diff --git a/src/platform/packages/shared/kbn-workflows/common/utils/zod/get_shape.ts b/src/platform/packages/shared/kbn-workflows/common/utils/zod/get_shape.ts index a7f6653eba6a9..83b51557f3e68 100644 --- a/src/platform/packages/shared/kbn-workflows/common/utils/zod/get_shape.ts +++ b/src/platform/packages/shared/kbn-workflows/common/utils/zod/get_shape.ts @@ -14,6 +14,12 @@ export function getShape(schema: z.ZodType): Record { if (current instanceof z.ZodOptional) { current = current.unwrap(); } + if (current instanceof z.ZodIntersection) { + return { + ...getShape(current.def.left as z.ZodType), + ...getShape(current.def.right as z.ZodType), + }; + } if (current instanceof z.ZodUnion) { return current.options.reduce((acc, option) => { return { ...acc, ...getShape(option as z.ZodType) }; diff --git a/src/platform/packages/shared/kbn-workflows/common/utils/zod/get_shape_at.test.ts b/src/platform/packages/shared/kbn-workflows/common/utils/zod/get_shape_at.test.ts index 21988f2bb17ae..6f986018628e2 100644 --- a/src/platform/packages/shared/kbn-workflows/common/utils/zod/get_shape_at.test.ts +++ b/src/platform/packages/shared/kbn-workflows/common/utils/zod/get_shape_at.test.ts @@ -33,4 +33,32 @@ describe('getShapeAt', () => { const atPath = getShapeAt(schema, 'path'); expect(atPath).toEqual({}); }); + + it('should return the shape at the given property in a union', () => { + const schema = z.union([ + z.object({ a: z.object({ b: z.string() }) }), + z.object({ c: z.object({ d: z.number() }) }), + ]); + const atA = getShapeAt(schema, 'a'); + expect(atA).toHaveProperty('b'); + expectZodSchemaEqual(atA.b, z.string()); + const atC = getShapeAt(schema, 'c'); + expect(atC).toHaveProperty('d'); + expectZodSchemaEqual(atC.d, z.number()); + }); + + it('should return the shape for a nested union', () => { + const schema = z.object({ + body: z.union([ + z.union([z.object({ a: z.string() }), z.object({ b: z.number() })]), + z.union([z.object({ c: z.boolean() }), z.object({ d: z.string() })]), + ]), + }); + const atBody = getShapeAt(schema, 'body'); + expect(Object.keys(atBody)).toEqual(['a', 'b', 'c', 'd']); + expectZodSchemaEqual(atBody.a, z.string()); + expectZodSchemaEqual(atBody.b, z.number()); + expectZodSchemaEqual(atBody.c, z.boolean()); + expectZodSchemaEqual(atBody.d, z.string()); + }); }); diff --git a/src/platform/packages/shared/kbn-workflows/common/utils/zod/get_shape_at.ts b/src/platform/packages/shared/kbn-workflows/common/utils/zod/get_shape_at.ts index 6504d8d713ebd..640f7f8525ca0 100644 --- a/src/platform/packages/shared/kbn-workflows/common/utils/zod/get_shape_at.ts +++ b/src/platform/packages/shared/kbn-workflows/common/utils/zod/get_shape_at.ts @@ -8,11 +8,11 @@ */ import { z } from '@kbn/zod/v4'; +import { getSchemaAtPath } from './get_schema_at_path'; import { getShape } from './get_shape'; -import { getZodObjectProperty } from './get_zod_object_property'; export function getShapeAt(schema: z.ZodType, property: string): Record { - const schemaAtProperty = getZodObjectProperty(schema, property); + const { schema: schemaAtProperty } = getSchemaAtPath(schema, property); if (schemaAtProperty === null) { return {}; } @@ -20,5 +20,5 @@ export function getShapeAt(schema: z.ZodType, property: string): Record fn(acc), openApiSpec); const config: UserConfig = { - input: KIBANA_SPEC_OPENAPI_PATH, + // @ts-expect-error - for some reason openapi-ts doesn't accept OpenAPIV3.Document + input: preprocessedOpenApiSpec, output: { path: OPENAPI_TS_OUTPUT_FOLDER_PATH, fileName: OPENAPI_TS_OUTPUT_FILENAME, diff --git a/src/platform/packages/shared/kbn-workflows/scripts/shared/generate_parameter_types.test.ts b/src/platform/packages/shared/kbn-workflows/scripts/shared/generate_parameter_types.test.ts index d3f180dc3be49..453e39d8202a7 100644 --- a/src/platform/packages/shared/kbn-workflows/scripts/shared/generate_parameter_types.test.ts +++ b/src/platform/packages/shared/kbn-workflows/scripts/shared/generate_parameter_types.test.ts @@ -143,4 +143,61 @@ describe('generateParameterTypes', () => { expect(parameterTypes.urlParams).toEqual(['queryParam']); expect(parameterTypes.bodyParams).toEqual(['bodyParam']); }); + it('should generate parameter types from an operation with oneOf in the request body', () => { + const operationWithOneOf: OpenAPIV3.OperationObject = { + requestBody: { + content: { + 'application/json': { + schema: { + oneOf: [ + { + $ref: '#/components/schemas/requestBodySchema1', + }, + { + $ref: '#/components/schemas/requestBodySchema2', + }, + ], + }, + }, + }, + }, + responses: { + '200': { + description: 'Success', + }, + }, + operationId: 'operationWithOneOf', + }; + const openApiDocument: OpenAPIV3.Document = { + openapi: '3.0.0', + info: { + title: 'Test API', + version: '1.0.0', + }, + paths: { + '{pathParam}/test': { + get: operationWithOneOf, + }, + }, + components: { + schemas: { + requestBodySchema1: { + type: 'object', + properties: { + bodyParam1: { type: 'string' }, + }, + }, + requestBodySchema2: { + type: 'object', + properties: { + bodyParam2: { type: 'string' }, + }, + }, + }, + }, + }; + const parameterTypes = generateParameterTypes([operationWithOneOf], openApiDocument); + expect(parameterTypes).toBeDefined(); + expect(parameterTypes.bodyParams).toEqual(['bodyParam1', 'bodyParam2']); + }); }); diff --git a/src/platform/packages/shared/kbn-workflows/scripts/shared/generate_parameter_types.ts b/src/platform/packages/shared/kbn-workflows/scripts/shared/generate_parameter_types.ts index 6545167f7669d..4549e3df12698 100644 --- a/src/platform/packages/shared/kbn-workflows/scripts/shared/generate_parameter_types.ts +++ b/src/platform/packages/shared/kbn-workflows/scripts/shared/generate_parameter_types.ts @@ -8,17 +8,13 @@ */ import type { OpenAPIV3 } from 'openapi-types'; +import type { ParameterTypes } from './types'; import { getOrResolveObject } from '../../common/utils'; export function generateParameterTypes( operations: OpenAPIV3.OperationObject[], openApiDocument: OpenAPIV3.Document -): { - headerParams: string[]; - pathParams: string[]; - urlParams: string[]; - bodyParams: string[]; -} { +): ParameterTypes { const allParameters = operations .flatMap((operation) => operation.parameters) .filter( @@ -36,6 +32,8 @@ export function generateParameterTypes( const urlParams = new Set( allParameters.filter((param) => param.in === 'query').map((param) => param.name) ); + + // Extract request body schemas and process them with the new recursive function const requestBodiesSchemas = operations .map((operation) => operation.requestBody) .filter( @@ -46,26 +44,18 @@ export function generateParameterTypes( getOrResolveObject(requestBody, openApiDocument) ) .filter((requestBody): requestBody is OpenAPIV3.RequestBodyObject => requestBody !== null) - .map((requestBody) => - getOrResolveObject( - requestBody.content['application/json']?.schema, - openApiDocument - ) - ) - .filter((schema): schema is OpenAPIV3.SchemaObject => schema !== null); + .map((requestBody) => requestBody.content?.['application/json']?.schema) + .filter( + (schema): schema is OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject => schema !== undefined + ); + + // Use the new recursive function to extract all properties const bodyParams = new Set( requestBodiesSchemas - .map((schema) => getOrResolveObject(schema, openApiDocument)) - .filter( - (schema): schema is OpenAPIV3.NonArraySchemaObject => - schema !== null && - typeof schema === 'object' && - 'properties' in schema && - schema.properties !== undefined - ) - .map((schema) => Object.keys(schema.properties ?? {})) + .map((schema) => extractPropertiesFromSchema(schema, openApiDocument)) .flat() ); + return { headerParams: Array.from(headerParams), pathParams: Array.from(pathParams), @@ -73,3 +63,69 @@ export function generateParameterTypes( bodyParams: Array.from(bodyParams), }; } + +export function generateParameterTypesForOperation( + operation: OpenAPIV3.OperationObject, + openApiDocument: OpenAPIV3.Document +): ParameterTypes { + const parameterTypes = generateParameterTypes([operation], openApiDocument); + return parameterTypes; +} + +/** + * Recursively extracts all property names from a schema, handling composition schemas + * like oneOf, allOf, anyOf as well as regular object schemas + */ +function extractPropertiesFromSchema( + schema: OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject, + openApiDocument: OpenAPIV3.Document, + visited: WeakSet = new WeakSet() +): string[] { + // Resolve references first + const resolvedSchema = getOrResolveObject(schema, openApiDocument); + if (!resolvedSchema || typeof resolvedSchema !== 'object') { + return []; + } + + // Prevent infinite recursion for circular references using object identity + if (visited.has(resolvedSchema)) { + return []; + } + visited.add(resolvedSchema); + + const properties: Set = new Set(); + + // Handle direct properties (object schema) + if ('properties' in resolvedSchema && resolvedSchema.properties) { + Object.keys(resolvedSchema.properties).forEach((key) => properties.add(key)); + } + + // Handle oneOf - union of all possible schemas + if ('oneOf' in resolvedSchema && Array.isArray(resolvedSchema.oneOf)) { + resolvedSchema.oneOf.forEach((subSchema) => { + extractPropertiesFromSchema(subSchema, openApiDocument, visited).forEach((prop) => + properties.add(prop) + ); + }); + } + + // Handle allOf - intersection of all schemas + if ('allOf' in resolvedSchema && Array.isArray(resolvedSchema.allOf)) { + resolvedSchema.allOf.forEach((subSchema) => { + extractPropertiesFromSchema(subSchema, openApiDocument, visited).forEach((prop) => + properties.add(prop) + ); + }); + } + + // Handle anyOf - similar to oneOf + if ('anyOf' in resolvedSchema && Array.isArray(resolvedSchema.anyOf)) { + resolvedSchema.anyOf.forEach((subSchema) => { + extractPropertiesFromSchema(subSchema, openApiDocument, visited).forEach((prop) => + properties.add(prop) + ); + }); + } + + return Array.from(properties); +} diff --git a/src/platform/packages/shared/kbn-workflows/scripts/shared/oas_align_default_with_enum.ts b/src/platform/packages/shared/kbn-workflows/scripts/shared/oas_align_default_with_enum.ts index 4787b5f9bcf87..8497d7397ea8d 100644 --- a/src/platform/packages/shared/kbn-workflows/scripts/shared/oas_align_default_with_enum.ts +++ b/src/platform/packages/shared/kbn-workflows/scripts/shared/oas_align_default_with_enum.ts @@ -47,7 +47,6 @@ export function alignDefaultWithEnum(document: OpenAPIV3.Document) { ), ], }; - console.log(key, JSON.stringify(extendedValue, null, 2)); return [key, extendedValue]; }) ); diff --git a/src/platform/packages/shared/kbn-workflows/scripts/shared/oas_remove_discriminators_with_invalid_mapping.ts b/src/platform/packages/shared/kbn-workflows/scripts/shared/oas_remove_discriminators_with_invalid_mapping.ts new file mode 100644 index 0000000000000..cdd4e49711adf --- /dev/null +++ b/src/platform/packages/shared/kbn-workflows/scripts/shared/oas_remove_discriminators_with_invalid_mapping.ts @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import type { OpenAPIV3 } from 'openapi-types'; + +// In order to generate valid zod schemas, we need to remove discriminators from the all components/schemas +// if their mapping doesn't have the same number of items as the oneOf array +// https://github.com/hey-api/openapi-ts/issues/3020 +export function removeDiscriminatorsWithInvalidMapping(document: OpenAPIV3.Document) { + if (!document.components || !document.components.schemas) { + return document; + } + document.components.schemas = Object.fromEntries( + Object.entries(document.components.schemas).map(([key, value]) => { + if ('$ref' in value) { + return [key, value]; + } + if (value.discriminator && Object.keys(value.discriminator.mapping ?? {}).length > 0) { + if (value.oneOf) { + const oneOfCount = value.oneOf.length; + const mappingCount = Object.keys(value.discriminator.mapping ?? {}).length; + if (oneOfCount !== mappingCount) { + console.warn( + `Discriminator ${key} has invalid mapping: mapping has ${mappingCount} items, but oneOf has ${oneOfCount} items, removing it` + ); + delete value.discriminator; + } + } + } + return [key, value]; + }) + ); + return document; +} diff --git a/src/platform/packages/shared/kbn-workflows/scripts/shared/oas_remove_discriminators_without_mapping.ts b/src/platform/packages/shared/kbn-workflows/scripts/shared/oas_remove_discriminators_without_mapping.ts index e7251a0b54abc..872d0678c4e1d 100644 --- a/src/platform/packages/shared/kbn-workflows/scripts/shared/oas_remove_discriminators_without_mapping.ts +++ b/src/platform/packages/shared/kbn-workflows/scripts/shared/oas_remove_discriminators_without_mapping.ts @@ -21,6 +21,7 @@ export function removeDiscriminatorsWithoutMapping(document: OpenAPIV3.Document) return [key, value]; } if (value.discriminator && !value.discriminator.mapping) { + console.warn(`Discriminator ${key} has no mapping, removing it`); delete value.discriminator; } return [key, value]; diff --git a/src/platform/packages/shared/kbn-workflows/scripts/shared/types.ts b/src/platform/packages/shared/kbn-workflows/scripts/shared/types.ts index 6eda106a7ac50..cafc019c3fcb2 100644 --- a/src/platform/packages/shared/kbn-workflows/scripts/shared/types.ts +++ b/src/platform/packages/shared/kbn-workflows/scripts/shared/types.ts @@ -24,3 +24,10 @@ export interface ContractMeta export interface OperationObjectWithOperationId extends OpenAPIV3.OperationObject { operationId: string; } + +export interface ParameterTypes { + headerParams: string[]; + pathParams: string[]; + urlParams: string[]; + bodyParams: string[]; +} diff --git a/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/elasticsearch.indices_put_data_lifecycle.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/elasticsearch.indices_put_data_lifecycle.gen.ts index 78b88ffdc6278..647afe026ff01 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/elasticsearch.indices_put_data_lifecycle.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/elasticsearch.indices_put_data_lifecycle.gen.ts @@ -43,7 +43,7 @@ Update the data stream lifecycle of the specified data streams. headerParams: [], pathParams: ['name'], urlParams: ['expand_wildcards', 'master_timeout', 'timeout'], - bodyParams: ['data_retention', 'downsampling', 'enabled'], + bodyParams: ['data_retention', 'downsampling', 'downsampling_method', 'enabled'], }, paramsSchema: z.object({ ...getShapeAt(indices_put_data_lifecycle_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/elasticsearch.ingest_put_ip_location_database.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/elasticsearch.ingest_put_ip_location_database.gen.ts index a2d6963cf1937..ac7503b90cf86 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/elasticsearch.ingest_put_ip_location_database.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/elasticsearch.ingest_put_ip_location_database.gen.ts @@ -41,7 +41,7 @@ export const INGEST_PUT_IP_LOCATION_DATABASE_CONTRACT: InternalConnectorContract headerParams: [], pathParams: ['id'], urlParams: ['master_timeout', 'timeout'], - bodyParams: [], + bodyParams: ['name', 'maxmind', 'ipinfo'], }, paramsSchema: z.object({ ...getShapeAt(ingest_put_ip_location_database_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/elasticsearch.snapshot_create_repository.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/elasticsearch.snapshot_create_repository.gen.ts index 264a017f68296..e4c283858e6e4 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/elasticsearch.snapshot_create_repository.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/elasticsearch.snapshot_create_repository.gen.ts @@ -50,7 +50,7 @@ If both parameters are specified, only the query parameter is used. headerParams: [], pathParams: ['repository'], urlParams: ['master_timeout', 'timeout', 'verify'], - bodyParams: [], + bodyParams: ['uuid', 'type', 'settings'], }, paramsSchema: z.union([ z.object({ diff --git a/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/index.ts b/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/index.ts index bc124fcf3087e..7ca821a1692a3 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/index.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/index.ts @@ -10,8 +10,8 @@ /* * AUTO-GENERATED FILE - DO NOT EDIT * - * This file contains Elasticsearch connector definitions generated from elasticsearch-specification repository. - * Generated at: 2025-12-07T11:53:20.177Z + * This file contains Elasticsearch connector definitions generated from elasticsearch-specification repository (https://github.com/elastic/elasticsearch-specification/commit/6566f69). + * Generated at: 2025-12-08T09:07:02.910Z * Source: elasticsearch-specification repository (577 APIs) * * To regenerate: node scripts/generate_workflow_es_contracts.js diff --git a/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/schemas/es_openapi_zod.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/schemas/es_openapi_zod.gen.ts index 74991766708b6..cbab5aa2f7610 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/schemas/es_openapi_zod.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/elasticsearch/generated/schemas/es_openapi_zod.gen.ts @@ -1,12 +1,3 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - // This file is auto-generated by @hey-api/openapi-ts import { z } from '@kbn/zod/v4'; @@ -14,284 +5,311 @@ import { z } from '@kbn/zod/v4'; export const types_id = z.string(); export const types_acknowledged_response_base = z.object({ - acknowledged: z.boolean().register(z.globalRegistry, { - description: - 'For a successful response, this value is always true. On failure, an exception is returned instead.', - }), + acknowledged: z.boolean().register(z.globalRegistry, { + description: 'For a successful response, this value is always true. On failure, an exception is returned instead.' + }) }); /** * A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and * `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. */ -export const types_duration = z.union([z.string(), z.enum(['-1']), z.enum(['0'])]); +export const types_duration = z.union([ + z.string(), + z.enum(['-1']), + z.enum(['0']) +]); export const types_metadata = z.record(z.string(), z.record(z.string(), z.unknown())); export const types_aggregations_aggregate_base = z.object({ - meta: z.optional(types_metadata), + meta: z.optional(types_metadata) }); -export const types_aggregations_cardinality_aggregate = types_aggregations_aggregate_base.and( - z.object({ - value: z.number(), - }) -); +export const types_aggregations_cardinality_aggregate = types_aggregations_aggregate_base.and(z.object({ + value: z.number() +})); -export const types_aggregations_keyed_percentiles = z.record( - z.string(), - z.union([z.string(), z.number(), z.null()]) -); +export const types_aggregations_keyed_percentiles = z.record(z.string(), z.union([ + z.string(), + z.number(), + z.null() +])); export const types_aggregations_array_percentiles_item = z.object({ - key: z.number(), - value: z.union([z.number(), z.string(), z.null()]), - value_as_string: z.optional(z.string()), + key: z.number(), + value: z.union([ + z.number(), + z.string(), + z.null() + ]), + value_as_string: z.optional(z.string()) }); export const types_aggregations_percentiles = z.union([ - types_aggregations_keyed_percentiles, - z.array(types_aggregations_array_percentiles_item), + types_aggregations_keyed_percentiles, + z.array(types_aggregations_array_percentiles_item) ]); -export const types_aggregations_percentiles_aggregate_base = types_aggregations_aggregate_base.and( - z.object({ - values: types_aggregations_percentiles, - }) -); +export const types_aggregations_percentiles_aggregate_base = types_aggregations_aggregate_base.and(z.object({ + values: types_aggregations_percentiles +})); -export const types_aggregations_hdr_percentiles_aggregate = - types_aggregations_percentiles_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_hdr_percentiles_aggregate = types_aggregations_percentiles_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_hdr_percentile_ranks_aggregate = - types_aggregations_percentiles_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_hdr_percentile_ranks_aggregate = types_aggregations_percentiles_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_t_digest_percentiles_aggregate = - types_aggregations_percentiles_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_t_digest_percentiles_aggregate = types_aggregations_percentiles_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_t_digest_percentile_ranks_aggregate = - types_aggregations_percentiles_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_t_digest_percentile_ranks_aggregate = types_aggregations_percentiles_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_percentiles_bucket_aggregate = - types_aggregations_percentiles_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_percentiles_bucket_aggregate = types_aggregations_percentiles_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_single_metric_aggregate_base = - types_aggregations_aggregate_base.and( - z.object({ - value: z.union([z.number(), z.string(), z.null()]), - value_as_string: z.optional(z.string()), - }) - ); +export const types_aggregations_single_metric_aggregate_base = types_aggregations_aggregate_base.and(z.object({ + value: z.union([ + z.number(), + z.string(), + z.null() + ]), + value_as_string: z.optional(z.string()) +})); -export const types_aggregations_median_absolute_deviation_aggregate = - types_aggregations_single_metric_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_median_absolute_deviation_aggregate = types_aggregations_single_metric_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_min_aggregate = types_aggregations_single_metric_aggregate_base.and( - z.record(z.string(), z.unknown()) -); +export const types_aggregations_min_aggregate = types_aggregations_single_metric_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_max_aggregate = types_aggregations_single_metric_aggregate_base.and( - z.record(z.string(), z.unknown()) -); +export const types_aggregations_max_aggregate = types_aggregations_single_metric_aggregate_base.and(z.record(z.string(), z.unknown())); /** * Sum aggregation result. `value` is always present and is zero if there were no values to process. */ -export const types_aggregations_sum_aggregate = types_aggregations_single_metric_aggregate_base.and( - z.record(z.string(), z.unknown()) -); +export const types_aggregations_sum_aggregate = types_aggregations_single_metric_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_avg_aggregate = types_aggregations_single_metric_aggregate_base.and( - z.record(z.string(), z.unknown()) -); +export const types_aggregations_avg_aggregate = types_aggregations_single_metric_aggregate_base.and(z.record(z.string(), z.unknown())); /** * Weighted average aggregation result. `value` is missing if the weight was set to zero. */ -export const types_aggregations_weighted_avg_aggregate = - types_aggregations_single_metric_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_weighted_avg_aggregate = types_aggregations_single_metric_aggregate_base.and(z.record(z.string(), z.unknown())); /** * Value count aggregation result. `value` is always present. */ -export const types_aggregations_value_count_aggregate = - types_aggregations_single_metric_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_value_count_aggregate = types_aggregations_single_metric_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_simple_value_aggregate = - types_aggregations_single_metric_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_simple_value_aggregate = types_aggregations_single_metric_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_derivative_aggregate = - types_aggregations_single_metric_aggregate_base.and( - z.object({ - normalized_value: z.optional(z.number()), - normalized_value_as_string: z.optional(z.string()), - }) - ); +export const types_aggregations_derivative_aggregate = types_aggregations_single_metric_aggregate_base.and(z.object({ + normalized_value: z.optional(z.number()), + normalized_value_as_string: z.optional(z.string()) +})); -export const types_aggregations_bucket_metric_value_aggregate = - types_aggregations_single_metric_aggregate_base.and( - z.object({ - keys: z.array(z.string()), - }) - ); +export const types_aggregations_bucket_metric_value_aggregate = types_aggregations_single_metric_aggregate_base.and(z.object({ + keys: z.array(z.string()) +})); export const types_aggregations_abstract_change_point = z.object({ - p_value: z.number(), - change_point: z.number(), + p_value: z.number(), + change_point: z.number() }); -export const types_aggregations_dip = types_aggregations_abstract_change_point.and( - z.record(z.string(), z.unknown()) -); +export const types_aggregations_dip = types_aggregations_abstract_change_point.and(z.record(z.string(), z.unknown())); -export const types_aggregations_distribution_change = types_aggregations_abstract_change_point.and( - z.record(z.string(), z.unknown()) -); +export const types_aggregations_distribution_change = types_aggregations_abstract_change_point.and(z.record(z.string(), z.unknown())); export const types_aggregations_indeterminable = z.object({ - reason: z.string(), + reason: z.string() }); export const types_aggregations_non_stationary = z.object({ - p_value: z.number(), - r_value: z.number(), - trend: z.string(), + p_value: z.number(), + r_value: z.number(), + trend: z.string() }); -export const types_aggregations_spike = types_aggregations_abstract_change_point.and( - z.record(z.string(), z.unknown()) -); +export const types_aggregations_spike = types_aggregations_abstract_change_point.and(z.record(z.string(), z.unknown())); export const types_aggregations_stationary = z.record(z.string(), z.unknown()); -export const types_aggregations_step_change = types_aggregations_abstract_change_point.and( - z.record(z.string(), z.unknown()) -); +export const types_aggregations_step_change = types_aggregations_abstract_change_point.and(z.record(z.string(), z.unknown())); export const types_aggregations_trend_change = z.object({ - p_value: z.number(), - r_value: z.number(), - change_point: z.number(), + p_value: z.number(), + r_value: z.number(), + change_point: z.number() }); export const types_aggregations_change_type = z.object({ - dip: z.optional(types_aggregations_dip), - distribution_change: z.optional(types_aggregations_distribution_change), - indeterminable: z.optional(types_aggregations_indeterminable), - non_stationary: z.optional(types_aggregations_non_stationary), - spike: z.optional(types_aggregations_spike), - stationary: z.optional(types_aggregations_stationary), - step_change: z.optional(types_aggregations_step_change), - trend_change: z.optional(types_aggregations_trend_change), + dip: z.optional(types_aggregations_dip), + distribution_change: z.optional(types_aggregations_distribution_change), + indeterminable: z.optional(types_aggregations_indeterminable), + non_stationary: z.optional(types_aggregations_non_stationary), + spike: z.optional(types_aggregations_spike), + stationary: z.optional(types_aggregations_stationary), + step_change: z.optional(types_aggregations_step_change), + trend_change: z.optional(types_aggregations_trend_change) }); /** * A field value. */ -export const types_field_value = z.union([z.number(), z.string(), z.boolean(), z.null()]); +export const types_field_value = z.union([ + z.number(), + z.string(), + z.boolean(), + z.null() +]); /** * Base type for multi-bucket aggregation results that can hold sub-aggregations results. */ -export const types_aggregations_multi_bucket_base = z - .object({ - doc_count: z.number(), - }) - .register(z.globalRegistry, { - description: - 'Base type for multi-bucket aggregation results that can hold sub-aggregations results.', - }); - -export const types_aggregations_change_point_bucket = types_aggregations_multi_bucket_base.and( - z.object({ - key: types_field_value, - }) -); - -export const types_aggregations_change_point_aggregate = types_aggregations_aggregate_base.and( - z.object({ +export const types_aggregations_multi_bucket_base = z.object({ + doc_count: z.number() +}).register(z.globalRegistry, { + description: 'Base type for multi-bucket aggregation results that can hold sub-aggregations results.' +}); + +export const types_aggregations_change_point_bucket = types_aggregations_multi_bucket_base.and(z.object({ + key: types_field_value +})); + +export const types_aggregations_change_point_aggregate = types_aggregations_aggregate_base.and(z.object({ type: types_aggregations_change_type, - bucket: z.optional(types_aggregations_change_point_bucket), - }) -); + bucket: z.optional(types_aggregations_change_point_bucket) +})); /** * Statistics aggregation result. `min`, `max` and `avg` are missing if there were no values to process * (`count` is zero). */ -export const types_aggregations_stats_aggregate = types_aggregations_aggregate_base.and( - z.object({ +export const types_aggregations_stats_aggregate = types_aggregations_aggregate_base.and(z.object({ count: z.number(), - min: z.union([z.number(), z.string(), z.null()]), - max: z.union([z.number(), z.string(), z.null()]), - avg: z.union([z.number(), z.string(), z.null()]), + min: z.union([ + z.number(), + z.string(), + z.null() + ]), + max: z.union([ + z.number(), + z.string(), + z.null() + ]), + avg: z.union([ + z.number(), + z.string(), + z.null() + ]), sum: z.number(), min_as_string: z.optional(z.string()), max_as_string: z.optional(z.string()), avg_as_string: z.optional(z.string()), - sum_as_string: z.optional(z.string()), - }) -); + sum_as_string: z.optional(z.string()) +})); -export const types_aggregations_stats_bucket_aggregate = types_aggregations_stats_aggregate.and( - z.record(z.string(), z.unknown()) -); +export const types_aggregations_stats_bucket_aggregate = types_aggregations_stats_aggregate.and(z.record(z.string(), z.unknown())); export const types_aggregations_standard_deviation_bounds = z.object({ - upper: z.union([z.number(), z.string(), z.null()]), - lower: z.union([z.number(), z.string(), z.null()]), - upper_population: z.union([z.number(), z.string(), z.null()]), - lower_population: z.union([z.number(), z.string(), z.null()]), - upper_sampling: z.union([z.number(), z.string(), z.null()]), - lower_sampling: z.union([z.number(), z.string(), z.null()]), + upper: z.union([ + z.number(), + z.string(), + z.null() + ]), + lower: z.union([ + z.number(), + z.string(), + z.null() + ]), + upper_population: z.union([ + z.number(), + z.string(), + z.null() + ]), + lower_population: z.union([ + z.number(), + z.string(), + z.null() + ]), + upper_sampling: z.union([ + z.number(), + z.string(), + z.null() + ]), + lower_sampling: z.union([ + z.number(), + z.string(), + z.null() + ]) }); export const types_aggregations_standard_deviation_bounds_as_string = z.object({ - upper: z.string(), - lower: z.string(), - upper_population: z.string(), - lower_population: z.string(), - upper_sampling: z.string(), - lower_sampling: z.string(), -}); - -export const types_aggregations_extended_stats_aggregate = types_aggregations_stats_aggregate.and( - z.object({ - sum_of_squares: z.union([z.number(), z.string(), z.null()]), - variance: z.union([z.number(), z.string(), z.null()]), - variance_population: z.union([z.number(), z.string(), z.null()]), - variance_sampling: z.union([z.number(), z.string(), z.null()]), - std_deviation: z.union([z.number(), z.string(), z.null()]), - std_deviation_population: z.union([z.number(), z.string(), z.null()]), - std_deviation_sampling: z.union([z.number(), z.string(), z.null()]), + upper: z.string(), + lower: z.string(), + upper_population: z.string(), + lower_population: z.string(), + upper_sampling: z.string(), + lower_sampling: z.string() +}); + +export const types_aggregations_extended_stats_aggregate = types_aggregations_stats_aggregate.and(z.object({ + sum_of_squares: z.union([ + z.number(), + z.string(), + z.null() + ]), + variance: z.union([ + z.number(), + z.string(), + z.null() + ]), + variance_population: z.union([ + z.number(), + z.string(), + z.null() + ]), + variance_sampling: z.union([ + z.number(), + z.string(), + z.null() + ]), + std_deviation: z.union([ + z.number(), + z.string(), + z.null() + ]), + std_deviation_population: z.union([ + z.number(), + z.string(), + z.null() + ]), + std_deviation_sampling: z.union([ + z.number(), + z.string(), + z.null() + ]), std_deviation_bounds: z.optional(types_aggregations_standard_deviation_bounds), sum_of_squares_as_string: z.optional(z.string()), variance_as_string: z.optional(z.string()), variance_population_as_string: z.optional(z.string()), variance_sampling_as_string: z.optional(z.string()), std_deviation_as_string: z.optional(z.string()), - std_deviation_bounds_as_string: z.optional( - types_aggregations_standard_deviation_bounds_as_string - ), - }) -); + std_deviation_bounds_as_string: z.optional(types_aggregations_standard_deviation_bounds_as_string) +})); -export const types_aggregations_extended_stats_bucket_aggregate = - types_aggregations_extended_stats_aggregate.and(z.record(z.string(), z.unknown())); +export const types_aggregations_extended_stats_bucket_aggregate = types_aggregations_extended_stats_aggregate.and(z.record(z.string(), z.unknown())); export const types_lat_lon_geo_location = z.object({ - lat: z.number().register(z.globalRegistry, { - description: 'Latitude', - }), - lon: z.number().register(z.globalRegistry, { - description: 'Longitude', - }), + lat: z.number().register(z.globalRegistry, { + description: 'Latitude' + }), + lon: z.number().register(z.globalRegistry, { + description: 'Longitude' + }) }); export const types_geo_hash = z.string(); export const types_geo_hash_location = z.object({ - geohash: types_geo_hash, + geohash: types_geo_hash }); /** @@ -302,50 +320,45 @@ export const types_geo_hash_location = z.object({ * - as a string in `", "` or WKT point formats */ export const types_geo_location = z.union([ - types_lat_lon_geo_location, - types_geo_hash_location, - z.array(z.number()), - z.string(), + types_lat_lon_geo_location, + types_geo_hash_location, + z.array(z.number()), + z.string() ]); export const types_top_left_bottom_right_geo_bounds = z.object({ - top_left: types_geo_location, - bottom_right: types_geo_location, + top_left: types_geo_location, + bottom_right: types_geo_location }); -export const types_aggregations_cartesian_bounds_aggregate = types_aggregations_aggregate_base.and( - z.object({ - bounds: z.optional(types_top_left_bottom_right_geo_bounds), - }) -); +export const types_aggregations_cartesian_bounds_aggregate = types_aggregations_aggregate_base.and(z.object({ + bounds: z.optional(types_top_left_bottom_right_geo_bounds) +})); export const types_cartesian_point = z.object({ - x: z.number(), - y: z.number(), + x: z.number(), + y: z.number() }); -export const types_aggregations_cartesian_centroid_aggregate = - types_aggregations_aggregate_base.and( - z.object({ - count: z.number(), - location: z.optional(types_cartesian_point), - }) - ); +export const types_aggregations_cartesian_centroid_aggregate = types_aggregations_aggregate_base.and(z.object({ + count: z.number(), + location: z.optional(types_cartesian_point) +})); export const types_coords_geo_bounds = z.object({ - top: z.number(), - bottom: z.number(), - left: z.number(), - right: z.number(), + top: z.number(), + bottom: z.number(), + left: z.number(), + right: z.number() }); export const types_top_right_bottom_left_geo_bounds = z.object({ - top_right: types_geo_location, - bottom_left: types_geo_location, + top_right: types_geo_location, + bottom_left: types_geo_location }); export const types_wkt_geo_bounds = z.object({ - wkt: z.string(), + wkt: z.string() }); /** @@ -356,258 +369,192 @@ export const types_wkt_geo_bounds = z.object({ * - as a WKT bounding box */ export const types_geo_bounds = z.union([ - types_coords_geo_bounds, - types_top_left_bottom_right_geo_bounds, - types_top_right_bottom_left_geo_bounds, - types_wkt_geo_bounds, + types_coords_geo_bounds, + types_top_left_bottom_right_geo_bounds, + types_top_right_bottom_left_geo_bounds, + types_wkt_geo_bounds ]); -export const types_aggregations_geo_bounds_aggregate = types_aggregations_aggregate_base.and( - z.object({ - bounds: z.optional(types_geo_bounds), - }) -); +export const types_aggregations_geo_bounds_aggregate = types_aggregations_aggregate_base.and(z.object({ + bounds: z.optional(types_geo_bounds) +})); -export const types_aggregations_geo_centroid_aggregate = types_aggregations_aggregate_base.and( - z.object({ +export const types_aggregations_geo_centroid_aggregate = types_aggregations_aggregate_base.and(z.object({ count: z.number(), - location: z.optional(types_geo_location), - }) -); + location: z.optional(types_geo_location) +})); -export const types_aggregations_histogram_bucket = types_aggregations_multi_bucket_base.and( - z.object({ +export const types_aggregations_histogram_bucket = types_aggregations_multi_bucket_base.and(z.object({ key_as_string: z.optional(z.string()), - key: z.number(), - }) -); + key: z.number() +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_histogram_bucket = z.union([ - z.record(z.string(), types_aggregations_histogram_bucket), - z.array(types_aggregations_histogram_bucket), + z.record(z.string(), types_aggregations_histogram_bucket), + z.array(types_aggregations_histogram_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_histogram_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_histogram_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_histogram_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_histogram_bucket +})); -export const types_aggregations_histogram_aggregate = - types_aggregations_multi_bucket_aggregate_base_histogram_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_histogram_aggregate = types_aggregations_multi_bucket_aggregate_base_histogram_bucket.and(z.record(z.string(), z.unknown())); /** * Time unit for milliseconds */ export const types_unit_millis = z.number().register(z.globalRegistry, { - description: 'Time unit for milliseconds', + description: 'Time unit for milliseconds' }); export const types_epoch_time_unit_millis = types_unit_millis; -export const types_aggregations_date_histogram_bucket = types_aggregations_multi_bucket_base.and( - z.object({ +export const types_aggregations_date_histogram_bucket = types_aggregations_multi_bucket_base.and(z.object({ key_as_string: z.optional(z.string()), - key: types_epoch_time_unit_millis, - }) -); + key: types_epoch_time_unit_millis +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_date_histogram_bucket = z.union([ - z.record(z.string(), types_aggregations_date_histogram_bucket), - z.array(types_aggregations_date_histogram_bucket), + z.record(z.string(), types_aggregations_date_histogram_bucket), + z.array(types_aggregations_date_histogram_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_date_histogram_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_date_histogram_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_date_histogram_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_date_histogram_bucket +})); -export const types_aggregations_date_histogram_aggregate = - types_aggregations_multi_bucket_aggregate_base_date_histogram_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_date_histogram_aggregate = types_aggregations_multi_bucket_aggregate_base_date_histogram_bucket.and(z.record(z.string(), z.unknown())); /** * A date histogram interval. Similar to `Duration` with additional units: `w` (week), `M` (month), `q` (quarter) and * `y` (year) */ export const types_duration_large = z.string().register(z.globalRegistry, { - description: - 'A date histogram interval. Similar to `Duration` with additional units: `w` (week), `M` (month), `q` (quarter) and\n`y` (year)', + description: 'A date histogram interval. Similar to `Duration` with additional units: `w` (week), `M` (month), `q` (quarter) and\n`y` (year)' }); -export const types_aggregations_auto_date_histogram_aggregate = - types_aggregations_multi_bucket_aggregate_base_date_histogram_bucket.and( - z.object({ - interval: types_duration_large, - }) - ); +export const types_aggregations_auto_date_histogram_aggregate = types_aggregations_multi_bucket_aggregate_base_date_histogram_bucket.and(z.object({ + interval: types_duration_large +})); -export const types_aggregations_variable_width_histogram_bucket = - types_aggregations_multi_bucket_base.and( - z.object({ - min: z.number(), - key: z.number(), - max: z.number(), - min_as_string: z.optional(z.string()), - key_as_string: z.optional(z.string()), - max_as_string: z.optional(z.string()), - }) - ); +export const types_aggregations_variable_width_histogram_bucket = types_aggregations_multi_bucket_base.and(z.object({ + min: z.number(), + key: z.number(), + max: z.number(), + min_as_string: z.optional(z.string()), + key_as_string: z.optional(z.string()), + max_as_string: z.optional(z.string()) +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_variable_width_histogram_bucket = z.union([ - z.record(z.string(), types_aggregations_variable_width_histogram_bucket), - z.array(types_aggregations_variable_width_histogram_bucket), + z.record(z.string(), types_aggregations_variable_width_histogram_bucket), + z.array(types_aggregations_variable_width_histogram_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_variable_width_histogram_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_variable_width_histogram_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_variable_width_histogram_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_variable_width_histogram_bucket +})); -export const types_aggregations_variable_width_histogram_aggregate = - types_aggregations_multi_bucket_aggregate_base_variable_width_histogram_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_variable_width_histogram_aggregate = types_aggregations_multi_bucket_aggregate_base_variable_width_histogram_bucket.and(z.record(z.string(), z.unknown())); -export const types_aggregations_terms_bucket_base = types_aggregations_multi_bucket_base.and( - z.object({ - doc_count_error_upper_bound: z.optional(z.number()), - }) -); +export const types_aggregations_terms_bucket_base = types_aggregations_multi_bucket_base.and(z.object({ + doc_count_error_upper_bound: z.optional(z.number()) +})); -export const types_aggregations_string_terms_bucket = types_aggregations_terms_bucket_base.and( - z.object({ - key: types_field_value, - }) -); +export const types_aggregations_string_terms_bucket = types_aggregations_terms_bucket_base.and(z.object({ + key: types_field_value +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_string_terms_bucket = z.union([ - z.record(z.string(), types_aggregations_string_terms_bucket), - z.array(types_aggregations_string_terms_bucket), + z.record(z.string(), types_aggregations_string_terms_bucket), + z.array(types_aggregations_string_terms_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_string_terms_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_string_terms_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_string_terms_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_string_terms_bucket +})); -export const types_aggregations_terms_aggregate_base_string_terms_bucket = - types_aggregations_multi_bucket_aggregate_base_string_terms_bucket.and( - z.object({ - doc_count_error_upper_bound: z.optional(z.number()), - sum_other_doc_count: z.optional(z.number()), - }) - ); +export const types_aggregations_terms_aggregate_base_string_terms_bucket = types_aggregations_multi_bucket_aggregate_base_string_terms_bucket.and(z.object({ + doc_count_error_upper_bound: z.optional(z.number()), + sum_other_doc_count: z.optional(z.number()) +})); /** * Result of a `terms` aggregation when the field is a string. */ -export const types_aggregations_string_terms_aggregate = - types_aggregations_terms_aggregate_base_string_terms_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_string_terms_aggregate = types_aggregations_terms_aggregate_base_string_terms_bucket.and(z.record(z.string(), z.unknown())); -export const types_aggregations_long_terms_bucket = types_aggregations_terms_bucket_base.and( - z.object({ +export const types_aggregations_long_terms_bucket = types_aggregations_terms_bucket_base.and(z.object({ key: z.number(), - key_as_string: z.optional(z.string()), - }) -); + key_as_string: z.optional(z.string()) +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_long_terms_bucket = z.union([ - z.record(z.string(), types_aggregations_long_terms_bucket), - z.array(types_aggregations_long_terms_bucket), + z.record(z.string(), types_aggregations_long_terms_bucket), + z.array(types_aggregations_long_terms_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_long_terms_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_long_terms_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_long_terms_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_long_terms_bucket +})); -export const types_aggregations_terms_aggregate_base_long_terms_bucket = - types_aggregations_multi_bucket_aggregate_base_long_terms_bucket.and( - z.object({ - doc_count_error_upper_bound: z.optional(z.number()), - sum_other_doc_count: z.optional(z.number()), - }) - ); +export const types_aggregations_terms_aggregate_base_long_terms_bucket = types_aggregations_multi_bucket_aggregate_base_long_terms_bucket.and(z.object({ + doc_count_error_upper_bound: z.optional(z.number()), + sum_other_doc_count: z.optional(z.number()) +})); /** * Result of a `terms` aggregation when the field is some kind of whole number like a integer, long, or a date. */ -export const types_aggregations_long_terms_aggregate = - types_aggregations_terms_aggregate_base_long_terms_bucket.and(z.record(z.string(), z.unknown())); +export const types_aggregations_long_terms_aggregate = types_aggregations_terms_aggregate_base_long_terms_bucket.and(z.record(z.string(), z.unknown())); -export const types_aggregations_double_terms_bucket = types_aggregations_terms_bucket_base.and( - z.object({ +export const types_aggregations_double_terms_bucket = types_aggregations_terms_bucket_base.and(z.object({ key: z.number(), - key_as_string: z.optional(z.string()), - }) -); + key_as_string: z.optional(z.string()) +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_double_terms_bucket = z.union([ - z.record(z.string(), types_aggregations_double_terms_bucket), - z.array(types_aggregations_double_terms_bucket), + z.record(z.string(), types_aggregations_double_terms_bucket), + z.array(types_aggregations_double_terms_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_double_terms_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_double_terms_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_double_terms_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_double_terms_bucket +})); -export const types_aggregations_terms_aggregate_base_double_terms_bucket = - types_aggregations_multi_bucket_aggregate_base_double_terms_bucket.and( - z.object({ - doc_count_error_upper_bound: z.optional(z.number()), - sum_other_doc_count: z.optional(z.number()), - }) - ); +export const types_aggregations_terms_aggregate_base_double_terms_bucket = types_aggregations_multi_bucket_aggregate_base_double_terms_bucket.and(z.object({ + doc_count_error_upper_bound: z.optional(z.number()), + sum_other_doc_count: z.optional(z.number()) +})); /** * Result of a `terms` aggregation when the field is some kind of decimal number like a float, double, or distance. */ -export const types_aggregations_double_terms_aggregate = - types_aggregations_terms_aggregate_base_double_terms_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_double_terms_aggregate = types_aggregations_terms_aggregate_base_double_terms_bucket.and(z.record(z.string(), z.unknown())); /** * The absence of any type. This is commonly used in APIs that don't return a body. @@ -618,8 +565,7 @@ export const types_aggregations_double_terms_aggregate = * See https://en.m.wikipedia.org/wiki/Unit_type and https://en.m.wikipedia.org/wiki/Bottom_type */ export const spec_utils_void = z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'The absence of any type. This is commonly used in APIs that don\'t return a body.\n\nAlthough "void" is generally used for the unit type that has only one value, this is to be interpreted as\nthe bottom type that has no value at all. Most languages have a unit type, but few have a bottom type.\n\nSee https://en.m.wikipedia.org/wiki/Unit_type and https://en.m.wikipedia.org/wiki/Bottom_type', + description: 'The absence of any type. This is commonly used in APIs that don\'t return a body.\n\nAlthough "void" is generally used for the unit type that has only one value, this is to be interpreted as\nthe bottom type that has no value at all. Most languages have a unit type, but few have a bottom type.\n\nSee https://en.m.wikipedia.org/wiki/Unit_type and https://en.m.wikipedia.org/wiki/Bottom_type' }); /** @@ -627,653 +573,479 @@ export const spec_utils_void = z.record(z.string(), z.unknown()).register(z.glob * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_void = z.union([ - z.record(z.string(), spec_utils_void), - z.array(spec_utils_void), + z.record(z.string(), spec_utils_void), + z.array(spec_utils_void) ]); -export const types_aggregations_multi_bucket_aggregate_base_void = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_void, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_void = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_void +})); -export const types_aggregations_terms_aggregate_base_void = - types_aggregations_multi_bucket_aggregate_base_void.and( - z.object({ - doc_count_error_upper_bound: z.optional(z.number()), - sum_other_doc_count: z.optional(z.number()), - }) - ); +export const types_aggregations_terms_aggregate_base_void = types_aggregations_multi_bucket_aggregate_base_void.and(z.object({ + doc_count_error_upper_bound: z.optional(z.number()), + sum_other_doc_count: z.optional(z.number()) +})); /** * Result of a `terms` aggregation when the field is unmapped. `buckets` is always empty. */ -export const types_aggregations_unmapped_terms_aggregate = - types_aggregations_terms_aggregate_base_void.and(z.record(z.string(), z.unknown())); +export const types_aggregations_unmapped_terms_aggregate = types_aggregations_terms_aggregate_base_void.and(z.record(z.string(), z.unknown())); -export const types_aggregations_long_rare_terms_bucket = types_aggregations_multi_bucket_base.and( - z.object({ +export const types_aggregations_long_rare_terms_bucket = types_aggregations_multi_bucket_base.and(z.object({ key: z.number(), - key_as_string: z.optional(z.string()), - }) -); + key_as_string: z.optional(z.string()) +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_long_rare_terms_bucket = z.union([ - z.record(z.string(), types_aggregations_long_rare_terms_bucket), - z.array(types_aggregations_long_rare_terms_bucket), + z.record(z.string(), types_aggregations_long_rare_terms_bucket), + z.array(types_aggregations_long_rare_terms_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_long_rare_terms_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_long_rare_terms_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_long_rare_terms_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_long_rare_terms_bucket +})); /** * Result of the `rare_terms` aggregation when the field is some kind of whole number like a integer, long, or a date. */ -export const types_aggregations_long_rare_terms_aggregate = - types_aggregations_multi_bucket_aggregate_base_long_rare_terms_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_long_rare_terms_aggregate = types_aggregations_multi_bucket_aggregate_base_long_rare_terms_bucket.and(z.record(z.string(), z.unknown())); -export const types_aggregations_string_rare_terms_bucket = types_aggregations_multi_bucket_base.and( - z.object({ - key: z.string(), - }) -); +export const types_aggregations_string_rare_terms_bucket = types_aggregations_multi_bucket_base.and(z.object({ + key: z.string() +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_string_rare_terms_bucket = z.union([ - z.record(z.string(), types_aggregations_string_rare_terms_bucket), - z.array(types_aggregations_string_rare_terms_bucket), + z.record(z.string(), types_aggregations_string_rare_terms_bucket), + z.array(types_aggregations_string_rare_terms_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_string_rare_terms_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_string_rare_terms_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_string_rare_terms_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_string_rare_terms_bucket +})); /** * Result of the `rare_terms` aggregation when the field is a string. */ -export const types_aggregations_string_rare_terms_aggregate = - types_aggregations_multi_bucket_aggregate_base_string_rare_terms_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_string_rare_terms_aggregate = types_aggregations_multi_bucket_aggregate_base_string_rare_terms_bucket.and(z.record(z.string(), z.unknown())); /** * Result of a `rare_terms` aggregation when the field is unmapped. `buckets` is always empty. */ -export const types_aggregations_unmapped_rare_terms_aggregate = - types_aggregations_multi_bucket_aggregate_base_void.and(z.record(z.string(), z.unknown())); +export const types_aggregations_unmapped_rare_terms_aggregate = types_aggregations_multi_bucket_aggregate_base_void.and(z.record(z.string(), z.unknown())); -export const types_aggregations_multi_terms_bucket = types_aggregations_multi_bucket_base.and( - z.object({ +export const types_aggregations_multi_terms_bucket = types_aggregations_multi_bucket_base.and(z.object({ key: z.array(types_field_value), key_as_string: z.optional(z.string()), - doc_count_error_upper_bound: z.optional(z.number()), - }) -); + doc_count_error_upper_bound: z.optional(z.number()) +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_multi_terms_bucket = z.union([ - z.record(z.string(), types_aggregations_multi_terms_bucket), - z.array(types_aggregations_multi_terms_bucket), + z.record(z.string(), types_aggregations_multi_terms_bucket), + z.array(types_aggregations_multi_terms_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_multi_terms_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_multi_terms_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_multi_terms_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_multi_terms_bucket +})); -export const types_aggregations_terms_aggregate_base_multi_terms_bucket = - types_aggregations_multi_bucket_aggregate_base_multi_terms_bucket.and( - z.object({ - doc_count_error_upper_bound: z.optional(z.number()), - sum_other_doc_count: z.optional(z.number()), - }) - ); +export const types_aggregations_terms_aggregate_base_multi_terms_bucket = types_aggregations_multi_bucket_aggregate_base_multi_terms_bucket.and(z.object({ + doc_count_error_upper_bound: z.optional(z.number()), + sum_other_doc_count: z.optional(z.number()) +})); -export const types_aggregations_multi_terms_aggregate = - types_aggregations_terms_aggregate_base_multi_terms_bucket.and(z.record(z.string(), z.unknown())); +export const types_aggregations_multi_terms_aggregate = types_aggregations_terms_aggregate_base_multi_terms_bucket.and(z.record(z.string(), z.unknown())); /** * Base type for single-bucket aggregation results that can hold sub-aggregations results. */ -export const types_aggregations_single_bucket_aggregate_base = - types_aggregations_aggregate_base.and( - z.object({ - doc_count: z.number(), - }) - ); +export const types_aggregations_single_bucket_aggregate_base = types_aggregations_aggregate_base.and(z.object({ + doc_count: z.number() +})); -export const types_aggregations_missing_aggregate = - types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_missing_aggregate = types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_nested_aggregate = - types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_nested_aggregate = types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_reverse_nested_aggregate = - types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_reverse_nested_aggregate = types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_global_aggregate = - types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_global_aggregate = types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_filter_aggregate = - types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_filter_aggregate = types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_children_aggregate = - types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_children_aggregate = types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_parent_aggregate = - types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_parent_aggregate = types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_sampler_aggregate = - types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_sampler_aggregate = types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_unmapped_sampler_aggregate = - types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_unmapped_sampler_aggregate = types_aggregations_single_bucket_aggregate_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_geo_hash_grid_bucket = types_aggregations_multi_bucket_base.and( - z.object({ - key: types_geo_hash, - }) -); +export const types_aggregations_geo_hash_grid_bucket = types_aggregations_multi_bucket_base.and(z.object({ + key: types_geo_hash +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_geo_hash_grid_bucket = z.union([ - z.record(z.string(), types_aggregations_geo_hash_grid_bucket), - z.array(types_aggregations_geo_hash_grid_bucket), + z.record(z.string(), types_aggregations_geo_hash_grid_bucket), + z.array(types_aggregations_geo_hash_grid_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_geo_hash_grid_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_geo_hash_grid_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_geo_hash_grid_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_geo_hash_grid_bucket +})); -export const types_aggregations_geo_hash_grid_aggregate = - types_aggregations_multi_bucket_aggregate_base_geo_hash_grid_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_geo_hash_grid_aggregate = types_aggregations_multi_bucket_aggregate_base_geo_hash_grid_bucket.and(z.record(z.string(), z.unknown())); /** * A map tile reference, represented as `{zoom}/{x}/{y}` */ export const types_geo_tile = z.string().register(z.globalRegistry, { - description: 'A map tile reference, represented as `{zoom}/{x}/{y}`', + description: 'A map tile reference, represented as `{zoom}/{x}/{y}`' }); -export const types_aggregations_geo_tile_grid_bucket = types_aggregations_multi_bucket_base.and( - z.object({ - key: types_geo_tile, - }) -); +export const types_aggregations_geo_tile_grid_bucket = types_aggregations_multi_bucket_base.and(z.object({ + key: types_geo_tile +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_geo_tile_grid_bucket = z.union([ - z.record(z.string(), types_aggregations_geo_tile_grid_bucket), - z.array(types_aggregations_geo_tile_grid_bucket), + z.record(z.string(), types_aggregations_geo_tile_grid_bucket), + z.array(types_aggregations_geo_tile_grid_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_geo_tile_grid_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_geo_tile_grid_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_geo_tile_grid_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_geo_tile_grid_bucket +})); -export const types_aggregations_geo_tile_grid_aggregate = - types_aggregations_multi_bucket_aggregate_base_geo_tile_grid_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_geo_tile_grid_aggregate = types_aggregations_multi_bucket_aggregate_base_geo_tile_grid_bucket.and(z.record(z.string(), z.unknown())); /** * A map hex cell (H3) reference */ export const types_geo_hex_cell = z.string().register(z.globalRegistry, { - description: 'A map hex cell (H3) reference', + description: 'A map hex cell (H3) reference' }); -export const types_aggregations_geo_hex_grid_bucket = types_aggregations_multi_bucket_base.and( - z.object({ - key: types_geo_hex_cell, - }) -); +export const types_aggregations_geo_hex_grid_bucket = types_aggregations_multi_bucket_base.and(z.object({ + key: types_geo_hex_cell +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_geo_hex_grid_bucket = z.union([ - z.record(z.string(), types_aggregations_geo_hex_grid_bucket), - z.array(types_aggregations_geo_hex_grid_bucket), + z.record(z.string(), types_aggregations_geo_hex_grid_bucket), + z.array(types_aggregations_geo_hex_grid_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_geo_hex_grid_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_geo_hex_grid_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_geo_hex_grid_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_geo_hex_grid_bucket +})); -export const types_aggregations_geo_hex_grid_aggregate = - types_aggregations_multi_bucket_aggregate_base_geo_hex_grid_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_geo_hex_grid_aggregate = types_aggregations_multi_bucket_aggregate_base_geo_hex_grid_bucket.and(z.record(z.string(), z.unknown())); -export const types_aggregations_range_bucket = types_aggregations_multi_bucket_base.and( - z.object({ +export const types_aggregations_range_bucket = types_aggregations_multi_bucket_base.and(z.object({ from: z.optional(z.number()), to: z.optional(z.number()), from_as_string: z.optional(z.string()), to_as_string: z.optional(z.string()), - key: z.optional( - z.string().register(z.globalRegistry, { - description: 'The bucket key. Present if the aggregation is _not_ keyed', - }) - ), - }) -); + key: z.optional(z.string().register(z.globalRegistry, { + description: 'The bucket key. Present if the aggregation is _not_ keyed' + })) +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_range_bucket = z.union([ - z.record(z.string(), types_aggregations_range_bucket), - z.array(types_aggregations_range_bucket), + z.record(z.string(), types_aggregations_range_bucket), + z.array(types_aggregations_range_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_range_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_range_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_range_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_range_bucket +})); -export const types_aggregations_range_aggregate = - types_aggregations_multi_bucket_aggregate_base_range_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_range_aggregate = types_aggregations_multi_bucket_aggregate_base_range_bucket.and(z.record(z.string(), z.unknown())); /** * Result of a `date_range` aggregation. Same format as a for a `range` aggregation: `from` and `to` * in `buckets` are milliseconds since the Epoch, represented as a floating point number. */ -export const types_aggregations_date_range_aggregate = types_aggregations_range_aggregate.and( - z.record(z.string(), z.unknown()) -); +export const types_aggregations_date_range_aggregate = types_aggregations_range_aggregate.and(z.record(z.string(), z.unknown())); /** * Result of a `geo_distance` aggregation. The unit for `from` and `to` is meters by default. */ -export const types_aggregations_geo_distance_aggregate = types_aggregations_range_aggregate.and( - z.record(z.string(), z.unknown()) -); +export const types_aggregations_geo_distance_aggregate = types_aggregations_range_aggregate.and(z.record(z.string(), z.unknown())); -export const types_aggregations_ip_range_bucket = types_aggregations_multi_bucket_base.and( - z.object({ +export const types_aggregations_ip_range_bucket = types_aggregations_multi_bucket_base.and(z.object({ key: z.optional(z.string()), from: z.optional(z.string()), - to: z.optional(z.string()), - }) -); + to: z.optional(z.string()) +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_ip_range_bucket = z.union([ - z.record(z.string(), types_aggregations_ip_range_bucket), - z.array(types_aggregations_ip_range_bucket), + z.record(z.string(), types_aggregations_ip_range_bucket), + z.array(types_aggregations_ip_range_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_ip_range_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_ip_range_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_ip_range_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_ip_range_bucket +})); -export const types_aggregations_ip_range_aggregate = - types_aggregations_multi_bucket_aggregate_base_ip_range_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_ip_range_aggregate = types_aggregations_multi_bucket_aggregate_base_ip_range_bucket.and(z.record(z.string(), z.unknown())); -export const types_aggregations_ip_prefix_bucket = types_aggregations_multi_bucket_base.and( - z.object({ +export const types_aggregations_ip_prefix_bucket = types_aggregations_multi_bucket_base.and(z.object({ is_ipv6: z.boolean(), key: z.string(), prefix_length: z.number(), - netmask: z.optional(z.string()), - }) -); + netmask: z.optional(z.string()) +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_ip_prefix_bucket = z.union([ - z.record(z.string(), types_aggregations_ip_prefix_bucket), - z.array(types_aggregations_ip_prefix_bucket), + z.record(z.string(), types_aggregations_ip_prefix_bucket), + z.array(types_aggregations_ip_prefix_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_ip_prefix_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_ip_prefix_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_ip_prefix_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_ip_prefix_bucket +})); -export const types_aggregations_ip_prefix_aggregate = - types_aggregations_multi_bucket_aggregate_base_ip_prefix_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_ip_prefix_aggregate = types_aggregations_multi_bucket_aggregate_base_ip_prefix_bucket.and(z.record(z.string(), z.unknown())); -export const types_aggregations_filters_bucket = types_aggregations_multi_bucket_base.and( - z.object({ - key: z.optional(z.string()), - }) -); +export const types_aggregations_filters_bucket = types_aggregations_multi_bucket_base.and(z.object({ + key: z.optional(z.string()) +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_filters_bucket = z.union([ - z.record(z.string(), types_aggregations_filters_bucket), - z.array(types_aggregations_filters_bucket), + z.record(z.string(), types_aggregations_filters_bucket), + z.array(types_aggregations_filters_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_filters_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_filters_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_filters_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_filters_bucket +})); -export const types_aggregations_filters_aggregate = - types_aggregations_multi_bucket_aggregate_base_filters_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_filters_aggregate = types_aggregations_multi_bucket_aggregate_base_filters_bucket.and(z.record(z.string(), z.unknown())); -export const types_aggregations_adjacency_matrix_bucket = types_aggregations_multi_bucket_base.and( - z.object({ - key: z.string(), - }) -); +export const types_aggregations_adjacency_matrix_bucket = types_aggregations_multi_bucket_base.and(z.object({ + key: z.string() +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_adjacency_matrix_bucket = z.union([ - z.record(z.string(), types_aggregations_adjacency_matrix_bucket), - z.array(types_aggregations_adjacency_matrix_bucket), + z.record(z.string(), types_aggregations_adjacency_matrix_bucket), + z.array(types_aggregations_adjacency_matrix_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_adjacency_matrix_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_adjacency_matrix_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_adjacency_matrix_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_adjacency_matrix_bucket +})); -export const types_aggregations_adjacency_matrix_aggregate = - types_aggregations_multi_bucket_aggregate_base_adjacency_matrix_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_adjacency_matrix_aggregate = types_aggregations_multi_bucket_aggregate_base_adjacency_matrix_bucket.and(z.record(z.string(), z.unknown())); -export const types_aggregations_significant_terms_bucket_base = - types_aggregations_multi_bucket_base.and( - z.object({ - score: z.number(), - bg_count: z.number(), - }) - ); +export const types_aggregations_significant_terms_bucket_base = types_aggregations_multi_bucket_base.and(z.object({ + score: z.number(), + bg_count: z.number() +})); -export const types_aggregations_significant_long_terms_bucket = - types_aggregations_significant_terms_bucket_base.and( - z.object({ - key: z.number(), - key_as_string: z.optional(z.string()), - }) - ); +export const types_aggregations_significant_long_terms_bucket = types_aggregations_significant_terms_bucket_base.and(z.object({ + key: z.number(), + key_as_string: z.optional(z.string()) +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_significant_long_terms_bucket = z.union([ - z.record(z.string(), types_aggregations_significant_long_terms_bucket), - z.array(types_aggregations_significant_long_terms_bucket), + z.record(z.string(), types_aggregations_significant_long_terms_bucket), + z.array(types_aggregations_significant_long_terms_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_significant_long_terms_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_significant_long_terms_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_significant_long_terms_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_significant_long_terms_bucket +})); -export const types_aggregations_significant_terms_aggregate_base_significant_long_terms_bucket = - types_aggregations_multi_bucket_aggregate_base_significant_long_terms_bucket.and( - z.object({ - bg_count: z.optional(z.number()), - doc_count: z.optional(z.number()), - }) - ); +export const types_aggregations_significant_terms_aggregate_base_significant_long_terms_bucket = types_aggregations_multi_bucket_aggregate_base_significant_long_terms_bucket.and(z.object({ + bg_count: z.optional(z.number()), + doc_count: z.optional(z.number()) +})); -export const types_aggregations_significant_long_terms_aggregate = - types_aggregations_significant_terms_aggregate_base_significant_long_terms_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_significant_long_terms_aggregate = types_aggregations_significant_terms_aggregate_base_significant_long_terms_bucket.and(z.record(z.string(), z.unknown())); -export const types_aggregations_significant_string_terms_bucket = - types_aggregations_significant_terms_bucket_base.and( - z.object({ - key: z.string(), - }) - ); +export const types_aggregations_significant_string_terms_bucket = types_aggregations_significant_terms_bucket_base.and(z.object({ + key: z.string() +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_significant_string_terms_bucket = z.union([ - z.record(z.string(), types_aggregations_significant_string_terms_bucket), - z.array(types_aggregations_significant_string_terms_bucket), + z.record(z.string(), types_aggregations_significant_string_terms_bucket), + z.array(types_aggregations_significant_string_terms_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_significant_string_terms_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_significant_string_terms_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_significant_string_terms_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_significant_string_terms_bucket +})); -export const types_aggregations_significant_terms_aggregate_base_significant_string_terms_bucket = - types_aggregations_multi_bucket_aggregate_base_significant_string_terms_bucket.and( - z.object({ - bg_count: z.optional(z.number()), - doc_count: z.optional(z.number()), - }) - ); +export const types_aggregations_significant_terms_aggregate_base_significant_string_terms_bucket = types_aggregations_multi_bucket_aggregate_base_significant_string_terms_bucket.and(z.object({ + bg_count: z.optional(z.number()), + doc_count: z.optional(z.number()) +})); -export const types_aggregations_significant_string_terms_aggregate = - types_aggregations_significant_terms_aggregate_base_significant_string_terms_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_significant_string_terms_aggregate = types_aggregations_significant_terms_aggregate_base_significant_string_terms_bucket.and(z.record(z.string(), z.unknown())); -export const types_aggregations_significant_terms_aggregate_base_void = - types_aggregations_multi_bucket_aggregate_base_void.and( - z.object({ - bg_count: z.optional(z.number()), - doc_count: z.optional(z.number()), - }) - ); +export const types_aggregations_significant_terms_aggregate_base_void = types_aggregations_multi_bucket_aggregate_base_void.and(z.object({ + bg_count: z.optional(z.number()), + doc_count: z.optional(z.number()) +})); /** * Result of the `significant_terms` aggregation on an unmapped field. `buckets` is always empty. */ -export const types_aggregations_unmapped_significant_terms_aggregate = - types_aggregations_significant_terms_aggregate_base_void.and(z.record(z.string(), z.unknown())); +export const types_aggregations_unmapped_significant_terms_aggregate = types_aggregations_significant_terms_aggregate_base_void.and(z.record(z.string(), z.unknown())); export const types_aggregations_composite_aggregate_key = z.record(z.string(), types_field_value); -export const types_aggregations_composite_bucket = types_aggregations_multi_bucket_base.and( - z.object({ - key: types_aggregations_composite_aggregate_key, - }) -); +export const types_aggregations_composite_bucket = types_aggregations_multi_bucket_base.and(z.object({ + key: types_aggregations_composite_aggregate_key +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_composite_bucket = z.union([ - z.record(z.string(), types_aggregations_composite_bucket), - z.array(types_aggregations_composite_bucket), + z.record(z.string(), types_aggregations_composite_bucket), + z.array(types_aggregations_composite_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_composite_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_composite_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_composite_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_composite_bucket +})); -export const types_aggregations_composite_aggregate = - types_aggregations_multi_bucket_aggregate_base_composite_bucket.and( - z.object({ - after_key: z.optional(types_aggregations_composite_aggregate_key), - }) - ); +export const types_aggregations_composite_aggregate = types_aggregations_multi_bucket_aggregate_base_composite_bucket.and(z.object({ + after_key: z.optional(types_aggregations_composite_aggregate_key) +})); -export const types_aggregations_frequent_item_sets_bucket = - types_aggregations_multi_bucket_base.and( - z.object({ - key: z.record(z.string(), z.array(z.string())), - support: z.number(), - }) - ); +export const types_aggregations_frequent_item_sets_bucket = types_aggregations_multi_bucket_base.and(z.object({ + key: z.record(z.string(), z.array(z.string())), + support: z.number() +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_frequent_item_sets_bucket = z.union([ - z.record(z.string(), types_aggregations_frequent_item_sets_bucket), - z.array(types_aggregations_frequent_item_sets_bucket), + z.record(z.string(), types_aggregations_frequent_item_sets_bucket), + z.array(types_aggregations_frequent_item_sets_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_frequent_item_sets_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_frequent_item_sets_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_frequent_item_sets_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_frequent_item_sets_bucket +})); -export const types_aggregations_frequent_item_sets_aggregate = - types_aggregations_multi_bucket_aggregate_base_frequent_item_sets_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_frequent_item_sets_aggregate = types_aggregations_multi_bucket_aggregate_base_frequent_item_sets_bucket.and(z.record(z.string(), z.unknown())); -export const types_aggregations_time_series_bucket = types_aggregations_multi_bucket_base.and( - z.object({ - key: z.record(z.string(), types_field_value), - }) -); +export const types_aggregations_time_series_bucket = types_aggregations_multi_bucket_base.and(z.object({ + key: z.record(z.string(), types_field_value) +})); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_time_series_bucket = z.union([ - z.record(z.string(), types_aggregations_time_series_bucket), - z.array(types_aggregations_time_series_bucket), + z.record(z.string(), types_aggregations_time_series_bucket), + z.array(types_aggregations_time_series_bucket) ]); -export const types_aggregations_multi_bucket_aggregate_base_time_series_bucket = - types_aggregations_aggregate_base.and( - z.object({ - buckets: types_aggregations_buckets_time_series_bucket, - }) - ); +export const types_aggregations_multi_bucket_aggregate_base_time_series_bucket = types_aggregations_aggregate_base.and(z.object({ + buckets: types_aggregations_buckets_time_series_bucket +})); -export const types_aggregations_time_series_aggregate = - types_aggregations_multi_bucket_aggregate_base_time_series_bucket.and( - z.record(z.string(), z.unknown()) - ); +export const types_aggregations_time_series_aggregate = types_aggregations_multi_bucket_aggregate_base_time_series_bucket.and(z.record(z.string(), z.unknown())); -export const types_aggregations_scripted_metric_aggregate = types_aggregations_aggregate_base.and( - z.object({ - value: z.record(z.string(), z.unknown()), - }) -); +export const types_aggregations_scripted_metric_aggregate = types_aggregations_aggregate_base.and(z.object({ + value: z.record(z.string(), z.unknown()) +})); export const global_search_types_total_hits_relation = z.enum(['eq', 'gte']); export const global_search_types_total_hits = z.object({ - relation: global_search_types_total_hits_relation, - value: z.number(), + relation: global_search_types_total_hits_relation, + value: z.number() }); export const types_index_name = z.string(); export const global_explain_explanation_detail = z.object({ - description: z.string(), - get details() { - return z.optional(z.array(z.lazy((): any => global_explain_explanation_detail))); - }, - value: z.number(), + description: z.string(), + get details() { + return z.optional(z.array(z.lazy((): any => global_explain_explanation_detail))); + }, + value: z.number() }); export const global_explain_explanation = z.object({ - description: z.string(), - details: z.array(global_explain_explanation_detail), - value: z.number(), + description: z.string(), + details: z.array(global_explain_explanation_detail), + value: z.number() }); /** * Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. */ export const types_field = z.string().register(z.globalRegistry, { - description: - "Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.", + description: 'Path to field or array of paths. Some API\'s support wildcards in the path to select multiple fields.' }); export const global_search_types_nested_identity = z.object({ - field: types_field, - offset: z.number(), - get _nested() { - return z.optional(z.lazy((): any => global_search_types_nested_identity)); - }, + field: types_field, + offset: z.number(), + get _nested() { + return z.optional(z.lazy((): any => global_search_types_nested_identity)); + } }); export const types_sequence_number = z.number(); @@ -1283,47 +1055,62 @@ export const types_version_number = z.number(); export const types_sort_results = z.array(types_field_value); export const types_aggregations_inference_class_importance = z.object({ - class_name: z.string(), - importance: z.number(), + class_name: z.string(), + importance: z.number() }); export const types_aggregations_inference_feature_importance = z.object({ - feature_name: z.string(), - importance: z.optional(z.number()), - classes: z.optional(z.array(types_aggregations_inference_class_importance)), + feature_name: z.string(), + importance: z.optional(z.number()), + classes: z.optional(z.array(types_aggregations_inference_class_importance)) }); export const types_aggregations_inference_top_class_entry = z.object({ - class_name: types_field_value, - class_probability: z.number(), - class_score: z.number(), + class_name: types_field_value, + class_probability: z.number(), + class_score: z.number() }); -export const types_aggregations_inference_aggregate = types_aggregations_aggregate_base.and( - z.object({ +export const types_aggregations_inference_aggregate = types_aggregations_aggregate_base.and(z.object({ value: z.optional(types_field_value), feature_importance: z.optional(z.array(types_aggregations_inference_feature_importance)), top_classes: z.optional(z.array(types_aggregations_inference_top_class_entry)), - warning: z.optional(z.string()), - }) -); + warning: z.optional(z.string()) +})); -export const types_aggregations_string_stats_aggregate = types_aggregations_aggregate_base.and( - z.object({ +export const types_aggregations_string_stats_aggregate = types_aggregations_aggregate_base.and(z.object({ count: z.number(), - min_length: z.union([z.number(), z.string(), z.null()]), - max_length: z.union([z.number(), z.string(), z.null()]), - avg_length: z.union([z.number(), z.string(), z.null()]), - entropy: z.union([z.number(), z.string(), z.null()]), - distribution: z.optional(z.union([z.record(z.string(), z.number()), z.string(), z.null()])), + min_length: z.union([ + z.number(), + z.string(), + z.null() + ]), + max_length: z.union([ + z.number(), + z.string(), + z.null() + ]), + avg_length: z.union([ + z.number(), + z.string(), + z.null() + ]), + entropy: z.union([ + z.number(), + z.string(), + z.null() + ]), + distribution: z.optional(z.union([ + z.record(z.string(), z.number()), + z.string(), + z.null() + ])), min_length_as_string: z.optional(z.string()), max_length_as_string: z.optional(z.string()), - avg_length_as_string: z.optional(z.string()), - }) -); + avg_length_as_string: z.optional(z.string()) +})); -export const types_aggregations_box_plot_aggregate = types_aggregations_aggregate_base.and( - z.object({ +export const types_aggregations_box_plot_aggregate = types_aggregations_aggregate_base.and(z.object({ min: z.number(), max: z.number(), q1: z.number(), @@ -1337,94 +1124,90 @@ export const types_aggregations_box_plot_aggregate = types_aggregations_aggregat q2_as_string: z.optional(z.string()), q3_as_string: z.optional(z.string()), lower_as_string: z.optional(z.string()), - upper_as_string: z.optional(z.string()), - }) -); + upper_as_string: z.optional(z.string()) +})); export const types_aggregations_top_metrics = z.object({ - sort: z.array(z.union([types_field_value, z.string(), z.null()])), - metrics: z.record(z.string(), z.union([types_field_value, z.string(), z.null()])), + sort: z.array(z.union([ + types_field_value, + z.string(), + z.null() + ])), + metrics: z.record(z.string(), z.union([ + types_field_value, + z.string(), + z.null() + ])) }); -export const types_aggregations_top_metrics_aggregate = types_aggregations_aggregate_base.and( - z.object({ - top: z.array(types_aggregations_top_metrics), - }) -); +export const types_aggregations_top_metrics_aggregate = types_aggregations_aggregate_base.and(z.object({ + top: z.array(types_aggregations_top_metrics) +})); -export const types_aggregations_t_test_aggregate = types_aggregations_aggregate_base.and( - z.object({ - value: z.union([z.number(), z.string(), z.null()]), - value_as_string: z.optional(z.string()), - }) -); +export const types_aggregations_t_test_aggregate = types_aggregations_aggregate_base.and(z.object({ + value: z.union([ + z.number(), + z.string(), + z.null() + ]), + value_as_string: z.optional(z.string()) +})); -export const types_aggregations_rate_aggregate = types_aggregations_aggregate_base.and( - z.object({ +export const types_aggregations_rate_aggregate = types_aggregations_aggregate_base.and(z.object({ value: z.number(), - value_as_string: z.optional(z.string()), - }) -); + value_as_string: z.optional(z.string()) +})); /** * Result of the `cumulative_cardinality` aggregation */ -export const types_aggregations_cumulative_cardinality_aggregate = - types_aggregations_aggregate_base.and( - z.object({ - value: z.number(), - value_as_string: z.optional(z.string()), - }) - ); +export const types_aggregations_cumulative_cardinality_aggregate = types_aggregations_aggregate_base.and(z.object({ + value: z.number(), + value_as_string: z.optional(z.string()) +})); export const types_aggregations_matrix_stats_fields = z.object({ - name: types_field, - count: z.number(), - mean: z.number(), - variance: z.number(), - skewness: z.number(), - kurtosis: z.number(), - covariance: z.record(z.string(), z.number()), - correlation: z.record(z.string(), z.number()), -}); - -export const types_aggregations_matrix_stats_aggregate = types_aggregations_aggregate_base.and( - z.object({ + name: types_field, + count: z.number(), + mean: z.number(), + variance: z.number(), + skewness: z.number(), + kurtosis: z.number(), + covariance: z.record(z.string(), z.number()), + correlation: z.record(z.string(), z.number()) +}); + +export const types_aggregations_matrix_stats_aggregate = types_aggregations_aggregate_base.and(z.object({ doc_count: z.number(), - fields: z.optional(z.array(types_aggregations_matrix_stats_fields)), - }) -); + fields: z.optional(z.array(types_aggregations_matrix_stats_fields)) +})); /** * A GeoJson GeoLine. */ -export const types_geo_line = z - .object({ +export const types_geo_line = z.object({ type: z.string().register(z.globalRegistry, { - description: 'Always `"LineString"`', + description: 'Always `"LineString"`' }), coordinates: z.array(z.array(z.number())).register(z.globalRegistry, { - description: 'Array of `[lon, lat]` coordinates', - }), - }) - .register(z.globalRegistry, { - description: 'A GeoJson GeoLine.', - }); + description: 'Array of `[lon, lat]` coordinates' + }) +}).register(z.globalRegistry, { + description: 'A GeoJson GeoLine.' +}); -export const types_aggregations_geo_line_aggregate = types_aggregations_aggregate_base.and( - z.object({ +export const types_aggregations_geo_line_aggregate = types_aggregations_aggregate_base.and(z.object({ type: z.string(), geometry: types_geo_line, - properties: z.record(z.string(), z.unknown()), - }) -); + properties: z.record(z.string(), z.unknown()) +})); export const types_cluster_search_status = z.enum([ - 'running', - 'successful', - 'partial', - 'skipped', - 'failed', + 'running', + 'successful', + 'partial', + 'skipped', + 'failed' ]); export const types_duration_value_unit_millis = types_unit_millis; @@ -1435,319 +1218,316 @@ export const types_uint = z.number(); * Cause and details about a request failure. This class defines the properties common to all error types. * Additional details are also provided, that depend on the error type. */ -export const types_error_cause = z - .object({ +export const types_error_cause = z.object({ type: z.string().register(z.globalRegistry, { - description: 'The type of error', - }), - reason: z.optional(z.union([z.string(), z.null()])), - stack_trace: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The server stack trace. Present only if the `error_trace=true` parameter was sent with the request.', - }) - ), + description: 'The type of error' + }), + reason: z.optional(z.union([ + z.string(), + z.null() + ])), + stack_trace: z.optional(z.string().register(z.globalRegistry, { + description: 'The server stack trace. Present only if the `error_trace=true` parameter was sent with the request.' + })), get caused_by() { - return z.optional(z.lazy((): any => types_error_cause)); + return z.optional(z.lazy((): any => types_error_cause)); }, get root_cause() { - return z.optional(z.array(z.lazy((): any => types_error_cause))); + return z.optional(z.array(z.lazy((): any => types_error_cause))); }, get suppressed() { - return z.optional(z.array(z.lazy((): any => types_error_cause))); - }, - }) - .register(z.globalRegistry, { - description: - 'Cause and details about a request failure. This class defines the properties common to all error types.\nAdditional details are also provided, that depend on the error type.', - }); + return z.optional(z.array(z.lazy((): any => types_error_cause))); + } +}).register(z.globalRegistry, { + description: 'Cause and details about a request failure. This class defines the properties common to all error types.\nAdditional details are also provided, that depend on the error type.' +}); export const types_shard_failure = z.object({ - index: z.optional(types_index_name), - node: z.optional(z.string()), - reason: types_error_cause, - shard: z.optional(z.number()), - status: z.optional(z.string()), - primary: z.optional(z.boolean()), + index: z.optional(types_index_name), + node: z.optional(z.string()), + reason: types_error_cause, + shard: z.optional(z.number()), + status: z.optional(z.string()), + primary: z.optional(z.boolean()) }); export const types_shard_statistics = z.object({ - failed: types_uint, - successful: types_uint, - total: types_uint, - failures: z.optional(z.array(types_shard_failure)), - skipped: z.optional(types_uint), + failed: types_uint, + successful: types_uint, + total: types_uint, + failures: z.optional(z.array(types_shard_failure)), + skipped: z.optional(types_uint) }); export const types_cluster_details = z.object({ - status: types_cluster_search_status, - indices: z.string(), - took: z.optional(types_duration_value_unit_millis), - timed_out: z.boolean(), - _shards: z.optional(types_shard_statistics), - failures: z.optional(z.array(types_shard_failure)), + status: types_cluster_search_status, + indices: z.string(), + took: z.optional(types_duration_value_unit_millis), + timed_out: z.boolean(), + _shards: z.optional(types_shard_statistics), + failures: z.optional(z.array(types_shard_failure)) }); export const types_cluster_statistics = z.object({ - skipped: z.number(), - successful: z.number(), - total: z.number(), - running: z.number(), - partial: z.number(), - failed: z.number(), - details: z.optional(z.record(z.string(), types_cluster_details)), + skipped: z.number(), + successful: z.number(), + total: z.number(), + running: z.number(), + partial: z.number(), + failed: z.number(), + details: z.optional(z.record(z.string(), types_cluster_details)) }); export const global_search_types_aggregation_breakdown = z.object({ - build_aggregation: z.number(), - build_aggregation_count: z.number(), - build_leaf_collector: z.number(), - build_leaf_collector_count: z.number(), - collect: z.number(), - collect_count: z.number(), - initialize: z.number(), - initialize_count: z.number(), - post_collection: z.optional(z.number()), - post_collection_count: z.optional(z.number()), - reduce: z.number(), - reduce_count: z.number(), + build_aggregation: z.number(), + build_aggregation_count: z.number(), + build_leaf_collector: z.number(), + build_leaf_collector_count: z.number(), + collect: z.number(), + collect_count: z.number(), + initialize: z.number(), + initialize_count: z.number(), + post_collection: z.optional(z.number()), + post_collection_count: z.optional(z.number()), + reduce: z.number(), + reduce_count: z.number() }); /** * Time unit for nanoseconds */ export const types_unit_nanos = z.number().register(z.globalRegistry, { - description: 'Time unit for nanoseconds', + description: 'Time unit for nanoseconds' }); export const types_duration_value_unit_nanos = types_unit_nanos; export const global_search_types_aggregation_profile_delegate_debug_filter = z.object({ - results_from_metadata: z.optional(z.number()), - query: z.optional(z.string()), - specialized_for: z.optional(z.string()), - segments_counted_in_constant_time: z.optional(z.number()), + results_from_metadata: z.optional(z.number()), + query: z.optional(z.string()), + specialized_for: z.optional(z.string()), + segments_counted_in_constant_time: z.optional(z.number()) }); export const global_search_types_aggregation_profile_debug = z.object({ - segments_with_multi_valued_ords: z.optional(z.number()), - collection_strategy: z.optional(z.string()), - segments_with_single_valued_ords: z.optional(z.number()), - total_buckets: z.optional(z.number()), - built_buckets: z.optional(z.number()), - result_strategy: z.optional(z.string()), - has_filter: z.optional(z.boolean()), - delegate: z.optional(z.string()), - get delegate_debug() { - return z.optional(z.lazy((): any => global_search_types_aggregation_profile_debug)); - }, - chars_fetched: z.optional(z.number()), - extract_count: z.optional(z.number()), - extract_ns: z.optional(z.number()), - values_fetched: z.optional(z.number()), - collect_analyzed_ns: z.optional(z.number()), - collect_analyzed_count: z.optional(z.number()), - surviving_buckets: z.optional(z.number()), - ordinals_collectors_used: z.optional(z.number()), - ordinals_collectors_overhead_too_high: z.optional(z.number()), - string_hashing_collectors_used: z.optional(z.number()), - numeric_collectors_used: z.optional(z.number()), - empty_collectors_used: z.optional(z.number()), - deferred_aggregators: z.optional(z.array(z.string())), - segments_with_doc_count_field: z.optional(z.number()), - segments_with_deleted_docs: z.optional(z.number()), - filters: z.optional(z.array(global_search_types_aggregation_profile_delegate_debug_filter)), - segments_counted: z.optional(z.number()), - segments_collected: z.optional(z.number()), - map_reducer: z.optional(z.string()), - brute_force_used: z.optional(z.number()), - dynamic_pruning_attempted: z.optional(z.number()), - dynamic_pruning_used: z.optional(z.number()), - skipped_due_to_no_data: z.optional(z.number()), + segments_with_multi_valued_ords: z.optional(z.number()), + collection_strategy: z.optional(z.string()), + segments_with_single_valued_ords: z.optional(z.number()), + total_buckets: z.optional(z.number()), + built_buckets: z.optional(z.number()), + result_strategy: z.optional(z.string()), + has_filter: z.optional(z.boolean()), + delegate: z.optional(z.string()), + get delegate_debug() { + return z.optional(z.lazy((): any => global_search_types_aggregation_profile_debug)); + }, + chars_fetched: z.optional(z.number()), + extract_count: z.optional(z.number()), + extract_ns: z.optional(z.number()), + values_fetched: z.optional(z.number()), + collect_analyzed_ns: z.optional(z.number()), + collect_analyzed_count: z.optional(z.number()), + surviving_buckets: z.optional(z.number()), + ordinals_collectors_used: z.optional(z.number()), + ordinals_collectors_overhead_too_high: z.optional(z.number()), + string_hashing_collectors_used: z.optional(z.number()), + numeric_collectors_used: z.optional(z.number()), + empty_collectors_used: z.optional(z.number()), + deferred_aggregators: z.optional(z.array(z.string())), + segments_with_doc_count_field: z.optional(z.number()), + segments_with_deleted_docs: z.optional(z.number()), + filters: z.optional(z.array(global_search_types_aggregation_profile_delegate_debug_filter)), + segments_counted: z.optional(z.number()), + segments_collected: z.optional(z.number()), + map_reducer: z.optional(z.string()), + brute_force_used: z.optional(z.number()), + dynamic_pruning_attempted: z.optional(z.number()), + dynamic_pruning_used: z.optional(z.number()), + skipped_due_to_no_data: z.optional(z.number()) }); export const global_search_types_aggregation_profile = z.object({ - breakdown: global_search_types_aggregation_breakdown, - description: z.string(), - time_in_nanos: types_duration_value_unit_nanos, - type: z.string(), - debug: z.optional(global_search_types_aggregation_profile_debug), - get children() { - return z.optional(z.array(z.lazy((): any => global_search_types_aggregation_profile))); - }, + breakdown: global_search_types_aggregation_breakdown, + description: z.string(), + time_in_nanos: types_duration_value_unit_nanos, + type: z.string(), + debug: z.optional(global_search_types_aggregation_profile_debug), + get children() { + return z.optional(z.array(z.lazy((): any => global_search_types_aggregation_profile))); + } }); export const global_search_types_dfs_statistics_breakdown = z.object({ - collection_statistics: z.number(), - collection_statistics_count: z.number(), - create_weight: z.number(), - create_weight_count: z.number(), - rewrite: z.number(), - rewrite_count: z.number(), - term_statistics: z.number(), - term_statistics_count: z.number(), + collection_statistics: z.number(), + collection_statistics_count: z.number(), + create_weight: z.number(), + create_weight_count: z.number(), + rewrite: z.number(), + rewrite_count: z.number(), + term_statistics: z.number(), + term_statistics_count: z.number() }); export const global_search_types_dfs_statistics_profile = z.object({ - type: z.string(), - description: z.string(), - time: z.optional(types_duration), - time_in_nanos: types_duration_value_unit_nanos, - breakdown: global_search_types_dfs_statistics_breakdown, - debug: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - get children() { - return z.optional(z.array(z.lazy((): any => global_search_types_dfs_statistics_profile))); - }, + type: z.string(), + description: z.string(), + time: z.optional(types_duration), + time_in_nanos: types_duration_value_unit_nanos, + breakdown: global_search_types_dfs_statistics_breakdown, + debug: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + get children() { + return z.optional(z.array(z.lazy((): any => global_search_types_dfs_statistics_profile))); + } }); export const global_search_types_knn_query_profile_breakdown = z.object({ - advance: z.number(), - advance_count: z.number(), - build_scorer: z.number(), - build_scorer_count: z.number(), - compute_max_score: z.number(), - compute_max_score_count: z.number(), - count_weight: z.number(), - count_weight_count: z.number(), - create_weight: z.number(), - create_weight_count: z.number(), - match: z.number(), - match_count: z.number(), - next_doc: z.number(), - next_doc_count: z.number(), - score: z.number(), - score_count: z.number(), - set_min_competitive_score: z.number(), - set_min_competitive_score_count: z.number(), - shallow_advance: z.number(), - shallow_advance_count: z.number(), + advance: z.number(), + advance_count: z.number(), + build_scorer: z.number(), + build_scorer_count: z.number(), + compute_max_score: z.number(), + compute_max_score_count: z.number(), + count_weight: z.number(), + count_weight_count: z.number(), + create_weight: z.number(), + create_weight_count: z.number(), + match: z.number(), + match_count: z.number(), + next_doc: z.number(), + next_doc_count: z.number(), + score: z.number(), + score_count: z.number(), + set_min_competitive_score: z.number(), + set_min_competitive_score_count: z.number(), + shallow_advance: z.number(), + shallow_advance_count: z.number() }); export const global_search_types_knn_query_profile_result = z.object({ - type: z.string(), - description: z.string(), - time: z.optional(types_duration), - time_in_nanos: types_duration_value_unit_nanos, - breakdown: global_search_types_knn_query_profile_breakdown, - debug: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - get children() { - return z.optional(z.array(z.lazy((): any => global_search_types_knn_query_profile_result))); - }, + type: z.string(), + description: z.string(), + time: z.optional(types_duration), + time_in_nanos: types_duration_value_unit_nanos, + breakdown: global_search_types_knn_query_profile_breakdown, + debug: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + get children() { + return z.optional(z.array(z.lazy((): any => global_search_types_knn_query_profile_result))); + } }); export const global_search_types_knn_collector_result = z.object({ - name: z.string(), - reason: z.string(), - time: z.optional(types_duration), - time_in_nanos: types_duration_value_unit_nanos, - get children() { - return z.optional(z.array(z.lazy((): any => global_search_types_knn_collector_result))); - }, + name: z.string(), + reason: z.string(), + time: z.optional(types_duration), + time_in_nanos: types_duration_value_unit_nanos, + get children() { + return z.optional(z.array(z.lazy((): any => global_search_types_knn_collector_result))); + } }); export const global_search_types_dfs_knn_profile = z.object({ - vector_operations_count: z.optional(z.number()), - query: z.array(global_search_types_knn_query_profile_result), - rewrite_time: z.number(), - collector: z.array(global_search_types_knn_collector_result), + vector_operations_count: z.optional(z.number()), + query: z.array(global_search_types_knn_query_profile_result), + rewrite_time: z.number(), + collector: z.array(global_search_types_knn_collector_result) }); export const global_search_types_dfs_profile = z.object({ - statistics: z.optional(global_search_types_dfs_statistics_profile), - knn: z.optional(z.array(global_search_types_dfs_knn_profile)), + statistics: z.optional(global_search_types_dfs_statistics_profile), + knn: z.optional(z.array(global_search_types_dfs_knn_profile)) }); export const global_search_types_fetch_profile_breakdown = z.object({ - load_source: z.optional(z.number()), - load_source_count: z.optional(z.number()), - load_stored_fields: z.optional(z.number()), - load_stored_fields_count: z.optional(z.number()), - next_reader: z.optional(z.number()), - next_reader_count: z.optional(z.number()), - process_count: z.optional(z.number()), - process: z.optional(z.number()), + load_source: z.optional(z.number()), + load_source_count: z.optional(z.number()), + load_stored_fields: z.optional(z.number()), + load_stored_fields_count: z.optional(z.number()), + next_reader: z.optional(z.number()), + next_reader_count: z.optional(z.number()), + process_count: z.optional(z.number()), + process: z.optional(z.number()) }); export const global_search_types_fetch_profile_debug = z.object({ - stored_fields: z.optional(z.array(z.string())), - fast_path: z.optional(z.number()), + stored_fields: z.optional(z.array(z.string())), + fast_path: z.optional(z.number()) }); export const global_search_types_fetch_profile = z.object({ - type: z.string(), - description: z.string(), - time_in_nanos: types_duration_value_unit_nanos, - breakdown: global_search_types_fetch_profile_breakdown, - debug: z.optional(global_search_types_fetch_profile_debug), - get children() { - return z.optional(z.array(z.lazy((): any => global_search_types_fetch_profile))); - }, + type: z.string(), + description: z.string(), + time_in_nanos: types_duration_value_unit_nanos, + breakdown: global_search_types_fetch_profile_breakdown, + debug: z.optional(global_search_types_fetch_profile_debug), + get children() { + return z.optional(z.array(z.lazy((): any => global_search_types_fetch_profile))); + } }); export const types_node_id = z.string(); export const global_search_types_collector = z.object({ - name: z.string(), - reason: z.string(), - time_in_nanos: types_duration_value_unit_nanos, - get children() { - return z.optional(z.array(z.lazy((): any => global_search_types_collector))); - }, + name: z.string(), + reason: z.string(), + time_in_nanos: types_duration_value_unit_nanos, + get children() { + return z.optional(z.array(z.lazy((): any => global_search_types_collector))); + } }); export const global_search_types_query_breakdown = z.object({ - advance: z.number(), - advance_count: z.number(), - build_scorer: z.number(), - build_scorer_count: z.number(), - create_weight: z.number(), - create_weight_count: z.number(), - match: z.number(), - match_count: z.number(), - shallow_advance: z.number(), - shallow_advance_count: z.number(), - next_doc: z.number(), - next_doc_count: z.number(), - score: z.number(), - score_count: z.number(), - compute_max_score: z.number(), - compute_max_score_count: z.number(), - count_weight: z.number(), - count_weight_count: z.number(), - set_min_competitive_score: z.number(), - set_min_competitive_score_count: z.number(), + advance: z.number(), + advance_count: z.number(), + build_scorer: z.number(), + build_scorer_count: z.number(), + create_weight: z.number(), + create_weight_count: z.number(), + match: z.number(), + match_count: z.number(), + shallow_advance: z.number(), + shallow_advance_count: z.number(), + next_doc: z.number(), + next_doc_count: z.number(), + score: z.number(), + score_count: z.number(), + compute_max_score: z.number(), + compute_max_score_count: z.number(), + count_weight: z.number(), + count_weight_count: z.number(), + set_min_competitive_score: z.number(), + set_min_competitive_score_count: z.number() }); export const global_search_types_query_profile = z.object({ - breakdown: global_search_types_query_breakdown, - description: z.string(), - time_in_nanos: types_duration_value_unit_nanos, - type: z.string(), - get children() { - return z.optional(z.array(z.lazy((): any => global_search_types_query_profile))); - }, + breakdown: global_search_types_query_breakdown, + description: z.string(), + time_in_nanos: types_duration_value_unit_nanos, + type: z.string(), + get children() { + return z.optional(z.array(z.lazy((): any => global_search_types_query_profile))); + } }); export const global_search_types_search_profile = z.object({ - collector: z.array(global_search_types_collector), - query: z.array(global_search_types_query_profile), - rewrite_time: z.number(), + collector: z.array(global_search_types_collector), + query: z.array(global_search_types_query_profile), + rewrite_time: z.number() }); export const global_search_types_shard_profile = z.object({ - aggregations: z.array(global_search_types_aggregation_profile), - cluster: z.string(), - dfs: z.optional(global_search_types_dfs_profile), - fetch: z.optional(global_search_types_fetch_profile), - id: z.string(), - index: types_index_name, - node_id: types_node_id, - searches: z.array(global_search_types_search_profile), - shard_id: z.number(), + aggregations: z.array(global_search_types_aggregation_profile), + cluster: z.string(), + dfs: z.optional(global_search_types_dfs_profile), + fetch: z.optional(global_search_types_fetch_profile), + id: z.string(), + index: types_index_name, + node_id: types_node_id, + searches: z.array(global_search_types_search_profile), + shard_id: z.number() }); export const global_search_types_profile = z.object({ - shards: z.array(global_search_types_shard_profile), + shards: z.array(global_search_types_shard_profile) }); export const types_scroll_id = z.string(); @@ -1755,75 +1535,75 @@ export const types_scroll_id = z.string(); /** * Text or location that we want similar documents for or a lookup to a document's field for the text. */ -export const global_search_types_context = z.union([z.string(), types_geo_location]); +export const global_search_types_context = z.union([ + z.string(), + types_geo_location +]); -export const types_routing = z.union([z.string(), z.array(z.string())]); +export const types_routing = z.union([ + z.string(), + z.array(z.string()) +]); export const global_search_types_completion_suggest_option = z.object({ - collate_match: z.optional(z.boolean()), - contexts: z.optional(z.record(z.string(), z.array(global_search_types_context))), - fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - _id: z.optional(z.string()), - _index: z.optional(types_index_name), - _routing: z.optional(types_routing), - _score: z.optional(z.number()), - _source: z.optional(z.record(z.string(), z.unknown())), - text: z.string(), - score: z.optional(z.number()), + collate_match: z.optional(z.boolean()), + contexts: z.optional(z.record(z.string(), z.array(global_search_types_context))), + fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + _id: z.optional(z.string()), + _index: z.optional(types_index_name), + _routing: z.optional(types_routing), + _score: z.optional(z.number()), + _source: z.optional(z.record(z.string(), z.unknown())), + text: z.string(), + score: z.optional(z.number()) }); export const global_search_types_suggest_base = z.object({ - length: z.number(), - offset: z.number(), - text: z.string(), + length: z.number(), + offset: z.number(), + text: z.string() }); -export const global_search_types_completion_suggest = global_search_types_suggest_base.and( - z.object({ +export const global_search_types_completion_suggest = global_search_types_suggest_base.and(z.object({ options: z.union([ - global_search_types_completion_suggest_option, - z.array(global_search_types_completion_suggest_option), - ]), - }) -); + global_search_types_completion_suggest_option, + z.array(global_search_types_completion_suggest_option) + ]) +})); export const global_search_types_phrase_suggest_option = z.object({ - text: z.string(), - score: z.number(), - highlighted: z.optional(z.string()), - collate_match: z.optional(z.boolean()), + text: z.string(), + score: z.number(), + highlighted: z.optional(z.string()), + collate_match: z.optional(z.boolean()) }); -export const global_search_types_phrase_suggest = global_search_types_suggest_base.and( - z.object({ +export const global_search_types_phrase_suggest = global_search_types_suggest_base.and(z.object({ options: z.union([ - global_search_types_phrase_suggest_option, - z.array(global_search_types_phrase_suggest_option), - ]), - }) -); + global_search_types_phrase_suggest_option, + z.array(global_search_types_phrase_suggest_option) + ]) +})); export const global_search_types_term_suggest_option = z.object({ - text: z.string(), - score: z.number(), - freq: z.number(), - highlighted: z.optional(z.string()), - collate_match: z.optional(z.boolean()), + text: z.string(), + score: z.number(), + freq: z.number(), + highlighted: z.optional(z.string()), + collate_match: z.optional(z.boolean()) }); -export const global_search_types_term_suggest = global_search_types_suggest_base.and( - z.object({ +export const global_search_types_term_suggest = global_search_types_suggest_base.and(z.object({ options: z.union([ - global_search_types_term_suggest_option, - z.array(global_search_types_term_suggest_option), - ]), - }) -); + global_search_types_term_suggest_option, + z.array(global_search_types_term_suggest_option) + ]) +})); export const global_search_types_suggest = z.union([ - global_search_types_completion_suggest, - global_search_types_phrase_suggest, - global_search_types_term_suggest, + global_search_types_completion_suggest, + global_search_types_phrase_suggest, + global_search_types_term_suggest ]); /** @@ -1831,57 +1611,73 @@ export const global_search_types_suggest = z.union([ * number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string * representation. */ -export const types_date_time = z.union([z.string(), types_epoch_time_unit_millis]); +export const types_date_time = z.union([ + z.string(), + types_epoch_time_unit_millis +]); export const async_search_types_async_search_response_base = z.object({ - id: z.optional(types_id), - is_partial: z.boolean().register(z.globalRegistry, { - description: - 'When the query is no longer running, this property indicates whether the search failed or was successfully completed on all shards.\nWhile the query is running, `is_partial` is always set to `true`.', - }), - is_running: z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether the search is still running or has completed.\n\n> info\n> If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though `is_running` is `false`.', - }), - expiration_time: z.optional(types_date_time), - expiration_time_in_millis: types_epoch_time_unit_millis, - start_time: z.optional(types_date_time), - start_time_in_millis: types_epoch_time_unit_millis, - completion_time: z.optional(types_date_time), - completion_time_in_millis: z.optional(types_epoch_time_unit_millis), - error: z.optional(types_error_cause), -}); - -export const async_search_status_status_response_base = - async_search_types_async_search_response_base.and( - z.object({ - _shards: types_shard_statistics, - _clusters: z.optional(types_cluster_statistics), - completion_status: z.optional( - z.number().register(z.globalRegistry, { - description: - 'If the async search completed, this field shows the status code of the search.\nFor example, `200` indicates that the async search was successfully completed.\n`503` indicates that the async search was completed with an error.', - }) - ), - }) - ); + id: z.optional(types_id), + is_partial: z.boolean().register(z.globalRegistry, { + description: 'When the query is no longer running, this property indicates whether the search failed or was successfully completed on all shards.\nWhile the query is running, `is_partial` is always set to `true`.' + }), + is_running: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the search is still running or has completed.\n\n> info\n> If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though `is_running` is `false`.' + }), + expiration_time: z.optional(types_date_time), + expiration_time_in_millis: types_epoch_time_unit_millis, + start_time: z.optional(types_date_time), + start_time_in_millis: types_epoch_time_unit_millis, + completion_time: z.optional(types_date_time), + completion_time_in_millis: z.optional(types_epoch_time_unit_millis), + error: z.optional(types_error_cause) +}); + +export const async_search_status_status_response_base = async_search_types_async_search_response_base.and(z.object({ + _shards: types_shard_statistics, + _clusters: z.optional(types_cluster_statistics), + completion_status: z.optional(z.number().register(z.globalRegistry, { + description: 'If the async search completed, this field shows the status code of the search.\nFor example, `200` indicates that the async search was successfully completed.\n`503` indicates that the async search was completed with an error.' + })) +})); -export const types_indices = z.union([types_index_name, z.array(types_index_name)]); +export const types_indices = z.union([ + types_index_name, + z.array(types_index_name) +]); -export const types_query_dsl_operator = z.enum(['and', 'AND', 'or', 'OR']); +export const types_query_dsl_operator = z.enum([ + 'and', + 'AND', + 'or', + 'OR' +]); -export const types_fields = z.union([types_field, z.array(types_field)]); +export const types_fields = z.union([ + types_field, + z.array(types_field) +]); -export const types_expand_wildcard = z.enum(['all', 'open', 'closed', 'hidden', 'none']); +export const types_expand_wildcard = z.enum([ + 'all', + 'open', + 'closed', + 'hidden', + 'none' +]); export const types_expand_wildcards = z.union([ - types_expand_wildcard, - z.array(types_expand_wildcard), + types_expand_wildcard, + z.array(types_expand_wildcard) ]); export const types_search_type = z.enum(['query_then_fetch', 'dfs_query_then_fetch']); -export const types_suggest_mode = z.enum(['missing', 'popular', 'always']); +export const types_suggest_mode = z.enum([ + 'missing', + 'popular', + 'always' +]); /** * Number of hits matching the query to count accurately. If true, the exact @@ -1889,206 +1685,182 @@ export const types_suggest_mode = z.enum(['missing', 'popular', 'always']); * response does not include the total number of hits matching the query. * Defaults to 10,000 hits. */ -export const global_search_types_track_hits = z.union([z.boolean(), z.number()]); +export const global_search_types_track_hits = z.union([ + z.boolean(), + z.number() +]); /** * Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered. * Used as a query parameter along with the `_source_includes` and `_source_excludes` parameters. */ -export const global_search_types_source_config_param = z.union([z.boolean(), types_fields]); +export const global_search_types_source_config_param = z.union([ + z.boolean(), + types_fields +]); /** * The minimum number of terms that should match as integer, percentage or range */ -export const types_minimum_should_match = z.union([z.number(), z.string()]); +export const types_minimum_should_match = z.union([ + z.number(), + z.string() +]); export const types_query_dsl_query_base = z.object({ - boost: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Floating point number used to decrease or increase the relevance scores of the query.\nBoost values are relative to the default value of 1.0.\nA boost value between 0 and 1.0 decreases the relevance score.\nA value greater than 1.0 increases the relevance score.', - }) - ), - _name: z.optional(z.string()), + boost: z.optional(z.number().register(z.globalRegistry, { + description: 'Floating point number used to decrease or increase the relevance scores of the query.\nBoost values are relative to the default value of 1.0.\nA boost value between 0 and 1.0 decreases the relevance score.\nA value greater than 1.0 increases the relevance score.' + })), + _name: z.optional(z.string()) }); -export const types_query_dsl_common_terms_query = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_common_terms_query = types_query_dsl_query_base.and(z.object({ analyzer: z.optional(z.string()), cutoff_frequency: z.optional(z.number()), high_freq_operator: z.optional(types_query_dsl_operator), low_freq_operator: z.optional(types_query_dsl_operator), minimum_should_match: z.optional(types_minimum_should_match), - query: z.string(), - }) -); + query: z.string() +})); export const types_query_dsl_combined_fields_operator = z.enum(['or', 'and']); export const types_query_dsl_combined_fields_zero_terms = z.enum(['none', 'all']); -export const types_query_dsl_combined_fields_query = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_combined_fields_query = types_query_dsl_query_base.and(z.object({ fields: z.array(types_field).register(z.globalRegistry, { - description: - 'List of fields to search. Field wildcard patterns are allowed. Only `text` fields are supported, and they must all have the same search `analyzer`.', + description: 'List of fields to search. Field wildcard patterns are allowed. Only `text` fields are supported, and they must all have the same search `analyzer`.' }), query: z.string().register(z.globalRegistry, { - description: - 'Text to search for in the provided `fields`.\nThe `combined_fields` query analyzes the provided text before performing a search.', - }), - auto_generate_synonyms_phrase_query: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, match phrase queries are automatically created for multi-term synonyms.', - }) - ), + description: 'Text to search for in the provided `fields`.\nThe `combined_fields` query analyzes the provided text before performing a search.' + }), + auto_generate_synonyms_phrase_query: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, match phrase queries are automatically created for multi-term synonyms.' + })), operator: z.optional(types_query_dsl_combined_fields_operator), minimum_should_match: z.optional(types_minimum_should_match), - zero_terms_query: z.optional(types_query_dsl_combined_fields_zero_terms), - }) -); + zero_terms_query: z.optional(types_query_dsl_combined_fields_zero_terms) +})); -export const types_query_dsl_distance_feature_query_base = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_distance_feature_query_base = types_query_dsl_query_base.and(z.object({ origin: z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'Date or point of origin used to calculate distances.\nIf the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.\nDate Math, such as `now-1h`, is supported.\nIf the field value is a `geo_point` field, the `origin` value must be a geopoint.', + description: 'Date or point of origin used to calculate distances.\nIf the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.\nDate Math, such as `now-1h`, is supported.\nIf the field value is a `geo_point` field, the `origin` value must be a geopoint.' }), pivot: z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'Distance from the `origin` at which relevance scores receive half of the `boost` value.\nIf the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.', + description: 'Distance from the `origin` at which relevance scores receive half of the `boost` value.\nIf the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.' }), - field: types_field, - }) -); + field: types_field +})); -export const types_query_dsl_untyped_distance_feature_query = - types_query_dsl_distance_feature_query_base.and(z.record(z.string(), z.unknown())); +export const types_query_dsl_untyped_distance_feature_query = types_query_dsl_distance_feature_query_base.and(z.record(z.string(), z.unknown())); export const types_distance = z.string(); -export const types_query_dsl_distance_feature_query_base_geo_location_distance = - types_query_dsl_query_base.and( - z.object({ - origin: types_geo_location, - pivot: types_distance, - field: types_field, - }) - ); +export const types_query_dsl_distance_feature_query_base_geo_location_distance = types_query_dsl_query_base.and(z.object({ + origin: types_geo_location, + pivot: types_distance, + field: types_field +})); -export const types_query_dsl_geo_distance_feature_query = - types_query_dsl_distance_feature_query_base_geo_location_distance.and( - z.record(z.string(), z.unknown()) - ); +export const types_query_dsl_geo_distance_feature_query = types_query_dsl_distance_feature_query_base_geo_location_distance.and(z.record(z.string(), z.unknown())); export const types_date_math = z.string(); -export const types_query_dsl_distance_feature_query_base_date_math_duration = - types_query_dsl_query_base.and( - z.object({ - origin: types_date_math, - pivot: types_duration, - field: types_field, - }) - ); +export const types_query_dsl_distance_feature_query_base_date_math_duration = types_query_dsl_query_base.and(z.object({ + origin: types_date_math, + pivot: types_duration, + field: types_field +})); -export const types_query_dsl_date_distance_feature_query = - types_query_dsl_distance_feature_query_base_date_math_duration.and( - z.record(z.string(), z.unknown()) - ); +export const types_query_dsl_date_distance_feature_query = types_query_dsl_distance_feature_query_base_date_math_duration.and(z.record(z.string(), z.unknown())); export const types_query_dsl_distance_feature_query = z.union([ - types_query_dsl_untyped_distance_feature_query, - types_query_dsl_geo_distance_feature_query, - types_query_dsl_date_distance_feature_query, + types_query_dsl_untyped_distance_feature_query, + types_query_dsl_geo_distance_feature_query, + types_query_dsl_date_distance_feature_query ]); -export const types_query_dsl_exists_query = types_query_dsl_query_base.and( - z.object({ - field: types_field, - }) -); +export const types_query_dsl_exists_query = types_query_dsl_query_base.and(z.object({ + field: types_field +})); export const types_query_dsl_function_boost_mode = z.enum([ - 'multiply', - 'replace', - 'sum', - 'avg', - 'max', - 'min', + 'multiply', + 'replace', + 'sum', + 'avg', + 'max', + 'min' ]); -export const types_query_dsl_multi_value_mode = z.enum(['min', 'max', 'avg', 'sum']); +export const types_query_dsl_multi_value_mode = z.enum([ + 'min', + 'max', + 'avg', + 'sum' +]); export const types_query_dsl_decay_function_base = z.object({ - multi_value_mode: z.optional(types_query_dsl_multi_value_mode), + multi_value_mode: z.optional(types_query_dsl_multi_value_mode) }); -export const types_query_dsl_untyped_decay_function = types_query_dsl_decay_function_base.and( - z.record(z.string(), z.unknown()) -); +export const types_query_dsl_untyped_decay_function = types_query_dsl_decay_function_base.and(z.record(z.string(), z.unknown())); export const types_query_dsl_decay_function_base_date_math_duration = z.object({ - multi_value_mode: z.optional(types_query_dsl_multi_value_mode), + multi_value_mode: z.optional(types_query_dsl_multi_value_mode) }); -export const types_query_dsl_date_decay_function = - types_query_dsl_decay_function_base_date_math_duration.and(z.record(z.string(), z.unknown())); +export const types_query_dsl_date_decay_function = types_query_dsl_decay_function_base_date_math_duration.and(z.record(z.string(), z.unknown())); export const types_query_dsl_decay_function_basedoubledouble = z.object({ - multi_value_mode: z.optional(types_query_dsl_multi_value_mode), + multi_value_mode: z.optional(types_query_dsl_multi_value_mode) }); -export const types_query_dsl_numeric_decay_function = - types_query_dsl_decay_function_basedoubledouble.and(z.record(z.string(), z.unknown())); +export const types_query_dsl_numeric_decay_function = types_query_dsl_decay_function_basedoubledouble.and(z.record(z.string(), z.unknown())); export const types_query_dsl_decay_function_base_geo_location_distance = z.object({ - multi_value_mode: z.optional(types_query_dsl_multi_value_mode), + multi_value_mode: z.optional(types_query_dsl_multi_value_mode) }); -export const types_query_dsl_geo_decay_function = - types_query_dsl_decay_function_base_geo_location_distance.and(z.record(z.string(), z.unknown())); +export const types_query_dsl_geo_decay_function = types_query_dsl_decay_function_base_geo_location_distance.and(z.record(z.string(), z.unknown())); export const types_query_dsl_decay_function = z.union([ - types_query_dsl_untyped_decay_function, - types_query_dsl_date_decay_function, - types_query_dsl_numeric_decay_function, - types_query_dsl_geo_decay_function, + types_query_dsl_untyped_decay_function, + types_query_dsl_date_decay_function, + types_query_dsl_numeric_decay_function, + types_query_dsl_geo_decay_function ]); export const types_query_dsl_field_value_factor_modifier = z.enum([ - 'none', - 'log', - 'log1p', - 'log2p', - 'ln', - 'ln1p', - 'ln2p', - 'square', - 'sqrt', - 'reciprocal', + 'none', + 'log', + 'log1p', + 'log2p', + 'ln', + 'ln1p', + 'ln2p', + 'square', + 'sqrt', + 'reciprocal' ]); export const types_query_dsl_field_value_factor_score_function = z.object({ - field: types_field, - factor: z.optional( - z.number().register(z.globalRegistry, { - description: 'Optional factor to multiply the field value with.', - }) - ), - missing: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Value used if the document doesn’t have that field.\nThe modifier and factor are still applied to it as though it were read from the document.', - }) - ), - modifier: z.optional(types_query_dsl_field_value_factor_modifier), + field: types_field, + factor: z.optional(z.number().register(z.globalRegistry, { + description: 'Optional factor to multiply the field value with.' + })), + missing: z.optional(z.number().register(z.globalRegistry, { + description: 'Value used if the document doesn’t have that field.\nThe modifier and factor are still applied to it as though it were read from the document.' + })), + modifier: z.optional(types_query_dsl_field_value_factor_modifier) }); export const types_query_dsl_random_score_function = z.object({ - field: z.optional(types_field), - seed: z.optional(z.union([z.number(), z.string()])), + field: z.optional(types_field), + seed: z.optional(z.union([ + z.number(), + z.string() + ])) }); export const types_name = z.string(); @@ -2096,28 +1868,32 @@ export const types_name = z.string(); /** * A reference to a field with formatting instructions on how to return the value */ -export const types_query_dsl_field_and_format = z - .object({ +export const types_query_dsl_field_and_format = z.object({ field: types_field, - format: z.optional( - z.string().register(z.globalRegistry, { - description: 'The format in which the values are returned.', - }) - ), - include_unmapped: z.optional(z.boolean()), - }) - .register(z.globalRegistry, { - description: 'A reference to a field with formatting instructions on how to return the value', - }); + format: z.optional(z.string().register(z.globalRegistry, { + description: 'The format in which the values are returned.' + })), + include_unmapped: z.optional(z.boolean()) +}).register(z.globalRegistry, { + description: 'A reference to a field with formatting instructions on how to return the value' +}); export const global_search_types_highlighter_encoder = z.enum(['default', 'html']); export const global_search_types_highlighter_type = z.union([ - z.enum(['plain', 'fvh', 'unified']), - z.string(), + z.enum([ + 'plain', + 'fvh', + 'unified' + ]), + z.string() ]); -export const global_search_types_boundary_scanner = z.enum(['chars', 'sentence', 'word']); +export const global_search_types_boundary_scanner = z.enum([ + 'chars', + 'sentence', + 'word' +]); export const global_search_types_highlighter_fragmenter = z.enum(['simple', 'span']); @@ -2128,599 +1904,517 @@ export const global_search_types_highlighter_tags_schema = z.enum(['styled']); export const types_sort_order = z.enum(['asc', 'desc']); export const types_score_sort = z.object({ - order: z.optional(types_sort_order), + order: z.optional(types_sort_order) }); -export const types_sort_mode = z.enum(['min', 'max', 'sum', 'avg', 'median']); +export const types_sort_mode = z.enum([ + 'min', + 'max', + 'sum', + 'avg', + 'median' +]); export const types_geo_distance_type = z.enum(['arc', 'plane']); -export const types_distance_unit = z.enum(['in', 'ft', 'yd', 'mi', 'nmi', 'km', 'm', 'cm', 'mm']); +export const types_distance_unit = z.enum([ + 'in', + 'ft', + 'yd', + 'mi', + 'nmi', + 'km', + 'm', + 'cm', + 'mm' +]); -export const types_script_sort_type = z.enum(['string', 'number', 'version']); +export const types_script_sort_type = z.enum([ + 'string', + 'number', + 'version' +]); export const global_search_types_source_filter = z.object({ - exclude_vectors: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, vector fields are excluded from the returned source.\n\nThis option takes precedence over `includes`: any vector field will\nremain excluded even if it matches an `includes` rule.', - }) - ), - excludes: z.optional(types_fields), - includes: z.optional(types_fields), + exclude_vectors: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, vector fields are excluded from the returned source.\n\nThis option takes precedence over `includes`: any vector field will\nremain excluded even if it matches an `includes` rule.' + })), + excludes: z.optional(types_fields), + includes: z.optional(types_fields) }); /** * Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered. */ export const global_search_types_source_config = z.union([ - z.boolean(), - global_search_types_source_filter, + z.boolean(), + global_search_types_source_filter ]); export const types_query_vector = z.array(z.number()); export const types_text_embedding = z.object({ - model_id: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Model ID is required for all dense_vector fields but\nmay be inferred for semantic_text fields', - }) - ), - model_text: z.string(), + model_id: z.optional(z.string().register(z.globalRegistry, { + description: 'Model ID is required for all dense_vector fields but\nmay be inferred for semantic_text fields' + })), + model_text: z.string() }); export const types_query_vector_builder = z.object({ - text_embedding: z.optional(types_text_embedding), + text_embedding: z.optional(types_text_embedding) }); export const types_rescore_vector = z.object({ - oversample: z.number().register(z.globalRegistry, { - description: 'Applies the specified oversample factor to k on the approximate kNN search', - }), + oversample: z.number().register(z.globalRegistry, { + description: 'Applies the specified oversample factor to k on the approximate kNN search' + }) }); export const types_rank_base = z.record(z.string(), z.unknown()); -export const types_rrf_rank = types_rank_base.and( - z.object({ - rank_constant: z.optional( - z.number().register(z.globalRegistry, { - description: - 'How much influence documents in individual result sets per query have over the final ranked result set', - }) - ), - rank_window_size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Size of the individual result sets per query', - }) - ), - }) -); +export const types_rrf_rank = types_rank_base.and(z.object({ + rank_constant: z.optional(z.number().register(z.globalRegistry, { + description: 'How much influence documents in individual result sets per query have over the final ranked result set' + })), + rank_window_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Size of the individual result sets per query' + })) +})); export const types_rank_container = z.object({ - rrf: z.optional(types_rrf_rank), + rrf: z.optional(types_rrf_rank) }); -export const global_search_types_score_mode = z.enum(['avg', 'max', 'min', 'multiply', 'total']); +export const global_search_types_score_mode = z.enum([ + 'avg', + 'max', + 'min', + 'multiply', + 'total' +]); export const global_search_types_learning_to_rank = z.object({ - model_id: z.string().register(z.globalRegistry, { - description: 'The unique identifier of the trained model uploaded to Elasticsearch', - }), - params: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'Named parameters to be passed to the query templates used for feature', - }) - ), + model_id: z.string().register(z.globalRegistry, { + description: 'The unique identifier of the trained model uploaded to Elasticsearch' + }), + params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Named parameters to be passed to the query templates used for feature' + })) }); export const types_mapping_chunk_rescorer_chunking_settings = z.object({ - strategy: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The chunking strategy: `sentence`, `word`, `none` or `recursive`.\n\n * If `strategy` is set to `recursive`, you must also specify:\n\n- `max_chunk_size`\n- either `separators` or`separator_group`\n\nLearn more about different chunking strategies in the linked documentation.', - }) - ), - separator_group: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Only applicable to the `recursive` strategy and required when using it.\n\nSets a predefined list of separators in the saved chunking settings based on the selected text type.\nValues can be `markdown` or `plaintext`.\n\nUsing this parameter is an alternative to manually specifying a custom `separators` list.', - }) - ), - separators: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'Only applicable to the `recursive` strategy and required when using it.\n\nA list of strings used as possible split points when chunking text.\n\nEach string can be a plain string or a regular expression (regex) pattern.\nThe system tries each separator in order to split the text, starting from the first item in the list.\n\nAfter splitting, it attempts to recombine smaller pieces into larger chunks that stay within\nthe `max_chunk_size` limit, to reduce the total number of chunks generated.', - }) - ), - max_chunk_size: z.number().register(z.globalRegistry, { - description: - 'The maximum size of a chunk in words.\nThis value cannot be lower than `20` (for `sentence` strategy) or `10` (for `word` strategy).\nThis value should not exceed the window size for the associated model.', - }), - overlap: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of overlapping words for chunks.\nIt is applicable only to a `word` chunking strategy.\nThis value cannot be higher than half the `max_chunk_size` value.', - }) - ), - sentence_overlap: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of overlapping sentences for chunks.\nIt is applicable only for a `sentence` chunking strategy.\nIt can be either `1` or `0`.', - }) - ), + strategy: z.optional(z.string().register(z.globalRegistry, { + description: 'The chunking strategy: `sentence`, `word`, `none` or `recursive`.\n\n * If `strategy` is set to `recursive`, you must also specify:\n\n- `max_chunk_size`\n- either `separators` or`separator_group`\n\nLearn more about different chunking strategies in the linked documentation.' + })), + separator_group: z.optional(z.string().register(z.globalRegistry, { + description: 'Only applicable to the `recursive` strategy and required when using it.\n\nSets a predefined list of separators in the saved chunking settings based on the selected text type.\nValues can be `markdown` or `plaintext`.\n\nUsing this parameter is an alternative to manually specifying a custom `separators` list.' + })), + separators: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Only applicable to the `recursive` strategy and required when using it.\n\nA list of strings used as possible split points when chunking text.\n\nEach string can be a plain string or a regular expression (regex) pattern.\nThe system tries each separator in order to split the text, starting from the first item in the list.\n\nAfter splitting, it attempts to recombine smaller pieces into larger chunks that stay within\nthe `max_chunk_size` limit, to reduce the total number of chunks generated.' + })), + max_chunk_size: z.number().register(z.globalRegistry, { + description: 'The maximum size of a chunk in words.\nThis value cannot be lower than `20` (for `sentence` strategy) or `10` (for `word` strategy).\nThis value should not exceed the window size for the associated model.' + }), + overlap: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of overlapping words for chunks.\nIt is applicable only to a `word` chunking strategy.\nThis value cannot be higher than half the `max_chunk_size` value.' + })), + sentence_overlap: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of overlapping sentences for chunks.\nIt is applicable only for a `sentence` chunking strategy.\nIt can be either `1` or `0`.' + })) }); export const types_chunk_rescorer = z.object({ - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of chunks per document to evaluate for reranking.', - }) - ), - chunking_settings: z.optional(types_mapping_chunk_rescorer_chunking_settings), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of chunks per document to evaluate for reranking.' + })), + chunking_settings: z.optional(types_mapping_chunk_rescorer_chunking_settings) }); -export const types_score_normalizer = z.enum(['none', 'minmax', 'l2_norm']); +export const types_score_normalizer = z.enum([ + 'none', + 'minmax', + 'l2_norm' +]); export const types_specified_document = z.object({ - index: z.optional(types_index_name), - id: types_id, + index: z.optional(types_index_name), + id: types_id }); export const types_diversify_retriever_types = z.enum(['mmr']); export const types_sliced_scroll = z.object({ - field: z.optional(types_field), - id: types_id, - max: z.number(), + field: z.optional(types_field), + id: types_id, + max: z.number() }); export const global_search_types_suggester = z.object({ - text: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Global suggest text, to avoid repetition when the same text is used in several suggesters', - }) - ), + text: z.optional(z.string().register(z.globalRegistry, { + description: 'Global suggest text, to avoid repetition when the same text is used in several suggesters' + })) }); export const global_search_types_point_in_time_reference = z.object({ - id: types_id, - keep_alive: z.optional(types_duration), + id: types_id, + keep_alive: z.optional(types_duration) }); export const types_mapping_runtime_field_type = z.enum([ - 'boolean', - 'composite', - 'date', - 'double', - 'geo_point', - 'geo_shape', - 'ip', - 'keyword', - 'long', - 'lookup', + 'boolean', + 'composite', + 'date', + 'double', + 'geo_point', + 'geo_shape', + 'ip', + 'keyword', + 'long', + 'lookup' ]); export const types_mapping_composite_sub_field = z.object({ - type: types_mapping_runtime_field_type, + type: types_mapping_runtime_field_type }); export const types_mapping_runtime_field_fetch_fields = z.object({ - field: types_field, - format: z.optional(z.string()), + field: types_field, + format: z.optional(z.string()) }); export const types_script_language = z.union([ - z.enum(['painless', 'expression', 'mustache', 'java']), - z.string(), + z.enum([ + 'painless', + 'expression', + 'mustache', + 'java' + ]), + z.string() ]); export const types_query_dsl_function_score_mode = z.enum([ - 'multiply', - 'sum', - 'avg', - 'first', - 'max', - 'min', + 'multiply', + 'sum', + 'avg', + 'first', + 'max', + 'min' ]); export const types_multi_term_query_rewrite = z.string(); -export const types_fuzziness = z.union([z.string(), z.number()]); - -export const types_query_dsl_fuzzy_query = types_query_dsl_query_base.and( - z.object({ - max_expansions: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum number of variations created.', - }) - ), - prefix_length: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of beginning characters left unchanged when creating expansions.', - }) - ), +export const types_fuzziness = z.union([ + z.string(), + z.number() +]); + +export const types_query_dsl_fuzzy_query = types_query_dsl_query_base.and(z.object({ + max_expansions: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of variations created.' + })), + prefix_length: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of beginning characters left unchanged when creating expansions.' + })), rewrite: z.optional(types_multi_term_query_rewrite), - transpositions: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether edits include transpositions of two adjacent characters (for example `ab` to `ba`).', - }) - ), + transpositions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether edits include transpositions of two adjacent characters (for example `ab` to `ba`).' + })), fuzziness: z.optional(types_fuzziness), - value: z.union([z.string(), z.number(), z.boolean()]), - }) -); + value: z.union([ + z.string(), + z.number(), + z.boolean() + ]) +})); export const types_query_dsl_geo_execution = z.enum(['memory', 'indexed']); export const types_query_dsl_geo_validation_method = z.enum([ - 'coerce', - 'ignore_malformed', - 'strict', + 'coerce', + 'ignore_malformed', + 'strict' ]); -export const types_query_dsl_geo_bounding_box_query = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_geo_bounding_box_query = types_query_dsl_query_base.and(z.object({ type: z.optional(types_query_dsl_geo_execution), validation_method: z.optional(types_query_dsl_geo_validation_method), - ignore_unmapped: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` to ignore an unmapped field and not match any documents for this query.\nSet to `false` to throw an exception if the field is not mapped.', - }) - ), - }) -); - -export const types_query_dsl_geo_distance_query = types_query_dsl_query_base.and( - z.object({ + ignore_unmapped: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` to ignore an unmapped field and not match any documents for this query.\nSet to `false` to throw an exception if the field is not mapped.' + })) +})); + +export const types_query_dsl_geo_distance_query = types_query_dsl_query_base.and(z.object({ distance: types_distance, distance_type: z.optional(types_geo_distance_type), validation_method: z.optional(types_query_dsl_geo_validation_method), - ignore_unmapped: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` to ignore an unmapped field and not match any documents for this query.\nSet to `false` to throw an exception if the field is not mapped.', - }) - ), - }) -); - -export const types_query_dsl_geo_grid_query = types_query_dsl_query_base.and( - z.object({ + ignore_unmapped: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` to ignore an unmapped field and not match any documents for this query.\nSet to `false` to throw an exception if the field is not mapped.' + })) +})); + +export const types_query_dsl_geo_grid_query = types_query_dsl_query_base.and(z.object({ geotile: z.optional(types_geo_tile), geohash: z.optional(types_geo_hash), - geohex: z.optional(types_geo_hex_cell), - }) -); + geohex: z.optional(types_geo_hex_cell) +})); -export const types_query_dsl_geo_polygon_query = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_geo_polygon_query = types_query_dsl_query_base.and(z.object({ validation_method: z.optional(types_query_dsl_geo_validation_method), - ignore_unmapped: z.optional(z.boolean()), - }) -); - -export const types_query_dsl_geo_shape_query = types_query_dsl_query_base.and( - z.object({ - ignore_unmapped: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` to ignore an unmapped field and not match any documents for this query.\nSet to `false` to throw an exception if the field is not mapped.', - }) - ), - }) -); - -export const types_query_dsl_child_score_mode = z.enum(['none', 'avg', 'sum', 'max', 'min']); + ignore_unmapped: z.optional(z.boolean()) +})); + +export const types_query_dsl_geo_shape_query = types_query_dsl_query_base.and(z.object({ + ignore_unmapped: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` to ignore an unmapped field and not match any documents for this query.\nSet to `false` to throw an exception if the field is not mapped.' + })) +})); + +export const types_query_dsl_child_score_mode = z.enum([ + 'none', + 'avg', + 'sum', + 'max', + 'min' +]); export const types_relation_name = z.string(); -export const types_ids = z.union([types_id, z.array(types_id)]); +export const types_ids = z.union([ + types_id, + z.array(types_id) +]); -export const types_query_dsl_ids_query = types_query_dsl_query_base.and( - z.object({ - values: z.optional(types_ids), - }) -); +export const types_query_dsl_ids_query = types_query_dsl_query_base.and(z.object({ + values: z.optional(types_ids) +})); export const types_query_dsl_intervals_fuzzy = z.object({ - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: 'Analyzer used to normalize the term.', - }) - ), - fuzziness: z.optional(types_fuzziness), - prefix_length: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of beginning characters left unchanged when creating expansions.', - }) - ), - term: z.string().register(z.globalRegistry, { - description: 'The term to match.', - }), - transpositions: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether edits include transpositions of two adjacent characters (for example, `ab` to `ba`).', - }) - ), - use_field: z.optional(types_field), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer used to normalize the term.' + })), + fuzziness: z.optional(types_fuzziness), + prefix_length: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of beginning characters left unchanged when creating expansions.' + })), + term: z.string().register(z.globalRegistry, { + description: 'The term to match.' + }), + transpositions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether edits include transpositions of two adjacent characters (for example, `ab` to `ba`).' + })), + use_field: z.optional(types_field) }); export const types_query_dsl_intervals_prefix = z.object({ - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: 'Analyzer used to analyze the `prefix`.', - }) - ), - prefix: z.string().register(z.globalRegistry, { - description: 'Beginning characters of terms you wish to find in the top-level field.', - }), - use_field: z.optional(types_field), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer used to analyze the `prefix`.' + })), + prefix: z.string().register(z.globalRegistry, { + description: 'Beginning characters of terms you wish to find in the top-level field.' + }), + use_field: z.optional(types_field) }); export const types_query_dsl_intervals_range = z.object({ - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: 'Analyzer used to analyze the `prefix`.', - }) - ), - gte: z.optional( - z.string().register(z.globalRegistry, { - description: 'Lower term, either gte or gt must be provided.', - }) - ), - gt: z.optional( - z.string().register(z.globalRegistry, { - description: 'Lower term, either gte or gt must be provided.', - }) - ), - lte: z.optional( - z.string().register(z.globalRegistry, { - description: 'Upper term, either lte or lt must be provided.', - }) - ), - lt: z.optional( - z.string().register(z.globalRegistry, { - description: 'Upper term, either lte or lt must be provided.', - }) - ), - use_field: z.optional(types_field), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer used to analyze the `prefix`.' + })), + gte: z.optional(z.string().register(z.globalRegistry, { + description: 'Lower term, either gte or gt must be provided.' + })), + gt: z.optional(z.string().register(z.globalRegistry, { + description: 'Lower term, either gte or gt must be provided.' + })), + lte: z.optional(z.string().register(z.globalRegistry, { + description: 'Upper term, either lte or lt must be provided.' + })), + lt: z.optional(z.string().register(z.globalRegistry, { + description: 'Upper term, either lte or lt must be provided.' + })), + use_field: z.optional(types_field) }); export const types_query_dsl_intervals_regexp = z.object({ - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: 'Analyzer used to analyze the `prefix`.', - }) - ), - pattern: z.string().register(z.globalRegistry, { - description: 'Regex pattern.', - }), - use_field: z.optional(types_field), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer used to analyze the `prefix`.' + })), + pattern: z.string().register(z.globalRegistry, { + description: 'Regex pattern.' + }), + use_field: z.optional(types_field) }); export const types_query_dsl_intervals_wildcard = z.object({ - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - "Analyzer used to analyze the `pattern`.\nDefaults to the top-level field's analyzer.", - }) - ), - pattern: z.string().register(z.globalRegistry, { - description: 'Wildcard pattern used to find matching terms.', - }), - use_field: z.optional(types_field), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer used to analyze the `pattern`.\nDefaults to the top-level field\'s analyzer.' + })), + pattern: z.string().register(z.globalRegistry, { + description: 'Wildcard pattern used to find matching terms.' + }), + use_field: z.optional(types_field) }); export const types_query_dsl_zero_terms_query = z.enum(['all', 'none']); export const types_query_dsl_match_query = z.union([ - z.string().register(z.globalRegistry, { - description: 'Short query syntax for match query', - }), - types_query_dsl_query_base.and( - z.object({ - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: 'Analyzer used to convert the text in the query value into tokens.', - }) - ), - auto_generate_synonyms_phrase_query: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, match phrase queries are automatically created for multi-term synonyms.', - }) - ), - cutoff_frequency: z.optional(z.number()), - fuzziness: z.optional(types_fuzziness), - fuzzy_rewrite: z.optional(types_multi_term_query_rewrite), - fuzzy_transpositions: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based errors, such as providing a text query value for a numeric field, are ignored.', - }) - ), - max_expansions: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum number of terms to which the query will expand.', - }) - ), - minimum_should_match: z.optional(types_minimum_should_match), - operator: z.optional(types_query_dsl_operator), - prefix_length: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of beginning characters left unchanged for fuzzy matching.', - }) - ), - query: z.union([z.string(), z.number(), z.boolean()]), - zero_terms_query: z.optional(types_query_dsl_zero_terms_query), - }) - ), + z.string().register(z.globalRegistry, { + description: 'Short query syntax for match query' + }), + types_query_dsl_query_base.and(z.object({ + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer used to convert the text in the query value into tokens.' + })), + auto_generate_synonyms_phrase_query: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, match phrase queries are automatically created for multi-term synonyms.' + })), + cutoff_frequency: z.optional(z.number()), + fuzziness: z.optional(types_fuzziness), + fuzzy_rewrite: z.optional(types_multi_term_query_rewrite), + fuzzy_transpositions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based errors, such as providing a text query value for a numeric field, are ignored.' + })), + max_expansions: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of terms to which the query will expand.' + })), + minimum_should_match: z.optional(types_minimum_should_match), + operator: z.optional(types_query_dsl_operator), + prefix_length: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of beginning characters left unchanged for fuzzy matching.' + })), + query: z.union([ + z.string(), + z.number(), + z.boolean() + ]), + zero_terms_query: z.optional(types_query_dsl_zero_terms_query) + })) ]); -export const types_query_dsl_match_all_query = types_query_dsl_query_base.and( - z.record(z.string(), z.unknown()) -); +export const types_query_dsl_match_all_query = types_query_dsl_query_base.and(z.record(z.string(), z.unknown())); -export const types_query_dsl_match_bool_prefix_query = types_query_dsl_query_base.and( - z.object({ - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: 'Analyzer used to convert the text in the query value into tokens.', - }) - ), +export const types_query_dsl_match_bool_prefix_query = types_query_dsl_query_base.and(z.object({ + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer used to convert the text in the query value into tokens.' + })), fuzziness: z.optional(types_fuzziness), fuzzy_rewrite: z.optional(types_multi_term_query_rewrite), - fuzzy_transpositions: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).\nCan be applied to the term subqueries constructed for all terms but the final term.', - }) - ), - max_expansions: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of terms to which the query will expand.\nCan be applied to the term subqueries constructed for all terms but the final term.', - }) - ), + fuzzy_transpositions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).\nCan be applied to the term subqueries constructed for all terms but the final term.' + })), + max_expansions: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of terms to which the query will expand.\nCan be applied to the term subqueries constructed for all terms but the final term.' + })), minimum_should_match: z.optional(types_minimum_should_match), operator: z.optional(types_query_dsl_operator), - prefix_length: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Number of beginning characters left unchanged for fuzzy matching.\nCan be applied to the term subqueries constructed for all terms but the final term.', - }) - ), + prefix_length: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of beginning characters left unchanged for fuzzy matching.\nCan be applied to the term subqueries constructed for all terms but the final term.' + })), query: z.string().register(z.globalRegistry, { - description: - 'Terms you wish to find in the provided field.\nThe last term is used in a prefix query.', - }), - }) -); - -export const types_query_dsl_match_none_query = types_query_dsl_query_base.and( - z.record(z.string(), z.unknown()) -); - -export const types_query_dsl_match_phrase_query = types_query_dsl_query_base.and( - z.object({ - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: 'Analyzer used to convert the text in the query value into tokens.', - }) - ), + description: 'Terms you wish to find in the provided field.\nThe last term is used in a prefix query.' + }) +})); + +export const types_query_dsl_match_none_query = types_query_dsl_query_base.and(z.record(z.string(), z.unknown())); + +export const types_query_dsl_match_phrase_query = types_query_dsl_query_base.and(z.object({ + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer used to convert the text in the query value into tokens.' + })), query: z.string().register(z.globalRegistry, { - description: 'Query terms that are analyzed and turned into a phrase query.', - }), - slop: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum number of positions allowed between matching tokens.', - }) - ), - zero_terms_query: z.optional(types_query_dsl_zero_terms_query), - }) -); - -export const types_query_dsl_match_phrase_prefix_query = types_query_dsl_query_base.and( - z.object({ - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: 'Analyzer used to convert text in the query value into tokens.', - }) - ), - max_expansions: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of terms to which the last provided term of the query value will expand.', - }) - ), + description: 'Query terms that are analyzed and turned into a phrase query.' + }), + slop: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of positions allowed between matching tokens.' + })), + zero_terms_query: z.optional(types_query_dsl_zero_terms_query) +})); + +export const types_query_dsl_match_phrase_prefix_query = types_query_dsl_query_base.and(z.object({ + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer used to convert text in the query value into tokens.' + })), + max_expansions: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of terms to which the last provided term of the query value will expand.' + })), query: z.string().register(z.globalRegistry, { - description: 'Text you wish to find in the provided field.', + description: 'Text you wish to find in the provided field.' }), - slop: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum number of positions allowed between matching tokens.', - }) - ), - zero_terms_query: z.optional(types_query_dsl_zero_terms_query), - }) -); + slop: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of positions allowed between matching tokens.' + })), + zero_terms_query: z.optional(types_query_dsl_zero_terms_query) +})); -export const types_version_type = z.enum(['internal', 'external', 'external_gte']); +export const types_version_type = z.enum([ + 'internal', + 'external', + 'external_gte' +]); export const types_query_dsl_like_document = z.object({ - doc: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: 'A document not present in the index.', - }) - ), - fields: z.optional(z.array(types_field)), - _id: z.optional(types_id), - _index: z.optional(types_index_name), - per_field_analyzer: z.optional( - z.record(z.string(), z.string()).register(z.globalRegistry, { - description: 'Overrides the default analyzer.', - }) - ), - routing: z.optional(types_routing), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), + doc: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'A document not present in the index.' + })), + fields: z.optional(z.array(types_field)), + _id: z.optional(types_id), + _index: z.optional(types_index_name), + per_field_analyzer: z.optional(z.record(z.string(), z.string()).register(z.globalRegistry, { + description: 'Overrides the default analyzer.' + })), + routing: z.optional(types_routing), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type) }); /** * Text that we want similar documents for or a lookup to a document's field for the text. */ -export const types_query_dsl_like = z.union([z.string(), types_query_dsl_like_document]); +export const types_query_dsl_like = z.union([ + z.string(), + types_query_dsl_like_document +]); export const types_analysis_stop_word_language = z.enum([ - '_arabic_', - '_armenian_', - '_basque_', - '_bengali_', - '_brazilian_', - '_bulgarian_', - '_catalan_', - '_cjk_', - '_czech_', - '_danish_', - '_dutch_', - '_english_', - '_estonian_', - '_finnish_', - '_french_', - '_galician_', - '_german_', - '_greek_', - '_hindi_', - '_hungarian_', - '_indonesian_', - '_irish_', - '_italian_', - '_latvian_', - '_lithuanian_', - '_norwegian_', - '_persian_', - '_portuguese_', - '_romanian_', - '_russian_', - '_serbian_', - '_sorani_', - '_spanish_', - '_swedish_', - '_thai_', - '_turkish_', - '_none_', + '_arabic_', + '_armenian_', + '_basque_', + '_bengali_', + '_brazilian_', + '_bulgarian_', + '_catalan_', + '_cjk_', + '_czech_', + '_danish_', + '_dutch_', + '_english_', + '_estonian_', + '_finnish_', + '_french_', + '_galician_', + '_german_', + '_greek_', + '_hindi_', + '_hungarian_', + '_indonesian_', + '_irish_', + '_italian_', + '_latvian_', + '_lithuanian_', + '_norwegian_', + '_persian_', + '_portuguese_', + '_romanian_', + '_russian_', + '_serbian_', + '_sorani_', + '_spanish_', + '_swedish_', + '_thai_', + '_turkish_', + '_none_' ]); /** @@ -2729,550 +2423,374 @@ export const types_analysis_stop_word_language = z.enum([ * Also accepts an array of stop words. */ export const types_analysis_stop_words = z.union([ - types_analysis_stop_word_language, - z.array(z.string()), -]); - -export const types_query_dsl_more_like_this_query = types_query_dsl_query_base.and( - z.object({ - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The analyzer that is used to analyze the free form text.\nDefaults to the analyzer associated with the first field in fields.', - }) - ), - boost_terms: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Each term in the formed query could be further boosted by their tf-idf score.\nThis sets the boost factor to use when using this feature.\nDefaults to deactivated (0).', - }) - ), - fail_on_unsupported_field: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Controls whether the query should fail (throw an exception) if any of the specified fields are not of the supported types (`text` or `keyword`).', - }) - ), - fields: z.optional( - z.array(types_field).register(z.globalRegistry, { - description: - 'A list of fields to fetch and analyze the text from.\nDefaults to the `index.query.default_field` index setting, which has a default value of `*`.', - }) - ), - include: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether the input documents should also be included in the search results returned.', - }) - ), - like: z.union([types_query_dsl_like, z.array(types_query_dsl_like)]), - max_doc_freq: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum document frequency above which the terms are ignored from the input document.', - }) - ), - max_query_terms: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of query terms that can be selected.', - }) - ), - max_word_length: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum word length above which the terms are ignored.\nDefaults to unbounded (`0`).', - }) - ), - min_doc_freq: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The minimum document frequency below which the terms are ignored from the input document.', - }) - ), + types_analysis_stop_word_language, + z.array(z.string()) +]); + +export const types_query_dsl_more_like_this_query = types_query_dsl_query_base.and(z.object({ + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'The analyzer that is used to analyze the free form text.\nDefaults to the analyzer associated with the first field in fields.' + })), + boost_terms: z.optional(z.number().register(z.globalRegistry, { + description: 'Each term in the formed query could be further boosted by their tf-idf score.\nThis sets the boost factor to use when using this feature.\nDefaults to deactivated (0).' + })), + fail_on_unsupported_field: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Controls whether the query should fail (throw an exception) if any of the specified fields are not of the supported types (`text` or `keyword`).' + })), + fields: z.optional(z.array(types_field).register(z.globalRegistry, { + description: 'A list of fields to fetch and analyze the text from.\nDefaults to the `index.query.default_field` index setting, which has a default value of `*`.' + })), + include: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether the input documents should also be included in the search results returned.' + })), + like: z.union([ + types_query_dsl_like, + z.array(types_query_dsl_like) + ]), + max_doc_freq: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum document frequency above which the terms are ignored from the input document.' + })), + max_query_terms: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of query terms that can be selected.' + })), + max_word_length: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum word length above which the terms are ignored.\nDefaults to unbounded (`0`).' + })), + min_doc_freq: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum document frequency below which the terms are ignored from the input document.' + })), minimum_should_match: z.optional(types_minimum_should_match), - min_term_freq: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The minimum term frequency below which the terms are ignored from the input document.', - }) - ), - min_word_length: z.optional( - z.number().register(z.globalRegistry, { - description: 'The minimum word length below which the terms are ignored.', - }) - ), + min_term_freq: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum term frequency below which the terms are ignored from the input document.' + })), + min_word_length: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum word length below which the terms are ignored.' + })), routing: z.optional(types_routing), stop_words: z.optional(types_analysis_stop_words), - unlike: z.optional(z.union([types_query_dsl_like, z.array(types_query_dsl_like)])), + unlike: z.optional(z.union([ + types_query_dsl_like, + z.array(types_query_dsl_like) + ])), version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - }) -); + version_type: z.optional(types_version_type) +})); export const types_query_dsl_text_query_type = z.enum([ - 'best_fields', - 'most_fields', - 'cross_fields', - 'phrase', - 'phrase_prefix', - 'bool_prefix', -]); - -export const types_query_dsl_multi_match_query = types_query_dsl_query_base.and( - z.object({ - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: 'Analyzer used to convert the text in the query value into tokens.', - }) - ), - auto_generate_synonyms_phrase_query: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, match phrase queries are automatically created for multi-term synonyms.', - }) - ), + 'best_fields', + 'most_fields', + 'cross_fields', + 'phrase', + 'phrase_prefix', + 'bool_prefix' +]); + +export const types_query_dsl_multi_match_query = types_query_dsl_query_base.and(z.object({ + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer used to convert the text in the query value into tokens.' + })), + auto_generate_synonyms_phrase_query: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, match phrase queries are automatically created for multi-term synonyms.' + })), cutoff_frequency: z.optional(z.number()), fields: z.optional(types_fields), fuzziness: z.optional(types_fuzziness), fuzzy_rewrite: z.optional(types_multi_term_query_rewrite), - fuzzy_transpositions: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).\nCan be applied to the term subqueries constructed for all terms but the final term.', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based errors, such as providing a text query value for a numeric field, are ignored.', - }) - ), - max_expansions: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum number of terms to which the query will expand.', - }) - ), + fuzzy_transpositions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).\nCan be applied to the term subqueries constructed for all terms but the final term.' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based errors, such as providing a text query value for a numeric field, are ignored.' + })), + max_expansions: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of terms to which the query will expand.' + })), minimum_should_match: z.optional(types_minimum_should_match), operator: z.optional(types_query_dsl_operator), - prefix_length: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of beginning characters left unchanged for fuzzy matching.', - }) - ), + prefix_length: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of beginning characters left unchanged for fuzzy matching.' + })), query: z.string().register(z.globalRegistry, { - description: 'Text, number, boolean value or date you wish to find in the provided field.', - }), - slop: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum number of positions allowed between matching tokens.', - }) - ), - tie_breaker: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Determines how scores for each per-term blended query and scores across groups are combined.', - }) - ), + description: 'Text, number, boolean value or date you wish to find in the provided field.' + }), + slop: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of positions allowed between matching tokens.' + })), + tie_breaker: z.optional(z.number().register(z.globalRegistry, { + description: 'Determines how scores for each per-term blended query and scores across groups are combined.' + })), type: z.optional(types_query_dsl_text_query_type), - zero_terms_query: z.optional(types_query_dsl_zero_terms_query), - }) -); + zero_terms_query: z.optional(types_query_dsl_zero_terms_query) +})); -export const types_query_dsl_parent_id_query = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_parent_id_query = types_query_dsl_query_base.and(z.object({ id: z.optional(types_id), - ignore_unmapped: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether to ignore an unmapped `type` and not return any documents instead of an error.', - }) - ), - type: z.optional(types_relation_name), - }) -); - -export const types_query_dsl_percolate_query = types_query_dsl_query_base.and( - z.object({ - document: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: 'The source of the document being percolated.', - }) - ), - documents: z.optional( - z.array(z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'An array of sources of the documents being percolated.', - }) - ), + ignore_unmapped: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether to ignore an unmapped `type` and not return any documents instead of an error.' + })), + type: z.optional(types_relation_name) +})); + +export const types_query_dsl_percolate_query = types_query_dsl_query_base.and(z.object({ + document: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'The source of the document being percolated.' + })), + documents: z.optional(z.array(z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'An array of sources of the documents being percolated.' + })), field: types_field, id: z.optional(types_id), index: z.optional(types_index_name), - name: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The suffix used for the `_percolator_document_slot` field when multiple `percolate` queries are specified.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: 'Preference used to fetch document to percolate.', - }) - ), + name: z.optional(z.string().register(z.globalRegistry, { + description: 'The suffix used for the `_percolator_document_slot` field when multiple `percolate` queries are specified.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'Preference used to fetch document to percolate.' + })), routing: z.optional(types_routing), - version: z.optional(types_version_number), - }) -); + version: z.optional(types_version_number) +})); export const types_query_dsl_pinned_doc = z.object({ - _id: types_id, - _index: z.optional(types_index_name), + _id: types_id, + _index: z.optional(types_index_name) }); -export const types_query_dsl_prefix_query = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_prefix_query = types_query_dsl_query_base.and(z.object({ rewrite: z.optional(types_multi_term_query_rewrite), value: z.string().register(z.globalRegistry, { - description: 'Beginning characters of terms you wish to find in the provided field.', + description: 'Beginning characters of terms you wish to find in the provided field.' }), - case_insensitive: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Allows ASCII case insensitive matching of the value with the indexed field values when set to `true`.\nDefault is `false` which means the case sensitivity of matching depends on the underlying field’s mapping.', - }) - ), - }) -); + case_insensitive: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Allows ASCII case insensitive matching of the value with the indexed field values when set to `true`.\nDefault is `false` which means the case sensitivity of matching depends on the underlying field’s mapping.' + })) +})); export const types_time_zone = z.string(); -export const types_query_dsl_query_string_query = types_query_dsl_query_base.and( - z.object({ - allow_leading_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the wildcard characters `*` and `?` are allowed as the first character of the query string.', - }) - ), - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: 'Analyzer used to convert text in the query string into tokens.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the query attempts to analyze wildcard terms in the query string.', - }) - ), - auto_generate_synonyms_phrase_query: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, match phrase queries are automatically created for multi-term synonyms.', - }) - ), +export const types_query_dsl_query_string_query = types_query_dsl_query_base.and(z.object({ + allow_leading_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the wildcard characters `*` and `?` are allowed as the first character of the query string.' + })), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer used to convert text in the query string into tokens.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the query attempts to analyze wildcard terms in the query string.' + })), + auto_generate_synonyms_phrase_query: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, match phrase queries are automatically created for multi-term synonyms.' + })), default_field: z.optional(types_field), default_operator: z.optional(types_query_dsl_operator), - enable_position_increments: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, enable position increments in queries constructed from a `query_string` search.', - }) - ), + enable_position_increments: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, enable position increments in queries constructed from a `query_string` search.' + })), escape: z.optional(z.boolean()), - fields: z.optional( - z.array(types_field).register(z.globalRegistry, { - description: 'Array of fields to search. Supports wildcards (`*`).', - }) - ), + fields: z.optional(z.array(types_field).register(z.globalRegistry, { + description: 'Array of fields to search. Supports wildcards (`*`).' + })), fuzziness: z.optional(types_fuzziness), - fuzzy_max_expansions: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum number of terms to which the query expands for fuzzy matching.', - }) - ), - fuzzy_prefix_length: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of beginning characters left unchanged for fuzzy matching.', - }) - ), + fuzzy_max_expansions: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of terms to which the query expands for fuzzy matching.' + })), + fuzzy_prefix_length: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of beginning characters left unchanged for fuzzy matching.' + })), fuzzy_rewrite: z.optional(types_multi_term_query_rewrite), - fuzzy_transpositions: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based errors, such as providing a text value for a numeric field, are ignored.', - }) - ), - max_determinized_states: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum number of automaton states required for the query.', - }) - ), + fuzzy_transpositions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based errors, such as providing a text value for a numeric field, are ignored.' + })), + max_determinized_states: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of automaton states required for the query.' + })), minimum_should_match: z.optional(types_minimum_should_match), - phrase_slop: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum number of positions allowed between matching tokens for phrases.', - }) - ), + phrase_slop: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of positions allowed between matching tokens for phrases.' + })), query: z.string().register(z.globalRegistry, { - description: 'Query string you wish to parse and use for search.', - }), - quote_analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Analyzer used to convert quoted text in the query string into tokens.\nFor quoted text, this parameter overrides the analyzer specified in the `analyzer` parameter.', - }) - ), - quote_field_suffix: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Suffix appended to quoted text in the query string.\nYou can use this suffix to use a different analysis method for exact matches.', - }) - ), + description: 'Query string you wish to parse and use for search.' + }), + quote_analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer used to convert quoted text in the query string into tokens.\nFor quoted text, this parameter overrides the analyzer specified in the `analyzer` parameter.' + })), + quote_field_suffix: z.optional(z.string().register(z.globalRegistry, { + description: 'Suffix appended to quoted text in the query string.\nYou can use this suffix to use a different analysis method for exact matches.' + })), rewrite: z.optional(types_multi_term_query_rewrite), - tie_breaker: z.optional( - z.number().register(z.globalRegistry, { - description: - 'How to combine the queries generated from the individual search terms in the resulting `dis_max` query.', - }) - ), + tie_breaker: z.optional(z.number().register(z.globalRegistry, { + description: 'How to combine the queries generated from the individual search terms in the resulting `dis_max` query.' + })), time_zone: z.optional(types_time_zone), - type: z.optional(types_query_dsl_text_query_type), - }) -); + type: z.optional(types_query_dsl_text_query_type) +})); export const types_date_format = z.string(); -export const types_query_dsl_range_relation = z.enum(['within', 'contains', 'intersects']); +export const types_query_dsl_range_relation = z.enum([ + 'within', + 'contains', + 'intersects' +]); -export const types_query_dsl_range_query_base = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_range_query_base = types_query_dsl_query_base.and(z.object({ relation: z.optional(types_query_dsl_range_relation), - gt: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: 'Greater than.', - }) - ), - gte: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: 'Greater than or equal to.', - }) - ), - lt: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: 'Less than.', - }) - ), - lte: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: 'Less than or equal to.', - }) - ), - }) -); - -export const types_query_dsl_untyped_range_query = types_query_dsl_range_query_base.and( - z.object({ + gt: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'Greater than.' + })), + gte: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'Greater than or equal to.' + })), + lt: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'Less than.' + })), + lte: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'Less than or equal to.' + })) +})); + +export const types_query_dsl_untyped_range_query = types_query_dsl_range_query_base.and(z.object({ format: z.optional(types_date_format), - time_zone: z.optional(types_time_zone), - }) -); + time_zone: z.optional(types_time_zone) +})); -export const types_query_dsl_range_query_base_date_math = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_range_query_base_date_math = types_query_dsl_query_base.and(z.object({ relation: z.optional(types_query_dsl_range_relation), gt: z.optional(types_date_math), gte: z.optional(types_date_math), lt: z.optional(types_date_math), - lte: z.optional(types_date_math), - }) -); + lte: z.optional(types_date_math) +})); -export const types_query_dsl_date_range_query = types_query_dsl_range_query_base_date_math.and( - z.object({ +export const types_query_dsl_date_range_query = types_query_dsl_range_query_base_date_math.and(z.object({ format: z.optional(types_date_format), - time_zone: z.optional(types_time_zone), - }) -); + time_zone: z.optional(types_time_zone) +})); -export const types_query_dsl_range_query_basedouble = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_range_query_basedouble = types_query_dsl_query_base.and(z.object({ relation: z.optional(types_query_dsl_range_relation), - gt: z.optional( - z.number().register(z.globalRegistry, { - description: 'Greater than.', - }) - ), - gte: z.optional( - z.number().register(z.globalRegistry, { - description: 'Greater than or equal to.', - }) - ), - lt: z.optional( - z.number().register(z.globalRegistry, { - description: 'Less than.', - }) - ), - lte: z.optional( - z.number().register(z.globalRegistry, { - description: 'Less than or equal to.', - }) - ), - }) -); - -export const types_query_dsl_number_range_query = types_query_dsl_range_query_basedouble.and( - z.record(z.string(), z.unknown()) -); - -export const types_query_dsl_range_query_basestring = types_query_dsl_query_base.and( - z.object({ + gt: z.optional(z.number().register(z.globalRegistry, { + description: 'Greater than.' + })), + gte: z.optional(z.number().register(z.globalRegistry, { + description: 'Greater than or equal to.' + })), + lt: z.optional(z.number().register(z.globalRegistry, { + description: 'Less than.' + })), + lte: z.optional(z.number().register(z.globalRegistry, { + description: 'Less than or equal to.' + })) +})); + +export const types_query_dsl_number_range_query = types_query_dsl_range_query_basedouble.and(z.record(z.string(), z.unknown())); + +export const types_query_dsl_range_query_basestring = types_query_dsl_query_base.and(z.object({ relation: z.optional(types_query_dsl_range_relation), - gt: z.optional( - z.string().register(z.globalRegistry, { - description: 'Greater than.', - }) - ), - gte: z.optional( - z.string().register(z.globalRegistry, { - description: 'Greater than or equal to.', - }) - ), - lt: z.optional( - z.string().register(z.globalRegistry, { - description: 'Less than.', - }) - ), - lte: z.optional( - z.string().register(z.globalRegistry, { - description: 'Less than or equal to.', - }) - ), - }) -); - -export const types_query_dsl_term_range_query = types_query_dsl_range_query_basestring.and( - z.record(z.string(), z.unknown()) -); + gt: z.optional(z.string().register(z.globalRegistry, { + description: 'Greater than.' + })), + gte: z.optional(z.string().register(z.globalRegistry, { + description: 'Greater than or equal to.' + })), + lt: z.optional(z.string().register(z.globalRegistry, { + description: 'Less than.' + })), + lte: z.optional(z.string().register(z.globalRegistry, { + description: 'Less than or equal to.' + })) +})); + +export const types_query_dsl_term_range_query = types_query_dsl_range_query_basestring.and(z.record(z.string(), z.unknown())); export const types_query_dsl_range_query = z.union([ - types_query_dsl_untyped_range_query, - types_query_dsl_date_range_query, - types_query_dsl_number_range_query, - types_query_dsl_term_range_query, + types_query_dsl_untyped_range_query, + types_query_dsl_date_range_query, + types_query_dsl_number_range_query, + types_query_dsl_term_range_query ]); export const types_query_dsl_rank_feature_function = z.record(z.string(), z.unknown()); -export const types_query_dsl_rank_feature_function_saturation = - types_query_dsl_rank_feature_function.and( - z.object({ - pivot: z.optional( - z.number().register(z.globalRegistry, { - description: 'Configurable pivot value so that the result will be less than 0.5.', - }) - ), - }) - ); +export const types_query_dsl_rank_feature_function_saturation = types_query_dsl_rank_feature_function.and(z.object({ + pivot: z.optional(z.number().register(z.globalRegistry, { + description: 'Configurable pivot value so that the result will be less than 0.5.' + })) +})); -export const types_query_dsl_rank_feature_function_logarithm = - types_query_dsl_rank_feature_function.and( - z.object({ - scaling_factor: z.number().register(z.globalRegistry, { - description: 'Configurable scaling factor.', - }), +export const types_query_dsl_rank_feature_function_logarithm = types_query_dsl_rank_feature_function.and(z.object({ + scaling_factor: z.number().register(z.globalRegistry, { + description: 'Configurable scaling factor.' }) - ); +})); -export const types_query_dsl_rank_feature_function_linear = - types_query_dsl_rank_feature_function.and(z.record(z.string(), z.unknown())); +export const types_query_dsl_rank_feature_function_linear = types_query_dsl_rank_feature_function.and(z.record(z.string(), z.unknown())); -export const types_query_dsl_rank_feature_function_sigmoid = - types_query_dsl_rank_feature_function.and( - z.object({ - pivot: z.number().register(z.globalRegistry, { - description: 'Configurable pivot value so that the result will be less than 0.5.', - }), - exponent: z.number().register(z.globalRegistry, { - description: 'Configurable Exponent.', - }), +export const types_query_dsl_rank_feature_function_sigmoid = types_query_dsl_rank_feature_function.and(z.object({ + pivot: z.number().register(z.globalRegistry, { + description: 'Configurable pivot value so that the result will be less than 0.5.' + }), + exponent: z.number().register(z.globalRegistry, { + description: 'Configurable Exponent.' }) - ); +})); -export const types_query_dsl_rank_feature_query = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_rank_feature_query = types_query_dsl_query_base.and(z.object({ field: types_field, saturation: z.optional(types_query_dsl_rank_feature_function_saturation), log: z.optional(types_query_dsl_rank_feature_function_logarithm), linear: z.optional(types_query_dsl_rank_feature_function_linear), - sigmoid: z.optional(types_query_dsl_rank_feature_function_sigmoid), - }) -); - -export const types_query_dsl_regexp_query = types_query_dsl_query_base.and( - z.object({ - case_insensitive: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Allows case insensitive matching of the regular expression value with the indexed field values when set to `true`.\nWhen `false`, case sensitivity of matching depends on the underlying field’s mapping.', - }) - ), - flags: z.optional( - z.string().register(z.globalRegistry, { - description: 'Enables optional operators for the regular expression.', - }) - ), - max_determinized_states: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum number of automaton states required for the query.', - }) - ), + sigmoid: z.optional(types_query_dsl_rank_feature_function_sigmoid) +})); + +export const types_query_dsl_regexp_query = types_query_dsl_query_base.and(z.object({ + case_insensitive: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Allows case insensitive matching of the regular expression value with the indexed field values when set to `true`.\nWhen `false`, case sensitivity of matching depends on the underlying field’s mapping.' + })), + flags: z.optional(z.string().register(z.globalRegistry, { + description: 'Enables optional operators for the regular expression.' + })), + max_determinized_states: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of automaton states required for the query.' + })), rewrite: z.optional(types_multi_term_query_rewrite), value: z.string().register(z.globalRegistry, { - description: 'Regular expression for terms you wish to find in the provided field.', - }), - }) -); + description: 'Regular expression for terms you wish to find in the provided field.' + }) +})); -export const types_query_dsl_semantic_query = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_semantic_query = types_query_dsl_query_base.and(z.object({ field: z.string().register(z.globalRegistry, { - description: 'The field to query, which must be a semantic_text field type', + description: 'The field to query, which must be a semantic_text field type' }), query: z.string().register(z.globalRegistry, { - description: 'The query text', - }), - }) -); - -export const types_query_dsl_shape_query = types_query_dsl_query_base.and( - z.object({ - ignore_unmapped: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When set to `true` the query ignores an unmapped field and will not match any documents.', - }) - ), - }) -); + description: 'The query text' + }) +})); + +export const types_query_dsl_shape_query = types_query_dsl_query_base.and(z.object({ + ignore_unmapped: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When set to `true` the query ignores an unmapped field and will not match any documents.' + })) +})); export const types_query_dsl_simple_query_string_flag = z.enum([ - 'NONE', - 'AND', - 'NOT', - 'OR', - 'PREFIX', - 'PHRASE', - 'PRECEDENCE', - 'ESCAPE', - 'WHITESPACE', - 'FUZZY', - 'NEAR', - 'SLOP', - 'ALL', + 'NONE', + 'AND', + 'NOT', + 'OR', + 'PREFIX', + 'PHRASE', + 'PRECEDENCE', + 'ESCAPE', + 'WHITESPACE', + 'FUZZY', + 'NEAR', + 'SLOP', + 'ALL' ]); /** @@ -3283,243 +2801,172 @@ export const types_query_dsl_simple_query_string_flag = z.enum([ * flags enum constructs and the corresponding (de-)serialization code. */ export const spec_utils_pipe_separated_flags_simple_query_string_flag = z.union([ - types_query_dsl_simple_query_string_flag, - z.string(), + types_query_dsl_simple_query_string_flag, + z.string() ]); /** * Query flags can be either a single flag or a combination of flags, e.g. `OR|AND|PREFIX` */ -export const types_query_dsl_simple_query_string_flags = - spec_utils_pipe_separated_flags_simple_query_string_flag; - -export const types_query_dsl_simple_query_string_query = types_query_dsl_query_base.and( - z.object({ - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: 'Analyzer used to convert text in the query string into tokens.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the query attempts to analyze wildcard terms in the query string.', - }) - ), - auto_generate_synonyms_phrase_query: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the parser creates a match_phrase query for each multi-position token.', - }) - ), +export const types_query_dsl_simple_query_string_flags = spec_utils_pipe_separated_flags_simple_query_string_flag; + +export const types_query_dsl_simple_query_string_query = types_query_dsl_query_base.and(z.object({ + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer used to convert text in the query string into tokens.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the query attempts to analyze wildcard terms in the query string.' + })), + auto_generate_synonyms_phrase_query: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the parser creates a match_phrase query for each multi-position token.' + })), default_operator: z.optional(types_query_dsl_operator), - fields: z.optional( - z.array(types_field).register(z.globalRegistry, { - description: - 'Array of fields you wish to search.\nAccepts wildcard expressions.\nYou also can boost relevance scores for matches to particular fields using a caret (`^`) notation.\nDefaults to the `index.query.default_field index` setting, which has a default value of `*`.', - }) - ), + fields: z.optional(z.array(types_field).register(z.globalRegistry, { + description: 'Array of fields you wish to search.\nAccepts wildcard expressions.\nYou also can boost relevance scores for matches to particular fields using a caret (`^`) notation.\nDefaults to the `index.query.default_field index` setting, which has a default value of `*`.' + })), flags: z.optional(types_query_dsl_simple_query_string_flags), - fuzzy_max_expansions: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum number of terms to which the query expands for fuzzy matching.', - }) - ), - fuzzy_prefix_length: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of beginning characters left unchanged for fuzzy matching.', - }) - ), - fuzzy_transpositions: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based errors, such as providing a text value for a numeric field, are ignored.', - }) - ), + fuzzy_max_expansions: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of terms to which the query expands for fuzzy matching.' + })), + fuzzy_prefix_length: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of beginning characters left unchanged for fuzzy matching.' + })), + fuzzy_transpositions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`).' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based errors, such as providing a text value for a numeric field, are ignored.' + })), minimum_should_match: z.optional(types_minimum_should_match), query: z.string().register(z.globalRegistry, { - description: - 'Query string in the simple query string syntax you wish to parse and use for search.', + description: 'Query string in the simple query string syntax you wish to parse and use for search.' }), - quote_field_suffix: z.optional( - z.string().register(z.globalRegistry, { - description: 'Suffix appended to quoted text in the query string.', - }) - ), - }) -); + quote_field_suffix: z.optional(z.string().register(z.globalRegistry, { + description: 'Suffix appended to quoted text in the query string.' + })) +})); /** * Can only be used as a clause in a span_near query. */ -export const types_query_dsl_span_gap_query = z - .record(z.string(), z.number()) - .register(z.globalRegistry, { - description: 'Can only be used as a clause in a span_near query.', - }); +export const types_query_dsl_span_gap_query = z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'Can only be used as a clause in a span_near query.' +}); -export const types_query_dsl_span_term_query = types_query_dsl_query_base.and( - z.object({ - value: types_field_value, - }) -); +export const types_query_dsl_span_term_query = types_query_dsl_query_base.and(z.object({ + value: types_field_value +})); export const types_token_pruning_config = z.object({ - tokens_freq_ratio_threshold: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Tokens whose frequency is more than this threshold times the average frequency of all tokens in the specified field are considered outliers and pruned.', - }) - ), - tokens_weight_threshold: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Tokens whose weight is less than this threshold are considered nonsignificant and pruned.', - }) - ), - only_score_pruned_tokens: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Whether to only score pruned tokens, vs only scoring kept tokens.', - }) - ), -}); - -export const types_query_dsl_sparse_vector_query = types_query_dsl_query_base.and( - z - .object({ - field: types_field, - query: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The query text you want to use for search.\nIf inference_id is specified, query must also be specified.', - }) - ), - prune: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to perform pruning, omitting the non-significant tokens from the query to improve query performance.\nIf prune is true but the pruning_config is not specified, pruning will occur but default values will be used.\nDefault: false', - }) - ), - pruning_config: z.optional(types_token_pruning_config), - }) - .and( - z.object({ - query_vector: z.optional( - z.record(z.string(), z.number()).register(z.globalRegistry, { - description: - 'Dictionary of precomputed sparse vectors and their associated weights.\nOnly one of inference_id or query_vector may be supplied in a request.', - }) - ), - inference_id: z.optional(types_id), - }) - ) -); + tokens_freq_ratio_threshold: z.optional(z.number().register(z.globalRegistry, { + description: 'Tokens whose frequency is more than this threshold times the average frequency of all tokens in the specified field are considered outliers and pruned.' + })), + tokens_weight_threshold: z.optional(z.number().register(z.globalRegistry, { + description: 'Tokens whose weight is less than this threshold are considered nonsignificant and pruned.' + })), + only_score_pruned_tokens: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to only score pruned tokens, vs only scoring kept tokens.' + })) +}); + +export const types_query_dsl_sparse_vector_query = types_query_dsl_query_base.and(z.object({ + field: types_field, + query: z.optional(z.string().register(z.globalRegistry, { + description: 'The query text you want to use for search.\nIf inference_id is specified, query must also be specified.' + })), + prune: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to perform pruning, omitting the non-significant tokens from the query to improve query performance.\nIf prune is true but the pruning_config is not specified, pruning will occur but default values will be used.\nDefault: false' + })), + pruning_config: z.optional(types_token_pruning_config) +}).and(z.object({ + query_vector: z.optional(z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'Dictionary of precomputed sparse vectors and their associated weights.\nOnly one of inference_id or query_vector may be supplied in a request.' + })), + inference_id: z.optional(types_id) +}))); export const types_query_dsl_term_query = z.union([ - z.string().register(z.globalRegistry, { - description: 'Short query syntax for match query', - }), - types_query_dsl_query_base.and( - z.object({ - value: types_field_value, - case_insensitive: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Allows ASCII case insensitive matching of the value with the indexed field values when set to `true`.\nWhen `false`, the case sensitivity of matching depends on the underlying field’s mapping.', - }) - ), - }) - ), + z.string().register(z.globalRegistry, { + description: 'Short query syntax for match query' + }), + types_query_dsl_query_base.and(z.object({ + value: types_field_value, + case_insensitive: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Allows ASCII case insensitive matching of the value with the indexed field values when set to `true`.\nWhen `false`, the case sensitivity of matching depends on the underlying field’s mapping.' + })) + })) ]); -export const types_query_dsl_terms_query = types_query_dsl_query_base.and( - z.record(z.string(), z.unknown()) -); +export const types_query_dsl_terms_query = types_query_dsl_query_base.and(z.record(z.string(), z.unknown())); -export const types_query_dsl_text_expansion_query = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_text_expansion_query = types_query_dsl_query_base.and(z.object({ model_id: z.string().register(z.globalRegistry, { - description: 'The text expansion NLP model to use', + description: 'The text expansion NLP model to use' }), model_text: z.string().register(z.globalRegistry, { - description: 'The query text', - }), - pruning_config: z.optional(types_token_pruning_config), - }) -); - -export const types_query_dsl_weighted_tokens_query = types_query_dsl_query_base.and( - z.object({ - tokens: z.union([z.record(z.string(), z.number()), z.array(z.record(z.string(), z.number()))]), - pruning_config: z.optional(types_token_pruning_config), - }) -); - -export const types_query_dsl_wildcard_query = types_query_dsl_query_base.and( - z.object({ - case_insensitive: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Allows case insensitive matching of the pattern with the indexed field values when set to true. Default is false which means the case sensitivity of matching depends on the underlying field’s mapping.', - }) - ), + description: 'The query text' + }), + pruning_config: z.optional(types_token_pruning_config) +})); + +export const types_query_dsl_weighted_tokens_query = types_query_dsl_query_base.and(z.object({ + tokens: z.union([ + z.record(z.string(), z.number()), + z.array(z.record(z.string(), z.number())) + ]), + pruning_config: z.optional(types_token_pruning_config) +})); + +export const types_query_dsl_wildcard_query = types_query_dsl_query_base.and(z.object({ + case_insensitive: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Allows case insensitive matching of the pattern with the indexed field values when set to true. Default is false which means the case sensitivity of matching depends on the underlying field’s mapping.' + })), rewrite: z.optional(types_multi_term_query_rewrite), - value: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Wildcard pattern for terms you wish to find in the provided field. Required, when wildcard is not set.', - }) - ), - wildcard: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Wildcard pattern for terms you wish to find in the provided field. Required, when value is not set.', - }) - ), - }) -); - -export const types_query_dsl_wrapper_query = types_query_dsl_query_base.and( - z.object({ + value: z.optional(z.string().register(z.globalRegistry, { + description: 'Wildcard pattern for terms you wish to find in the provided field. Required, when wildcard is not set.' + })), + wildcard: z.optional(z.string().register(z.globalRegistry, { + description: 'Wildcard pattern for terms you wish to find in the provided field. Required, when value is not set.' + })) +})); + +export const types_query_dsl_wrapper_query = types_query_dsl_query_base.and(z.object({ query: z.string().register(z.globalRegistry, { - description: - 'A base64 encoded query.\nThe binary data format can be any of JSON, YAML, CBOR or SMILE encodings', - }), - }) -); + description: 'A base64 encoded query.\nThe binary data format can be any of JSON, YAML, CBOR or SMILE encodings' + }) +})); -export const types_query_dsl_type_query = types_query_dsl_query_base.and( - z.object({ - value: z.string(), - }) -); +export const types_query_dsl_type_query = types_query_dsl_query_base.and(z.object({ + value: z.string() +})); export const types_aggregations_aggregation = z.record(z.string(), z.unknown()); /** * Base type for bucket aggregations. These aggregations also accept sub-aggregations. */ -export const types_aggregations_bucket_aggregation_base = types_aggregations_aggregation.and( - z.record(z.string(), z.unknown()) -); +export const types_aggregations_bucket_aggregation_base = types_aggregations_aggregation.and(z.record(z.string(), z.unknown())); export const types_aggregations_minimum_interval = z.enum([ - 'second', - 'minute', - 'hour', - 'day', - 'month', - 'year', + 'second', + 'minute', + 'hour', + 'day', + 'month', + 'year' ]); -export const types_aggregations_missing = z.union([z.string(), z.number(), z.boolean()]); +export const types_aggregations_missing = z.union([ + z.string(), + z.number(), + z.boolean() +]); -export const types_aggregations_gap_policy = z.enum(['skip', 'insert_zeros', 'keep_values']); +export const types_aggregations_gap_policy = z.enum([ + 'skip', + 'insert_zeros', + 'keep_values' +]); /** * Buckets path can be expressed in different ways, and an aggregation may accept some or all of these @@ -3527,32 +2974,23 @@ export const types_aggregations_gap_policy = z.enum(['skip', 'insert_zeros', 'ke * path forms they accept. */ export const types_aggregations_buckets_path = z.union([ - z.string(), - z.array(z.string()), - z.record(z.string(), z.string()), + z.string(), + z.array(z.string()), + z.record(z.string(), z.string()) ]); -export const types_aggregations_bucket_path_aggregation = types_aggregations_aggregation.and( - z.object({ - buckets_path: z.optional(types_aggregations_buckets_path), - }) -); +export const types_aggregations_bucket_path_aggregation = types_aggregations_aggregation.and(z.object({ + buckets_path: z.optional(types_aggregations_buckets_path) +})); -export const types_aggregations_pipeline_aggregation_base = - types_aggregations_bucket_path_aggregation.and( - z.object({ - format: z.optional( - z.string().register(z.globalRegistry, { - description: - '`DecimalFormat` pattern for the output value.\nIf specified, the formatted value is returned in the aggregation’s `value_as_string` property.', - }) - ), - gap_policy: z.optional(types_aggregations_gap_policy), - }) - ); +export const types_aggregations_pipeline_aggregation_base = types_aggregations_bucket_path_aggregation.and(z.object({ + format: z.optional(z.string().register(z.globalRegistry, { + description: '`DecimalFormat` pattern for the output value.\nIf specified, the formatted value is returned in the aggregation’s `value_as_string` property.' + })), + gap_policy: z.optional(types_aggregations_gap_policy) +})); -export const types_aggregations_average_bucket_aggregation = - types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_average_bucket_aggregation = types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); export const types_aggregations_t_digest_execution_hint = z.enum(['default', 'high_accuracy']); @@ -3567,82 +3005,62 @@ export const types_aggregations_t_digest_execution_hint = z.enum(['default', 'hi * terms aggregation, in which case one compares the overall distribution of metric to its restriction * to each term. */ -export const types_aggregations_bucket_ks_aggregation = - types_aggregations_bucket_path_aggregation.and( - z.object({ - alternative: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'A list of string values indicating which K-S test alternative to calculate. The valid values\nare: "greater", "less", "two_sided". This parameter is key for determining the K-S statistic used\nwhen calculating the K-S test. Default value is all possible alternative hypotheses.', - }) - ), - fractions: z.optional( - z.array(z.number()).register(z.globalRegistry, { - description: - 'A list of doubles indicating the distribution of the samples with which to compare to the `buckets_path` results.\nIn typical usage this is the overall proportion of documents in each bucket, which is compared with the actual\ndocument proportions in each bucket from the sibling aggregation counts. The default is to assume that overall\ndocuments are uniformly distributed on these buckets, which they would be if one used equal percentiles of a\nmetric to define the bucket end points.', - }) - ), - sampling_method: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Indicates the sampling methodology when calculating the K-S test. Note, this is sampling of the returned values.\nThis determines the cumulative distribution function (CDF) points used comparing the two samples. Default is\n`upper_tail`, which emphasizes the upper end of the CDF points. Valid options are: `upper_tail`, `uniform`,\nand `lower_tail`.', - }) - ), - }) - ); +export const types_aggregations_bucket_ks_aggregation = types_aggregations_bucket_path_aggregation.and(z.object({ + alternative: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A list of string values indicating which K-S test alternative to calculate. The valid values\nare: "greater", "less", "two_sided". This parameter is key for determining the K-S statistic used\nwhen calculating the K-S test. Default value is all possible alternative hypotheses.' + })), + fractions: z.optional(z.array(z.number()).register(z.globalRegistry, { + description: 'A list of doubles indicating the distribution of the samples with which to compare to the `buckets_path` results.\nIn typical usage this is the overall proportion of documents in each bucket, which is compared with the actual\ndocument proportions in each bucket from the sibling aggregation counts. The default is to assume that overall\ndocuments are uniformly distributed on these buckets, which they would be if one used equal percentiles of a\nmetric to define the bucket end points.' + })), + sampling_method: z.optional(z.string().register(z.globalRegistry, { + description: 'Indicates the sampling methodology when calculating the K-S test. Note, this is sampling of the returned values.\nThis determines the cumulative distribution function (CDF) points used comparing the two samples. Default is\n`upper_tail`, which emphasizes the upper end of the CDF points. Valid options are: `upper_tail`, `uniform`,\nand `lower_tail`.' + })) +})); export const types_aggregations_bucket_correlation_function_count_correlation_indicator = z.object({ - doc_count: z.number().register(z.globalRegistry, { - description: - 'The total number of documents that initially created the expectations. It’s required to be greater\nthan or equal to the sum of all values in the buckets_path as this is the originating superset of data\nto which the term values are correlated.', - }), - expectations: z.array(z.number()).register(z.globalRegistry, { - description: - 'An array of numbers with which to correlate the configured `bucket_path` values.\nThe length of this value must always equal the number of buckets returned by the `bucket_path`.', - }), - fractions: z.optional( - z.array(z.number()).register(z.globalRegistry, { - description: - 'An array of fractions to use when averaging and calculating variance. This should be used if\nthe pre-calculated data and the buckets_path have known gaps. The length of fractions, if provided,\nmust equal expectations.', - }) - ), + doc_count: z.number().register(z.globalRegistry, { + description: 'The total number of documents that initially created the expectations. It’s required to be greater\nthan or equal to the sum of all values in the buckets_path as this is the originating superset of data\nto which the term values are correlated.' + }), + expectations: z.array(z.number()).register(z.globalRegistry, { + description: 'An array of numbers with which to correlate the configured `bucket_path` values.\nThe length of this value must always equal the number of buckets returned by the `bucket_path`.' + }), + fractions: z.optional(z.array(z.number()).register(z.globalRegistry, { + description: 'An array of fractions to use when averaging and calculating variance. This should be used if\nthe pre-calculated data and the buckets_path have known gaps. The length of fractions, if provided,\nmust equal expectations.' + })) }); export const types_aggregations_bucket_correlation_function_count_correlation = z.object({ - indicator: types_aggregations_bucket_correlation_function_count_correlation_indicator, + indicator: types_aggregations_bucket_correlation_function_count_correlation_indicator }); export const types_aggregations_bucket_correlation_function = z.object({ - count_correlation: types_aggregations_bucket_correlation_function_count_correlation, + count_correlation: types_aggregations_bucket_correlation_function_count_correlation }); /** * A sibling pipeline aggregation which executes a correlation function on the configured sibling multi-bucket aggregation. */ -export const types_aggregations_bucket_correlation_aggregation = - types_aggregations_bucket_path_aggregation.and( - z.object({ - function: types_aggregations_bucket_correlation_function, - }) - ); +export const types_aggregations_bucket_correlation_aggregation = types_aggregations_bucket_path_aggregation.and(z.object({ + function: types_aggregations_bucket_correlation_function +})); export const types_aggregations_cardinality_execution_mode = z.enum([ - 'global_ordinals', - 'segment_ordinals', - 'direct', - 'save_memory_heuristic', - 'save_time_heuristic', + 'global_ordinals', + 'segment_ordinals', + 'direct', + 'save_memory_heuristic', + 'save_time_heuristic' ]); export const types_aggregations_custom_categorize_text_analyzer = z.object({ - char_filter: z.optional(z.array(z.string())), - tokenizer: z.optional(z.string()), - filter: z.optional(z.array(z.string())), + char_filter: z.optional(z.array(z.string())), + tokenizer: z.optional(z.string()), + filter: z.optional(z.array(z.string())) }); export const types_aggregations_categorize_text_analyzer = z.union([ - z.string(), - types_aggregations_custom_categorize_text_analyzer, + z.string(), + types_aggregations_custom_categorize_text_analyzer ]); /** @@ -3651,1124 +3069,838 @@ export const types_aggregations_categorize_text_analyzer = z.union([ * creating buckets of similarly formatted text values. This aggregation works best with machine * generated text like system logs. Only the first 100 analyzed tokens are used to categorize the text. */ -export const types_aggregations_categorize_text_aggregation = types_aggregations_aggregation.and( - z.object({ +export const types_aggregations_categorize_text_aggregation = types_aggregations_aggregation.and(z.object({ field: types_field, - max_unique_tokens: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of unique tokens at any position up to max_matched_tokens. Must be larger than 1.\nSmaller values use less memory and create fewer categories. Larger values will use more memory and\ncreate narrower categories. Max allowed value is 100.', - }) - ), - max_matched_tokens: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of token positions to match on before attempting to merge categories. Larger\nvalues will use more memory and create narrower categories. Max allowed value is 100.', - }) - ), - similarity_threshold: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The minimum percentage of tokens that must match for text to be added to the category bucket. Must\nbe between 1 and 100. The larger the value the narrower the categories. Larger values will increase memory\nusage and create narrower categories.', - }) - ), - categorization_filters: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'This property expects an array of regular expressions. The expressions are used to filter out matching\nsequences from the categorization field values. You can use this functionality to fine tune the categorization\nby excluding sequences from consideration when categories are defined. For example, you can exclude SQL\nstatements that appear in your log files. This property cannot be used at the same time as categorization_analyzer.\nIf you only want to define simple regular expression filters that are applied prior to tokenization, setting\nthis property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering,\nuse the categorization_analyzer property instead and include the filters as pattern_replace character filters.', - }) - ), + max_unique_tokens: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of unique tokens at any position up to max_matched_tokens. Must be larger than 1.\nSmaller values use less memory and create fewer categories. Larger values will use more memory and\ncreate narrower categories. Max allowed value is 100.' + })), + max_matched_tokens: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of token positions to match on before attempting to merge categories. Larger\nvalues will use more memory and create narrower categories. Max allowed value is 100.' + })), + similarity_threshold: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum percentage of tokens that must match for text to be added to the category bucket. Must\nbe between 1 and 100. The larger the value the narrower the categories. Larger values will increase memory\nusage and create narrower categories.' + })), + categorization_filters: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'This property expects an array of regular expressions. The expressions are used to filter out matching\nsequences from the categorization field values. You can use this functionality to fine tune the categorization\nby excluding sequences from consideration when categories are defined. For example, you can exclude SQL\nstatements that appear in your log files. This property cannot be used at the same time as categorization_analyzer.\nIf you only want to define simple regular expression filters that are applied prior to tokenization, setting\nthis property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering,\nuse the categorization_analyzer property instead and include the filters as pattern_replace character filters.' + })), categorization_analyzer: z.optional(types_aggregations_categorize_text_analyzer), - shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of categorization buckets to return from each shard before merging all the results.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of buckets to return.', - }) - ), - min_doc_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'The minimum number of documents in a bucket to be returned to the results.', - }) - ), - shard_min_doc_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The minimum number of documents in a bucket to be returned from the shard before merging.', - }) - ), - }) -); - -export const types_aggregations_change_point_aggregation = - types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); - -export const types_aggregations_children_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - type: z.optional(types_relation_name), - }) - ); - -export const types_aggregations_missing_order = z.enum(['first', 'last', 'default']); + shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of categorization buckets to return from each shard before merging all the results.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of buckets to return.' + })), + min_doc_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum number of documents in a bucket to be returned to the results.' + })), + shard_min_doc_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum number of documents in a bucket to be returned from the shard before merging.' + })) +})); + +export const types_aggregations_change_point_aggregation = types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); + +export const types_aggregations_children_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + type: z.optional(types_relation_name) +})); + +export const types_aggregations_missing_order = z.enum([ + 'first', + 'last', + 'default' +]); export const types_aggregations_value_type = z.enum([ - 'string', - 'long', - 'double', - 'number', - 'date', - 'date_nanos', - 'ip', - 'numeric', - 'geo_point', - 'boolean', + 'string', + 'long', + 'double', + 'number', + 'date', + 'date_nanos', + 'ip', + 'numeric', + 'geo_point', + 'boolean' ]); -export const types_aggregations_cumulative_cardinality_aggregation = - types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_cumulative_cardinality_aggregation = types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_cumulative_sum_aggregation = - types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_cumulative_sum_aggregation = types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); export const types_aggregations_calendar_interval = z.enum([ - 'second', - '1s', - 'minute', - '1m', - 'hour', - '1h', - 'day', - '1d', - 'week', - '1w', - 'month', - '1M', - 'quarter', - '1q', - 'year', - '1y', + 'second', + '1s', + 'minute', + '1m', + 'hour', + '1h', + 'day', + '1d', + 'week', + '1w', + 'month', + '1M', + 'quarter', + '1q', + 'year', + '1y' ]); /** * A date range limit, represented either as a DateMath expression or a number expressed * according to the target field's precision. */ -export const types_aggregations_field_date_math = z.union([types_date_math, z.number()]); +export const types_aggregations_field_date_math = z.union([ + types_date_math, + z.number() +]); export const types_aggregations_extended_bounds_field_date_math = z.object({ - max: z.optional(types_aggregations_field_date_math), - min: z.optional(types_aggregations_field_date_math), + max: z.optional(types_aggregations_field_date_math), + min: z.optional(types_aggregations_field_date_math) }); export const types_aggregations_aggregate_order = z.union([ - z.record(z.string(), types_sort_order), - z.array(z.record(z.string(), types_sort_order)), + z.record(z.string(), types_sort_order), + z.array(z.record(z.string(), types_sort_order)) ]); export const types_aggregations_date_range_expression = z.object({ - from: z.optional(types_aggregations_field_date_math), - key: z.optional( - z.string().register(z.globalRegistry, { - description: 'Custom key to return the range with.', - }) - ), - to: z.optional(types_aggregations_field_date_math), + from: z.optional(types_aggregations_field_date_math), + key: z.optional(z.string().register(z.globalRegistry, { + description: 'Custom key to return the range with.' + })), + to: z.optional(types_aggregations_field_date_math) }); -export const types_aggregations_date_range_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - field: z.optional(types_field), - format: z.optional( - z.string().register(z.globalRegistry, { - description: 'The date format used to format `from` and `to` in the response.', - }) - ), - missing: z.optional(types_aggregations_missing), - ranges: z.optional( - z.array(types_aggregations_date_range_expression).register(z.globalRegistry, { - description: 'Array of date ranges.', - }) - ), - time_zone: z.optional(types_time_zone), - keyed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` to associate a unique string key with each bucket and returns the ranges as a hash rather than an array.', - }) - ), - }) - ); +export const types_aggregations_date_range_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + field: z.optional(types_field), + format: z.optional(z.string().register(z.globalRegistry, { + description: 'The date format used to format `from` and `to` in the response.' + })), + missing: z.optional(types_aggregations_missing), + ranges: z.optional(z.array(types_aggregations_date_range_expression).register(z.globalRegistry, { + description: 'Array of date ranges.' + })), + time_zone: z.optional(types_time_zone), + keyed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` to associate a unique string key with each bucket and returns the ranges as a hash rather than an array.' + })) +})); -export const types_aggregations_derivative_aggregation = - types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_derivative_aggregation = types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); export const types_aggregations_sampler_aggregation_execution_hint = z.enum([ - 'map', - 'global_ordinals', - 'bytes_hash', + 'map', + 'global_ordinals', + 'bytes_hash' ]); -export const types_aggregations_extended_stats_bucket_aggregation = - types_aggregations_pipeline_aggregation_base.and( - z.object({ - sigma: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of standard deviations above/below the mean to display.', - }) - ), - }) - ); +export const types_aggregations_extended_stats_bucket_aggregation = types_aggregations_pipeline_aggregation_base.and(z.object({ + sigma: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of standard deviations above/below the mean to display.' + })) +})); -export const types_aggregations_terms_exclude = z.union([z.string(), z.array(z.string())]); +export const types_aggregations_terms_exclude = z.union([ + z.string(), + z.array(z.string()) +]); export const types_aggregations_terms_partition = z.object({ - num_partitions: z.number().register(z.globalRegistry, { - description: 'The number of partitions.', - }), - partition: z.number().register(z.globalRegistry, { - description: 'The partition number for this request.', - }), + num_partitions: z.number().register(z.globalRegistry, { + description: 'The number of partitions.' + }), + partition: z.number().register(z.globalRegistry, { + description: 'The partition number for this request.' + }) }); export const types_aggregations_terms_include = z.union([ - z.string(), - z.array(z.string()), - types_aggregations_terms_partition, + z.string(), + z.array(z.string()), + types_aggregations_terms_partition ]); export const types_aggregations_frequent_item_sets_field = z.object({ - field: types_field, - exclude: z.optional(types_aggregations_terms_exclude), - include: z.optional(types_aggregations_terms_include), + field: types_field, + exclude: z.optional(types_aggregations_terms_exclude), + include: z.optional(types_aggregations_terms_include) }); export const types_aggregations_aggregation_range = z.object({ - from: z.optional(z.union([z.number(), z.string(), z.null()])), - key: z.optional( - z.string().register(z.globalRegistry, { - description: 'Custom key to return the range with.', - }) - ), - to: z.optional(z.union([z.number(), z.string(), z.null()])), + from: z.optional(z.union([ + z.number(), + z.string(), + z.null() + ])), + key: z.optional(z.string().register(z.globalRegistry, { + description: 'Custom key to return the range with.' + })), + to: z.optional(z.union([ + z.number(), + z.string(), + z.null() + ])) }); -export const types_aggregations_geo_distance_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - distance_type: z.optional(types_geo_distance_type), - field: z.optional(types_field), - origin: z.optional(types_geo_location), - ranges: z.optional( - z.array(types_aggregations_aggregation_range).register(z.globalRegistry, { - description: 'An array of ranges used to bucket documents.', - }) - ), - unit: z.optional(types_distance_unit), - }) - ); +export const types_aggregations_geo_distance_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + distance_type: z.optional(types_geo_distance_type), + field: z.optional(types_field), + origin: z.optional(types_geo_location), + ranges: z.optional(z.array(types_aggregations_aggregation_range).register(z.globalRegistry, { + description: 'An array of ranges used to bucket documents.' + })), + unit: z.optional(types_distance_unit) +})); /** * A precision that can be expressed as a geohash length between 1 and 12, or a distance measure like "1km", "10m". */ -export const types_geo_hash_precision = z.union([z.number(), z.string()]); +export const types_geo_hash_precision = z.union([ + z.number(), + z.string() +]); -export const types_aggregations_geo_hash_grid_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - bounds: z.optional(types_geo_bounds), - field: z.optional(types_field), - precision: z.optional(types_geo_hash_precision), - shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Allows for more accurate counting of the top cells returned in the final result the aggregation.\nDefaults to returning `max(10,(size x number-of-shards))` buckets from each shard.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of geohash buckets to return.', - }) - ), - }) - ); +export const types_aggregations_geo_hash_grid_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + bounds: z.optional(types_geo_bounds), + field: z.optional(types_field), + precision: z.optional(types_geo_hash_precision), + shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Allows for more accurate counting of the top cells returned in the final result the aggregation.\nDefaults to returning `max(10,(size x number-of-shards))` buckets from each shard.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of geohash buckets to return.' + })) +})); export const types_aggregations_geo_line_point = z.object({ - field: types_field, + field: types_field }); export const types_aggregations_geo_line_sort = z.object({ - field: types_field, + field: types_field }); export const types_aggregations_geo_line_aggregation = z.object({ - point: types_aggregations_geo_line_point, - sort: z.optional(types_aggregations_geo_line_sort), - include_sort: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When `true`, returns an additional array of the sort values in the feature properties.', - }) - ), - sort_order: z.optional(types_sort_order), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum length of the line represented in the aggregation.\nValid sizes are between 1 and 10000.', - }) - ), + point: types_aggregations_geo_line_point, + sort: z.optional(types_aggregations_geo_line_sort), + include_sort: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When `true`, returns an additional array of the sort values in the feature properties.' + })), + sort_order: z.optional(types_sort_order), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum length of the line represented in the aggregation.\nValid sizes are between 1 and 10000.' + })) }); export const types_geo_tile_precision = z.number(); -export const types_aggregations_geo_tile_grid_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - field: z.optional(types_field), - precision: z.optional(types_geo_tile_precision), - shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Allows for more accurate counting of the top cells returned in the final result the aggregation.\nDefaults to returning `max(10,(size x number-of-shards))` buckets from each shard.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of buckets to return.', - }) - ), - bounds: z.optional(types_geo_bounds), - }) - ); - -export const types_aggregations_geohex_grid_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - field: types_field, - precision: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Integer zoom of the key used to defined cells or buckets\nin the results. Value should be between 0-15.', - }) - ), - bounds: z.optional(types_geo_bounds), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum number of buckets to return.', - }) - ), - shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of buckets returned from each shard.', - }) - ), - }) - ); +export const types_aggregations_geo_tile_grid_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + field: z.optional(types_field), + precision: z.optional(types_geo_tile_precision), + shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Allows for more accurate counting of the top cells returned in the final result the aggregation.\nDefaults to returning `max(10,(size x number-of-shards))` buckets from each shard.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of buckets to return.' + })), + bounds: z.optional(types_geo_bounds) +})); + +export const types_aggregations_geohex_grid_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + field: types_field, + precision: z.optional(z.number().register(z.globalRegistry, { + description: 'Integer zoom of the key used to defined cells or buckets\nin the results. Value should be between 0-15.' + })), + bounds: z.optional(types_geo_bounds), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of buckets to return.' + })), + shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of buckets returned from each shard.' + })) +})); -export const types_aggregations_global_aggregation = types_aggregations_bucket_aggregation_base.and( - z.record(z.string(), z.unknown()) -); +export const types_aggregations_global_aggregation = types_aggregations_bucket_aggregation_base.and(z.record(z.string(), z.unknown())); export const types_aggregations_extended_boundsdouble = z.object({ - max: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum value for the bound.', - }) - ), - min: z.optional( - z.number().register(z.globalRegistry, { - description: 'Minimum value for the bound.', - }) - ), + max: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum value for the bound.' + })), + min: z.optional(z.number().register(z.globalRegistry, { + description: 'Minimum value for the bound.' + })) }); export const types_aggregations_ip_range_aggregation_range = z.object({ - from: z.optional(z.union([z.string(), z.null()])), - mask: z.optional( - z.string().register(z.globalRegistry, { - description: 'IP range defined as a CIDR mask.', - }) - ), - to: z.optional(z.union([z.string(), z.null()])), + from: z.optional(z.union([ + z.string(), + z.null() + ])), + mask: z.optional(z.string().register(z.globalRegistry, { + description: 'IP range defined as a CIDR mask.' + })), + to: z.optional(z.union([ + z.string(), + z.null() + ])) }); -export const types_aggregations_ip_range_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - field: z.optional(types_field), - ranges: z.optional( - z.array(types_aggregations_ip_range_aggregation_range).register(z.globalRegistry, { - description: 'Array of IP ranges.', - }) - ), - }) - ); +export const types_aggregations_ip_range_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + field: z.optional(types_field), + ranges: z.optional(z.array(types_aggregations_ip_range_aggregation_range).register(z.globalRegistry, { + description: 'Array of IP ranges.' + })) +})); -export const types_aggregations_ip_prefix_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - field: types_field, - prefix_length: z.number().register(z.globalRegistry, { - description: - 'Length of the network prefix. For IPv4 addresses the accepted range is [0, 32].\nFor IPv6 addresses the accepted range is [0, 128].', - }), - is_ipv6: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Defines whether the prefix applies to IPv6 addresses.', - }) - ), - append_prefix_length: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Defines whether the prefix length is appended to IP address keys in the response.', - }) - ), - keyed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Defines whether buckets are returned as a hash rather than an array in the response.', - }) - ), - min_doc_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Minimum number of documents in a bucket for it to be included in the response.', - }) - ), - }) - ); +export const types_aggregations_ip_prefix_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + field: types_field, + prefix_length: z.number().register(z.globalRegistry, { + description: 'Length of the network prefix. For IPv4 addresses the accepted range is [0, 32].\nFor IPv6 addresses the accepted range is [0, 128].' + }), + is_ipv6: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Defines whether the prefix applies to IPv6 addresses.' + })), + append_prefix_length: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Defines whether the prefix length is appended to IP address keys in the response.' + })), + keyed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Defines whether buckets are returned as a hash rather than an array in the response.' + })), + min_doc_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Minimum number of documents in a bucket for it to be included in the response.' + })) +})); export const ml_types_regression_inference_options = z.object({ - results_field: z.optional(types_field), - num_top_feature_importance_values: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of feature importance values per document.', - }) - ), + results_field: z.optional(types_field), + num_top_feature_importance_values: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of feature importance values per document.' + })) }); export const ml_types_classification_inference_options = z.object({ - num_top_classes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the number of top class predictions to return. Defaults to 0.', - }) - ), - num_top_feature_importance_values: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of feature importance values per document.', - }) - ), - prediction_field_type: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Specifies the type of the predicted field to write. Acceptable values are: string, number, boolean. When boolean is provided 1.0 is transformed to true and 0.0 to false.', - }) - ), - results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.', - }) - ), - top_classes_results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Specifies the field to which the top classes are written. Defaults to top_classes.', - }) - ), + num_top_classes: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the number of top class predictions to return. Defaults to 0.' + })), + num_top_feature_importance_values: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of feature importance values per document.' + })), + prediction_field_type: z.optional(z.string().register(z.globalRegistry, { + description: 'Specifies the type of the predicted field to write. Acceptable values are: string, number, boolean. When boolean is provided 1.0 is transformed to true and 0.0 to false.' + })), + results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.' + })), + top_classes_results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'Specifies the field to which the top classes are written. Defaults to top_classes.' + })) }); export const types_aggregations_inference_config_container = z.object({ - regression: z.optional(ml_types_regression_inference_options), - classification: z.optional(ml_types_classification_inference_options), + regression: z.optional(ml_types_regression_inference_options), + classification: z.optional(ml_types_classification_inference_options) }); -export const types_aggregations_inference_aggregation = - types_aggregations_pipeline_aggregation_base.and( - z.object({ - model_id: types_name, - inference_config: z.optional(types_aggregations_inference_config_container), - }) - ); +export const types_aggregations_inference_aggregation = types_aggregations_pipeline_aggregation_base.and(z.object({ + model_id: types_name, + inference_config: z.optional(types_aggregations_inference_config_container) +})); -export const types_aggregations_matrix_aggregation = types_aggregations_aggregation.and( - z.object({ +export const types_aggregations_matrix_aggregation = types_aggregations_aggregation.and(z.object({ fields: z.optional(types_fields), - missing: z.optional( - z.record(z.string(), z.number()).register(z.globalRegistry, { - description: - 'The value to apply to documents that do not have a value.\nBy default, documents without a value are ignored.', - }) - ), - }) -); - -export const types_aggregations_matrix_stats_aggregation = - types_aggregations_matrix_aggregation.and( - z.object({ - mode: z.optional(types_sort_mode), - }) - ); + missing: z.optional(z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'The value to apply to documents that do not have a value.\nBy default, documents without a value are ignored.' + })) +})); -export const types_aggregations_max_bucket_aggregation = - types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_matrix_stats_aggregation = types_aggregations_matrix_aggregation.and(z.object({ + mode: z.optional(types_sort_mode) +})); -export const types_aggregations_min_bucket_aggregation = - types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_max_bucket_aggregation = types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_missing_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - field: z.optional(types_field), - missing: z.optional(types_aggregations_missing), - }) - ); +export const types_aggregations_min_bucket_aggregation = types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); + +export const types_aggregations_missing_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + field: z.optional(types_field), + missing: z.optional(types_aggregations_missing) +})); /** * For empty Class assignments */ export const types_empty_object = z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: 'For empty Class assignments', + description: 'For empty Class assignments' }); -export const types_aggregations_moving_average_aggregation_base = - types_aggregations_pipeline_aggregation_base.and( - z.object({ - minimize: z.optional(z.boolean()), - predict: z.optional(z.number()), - window: z.optional(z.number()), - }) - ); +export const types_aggregations_moving_average_aggregation_base = types_aggregations_pipeline_aggregation_base.and(z.object({ + minimize: z.optional(z.boolean()), + predict: z.optional(z.number()), + window: z.optional(z.number()) +})); -export const types_aggregations_linear_moving_average_aggregation = - types_aggregations_moving_average_aggregation_base.and( - z.object({ - model: z.enum(['linear']), - settings: types_empty_object, - }) - ); +export const types_aggregations_linear_moving_average_aggregation = types_aggregations_moving_average_aggregation_base.and(z.object({ + model: z.enum(['linear']), + settings: types_empty_object +})); -export const types_aggregations_simple_moving_average_aggregation = - types_aggregations_moving_average_aggregation_base.and( - z.object({ - model: z.enum(['simple']), - settings: types_empty_object, - }) - ); +export const types_aggregations_simple_moving_average_aggregation = types_aggregations_moving_average_aggregation_base.and(z.object({ + model: z.enum(['simple']), + settings: types_empty_object +})); export const types_aggregations_ewma_model_settings = z.object({ - alpha: z.optional(z.number()), + alpha: z.optional(z.number()) }); -export const types_aggregations_ewma_moving_average_aggregation = - types_aggregations_moving_average_aggregation_base.and( - z.object({ - model: z.enum(['ewma']), - settings: types_aggregations_ewma_model_settings, - }) - ); +export const types_aggregations_ewma_moving_average_aggregation = types_aggregations_moving_average_aggregation_base.and(z.object({ + model: z.enum(['ewma']), + settings: types_aggregations_ewma_model_settings +})); export const types_aggregations_holt_linear_model_settings = z.object({ - alpha: z.optional(z.number()), - beta: z.optional(z.number()), + alpha: z.optional(z.number()), + beta: z.optional(z.number()) }); -export const types_aggregations_holt_moving_average_aggregation = - types_aggregations_moving_average_aggregation_base.and( - z.object({ - model: z.enum(['holt']), - settings: types_aggregations_holt_linear_model_settings, - }) - ); +export const types_aggregations_holt_moving_average_aggregation = types_aggregations_moving_average_aggregation_base.and(z.object({ + model: z.enum(['holt']), + settings: types_aggregations_holt_linear_model_settings +})); export const types_aggregations_holt_winters_type = z.enum(['add', 'mult']); export const types_aggregations_holt_winters_model_settings = z.object({ - alpha: z.optional(z.number()), - beta: z.optional(z.number()), - gamma: z.optional(z.number()), - pad: z.optional(z.boolean()), - period: z.optional(z.number()), - type: z.optional(types_aggregations_holt_winters_type), + alpha: z.optional(z.number()), + beta: z.optional(z.number()), + gamma: z.optional(z.number()), + pad: z.optional(z.boolean()), + period: z.optional(z.number()), + type: z.optional(types_aggregations_holt_winters_type) }); -export const types_aggregations_holt_winters_moving_average_aggregation = - types_aggregations_moving_average_aggregation_base.and( - z.object({ - model: z.enum(['holt_winters']), - settings: types_aggregations_holt_winters_model_settings, - }) - ); +export const types_aggregations_holt_winters_moving_average_aggregation = types_aggregations_moving_average_aggregation_base.and(z.object({ + model: z.enum(['holt_winters']), + settings: types_aggregations_holt_winters_model_settings +})); export const types_aggregations_moving_average_aggregation = z.union([ - z - .object({ - model: z.literal('linear'), - }) - .and(types_aggregations_linear_moving_average_aggregation), - z - .object({ - model: z.literal('simple'), - }) - .and(types_aggregations_simple_moving_average_aggregation), - z - .object({ - model: z.literal('ewma'), - }) - .and(types_aggregations_ewma_moving_average_aggregation), - z - .object({ - model: z.literal('holt'), - }) - .and(types_aggregations_holt_moving_average_aggregation), - z - .object({ - model: z.literal('holt_winters'), - }) - .and(types_aggregations_holt_winters_moving_average_aggregation), + z.object({ + model: z.literal('linear') + }).and(types_aggregations_linear_moving_average_aggregation), + z.object({ + model: z.literal('simple') + }).and(types_aggregations_simple_moving_average_aggregation), + z.object({ + model: z.literal('ewma') + }).and(types_aggregations_ewma_moving_average_aggregation), + z.object({ + model: z.literal('holt') + }).and(types_aggregations_holt_moving_average_aggregation), + z.object({ + model: z.literal('holt_winters') + }).and(types_aggregations_holt_winters_moving_average_aggregation) ]); -export const types_aggregations_moving_percentiles_aggregation = - types_aggregations_pipeline_aggregation_base.and( - z.object({ - window: z.optional( - z.number().register(z.globalRegistry, { - description: 'The size of window to "slide" across the histogram.', - }) - ), - shift: z.optional( - z.number().register(z.globalRegistry, { - description: - 'By default, the window consists of the last n values excluding the current bucket.\nIncreasing `shift` by 1, moves the starting window position by 1 to the right.', - }) - ), - keyed: z.optional(z.boolean()), - }) - ); +export const types_aggregations_moving_percentiles_aggregation = types_aggregations_pipeline_aggregation_base.and(z.object({ + window: z.optional(z.number().register(z.globalRegistry, { + description: 'The size of window to "slide" across the histogram.' + })), + shift: z.optional(z.number().register(z.globalRegistry, { + description: 'By default, the window consists of the last n values excluding the current bucket.\nIncreasing `shift` by 1, moves the starting window position by 1 to the right.' + })), + keyed: z.optional(z.boolean()) +})); -export const types_aggregations_moving_function_aggregation = - types_aggregations_pipeline_aggregation_base.and( - z.object({ - script: z.optional( - z.string().register(z.globalRegistry, { - description: 'The script that should be executed on each window of data.', - }) - ), - shift: z.optional( - z.number().register(z.globalRegistry, { - description: - 'By default, the window consists of the last n values excluding the current bucket.\nIncreasing `shift` by 1, moves the starting window position by 1 to the right.', - }) - ), - window: z.optional( - z.number().register(z.globalRegistry, { - description: 'The size of window to "slide" across the histogram.', - }) - ), - }) - ); +export const types_aggregations_moving_function_aggregation = types_aggregations_pipeline_aggregation_base.and(z.object({ + script: z.optional(z.string().register(z.globalRegistry, { + description: 'The script that should be executed on each window of data.' + })), + shift: z.optional(z.number().register(z.globalRegistry, { + description: 'By default, the window consists of the last n values excluding the current bucket.\nIncreasing `shift` by 1, moves the starting window position by 1 to the right.' + })), + window: z.optional(z.number().register(z.globalRegistry, { + description: 'The size of window to "slide" across the histogram.' + })) +})); -export const types_aggregations_terms_aggregation_collect_mode = z.enum([ - 'depth_first', - 'breadth_first', -]); +export const types_aggregations_terms_aggregation_collect_mode = z.enum(['depth_first', 'breadth_first']); export const types_aggregations_multi_term_lookup = z.object({ - field: types_field, - missing: z.optional(types_aggregations_missing), + field: types_field, + missing: z.optional(types_aggregations_missing) }); -export const types_aggregations_multi_terms_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - collect_mode: z.optional(types_aggregations_terms_aggregation_collect_mode), - order: z.optional(types_aggregations_aggregate_order), - min_doc_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'The minimum number of documents in a bucket for it to be returned.', - }) - ), - shard_min_doc_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The minimum number of documents in a bucket on each shard for it to be returned.', - }) - ), - shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of candidate terms produced by each shard.\nBy default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.', - }) - ), - show_term_doc_count_error: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Calculates the doc count error on per term basis.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of term buckets should be returned out of the overall terms list.', - }) - ), - terms: z.array(types_aggregations_multi_term_lookup).register(z.globalRegistry, { - description: 'The field from which to generate sets of terms.', - }), - }) - ); - -export const types_aggregations_nested_aggregation = types_aggregations_bucket_aggregation_base.and( - z.object({ - path: z.optional(types_field), - }) -); +export const types_aggregations_multi_terms_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + collect_mode: z.optional(types_aggregations_terms_aggregation_collect_mode), + order: z.optional(types_aggregations_aggregate_order), + min_doc_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum number of documents in a bucket for it to be returned.' + })), + shard_min_doc_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum number of documents in a bucket on each shard for it to be returned.' + })), + shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of candidate terms produced by each shard.\nBy default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.' + })), + show_term_doc_count_error: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Calculates the doc count error on per term basis.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of term buckets should be returned out of the overall terms list.' + })), + terms: z.array(types_aggregations_multi_term_lookup).register(z.globalRegistry, { + description: 'The field from which to generate sets of terms.' + }) +})); + +export const types_aggregations_nested_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + path: z.optional(types_field) +})); export const types_aggregations_normalize_method = z.enum([ - 'rescale_0_1', - 'rescale_0_100', - 'percent_of_sum', - 'mean', - 'z-score', - 'softmax', + 'rescale_0_1', + 'rescale_0_100', + 'percent_of_sum', + 'mean', + 'z-score', + 'softmax' ]); -export const types_aggregations_normalize_aggregation = - types_aggregations_pipeline_aggregation_base.and( - z.object({ - method: z.optional(types_aggregations_normalize_method), - }) - ); +export const types_aggregations_normalize_aggregation = types_aggregations_pipeline_aggregation_base.and(z.object({ + method: z.optional(types_aggregations_normalize_method) +})); -export const types_aggregations_parent_aggregation = types_aggregations_bucket_aggregation_base.and( - z.object({ - type: z.optional(types_relation_name), - }) -); +export const types_aggregations_parent_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + type: z.optional(types_relation_name) +})); export const types_aggregations_hdr_method = z.object({ - number_of_significant_value_digits: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Specifies the resolution of values for the histogram in number of significant digits.', - }) - ), + number_of_significant_value_digits: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the resolution of values for the histogram in number of significant digits.' + })) }); export const types_aggregations_t_digest = z.object({ - compression: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error.', - }) - ), - execution_hint: z.optional(types_aggregations_t_digest_execution_hint), + compression: z.optional(z.number().register(z.globalRegistry, { + description: 'Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error.' + })), + execution_hint: z.optional(types_aggregations_t_digest_execution_hint) }); -export const types_aggregations_percentiles_bucket_aggregation = - types_aggregations_pipeline_aggregation_base.and( - z.object({ - percents: z.optional( - z.array(z.number()).register(z.globalRegistry, { - description: 'The list of percentiles to calculate.', - }) - ), - }) - ); +export const types_aggregations_percentiles_bucket_aggregation = types_aggregations_pipeline_aggregation_base.and(z.object({ + percents: z.optional(z.array(z.number()).register(z.globalRegistry, { + description: 'The list of percentiles to calculate.' + })) +})); -export const types_aggregations_rare_terms_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - exclude: z.optional(types_aggregations_terms_exclude), - field: z.optional(types_field), - include: z.optional(types_aggregations_terms_include), - max_doc_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of documents a term should appear in.', - }) - ), - missing: z.optional(types_aggregations_missing), - precision: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The precision of the internal CuckooFilters.\nSmaller precision leads to better approximation, but higher memory usage.', - }) - ), - value_type: z.optional(z.string()), - }) - ); +export const types_aggregations_rare_terms_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + exclude: z.optional(types_aggregations_terms_exclude), + field: z.optional(types_field), + include: z.optional(types_aggregations_terms_include), + max_doc_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents a term should appear in.' + })), + missing: z.optional(types_aggregations_missing), + precision: z.optional(z.number().register(z.globalRegistry, { + description: 'The precision of the internal CuckooFilters.\nSmaller precision leads to better approximation, but higher memory usage.' + })), + value_type: z.optional(z.string()) +})); export const types_aggregations_rate_mode = z.enum(['sum', 'value_count']); -export const types_aggregations_reverse_nested_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - path: z.optional(types_field), - }) - ); - -export const types_aggregations_random_sampler_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - probability: z.number().register(z.globalRegistry, { - description: - 'The probability that a document will be included in the aggregated data.\nMust be greater than 0, less than 0.5, or exactly 1.\nThe lower the probability, the fewer documents are matched.', - }), - seed: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The seed to generate the random sampling of documents.\nWhen a seed is provided, the random subset of documents is the same between calls.', - }) - ), - shard_seed: z.optional( - z.number().register(z.globalRegistry, { - description: - 'When combined with seed, setting shard_seed ensures 100% consistent sampling over shards where data is exactly the same.', - }) - ), - }) - ); - -export const types_aggregations_sampler_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Limits how many top-scoring documents are collected in the sample processed on each shard.', - }) - ), - }) - ); +export const types_aggregations_reverse_nested_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + path: z.optional(types_field) +})); -export const types_aggregations_serial_differencing_aggregation = - types_aggregations_pipeline_aggregation_base.and( - z.object({ - lag: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The historical bucket to subtract from the current value.\nMust be a positive, non-zero integer.', - }) - ), - }) - ); +export const types_aggregations_random_sampler_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + probability: z.number().register(z.globalRegistry, { + description: 'The probability that a document will be included in the aggregated data.\nMust be greater than 0, less than 0.5, or exactly 1.\nThe lower the probability, the fewer documents are matched.' + }), + seed: z.optional(z.number().register(z.globalRegistry, { + description: 'The seed to generate the random sampling of documents.\nWhen a seed is provided, the random subset of documents is the same between calls.' + })), + shard_seed: z.optional(z.number().register(z.globalRegistry, { + description: 'When combined with seed, setting shard_seed ensures 100% consistent sampling over shards where data is exactly the same.' + })) +})); + +export const types_aggregations_sampler_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Limits how many top-scoring documents are collected in the sample processed on each shard.' + })) +})); + +export const types_aggregations_serial_differencing_aggregation = types_aggregations_pipeline_aggregation_base.and(z.object({ + lag: z.optional(z.number().register(z.globalRegistry, { + description: 'The historical bucket to subtract from the current value.\nMust be a positive, non-zero integer.' + })) +})); export const types_aggregations_chi_square_heuristic = z.object({ - background_is_superset: z.boolean().register(z.globalRegistry, { - description: - 'Set to `false` if you defined a custom background filter that represents a different set of documents that you want to compare to.', - }), - include_negatives: z.boolean().register(z.globalRegistry, { - description: - 'Set to `false` to filter out the terms that appear less often in the subset than in documents outside the subset.', - }), + background_is_superset: z.boolean().register(z.globalRegistry, { + description: 'Set to `false` if you defined a custom background filter that represents a different set of documents that you want to compare to.' + }), + include_negatives: z.boolean().register(z.globalRegistry, { + description: 'Set to `false` to filter out the terms that appear less often in the subset than in documents outside the subset.' + }) }); export const types_aggregations_terms_aggregation_execution_hint = z.enum([ - 'map', - 'global_ordinals', - 'global_ordinals_hash', - 'global_ordinals_low_cardinality', + 'map', + 'global_ordinals', + 'global_ordinals_hash', + 'global_ordinals_low_cardinality' ]); export const types_aggregations_google_normalized_distance_heuristic = z.object({ - background_is_superset: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `false` if you defined a custom background filter that represents a different set of documents that you want to compare to.', - }) - ), + background_is_superset: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `false` if you defined a custom background filter that represents a different set of documents that you want to compare to.' + })) }); export const types_aggregations_mutual_information_heuristic = z.object({ - background_is_superset: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `false` if you defined a custom background filter that represents a different set of documents that you want to compare to.', - }) - ), - include_negatives: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `false` to filter out the terms that appear less often in the subset than in documents outside the subset.', - }) - ), + background_is_superset: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `false` if you defined a custom background filter that represents a different set of documents that you want to compare to.' + })), + include_negatives: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `false` to filter out the terms that appear less often in the subset than in documents outside the subset.' + })) }); export const types_aggregations_percentage_score_heuristic = z.record(z.string(), z.unknown()); export const types_aggregations_p_value_heuristic = z.object({ - background_is_superset: z.optional(z.boolean()), - normalize_above: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Should the results be normalized when above the given value.\nAllows for consistent significance results at various scales.\nNote: `0` is a special value which means no normalization', - }) - ), + background_is_superset: z.optional(z.boolean()), + normalize_above: z.optional(z.number().register(z.globalRegistry, { + description: 'Should the results be normalized when above the given value.\nAllows for consistent significance results at various scales.\nNote: `0` is a special value which means no normalization' + })) }); -export const types_aggregations_stats_bucket_aggregation = - types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_stats_bucket_aggregation = types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_sum_bucket_aggregation = - types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_sum_bucket_aggregation = types_aggregations_pipeline_aggregation_base.and(z.record(z.string(), z.unknown())); -export const types_aggregations_time_series_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of results to return.', - }) - ), - keyed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` to associate a unique string key with each bucket and returns the ranges as a hash rather than an array.', - }) - ), - }) - ); +export const types_aggregations_time_series_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of results to return.' + })), + keyed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` to associate a unique string key with each bucket and returns the ranges as a hash rather than an array.' + })) +})); export const types_aggregations_t_test_type = z.enum([ - 'paired', - 'homoscedastic', - 'heteroscedastic', + 'paired', + 'homoscedastic', + 'heteroscedastic' ]); export const types_aggregations_top_metrics_value = z.object({ - field: types_field, + field: types_field }); -export const types_refresh = z.enum(['true', 'false', 'wait_for']); +export const types_refresh = z.enum([ + 'true', + 'false', + 'wait_for' +]); export const types_wait_for_active_shard_options = z.enum(['all', 'index-setting']); export const types_wait_for_active_shards = z.union([ - z.number(), - types_wait_for_active_shard_options, + z.number(), + types_wait_for_active_shard_options ]); export const global_bulk_operation_base = z.object({ - _id: z.optional(types_id), - _index: z.optional(types_index_name), - routing: z.optional(types_routing), - if_primary_term: z.optional(z.number()), - if_seq_no: z.optional(types_sequence_number), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), -}); - -export const global_bulk_write_operation = global_bulk_operation_base.and( - z.object({ - dynamic_templates: z.optional( - z.record(z.string(), z.string()).register(z.globalRegistry, { - description: - "A map from the full name of fields to the name of dynamic templates.\nIt defaults to an empty map.\nIf a name matches a dynamic template, that template will be applied regardless of other match predicates defined in the template.\nIf a field is already defined in the mapping, then this parameter won't be used.", - }) - ), - pipeline: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.', - }) - ), - require_alias: z.optional( - z.boolean().register(z.globalRegistry, { - description: "If `true`, the request's actions must target an index alias.", - }) - ), - }) -); - -export const global_bulk_index_operation = global_bulk_write_operation.and( - z.record(z.string(), z.unknown()) -); - -export const global_bulk_create_operation = global_bulk_write_operation.and( - z.record(z.string(), z.unknown()) -); - -export const global_bulk_update_operation = global_bulk_operation_base.and( - z.object({ - require_alias: z.optional( - z.boolean().register(z.globalRegistry, { - description: "If `true`, the request's actions must target an index alias.", - }) - ), - retry_on_conflict: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of times an update should be retried in the case of a version conflict.', - }) - ), - }) -); - -export const global_bulk_delete_operation = global_bulk_operation_base.and( - z.record(z.string(), z.unknown()) -); + _id: z.optional(types_id), + _index: z.optional(types_index_name), + routing: z.optional(types_routing), + if_primary_term: z.optional(z.number()), + if_seq_no: z.optional(types_sequence_number), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type) +}); + +export const global_bulk_write_operation = global_bulk_operation_base.and(z.object({ + dynamic_templates: z.optional(z.record(z.string(), z.string()).register(z.globalRegistry, { + description: 'A map from the full name of fields to the name of dynamic templates.\nIt defaults to an empty map.\nIf a name matches a dynamic template, that template will be applied regardless of other match predicates defined in the template.\nIf a field is already defined in the mapping, then this parameter won\'t be used.' + })), + pipeline: z.optional(z.string().register(z.globalRegistry, { + description: 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.' + })), + require_alias: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request\'s actions must target an index alias.' + })) +})); + +export const global_bulk_index_operation = global_bulk_write_operation.and(z.record(z.string(), z.unknown())); + +export const global_bulk_create_operation = global_bulk_write_operation.and(z.record(z.string(), z.unknown())); + +export const global_bulk_update_operation = global_bulk_operation_base.and(z.object({ + require_alias: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request\'s actions must target an index alias.' + })), + retry_on_conflict: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of times an update should be retried in the case of a version conflict.' + })) +})); + +export const global_bulk_delete_operation = global_bulk_operation_base.and(z.record(z.string(), z.unknown())); export const global_bulk_operation_container = z.object({ - index: z.optional(global_bulk_index_operation), - create: z.optional(global_bulk_create_operation), - update: z.optional(global_bulk_update_operation), - delete: z.optional(global_bulk_delete_operation), + index: z.optional(global_bulk_index_operation), + create: z.optional(global_bulk_create_operation), + update: z.optional(global_bulk_update_operation), + delete: z.optional(global_bulk_delete_operation) }); export const global_bulk_failure_store_status = z.enum([ - 'not_applicable_or_unknown', - 'used', - 'not_enabled', - 'failed', + 'not_applicable_or_unknown', + 'used', + 'not_enabled', + 'failed' ]); export const types_inline_get_dict_user_defined = z.object({ - fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - found: z.boolean(), - _seq_no: z.optional(types_sequence_number), - _primary_term: z.optional(z.number()), - _routing: z.optional(types_routing), - _source: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + found: z.boolean(), + _seq_no: z.optional(types_sequence_number), + _primary_term: z.optional(z.number()), + _routing: z.optional(types_routing), + _source: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))) }); export const global_bulk_response_item = z.object({ - _id: z.optional(z.union([z.string(), z.null()])), - _index: z.string().register(z.globalRegistry, { - description: - 'The name of the index associated with the operation.\nIf the operation targeted a data stream, this is the backing index into which the document was written.', - }), - status: z.number().register(z.globalRegistry, { - description: 'The HTTP status code returned for the operation.', - }), - failure_store: z.optional(global_bulk_failure_store_status), - error: z.optional(types_error_cause), - _primary_term: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The primary term assigned to the document for the operation.\nThis property is returned only for successful operations.', - }) - ), - result: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The result of the operation.\nSuccessful values are `created`, `deleted`, and `updated`.', - }) - ), - _seq_no: z.optional(types_sequence_number), - _shards: z.optional(types_shard_statistics), - _version: z.optional(types_version_number), - forced_refresh: z.optional(z.boolean()), - get: z.optional(types_inline_get_dict_user_defined), + _id: z.optional(z.union([ + z.string(), + z.null() + ])), + _index: z.string().register(z.globalRegistry, { + description: 'The name of the index associated with the operation.\nIf the operation targeted a data stream, this is the backing index into which the document was written.' + }), + status: z.number().register(z.globalRegistry, { + description: 'The HTTP status code returned for the operation.' + }), + failure_store: z.optional(global_bulk_failure_store_status), + error: z.optional(types_error_cause), + _primary_term: z.optional(z.number().register(z.globalRegistry, { + description: 'The primary term assigned to the document for the operation.\nThis property is returned only for successful operations.' + })), + result: z.optional(z.string().register(z.globalRegistry, { + description: 'The result of the operation.\nSuccessful values are `created`, `deleted`, and `updated`.' + })), + _seq_no: z.optional(types_sequence_number), + _shards: z.optional(types_shard_statistics), + _version: z.optional(types_version_number), + forced_refresh: z.optional(z.boolean()), + get: z.optional(types_inline_get_dict_user_defined) }); -export const types_names = z.union([types_name, z.array(types_name)]); +export const types_names = z.union([ + types_name, + z.array(types_name) +]); export const cat_types_cat_aliases_column = z.union([ - z.enum([ - 'alias', - 'a', - 'index', - 'i', - 'idx', - 'filter', - 'f', - 'fi', - 'routing.index', - 'ri', - 'routingIndex', - 'routing.search', - 'rs', - 'routingSearch', - 'is_write_index', - 'w', - 'isWriteIndex', - ]), - z.string(), + z.enum([ + 'alias', + 'a', + 'index', + 'i', + 'idx', + 'filter', + 'f', + 'fi', + 'routing.index', + 'ri', + 'routingIndex', + 'routing.search', + 'rs', + 'routingSearch', + 'is_write_index', + 'w', + 'isWriteIndex' + ]), + z.string() ]); export const cat_types_cat_aliases_columns = z.union([ - cat_types_cat_aliases_column, - z.array(cat_types_cat_aliases_column), + cat_types_cat_aliases_column, + z.array(cat_types_cat_aliases_column) ]); export const cat_aliases_aliases_record = z.object({ - alias: z.optional( - z.string().register(z.globalRegistry, { - description: 'alias name', - }) - ), - index: z.optional(types_index_name), - filter: z.optional( - z.string().register(z.globalRegistry, { - description: 'filter', - }) - ), - 'routing.index': z.optional( - z.string().register(z.globalRegistry, { - description: 'index routing', - }) - ), - 'routing.search': z.optional( - z.string().register(z.globalRegistry, { - description: 'search routing', - }) - ), - is_write_index: z.optional( - z.string().register(z.globalRegistry, { - description: 'write index', - }) - ), + alias: z.optional(z.string().register(z.globalRegistry, { + description: 'alias name' + })), + index: z.optional(types_index_name), + filter: z.optional(z.string().register(z.globalRegistry, { + description: 'filter' + })), + 'routing.index': z.optional(z.string().register(z.globalRegistry, { + description: 'index routing' + })), + 'routing.search': z.optional(z.string().register(z.globalRegistry, { + description: 'search routing' + })), + is_write_index: z.optional(z.string().register(z.globalRegistry, { + description: 'write index' + })) }); -export const types_node_ids = z.union([types_node_id, z.array(types_node_id)]); +export const types_node_ids = z.union([ + types_node_id, + z.array(types_node_id) +]); export const cat_types_cat_allocation_column = z.union([ - z.enum([ - 'shards', - 's', - 'shards.undesired', - 'write_load.forecast', - 'wlf', - 'writeLoadForecast', - 'disk.indices.forecast', - 'dif', - 'diskIndicesForecast', - 'disk.indices', - 'di', - 'diskIndices', - 'disk.used', - 'du', - 'diskUsed', - 'disk.avail', - 'da', - 'diskAvail', - 'disk.total', - 'dt', - 'diskTotal', - 'disk.percent', - 'dp', - 'diskPercent', - 'host', - 'h', - 'ip', - 'node', - 'n', - 'node.role', - 'r', - 'role', - 'nodeRole', - ]), - z.string(), + z.enum([ + 'shards', + 's', + 'shards.undesired', + 'write_load.forecast', + 'wlf', + 'writeLoadForecast', + 'disk.indices.forecast', + 'dif', + 'diskIndicesForecast', + 'disk.indices', + 'di', + 'diskIndices', + 'disk.used', + 'du', + 'diskUsed', + 'disk.avail', + 'da', + 'diskAvail', + 'disk.total', + 'dt', + 'diskTotal', + 'disk.percent', + 'dp', + 'diskPercent', + 'host', + 'h', + 'ip', + 'node', + 'n', + 'node.role', + 'r', + 'role', + 'nodeRole' + ]), + z.string() ]); export const cat_types_cat_allocation_columns = z.union([ - cat_types_cat_allocation_column, - z.array(cat_types_cat_allocation_column), + cat_types_cat_allocation_column, + z.array(cat_types_cat_allocation_column) ]); /** @@ -4778,167 +3910,205 @@ export const cat_types_cat_allocation_columns = z.union([ * Depending on the target language, code generators can keep the union or remove it and leniently parse * strings to the target type. */ -export const spec_utils_stringifieddouble = z.union([z.number(), z.string()]); +export const spec_utils_stringifieddouble = z.union([ + z.number(), + z.string() +]); -export const types_byte_size = z.union([z.number(), z.string()]); +export const types_byte_size = z.union([ + z.number(), + z.string() +]); -export const types_percentage = z.union([z.string(), z.number()]); +export const types_percentage = z.union([ + z.string(), + z.number() +]); export const types_host = z.string(); export const types_ip = z.string(); export const cat_allocation_allocation_record = z.object({ - shards: z.optional( - z.string().register(z.globalRegistry, { - description: 'Number of primary and replica shards assigned to the node.', - }) - ), - 'shards.undesired': z.optional(z.union([z.string(), z.null()])), - 'write_load.forecast': z.optional(z.union([spec_utils_stringifieddouble, z.string(), z.null()])), - 'disk.indices.forecast': z.optional(z.union([types_byte_size, z.string(), z.null()])), - 'disk.indices': z.optional(z.union([types_byte_size, z.string(), z.null()])), - 'disk.used': z.optional(z.union([types_byte_size, z.string(), z.null()])), - 'disk.avail': z.optional(z.union([types_byte_size, z.string(), z.null()])), - 'disk.total': z.optional(z.union([types_byte_size, z.string(), z.null()])), - 'disk.percent': z.optional(z.union([types_percentage, z.string(), z.null()])), - host: z.optional(z.union([types_host, z.string(), z.null()])), - ip: z.optional(z.union([types_ip, z.string(), z.null()])), - node: z.optional( - z.string().register(z.globalRegistry, { - description: 'Name for the node. Set using the `node.name` setting.', - }) - ), - 'node.role': z.optional(z.union([z.string(), z.null()])), + shards: z.optional(z.string().register(z.globalRegistry, { + description: 'Number of primary and replica shards assigned to the node.' + })), + 'shards.undesired': z.optional(z.union([ + z.string(), + z.null() + ])), + 'write_load.forecast': z.optional(z.union([ + spec_utils_stringifieddouble, + z.string(), + z.null() + ])), + 'disk.indices.forecast': z.optional(z.union([ + types_byte_size, + z.string(), + z.null() + ])), + 'disk.indices': z.optional(z.union([ + types_byte_size, + z.string(), + z.null() + ])), + 'disk.used': z.optional(z.union([ + types_byte_size, + z.string(), + z.null() + ])), + 'disk.avail': z.optional(z.union([ + types_byte_size, + z.string(), + z.null() + ])), + 'disk.total': z.optional(z.union([ + types_byte_size, + z.string(), + z.null() + ])), + 'disk.percent': z.optional(z.union([ + types_percentage, + z.string(), + z.null() + ])), + host: z.optional(z.union([ + types_host, + z.string(), + z.null() + ])), + ip: z.optional(z.union([ + types_ip, + z.string(), + z.null() + ])), + node: z.optional(z.string().register(z.globalRegistry, { + description: 'Name for the node. Set using the `node.name` setting.' + })), + 'node.role': z.optional(z.union([ + z.string(), + z.null() + ])) }); export const cat_types_cat_circuit_breaker_column = z.union([ - z.enum([ - 'node_id', - 'id', - 'node_name', - 'nn', - 'breaker', - 'br', - 'limit', - 'l', - 'limit_bytes', - 'lb', - 'estimated', - 'e', - 'estimated_bytes', - 'eb', - 'tripped', - 't', - 'overhead', - 'o', - ]), - z.string(), + z.enum([ + 'node_id', + 'id', + 'node_name', + 'nn', + 'breaker', + 'br', + 'limit', + 'l', + 'limit_bytes', + 'lb', + 'estimated', + 'e', + 'estimated_bytes', + 'eb', + 'tripped', + 't', + 'overhead', + 'o' + ]), + z.string() ]); export const cat_types_cat_circuit_breaker_columns = z.union([ - cat_types_cat_circuit_breaker_column, - z.array(cat_types_cat_circuit_breaker_column), + cat_types_cat_circuit_breaker_column, + z.array(cat_types_cat_circuit_breaker_column) ]); export const cat_circuit_breaker_circuit_breaker_record = z.object({ - node_id: z.optional(types_node_id), - node_name: z.optional( - z.string().register(z.globalRegistry, { - description: 'Node name', - }) - ), - breaker: z.optional( - z.string().register(z.globalRegistry, { - description: 'Breaker name', - }) - ), - limit: z.optional( - z.string().register(z.globalRegistry, { - description: 'Limit size', - }) - ), - limit_bytes: z.optional(types_byte_size), - estimated: z.optional( - z.string().register(z.globalRegistry, { - description: 'Estimated size', - }) - ), - estimated_bytes: z.optional(types_byte_size), - tripped: z.optional( - z.string().register(z.globalRegistry, { - description: 'Tripped count', - }) - ), - overhead: z.optional( - z.string().register(z.globalRegistry, { - description: 'Overhead', - }) - ), + node_id: z.optional(types_node_id), + node_name: z.optional(z.string().register(z.globalRegistry, { + description: 'Node name' + })), + breaker: z.optional(z.string().register(z.globalRegistry, { + description: 'Breaker name' + })), + limit: z.optional(z.string().register(z.globalRegistry, { + description: 'Limit size' + })), + limit_bytes: z.optional(types_byte_size), + estimated: z.optional(z.string().register(z.globalRegistry, { + description: 'Estimated size' + })), + estimated_bytes: z.optional(types_byte_size), + tripped: z.optional(z.string().register(z.globalRegistry, { + description: 'Tripped count' + })), + overhead: z.optional(z.string().register(z.globalRegistry, { + description: 'Overhead' + })) }); export const cat_types_cat_component_column = z.union([ - z.enum([ - 'name', - 'n', - 'version', - 'v', - 'alias_count', - 'a', - 'mapping_count', - 'm', - 'settings_count', - 's', - 'metadata_count', - 'me', - 'included_in', - 'i', - ]), - z.string(), + z.enum([ + 'name', + 'n', + 'version', + 'v', + 'alias_count', + 'a', + 'mapping_count', + 'm', + 'settings_count', + 's', + 'metadata_count', + 'me', + 'included_in', + 'i' + ]), + z.string() ]); export const cat_types_cat_component_columns = z.union([ - cat_types_cat_component_column, - z.array(cat_types_cat_component_column), + cat_types_cat_component_column, + z.array(cat_types_cat_component_column) ]); export const cat_component_templates_component_template = z.object({ - name: z.string(), - version: z.union([z.string(), z.null()]), - alias_count: z.string(), - mapping_count: z.string(), - settings_count: z.string(), - metadata_count: z.string(), - included_in: z.string(), + name: z.string(), + version: z.union([ + z.string(), + z.null() + ]), + alias_count: z.string(), + mapping_count: z.string(), + settings_count: z.string(), + metadata_count: z.string(), + included_in: z.string() }); export const cat_types_cat_count_column = z.union([ - z.enum([ - 'epoch', - 't', - 'time', - 'timestamp', - 'ts', - 'hms', - 'hhmmss', - 'count', - 'dc', - 'docs.count', - 'docsCount', - ]), - z.string(), + z.enum([ + 'epoch', + 't', + 'time', + 'timestamp', + 'ts', + 'hms', + 'hhmmss', + 'count', + 'dc', + 'docs.count', + 'docsCount' + ]), + z.string() ]); export const cat_types_cat_count_columns = z.union([ - cat_types_cat_count_column, - z.array(cat_types_cat_count_column), + cat_types_cat_count_column, + z.array(cat_types_cat_count_column) ]); /** * Time unit for seconds */ export const types_unit_seconds = z.number().register(z.globalRegistry, { - description: 'Time unit for seconds', + description: 'Time unit for seconds' }); export const types_epoch_time_unit_seconds = types_unit_seconds; @@ -4951,4437 +4121,3461 @@ export const types_epoch_time_unit_seconds = types_unit_seconds; * strings to the target type. */ export const spec_utils_stringified_epoch_time_unit_seconds = z.union([ - types_epoch_time_unit_seconds, - z.string(), + types_epoch_time_unit_seconds, + z.string() ]); /** * Time of day, expressed as HH:MM:SS */ export const types_time_of_day = z.string().register(z.globalRegistry, { - description: 'Time of day, expressed as HH:MM:SS', + description: 'Time of day, expressed as HH:MM:SS' }); export const cat_count_count_record = z.object({ - epoch: z.optional(spec_utils_stringified_epoch_time_unit_seconds), - timestamp: z.optional(types_time_of_day), - count: z.optional( - z.string().register(z.globalRegistry, { - description: 'the document count', - }) - ), + epoch: z.optional(spec_utils_stringified_epoch_time_unit_seconds), + timestamp: z.optional(types_time_of_day), + count: z.optional(z.string().register(z.globalRegistry, { + description: 'the document count' + })) }); export const cat_types_cat_field_data_column = z.union([ - z.enum(['id', 'host', 'h', 'ip', 'node', 'n', 'field', 'f', 'size', 's']), - z.string(), + z.enum([ + 'id', + 'host', + 'h', + 'ip', + 'node', + 'n', + 'field', + 'f', + 'size', + 's' + ]), + z.string() ]); export const cat_types_cat_field_data_columns = z.union([ - cat_types_cat_field_data_column, - z.array(cat_types_cat_field_data_column), + cat_types_cat_field_data_column, + z.array(cat_types_cat_field_data_column) ]); export const cat_fielddata_fielddata_record = z.object({ - id: z.optional( - z.string().register(z.globalRegistry, { - description: 'node id', - }) - ), - host: z.optional( - z.string().register(z.globalRegistry, { - description: 'host name', - }) - ), - ip: z.optional( - z.string().register(z.globalRegistry, { - description: 'ip address', - }) - ), - node: z.optional( - z.string().register(z.globalRegistry, { - description: 'node name', - }) - ), - field: z.optional( - z.string().register(z.globalRegistry, { - description: 'field name', - }) - ), - size: z.optional( - z.string().register(z.globalRegistry, { - description: 'field data usage', - }) - ), + id: z.optional(z.string().register(z.globalRegistry, { + description: 'node id' + })), + host: z.optional(z.string().register(z.globalRegistry, { + description: 'host name' + })), + ip: z.optional(z.string().register(z.globalRegistry, { + description: 'ip address' + })), + node: z.optional(z.string().register(z.globalRegistry, { + description: 'node name' + })), + field: z.optional(z.string().register(z.globalRegistry, { + description: 'field name' + })), + size: z.optional(z.string().register(z.globalRegistry, { + description: 'field data usage' + })) }); export const cat_types_cat_health_column = z.union([ - z.enum([ - 'epoch', - 't', - 'time', - 'timestamp', - 'ts', - 'hms', - 'hhmmss', - 'cluster', - 'cl', - 'status', - 'st', - 'node.total', - 'nt', - 'nodeTotal', - 'node.data', - 'nd', - 'nodeData', - 'shards', - 't', - 'sh', - 'shards.total', - 'shardsTotal', - 'pri', - 'p', - 'shards.primary', - 'shardsPrimary', - 'relo', - 'r', - 'shards.relocating', - 'shardsRelocating', - 'init', - 'i', - 'shards.initializing', - 'shardsInitializing', - 'unassign', - 'u', - 'shards.unassigned', - 'shardsUnassigned', - 'unassign.pri', - 'up', - 'shards.unassigned.primary', - 'shardsUnassignedPrimary', - 'pending_tasks', - 'pt', - 'pendingTasks', - 'max_task_wait_time', - 'mtwt', - 'maxTaskWaitTime', - 'active_shards_percent', - 'asp', - 'activeShardsPercent', - ]), - z.string(), + z.enum([ + 'epoch', + 't', + 'time', + 'timestamp', + 'ts', + 'hms', + 'hhmmss', + 'cluster', + 'cl', + 'status', + 'st', + 'node.total', + 'nt', + 'nodeTotal', + 'node.data', + 'nd', + 'nodeData', + 'shards', + 't', + 'sh', + 'shards.total', + 'shardsTotal', + 'pri', + 'p', + 'shards.primary', + 'shardsPrimary', + 'relo', + 'r', + 'shards.relocating', + 'shardsRelocating', + 'init', + 'i', + 'shards.initializing', + 'shardsInitializing', + 'unassign', + 'u', + 'shards.unassigned', + 'shardsUnassigned', + 'unassign.pri', + 'up', + 'shards.unassigned.primary', + 'shardsUnassignedPrimary', + 'pending_tasks', + 'pt', + 'pendingTasks', + 'max_task_wait_time', + 'mtwt', + 'maxTaskWaitTime', + 'active_shards_percent', + 'asp', + 'activeShardsPercent' + ]), + z.string() ]); export const cat_types_cat_health_columns = z.union([ - cat_types_cat_health_column, - z.array(cat_types_cat_health_column), + cat_types_cat_health_column, + z.array(cat_types_cat_health_column) ]); export const cat_health_health_record = z.object({ - epoch: z.optional(spec_utils_stringified_epoch_time_unit_seconds), - timestamp: z.optional(types_time_of_day), - cluster: z.optional( - z.string().register(z.globalRegistry, { - description: 'cluster name', - }) - ), - status: z.optional( - z.string().register(z.globalRegistry, { - description: 'health status', - }) - ), - 'node.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'total number of nodes', - }) - ), - 'node.data': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of nodes that can store data', - }) - ), - shards: z.optional( - z.string().register(z.globalRegistry, { - description: 'total number of shards', - }) - ), - pri: z.optional( - z.string().register(z.globalRegistry, { - description: 'number of primary shards', - }) - ), - relo: z.optional( - z.string().register(z.globalRegistry, { - description: 'number of relocating nodes', - }) - ), - init: z.optional( - z.string().register(z.globalRegistry, { - description: 'number of initializing nodes', - }) - ), - 'unassign.pri': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of unassigned primary shards', - }) - ), - unassign: z.optional( - z.string().register(z.globalRegistry, { - description: 'number of unassigned shards', - }) - ), - pending_tasks: z.optional( - z.string().register(z.globalRegistry, { - description: 'number of pending tasks', - }) - ), - max_task_wait_time: z.optional( - z.string().register(z.globalRegistry, { - description: 'wait time of longest task pending', - }) - ), - active_shards_percent: z.optional( - z.string().register(z.globalRegistry, { - description: 'active number of shards in percent', - }) - ), + epoch: z.optional(spec_utils_stringified_epoch_time_unit_seconds), + timestamp: z.optional(types_time_of_day), + cluster: z.optional(z.string().register(z.globalRegistry, { + description: 'cluster name' + })), + status: z.optional(z.string().register(z.globalRegistry, { + description: 'health status' + })), + 'node.total': z.optional(z.string().register(z.globalRegistry, { + description: 'total number of nodes' + })), + 'node.data': z.optional(z.string().register(z.globalRegistry, { + description: 'number of nodes that can store data' + })), + shards: z.optional(z.string().register(z.globalRegistry, { + description: 'total number of shards' + })), + pri: z.optional(z.string().register(z.globalRegistry, { + description: 'number of primary shards' + })), + relo: z.optional(z.string().register(z.globalRegistry, { + description: 'number of relocating nodes' + })), + init: z.optional(z.string().register(z.globalRegistry, { + description: 'number of initializing nodes' + })), + 'unassign.pri': z.optional(z.string().register(z.globalRegistry, { + description: 'number of unassigned primary shards' + })), + unassign: z.optional(z.string().register(z.globalRegistry, { + description: 'number of unassigned shards' + })), + pending_tasks: z.optional(z.string().register(z.globalRegistry, { + description: 'number of pending tasks' + })), + max_task_wait_time: z.optional(z.string().register(z.globalRegistry, { + description: 'wait time of longest task pending' + })), + active_shards_percent: z.optional(z.string().register(z.globalRegistry, { + description: 'active number of shards in percent' + })) }); export const types_health_status = z.enum([ - 'green', - 'GREEN', - 'yellow', - 'YELLOW', - 'red', - 'RED', - 'unknown', - 'unavailable', + 'green', + 'GREEN', + 'yellow', + 'YELLOW', + 'red', + 'RED', + 'unknown', + 'unavailable' ]); export const cat_types_cat_indices_column = z.union([ - z.enum([ - 'health', - 'h', - 'status', - 's', - 'index', - 'i', - 'idx', - 'uuid', - 'id', - 'uuid', - 'pri', - 'p', - 'shards.primary', - 'shardsPrimary', - 'rep', - 'r', - 'shards.replica', - 'shardsReplica', - 'docs.count', - 'dc', - 'docsCount', - 'docs.deleted', - 'dd', - 'docsDeleted', - 'creation.date', - 'cd', - 'creation.date.string', - 'cds', - 'store.size', - 'ss', - 'storeSize', - 'pri.store.size', - 'dataset.size', - 'completion.size', - 'cs', - 'completionSize', - 'pri.completion.size', - 'fielddata.memory_size', - 'fm', - 'fielddataMemory', - 'pri.fielddata.memory_size', - 'fielddata.evictions', - 'fe', - 'fielddataEvictions', - 'pri.fielddata.evictions', - 'query_cache.memory_size', - 'qcm', - 'queryCacheMemory', - 'pri.query_cache.memory_size', - 'query_cache.evictions', - 'qce', - 'queryCacheEvictions', - 'pri.query_cache.evictions', - 'request_cache.memory_size', - 'rcm', - 'requestCacheMemory', - 'pri.request_cache.memory_size', - 'request_cache.evictions', - 'rce', - 'requestCacheEvictions', - 'pri.request_cache.evictions', - 'request_cache.hit_count', - 'rchc', - 'requestCacheHitCount', - 'pri.request_cache.hit_count', - 'request_cache.miss_count', - 'rcmc', - 'requestCacheMissCount', - 'pri.request_cache.miss_count', - 'flush.total', - 'ft', - 'flushTotal', - 'pri.flush.total', - 'flush.total_time', - 'ftt', - 'flushTotalTime', - 'pri.flush.total_time', - 'get.current', - 'gc', - 'getCurrent', - 'pri.get.current', - 'get.time', - 'gti', - 'getTime', - 'pri.get.time', - 'get.total', - 'gto', - 'getTotal', - 'pri.get.total', - 'get.exists_time', - 'geti', - 'getExistsTime', - 'pri.get.exists_time', - 'get.exists_total', - 'geto', - 'getExistsTotal', - 'pri.get.exists_total', - 'get.missing_time', - 'gmti', - 'getMissingTime', - 'pri.get.missing_time', - 'get.missing_total', - 'gmto', - 'getMissingTotal', - 'pri.get.missing_total', - 'indexing.delete_current', - 'idc', - 'indexingDeleteCurrent', - 'pri.indexing.delete_current', - 'indexing.delete_time', - 'idti', - 'indexingDeleteTime', - 'pri.indexing.delete_time', - 'indexing.delete_total', - 'idto', - 'indexingDeleteTotal', - 'pri.indexing.delete_total', - 'indexing.index_current', - 'iic', - 'indexingIndexCurrent', - 'pri.indexing.index_current', - 'indexing.index_time', - 'iiti', - 'indexingIndexTime', - 'pri.indexing.index_time', - 'indexing.index_total', - 'iito', - 'indexingIndexTotal', - 'pri.indexing.index_total', - 'indexing.index_failed', - 'iif', - 'indexingIndexFailed', - 'pri.indexing.index_failed', - 'indexing.index_failed_due_to_version_conflict', - 'iifvc', - 'indexingIndexFailedDueToVersionConflict', - 'pri.indexing.index_failed_due_to_version_conflict', - 'merges.current', - 'mc', - 'mergesCurrent', - 'pri.merges.current', - 'merges.current_docs', - 'mcd', - 'mergesCurrentDocs', - 'pri.merges.current_docs', - 'merges.current_size', - 'mcs', - 'mergesCurrentSize', - 'pri.merges.current_size', - 'merges.total', - 'mt', - 'mergesTotal', - 'pri.merges.total', - 'merges.total_docs', - 'mtd', - 'mergesTotalDocs', - 'pri.merges.total_docs', - 'merges.total_size', - 'mts', - 'mergesTotalSize', - 'pri.merges.total_size', - 'merges.total_time', - 'mtt', - 'mergesTotalTime', - 'pri.merges.total_time', - 'refresh.total', - 'rto', - 'refreshTotal', - 'pri.refresh.total', - 'refresh.time', - 'rti', - 'refreshTime', - 'pri.refresh.time', - 'refresh.external_total', - 'rto', - 'refreshTotal', - 'pri.refresh.external_total', - 'refresh.external_time', - 'rti', - 'refreshTime', - 'pri.refresh.external_time', - 'refresh.listeners', - 'rli', - 'refreshListeners', - 'pri.refresh.listeners', - 'search.fetch_current', - 'sfc', - 'searchFetchCurrent', - 'pri.search.fetch_current', - 'search.fetch_time', - 'sfti', - 'searchFetchTime', - 'pri.search.fetch_time', - 'search.fetch_total', - 'sfto', - 'searchFetchTotal', - 'pri.search.fetch_total', - 'search.open_contexts', - 'so', - 'searchOpenContexts', - 'pri.search.open_contexts', - 'search.query_current', - 'sqc', - 'searchQueryCurrent', - 'pri.search.query_current', - 'search.query_time', - 'sqti', - 'searchQueryTime', - 'pri.search.query_time', - 'search.query_total', - 'sqto', - 'searchQueryTotal', - 'pri.search.query_total', - 'search.scroll_current', - 'scc', - 'searchScrollCurrent', - 'pri.search.scroll_current', - 'search.scroll_time', - 'scti', - 'searchScrollTime', - 'pri.search.scroll_time', - 'search.scroll_total', - 'scto', - 'searchScrollTotal', - 'pri.search.scroll_total', - 'segments.count', - 'sc', - 'segmentsCount', - 'pri.segments.count', - 'segments.memory', - 'sm', - 'segmentsMemory', - 'pri.segments.memory', - 'segments.index_writer_memory', - 'siwm', - 'segmentsIndexWriterMemory', - 'pri.segments.index_writer_memory', - 'segments.version_map_memory', - 'svmm', - 'segmentsVersionMapMemory', - 'pri.segments.version_map_memory', - 'segments.fixed_bitset_memory', - 'sfbm', - 'fixedBitsetMemory', - 'pri.segments.fixed_bitset_memory', - 'warmer.current', - 'wc', - 'warmerCurrent', - 'pri.warmer.current', - 'warmer.total', - 'wto', - 'warmerTotal', - 'pri.warmer.total', - 'warmer.total_time', - 'wtt', - 'warmerTotalTime', - 'pri.warmer.total_time', - 'suggest.current', - 'suc', - 'suggestCurrent', - 'pri.suggest.current', - 'suggest.time', - 'suti', - 'suggestTime', - 'pri.suggest.time', - 'suggest.total', - 'suto', - 'suggestTotal', - 'pri.suggest.total', - 'memory.total', - 'tm', - 'memoryTotal', - 'pri.memory.total', - 'bulk.total_operations', - 'bto', - 'bulkTotalOperation', - 'pri.bulk.total_operations', - 'bulk.total_time', - 'btti', - 'bulkTotalTime', - 'pri.bulk.total_time', - 'bulk.total_size_in_bytes', - 'btsi', - 'bulkTotalSizeInBytes', - 'pri.bulk.total_size_in_bytes', - 'bulk.avg_time', - 'bati', - 'bulkAvgTime', - 'pri.bulk.avg_time', - 'bulk.avg_size_in_bytes', - 'basi', - 'bulkAvgSizeInBytes', - 'pri.bulk.avg_size_in_bytes', - 'dense_vector.value_count', - 'dvc', - 'denseVectorCount', - 'pri.dense_vector.value_count', - 'sparse_vector.value_count', - 'svc', - 'sparseVectorCount', - 'pri.sparse_vector.value_count', - ]), - z.string(), + z.enum([ + 'health', + 'h', + 'status', + 's', + 'index', + 'i', + 'idx', + 'uuid', + 'id', + 'uuid', + 'pri', + 'p', + 'shards.primary', + 'shardsPrimary', + 'rep', + 'r', + 'shards.replica', + 'shardsReplica', + 'docs.count', + 'dc', + 'docsCount', + 'docs.deleted', + 'dd', + 'docsDeleted', + 'creation.date', + 'cd', + 'creation.date.string', + 'cds', + 'store.size', + 'ss', + 'storeSize', + 'pri.store.size', + 'dataset.size', + 'completion.size', + 'cs', + 'completionSize', + 'pri.completion.size', + 'fielddata.memory_size', + 'fm', + 'fielddataMemory', + 'pri.fielddata.memory_size', + 'fielddata.evictions', + 'fe', + 'fielddataEvictions', + 'pri.fielddata.evictions', + 'query_cache.memory_size', + 'qcm', + 'queryCacheMemory', + 'pri.query_cache.memory_size', + 'query_cache.evictions', + 'qce', + 'queryCacheEvictions', + 'pri.query_cache.evictions', + 'request_cache.memory_size', + 'rcm', + 'requestCacheMemory', + 'pri.request_cache.memory_size', + 'request_cache.evictions', + 'rce', + 'requestCacheEvictions', + 'pri.request_cache.evictions', + 'request_cache.hit_count', + 'rchc', + 'requestCacheHitCount', + 'pri.request_cache.hit_count', + 'request_cache.miss_count', + 'rcmc', + 'requestCacheMissCount', + 'pri.request_cache.miss_count', + 'flush.total', + 'ft', + 'flushTotal', + 'pri.flush.total', + 'flush.total_time', + 'ftt', + 'flushTotalTime', + 'pri.flush.total_time', + 'get.current', + 'gc', + 'getCurrent', + 'pri.get.current', + 'get.time', + 'gti', + 'getTime', + 'pri.get.time', + 'get.total', + 'gto', + 'getTotal', + 'pri.get.total', + 'get.exists_time', + 'geti', + 'getExistsTime', + 'pri.get.exists_time', + 'get.exists_total', + 'geto', + 'getExistsTotal', + 'pri.get.exists_total', + 'get.missing_time', + 'gmti', + 'getMissingTime', + 'pri.get.missing_time', + 'get.missing_total', + 'gmto', + 'getMissingTotal', + 'pri.get.missing_total', + 'indexing.delete_current', + 'idc', + 'indexingDeleteCurrent', + 'pri.indexing.delete_current', + 'indexing.delete_time', + 'idti', + 'indexingDeleteTime', + 'pri.indexing.delete_time', + 'indexing.delete_total', + 'idto', + 'indexingDeleteTotal', + 'pri.indexing.delete_total', + 'indexing.index_current', + 'iic', + 'indexingIndexCurrent', + 'pri.indexing.index_current', + 'indexing.index_time', + 'iiti', + 'indexingIndexTime', + 'pri.indexing.index_time', + 'indexing.index_total', + 'iito', + 'indexingIndexTotal', + 'pri.indexing.index_total', + 'indexing.index_failed', + 'iif', + 'indexingIndexFailed', + 'pri.indexing.index_failed', + 'indexing.index_failed_due_to_version_conflict', + 'iifvc', + 'indexingIndexFailedDueToVersionConflict', + 'pri.indexing.index_failed_due_to_version_conflict', + 'merges.current', + 'mc', + 'mergesCurrent', + 'pri.merges.current', + 'merges.current_docs', + 'mcd', + 'mergesCurrentDocs', + 'pri.merges.current_docs', + 'merges.current_size', + 'mcs', + 'mergesCurrentSize', + 'pri.merges.current_size', + 'merges.total', + 'mt', + 'mergesTotal', + 'pri.merges.total', + 'merges.total_docs', + 'mtd', + 'mergesTotalDocs', + 'pri.merges.total_docs', + 'merges.total_size', + 'mts', + 'mergesTotalSize', + 'pri.merges.total_size', + 'merges.total_time', + 'mtt', + 'mergesTotalTime', + 'pri.merges.total_time', + 'refresh.total', + 'rto', + 'refreshTotal', + 'pri.refresh.total', + 'refresh.time', + 'rti', + 'refreshTime', + 'pri.refresh.time', + 'refresh.external_total', + 'rto', + 'refreshTotal', + 'pri.refresh.external_total', + 'refresh.external_time', + 'rti', + 'refreshTime', + 'pri.refresh.external_time', + 'refresh.listeners', + 'rli', + 'refreshListeners', + 'pri.refresh.listeners', + 'search.fetch_current', + 'sfc', + 'searchFetchCurrent', + 'pri.search.fetch_current', + 'search.fetch_time', + 'sfti', + 'searchFetchTime', + 'pri.search.fetch_time', + 'search.fetch_total', + 'sfto', + 'searchFetchTotal', + 'pri.search.fetch_total', + 'search.open_contexts', + 'so', + 'searchOpenContexts', + 'pri.search.open_contexts', + 'search.query_current', + 'sqc', + 'searchQueryCurrent', + 'pri.search.query_current', + 'search.query_time', + 'sqti', + 'searchQueryTime', + 'pri.search.query_time', + 'search.query_total', + 'sqto', + 'searchQueryTotal', + 'pri.search.query_total', + 'search.scroll_current', + 'scc', + 'searchScrollCurrent', + 'pri.search.scroll_current', + 'search.scroll_time', + 'scti', + 'searchScrollTime', + 'pri.search.scroll_time', + 'search.scroll_total', + 'scto', + 'searchScrollTotal', + 'pri.search.scroll_total', + 'segments.count', + 'sc', + 'segmentsCount', + 'pri.segments.count', + 'segments.memory', + 'sm', + 'segmentsMemory', + 'pri.segments.memory', + 'segments.index_writer_memory', + 'siwm', + 'segmentsIndexWriterMemory', + 'pri.segments.index_writer_memory', + 'segments.version_map_memory', + 'svmm', + 'segmentsVersionMapMemory', + 'pri.segments.version_map_memory', + 'segments.fixed_bitset_memory', + 'sfbm', + 'fixedBitsetMemory', + 'pri.segments.fixed_bitset_memory', + 'warmer.current', + 'wc', + 'warmerCurrent', + 'pri.warmer.current', + 'warmer.total', + 'wto', + 'warmerTotal', + 'pri.warmer.total', + 'warmer.total_time', + 'wtt', + 'warmerTotalTime', + 'pri.warmer.total_time', + 'suggest.current', + 'suc', + 'suggestCurrent', + 'pri.suggest.current', + 'suggest.time', + 'suti', + 'suggestTime', + 'pri.suggest.time', + 'suggest.total', + 'suto', + 'suggestTotal', + 'pri.suggest.total', + 'memory.total', + 'tm', + 'memoryTotal', + 'pri.memory.total', + 'bulk.total_operations', + 'bto', + 'bulkTotalOperation', + 'pri.bulk.total_operations', + 'bulk.total_time', + 'btti', + 'bulkTotalTime', + 'pri.bulk.total_time', + 'bulk.total_size_in_bytes', + 'btsi', + 'bulkTotalSizeInBytes', + 'pri.bulk.total_size_in_bytes', + 'bulk.avg_time', + 'bati', + 'bulkAvgTime', + 'pri.bulk.avg_time', + 'bulk.avg_size_in_bytes', + 'basi', + 'bulkAvgSizeInBytes', + 'pri.bulk.avg_size_in_bytes', + 'dense_vector.value_count', + 'dvc', + 'denseVectorCount', + 'pri.dense_vector.value_count', + 'sparse_vector.value_count', + 'svc', + 'sparseVectorCount', + 'pri.sparse_vector.value_count' + ]), + z.string() ]); export const cat_types_cat_indices_columns = z.union([ - cat_types_cat_indices_column, - z.array(cat_types_cat_indices_column), + cat_types_cat_indices_column, + z.array(cat_types_cat_indices_column) ]); export const cat_indices_indices_record = z.object({ - health: z.optional( - z.string().register(z.globalRegistry, { - description: 'current health status', - }) - ), - status: z.optional( - z.string().register(z.globalRegistry, { - description: 'open/close status', - }) - ), - index: z.optional( - z.string().register(z.globalRegistry, { - description: 'index name', - }) - ), - uuid: z.optional( - z.string().register(z.globalRegistry, { - description: 'index uuid', - }) - ), - pri: z.optional( - z.string().register(z.globalRegistry, { - description: 'number of primary shards', - }) - ), - rep: z.optional( - z.string().register(z.globalRegistry, { - description: 'number of replica shards', - }) - ), - 'docs.count': z.optional(z.union([z.string(), z.null()])), - 'docs.deleted': z.optional(z.union([z.string(), z.null()])), - 'creation.date': z.optional( - z.string().register(z.globalRegistry, { - description: 'index creation date (millisecond value)', - }) - ), - 'creation.date.string': z.optional( - z.string().register(z.globalRegistry, { - description: 'index creation date (as string)', - }) - ), - 'store.size': z.optional(z.union([z.string(), z.null()])), - 'pri.store.size': z.optional(z.union([z.string(), z.null()])), - 'dataset.size': z.optional(z.union([z.string(), z.null()])), - 'completion.size': z.optional( - z.string().register(z.globalRegistry, { - description: 'size of completion', - }) - ), - 'pri.completion.size': z.optional( - z.string().register(z.globalRegistry, { - description: 'size of completion', - }) - ), - 'fielddata.memory_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'used fielddata cache', - }) - ), - 'pri.fielddata.memory_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'used fielddata cache', - }) - ), - 'fielddata.evictions': z.optional( - z.string().register(z.globalRegistry, { - description: 'fielddata evictions', - }) - ), - 'pri.fielddata.evictions': z.optional( - z.string().register(z.globalRegistry, { - description: 'fielddata evictions', - }) - ), - 'query_cache.memory_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'used query cache', - }) - ), - 'pri.query_cache.memory_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'used query cache', - }) - ), - 'query_cache.evictions': z.optional( - z.string().register(z.globalRegistry, { - description: 'query cache evictions', - }) - ), - 'pri.query_cache.evictions': z.optional( - z.string().register(z.globalRegistry, { - description: 'query cache evictions', - }) - ), - 'request_cache.memory_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'used request cache', - }) - ), - 'pri.request_cache.memory_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'used request cache', - }) - ), - 'request_cache.evictions': z.optional( - z.string().register(z.globalRegistry, { - description: 'request cache evictions', - }) - ), - 'pri.request_cache.evictions': z.optional( - z.string().register(z.globalRegistry, { - description: 'request cache evictions', - }) - ), - 'request_cache.hit_count': z.optional( - z.string().register(z.globalRegistry, { - description: 'request cache hit count', - }) - ), - 'pri.request_cache.hit_count': z.optional( - z.string().register(z.globalRegistry, { - description: 'request cache hit count', - }) - ), - 'request_cache.miss_count': z.optional( - z.string().register(z.globalRegistry, { - description: 'request cache miss count', - }) - ), - 'pri.request_cache.miss_count': z.optional( - z.string().register(z.globalRegistry, { - description: 'request cache miss count', - }) - ), - 'flush.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of flushes', - }) - ), - 'pri.flush.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of flushes', - }) - ), - 'flush.total_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in flush', - }) - ), - 'pri.flush.total_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in flush', - }) - ), - 'get.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of current get ops', - }) - ), - 'pri.get.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of current get ops', - }) - ), - 'get.time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in get', - }) - ), - 'pri.get.time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in get', - }) - ), - 'get.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of get ops', - }) - ), - 'pri.get.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of get ops', - }) - ), - 'get.exists_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in successful gets', - }) - ), - 'pri.get.exists_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in successful gets', - }) - ), - 'get.exists_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of successful gets', - }) - ), - 'pri.get.exists_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of successful gets', - }) - ), - 'get.missing_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in failed gets', - }) - ), - 'pri.get.missing_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in failed gets', - }) - ), - 'get.missing_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of failed gets', - }) - ), - 'pri.get.missing_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of failed gets', - }) - ), - 'indexing.delete_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of current deletions', - }) - ), - 'pri.indexing.delete_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of current deletions', - }) - ), - 'indexing.delete_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in deletions', - }) - ), - 'pri.indexing.delete_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in deletions', - }) - ), - 'indexing.delete_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of delete ops', - }) - ), - 'pri.indexing.delete_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of delete ops', - }) - ), - 'indexing.index_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of current indexing ops', - }) - ), - 'pri.indexing.index_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of current indexing ops', - }) - ), - 'indexing.index_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in indexing', - }) - ), - 'pri.indexing.index_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in indexing', - }) - ), - 'indexing.index_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of indexing ops', - }) - ), - 'pri.indexing.index_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of indexing ops', - }) - ), - 'indexing.index_failed': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of failed indexing ops', - }) - ), - 'pri.indexing.index_failed': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of failed indexing ops', - }) - ), - 'merges.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of current merges', - }) - ), - 'pri.merges.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of current merges', - }) - ), - 'merges.current_docs': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of current merging docs', - }) - ), - 'pri.merges.current_docs': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of current merging docs', - }) - ), - 'merges.current_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'size of current merges', - }) - ), - 'pri.merges.current_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'size of current merges', - }) - ), - 'merges.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of completed merge ops', - }) - ), - 'pri.merges.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of completed merge ops', - }) - ), - 'merges.total_docs': z.optional( - z.string().register(z.globalRegistry, { - description: 'docs merged', - }) - ), - 'pri.merges.total_docs': z.optional( - z.string().register(z.globalRegistry, { - description: 'docs merged', - }) - ), - 'merges.total_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'size merged', - }) - ), - 'pri.merges.total_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'size merged', - }) - ), - 'merges.total_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in merges', - }) - ), - 'pri.merges.total_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in merges', - }) - ), - 'refresh.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'total refreshes', - }) - ), - 'pri.refresh.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'total refreshes', - }) - ), - 'refresh.time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in refreshes', - }) - ), - 'pri.refresh.time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in refreshes', - }) - ), - 'refresh.external_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'total external refreshes', - }) - ), - 'pri.refresh.external_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'total external refreshes', - }) - ), - 'refresh.external_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in external refreshes', - }) - ), - 'pri.refresh.external_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in external refreshes', - }) - ), - 'refresh.listeners': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of pending refresh listeners', - }) - ), - 'pri.refresh.listeners': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of pending refresh listeners', - }) - ), - 'search.fetch_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'current fetch phase ops', - }) - ), - 'pri.search.fetch_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'current fetch phase ops', - }) - ), - 'search.fetch_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in fetch phase', - }) - ), - 'pri.search.fetch_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in fetch phase', - }) - ), - 'search.fetch_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'total fetch ops', - }) - ), - 'pri.search.fetch_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'total fetch ops', - }) - ), - 'search.open_contexts': z.optional( - z.string().register(z.globalRegistry, { - description: 'open search contexts', - }) - ), - 'pri.search.open_contexts': z.optional( - z.string().register(z.globalRegistry, { - description: 'open search contexts', - }) - ), - 'search.query_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'current query phase ops', - }) - ), - 'pri.search.query_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'current query phase ops', - }) - ), - 'search.query_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in query phase', - }) - ), - 'pri.search.query_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in query phase', - }) - ), - 'search.query_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'total query phase ops', - }) - ), - 'pri.search.query_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'total query phase ops', - }) - ), - 'search.scroll_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'open scroll contexts', - }) - ), - 'pri.search.scroll_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'open scroll contexts', - }) - ), - 'search.scroll_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time scroll contexts held open', - }) - ), - 'pri.search.scroll_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time scroll contexts held open', - }) - ), - 'search.scroll_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'completed scroll contexts', - }) - ), - 'pri.search.scroll_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'completed scroll contexts', - }) - ), - 'segments.count': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of segments', - }) - ), - 'pri.segments.count': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of segments', - }) - ), - 'segments.memory': z.optional( - z.string().register(z.globalRegistry, { - description: 'memory used by segments', - }) - ), - 'pri.segments.memory': z.optional( - z.string().register(z.globalRegistry, { - description: 'memory used by segments', - }) - ), - 'segments.index_writer_memory': z.optional( - z.string().register(z.globalRegistry, { - description: 'memory used by index writer', - }) - ), - 'pri.segments.index_writer_memory': z.optional( - z.string().register(z.globalRegistry, { - description: 'memory used by index writer', - }) - ), - 'segments.version_map_memory': z.optional( - z.string().register(z.globalRegistry, { - description: 'memory used by version map', - }) - ), - 'pri.segments.version_map_memory': z.optional( - z.string().register(z.globalRegistry, { - description: 'memory used by version map', - }) - ), - 'segments.fixed_bitset_memory': z.optional( - z.string().register(z.globalRegistry, { - description: - 'memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent fields', - }) - ), - 'pri.segments.fixed_bitset_memory': z.optional( - z.string().register(z.globalRegistry, { - description: - 'memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent fields', - }) - ), - 'warmer.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'current warmer ops', - }) - ), - 'pri.warmer.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'current warmer ops', - }) - ), - 'warmer.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'total warmer ops', - }) - ), - 'pri.warmer.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'total warmer ops', - }) - ), - 'warmer.total_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in warmers', - }) - ), - 'pri.warmer.total_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spent in warmers', - }) - ), - 'suggest.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of current suggest ops', - }) - ), - 'pri.suggest.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of current suggest ops', - }) - ), - 'suggest.time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spend in suggest', - }) - ), - 'pri.suggest.time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spend in suggest', - }) - ), - 'suggest.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of suggest ops', - }) - ), - 'pri.suggest.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of suggest ops', - }) - ), - 'memory.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'total used memory', - }) - ), - 'pri.memory.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'total user memory', - }) - ), - 'search.throttled': z.optional( - z.string().register(z.globalRegistry, { - description: 'indicates if the index is search throttled', - }) - ), - 'bulk.total_operations': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of bulk shard ops', - }) - ), - 'pri.bulk.total_operations': z.optional( - z.string().register(z.globalRegistry, { - description: 'number of bulk shard ops', - }) - ), - 'bulk.total_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spend in shard bulk', - }) - ), - 'pri.bulk.total_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'time spend in shard bulk', - }) - ), - 'bulk.total_size_in_bytes': z.optional( - z.string().register(z.globalRegistry, { - description: 'total size in bytes of shard bulk', - }) - ), - 'pri.bulk.total_size_in_bytes': z.optional( - z.string().register(z.globalRegistry, { - description: 'total size in bytes of shard bulk', - }) - ), - 'bulk.avg_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'average time spend in shard bulk', - }) - ), - 'pri.bulk.avg_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'average time spend in shard bulk', - }) - ), - 'bulk.avg_size_in_bytes': z.optional( - z.string().register(z.globalRegistry, { - description: 'average size in bytes of shard bulk', - }) - ), - 'pri.bulk.avg_size_in_bytes': z.optional( - z.string().register(z.globalRegistry, { - description: 'average size in bytes of shard bulk', - }) - ), -}); - -export const cat_types_cat_master_column = z.union([ - z.enum(['id', 'host', 'h', 'ip', 'node', 'n']), - z.string(), -]); - -export const cat_types_cat_master_columns = z.union([ - cat_types_cat_master_column, - z.array(cat_types_cat_master_column), -]); - -export const cat_master_master_record = z.object({ - id: z.optional( - z.string().register(z.globalRegistry, { - description: 'node id', - }) - ), - host: z.optional( - z.string().register(z.globalRegistry, { - description: 'host name', - }) - ), - ip: z.optional( - z.string().register(z.globalRegistry, { - description: 'ip address', - }) - ), - node: z.optional( - z.string().register(z.globalRegistry, { - description: 'node name', - }) - ), -}); - -export const cat_types_cat_dfa_column = z.enum([ - 'assignment_explanation', - 'ae', - 'create_time', - 'ct', - 'createTime', - 'description', - 'd', - 'dest_index', - 'di', - 'destIndex', - 'failure_reason', - 'fr', - 'failureReason', - 'id', - 'model_memory_limit', - 'mml', - 'modelMemoryLimit', - 'node.address', - 'na', - 'nodeAddress', - 'node.ephemeral_id', - 'ne', - 'nodeEphemeralId', - 'node.id', - 'ni', - 'nodeId', - 'node.name', - 'nn', - 'nodeName', - 'progress', - 'p', - 'source_index', - 'si', - 'sourceIndex', - 'state', - 's', - 'type', - 't', - 'version', - 'v', -]); - -export const cat_types_cat_dfa_columns = z.union([ - cat_types_cat_dfa_column, - z.array(cat_types_cat_dfa_column), -]); - -export const types_version_string = z.string(); - -export const cat_ml_data_frame_analytics_data_frame_analytics_record = z.object({ - id: z.optional(types_id), - type: z.optional( - z.string().register(z.globalRegistry, { - description: 'The type of analysis that the job performs.', - }) - ), - create_time: z.optional( - z.string().register(z.globalRegistry, { - description: 'The time when the job was created.', - }) - ), - version: z.optional(types_version_string), - source_index: z.optional(types_index_name), - dest_index: z.optional(types_index_name), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the job.', - }) - ), - model_memory_limit: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The approximate maximum amount of memory resources that are permitted for the job.', - }) - ), - state: z.optional( - z.string().register(z.globalRegistry, { - description: 'The current status of the job.', - }) - ), - failure_reason: z.optional( - z.string().register(z.globalRegistry, { - description: 'Messages about the reason why the job failed.', - }) - ), - progress: z.optional( - z.string().register(z.globalRegistry, { - description: 'The progress report for the job by phase.', - }) - ), - assignment_explanation: z.optional( - z.string().register(z.globalRegistry, { - description: 'Messages related to the selection of a node.', - }) - ), - 'node.id': z.optional(types_id), - 'node.name': z.optional(types_name), - 'node.ephemeral_id': z.optional(types_id), - 'node.address': z.optional( - z.string().register(z.globalRegistry, { - description: 'The network address of the assigned node.', - }) - ), -}); - -export const cat_types_cat_datafeed_column = z.enum([ - 'ae', - 'assignment_explanation', - 'bc', - 'buckets.count', - 'bucketsCount', - 'id', - 'na', - 'node.address', - 'nodeAddress', - 'ne', - 'node.ephemeral_id', - 'nodeEphemeralId', - 'ni', - 'node.id', - 'nodeId', - 'nn', - 'node.name', - 'nodeName', - 'sba', - 'search.bucket_avg', - 'searchBucketAvg', - 'sc', - 'search.count', - 'searchCount', - 'seah', - 'search.exp_avg_hour', - 'searchExpAvgHour', - 'st', - 'search.time', - 'searchTime', - 's', - 'state', -]); - -export const cat_types_cat_datafeed_columns = z.union([ - cat_types_cat_datafeed_column, - z.array(cat_types_cat_datafeed_column), -]); - -export const ml_types_datafeed_state = z.enum(['started', 'stopped', 'starting', 'stopping']); - -export const cat_ml_datafeeds_datafeeds_record = z.object({ - id: z.optional( - z.string().register(z.globalRegistry, { - description: 'The datafeed identifier.', - }) - ), - state: z.optional(ml_types_datafeed_state), - assignment_explanation: z.optional( - z.string().register(z.globalRegistry, { - description: - 'For started datafeeds only, contains messages relating to the selection of a node.', - }) - ), - 'buckets.count': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of buckets processed.', - }) - ), - 'search.count': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of searches run by the datafeed.', - }) - ), - 'search.time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total time the datafeed spent searching, in milliseconds.', - }) - ), - 'search.bucket_avg': z.optional( - z.string().register(z.globalRegistry, { - description: 'The average search time per bucket, in milliseconds.', - }) - ), - 'search.exp_avg_hour': z.optional( - z.string().register(z.globalRegistry, { - description: 'The exponential average search time per hour, in milliseconds.', - }) - ), - 'node.id': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The unique identifier of the assigned node.\nFor started datafeeds only, this information pertains to the node upon which the datafeed is started.', - }) - ), - 'node.name': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The name of the assigned node.\nFor started datafeeds only, this information pertains to the node upon which the datafeed is started.', - }) - ), - 'node.ephemeral_id': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The ephemeral identifier of the assigned node.\nFor started datafeeds only, this information pertains to the node upon which the datafeed is started.', - }) - ), - 'node.address': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The network address of the assigned node.\nFor started datafeeds only, this information pertains to the node upon which the datafeed is started.', - }) - ), -}); - -export const cat_types_cat_anomaly_detector_column = z.enum([ - 'assignment_explanation', - 'ae', - 'buckets.count', - 'bc', - 'bucketsCount', - 'buckets.time.exp_avg', - 'btea', - 'bucketsTimeExpAvg', - 'buckets.time.exp_avg_hour', - 'bteah', - 'bucketsTimeExpAvgHour', - 'buckets.time.max', - 'btmax', - 'bucketsTimeMax', - 'buckets.time.min', - 'btmin', - 'bucketsTimeMin', - 'buckets.time.total', - 'btt', - 'bucketsTimeTotal', - 'data.buckets', - 'db', - 'dataBuckets', - 'data.earliest_record', - 'der', - 'dataEarliestRecord', - 'data.empty_buckets', - 'deb', - 'dataEmptyBuckets', - 'data.input_bytes', - 'dib', - 'dataInputBytes', - 'data.input_fields', - 'dif', - 'dataInputFields', - 'data.input_records', - 'dir', - 'dataInputRecords', - 'data.invalid_dates', - 'did', - 'dataInvalidDates', - 'data.last', - 'dl', - 'dataLast', - 'data.last_empty_bucket', - 'dleb', - 'dataLastEmptyBucket', - 'data.last_sparse_bucket', - 'dlsb', - 'dataLastSparseBucket', - 'data.latest_record', - 'dlr', - 'dataLatestRecord', - 'data.missing_fields', - 'dmf', - 'dataMissingFields', - 'data.out_of_order_timestamps', - 'doot', - 'dataOutOfOrderTimestamps', - 'data.processed_fields', - 'dpf', - 'dataProcessedFields', - 'data.processed_records', - 'dpr', - 'dataProcessedRecords', - 'data.sparse_buckets', - 'dsb', - 'dataSparseBuckets', - 'forecasts.memory.avg', - 'fmavg', - 'forecastsMemoryAvg', - 'forecasts.memory.max', - 'fmmax', - 'forecastsMemoryMax', - 'forecasts.memory.min', - 'fmmin', - 'forecastsMemoryMin', - 'forecasts.memory.total', - 'fmt', - 'forecastsMemoryTotal', - 'forecasts.records.avg', - 'fravg', - 'forecastsRecordsAvg', - 'forecasts.records.max', - 'frmax', - 'forecastsRecordsMax', - 'forecasts.records.min', - 'frmin', - 'forecastsRecordsMin', - 'forecasts.records.total', - 'frt', - 'forecastsRecordsTotal', - 'forecasts.time.avg', - 'ftavg', - 'forecastsTimeAvg', - 'forecasts.time.max', - 'ftmax', - 'forecastsTimeMax', - 'forecasts.time.min', - 'ftmin', - 'forecastsTimeMin', - 'forecasts.time.total', - 'ftt', - 'forecastsTimeTotal', - 'forecasts.total', - 'ft', - 'forecastsTotal', - 'id', - 'model.bucket_allocation_failures', - 'mbaf', - 'modelBucketAllocationFailures', - 'model.by_fields', - 'mbf', - 'modelByFields', - 'model.bytes', - 'mb', - 'modelBytes', - 'model.bytes_exceeded', - 'mbe', - 'modelBytesExceeded', - 'model.categorization_status', - 'mcs', - 'modelCategorizationStatus', - 'model.categorized_doc_count', - 'mcdc', - 'modelCategorizedDocCount', - 'model.dead_category_count', - 'mdcc', - 'modelDeadCategoryCount', - 'model.failed_category_count', - 'mdcc', - 'modelFailedCategoryCount', - 'model.frequent_category_count', - 'mfcc', - 'modelFrequentCategoryCount', - 'model.log_time', - 'mlt', - 'modelLogTime', - 'model.memory_limit', - 'mml', - 'modelMemoryLimit', - 'model.memory_status', - 'mms', - 'modelMemoryStatus', - 'model.over_fields', - 'mof', - 'modelOverFields', - 'model.partition_fields', - 'mpf', - 'modelPartitionFields', - 'model.rare_category_count', - 'mrcc', - 'modelRareCategoryCount', - 'model.timestamp', - 'mt', - 'modelTimestamp', - 'model.total_category_count', - 'mtcc', - 'modelTotalCategoryCount', - 'node.address', - 'na', - 'nodeAddress', - 'node.ephemeral_id', - 'ne', - 'nodeEphemeralId', - 'node.id', - 'ni', - 'nodeId', - 'node.name', - 'nn', - 'nodeName', - 'opened_time', - 'ot', - 'state', - 's', -]); - -export const cat_types_cat_anomaly_detector_columns = z.union([ - cat_types_cat_anomaly_detector_column, - z.array(cat_types_cat_anomaly_detector_column), -]); - -export const ml_types_job_state = z.enum(['closing', 'closed', 'opened', 'failed', 'opening']); - -export const ml_types_memory_status = z.enum(['ok', 'soft_limit', 'hard_limit']); - -export const ml_types_categorization_status = z.enum(['ok', 'warn']); - -export const cat_ml_jobs_jobs_record = z.object({ - id: z.optional(types_id), - state: z.optional(ml_types_job_state), - opened_time: z.optional( - z.string().register(z.globalRegistry, { - description: 'For open jobs only, the amount of time the job has been opened.', - }) - ), - assignment_explanation: z.optional( - z.string().register(z.globalRegistry, { - description: - 'For open anomaly detection jobs only, contains messages relating to the selection of a node to run the job.', - }) - ), - 'data.processed_records': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of input documents that have been processed by the anomaly detection job.\nThis value includes documents with missing fields, since they are nonetheless analyzed.\nIf you use datafeeds and have aggregations in your search query, the `processed_record_count` is the number of aggregation results processed, not the number of Elasticsearch documents.', - }) - ), - 'data.processed_fields': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The total number of fields in all the documents that have been processed by the anomaly detection job.\nOnly fields that are specified in the detector configuration object contribute to this count.\nThe timestamp is not included in this count.', - }) - ), - 'data.input_bytes': z.optional(types_byte_size), - 'data.input_records': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of input documents posted to the anomaly detection job.', - }) - ), - 'data.input_fields': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The total number of fields in input documents posted to the anomaly detection job.\nThis count includes fields that are not used in the analysis.\nHowever, be aware that if you are using a datafeed, it extracts only the required fields from the documents it retrieves before posting them to the job.', - }) - ), - 'data.invalid_dates': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of input documents with either a missing date field or a date that could not be parsed.', - }) - ), - 'data.missing_fields': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of input documents that are missing a field that the anomaly detection job is configured to analyze.\nInput documents with missing fields are still processed because it is possible that not all fields are missing.\nIf you are using datafeeds or posting data to the job in JSON format, a high `missing_field_count` is often not an indication of data issues.\nIt is not necessarily a cause for concern.', - }) - ), - 'data.out_of_order_timestamps': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of input documents that have a timestamp chronologically preceding the start of the current anomaly detection bucket offset by the latency window.\nThis information is applicable only when you provide data to the anomaly detection job by using the post data API.\nThese out of order documents are discarded, since jobs require time series data to be in ascending chronological order.', - }) - ), - 'data.empty_buckets': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of buckets which did not contain any data.\nIf your data contains many empty buckets, consider increasing your `bucket_span` or using functions that are tolerant to gaps in data such as mean, `non_null_sum` or `non_zero_count`.', - }) - ), - 'data.sparse_buckets': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of buckets that contained few data points compared to the expected number of data points.\nIf your data contains many sparse buckets, consider using a longer `bucket_span`.', - }) - ), - 'data.buckets': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total number of buckets processed.', - }) - ), - 'data.earliest_record': z.optional( - z.string().register(z.globalRegistry, { - description: 'The timestamp of the earliest chronologically input document.', - }) - ), - 'data.latest_record': z.optional( - z.string().register(z.globalRegistry, { - description: 'The timestamp of the latest chronologically input document.', - }) - ), - 'data.last': z.optional( - z.string().register(z.globalRegistry, { - description: 'The timestamp at which data was last analyzed, according to server time.', - }) - ), - 'data.last_empty_bucket': z.optional( - z.string().register(z.globalRegistry, { - description: 'The timestamp of the last bucket that did not contain any data.', - }) - ), - 'data.last_sparse_bucket': z.optional( - z.string().register(z.globalRegistry, { - description: 'The timestamp of the last bucket that was considered sparse.', - }) - ), - 'model.bytes': z.optional(types_byte_size), - 'model.memory_status': z.optional(ml_types_memory_status), - 'model.bytes_exceeded': z.optional(types_byte_size), - 'model.memory_limit': z.optional( - z.string().register(z.globalRegistry, { - description: 'The upper limit for model memory usage, checked on increasing values.', - }) - ), - 'model.by_fields': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of `by` field values that were analyzed by the models.\nThis value is cumulative for all detectors in the job.', - }) - ), - 'model.over_fields': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of `over` field values that were analyzed by the models.\nThis value is cumulative for all detectors in the job.', - }) - ), - 'model.partition_fields': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of `partition` field values that were analyzed by the models.\nThis value is cumulative for all detectors in the job.', - }) - ), - 'model.bucket_allocation_failures': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of buckets for which new entities in incoming data were not processed due to insufficient model memory.\nThis situation is also signified by a `hard_limit: memory_status` property value.', - }) - ), - 'model.categorization_status': z.optional(ml_types_categorization_status), - 'model.categorized_doc_count': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of documents that have had a field categorized.', - }) - ), - 'model.total_category_count': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of categories created by categorization.', - }) - ), - 'model.frequent_category_count': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of categories that match more than 1% of categorized documents.', - }) - ), - 'model.rare_category_count': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of categories that match just one categorized document.', - }) - ), - 'model.dead_category_count': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of categories created by categorization that will never be assigned again because another category’s definition makes it a superset of the dead category.\nDead categories are a side effect of the way categorization has no prior training.', - }) - ), - 'model.failed_category_count': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of times that categorization wanted to create a new category but couldn’t because the job had hit its `model_memory_limit`.\nThis count does not track which specific categories failed to be created.\nTherefore you cannot use this value to determine the number of unique categories that were missed.', - }) - ), - 'model.log_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The timestamp when the model stats were gathered, according to server time.', - }) - ), - 'model.timestamp': z.optional( - z.string().register(z.globalRegistry, { - description: 'The timestamp of the last record when the model stats were gathered.', - }) - ), - 'forecasts.total': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of individual forecasts currently available for the job.\nA value of one or more indicates that forecasts exist.', - }) - ), - 'forecasts.memory.min': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The minimum memory usage in bytes for forecasts related to the anomaly detection job.', - }) - ), - 'forecasts.memory.max': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The maximum memory usage in bytes for forecasts related to the anomaly detection job.', - }) - ), - 'forecasts.memory.avg': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The average memory usage in bytes for forecasts related to the anomaly detection job.', - }) - ), - 'forecasts.memory.total': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The total memory usage in bytes for forecasts related to the anomaly detection job.', - }) - ), - 'forecasts.records.min': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The minimum number of `model_forecast` documents written for forecasts related to the anomaly detection job.', - }) - ), - 'forecasts.records.max': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The maximum number of `model_forecast` documents written for forecasts related to the anomaly detection job.', - }) - ), - 'forecasts.records.avg': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The average number of `model_forecast` documents written for forecasts related to the anomaly detection job.', - }) - ), - 'forecasts.records.total': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The total number of `model_forecast` documents written for forecasts related to the anomaly detection job.', - }) - ), - 'forecasts.time.min': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The minimum runtime in milliseconds for forecasts related to the anomaly detection job.', - }) - ), - 'forecasts.time.max': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The maximum runtime in milliseconds for forecasts related to the anomaly detection job.', - }) - ), - 'forecasts.time.avg': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The average runtime in milliseconds for forecasts related to the anomaly detection job.', - }) - ), - 'forecasts.time.total': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The total runtime in milliseconds for forecasts related to the anomaly detection job.', - }) - ), - 'node.id': z.optional(types_node_id), - 'node.name': z.optional( - z.string().register(z.globalRegistry, { - description: 'The name of the assigned node.', - }) - ), - 'node.ephemeral_id': z.optional(types_node_id), - 'node.address': z.optional( - z.string().register(z.globalRegistry, { - description: 'The network address of the assigned node.', - }) - ), - 'buckets.count': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of bucket results produced by the job.', - }) - ), - 'buckets.time.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The sum of all bucket processing times, in milliseconds.', - }) - ), - 'buckets.time.min': z.optional( - z.string().register(z.globalRegistry, { - description: 'The minimum of all bucket processing times, in milliseconds.', - }) - ), - 'buckets.time.max': z.optional( - z.string().register(z.globalRegistry, { - description: 'The maximum of all bucket processing times, in milliseconds.', - }) - ), - 'buckets.time.exp_avg': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The exponential moving average of all bucket processing times, in milliseconds.', - }) - ), - 'buckets.time.exp_avg_hour': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The exponential moving average of bucket processing times calculated in a one hour time window, in milliseconds.', - }) - ), -}); - -export const cat_types_cat_trained_models_column = z.enum([ - 'create_time', - 'ct', - 'created_by', - 'c', - 'createdBy', - 'data_frame_analytics_id', - 'df', - 'dataFrameAnalytics', - 'dfid', - 'description', - 'd', - 'heap_size', - 'hs', - 'modelHeapSize', - 'id', - 'ingest.count', - 'ic', - 'ingestCount', - 'ingest.current', - 'icurr', - 'ingestCurrent', - 'ingest.failed', - 'if', - 'ingestFailed', - 'ingest.pipelines', - 'ip', - 'ingestPipelines', - 'ingest.time', - 'it', - 'ingestTime', - 'license', - 'l', - 'operations', - 'o', - 'modelOperations', - 'version', - 'v', -]); - -export const cat_types_cat_trained_models_columns = z.union([ - cat_types_cat_trained_models_column, - z.array(cat_types_cat_trained_models_column), -]); - -export const cat_ml_trained_models_trained_models_record = z.object({ - id: z.optional(types_id), - created_by: z.optional( - z.string().register(z.globalRegistry, { - description: 'Information about the creator of the model.', - }) - ), - heap_size: z.optional(types_byte_size), - operations: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The estimated number of operations to use the model.\nThis number helps to measure the computational complexity of the model.', - }) - ), - license: z.optional( - z.string().register(z.globalRegistry, { - description: 'The license level of the model.', - }) - ), - create_time: z.optional(types_date_time), - version: z.optional(types_version_string), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the model.', - }) - ), - 'ingest.pipelines': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of pipelines that are referencing the model.', - }) - ), - 'ingest.count': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total number of documents that are processed by the model.', - }) - ), - 'ingest.time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total time spent processing documents with thie model.', - }) - ), - 'ingest.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total number of documents that are currently being handled by the model.', - }) - ), - 'ingest.failed': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total number of failed ingest attempts with the model.', - }) - ), - 'data_frame.id': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The identifier for the data frame analytics job that created the model.\nOnly displayed if the job is still available.', - }) - ), - 'data_frame.create_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time the data frame analytics job was created.', - }) - ), - 'data_frame.source_index': z.optional( - z.string().register(z.globalRegistry, { - description: 'The source index used to train in the data frame analysis.', - }) - ), - 'data_frame.analysis': z.optional( - z.string().register(z.globalRegistry, { - description: 'The analysis used by the data frame to build the model.', - }) - ), - type: z.optional(z.string()), -}); - -export const cat_types_cat_nodeattrs_column = z.union([ - z.enum([ - 'node', - 'id', - 'id', - 'nodeId', - 'pid', - 'p', - 'host', - 'h', - 'ip', - 'i', - 'port', - 'po', - 'attr', - 'attr.name', - 'value', - 'attr.value', - ]), - z.string(), -]); - -export const cat_types_cat_nodeattrs_columns = z.union([ - cat_types_cat_nodeattrs_column, - z.array(cat_types_cat_nodeattrs_column), -]); - -export const cat_nodeattrs_node_attributes_record = z.object({ - node: z.optional( - z.string().register(z.globalRegistry, { - description: 'The node name.', - }) - ), - id: z.optional( - z.string().register(z.globalRegistry, { - description: 'The unique node identifier.', - }) - ), - pid: z.optional( - z.string().register(z.globalRegistry, { - description: 'The process identifier.', - }) - ), - host: z.optional( - z.string().register(z.globalRegistry, { - description: 'The host name.', - }) - ), - ip: z.optional( - z.string().register(z.globalRegistry, { - description: 'The IP address.', - }) - ), - port: z.optional( - z.string().register(z.globalRegistry, { - description: 'The bound transport port.', - }) - ), - attr: z.optional( - z.string().register(z.globalRegistry, { - description: 'The attribute name.', - }) - ), - value: z.optional( - z.string().register(z.globalRegistry, { - description: 'The attribute value.', - }) - ), -}); - -export const cat_types_cat_node_column = z.union([ - z.enum([ - 'build', - 'b', - 'completion.size', - 'cs', - 'completionSize', - 'cpu', - 'disk.avail', - 'd', - 'disk', - 'diskAvail', - 'disk.total', - 'dt', - 'diskTotal', - 'disk.used', - 'du', - 'diskUsed', - 'disk.used_percent', - 'dup', - 'diskUsedPercent', - 'fielddata.evictions', - 'fe', - 'fielddataEvictions', - 'fielddata.memory_size', - 'fm', - 'fielddataMemory', - 'file_desc.current', - 'fdc', - 'fileDescriptorCurrent', - 'file_desc.max', - 'fdm', - 'fileDescriptorMax', - 'file_desc.percent', - 'fdp', - 'fileDescriptorPercent', - 'flush.total', - 'ft', - 'flushTotal', - 'flush.total_time', - 'ftt', - 'flushTotalTime', - 'get.current', - 'gc', - 'getCurrent', - 'get.exists_time', - 'geti', - 'getExistsTime', - 'get.exists_total', - 'geto', - 'getExistsTotal', - 'get.missing_time', - 'gmti', - 'getMissingTime', - 'get.missing_total', - 'gmto', - 'getMissingTotal', - 'get.time', - 'gti', - 'getTime', - 'get.total', - 'gto', - 'getTotal', - 'heap.current', - 'hc', - 'heapCurrent', - 'heap.max', - 'hm', - 'heapMax', - 'heap.percent', - 'hp', - 'heapPercent', - 'http_address', - 'http', - 'id', - 'nodeId', - 'indexing.delete_current', - 'idc', - 'indexingDeleteCurrent', - 'indexing.delete_time', - 'idti', - 'indexingDeleteTime', - 'indexing.delete_total', - 'idto', - 'indexingDeleteTotal', - 'indexing.index_current', - 'iic', - 'indexingIndexCurrent', - 'indexing.index_failed', - 'iif', - 'indexingIndexFailed', - 'indexing.index_failed_due_to_version_conflict', - 'iifvc', - 'indexingIndexFailedDueToVersionConflict', - 'indexing.index_time', - 'iiti', - 'indexingIndexTime', - 'indexing.index_total', - 'iito', - 'indexingIndexTotal', - 'ip', - 'i', - 'jdk', - 'j', - 'load_1m', - 'l', - 'load_5m', - 'l', - 'load_15m', - 'l', - 'available_processors', - 'ap', - 'mappings.total_count', - 'mtc', - 'mappingsTotalCount', - 'mappings.total_estimated_overhead_in_bytes', - 'mteo', - 'mappingsTotalEstimatedOverheadInBytes', - 'master', - 'm', - 'merges.current', - 'mc', - 'mergesCurrent', - 'merges.current_docs', - 'mcd', - 'mergesCurrentDocs', - 'merges.current_size', - 'mcs', - 'mergesCurrentSize', - 'merges.total', - 'mt', - 'mergesTotal', - 'merges.total_docs', - 'mtd', - 'mergesTotalDocs', - 'merges.total_size', - 'mts', - 'mergesTotalSize', - 'merges.total_time', - 'mtt', - 'mergesTotalTime', - 'name', - 'n', - 'node.role', - 'r', - 'role', - 'nodeRole', - 'pid', - 'p', - 'port', - 'po', - 'query_cache.memory_size', - 'qcm', - 'queryCacheMemory', - 'query_cache.evictions', - 'qce', - 'queryCacheEvictions', - 'query_cache.hit_count', - 'qchc', - 'queryCacheHitCount', - 'query_cache.miss_count', - 'qcmc', - 'queryCacheMissCount', - 'ram.current', - 'rc', - 'ramCurrent', - 'ram.max', - 'rm', - 'ramMax', - 'ram.percent', - 'rp', - 'ramPercent', - 'refresh.total', - 'rto', - 'refreshTotal', - 'refresh.time', - 'rti', - 'refreshTime', - 'request_cache.memory_size', - 'rcm', - 'requestCacheMemory', - 'request_cache.evictions', - 'rce', - 'requestCacheEvictions', - 'request_cache.hit_count', - 'rchc', - 'requestCacheHitCount', - 'request_cache.miss_count', - 'rcmc', - 'requestCacheMissCount', - 'script.compilations', - 'scrcc', - 'scriptCompilations', - 'script.cache_evictions', - 'scrce', - 'scriptCacheEvictions', - 'search.fetch_current', - 'sfc', - 'searchFetchCurrent', - 'search.fetch_time', - 'sfti', - 'searchFetchTime', - 'search.fetch_total', - 'sfto', - 'searchFetchTotal', - 'search.open_contexts', - 'so', - 'searchOpenContexts', - 'search.query_current', - 'sqc', - 'searchQueryCurrent', - 'search.query_time', - 'sqti', - 'searchQueryTime', - 'search.query_total', - 'sqto', - 'searchQueryTotal', - 'search.scroll_current', - 'scc', - 'searchScrollCurrent', - 'search.scroll_time', - 'scti', - 'searchScrollTime', - 'search.scroll_total', - 'scto', - 'searchScrollTotal', - 'segments.count', - 'sc', - 'segmentsCount', - 'segments.fixed_bitset_memory', - 'sfbm', - 'fixedBitsetMemory', - 'segments.index_writer_memory', - 'siwm', - 'segmentsIndexWriterMemory', - 'segments.memory', - 'sm', - 'segmentsMemory', - 'segments.version_map_memory', - 'svmm', - 'segmentsVersionMapMemory', - 'shard_stats.total_count', - 'sstc', - 'shards', - 'shardStatsTotalCount', - 'suggest.current', - 'suc', - 'suggestCurrent', - 'suggest.time', - 'suti', - 'suggestTime', - 'suggest.total', - 'suto', - 'suggestTotal', - 'uptime', - 'u', - 'version', - 'v', - ]), - z.string(), -]); - -export const cat_types_cat_node_columns = z.union([ - cat_types_cat_node_column, - z.array(cat_types_cat_node_column), -]); - -export const cat_nodes_nodes_record = z.object({ - id: z.optional(types_id), - pid: z.optional( - z.string().register(z.globalRegistry, { - description: 'The process identifier.', - }) - ), - ip: z.optional( - z.string().register(z.globalRegistry, { - description: 'The IP address.', - }) - ), - port: z.optional( - z.string().register(z.globalRegistry, { - description: 'The bound transport port.', - }) - ), - http_address: z.optional( - z.string().register(z.globalRegistry, { - description: 'The bound HTTP address.', - }) - ), - version: z.optional(types_version_string), - flavor: z.optional( - z.string().register(z.globalRegistry, { - description: 'The Elasticsearch distribution flavor.', - }) - ), - type: z.optional( - z.string().register(z.globalRegistry, { - description: 'The Elasticsearch distribution type.', - }) - ), - build: z.optional( - z.string().register(z.globalRegistry, { - description: 'The Elasticsearch build hash.', - }) - ), - jdk: z.optional( - z.string().register(z.globalRegistry, { - description: 'The Java version.', - }) - ), - 'disk.total': z.optional(types_byte_size), - 'disk.used': z.optional(types_byte_size), - 'disk.avail': z.optional(types_byte_size), - 'disk.used_percent': z.optional(types_percentage), - 'heap.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The used heap.', - }) - ), - 'heap.percent': z.optional(types_percentage), - 'heap.max': z.optional( - z.string().register(z.globalRegistry, { - description: 'The maximum configured heap.', - }) - ), - 'ram.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The used machine memory.', - }) - ), - 'ram.percent': z.optional(types_percentage), - 'ram.max': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total machine memory.', - }) - ), - 'file_desc.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The used file descriptors.', - }) - ), - 'file_desc.percent': z.optional(types_percentage), - 'file_desc.max': z.optional( - z.string().register(z.globalRegistry, { - description: 'The maximum number of file descriptors.', - }) - ), - cpu: z.optional( - z.string().register(z.globalRegistry, { - description: 'The recent system CPU usage as a percentage.', - }) - ), - load_1m: z.optional( - z.string().register(z.globalRegistry, { - description: 'The load average for the most recent minute.', - }) - ), - load_5m: z.optional( - z.string().register(z.globalRegistry, { - description: 'The load average for the last five minutes.', - }) - ), - load_15m: z.optional( - z.string().register(z.globalRegistry, { - description: 'The load average for the last fifteen minutes.', - }) - ), - available_processors: z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of available processors (logical CPU cores available to the JVM).', - }) - ), - uptime: z.optional( - z.string().register(z.globalRegistry, { - description: 'The node uptime.', - }) - ), - 'node.role': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The roles of the node.\nReturned values include `c`(cold node), `d`(data node), `f`(frozen node), `h`(hot node), `i`(ingest node), `l`(machine learning node), `m` (master eligible node), `r`(remote cluster client node), `s`(content node), `t`(transform node), `v`(voting-only node), `w`(warm node),and `-`(coordinating node only).', - }) - ), - master: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Indicates whether the node is the elected master node.\nReturned values include `*`(elected master) and `-`(not elected master).', - }) - ), - name: z.optional(types_name), - 'completion.size': z.optional( - z.string().register(z.globalRegistry, { - description: 'The size of completion.', - }) - ), - 'fielddata.memory_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'The used fielddata cache.', - }) - ), - 'fielddata.evictions': z.optional( - z.string().register(z.globalRegistry, { - description: 'The fielddata evictions.', - }) - ), - 'query_cache.memory_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'The used query cache.', - }) - ), - 'query_cache.evictions': z.optional( - z.string().register(z.globalRegistry, { - description: 'The query cache evictions.', - }) - ), - 'query_cache.hit_count': z.optional( - z.string().register(z.globalRegistry, { - description: 'The query cache hit counts.', - }) - ), - 'query_cache.miss_count': z.optional( - z.string().register(z.globalRegistry, { - description: 'The query cache miss counts.', - }) - ), - 'request_cache.memory_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'The used request cache.', - }) - ), - 'request_cache.evictions': z.optional( - z.string().register(z.globalRegistry, { - description: 'The request cache evictions.', - }) - ), - 'request_cache.hit_count': z.optional( - z.string().register(z.globalRegistry, { - description: 'The request cache hit counts.', - }) - ), - 'request_cache.miss_count': z.optional( - z.string().register(z.globalRegistry, { - description: 'The request cache miss counts.', - }) - ), - 'flush.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of flushes.', - }) - ), - 'flush.total_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in flush.', - }) - ), - 'get.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of current get ops.', - }) - ), - 'get.time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in get.', - }) - ), - 'get.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of get ops.', - }) - ), - 'get.exists_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in successful gets.', - }) - ), - 'get.exists_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of successful get operations.', - }) - ), - 'get.missing_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in failed gets.', - }) - ), - 'get.missing_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of failed gets.', - }) - ), - 'indexing.delete_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of current deletions.', - }) - ), - 'indexing.delete_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in deletions.', - }) - ), - 'indexing.delete_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of delete operations.', - }) - ), - 'indexing.index_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of current indexing operations.', - }) - ), - 'indexing.index_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in indexing.', - }) - ), - 'indexing.index_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of indexing operations.', - }) - ), - 'indexing.index_failed': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of failed indexing operations.', - }) - ), - 'merges.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of current merges.', - }) - ), - 'merges.current_docs': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of current merging docs.', - }) - ), - 'merges.current_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'The size of current merges.', - }) - ), - 'merges.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of completed merge operations.', - }) - ), - 'merges.total_docs': z.optional( - z.string().register(z.globalRegistry, { - description: 'The docs merged.', - }) - ), - 'merges.total_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'The size merged.', - }) - ), - 'merges.total_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in merges.', - }) - ), - 'refresh.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total refreshes.', - }) - ), - 'refresh.time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in refreshes.', - }) - ), - 'refresh.external_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total external refreshes.', - }) - ), - 'refresh.external_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in external refreshes.', - }) - ), - 'refresh.listeners': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of pending refresh listeners.', - }) - ), - 'script.compilations': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total script compilations.', - }) - ), - 'script.cache_evictions': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total compiled scripts evicted from the cache.', - }) - ), - 'script.compilation_limit_triggered': z.optional( - z.string().register(z.globalRegistry, { - description: 'The script cache compilation limit triggered.', - }) - ), - 'search.fetch_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The current fetch phase operations.', - }) - ), - 'search.fetch_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in fetch phase.', - }) - ), - 'search.fetch_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total fetch operations.', - }) - ), - 'search.open_contexts': z.optional( - z.string().register(z.globalRegistry, { - description: 'The open search contexts.', - }) - ), - 'search.query_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The current query phase operations.', - }) - ), - 'search.query_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in query phase.', - }) - ), - 'search.query_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total query phase operations.', - }) - ), - 'search.scroll_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The open scroll contexts.', - }) - ), - 'search.scroll_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time scroll contexts held open.', - }) - ), - 'search.scroll_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The completed scroll contexts.', - }) - ), - 'segments.count': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of segments.', - }) - ), - 'segments.memory': z.optional( - z.string().register(z.globalRegistry, { - description: 'The memory used by segments.', - }) - ), - 'segments.index_writer_memory': z.optional( - z.string().register(z.globalRegistry, { - description: 'The memory used by the index writer.', - }) - ), - 'segments.version_map_memory': z.optional( - z.string().register(z.globalRegistry, { - description: 'The memory used by the version map.', - }) - ), - 'segments.fixed_bitset_memory': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent fields.', - }) - ), - 'suggest.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of current suggest operations.', - }) - ), - 'suggest.time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spend in suggest.', - }) - ), - 'suggest.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of suggest operations.', - }) - ), - 'bulk.total_operations': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of bulk shard operations.', - }) - ), - 'bulk.total_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spend in shard bulk.', - }) - ), - 'bulk.total_size_in_bytes': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total size in bytes of shard bulk.', - }) - ), - 'bulk.avg_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The average time spend in shard bulk.', - }) - ), - 'bulk.avg_size_in_bytes': z.optional( - z.string().register(z.globalRegistry, { - description: 'The average size in bytes of shard bulk.', - }) - ), -}); - -export const cat_types_cat_pending_tasks_column = z.union([ - z.enum(['insertOrder', 'o', 'timeInQueue', 't', 'priority', 'p', 'source', 's']), - z.string(), -]); - -export const cat_types_cat_pending_tasks_columns = z.union([ - cat_types_cat_pending_tasks_column, - z.array(cat_types_cat_pending_tasks_column), -]); - -export const cat_pending_tasks_pending_tasks_record = z.object({ - insertOrder: z.optional( - z.string().register(z.globalRegistry, { - description: 'The task insertion order.', - }) - ), - timeInQueue: z.optional( - z.string().register(z.globalRegistry, { - description: 'Indicates how long the task has been in queue.', - }) - ), - priority: z.optional( - z.string().register(z.globalRegistry, { - description: 'The task priority.', - }) - ), - source: z.optional( - z.string().register(z.globalRegistry, { - description: 'The task source.', - }) - ), -}); - -export const cat_types_cat_plugins_column = z.union([ - z.enum(['id', 'name', 'n', 'component', 'c', 'version', 'v', 'description', 'd']), - z.string(), -]); - -export const cat_types_cat_plugins_columns = z.union([ - cat_types_cat_plugins_column, - z.array(cat_types_cat_plugins_column), -]); - -export const cat_plugins_plugins_record = z.object({ - id: z.optional(types_node_id), - name: z.optional(types_name), - component: z.optional( - z.string().register(z.globalRegistry, { - description: 'The component name.', - }) - ), - version: z.optional(types_version_string), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'The plugin details.', - }) - ), - type: z.optional( - z.string().register(z.globalRegistry, { - description: 'The plugin type.', - }) - ), -}); - -export const cat_types_cat_recovery_column = z.union([ - z.enum([ - 'index', - 'i', - 'idx', - 'shard', - 's', - 'sh', - 'start_time', - 'start', - 'start_time_millis', - 'start_millis', - 'stop_time', - 'stop', - 'stop_time_millis', - 'stop_millis', - 'time', - 't', - 'ti', - 'type', - 'ty', - 'stage', - 'st', - 'source_host', - 'shost', - 'source_node', - 'snode', - 'target_host', - 'thost', - 'target_node', - 'tnode', - 'repository', - 'rep', - 'snapshot', - 'snap', - 'files', - 'f', - 'files_recovered', - 'fr', - 'files_percent', - 'fp', - 'files_total', - 'tf', - 'bytes', - 'b', - 'bytes_recovered', - 'br', - 'bytes_percent', - 'bp', - 'bytes_total', - 'tb', - 'translog_ops', - 'to', - 'translog_ops_recovered', - 'tor', - 'translog_ops_percent', - 'top', - ]), - z.string(), -]); - -export const cat_types_cat_recovery_columns = z.union([ - cat_types_cat_recovery_column, - z.array(cat_types_cat_recovery_column), -]); - -export const cat_recovery_recovery_record = z.object({ - index: z.optional(types_index_name), - shard: z.optional( - z.string().register(z.globalRegistry, { - description: 'The shard name.', - }) - ), - start_time: z.optional(types_date_time), - start_time_millis: z.optional(types_epoch_time_unit_millis), - stop_time: z.optional(types_date_time), - stop_time_millis: z.optional(types_epoch_time_unit_millis), - time: z.optional(types_duration), - type: z.optional( - z.string().register(z.globalRegistry, { - description: 'The recovery type.', - }) - ), - stage: z.optional( - z.string().register(z.globalRegistry, { - description: 'The recovery stage.', - }) - ), - source_host: z.optional( - z.string().register(z.globalRegistry, { - description: 'The source host.', - }) - ), - source_node: z.optional( - z.string().register(z.globalRegistry, { - description: 'The source node name.', - }) - ), - target_host: z.optional( - z.string().register(z.globalRegistry, { - description: 'The target host.', - }) - ), - target_node: z.optional( - z.string().register(z.globalRegistry, { - description: 'The target node name.', - }) - ), - repository: z.optional( - z.string().register(z.globalRegistry, { - description: 'The repository name.', - }) - ), - snapshot: z.optional( - z.string().register(z.globalRegistry, { - description: 'The snapshot name.', - }) - ), - files: z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of files to recover.', - }) - ), - files_recovered: z.optional( - z.string().register(z.globalRegistry, { - description: 'The files recovered.', - }) - ), - files_percent: z.optional(types_percentage), - files_total: z.optional( - z.string().register(z.globalRegistry, { - description: 'The total number of files.', - }) - ), - bytes: z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of bytes to recover.', - }) - ), - bytes_recovered: z.optional( - z.string().register(z.globalRegistry, { - description: 'The bytes recovered.', - }) - ), - bytes_percent: z.optional(types_percentage), - bytes_total: z.optional( - z.string().register(z.globalRegistry, { - description: 'The total number of bytes.', - }) - ), - translog_ops: z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of translog operations to recover.', - }) - ), - translog_ops_recovered: z.optional( - z.string().register(z.globalRegistry, { - description: 'The translog operations recovered.', - }) - ), - translog_ops_percent: z.optional(types_percentage), + health: z.optional(z.string().register(z.globalRegistry, { + description: 'current health status' + })), + status: z.optional(z.string().register(z.globalRegistry, { + description: 'open/close status' + })), + index: z.optional(z.string().register(z.globalRegistry, { + description: 'index name' + })), + uuid: z.optional(z.string().register(z.globalRegistry, { + description: 'index uuid' + })), + pri: z.optional(z.string().register(z.globalRegistry, { + description: 'number of primary shards' + })), + rep: z.optional(z.string().register(z.globalRegistry, { + description: 'number of replica shards' + })), + 'docs.count': z.optional(z.union([ + z.string(), + z.null() + ])), + 'docs.deleted': z.optional(z.union([ + z.string(), + z.null() + ])), + 'creation.date': z.optional(z.string().register(z.globalRegistry, { + description: 'index creation date (millisecond value)' + })), + 'creation.date.string': z.optional(z.string().register(z.globalRegistry, { + description: 'index creation date (as string)' + })), + 'store.size': z.optional(z.union([ + z.string(), + z.null() + ])), + 'pri.store.size': z.optional(z.union([ + z.string(), + z.null() + ])), + 'dataset.size': z.optional(z.union([ + z.string(), + z.null() + ])), + 'completion.size': z.optional(z.string().register(z.globalRegistry, { + description: 'size of completion' + })), + 'pri.completion.size': z.optional(z.string().register(z.globalRegistry, { + description: 'size of completion' + })), + 'fielddata.memory_size': z.optional(z.string().register(z.globalRegistry, { + description: 'used fielddata cache' + })), + 'pri.fielddata.memory_size': z.optional(z.string().register(z.globalRegistry, { + description: 'used fielddata cache' + })), + 'fielddata.evictions': z.optional(z.string().register(z.globalRegistry, { + description: 'fielddata evictions' + })), + 'pri.fielddata.evictions': z.optional(z.string().register(z.globalRegistry, { + description: 'fielddata evictions' + })), + 'query_cache.memory_size': z.optional(z.string().register(z.globalRegistry, { + description: 'used query cache' + })), + 'pri.query_cache.memory_size': z.optional(z.string().register(z.globalRegistry, { + description: 'used query cache' + })), + 'query_cache.evictions': z.optional(z.string().register(z.globalRegistry, { + description: 'query cache evictions' + })), + 'pri.query_cache.evictions': z.optional(z.string().register(z.globalRegistry, { + description: 'query cache evictions' + })), + 'request_cache.memory_size': z.optional(z.string().register(z.globalRegistry, { + description: 'used request cache' + })), + 'pri.request_cache.memory_size': z.optional(z.string().register(z.globalRegistry, { + description: 'used request cache' + })), + 'request_cache.evictions': z.optional(z.string().register(z.globalRegistry, { + description: 'request cache evictions' + })), + 'pri.request_cache.evictions': z.optional(z.string().register(z.globalRegistry, { + description: 'request cache evictions' + })), + 'request_cache.hit_count': z.optional(z.string().register(z.globalRegistry, { + description: 'request cache hit count' + })), + 'pri.request_cache.hit_count': z.optional(z.string().register(z.globalRegistry, { + description: 'request cache hit count' + })), + 'request_cache.miss_count': z.optional(z.string().register(z.globalRegistry, { + description: 'request cache miss count' + })), + 'pri.request_cache.miss_count': z.optional(z.string().register(z.globalRegistry, { + description: 'request cache miss count' + })), + 'flush.total': z.optional(z.string().register(z.globalRegistry, { + description: 'number of flushes' + })), + 'pri.flush.total': z.optional(z.string().register(z.globalRegistry, { + description: 'number of flushes' + })), + 'flush.total_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in flush' + })), + 'pri.flush.total_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in flush' + })), + 'get.current': z.optional(z.string().register(z.globalRegistry, { + description: 'number of current get ops' + })), + 'pri.get.current': z.optional(z.string().register(z.globalRegistry, { + description: 'number of current get ops' + })), + 'get.time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in get' + })), + 'pri.get.time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in get' + })), + 'get.total': z.optional(z.string().register(z.globalRegistry, { + description: 'number of get ops' + })), + 'pri.get.total': z.optional(z.string().register(z.globalRegistry, { + description: 'number of get ops' + })), + 'get.exists_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in successful gets' + })), + 'pri.get.exists_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in successful gets' + })), + 'get.exists_total': z.optional(z.string().register(z.globalRegistry, { + description: 'number of successful gets' + })), + 'pri.get.exists_total': z.optional(z.string().register(z.globalRegistry, { + description: 'number of successful gets' + })), + 'get.missing_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in failed gets' + })), + 'pri.get.missing_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in failed gets' + })), + 'get.missing_total': z.optional(z.string().register(z.globalRegistry, { + description: 'number of failed gets' + })), + 'pri.get.missing_total': z.optional(z.string().register(z.globalRegistry, { + description: 'number of failed gets' + })), + 'indexing.delete_current': z.optional(z.string().register(z.globalRegistry, { + description: 'number of current deletions' + })), + 'pri.indexing.delete_current': z.optional(z.string().register(z.globalRegistry, { + description: 'number of current deletions' + })), + 'indexing.delete_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in deletions' + })), + 'pri.indexing.delete_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in deletions' + })), + 'indexing.delete_total': z.optional(z.string().register(z.globalRegistry, { + description: 'number of delete ops' + })), + 'pri.indexing.delete_total': z.optional(z.string().register(z.globalRegistry, { + description: 'number of delete ops' + })), + 'indexing.index_current': z.optional(z.string().register(z.globalRegistry, { + description: 'number of current indexing ops' + })), + 'pri.indexing.index_current': z.optional(z.string().register(z.globalRegistry, { + description: 'number of current indexing ops' + })), + 'indexing.index_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in indexing' + })), + 'pri.indexing.index_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in indexing' + })), + 'indexing.index_total': z.optional(z.string().register(z.globalRegistry, { + description: 'number of indexing ops' + })), + 'pri.indexing.index_total': z.optional(z.string().register(z.globalRegistry, { + description: 'number of indexing ops' + })), + 'indexing.index_failed': z.optional(z.string().register(z.globalRegistry, { + description: 'number of failed indexing ops' + })), + 'pri.indexing.index_failed': z.optional(z.string().register(z.globalRegistry, { + description: 'number of failed indexing ops' + })), + 'merges.current': z.optional(z.string().register(z.globalRegistry, { + description: 'number of current merges' + })), + 'pri.merges.current': z.optional(z.string().register(z.globalRegistry, { + description: 'number of current merges' + })), + 'merges.current_docs': z.optional(z.string().register(z.globalRegistry, { + description: 'number of current merging docs' + })), + 'pri.merges.current_docs': z.optional(z.string().register(z.globalRegistry, { + description: 'number of current merging docs' + })), + 'merges.current_size': z.optional(z.string().register(z.globalRegistry, { + description: 'size of current merges' + })), + 'pri.merges.current_size': z.optional(z.string().register(z.globalRegistry, { + description: 'size of current merges' + })), + 'merges.total': z.optional(z.string().register(z.globalRegistry, { + description: 'number of completed merge ops' + })), + 'pri.merges.total': z.optional(z.string().register(z.globalRegistry, { + description: 'number of completed merge ops' + })), + 'merges.total_docs': z.optional(z.string().register(z.globalRegistry, { + description: 'docs merged' + })), + 'pri.merges.total_docs': z.optional(z.string().register(z.globalRegistry, { + description: 'docs merged' + })), + 'merges.total_size': z.optional(z.string().register(z.globalRegistry, { + description: 'size merged' + })), + 'pri.merges.total_size': z.optional(z.string().register(z.globalRegistry, { + description: 'size merged' + })), + 'merges.total_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in merges' + })), + 'pri.merges.total_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in merges' + })), + 'refresh.total': z.optional(z.string().register(z.globalRegistry, { + description: 'total refreshes' + })), + 'pri.refresh.total': z.optional(z.string().register(z.globalRegistry, { + description: 'total refreshes' + })), + 'refresh.time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in refreshes' + })), + 'pri.refresh.time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in refreshes' + })), + 'refresh.external_total': z.optional(z.string().register(z.globalRegistry, { + description: 'total external refreshes' + })), + 'pri.refresh.external_total': z.optional(z.string().register(z.globalRegistry, { + description: 'total external refreshes' + })), + 'refresh.external_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in external refreshes' + })), + 'pri.refresh.external_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in external refreshes' + })), + 'refresh.listeners': z.optional(z.string().register(z.globalRegistry, { + description: 'number of pending refresh listeners' + })), + 'pri.refresh.listeners': z.optional(z.string().register(z.globalRegistry, { + description: 'number of pending refresh listeners' + })), + 'search.fetch_current': z.optional(z.string().register(z.globalRegistry, { + description: 'current fetch phase ops' + })), + 'pri.search.fetch_current': z.optional(z.string().register(z.globalRegistry, { + description: 'current fetch phase ops' + })), + 'search.fetch_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in fetch phase' + })), + 'pri.search.fetch_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in fetch phase' + })), + 'search.fetch_total': z.optional(z.string().register(z.globalRegistry, { + description: 'total fetch ops' + })), + 'pri.search.fetch_total': z.optional(z.string().register(z.globalRegistry, { + description: 'total fetch ops' + })), + 'search.open_contexts': z.optional(z.string().register(z.globalRegistry, { + description: 'open search contexts' + })), + 'pri.search.open_contexts': z.optional(z.string().register(z.globalRegistry, { + description: 'open search contexts' + })), + 'search.query_current': z.optional(z.string().register(z.globalRegistry, { + description: 'current query phase ops' + })), + 'pri.search.query_current': z.optional(z.string().register(z.globalRegistry, { + description: 'current query phase ops' + })), + 'search.query_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in query phase' + })), + 'pri.search.query_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in query phase' + })), + 'search.query_total': z.optional(z.string().register(z.globalRegistry, { + description: 'total query phase ops' + })), + 'pri.search.query_total': z.optional(z.string().register(z.globalRegistry, { + description: 'total query phase ops' + })), + 'search.scroll_current': z.optional(z.string().register(z.globalRegistry, { + description: 'open scroll contexts' + })), + 'pri.search.scroll_current': z.optional(z.string().register(z.globalRegistry, { + description: 'open scroll contexts' + })), + 'search.scroll_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time scroll contexts held open' + })), + 'pri.search.scroll_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time scroll contexts held open' + })), + 'search.scroll_total': z.optional(z.string().register(z.globalRegistry, { + description: 'completed scroll contexts' + })), + 'pri.search.scroll_total': z.optional(z.string().register(z.globalRegistry, { + description: 'completed scroll contexts' + })), + 'segments.count': z.optional(z.string().register(z.globalRegistry, { + description: 'number of segments' + })), + 'pri.segments.count': z.optional(z.string().register(z.globalRegistry, { + description: 'number of segments' + })), + 'segments.memory': z.optional(z.string().register(z.globalRegistry, { + description: 'memory used by segments' + })), + 'pri.segments.memory': z.optional(z.string().register(z.globalRegistry, { + description: 'memory used by segments' + })), + 'segments.index_writer_memory': z.optional(z.string().register(z.globalRegistry, { + description: 'memory used by index writer' + })), + 'pri.segments.index_writer_memory': z.optional(z.string().register(z.globalRegistry, { + description: 'memory used by index writer' + })), + 'segments.version_map_memory': z.optional(z.string().register(z.globalRegistry, { + description: 'memory used by version map' + })), + 'pri.segments.version_map_memory': z.optional(z.string().register(z.globalRegistry, { + description: 'memory used by version map' + })), + 'segments.fixed_bitset_memory': z.optional(z.string().register(z.globalRegistry, { + description: 'memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent fields' + })), + 'pri.segments.fixed_bitset_memory': z.optional(z.string().register(z.globalRegistry, { + description: 'memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent fields' + })), + 'warmer.current': z.optional(z.string().register(z.globalRegistry, { + description: 'current warmer ops' + })), + 'pri.warmer.current': z.optional(z.string().register(z.globalRegistry, { + description: 'current warmer ops' + })), + 'warmer.total': z.optional(z.string().register(z.globalRegistry, { + description: 'total warmer ops' + })), + 'pri.warmer.total': z.optional(z.string().register(z.globalRegistry, { + description: 'total warmer ops' + })), + 'warmer.total_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in warmers' + })), + 'pri.warmer.total_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spent in warmers' + })), + 'suggest.current': z.optional(z.string().register(z.globalRegistry, { + description: 'number of current suggest ops' + })), + 'pri.suggest.current': z.optional(z.string().register(z.globalRegistry, { + description: 'number of current suggest ops' + })), + 'suggest.time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spend in suggest' + })), + 'pri.suggest.time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spend in suggest' + })), + 'suggest.total': z.optional(z.string().register(z.globalRegistry, { + description: 'number of suggest ops' + })), + 'pri.suggest.total': z.optional(z.string().register(z.globalRegistry, { + description: 'number of suggest ops' + })), + 'memory.total': z.optional(z.string().register(z.globalRegistry, { + description: 'total used memory' + })), + 'pri.memory.total': z.optional(z.string().register(z.globalRegistry, { + description: 'total user memory' + })), + 'search.throttled': z.optional(z.string().register(z.globalRegistry, { + description: 'indicates if the index is search throttled' + })), + 'bulk.total_operations': z.optional(z.string().register(z.globalRegistry, { + description: 'number of bulk shard ops' + })), + 'pri.bulk.total_operations': z.optional(z.string().register(z.globalRegistry, { + description: 'number of bulk shard ops' + })), + 'bulk.total_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spend in shard bulk' + })), + 'pri.bulk.total_time': z.optional(z.string().register(z.globalRegistry, { + description: 'time spend in shard bulk' + })), + 'bulk.total_size_in_bytes': z.optional(z.string().register(z.globalRegistry, { + description: 'total size in bytes of shard bulk' + })), + 'pri.bulk.total_size_in_bytes': z.optional(z.string().register(z.globalRegistry, { + description: 'total size in bytes of shard bulk' + })), + 'bulk.avg_time': z.optional(z.string().register(z.globalRegistry, { + description: 'average time spend in shard bulk' + })), + 'pri.bulk.avg_time': z.optional(z.string().register(z.globalRegistry, { + description: 'average time spend in shard bulk' + })), + 'bulk.avg_size_in_bytes': z.optional(z.string().register(z.globalRegistry, { + description: 'average size in bytes of shard bulk' + })), + 'pri.bulk.avg_size_in_bytes': z.optional(z.string().register(z.globalRegistry, { + description: 'average size in bytes of shard bulk' + })) }); -export const cat_repositories_repositories_record = z.object({ - id: z.optional( - z.string().register(z.globalRegistry, { - description: 'The unique repository identifier.', - }) - ), - type: z.optional( - z.string().register(z.globalRegistry, { - description: 'The repository type.', - }) - ), +export const cat_types_cat_master_column = z.union([ + z.enum([ + 'id', + 'host', + 'h', + 'ip', + 'node', + 'n' + ]), + z.string() +]); + +export const cat_types_cat_master_columns = z.union([ + cat_types_cat_master_column, + z.array(cat_types_cat_master_column) +]); + +export const cat_master_master_record = z.object({ + id: z.optional(z.string().register(z.globalRegistry, { + description: 'node id' + })), + host: z.optional(z.string().register(z.globalRegistry, { + description: 'host name' + })), + ip: z.optional(z.string().register(z.globalRegistry, { + description: 'ip address' + })), + node: z.optional(z.string().register(z.globalRegistry, { + description: 'node name' + })) }); -export const cat_types_cat_segments_column = z.union([ - z.enum([ - 'index', - 'i', - 'idx', - 'shard', - 's', - 'sh', - 'prirep', +export const cat_types_cat_dfa_column = z.enum([ + 'assignment_explanation', + 'ae', + 'create_time', + 'ct', + 'createTime', + 'description', + 'd', + 'dest_index', + 'di', + 'destIndex', + 'failure_reason', + 'fr', + 'failureReason', + 'id', + 'model_memory_limit', + 'mml', + 'modelMemoryLimit', + 'node.address', + 'na', + 'nodeAddress', + 'node.ephemeral_id', + 'ne', + 'nodeEphemeralId', + 'node.id', + 'ni', + 'nodeId', + 'node.name', + 'nn', + 'nodeName', + 'progress', 'p', - 'pr', - 'primaryOrReplica', - 'ip', - 'segment', - 'generation', - 'docs.count', - 'docs.deleted', - 'size', - 'size.memory', - 'committed', - 'searchable', + 'source_index', + 'si', + 'sourceIndex', + 'state', + 's', + 'type', + 't', 'version', - 'compound', - 'id', - ]), - z.string(), + 'v' ]); -export const cat_types_cat_segments_columns = z.union([ - cat_types_cat_segments_column, - z.array(cat_types_cat_segments_column), +export const cat_types_cat_dfa_columns = z.union([ + cat_types_cat_dfa_column, + z.array(cat_types_cat_dfa_column) ]); -export const cat_segments_segments_record = z.object({ - index: z.optional(types_index_name), - shard: z.optional( - z.string().register(z.globalRegistry, { - description: 'The shard name.', - }) - ), - prirep: z.optional( - z.string().register(z.globalRegistry, { - description: 'The shard type: `primary` or `replica`.', - }) - ), - ip: z.optional( - z.string().register(z.globalRegistry, { - description: 'The IP address of the node where it lives.', - }) - ), - id: z.optional(types_node_id), - segment: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The segment name, which is derived from the segment generation and used internally to create file names in the directory of the shard.', - }) - ), - generation: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The segment generation number.\nElasticsearch increments this generation number for each segment written then uses this number to derive the segment name.', - }) - ), - 'docs.count': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of documents in the segment.\nThis excludes deleted documents and counts any nested documents separately from their parents.\nIt also excludes documents which were indexed recently and do not yet belong to a segment.', - }) - ), - 'docs.deleted': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of deleted documents in the segment, which might be higher or lower than the number of delete operations you have performed.\nThis number excludes deletes that were performed recently and do not yet belong to a segment.\nDeleted documents are cleaned up by the automatic merge process if it makes sense to do so.\nAlso, Elasticsearch creates extra deleted documents to internally track the recent history of operations on a shard.', - }) - ), - size: z.optional(types_byte_size), - 'size.memory': z.optional(types_byte_size), - committed: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If `true`, the segment is synced to disk.\nSegments that are synced can survive a hard reboot.\nIf `false`, the data from uncommitted segments is also stored in the transaction log so that Elasticsearch is able to replay changes on the next start.', - }) - ), - searchable: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If `true`, the segment is searchable.\nIf `false`, the segment has most likely been written to disk but needs a refresh to be searchable.', - }) - ), - version: z.optional(types_version_string), - compound: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If `true`, the segment is stored in a compound file.\nThis means Lucene merged all files from the segment in a single file to save file descriptors.', - }) - ), +export const types_version_string = z.string(); + +export const cat_ml_data_frame_analytics_data_frame_analytics_record = z.object({ + id: z.optional(types_id), + type: z.optional(z.string().register(z.globalRegistry, { + description: 'The type of analysis that the job performs.' + })), + create_time: z.optional(z.string().register(z.globalRegistry, { + description: 'The time when the job was created.' + })), + version: z.optional(types_version_string), + source_index: z.optional(types_index_name), + dest_index: z.optional(types_index_name), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the job.' + })), + model_memory_limit: z.optional(z.string().register(z.globalRegistry, { + description: 'The approximate maximum amount of memory resources that are permitted for the job.' + })), + state: z.optional(z.string().register(z.globalRegistry, { + description: 'The current status of the job.' + })), + failure_reason: z.optional(z.string().register(z.globalRegistry, { + description: 'Messages about the reason why the job failed.' + })), + progress: z.optional(z.string().register(z.globalRegistry, { + description: 'The progress report for the job by phase.' + })), + assignment_explanation: z.optional(z.string().register(z.globalRegistry, { + description: 'Messages related to the selection of a node.' + })), + 'node.id': z.optional(types_id), + 'node.name': z.optional(types_name), + 'node.ephemeral_id': z.optional(types_id), + 'node.address': z.optional(z.string().register(z.globalRegistry, { + description: 'The network address of the assigned node.' + })) }); -export const cat_types_cat_shard_column = z.union([ - z.enum([ - 'completion.size', - 'cs', - 'completionSize', - 'dataset.size', - 'dense_vector.value_count', - 'dvc', - 'denseVectorCount', - 'docs', - 'd', - 'dc', - 'fielddata.evictions', - 'fe', - 'fielddataEvictions', - 'fielddata.memory_size', - 'fm', - 'fielddataMemory', - 'flush.total', - 'ft', - 'flushTotal', - 'flush.total_time', - 'ftt', - 'flushTotalTime', - 'get.current', - 'gc', - 'getCurrent', - 'get.exists_time', - 'geti', - 'getExistsTime', - 'get.exists_total', - 'geto', - 'getExistsTotal', - 'get.missing_time', - 'gmti', - 'getMissingTime', - 'get.missing_total', - 'gmto', - 'getMissingTotal', - 'get.time', - 'gti', - 'getTime', - 'get.total', - 'gto', - 'getTotal', +export const cat_types_cat_datafeed_column = z.enum([ + 'ae', + 'assignment_explanation', + 'bc', + 'buckets.count', + 'bucketsCount', 'id', - 'index', - 'i', - 'idx', - 'indexing.delete_current', - 'idc', - 'indexingDeleteCurrent', - 'indexing.delete_time', - 'idti', - 'indexingDeleteTime', - 'indexing.delete_total', - 'idto', - 'indexingDeleteTotal', - 'indexing.index_current', - 'iic', - 'indexingIndexCurrent', - 'indexing.index_failed_due_to_version_conflict', - 'iifvc', - 'indexingIndexFailedDueToVersionConflict', - 'indexing.index_failed', - 'iif', - 'indexingIndexFailed', - 'indexing.index_time', - 'iiti', - 'indexingIndexTime', - 'indexing.index_total', - 'iito', - 'indexingIndexTotal', - 'ip', - 'merges.current', - 'mc', - 'mergesCurrent', - 'merges.current_docs', - 'mcd', - 'mergesCurrentDocs', - 'merges.current_size', - 'mcs', - 'mergesCurrentSize', - 'merges.total', - 'mt', - 'mergesTotal', - 'merges.total_docs', - 'mtd', - 'mergesTotalDocs', - 'merges.total_size', - 'mts', - 'mergesTotalSize', - 'merges.total_time', - 'mtt', - 'mergesTotalTime', - 'node', - 'n', - 'prirep', - 'p', - 'pr', - 'primaryOrReplica', - 'query_cache.evictions', - 'qce', - 'queryCacheEvictions', - 'query_cache.memory_size', - 'qcm', - 'queryCacheMemory', - 'recoverysource.type', - 'rs', - 'refresh.time', - 'rti', - 'refreshTime', - 'refresh.total', - 'rto', - 'refreshTotal', - 'search.fetch_current', - 'sfc', - 'searchFetchCurrent', - 'search.fetch_time', - 'sfti', - 'searchFetchTime', - 'search.fetch_total', - 'sfto', - 'searchFetchTotal', - 'search.open_contexts', - 'so', - 'searchOpenContexts', - 'search.query_current', - 'sqc', - 'searchQueryCurrent', - 'search.query_time', - 'sqti', - 'searchQueryTime', - 'search.query_total', - 'sqto', - 'searchQueryTotal', - 'search.scroll_current', - 'scc', - 'searchScrollCurrent', - 'search.scroll_time', - 'scti', - 'searchScrollTime', - 'search.scroll_total', - 'scto', - 'searchScrollTotal', - 'segments.count', + 'na', + 'node.address', + 'nodeAddress', + 'ne', + 'node.ephemeral_id', + 'nodeEphemeralId', + 'ni', + 'node.id', + 'nodeId', + 'nn', + 'node.name', + 'nodeName', + 'sba', + 'search.bucket_avg', + 'searchBucketAvg', 'sc', - 'segmentsCount', - 'segments.fixed_bitset_memory', - 'sfbm', - 'fixedBitsetMemory', - 'segments.index_writer_memory', - 'siwm', - 'segmentsIndexWriterMemory', - 'segments.memory', - 'sm', - 'segmentsMemory', - 'segments.version_map_memory', - 'svmm', - 'segmentsVersionMapMemory', - 'seq_no.global_checkpoint', - 'sqg', - 'globalCheckpoint', - 'seq_no.local_checkpoint', - 'sql', - 'localCheckpoint', - 'seq_no.max', - 'sqm', - 'maxSeqNo', - 'shard', - 's', - 'sh', - 'dsparse_vector.value_count', - 'svc', - 'sparseVectorCount', - 'state', + 'search.count', + 'searchCount', + 'seah', + 'search.exp_avg_hour', + 'searchExpAvgHour', 'st', - 'store', - 'sto', - 'suggest.current', - 'suc', - 'suggestCurrent', - 'suggest.time', - 'suti', - 'suggestTime', - 'suggest.total', - 'suto', - 'suggestTotal', - 'sync_id', - 'unassigned.at', - 'ua', - 'unassigned.details', - 'ud', - 'unassigned.for', - 'uf', - 'unassigned.reason', - 'ur', - ]), - z.string(), + 'search.time', + 'searchTime', + 's', + 'state' ]); -export const cat_types_cat_shard_columns = z.union([ - cat_types_cat_shard_column, - z.array(cat_types_cat_shard_column), +export const cat_types_cat_datafeed_columns = z.union([ + cat_types_cat_datafeed_column, + z.array(cat_types_cat_datafeed_column) ]); -export const cat_shards_shards_record = z.object({ - index: z.optional( - z.string().register(z.globalRegistry, { - description: 'The index name.', - }) - ), - shard: z.optional( - z.string().register(z.globalRegistry, { - description: 'The shard name.', - }) - ), - prirep: z.optional( - z.string().register(z.globalRegistry, { - description: 'The shard type: `primary` or `replica`.', - }) - ), - state: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The shard state.\nReturned values include:\n`INITIALIZING`: The shard is recovering from a peer shard or gateway.\n`RELOCATING`: The shard is relocating.\n`STARTED`: The shard has started.\n`UNASSIGNED`: The shard is not assigned to any node.', - }) - ), - docs: z.optional(z.union([z.string(), z.null()])), - store: z.optional(z.union([z.string(), z.null()])), - dataset: z.optional(z.union([z.string(), z.null()])), - ip: z.optional(z.union([z.string(), z.null()])), - id: z.optional( - z.string().register(z.globalRegistry, { - description: 'The unique identifier for the node.', - }) - ), - node: z.optional(z.union([z.string(), z.null()])), - sync_id: z.optional( - z.string().register(z.globalRegistry, { - description: 'The sync identifier.', - }) - ), - 'unassigned.reason': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The reason for the last change to the state of an unassigned shard.\nIt does not explain why the shard is currently unassigned; use the cluster allocation explain API for that information.\nReturned values include:\n`ALLOCATION_FAILED`: Unassigned as a result of a failed allocation of the shard.\n`CLUSTER_RECOVERED`: Unassigned as a result of a full cluster recovery.\n`DANGLING_INDEX_IMPORTED`: Unassigned as a result of importing a dangling index.\n`EXISTING_INDEX_RESTORED`: Unassigned as a result of restoring into a closed index.\n`FORCED_EMPTY_PRIMARY`: The shard’s allocation was last modified by forcing an empty primary using the cluster reroute API.\n`INDEX_CLOSED`: Unassigned because the index was closed.\n`INDEX_CREATED`: Unassigned as a result of an API creation of an index.\n`INDEX_REOPENED`: Unassigned as a result of opening a closed index.\n`MANUAL_ALLOCATION`: The shard’s allocation was last modified by the cluster reroute API.\n`NEW_INDEX_RESTORED`: Unassigned as a result of restoring into a new index.\n`NODE_LEFT`: Unassigned as a result of the node hosting it leaving the cluster.\n`NODE_RESTARTING`: Similar to `NODE_LEFT`, except that the node was registered as restarting using the node shutdown API.\n`PRIMARY_FAILED`: The shard was initializing as a replica, but the primary shard failed before the initialization completed.\n`REALLOCATED_REPLICA`: A better replica location is identified and causes the existing replica allocation to be cancelled.\n`REINITIALIZED`: When a shard moves from started back to initializing.\n`REPLICA_ADDED`: Unassigned as a result of explicit addition of a replica.\n`REROUTE_CANCELLED`: Unassigned as a result of explicit cancel reroute command.', - }) - ), - 'unassigned.at': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The time at which the shard became unassigned in Coordinated Universal Time (UTC).', - }) - ), - 'unassigned.for': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The time at which the shard was requested to be unassigned in Coordinated Universal Time (UTC).', - }) - ), - 'unassigned.details': z.optional( - z.string().register(z.globalRegistry, { - description: - 'Additional details as to why the shard became unassigned.\nIt does not explain why the shard is not assigned; use the cluster allocation explain API for that information.', - }) - ), - 'recoverysource.type': z.optional( - z.string().register(z.globalRegistry, { - description: 'The type of recovery source.', - }) - ), - 'completion.size': z.optional( - z.string().register(z.globalRegistry, { - description: 'The size of completion.', - }) - ), - 'fielddata.memory_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'The used fielddata cache memory.', - }) - ), - 'fielddata.evictions': z.optional( - z.string().register(z.globalRegistry, { - description: 'The fielddata cache evictions.', - }) - ), - 'query_cache.memory_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'The used query cache memory.', - }) - ), - 'query_cache.evictions': z.optional( - z.string().register(z.globalRegistry, { - description: 'The query cache evictions.', - }) - ), - 'flush.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of flushes.', - }) - ), - 'flush.total_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in flush.', - }) - ), - 'get.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of current get operations.', - }) - ), - 'get.time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in get operations.', - }) - ), - 'get.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of get operations.', - }) - ), - 'get.exists_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in successful get operations.', - }) - ), - 'get.exists_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of successful get operations.', - }) - ), - 'get.missing_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in failed get operations.', - }) - ), - 'get.missing_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of failed get operations.', - }) - ), - 'indexing.delete_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of current deletion operations.', - }) - ), - 'indexing.delete_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in deletion operations.', - }) - ), - 'indexing.delete_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of delete operations.', - }) - ), - 'indexing.index_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of current indexing operations.', - }) - ), - 'indexing.index_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in indexing operations.', - }) - ), - 'indexing.index_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of indexing operations.', - }) - ), - 'indexing.index_failed': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of failed indexing operations.', - }) - ), - 'merges.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of current merge operations.', - }) - ), - 'merges.current_docs': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of current merging documents.', - }) - ), - 'merges.current_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'The size of current merge operations.', - }) - ), - 'merges.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of completed merge operations.', - }) - ), - 'merges.total_docs': z.optional( - z.string().register(z.globalRegistry, { - description: 'The nuber of merged documents.', - }) - ), - 'merges.total_size': z.optional( - z.string().register(z.globalRegistry, { - description: 'The size of current merges.', - }) - ), - 'merges.total_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent merging documents.', - }) - ), - 'refresh.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total number of refreshes.', - }) - ), - 'refresh.time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in refreshes.', - }) - ), - 'refresh.external_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total nunber of external refreshes.', - }) - ), - 'refresh.external_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in external refreshes.', - }) - ), - 'refresh.listeners': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of pending refresh listeners.', - }) - ), - 'search.fetch_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The current fetch phase operations.', - }) - ), - 'search.fetch_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in fetch phase.', - }) - ), - 'search.fetch_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total number of fetch operations.', - }) - ), - 'search.open_contexts': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of open search contexts.', - }) - ), - 'search.query_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The current query phase operations.', - }) - ), - 'search.query_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in query phase.', - }) - ), - 'search.query_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total number of query phase operations.', - }) - ), - 'search.scroll_current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The open scroll contexts.', - }) - ), - 'search.scroll_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time scroll contexts were held open.', - }) - ), - 'search.scroll_total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of completed scroll contexts.', - }) - ), - 'segments.count': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of segments.', - }) - ), - 'segments.memory': z.optional( - z.string().register(z.globalRegistry, { - description: 'The memory used by segments.', - }) - ), - 'segments.index_writer_memory': z.optional( - z.string().register(z.globalRegistry, { - description: 'The memory used by the index writer.', - }) - ), - 'segments.version_map_memory': z.optional( - z.string().register(z.globalRegistry, { - description: 'The memory used by the version map.', - }) - ), - 'segments.fixed_bitset_memory': z.optional( - z.string().register(z.globalRegistry, { - description: - 'The memory used by fixed bit sets for nested object field types and export type filters for types referred in `_parent` fields.', - }) - ), - 'seq_no.max': z.optional( - z.string().register(z.globalRegistry, { - description: 'The maximum sequence number.', - }) - ), - 'seq_no.local_checkpoint': z.optional( - z.string().register(z.globalRegistry, { - description: 'The local checkpoint.', - }) - ), - 'seq_no.global_checkpoint': z.optional( - z.string().register(z.globalRegistry, { - description: 'The global checkpoint.', - }) - ), - 'warmer.current': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of current warmer operations.', - }) - ), - 'warmer.total': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total number of warmer operations.', - }) - ), - 'warmer.total_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in warmer operations.', - }) - ), - 'path.data': z.optional( - z.string().register(z.globalRegistry, { - description: 'The shard data path.', - }) - ), - 'path.state': z.optional( - z.string().register(z.globalRegistry, { - description: 'The shard state path.', - }) - ), - 'bulk.total_operations': z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of bulk shard operations.', - }) - ), - 'bulk.total_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The time spent in shard bulk operations.', - }) - ), - 'bulk.total_size_in_bytes': z.optional( - z.string().register(z.globalRegistry, { - description: 'The total size in bytes of shard bulk operations.', - }) - ), - 'bulk.avg_time': z.optional( - z.string().register(z.globalRegistry, { - description: 'The average time spent in shard bulk operations.', - }) - ), - 'bulk.avg_size_in_bytes': z.optional( - z.string().register(z.globalRegistry, { - description: 'The average size in bytes of shard bulk operations.', - }) - ), +export const ml_types_datafeed_state = z.enum([ + 'started', + 'stopped', + 'starting', + 'stopping' +]); + +export const cat_ml_datafeeds_datafeeds_record = z.object({ + id: z.optional(z.string().register(z.globalRegistry, { + description: 'The datafeed identifier.' + })), + state: z.optional(ml_types_datafeed_state), + assignment_explanation: z.optional(z.string().register(z.globalRegistry, { + description: 'For started datafeeds only, contains messages relating to the selection of a node.' + })), + 'buckets.count': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of buckets processed.' + })), + 'search.count': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of searches run by the datafeed.' + })), + 'search.time': z.optional(z.string().register(z.globalRegistry, { + description: 'The total time the datafeed spent searching, in milliseconds.' + })), + 'search.bucket_avg': z.optional(z.string().register(z.globalRegistry, { + description: 'The average search time per bucket, in milliseconds.' + })), + 'search.exp_avg_hour': z.optional(z.string().register(z.globalRegistry, { + description: 'The exponential average search time per hour, in milliseconds.' + })), + 'node.id': z.optional(z.string().register(z.globalRegistry, { + description: 'The unique identifier of the assigned node.\nFor started datafeeds only, this information pertains to the node upon which the datafeed is started.' + })), + 'node.name': z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the assigned node.\nFor started datafeeds only, this information pertains to the node upon which the datafeed is started.' + })), + 'node.ephemeral_id': z.optional(z.string().register(z.globalRegistry, { + description: 'The ephemeral identifier of the assigned node.\nFor started datafeeds only, this information pertains to the node upon which the datafeed is started.' + })), + 'node.address': z.optional(z.string().register(z.globalRegistry, { + description: 'The network address of the assigned node.\nFor started datafeeds only, this information pertains to the node upon which the datafeed is started.' + })) }); -export const cat_types_cat_snapshots_column = z.union([ - z.enum([ +export const cat_types_cat_anomaly_detector_column = z.enum([ + 'assignment_explanation', + 'ae', + 'buckets.count', + 'bc', + 'bucketsCount', + 'buckets.time.exp_avg', + 'btea', + 'bucketsTimeExpAvg', + 'buckets.time.exp_avg_hour', + 'bteah', + 'bucketsTimeExpAvgHour', + 'buckets.time.max', + 'btmax', + 'bucketsTimeMax', + 'buckets.time.min', + 'btmin', + 'bucketsTimeMin', + 'buckets.time.total', + 'btt', + 'bucketsTimeTotal', + 'data.buckets', + 'db', + 'dataBuckets', + 'data.earliest_record', + 'der', + 'dataEarliestRecord', + 'data.empty_buckets', + 'deb', + 'dataEmptyBuckets', + 'data.input_bytes', + 'dib', + 'dataInputBytes', + 'data.input_fields', + 'dif', + 'dataInputFields', + 'data.input_records', + 'dir', + 'dataInputRecords', + 'data.invalid_dates', + 'did', + 'dataInvalidDates', + 'data.last', + 'dl', + 'dataLast', + 'data.last_empty_bucket', + 'dleb', + 'dataLastEmptyBucket', + 'data.last_sparse_bucket', + 'dlsb', + 'dataLastSparseBucket', + 'data.latest_record', + 'dlr', + 'dataLatestRecord', + 'data.missing_fields', + 'dmf', + 'dataMissingFields', + 'data.out_of_order_timestamps', + 'doot', + 'dataOutOfOrderTimestamps', + 'data.processed_fields', + 'dpf', + 'dataProcessedFields', + 'data.processed_records', + 'dpr', + 'dataProcessedRecords', + 'data.sparse_buckets', + 'dsb', + 'dataSparseBuckets', + 'forecasts.memory.avg', + 'fmavg', + 'forecastsMemoryAvg', + 'forecasts.memory.max', + 'fmmax', + 'forecastsMemoryMax', + 'forecasts.memory.min', + 'fmmin', + 'forecastsMemoryMin', + 'forecasts.memory.total', + 'fmt', + 'forecastsMemoryTotal', + 'forecasts.records.avg', + 'fravg', + 'forecastsRecordsAvg', + 'forecasts.records.max', + 'frmax', + 'forecastsRecordsMax', + 'forecasts.records.min', + 'frmin', + 'forecastsRecordsMin', + 'forecasts.records.total', + 'frt', + 'forecastsRecordsTotal', + 'forecasts.time.avg', + 'ftavg', + 'forecastsTimeAvg', + 'forecasts.time.max', + 'ftmax', + 'forecastsTimeMax', + 'forecasts.time.min', + 'ftmin', + 'forecastsTimeMin', + 'forecasts.time.total', + 'ftt', + 'forecastsTimeTotal', + 'forecasts.total', + 'ft', + 'forecastsTotal', 'id', - 'snapshot', - 'repository', - 're', - 'repo', - 'status', - 's', - 'start_epoch', - 'ste', - 'startEpoch', - 'start_time', - 'sti', - 'startTime', - 'end_epoch', - 'ete', - 'endEpoch', - 'end_time', - 'eti', - 'endTime', - 'duration', - 'dur', - 'indices', - 'i', - 'successful_shards', - 'ss', - 'failed_shards', - 'fs', - 'total_shards', - 'ts', - 'reason', - 'r', - ]), - z.string(), + 'model.bucket_allocation_failures', + 'mbaf', + 'modelBucketAllocationFailures', + 'model.by_fields', + 'mbf', + 'modelByFields', + 'model.bytes', + 'mb', + 'modelBytes', + 'model.bytes_exceeded', + 'mbe', + 'modelBytesExceeded', + 'model.categorization_status', + 'mcs', + 'modelCategorizationStatus', + 'model.categorized_doc_count', + 'mcdc', + 'modelCategorizedDocCount', + 'model.dead_category_count', + 'mdcc', + 'modelDeadCategoryCount', + 'model.failed_category_count', + 'mdcc', + 'modelFailedCategoryCount', + 'model.frequent_category_count', + 'mfcc', + 'modelFrequentCategoryCount', + 'model.log_time', + 'mlt', + 'modelLogTime', + 'model.memory_limit', + 'mml', + 'modelMemoryLimit', + 'model.memory_status', + 'mms', + 'modelMemoryStatus', + 'model.over_fields', + 'mof', + 'modelOverFields', + 'model.partition_fields', + 'mpf', + 'modelPartitionFields', + 'model.rare_category_count', + 'mrcc', + 'modelRareCategoryCount', + 'model.timestamp', + 'mt', + 'modelTimestamp', + 'model.total_category_count', + 'mtcc', + 'modelTotalCategoryCount', + 'node.address', + 'na', + 'nodeAddress', + 'node.ephemeral_id', + 'ne', + 'nodeEphemeralId', + 'node.id', + 'ni', + 'nodeId', + 'node.name', + 'nn', + 'nodeName', + 'opened_time', + 'ot', + 'state', + 's' +]); + +export const cat_types_cat_anomaly_detector_columns = z.union([ + cat_types_cat_anomaly_detector_column, + z.array(cat_types_cat_anomaly_detector_column) +]); + +export const ml_types_job_state = z.enum([ + 'closing', + 'closed', + 'opened', + 'failed', + 'opening' +]); + +export const ml_types_memory_status = z.enum([ + 'ok', + 'soft_limit', + 'hard_limit' +]); + +export const ml_types_categorization_status = z.enum(['ok', 'warn']); + +export const cat_ml_jobs_jobs_record = z.object({ + id: z.optional(types_id), + state: z.optional(ml_types_job_state), + opened_time: z.optional(z.string().register(z.globalRegistry, { + description: 'For open jobs only, the amount of time the job has been opened.' + })), + assignment_explanation: z.optional(z.string().register(z.globalRegistry, { + description: 'For open anomaly detection jobs only, contains messages relating to the selection of a node to run the job.' + })), + 'data.processed_records': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of input documents that have been processed by the anomaly detection job.\nThis value includes documents with missing fields, since they are nonetheless analyzed.\nIf you use datafeeds and have aggregations in your search query, the `processed_record_count` is the number of aggregation results processed, not the number of Elasticsearch documents.' + })), + 'data.processed_fields': z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of fields in all the documents that have been processed by the anomaly detection job.\nOnly fields that are specified in the detector configuration object contribute to this count.\nThe timestamp is not included in this count.' + })), + 'data.input_bytes': z.optional(types_byte_size), + 'data.input_records': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of input documents posted to the anomaly detection job.' + })), + 'data.input_fields': z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of fields in input documents posted to the anomaly detection job.\nThis count includes fields that are not used in the analysis.\nHowever, be aware that if you are using a datafeed, it extracts only the required fields from the documents it retrieves before posting them to the job.' + })), + 'data.invalid_dates': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of input documents with either a missing date field or a date that could not be parsed.' + })), + 'data.missing_fields': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of input documents that are missing a field that the anomaly detection job is configured to analyze.\nInput documents with missing fields are still processed because it is possible that not all fields are missing.\nIf you are using datafeeds or posting data to the job in JSON format, a high `missing_field_count` is often not an indication of data issues.\nIt is not necessarily a cause for concern.' + })), + 'data.out_of_order_timestamps': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of input documents that have a timestamp chronologically preceding the start of the current anomaly detection bucket offset by the latency window.\nThis information is applicable only when you provide data to the anomaly detection job by using the post data API.\nThese out of order documents are discarded, since jobs require time series data to be in ascending chronological order.' + })), + 'data.empty_buckets': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of buckets which did not contain any data.\nIf your data contains many empty buckets, consider increasing your `bucket_span` or using functions that are tolerant to gaps in data such as mean, `non_null_sum` or `non_zero_count`.' + })), + 'data.sparse_buckets': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of buckets that contained few data points compared to the expected number of data points.\nIf your data contains many sparse buckets, consider using a longer `bucket_span`.' + })), + 'data.buckets': z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of buckets processed.' + })), + 'data.earliest_record': z.optional(z.string().register(z.globalRegistry, { + description: 'The timestamp of the earliest chronologically input document.' + })), + 'data.latest_record': z.optional(z.string().register(z.globalRegistry, { + description: 'The timestamp of the latest chronologically input document.' + })), + 'data.last': z.optional(z.string().register(z.globalRegistry, { + description: 'The timestamp at which data was last analyzed, according to server time.' + })), + 'data.last_empty_bucket': z.optional(z.string().register(z.globalRegistry, { + description: 'The timestamp of the last bucket that did not contain any data.' + })), + 'data.last_sparse_bucket': z.optional(z.string().register(z.globalRegistry, { + description: 'The timestamp of the last bucket that was considered sparse.' + })), + 'model.bytes': z.optional(types_byte_size), + 'model.memory_status': z.optional(ml_types_memory_status), + 'model.bytes_exceeded': z.optional(types_byte_size), + 'model.memory_limit': z.optional(z.string().register(z.globalRegistry, { + description: 'The upper limit for model memory usage, checked on increasing values.' + })), + 'model.by_fields': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of `by` field values that were analyzed by the models.\nThis value is cumulative for all detectors in the job.' + })), + 'model.over_fields': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of `over` field values that were analyzed by the models.\nThis value is cumulative for all detectors in the job.' + })), + 'model.partition_fields': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of `partition` field values that were analyzed by the models.\nThis value is cumulative for all detectors in the job.' + })), + 'model.bucket_allocation_failures': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of buckets for which new entities in incoming data were not processed due to insufficient model memory.\nThis situation is also signified by a `hard_limit: memory_status` property value.' + })), + 'model.categorization_status': z.optional(ml_types_categorization_status), + 'model.categorized_doc_count': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of documents that have had a field categorized.' + })), + 'model.total_category_count': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of categories created by categorization.' + })), + 'model.frequent_category_count': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of categories that match more than 1% of categorized documents.' + })), + 'model.rare_category_count': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of categories that match just one categorized document.' + })), + 'model.dead_category_count': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of categories created by categorization that will never be assigned again because another category’s definition makes it a superset of the dead category.\nDead categories are a side effect of the way categorization has no prior training.' + })), + 'model.failed_category_count': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of times that categorization wanted to create a new category but couldn’t because the job had hit its `model_memory_limit`.\nThis count does not track which specific categories failed to be created.\nTherefore you cannot use this value to determine the number of unique categories that were missed.' + })), + 'model.log_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The timestamp when the model stats were gathered, according to server time.' + })), + 'model.timestamp': z.optional(z.string().register(z.globalRegistry, { + description: 'The timestamp of the last record when the model stats were gathered.' + })), + 'forecasts.total': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of individual forecasts currently available for the job.\nA value of one or more indicates that forecasts exist.' + })), + 'forecasts.memory.min': z.optional(z.string().register(z.globalRegistry, { + description: 'The minimum memory usage in bytes for forecasts related to the anomaly detection job.' + })), + 'forecasts.memory.max': z.optional(z.string().register(z.globalRegistry, { + description: 'The maximum memory usage in bytes for forecasts related to the anomaly detection job.' + })), + 'forecasts.memory.avg': z.optional(z.string().register(z.globalRegistry, { + description: 'The average memory usage in bytes for forecasts related to the anomaly detection job.' + })), + 'forecasts.memory.total': z.optional(z.string().register(z.globalRegistry, { + description: 'The total memory usage in bytes for forecasts related to the anomaly detection job.' + })), + 'forecasts.records.min': z.optional(z.string().register(z.globalRegistry, { + description: 'The minimum number of `model_forecast` documents written for forecasts related to the anomaly detection job.' + })), + 'forecasts.records.max': z.optional(z.string().register(z.globalRegistry, { + description: 'The maximum number of `model_forecast` documents written for forecasts related to the anomaly detection job.' + })), + 'forecasts.records.avg': z.optional(z.string().register(z.globalRegistry, { + description: 'The average number of `model_forecast` documents written for forecasts related to the anomaly detection job.' + })), + 'forecasts.records.total': z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of `model_forecast` documents written for forecasts related to the anomaly detection job.' + })), + 'forecasts.time.min': z.optional(z.string().register(z.globalRegistry, { + description: 'The minimum runtime in milliseconds for forecasts related to the anomaly detection job.' + })), + 'forecasts.time.max': z.optional(z.string().register(z.globalRegistry, { + description: 'The maximum runtime in milliseconds for forecasts related to the anomaly detection job.' + })), + 'forecasts.time.avg': z.optional(z.string().register(z.globalRegistry, { + description: 'The average runtime in milliseconds for forecasts related to the anomaly detection job.' + })), + 'forecasts.time.total': z.optional(z.string().register(z.globalRegistry, { + description: 'The total runtime in milliseconds for forecasts related to the anomaly detection job.' + })), + 'node.id': z.optional(types_node_id), + 'node.name': z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the assigned node.' + })), + 'node.ephemeral_id': z.optional(types_node_id), + 'node.address': z.optional(z.string().register(z.globalRegistry, { + description: 'The network address of the assigned node.' + })), + 'buckets.count': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of bucket results produced by the job.' + })), + 'buckets.time.total': z.optional(z.string().register(z.globalRegistry, { + description: 'The sum of all bucket processing times, in milliseconds.' + })), + 'buckets.time.min': z.optional(z.string().register(z.globalRegistry, { + description: 'The minimum of all bucket processing times, in milliseconds.' + })), + 'buckets.time.max': z.optional(z.string().register(z.globalRegistry, { + description: 'The maximum of all bucket processing times, in milliseconds.' + })), + 'buckets.time.exp_avg': z.optional(z.string().register(z.globalRegistry, { + description: 'The exponential moving average of all bucket processing times, in milliseconds.' + })), + 'buckets.time.exp_avg_hour': z.optional(z.string().register(z.globalRegistry, { + description: 'The exponential moving average of bucket processing times calculated in a one hour time window, in milliseconds.' + })) +}); + +export const cat_types_cat_trained_models_column = z.enum([ + 'create_time', + 'ct', + 'created_by', + 'c', + 'createdBy', + 'data_frame_analytics_id', + 'df', + 'dataFrameAnalytics', + 'dfid', + 'description', + 'd', + 'heap_size', + 'hs', + 'modelHeapSize', + 'id', + 'ingest.count', + 'ic', + 'ingestCount', + 'ingest.current', + 'icurr', + 'ingestCurrent', + 'ingest.failed', + 'if', + 'ingestFailed', + 'ingest.pipelines', + 'ip', + 'ingestPipelines', + 'ingest.time', + 'it', + 'ingestTime', + 'license', + 'l', + 'operations', + 'o', + 'modelOperations', + 'version', + 'v' +]); + +export const cat_types_cat_trained_models_columns = z.union([ + cat_types_cat_trained_models_column, + z.array(cat_types_cat_trained_models_column) +]); + +export const cat_ml_trained_models_trained_models_record = z.object({ + id: z.optional(types_id), + created_by: z.optional(z.string().register(z.globalRegistry, { + description: 'Information about the creator of the model.' + })), + heap_size: z.optional(types_byte_size), + operations: z.optional(z.string().register(z.globalRegistry, { + description: 'The estimated number of operations to use the model.\nThis number helps to measure the computational complexity of the model.' + })), + license: z.optional(z.string().register(z.globalRegistry, { + description: 'The license level of the model.' + })), + create_time: z.optional(types_date_time), + version: z.optional(types_version_string), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the model.' + })), + 'ingest.pipelines': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of pipelines that are referencing the model.' + })), + 'ingest.count': z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of documents that are processed by the model.' + })), + 'ingest.time': z.optional(z.string().register(z.globalRegistry, { + description: 'The total time spent processing documents with thie model.' + })), + 'ingest.current': z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of documents that are currently being handled by the model.' + })), + 'ingest.failed': z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of failed ingest attempts with the model.' + })), + 'data_frame.id': z.optional(z.string().register(z.globalRegistry, { + description: 'The identifier for the data frame analytics job that created the model.\nOnly displayed if the job is still available.' + })), + 'data_frame.create_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time the data frame analytics job was created.' + })), + 'data_frame.source_index': z.optional(z.string().register(z.globalRegistry, { + description: 'The source index used to train in the data frame analysis.' + })), + 'data_frame.analysis': z.optional(z.string().register(z.globalRegistry, { + description: 'The analysis used by the data frame to build the model.' + })), + type: z.optional(z.string()) +}); + +export const cat_types_cat_nodeattrs_column = z.union([ + z.enum([ + 'node', + 'id', + 'id', + 'nodeId', + 'pid', + 'p', + 'host', + 'h', + 'ip', + 'i', + 'port', + 'po', + 'attr', + 'attr.name', + 'value', + 'attr.value' + ]), + z.string() +]); + +export const cat_types_cat_nodeattrs_columns = z.union([ + cat_types_cat_nodeattrs_column, + z.array(cat_types_cat_nodeattrs_column) +]); + +export const cat_nodeattrs_node_attributes_record = z.object({ + node: z.optional(z.string().register(z.globalRegistry, { + description: 'The node name.' + })), + id: z.optional(z.string().register(z.globalRegistry, { + description: 'The unique node identifier.' + })), + pid: z.optional(z.string().register(z.globalRegistry, { + description: 'The process identifier.' + })), + host: z.optional(z.string().register(z.globalRegistry, { + description: 'The host name.' + })), + ip: z.optional(z.string().register(z.globalRegistry, { + description: 'The IP address.' + })), + port: z.optional(z.string().register(z.globalRegistry, { + description: 'The bound transport port.' + })), + attr: z.optional(z.string().register(z.globalRegistry, { + description: 'The attribute name.' + })), + value: z.optional(z.string().register(z.globalRegistry, { + description: 'The attribute value.' + })) +}); + +export const cat_types_cat_node_column = z.union([ + z.enum([ + 'build', + 'b', + 'completion.size', + 'cs', + 'completionSize', + 'cpu', + 'disk.avail', + 'd', + 'disk', + 'diskAvail', + 'disk.total', + 'dt', + 'diskTotal', + 'disk.used', + 'du', + 'diskUsed', + 'disk.used_percent', + 'dup', + 'diskUsedPercent', + 'fielddata.evictions', + 'fe', + 'fielddataEvictions', + 'fielddata.memory_size', + 'fm', + 'fielddataMemory', + 'file_desc.current', + 'fdc', + 'fileDescriptorCurrent', + 'file_desc.max', + 'fdm', + 'fileDescriptorMax', + 'file_desc.percent', + 'fdp', + 'fileDescriptorPercent', + 'flush.total', + 'ft', + 'flushTotal', + 'flush.total_time', + 'ftt', + 'flushTotalTime', + 'get.current', + 'gc', + 'getCurrent', + 'get.exists_time', + 'geti', + 'getExistsTime', + 'get.exists_total', + 'geto', + 'getExistsTotal', + 'get.missing_time', + 'gmti', + 'getMissingTime', + 'get.missing_total', + 'gmto', + 'getMissingTotal', + 'get.time', + 'gti', + 'getTime', + 'get.total', + 'gto', + 'getTotal', + 'heap.current', + 'hc', + 'heapCurrent', + 'heap.max', + 'hm', + 'heapMax', + 'heap.percent', + 'hp', + 'heapPercent', + 'http_address', + 'http', + 'id', + 'nodeId', + 'indexing.delete_current', + 'idc', + 'indexingDeleteCurrent', + 'indexing.delete_time', + 'idti', + 'indexingDeleteTime', + 'indexing.delete_total', + 'idto', + 'indexingDeleteTotal', + 'indexing.index_current', + 'iic', + 'indexingIndexCurrent', + 'indexing.index_failed', + 'iif', + 'indexingIndexFailed', + 'indexing.index_failed_due_to_version_conflict', + 'iifvc', + 'indexingIndexFailedDueToVersionConflict', + 'indexing.index_time', + 'iiti', + 'indexingIndexTime', + 'indexing.index_total', + 'iito', + 'indexingIndexTotal', + 'ip', + 'i', + 'jdk', + 'j', + 'load_1m', + 'l', + 'load_5m', + 'l', + 'load_15m', + 'l', + 'available_processors', + 'ap', + 'mappings.total_count', + 'mtc', + 'mappingsTotalCount', + 'mappings.total_estimated_overhead_in_bytes', + 'mteo', + 'mappingsTotalEstimatedOverheadInBytes', + 'master', + 'm', + 'merges.current', + 'mc', + 'mergesCurrent', + 'merges.current_docs', + 'mcd', + 'mergesCurrentDocs', + 'merges.current_size', + 'mcs', + 'mergesCurrentSize', + 'merges.total', + 'mt', + 'mergesTotal', + 'merges.total_docs', + 'mtd', + 'mergesTotalDocs', + 'merges.total_size', + 'mts', + 'mergesTotalSize', + 'merges.total_time', + 'mtt', + 'mergesTotalTime', + 'name', + 'n', + 'node.role', + 'r', + 'role', + 'nodeRole', + 'pid', + 'p', + 'port', + 'po', + 'query_cache.memory_size', + 'qcm', + 'queryCacheMemory', + 'query_cache.evictions', + 'qce', + 'queryCacheEvictions', + 'query_cache.hit_count', + 'qchc', + 'queryCacheHitCount', + 'query_cache.miss_count', + 'qcmc', + 'queryCacheMissCount', + 'ram.current', + 'rc', + 'ramCurrent', + 'ram.max', + 'rm', + 'ramMax', + 'ram.percent', + 'rp', + 'ramPercent', + 'refresh.total', + 'rto', + 'refreshTotal', + 'refresh.time', + 'rti', + 'refreshTime', + 'request_cache.memory_size', + 'rcm', + 'requestCacheMemory', + 'request_cache.evictions', + 'rce', + 'requestCacheEvictions', + 'request_cache.hit_count', + 'rchc', + 'requestCacheHitCount', + 'request_cache.miss_count', + 'rcmc', + 'requestCacheMissCount', + 'script.compilations', + 'scrcc', + 'scriptCompilations', + 'script.cache_evictions', + 'scrce', + 'scriptCacheEvictions', + 'search.fetch_current', + 'sfc', + 'searchFetchCurrent', + 'search.fetch_time', + 'sfti', + 'searchFetchTime', + 'search.fetch_total', + 'sfto', + 'searchFetchTotal', + 'search.open_contexts', + 'so', + 'searchOpenContexts', + 'search.query_current', + 'sqc', + 'searchQueryCurrent', + 'search.query_time', + 'sqti', + 'searchQueryTime', + 'search.query_total', + 'sqto', + 'searchQueryTotal', + 'search.scroll_current', + 'scc', + 'searchScrollCurrent', + 'search.scroll_time', + 'scti', + 'searchScrollTime', + 'search.scroll_total', + 'scto', + 'searchScrollTotal', + 'segments.count', + 'sc', + 'segmentsCount', + 'segments.fixed_bitset_memory', + 'sfbm', + 'fixedBitsetMemory', + 'segments.index_writer_memory', + 'siwm', + 'segmentsIndexWriterMemory', + 'segments.memory', + 'sm', + 'segmentsMemory', + 'segments.version_map_memory', + 'svmm', + 'segmentsVersionMapMemory', + 'shard_stats.total_count', + 'sstc', + 'shards', + 'shardStatsTotalCount', + 'suggest.current', + 'suc', + 'suggestCurrent', + 'suggest.time', + 'suti', + 'suggestTime', + 'suggest.total', + 'suto', + 'suggestTotal', + 'uptime', + 'u', + 'version', + 'v' + ]), + z.string() +]); + +export const cat_types_cat_node_columns = z.union([ + cat_types_cat_node_column, + z.array(cat_types_cat_node_column) +]); + +export const cat_nodes_nodes_record = z.object({ + id: z.optional(types_id), + pid: z.optional(z.string().register(z.globalRegistry, { + description: 'The process identifier.' + })), + ip: z.optional(z.string().register(z.globalRegistry, { + description: 'The IP address.' + })), + port: z.optional(z.string().register(z.globalRegistry, { + description: 'The bound transport port.' + })), + http_address: z.optional(z.string().register(z.globalRegistry, { + description: 'The bound HTTP address.' + })), + version: z.optional(types_version_string), + flavor: z.optional(z.string().register(z.globalRegistry, { + description: 'The Elasticsearch distribution flavor.' + })), + type: z.optional(z.string().register(z.globalRegistry, { + description: 'The Elasticsearch distribution type.' + })), + build: z.optional(z.string().register(z.globalRegistry, { + description: 'The Elasticsearch build hash.' + })), + jdk: z.optional(z.string().register(z.globalRegistry, { + description: 'The Java version.' + })), + 'disk.total': z.optional(types_byte_size), + 'disk.used': z.optional(types_byte_size), + 'disk.avail': z.optional(types_byte_size), + 'disk.used_percent': z.optional(types_percentage), + 'heap.current': z.optional(z.string().register(z.globalRegistry, { + description: 'The used heap.' + })), + 'heap.percent': z.optional(types_percentage), + 'heap.max': z.optional(z.string().register(z.globalRegistry, { + description: 'The maximum configured heap.' + })), + 'ram.current': z.optional(z.string().register(z.globalRegistry, { + description: 'The used machine memory.' + })), + 'ram.percent': z.optional(types_percentage), + 'ram.max': z.optional(z.string().register(z.globalRegistry, { + description: 'The total machine memory.' + })), + 'file_desc.current': z.optional(z.string().register(z.globalRegistry, { + description: 'The used file descriptors.' + })), + 'file_desc.percent': z.optional(types_percentage), + 'file_desc.max': z.optional(z.string().register(z.globalRegistry, { + description: 'The maximum number of file descriptors.' + })), + cpu: z.optional(z.string().register(z.globalRegistry, { + description: 'The recent system CPU usage as a percentage.' + })), + load_1m: z.optional(z.string().register(z.globalRegistry, { + description: 'The load average for the most recent minute.' + })), + load_5m: z.optional(z.string().register(z.globalRegistry, { + description: 'The load average for the last five minutes.' + })), + load_15m: z.optional(z.string().register(z.globalRegistry, { + description: 'The load average for the last fifteen minutes.' + })), + available_processors: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of available processors (logical CPU cores available to the JVM).' + })), + uptime: z.optional(z.string().register(z.globalRegistry, { + description: 'The node uptime.' + })), + 'node.role': z.optional(z.string().register(z.globalRegistry, { + description: 'The roles of the node.\nReturned values include `c`(cold node), `d`(data node), `f`(frozen node), `h`(hot node), `i`(ingest node), `l`(machine learning node), `m` (master eligible node), `r`(remote cluster client node), `s`(content node), `t`(transform node), `v`(voting-only node), `w`(warm node),and `-`(coordinating node only).' + })), + master: z.optional(z.string().register(z.globalRegistry, { + description: 'Indicates whether the node is the elected master node.\nReturned values include `*`(elected master) and `-`(not elected master).' + })), + name: z.optional(types_name), + 'completion.size': z.optional(z.string().register(z.globalRegistry, { + description: 'The size of completion.' + })), + 'fielddata.memory_size': z.optional(z.string().register(z.globalRegistry, { + description: 'The used fielddata cache.' + })), + 'fielddata.evictions': z.optional(z.string().register(z.globalRegistry, { + description: 'The fielddata evictions.' + })), + 'query_cache.memory_size': z.optional(z.string().register(z.globalRegistry, { + description: 'The used query cache.' + })), + 'query_cache.evictions': z.optional(z.string().register(z.globalRegistry, { + description: 'The query cache evictions.' + })), + 'query_cache.hit_count': z.optional(z.string().register(z.globalRegistry, { + description: 'The query cache hit counts.' + })), + 'query_cache.miss_count': z.optional(z.string().register(z.globalRegistry, { + description: 'The query cache miss counts.' + })), + 'request_cache.memory_size': z.optional(z.string().register(z.globalRegistry, { + description: 'The used request cache.' + })), + 'request_cache.evictions': z.optional(z.string().register(z.globalRegistry, { + description: 'The request cache evictions.' + })), + 'request_cache.hit_count': z.optional(z.string().register(z.globalRegistry, { + description: 'The request cache hit counts.' + })), + 'request_cache.miss_count': z.optional(z.string().register(z.globalRegistry, { + description: 'The request cache miss counts.' + })), + 'flush.total': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of flushes.' + })), + 'flush.total_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in flush.' + })), + 'get.current': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of current get ops.' + })), + 'get.time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in get.' + })), + 'get.total': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of get ops.' + })), + 'get.exists_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in successful gets.' + })), + 'get.exists_total': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of successful get operations.' + })), + 'get.missing_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in failed gets.' + })), + 'get.missing_total': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of failed gets.' + })), + 'indexing.delete_current': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of current deletions.' + })), + 'indexing.delete_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in deletions.' + })), + 'indexing.delete_total': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of delete operations.' + })), + 'indexing.index_current': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of current indexing operations.' + })), + 'indexing.index_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in indexing.' + })), + 'indexing.index_total': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of indexing operations.' + })), + 'indexing.index_failed': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of failed indexing operations.' + })), + 'merges.current': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of current merges.' + })), + 'merges.current_docs': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of current merging docs.' + })), + 'merges.current_size': z.optional(z.string().register(z.globalRegistry, { + description: 'The size of current merges.' + })), + 'merges.total': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of completed merge operations.' + })), + 'merges.total_docs': z.optional(z.string().register(z.globalRegistry, { + description: 'The docs merged.' + })), + 'merges.total_size': z.optional(z.string().register(z.globalRegistry, { + description: 'The size merged.' + })), + 'merges.total_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in merges.' + })), + 'refresh.total': z.optional(z.string().register(z.globalRegistry, { + description: 'The total refreshes.' + })), + 'refresh.time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in refreshes.' + })), + 'refresh.external_total': z.optional(z.string().register(z.globalRegistry, { + description: 'The total external refreshes.' + })), + 'refresh.external_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in external refreshes.' + })), + 'refresh.listeners': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of pending refresh listeners.' + })), + 'script.compilations': z.optional(z.string().register(z.globalRegistry, { + description: 'The total script compilations.' + })), + 'script.cache_evictions': z.optional(z.string().register(z.globalRegistry, { + description: 'The total compiled scripts evicted from the cache.' + })), + 'script.compilation_limit_triggered': z.optional(z.string().register(z.globalRegistry, { + description: 'The script cache compilation limit triggered.' + })), + 'search.fetch_current': z.optional(z.string().register(z.globalRegistry, { + description: 'The current fetch phase operations.' + })), + 'search.fetch_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in fetch phase.' + })), + 'search.fetch_total': z.optional(z.string().register(z.globalRegistry, { + description: 'The total fetch operations.' + })), + 'search.open_contexts': z.optional(z.string().register(z.globalRegistry, { + description: 'The open search contexts.' + })), + 'search.query_current': z.optional(z.string().register(z.globalRegistry, { + description: 'The current query phase operations.' + })), + 'search.query_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in query phase.' + })), + 'search.query_total': z.optional(z.string().register(z.globalRegistry, { + description: 'The total query phase operations.' + })), + 'search.scroll_current': z.optional(z.string().register(z.globalRegistry, { + description: 'The open scroll contexts.' + })), + 'search.scroll_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time scroll contexts held open.' + })), + 'search.scroll_total': z.optional(z.string().register(z.globalRegistry, { + description: 'The completed scroll contexts.' + })), + 'segments.count': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of segments.' + })), + 'segments.memory': z.optional(z.string().register(z.globalRegistry, { + description: 'The memory used by segments.' + })), + 'segments.index_writer_memory': z.optional(z.string().register(z.globalRegistry, { + description: 'The memory used by the index writer.' + })), + 'segments.version_map_memory': z.optional(z.string().register(z.globalRegistry, { + description: 'The memory used by the version map.' + })), + 'segments.fixed_bitset_memory': z.optional(z.string().register(z.globalRegistry, { + description: 'The memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent fields.' + })), + 'suggest.current': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of current suggest operations.' + })), + 'suggest.time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spend in suggest.' + })), + 'suggest.total': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of suggest operations.' + })), + 'bulk.total_operations': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of bulk shard operations.' + })), + 'bulk.total_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spend in shard bulk.' + })), + 'bulk.total_size_in_bytes': z.optional(z.string().register(z.globalRegistry, { + description: 'The total size in bytes of shard bulk.' + })), + 'bulk.avg_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The average time spend in shard bulk.' + })), + 'bulk.avg_size_in_bytes': z.optional(z.string().register(z.globalRegistry, { + description: 'The average size in bytes of shard bulk.' + })) +}); + +export const cat_types_cat_pending_tasks_column = z.union([ + z.enum([ + 'insertOrder', + 'o', + 'timeInQueue', + 't', + 'priority', + 'p', + 'source', + 's' + ]), + z.string() +]); + +export const cat_types_cat_pending_tasks_columns = z.union([ + cat_types_cat_pending_tasks_column, + z.array(cat_types_cat_pending_tasks_column) +]); + +export const cat_pending_tasks_pending_tasks_record = z.object({ + insertOrder: z.optional(z.string().register(z.globalRegistry, { + description: 'The task insertion order.' + })), + timeInQueue: z.optional(z.string().register(z.globalRegistry, { + description: 'Indicates how long the task has been in queue.' + })), + priority: z.optional(z.string().register(z.globalRegistry, { + description: 'The task priority.' + })), + source: z.optional(z.string().register(z.globalRegistry, { + description: 'The task source.' + })) +}); + +export const cat_types_cat_plugins_column = z.union([ + z.enum([ + 'id', + 'name', + 'n', + 'component', + 'c', + 'version', + 'v', + 'description', + 'd' + ]), + z.string() +]); + +export const cat_types_cat_plugins_columns = z.union([ + cat_types_cat_plugins_column, + z.array(cat_types_cat_plugins_column) +]); + +export const cat_plugins_plugins_record = z.object({ + id: z.optional(types_node_id), + name: z.optional(types_name), + component: z.optional(z.string().register(z.globalRegistry, { + description: 'The component name.' + })), + version: z.optional(types_version_string), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'The plugin details.' + })), + type: z.optional(z.string().register(z.globalRegistry, { + description: 'The plugin type.' + })) +}); + +export const cat_types_cat_recovery_column = z.union([ + z.enum([ + 'index', + 'i', + 'idx', + 'shard', + 's', + 'sh', + 'start_time', + 'start', + 'start_time_millis', + 'start_millis', + 'stop_time', + 'stop', + 'stop_time_millis', + 'stop_millis', + 'time', + 't', + 'ti', + 'type', + 'ty', + 'stage', + 'st', + 'source_host', + 'shost', + 'source_node', + 'snode', + 'target_host', + 'thost', + 'target_node', + 'tnode', + 'repository', + 'rep', + 'snapshot', + 'snap', + 'files', + 'f', + 'files_recovered', + 'fr', + 'files_percent', + 'fp', + 'files_total', + 'tf', + 'bytes', + 'b', + 'bytes_recovered', + 'br', + 'bytes_percent', + 'bp', + 'bytes_total', + 'tb', + 'translog_ops', + 'to', + 'translog_ops_recovered', + 'tor', + 'translog_ops_percent', + 'top' + ]), + z.string() +]); + +export const cat_types_cat_recovery_columns = z.union([ + cat_types_cat_recovery_column, + z.array(cat_types_cat_recovery_column) +]); + +export const cat_recovery_recovery_record = z.object({ + index: z.optional(types_index_name), + shard: z.optional(z.string().register(z.globalRegistry, { + description: 'The shard name.' + })), + start_time: z.optional(types_date_time), + start_time_millis: z.optional(types_epoch_time_unit_millis), + stop_time: z.optional(types_date_time), + stop_time_millis: z.optional(types_epoch_time_unit_millis), + time: z.optional(types_duration), + type: z.optional(z.string().register(z.globalRegistry, { + description: 'The recovery type.' + })), + stage: z.optional(z.string().register(z.globalRegistry, { + description: 'The recovery stage.' + })), + source_host: z.optional(z.string().register(z.globalRegistry, { + description: 'The source host.' + })), + source_node: z.optional(z.string().register(z.globalRegistry, { + description: 'The source node name.' + })), + target_host: z.optional(z.string().register(z.globalRegistry, { + description: 'The target host.' + })), + target_node: z.optional(z.string().register(z.globalRegistry, { + description: 'The target node name.' + })), + repository: z.optional(z.string().register(z.globalRegistry, { + description: 'The repository name.' + })), + snapshot: z.optional(z.string().register(z.globalRegistry, { + description: 'The snapshot name.' + })), + files: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of files to recover.' + })), + files_recovered: z.optional(z.string().register(z.globalRegistry, { + description: 'The files recovered.' + })), + files_percent: z.optional(types_percentage), + files_total: z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of files.' + })), + bytes: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of bytes to recover.' + })), + bytes_recovered: z.optional(z.string().register(z.globalRegistry, { + description: 'The bytes recovered.' + })), + bytes_percent: z.optional(types_percentage), + bytes_total: z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of bytes.' + })), + translog_ops: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of translog operations to recover.' + })), + translog_ops_recovered: z.optional(z.string().register(z.globalRegistry, { + description: 'The translog operations recovered.' + })), + translog_ops_percent: z.optional(types_percentage) +}); + +export const cat_repositories_repositories_record = z.object({ + id: z.optional(z.string().register(z.globalRegistry, { + description: 'The unique repository identifier.' + })), + type: z.optional(z.string().register(z.globalRegistry, { + description: 'The repository type.' + })) +}); + +export const cat_types_cat_segments_column = z.union([ + z.enum([ + 'index', + 'i', + 'idx', + 'shard', + 's', + 'sh', + 'prirep', + 'p', + 'pr', + 'primaryOrReplica', + 'ip', + 'segment', + 'generation', + 'docs.count', + 'docs.deleted', + 'size', + 'size.memory', + 'committed', + 'searchable', + 'version', + 'compound', + 'id' + ]), + z.string() +]); + +export const cat_types_cat_segments_columns = z.union([ + cat_types_cat_segments_column, + z.array(cat_types_cat_segments_column) +]); + +export const cat_segments_segments_record = z.object({ + index: z.optional(types_index_name), + shard: z.optional(z.string().register(z.globalRegistry, { + description: 'The shard name.' + })), + prirep: z.optional(z.string().register(z.globalRegistry, { + description: 'The shard type: `primary` or `replica`.' + })), + ip: z.optional(z.string().register(z.globalRegistry, { + description: 'The IP address of the node where it lives.' + })), + id: z.optional(types_node_id), + segment: z.optional(z.string().register(z.globalRegistry, { + description: 'The segment name, which is derived from the segment generation and used internally to create file names in the directory of the shard.' + })), + generation: z.optional(z.string().register(z.globalRegistry, { + description: 'The segment generation number.\nElasticsearch increments this generation number for each segment written then uses this number to derive the segment name.' + })), + 'docs.count': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of documents in the segment.\nThis excludes deleted documents and counts any nested documents separately from their parents.\nIt also excludes documents which were indexed recently and do not yet belong to a segment.' + })), + 'docs.deleted': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of deleted documents in the segment, which might be higher or lower than the number of delete operations you have performed.\nThis number excludes deletes that were performed recently and do not yet belong to a segment.\nDeleted documents are cleaned up by the automatic merge process if it makes sense to do so.\nAlso, Elasticsearch creates extra deleted documents to internally track the recent history of operations on a shard.' + })), + size: z.optional(types_byte_size), + 'size.memory': z.optional(types_byte_size), + committed: z.optional(z.string().register(z.globalRegistry, { + description: 'If `true`, the segment is synced to disk.\nSegments that are synced can survive a hard reboot.\nIf `false`, the data from uncommitted segments is also stored in the transaction log so that Elasticsearch is able to replay changes on the next start.' + })), + searchable: z.optional(z.string().register(z.globalRegistry, { + description: 'If `true`, the segment is searchable.\nIf `false`, the segment has most likely been written to disk but needs a refresh to be searchable.' + })), + version: z.optional(types_version_string), + compound: z.optional(z.string().register(z.globalRegistry, { + description: 'If `true`, the segment is stored in a compound file.\nThis means Lucene merged all files from the segment in a single file to save file descriptors.' + })) +}); + +export const cat_types_cat_shard_column = z.union([ + z.enum([ + 'completion.size', + 'cs', + 'completionSize', + 'dataset.size', + 'dense_vector.value_count', + 'dvc', + 'denseVectorCount', + 'docs', + 'd', + 'dc', + 'fielddata.evictions', + 'fe', + 'fielddataEvictions', + 'fielddata.memory_size', + 'fm', + 'fielddataMemory', + 'flush.total', + 'ft', + 'flushTotal', + 'flush.total_time', + 'ftt', + 'flushTotalTime', + 'get.current', + 'gc', + 'getCurrent', + 'get.exists_time', + 'geti', + 'getExistsTime', + 'get.exists_total', + 'geto', + 'getExistsTotal', + 'get.missing_time', + 'gmti', + 'getMissingTime', + 'get.missing_total', + 'gmto', + 'getMissingTotal', + 'get.time', + 'gti', + 'getTime', + 'get.total', + 'gto', + 'getTotal', + 'id', + 'index', + 'i', + 'idx', + 'indexing.delete_current', + 'idc', + 'indexingDeleteCurrent', + 'indexing.delete_time', + 'idti', + 'indexingDeleteTime', + 'indexing.delete_total', + 'idto', + 'indexingDeleteTotal', + 'indexing.index_current', + 'iic', + 'indexingIndexCurrent', + 'indexing.index_failed_due_to_version_conflict', + 'iifvc', + 'indexingIndexFailedDueToVersionConflict', + 'indexing.index_failed', + 'iif', + 'indexingIndexFailed', + 'indexing.index_time', + 'iiti', + 'indexingIndexTime', + 'indexing.index_total', + 'iito', + 'indexingIndexTotal', + 'ip', + 'merges.current', + 'mc', + 'mergesCurrent', + 'merges.current_docs', + 'mcd', + 'mergesCurrentDocs', + 'merges.current_size', + 'mcs', + 'mergesCurrentSize', + 'merges.total', + 'mt', + 'mergesTotal', + 'merges.total_docs', + 'mtd', + 'mergesTotalDocs', + 'merges.total_size', + 'mts', + 'mergesTotalSize', + 'merges.total_time', + 'mtt', + 'mergesTotalTime', + 'node', + 'n', + 'prirep', + 'p', + 'pr', + 'primaryOrReplica', + 'query_cache.evictions', + 'qce', + 'queryCacheEvictions', + 'query_cache.memory_size', + 'qcm', + 'queryCacheMemory', + 'recoverysource.type', + 'rs', + 'refresh.time', + 'rti', + 'refreshTime', + 'refresh.total', + 'rto', + 'refreshTotal', + 'search.fetch_current', + 'sfc', + 'searchFetchCurrent', + 'search.fetch_time', + 'sfti', + 'searchFetchTime', + 'search.fetch_total', + 'sfto', + 'searchFetchTotal', + 'search.open_contexts', + 'so', + 'searchOpenContexts', + 'search.query_current', + 'sqc', + 'searchQueryCurrent', + 'search.query_time', + 'sqti', + 'searchQueryTime', + 'search.query_total', + 'sqto', + 'searchQueryTotal', + 'search.scroll_current', + 'scc', + 'searchScrollCurrent', + 'search.scroll_time', + 'scti', + 'searchScrollTime', + 'search.scroll_total', + 'scto', + 'searchScrollTotal', + 'segments.count', + 'sc', + 'segmentsCount', + 'segments.fixed_bitset_memory', + 'sfbm', + 'fixedBitsetMemory', + 'segments.index_writer_memory', + 'siwm', + 'segmentsIndexWriterMemory', + 'segments.memory', + 'sm', + 'segmentsMemory', + 'segments.version_map_memory', + 'svmm', + 'segmentsVersionMapMemory', + 'seq_no.global_checkpoint', + 'sqg', + 'globalCheckpoint', + 'seq_no.local_checkpoint', + 'sql', + 'localCheckpoint', + 'seq_no.max', + 'sqm', + 'maxSeqNo', + 'shard', + 's', + 'sh', + 'dsparse_vector.value_count', + 'svc', + 'sparseVectorCount', + 'state', + 'st', + 'store', + 'sto', + 'suggest.current', + 'suc', + 'suggestCurrent', + 'suggest.time', + 'suti', + 'suggestTime', + 'suggest.total', + 'suto', + 'suggestTotal', + 'sync_id', + 'unassigned.at', + 'ua', + 'unassigned.details', + 'ud', + 'unassigned.for', + 'uf', + 'unassigned.reason', + 'ur' + ]), + z.string() +]); + +export const cat_types_cat_shard_columns = z.union([ + cat_types_cat_shard_column, + z.array(cat_types_cat_shard_column) +]); + +export const cat_shards_shards_record = z.object({ + index: z.optional(z.string().register(z.globalRegistry, { + description: 'The index name.' + })), + shard: z.optional(z.string().register(z.globalRegistry, { + description: 'The shard name.' + })), + prirep: z.optional(z.string().register(z.globalRegistry, { + description: 'The shard type: `primary` or `replica`.' + })), + state: z.optional(z.string().register(z.globalRegistry, { + description: 'The shard state.\nReturned values include:\n`INITIALIZING`: The shard is recovering from a peer shard or gateway.\n`RELOCATING`: The shard is relocating.\n`STARTED`: The shard has started.\n`UNASSIGNED`: The shard is not assigned to any node.' + })), + docs: z.optional(z.union([ + z.string(), + z.null() + ])), + store: z.optional(z.union([ + z.string(), + z.null() + ])), + dataset: z.optional(z.union([ + z.string(), + z.null() + ])), + ip: z.optional(z.union([ + z.string(), + z.null() + ])), + id: z.optional(z.string().register(z.globalRegistry, { + description: 'The unique identifier for the node.' + })), + node: z.optional(z.union([ + z.string(), + z.null() + ])), + sync_id: z.optional(z.string().register(z.globalRegistry, { + description: 'The sync identifier.' + })), + 'unassigned.reason': z.optional(z.string().register(z.globalRegistry, { + description: 'The reason for the last change to the state of an unassigned shard.\nIt does not explain why the shard is currently unassigned; use the cluster allocation explain API for that information.\nReturned values include:\n`ALLOCATION_FAILED`: Unassigned as a result of a failed allocation of the shard.\n`CLUSTER_RECOVERED`: Unassigned as a result of a full cluster recovery.\n`DANGLING_INDEX_IMPORTED`: Unassigned as a result of importing a dangling index.\n`EXISTING_INDEX_RESTORED`: Unassigned as a result of restoring into a closed index.\n`FORCED_EMPTY_PRIMARY`: The shard’s allocation was last modified by forcing an empty primary using the cluster reroute API.\n`INDEX_CLOSED`: Unassigned because the index was closed.\n`INDEX_CREATED`: Unassigned as a result of an API creation of an index.\n`INDEX_REOPENED`: Unassigned as a result of opening a closed index.\n`MANUAL_ALLOCATION`: The shard’s allocation was last modified by the cluster reroute API.\n`NEW_INDEX_RESTORED`: Unassigned as a result of restoring into a new index.\n`NODE_LEFT`: Unassigned as a result of the node hosting it leaving the cluster.\n`NODE_RESTARTING`: Similar to `NODE_LEFT`, except that the node was registered as restarting using the node shutdown API.\n`PRIMARY_FAILED`: The shard was initializing as a replica, but the primary shard failed before the initialization completed.\n`REALLOCATED_REPLICA`: A better replica location is identified and causes the existing replica allocation to be cancelled.\n`REINITIALIZED`: When a shard moves from started back to initializing.\n`REPLICA_ADDED`: Unassigned as a result of explicit addition of a replica.\n`REROUTE_CANCELLED`: Unassigned as a result of explicit cancel reroute command.' + })), + 'unassigned.at': z.optional(z.string().register(z.globalRegistry, { + description: 'The time at which the shard became unassigned in Coordinated Universal Time (UTC).' + })), + 'unassigned.for': z.optional(z.string().register(z.globalRegistry, { + description: 'The time at which the shard was requested to be unassigned in Coordinated Universal Time (UTC).' + })), + 'unassigned.details': z.optional(z.string().register(z.globalRegistry, { + description: 'Additional details as to why the shard became unassigned.\nIt does not explain why the shard is not assigned; use the cluster allocation explain API for that information.' + })), + 'recoverysource.type': z.optional(z.string().register(z.globalRegistry, { + description: 'The type of recovery source.' + })), + 'completion.size': z.optional(z.string().register(z.globalRegistry, { + description: 'The size of completion.' + })), + 'fielddata.memory_size': z.optional(z.string().register(z.globalRegistry, { + description: 'The used fielddata cache memory.' + })), + 'fielddata.evictions': z.optional(z.string().register(z.globalRegistry, { + description: 'The fielddata cache evictions.' + })), + 'query_cache.memory_size': z.optional(z.string().register(z.globalRegistry, { + description: 'The used query cache memory.' + })), + 'query_cache.evictions': z.optional(z.string().register(z.globalRegistry, { + description: 'The query cache evictions.' + })), + 'flush.total': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of flushes.' + })), + 'flush.total_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in flush.' + })), + 'get.current': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of current get operations.' + })), + 'get.time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in get operations.' + })), + 'get.total': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of get operations.' + })), + 'get.exists_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in successful get operations.' + })), + 'get.exists_total': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of successful get operations.' + })), + 'get.missing_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in failed get operations.' + })), + 'get.missing_total': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of failed get operations.' + })), + 'indexing.delete_current': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of current deletion operations.' + })), + 'indexing.delete_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in deletion operations.' + })), + 'indexing.delete_total': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of delete operations.' + })), + 'indexing.index_current': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of current indexing operations.' + })), + 'indexing.index_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in indexing operations.' + })), + 'indexing.index_total': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of indexing operations.' + })), + 'indexing.index_failed': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of failed indexing operations.' + })), + 'merges.current': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of current merge operations.' + })), + 'merges.current_docs': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of current merging documents.' + })), + 'merges.current_size': z.optional(z.string().register(z.globalRegistry, { + description: 'The size of current merge operations.' + })), + 'merges.total': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of completed merge operations.' + })), + 'merges.total_docs': z.optional(z.string().register(z.globalRegistry, { + description: 'The nuber of merged documents.' + })), + 'merges.total_size': z.optional(z.string().register(z.globalRegistry, { + description: 'The size of current merges.' + })), + 'merges.total_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent merging documents.' + })), + 'refresh.total': z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of refreshes.' + })), + 'refresh.time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in refreshes.' + })), + 'refresh.external_total': z.optional(z.string().register(z.globalRegistry, { + description: 'The total nunber of external refreshes.' + })), + 'refresh.external_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in external refreshes.' + })), + 'refresh.listeners': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of pending refresh listeners.' + })), + 'search.fetch_current': z.optional(z.string().register(z.globalRegistry, { + description: 'The current fetch phase operations.' + })), + 'search.fetch_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in fetch phase.' + })), + 'search.fetch_total': z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of fetch operations.' + })), + 'search.open_contexts': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of open search contexts.' + })), + 'search.query_current': z.optional(z.string().register(z.globalRegistry, { + description: 'The current query phase operations.' + })), + 'search.query_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in query phase.' + })), + 'search.query_total': z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of query phase operations.' + })), + 'search.scroll_current': z.optional(z.string().register(z.globalRegistry, { + description: 'The open scroll contexts.' + })), + 'search.scroll_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time scroll contexts were held open.' + })), + 'search.scroll_total': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of completed scroll contexts.' + })), + 'segments.count': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of segments.' + })), + 'segments.memory': z.optional(z.string().register(z.globalRegistry, { + description: 'The memory used by segments.' + })), + 'segments.index_writer_memory': z.optional(z.string().register(z.globalRegistry, { + description: 'The memory used by the index writer.' + })), + 'segments.version_map_memory': z.optional(z.string().register(z.globalRegistry, { + description: 'The memory used by the version map.' + })), + 'segments.fixed_bitset_memory': z.optional(z.string().register(z.globalRegistry, { + description: 'The memory used by fixed bit sets for nested object field types and export type filters for types referred in `_parent` fields.' + })), + 'seq_no.max': z.optional(z.string().register(z.globalRegistry, { + description: 'The maximum sequence number.' + })), + 'seq_no.local_checkpoint': z.optional(z.string().register(z.globalRegistry, { + description: 'The local checkpoint.' + })), + 'seq_no.global_checkpoint': z.optional(z.string().register(z.globalRegistry, { + description: 'The global checkpoint.' + })), + 'warmer.current': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of current warmer operations.' + })), + 'warmer.total': z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of warmer operations.' + })), + 'warmer.total_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in warmer operations.' + })), + 'path.data': z.optional(z.string().register(z.globalRegistry, { + description: 'The shard data path.' + })), + 'path.state': z.optional(z.string().register(z.globalRegistry, { + description: 'The shard state path.' + })), + 'bulk.total_operations': z.optional(z.string().register(z.globalRegistry, { + description: 'The number of bulk shard operations.' + })), + 'bulk.total_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The time spent in shard bulk operations.' + })), + 'bulk.total_size_in_bytes': z.optional(z.string().register(z.globalRegistry, { + description: 'The total size in bytes of shard bulk operations.' + })), + 'bulk.avg_time': z.optional(z.string().register(z.globalRegistry, { + description: 'The average time spent in shard bulk operations.' + })), + 'bulk.avg_size_in_bytes': z.optional(z.string().register(z.globalRegistry, { + description: 'The average size in bytes of shard bulk operations.' + })) +}); + +export const cat_types_cat_snapshots_column = z.union([ + z.enum([ + 'id', + 'snapshot', + 'repository', + 're', + 'repo', + 'status', + 's', + 'start_epoch', + 'ste', + 'startEpoch', + 'start_time', + 'sti', + 'startTime', + 'end_epoch', + 'ete', + 'endEpoch', + 'end_time', + 'eti', + 'endTime', + 'duration', + 'dur', + 'indices', + 'i', + 'successful_shards', + 'ss', + 'failed_shards', + 'fs', + 'total_shards', + 'ts', + 'reason', + 'r' + ]), + z.string() ]); export const cat_types_cat_snapshots_columns = z.union([ - cat_types_cat_snapshots_column, - z.array(cat_types_cat_snapshots_column), + cat_types_cat_snapshots_column, + z.array(cat_types_cat_snapshots_column) ]); export const watcher_types_hour_and_minute = z.object({ - hour: z.array(z.number()), - minute: z.array(z.number()), + hour: z.array(z.number()), + minute: z.array(z.number()) }); /** * A time of day, expressed either as `hh:mm`, `noon`, `midnight`, or an hour/minutes structure. */ export const watcher_types_schedule_time_of_day = z.union([ - z.string(), - watcher_types_hour_and_minute, + z.string(), + watcher_types_hour_and_minute ]); export const cat_snapshots_snapshots_record = z.object({ - id: z.optional( - z.string().register(z.globalRegistry, { - description: 'The unique identifier for the snapshot.', - }) - ), - repository: z.optional( - z.string().register(z.globalRegistry, { - description: 'The repository name.', - }) - ), - status: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The state of the snapshot process.\nReturned values include:\n`FAILED`: The snapshot process failed.\n`INCOMPATIBLE`: The snapshot process is incompatible with the current cluster version.\n`IN_PROGRESS`: The snapshot process started but has not completed.\n`PARTIAL`: The snapshot process completed with a partial success.\n`SUCCESS`: The snapshot process completed with a full success.', - }) - ), - start_epoch: z.optional(spec_utils_stringified_epoch_time_unit_seconds), - start_time: z.optional(watcher_types_schedule_time_of_day), - end_epoch: z.optional(spec_utils_stringified_epoch_time_unit_seconds), - end_time: z.optional(types_time_of_day), - duration: z.optional(types_duration), - indices: z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of indices in the snapshot.', - }) - ), - successful_shards: z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of successful shards in the snapshot.', - }) - ), - failed_shards: z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of failed shards in the snapshot.', - }) - ), - total_shards: z.optional( - z.string().register(z.globalRegistry, { - description: 'The total number of shards in the snapshot.', - }) - ), - reason: z.optional( - z.string().register(z.globalRegistry, { - description: 'The reason for any snapshot failures.', - }) - ), + id: z.optional(z.string().register(z.globalRegistry, { + description: 'The unique identifier for the snapshot.' + })), + repository: z.optional(z.string().register(z.globalRegistry, { + description: 'The repository name.' + })), + status: z.optional(z.string().register(z.globalRegistry, { + description: 'The state of the snapshot process.\nReturned values include:\n`FAILED`: The snapshot process failed.\n`INCOMPATIBLE`: The snapshot process is incompatible with the current cluster version.\n`IN_PROGRESS`: The snapshot process started but has not completed.\n`PARTIAL`: The snapshot process completed with a partial success.\n`SUCCESS`: The snapshot process completed with a full success.' + })), + start_epoch: z.optional(spec_utils_stringified_epoch_time_unit_seconds), + start_time: z.optional(watcher_types_schedule_time_of_day), + end_epoch: z.optional(spec_utils_stringified_epoch_time_unit_seconds), + end_time: z.optional(types_time_of_day), + duration: z.optional(types_duration), + indices: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of indices in the snapshot.' + })), + successful_shards: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of successful shards in the snapshot.' + })), + failed_shards: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of failed shards in the snapshot.' + })), + total_shards: z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of shards in the snapshot.' + })), + reason: z.optional(z.string().register(z.globalRegistry, { + description: 'The reason for any snapshot failures.' + })) }); export const cat_types_cat_tasks_column = z.union([ - z.enum([ - 'id', - 'action', - 'ac', - 'task_id', - 'ti', - 'parent_task_id', - 'pti', - 'type', - 'ty', - 'start_time', - 'start', - 'timestamp', - 'ts', - 'hms', - 'hhmmss', - 'running_time_ns', - 'time', - 'running_time', - 'time', - 'node_id', - 'ni', - 'ip', - 'i', - 'port', - 'po', - 'node', - 'n', - 'version', - 'v', - 'x_opaque_id', - 'x', - ]), - z.string(), + z.enum([ + 'id', + 'action', + 'ac', + 'task_id', + 'ti', + 'parent_task_id', + 'pti', + 'type', + 'ty', + 'start_time', + 'start', + 'timestamp', + 'ts', + 'hms', + 'hhmmss', + 'running_time_ns', + 'time', + 'running_time', + 'time', + 'node_id', + 'ni', + 'ip', + 'i', + 'port', + 'po', + 'node', + 'n', + 'version', + 'v', + 'x_opaque_id', + 'x' + ]), + z.string() ]); export const cat_types_cat_tasks_columns = z.union([ - cat_types_cat_tasks_column, - z.array(cat_types_cat_tasks_column), + cat_types_cat_tasks_column, + z.array(cat_types_cat_tasks_column) ]); export const cat_tasks_tasks_record = z.object({ - id: z.optional(types_id), - action: z.optional( - z.string().register(z.globalRegistry, { - description: 'The task action.', - }) - ), - task_id: z.optional(types_id), - parent_task_id: z.optional( - z.string().register(z.globalRegistry, { - description: 'The parent task identifier.', - }) - ), - type: z.optional( - z.string().register(z.globalRegistry, { - description: 'The task type.', - }) - ), - start_time: z.optional( - z.string().register(z.globalRegistry, { - description: 'The start time in milliseconds.', - }) - ), - timestamp: z.optional( - z.string().register(z.globalRegistry, { - description: 'The start time in `HH:MM:SS` format.', - }) - ), - running_time_ns: z.optional( - z.string().register(z.globalRegistry, { - description: 'The running time in nanoseconds.', - }) - ), - running_time: z.optional( - z.string().register(z.globalRegistry, { - description: 'The running time.', - }) - ), - node_id: z.optional(types_node_id), - ip: z.optional( - z.string().register(z.globalRegistry, { - description: 'The IP address for the node.', - }) - ), - port: z.optional( - z.string().register(z.globalRegistry, { - description: 'The bound transport port for the node.', - }) - ), - node: z.optional( - z.string().register(z.globalRegistry, { - description: 'The node name.', - }) - ), - version: z.optional(types_version_string), - x_opaque_id: z.optional( - z.string().register(z.globalRegistry, { - description: 'The X-Opaque-ID header.', - }) - ), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'The task action description.', - }) - ), + id: z.optional(types_id), + action: z.optional(z.string().register(z.globalRegistry, { + description: 'The task action.' + })), + task_id: z.optional(types_id), + parent_task_id: z.optional(z.string().register(z.globalRegistry, { + description: 'The parent task identifier.' + })), + type: z.optional(z.string().register(z.globalRegistry, { + description: 'The task type.' + })), + start_time: z.optional(z.string().register(z.globalRegistry, { + description: 'The start time in milliseconds.' + })), + timestamp: z.optional(z.string().register(z.globalRegistry, { + description: 'The start time in `HH:MM:SS` format.' + })), + running_time_ns: z.optional(z.string().register(z.globalRegistry, { + description: 'The running time in nanoseconds.' + })), + running_time: z.optional(z.string().register(z.globalRegistry, { + description: 'The running time.' + })), + node_id: z.optional(types_node_id), + ip: z.optional(z.string().register(z.globalRegistry, { + description: 'The IP address for the node.' + })), + port: z.optional(z.string().register(z.globalRegistry, { + description: 'The bound transport port for the node.' + })), + node: z.optional(z.string().register(z.globalRegistry, { + description: 'The node name.' + })), + version: z.optional(types_version_string), + x_opaque_id: z.optional(z.string().register(z.globalRegistry, { + description: 'The X-Opaque-ID header.' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'The task action description.' + })) }); export const cat_types_cat_templates_column = z.union([ - z.enum([ - 'name', - 'n', - 'index_patterns', - 't', - 'order', - 'o', - 'p', - 'version', - 'v', - 'composed_of', - 'c', - ]), - z.string(), + z.enum([ + 'name', + 'n', + 'index_patterns', + 't', + 'order', + 'o', + 'p', + 'version', + 'v', + 'composed_of', + 'c' + ]), + z.string() ]); export const cat_types_cat_templates_columns = z.union([ - cat_types_cat_templates_column, - z.array(cat_types_cat_templates_column), + cat_types_cat_templates_column, + z.array(cat_types_cat_templates_column) ]); export const cat_templates_templates_record = z.object({ - name: z.optional(types_name), - index_patterns: z.optional( - z.string().register(z.globalRegistry, { - description: 'The template index patterns.', - }) - ), - order: z.optional( - z.string().register(z.globalRegistry, { - description: 'The template application order or priority number.', - }) - ), - version: z.optional(z.union([types_version_string, z.string(), z.null()])), - composed_of: z.optional( - z.string().register(z.globalRegistry, { - description: 'The component templates that comprise the index template.', - }) - ), + name: z.optional(types_name), + index_patterns: z.optional(z.string().register(z.globalRegistry, { + description: 'The template index patterns.' + })), + order: z.optional(z.string().register(z.globalRegistry, { + description: 'The template application order or priority number.' + })), + version: z.optional(z.union([ + types_version_string, + z.string(), + z.null() + ])), + composed_of: z.optional(z.string().register(z.globalRegistry, { + description: 'The component templates that comprise the index template.' + })) }); export const cat_types_cat_thread_pool_column = z.union([ - z.enum([ - 'active', - 'a', - 'completed', - 'c', - 'core', - 'cr', - 'ephemeral_id', - 'eid', - 'host', - 'h', - 'ip', - 'i', - 'keep_alive', - 'k', - 'largest', - 'l', - 'max', - 'mx', - 'name', - 'node_id', - 'id', - 'node_name', - 'pid', - 'p', - 'pool_size', - 'psz', - 'port', - 'po', - 'queue', - 'q', - 'queue_size', - 'qs', - 'rejected', - 'r', - 'size', - 'sz', - 'type', - 't', - ]), - z.string(), + z.enum([ + 'active', + 'a', + 'completed', + 'c', + 'core', + 'cr', + 'ephemeral_id', + 'eid', + 'host', + 'h', + 'ip', + 'i', + 'keep_alive', + 'k', + 'largest', + 'l', + 'max', + 'mx', + 'name', + 'node_id', + 'id', + 'node_name', + 'pid', + 'p', + 'pool_size', + 'psz', + 'port', + 'po', + 'queue', + 'q', + 'queue_size', + 'qs', + 'rejected', + 'r', + 'size', + 'sz', + 'type', + 't' + ]), + z.string() ]); export const cat_types_cat_thread_pool_columns = z.union([ - cat_types_cat_thread_pool_column, - z.array(cat_types_cat_thread_pool_column), + cat_types_cat_thread_pool_column, + z.array(cat_types_cat_thread_pool_column) ]); export const cat_thread_pool_thread_pool_record = z.object({ - node_name: z.optional( - z.string().register(z.globalRegistry, { - description: 'The node name.', - }) - ), - node_id: z.optional(types_node_id), - ephemeral_node_id: z.optional( - z.string().register(z.globalRegistry, { - description: 'The ephemeral node identifier.', - }) - ), - pid: z.optional( - z.string().register(z.globalRegistry, { - description: 'The process identifier.', - }) - ), - host: z.optional( - z.string().register(z.globalRegistry, { - description: 'The host name for the current node.', - }) - ), - ip: z.optional( - z.string().register(z.globalRegistry, { - description: 'The IP address for the current node.', - }) - ), - port: z.optional( - z.string().register(z.globalRegistry, { - description: 'The bound transport port for the current node.', - }) - ), - name: z.optional( - z.string().register(z.globalRegistry, { - description: 'The thread pool name.', - }) - ), - type: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The thread pool type.\nReturned values include `fixed`, `fixed_auto_queue_size`, `direct`, and `scaling`.', - }) - ), - active: z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of active threads in the current thread pool.', - }) - ), - pool_size: z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of threads in the current thread pool.', - }) - ), - queue: z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of tasks currently in queue.', - }) - ), - queue_size: z.optional( - z.string().register(z.globalRegistry, { - description: 'The maximum number of tasks permitted in the queue.', - }) - ), - rejected: z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of rejected tasks.', - }) - ), - largest: z.optional( - z.string().register(z.globalRegistry, { - description: 'The highest number of active threads in the current thread pool.', - }) - ), - completed: z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of completed tasks.', - }) - ), - core: z.optional(z.union([z.string(), z.null()])), - max: z.optional(z.union([z.string(), z.null()])), - size: z.optional(z.union([z.string(), z.null()])), - keep_alive: z.optional(z.union([z.string(), z.null()])), + node_name: z.optional(z.string().register(z.globalRegistry, { + description: 'The node name.' + })), + node_id: z.optional(types_node_id), + ephemeral_node_id: z.optional(z.string().register(z.globalRegistry, { + description: 'The ephemeral node identifier.' + })), + pid: z.optional(z.string().register(z.globalRegistry, { + description: 'The process identifier.' + })), + host: z.optional(z.string().register(z.globalRegistry, { + description: 'The host name for the current node.' + })), + ip: z.optional(z.string().register(z.globalRegistry, { + description: 'The IP address for the current node.' + })), + port: z.optional(z.string().register(z.globalRegistry, { + description: 'The bound transport port for the current node.' + })), + name: z.optional(z.string().register(z.globalRegistry, { + description: 'The thread pool name.' + })), + type: z.optional(z.string().register(z.globalRegistry, { + description: 'The thread pool type.\nReturned values include `fixed`, `fixed_auto_queue_size`, `direct`, and `scaling`.' + })), + active: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of active threads in the current thread pool.' + })), + pool_size: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of threads in the current thread pool.' + })), + queue: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of tasks currently in queue.' + })), + queue_size: z.optional(z.string().register(z.globalRegistry, { + description: 'The maximum number of tasks permitted in the queue.' + })), + rejected: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of rejected tasks.' + })), + largest: z.optional(z.string().register(z.globalRegistry, { + description: 'The highest number of active threads in the current thread pool.' + })), + completed: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of completed tasks.' + })), + core: z.optional(z.union([ + z.string(), + z.null() + ])), + max: z.optional(z.union([ + z.string(), + z.null() + ])), + size: z.optional(z.union([ + z.string(), + z.null() + ])), + keep_alive: z.optional(z.union([ + z.string(), + z.null() + ])) }); export const cat_types_cat_transform_column = z.enum([ - 'changes_last_detection_time', - 'cldt', - 'checkpoint', - 'cp', - 'checkpoint_duration_time_exp_avg', - 'cdtea', - 'checkpointTimeExpAvg', - 'checkpoint_progress', - 'c', - 'checkpointProgress', - 'create_time', - 'ct', - 'createTime', - 'delete_time', - 'dtime', - 'description', - 'd', - 'dest_index', - 'di', - 'destIndex', - 'documents_deleted', - 'docd', - 'documents_indexed', - 'doci', - 'docs_per_second', - 'dps', - 'documents_processed', - 'docp', - 'frequency', - 'f', - 'id', - 'index_failure', - 'if', - 'index_time', - 'itime', - 'index_total', - 'it', - 'indexed_documents_exp_avg', - 'idea', - 'last_search_time', - 'lst', - 'lastSearchTime', - 'max_page_search_size', - 'mpsz', - 'pages_processed', - 'pp', - 'pipeline', - 'p', - 'processed_documents_exp_avg', - 'pdea', - 'processing_time', - 'pt', - 'reason', - 'r', - 'search_failure', - 'sf', - 'search_time', - 'stime', - 'search_total', - 'st', - 'source_index', - 'si', - 'sourceIndex', - 'state', - 's', - 'transform_type', - 'tt', - 'trigger_count', - 'tc', - 'version', - 'v', + 'changes_last_detection_time', + 'cldt', + 'checkpoint', + 'cp', + 'checkpoint_duration_time_exp_avg', + 'cdtea', + 'checkpointTimeExpAvg', + 'checkpoint_progress', + 'c', + 'checkpointProgress', + 'create_time', + 'ct', + 'createTime', + 'delete_time', + 'dtime', + 'description', + 'd', + 'dest_index', + 'di', + 'destIndex', + 'documents_deleted', + 'docd', + 'documents_indexed', + 'doci', + 'docs_per_second', + 'dps', + 'documents_processed', + 'docp', + 'frequency', + 'f', + 'id', + 'index_failure', + 'if', + 'index_time', + 'itime', + 'index_total', + 'it', + 'indexed_documents_exp_avg', + 'idea', + 'last_search_time', + 'lst', + 'lastSearchTime', + 'max_page_search_size', + 'mpsz', + 'pages_processed', + 'pp', + 'pipeline', + 'p', + 'processed_documents_exp_avg', + 'pdea', + 'processing_time', + 'pt', + 'reason', + 'r', + 'search_failure', + 'sf', + 'search_time', + 'stime', + 'search_total', + 'st', + 'source_index', + 'si', + 'sourceIndex', + 'state', + 's', + 'transform_type', + 'tt', + 'trigger_count', + 'tc', + 'version', + 'v' ]); export const cat_types_cat_transform_columns = z.union([ - cat_types_cat_transform_column, - z.array(cat_types_cat_transform_column), + cat_types_cat_transform_column, + z.array(cat_types_cat_transform_column) ]); export const cat_transforms_transforms_record = z.object({ - id: z.optional(types_id), - state: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The status of the transform.\nReturned values include:\n`aborting`: The transform is aborting.\n`failed: The transform failed. For more information about the failure, check the `reason` field.\n`indexing`: The transform is actively processing data and creating new documents.\n`started`: The transform is running but not actively indexing data.\n`stopped`: The transform is stopped.\n`stopping`: The transform is stopping.', - }) - ), - checkpoint: z.optional( - z.string().register(z.globalRegistry, { - description: 'The sequence number for the checkpoint.', - }) - ), - documents_processed: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of documents that have been processed from the source index of the transform.', - }) - ), - checkpoint_progress: z.optional(z.union([z.string(), z.null()])), - last_search_time: z.optional(z.union([z.string(), z.null()])), - changes_last_detection_time: z.optional(z.union([z.string(), z.null()])), - create_time: z.optional( - z.string().register(z.globalRegistry, { - description: 'The time the transform was created.', - }) - ), - version: z.optional(types_version_string), - source_index: z.optional( - z.string().register(z.globalRegistry, { - description: 'The source indices for the transform.', - }) - ), - dest_index: z.optional( - z.string().register(z.globalRegistry, { - description: 'The destination index for the transform.', - }) - ), - pipeline: z.optional( - z.string().register(z.globalRegistry, { - description: 'The unique identifier for the ingest pipeline.', - }) - ), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'The description of the transform.', - }) - ), - transform_type: z.optional( - z.string().register(z.globalRegistry, { - description: 'The type of transform: `batch` or `continuous`.', - }) - ), - frequency: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The interval between checks for changes in the source indices when the transform is running continuously.', - }) - ), - max_page_search_size: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The initial page size that is used for the composite aggregation for each checkpoint.', - }) - ), - docs_per_second: z.optional( - z.string().register(z.globalRegistry, { - description: 'The number of input documents per second.', - }) - ), - reason: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If a transform has a `failed` state, these details describe the reason for failure.', - }) - ), - search_total: z.optional( - z.string().register(z.globalRegistry, { - description: 'The total number of search operations on the source index for the transform.', - }) - ), - search_failure: z.optional( - z.string().register(z.globalRegistry, { - description: 'The total number of search failures.', - }) - ), - search_time: z.optional( - z.string().register(z.globalRegistry, { - description: 'The total amount of search time, in milliseconds.', - }) - ), - index_total: z.optional( - z.string().register(z.globalRegistry, { - description: 'The total number of index operations done by the transform.', - }) - ), - index_failure: z.optional( - z.string().register(z.globalRegistry, { - description: 'The total number of indexing failures.', - }) - ), - index_time: z.optional( - z.string().register(z.globalRegistry, { - description: 'The total time spent indexing documents, in milliseconds.', - }) - ), - documents_indexed: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of documents that have been indexed into the destination index for the transform.', - }) - ), - delete_time: z.optional( - z.string().register(z.globalRegistry, { - description: 'The total time spent deleting documents, in milliseconds.', - }) - ), - documents_deleted: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of documents deleted from the destination index due to the retention policy for the transform.', - }) - ), - trigger_count: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of times the transform has been triggered by the scheduler.\nFor example, the scheduler triggers the transform indexer to check for updates or ingest new data at an interval specified in the `frequency` property.', - }) - ), - pages_processed: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The number of search or bulk index operations processed.\nDocuments are processed in batches instead of individually.', - }) - ), - processing_time: z.optional( - z.string().register(z.globalRegistry, { - description: 'The total time spent processing results, in milliseconds.', - }) - ), - checkpoint_duration_time_exp_avg: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The exponential moving average of the duration of the checkpoint, in milliseconds.', - }) - ), - indexed_documents_exp_avg: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The exponential moving average of the number of new documents that have been indexed.', - }) - ), - processed_documents_exp_avg: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The exponential moving average of the number of documents that have been processed.', - }) - ), + id: z.optional(types_id), + state: z.optional(z.string().register(z.globalRegistry, { + description: 'The status of the transform.\nReturned values include:\n`aborting`: The transform is aborting.\n`failed: The transform failed. For more information about the failure, check the `reason` field.\n`indexing`: The transform is actively processing data and creating new documents.\n`started`: The transform is running but not actively indexing data.\n`stopped`: The transform is stopped.\n`stopping`: The transform is stopping.' + })), + checkpoint: z.optional(z.string().register(z.globalRegistry, { + description: 'The sequence number for the checkpoint.' + })), + documents_processed: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of documents that have been processed from the source index of the transform.' + })), + checkpoint_progress: z.optional(z.union([ + z.string(), + z.null() + ])), + last_search_time: z.optional(z.union([ + z.string(), + z.null() + ])), + changes_last_detection_time: z.optional(z.union([ + z.string(), + z.null() + ])), + create_time: z.optional(z.string().register(z.globalRegistry, { + description: 'The time the transform was created.' + })), + version: z.optional(types_version_string), + source_index: z.optional(z.string().register(z.globalRegistry, { + description: 'The source indices for the transform.' + })), + dest_index: z.optional(z.string().register(z.globalRegistry, { + description: 'The destination index for the transform.' + })), + pipeline: z.optional(z.string().register(z.globalRegistry, { + description: 'The unique identifier for the ingest pipeline.' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'The description of the transform.' + })), + transform_type: z.optional(z.string().register(z.globalRegistry, { + description: 'The type of transform: `batch` or `continuous`.' + })), + frequency: z.optional(z.string().register(z.globalRegistry, { + description: 'The interval between checks for changes in the source indices when the transform is running continuously.' + })), + max_page_search_size: z.optional(z.string().register(z.globalRegistry, { + description: 'The initial page size that is used for the composite aggregation for each checkpoint.' + })), + docs_per_second: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of input documents per second.' + })), + reason: z.optional(z.string().register(z.globalRegistry, { + description: 'If a transform has a `failed` state, these details describe the reason for failure.' + })), + search_total: z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of search operations on the source index for the transform.' + })), + search_failure: z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of search failures.' + })), + search_time: z.optional(z.string().register(z.globalRegistry, { + description: 'The total amount of search time, in milliseconds.' + })), + index_total: z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of index operations done by the transform.' + })), + index_failure: z.optional(z.string().register(z.globalRegistry, { + description: 'The total number of indexing failures.' + })), + index_time: z.optional(z.string().register(z.globalRegistry, { + description: 'The total time spent indexing documents, in milliseconds.' + })), + documents_indexed: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of documents that have been indexed into the destination index for the transform.' + })), + delete_time: z.optional(z.string().register(z.globalRegistry, { + description: 'The total time spent deleting documents, in milliseconds.' + })), + documents_deleted: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of documents deleted from the destination index due to the retention policy for the transform.' + })), + trigger_count: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of times the transform has been triggered by the scheduler.\nFor example, the scheduler triggers the transform indexer to check for updates or ingest new data at an interval specified in the `frequency` property.' + })), + pages_processed: z.optional(z.string().register(z.globalRegistry, { + description: 'The number of search or bulk index operations processed.\nDocuments are processed in batches instead of individually.' + })), + processing_time: z.optional(z.string().register(z.globalRegistry, { + description: 'The total time spent processing results, in milliseconds.' + })), + checkpoint_duration_time_exp_avg: z.optional(z.string().register(z.globalRegistry, { + description: 'The exponential moving average of the duration of the checkpoint, in milliseconds.' + })), + indexed_documents_exp_avg: z.optional(z.string().register(z.globalRegistry, { + description: 'The exponential moving average of the number of new documents that have been indexed.' + })), + processed_documents_exp_avg: z.optional(z.string().register(z.globalRegistry, { + description: 'The exponential moving average of the number of documents that have been processed.' + })) }); export const indices_types_retention_lease = z.object({ - period: types_duration, + period: types_duration }); export const indices_types_soft_deletes = z.object({ - enabled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Indicates whether soft deletes are enabled on the index.', - }) - ), - retention_lease: z.optional(indices_types_retention_lease), + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether soft deletes are enabled on the index.' + })), + retention_lease: z.optional(indices_types_retention_lease) }); -export const indices_types_segment_sort_order = z.enum(['asc', 'ASC', 'desc', 'DESC']); +export const indices_types_segment_sort_order = z.enum([ + 'asc', + 'ASC', + 'desc', + 'DESC' +]); -export const indices_types_segment_sort_mode = z.enum(['min', 'MIN', 'max', 'MAX']); +export const indices_types_segment_sort_mode = z.enum([ + 'min', + 'MIN', + 'max', + 'MAX' +]); export const indices_types_segment_sort_missing = z.enum(['_last', '_first']); export const indices_types_index_segment_sort = z.object({ - field: z.optional(types_fields), - order: z.optional( - z.union([indices_types_segment_sort_order, z.array(indices_types_segment_sort_order)]) - ), - mode: z.optional( - z.union([indices_types_segment_sort_mode, z.array(indices_types_segment_sort_mode)]) - ), - missing: z.optional( - z.union([indices_types_segment_sort_missing, z.array(indices_types_segment_sort_missing)]) - ), + field: z.optional(types_fields), + order: z.optional(z.union([ + indices_types_segment_sort_order, + z.array(indices_types_segment_sort_order) + ])), + mode: z.optional(z.union([ + indices_types_segment_sort_mode, + z.array(indices_types_segment_sort_mode) + ])), + missing: z.optional(z.union([ + indices_types_segment_sort_missing, + z.array(indices_types_segment_sort_missing) + ])) }); -export const indices_types_index_check_on_startup = z.enum(['true', 'false', 'checksum']); +export const indices_types_index_check_on_startup = z.enum([ + 'true', + 'false', + 'checksum' +]); /** * Some APIs will return values such as numbers also as a string (notably epoch timestamps). This behavior @@ -9390,50 +7584,56 @@ export const indices_types_index_check_on_startup = z.enum(['true', 'false', 'ch * Depending on the target language, code generators can keep the union or remove it and leniently parse * strings to the target type. */ -export const spec_utils_stringifiedinteger = z.union([z.number(), z.string()]); +export const spec_utils_stringifiedinteger = z.union([ + z.number(), + z.string() +]); /** * A `null` value that is to be interpreted as an actual value, unless other uses of `null` that are equivalent * to a missing value. It is used for exemple in settings, where using the `NullValue` for a setting will reset * it to its default value. */ -export const spec_utils_null_value = z.union([z.string(), z.null()]); +export const spec_utils_null_value = z.union([ + z.string(), + z.null() +]); export const indices_types_merge_scheduler = z.object({ - max_thread_count: z.optional(spec_utils_stringifiedinteger), - max_merge_count: z.optional(spec_utils_stringifiedinteger), + max_thread_count: z.optional(spec_utils_stringifiedinteger), + max_merge_count: z.optional(spec_utils_stringifiedinteger) }); export const indices_types_merge = z.object({ - scheduler: z.optional(indices_types_merge_scheduler), + scheduler: z.optional(indices_types_merge_scheduler) }); export const indices_types_search_idle = z.object({ - after: z.optional(types_duration), + after: z.optional(types_duration) }); export const indices_types_slowlog_treshold_levels = z.object({ - warn: z.optional(types_duration), - info: z.optional(types_duration), - debug: z.optional(types_duration), - trace: z.optional(types_duration), + warn: z.optional(types_duration), + info: z.optional(types_duration), + debug: z.optional(types_duration), + trace: z.optional(types_duration) }); export const indices_types_slowlog_tresholds = z.object({ - query: z.optional(indices_types_slowlog_treshold_levels), - fetch: z.optional(indices_types_slowlog_treshold_levels), + query: z.optional(indices_types_slowlog_treshold_levels), + fetch: z.optional(indices_types_slowlog_treshold_levels) }); export const indices_types_slowlog_settings = z.object({ - level: z.optional(z.string()), - source: z.optional(z.number()), - reformat: z.optional(z.boolean()), - threshold: z.optional(indices_types_slowlog_tresholds), + level: z.optional(z.string()), + source: z.optional(z.number()), + reformat: z.optional(z.boolean()), + threshold: z.optional(indices_types_slowlog_tresholds) }); export const indices_types_settings_search = z.object({ - idle: z.optional(indices_types_search_idle), - slowlog: z.optional(indices_types_slowlog_settings), + idle: z.optional(indices_types_search_idle), + slowlog: z.optional(indices_types_slowlog_settings) }); /** @@ -9443,96 +7643,96 @@ export const indices_types_settings_search = z.object({ * Depending on the target language, code generators can keep the union or remove it and leniently parse * strings to the target type. */ -export const spec_utils_stringifiedboolean = z.union([z.boolean(), z.string()]); +export const spec_utils_stringifiedboolean = z.union([ + z.boolean(), + z.string() +]); export const indices_types_index_setting_blocks = z.object({ - read_only: z.optional(spec_utils_stringifiedboolean), - read_only_allow_delete: z.optional(spec_utils_stringifiedboolean), - read: z.optional(spec_utils_stringifiedboolean), - write: z.optional(spec_utils_stringifiedboolean), - metadata: z.optional(spec_utils_stringifiedboolean), + read_only: z.optional(spec_utils_stringifiedboolean), + read_only_allow_delete: z.optional(spec_utils_stringifiedboolean), + read: z.optional(spec_utils_stringifiedboolean), + write: z.optional(spec_utils_stringifiedboolean), + metadata: z.optional(spec_utils_stringifiedboolean) }); export const indices_types_settings_analyze = z.object({ - max_token_count: z.optional(spec_utils_stringifiedinteger), + max_token_count: z.optional(spec_utils_stringifiedinteger) }); export const indices_types_settings_highlight = z.object({ - max_analyzed_offset: z.optional(z.number()), + max_analyzed_offset: z.optional(z.number()) }); export const indices_types_index_routing_allocation_options = z.enum([ - 'all', - 'primaries', - 'new_primaries', - 'none', + 'all', + 'primaries', + 'new_primaries', + 'none' ]); export const indices_types_index_routing_allocation_include = z.object({ - _tier_preference: z.optional(z.string()), - _id: z.optional(types_id), + _tier_preference: z.optional(z.string()), + _id: z.optional(types_id) }); export const indices_types_index_routing_allocation_initial_recovery = z.object({ - _id: z.optional(types_id), + _id: z.optional(types_id) }); export const indices_types_index_routing_allocation_disk = z.object({ - threshold_enabled: z.optional(z.union([z.boolean(), z.string()])), + threshold_enabled: z.optional(z.union([ + z.boolean(), + z.string() + ])) }); export const indices_types_index_routing_allocation = z.object({ - enable: z.optional(indices_types_index_routing_allocation_options), - include: z.optional(indices_types_index_routing_allocation_include), - initial_recovery: z.optional(indices_types_index_routing_allocation_initial_recovery), - disk: z.optional(indices_types_index_routing_allocation_disk), + enable: z.optional(indices_types_index_routing_allocation_options), + include: z.optional(indices_types_index_routing_allocation_include), + initial_recovery: z.optional(indices_types_index_routing_allocation_initial_recovery), + disk: z.optional(indices_types_index_routing_allocation_disk) }); export const indices_types_index_routing_rebalance_options = z.enum([ - 'all', - 'primaries', - 'replicas', - 'none', + 'all', + 'primaries', + 'replicas', + 'none' ]); export const indices_types_index_routing_rebalance = z.object({ - enable: indices_types_index_routing_rebalance_options, + enable: indices_types_index_routing_rebalance_options }); export const indices_types_index_routing = z.object({ - allocation: z.optional(indices_types_index_routing_allocation), - rebalance: z.optional(indices_types_index_routing_rebalance), + allocation: z.optional(indices_types_index_routing_allocation), + rebalance: z.optional(indices_types_index_routing_rebalance) }); export const types_pipeline_name = z.string(); export const indices_types_index_settings_lifecycle_step = z.object({ - wait_time_threshold: z.optional(types_duration), + wait_time_threshold: z.optional(types_duration) }); export const indices_types_index_settings_lifecycle = z.object({ - name: z.optional(types_name), - indexing_complete: z.optional(spec_utils_stringifiedboolean), - origination_date: z.optional( - z.number().register(z.globalRegistry, { - description: - 'If specified, this is the timestamp used to calculate the index age for its phase transitions. Use this setting\nif you create a new index that contains old data and want to use the original creation date to calculate the index\nage. Specified as a Unix epoch value in milliseconds.', - }) - ), - parse_origination_date: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to true to parse the origination date from the index name. This origination date is used to calculate the index age\nfor its phase transitions. The index name must match the pattern ^.*-{date_format}-\\\\d+, where the date_format is\nyyyy.MM.dd and the trailing digits are optional. An index that was rolled over would normally match the full format,\nfor example logs-2016.10.31-000002). If the index name doesn’t match the pattern, index creation fails.', - }) - ), - step: z.optional(indices_types_index_settings_lifecycle_step), - rollover_alias: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The index alias to update when the index rolls over. Specify when using a policy that contains a rollover action.\nWhen the index rolls over, the alias is updated to reflect that the index is no longer the write index. For more\ninformation about rolling indices, see Rollover.', - }) - ), - prefer_ilm: z.optional(z.union([z.boolean(), z.string()])), + name: z.optional(types_name), + indexing_complete: z.optional(spec_utils_stringifiedboolean), + origination_date: z.optional(z.number().register(z.globalRegistry, { + description: 'If specified, this is the timestamp used to calculate the index age for its phase transitions. Use this setting\nif you create a new index that contains old data and want to use the original creation date to calculate the index\nage. Specified as a Unix epoch value in milliseconds.' + })), + parse_origination_date: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to true to parse the origination date from the index name. This origination date is used to calculate the index age\nfor its phase transitions. The index name must match the pattern ^.*-{date_format}-\\\\d+, where the date_format is\nyyyy.MM.dd and the trailing digits are optional. An index that was rolled over would normally match the full format,\nfor example logs-2016.10.31-000002). If the index name doesn’t match the pattern, index creation fails.' + })), + step: z.optional(indices_types_index_settings_lifecycle_step), + rollover_alias: z.optional(z.string().register(z.globalRegistry, { + description: 'The index alias to update when the index rolls over. Specify when using a policy that contains a rollover action.\nWhen the index rolls over, the alias is updated to reflect that the index is no longer the write index. For more\ninformation about rolling indices, see Rollover.' + })), + prefer_ilm: z.optional(z.union([ + z.boolean(), + z.string() + ])) }); /** @@ -9543,1698 +7743,1227 @@ export const indices_types_index_settings_lifecycle = z.object({ * strings to the target type. */ export const spec_utils_stringified_epoch_time_unit_millis = z.union([ - types_epoch_time_unit_millis, - z.string(), + types_epoch_time_unit_millis, + z.string() ]); export const types_uuid = z.string(); export const indices_types_index_versioning = z.object({ - created: z.optional(types_version_string), - created_string: z.optional(z.string()), + created: z.optional(types_version_string), + created_string: z.optional(z.string()) }); -export const indices_types_translog_durability = z.enum(['request', 'REQUEST', 'async', 'ASYNC']); +export const indices_types_translog_durability = z.enum([ + 'request', + 'REQUEST', + 'async', + 'ASYNC' +]); export const indices_types_translog_retention = z.object({ - size: z.optional(types_byte_size), - age: z.optional(types_duration), + size: z.optional(types_byte_size), + age: z.optional(types_duration) }); export const indices_types_translog = z.object({ - sync_interval: z.optional(types_duration), - durability: z.optional(indices_types_translog_durability), - flush_threshold_size: z.optional(types_byte_size), - retention: z.optional(indices_types_translog_retention), + sync_interval: z.optional(types_duration), + durability: z.optional(indices_types_translog_durability), + flush_threshold_size: z.optional(types_byte_size), + retention: z.optional(indices_types_translog_retention) }); export const indices_types_settings_query_string = z.object({ - lenient: spec_utils_stringifiedboolean, + lenient: spec_utils_stringifiedboolean }); export const types_analysis_custom_analyzer = z.object({ - type: z.enum(['custom']), - char_filter: z.optional(z.union([z.string(), z.array(z.string())])), - filter: z.optional(z.union([z.string(), z.array(z.string())])), - position_increment_gap: z.optional(z.number()), - position_offset_gap: z.optional(z.number()), - tokenizer: z.string(), + type: z.enum(['custom']), + char_filter: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + filter: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + position_increment_gap: z.optional(z.number()), + position_offset_gap: z.optional(z.number()), + tokenizer: z.string() }); export const types_analysis_fingerprint_analyzer = z.object({ - type: z.enum(['fingerprint']), - version: z.optional(types_version_string), - max_output_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum token size to emit. Tokens larger than this size will be discarded.\nDefaults to `255`', - }) - ), - separator: z.optional( - z.string().register(z.globalRegistry, { - description: 'The character to use to concatenate the terms.\nDefaults to a space.', - }) - ), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional( - z.string().register(z.globalRegistry, { - description: 'The path to a file containing stop words.', - }) - ), + type: z.enum(['fingerprint']), + version: z.optional(types_version_string), + max_output_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum token size to emit. Tokens larger than this size will be discarded.\nDefaults to `255`' + })), + separator: z.optional(z.string().register(z.globalRegistry, { + description: 'The character to use to concatenate the terms.\nDefaults to a space.' + })), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string().register(z.globalRegistry, { + description: 'The path to a file containing stop words.' + })) }); export const types_analysis_keyword_analyzer = z.object({ - type: z.enum(['keyword']), - version: z.optional(types_version_string), + type: z.enum(['keyword']), + version: z.optional(types_version_string) }); -export const types_analysis_nori_decompound_mode = z.enum(['discard', 'none', 'mixed']); +export const types_analysis_nori_decompound_mode = z.enum([ + 'discard', + 'none', + 'mixed' +]); export const types_analysis_nori_analyzer = z.object({ - type: z.enum(['nori']), - version: z.optional(types_version_string), - decompound_mode: z.optional(types_analysis_nori_decompound_mode), - stoptags: z.optional(z.array(z.string())), - user_dictionary: z.optional(z.string()), + type: z.enum(['nori']), + version: z.optional(types_version_string), + decompound_mode: z.optional(types_analysis_nori_decompound_mode), + stoptags: z.optional(z.array(z.string())), + user_dictionary: z.optional(z.string()) }); export const types_analysis_pattern_analyzer = z.object({ - type: z.enum(['pattern']), - version: z.optional(types_version_string), - flags: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Java regular expression flags. Flags should be pipe-separated, eg "CASE_INSENSITIVE|COMMENTS".', - }) - ), - lowercase: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Should terms be lowercased or not.\nDefaults to `true`.', - }) - ), - pattern: z.optional( - z.string().register(z.globalRegistry, { - description: 'A Java regular expression.\nDefaults to `\\W+`.', - }) - ), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional( - z.string().register(z.globalRegistry, { - description: 'The path to a file containing stop words.', - }) - ), + type: z.enum(['pattern']), + version: z.optional(types_version_string), + flags: z.optional(z.string().register(z.globalRegistry, { + description: 'Java regular expression flags. Flags should be pipe-separated, eg "CASE_INSENSITIVE|COMMENTS".' + })), + lowercase: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Should terms be lowercased or not.\nDefaults to `true`.' + })), + pattern: z.optional(z.string().register(z.globalRegistry, { + description: 'A Java regular expression.\nDefaults to `\\W+`.' + })), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string().register(z.globalRegistry, { + description: 'The path to a file containing stop words.' + })) }); export const types_analysis_simple_analyzer = z.object({ - type: z.enum(['simple']), - version: z.optional(types_version_string), + type: z.enum(['simple']), + version: z.optional(types_version_string) }); export const types_analysis_standard_analyzer = z.object({ - type: z.enum(['standard']), - max_token_length: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum token length. If a token is seen that exceeds this length then it is split at `max_token_length` intervals.\nDefaults to `255`.', - }) - ), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional( - z.string().register(z.globalRegistry, { - description: 'The path to a file containing stop words.', - }) - ), + type: z.enum(['standard']), + max_token_length: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum token length. If a token is seen that exceeds this length then it is split at `max_token_length` intervals.\nDefaults to `255`.' + })), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string().register(z.globalRegistry, { + description: 'The path to a file containing stop words.' + })) }); export const types_analysis_stop_analyzer = z.object({ - type: z.enum(['stop']), - version: z.optional(types_version_string), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional( - z.string().register(z.globalRegistry, { - description: 'The path to a file containing stop words.', - }) - ), + type: z.enum(['stop']), + version: z.optional(types_version_string), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string().register(z.globalRegistry, { + description: 'The path to a file containing stop words.' + })) }); export const types_analysis_whitespace_analyzer = z.object({ - type: z.enum(['whitespace']), - version: z.optional(types_version_string), + type: z.enum(['whitespace']), + version: z.optional(types_version_string) }); -export const types_analysis_icu_normalization_type = z.enum(['nfc', 'nfkc', 'nfkc_cf']); +export const types_analysis_icu_normalization_type = z.enum([ + 'nfc', + 'nfkc', + 'nfkc_cf' +]); export const types_analysis_icu_normalization_mode = z.enum(['decompose', 'compose']); export const types_analysis_icu_analyzer = z.object({ - type: z.enum(['icu_analyzer']), - method: types_analysis_icu_normalization_type, - mode: types_analysis_icu_normalization_mode, + type: z.enum(['icu_analyzer']), + method: types_analysis_icu_normalization_type, + mode: types_analysis_icu_normalization_mode }); -export const types_analysis_kuromoji_tokenization_mode = z.enum(['normal', 'search', 'extended']); +export const types_analysis_kuromoji_tokenization_mode = z.enum([ + 'normal', + 'search', + 'extended' +]); export const types_analysis_kuromoji_analyzer = z.object({ - type: z.enum(['kuromoji']), - mode: z.optional(types_analysis_kuromoji_tokenization_mode), - user_dictionary: z.optional(z.string()), + type: z.enum(['kuromoji']), + mode: z.optional(types_analysis_kuromoji_tokenization_mode), + user_dictionary: z.optional(z.string()) }); export const types_analysis_snowball_language = z.enum([ - 'Arabic', - 'Armenian', - 'Basque', - 'Catalan', - 'Danish', - 'Dutch', - 'English', - 'Estonian', - 'Finnish', - 'French', - 'German', - 'German2', - 'Hungarian', - 'Italian', - 'Irish', - 'Kp', - 'Lithuanian', - 'Lovins', - 'Norwegian', - 'Porter', - 'Portuguese', - 'Romanian', - 'Russian', - 'Serbian', - 'Spanish', - 'Swedish', - 'Turkish', + 'Arabic', + 'Armenian', + 'Basque', + 'Catalan', + 'Danish', + 'Dutch', + 'English', + 'Estonian', + 'Finnish', + 'French', + 'German', + 'German2', + 'Hungarian', + 'Italian', + 'Irish', + 'Kp', + 'Lithuanian', + 'Lovins', + 'Norwegian', + 'Porter', + 'Portuguese', + 'Romanian', + 'Russian', + 'Serbian', + 'Spanish', + 'Swedish', + 'Turkish' ]); export const types_analysis_snowball_analyzer = z.object({ - type: z.enum(['snowball']), - version: z.optional(types_version_string), - language: types_analysis_snowball_language, - stopwords: z.optional(types_analysis_stop_words), + type: z.enum(['snowball']), + version: z.optional(types_version_string), + language: types_analysis_snowball_language, + stopwords: z.optional(types_analysis_stop_words) }); export const types_analysis_arabic_analyzer = z.object({ - type: z.enum(['arabic']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['arabic']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_armenian_analyzer = z.object({ - type: z.enum(['armenian']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['armenian']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_basque_analyzer = z.object({ - type: z.enum(['basque']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['basque']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_bengali_analyzer = z.object({ - type: z.enum(['bengali']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['bengali']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_brazilian_analyzer = z.object({ - type: z.enum(['brazilian']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), + type: z.enum(['brazilian']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()) }); export const types_analysis_bulgarian_analyzer = z.object({ - type: z.enum(['bulgarian']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['bulgarian']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_catalan_analyzer = z.object({ - type: z.enum(['catalan']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['catalan']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_chinese_analyzer = z.object({ - type: z.enum(['chinese']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), + type: z.enum(['chinese']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()) }); export const types_analysis_cjk_analyzer = z.object({ - type: z.enum(['cjk']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), + type: z.enum(['cjk']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()) }); export const types_analysis_czech_analyzer = z.object({ - type: z.enum(['czech']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['czech']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_danish_analyzer = z.object({ - type: z.enum(['danish']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), + type: z.enum(['danish']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()) }); export const types_analysis_dutch_analyzer = z.object({ - type: z.enum(['dutch']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['dutch']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_english_analyzer = z.object({ - type: z.enum(['english']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['english']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_estonian_analyzer = z.object({ - type: z.enum(['estonian']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), + type: z.enum(['estonian']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()) }); export const types_analysis_finnish_analyzer = z.object({ - type: z.enum(['finnish']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['finnish']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_french_analyzer = z.object({ - type: z.enum(['french']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['french']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_galician_analyzer = z.object({ - type: z.enum(['galician']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['galician']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_german_analyzer = z.object({ - type: z.enum(['german']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['german']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_greek_analyzer = z.object({ - type: z.enum(['greek']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), + type: z.enum(['greek']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()) }); export const types_analysis_hindi_analyzer = z.object({ - type: z.enum(['hindi']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['hindi']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_hungarian_analyzer = z.object({ - type: z.enum(['hungarian']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['hungarian']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_indonesian_analyzer = z.object({ - type: z.enum(['indonesian']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['indonesian']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_irish_analyzer = z.object({ - type: z.enum(['irish']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['irish']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_italian_analyzer = z.object({ - type: z.enum(['italian']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['italian']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_latvian_analyzer = z.object({ - type: z.enum(['latvian']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['latvian']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_lithuanian_analyzer = z.object({ - type: z.enum(['lithuanian']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['lithuanian']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_norwegian_analyzer = z.object({ - type: z.enum(['norwegian']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['norwegian']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_persian_analyzer = z.object({ - type: z.enum(['persian']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), + type: z.enum(['persian']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()) }); export const types_analysis_portuguese_analyzer = z.object({ - type: z.enum(['portuguese']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['portuguese']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_romanian_analyzer = z.object({ - type: z.enum(['romanian']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['romanian']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_russian_analyzer = z.object({ - type: z.enum(['russian']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['russian']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_serbian_analyzer = z.object({ - type: z.enum(['serbian']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['serbian']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_sorani_analyzer = z.object({ - type: z.enum(['sorani']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['sorani']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_spanish_analyzer = z.object({ - type: z.enum(['spanish']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['spanish']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_swedish_analyzer = z.object({ - type: z.enum(['swedish']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['swedish']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_turkish_analyzer = z.object({ - type: z.enum(['turkish']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), - stem_exclusion: z.optional(z.array(z.string())), + type: z.enum(['turkish']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()), + stem_exclusion: z.optional(z.array(z.string())) }); export const types_analysis_thai_analyzer = z.object({ - type: z.enum(['thai']), - stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional(z.string()), + type: z.enum(['thai']), + stopwords: z.optional(types_analysis_stop_words), + stopwords_path: z.optional(z.string()) }); export const types_analysis_analyzer = z.union([ - z - .object({ - type: z.literal('custom'), - }) - .and(types_analysis_custom_analyzer), - z - .object({ - type: z.literal('fingerprint'), - }) - .and(types_analysis_fingerprint_analyzer), - z - .object({ - type: z.literal('keyword'), - }) - .and(types_analysis_keyword_analyzer), - z - .object({ - type: z.literal('nori'), - }) - .and(types_analysis_nori_analyzer), - z - .object({ - type: z.literal('pattern'), - }) - .and(types_analysis_pattern_analyzer), - z - .object({ - type: z.literal('simple'), - }) - .and(types_analysis_simple_analyzer), - z - .object({ - type: z.literal('standard'), - }) - .and(types_analysis_standard_analyzer), - z - .object({ - type: z.literal('stop'), - }) - .and(types_analysis_stop_analyzer), - z - .object({ - type: z.literal('whitespace'), - }) - .and(types_analysis_whitespace_analyzer), - z - .object({ - type: z.literal('icu_analyzer'), - }) - .and(types_analysis_icu_analyzer), - z - .object({ - type: z.literal('kuromoji'), - }) - .and(types_analysis_kuromoji_analyzer), - z - .object({ - type: z.literal('snowball'), - }) - .and(types_analysis_snowball_analyzer), - z - .object({ - type: z.literal('arabic'), - }) - .and(types_analysis_arabic_analyzer), - z - .object({ - type: z.literal('armenian'), - }) - .and(types_analysis_armenian_analyzer), - z - .object({ - type: z.literal('basque'), - }) - .and(types_analysis_basque_analyzer), - z - .object({ - type: z.literal('bengali'), - }) - .and(types_analysis_bengali_analyzer), - z - .object({ - type: z.literal('brazilian'), - }) - .and(types_analysis_brazilian_analyzer), - z - .object({ - type: z.literal('bulgarian'), - }) - .and(types_analysis_bulgarian_analyzer), - z - .object({ - type: z.literal('catalan'), - }) - .and(types_analysis_catalan_analyzer), - z - .object({ - type: z.literal('chinese'), - }) - .and(types_analysis_chinese_analyzer), - z - .object({ - type: z.literal('cjk'), - }) - .and(types_analysis_cjk_analyzer), - z - .object({ - type: z.literal('czech'), - }) - .and(types_analysis_czech_analyzer), - z - .object({ - type: z.literal('danish'), - }) - .and(types_analysis_danish_analyzer), - z - .object({ - type: z.literal('dutch'), - }) - .and(types_analysis_dutch_analyzer), - z - .object({ - type: z.literal('english'), - }) - .and(types_analysis_english_analyzer), - z - .object({ - type: z.literal('estonian'), - }) - .and(types_analysis_estonian_analyzer), - z - .object({ - type: z.literal('finnish'), - }) - .and(types_analysis_finnish_analyzer), - z - .object({ - type: z.literal('french'), - }) - .and(types_analysis_french_analyzer), - z - .object({ - type: z.literal('galician'), - }) - .and(types_analysis_galician_analyzer), - z - .object({ - type: z.literal('german'), - }) - .and(types_analysis_german_analyzer), - z - .object({ - type: z.literal('greek'), - }) - .and(types_analysis_greek_analyzer), - z - .object({ - type: z.literal('hindi'), - }) - .and(types_analysis_hindi_analyzer), - z - .object({ - type: z.literal('hungarian'), - }) - .and(types_analysis_hungarian_analyzer), - z - .object({ - type: z.literal('indonesian'), - }) - .and(types_analysis_indonesian_analyzer), - z - .object({ - type: z.literal('irish'), - }) - .and(types_analysis_irish_analyzer), - z - .object({ - type: z.literal('italian'), - }) - .and(types_analysis_italian_analyzer), - z - .object({ - type: z.literal('latvian'), - }) - .and(types_analysis_latvian_analyzer), - z - .object({ - type: z.literal('lithuanian'), - }) - .and(types_analysis_lithuanian_analyzer), - z - .object({ - type: z.literal('norwegian'), - }) - .and(types_analysis_norwegian_analyzer), - z - .object({ - type: z.literal('persian'), - }) - .and(types_analysis_persian_analyzer), - z - .object({ - type: z.literal('portuguese'), - }) - .and(types_analysis_portuguese_analyzer), - z - .object({ - type: z.literal('romanian'), - }) - .and(types_analysis_romanian_analyzer), - z - .object({ - type: z.literal('russian'), - }) - .and(types_analysis_russian_analyzer), - z - .object({ - type: z.literal('serbian'), - }) - .and(types_analysis_serbian_analyzer), - z - .object({ - type: z.literal('sorani'), - }) - .and(types_analysis_sorani_analyzer), - z - .object({ - type: z.literal('spanish'), - }) - .and(types_analysis_spanish_analyzer), - z - .object({ - type: z.literal('swedish'), - }) - .and(types_analysis_swedish_analyzer), - z - .object({ - type: z.literal('turkish'), - }) - .and(types_analysis_turkish_analyzer), - z - .object({ - type: z.literal('thai'), - }) - .and(types_analysis_thai_analyzer), + z.object({ + type: z.literal('custom') + }).and(types_analysis_custom_analyzer), + z.object({ + type: z.literal('fingerprint') + }).and(types_analysis_fingerprint_analyzer), + z.object({ + type: z.literal('keyword') + }).and(types_analysis_keyword_analyzer), + z.object({ + type: z.literal('nori') + }).and(types_analysis_nori_analyzer), + z.object({ + type: z.literal('pattern') + }).and(types_analysis_pattern_analyzer), + z.object({ + type: z.literal('simple') + }).and(types_analysis_simple_analyzer), + z.object({ + type: z.literal('standard') + }).and(types_analysis_standard_analyzer), + z.object({ + type: z.literal('stop') + }).and(types_analysis_stop_analyzer), + z.object({ + type: z.literal('whitespace') + }).and(types_analysis_whitespace_analyzer), + z.object({ + type: z.literal('icu_analyzer') + }).and(types_analysis_icu_analyzer), + z.object({ + type: z.literal('kuromoji') + }).and(types_analysis_kuromoji_analyzer), + z.object({ + type: z.literal('snowball') + }).and(types_analysis_snowball_analyzer), + z.object({ + type: z.literal('arabic') + }).and(types_analysis_arabic_analyzer), + z.object({ + type: z.literal('armenian') + }).and(types_analysis_armenian_analyzer), + z.object({ + type: z.literal('basque') + }).and(types_analysis_basque_analyzer), + z.object({ + type: z.literal('bengali') + }).and(types_analysis_bengali_analyzer), + z.object({ + type: z.literal('brazilian') + }).and(types_analysis_brazilian_analyzer), + z.object({ + type: z.literal('bulgarian') + }).and(types_analysis_bulgarian_analyzer), + z.object({ + type: z.literal('catalan') + }).and(types_analysis_catalan_analyzer), + z.object({ + type: z.literal('chinese') + }).and(types_analysis_chinese_analyzer), + z.object({ + type: z.literal('cjk') + }).and(types_analysis_cjk_analyzer), + z.object({ + type: z.literal('czech') + }).and(types_analysis_czech_analyzer), + z.object({ + type: z.literal('danish') + }).and(types_analysis_danish_analyzer), + z.object({ + type: z.literal('dutch') + }).and(types_analysis_dutch_analyzer), + z.object({ + type: z.literal('english') + }).and(types_analysis_english_analyzer), + z.object({ + type: z.literal('estonian') + }).and(types_analysis_estonian_analyzer), + z.object({ + type: z.literal('finnish') + }).and(types_analysis_finnish_analyzer), + z.object({ + type: z.literal('french') + }).and(types_analysis_french_analyzer), + z.object({ + type: z.literal('galician') + }).and(types_analysis_galician_analyzer), + z.object({ + type: z.literal('german') + }).and(types_analysis_german_analyzer), + z.object({ + type: z.literal('greek') + }).and(types_analysis_greek_analyzer), + z.object({ + type: z.literal('hindi') + }).and(types_analysis_hindi_analyzer), + z.object({ + type: z.literal('hungarian') + }).and(types_analysis_hungarian_analyzer), + z.object({ + type: z.literal('indonesian') + }).and(types_analysis_indonesian_analyzer), + z.object({ + type: z.literal('irish') + }).and(types_analysis_irish_analyzer), + z.object({ + type: z.literal('italian') + }).and(types_analysis_italian_analyzer), + z.object({ + type: z.literal('latvian') + }).and(types_analysis_latvian_analyzer), + z.object({ + type: z.literal('lithuanian') + }).and(types_analysis_lithuanian_analyzer), + z.object({ + type: z.literal('norwegian') + }).and(types_analysis_norwegian_analyzer), + z.object({ + type: z.literal('persian') + }).and(types_analysis_persian_analyzer), + z.object({ + type: z.literal('portuguese') + }).and(types_analysis_portuguese_analyzer), + z.object({ + type: z.literal('romanian') + }).and(types_analysis_romanian_analyzer), + z.object({ + type: z.literal('russian') + }).and(types_analysis_russian_analyzer), + z.object({ + type: z.literal('serbian') + }).and(types_analysis_serbian_analyzer), + z.object({ + type: z.literal('sorani') + }).and(types_analysis_sorani_analyzer), + z.object({ + type: z.literal('spanish') + }).and(types_analysis_spanish_analyzer), + z.object({ + type: z.literal('swedish') + }).and(types_analysis_swedish_analyzer), + z.object({ + type: z.literal('turkish') + }).and(types_analysis_turkish_analyzer), + z.object({ + type: z.literal('thai') + }).and(types_analysis_thai_analyzer) ]); export const types_analysis_char_filter_base = z.object({ - version: z.optional(types_version_string), + version: z.optional(types_version_string) }); -export const types_analysis_html_strip_char_filter = types_analysis_char_filter_base.and( - z.object({ +export const types_analysis_html_strip_char_filter = types_analysis_char_filter_base.and(z.object({ type: z.enum(['html_strip']), - escaped_tags: z.optional(z.array(z.string())), - }) -); + escaped_tags: z.optional(z.array(z.string())) +})); -export const types_analysis_mapping_char_filter = types_analysis_char_filter_base.and( - z.object({ +export const types_analysis_mapping_char_filter = types_analysis_char_filter_base.and(z.object({ type: z.enum(['mapping']), mappings: z.optional(z.array(z.string())), - mappings_path: z.optional(z.string()), - }) -); + mappings_path: z.optional(z.string()) +})); -export const types_analysis_pattern_replace_char_filter = types_analysis_char_filter_base.and( - z.object({ +export const types_analysis_pattern_replace_char_filter = types_analysis_char_filter_base.and(z.object({ type: z.enum(['pattern_replace']), flags: z.optional(z.string()), pattern: z.string(), - replacement: z.optional(z.string()), - }) -); + replacement: z.optional(z.string()) +})); -export const types_analysis_icu_normalization_char_filter = types_analysis_char_filter_base.and( - z.object({ +export const types_analysis_icu_normalization_char_filter = types_analysis_char_filter_base.and(z.object({ type: z.enum(['icu_normalizer']), mode: z.optional(types_analysis_icu_normalization_mode), name: z.optional(types_analysis_icu_normalization_type), - unicode_set_filter: z.optional(z.string()), - }) -); + unicode_set_filter: z.optional(z.string()) +})); -export const types_analysis_kuromoji_iteration_mark_char_filter = - types_analysis_char_filter_base.and( - z.object({ - type: z.enum(['kuromoji_iteration_mark']), - normalize_kana: z.boolean(), - normalize_kanji: z.boolean(), - }) - ); +export const types_analysis_kuromoji_iteration_mark_char_filter = types_analysis_char_filter_base.and(z.object({ + type: z.enum(['kuromoji_iteration_mark']), + normalize_kana: z.boolean(), + normalize_kanji: z.boolean() +})); export const types_analysis_char_filter_definition = z.union([ - z - .object({ - type: z.literal('html_strip'), - }) - .and(types_analysis_html_strip_char_filter), - z - .object({ - type: z.literal('mapping'), - }) - .and(types_analysis_mapping_char_filter), - z - .object({ - type: z.literal('pattern_replace'), - }) - .and(types_analysis_pattern_replace_char_filter), - z - .object({ - type: z.literal('icu_normalizer'), - }) - .and(types_analysis_icu_normalization_char_filter), - z - .object({ - type: z.literal('kuromoji_iteration_mark'), - }) - .and(types_analysis_kuromoji_iteration_mark_char_filter), + z.object({ + type: z.literal('html_strip') + }).and(types_analysis_html_strip_char_filter), + z.object({ + type: z.literal('mapping') + }).and(types_analysis_mapping_char_filter), + z.object({ + type: z.literal('pattern_replace') + }).and(types_analysis_pattern_replace_char_filter), + z.object({ + type: z.literal('icu_normalizer') + }).and(types_analysis_icu_normalization_char_filter), + z.object({ + type: z.literal('kuromoji_iteration_mark') + }).and(types_analysis_kuromoji_iteration_mark_char_filter) ]); export const types_analysis_char_filter = z.union([ - z.string(), - types_analysis_char_filter_definition, + z.string(), + types_analysis_char_filter_definition ]); export const types_analysis_token_filter_base = z.object({ - version: z.optional(types_version_string), + version: z.optional(types_version_string) }); -export const types_analysis_apostrophe_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['apostrophe']), - }) -); +export const types_analysis_apostrophe_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['apostrophe']) +})); -export const types_analysis_arabic_stem_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['arabic_stem']), - }) -); +export const types_analysis_arabic_stem_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['arabic_stem']) +})); -export const types_analysis_arabic_normalization_token_filter = - types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['arabic_normalization']), - }) - ); +export const types_analysis_arabic_normalization_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['arabic_normalization']) +})); -export const types_analysis_ascii_folding_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_ascii_folding_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['asciifolding']), - preserve_original: z.optional(spec_utils_stringifiedboolean), - }) -); + preserve_original: z.optional(spec_utils_stringifiedboolean) +})); -export const types_analysis_bengali_normalization_token_filter = - types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['bengali_normalization']), - }) - ); +export const types_analysis_bengali_normalization_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['bengali_normalization']) +})); -export const types_analysis_brazilian_stem_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['brazilian_stem']), - }) -); +export const types_analysis_brazilian_stem_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['brazilian_stem']) +})); export const types_analysis_cjk_bigram_ignored_script = z.enum([ - 'han', - 'hangul', - 'hiragana', - 'katakana', + 'han', + 'hangul', + 'hiragana', + 'katakana' ]); -export const types_analysis_cjk_bigram_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_cjk_bigram_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['cjk_bigram']), - ignored_scripts: z.optional( - z.array(types_analysis_cjk_bigram_ignored_script).register(z.globalRegistry, { - description: 'Array of character scripts for which to disable bigrams.', - }) - ), - output_unigrams: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, emit tokens in both bigram and unigram form. If `false`, a CJK character is output in unigram form when it has no adjacent characters. Defaults to `false`.', - }) - ), - }) -); - -export const types_analysis_cjk_width_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['cjk_width']), - }) -); - -export const types_analysis_classic_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['classic']), - }) -); - -export const types_analysis_common_grams_token_filter = types_analysis_token_filter_base.and( - z.object({ + ignored_scripts: z.optional(z.array(types_analysis_cjk_bigram_ignored_script).register(z.globalRegistry, { + description: 'Array of character scripts for which to disable bigrams.' + })), + output_unigrams: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, emit tokens in both bigram and unigram form. If `false`, a CJK character is output in unigram form when it has no adjacent characters. Defaults to `false`.' + })) +})); + +export const types_analysis_cjk_width_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['cjk_width']) +})); + +export const types_analysis_classic_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['classic']) +})); + +export const types_analysis_common_grams_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['common_grams']), - common_words: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'A list of tokens. The filter generates bigrams for these tokens.\nEither this or the `common_words_path` parameter is required.', - }) - ), - common_words_path: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Path to a file containing a list of tokens. The filter generates bigrams for these tokens.\nThis path must be absolute or relative to the `config` location. The file must be UTF-8 encoded. Each token in the file must be separated by a line break.\nEither this or the `common_words` parameter is required.', - }) - ), - ignore_case: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, matches for common words matching are case-insensitive. Defaults to `false`.', - }) - ), - query_mode: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the filter excludes the following tokens from the output:\n- Unigrams for common words\n- Unigrams for terms followed by common words\nDefaults to `false`. We recommend enabling this parameter for search analyzers.', - }) - ), - }) -); - -export const types_analysis_czech_stem_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['czech_stem']), - }) -); - -export const types_analysis_decimal_digit_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['decimal_digit']), - }) -); - -export const types_analysis_delimited_payload_encoding = z.enum(['int', 'float', 'identity']); - -export const types_analysis_delimited_payload_token_filter = types_analysis_token_filter_base.and( - z.object({ + common_words: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A list of tokens. The filter generates bigrams for these tokens.\nEither this or the `common_words_path` parameter is required.' + })), + common_words_path: z.optional(z.string().register(z.globalRegistry, { + description: 'Path to a file containing a list of tokens. The filter generates bigrams for these tokens.\nThis path must be absolute or relative to the `config` location. The file must be UTF-8 encoded. Each token in the file must be separated by a line break.\nEither this or the `common_words` parameter is required.' + })), + ignore_case: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, matches for common words matching are case-insensitive. Defaults to `false`.' + })), + query_mode: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the filter excludes the following tokens from the output:\n- Unigrams for common words\n- Unigrams for terms followed by common words\nDefaults to `false`. We recommend enabling this parameter for search analyzers.' + })) +})); + +export const types_analysis_czech_stem_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['czech_stem']) +})); + +export const types_analysis_decimal_digit_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['decimal_digit']) +})); + +export const types_analysis_delimited_payload_encoding = z.enum([ + 'int', + 'float', + 'identity' +]); + +export const types_analysis_delimited_payload_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['delimited_payload']), - delimiter: z.optional( - z.string().register(z.globalRegistry, { - description: 'Character used to separate tokens from payloads. Defaults to `|`.', - }) - ), - encoding: z.optional(types_analysis_delimited_payload_encoding), - }) -); - -export const types_analysis_dutch_stem_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['dutch_stem']), - }) -); + delimiter: z.optional(z.string().register(z.globalRegistry, { + description: 'Character used to separate tokens from payloads. Defaults to `|`.' + })), + encoding: z.optional(types_analysis_delimited_payload_encoding) +})); + +export const types_analysis_dutch_stem_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['dutch_stem']) +})); export const types_analysis_edge_n_gram_side = z.enum(['front', 'back']); -export const types_analysis_edge_n_gram_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_edge_n_gram_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['edge_ngram']), - max_gram: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum character length of a gram. For custom token filters, defaults to `2`. For the built-in edge_ngram filter, defaults to `1`.', - }) - ), - min_gram: z.optional( - z.number().register(z.globalRegistry, { - description: 'Minimum character length of a gram. Defaults to `1`.', - }) - ), + max_gram: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum character length of a gram. For custom token filters, defaults to `2`. For the built-in edge_ngram filter, defaults to `1`.' + })), + min_gram: z.optional(z.number().register(z.globalRegistry, { + description: 'Minimum character length of a gram. Defaults to `1`.' + })), side: z.optional(types_analysis_edge_n_gram_side), - preserve_original: z.optional(spec_utils_stringifiedboolean), - }) -); + preserve_original: z.optional(spec_utils_stringifiedboolean) +})); -export const types_analysis_elision_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_elision_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['elision']), - articles: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'List of elisions to remove.\nTo be removed, the elision must be at the beginning of a token and be immediately followed by an apostrophe. Both the elision and apostrophe are removed.\nFor custom `elision` filters, either this parameter or `articles_path` must be specified.', - }) - ), - articles_path: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Path to a file that contains a list of elisions to remove.\nThis path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each elision in the file must be separated by a line break.\nTo be removed, the elision must be at the beginning of a token and be immediately followed by an apostrophe. Both the elision and apostrophe are removed.\nFor custom `elision` filters, either this parameter or `articles` must be specified.', - }) - ), - articles_case: z.optional(spec_utils_stringifiedboolean), - }) -); - -export const types_analysis_fingerprint_token_filter = types_analysis_token_filter_base.and( - z.object({ + articles: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'List of elisions to remove.\nTo be removed, the elision must be at the beginning of a token and be immediately followed by an apostrophe. Both the elision and apostrophe are removed.\nFor custom `elision` filters, either this parameter or `articles_path` must be specified.' + })), + articles_path: z.optional(z.string().register(z.globalRegistry, { + description: 'Path to a file that contains a list of elisions to remove.\nThis path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each elision in the file must be separated by a line break.\nTo be removed, the elision must be at the beginning of a token and be immediately followed by an apostrophe. Both the elision and apostrophe are removed.\nFor custom `elision` filters, either this parameter or `articles` must be specified.' + })), + articles_case: z.optional(spec_utils_stringifiedboolean) +})); + +export const types_analysis_fingerprint_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['fingerprint']), - max_output_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum character length, including whitespace, of the output token. Defaults to `255`. Concatenated tokens longer than this will result in no token output.', - }) - ), - separator: z.optional( - z.string().register(z.globalRegistry, { - description: 'Character to use to concatenate the token stream input. Defaults to a space.', - }) - ), - }) -); - -export const types_analysis_flatten_graph_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['flatten_graph']), - }) -); - -export const types_analysis_french_stem_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['french_stem']), - }) -); - -export const types_analysis_german_normalization_token_filter = - types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['german_normalization']), - }) - ); - -export const types_analysis_german_stem_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['german_stem']), - }) -); - -export const types_analysis_hindi_normalization_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['hindi_normalization']), - }) -); - -export const types_analysis_hunspell_token_filter = types_analysis_token_filter_base.and( - z.object({ + max_output_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum character length, including whitespace, of the output token. Defaults to `255`. Concatenated tokens longer than this will result in no token output.' + })), + separator: z.optional(z.string().register(z.globalRegistry, { + description: 'Character to use to concatenate the token stream input. Defaults to a space.' + })) +})); + +export const types_analysis_flatten_graph_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['flatten_graph']) +})); + +export const types_analysis_french_stem_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['french_stem']) +})); + +export const types_analysis_german_normalization_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['german_normalization']) +})); + +export const types_analysis_german_stem_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['german_stem']) +})); + +export const types_analysis_hindi_normalization_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['hindi_normalization']) +})); + +export const types_analysis_hunspell_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['hunspell']), - dedup: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, duplicate tokens are removed from the filter’s output. Defaults to `true`.', - }) - ), - dictionary: z.optional( - z.string().register(z.globalRegistry, { - description: - 'One or more `.dic` files (e.g, `en_US.dic`, my_custom.dic) to use for the Hunspell dictionary.\nBy default, the `hunspell` filter uses all `.dic` files in the `<$ES_PATH_CONF>/hunspell/` directory specified using the `lang`, `language`, or `locale` parameter.', - }) - ), + dedup: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, duplicate tokens are removed from the filter’s output. Defaults to `true`.' + })), + dictionary: z.optional(z.string().register(z.globalRegistry, { + description: 'One or more `.dic` files (e.g, `en_US.dic`, my_custom.dic) to use for the Hunspell dictionary.\nBy default, the `hunspell` filter uses all `.dic` files in the `<$ES_PATH_CONF>/hunspell/` directory specified using the `lang`, `language`, or `locale` parameter.' + })), locale: z.string().register(z.globalRegistry, { - description: - 'Locale directory used to specify the `.aff` and `.dic` files for a Hunspell dictionary.', - }), - longest_only: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, only the longest stemmed version of each token is included in the output. If `false`, all stemmed versions of the token are included. Defaults to `false`.', - }) - ), - }) -); - -export const types_analysis_compound_word_token_filter_base = types_analysis_token_filter_base.and( - z.object({ - max_subword_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum subword character length. Longer subword tokens are excluded from the output. Defaults to `15`.', - }) - ), - min_subword_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Minimum subword character length. Shorter subword tokens are excluded from the output. Defaults to `2`.', - }) - ), - min_word_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Minimum word character length. Shorter word tokens are excluded from the output. Defaults to `5`.', - }) - ), - only_longest_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, only include the longest matching subword. Defaults to `false`.', - }) - ), - word_list: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'A list of subwords to look for in the token stream. If found, the subword is included in the token output.\nEither this parameter or `word_list_path` must be specified.', - }) - ), - word_list_path: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Path to a file that contains a list of subwords to find in the token stream. If found, the subword is included in the token output.\nThis path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break.\nEither this parameter or `word_list` must be specified.', - }) - ), - }) -); - -export const types_analysis_hyphenation_decompounder_token_filter = - types_analysis_compound_word_token_filter_base.and( - z.object({ - type: z.enum(['hyphenation_decompounder']), - hyphenation_patterns_path: z.string().register(z.globalRegistry, { - description: - 'Path to an Apache FOP (Formatting Objects Processor) XML hyphenation pattern file.\nThis path must be absolute or relative to the `config` location. Only FOP v1.2 compatible files are supported.', - }), - no_sub_matches: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, do not match sub tokens in tokens that are in the word list. Defaults to `false`.', - }) - ), - no_overlapping_matches: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, do not allow overlapping tokens. Defaults to `false`.', - }) - ), - }) - ); - -export const types_analysis_indic_normalization_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['indic_normalization']), - }) -); + description: 'Locale directory used to specify the `.aff` and `.dic` files for a Hunspell dictionary.' + }), + longest_only: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, only the longest stemmed version of each token is included in the output. If `false`, all stemmed versions of the token are included. Defaults to `false`.' + })) +})); + +export const types_analysis_compound_word_token_filter_base = types_analysis_token_filter_base.and(z.object({ + max_subword_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum subword character length. Longer subword tokens are excluded from the output. Defaults to `15`.' + })), + min_subword_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Minimum subword character length. Shorter subword tokens are excluded from the output. Defaults to `2`.' + })), + min_word_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Minimum word character length. Shorter word tokens are excluded from the output. Defaults to `5`.' + })), + only_longest_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, only include the longest matching subword. Defaults to `false`.' + })), + word_list: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A list of subwords to look for in the token stream. If found, the subword is included in the token output.\nEither this parameter or `word_list_path` must be specified.' + })), + word_list_path: z.optional(z.string().register(z.globalRegistry, { + description: 'Path to a file that contains a list of subwords to find in the token stream. If found, the subword is included in the token output.\nThis path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break.\nEither this parameter or `word_list` must be specified.' + })) +})); + +export const types_analysis_hyphenation_decompounder_token_filter = types_analysis_compound_word_token_filter_base.and(z.object({ + type: z.enum(['hyphenation_decompounder']), + hyphenation_patterns_path: z.string().register(z.globalRegistry, { + description: 'Path to an Apache FOP (Formatting Objects Processor) XML hyphenation pattern file.\nThis path must be absolute or relative to the `config` location. Only FOP v1.2 compatible files are supported.' + }), + no_sub_matches: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, do not match sub tokens in tokens that are in the word list. Defaults to `false`.' + })), + no_overlapping_matches: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, do not allow overlapping tokens. Defaults to `false`.' + })) +})); + +export const types_analysis_indic_normalization_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['indic_normalization']) +})); export const types_analysis_keep_types_mode = z.enum(['include', 'exclude']); -export const types_analysis_keep_types_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_keep_types_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['keep_types']), mode: z.optional(types_analysis_keep_types_mode), types: z.array(z.string()).register(z.globalRegistry, { - description: 'List of token types to keep or remove.', - }), - }) -); + description: 'List of token types to keep or remove.' + }) +})); -export const types_analysis_keep_words_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_keep_words_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['keep']), - keep_words: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'List of words to keep. Only tokens that match words in this list are included in the output.\nEither this parameter or `keep_words_path` must be specified.', - }) - ), - keep_words_case: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, lowercase all keep words. Defaults to `false`.', - }) - ), - keep_words_path: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Path to a file that contains a list of words to keep. Only tokens that match words in this list are included in the output.\nThis path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each word in the file must be separated by a line break.\nEither this parameter or `keep_words` must be specified.', - }) - ), - }) -); - -export const types_analysis_keyword_marker_token_filter = types_analysis_token_filter_base.and( - z.object({ + keep_words: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'List of words to keep. Only tokens that match words in this list are included in the output.\nEither this parameter or `keep_words_path` must be specified.' + })), + keep_words_case: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, lowercase all keep words. Defaults to `false`.' + })), + keep_words_path: z.optional(z.string().register(z.globalRegistry, { + description: 'Path to a file that contains a list of words to keep. Only tokens that match words in this list are included in the output.\nThis path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each word in the file must be separated by a line break.\nEither this parameter or `keep_words` must be specified.' + })) +})); + +export const types_analysis_keyword_marker_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['keyword_marker']), - ignore_case: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, matching for the `keywords` and `keywords_path` parameters ignores letter case. Defaults to `false`.', - }) - ), - keywords: z.optional(z.union([z.string(), z.array(z.string())])), - keywords_path: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Path to a file that contains a list of keywords. Tokens that match these keywords are not stemmed.\nThis path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each word in the file must be separated by a line break.\nThis parameter, `keywords`, or `keywords_pattern` must be specified. You cannot specify this parameter and `keywords_pattern`.', - }) - ), - keywords_pattern: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Java regular expression used to match tokens. Tokens that match this expression are marked as keywords and not stemmed.\nThis parameter, `keywords`, or `keywords_path` must be specified. You cannot specify this parameter and `keywords` or `keywords_pattern`.', - }) - ), - }) -); - -export const types_analysis_keyword_repeat_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['keyword_repeat']), - }) -); - -export const types_analysis_k_stem_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['kstem']), - }) -); - -export const types_analysis_length_token_filter = types_analysis_token_filter_base.and( - z.object({ + ignore_case: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, matching for the `keywords` and `keywords_path` parameters ignores letter case. Defaults to `false`.' + })), + keywords: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + keywords_path: z.optional(z.string().register(z.globalRegistry, { + description: 'Path to a file that contains a list of keywords. Tokens that match these keywords are not stemmed.\nThis path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each word in the file must be separated by a line break.\nThis parameter, `keywords`, or `keywords_pattern` must be specified. You cannot specify this parameter and `keywords_pattern`.' + })), + keywords_pattern: z.optional(z.string().register(z.globalRegistry, { + description: 'Java regular expression used to match tokens. Tokens that match this expression are marked as keywords and not stemmed.\nThis parameter, `keywords`, or `keywords_path` must be specified. You cannot specify this parameter and `keywords` or `keywords_pattern`.' + })) +})); + +export const types_analysis_keyword_repeat_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['keyword_repeat']) +})); + +export const types_analysis_k_stem_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['kstem']) +})); + +export const types_analysis_length_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['length']), - max: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum character length of a token. Longer tokens are excluded from the output. Defaults to `Integer.MAX_VALUE`, which is `2^31-1` or `2147483647`.', - }) - ), - min: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Minimum character length of a token. Shorter tokens are excluded from the output. Defaults to `0`.', - }) - ), - }) -); - -export const types_analysis_limit_token_count_token_filter = types_analysis_token_filter_base.and( - z.object({ + max: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum character length of a token. Longer tokens are excluded from the output. Defaults to `Integer.MAX_VALUE`, which is `2^31-1` or `2147483647`.' + })), + min: z.optional(z.number().register(z.globalRegistry, { + description: 'Minimum character length of a token. Shorter tokens are excluded from the output. Defaults to `0`.' + })) +})); + +export const types_analysis_limit_token_count_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['limit']), - consume_all_tokens: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the limit filter exhausts the token stream, even if the `max_token_count` has already been reached. Defaults to `false`.', - }) - ), - max_token_count: z.optional(spec_utils_stringifiedinteger), - }) -); + consume_all_tokens: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the limit filter exhausts the token stream, even if the `max_token_count` has already been reached. Defaults to `false`.' + })), + max_token_count: z.optional(spec_utils_stringifiedinteger) +})); export const types_analysis_lowercase_token_filter_languages = z.enum([ - 'greek', - 'irish', - 'turkish', + 'greek', + 'irish', + 'turkish' ]); -export const types_analysis_lowercase_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_lowercase_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['lowercase']), - language: z.optional(types_analysis_lowercase_token_filter_languages), - }) -); + language: z.optional(types_analysis_lowercase_token_filter_languages) +})); -export const types_analysis_min_hash_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_min_hash_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['min_hash']), - bucket_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of buckets to which hashes are assigned. Defaults to `512`.', - }) - ), - hash_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of ways to hash each token in the stream. Defaults to `1`.', - }) - ), - hash_set_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Number of hashes to keep from each bucket. Defaults to `1`.\nHashes are retained by ascending size, starting with the bucket’s smallest hash first.', - }) - ), - with_rotation: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the filter fills empty buckets with the value of the first non-empty bucket to its circular right if the `hash_set_size` is `1`. If the `bucket_count` argument is greater than 1, this parameter defaults to `true`. Otherwise, this parameter defaults to `false`.', - }) - ), - }) -); - -export const types_analysis_multiplexer_token_filter = types_analysis_token_filter_base.and( - z.object({ + bucket_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of buckets to which hashes are assigned. Defaults to `512`.' + })), + hash_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of ways to hash each token in the stream. Defaults to `1`.' + })), + hash_set_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of hashes to keep from each bucket. Defaults to `1`.\nHashes are retained by ascending size, starting with the bucket’s smallest hash first.' + })), + with_rotation: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the filter fills empty buckets with the value of the first non-empty bucket to its circular right if the `hash_set_size` is `1`. If the `bucket_count` argument is greater than 1, this parameter defaults to `true`. Otherwise, this parameter defaults to `false`.' + })) +})); + +export const types_analysis_multiplexer_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['multiplexer']), filters: z.array(z.string()).register(z.globalRegistry, { - description: 'A list of token filters to apply to incoming tokens.', + description: 'A list of token filters to apply to incoming tokens.' }), - preserve_original: z.optional(spec_utils_stringifiedboolean), - }) -); + preserve_original: z.optional(spec_utils_stringifiedboolean) +})); -export const types_analysis_n_gram_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_n_gram_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['ngram']), - max_gram: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum length of characters in a gram. Defaults to `2`.', - }) - ), - min_gram: z.optional( - z.number().register(z.globalRegistry, { - description: 'Minimum length of characters in a gram. Defaults to `1`.', - }) - ), - preserve_original: z.optional(spec_utils_stringifiedboolean), - }) -); - -export const types_analysis_nori_part_of_speech_token_filter = types_analysis_token_filter_base.and( - z.object({ + max_gram: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum length of characters in a gram. Defaults to `2`.' + })), + min_gram: z.optional(z.number().register(z.globalRegistry, { + description: 'Minimum length of characters in a gram. Defaults to `1`.' + })), + preserve_original: z.optional(spec_utils_stringifiedboolean) +})); + +export const types_analysis_nori_part_of_speech_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['nori_part_of_speech']), - stoptags: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'An array of part-of-speech tags that should be removed.', - }) - ), - }) -); - -export const types_analysis_pattern_capture_token_filter = types_analysis_token_filter_base.and( - z.object({ + stoptags: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'An array of part-of-speech tags that should be removed.' + })) +})); + +export const types_analysis_pattern_capture_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['pattern_capture']), patterns: z.array(z.string()).register(z.globalRegistry, { - description: 'A list of regular expressions to match.', + description: 'A list of regular expressions to match.' }), - preserve_original: z.optional(spec_utils_stringifiedboolean), - }) -); + preserve_original: z.optional(spec_utils_stringifiedboolean) +})); -export const types_analysis_pattern_replace_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_pattern_replace_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['pattern_replace']), - all: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, all substrings matching the pattern parameter’s regular expression are replaced. If `false`, the filter replaces only the first matching substring in each token. Defaults to `true`.', - }) - ), + all: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, all substrings matching the pattern parameter’s regular expression are replaced. If `false`, the filter replaces only the first matching substring in each token. Defaults to `true`.' + })), flags: z.optional(z.string()), pattern: z.string().register(z.globalRegistry, { - description: - 'Regular expression, written in Java’s regular expression syntax. The filter replaces token substrings matching this pattern with the substring in the `replacement` parameter.', - }), - replacement: z.optional( - z.string().register(z.globalRegistry, { - description: 'Replacement substring. Defaults to an empty substring (`""`).', - }) - ), - }) -); - -export const types_analysis_persian_normalization_token_filter = - types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['persian_normalization']), - }) - ); - -export const types_analysis_persian_stem_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['persian_stem']), - }) -); - -export const types_analysis_porter_stem_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['porter_stem']), - }) -); - -export const types_analysis_remove_duplicates_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['remove_duplicates']), - }) -); - -export const types_analysis_reverse_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['reverse']), - }) -); - -export const types_analysis_russian_stem_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['russian_stem']), - }) -); - -export const types_analysis_scandinavian_folding_token_filter = - types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['scandinavian_folding']), - }) - ); + description: 'Regular expression, written in Java’s regular expression syntax. The filter replaces token substrings matching this pattern with the substring in the `replacement` parameter.' + }), + replacement: z.optional(z.string().register(z.globalRegistry, { + description: 'Replacement substring. Defaults to an empty substring (`""`).' + })) +})); -export const types_analysis_scandinavian_normalization_token_filter = - types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['scandinavian_normalization']), - }) - ); +export const types_analysis_persian_normalization_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['persian_normalization']) +})); -export const types_analysis_serbian_normalization_token_filter = - types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['serbian_normalization']), - }) - ); +export const types_analysis_persian_stem_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['persian_stem']) +})); + +export const types_analysis_porter_stem_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['porter_stem']) +})); + +export const types_analysis_remove_duplicates_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['remove_duplicates']) +})); + +export const types_analysis_reverse_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['reverse']) +})); + +export const types_analysis_russian_stem_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['russian_stem']) +})); + +export const types_analysis_scandinavian_folding_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['scandinavian_folding']) +})); -export const types_analysis_shingle_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_scandinavian_normalization_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['scandinavian_normalization']) +})); + +export const types_analysis_serbian_normalization_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['serbian_normalization']) +})); + +export const types_analysis_shingle_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['shingle']), - filler_token: z.optional( - z.string().register(z.globalRegistry, { - description: - 'String used in shingles as a replacement for empty positions that do not contain a token. This filler token is only used in shingles, not original unigrams. Defaults to an underscore (`_`).', - }) - ), + filler_token: z.optional(z.string().register(z.globalRegistry, { + description: 'String used in shingles as a replacement for empty positions that do not contain a token. This filler token is only used in shingles, not original unigrams. Defaults to an underscore (`_`).' + })), max_shingle_size: z.optional(spec_utils_stringifiedinteger), min_shingle_size: z.optional(spec_utils_stringifiedinteger), - output_unigrams: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the output includes the original input tokens. If `false`, the output only includes shingles; the original input tokens are removed. Defaults to `true`.', - }) - ), - output_unigrams_if_no_shingles: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the output includes the original input tokens only if no shingles are produced; if shingles are produced, the output only includes shingles. Defaults to `false`.', - }) - ), - token_separator: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Separator used to concatenate adjacent tokens to form a shingle. Defaults to a space (`" "`).', - }) - ), - }) -); - -export const types_analysis_snowball_token_filter = types_analysis_token_filter_base.and( - z.object({ + output_unigrams: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the output includes the original input tokens. If `false`, the output only includes shingles; the original input tokens are removed. Defaults to `true`.' + })), + output_unigrams_if_no_shingles: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the output includes the original input tokens only if no shingles are produced; if shingles are produced, the output only includes shingles. Defaults to `false`.' + })), + token_separator: z.optional(z.string().register(z.globalRegistry, { + description: 'Separator used to concatenate adjacent tokens to form a shingle. Defaults to a space (`" "`).' + })) +})); + +export const types_analysis_snowball_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['snowball']), - language: z.optional(types_analysis_snowball_language), - }) -); + language: z.optional(types_analysis_snowball_language) +})); -export const types_analysis_sorani_normalization_token_filter = - types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['sorani_normalization']), - }) - ); +export const types_analysis_sorani_normalization_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['sorani_normalization']) +})); -export const types_analysis_stemmer_override_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_stemmer_override_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['stemmer_override']), - rules: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'A list of mapping rules to use.', - }) - ), - rules_path: z.optional( - z.string().register(z.globalRegistry, { - description: - 'A path (either relative to `config` location, or absolute) to a list of mappings.', - }) - ), - }) -); - -export const types_analysis_stemmer_token_filter = types_analysis_token_filter_base.and( - z.object({ + rules: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A list of mapping rules to use.' + })), + rules_path: z.optional(z.string().register(z.globalRegistry, { + description: 'A path (either relative to `config` location, or absolute) to a list of mappings.' + })) +})); + +export const types_analysis_stemmer_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['stemmer']), - language: z.optional(z.string()), - }) -); + language: z.optional(z.string()) +})); -export const types_analysis_stop_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_stop_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['stop']), - ignore_case: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, stop word matching is case insensitive. For example, if `true`, a stop word of the matches and removes `The`, `THE`, or `the`. Defaults to `false`.', - }) - ), - remove_trailing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the last token of a stream is removed if it’s a stop word. Defaults to `true`.', - }) - ), + ignore_case: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, stop word matching is case insensitive. For example, if `true`, a stop word of the matches and removes `The`, `THE`, or `the`. Defaults to `false`.' + })), + remove_trailing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the last token of a stream is removed if it’s a stop word. Defaults to `true`.' + })), stopwords: z.optional(types_analysis_stop_words), - stopwords_path: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Path to a file that contains a list of stop words to remove.\nThis path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each stop word in the file must be separated by a line break.', - }) - ), - }) -); + stopwords_path: z.optional(z.string().register(z.globalRegistry, { + description: 'Path to a file that contains a list of stop words to remove.\nThis path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each stop word in the file must be separated by a line break.' + })) +})); export const types_analysis_synonym_format = z.enum(['solr', 'wordnet']); -export const types_analysis_synonym_token_filter_base = types_analysis_token_filter_base.and( - z.object({ - expand: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Expands definitions for equivalent synonym rules. Defaults to `true`.', - }) - ), +export const types_analysis_synonym_token_filter_base = types_analysis_token_filter_base.and(z.object({ + expand: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Expands definitions for equivalent synonym rules. Defaults to `true`.' + })), format: z.optional(types_analysis_synonym_format), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` ignores errors while parsing the synonym rules. It is important to note that only those synonym rules which cannot get parsed are ignored. Defaults to the value of the `updateable` setting.', - }) - ), - synonyms: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'Used to define inline synonyms.', - }) - ), - synonyms_path: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Used to provide a synonym file. This path must be absolute or relative to the `config` location.', - }) - ), - synonyms_set: z.optional( - z.string().register(z.globalRegistry, { - description: 'Provide a synonym set created via Synonyms Management APIs.', - }) - ), - tokenizer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Controls the tokenizers that will be used to tokenize the synonym, this parameter is for backwards compatibility for indices that created before 6.0.', - }) - ), - updateable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` allows reloading search analyzers to pick up changes to synonym files. Only to be used for search analyzers. Defaults to `false`.', - }) - ), - }) -); - -export const types_analysis_synonym_graph_token_filter = - types_analysis_synonym_token_filter_base.and( - z.object({ - type: z.enum(['synonym_graph']), - }) - ); - -export const types_analysis_synonym_token_filter = types_analysis_synonym_token_filter_base.and( - z.object({ - type: z.enum(['synonym']), - }) -); - -export const types_analysis_trim_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['trim']), - }) -); - -export const types_analysis_truncate_token_filter = types_analysis_token_filter_base.and( - z.object({ + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` ignores errors while parsing the synonym rules. It is important to note that only those synonym rules which cannot get parsed are ignored. Defaults to the value of the `updateable` setting.' + })), + synonyms: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Used to define inline synonyms.' + })), + synonyms_path: z.optional(z.string().register(z.globalRegistry, { + description: 'Used to provide a synonym file. This path must be absolute or relative to the `config` location.' + })), + synonyms_set: z.optional(z.string().register(z.globalRegistry, { + description: 'Provide a synonym set created via Synonyms Management APIs.' + })), + tokenizer: z.optional(z.string().register(z.globalRegistry, { + description: 'Controls the tokenizers that will be used to tokenize the synonym, this parameter is for backwards compatibility for indices that created before 6.0.' + })), + updateable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` allows reloading search analyzers to pick up changes to synonym files. Only to be used for search analyzers. Defaults to `false`.' + })) +})); + +export const types_analysis_synonym_graph_token_filter = types_analysis_synonym_token_filter_base.and(z.object({ + type: z.enum(['synonym_graph']) +})); + +export const types_analysis_synonym_token_filter = types_analysis_synonym_token_filter_base.and(z.object({ + type: z.enum(['synonym']) +})); + +export const types_analysis_trim_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['trim']) +})); + +export const types_analysis_truncate_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['truncate']), - length: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Character limit for each token. Tokens exceeding this limit are truncated. Defaults to `10`.', - }) - ), - }) -); - -export const types_analysis_unique_token_filter = types_analysis_token_filter_base.and( - z.object({ + length: z.optional(z.number().register(z.globalRegistry, { + description: 'Character limit for each token. Tokens exceeding this limit are truncated. Defaults to `10`.' + })) +})); + +export const types_analysis_unique_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['unique']), - only_on_same_position: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, only remove duplicate tokens in the same position. Defaults to `false`.', - }) - ), - }) -); - -export const types_analysis_uppercase_token_filter = types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['uppercase']), - }) -); - -export const types_analysis_word_delimiter_token_filter_base = types_analysis_token_filter_base.and( - z.object({ - catenate_all: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the filter produces catenated tokens for chains of alphanumeric characters separated by non-alphabetic delimiters. Defaults to `false`.', - }) - ), - catenate_numbers: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the filter produces catenated tokens for chains of numeric characters separated by non-alphabetic delimiters. Defaults to `false`.', - }) - ), - catenate_words: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the filter produces catenated tokens for chains of alphabetical characters separated by non-alphabetic delimiters. Defaults to `false`.', - }) - ), - generate_number_parts: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the filter includes tokens consisting of only numeric characters in the output. If `false`, the filter excludes these tokens from the output. Defaults to `true`.', - }) - ), - generate_word_parts: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the filter includes tokens consisting of only alphabetical characters in the output. If `false`, the filter excludes these tokens from the output. Defaults to `true`.', - }) - ), + only_on_same_position: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, only remove duplicate tokens in the same position. Defaults to `false`.' + })) +})); + +export const types_analysis_uppercase_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['uppercase']) +})); + +export const types_analysis_word_delimiter_token_filter_base = types_analysis_token_filter_base.and(z.object({ + catenate_all: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the filter produces catenated tokens for chains of alphanumeric characters separated by non-alphabetic delimiters. Defaults to `false`.' + })), + catenate_numbers: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the filter produces catenated tokens for chains of numeric characters separated by non-alphabetic delimiters. Defaults to `false`.' + })), + catenate_words: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the filter produces catenated tokens for chains of alphabetical characters separated by non-alphabetic delimiters. Defaults to `false`.' + })), + generate_number_parts: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the filter includes tokens consisting of only numeric characters in the output. If `false`, the filter excludes these tokens from the output. Defaults to `true`.' + })), + generate_word_parts: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the filter includes tokens consisting of only alphabetical characters in the output. If `false`, the filter excludes these tokens from the output. Defaults to `true`.' + })), preserve_original: z.optional(spec_utils_stringifiedboolean), - protected_words: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'Array of tokens the filter won’t split.', - }) - ), - protected_words_path: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Path to a file that contains a list of tokens the filter won’t split.\nThis path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break.', - }) - ), - split_on_case_change: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the filter splits tokens at letter case transitions. For example: camelCase -> [ camel, Case ]. Defaults to `true`.', - }) - ), - split_on_numerics: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the filter splits tokens at letter-number transitions. For example: j2se -> [ j, 2, se ]. Defaults to `true`.', - }) - ), - stem_english_possessive: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `true`, the filter removes the English possessive (`'s`) from the end of each token. For example: O'Neil's -> [ O, Neil ]. Defaults to `true`.", - }) - ), - type_table: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'Array of custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters.', - }) - ), - type_table_path: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Path to a file that contains custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters.', - }) - ), - }) -); - -export const types_analysis_word_delimiter_graph_token_filter = - types_analysis_word_delimiter_token_filter_base.and( - z.object({ - type: z.enum(['word_delimiter_graph']), - adjust_offsets: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the filter adjusts the offsets of split or catenated tokens to better reflect their actual position in the token stream. Defaults to `true`.', - }) - ), - ignore_keywords: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the filter skips tokens with a keyword attribute of true. Defaults to `false`.', - }) - ), - }) - ); - -export const types_analysis_word_delimiter_token_filter = - types_analysis_word_delimiter_token_filter_base.and( - z.object({ - type: z.enum(['word_delimiter']), - }) - ); - -export const types_analysis_ja_stop_token_filter = types_analysis_token_filter_base.and( - z.object({ + protected_words: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Array of tokens the filter won’t split.' + })), + protected_words_path: z.optional(z.string().register(z.globalRegistry, { + description: 'Path to a file that contains a list of tokens the filter won’t split.\nThis path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break.' + })), + split_on_case_change: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the filter splits tokens at letter case transitions. For example: camelCase -> [ camel, Case ]. Defaults to `true`.' + })), + split_on_numerics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the filter splits tokens at letter-number transitions. For example: j2se -> [ j, 2, se ]. Defaults to `true`.' + })), + stem_english_possessive: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the filter removes the English possessive (`\'s`) from the end of each token. For example: O\'Neil\'s -> [ O, Neil ]. Defaults to `true`.' + })), + type_table: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Array of custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters.' + })), + type_table_path: z.optional(z.string().register(z.globalRegistry, { + description: 'Path to a file that contains custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters.' + })) +})); + +export const types_analysis_word_delimiter_graph_token_filter = types_analysis_word_delimiter_token_filter_base.and(z.object({ + type: z.enum(['word_delimiter_graph']), + adjust_offsets: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the filter adjusts the offsets of split or catenated tokens to better reflect their actual position in the token stream. Defaults to `true`.' + })), + ignore_keywords: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the filter skips tokens with a keyword attribute of true. Defaults to `false`.' + })) +})); + +export const types_analysis_word_delimiter_token_filter = types_analysis_word_delimiter_token_filter_base.and(z.object({ + type: z.enum(['word_delimiter']) +})); + +export const types_analysis_ja_stop_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['ja_stop']), - stopwords: z.optional(types_analysis_stop_words), - }) -); + stopwords: z.optional(types_analysis_stop_words) +})); -export const types_analysis_kuromoji_stemmer_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_kuromoji_stemmer_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['kuromoji_stemmer']), - minimum_length: z.number(), - }) -); + minimum_length: z.number() +})); -export const types_analysis_kuromoji_reading_form_token_filter = - types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['kuromoji_readingform']), - use_romaji: z.boolean(), - }) - ); +export const types_analysis_kuromoji_reading_form_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['kuromoji_readingform']), + use_romaji: z.boolean() +})); -export const types_analysis_kuromoji_part_of_speech_token_filter = - types_analysis_token_filter_base.and( - z.object({ - type: z.enum(['kuromoji_part_of_speech']), - stoptags: z.array(z.string()), - }) - ); +export const types_analysis_kuromoji_part_of_speech_token_filter = types_analysis_token_filter_base.and(z.object({ + type: z.enum(['kuromoji_part_of_speech']), + stoptags: z.array(z.string()) +})); export const types_analysis_icu_collation_alternate = z.enum(['shifted', 'non-ignorable']); @@ -11243,15 +8972,14 @@ export const types_analysis_icu_collation_case_first = z.enum(['lower', 'upper'] export const types_analysis_icu_collation_decomposition = z.enum(['no', 'identical']); export const types_analysis_icu_collation_strength = z.enum([ - 'primary', - 'secondary', - 'tertiary', - 'quaternary', - 'identical', + 'primary', + 'secondary', + 'tertiary', + 'quaternary', + 'identical' ]); -export const types_analysis_icu_collation_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_icu_collation_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['icu_collation']), alternate: z.optional(types_analysis_icu_collation_alternate), caseFirst: z.optional(types_analysis_icu_collation_case_first), @@ -11264,249 +8992,205 @@ export const types_analysis_icu_collation_token_filter = types_analysis_token_fi rules: z.optional(z.string()), strength: z.optional(types_analysis_icu_collation_strength), variableTop: z.optional(z.string()), - variant: z.optional(z.string()), - }) -); + variant: z.optional(z.string()) +})); -export const types_analysis_icu_folding_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_icu_folding_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['icu_folding']), - unicode_set_filter: z.string(), - }) -); + unicode_set_filter: z.string() +})); -export const types_analysis_icu_normalization_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_icu_normalization_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['icu_normalizer']), - name: types_analysis_icu_normalization_type, - }) -); + name: types_analysis_icu_normalization_type +})); export const types_analysis_icu_transform_direction = z.enum(['forward', 'reverse']); -export const types_analysis_icu_transform_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_icu_transform_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['icu_transform']), dir: z.optional(types_analysis_icu_transform_direction), - id: z.string(), - }) -); + id: z.string() +})); export const types_analysis_phonetic_encoder = z.enum([ - 'metaphone', - 'double_metaphone', - 'soundex', - 'refined_soundex', - 'caverphone1', - 'caverphone2', - 'cologne', - 'nysiis', - 'koelnerphonetik', - 'haasephonetik', - 'beider_morse', - 'daitch_mokotoff', + 'metaphone', + 'double_metaphone', + 'soundex', + 'refined_soundex', + 'caverphone1', + 'caverphone2', + 'cologne', + 'nysiis', + 'koelnerphonetik', + 'haasephonetik', + 'beider_morse', + 'daitch_mokotoff' ]); export const types_analysis_phonetic_language = z.enum([ - 'any', - 'common', - 'cyrillic', - 'english', - 'french', - 'german', - 'hebrew', - 'hungarian', - 'polish', - 'romanian', - 'russian', - 'spanish', -]); - -export const types_analysis_phonetic_name_type = z.enum(['generic', 'ashkenazi', 'sephardic']); + 'any', + 'common', + 'cyrillic', + 'english', + 'french', + 'german', + 'hebrew', + 'hungarian', + 'polish', + 'romanian', + 'russian', + 'spanish' +]); + +export const types_analysis_phonetic_name_type = z.enum([ + 'generic', + 'ashkenazi', + 'sephardic' +]); export const types_analysis_phonetic_rule_type = z.enum(['approx', 'exact']); -export const types_analysis_phonetic_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_phonetic_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['phonetic']), encoder: types_analysis_phonetic_encoder, - languageset: z.optional( - z.union([types_analysis_phonetic_language, z.array(types_analysis_phonetic_language)]) - ), + languageset: z.optional(z.union([ + types_analysis_phonetic_language, + z.array(types_analysis_phonetic_language) + ])), max_code_len: z.optional(z.number()), name_type: z.optional(types_analysis_phonetic_name_type), replace: z.optional(z.boolean()), - rule_type: z.optional(types_analysis_phonetic_rule_type), - }) -); + rule_type: z.optional(types_analysis_phonetic_rule_type) +})); -export const types_analysis_dictionary_decompounder_token_filter = - types_analysis_compound_word_token_filter_base.and( - z.object({ - type: z.enum(['dictionary_decompounder']), - }) - ); +export const types_analysis_dictionary_decompounder_token_filter = types_analysis_compound_word_token_filter_base.and(z.object({ + type: z.enum(['dictionary_decompounder']) +})); export const types_analysis_lowercase_normalizer = z.object({ - type: z.enum(['lowercase']), + type: z.enum(['lowercase']) }); export const types_analysis_custom_normalizer = z.object({ - type: z.enum(['custom']), - char_filter: z.optional(z.array(z.string())), - filter: z.optional(z.array(z.string())), + type: z.enum(['custom']), + char_filter: z.optional(z.array(z.string())), + filter: z.optional(z.array(z.string())) }); export const types_analysis_normalizer = z.union([ - z - .object({ - type: z.literal('lowercase'), - }) - .and(types_analysis_lowercase_normalizer), - z - .object({ - type: z.literal('custom'), - }) - .and(types_analysis_custom_normalizer), + z.object({ + type: z.literal('lowercase') + }).and(types_analysis_lowercase_normalizer), + z.object({ + type: z.literal('custom') + }).and(types_analysis_custom_normalizer) ]); export const types_analysis_tokenizer_base = z.object({ - version: z.optional(types_version_string), + version: z.optional(types_version_string) }); -export const types_analysis_char_group_tokenizer = types_analysis_tokenizer_base.and( - z.object({ +export const types_analysis_char_group_tokenizer = types_analysis_tokenizer_base.and(z.object({ type: z.enum(['char_group']), tokenize_on_chars: z.array(z.string()), - max_token_length: z.optional(z.number()), - }) -); + max_token_length: z.optional(z.number()) +})); -export const types_analysis_classic_tokenizer = types_analysis_tokenizer_base.and( - z.object({ +export const types_analysis_classic_tokenizer = types_analysis_tokenizer_base.and(z.object({ type: z.enum(['classic']), - max_token_length: z.optional(z.number()), - }) -); + max_token_length: z.optional(z.number()) +})); export const types_analysis_token_char = z.enum([ - 'letter', - 'digit', - 'whitespace', - 'punctuation', - 'symbol', - 'custom', + 'letter', + 'digit', + 'whitespace', + 'punctuation', + 'symbol', + 'custom' ]); -export const types_analysis_edge_n_gram_tokenizer = types_analysis_tokenizer_base.and( - z.object({ +export const types_analysis_edge_n_gram_tokenizer = types_analysis_tokenizer_base.and(z.object({ type: z.enum(['edge_ngram']), custom_token_chars: z.optional(z.string()), max_gram: z.optional(z.number()), min_gram: z.optional(z.number()), - token_chars: z.optional(z.array(types_analysis_token_char)), - }) -); + token_chars: z.optional(z.array(types_analysis_token_char)) +})); -export const types_analysis_keyword_tokenizer = types_analysis_tokenizer_base.and( - z.object({ +export const types_analysis_keyword_tokenizer = types_analysis_tokenizer_base.and(z.object({ type: z.enum(['keyword']), - buffer_size: z.optional(z.number()), - }) -); - -export const types_analysis_letter_tokenizer = types_analysis_tokenizer_base.and( - z.object({ - type: z.enum(['letter']), - }) -); - -export const types_analysis_lowercase_tokenizer = types_analysis_tokenizer_base.and( - z.object({ - type: z.enum(['lowercase']), - }) -); + buffer_size: z.optional(z.number()) +})); + +export const types_analysis_letter_tokenizer = types_analysis_tokenizer_base.and(z.object({ + type: z.enum(['letter']) +})); -export const types_analysis_n_gram_tokenizer = types_analysis_tokenizer_base.and( - z.object({ +export const types_analysis_lowercase_tokenizer = types_analysis_tokenizer_base.and(z.object({ + type: z.enum(['lowercase']) +})); + +export const types_analysis_n_gram_tokenizer = types_analysis_tokenizer_base.and(z.object({ type: z.enum(['ngram']), custom_token_chars: z.optional(z.string()), max_gram: z.optional(z.number()), min_gram: z.optional(z.number()), - token_chars: z.optional(z.array(types_analysis_token_char)), - }) -); + token_chars: z.optional(z.array(types_analysis_token_char)) +})); -export const types_analysis_path_hierarchy_tokenizer = types_analysis_tokenizer_base.and( - z.object({ +export const types_analysis_path_hierarchy_tokenizer = types_analysis_tokenizer_base.and(z.object({ type: z.enum(['path_hierarchy']), buffer_size: z.optional(spec_utils_stringifiedinteger), delimiter: z.optional(z.string()), replacement: z.optional(z.string()), reverse: z.optional(spec_utils_stringifiedboolean), - skip: z.optional(spec_utils_stringifiedinteger), - }) -); + skip: z.optional(spec_utils_stringifiedinteger) +})); -export const types_analysis_pattern_tokenizer = types_analysis_tokenizer_base.and( - z.object({ +export const types_analysis_pattern_tokenizer = types_analysis_tokenizer_base.and(z.object({ type: z.enum(['pattern']), flags: z.optional(z.string()), group: z.optional(z.number()), - pattern: z.optional(z.string()), - }) -); + pattern: z.optional(z.string()) +})); -export const types_analysis_simple_pattern_tokenizer = types_analysis_tokenizer_base.and( - z.object({ +export const types_analysis_simple_pattern_tokenizer = types_analysis_tokenizer_base.and(z.object({ type: z.enum(['simple_pattern']), - pattern: z.optional(z.string()), - }) -); + pattern: z.optional(z.string()) +})); -export const types_analysis_simple_pattern_split_tokenizer = types_analysis_tokenizer_base.and( - z.object({ +export const types_analysis_simple_pattern_split_tokenizer = types_analysis_tokenizer_base.and(z.object({ type: z.enum(['simple_pattern_split']), - pattern: z.optional(z.string()), - }) -); + pattern: z.optional(z.string()) +})); -export const types_analysis_standard_tokenizer = types_analysis_tokenizer_base.and( - z.object({ +export const types_analysis_standard_tokenizer = types_analysis_tokenizer_base.and(z.object({ type: z.enum(['standard']), - max_token_length: z.optional(z.number()), - }) -); + max_token_length: z.optional(z.number()) +})); -export const types_analysis_thai_tokenizer = types_analysis_tokenizer_base.and( - z.object({ - type: z.enum(['thai']), - }) -); +export const types_analysis_thai_tokenizer = types_analysis_tokenizer_base.and(z.object({ + type: z.enum(['thai']) +})); -export const types_analysis_uax_email_url_tokenizer = types_analysis_tokenizer_base.and( - z.object({ +export const types_analysis_uax_email_url_tokenizer = types_analysis_tokenizer_base.and(z.object({ type: z.enum(['uax_url_email']), - max_token_length: z.optional(z.number()), - }) -); + max_token_length: z.optional(z.number()) +})); -export const types_analysis_whitespace_tokenizer = types_analysis_tokenizer_base.and( - z.object({ +export const types_analysis_whitespace_tokenizer = types_analysis_tokenizer_base.and(z.object({ type: z.enum(['whitespace']), - max_token_length: z.optional(z.number()), - }) -); + max_token_length: z.optional(z.number()) +})); -export const types_analysis_icu_tokenizer = types_analysis_tokenizer_base.and( - z.object({ +export const types_analysis_icu_tokenizer = types_analysis_tokenizer_base.and(z.object({ type: z.enum(['icu_tokenizer']), - rule_files: z.string(), - }) -); + rule_files: z.string() +})); -export const types_analysis_kuromoji_tokenizer = types_analysis_tokenizer_base.and( - z.object({ +export const types_analysis_kuromoji_tokenizer = types_analysis_tokenizer_base.and(z.object({ type: z.enum(['kuromoji_tokenizer']), discard_punctuation: z.optional(z.boolean()), mode: types_analysis_kuromoji_tokenization_mode, @@ -11514,157 +9198,143 @@ export const types_analysis_kuromoji_tokenizer = types_analysis_tokenizer_base.a nbest_examples: z.optional(z.string()), user_dictionary: z.optional(z.string()), user_dictionary_rules: z.optional(z.array(z.string())), - discard_compound_token: z.optional(z.boolean()), - }) -); + discard_compound_token: z.optional(z.boolean()) +})); -export const types_analysis_nori_tokenizer = types_analysis_tokenizer_base.and( - z.object({ +export const types_analysis_nori_tokenizer = types_analysis_tokenizer_base.and(z.object({ type: z.enum(['nori_tokenizer']), decompound_mode: z.optional(types_analysis_nori_decompound_mode), discard_punctuation: z.optional(z.boolean()), user_dictionary: z.optional(z.string()), - user_dictionary_rules: z.optional(z.array(z.string())), - }) -); + user_dictionary_rules: z.optional(z.array(z.string())) +})); export const types_analysis_tokenizer_definition = z.union([ - z - .object({ - type: z.literal('char_group'), - }) - .and(types_analysis_char_group_tokenizer), - z - .object({ - type: z.literal('classic'), - }) - .and(types_analysis_classic_tokenizer), - z - .object({ - type: z.literal('edge_ngram'), - }) - .and(types_analysis_edge_n_gram_tokenizer), - z - .object({ - type: z.literal('keyword'), - }) - .and(types_analysis_keyword_tokenizer), - z - .object({ - type: z.literal('letter'), - }) - .and(types_analysis_letter_tokenizer), - z - .object({ - type: z.literal('lowercase'), - }) - .and(types_analysis_lowercase_tokenizer), - z - .object({ - type: z.literal('ngram'), - }) - .and(types_analysis_n_gram_tokenizer), - z - .object({ - type: z.literal('path_hierarchy'), - }) - .and(types_analysis_path_hierarchy_tokenizer), - z - .object({ - type: z.literal('pattern'), - }) - .and(types_analysis_pattern_tokenizer), - z - .object({ - type: z.literal('simple_pattern'), - }) - .and(types_analysis_simple_pattern_tokenizer), - z - .object({ - type: z.literal('simple_pattern_split'), - }) - .and(types_analysis_simple_pattern_split_tokenizer), - z - .object({ - type: z.literal('standard'), - }) - .and(types_analysis_standard_tokenizer), - z - .object({ - type: z.literal('thai'), - }) - .and(types_analysis_thai_tokenizer), - z - .object({ - type: z.literal('uax_url_email'), - }) - .and(types_analysis_uax_email_url_tokenizer), - z - .object({ - type: z.literal('whitespace'), - }) - .and(types_analysis_whitespace_tokenizer), - z - .object({ - type: z.literal('icu_tokenizer'), - }) - .and(types_analysis_icu_tokenizer), - z - .object({ - type: z.literal('kuromoji_tokenizer'), - }) - .and(types_analysis_kuromoji_tokenizer), - z - .object({ - type: z.literal('nori_tokenizer'), - }) - .and(types_analysis_nori_tokenizer), + z.object({ + type: z.literal('char_group') + }).and(types_analysis_char_group_tokenizer), + z.object({ + type: z.literal('classic') + }).and(types_analysis_classic_tokenizer), + z.object({ + type: z.literal('edge_ngram') + }).and(types_analysis_edge_n_gram_tokenizer), + z.object({ + type: z.literal('keyword') + }).and(types_analysis_keyword_tokenizer), + z.object({ + type: z.literal('letter') + }).and(types_analysis_letter_tokenizer), + z.object({ + type: z.literal('lowercase') + }).and(types_analysis_lowercase_tokenizer), + z.object({ + type: z.literal('ngram') + }).and(types_analysis_n_gram_tokenizer), + z.object({ + type: z.literal('path_hierarchy') + }).and(types_analysis_path_hierarchy_tokenizer), + z.object({ + type: z.literal('pattern') + }).and(types_analysis_pattern_tokenizer), + z.object({ + type: z.literal('simple_pattern') + }).and(types_analysis_simple_pattern_tokenizer), + z.object({ + type: z.literal('simple_pattern_split') + }).and(types_analysis_simple_pattern_split_tokenizer), + z.object({ + type: z.literal('standard') + }).and(types_analysis_standard_tokenizer), + z.object({ + type: z.literal('thai') + }).and(types_analysis_thai_tokenizer), + z.object({ + type: z.literal('uax_url_email') + }).and(types_analysis_uax_email_url_tokenizer), + z.object({ + type: z.literal('whitespace') + }).and(types_analysis_whitespace_tokenizer), + z.object({ + type: z.literal('icu_tokenizer') + }).and(types_analysis_icu_tokenizer), + z.object({ + type: z.literal('kuromoji_tokenizer') + }).and(types_analysis_kuromoji_tokenizer), + z.object({ + type: z.literal('nori_tokenizer') + }).and(types_analysis_nori_tokenizer) ]); -export const types_analysis_tokenizer = z.union([z.string(), types_analysis_tokenizer_definition]); +export const types_analysis_tokenizer = z.union([ + z.string(), + types_analysis_tokenizer_definition +]); export const indices_types_index_settings_time_series = z.object({ - end_time: z.optional(types_date_time), - start_time: z.optional(types_date_time), + end_time: z.optional(types_date_time), + start_time: z.optional(types_date_time) }); export const indices_types_cache_queries = z.object({ - enabled: z.boolean(), + enabled: z.boolean() }); export const indices_types_queries = z.object({ - cache: z.optional(indices_types_cache_queries), + cache: z.optional(indices_types_cache_queries) }); export const indices_types_settings_similarity_bm25 = z.object({ - type: z.enum(['BM25']), - b: z.optional(z.number()), - discount_overlaps: z.optional(z.boolean()), - k1: z.optional(z.number()), + type: z.enum(['BM25']), + b: z.optional(z.number()), + discount_overlaps: z.optional(z.boolean()), + k1: z.optional(z.number()) }); export const indices_types_settings_similarity_boolean = z.object({ - type: z.enum(['boolean']), + type: z.enum(['boolean']) }); -export const types_dfi_independence_measure = z.enum(['standardized', 'saturated', 'chisquared']); +export const types_dfi_independence_measure = z.enum([ + 'standardized', + 'saturated', + 'chisquared' +]); export const indices_types_settings_similarity_dfi = z.object({ - type: z.enum(['DFI']), - independence_measure: types_dfi_independence_measure, + type: z.enum(['DFI']), + independence_measure: types_dfi_independence_measure }); -export const types_dfr_after_effect = z.enum(['no', 'b', 'l']); +export const types_dfr_after_effect = z.enum([ + 'no', + 'b', + 'l' +]); -export const types_dfr_basic_model = z.enum(['be', 'd', 'g', 'if', 'in', 'ine', 'p']); +export const types_dfr_basic_model = z.enum([ + 'be', + 'd', + 'g', + 'if', + 'in', + 'ine', + 'p' +]); -export const types_normalization = z.enum(['no', 'h1', 'h2', 'h3', 'z']); +export const types_normalization = z.enum([ + 'no', + 'h1', + 'h2', + 'h3', + 'z' +]); export const indices_types_settings_similarity_dfr = z.object({ - type: z.enum(['DFR']), - after_effect: types_dfr_after_effect, - basic_model: types_dfr_basic_model, - normalization: types_normalization, + type: z.enum(['DFR']), + after_effect: types_dfr_after_effect, + basic_model: types_dfr_basic_model, + normalization: types_normalization }); export const types_ib_distribution = z.enum(['ll', 'spl']); @@ -11672,83 +9342,77 @@ export const types_ib_distribution = z.enum(['ll', 'spl']); export const types_ib_lambda = z.enum(['df', 'ttf']); export const indices_types_settings_similarity_ib = z.object({ - type: z.enum(['IB']), - distribution: types_ib_distribution, - lambda: types_ib_lambda, - normalization: types_normalization, + type: z.enum(['IB']), + distribution: types_ib_distribution, + lambda: types_ib_lambda, + normalization: types_normalization }); export const indices_types_settings_similarity_lmd = z.object({ - type: z.enum(['LMDirichlet']), - mu: z.optional(z.number()), + type: z.enum(['LMDirichlet']), + mu: z.optional(z.number()) }); export const indices_types_settings_similarity_lmj = z.object({ - type: z.enum(['LMJelinekMercer']), - lambda: z.optional(z.number()), + type: z.enum(['LMJelinekMercer']), + lambda: z.optional(z.number()) }); export const indices_types_mapping_limit_settings_total_fields = z.object({ - limit: z.optional(z.union([z.number(), z.string()])), - ignore_dynamic_beyond_limit: z.optional(z.union([z.boolean(), z.string()])), + limit: z.optional(z.union([ + z.number(), + z.string() + ])), + ignore_dynamic_beyond_limit: z.optional(z.union([ + z.boolean(), + z.string() + ])) }); export const indices_types_mapping_limit_settings_depth = z.object({ - limit: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum depth for a field, which is measured as the number of inner objects. For instance, if all fields are defined\nat the root object level, then the depth is 1. If there is one object mapping, then the depth is 2, etc.', - }) - ), + limit: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum depth for a field, which is measured as the number of inner objects. For instance, if all fields are defined\nat the root object level, then the depth is 1. If there is one object mapping, then the depth is 2, etc.' + })) }); export const indices_types_mapping_limit_settings_nested_fields = z.object({ - limit: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of distinct nested mappings in an index. The nested type should only be used in special cases, when\narrays of objects need to be queried independently of each other. To safeguard against poorly designed mappings, this\nsetting limits the number of unique nested types per index.', - }) - ), + limit: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of distinct nested mappings in an index. The nested type should only be used in special cases, when\narrays of objects need to be queried independently of each other. To safeguard against poorly designed mappings, this\nsetting limits the number of unique nested types per index.' + })) }); export const indices_types_mapping_limit_settings_nested_objects = z.object({ - limit: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of nested JSON objects that a single document can contain across all nested types. This limit helps\nto prevent out of memory errors when a document contains too many nested objects.', - }) - ), + limit: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of nested JSON objects that a single document can contain across all nested types. This limit helps\nto prevent out of memory errors when a document contains too many nested objects.' + })) }); export const indices_types_mapping_limit_settings_field_name_length = z.object({ - limit: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Setting for the maximum length of a field name. This setting isn’t really something that addresses mappings explosion but\nmight still be useful if you want to limit the field length. It usually shouldn’t be necessary to set this setting. The\ndefault is okay unless a user starts to add a huge number of fields with really long names. Default is `Long.MAX_VALUE` (no limit).', - }) - ), + limit: z.optional(z.number().register(z.globalRegistry, { + description: 'Setting for the maximum length of a field name. This setting isn’t really something that addresses mappings explosion but\nmight still be useful if you want to limit the field length. It usually shouldn’t be necessary to set this setting. The\ndefault is okay unless a user starts to add a huge number of fields with really long names. Default is `Long.MAX_VALUE` (no limit).' + })) }); export const indices_types_mapping_limit_settings_dimension_fields = z.object({ - limit: z.optional( - z.number().register(z.globalRegistry, { - description: - '[preview] This functionality is in technical preview and may be changed or removed in a future release.\nElastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.', - }) - ), + limit: z.optional(z.number().register(z.globalRegistry, { + description: '[preview] This functionality is in technical preview and may be changed or removed in a future release.\nElastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.' + })) }); -export const indices_types_source_mode = z.enum(['disabled', 'stored', 'synthetic']); +export const indices_types_source_mode = z.enum([ + 'disabled', + 'stored', + 'synthetic' +]); export const indices_types_mapping_limit_settings_source_fields = z.object({ - mode: indices_types_source_mode, + mode: indices_types_source_mode }); /** * Mapping Limit Settings */ -export const indices_types_mapping_limit_settings = z - .object({ +export const indices_types_mapping_limit_settings = z.object({ coerce: z.optional(z.boolean()), total_fields: z.optional(indices_types_mapping_limit_settings_total_fields), depth: z.optional(indices_types_mapping_limit_settings_depth), @@ -11757,183 +9421,169 @@ export const indices_types_mapping_limit_settings = z field_name_length: z.optional(indices_types_mapping_limit_settings_field_name_length), dimension_fields: z.optional(indices_types_mapping_limit_settings_dimension_fields), source: z.optional(indices_types_mapping_limit_settings_source_fields), - ignore_malformed: z.optional(z.union([z.boolean(), z.string()])), - }) - .register(z.globalRegistry, { - description: 'Mapping Limit Settings', - }); + ignore_malformed: z.optional(z.union([ + z.boolean(), + z.string() + ])) +}).register(z.globalRegistry, { + description: 'Mapping Limit Settings' +}); export const indices_types_indexing_slowlog_tresholds = z.object({ - index: z.optional(indices_types_slowlog_treshold_levels), + index: z.optional(indices_types_slowlog_treshold_levels) }); export const indices_types_indexing_slowlog_settings = z.object({ - level: z.optional(z.string()), - source: z.optional(z.number()), - reformat: z.optional(z.boolean()), - threshold: z.optional(indices_types_indexing_slowlog_tresholds), + level: z.optional(z.string()), + source: z.optional(z.number()), + reformat: z.optional(z.boolean()), + threshold: z.optional(indices_types_indexing_slowlog_tresholds) }); export const indices_types_indexing_pressure_memory = z.object({ - limit: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Number of outstanding bytes that may be consumed by indexing requests. When this limit is reached or exceeded,\nthe node will reject new coordinating and primary operations. When replica operations consume 1.5x this limit,\nthe node will reject new replica operations. Defaults to 10% of the heap.', - }) - ), + limit: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of outstanding bytes that may be consumed by indexing requests. When this limit is reached or exceeded,\nthe node will reject new coordinating and primary operations. When replica operations consume 1.5x this limit,\nthe node will reject new replica operations. Defaults to 10% of the heap.' + })) }); export const indices_types_indexing_pressure = z.object({ - memory: indices_types_indexing_pressure_memory, + memory: indices_types_indexing_pressure_memory }); export const indices_types_storage_type = z.union([ - z.enum(['fs', 'niofs', 'mmapfs', 'hybridfs']), - z.string(), + z.enum([ + 'fs', + 'niofs', + 'mmapfs', + 'hybridfs' + ]), + z.string() ]); export const indices_types_storage = z.object({ - type: indices_types_storage_type, - allow_mmap: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'You can restrict the use of the mmapfs and the related hybridfs store type via the setting node.store.allow_mmap.\nThis is a boolean setting indicating whether or not memory-mapping is allowed. The default is to allow it. This\nsetting is useful, for example, if you are in an environment where you can not control the ability to create a lot\nof memory maps so you need disable the ability to use memory-mapping.', - }) - ), - stats_refresh_interval: z.optional(types_duration), + type: indices_types_storage_type, + allow_mmap: z.optional(z.boolean().register(z.globalRegistry, { + description: 'You can restrict the use of the mmapfs and the related hybridfs store type via the setting node.store.allow_mmap.\nThis is a boolean setting indicating whether or not memory-mapping is allowed. The default is to allow it. This\nsetting is useful, for example, if you are in an environment where you can not control the ability to create a lot\nof memory maps so you need disable the ability to use memory-mapping.' + })), + stats_refresh_interval: z.optional(types_duration) }); export const ccr_follow_info_follower_index_parameters = z.object({ - max_outstanding_read_requests: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of outstanding reads requests from the remote cluster.', - }) - ), - max_outstanding_write_requests: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of outstanding write requests on the follower.', - }) - ), - max_read_request_operation_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of operations to pull per read from the remote cluster.', - }) - ), - max_read_request_size: z.optional(types_byte_size), - max_retry_delay: z.optional(types_duration), - max_write_buffer_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be\ndeferred until the number of queued operations goes below the limit.', - }) - ), - max_write_buffer_size: z.optional(types_byte_size), - max_write_request_operation_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of operations per bulk write request executed on the follower.', - }) - ), - max_write_request_size: z.optional(types_byte_size), - read_poll_timeout: z.optional(types_duration), + max_outstanding_read_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of outstanding reads requests from the remote cluster.' + })), + max_outstanding_write_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of outstanding write requests on the follower.' + })), + max_read_request_operation_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of operations to pull per read from the remote cluster.' + })), + max_read_request_size: z.optional(types_byte_size), + max_retry_delay: z.optional(types_duration), + max_write_buffer_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be\ndeferred until the number of queued operations goes below the limit.' + })), + max_write_buffer_size: z.optional(types_byte_size), + max_write_request_operation_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of operations per bulk write request executed on the follower.' + })), + max_write_request_size: z.optional(types_byte_size), + read_poll_timeout: z.optional(types_duration) }); export const ccr_follow_info_follower_index_status = z.enum(['active', 'paused']); export const ccr_follow_info_follower_index = z.object({ - follower_index: types_index_name, - leader_index: types_index_name, - parameters: z.optional(ccr_follow_info_follower_index_parameters), - remote_cluster: types_name, - status: ccr_follow_info_follower_index_status, + follower_index: types_index_name, + leader_index: types_index_name, + parameters: z.optional(ccr_follow_info_follower_index_parameters), + remote_cluster: types_name, + status: ccr_follow_info_follower_index_status }); export const ccr_types_read_exception = z.object({ - exception: types_error_cause, - from_seq_no: types_sequence_number, - retries: z.number().register(z.globalRegistry, { - description: 'The number of times the batch has been retried.', - }), + exception: types_error_cause, + from_seq_no: types_sequence_number, + retries: z.number().register(z.globalRegistry, { + description: 'The number of times the batch has been retried.' + }) }); export const ccr_types_shard_stats = z.object({ - bytes_read: z.number().register(z.globalRegistry, { - description: - 'The total of transferred bytes read from the leader.\nThis is only an estimate and does not account for compression if enabled.', - }), - failed_read_requests: z.number().register(z.globalRegistry, { - description: 'The number of failed reads.', - }), - failed_write_requests: z.number().register(z.globalRegistry, { - description: 'The number of failed bulk write requests on the follower.', - }), - fatal_exception: z.optional(types_error_cause), - follower_aliases_version: types_version_number, - follower_global_checkpoint: z.number().register(z.globalRegistry, { - description: - 'The current global checkpoint on the follower.\nThe difference between the `leader_global_checkpoint` and the `follower_global_checkpoint` is an indication of how much the follower is lagging the leader.', - }), - follower_index: z.string().register(z.globalRegistry, { - description: 'The name of the follower index.', - }), - follower_mapping_version: types_version_number, - follower_max_seq_no: types_sequence_number, - follower_settings_version: types_version_number, - last_requested_seq_no: types_sequence_number, - leader_global_checkpoint: z.number().register(z.globalRegistry, { - description: 'The current global checkpoint on the leader known to the follower task.', - }), - leader_index: z.string().register(z.globalRegistry, { - description: 'The name of the index in the leader cluster being followed.', - }), - leader_max_seq_no: types_sequence_number, - operations_read: z.number().register(z.globalRegistry, { - description: 'The total number of operations read from the leader.', - }), - operations_written: z.number().register(z.globalRegistry, { - description: 'The number of operations written on the follower.', - }), - outstanding_read_requests: z.number().register(z.globalRegistry, { - description: 'The number of active read requests from the follower.', - }), - outstanding_write_requests: z.number().register(z.globalRegistry, { - description: 'The number of active bulk write requests on the follower.', - }), - read_exceptions: z.array(ccr_types_read_exception).register(z.globalRegistry, { - description: 'An array of objects representing failed reads.', - }), - remote_cluster: z.string().register(z.globalRegistry, { - description: 'The remote cluster containing the leader index.', - }), - shard_id: z.number().register(z.globalRegistry, { - description: - 'The numerical shard ID, with values from 0 to one less than the number of replicas.', - }), - successful_read_requests: z.number().register(z.globalRegistry, { - description: 'The number of successful fetches.', - }), - successful_write_requests: z.number().register(z.globalRegistry, { - description: 'The number of bulk write requests run on the follower.', - }), - time_since_last_read: z.optional(types_duration), - time_since_last_read_millis: types_duration_value_unit_millis, - total_read_remote_exec_time: z.optional(types_duration), - total_read_remote_exec_time_millis: types_duration_value_unit_millis, - total_read_time: z.optional(types_duration), - total_read_time_millis: types_duration_value_unit_millis, - total_write_time: z.optional(types_duration), - total_write_time_millis: types_duration_value_unit_millis, - write_buffer_operation_count: z.number().register(z.globalRegistry, { - description: 'The number of write operations queued on the follower.', - }), - write_buffer_size_in_bytes: types_byte_size, + bytes_read: z.number().register(z.globalRegistry, { + description: 'The total of transferred bytes read from the leader.\nThis is only an estimate and does not account for compression if enabled.' + }), + failed_read_requests: z.number().register(z.globalRegistry, { + description: 'The number of failed reads.' + }), + failed_write_requests: z.number().register(z.globalRegistry, { + description: 'The number of failed bulk write requests on the follower.' + }), + fatal_exception: z.optional(types_error_cause), + follower_aliases_version: types_version_number, + follower_global_checkpoint: z.number().register(z.globalRegistry, { + description: 'The current global checkpoint on the follower.\nThe difference between the `leader_global_checkpoint` and the `follower_global_checkpoint` is an indication of how much the follower is lagging the leader.' + }), + follower_index: z.string().register(z.globalRegistry, { + description: 'The name of the follower index.' + }), + follower_mapping_version: types_version_number, + follower_max_seq_no: types_sequence_number, + follower_settings_version: types_version_number, + last_requested_seq_no: types_sequence_number, + leader_global_checkpoint: z.number().register(z.globalRegistry, { + description: 'The current global checkpoint on the leader known to the follower task.' + }), + leader_index: z.string().register(z.globalRegistry, { + description: 'The name of the index in the leader cluster being followed.' + }), + leader_max_seq_no: types_sequence_number, + operations_read: z.number().register(z.globalRegistry, { + description: 'The total number of operations read from the leader.' + }), + operations_written: z.number().register(z.globalRegistry, { + description: 'The number of operations written on the follower.' + }), + outstanding_read_requests: z.number().register(z.globalRegistry, { + description: 'The number of active read requests from the follower.' + }), + outstanding_write_requests: z.number().register(z.globalRegistry, { + description: 'The number of active bulk write requests on the follower.' + }), + read_exceptions: z.array(ccr_types_read_exception).register(z.globalRegistry, { + description: 'An array of objects representing failed reads.' + }), + remote_cluster: z.string().register(z.globalRegistry, { + description: 'The remote cluster containing the leader index.' + }), + shard_id: z.number().register(z.globalRegistry, { + description: 'The numerical shard ID, with values from 0 to one less than the number of replicas.' + }), + successful_read_requests: z.number().register(z.globalRegistry, { + description: 'The number of successful fetches.' + }), + successful_write_requests: z.number().register(z.globalRegistry, { + description: 'The number of bulk write requests run on the follower.' + }), + time_since_last_read: z.optional(types_duration), + time_since_last_read_millis: types_duration_value_unit_millis, + total_read_remote_exec_time: z.optional(types_duration), + total_read_remote_exec_time_millis: types_duration_value_unit_millis, + total_read_time: z.optional(types_duration), + total_read_time_millis: types_duration_value_unit_millis, + total_write_time: z.optional(types_duration), + total_write_time_millis: types_duration_value_unit_millis, + write_buffer_operation_count: z.number().register(z.globalRegistry, { + description: 'The number of write operations queued on the follower.' + }), + write_buffer_size_in_bytes: types_byte_size }); export const ccr_types_follow_index_stats = z.object({ - index: types_index_name, - shards: z.array(ccr_types_shard_stats).register(z.globalRegistry, { - description: 'An array of shard-level following task statistics.', - }), + index: types_index_name, + shards: z.array(ccr_types_shard_stats).register(z.globalRegistry, { + description: 'An array of shard-level following task statistics.' + }) }); export const types_index_pattern = z.string(); @@ -11941,122 +9591,123 @@ export const types_index_pattern = z.string(); export const types_index_patterns = z.array(types_index_pattern); export const ccr_get_auto_follow_pattern_auto_follow_pattern_summary = z.object({ - active: z.boolean(), - remote_cluster: z.string().register(z.globalRegistry, { - description: 'The remote cluster containing the leader indices to match against.', - }), - follow_index_pattern: z.optional(types_index_pattern), - leader_index_patterns: types_index_patterns, - leader_index_exclusion_patterns: types_index_patterns, - max_outstanding_read_requests: z.number().register(z.globalRegistry, { - description: 'The maximum number of outstanding reads requests from the remote cluster.', - }), + active: z.boolean(), + remote_cluster: z.string().register(z.globalRegistry, { + description: 'The remote cluster containing the leader indices to match against.' + }), + follow_index_pattern: z.optional(types_index_pattern), + leader_index_patterns: types_index_patterns, + leader_index_exclusion_patterns: types_index_patterns, + max_outstanding_read_requests: z.number().register(z.globalRegistry, { + description: 'The maximum number of outstanding reads requests from the remote cluster.' + }) }); export const ccr_get_auto_follow_pattern_auto_follow_pattern = z.object({ - name: types_name, - pattern: ccr_get_auto_follow_pattern_auto_follow_pattern_summary, + name: types_name, + pattern: ccr_get_auto_follow_pattern_auto_follow_pattern_summary }); export const ccr_stats_auto_followed_cluster = z.object({ - cluster_name: types_name, - last_seen_metadata_version: types_version_number, - time_since_last_check_millis: types_duration_value_unit_millis, + cluster_name: types_name, + last_seen_metadata_version: types_version_number, + time_since_last_check_millis: types_duration_value_unit_millis }); export const ccr_stats_auto_follow_stats = z.object({ - auto_followed_clusters: z.array(ccr_stats_auto_followed_cluster), - number_of_failed_follow_indices: z.number().register(z.globalRegistry, { - description: - 'The number of indices that the auto-follow coordinator failed to automatically follow.\nThe causes of recent failures are captured in the logs of the elected master node and in the `auto_follow_stats.recent_auto_follow_errors` field.', - }), - number_of_failed_remote_cluster_state_requests: z.number().register(z.globalRegistry, { - description: - 'The number of times that the auto-follow coordinator failed to retrieve the cluster state from a remote cluster registered in a collection of auto-follow patterns.', - }), - number_of_successful_follow_indices: z.number().register(z.globalRegistry, { - description: 'The number of indices that the auto-follow coordinator successfully followed.', - }), - recent_auto_follow_errors: z.array(types_error_cause).register(z.globalRegistry, { - description: 'An array of objects representing failures by the auto-follow coordinator.', - }), + auto_followed_clusters: z.array(ccr_stats_auto_followed_cluster), + number_of_failed_follow_indices: z.number().register(z.globalRegistry, { + description: 'The number of indices that the auto-follow coordinator failed to automatically follow.\nThe causes of recent failures are captured in the logs of the elected master node and in the `auto_follow_stats.recent_auto_follow_errors` field.' + }), + number_of_failed_remote_cluster_state_requests: z.number().register(z.globalRegistry, { + description: 'The number of times that the auto-follow coordinator failed to retrieve the cluster state from a remote cluster registered in a collection of auto-follow patterns.' + }), + number_of_successful_follow_indices: z.number().register(z.globalRegistry, { + description: 'The number of indices that the auto-follow coordinator successfully followed.' + }), + recent_auto_follow_errors: z.array(types_error_cause).register(z.globalRegistry, { + description: 'An array of objects representing failures by the auto-follow coordinator.' + }) }); export const ccr_stats_follow_stats = z.object({ - indices: z.array(ccr_types_follow_index_stats), + indices: z.array(ccr_types_follow_index_stats) }); -export const types_scroll_ids = z.union([types_scroll_id, z.array(types_scroll_id)]); +export const types_scroll_ids = z.union([ + types_scroll_id, + z.array(types_scroll_id) +]); export const cluster_allocation_explain_decision = z.enum([ - 'yes', - 'no', - 'worse_balance', - 'throttled', - 'awaiting_info', - 'allocation_delayed', - 'no_valid_shard_copy', - 'no_attempt', + 'yes', + 'no', + 'worse_balance', + 'throttled', + 'awaiting_info', + 'allocation_delayed', + 'no_valid_shard_copy', + 'no_attempt' ]); export const cluster_allocation_explain_allocation_explain_decision = z.enum([ - 'NO', - 'YES', - 'THROTTLE', - 'ALWAYS', + 'NO', + 'YES', + 'THROTTLE', + 'ALWAYS' ]); export const cluster_allocation_explain_allocation_decision = z.object({ - decider: z.string(), - decision: cluster_allocation_explain_allocation_explain_decision, - explanation: z.string(), + decider: z.string(), + decision: cluster_allocation_explain_allocation_explain_decision, + explanation: z.string() }); export const cluster_allocation_explain_disk_usage = z.object({ - path: z.string(), - total_bytes: z.number(), - used_bytes: z.number(), - free_bytes: z.number(), - free_disk_percent: z.number(), - used_disk_percent: z.number(), + path: z.string(), + total_bytes: z.number(), + used_bytes: z.number(), + free_bytes: z.number(), + free_disk_percent: z.number(), + used_disk_percent: z.number() }); export const cluster_allocation_explain_node_disk_usage = z.object({ - node_name: types_name, - least_available: cluster_allocation_explain_disk_usage, - most_available: cluster_allocation_explain_disk_usage, + node_name: types_name, + least_available: cluster_allocation_explain_disk_usage, + most_available: cluster_allocation_explain_disk_usage }); export const cluster_allocation_explain_reserved_size = z.object({ - node_id: types_id, - path: z.string(), - total: z.number(), - shards: z.array(z.string()), + node_id: types_id, + path: z.string(), + total: z.number(), + shards: z.array(z.string()) }); export const cluster_allocation_explain_cluster_info = z.object({ - nodes: z.record(z.string(), cluster_allocation_explain_node_disk_usage), - shard_sizes: z.record(z.string(), z.number()), - shard_data_set_sizes: z.optional(z.record(z.string(), z.string())), - shard_paths: z.record(z.string(), z.string()), - reserved_sizes: z.array(cluster_allocation_explain_reserved_size), + nodes: z.record(z.string(), cluster_allocation_explain_node_disk_usage), + shard_sizes: z.record(z.string(), z.number()), + shard_data_set_sizes: z.optional(z.record(z.string(), z.string())), + shard_paths: z.record(z.string(), z.string()), + reserved_sizes: z.array(cluster_allocation_explain_reserved_size) }); export const types_node_role = z.enum([ - 'master', - 'data', - 'data_cold', - 'data_content', - 'data_frozen', - 'data_hot', - 'data_warm', - 'client', - 'ingest', - 'ml', - 'voting_only', - 'transform', - 'remote_cluster_client', - 'coordinating_only', + 'master', + 'data', + 'data_cold', + 'data_content', + 'data_frozen', + 'data_hot', + 'data_warm', + 'client', + 'ingest', + 'ml', + 'voting_only', + 'transform', + 'remote_cluster_client', + 'coordinating_only' ]); export const types_node_roles = z.array(types_node_role); @@ -12064,248 +9715,248 @@ export const types_node_roles = z.array(types_node_role); export const types_transport_address = z.string(); export const cluster_allocation_explain_current_node = z.object({ - id: types_id, - name: types_name, - roles: types_node_roles, - attributes: z.record(z.string(), z.string()), - transport_address: types_transport_address, - weight_ranking: z.number(), + id: types_id, + name: types_name, + roles: types_node_roles, + attributes: z.record(z.string(), z.string()), + transport_address: types_transport_address, + weight_ranking: z.number() }); export const cluster_allocation_explain_allocation_store = z.object({ - allocation_id: z.string(), - found: z.boolean(), - in_sync: z.boolean(), - matching_size_in_bytes: z.number(), - matching_sync_id: z.boolean(), - store_exception: z.string(), + allocation_id: z.string(), + found: z.boolean(), + in_sync: z.boolean(), + matching_size_in_bytes: z.number(), + matching_sync_id: z.boolean(), + store_exception: z.string() }); export const cluster_allocation_explain_node_allocation_explanation = z.object({ - deciders: z.optional(z.array(cluster_allocation_explain_allocation_decision)), - node_attributes: z.record(z.string(), z.string()), - node_decision: cluster_allocation_explain_decision, - node_id: types_id, - node_name: types_name, - roles: types_node_roles, - store: z.optional(cluster_allocation_explain_allocation_store), - transport_address: types_transport_address, - weight_ranking: z.optional(z.number()), + deciders: z.optional(z.array(cluster_allocation_explain_allocation_decision)), + node_attributes: z.record(z.string(), z.string()), + node_decision: cluster_allocation_explain_decision, + node_id: types_id, + node_name: types_name, + roles: types_node_roles, + store: z.optional(cluster_allocation_explain_allocation_store), + transport_address: types_transport_address, + weight_ranking: z.optional(z.number()) }); export const cluster_allocation_explain_unassigned_information_reason = z.enum([ - 'INDEX_CREATED', - 'CLUSTER_RECOVERED', - 'INDEX_REOPENED', - 'DANGLING_INDEX_IMPORTED', - 'NEW_INDEX_RESTORED', - 'EXISTING_INDEX_RESTORED', - 'REPLICA_ADDED', - 'ALLOCATION_FAILED', - 'NODE_LEFT', - 'REROUTE_CANCELLED', - 'REINITIALIZED', - 'REALLOCATED_REPLICA', - 'PRIMARY_FAILED', - 'FORCED_EMPTY_PRIMARY', - 'MANUAL_ALLOCATION', + 'INDEX_CREATED', + 'CLUSTER_RECOVERED', + 'INDEX_REOPENED', + 'DANGLING_INDEX_IMPORTED', + 'NEW_INDEX_RESTORED', + 'EXISTING_INDEX_RESTORED', + 'REPLICA_ADDED', + 'ALLOCATION_FAILED', + 'NODE_LEFT', + 'REROUTE_CANCELLED', + 'REINITIALIZED', + 'REALLOCATED_REPLICA', + 'PRIMARY_FAILED', + 'FORCED_EMPTY_PRIMARY', + 'MANUAL_ALLOCATION' ]); export const cluster_allocation_explain_unassigned_information = z.object({ - at: types_date_time, - last_allocation_status: z.optional(z.string()), - reason: cluster_allocation_explain_unassigned_information_reason, - details: z.optional(z.string()), - failed_allocation_attempts: z.optional(z.number()), - delayed: z.optional(z.boolean()), - allocation_status: z.optional(z.string()), + at: types_date_time, + last_allocation_status: z.optional(z.string()), + reason: cluster_allocation_explain_unassigned_information_reason, + details: z.optional(z.string()), + failed_allocation_attempts: z.optional(z.number()), + delayed: z.optional(z.boolean()), + allocation_status: z.optional(z.string()) }); export const types_mapping_all_field = z.object({ - analyzer: z.string(), - enabled: z.boolean(), - omit_norms: z.boolean(), - search_analyzer: z.string(), - similarity: z.string(), - store: z.boolean(), - store_term_vector_offsets: z.boolean(), - store_term_vector_payloads: z.boolean(), - store_term_vector_positions: z.boolean(), - store_term_vectors: z.boolean(), -}); - -export const types_mapping_dynamic_mapping = z.enum(['strict', 'runtime', 'true', 'false']); - -export const types_mapping_synthetic_source_keep_enum = z.enum(['none', 'arrays', 'all']); + analyzer: z.string(), + enabled: z.boolean(), + omit_norms: z.boolean(), + search_analyzer: z.string(), + similarity: z.string(), + store: z.boolean(), + store_term_vector_offsets: z.boolean(), + store_term_vector_payloads: z.boolean(), + store_term_vector_positions: z.boolean(), + store_term_vectors: z.boolean() +}); + +export const types_mapping_dynamic_mapping = z.enum([ + 'strict', + 'runtime', + 'true', + 'false' +]); + +export const types_mapping_synthetic_source_keep_enum = z.enum([ + 'none', + 'arrays', + 'all' +]); export const indices_types_numeric_fielddata_format = z.enum(['array', 'disabled']); export const indices_types_numeric_fielddata = z.object({ - format: indices_types_numeric_fielddata_format, + format: indices_types_numeric_fielddata_format }); export const types_mapping_on_script_error = z.enum(['fail', 'continue']); export const types_mapping_time_series_metric_type = z.enum([ - 'gauge', - 'counter', - 'summary', - 'histogram', - 'position', + 'gauge', + 'counter', + 'summary', + 'histogram', + 'position' ]); -export const types_mapping_index_options = z.enum(['docs', 'freqs', 'positions', 'offsets']); +export const types_mapping_index_options = z.enum([ + 'docs', + 'freqs', + 'positions', + 'offsets' +]); export const types_mapping_text_index_prefixes = z.object({ - max_chars: z.number(), - min_chars: z.number(), + max_chars: z.number(), + min_chars: z.number() }); export const types_mapping_term_vector_option = z.enum([ - 'no', - 'yes', - 'with_offsets', - 'with_positions', - 'with_positions_offsets', - 'with_positions_offsets_payloads', - 'with_positions_payloads', + 'no', + 'yes', + 'with_offsets', + 'with_positions', + 'with_positions_offsets', + 'with_positions_offsets_payloads', + 'with_positions_payloads' ]); export const indices_types_fielddata_frequency_filter = z.object({ - max: z.number(), - min: z.number(), - min_segment_size: z.number(), + max: z.number(), + min: z.number(), + min_segment_size: z.number() }); -export const types_mapping_dense_vector_element_type = z.enum(['bit', 'byte', 'float', 'bfloat16']); +export const types_mapping_dense_vector_element_type = z.enum([ + 'bit', + 'byte', + 'float', + 'bfloat16' +]); export const types_mapping_dense_vector_index_options_type = z.enum([ - 'bbq_flat', - 'bbq_hnsw', - 'bbq_disk', - 'flat', - 'hnsw', - 'int4_flat', - 'int4_hnsw', - 'int8_flat', - 'int8_hnsw', + 'bbq_flat', + 'bbq_hnsw', + 'bbq_disk', + 'flat', + 'hnsw', + 'int4_flat', + 'int4_hnsw', + 'int8_flat', + 'int8_hnsw' ]); export const types_mapping_dense_vector_index_options_rescore_vector = z.object({ - oversample: z.number().register(z.globalRegistry, { - description: - 'The oversampling factor to use when searching for the nearest neighbor. This is only applicable to the quantized formats: `bbq_*`, `int4_*`, and `int8_*`.\nWhen provided, `oversample * k` vectors will be gathered and then their scores will be re-computed with the original vectors.\n\nvalid values are between `1.0` and `10.0` (inclusive), or `0` exactly to disable oversampling.', - }), + oversample: z.number().register(z.globalRegistry, { + description: 'The oversampling factor to use when searching for the nearest neighbor. This is only applicable to the quantized formats: `bbq_*`, `int4_*`, and `int8_*`.\nWhen provided, `oversample * k` vectors will be gathered and then their scores will be re-computed with the original vectors.\n\nvalid values are between `1.0` and `10.0` (inclusive), or `0` exactly to disable oversampling.' + }) }); export const types_mapping_dense_vector_index_options = z.object({ - confidence_interval: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The confidence interval to use when quantizing the vectors. Can be any value between and including `0.90` and\n`1.0` or exactly `0`. When the value is `0`, this indicates that dynamic quantiles should be calculated for\noptimized quantization. When between `0.90` and `1.0`, this value restricts the values used when calculating\nthe quantization thresholds.\n\nFor example, a value of `0.95` will only use the middle `95%` of the values when calculating the quantization\nthresholds (e.g. the highest and lowest `2.5%` of values will be ignored).\n\nDefaults to `1/(dims + 1)` for `int8` quantized vectors and `0` for `int4` for dynamic quantile calculation.\n\nOnly applicable to `int8_hnsw`, `int4_hnsw`, `int8_flat`, and `int4_flat` index types.', - }) - ), - ef_construction: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of candidates to track while assembling the list of nearest neighbors for each new node.\n\nOnly applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw` index types.', - }) - ), - m: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of neighbors each node will be connected to in the HNSW graph.\n\nOnly applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw` index types.', - }) - ), - type: types_mapping_dense_vector_index_options_type, - rescore_vector: z.optional(types_mapping_dense_vector_index_options_rescore_vector), - on_disk_rescore: z.optional( - z.boolean().register(z.globalRegistry, { - description: - '`true` if vector rescoring should be done on-disk\n\nOnly applicable to `bbq_disk`, `bbq_hnsw`, `int4_hnsw`, `int8_hnsw`', - }) - ), + confidence_interval: z.optional(z.number().register(z.globalRegistry, { + description: 'The confidence interval to use when quantizing the vectors. Can be any value between and including `0.90` and\n`1.0` or exactly `0`. When the value is `0`, this indicates that dynamic quantiles should be calculated for\noptimized quantization. When between `0.90` and `1.0`, this value restricts the values used when calculating\nthe quantization thresholds.\n\nFor example, a value of `0.95` will only use the middle `95%` of the values when calculating the quantization\nthresholds (e.g. the highest and lowest `2.5%` of values will be ignored).\n\nDefaults to `1/(dims + 1)` for `int8` quantized vectors and `0` for `int4` for dynamic quantile calculation.\n\nOnly applicable to `int8_hnsw`, `int4_hnsw`, `int8_flat`, and `int4_flat` index types.' + })), + ef_construction: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of candidates to track while assembling the list of nearest neighbors for each new node.\n\nOnly applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw` index types.' + })), + m: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of neighbors each node will be connected to in the HNSW graph.\n\nOnly applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw` index types.' + })), + type: types_mapping_dense_vector_index_options_type, + rescore_vector: z.optional(types_mapping_dense_vector_index_options_rescore_vector), + on_disk_rescore: z.optional(z.boolean().register(z.globalRegistry, { + description: '`true` if vector rescoring should be done on-disk\n\nOnly applicable to `bbq_disk`, `bbq_hnsw`, `int4_hnsw`, `int8_hnsw`' + })) }); export const types_mapping_dense_vector_similarity = z.enum([ - 'cosine', - 'dot_product', - 'l2_norm', - 'max_inner_product', + 'cosine', + 'dot_product', + 'l2_norm', + 'max_inner_product' ]); export const types_mapping_subobjects = z.enum(['true', 'false']); -export const types_mapping_rank_vector_element_type = z.enum(['byte', 'float', 'bit']); +export const types_mapping_rank_vector_element_type = z.enum([ + 'byte', + 'float', + 'bit' +]); export const types_mapping_sparse_vector_index_options = z.object({ - prune: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to perform pruning, omitting the non-significant tokens from the query to improve query performance.\nIf prune is true but the pruning_config is not specified, pruning will occur but default values will be used.\nDefault: false', - }) - ), - pruning_config: z.optional(types_token_pruning_config), + prune: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to perform pruning, omitting the non-significant tokens from the query to improve query performance.\nIf prune is true but the pruning_config is not specified, pruning will occur but default values will be used.\nDefault: false' + })), + pruning_config: z.optional(types_token_pruning_config) }); export const types_mapping_semantic_text_index_options = z.object({ - dense_vector: z.optional(types_mapping_dense_vector_index_options), - sparse_vector: z.optional(types_mapping_sparse_vector_index_options), + dense_vector: z.optional(types_mapping_dense_vector_index_options), + sparse_vector: z.optional(types_mapping_sparse_vector_index_options) }); export const types_mapping_chunking_settings = z.object({ - strategy: z.string().register(z.globalRegistry, { - description: - 'The chunking strategy: `sentence`, `word`, `none` or `recursive`.\n\n * If `strategy` is set to `recursive`, you must also specify:\n\n- `max_chunk_size`\n- either `separators` or`separator_group`\n\nLearn more about different chunking strategies in the linked documentation.', - }), - separator_group: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Only applicable to the `recursive` strategy and required when using it.\n\nSets a predefined list of separators in the saved chunking settings based on the selected text type.\nValues can be `markdown` or `plaintext`.\n\nUsing this parameter is an alternative to manually specifying a custom `separators` list.', - }) - ), - separators: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'Only applicable to the `recursive` strategy and required when using it.\n\nA list of strings used as possible split points when chunking text.\n\nEach string can be a plain string or a regular expression (regex) pattern.\nThe system tries each separator in order to split the text, starting from the first item in the list.\n\nAfter splitting, it attempts to recombine smaller pieces into larger chunks that stay within\nthe `max_chunk_size` limit, to reduce the total number of chunks generated.', - }) - ), - max_chunk_size: z.number().register(z.globalRegistry, { - description: - 'The maximum size of a chunk in words.\nThis value cannot be lower than `20` (for `sentence` strategy) or `10` (for `word` strategy).\nThis value should not exceed the window size for the associated model.', - }), - overlap: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of overlapping words for chunks.\nIt is applicable only to a `word` chunking strategy.\nThis value cannot be higher than half the `max_chunk_size` value.', - }) - ), - sentence_overlap: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of overlapping sentences for chunks.\nIt is applicable only for a `sentence` chunking strategy.\nIt can be either `1` or `0`.', - }) - ), + strategy: z.string().register(z.globalRegistry, { + description: 'The chunking strategy: `sentence`, `word`, `none` or `recursive`.\n\n * If `strategy` is set to `recursive`, you must also specify:\n\n- `max_chunk_size`\n- either `separators` or`separator_group`\n\nLearn more about different chunking strategies in the linked documentation.' + }), + separator_group: z.optional(z.string().register(z.globalRegistry, { + description: 'Only applicable to the `recursive` strategy and required when using it.\n\nSets a predefined list of separators in the saved chunking settings based on the selected text type.\nValues can be `markdown` or `plaintext`.\n\nUsing this parameter is an alternative to manually specifying a custom `separators` list.' + })), + separators: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Only applicable to the `recursive` strategy and required when using it.\n\nA list of strings used as possible split points when chunking text.\n\nEach string can be a plain string or a regular expression (regex) pattern.\nThe system tries each separator in order to split the text, starting from the first item in the list.\n\nAfter splitting, it attempts to recombine smaller pieces into larger chunks that stay within\nthe `max_chunk_size` limit, to reduce the total number of chunks generated.' + })), + max_chunk_size: z.number().register(z.globalRegistry, { + description: 'The maximum size of a chunk in words.\nThis value cannot be lower than `20` (for `sentence` strategy) or `10` (for `word` strategy).\nThis value should not exceed the window size for the associated model.' + }), + overlap: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of overlapping words for chunks.\nIt is applicable only to a `word` chunking strategy.\nThis value cannot be higher than half the `max_chunk_size` value.' + })), + sentence_overlap: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of overlapping sentences for chunks.\nIt is applicable only for a `sentence` chunking strategy.\nIt can be either `1` or `0`.' + })) }); export const types_mapping_suggest_context = z.object({ - name: types_name, - path: z.optional(types_field), - type: z.string(), - precision: z.optional(z.union([z.number(), z.string()])), + name: types_name, + path: z.optional(types_field), + type: z.string(), + precision: z.optional(z.union([ + z.number(), + z.string() + ])) }); -export const types_mapping_geo_point_metric_type = z.enum(['gauge', 'counter', 'position']); +export const types_mapping_geo_point_metric_type = z.enum([ + 'gauge', + 'counter', + 'position' +]); export const types_mapping_geo_orientation = z.enum([ - 'right', - 'RIGHT', - 'counterclockwise', - 'ccw', - 'left', - 'LEFT', - 'clockwise', - 'cw', + 'right', + 'RIGHT', + 'counterclockwise', + 'ccw', + 'left', + 'LEFT', + 'clockwise', + 'cw' ]); export const types_mapping_geo_strategy = z.enum(['recursive', 'term']); @@ -12319,2010 +9970,1795 @@ export const types_ulong = z.number(); export const types_mapping_match_type = z.enum(['simple', 'regex']); export const types_mapping_field_names_field = z.object({ - enabled: z.boolean(), + enabled: z.boolean() }); export const types_mapping_index_field = z.object({ - enabled: z.boolean(), + enabled: z.boolean() }); export const types_mapping_routing_field = z.object({ - required: z.boolean(), + required: z.boolean() }); export const types_mapping_size_field = z.object({ - enabled: z.boolean(), + enabled: z.boolean() }); -export const types_mapping_source_field_mode = z.enum(['disabled', 'stored', 'synthetic']); +export const types_mapping_source_field_mode = z.enum([ + 'disabled', + 'stored', + 'synthetic' +]); export const types_mapping_source_field = z.object({ - compress: z.optional(z.boolean()), - compress_threshold: z.optional(z.string()), - enabled: z.optional(z.boolean()), - excludes: z.optional(z.array(z.string())), - includes: z.optional(z.array(z.string())), - mode: z.optional(types_mapping_source_field_mode), + compress: z.optional(z.boolean()), + compress_threshold: z.optional(z.string()), + enabled: z.optional(z.boolean()), + excludes: z.optional(z.array(z.string())), + includes: z.optional(z.array(z.string())), + mode: z.optional(types_mapping_source_field_mode) }); export const types_mapping_data_stream_timestamp = z.object({ - enabled: z.boolean(), + enabled: z.boolean() }); export const indices_types_data_stream_lifecycle_rollover_conditions = z.object({ - min_age: z.optional(types_duration), - max_age: z.optional(z.string()), - min_docs: z.optional(z.number()), - max_docs: z.optional(z.number()), - min_size: z.optional(types_byte_size), - max_size: z.optional(types_byte_size), - min_primary_shard_size: z.optional(types_byte_size), - max_primary_shard_size: z.optional(types_byte_size), - min_primary_shard_docs: z.optional(z.number()), - max_primary_shard_docs: z.optional(z.number()), + min_age: z.optional(types_duration), + max_age: z.optional(z.string()), + min_docs: z.optional(z.number()), + max_docs: z.optional(z.number()), + min_size: z.optional(types_byte_size), + max_size: z.optional(types_byte_size), + min_primary_shard_size: z.optional(types_byte_size), + max_primary_shard_size: z.optional(types_byte_size), + min_primary_shard_docs: z.optional(z.number()), + max_primary_shard_docs: z.optional(z.number()) }); export const indices_types_downsampling_round = z.object({ - after: types_duration, - fixed_interval: types_duration_large, + after: types_duration, + fixed_interval: types_duration_large }); +export const indices_types_sampling_method = z.enum(['aggregate', 'last_value']); + /** * Data stream lifecycle denotes that a data stream is managed by the data stream lifecycle and contains the configuration. */ -export const indices_types_data_stream_lifecycle = z - .object({ +export const indices_types_data_stream_lifecycle = z.object({ data_retention: z.optional(types_duration), - downsampling: z.optional( - z.array(indices_types_downsampling_round).register(z.globalRegistry, { - description: - 'The list of downsampling rounds to execute as part of this downsampling configuration', - }) - ), - enabled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle\nthat's disabled (enabled: `false`) will have no effect on the data stream.", - }) - ), - }) - .register(z.globalRegistry, { - description: - 'Data stream lifecycle denotes that a data stream is managed by the data stream lifecycle and contains the configuration.', - }); + downsampling: z.optional(z.array(indices_types_downsampling_round).register(z.globalRegistry, { + description: 'The list of downsampling rounds to execute as part of this downsampling configuration' + })), + downsampling_method: z.optional(indices_types_sampling_method), + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle\nthat\'s disabled (enabled: `false`) will have no effect on the data stream.' + })) +}).register(z.globalRegistry, { + description: 'Data stream lifecycle denotes that a data stream is managed by the data stream lifecycle and contains the configuration.' +}); /** * Data stream lifecycle with rollover can be used to display the configuration including the default rollover conditions, * if asked. */ -export const indices_types_data_stream_lifecycle_with_rollover = - indices_types_data_stream_lifecycle.and( - z.object({ - rollover: z.optional(indices_types_data_stream_lifecycle_rollover_conditions), - }) - ); +export const indices_types_data_stream_lifecycle_with_rollover = indices_types_data_stream_lifecycle.and(z.object({ + rollover: z.optional(indices_types_data_stream_lifecycle_rollover_conditions) +})); /** * Template equivalent of FailureStoreLifecycle that allows nullable values. */ -export const indices_types_failure_store_lifecycle_template = z - .object({ - data_retention: z.optional(z.union([types_duration, z.string(), z.null()])), - enabled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle\nthat's disabled (enabled: `false`) will have no effect on the data stream.", - }) - ), - }) - .register(z.globalRegistry, { - description: 'Template equivalent of FailureStoreLifecycle that allows nullable values.', - }); +export const indices_types_failure_store_lifecycle_template = z.object({ + data_retention: z.optional(z.union([ + types_duration, + z.string(), + z.null() + ])), + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle\nthat\'s disabled (enabled: `false`) will have no effect on the data stream.' + })) +}).register(z.globalRegistry, { + description: 'Template equivalent of FailureStoreLifecycle that allows nullable values.' +}); /** * Template equivalent of DataStreamFailureStore that allows nullable values. */ -export const indices_types_data_stream_failure_store_template = z - .object({ - enabled: z.optional(z.union([z.boolean(), z.string(), z.null()])), - lifecycle: z.optional( - z.union([indices_types_failure_store_lifecycle_template, z.string(), z.null()]) - ), - }) - .register(z.globalRegistry, { - description: 'Template equivalent of DataStreamFailureStore that allows nullable values.', - }); +export const indices_types_data_stream_failure_store_template = z.object({ + enabled: z.optional(z.union([ + z.boolean(), + z.string(), + z.null() + ])), + lifecycle: z.optional(z.union([ + indices_types_failure_store_lifecycle_template, + z.string(), + z.null() + ])) +}).register(z.globalRegistry, { + description: 'Template equivalent of DataStreamFailureStore that allows nullable values.' +}); /** * Data stream options template contains the same information as DataStreamOptions but allows them to be set explicitly to null. */ -export const indices_types_data_stream_options_template = z - .object({ - failure_store: z.optional( - z.union([indices_types_data_stream_failure_store_template, z.string(), z.null()]) - ), - }) - .register(z.globalRegistry, { - description: - 'Data stream options template contains the same information as DataStreamOptions but allows them to be set explicitly to null.', - }); +export const indices_types_data_stream_options_template = z.object({ + failure_store: z.optional(z.union([ + indices_types_data_stream_failure_store_template, + z.string(), + z.null() + ])) +}).register(z.globalRegistry, { + description: 'Data stream options template contains the same information as DataStreamOptions but allows them to be set explicitly to null.' +}); -export const types_level = z.enum(['cluster', 'indices', 'shards']); +export const types_level = z.enum([ + 'cluster', + 'indices', + 'shards' +]); export const types_wait_for_events = z.enum([ - 'immediate', - 'urgent', - 'high', - 'normal', - 'low', - 'languid', + 'immediate', + 'urgent', + 'high', + 'normal', + 'low', + 'languid' ]); -export const cluster_health_wait_for_nodes = z.union([z.string(), z.number()]); +export const cluster_health_wait_for_nodes = z.union([ + z.string(), + z.number() +]); export const cluster_health_shard_health_stats = z.object({ - active_shards: z.number(), - initializing_shards: z.number(), - primary_active: z.boolean(), - relocating_shards: z.number(), - status: types_health_status, - unassigned_shards: z.number(), - unassigned_primary_shards: z.number(), + active_shards: z.number(), + initializing_shards: z.number(), + primary_active: z.boolean(), + relocating_shards: z.number(), + status: types_health_status, + unassigned_shards: z.number(), + unassigned_primary_shards: z.number() }); export const cluster_health_index_health_stats = z.object({ - active_primary_shards: z.number(), - active_shards: z.number(), - initializing_shards: z.number(), - number_of_replicas: z.number(), - number_of_shards: z.number(), - relocating_shards: z.number(), - shards: z.optional(z.record(z.string(), cluster_health_shard_health_stats)), - status: types_health_status, - unassigned_shards: z.number(), - unassigned_primary_shards: z.number(), + active_primary_shards: z.number(), + active_shards: z.number(), + initializing_shards: z.number(), + number_of_replicas: z.number(), + number_of_shards: z.number(), + relocating_shards: z.number(), + shards: z.optional(z.record(z.string(), cluster_health_shard_health_stats)), + status: types_health_status, + unassigned_shards: z.number(), + unassigned_primary_shards: z.number() }); export const cluster_health_health_response_body = z.object({ - active_primary_shards: z.number().register(z.globalRegistry, { - description: 'The number of active primary shards.', - }), - active_shards: z.number().register(z.globalRegistry, { - description: 'The total number of active primary and replica shards.', - }), - active_shards_percent: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The ratio of active shards in the cluster expressed as a string formatted percentage.', + active_primary_shards: z.number().register(z.globalRegistry, { + description: 'The number of active primary shards.' + }), + active_shards: z.number().register(z.globalRegistry, { + description: 'The total number of active primary and replica shards.' + }), + active_shards_percent: z.optional(z.string().register(z.globalRegistry, { + description: 'The ratio of active shards in the cluster expressed as a string formatted percentage.' + })), + active_shards_percent_as_number: z.number().register(z.globalRegistry, { + description: 'The ratio of active shards in the cluster expressed as a percentage.' + }), + cluster_name: types_name, + delayed_unassigned_shards: z.number().register(z.globalRegistry, { + description: 'The number of shards whose allocation has been delayed by the timeout settings.' + }), + indices: z.optional(z.record(z.string(), cluster_health_index_health_stats)), + initializing_shards: z.number().register(z.globalRegistry, { + description: 'The number of shards that are under initialization.' + }), + number_of_data_nodes: z.number().register(z.globalRegistry, { + description: 'The number of nodes that are dedicated data nodes.' + }), + number_of_in_flight_fetch: z.number().register(z.globalRegistry, { + description: 'The number of unfinished fetches.' + }), + number_of_nodes: z.number().register(z.globalRegistry, { + description: 'The number of nodes within the cluster.' + }), + number_of_pending_tasks: z.number().register(z.globalRegistry, { + description: 'The number of cluster-level changes that have not yet been executed.' + }), + relocating_shards: z.number().register(z.globalRegistry, { + description: 'The number of shards that are under relocation.' + }), + status: types_health_status, + task_max_waiting_in_queue: z.optional(types_duration), + task_max_waiting_in_queue_millis: types_duration_value_unit_millis, + timed_out: z.boolean().register(z.globalRegistry, { + description: 'If false the response returned within the period of time that is specified by the timeout parameter (30s by default)' + }), + unassigned_primary_shards: z.number().register(z.globalRegistry, { + description: 'The number of primary shards that are not allocated.' + }), + unassigned_shards: z.number().register(z.globalRegistry, { + description: 'The number of shards that are not allocated.' }) - ), - active_shards_percent_as_number: z.number().register(z.globalRegistry, { - description: 'The ratio of active shards in the cluster expressed as a percentage.', - }), - cluster_name: types_name, - delayed_unassigned_shards: z.number().register(z.globalRegistry, { - description: 'The number of shards whose allocation has been delayed by the timeout settings.', - }), - indices: z.optional(z.record(z.string(), cluster_health_index_health_stats)), - initializing_shards: z.number().register(z.globalRegistry, { - description: 'The number of shards that are under initialization.', - }), - number_of_data_nodes: z.number().register(z.globalRegistry, { - description: 'The number of nodes that are dedicated data nodes.', - }), - number_of_in_flight_fetch: z.number().register(z.globalRegistry, { - description: 'The number of unfinished fetches.', - }), - number_of_nodes: z.number().register(z.globalRegistry, { - description: 'The number of nodes within the cluster.', - }), - number_of_pending_tasks: z.number().register(z.globalRegistry, { - description: 'The number of cluster-level changes that have not yet been executed.', - }), - relocating_shards: z.number().register(z.globalRegistry, { - description: 'The number of shards that are under relocation.', - }), - status: types_health_status, - task_max_waiting_in_queue: z.optional(types_duration), - task_max_waiting_in_queue_millis: types_duration_value_unit_millis, - timed_out: z.boolean().register(z.globalRegistry, { - description: - 'If false the response returned within the period of time that is specified by the timeout parameter (30s by default)', - }), - unassigned_primary_shards: z.number().register(z.globalRegistry, { - description: 'The number of primary shards that are not allocated.', - }), - unassigned_shards: z.number().register(z.globalRegistry, { - description: 'The number of shards that are not allocated.', - }), }); export const types_cluster_info_target = z.enum([ - '_all', - 'http', - 'ingest', - 'thread_pool', - 'script', + '_all', + 'http', + 'ingest', + 'thread_pool', + 'script' ]); export const types_cluster_info_targets = z.union([ - types_cluster_info_target, - z.array(types_cluster_info_target), + types_cluster_info_target, + z.array(types_cluster_info_target) ]); export const nodes_types_client = z.object({ - id: z.optional( - z.number().register(z.globalRegistry, { - description: 'Unique ID for the HTTP client.', - }) - ), - agent: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Reported agent for the HTTP client.\nIf unavailable, this property is not included in the response.', - }) - ), - local_address: z.optional( - z.string().register(z.globalRegistry, { - description: 'Local address for the HTTP connection.', - }) - ), - remote_address: z.optional( - z.string().register(z.globalRegistry, { - description: 'Remote address for the HTTP connection.', - }) - ), - last_uri: z.optional( - z.string().register(z.globalRegistry, { - description: 'The URI of the client’s most recent request.', - }) - ), - opened_time_millis: z.optional( - z.number().register(z.globalRegistry, { - description: 'Time at which the client opened the connection.', - }) - ), - closed_time_millis: z.optional( - z.number().register(z.globalRegistry, { - description: 'Time at which the client closed the connection if the connection is closed.', - }) - ), - last_request_time_millis: z.optional( - z.number().register(z.globalRegistry, { - description: 'Time of the most recent request from this client.', - }) - ), - request_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of requests from this client.', - }) - ), - request_size_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Cumulative size in bytes of all requests from this client.', - }) - ), - x_opaque_id: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Value from the client’s `x-opaque-id` HTTP header.\nIf unavailable, this property is not included in the response.', - }) - ), + id: z.optional(z.number().register(z.globalRegistry, { + description: 'Unique ID for the HTTP client.' + })), + agent: z.optional(z.string().register(z.globalRegistry, { + description: 'Reported agent for the HTTP client.\nIf unavailable, this property is not included in the response.' + })), + local_address: z.optional(z.string().register(z.globalRegistry, { + description: 'Local address for the HTTP connection.' + })), + remote_address: z.optional(z.string().register(z.globalRegistry, { + description: 'Remote address for the HTTP connection.' + })), + last_uri: z.optional(z.string().register(z.globalRegistry, { + description: 'The URI of the client’s most recent request.' + })), + opened_time_millis: z.optional(z.number().register(z.globalRegistry, { + description: 'Time at which the client opened the connection.' + })), + closed_time_millis: z.optional(z.number().register(z.globalRegistry, { + description: 'Time at which the client closed the connection if the connection is closed.' + })), + last_request_time_millis: z.optional(z.number().register(z.globalRegistry, { + description: 'Time of the most recent request from this client.' + })), + request_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of requests from this client.' + })), + request_size_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Cumulative size in bytes of all requests from this client.' + })), + x_opaque_id: z.optional(z.string().register(z.globalRegistry, { + description: 'Value from the client’s `x-opaque-id` HTTP header.\nIf unavailable, this property is not included in the response.' + })) }); export const nodes_types_size_http_histogram = z.object({ - count: z.number(), - ge_bytes: z.optional(z.number()), - lt_bytes: z.optional(z.number()), + count: z.number(), + ge_bytes: z.optional(z.number()), + lt_bytes: z.optional(z.number()) }); export const nodes_types_http_route_requests = z.object({ - count: z.number(), - total_size_in_bytes: z.number(), - size_histogram: z.array(nodes_types_size_http_histogram), + count: z.number(), + total_size_in_bytes: z.number(), + size_histogram: z.array(nodes_types_size_http_histogram) }); export const nodes_types_time_http_histogram = z.object({ - count: z.number(), - ge_millis: z.optional(z.number()), - lt_millis: z.optional(z.number()), + count: z.number(), + ge_millis: z.optional(z.number()), + lt_millis: z.optional(z.number()) }); export const nodes_types_http_route_responses = z.object({ - count: z.number(), - total_size_in_bytes: z.number(), - handling_time_histogram: z.array(nodes_types_time_http_histogram), - size_histogram: z.array(nodes_types_size_http_histogram), + count: z.number(), + total_size_in_bytes: z.number(), + handling_time_histogram: z.array(nodes_types_time_http_histogram), + size_histogram: z.array(nodes_types_size_http_histogram) }); export const nodes_types_http_route = z.object({ - requests: nodes_types_http_route_requests, - responses: nodes_types_http_route_responses, + requests: nodes_types_http_route_requests, + responses: nodes_types_http_route_responses }); export const nodes_types_http = z.object({ - current_open: z.optional( - z.number().register(z.globalRegistry, { - description: 'Current number of open HTTP connections for the node.', - }) - ), - total_opened: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total number of HTTP connections opened for the node.', + current_open: z.optional(z.number().register(z.globalRegistry, { + description: 'Current number of open HTTP connections for the node.' + })), + total_opened: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of HTTP connections opened for the node.' + })), + clients: z.optional(z.array(nodes_types_client).register(z.globalRegistry, { + description: 'Information on current and recently-closed HTTP client connections.\nClients that have been closed longer than the `http.client_stats.closed_channels.max_age` setting will not be represented here.' + })), + routes: z.record(z.string(), nodes_types_http_route).register(z.globalRegistry, { + description: 'Detailed HTTP stats broken down by route' }) - ), - clients: z.optional( - z.array(nodes_types_client).register(z.globalRegistry, { - description: - 'Information on current and recently-closed HTTP client connections.\nClients that have been closed longer than the `http.client_stats.closed_channels.max_age` setting will not be represented here.', - }) - ), - routes: z.record(z.string(), nodes_types_http_route).register(z.globalRegistry, { - description: 'Detailed HTTP stats broken down by route', - }), }); export const nodes_types_processor = z.object({ - count: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of documents transformed by the processor.', - }) - ), - current: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of documents currently being transformed by the processor.', - }) - ), - failed: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of failed operations for the processor.', - }) - ), - time_in_millis: z.optional(types_duration_value_unit_millis), + count: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of documents transformed by the processor.' + })), + current: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of documents currently being transformed by the processor.' + })), + failed: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of failed operations for the processor.' + })), + time_in_millis: z.optional(types_duration_value_unit_millis) }); export const nodes_types_keyed_processor = z.object({ - stats: z.optional(nodes_types_processor), - type: z.optional(z.string()), + stats: z.optional(nodes_types_processor), + type: z.optional(z.string()) }); export const nodes_types_ingest_stats = z.object({ - count: z.number().register(z.globalRegistry, { - description: 'Total number of documents ingested during the lifetime of this node.', - }), - current: z.number().register(z.globalRegistry, { - description: 'Total number of documents currently being ingested.', - }), - failed: z.number().register(z.globalRegistry, { - description: 'Total number of failed ingest operations during the lifetime of this node.', - }), - processors: z - .array(z.record(z.string(), nodes_types_keyed_processor)) - .register(z.globalRegistry, { - description: 'Total number of ingest processors.', - }), - time_in_millis: types_duration_value_unit_millis, - ingested_as_first_pipeline_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Total number of bytes of all documents ingested by the pipeline.\nThis field is only present on pipelines which are the first to process a document.\nThus, it is not present on pipelines which only serve as a final pipeline after a default pipeline, a pipeline run after a reroute processor, or pipelines in pipeline processors.', - }), - produced_as_first_pipeline_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Total number of bytes of all documents produced by the pipeline.\nThis field is only present on pipelines which are the first to process a document.\nThus, it is not present on pipelines which only serve as a final pipeline after a default pipeline, a pipeline run after a reroute processor, or pipelines in pipeline processors.\nIn situations where there are subsequent pipelines, the value represents the size of the document after all pipelines have run.', - }), + count: z.number().register(z.globalRegistry, { + description: 'Total number of documents ingested during the lifetime of this node.' + }), + current: z.number().register(z.globalRegistry, { + description: 'Total number of documents currently being ingested.' + }), + failed: z.number().register(z.globalRegistry, { + description: 'Total number of failed ingest operations during the lifetime of this node.' + }), + processors: z.array(z.record(z.string(), nodes_types_keyed_processor)).register(z.globalRegistry, { + description: 'Total number of ingest processors.' + }), + time_in_millis: types_duration_value_unit_millis, + ingested_as_first_pipeline_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total number of bytes of all documents ingested by the pipeline.\nThis field is only present on pipelines which are the first to process a document.\nThus, it is not present on pipelines which only serve as a final pipeline after a default pipeline, a pipeline run after a reroute processor, or pipelines in pipeline processors.' + }), + produced_as_first_pipeline_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total number of bytes of all documents produced by the pipeline.\nThis field is only present on pipelines which are the first to process a document.\nThus, it is not present on pipelines which only serve as a final pipeline after a default pipeline, a pipeline run after a reroute processor, or pipelines in pipeline processors.\nIn situations where there are subsequent pipelines, the value represents the size of the document after all pipelines have run.' + }) }); export const nodes_types_ingest_total = z.object({ - count: z.number().register(z.globalRegistry, { - description: 'Total number of documents ingested during the lifetime of this node.', - }), - current: z.number().register(z.globalRegistry, { - description: 'Total number of documents currently being ingested.', - }), - failed: z.number().register(z.globalRegistry, { - description: 'Total number of failed ingest operations during the lifetime of this node.', - }), - time_in_millis: types_duration_value_unit_millis, + count: z.number().register(z.globalRegistry, { + description: 'Total number of documents ingested during the lifetime of this node.' + }), + current: z.number().register(z.globalRegistry, { + description: 'Total number of documents currently being ingested.' + }), + failed: z.number().register(z.globalRegistry, { + description: 'Total number of failed ingest operations during the lifetime of this node.' + }), + time_in_millis: types_duration_value_unit_millis }); export const nodes_types_ingest = z.object({ - pipelines: z.optional( - z.record(z.string(), nodes_types_ingest_stats).register(z.globalRegistry, { - description: 'Contains statistics about ingest pipelines for the node.', - }) - ), - total: z.optional(nodes_types_ingest_total), + pipelines: z.optional(z.record(z.string(), nodes_types_ingest_stats).register(z.globalRegistry, { + description: 'Contains statistics about ingest pipelines for the node.' + })), + total: z.optional(nodes_types_ingest_total) }); export const nodes_types_thread_count = z.object({ - active: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of active threads in the thread pool.', - }) - ), - completed: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of tasks completed by the thread pool executor.', - }) - ), - largest: z.optional( - z.number().register(z.globalRegistry, { - description: 'Highest number of active threads in the thread pool.', - }) - ), - queue: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of tasks in queue for the thread pool.', - }) - ), - rejected: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of tasks rejected by the thread pool executor.', - }) - ), - threads: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of threads in the thread pool.', - }) - ), + active: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of active threads in the thread pool.' + })), + completed: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of tasks completed by the thread pool executor.' + })), + largest: z.optional(z.number().register(z.globalRegistry, { + description: 'Highest number of active threads in the thread pool.' + })), + queue: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of tasks in queue for the thread pool.' + })), + rejected: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of tasks rejected by the thread pool executor.' + })), + threads: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of threads in the thread pool.' + })) }); export const nodes_types_context = z.object({ - context: z.optional(z.string()), - compilations: z.optional(z.number()), - cache_evictions: z.optional(z.number()), - compilation_limit_triggered: z.optional(z.number()), + context: z.optional(z.string()), + compilations: z.optional(z.number()), + cache_evictions: z.optional(z.number()), + compilation_limit_triggered: z.optional(z.number()) }); export const nodes_types_scripting = z.object({ - cache_evictions: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total number of times the script cache has evicted old data.', - }) - ), - compilations: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total number of inline script compilations performed by the node.', - }) - ), - compilations_history: z.optional( - z.record(z.string(), z.number()).register(z.globalRegistry, { - description: 'Contains this recent history of script compilations.', - }) - ), - compilation_limit_triggered: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Total number of times the script compilation circuit breaker has limited inline script compilations.', - }) - ), - contexts: z.optional(z.array(nodes_types_context)), + cache_evictions: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of times the script cache has evicted old data.' + })), + compilations: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of inline script compilations performed by the node.' + })), + compilations_history: z.optional(z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'Contains this recent history of script compilations.' + })), + compilation_limit_triggered: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of times the script compilation circuit breaker has limited inline script compilations.' + })), + contexts: z.optional(z.array(nodes_types_context)) }); export const cluster_pending_tasks_pending_task = z.object({ - executing: z.boolean().register(z.globalRegistry, { - description: 'Indicates whether the pending tasks are currently executing or not.', - }), - insert_order: z.number().register(z.globalRegistry, { - description: 'The number that represents when the task has been inserted into the task queue.', - }), - priority: z.string().register(z.globalRegistry, { - description: - 'The priority of the pending task.\nThe valid priorities in descending priority order are: `IMMEDIATE` > `URGENT` > `HIGH` > `NORMAL` > `LOW` > `LANGUID`.', - }), - source: z.string().register(z.globalRegistry, { - description: 'A general description of the cluster task that may include a reason and origin.', - }), - time_in_queue: z.optional(types_duration), - time_in_queue_millis: types_duration_value_unit_millis, + executing: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the pending tasks are currently executing or not.' + }), + insert_order: z.number().register(z.globalRegistry, { + description: 'The number that represents when the task has been inserted into the task queue.' + }), + priority: z.string().register(z.globalRegistry, { + description: 'The priority of the pending task.\nThe valid priorities in descending priority order are: `IMMEDIATE` > `URGENT` > `HIGH` > `NORMAL` > `LOW` > `LANGUID`.' + }), + source: z.string().register(z.globalRegistry, { + description: 'A general description of the cluster task that may include a reason and origin.' + }), + time_in_queue: z.optional(types_duration), + time_in_queue_millis: types_duration_value_unit_millis }); export const types_data_stream_name = z.string(); export const cluster_remote_info_cluster_remote_sniff_info = z.object({ - mode: z.enum(['sniff']).register(z.globalRegistry, { - description: 'The connection mode for the remote cluster.', - }), - connected: z.boolean().register(z.globalRegistry, { - description: - 'If it is `true`, there is at least one open connection to the remote cluster.\nIf it is `false`, it means that the cluster no longer has an open connection to the remote cluster.\nIt does not necessarily mean that the remote cluster is down or unavailable, just that at some point a connection was lost.', - }), - max_connections_per_cluster: z.number().register(z.globalRegistry, { - description: - 'The maximum number of connections maintained for the remote cluster when sniff mode is configured.', - }), - num_nodes_connected: z.number().register(z.globalRegistry, { - description: - 'The number of connected nodes in the remote cluster when sniff mode is configured.', - }), - initial_connect_timeout: types_duration, - skip_unavailable: z.boolean().register(z.globalRegistry, { - description: - 'If `true`, cross-cluster search skips the remote cluster when its nodes are unavailable during the search and ignores errors returned by the remote cluster.', - }), - seeds: z.array(z.string()).register(z.globalRegistry, { - description: - 'The initial seed transport addresses of the remote cluster when sniff mode is configured.', - }), + mode: z.enum(['sniff']).register(z.globalRegistry, { + description: 'The connection mode for the remote cluster.' + }), + connected: z.boolean().register(z.globalRegistry, { + description: 'If it is `true`, there is at least one open connection to the remote cluster.\nIf it is `false`, it means that the cluster no longer has an open connection to the remote cluster.\nIt does not necessarily mean that the remote cluster is down or unavailable, just that at some point a connection was lost.' + }), + max_connections_per_cluster: z.number().register(z.globalRegistry, { + description: 'The maximum number of connections maintained for the remote cluster when sniff mode is configured.' + }), + num_nodes_connected: z.number().register(z.globalRegistry, { + description: 'The number of connected nodes in the remote cluster when sniff mode is configured.' + }), + initial_connect_timeout: types_duration, + skip_unavailable: z.boolean().register(z.globalRegistry, { + description: 'If `true`, cross-cluster search skips the remote cluster when its nodes are unavailable during the search and ignores errors returned by the remote cluster.' + }), + seeds: z.array(z.string()).register(z.globalRegistry, { + description: 'The initial seed transport addresses of the remote cluster when sniff mode is configured.' + }) }); export const cluster_remote_info_cluster_remote_proxy_info = z.object({ - mode: z.enum(['proxy']).register(z.globalRegistry, { - description: 'The connection mode for the remote cluster.', - }), - connected: z.boolean().register(z.globalRegistry, { - description: - 'If it is `true`, there is at least one open connection to the remote cluster.\nIf it is `false`, it means that the cluster no longer has an open connection to the remote cluster.\nIt does not necessarily mean that the remote cluster is down or unavailable, just that at some point a connection was lost.', - }), - initial_connect_timeout: types_duration, - skip_unavailable: z.boolean().register(z.globalRegistry, { - description: - 'If `true`, cross-cluster search skips the remote cluster when its nodes are unavailable during the search and ignores errors returned by the remote cluster.', - }), - proxy_address: z.string().register(z.globalRegistry, { - description: 'The address for remote connections when proxy mode is configured.', - }), - server_name: z.string(), - num_proxy_sockets_connected: z.number().register(z.globalRegistry, { - description: - 'The number of open socket connections to the remote cluster when proxy mode is configured.', - }), - max_proxy_socket_connections: z.number().register(z.globalRegistry, { - description: - 'The maximum number of socket connections to the remote cluster when proxy mode is configured.', - }), - cluster_credentials: z.optional( - z.string().register(z.globalRegistry, { - description: - 'This field is present and has a value of `::es_redacted::` only when the remote cluster is configured with the API key based model. Otherwise, the field is not present.', - }) - ), + mode: z.enum(['proxy']).register(z.globalRegistry, { + description: 'The connection mode for the remote cluster.' + }), + connected: z.boolean().register(z.globalRegistry, { + description: 'If it is `true`, there is at least one open connection to the remote cluster.\nIf it is `false`, it means that the cluster no longer has an open connection to the remote cluster.\nIt does not necessarily mean that the remote cluster is down or unavailable, just that at some point a connection was lost.' + }), + initial_connect_timeout: types_duration, + skip_unavailable: z.boolean().register(z.globalRegistry, { + description: 'If `true`, cross-cluster search skips the remote cluster when its nodes are unavailable during the search and ignores errors returned by the remote cluster.' + }), + proxy_address: z.string().register(z.globalRegistry, { + description: 'The address for remote connections when proxy mode is configured.' + }), + server_name: z.string(), + num_proxy_sockets_connected: z.number().register(z.globalRegistry, { + description: 'The number of open socket connections to the remote cluster when proxy mode is configured.' + }), + max_proxy_socket_connections: z.number().register(z.globalRegistry, { + description: 'The maximum number of socket connections to the remote cluster when proxy mode is configured.' + }), + cluster_credentials: z.optional(z.string().register(z.globalRegistry, { + description: 'This field is present and has a value of `::es_redacted::` only when the remote cluster is configured with the API key based model. Otherwise, the field is not present.' + })) }); export const cluster_remote_info_cluster_remote_info = z.union([ - z - .object({ - mode: z.literal('sniff'), - }) - .and(cluster_remote_info_cluster_remote_sniff_info), - z - .object({ - mode: z.literal('proxy'), - }) - .and(cluster_remote_info_cluster_remote_proxy_info), + z.object({ + mode: z.literal('sniff') + }).and(cluster_remote_info_cluster_remote_sniff_info), + z.object({ + mode: z.literal('proxy') + }).and(cluster_remote_info_cluster_remote_proxy_info) ]); export const cluster_reroute_command_cancel_action = z.object({ - index: types_index_name, - shard: z.number(), - node: z.string(), - allow_primary: z.optional(z.boolean()), + index: types_index_name, + shard: z.number(), + node: z.string(), + allow_primary: z.optional(z.boolean()) }); export const cluster_reroute_command_move_action = z.object({ - index: types_index_name, - shard: z.number(), - from_node: z.string().register(z.globalRegistry, { - description: 'The node to move the shard from', - }), - to_node: z.string().register(z.globalRegistry, { - description: 'The node to move the shard to', - }), + index: types_index_name, + shard: z.number(), + from_node: z.string().register(z.globalRegistry, { + description: 'The node to move the shard from' + }), + to_node: z.string().register(z.globalRegistry, { + description: 'The node to move the shard to' + }) }); export const cluster_reroute_command_allocate_replica_action = z.object({ - index: types_index_name, - shard: z.number(), - node: z.string(), + index: types_index_name, + shard: z.number(), + node: z.string() }); export const cluster_reroute_command_allocate_primary_action = z.object({ - index: types_index_name, - shard: z.number(), - node: z.string(), - accept_data_loss: z.boolean().register(z.globalRegistry, { - description: - 'If a node which has a copy of the data rejoins the cluster later on, that data will be deleted. To ensure that these implications are well-understood, this command requires the flag accept_data_loss to be explicitly set to true', - }), + index: types_index_name, + shard: z.number(), + node: z.string(), + accept_data_loss: z.boolean().register(z.globalRegistry, { + description: 'If a node which has a copy of the data rejoins the cluster later on, that data will be deleted. To ensure that these implications are well-understood, this command requires the flag accept_data_loss to be explicitly set to true' + }) }); export const cluster_reroute_command = z.object({ - cancel: z.optional(cluster_reroute_command_cancel_action), - move: z.optional(cluster_reroute_command_move_action), - allocate_replica: z.optional(cluster_reroute_command_allocate_replica_action), - allocate_stale_primary: z.optional(cluster_reroute_command_allocate_primary_action), - allocate_empty_primary: z.optional(cluster_reroute_command_allocate_primary_action), + cancel: z.optional(cluster_reroute_command_cancel_action), + move: z.optional(cluster_reroute_command_move_action), + allocate_replica: z.optional(cluster_reroute_command_allocate_replica_action), + allocate_stale_primary: z.optional(cluster_reroute_command_allocate_primary_action), + allocate_empty_primary: z.optional(cluster_reroute_command_allocate_primary_action) }); export const cluster_reroute_reroute_decision = z.object({ - decider: z.string(), - decision: z.string(), - explanation: z.string(), + decider: z.string(), + decision: z.string(), + explanation: z.string() }); export const types_node_name = z.string(); export const cluster_reroute_reroute_parameters = z.object({ - allow_primary: z.boolean(), - index: types_index_name, - node: types_node_name, - shard: z.number(), - from_node: z.optional(types_node_name), - to_node: z.optional(types_node_name), + allow_primary: z.boolean(), + index: types_index_name, + node: types_node_name, + shard: z.number(), + from_node: z.optional(types_node_name), + to_node: z.optional(types_node_name) }); export const cluster_reroute_reroute_explanation = z.object({ - command: z.string(), - decisions: z.array(cluster_reroute_reroute_decision), - parameters: cluster_reroute_reroute_parameters, + command: z.string(), + decisions: z.array(cluster_reroute_reroute_decision), + parameters: cluster_reroute_reroute_parameters }); export const cluster_state_cluster_state_metric = z.enum([ - '_all', - 'version', - 'master_node', - 'blocks', - 'nodes', - 'metadata', - 'routing_table', - 'routing_nodes', - 'customs', + '_all', + 'version', + 'master_node', + 'blocks', + 'nodes', + 'metadata', + 'routing_table', + 'routing_nodes', + 'customs' ]); export const cluster_state_cluster_state_metrics = z.union([ - cluster_state_cluster_state_metric, - z.array(cluster_state_cluster_state_metric), + cluster_state_cluster_state_metric, + z.array(cluster_state_cluster_state_metric) ]); export const cluster_stats_field_types = z.object({ - name: types_name, - count: z.number().register(z.globalRegistry, { - description: 'The number of occurrences of the field type in selected nodes.', - }), - index_count: z.number().register(z.globalRegistry, { - description: 'The number of indices containing the field type in selected nodes.', - }), - indexed_vector_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For dense_vector field types, number of indexed vector types in selected nodes.', - }) - ), - indexed_vector_dim_max: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For dense_vector field types, the maximum dimension of all indexed vector types in selected nodes.', - }) - ), - indexed_vector_dim_min: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For dense_vector field types, the minimum dimension of all indexed vector types in selected nodes.', - }) - ), - script_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of fields that declare a script.', - }) - ), - vector_index_type_count: z.optional( - z.record(z.string(), z.number()).register(z.globalRegistry, { - description: 'For dense_vector field types, count of mappings by index type', - }) - ), - vector_similarity_type_count: z.optional( - z.record(z.string(), z.number()).register(z.globalRegistry, { - description: 'For dense_vector field types, count of mappings by similarity', - }) - ), - vector_element_type_count: z.optional( - z.record(z.string(), z.number()).register(z.globalRegistry, { - description: 'For dense_vector field types, count of mappings by element type', - }) - ), + name: types_name, + count: z.number().register(z.globalRegistry, { + description: 'The number of occurrences of the field type in selected nodes.' + }), + index_count: z.number().register(z.globalRegistry, { + description: 'The number of indices containing the field type in selected nodes.' + }), + indexed_vector_count: z.optional(z.number().register(z.globalRegistry, { + description: 'For dense_vector field types, number of indexed vector types in selected nodes.' + })), + indexed_vector_dim_max: z.optional(z.number().register(z.globalRegistry, { + description: 'For dense_vector field types, the maximum dimension of all indexed vector types in selected nodes.' + })), + indexed_vector_dim_min: z.optional(z.number().register(z.globalRegistry, { + description: 'For dense_vector field types, the minimum dimension of all indexed vector types in selected nodes.' + })), + script_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of fields that declare a script.' + })), + vector_index_type_count: z.optional(z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'For dense_vector field types, count of mappings by index type' + })), + vector_similarity_type_count: z.optional(z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'For dense_vector field types, count of mappings by similarity' + })), + vector_element_type_count: z.optional(z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'For dense_vector field types, count of mappings by element type' + })) }); export const cluster_stats_synonyms_stats = z.object({ - count: z.number(), - index_count: z.number(), + count: z.number(), + index_count: z.number() }); export const cluster_stats_char_filter_types = z.object({ - analyzer_types: z.array(cluster_stats_field_types).register(z.globalRegistry, { - description: 'Contains statistics about analyzer types used in selected nodes.', - }), - built_in_analyzers: z.array(cluster_stats_field_types).register(z.globalRegistry, { - description: 'Contains statistics about built-in analyzers used in selected nodes.', - }), - built_in_char_filters: z.array(cluster_stats_field_types).register(z.globalRegistry, { - description: 'Contains statistics about built-in character filters used in selected nodes.', - }), - built_in_filters: z.array(cluster_stats_field_types).register(z.globalRegistry, { - description: 'Contains statistics about built-in token filters used in selected nodes.', - }), - built_in_tokenizers: z.array(cluster_stats_field_types).register(z.globalRegistry, { - description: 'Contains statistics about built-in tokenizers used in selected nodes.', - }), - char_filter_types: z.array(cluster_stats_field_types).register(z.globalRegistry, { - description: 'Contains statistics about character filter types used in selected nodes.', - }), - filter_types: z.array(cluster_stats_field_types).register(z.globalRegistry, { - description: 'Contains statistics about token filter types used in selected nodes.', - }), - tokenizer_types: z.array(cluster_stats_field_types).register(z.globalRegistry, { - description: 'Contains statistics about tokenizer types used in selected nodes.', - }), - synonyms: z.record(z.string(), cluster_stats_synonyms_stats).register(z.globalRegistry, { - description: 'Contains statistics about synonyms types used in selected nodes.', - }), + analyzer_types: z.array(cluster_stats_field_types).register(z.globalRegistry, { + description: 'Contains statistics about analyzer types used in selected nodes.' + }), + built_in_analyzers: z.array(cluster_stats_field_types).register(z.globalRegistry, { + description: 'Contains statistics about built-in analyzers used in selected nodes.' + }), + built_in_char_filters: z.array(cluster_stats_field_types).register(z.globalRegistry, { + description: 'Contains statistics about built-in character filters used in selected nodes.' + }), + built_in_filters: z.array(cluster_stats_field_types).register(z.globalRegistry, { + description: 'Contains statistics about built-in token filters used in selected nodes.' + }), + built_in_tokenizers: z.array(cluster_stats_field_types).register(z.globalRegistry, { + description: 'Contains statistics about built-in tokenizers used in selected nodes.' + }), + char_filter_types: z.array(cluster_stats_field_types).register(z.globalRegistry, { + description: 'Contains statistics about character filter types used in selected nodes.' + }), + filter_types: z.array(cluster_stats_field_types).register(z.globalRegistry, { + description: 'Contains statistics about token filter types used in selected nodes.' + }), + tokenizer_types: z.array(cluster_stats_field_types).register(z.globalRegistry, { + description: 'Contains statistics about tokenizer types used in selected nodes.' + }), + synonyms: z.record(z.string(), cluster_stats_synonyms_stats).register(z.globalRegistry, { + description: 'Contains statistics about synonyms types used in selected nodes.' + }) }); export const types_field_size_usage = z.object({ - size: z.optional(types_byte_size), - size_in_bytes: z.number(), + size: z.optional(types_byte_size), + size_in_bytes: z.number() }); export const types_completion_stats = z.object({ - size_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Total amount, in bytes, of memory used for completion across all shards assigned to selected nodes.', - }), - size: z.optional(types_byte_size), - fields: z.optional(z.record(z.string(), types_field_size_usage)), + size_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total amount, in bytes, of memory used for completion across all shards assigned to selected nodes.' + }), + size: z.optional(types_byte_size), + fields: z.optional(z.record(z.string(), types_field_size_usage)) }); export const types_doc_stats = z.object({ - count: z.number().register(z.globalRegistry, { - description: - 'Total number of non-deleted documents across all primary shards assigned to selected nodes.\nThis number is based on documents in Lucene segments and may include documents from nested fields.', - }), - deleted: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Total number of deleted documents across all primary shards assigned to selected nodes.\nThis number is based on documents in Lucene segments.\nElasticsearch reclaims the disk space of deleted Lucene documents when a segment is merged.', - }) - ), - total_size_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Returns the total size in bytes of all documents in this stats.\nThis value may be more reliable than store_stats.size_in_bytes in estimating the index size.', - }), - total_size: z.optional(types_byte_size), + count: z.number().register(z.globalRegistry, { + description: 'Total number of non-deleted documents across all primary shards assigned to selected nodes.\nThis number is based on documents in Lucene segments and may include documents from nested fields.' + }), + deleted: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of deleted documents across all primary shards assigned to selected nodes.\nThis number is based on documents in Lucene segments.\nElasticsearch reclaims the disk space of deleted Lucene documents when a segment is merged.' + })), + total_size_in_bytes: z.number().register(z.globalRegistry, { + description: 'Returns the total size in bytes of all documents in this stats.\nThis value may be more reliable than store_stats.size_in_bytes in estimating the index size.' + }), + total_size: z.optional(types_byte_size) }); export const types_field_memory_usage = z.object({ - memory_size: z.optional(types_byte_size), - memory_size_in_bytes: z.number(), + memory_size: z.optional(types_byte_size), + memory_size_in_bytes: z.number() }); export const types_global_ordinal_field_stats = z.object({ - build_time_in_millis: types_unit_millis, - build_time: z.optional(z.string()), - shard_max_value_count: z.number(), + build_time_in_millis: types_unit_millis, + build_time: z.optional(z.string()), + shard_max_value_count: z.number() }); export const types_global_ordinals_stats = z.object({ - build_time_in_millis: types_unit_millis, - build_time: z.optional(z.string()), - fields: z.optional(z.record(z.string(), types_global_ordinal_field_stats)), + build_time_in_millis: types_unit_millis, + build_time: z.optional(z.string()), + fields: z.optional(z.record(z.string(), types_global_ordinal_field_stats)) }); export const types_fielddata_stats = z.object({ - evictions: z.optional(z.number()), - memory_size: z.optional(types_byte_size), - memory_size_in_bytes: z.number(), - fields: z.optional(z.record(z.string(), types_field_memory_usage)), - global_ordinals: types_global_ordinals_stats, + evictions: z.optional(z.number()), + memory_size: z.optional(types_byte_size), + memory_size_in_bytes: z.number(), + fields: z.optional(z.record(z.string(), types_field_memory_usage)), + global_ordinals: types_global_ordinals_stats }); export const types_query_cache_stats = z.object({ - cache_count: z.number().register(z.globalRegistry, { - description: - 'Total number of entries added to the query cache across all shards assigned to selected nodes.\nThis number includes current and evicted entries.', - }), - cache_size: z.number().register(z.globalRegistry, { - description: - 'Total number of entries currently in the query cache across all shards assigned to selected nodes.', - }), - evictions: z.number().register(z.globalRegistry, { - description: - 'Total number of query cache evictions across all shards assigned to selected nodes.', - }), - hit_count: z.number().register(z.globalRegistry, { - description: 'Total count of query cache hits across all shards assigned to selected nodes.', - }), - memory_size: z.optional(types_byte_size), - memory_size_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Total amount, in bytes, of memory used for the query cache across all shards assigned to selected nodes.', - }), - miss_count: z.number().register(z.globalRegistry, { - description: 'Total count of query cache misses across all shards assigned to selected nodes.', - }), - total_count: z.number().register(z.globalRegistry, { - description: - 'Total count of hits and misses in the query cache across all shards assigned to selected nodes.', - }), + cache_count: z.number().register(z.globalRegistry, { + description: 'Total number of entries added to the query cache across all shards assigned to selected nodes.\nThis number includes current and evicted entries.' + }), + cache_size: z.number().register(z.globalRegistry, { + description: 'Total number of entries currently in the query cache across all shards assigned to selected nodes.' + }), + evictions: z.number().register(z.globalRegistry, { + description: 'Total number of query cache evictions across all shards assigned to selected nodes.' + }), + hit_count: z.number().register(z.globalRegistry, { + description: 'Total count of query cache hits across all shards assigned to selected nodes.' + }), + memory_size: z.optional(types_byte_size), + memory_size_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total amount, in bytes, of memory used for the query cache across all shards assigned to selected nodes.' + }), + miss_count: z.number().register(z.globalRegistry, { + description: 'Total count of query cache misses across all shards assigned to selected nodes.' + }), + total_count: z.number().register(z.globalRegistry, { + description: 'Total count of hits and misses in the query cache across all shards assigned to selected nodes.' + }) }); export const cluster_stats_extended_text_similarity_retriever_usage = z.object({ - chunk_rescorer: z.optional(z.number()), + chunk_rescorer: z.optional(z.number()) }); export const cluster_stats_extended_retrievers_search_usage = z.object({ - text_similarity_reranker: z.optional(cluster_stats_extended_text_similarity_retriever_usage), + text_similarity_reranker: z.optional(cluster_stats_extended_text_similarity_retriever_usage) }); export const cluster_stats_extended_search_usage = z.object({ - retrievers: z.optional(cluster_stats_extended_retrievers_search_usage), + retrievers: z.optional(cluster_stats_extended_retrievers_search_usage) }); export const cluster_stats_search_usage_stats = z.object({ - total: z.number(), - queries: z.record(z.string(), z.number()), - rescorers: z.record(z.string(), z.number()), - sections: z.record(z.string(), z.number()), - retrievers: z.record(z.string(), z.number()), - extended: cluster_stats_extended_search_usage, + total: z.number(), + queries: z.record(z.string(), z.number()), + rescorers: z.record(z.string(), z.number()), + sections: z.record(z.string(), z.number()), + retrievers: z.record(z.string(), z.number()), + extended: cluster_stats_extended_search_usage }); export const indices_stats_shard_file_size_info = z.object({ - description: z.string(), - size_in_bytes: z.number(), - min_size_in_bytes: z.optional(z.number()), - max_size_in_bytes: z.optional(z.number()), - average_size_in_bytes: z.optional(z.number()), - count: z.optional(z.number()), + description: z.string(), + size_in_bytes: z.number(), + min_size_in_bytes: z.optional(z.number()), + max_size_in_bytes: z.optional(z.number()), + average_size_in_bytes: z.optional(z.number()), + count: z.optional(z.number()) }); export const types_segments_stats = z.object({ - count: z.number().register(z.globalRegistry, { - description: 'Total number of segments across all shards assigned to selected nodes.', - }), - doc_values_memory: z.optional(types_byte_size), - doc_values_memory_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Total amount, in bytes, of memory used for doc values across all shards assigned to selected nodes.', - }), - file_sizes: z.record(z.string(), indices_stats_shard_file_size_info).register(z.globalRegistry, { - description: - 'This object is not populated by the cluster stats API.\nTo get information on segment files, use the node stats API.', - }), - fixed_bit_set: z.optional(types_byte_size), - fixed_bit_set_memory_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Total amount of memory, in bytes, used by fixed bit sets across all shards assigned to selected nodes.', - }), - index_writer_memory: z.optional(types_byte_size), - index_writer_memory_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Total amount, in bytes, of memory used by all index writers across all shards assigned to selected nodes.', - }), - max_unsafe_auto_id_timestamp: z.number().register(z.globalRegistry, { - description: 'Unix timestamp, in milliseconds, of the most recently retried indexing request.', - }), - memory: z.optional(types_byte_size), - memory_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Total amount, in bytes, of memory used for segments across all shards assigned to selected nodes.', - }), - norms_memory: z.optional(types_byte_size), - norms_memory_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Total amount, in bytes, of memory used for normalization factors across all shards assigned to selected nodes.', - }), - points_memory: z.optional(types_byte_size), - points_memory_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Total amount, in bytes, of memory used for points across all shards assigned to selected nodes.', - }), - stored_fields_memory_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Total amount, in bytes, of memory used for stored fields across all shards assigned to selected nodes.', - }), - stored_fields_memory: z.optional(types_byte_size), - terms_memory_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Total amount, in bytes, of memory used for terms across all shards assigned to selected nodes.', - }), - terms_memory: z.optional(types_byte_size), - term_vectors_memory: z.optional(types_byte_size), - term_vectors_memory_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Total amount, in bytes, of memory used for term vectors across all shards assigned to selected nodes.', - }), - version_map_memory: z.optional(types_byte_size), - version_map_memory_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Total amount, in bytes, of memory used by all version maps across all shards assigned to selected nodes.', - }), + count: z.number().register(z.globalRegistry, { + description: 'Total number of segments across all shards assigned to selected nodes.' + }), + doc_values_memory: z.optional(types_byte_size), + doc_values_memory_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total amount, in bytes, of memory used for doc values across all shards assigned to selected nodes.' + }), + file_sizes: z.record(z.string(), indices_stats_shard_file_size_info).register(z.globalRegistry, { + description: 'This object is not populated by the cluster stats API.\nTo get information on segment files, use the node stats API.' + }), + fixed_bit_set: z.optional(types_byte_size), + fixed_bit_set_memory_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total amount of memory, in bytes, used by fixed bit sets across all shards assigned to selected nodes.' + }), + index_writer_memory: z.optional(types_byte_size), + index_writer_memory_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total amount, in bytes, of memory used by all index writers across all shards assigned to selected nodes.' + }), + max_unsafe_auto_id_timestamp: z.number().register(z.globalRegistry, { + description: 'Unix timestamp, in milliseconds, of the most recently retried indexing request.' + }), + memory: z.optional(types_byte_size), + memory_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total amount, in bytes, of memory used for segments across all shards assigned to selected nodes.' + }), + norms_memory: z.optional(types_byte_size), + norms_memory_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total amount, in bytes, of memory used for normalization factors across all shards assigned to selected nodes.' + }), + points_memory: z.optional(types_byte_size), + points_memory_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total amount, in bytes, of memory used for points across all shards assigned to selected nodes.' + }), + stored_fields_memory_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total amount, in bytes, of memory used for stored fields across all shards assigned to selected nodes.' + }), + stored_fields_memory: z.optional(types_byte_size), + terms_memory_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total amount, in bytes, of memory used for terms across all shards assigned to selected nodes.' + }), + terms_memory: z.optional(types_byte_size), + term_vectors_memory: z.optional(types_byte_size), + term_vectors_memory_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total amount, in bytes, of memory used for term vectors across all shards assigned to selected nodes.' + }), + version_map_memory: z.optional(types_byte_size), + version_map_memory_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total amount, in bytes, of memory used by all version maps across all shards assigned to selected nodes.' + }) }); export const cluster_stats_cluster_shard_metrics = z.object({ - avg: z.number().register(z.globalRegistry, { - description: - 'Mean number of shards in an index, counting only shards assigned to selected nodes.', - }), - max: z.number().register(z.globalRegistry, { - description: - 'Maximum number of shards in an index, counting only shards assigned to selected nodes.', - }), - min: z.number().register(z.globalRegistry, { - description: - 'Minimum number of shards in an index, counting only shards assigned to selected nodes.', - }), + avg: z.number().register(z.globalRegistry, { + description: 'Mean number of shards in an index, counting only shards assigned to selected nodes.' + }), + max: z.number().register(z.globalRegistry, { + description: 'Maximum number of shards in an index, counting only shards assigned to selected nodes.' + }), + min: z.number().register(z.globalRegistry, { + description: 'Minimum number of shards in an index, counting only shards assigned to selected nodes.' + }) }); export const cluster_stats_cluster_indices_shards_index = z.object({ - primaries: cluster_stats_cluster_shard_metrics, - replication: cluster_stats_cluster_shard_metrics, - shards: cluster_stats_cluster_shard_metrics, + primaries: cluster_stats_cluster_shard_metrics, + replication: cluster_stats_cluster_shard_metrics, + shards: cluster_stats_cluster_shard_metrics }); /** * Contains statistics about shards assigned to selected nodes. */ -export const cluster_stats_cluster_indices_shards = z - .object({ +export const cluster_stats_cluster_indices_shards = z.object({ index: z.optional(cluster_stats_cluster_indices_shards_index), - primaries: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of primary shards assigned to selected nodes.', - }) - ), - replication: z.optional( - z.number().register(z.globalRegistry, { - description: 'Ratio of replica shards to primary shards across all selected nodes.', - }) - ), - total: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total number of shards assigned to selected nodes.', - }) - ), - }) - .register(z.globalRegistry, { - description: 'Contains statistics about shards assigned to selected nodes.', - }); + primaries: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of primary shards assigned to selected nodes.' + })), + replication: z.optional(z.number().register(z.globalRegistry, { + description: 'Ratio of replica shards to primary shards across all selected nodes.' + })), + total: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of shards assigned to selected nodes.' + })) +}).register(z.globalRegistry, { + description: 'Contains statistics about shards assigned to selected nodes.' +}); export const types_store_stats = z.object({ - size: z.optional(types_byte_size), - size_in_bytes: z.number().register(z.globalRegistry, { - description: 'Total size, in bytes, of all shards assigned to selected nodes.', - }), - reserved: z.optional(types_byte_size), - reserved_in_bytes: z.number().register(z.globalRegistry, { - description: - 'A prediction, in bytes, of how much larger the shard stores will eventually grow due to ongoing peer recoveries, restoring snapshots, and similar activities.', - }), - total_data_set_size: z.optional(types_byte_size), - total_data_set_size_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Total data set size, in bytes, of all shards assigned to selected nodes.\nThis includes the size of shards not stored fully on the nodes, such as the cache for partially mounted indices.', - }) - ), + size: z.optional(types_byte_size), + size_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total size, in bytes, of all shards assigned to selected nodes.' + }), + reserved: z.optional(types_byte_size), + reserved_in_bytes: z.number().register(z.globalRegistry, { + description: 'A prediction, in bytes, of how much larger the shard stores will eventually grow due to ongoing peer recoveries, restoring snapshots, and similar activities.' + }), + total_data_set_size: z.optional(types_byte_size), + total_data_set_size_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Total data set size, in bytes, of all shards assigned to selected nodes.\nThis includes the size of shards not stored fully on the nodes, such as the cache for partially mounted indices.' + })) }); export const cluster_stats_runtime_field_types = z.object({ - chars_max: z.number().register(z.globalRegistry, { - description: 'Maximum number of characters for a single runtime field script.', - }), - chars_total: z.number().register(z.globalRegistry, { - description: - 'Total number of characters for the scripts that define the current runtime field data type.', - }), - count: z.number().register(z.globalRegistry, { - description: 'Number of runtime fields mapped to the field data type in selected nodes.', - }), - doc_max: z.number().register(z.globalRegistry, { - description: 'Maximum number of accesses to doc_values for a single runtime field script', - }), - doc_total: z.number().register(z.globalRegistry, { - description: - 'Total number of accesses to doc_values for the scripts that define the current runtime field data type.', - }), - index_count: z.number().register(z.globalRegistry, { - description: - 'Number of indices containing a mapping of the runtime field data type in selected nodes.', - }), - lang: z.array(z.string()).register(z.globalRegistry, { - description: 'Script languages used for the runtime fields scripts.', - }), - lines_max: z.number().register(z.globalRegistry, { - description: 'Maximum number of lines for a single runtime field script.', - }), - lines_total: z.number().register(z.globalRegistry, { - description: - 'Total number of lines for the scripts that define the current runtime field data type.', - }), - name: types_name, - scriptless_count: z.number().register(z.globalRegistry, { - description: 'Number of runtime fields that don’t declare a script.', - }), - shadowed_count: z.number().register(z.globalRegistry, { - description: 'Number of runtime fields that shadow an indexed field.', - }), - source_max: z.number().register(z.globalRegistry, { - description: 'Maximum number of accesses to _source for a single runtime field script.', - }), - source_total: z.number().register(z.globalRegistry, { - description: - 'Total number of accesses to _source for the scripts that define the current runtime field data type.', - }), + chars_max: z.number().register(z.globalRegistry, { + description: 'Maximum number of characters for a single runtime field script.' + }), + chars_total: z.number().register(z.globalRegistry, { + description: 'Total number of characters for the scripts that define the current runtime field data type.' + }), + count: z.number().register(z.globalRegistry, { + description: 'Number of runtime fields mapped to the field data type in selected nodes.' + }), + doc_max: z.number().register(z.globalRegistry, { + description: 'Maximum number of accesses to doc_values for a single runtime field script' + }), + doc_total: z.number().register(z.globalRegistry, { + description: 'Total number of accesses to doc_values for the scripts that define the current runtime field data type.' + }), + index_count: z.number().register(z.globalRegistry, { + description: 'Number of indices containing a mapping of the runtime field data type in selected nodes.' + }), + lang: z.array(z.string()).register(z.globalRegistry, { + description: 'Script languages used for the runtime fields scripts.' + }), + lines_max: z.number().register(z.globalRegistry, { + description: 'Maximum number of lines for a single runtime field script.' + }), + lines_total: z.number().register(z.globalRegistry, { + description: 'Total number of lines for the scripts that define the current runtime field data type.' + }), + name: types_name, + scriptless_count: z.number().register(z.globalRegistry, { + description: 'Number of runtime fields that don’t declare a script.' + }), + shadowed_count: z.number().register(z.globalRegistry, { + description: 'Number of runtime fields that shadow an indexed field.' + }), + source_max: z.number().register(z.globalRegistry, { + description: 'Maximum number of accesses to _source for a single runtime field script.' + }), + source_total: z.number().register(z.globalRegistry, { + description: 'Total number of accesses to _source for the scripts that define the current runtime field data type.' + }) }); export const cluster_stats_field_types_mappings = z.object({ - field_types: z.array(cluster_stats_field_types).register(z.globalRegistry, { - description: 'Contains statistics about field data types used in selected nodes.', - }), - runtime_field_types: z.array(cluster_stats_runtime_field_types).register(z.globalRegistry, { - description: 'Contains statistics about runtime field data types used in selected nodes.', - }), - total_field_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total number of fields in all non-system indices.', - }) - ), - total_deduplicated_field_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Total number of fields in all non-system indices, accounting for mapping deduplication.', - }) - ), - total_deduplicated_mapping_size: z.optional(types_byte_size), - total_deduplicated_mapping_size_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total size of all mappings, in bytes, after deduplication and compression.', + field_types: z.array(cluster_stats_field_types).register(z.globalRegistry, { + description: 'Contains statistics about field data types used in selected nodes.' + }), + runtime_field_types: z.array(cluster_stats_runtime_field_types).register(z.globalRegistry, { + description: 'Contains statistics about runtime field data types used in selected nodes.' + }), + total_field_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of fields in all non-system indices.' + })), + total_deduplicated_field_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of fields in all non-system indices, accounting for mapping deduplication.' + })), + total_deduplicated_mapping_size: z.optional(types_byte_size), + total_deduplicated_mapping_size_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Total size of all mappings, in bytes, after deduplication and compression.' + })), + source_modes: z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'Source mode usage count.' }) - ), - source_modes: z.record(z.string(), z.number()).register(z.globalRegistry, { - description: 'Source mode usage count.', - }), }); export const cluster_stats_indices_versions = z.object({ - index_count: z.number(), - primary_shard_count: z.number(), - total_primary_bytes: z.number(), - total_primary_size: z.optional(types_byte_size), - version: types_version_string, + index_count: z.number(), + primary_shard_count: z.number(), + total_primary_bytes: z.number(), + total_primary_size: z.optional(types_byte_size), + version: types_version_string }); export const cluster_stats_dense_vector_off_heap_stats = z.object({ - total_size_bytes: z.number(), - total_size: z.optional(types_byte_size), - total_veb_size_bytes: z.number(), - total_veb_size: z.optional(types_byte_size), - total_vec_size_bytes: z.number(), - total_vec_size: z.optional(types_byte_size), - total_veq_size_bytes: z.number(), - total_veq_size: z.optional(types_byte_size), - total_vex_size_bytes: z.number(), - total_vex_size: z.optional(types_byte_size), - total_cenif_size_bytes: z.number(), - total_cenif_size: z.optional(types_byte_size), - total_clivf_size_bytes: z.number(), - total_clivf_size: z.optional(types_byte_size), - fielddata: z.optional(z.record(z.string(), z.record(z.string(), z.number()))), + total_size_bytes: z.number(), + total_size: z.optional(types_byte_size), + total_veb_size_bytes: z.number(), + total_veb_size: z.optional(types_byte_size), + total_vec_size_bytes: z.number(), + total_vec_size: z.optional(types_byte_size), + total_veq_size_bytes: z.number(), + total_veq_size: z.optional(types_byte_size), + total_vex_size_bytes: z.number(), + total_vex_size: z.optional(types_byte_size), + total_cenif_size_bytes: z.number(), + total_cenif_size: z.optional(types_byte_size), + total_clivf_size_bytes: z.number(), + total_clivf_size: z.optional(types_byte_size), + fielddata: z.optional(z.record(z.string(), z.record(z.string(), z.number()))) }); export const cluster_stats_dense_vector_stats = z.object({ - value_count: z.number(), - off_heap: z.optional(cluster_stats_dense_vector_off_heap_stats), + value_count: z.number(), + off_heap: z.optional(cluster_stats_dense_vector_off_heap_stats) }); export const cluster_stats_sparse_vector_stats = z.object({ - value_count: z.number(), + value_count: z.number() }); export const cluster_stats_cluster_indices = z.object({ - analysis: z.optional(cluster_stats_char_filter_types), - completion: types_completion_stats, - count: z.number().register(z.globalRegistry, { - description: 'Total number of indices with shards assigned to selected nodes.', - }), - docs: types_doc_stats, - fielddata: types_fielddata_stats, - query_cache: types_query_cache_stats, - search: cluster_stats_search_usage_stats, - segments: types_segments_stats, - shards: cluster_stats_cluster_indices_shards, - store: types_store_stats, - mappings: z.optional(cluster_stats_field_types_mappings), - versions: z.optional( - z.array(cluster_stats_indices_versions).register(z.globalRegistry, { - description: - 'Contains statistics about analyzers and analyzer components used in selected nodes.', - }) - ), - dense_vector: cluster_stats_dense_vector_stats, - sparse_vector: cluster_stats_sparse_vector_stats, + analysis: z.optional(cluster_stats_char_filter_types), + completion: types_completion_stats, + count: z.number().register(z.globalRegistry, { + description: 'Total number of indices with shards assigned to selected nodes.' + }), + docs: types_doc_stats, + fielddata: types_fielddata_stats, + query_cache: types_query_cache_stats, + search: cluster_stats_search_usage_stats, + segments: types_segments_stats, + shards: cluster_stats_cluster_indices_shards, + store: types_store_stats, + mappings: z.optional(cluster_stats_field_types_mappings), + versions: z.optional(z.array(cluster_stats_indices_versions).register(z.globalRegistry, { + description: 'Contains statistics about analyzers and analyzer components used in selected nodes.' + })), + dense_vector: cluster_stats_dense_vector_stats, + sparse_vector: cluster_stats_sparse_vector_stats }); export const cluster_stats_cluster_node_count = z.object({ - total: z.number(), - coordinating_only: z.optional(z.number()), - data: z.optional(z.number()), - data_cold: z.optional(z.number()), - data_content: z.optional(z.number()), - data_frozen: z.optional(z.number()), - data_hot: z.optional(z.number()), - data_warm: z.optional(z.number()), - index: z.optional(z.number()), - ingest: z.optional(z.number()), - master: z.optional(z.number()), - ml: z.optional(z.number()), - remote_cluster_client: z.optional(z.number()), - search: z.optional(z.number()), - transform: z.optional(z.number()), - voting_only: z.optional(z.number()), + total: z.number(), + coordinating_only: z.optional(z.number()), + data: z.optional(z.number()), + data_cold: z.optional(z.number()), + data_content: z.optional(z.number()), + data_frozen: z.optional(z.number()), + data_hot: z.optional(z.number()), + data_warm: z.optional(z.number()), + index: z.optional(z.number()), + ingest: z.optional(z.number()), + master: z.optional(z.number()), + ml: z.optional(z.number()), + remote_cluster_client: z.optional(z.number()), + search: z.optional(z.number()), + transform: z.optional(z.number()), + voting_only: z.optional(z.number()) }); export const cluster_stats_cluster_file_system = z.object({ - path: z.optional(z.string()), - mount: z.optional(z.string()), - type: z.optional(z.string()), - available_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Total number of bytes available to JVM in file stores across all selected nodes.\nDepending on operating system or process-level restrictions, this number may be less than `nodes.fs.free_in_byes`.\nThis is the actual amount of free disk space the selected Elasticsearch nodes can use.', - }) - ), - available: z.optional(types_byte_size), - free_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Total number, in bytes, of unallocated bytes in file stores across all selected nodes.', - }) - ), - free: z.optional(types_byte_size), - total_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total size, in bytes, of all file stores across all selected nodes.', - }) - ), - total: z.optional(types_byte_size), - low_watermark_free_space: z.optional(types_byte_size), - low_watermark_free_space_in_bytes: z.optional(z.number()), - high_watermark_free_space: z.optional(types_byte_size), - high_watermark_free_space_in_bytes: z.optional(z.number()), - flood_stage_free_space: z.optional(types_byte_size), - flood_stage_free_space_in_bytes: z.optional(z.number()), - frozen_flood_stage_free_space: z.optional(types_byte_size), - frozen_flood_stage_free_space_in_bytes: z.optional(z.number()), + path: z.optional(z.string()), + mount: z.optional(z.string()), + type: z.optional(z.string()), + available_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of bytes available to JVM in file stores across all selected nodes.\nDepending on operating system or process-level restrictions, this number may be less than `nodes.fs.free_in_byes`.\nThis is the actual amount of free disk space the selected Elasticsearch nodes can use.' + })), + available: z.optional(types_byte_size), + free_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number, in bytes, of unallocated bytes in file stores across all selected nodes.' + })), + free: z.optional(types_byte_size), + total_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Total size, in bytes, of all file stores across all selected nodes.' + })), + total: z.optional(types_byte_size), + low_watermark_free_space: z.optional(types_byte_size), + low_watermark_free_space_in_bytes: z.optional(z.number()), + high_watermark_free_space: z.optional(types_byte_size), + high_watermark_free_space_in_bytes: z.optional(z.number()), + flood_stage_free_space: z.optional(types_byte_size), + flood_stage_free_space_in_bytes: z.optional(z.number()), + frozen_flood_stage_free_space: z.optional(types_byte_size), + frozen_flood_stage_free_space_in_bytes: z.optional(z.number()) }); export const nodes_types_pressure_memory = z.object({ - all: z.optional(types_byte_size), - all_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Memory consumed, in bytes, by indexing requests in the coordinating, primary, or replica stage.', - }) - ), - combined_coordinating_and_primary: z.optional(types_byte_size), - combined_coordinating_and_primary_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Memory consumed, in bytes, by indexing requests in the coordinating or primary stage.\nThis value is not the sum of coordinating and primary as a node can reuse the coordinating memory if the primary stage is executed locally.', - }) - ), - coordinating: z.optional(types_byte_size), - coordinating_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Memory consumed, in bytes, by indexing requests in the coordinating stage.', - }) - ), - primary: z.optional(types_byte_size), - primary_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Memory consumed, in bytes, by indexing requests in the primary stage.', - }) - ), - replica: z.optional(types_byte_size), - replica_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Memory consumed, in bytes, by indexing requests in the replica stage.', - }) - ), - coordinating_rejections: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of indexing requests rejected in the coordinating stage.', - }) - ), - primary_rejections: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of indexing requests rejected in the primary stage.', - }) - ), - replica_rejections: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of indexing requests rejected in the replica stage.', - }) - ), - primary_document_rejections: z.optional(z.number()), - large_operation_rejections: z.optional(z.number()), + all: z.optional(types_byte_size), + all_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Memory consumed, in bytes, by indexing requests in the coordinating, primary, or replica stage.' + })), + combined_coordinating_and_primary: z.optional(types_byte_size), + combined_coordinating_and_primary_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Memory consumed, in bytes, by indexing requests in the coordinating or primary stage.\nThis value is not the sum of coordinating and primary as a node can reuse the coordinating memory if the primary stage is executed locally.' + })), + coordinating: z.optional(types_byte_size), + coordinating_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Memory consumed, in bytes, by indexing requests in the coordinating stage.' + })), + primary: z.optional(types_byte_size), + primary_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Memory consumed, in bytes, by indexing requests in the primary stage.' + })), + replica: z.optional(types_byte_size), + replica_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Memory consumed, in bytes, by indexing requests in the replica stage.' + })), + coordinating_rejections: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of indexing requests rejected in the coordinating stage.' + })), + primary_rejections: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of indexing requests rejected in the primary stage.' + })), + replica_rejections: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of indexing requests rejected in the replica stage.' + })), + primary_document_rejections: z.optional(z.number()), + large_operation_rejections: z.optional(z.number()) }); export const nodes_types_indexing_pressure_memory = z.object({ - limit: z.optional(types_byte_size), - limit_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Configured memory limit, in bytes, for the indexing requests.\nReplica requests have an automatic limit that is 1.5x this value.', - }) - ), - current: z.optional(nodes_types_pressure_memory), - total: z.optional(nodes_types_pressure_memory), + limit: z.optional(types_byte_size), + limit_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Configured memory limit, in bytes, for the indexing requests.\nReplica requests have an automatic limit that is 1.5x this value.' + })), + current: z.optional(nodes_types_pressure_memory), + total: z.optional(nodes_types_pressure_memory) }); export const cluster_stats_indexing_pressure = z.object({ - memory: nodes_types_indexing_pressure_memory, + memory: nodes_types_indexing_pressure_memory }); export const cluster_stats_cluster_processor = z.object({ - count: z.number(), - current: z.number(), - failed: z.number(), - time: z.optional(types_duration), - time_in_millis: types_duration_value_unit_millis, + count: z.number(), + current: z.number(), + failed: z.number(), + time: z.optional(types_duration), + time_in_millis: types_duration_value_unit_millis }); export const cluster_stats_cluster_ingest = z.object({ - number_of_pipelines: z.number(), - processor_stats: z.record(z.string(), cluster_stats_cluster_processor), + number_of_pipelines: z.number(), + processor_stats: z.record(z.string(), cluster_stats_cluster_processor) }); export const cluster_stats_cluster_jvm_memory = z.object({ - heap_max_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Maximum amount of memory, in bytes, available for use by the heap across all selected nodes.', - }), - heap_max: z.optional(types_byte_size), - heap_used_in_bytes: z.number().register(z.globalRegistry, { - description: 'Memory, in bytes, currently in use by the heap across all selected nodes.', - }), - heap_used: z.optional(types_byte_size), + heap_max_in_bytes: z.number().register(z.globalRegistry, { + description: 'Maximum amount of memory, in bytes, available for use by the heap across all selected nodes.' + }), + heap_max: z.optional(types_byte_size), + heap_used_in_bytes: z.number().register(z.globalRegistry, { + description: 'Memory, in bytes, currently in use by the heap across all selected nodes.' + }), + heap_used: z.optional(types_byte_size) }); export const cluster_stats_cluster_jvm_version = z.object({ - bundled_jdk: z.boolean().register(z.globalRegistry, { - description: 'Always `true`. All distributions come with a bundled Java Development Kit (JDK).', - }), - count: z.number().register(z.globalRegistry, { - description: 'Total number of selected nodes using JVM.', - }), - using_bundled_jdk: z.boolean().register(z.globalRegistry, { - description: 'If `true`, a bundled JDK is in use by JVM.', - }), - version: types_version_string, - vm_name: z.string().register(z.globalRegistry, { - description: 'Name of the JVM.', - }), - vm_vendor: z.string().register(z.globalRegistry, { - description: 'Vendor of the JVM.', - }), - vm_version: types_version_string, + bundled_jdk: z.boolean().register(z.globalRegistry, { + description: 'Always `true`. All distributions come with a bundled Java Development Kit (JDK).' + }), + count: z.number().register(z.globalRegistry, { + description: 'Total number of selected nodes using JVM.' + }), + using_bundled_jdk: z.boolean().register(z.globalRegistry, { + description: 'If `true`, a bundled JDK is in use by JVM.' + }), + version: types_version_string, + vm_name: z.string().register(z.globalRegistry, { + description: 'Name of the JVM.' + }), + vm_vendor: z.string().register(z.globalRegistry, { + description: 'Vendor of the JVM.' + }), + vm_version: types_version_string }); export const cluster_stats_cluster_jvm = z.object({ - max_uptime_in_millis: types_duration_value_unit_millis, - max_uptime: z.optional(types_duration), - mem: cluster_stats_cluster_jvm_memory, - threads: z.number().register(z.globalRegistry, { - description: 'Number of active threads in use by JVM across all selected nodes.', - }), - versions: z.array(cluster_stats_cluster_jvm_version).register(z.globalRegistry, { - description: 'Contains statistics about the JVM versions used by selected nodes.', - }), + max_uptime_in_millis: types_duration_value_unit_millis, + max_uptime: z.optional(types_duration), + mem: cluster_stats_cluster_jvm_memory, + threads: z.number().register(z.globalRegistry, { + description: 'Number of active threads in use by JVM across all selected nodes.' + }), + versions: z.array(cluster_stats_cluster_jvm_version).register(z.globalRegistry, { + description: 'Contains statistics about the JVM versions used by selected nodes.' + }) }); export const cluster_stats_cluster_network_types = z.object({ - http_types: z.record(z.string(), z.number()).register(z.globalRegistry, { - description: 'Contains statistics about the HTTP network types used by selected nodes.', - }), - transport_types: z.record(z.string(), z.number()).register(z.globalRegistry, { - description: 'Contains statistics about the transport network types used by selected nodes.', - }), + http_types: z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'Contains statistics about the HTTP network types used by selected nodes.' + }), + transport_types: z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'Contains statistics about the transport network types used by selected nodes.' + }) }); export const cluster_stats_cluster_operating_system_architecture = z.object({ - arch: z.string().register(z.globalRegistry, { - description: 'Name of an architecture used by one or more selected nodes.', - }), - count: z.number().register(z.globalRegistry, { - description: 'Number of selected nodes using the architecture.', - }), + arch: z.string().register(z.globalRegistry, { + description: 'Name of an architecture used by one or more selected nodes.' + }), + count: z.number().register(z.globalRegistry, { + description: 'Number of selected nodes using the architecture.' + }) }); export const cluster_stats_operating_system_memory_info = z.object({ - adjusted_total_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Total amount, in bytes, of memory across all selected nodes, but using the value specified using the `es.total_memory_bytes` system property instead of measured total memory for those nodes where that system property was set.', + adjusted_total_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Total amount, in bytes, of memory across all selected nodes, but using the value specified using the `es.total_memory_bytes` system property instead of measured total memory for those nodes where that system property was set.' + })), + adjusted_total: z.optional(types_byte_size), + free_in_bytes: z.number().register(z.globalRegistry, { + description: 'Amount, in bytes, of free physical memory across all selected nodes.' + }), + free: z.optional(types_byte_size), + free_percent: z.number().register(z.globalRegistry, { + description: 'Percentage of free physical memory across all selected nodes.' + }), + total_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total amount, in bytes, of physical memory across all selected nodes.' + }), + total: z.optional(types_byte_size), + used_in_bytes: z.number().register(z.globalRegistry, { + description: 'Amount, in bytes, of physical memory in use across all selected nodes.' + }), + used: z.optional(types_byte_size), + used_percent: z.number().register(z.globalRegistry, { + description: 'Percentage of physical memory in use across all selected nodes.' }) - ), - adjusted_total: z.optional(types_byte_size), - free_in_bytes: z.number().register(z.globalRegistry, { - description: 'Amount, in bytes, of free physical memory across all selected nodes.', - }), - free: z.optional(types_byte_size), - free_percent: z.number().register(z.globalRegistry, { - description: 'Percentage of free physical memory across all selected nodes.', - }), - total_in_bytes: z.number().register(z.globalRegistry, { - description: 'Total amount, in bytes, of physical memory across all selected nodes.', - }), - total: z.optional(types_byte_size), - used_in_bytes: z.number().register(z.globalRegistry, { - description: 'Amount, in bytes, of physical memory in use across all selected nodes.', - }), - used: z.optional(types_byte_size), - used_percent: z.number().register(z.globalRegistry, { - description: 'Percentage of physical memory in use across all selected nodes.', - }), }); export const cluster_stats_cluster_operating_system_name = z.object({ - count: z.number().register(z.globalRegistry, { - description: 'Number of selected nodes using the operating system.', - }), - name: types_name, + count: z.number().register(z.globalRegistry, { + description: 'Number of selected nodes using the operating system.' + }), + name: types_name }); export const cluster_stats_cluster_operating_system_pretty_name = z.object({ - count: z.number().register(z.globalRegistry, { - description: 'Number of selected nodes using the operating system.', - }), - pretty_name: types_name, + count: z.number().register(z.globalRegistry, { + description: 'Number of selected nodes using the operating system.' + }), + pretty_name: types_name }); export const cluster_stats_cluster_operating_system = z.object({ - allocated_processors: z.number().register(z.globalRegistry, { - description: - 'Number of processors used to calculate thread pool size across all selected nodes.\nThis number can be set with the processors setting of a node and defaults to the number of processors reported by the operating system.\nIn both cases, this number will never be larger than 32.', - }), - architectures: z.optional( - z.array(cluster_stats_cluster_operating_system_architecture).register(z.globalRegistry, { - description: - 'Contains statistics about processor architectures (for example, x86_64 or aarch64) used by selected nodes.', - }) - ), - available_processors: z.number().register(z.globalRegistry, { - description: 'Number of processors available to JVM across all selected nodes.', - }), - mem: cluster_stats_operating_system_memory_info, - names: z.array(cluster_stats_cluster_operating_system_name).register(z.globalRegistry, { - description: 'Contains statistics about operating systems used by selected nodes.', - }), - pretty_names: z - .array(cluster_stats_cluster_operating_system_pretty_name) - .register(z.globalRegistry, { - description: 'Contains statistics about operating systems used by selected nodes.', + allocated_processors: z.number().register(z.globalRegistry, { + description: 'Number of processors used to calculate thread pool size across all selected nodes.\nThis number can be set with the processors setting of a node and defaults to the number of processors reported by the operating system.\nIn both cases, this number will never be larger than 32.' + }), + architectures: z.optional(z.array(cluster_stats_cluster_operating_system_architecture).register(z.globalRegistry, { + description: 'Contains statistics about processor architectures (for example, x86_64 or aarch64) used by selected nodes.' + })), + available_processors: z.number().register(z.globalRegistry, { + description: 'Number of processors available to JVM across all selected nodes.' }), + mem: cluster_stats_operating_system_memory_info, + names: z.array(cluster_stats_cluster_operating_system_name).register(z.globalRegistry, { + description: 'Contains statistics about operating systems used by selected nodes.' + }), + pretty_names: z.array(cluster_stats_cluster_operating_system_pretty_name).register(z.globalRegistry, { + description: 'Contains statistics about operating systems used by selected nodes.' + }) }); export const cluster_stats_node_packaging_type = z.object({ - count: z.number().register(z.globalRegistry, { - description: 'Number of selected nodes using the distribution flavor and file type.', - }), - flavor: z.string().register(z.globalRegistry, { - description: 'Type of Elasticsearch distribution. This is always `default`.', - }), - type: z.string().register(z.globalRegistry, { - description: 'File type (such as `tar` or `zip`) used for the distribution package.', - }), + count: z.number().register(z.globalRegistry, { + description: 'Number of selected nodes using the distribution flavor and file type.' + }), + flavor: z.string().register(z.globalRegistry, { + description: 'Type of Elasticsearch distribution. This is always `default`.' + }), + type: z.string().register(z.globalRegistry, { + description: 'File type (such as `tar` or `zip`) used for the distribution package.' + }) }); export const types_plugin_stats = z.object({ - classname: z.string(), - description: z.string(), - elasticsearch_version: types_version_string, - extended_plugins: z.array(z.string()), - has_native_controller: z.boolean(), - java_version: types_version_string, - name: types_name, - version: types_version_string, - licensed: z.boolean(), + classname: z.string(), + description: z.string(), + elasticsearch_version: types_version_string, + extended_plugins: z.array(z.string()), + has_native_controller: z.boolean(), + java_version: types_version_string, + name: types_name, + version: types_version_string, + licensed: z.boolean() }); export const cluster_stats_cluster_process_cpu = z.object({ - percent: z.number().register(z.globalRegistry, { - description: - 'Percentage of CPU used across all selected nodes.\nReturns `-1` if not supported.', - }), + percent: z.number().register(z.globalRegistry, { + description: 'Percentage of CPU used across all selected nodes.\nReturns `-1` if not supported.' + }) }); export const cluster_stats_cluster_process_open_file_descriptors = z.object({ - avg: z.number().register(z.globalRegistry, { - description: - 'Average number of concurrently open file descriptors.\nReturns `-1` if not supported.', - }), - max: z.number().register(z.globalRegistry, { - description: - 'Maximum number of concurrently open file descriptors allowed across all selected nodes.\nReturns `-1` if not supported.', - }), - min: z.number().register(z.globalRegistry, { - description: - 'Minimum number of concurrently open file descriptors across all selected nodes.\nReturns -1 if not supported.', - }), + avg: z.number().register(z.globalRegistry, { + description: 'Average number of concurrently open file descriptors.\nReturns `-1` if not supported.' + }), + max: z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrently open file descriptors allowed across all selected nodes.\nReturns `-1` if not supported.' + }), + min: z.number().register(z.globalRegistry, { + description: 'Minimum number of concurrently open file descriptors across all selected nodes.\nReturns -1 if not supported.' + }) }); export const cluster_stats_cluster_process = z.object({ - cpu: cluster_stats_cluster_process_cpu, - open_file_descriptors: cluster_stats_cluster_process_open_file_descriptors, + cpu: cluster_stats_cluster_process_cpu, + open_file_descriptors: cluster_stats_cluster_process_open_file_descriptors }); export const cluster_stats_cluster_nodes = z.object({ - count: cluster_stats_cluster_node_count, - discovery_types: z.record(z.string(), z.number()).register(z.globalRegistry, { - description: 'Contains statistics about the discovery types used by selected nodes.', - }), - fs: cluster_stats_cluster_file_system, - indexing_pressure: cluster_stats_indexing_pressure, - ingest: cluster_stats_cluster_ingest, - jvm: cluster_stats_cluster_jvm, - network_types: cluster_stats_cluster_network_types, - os: cluster_stats_cluster_operating_system, - packaging_types: z.array(cluster_stats_node_packaging_type).register(z.globalRegistry, { - description: - 'Contains statistics about Elasticsearch distributions installed on selected nodes.', - }), - plugins: z.array(types_plugin_stats).register(z.globalRegistry, { - description: - 'Contains statistics about installed plugins and modules by selected nodes.\nIf no plugins or modules are installed, this array is empty.', - }), - process: cluster_stats_cluster_process, - versions: z.array(types_version_string).register(z.globalRegistry, { - description: 'Array of Elasticsearch versions used on selected nodes.', - }), + count: cluster_stats_cluster_node_count, + discovery_types: z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'Contains statistics about the discovery types used by selected nodes.' + }), + fs: cluster_stats_cluster_file_system, + indexing_pressure: cluster_stats_indexing_pressure, + ingest: cluster_stats_cluster_ingest, + jvm: cluster_stats_cluster_jvm, + network_types: cluster_stats_cluster_network_types, + os: cluster_stats_cluster_operating_system, + packaging_types: z.array(cluster_stats_node_packaging_type).register(z.globalRegistry, { + description: 'Contains statistics about Elasticsearch distributions installed on selected nodes.' + }), + plugins: z.array(types_plugin_stats).register(z.globalRegistry, { + description: 'Contains statistics about installed plugins and modules by selected nodes.\nIf no plugins or modules are installed, this array is empty.' + }), + process: cluster_stats_cluster_process, + versions: z.array(types_version_string).register(z.globalRegistry, { + description: 'Array of Elasticsearch versions used on selected nodes.' + }) }); export const cluster_stats_snapshot_current_counts = z.object({ - snapshots: z.number().register(z.globalRegistry, { - description: 'Snapshots currently in progress', - }), - shard_snapshots: z.number().register(z.globalRegistry, { - description: 'Incomplete shard snapshots', - }), - snapshot_deletions: z.number().register(z.globalRegistry, { - description: 'Snapshots deletions in progress', - }), - concurrent_operations: z.number().register(z.globalRegistry, { - description: 'Sum of snapshots and snapshot_deletions', - }), - cleanups: z.number().register(z.globalRegistry, { - description: - 'Cleanups in progress, not counted in concurrent_operations as they are not concurrent', - }), + snapshots: z.number().register(z.globalRegistry, { + description: 'Snapshots currently in progress' + }), + shard_snapshots: z.number().register(z.globalRegistry, { + description: 'Incomplete shard snapshots' + }), + snapshot_deletions: z.number().register(z.globalRegistry, { + description: 'Snapshots deletions in progress' + }), + concurrent_operations: z.number().register(z.globalRegistry, { + description: 'Sum of snapshots and snapshot_deletions' + }), + cleanups: z.number().register(z.globalRegistry, { + description: 'Cleanups in progress, not counted in concurrent_operations as they are not concurrent' + }) }); export const cluster_stats_repository_stats_shards = z.object({ - total: z.number(), - complete: z.number(), - incomplete: z.number(), - states: z.record(z.string(), z.number()), + total: z.number(), + complete: z.number(), + incomplete: z.number(), + states: z.record(z.string(), z.number()) }); export const cluster_stats_repository_stats_current_counts = z.object({ - snapshots: z.number(), - clones: z.number(), - finalizations: z.number(), - deletions: z.number(), - snapshot_deletions: z.number(), - active_deletions: z.number(), - shards: cluster_stats_repository_stats_shards, + snapshots: z.number(), + clones: z.number(), + finalizations: z.number(), + deletions: z.number(), + snapshot_deletions: z.number(), + active_deletions: z.number(), + shards: cluster_stats_repository_stats_shards }); export const cluster_stats_per_repository_stats = z.object({ - type: z.string(), - oldest_start_time_millis: types_unit_millis, - oldest_start_time: z.optional(types_date_format), - current_counts: cluster_stats_repository_stats_current_counts, + type: z.string(), + oldest_start_time_millis: types_unit_millis, + oldest_start_time: z.optional(types_date_format), + current_counts: cluster_stats_repository_stats_current_counts }); export const cluster_stats_cluster_snapshot_stats = z.object({ - current_counts: cluster_stats_snapshot_current_counts, - repositories: z.record(z.string(), cluster_stats_per_repository_stats), + current_counts: cluster_stats_snapshot_current_counts, + repositories: z.record(z.string(), cluster_stats_per_repository_stats) }); export const cluster_stats_remote_cluster_info = z.object({ - cluster_uuid: z.string().register(z.globalRegistry, { - description: 'The UUID of the remote cluster.', - }), - mode: z.string().register(z.globalRegistry, { - description: 'The connection mode used to communicate with the remote cluster.', - }), - skip_unavailable: z.boolean().register(z.globalRegistry, { - description: 'The `skip_unavailable` setting used for this remote cluster.', - }), - 'transport.compress': z.string().register(z.globalRegistry, { - description: 'Transport compression setting used for this remote cluster.', - }), - status: types_health_status, - version: z.array(types_version_string).register(z.globalRegistry, { - description: 'The list of Elasticsearch versions used by the nodes on the remote cluster.', - }), - nodes_count: z.number().register(z.globalRegistry, { - description: 'The total count of nodes in the remote cluster.', - }), - shards_count: z.number().register(z.globalRegistry, { - description: 'The total number of shards in the remote cluster.', - }), - indices_count: z.number().register(z.globalRegistry, { - description: 'The total number of indices in the remote cluster.', - }), - indices_total_size_in_bytes: z.number().register(z.globalRegistry, { - description: 'Total data set size, in bytes, of all shards assigned to selected nodes.', - }), - indices_total_size: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Total data set size of all shards assigned to selected nodes, as a human-readable string.', - }) - ), - max_heap_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Maximum amount of memory, in bytes, available for use by the heap across the nodes of the remote cluster.', - }), - max_heap: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Maximum amount of memory available for use by the heap across the nodes of the remote cluster, as a human-readable string.', - }) - ), - mem_total_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Total amount, in bytes, of physical memory across the nodes of the remote cluster.', - }), - mem_total: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Total amount of physical memory across the nodes of the remote cluster, as a human-readable string.', - }) - ), + cluster_uuid: z.string().register(z.globalRegistry, { + description: 'The UUID of the remote cluster.' + }), + mode: z.string().register(z.globalRegistry, { + description: 'The connection mode used to communicate with the remote cluster.' + }), + skip_unavailable: z.boolean().register(z.globalRegistry, { + description: 'The `skip_unavailable` setting used for this remote cluster.' + }), + 'transport.compress': z.string().register(z.globalRegistry, { + description: 'Transport compression setting used for this remote cluster.' + }), + status: types_health_status, + version: z.array(types_version_string).register(z.globalRegistry, { + description: 'The list of Elasticsearch versions used by the nodes on the remote cluster.' + }), + nodes_count: z.number().register(z.globalRegistry, { + description: 'The total count of nodes in the remote cluster.' + }), + shards_count: z.number().register(z.globalRegistry, { + description: 'The total number of shards in the remote cluster.' + }), + indices_count: z.number().register(z.globalRegistry, { + description: 'The total number of indices in the remote cluster.' + }), + indices_total_size_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total data set size, in bytes, of all shards assigned to selected nodes.' + }), + indices_total_size: z.optional(z.string().register(z.globalRegistry, { + description: 'Total data set size of all shards assigned to selected nodes, as a human-readable string.' + })), + max_heap_in_bytes: z.number().register(z.globalRegistry, { + description: 'Maximum amount of memory, in bytes, available for use by the heap across the nodes of the remote cluster.' + }), + max_heap: z.optional(z.string().register(z.globalRegistry, { + description: 'Maximum amount of memory available for use by the heap across the nodes of the remote cluster, as a human-readable string.' + })), + mem_total_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total amount, in bytes, of physical memory across the nodes of the remote cluster.' + }), + mem_total: z.optional(z.string().register(z.globalRegistry, { + description: 'Total amount of physical memory across the nodes of the remote cluster, as a human-readable string.' + })) }); export const cluster_stats_ccs_usage_time_value = z.object({ - max: types_duration_value_unit_millis, - avg: types_duration_value_unit_millis, - p90: types_duration_value_unit_millis, + max: types_duration_value_unit_millis, + avg: types_duration_value_unit_millis, + p90: types_duration_value_unit_millis }); export const cluster_stats_ccs_usage_cluster_stats = z.object({ - total: z.number().register(z.globalRegistry, { - description: - 'The total number of successful (not skipped) cross-cluster search requests that were executed against this cluster. This may include requests where partial results were returned, but not requests in which the cluster has been skipped entirely.', - }), - skipped: z.number().register(z.globalRegistry, { - description: - 'The total number of cross-cluster search requests for which this cluster was skipped.', - }), - took: cluster_stats_ccs_usage_time_value, + total: z.number().register(z.globalRegistry, { + description: 'The total number of successful (not skipped) cross-cluster search requests that were executed against this cluster. This may include requests where partial results were returned, but not requests in which the cluster has been skipped entirely.' + }), + skipped: z.number().register(z.globalRegistry, { + description: 'The total number of cross-cluster search requests for which this cluster was skipped.' + }), + took: cluster_stats_ccs_usage_time_value }); export const cluster_stats_ccs_usage_stats = z.object({ - total: z.number().register(z.globalRegistry, { - description: - 'The total number of cross-cluster search requests that have been executed by the cluster.', - }), - success: z.number().register(z.globalRegistry, { - description: - 'The total number of cross-cluster search requests that have been successfully executed by the cluster.', - }), - skipped: z.number().register(z.globalRegistry, { - description: - 'The total number of cross-cluster search requests (successful or failed) that had at least one remote cluster skipped.', - }), - took: cluster_stats_ccs_usage_time_value, - took_mrt_true: z.optional(cluster_stats_ccs_usage_time_value), - took_mrt_false: z.optional(cluster_stats_ccs_usage_time_value), - remotes_per_search_max: z.number().register(z.globalRegistry, { - description: - 'The maximum number of remote clusters that were queried in a single cross-cluster search request.', - }), - remotes_per_search_avg: z.number().register(z.globalRegistry, { - description: - 'The average number of remote clusters that were queried in a single cross-cluster search request.', - }), - failure_reasons: z.record(z.string(), z.number()).register(z.globalRegistry, { - description: - 'Statistics about the reasons for cross-cluster search request failures. The keys are the failure reason names and the values are the number of requests that failed for that reason.', - }), - features: z.record(z.string(), z.number()).register(z.globalRegistry, { - description: - 'The keys are the names of the search feature, and the values are the number of requests that used that feature. Single request can use more than one feature (e.g. both `async` and `wildcard`).', - }), - clients: z.record(z.string(), z.number()).register(z.globalRegistry, { - description: - 'Statistics about the clients that executed cross-cluster search requests. The keys are the names of the clients, and the values are the number of requests that were executed by that client. Only known clients (such as `kibana` or `elasticsearch`) are counted.', - }), - clusters: z.record(z.string(), cluster_stats_ccs_usage_cluster_stats).register(z.globalRegistry, { - description: - 'Statistics about the clusters that were queried in cross-cluster search requests. The keys are cluster names, and the values are per-cluster telemetry data. This also includes the local cluster itself, which uses the name `(local)`.', - }), + total: z.number().register(z.globalRegistry, { + description: 'The total number of cross-cluster search requests that have been executed by the cluster.' + }), + success: z.number().register(z.globalRegistry, { + description: 'The total number of cross-cluster search requests that have been successfully executed by the cluster.' + }), + skipped: z.number().register(z.globalRegistry, { + description: 'The total number of cross-cluster search requests (successful or failed) that had at least one remote cluster skipped.' + }), + took: cluster_stats_ccs_usage_time_value, + took_mrt_true: z.optional(cluster_stats_ccs_usage_time_value), + took_mrt_false: z.optional(cluster_stats_ccs_usage_time_value), + remotes_per_search_max: z.number().register(z.globalRegistry, { + description: 'The maximum number of remote clusters that were queried in a single cross-cluster search request.' + }), + remotes_per_search_avg: z.number().register(z.globalRegistry, { + description: 'The average number of remote clusters that were queried in a single cross-cluster search request.' + }), + failure_reasons: z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'Statistics about the reasons for cross-cluster search request failures. The keys are the failure reason names and the values are the number of requests that failed for that reason.' + }), + features: z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'The keys are the names of the search feature, and the values are the number of requests that used that feature. Single request can use more than one feature (e.g. both `async` and `wildcard`).' + }), + clients: z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'Statistics about the clients that executed cross-cluster search requests. The keys are the names of the clients, and the values are the number of requests that were executed by that client. Only known clients (such as `kibana` or `elasticsearch`) are counted.' + }), + clusters: z.record(z.string(), cluster_stats_ccs_usage_cluster_stats).register(z.globalRegistry, { + description: 'Statistics about the clusters that were queried in cross-cluster search requests. The keys are cluster names, and the values are per-cluster telemetry data. This also includes the local cluster itself, which uses the name `(local)`.' + }) }); export const cluster_stats_ccs_stats = z.object({ - clusters: z.optional( - z.record(z.string(), cluster_stats_remote_cluster_info).register(z.globalRegistry, { - description: - 'Contains remote cluster settings and metrics collected from them.\nThe keys are cluster names, and the values are per-cluster data.\nOnly present if `include_remotes` option is set to true.', - }) - ), - _search: cluster_stats_ccs_usage_stats, - _esql: z.optional(cluster_stats_ccs_usage_stats), + clusters: z.optional(z.record(z.string(), cluster_stats_remote_cluster_info).register(z.globalRegistry, { + description: 'Contains remote cluster settings and metrics collected from them.\nThe keys are cluster names, and the values are per-cluster data.\nOnly present if `include_remotes` option is set to true.' + })), + _search: cluster_stats_ccs_usage_stats, + _esql: z.optional(cluster_stats_ccs_usage_stats) }); /** * Contains statistics about the number of nodes selected by the request. */ -export const types_node_statistics = z - .object({ +export const types_node_statistics = z.object({ failures: z.optional(z.array(types_error_cause)), total: z.number().register(z.globalRegistry, { - description: 'Total number of nodes selected by the request.', + description: 'Total number of nodes selected by the request.' }), successful: z.number().register(z.globalRegistry, { - description: 'Number of nodes that responded successfully to the request.', + description: 'Number of nodes that responded successfully to the request.' }), failed: z.number().register(z.globalRegistry, { - description: - 'Number of nodes that rejected the request or failed to respond. If this value is not 0, a reason for the rejection or failure is included in the response.', - }), - }) - .register(z.globalRegistry, { - description: 'Contains statistics about the number of nodes selected by the request.', - }); + description: 'Number of nodes that rejected the request or failed to respond. If this value is not 0, a reason for the rejection or failure is included in the response.' + }) +}).register(z.globalRegistry, { + description: 'Contains statistics about the number of nodes selected by the request.' +}); export const nodes_types_nodes_response_base = z.object({ - _nodes: z.optional(types_node_statistics), + _nodes: z.optional(types_node_statistics) }); -export const cluster_stats_stats_response_base = nodes_types_nodes_response_base.and( - z.object({ +export const cluster_stats_stats_response_base = nodes_types_nodes_response_base.and(z.object({ cluster_name: types_name, cluster_uuid: types_uuid, indices: cluster_stats_cluster_indices, nodes: cluster_stats_cluster_nodes, - repositories: z - .record(z.string(), z.record(z.string(), z.number())) - .register(z.globalRegistry, { - description: - 'Contains stats on repository feature usage exposed in cluster stats for telemetry.', - }), + repositories: z.record(z.string(), z.record(z.string(), z.number())).register(z.globalRegistry, { + description: 'Contains stats on repository feature usage exposed in cluster stats for telemetry.' + }), snapshots: cluster_stats_cluster_snapshot_stats, status: z.optional(types_health_status), timestamp: z.number().register(z.globalRegistry, { - description: - 'Unix timestamp, in milliseconds, for the last time the cluster statistics were refreshed.', + description: 'Unix timestamp, in milliseconds, for the last time the cluster statistics were refreshed.' }), - ccs: cluster_stats_ccs_stats, - }) -); + ccs: cluster_stats_ccs_stats +})); -export const types_result = z.enum(['created', 'updated', 'deleted', 'not_found', 'noop']); +export const types_result = z.enum([ + 'created', + 'updated', + 'deleted', + 'not_found', + 'noop' +]); /** * A scalar value. */ -export const types_scalar_value = z.union([z.number(), z.string(), z.boolean(), z.null()]); +export const types_scalar_value = z.union([ + z.number(), + z.string(), + z.boolean(), + z.null() +]); export const connector_types_dependency = z.object({ - field: z.string(), - value: types_scalar_value, + field: z.string(), + value: types_scalar_value }); export const connector_types_display_type = z.enum([ - 'textbox', - 'textarea', - 'numeric', - 'toggle', - 'dropdown', + 'textbox', + 'textarea', + 'numeric', + 'toggle', + 'dropdown' ]); export const connector_types_select_option = z.object({ - label: z.string(), - value: types_scalar_value, + label: z.string(), + value: types_scalar_value }); -export const connector_types_connector_field_type = z.enum(['str', 'int', 'list', 'bool']); +export const connector_types_connector_field_type = z.enum([ + 'str', + 'int', + 'list', + 'bool' +]); export const connector_types_less_than_validation = z.object({ - type: z.enum(['less_than']), - constraint: z.number(), + type: z.enum(['less_than']), + constraint: z.number() }); export const connector_types_greater_than_validation = z.object({ - type: z.enum(['greater_than']), - constraint: z.number(), + type: z.enum(['greater_than']), + constraint: z.number() }); export const connector_types_list_type_validation = z.object({ - type: z.enum(['list_type']), - constraint: z.string(), + type: z.enum(['list_type']), + constraint: z.string() }); export const connector_types_included_in_validation = z.object({ - type: z.enum(['included_in']), - constraint: z.array(types_scalar_value), + type: z.enum(['included_in']), + constraint: z.array(types_scalar_value) }); export const connector_types_regex_validation = z.object({ - type: z.enum(['regex']), - constraint: z.string(), + type: z.enum(['regex']), + constraint: z.string() }); export const connector_types_validation = z.union([ - z - .object({ - type: z.literal('less_than'), - }) - .and(connector_types_less_than_validation), - z - .object({ - type: z.literal('greater_than'), - }) - .and(connector_types_greater_than_validation), - z - .object({ - type: z.literal('list_type'), - }) - .and(connector_types_list_type_validation), - z - .object({ - type: z.literal('included_in'), - }) - .and(connector_types_included_in_validation), - z - .object({ - type: z.literal('regex'), - }) - .and(connector_types_regex_validation), + z.object({ + type: z.literal('less_than') + }).and(connector_types_less_than_validation), + z.object({ + type: z.literal('greater_than') + }).and(connector_types_greater_than_validation), + z.object({ + type: z.literal('list_type') + }).and(connector_types_list_type_validation), + z.object({ + type: z.literal('included_in') + }).and(connector_types_included_in_validation), + z.object({ + type: z.literal('regex') + }).and(connector_types_regex_validation) ]); export const connector_types_connector_config_properties = z.object({ - category: z.optional(z.string()), - default_value: types_scalar_value, - depends_on: z.array(connector_types_dependency), - display: connector_types_display_type, - label: z.string(), - options: z.array(connector_types_select_option), - order: z.optional(z.number()), - placeholder: z.optional(z.string()), - required: z.boolean(), - sensitive: z.boolean(), - tooltip: z.optional(z.union([z.string(), z.null()])), - type: z.optional(connector_types_connector_field_type), - ui_restrictions: z.optional(z.array(z.string())), - validations: z.optional(z.array(connector_types_validation)), - value: z.record(z.string(), z.unknown()), -}); - -export const connector_types_connector_configuration = z.record( - z.string(), - connector_types_connector_config_properties -); + category: z.optional(z.string()), + default_value: types_scalar_value, + depends_on: z.array(connector_types_dependency), + display: connector_types_display_type, + label: z.string(), + options: z.array(connector_types_select_option), + order: z.optional(z.number()), + placeholder: z.optional(z.string()), + required: z.boolean(), + sensitive: z.boolean(), + tooltip: z.optional(z.union([ + z.string(), + z.null() + ])), + type: z.optional(connector_types_connector_field_type), + ui_restrictions: z.optional(z.array(z.string())), + validations: z.optional(z.array(connector_types_validation)), + value: z.record(z.string(), z.unknown()) +}); + +export const connector_types_connector_configuration = z.record(z.string(), connector_types_connector_config_properties); export const connector_types_custom_scheduling_configuration_overrides = z.object({ - max_crawl_depth: z.optional(z.number()), - sitemap_discovery_disabled: z.optional(z.boolean()), - domain_allowlist: z.optional(z.array(z.string())), - sitemap_urls: z.optional(z.array(z.string())), - seed_urls: z.optional(z.array(z.string())), + max_crawl_depth: z.optional(z.number()), + sitemap_discovery_disabled: z.optional(z.boolean()), + domain_allowlist: z.optional(z.array(z.string())), + sitemap_urls: z.optional(z.array(z.string())), + seed_urls: z.optional(z.array(z.string())) }); export const connector_types_custom_scheduling = z.object({ - configuration_overrides: connector_types_custom_scheduling_configuration_overrides, - enabled: z.boolean(), - interval: z.string(), - last_synced: z.optional(types_date_time), - name: z.string(), + configuration_overrides: connector_types_custom_scheduling_configuration_overrides, + enabled: z.boolean(), + interval: z.string(), + last_synced: z.optional(types_date_time), + name: z.string() }); -export const connector_types_connector_custom_scheduling = z.record( - z.string(), - connector_types_custom_scheduling -); +export const connector_types_connector_custom_scheduling = z.record(z.string(), connector_types_custom_scheduling); export const connector_types_feature_enabled = z.object({ - enabled: z.boolean(), + enabled: z.boolean() }); export const connector_types_sync_rules_feature = z.object({ - advanced: z.optional(connector_types_feature_enabled), - basic: z.optional(connector_types_feature_enabled), + advanced: z.optional(connector_types_feature_enabled), + basic: z.optional(connector_types_feature_enabled) }); export const connector_types_connector_features = z.object({ - document_level_security: z.optional(connector_types_feature_enabled), - incremental_sync: z.optional(connector_types_feature_enabled), - native_connector_api_keys: z.optional(connector_types_feature_enabled), - sync_rules: z.optional(connector_types_sync_rules_feature), + document_level_security: z.optional(connector_types_feature_enabled), + incremental_sync: z.optional(connector_types_feature_enabled), + native_connector_api_keys: z.optional(connector_types_feature_enabled), + sync_rules: z.optional(connector_types_sync_rules_feature) }); export const connector_types_filtering_advanced_snippet = z.object({ - created_at: z.optional(types_date_time), - updated_at: z.optional(types_date_time), - value: z.record(z.string(), z.unknown()), + created_at: z.optional(types_date_time), + updated_at: z.optional(types_date_time), + value: z.record(z.string(), z.unknown()) }); export const connector_types_filtering_policy = z.enum(['exclude', 'include']); export const connector_types_filtering_rule_rule = z.enum([ - 'contains', - 'ends_with', - 'equals', - 'regex', - 'starts_with', - '>', - '<', + 'contains', + 'ends_with', + 'equals', + 'regex', + 'starts_with', + '>', + '<' ]); export const connector_types_filtering_rule = z.object({ - created_at: z.optional(types_date_time), - field: types_field, - id: types_id, - order: z.number(), - policy: connector_types_filtering_policy, - rule: connector_types_filtering_rule_rule, - updated_at: z.optional(types_date_time), - value: z.string(), + created_at: z.optional(types_date_time), + field: types_field, + id: types_id, + order: z.number(), + policy: connector_types_filtering_policy, + rule: connector_types_filtering_rule_rule, + updated_at: z.optional(types_date_time), + value: z.string() }); export const connector_types_filtering_validation = z.object({ - ids: z.array(types_id), - messages: z.array(z.string()), + ids: z.array(types_id), + messages: z.array(z.string()) }); -export const connector_types_filtering_validation_state = z.enum(['edited', 'invalid', 'valid']); +export const connector_types_filtering_validation_state = z.enum([ + 'edited', + 'invalid', + 'valid' +]); export const connector_types_filtering_rules_validation = z.object({ - errors: z.array(connector_types_filtering_validation), - state: connector_types_filtering_validation_state, + errors: z.array(connector_types_filtering_validation), + state: connector_types_filtering_validation_state }); export const connector_types_filtering_rules = z.object({ - advanced_snippet: connector_types_filtering_advanced_snippet, - rules: z.array(connector_types_filtering_rule), - validation: connector_types_filtering_rules_validation, + advanced_snippet: connector_types_filtering_advanced_snippet, + rules: z.array(connector_types_filtering_rule), + validation: connector_types_filtering_rules_validation }); export const connector_types_filtering_config = z.object({ - active: connector_types_filtering_rules, - domain: z.optional(z.string()), - draft: connector_types_filtering_rules, + active: connector_types_filtering_rules, + domain: z.optional(z.string()), + draft: connector_types_filtering_rules }); export const connector_types_sync_status = z.enum([ - 'canceling', - 'canceled', - 'completed', - 'error', - 'in_progress', - 'pending', - 'suspended', + 'canceling', + 'canceled', + 'completed', + 'error', + 'in_progress', + 'pending', + 'suspended' ]); export const connector_types_ingest_pipeline_params = z.object({ - extract_binary_content: z.boolean(), - name: z.string(), - reduce_whitespace: z.boolean(), - run_ml_inference: z.boolean(), + extract_binary_content: z.boolean(), + name: z.string(), + reduce_whitespace: z.boolean(), + run_ml_inference: z.boolean() }); export const connector_types_connector_scheduling = z.object({ - enabled: z.boolean(), - interval: z.string().register(z.globalRegistry, { - description: 'The interval is expressed using the crontab syntax', - }), + enabled: z.boolean(), + interval: z.string().register(z.globalRegistry, { + description: 'The interval is expressed using the crontab syntax' + }) }); export const connector_types_scheduling_configuration = z.object({ - access_control: z.optional(connector_types_connector_scheduling), - full: z.optional(connector_types_connector_scheduling), - incremental: z.optional(connector_types_connector_scheduling), + access_control: z.optional(connector_types_connector_scheduling), + full: z.optional(connector_types_connector_scheduling), + incremental: z.optional(connector_types_connector_scheduling) }); export const connector_types_connector_status = z.enum([ - 'created', - 'needs_configuration', - 'configured', - 'connected', - 'error', + 'created', + 'needs_configuration', + 'configured', + 'connected', + 'error' ]); export const connector_types_connector = z.object({ - api_key_id: z.optional(z.string()), - api_key_secret_id: z.optional(z.string()), - configuration: connector_types_connector_configuration, - custom_scheduling: connector_types_connector_custom_scheduling, - deleted: z.boolean(), - description: z.optional(z.string()), - error: z.optional(z.union([z.string(), z.null()])), - features: z.optional(connector_types_connector_features), - filtering: z.array(connector_types_filtering_config), - id: z.optional(types_id), - index_name: z.optional(z.union([types_index_name, z.string(), z.null()])), - is_native: z.boolean(), - language: z.optional(z.string()), - last_access_control_sync_error: z.optional(z.string()), - last_access_control_sync_scheduled_at: z.optional(types_date_time), - last_access_control_sync_status: z.optional(connector_types_sync_status), - last_deleted_document_count: z.optional(z.number()), - last_incremental_sync_scheduled_at: z.optional(types_date_time), - last_indexed_document_count: z.optional(z.number()), - last_seen: z.optional(types_date_time), - last_sync_error: z.optional(z.string()), - last_sync_scheduled_at: z.optional(types_date_time), - last_sync_status: z.optional(connector_types_sync_status), - last_synced: z.optional(types_date_time), - name: z.optional(z.string()), - pipeline: z.optional(connector_types_ingest_pipeline_params), - scheduling: connector_types_scheduling_configuration, - service_type: z.optional(z.string()), - status: connector_types_connector_status, - sync_cursor: z.optional(z.record(z.string(), z.unknown())), - sync_now: z.boolean(), + api_key_id: z.optional(z.string()), + api_key_secret_id: z.optional(z.string()), + configuration: connector_types_connector_configuration, + custom_scheduling: connector_types_connector_custom_scheduling, + deleted: z.boolean(), + description: z.optional(z.string()), + error: z.optional(z.union([ + z.string(), + z.null() + ])), + features: z.optional(connector_types_connector_features), + filtering: z.array(connector_types_filtering_config), + id: z.optional(types_id), + index_name: z.optional(z.union([ + types_index_name, + z.string(), + z.null() + ])), + is_native: z.boolean(), + language: z.optional(z.string()), + last_access_control_sync_error: z.optional(z.string()), + last_access_control_sync_scheduled_at: z.optional(types_date_time), + last_access_control_sync_status: z.optional(connector_types_sync_status), + last_deleted_document_count: z.optional(z.number()), + last_incremental_sync_scheduled_at: z.optional(types_date_time), + last_indexed_document_count: z.optional(z.number()), + last_seen: z.optional(types_date_time), + last_sync_error: z.optional(z.string()), + last_sync_scheduled_at: z.optional(types_date_time), + last_sync_status: z.optional(connector_types_sync_status), + last_synced: z.optional(types_date_time), + name: z.optional(z.string()), + pipeline: z.optional(connector_types_ingest_pipeline_params), + scheduling: connector_types_scheduling_configuration, + service_type: z.optional(z.string()), + status: connector_types_connector_status, + sync_cursor: z.optional(z.record(z.string(), z.unknown())), + sync_now: z.boolean() }); export const connector_types_sync_job_connector_reference = z.object({ - configuration: connector_types_connector_configuration, - filtering: connector_types_filtering_rules, - id: types_id, - index_name: z.string(), - language: z.optional(z.string()), - pipeline: z.optional(connector_types_ingest_pipeline_params), - service_type: z.string(), - sync_cursor: z.optional(z.record(z.string(), z.unknown())), + configuration: connector_types_connector_configuration, + filtering: connector_types_filtering_rules, + id: types_id, + index_name: z.string(), + language: z.optional(z.string()), + pipeline: z.optional(connector_types_ingest_pipeline_params), + service_type: z.string(), + sync_cursor: z.optional(z.record(z.string(), z.unknown())) }); -export const connector_types_sync_job_type = z.enum(['full', 'incremental', 'access_control']); +export const connector_types_sync_job_type = z.enum([ + 'full', + 'incremental', + 'access_control' +]); export const connector_types_sync_job_trigger_method = z.enum(['on_demand', 'scheduled']); export const connector_types_connector_sync_job = z.object({ - cancelation_requested_at: z.optional(types_date_time), - canceled_at: z.optional(types_date_time), - completed_at: z.optional(types_date_time), - connector: connector_types_sync_job_connector_reference, - created_at: types_date_time, - deleted_document_count: z.number(), - error: z.optional(z.string()), - id: types_id, - indexed_document_count: z.number(), - indexed_document_volume: z.number(), - job_type: connector_types_sync_job_type, - last_seen: z.optional(types_date_time), - metadata: z.record(z.string(), z.record(z.string(), z.unknown())), - started_at: z.optional(types_date_time), - status: connector_types_sync_status, - total_document_count: z.number(), - trigger_method: connector_types_sync_job_trigger_method, - worker_hostname: z.optional(z.string()), + cancelation_requested_at: z.optional(types_date_time), + canceled_at: z.optional(types_date_time), + completed_at: z.optional(types_date_time), + connector: connector_types_sync_job_connector_reference, + created_at: types_date_time, + deleted_document_count: z.number(), + error: z.optional(z.string()), + id: types_id, + indexed_document_count: z.number(), + indexed_document_volume: z.number(), + job_type: connector_types_sync_job_type, + last_seen: z.optional(types_date_time), + metadata: z.record(z.string(), z.record(z.string(), z.unknown())), + started_at: z.optional(types_date_time), + status: connector_types_sync_status, + total_document_count: z.number(), + trigger_method: connector_types_sync_job_trigger_method, + worker_hostname: z.optional(z.string()) }); export const types_write_response_base = z.object({ - _id: types_id, - _index: types_index_name, - _primary_term: z.optional( - z.number().register(z.globalRegistry, { - description: 'The primary term assigned to the document for the indexing operation.', - }) - ), - result: types_result, - _seq_no: z.optional(types_sequence_number), - _shards: types_shard_statistics, - _version: types_version_number, - failure_store: z.optional(global_bulk_failure_store_status), - forced_refresh: z.optional(z.boolean()), + _id: types_id, + _index: types_index_name, + _primary_term: z.optional(z.number().register(z.globalRegistry, { + description: 'The primary term assigned to the document for the indexing operation.' + })), + result: types_result, + _seq_no: z.optional(types_sequence_number), + _shards: types_shard_statistics, + _version: types_version_number, + failure_store: z.optional(global_bulk_failure_store_status), + forced_refresh: z.optional(z.boolean()) }); export const dangling_indices_list_dangling_indices_dangling_index = z.object({ - index_name: z.string(), - index_uuid: z.string(), - creation_date_millis: types_epoch_time_unit_millis, - node_ids: types_ids, + index_name: z.string(), + index_uuid: z.string(), + creation_date_millis: types_epoch_time_unit_millis, + node_ids: types_ids }); export const types_conflicts = z.enum(['abort', 'proceed']); @@ -14332,360 +11768,332 @@ export const types_slices_calculation = z.enum(['auto']); /** * Slices configuration used to parallelize a process. */ -export const types_slices = z.union([z.number(), types_slices_calculation]); +export const types_slices = z.union([ + z.number(), + types_slices_calculation +]); export const types_bulk_index_by_scroll_failure = z.object({ - cause: types_error_cause, - id: types_id, - index: types_index_name, - status: z.number(), + cause: types_error_cause, + id: types_id, + index: types_index_name, + status: z.number() }); export const types_retries = z.object({ - bulk: z.number().register(z.globalRegistry, { - description: 'The number of bulk actions retried.', - }), - search: z.number().register(z.globalRegistry, { - description: 'The number of search actions retried.', - }), + bulk: z.number().register(z.globalRegistry, { + description: 'The number of bulk actions retried.' + }), + search: z.number().register(z.globalRegistry, { + description: 'The number of search actions retried.' + }) }); export const types_task_id = z.string(); export const types_task_failure = z.object({ - task_id: z.number(), - node_id: types_node_id, - status: z.string(), - reason: types_error_cause, + task_id: z.number(), + node_id: types_node_id, + status: z.string(), + reason: types_error_cause }); export const tasks_types_task_info = z.object({ - action: z.string(), - cancelled: z.optional(z.boolean()), - cancellable: z.boolean(), - description: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Human readable text that identifies the particular request that the task is performing.\nFor example, it might identify the search request being performed by a search task.\nOther kinds of tasks have different descriptions, like `_reindex` which has the source and the destination, or `_bulk` which just has the number of requests and the destination indices.\nMany requests will have only an empty description because more detailed information about the request is not easily available or particularly helpful in identifying the request.', - }) - ), - headers: z.record(z.string(), z.string()), - id: z.number(), - node: types_node_id, - running_time: z.optional(types_duration), - running_time_in_nanos: types_duration_value_unit_nanos, - start_time_in_millis: types_epoch_time_unit_millis, - status: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'The internal status of the task, which varies from task to task.\nThe format also varies.\nWhile the goal is to keep the status for a particular task consistent from version to version, this is not always possible because sometimes the implementation changes.\nFields might be removed from the status for a particular request so any parsing you do of the status might break in minor releases.', - }) - ), - type: z.string(), - parent_task_id: z.optional(types_task_id), + action: z.string(), + cancelled: z.optional(z.boolean()), + cancellable: z.boolean(), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human readable text that identifies the particular request that the task is performing.\nFor example, it might identify the search request being performed by a search task.\nOther kinds of tasks have different descriptions, like `_reindex` which has the source and the destination, or `_bulk` which just has the number of requests and the destination indices.\nMany requests will have only an empty description because more detailed information about the request is not easily available or particularly helpful in identifying the request.' + })), + headers: z.record(z.string(), z.string()), + id: z.number(), + node: types_node_id, + running_time: z.optional(types_duration), + running_time_in_nanos: types_duration_value_unit_nanos, + start_time_in_millis: types_epoch_time_unit_millis, + status: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'The internal status of the task, which varies from task to task.\nThe format also varies.\nWhile the goal is to keep the status for a particular task consistent from version to version, this is not always possible because sometimes the implementation changes.\nFields might be removed from the status for a particular request so any parsing you do of the status might break in minor releases.' + })), + type: z.string(), + parent_task_id: z.optional(types_task_id) }); export const tasks_types_node_tasks = z.object({ - name: z.optional(types_node_id), - transport_address: z.optional(types_transport_address), - host: z.optional(types_host), - ip: z.optional(types_ip), - roles: z.optional(z.array(z.string())), - attributes: z.optional(z.record(z.string(), z.string())), - tasks: z.record(z.string(), tasks_types_task_info), + name: z.optional(types_node_id), + transport_address: z.optional(types_transport_address), + host: z.optional(types_host), + ip: z.optional(types_ip), + roles: z.optional(z.array(z.string())), + attributes: z.optional(z.record(z.string(), z.string())), + tasks: z.record(z.string(), tasks_types_task_info) }); -export const tasks_types_parent_task_info = tasks_types_task_info.and( - z.object({ - children: z.optional(z.array(tasks_types_task_info)), - }) -); +export const tasks_types_parent_task_info = tasks_types_task_info.and(z.object({ + children: z.optional(z.array(tasks_types_task_info)) +})); export const tasks_types_task_infos = z.union([ - z.array(tasks_types_task_info), - z.record(z.string(), tasks_types_parent_task_info), + z.array(tasks_types_task_info), + z.record(z.string(), tasks_types_parent_task_info) ]); export const tasks_types_task_list_response_base = z.object({ - node_failures: z.optional(z.array(types_error_cause)), - task_failures: z.optional(z.array(types_task_failure)), - nodes: z.optional( - z.record(z.string(), tasks_types_node_tasks).register(z.globalRegistry, { - description: - 'Task information grouped by node, if `group_by` was set to `node` (the default).', - }) - ), - tasks: z.optional(tasks_types_task_infos), + node_failures: z.optional(z.array(types_error_cause)), + task_failures: z.optional(z.array(types_task_failure)), + nodes: z.optional(z.record(z.string(), tasks_types_node_tasks).register(z.globalRegistry, { + description: 'Task information grouped by node, if `group_by` was set to `node` (the default).' + })), + tasks: z.optional(tasks_types_task_infos) }); export const enrich_execute_policy_enrich_policy_phase = z.enum([ - 'SCHEDULED', - 'RUNNING', - 'COMPLETE', - 'FAILED', - 'CANCELLED', + 'SCHEDULED', + 'RUNNING', + 'COMPLETE', + 'FAILED', + 'CANCELLED' ]); export const enrich_execute_policy_execute_enrich_policy_status = z.object({ - phase: enrich_execute_policy_enrich_policy_phase, - step: z.optional(z.string()), + phase: enrich_execute_policy_enrich_policy_phase, + step: z.optional(z.string()) }); export const enrich_stats_coordinator_stats = z.object({ - executed_searches_total: z.number(), - node_id: types_id, - queue_size: z.number(), - remote_requests_current: z.number(), - remote_requests_total: z.number(), + executed_searches_total: z.number(), + node_id: types_id, + queue_size: z.number(), + remote_requests_current: z.number(), + remote_requests_total: z.number() }); export const enrich_stats_executing_policy = z.object({ - name: types_name, - task: tasks_types_task_info, + name: types_name, + task: tasks_types_task_info }); export const enrich_stats_cache_stats = z.object({ - node_id: types_id, - count: z.number(), - hits: z.number(), - hits_time_in_millis: types_duration_value_unit_millis, - misses: z.number(), - misses_time_in_millis: types_duration_value_unit_millis, - evictions: z.number(), - size_in_bytes: z.number(), + node_id: types_id, + count: z.number(), + hits: z.number(), + hits_time_in_millis: types_duration_value_unit_millis, + misses: z.number(), + misses_time_in_millis: types_duration_value_unit_millis, + evictions: z.number(), + size_in_bytes: z.number() }); export const eql_types_hits_event = z.object({ - _index: types_index_name, - _id: types_id, - _source: z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: 'Original JSON body passed for the event at index time.', - }), - missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` for events in a timespan-constrained sequence that do not meet a given condition.', - }) - ), - fields: z.optional(z.record(z.string(), z.array(z.record(z.string(), z.unknown())))), + _index: types_index_name, + _id: types_id, + _source: z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'Original JSON body passed for the event at index time.' + }), + missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` for events in a timespan-constrained sequence that do not meet a given condition.' + })), + fields: z.optional(z.record(z.string(), z.array(z.record(z.string(), z.unknown())))) }); export const eql_types_hits_sequence = z.object({ - events: z.array(eql_types_hits_event).register(z.globalRegistry, { - description: 'Contains events matching the query. Each object represents a matching event.', - }), - join_keys: z.optional( - z.array(z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'Shared field values used to constrain matches in the sequence. These are defined using the by keyword in the EQL query syntax.', - }) - ), + events: z.array(eql_types_hits_event).register(z.globalRegistry, { + description: 'Contains events matching the query. Each object represents a matching event.' + }), + join_keys: z.optional(z.array(z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Shared field values used to constrain matches in the sequence. These are defined using the by keyword in the EQL query syntax.' + })) }); export const eql_types_eql_hits = z.object({ - total: z.optional(global_search_types_total_hits), - events: z.optional( - z.array(eql_types_hits_event).register(z.globalRegistry, { - description: 'Contains events matching the query. Each object represents a matching event.', - }) - ), - sequences: z.optional( - z.array(eql_types_hits_sequence).register(z.globalRegistry, { - description: - 'Contains event sequences matching the query. Each object represents a matching sequence. This parameter is only returned for EQL queries containing a sequence.', - }) - ), + total: z.optional(global_search_types_total_hits), + events: z.optional(z.array(eql_types_hits_event).register(z.globalRegistry, { + description: 'Contains events matching the query. Each object represents a matching event.' + })), + sequences: z.optional(z.array(eql_types_hits_sequence).register(z.globalRegistry, { + description: 'Contains event sequences matching the query. Each object represents a matching sequence. This parameter is only returned for EQL queries containing a sequence.' + })) }); export const eql_types_eql_search_response_base = z.object({ - id: z.optional(types_id), - is_partial: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the response does not contain complete search results.', - }) - ), - is_running: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the search request is still executing.', - }) - ), - took: z.optional(types_duration_value_unit_millis), - timed_out: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the request timed out before completion.', - }) - ), - hits: eql_types_eql_hits, - shard_failures: z.optional( - z.array(types_shard_failure).register(z.globalRegistry, { - description: - 'Contains information about shard failures (if any), in case allow_partial_search_results=true', - }) - ), + id: z.optional(types_id), + is_partial: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the response does not contain complete search results.' + })), + is_running: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the search request is still executing.' + })), + took: z.optional(types_duration_value_unit_millis), + timed_out: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request timed out before completion.' + })), + hits: eql_types_eql_hits, + shard_failures: z.optional(z.array(types_shard_failure).register(z.globalRegistry, { + description: 'Contains information about shard failures (if any), in case allow_partial_search_results=true' + })) }); export const eql_search_result_position = z.enum(['tail', 'head']); export const esql_types_esql_format = z.enum([ - 'csv', - 'json', - 'tsv', - 'txt', - 'yaml', - 'cbor', - 'smile', - 'arrow', + 'csv', + 'json', + 'tsv', + 'txt', + 'yaml', + 'cbor', + 'smile', + 'arrow' ]); -export const esql_types_table_values_integer_value = z.union([z.number(), z.array(z.number())]); +export const esql_types_table_values_integer_value = z.union([ + z.number(), + z.array(z.number()) +]); -export const esql_types_table_values_keyword_value = z.union([z.string(), z.array(z.string())]); +export const esql_types_table_values_keyword_value = z.union([ + z.string(), + z.array(z.string()) +]); -export const esql_types_table_values_long_value = z.union([z.number(), z.array(z.number())]); +export const esql_types_table_values_long_value = z.union([ + z.number(), + z.array(z.number()) +]); -export const esql_types_table_values_long_double = z.union([z.number(), z.array(z.number())]); +export const esql_types_table_values_long_double = z.union([ + z.number(), + z.array(z.number()) +]); export const esql_types_table_values_container = z.object({ - integer: z.optional(z.array(esql_types_table_values_integer_value)), - keyword: z.optional(z.array(esql_types_table_values_keyword_value)), - long: z.optional(z.array(esql_types_table_values_long_value)), - double: z.optional(z.array(esql_types_table_values_long_double)), + integer: z.optional(z.array(esql_types_table_values_integer_value)), + keyword: z.optional(z.array(esql_types_table_values_keyword_value)), + long: z.optional(z.array(esql_types_table_values_long_value)), + double: z.optional(z.array(esql_types_table_values_long_double)) }); export const esql_types_esql_column_info = z.object({ - name: z.string(), - type: z.string(), + name: z.string(), + type: z.string() }); export const esql_types_esql_cluster_status = z.enum([ - 'running', - 'successful', - 'partial', - 'skipped', - 'failed', + 'running', + 'successful', + 'partial', + 'skipped', + 'failed' ]); export const esql_types_esql_shard_info = z.object({ - total: z.number(), - successful: z.optional(z.number()), - skipped: z.optional(z.number()), - failed: z.optional(z.number()), + total: z.number(), + successful: z.optional(z.number()), + skipped: z.optional(z.number()), + failed: z.optional(z.number()) }); export const esql_types_esql_shard_failure = z.object({ - shard: z.number(), - index: z.union([types_index_name, z.string(), z.null()]), - node: z.optional(types_node_id), - reason: types_error_cause, + shard: z.number(), + index: z.union([ + types_index_name, + z.string(), + z.null() + ]), + node: z.optional(types_node_id), + reason: types_error_cause }); export const esql_types_esql_cluster_details = z.object({ - status: esql_types_esql_cluster_status, - indices: z.string(), - took: z.optional(types_duration_value_unit_millis), - _shards: z.optional(esql_types_esql_shard_info), - failures: z.optional(z.array(esql_types_esql_shard_failure)), + status: esql_types_esql_cluster_status, + indices: z.string(), + took: z.optional(types_duration_value_unit_millis), + _shards: z.optional(esql_types_esql_shard_info), + failures: z.optional(z.array(esql_types_esql_shard_failure)) }); export const esql_types_esql_cluster_info = z.object({ - total: z.number(), - successful: z.number(), - running: z.number(), - skipped: z.number(), - partial: z.number(), - failed: z.number(), - details: z.record(z.string(), esql_types_esql_cluster_details), + total: z.number(), + successful: z.number(), + running: z.number(), + skipped: z.number(), + partial: z.number(), + failed: z.number(), + details: z.record(z.string(), esql_types_esql_cluster_details) }); export const esql_types_esql_result = z.object({ - took: z.optional(types_duration_value_unit_millis), - is_partial: z.optional(z.boolean()), - all_columns: z.optional(z.array(esql_types_esql_column_info)), - columns: z.array(esql_types_esql_column_info), - values: z.array(z.array(types_field_value)), - _clusters: z.optional(esql_types_esql_cluster_info), - profile: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'Profiling information. Present if `profile` was `true` in the request.\nThe contents of this field are currently unstable.', - }) - ), -}); - -export const esql_types_async_esql_result = esql_types_esql_result.and( - z.object({ - id: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The ID of the async query, to be used in subsequent requests to check the status or retrieve results.\n\nAlso available in the `X-Elasticsearch-Async-Id` HTTP header.', - }) - ), + took: z.optional(types_duration_value_unit_millis), + is_partial: z.optional(z.boolean()), + all_columns: z.optional(z.array(esql_types_esql_column_info)), + columns: z.array(esql_types_esql_column_info), + values: z.array(z.array(types_field_value)), + _clusters: z.optional(esql_types_esql_cluster_info), + profile: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'Profiling information. Present if `profile` was `true` in the request.\nThe contents of this field are currently unstable.' + })) +}); + +export const esql_types_async_esql_result = esql_types_esql_result.and(z.object({ + id: z.optional(z.string().register(z.globalRegistry, { + description: 'The ID of the async query, to be used in subsequent requests to check the status or retrieve results.\n\nAlso available in the `X-Elasticsearch-Async-Id` HTTP header.' + })), is_running: z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether the async query is still running or has completed.\n\nAlso available in the `X-Elasticsearch-Async-Is-Running` HTTP header.', - }), - }) -); + description: 'Indicates whether the async query is still running or has completed.\n\nAlso available in the `X-Elasticsearch-Async-Is-Running` HTTP header.' + }) +})); export const esql_list_queries_body = z.object({ - id: z.number(), - node: types_node_id, - start_time_millis: z.number(), - running_time_nanos: z.number(), - query: z.string(), + id: z.number(), + node: types_node_id, + start_time_millis: z.number(), + running_time_nanos: z.number(), + query: z.string() }); -export const esql_types_esql_param = z.union([types_field_value, z.array(types_field_value)]); +export const esql_types_esql_param = z.union([ + types_field_value, + z.array(types_field_value) +]); export const types_inline_get = z.object({ - fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - found: z.boolean(), - _seq_no: z.optional(types_sequence_number), - _primary_term: z.optional(z.number()), - _routing: z.optional(types_routing), - _source: z.optional(z.record(z.string(), z.unknown())), + fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + found: z.boolean(), + _seq_no: z.optional(types_sequence_number), + _primary_term: z.optional(z.number()), + _routing: z.optional(types_routing), + _source: z.optional(z.record(z.string(), z.unknown())) }); export const features_types_feature = z.object({ - name: z.string(), - description: z.string(), + name: z.string(), + description: z.string() }); export const global_field_caps_field_capability = z.object({ - aggregatable: z.boolean().register(z.globalRegistry, { - description: 'Whether this field can be aggregated on all indices.', - }), - indices: z.optional(types_indices), - meta: z.optional(types_metadata), - non_aggregatable_indices: z.optional(types_indices), - non_searchable_indices: z.optional(types_indices), - searchable: z.boolean().register(z.globalRegistry, { - description: 'Whether this field is indexed for search on all indices.', - }), - type: z.string(), - metadata_field: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Whether this field is registered as a metadata field.', - }) - ), - time_series_dimension: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Whether this field is used as a time series dimension.', - }) - ), - time_series_metric: z.optional(types_mapping_time_series_metric_type), - non_dimension_indices: z.optional( - z.array(types_index_name).register(z.globalRegistry, { - description: - 'If this list is present in response then some indices have the\nfield marked as a dimension and other indices, the ones in this list, do not.', - }) - ), - metric_conflicts_indices: z.optional( - z.array(types_index_name).register(z.globalRegistry, { - description: - 'The list of indices where this field is present if these indices\ndon’t have the same `time_series_metric` value for this field.', - }) - ), + aggregatable: z.boolean().register(z.globalRegistry, { + description: 'Whether this field can be aggregated on all indices.' + }), + indices: z.optional(types_indices), + meta: z.optional(types_metadata), + non_aggregatable_indices: z.optional(types_indices), + non_searchable_indices: z.optional(types_indices), + searchable: z.boolean().register(z.globalRegistry, { + description: 'Whether this field is indexed for search on all indices.' + }), + type: z.string(), + metadata_field: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether this field is registered as a metadata field.' + })), + time_series_dimension: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether this field is used as a time series dimension.' + })), + time_series_metric: z.optional(types_mapping_time_series_metric_type), + non_dimension_indices: z.optional(z.array(types_index_name).register(z.globalRegistry, { + description: 'If this list is present in response then some indices have the\nfield marked as a dimension and other indices, the ones in this list, do not.' + })), + metric_conflicts_indices: z.optional(z.array(types_index_name).register(z.globalRegistry, { + description: 'The list of indices where this field is present if these indices\ndon’t have the same `time_series_metric` value for this field.' + })) }); export const types_index_alias = z.string(); @@ -14697,8 +12105,7 @@ export const types_project_routing = z.string(); /** * Contains parameters used to limit or change the subsequent search body request. */ -export const global_msearch_multisearch_header = z - .object({ +export const global_msearch_multisearch_header = z.object({ allow_no_indices: z.optional(z.boolean()), expand_wildcards: z.optional(types_expand_wildcards), ignore_unavailable: z.optional(z.boolean()), @@ -14710,1596 +12117,1463 @@ export const global_msearch_multisearch_header = z search_type: z.optional(types_search_type), ccs_minimize_roundtrips: z.optional(z.boolean()), allow_partial_search_results: z.optional(z.boolean()), - ignore_throttled: z.optional(z.boolean()), - }) - .register(z.globalRegistry, { - description: 'Contains parameters used to limit or change the subsequent search body request.', - }); + ignore_throttled: z.optional(z.boolean()) +}).register(z.globalRegistry, { + description: 'Contains parameters used to limit or change the subsequent search body request.' +}); /** * The response returned by Elasticsearch when request execution did not succeed. */ -export const types_error_response_base = z - .object({ +export const types_error_response_base = z.object({ error: types_error_cause, - status: z.number(), - }) - .register(z.globalRegistry, { - description: 'The response returned by Elasticsearch when request execution did not succeed.', - }); + status: z.number() +}).register(z.globalRegistry, { + description: 'The response returned by Elasticsearch when request execution did not succeed.' +}); export const global_get_get_result = z.object({ - _index: types_index_name, - fields: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'If the `stored_fields` parameter is set to `true` and `found` is `true`, it contains the document fields stored in the index.', - }) - ), - _ignored: z.optional(z.array(z.string())), - found: z.boolean().register(z.globalRegistry, { - description: 'Indicates whether the document exists.', - }), - _id: types_id, - _primary_term: z.optional( - z.number().register(z.globalRegistry, { - description: 'The primary term assigned to the document for the indexing operation.', - }) - ), - _routing: z.optional( - z.string().register(z.globalRegistry, { - description: 'The explicit routing, if set.', - }) - ), - _seq_no: z.optional(types_sequence_number), - _source: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'If `found` is `true`, it contains the document data formatted in JSON.\nIf the `_source` parameter is set to `false` or the `stored_fields` parameter is set to `true`, it is excluded.', - }) - ), - _version: z.optional(types_version_number), + _index: types_index_name, + fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'If the `stored_fields` parameter is set to `true` and `found` is `true`, it contains the document fields stored in the index.' + })), + _ignored: z.optional(z.array(z.string())), + found: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the document exists.' + }), + _id: types_id, + _primary_term: z.optional(z.number().register(z.globalRegistry, { + description: 'The primary term assigned to the document for the indexing operation.' + })), + _routing: z.optional(z.string().register(z.globalRegistry, { + description: 'The explicit routing, if set.' + })), + _seq_no: z.optional(types_sequence_number), + _source: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'If `found` is `true`, it contains the document data formatted in JSON.\nIf the `_source` parameter is set to `false` or the `stored_fields` parameter is set to `true`, it is excluded.' + })), + _version: z.optional(types_version_number) }); export const global_get_script_context_context_method_param = z.object({ - name: types_name, - type: z.string(), + name: types_name, + type: z.string() }); export const global_get_script_context_context_method = z.object({ - name: types_name, - return_type: z.string(), - params: z.array(global_get_script_context_context_method_param), + name: types_name, + return_type: z.string(), + params: z.array(global_get_script_context_context_method_param) }); export const global_get_script_context_context = z.object({ - methods: z.array(global_get_script_context_context_method), - name: types_name, + methods: z.array(global_get_script_context_context_method), + name: types_name }); export const global_get_script_languages_language_context = z.object({ - contexts: z.array(z.string()), - language: types_script_language, + contexts: z.array(z.string()), + language: types_script_language }); export const graph_types_vertex_include = z.object({ - boost: z.optional(z.number()), - term: z.string(), + boost: z.optional(z.number()), + term: z.string() }); export const graph_types_vertex_definition = z.object({ - exclude: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'Prevents the specified terms from being included in the results.', - }) - ), - field: types_field, - include: z.optional( - z.array(graph_types_vertex_include).register(z.globalRegistry, { - description: - 'Identifies the terms of interest that form the starting points from which you want to spider out.', - }) - ), - min_doc_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Specifies how many documents must contain a pair of terms before it is considered to be a useful connection.\nThis setting acts as a certainty threshold.', - }) - ), - shard_min_doc_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Controls how many documents on a particular shard have to contain a pair of terms before the connection is returned for global consideration.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of vertex terms returned for each field.', - }) - ), + exclude: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Prevents the specified terms from being included in the results.' + })), + field: types_field, + include: z.optional(z.array(graph_types_vertex_include).register(z.globalRegistry, { + description: 'Identifies the terms of interest that form the starting points from which you want to spider out.' + })), + min_doc_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies how many documents must contain a pair of terms before it is considered to be a useful connection.\nThis setting acts as a certainty threshold.' + })), + shard_min_doc_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Controls how many documents on a particular shard have to contain a pair of terms before the connection is returned for global consideration.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of vertex terms returned for each field.' + })) }); export const graph_types_sample_diversity = z.object({ - field: types_field, - max_docs_per_value: z.number(), + field: types_field, + max_docs_per_value: z.number() }); export const graph_types_explore_controls = z.object({ - sample_diversity: z.optional(graph_types_sample_diversity), - sample_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Each hop considers a sample of the best-matching documents on each shard.\nUsing samples improves the speed of execution and keeps exploration focused on meaningfully-connected terms.\nVery small values (less than 50) might not provide sufficient weight-of-evidence to identify significant connections between terms.\nVery large sample sizes can dilute the quality of the results and increase execution times.', + sample_diversity: z.optional(graph_types_sample_diversity), + sample_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Each hop considers a sample of the best-matching documents on each shard.\nUsing samples improves the speed of execution and keeps exploration focused on meaningfully-connected terms.\nVery small values (less than 50) might not provide sufficient weight-of-evidence to identify significant connections between terms.\nVery large sample sizes can dilute the quality of the results and increase execution times.' + })), + timeout: z.optional(types_duration), + use_significance: z.boolean().register(z.globalRegistry, { + description: 'Filters associated terms so only those that are significantly associated with your query are included.' }) - ), - timeout: z.optional(types_duration), - use_significance: z.boolean().register(z.globalRegistry, { - description: - 'Filters associated terms so only those that are significantly associated with your query are included.', - }), }); export const graph_types_connection = z.object({ - doc_count: z.number(), - source: z.number(), - target: z.number(), - weight: z.number(), + doc_count: z.number(), + source: z.number(), + target: z.number(), + weight: z.number() }); export const graph_types_vertex = z.object({ - depth: z.number(), - field: types_field, - term: z.string(), - weight: z.number(), + depth: z.number(), + field: types_field, + term: z.string(), + weight: z.number() }); export const global_health_report_indicator_node = z.object({ - name: z.union([z.string(), z.null()]), - node_id: z.union([z.string(), z.null()]), + name: z.union([ + z.string(), + z.null() + ]), + node_id: z.union([ + z.string(), + z.null() + ]) }); export const global_health_report_master_is_stable_indicator_exception_fetching_history = z.object({ - message: z.string(), - stack_trace: z.string(), + message: z.string(), + stack_trace: z.string() }); export const global_health_report_master_is_stable_indicator_cluster_formation_node = z.object({ - name: z.optional(z.string()), - node_id: z.string(), - cluster_formation_message: z.string(), + name: z.optional(z.string()), + node_id: z.string(), + cluster_formation_message: z.string() }); export const global_health_report_master_is_stable_indicator_details = z.object({ - current_master: global_health_report_indicator_node, - recent_masters: z.array(global_health_report_indicator_node), - exception_fetching_history: z.optional( - global_health_report_master_is_stable_indicator_exception_fetching_history - ), - cluster_formation: z.optional( - z.array(global_health_report_master_is_stable_indicator_cluster_formation_node) - ), + current_master: global_health_report_indicator_node, + recent_masters: z.array(global_health_report_indicator_node), + exception_fetching_history: z.optional(global_health_report_master_is_stable_indicator_exception_fetching_history), + cluster_formation: z.optional(z.array(global_health_report_master_is_stable_indicator_cluster_formation_node)) }); export const global_health_report_indicator_health_status = z.enum([ - 'green', - 'yellow', - 'red', - 'unknown', - 'unavailable', + 'green', + 'yellow', + 'red', + 'unknown', + 'unavailable' ]); export const global_health_report_impact_area = z.enum([ - 'search', - 'ingest', - 'backup', - 'deployment_management', + 'search', + 'ingest', + 'backup', + 'deployment_management' ]); export const global_health_report_impact = z.object({ - description: z.string(), - id: z.string(), - impact_areas: z.array(global_health_report_impact_area), - severity: z.number(), + description: z.string(), + id: z.string(), + impact_areas: z.array(global_health_report_impact_area), + severity: z.number() }); export const global_health_report_diagnosis_affected_resources = z.object({ - indices: z.optional(types_indices), - nodes: z.optional(z.array(global_health_report_indicator_node)), - slm_policies: z.optional(z.array(z.string())), - feature_states: z.optional(z.array(z.string())), - snapshot_repositories: z.optional(z.array(z.string())), + indices: z.optional(types_indices), + nodes: z.optional(z.array(global_health_report_indicator_node)), + slm_policies: z.optional(z.array(z.string())), + feature_states: z.optional(z.array(z.string())), + snapshot_repositories: z.optional(z.array(z.string())) }); export const global_health_report_diagnosis = z.object({ - id: z.string(), - action: z.string(), - affected_resources: global_health_report_diagnosis_affected_resources, - cause: z.string(), - help_url: z.string(), + id: z.string(), + action: z.string(), + affected_resources: global_health_report_diagnosis_affected_resources, + cause: z.string(), + help_url: z.string() }); export const global_health_report_base_indicator = z.object({ - status: global_health_report_indicator_health_status, - symptom: z.string(), - impacts: z.optional(z.array(global_health_report_impact)), - diagnosis: z.optional(z.array(global_health_report_diagnosis)), + status: global_health_report_indicator_health_status, + symptom: z.string(), + impacts: z.optional(z.array(global_health_report_impact)), + diagnosis: z.optional(z.array(global_health_report_diagnosis)) }); /** * MASTER_IS_STABLE */ -export const global_health_report_master_is_stable_indicator = - global_health_report_base_indicator.and( - z.object({ - details: z.optional(global_health_report_master_is_stable_indicator_details), - }) - ); +export const global_health_report_master_is_stable_indicator = global_health_report_base_indicator.and(z.object({ + details: z.optional(global_health_report_master_is_stable_indicator_details) +})); export const global_health_report_shards_availability_indicator_details = z.object({ - creating_primaries: z.number(), - creating_replicas: z.number(), - initializing_primaries: z.number(), - initializing_replicas: z.number(), - restarting_primaries: z.number(), - restarting_replicas: z.number(), - started_primaries: z.number(), - started_replicas: z.number(), - unassigned_primaries: z.number(), - unassigned_replicas: z.number(), + creating_primaries: z.number(), + creating_replicas: z.number(), + initializing_primaries: z.number(), + initializing_replicas: z.number(), + restarting_primaries: z.number(), + restarting_replicas: z.number(), + started_primaries: z.number(), + started_replicas: z.number(), + unassigned_primaries: z.number(), + unassigned_replicas: z.number() }); /** * SHARDS_AVAILABILITY */ -export const global_health_report_shards_availability_indicator = - global_health_report_base_indicator.and( - z.object({ - details: z.optional(global_health_report_shards_availability_indicator_details), - }) - ); +export const global_health_report_shards_availability_indicator = global_health_report_base_indicator.and(z.object({ + details: z.optional(global_health_report_shards_availability_indicator_details) +})); export const global_health_report_disk_indicator_details = z.object({ - indices_with_readonly_block: z.number(), - nodes_with_enough_disk_space: z.number(), - nodes_over_high_watermark: z.number(), - nodes_over_flood_stage_watermark: z.number(), - nodes_with_unknown_disk_status: z.number(), + indices_with_readonly_block: z.number(), + nodes_with_enough_disk_space: z.number(), + nodes_over_high_watermark: z.number(), + nodes_over_flood_stage_watermark: z.number(), + nodes_with_unknown_disk_status: z.number() }); /** * DISK */ -export const global_health_report_disk_indicator = global_health_report_base_indicator.and( - z.object({ - details: z.optional(global_health_report_disk_indicator_details), - }) -); +export const global_health_report_disk_indicator = global_health_report_base_indicator.and(z.object({ + details: z.optional(global_health_report_disk_indicator_details) +})); export const global_health_report_repository_integrity_indicator_details = z.object({ - total_repositories: z.optional(z.number()), - corrupted_repositories: z.optional(z.number()), - corrupted: z.optional(z.array(z.string())), + total_repositories: z.optional(z.number()), + corrupted_repositories: z.optional(z.number()), + corrupted: z.optional(z.array(z.string())) }); /** * REPOSITORY_INTEGRITY */ -export const global_health_report_repository_integrity_indicator = - global_health_report_base_indicator.and( - z.object({ - details: z.optional(global_health_report_repository_integrity_indicator_details), - }) - ); +export const global_health_report_repository_integrity_indicator = global_health_report_base_indicator.and(z.object({ + details: z.optional(global_health_report_repository_integrity_indicator_details) +})); export const global_health_report_stagnating_backing_indices = z.object({ - index_name: types_index_name, - first_occurrence_timestamp: z.number(), - retry_count: z.number(), + index_name: types_index_name, + first_occurrence_timestamp: z.number(), + retry_count: z.number() }); export const global_health_report_data_stream_lifecycle_details = z.object({ - stagnating_backing_indices_count: z.number(), - total_backing_indices_in_error: z.number(), - stagnating_backing_indices: z.optional(z.array(global_health_report_stagnating_backing_indices)), + stagnating_backing_indices_count: z.number(), + total_backing_indices_in_error: z.number(), + stagnating_backing_indices: z.optional(z.array(global_health_report_stagnating_backing_indices)) }); /** * DATA_STREAM_LIFECYCLE */ -export const global_health_report_data_stream_lifecycle_indicator = - global_health_report_base_indicator.and( - z.object({ - details: z.optional(global_health_report_data_stream_lifecycle_details), - }) - ); +export const global_health_report_data_stream_lifecycle_indicator = global_health_report_base_indicator.and(z.object({ + details: z.optional(global_health_report_data_stream_lifecycle_details) +})); -export const types_lifecycle_operation_mode = z.enum(['RUNNING', 'STOPPING', 'STOPPED']); +export const types_lifecycle_operation_mode = z.enum([ + 'RUNNING', + 'STOPPING', + 'STOPPED' +]); export const global_health_report_ilm_indicator_details = z.object({ - ilm_status: types_lifecycle_operation_mode, - policies: z.number(), - stagnating_indices: z.number(), + ilm_status: types_lifecycle_operation_mode, + policies: z.number(), + stagnating_indices: z.number() }); /** * ILM */ -export const global_health_report_ilm_indicator = global_health_report_base_indicator.and( - z.object({ - details: z.optional(global_health_report_ilm_indicator_details), - }) -); +export const global_health_report_ilm_indicator = global_health_report_base_indicator.and(z.object({ + details: z.optional(global_health_report_ilm_indicator_details) +})); export const global_health_report_slm_indicator_unhealthy_policies = z.object({ - count: z.number(), - invocations_since_last_success: z.optional(z.record(z.string(), z.number())), + count: z.number(), + invocations_since_last_success: z.optional(z.record(z.string(), z.number())) }); export const global_health_report_slm_indicator_details = z.object({ - slm_status: types_lifecycle_operation_mode, - policies: z.number(), - unhealthy_policies: z.optional(global_health_report_slm_indicator_unhealthy_policies), + slm_status: types_lifecycle_operation_mode, + policies: z.number(), + unhealthy_policies: z.optional(global_health_report_slm_indicator_unhealthy_policies) }); /** * SLM */ -export const global_health_report_slm_indicator = global_health_report_base_indicator.and( - z.object({ - details: z.optional(global_health_report_slm_indicator_details), - }) -); +export const global_health_report_slm_indicator = global_health_report_base_indicator.and(z.object({ + details: z.optional(global_health_report_slm_indicator_details) +})); export const global_health_report_shards_capacity_indicator_tier_detail = z.object({ - max_shards_in_cluster: z.number(), - current_used_shards: z.optional(z.number()), + max_shards_in_cluster: z.number(), + current_used_shards: z.optional(z.number()) }); export const global_health_report_shards_capacity_indicator_details = z.object({ - data: global_health_report_shards_capacity_indicator_tier_detail, - frozen: global_health_report_shards_capacity_indicator_tier_detail, + data: global_health_report_shards_capacity_indicator_tier_detail, + frozen: global_health_report_shards_capacity_indicator_tier_detail }); /** * SHARDS_CAPACITY */ -export const global_health_report_shards_capacity_indicator = - global_health_report_base_indicator.and( - z.object({ - details: z.optional(global_health_report_shards_capacity_indicator_details), - }) - ); +export const global_health_report_shards_capacity_indicator = global_health_report_base_indicator.and(z.object({ + details: z.optional(global_health_report_shards_capacity_indicator_details) +})); export const global_health_report_file_settings_indicator_details = z.object({ - failure_streak: z.number(), - most_recent_failure: z.string(), + failure_streak: z.number(), + most_recent_failure: z.string() }); /** * FILE_SETTINGS */ -export const global_health_report_file_settings_indicator = global_health_report_base_indicator.and( - z.object({ - details: z.optional(global_health_report_file_settings_indicator_details), - }) -); +export const global_health_report_file_settings_indicator = global_health_report_base_indicator.and(z.object({ + details: z.optional(global_health_report_file_settings_indicator_details) +})); export const global_health_report_indicators = z.object({ - master_is_stable: z.optional(global_health_report_master_is_stable_indicator), - shards_availability: z.optional(global_health_report_shards_availability_indicator), - disk: z.optional(global_health_report_disk_indicator), - repository_integrity: z.optional(global_health_report_repository_integrity_indicator), - data_stream_lifecycle: z.optional(global_health_report_data_stream_lifecycle_indicator), - ilm: z.optional(global_health_report_ilm_indicator), - slm: z.optional(global_health_report_slm_indicator), - shards_capacity: z.optional(global_health_report_shards_capacity_indicator), - file_settings: z.optional(global_health_report_file_settings_indicator), + master_is_stable: z.optional(global_health_report_master_is_stable_indicator), + shards_availability: z.optional(global_health_report_shards_availability_indicator), + disk: z.optional(global_health_report_disk_indicator), + repository_integrity: z.optional(global_health_report_repository_integrity_indicator), + data_stream_lifecycle: z.optional(global_health_report_data_stream_lifecycle_indicator), + ilm: z.optional(global_health_report_ilm_indicator), + slm: z.optional(global_health_report_slm_indicator), + shards_capacity: z.optional(global_health_report_shards_capacity_indicator), + file_settings: z.optional(global_health_report_file_settings_indicator) }); export const ilm_types_allocate_action = z.object({ - number_of_replicas: z.optional(z.number()), - total_shards_per_node: z.optional(z.number()), - include: z.optional(z.record(z.string(), z.string())), - exclude: z.optional(z.record(z.string(), z.string())), - require: z.optional(z.record(z.string(), z.string())), + number_of_replicas: z.optional(z.number()), + total_shards_per_node: z.optional(z.number()), + include: z.optional(z.record(z.string(), z.string())), + exclude: z.optional(z.record(z.string(), z.string())), + require: z.optional(z.record(z.string(), z.string())) }); export const ilm_types_delete_action = z.object({ - delete_searchable_snapshot: z.optional(z.boolean()), + delete_searchable_snapshot: z.optional(z.boolean()) }); export const ilm_types_downsample_action = z.object({ - fixed_interval: types_duration_large, - wait_timeout: z.optional(types_duration), + fixed_interval: types_duration_large, + wait_timeout: z.optional(types_duration) }); export const ilm_types_force_merge_action = z.object({ - max_num_segments: z.number(), - index_codec: z.optional(z.string()), + max_num_segments: z.number(), + index_codec: z.optional(z.string()) }); export const ilm_types_migrate_action = z.object({ - enabled: z.optional(z.boolean()), + enabled: z.optional(z.boolean()) }); export const ilm_types_rollover_action = z.object({ - max_size: z.optional(types_byte_size), - max_primary_shard_size: z.optional(types_byte_size), - max_age: z.optional(types_duration), - max_docs: z.optional(z.number()), - max_primary_shard_docs: z.optional(z.number()), - min_size: z.optional(types_byte_size), - min_primary_shard_size: z.optional(types_byte_size), - min_age: z.optional(types_duration), - min_docs: z.optional(z.number()), - min_primary_shard_docs: z.optional(z.number()), + max_size: z.optional(types_byte_size), + max_primary_shard_size: z.optional(types_byte_size), + max_age: z.optional(types_duration), + max_docs: z.optional(z.number()), + max_primary_shard_docs: z.optional(z.number()), + min_size: z.optional(types_byte_size), + min_primary_shard_size: z.optional(types_byte_size), + min_age: z.optional(types_duration), + min_docs: z.optional(z.number()), + min_primary_shard_docs: z.optional(z.number()) }); export const ilm_types_set_priority_action = z.object({ - priority: z.optional(z.number()), + priority: z.optional(z.number()) }); export const ilm_types_searchable_snapshot_action = z.object({ - snapshot_repository: z.string(), - force_merge_index: z.optional(z.boolean()), + snapshot_repository: z.string(), + force_merge_index: z.optional(z.boolean()) }); export const ilm_types_shrink_action = z.object({ - number_of_shards: z.optional(z.number()), - max_primary_shard_size: z.optional(types_byte_size), - allow_write_after_shrink: z.optional(z.boolean()), + number_of_shards: z.optional(z.number()), + max_primary_shard_size: z.optional(types_byte_size), + allow_write_after_shrink: z.optional(z.boolean()) }); export const ilm_types_wait_for_snapshot_action = z.object({ - policy: z.string(), + policy: z.string() }); export const ilm_types_actions = z.object({ - allocate: z.optional(ilm_types_allocate_action), - delete: z.optional(ilm_types_delete_action), - downsample: z.optional(ilm_types_downsample_action), - freeze: z.optional(types_empty_object), - forcemerge: z.optional(ilm_types_force_merge_action), - migrate: z.optional(ilm_types_migrate_action), - readonly: z.optional(types_empty_object), - rollover: z.optional(ilm_types_rollover_action), - set_priority: z.optional(ilm_types_set_priority_action), - searchable_snapshot: z.optional(ilm_types_searchable_snapshot_action), - shrink: z.optional(ilm_types_shrink_action), - unfollow: z.optional(types_empty_object), - wait_for_snapshot: z.optional(ilm_types_wait_for_snapshot_action), + allocate: z.optional(ilm_types_allocate_action), + delete: z.optional(ilm_types_delete_action), + downsample: z.optional(ilm_types_downsample_action), + freeze: z.optional(types_empty_object), + forcemerge: z.optional(ilm_types_force_merge_action), + migrate: z.optional(ilm_types_migrate_action), + readonly: z.optional(types_empty_object), + rollover: z.optional(ilm_types_rollover_action), + set_priority: z.optional(ilm_types_set_priority_action), + searchable_snapshot: z.optional(ilm_types_searchable_snapshot_action), + shrink: z.optional(ilm_types_shrink_action), + unfollow: z.optional(types_empty_object), + wait_for_snapshot: z.optional(ilm_types_wait_for_snapshot_action) }); export const ilm_types_phase = z.object({ - actions: z.optional(ilm_types_actions), - min_age: z.optional(types_duration), + actions: z.optional(ilm_types_actions), + min_age: z.optional(types_duration) }); export const ilm_explain_lifecycle_lifecycle_explain_phase_execution = z.object({ - phase_definition: z.optional(ilm_types_phase), - policy: types_name, - version: types_version_number, - modified_date_in_millis: types_epoch_time_unit_millis, + phase_definition: z.optional(ilm_types_phase), + policy: types_name, + version: types_version_number, + modified_date_in_millis: types_epoch_time_unit_millis }); export const ilm_explain_lifecycle_lifecycle_explain_managed = z.object({ - action: z.optional(types_name), - action_time: z.optional(types_date_time), - action_time_millis: z.optional(types_epoch_time_unit_millis), - age: z.optional(types_duration), - age_in_millis: z.optional(types_duration_value_unit_millis), - failed_step: z.optional(types_name), - failed_step_retry_count: z.optional(z.number()), - index: types_index_name, - index_creation_date: z.optional(types_date_time), - index_creation_date_millis: z.optional(types_epoch_time_unit_millis), - is_auto_retryable_error: z.optional(z.boolean()), - lifecycle_date: z.optional(types_date_time), - lifecycle_date_millis: z.optional(types_epoch_time_unit_millis), - managed: z.enum(['true']), - phase: z.optional(types_name), - phase_time: z.optional(types_date_time), - phase_time_millis: z.optional(types_epoch_time_unit_millis), - policy: z.optional(types_name), - previous_step_info: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - repository_name: z.optional(z.string()), - snapshot_name: z.optional(z.string()), - shrink_index_name: z.optional(z.string()), - step: z.optional(types_name), - step_info: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - step_time: z.optional(types_date_time), - step_time_millis: z.optional(types_epoch_time_unit_millis), - phase_execution: z.optional(ilm_explain_lifecycle_lifecycle_explain_phase_execution), - time_since_index_creation: z.optional(types_duration), - skip: z.boolean(), + action: z.optional(types_name), + action_time: z.optional(types_date_time), + action_time_millis: z.optional(types_epoch_time_unit_millis), + age: z.optional(types_duration), + age_in_millis: z.optional(types_duration_value_unit_millis), + failed_step: z.optional(types_name), + failed_step_retry_count: z.optional(z.number()), + index: types_index_name, + index_creation_date: z.optional(types_date_time), + index_creation_date_millis: z.optional(types_epoch_time_unit_millis), + is_auto_retryable_error: z.optional(z.boolean()), + lifecycle_date: z.optional(types_date_time), + lifecycle_date_millis: z.optional(types_epoch_time_unit_millis), + managed: z.enum(['true']), + phase: z.optional(types_name), + phase_time: z.optional(types_date_time), + phase_time_millis: z.optional(types_epoch_time_unit_millis), + policy: z.optional(types_name), + previous_step_info: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + repository_name: z.optional(z.string()), + snapshot_name: z.optional(z.string()), + shrink_index_name: z.optional(z.string()), + step: z.optional(types_name), + step_info: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + step_time: z.optional(types_date_time), + step_time_millis: z.optional(types_epoch_time_unit_millis), + phase_execution: z.optional(ilm_explain_lifecycle_lifecycle_explain_phase_execution), + time_since_index_creation: z.optional(types_duration), + skip: z.boolean() }); export const ilm_explain_lifecycle_lifecycle_explain_unmanaged = z.object({ - index: types_index_name, - managed: z.enum(['false']), + index: types_index_name, + managed: z.enum(['false']) }); export const ilm_explain_lifecycle_lifecycle_explain = z.union([ - z - .object({ - managed: z.literal('true'), - }) - .and(ilm_explain_lifecycle_lifecycle_explain_managed), - z - .object({ - managed: z.literal('false'), - }) - .and(ilm_explain_lifecycle_lifecycle_explain_unmanaged), + z.object({ + managed: z.literal('true') + }).and(ilm_explain_lifecycle_lifecycle_explain_managed), + z.object({ + managed: z.literal('false') + }).and(ilm_explain_lifecycle_lifecycle_explain_unmanaged) ]); export const ilm_types_phases = z.object({ - cold: z.optional(ilm_types_phase), - delete: z.optional(ilm_types_phase), - frozen: z.optional(ilm_types_phase), - hot: z.optional(ilm_types_phase), - warm: z.optional(ilm_types_phase), + cold: z.optional(ilm_types_phase), + delete: z.optional(ilm_types_phase), + frozen: z.optional(ilm_types_phase), + hot: z.optional(ilm_types_phase), + warm: z.optional(ilm_types_phase) }); export const ilm_types_policy = z.object({ - phases: ilm_types_phases, - _meta: z.optional(types_metadata), + phases: ilm_types_phases, + _meta: z.optional(types_metadata) }); export const ilm_get_lifecycle_lifecycle = z.object({ - modified_date: types_date_time, - policy: ilm_types_policy, - version: types_version_number, + modified_date: types_date_time, + policy: ilm_types_policy, + version: types_version_number }); export const ilm_move_to_step_step_key = z.object({ - action: z.optional( - z.string().register(z.globalRegistry, { - description: 'The optional action to which the index will be moved.', - }) - ), - name: z.optional( - z.string().register(z.globalRegistry, { - description: 'The optional step name to which the index will be moved.', - }) - ), - phase: z.string(), + action: z.optional(z.string().register(z.globalRegistry, { + description: 'The optional action to which the index will be moved.' + })), + name: z.optional(z.string().register(z.globalRegistry, { + description: 'The optional step name to which the index will be moved.' + })), + phase: z.string() }); export const types_op_type = z.enum(['index', 'create']); export const indices_types_indices_block_options = z.enum([ - 'metadata', - 'read', - 'read_only', - 'write', + 'metadata', + 'read', + 'read_only', + 'write' ]); export const indices_add_block_add_indices_block_status = z.object({ - name: types_index_name, - blocked: z.boolean(), + name: types_index_name, + blocked: z.boolean() }); -export const indices_analyze_text_to_analyze = z.union([z.string(), z.array(z.string())]); +export const indices_analyze_text_to_analyze = z.union([ + z.string(), + z.array(z.string()) +]); export const indices_analyze_explain_analyze_token = z.object({ - bytes: z.string(), - end_offset: z.number(), - keyword: z.optional(z.boolean()), - position: z.number(), - positionLength: z.number(), - start_offset: z.number(), - termFrequency: z.number(), - token: z.string(), - type: z.string(), + bytes: z.string(), + end_offset: z.number(), + keyword: z.optional(z.boolean()), + position: z.number(), + positionLength: z.number(), + start_offset: z.number(), + termFrequency: z.number(), + token: z.string(), + type: z.string() }); export const indices_analyze_analyzer_detail = z.object({ - name: z.string(), - tokens: z.array(indices_analyze_explain_analyze_token), + name: z.string(), + tokens: z.array(indices_analyze_explain_analyze_token) }); export const indices_analyze_char_filter_detail = z.object({ - filtered_text: z.array(z.string()), - name: z.string(), + filtered_text: z.array(z.string()), + name: z.string() }); export const indices_analyze_token_detail = z.object({ - name: z.string(), - tokens: z.array(indices_analyze_explain_analyze_token), + name: z.string(), + tokens: z.array(indices_analyze_explain_analyze_token) }); export const indices_analyze_analyze_detail = z.object({ - analyzer: z.optional(indices_analyze_analyzer_detail), - charfilters: z.optional(z.array(indices_analyze_char_filter_detail)), - custom_analyzer: z.boolean(), - tokenfilters: z.optional(z.array(indices_analyze_token_detail)), - tokenizer: z.optional(indices_analyze_token_detail), + analyzer: z.optional(indices_analyze_analyzer_detail), + charfilters: z.optional(z.array(indices_analyze_char_filter_detail)), + custom_analyzer: z.boolean(), + tokenfilters: z.optional(z.array(indices_analyze_token_detail)), + tokenizer: z.optional(indices_analyze_token_detail) }); export const indices_analyze_analyze_token = z.object({ - end_offset: z.number(), - position: z.number(), - positionLength: z.optional(z.number()), - start_offset: z.number(), - token: z.string(), - type: z.string(), + end_offset: z.number(), + position: z.number(), + positionLength: z.optional(z.number()), + start_offset: z.number(), + token: z.string(), + type: z.string() }); export const types_shards_operation_response_base = z.object({ - _shards: z.optional(types_shard_statistics), + _shards: z.optional(types_shard_statistics) }); export const indices_close_close_shard_result = z.object({ - failures: z.array(types_shard_failure), + failures: z.array(types_shard_failure) }); export const indices_close_close_index_result = z.object({ - closed: z.boolean(), - shards: z.optional(z.record(z.string(), indices_close_close_shard_result)), + closed: z.boolean(), + shards: z.optional(z.record(z.string(), indices_close_close_shard_result)) }); export const indices_data_streams_stats_data_streams_stats_item = z.object({ - backing_indices: z.number().register(z.globalRegistry, { - description: 'Current number of backing indices for the data stream.', - }), - data_stream: types_name, - maximum_timestamp: types_epoch_time_unit_millis, - store_size: z.optional(types_byte_size), - store_size_bytes: z.number().register(z.globalRegistry, { - description: 'Total size, in bytes, of all shards for the data stream’s backing indices.', - }), -}); - -export const types_indices_response_base = types_acknowledged_response_base.and( - z.object({ - _shards: z.optional(types_shard_statistics), - }) -); - -export const indices_delete_alias_indices_aliases_response_body = - types_acknowledged_response_base.and( - z.object({ - errors: z.optional(z.boolean()), + backing_indices: z.number().register(z.globalRegistry, { + description: 'Current number of backing indices for the data stream.' + }), + data_stream: types_name, + maximum_timestamp: types_epoch_time_unit_millis, + store_size: z.optional(types_byte_size), + store_size_bytes: z.number().register(z.globalRegistry, { + description: 'Total size, in bytes, of all shards for the data stream’s backing indices.' }) - ); +}); + +export const types_indices_response_base = types_acknowledged_response_base.and(z.object({ + _shards: z.optional(types_shard_statistics) +})); + +export const indices_delete_alias_indices_aliases_response_body = types_acknowledged_response_base.and(z.object({ + errors: z.optional(z.boolean()) +})); export const types_data_stream_names = z.union([ - types_data_stream_name, - z.array(types_data_stream_name), + types_data_stream_name, + z.array(types_data_stream_name) ]); -export const indices_types_sampling_method = z.enum(['aggregate', 'last_value']); - export const indices_types_downsample_config = z.object({ - fixed_interval: types_duration_large, - sampling_method: z.optional(indices_types_sampling_method), + fixed_interval: types_duration_large, + sampling_method: z.optional(indices_types_sampling_method) }); export const indices_explain_data_lifecycle_data_stream_lifecycle_explain = z.object({ - index: types_index_name, - managed_by_lifecycle: z.boolean(), - index_creation_date_millis: z.optional(types_epoch_time_unit_millis), - time_since_index_creation: z.optional(types_duration), - rollover_date_millis: z.optional(types_epoch_time_unit_millis), - time_since_rollover: z.optional(types_duration), - lifecycle: z.optional(indices_types_data_stream_lifecycle_with_rollover), - generation_time: z.optional(types_duration), - error: z.optional(z.string()), + index: types_index_name, + managed_by_lifecycle: z.boolean(), + index_creation_date_millis: z.optional(types_epoch_time_unit_millis), + time_since_index_creation: z.optional(types_duration), + rollover_date_millis: z.optional(types_epoch_time_unit_millis), + time_since_rollover: z.optional(types_duration), + lifecycle: z.optional(indices_types_data_stream_lifecycle_with_rollover), + generation_time: z.optional(types_duration), + error: z.optional(z.string()) }); export const indices_field_usage_stats_fields_usage_body = z.object({ - _shards: types_shard_statistics, + _shards: types_shard_statistics }); -export const indices_forcemerge_types_force_merge_response_body = - types_shards_operation_response_base.and( - z.object({ - task: z.optional( - z.string().register(z.globalRegistry, { - description: - 'task contains a task id returned when wait_for_completion=false,\nyou can use the task_id to get the status of the task at _tasks/', - }) - ), - }) - ); +export const indices_forcemerge_types_force_merge_response_body = types_shards_operation_response_base.and(z.object({ + task: z.optional(z.string().register(z.globalRegistry, { + description: 'task contains a task id returned when wait_for_completion=false,\nyou can use the task_id to get the status of the task at _tasks/' + })) +})); -export const indices_get_feature = z.enum(['aliases', 'mappings', 'settings']); +export const indices_get_feature = z.enum([ + 'aliases', + 'mappings', + 'settings' +]); -export const indices_get_features = z.union([indices_get_feature, z.array(indices_get_feature)]); +export const indices_get_features = z.union([ + indices_get_feature, + z.array(indices_get_feature) +]); export const indices_get_data_lifecycle_data_stream_with_lifecycle = z.object({ - name: types_data_stream_name, - lifecycle: z.optional(indices_types_data_stream_lifecycle_with_rollover), + name: types_data_stream_name, + lifecycle: z.optional(indices_types_data_stream_lifecycle_with_rollover) }); export const indices_get_data_lifecycle_stats_data_stream_stats = z.object({ - backing_indices_in_error: z.number().register(z.globalRegistry, { - description: 'The count of the backing indices for the data stream.', - }), - backing_indices_in_total: z.number().register(z.globalRegistry, { - description: - 'The count of the backing indices for the data stream that have encountered an error.', - }), - name: types_data_stream_name, + backing_indices_in_error: z.number().register(z.globalRegistry, { + description: 'The count of the backing indices for the data stream.' + }), + backing_indices_in_total: z.number().register(z.globalRegistry, { + description: 'The count of the backing indices for the data stream that have encountered an error.' + }), + name: types_data_stream_name }); export const indices_types_managed_by = z.enum([ - 'Index Lifecycle Management', - 'Data stream lifecycle', - 'Unmanaged', + 'Index Lifecycle Management', + 'Data stream lifecycle', + 'Unmanaged' ]); -export const indices_types_index_mode = z.enum(['standard', 'time_series', 'logsdb', 'lookup']); +export const indices_types_index_mode = z.enum([ + 'standard', + 'time_series', + 'logsdb', + 'lookup' +]); export const indices_types_data_stream_index = z.object({ - index_name: types_index_name, - index_uuid: types_uuid, - ilm_policy: z.optional(types_name), - managed_by: z.optional(indices_types_managed_by), - prefer_ilm: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates if ILM should take precedence over DSL in case both are configured to manage this index.', - }) - ), - index_mode: z.optional(indices_types_index_mode), + index_name: types_index_name, + index_uuid: types_uuid, + ilm_policy: z.optional(types_name), + managed_by: z.optional(indices_types_managed_by), + prefer_ilm: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates if ILM should take precedence over DSL in case both are configured to manage this index.' + })), + index_mode: z.optional(indices_types_index_mode) }); export const indices_types_failure_store = z.object({ - enabled: z.boolean(), - indices: z.array(indices_types_data_stream_index), - rollover_on_write: z.boolean(), + enabled: z.boolean(), + indices: z.array(indices_types_data_stream_index), + rollover_on_write: z.boolean() }); export const indices_types_data_stream_timestamp_field = z.object({ - name: types_field, + name: types_field }); /** * The failure store lifecycle configures the data stream lifecycle configuration for failure indices. */ -export const indices_types_failure_store_lifecycle = z - .object({ +export const indices_types_failure_store_lifecycle = z.object({ data_retention: z.optional(types_duration), - enabled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle\nthat's disabled (enabled: `false`) will have no effect on the data stream.", - }) - ), - }) - .register(z.globalRegistry, { - description: - 'The failure store lifecycle configures the data stream lifecycle configuration for failure indices.', - }); + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle\nthat\'s disabled (enabled: `false`) will have no effect on the data stream.' + })) +}).register(z.globalRegistry, { + description: 'The failure store lifecycle configures the data stream lifecycle configuration for failure indices.' +}); /** * Data stream failure store contains the configuration of the failure store for a given data stream. */ -export const indices_types_data_stream_failure_store = z - .object({ - enabled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If defined, it turns the failure store on/off (`true`/`false`) for this data stream. A data stream failure store\nthat's disabled (enabled: `false`) will redirect no new failed indices to the failure store; however, it will\nnot remove any existing data from the failure store.", - }) - ), - lifecycle: z.optional(indices_types_failure_store_lifecycle), - }) - .register(z.globalRegistry, { - description: - 'Data stream failure store contains the configuration of the failure store for a given data stream.', - }); +export const indices_types_data_stream_failure_store = z.object({ + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If defined, it turns the failure store on/off (`true`/`false`) for this data stream. A data stream failure store\nthat\'s disabled (enabled: `false`) will redirect no new failed indices to the failure store; however, it will\nnot remove any existing data from the failure store.' + })), + lifecycle: z.optional(indices_types_failure_store_lifecycle) +}).register(z.globalRegistry, { + description: 'Data stream failure store contains the configuration of the failure store for a given data stream.' +}); /** * Data stream options contain the configuration of data stream level features for a given data stream, for example, * the failure store configuration. */ -export const indices_types_data_stream_options = z - .object({ - failure_store: z.optional(indices_types_data_stream_failure_store), - }) - .register(z.globalRegistry, { - description: - 'Data stream options contain the configuration of data stream level features for a given data stream, for example,\nthe failure store configuration.', - }); +export const indices_types_data_stream_options = z.object({ + failure_store: z.optional(indices_types_data_stream_failure_store) +}).register(z.globalRegistry, { + description: 'Data stream options contain the configuration of data stream level features for a given data stream, for example,\nthe failure store configuration.' +}); export const indices_get_data_stream_options_data_stream_with_options = z.object({ - name: types_data_stream_name, - options: z.optional(indices_types_data_stream_options), + name: types_data_stream_name, + options: z.optional(indices_types_data_stream_options) }); export const indices_types_index_template_data_stream_configuration = z.object({ - hidden: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the data stream is hidden.', - }) - ), - allow_custom_routing: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the data stream supports custom routing.', - }) - ), + hidden: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the data stream is hidden.' + })), + allow_custom_routing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the data stream supports custom routing.' + })) }); export const indices_get_migrate_reindex_status_status_in_progress = z.object({ - index: z.string(), - total_doc_count: z.number(), - reindexed_doc_count: z.number(), + index: z.string(), + total_doc_count: z.number(), + reindexed_doc_count: z.number() }); export const indices_get_migrate_reindex_status_status_error = z.object({ - index: z.string(), - message: z.string(), + index: z.string(), + message: z.string() }); export const indices_migrate_reindex_mode_enum = z.enum(['upgrade']); export const indices_migrate_reindex_source_index = z.object({ - index: types_index_name, + index: types_index_name }); export const indices_migrate_reindex_migrate_reindex = z.object({ - mode: indices_migrate_reindex_mode_enum, - source: indices_migrate_reindex_source_index, + mode: indices_migrate_reindex_mode_enum, + source: indices_migrate_reindex_source_index }); export const indices_modify_data_stream_index_and_data_stream_action = z.object({ - data_stream: types_data_stream_name, - index: types_index_name, + data_stream: types_data_stream_name, + index: types_index_name }); export const indices_modify_data_stream_action = z.object({ - add_backing_index: z.optional(indices_modify_data_stream_index_and_data_stream_action), - remove_backing_index: z.optional(indices_modify_data_stream_index_and_data_stream_action), + add_backing_index: z.optional(indices_modify_data_stream_index_and_data_stream_action), + remove_backing_index: z.optional(indices_modify_data_stream_index_and_data_stream_action) }); export const indices_put_data_stream_settings_data_stream_settings_error = z.object({ - index: types_index_name, - error: z.string().register(z.globalRegistry, { - description: 'A message explaining why the settings could not be applied to specific indices.', - }), + index: types_index_name, + error: z.string().register(z.globalRegistry, { + description: 'A message explaining why the settings could not be applied to specific indices.' + }) }); export const indices_put_data_stream_settings_index_setting_results = z.object({ - applied_to_data_stream_only: z.array(z.string()).register(z.globalRegistry, { - description: - 'The list of settings that were applied to the data stream but not to backing indices. These will be applied to\nthe write index the next time the data stream is rolled over.', - }), - applied_to_data_stream_and_backing_indices: z.array(z.string()).register(z.globalRegistry, { - description: - 'The list of settings that were applied to the data stream and to all of its backing indices. These settings will\nalso be applied to the write index the next time the data stream is rolled over.', - }), - errors: z.optional(z.array(indices_put_data_stream_settings_data_stream_settings_error)), + applied_to_data_stream_only: z.array(z.string()).register(z.globalRegistry, { + description: 'The list of settings that were applied to the data stream but not to backing indices. These will be applied to\nthe write index the next time the data stream is rolled over.' + }), + applied_to_data_stream_and_backing_indices: z.array(z.string()).register(z.globalRegistry, { + description: 'The list of settings that were applied to the data stream and to all of its backing indices. These settings will\nalso be applied to the write index the next time the data stream is rolled over.' + }), + errors: z.optional(z.array(indices_put_data_stream_settings_data_stream_settings_error)) }); export const indices_types_data_stream_visibility = z.object({ - hidden: z.optional(z.boolean()), - allow_custom_routing: z.optional(z.boolean()), + hidden: z.optional(z.boolean()), + allow_custom_routing: z.optional(z.boolean()) }); export const indices_recovery_recovery_bytes = z.object({ - percent: types_percentage, - recovered: z.optional(types_byte_size), - recovered_in_bytes: types_byte_size, - recovered_from_snapshot: z.optional(types_byte_size), - recovered_from_snapshot_in_bytes: z.optional(types_byte_size), - reused: z.optional(types_byte_size), - reused_in_bytes: types_byte_size, - total: z.optional(types_byte_size), - total_in_bytes: types_byte_size, + percent: types_percentage, + recovered: z.optional(types_byte_size), + recovered_in_bytes: types_byte_size, + recovered_from_snapshot: z.optional(types_byte_size), + recovered_from_snapshot_in_bytes: z.optional(types_byte_size), + reused: z.optional(types_byte_size), + reused_in_bytes: types_byte_size, + total: z.optional(types_byte_size), + total_in_bytes: types_byte_size }); export const indices_recovery_file_details = z.object({ - length: z.number(), - name: z.string(), - recovered: z.number(), + length: z.number(), + name: z.string(), + recovered: z.number() }); export const indices_recovery_recovery_files = z.object({ - details: z.optional(z.array(indices_recovery_file_details)), - percent: types_percentage, - recovered: z.number(), - reused: z.number(), - total: z.number(), + details: z.optional(z.array(indices_recovery_file_details)), + percent: types_percentage, + recovered: z.number(), + reused: z.number(), + total: z.number() }); export const indices_recovery_recovery_index_status = z.object({ - bytes: z.optional(indices_recovery_recovery_bytes), - files: indices_recovery_recovery_files, - size: indices_recovery_recovery_bytes, - source_throttle_time: z.optional(types_duration), - source_throttle_time_in_millis: types_duration_value_unit_millis, - target_throttle_time: z.optional(types_duration), - target_throttle_time_in_millis: types_duration_value_unit_millis, - total_time: z.optional(types_duration), - total_time_in_millis: types_duration_value_unit_millis, + bytes: z.optional(indices_recovery_recovery_bytes), + files: indices_recovery_recovery_files, + size: indices_recovery_recovery_bytes, + source_throttle_time: z.optional(types_duration), + source_throttle_time_in_millis: types_duration_value_unit_millis, + target_throttle_time: z.optional(types_duration), + target_throttle_time_in_millis: types_duration_value_unit_millis, + total_time: z.optional(types_duration), + total_time_in_millis: types_duration_value_unit_millis }); export const indices_recovery_recovery_origin = z.object({ - hostname: z.optional(z.string()), - host: z.optional(types_host), - transport_address: z.optional(types_transport_address), - id: z.optional(types_id), - ip: z.optional(types_ip), - name: z.optional(types_name), - bootstrap_new_history_uuid: z.optional(z.boolean()), - repository: z.optional(types_name), - snapshot: z.optional(types_name), - version: z.optional(types_version_string), - restoreUUID: z.optional(types_uuid), - index: z.optional(types_index_name), + hostname: z.optional(z.string()), + host: z.optional(types_host), + transport_address: z.optional(types_transport_address), + id: z.optional(types_id), + ip: z.optional(types_ip), + name: z.optional(types_name), + bootstrap_new_history_uuid: z.optional(z.boolean()), + repository: z.optional(types_name), + snapshot: z.optional(types_name), + version: z.optional(types_version_string), + restoreUUID: z.optional(types_uuid), + index: z.optional(types_index_name) }); export const indices_recovery_recovery_start_status = z.object({ - check_index_time: z.optional(types_duration), - check_index_time_in_millis: types_duration_value_unit_millis, - total_time: z.optional(types_duration), - total_time_in_millis: types_duration_value_unit_millis, + check_index_time: z.optional(types_duration), + check_index_time_in_millis: types_duration_value_unit_millis, + total_time: z.optional(types_duration), + total_time_in_millis: types_duration_value_unit_millis }); export const indices_recovery_translog_status = z.object({ - percent: types_percentage, - recovered: z.number(), - total: z.number(), - total_on_start: z.number(), - total_time: z.optional(types_duration), - total_time_in_millis: types_duration_value_unit_millis, + percent: types_percentage, + recovered: z.number(), + total: z.number(), + total_on_start: z.number(), + total_time: z.optional(types_duration), + total_time_in_millis: types_duration_value_unit_millis }); export const indices_recovery_verify_index = z.object({ - check_index_time: z.optional(types_duration), - check_index_time_in_millis: types_duration_value_unit_millis, - total_time: z.optional(types_duration), - total_time_in_millis: types_duration_value_unit_millis, + check_index_time: z.optional(types_duration), + check_index_time_in_millis: types_duration_value_unit_millis, + total_time: z.optional(types_duration), + total_time_in_millis: types_duration_value_unit_millis }); export const indices_recovery_shard_recovery = z.object({ - id: z.number(), - index: indices_recovery_recovery_index_status, - primary: z.boolean(), - source: indices_recovery_recovery_origin, - stage: z.string(), - start: z.optional(indices_recovery_recovery_start_status), - start_time: z.optional(types_date_time), - start_time_in_millis: types_epoch_time_unit_millis, - stop_time: z.optional(types_date_time), - stop_time_in_millis: z.optional(types_epoch_time_unit_millis), - target: indices_recovery_recovery_origin, - total_time: z.optional(types_duration), - total_time_in_millis: types_duration_value_unit_millis, - translog: indices_recovery_translog_status, - type: z.string(), - verify_index: indices_recovery_verify_index, + id: z.number(), + index: indices_recovery_recovery_index_status, + primary: z.boolean(), + source: indices_recovery_recovery_origin, + stage: z.string(), + start: z.optional(indices_recovery_recovery_start_status), + start_time: z.optional(types_date_time), + start_time_in_millis: types_epoch_time_unit_millis, + stop_time: z.optional(types_date_time), + stop_time_in_millis: z.optional(types_epoch_time_unit_millis), + target: indices_recovery_recovery_origin, + total_time: z.optional(types_duration), + total_time_in_millis: types_duration_value_unit_millis, + translog: indices_recovery_translog_status, + type: z.string(), + verify_index: indices_recovery_verify_index }); export const indices_recovery_recovery_status = z.object({ - shards: z.array(indices_recovery_shard_recovery), + shards: z.array(indices_recovery_shard_recovery) }); export const indices_reload_search_analyzers_reload_details = z.object({ - index: z.string(), - reloaded_analyzers: z.array(z.string()), - reloaded_node_ids: z.array(z.string()), + index: z.string(), + reloaded_analyzers: z.array(z.string()), + reloaded_node_ids: z.array(z.string()) }); export const indices_reload_search_analyzers_reload_result = z.object({ - reload_details: z.array(indices_reload_search_analyzers_reload_details), - _shards: types_shard_statistics, + reload_details: z.array(indices_reload_search_analyzers_reload_details), + _shards: types_shard_statistics }); export const indices_remove_block_remove_indices_block_status = z.object({ - name: types_index_name, - unblocked: z.optional(z.boolean()), - exception: z.optional(types_error_cause), + name: types_index_name, + unblocked: z.optional(z.boolean()), + exception: z.optional(types_error_cause) }); /** * Reduced (minimal) info ElasticsearchVersion */ -export const types_elasticsearch_version_min_info = z - .object({ +export const types_elasticsearch_version_min_info = z.object({ build_flavor: z.string(), minimum_index_compatibility_version: types_version_string, minimum_wire_compatibility_version: types_version_string, - number: z.string(), - }) - .register(z.globalRegistry, { - description: 'Reduced (minimal) info ElasticsearchVersion', - }); + number: z.string() +}).register(z.globalRegistry, { + description: 'Reduced (minimal) info ElasticsearchVersion' +}); /** * Provides information about each cluster request relevant to doing a cross-cluster search. */ -export const indices_resolve_cluster_resolve_cluster_info = z - .object({ +export const indices_resolve_cluster_resolve_cluster_info = z.object({ connected: z.boolean().register(z.globalRegistry, { - description: 'Whether the remote cluster is connected to the local (querying) cluster.', + description: 'Whether the remote cluster is connected to the local (querying) cluster.' }), skip_unavailable: z.boolean().register(z.globalRegistry, { - description: 'The `skip_unavailable` setting for a remote cluster.', - }), - matching_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether the index expression provided in the request matches any indices, aliases or data streams\non the cluster.', - }) - ), - error: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Provides error messages that are likely to occur if you do a search with this index expression\non the specified cluster (for example, lack of security privileges to query an index).', - }) - ), - version: z.optional(types_elasticsearch_version_min_info), - }) - .register(z.globalRegistry, { - description: - 'Provides information about each cluster request relevant to doing a cross-cluster search.', - }); + description: 'The `skip_unavailable` setting for a remote cluster.' + }), + matching_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether the index expression provided in the request matches any indices, aliases or data streams\non the cluster.' + })), + error: z.optional(z.string().register(z.globalRegistry, { + description: 'Provides error messages that are likely to occur if you do a search with this index expression\non the specified cluster (for example, lack of security privileges to query an index).' + })), + version: z.optional(types_elasticsearch_version_min_info) +}).register(z.globalRegistry, { + description: 'Provides information about each cluster request relevant to doing a cross-cluster search.' +}); export const indices_resolve_index_resolve_index_item = z.object({ - name: types_name, - aliases: z.optional(z.array(z.string())), - attributes: z.array(z.string()), - data_stream: z.optional(types_data_stream_name), - mode: z.optional(indices_types_index_mode), + name: types_name, + aliases: z.optional(z.array(z.string())), + attributes: z.array(z.string()), + data_stream: z.optional(types_data_stream_name), + mode: z.optional(indices_types_index_mode) }); export const indices_resolve_index_resolve_index_alias_item = z.object({ - name: types_name, - indices: types_indices, + name: types_name, + indices: types_indices }); export const indices_resolve_index_resolve_index_data_streams_item = z.object({ - name: types_data_stream_name, - timestamp_field: types_field, - backing_indices: types_indices, + name: types_data_stream_name, + timestamp_field: types_field, + backing_indices: types_indices }); export const indices_rollover_rollover_conditions = z.object({ - min_age: z.optional(types_duration), - max_age: z.optional(types_duration), - max_age_millis: z.optional(types_duration_value_unit_millis), - min_docs: z.optional(z.number()), - max_docs: z.optional(z.number()), - max_size: z.optional(types_byte_size), - max_size_bytes: z.optional(z.number()), - min_size: z.optional(types_byte_size), - min_size_bytes: z.optional(z.number()), - max_primary_shard_size: z.optional(types_byte_size), - max_primary_shard_size_bytes: z.optional(z.number()), - min_primary_shard_size: z.optional(types_byte_size), - min_primary_shard_size_bytes: z.optional(z.number()), - max_primary_shard_docs: z.optional(z.number()), - min_primary_shard_docs: z.optional(z.number()), + min_age: z.optional(types_duration), + max_age: z.optional(types_duration), + max_age_millis: z.optional(types_duration_value_unit_millis), + min_docs: z.optional(z.number()), + max_docs: z.optional(z.number()), + max_size: z.optional(types_byte_size), + max_size_bytes: z.optional(z.number()), + min_size: z.optional(types_byte_size), + min_size_bytes: z.optional(z.number()), + max_primary_shard_size: z.optional(types_byte_size), + max_primary_shard_size_bytes: z.optional(z.number()), + min_primary_shard_size: z.optional(types_byte_size), + min_primary_shard_size_bytes: z.optional(z.number()), + max_primary_shard_docs: z.optional(z.number()), + min_primary_shard_docs: z.optional(z.number()) }); export const indices_segments_shard_segment_routing = z.object({ - node: z.string(), - primary: z.boolean(), - state: z.string(), + node: z.string(), + primary: z.boolean(), + state: z.string() }); export const indices_segments_segment = z.object({ - attributes: z.record(z.string(), z.string()), - committed: z.boolean(), - compound: z.boolean(), - deleted_docs: z.number(), - generation: z.number(), - search: z.boolean(), - size_in_bytes: z.number(), - num_docs: z.number(), - version: types_version_string, + attributes: z.record(z.string(), z.string()), + committed: z.boolean(), + compound: z.boolean(), + deleted_docs: z.number(), + generation: z.number(), + search: z.boolean(), + size_in_bytes: z.number(), + num_docs: z.number(), + version: types_version_string }); export const indices_segments_shards_segment = z.object({ - num_committed_segments: z.number(), - routing: indices_segments_shard_segment_routing, - num_search_segments: z.number(), - segments: z.record(z.string(), indices_segments_segment), + num_committed_segments: z.number(), + routing: indices_segments_shard_segment_routing, + num_search_segments: z.number(), + segments: z.record(z.string(), indices_segments_segment) }); export const indices_segments_index_segment = z.object({ - shards: z.record( - z.string(), - z.union([indices_segments_shards_segment, z.array(indices_segments_shards_segment)]) - ), + shards: z.record(z.string(), z.union([ + indices_segments_shards_segment, + z.array(indices_segments_shards_segment) + ])) }); -export const indices_shard_stores_shard_store_status = z.enum(['green', 'yellow', 'red', 'all']); +export const indices_shard_stores_shard_store_status = z.enum([ + 'green', + 'yellow', + 'red', + 'all' +]); -export const indices_shard_stores_shard_store_allocation = z.enum(['primary', 'replica', 'unused']); +export const indices_shard_stores_shard_store_allocation = z.enum([ + 'primary', + 'replica', + 'unused' +]); export const indices_shard_stores_shard_store_exception = z.object({ - reason: z.string(), - type: z.string(), + reason: z.string(), + type: z.string() }); export const indices_shard_stores_shard_store = z.object({ - allocation: indices_shard_stores_shard_store_allocation, - allocation_id: z.optional(types_id), - store_exception: z.optional(indices_shard_stores_shard_store_exception), + allocation: indices_shard_stores_shard_store_allocation, + allocation_id: z.optional(types_id), + store_exception: z.optional(indices_shard_stores_shard_store_exception) }); export const indices_shard_stores_shard_store_wrapper = z.object({ - stores: z.array(indices_shard_stores_shard_store), + stores: z.array(indices_shard_stores_shard_store) }); export const indices_shard_stores_indices_shard_stores = z.object({ - shards: z.record(z.string(), indices_shard_stores_shard_store_wrapper), + shards: z.record(z.string(), indices_shard_stores_shard_store_wrapper) }); export const indices_simulate_template_overlapping = z.object({ - name: types_name, - index_patterns: z.array(z.string()), + name: types_name, + index_patterns: z.array(z.string()) }); export const types_common_stats_flag = z.enum([ - '_all', - 'store', - 'indexing', - 'get', - 'search', - 'merge', - 'flush', - 'refresh', - 'query_cache', - 'fielddata', - 'docs', - 'warmer', - 'completion', - 'segments', - 'translog', - 'request_cache', - 'recovery', - 'bulk', - 'shard_stats', - 'mappings', - 'dense_vector', - 'sparse_vector', + '_all', + 'store', + 'indexing', + 'get', + 'search', + 'merge', + 'flush', + 'refresh', + 'query_cache', + 'fielddata', + 'docs', + 'warmer', + 'completion', + 'segments', + 'translog', + 'request_cache', + 'recovery', + 'bulk', + 'shard_stats', + 'mappings', + 'dense_vector', + 'sparse_vector' ]); export const types_common_stats_flags = z.union([ - types_common_stats_flag, - z.array(types_common_stats_flag), + types_common_stats_flag, + z.array(types_common_stats_flag) ]); export const types_flush_stats = z.object({ - periodic: z.number(), - total: z.number(), - total_time: z.optional(types_duration), - total_time_in_millis: types_duration_value_unit_millis, + periodic: z.number(), + total: z.number(), + total_time: z.optional(types_duration), + total_time_in_millis: types_duration_value_unit_millis }); export const types_get_stats = z.object({ - current: z.number(), - exists_time: z.optional(types_duration), - exists_time_in_millis: types_duration_value_unit_millis, - exists_total: z.number(), - missing_time: z.optional(types_duration), - missing_time_in_millis: types_duration_value_unit_millis, - missing_total: z.number(), - time: z.optional(types_duration), - time_in_millis: types_duration_value_unit_millis, - total: z.number(), + current: z.number(), + exists_time: z.optional(types_duration), + exists_time_in_millis: types_duration_value_unit_millis, + exists_total: z.number(), + missing_time: z.optional(types_duration), + missing_time_in_millis: types_duration_value_unit_millis, + missing_total: z.number(), + time: z.optional(types_duration), + time_in_millis: types_duration_value_unit_millis, + total: z.number() }); export const types_indexing_stats = z.object({ - index_current: z.number(), - delete_current: z.number(), - delete_time: z.optional(types_duration), - delete_time_in_millis: types_duration_value_unit_millis, - delete_total: z.number(), - is_throttled: z.boolean(), - noop_update_total: z.number(), - throttle_time: z.optional(types_duration), - throttle_time_in_millis: types_duration_value_unit_millis, - index_time: z.optional(types_duration), - index_time_in_millis: types_duration_value_unit_millis, - index_total: z.number(), - index_failed: z.number(), - get types() { - return z.optional( - z.record( - z.string(), - z.lazy((): any => types_indexing_stats) - ) - ); - }, - write_load: z.optional(z.number()), - recent_write_load: z.optional(z.number()), - peak_write_load: z.optional(z.number()), + index_current: z.number(), + delete_current: z.number(), + delete_time: z.optional(types_duration), + delete_time_in_millis: types_duration_value_unit_millis, + delete_total: z.number(), + is_throttled: z.boolean(), + noop_update_total: z.number(), + throttle_time: z.optional(types_duration), + throttle_time_in_millis: types_duration_value_unit_millis, + index_time: z.optional(types_duration), + index_time_in_millis: types_duration_value_unit_millis, + index_total: z.number(), + index_failed: z.number(), + get types() { + return z.optional(z.record(z.string(), z.lazy((): any => types_indexing_stats))); + }, + write_load: z.optional(z.number()), + recent_write_load: z.optional(z.number()), + peak_write_load: z.optional(z.number()) }); export const types_merges_stats = z.object({ - current: z.number(), - current_docs: z.number(), - current_size: z.optional(z.string()), - current_size_in_bytes: z.number(), - total: z.number(), - total_auto_throttle: z.optional(z.string()), - total_auto_throttle_in_bytes: z.number(), - total_docs: z.number(), - total_size: z.optional(z.string()), - total_size_in_bytes: z.number(), - total_stopped_time: z.optional(types_duration), - total_stopped_time_in_millis: types_duration_value_unit_millis, - total_throttled_time: z.optional(types_duration), - total_throttled_time_in_millis: types_duration_value_unit_millis, - total_time: z.optional(types_duration), - total_time_in_millis: types_duration_value_unit_millis, + current: z.number(), + current_docs: z.number(), + current_size: z.optional(z.string()), + current_size_in_bytes: z.number(), + total: z.number(), + total_auto_throttle: z.optional(z.string()), + total_auto_throttle_in_bytes: z.number(), + total_docs: z.number(), + total_size: z.optional(z.string()), + total_size_in_bytes: z.number(), + total_stopped_time: z.optional(types_duration), + total_stopped_time_in_millis: types_duration_value_unit_millis, + total_throttled_time: z.optional(types_duration), + total_throttled_time_in_millis: types_duration_value_unit_millis, + total_time: z.optional(types_duration), + total_time_in_millis: types_duration_value_unit_millis }); export const types_recovery_stats = z.object({ - current_as_source: z.number(), - current_as_target: z.number(), - throttle_time: z.optional(types_duration), - throttle_time_in_millis: types_duration_value_unit_millis, + current_as_source: z.number(), + current_as_target: z.number(), + throttle_time: z.optional(types_duration), + throttle_time_in_millis: types_duration_value_unit_millis }); export const types_refresh_stats = z.object({ - external_total: z.number(), - external_total_time_in_millis: types_duration_value_unit_millis, - listeners: z.number(), - total: z.number(), - total_time: z.optional(types_duration), - total_time_in_millis: types_duration_value_unit_millis, + external_total: z.number(), + external_total_time_in_millis: types_duration_value_unit_millis, + listeners: z.number(), + total: z.number(), + total_time: z.optional(types_duration), + total_time_in_millis: types_duration_value_unit_millis }); export const types_request_cache_stats = z.object({ - evictions: z.number(), - hit_count: z.number(), - memory_size: z.optional(z.string()), - memory_size_in_bytes: z.number(), - miss_count: z.number(), + evictions: z.number(), + hit_count: z.number(), + memory_size: z.optional(z.string()), + memory_size_in_bytes: z.number(), + miss_count: z.number() }); export const types_search_stats = z.object({ - fetch_current: z.number(), - fetch_time: z.optional(types_duration), - fetch_time_in_millis: types_duration_value_unit_millis, - fetch_total: z.number(), - open_contexts: z.optional(z.number()), - query_current: z.number(), - query_time: z.optional(types_duration), - query_time_in_millis: types_duration_value_unit_millis, - query_total: z.number(), - scroll_current: z.number(), - scroll_time: z.optional(types_duration), - scroll_time_in_millis: types_duration_value_unit_millis, - scroll_total: z.number(), - suggest_current: z.number(), - suggest_time: z.optional(types_duration), - suggest_time_in_millis: types_duration_value_unit_millis, - suggest_total: z.number(), - recent_search_load: z.optional(z.number()), - get groups() { - return z.optional( - z.record( - z.string(), - z.lazy((): any => types_search_stats) - ) - ); - }, + fetch_current: z.number(), + fetch_time: z.optional(types_duration), + fetch_time_in_millis: types_duration_value_unit_millis, + fetch_total: z.number(), + open_contexts: z.optional(z.number()), + query_current: z.number(), + query_time: z.optional(types_duration), + query_time_in_millis: types_duration_value_unit_millis, + query_total: z.number(), + scroll_current: z.number(), + scroll_time: z.optional(types_duration), + scroll_time_in_millis: types_duration_value_unit_millis, + scroll_total: z.number(), + suggest_current: z.number(), + suggest_time: z.optional(types_duration), + suggest_time_in_millis: types_duration_value_unit_millis, + suggest_total: z.number(), + recent_search_load: z.optional(z.number()), + get groups() { + return z.optional(z.record(z.string(), z.lazy((): any => types_search_stats))); + } }); export const types_translog_stats = z.object({ - earliest_last_modified_age: z.number(), - operations: z.number(), - size: z.optional(z.string()), - size_in_bytes: z.number(), - uncommitted_operations: z.number(), - uncommitted_size: z.optional(z.string()), - uncommitted_size_in_bytes: z.number(), + earliest_last_modified_age: z.number(), + operations: z.number(), + size: z.optional(z.string()), + size_in_bytes: z.number(), + uncommitted_operations: z.number(), + uncommitted_size: z.optional(z.string()), + uncommitted_size_in_bytes: z.number() }); export const types_warmer_stats = z.object({ - current: z.number(), - total: z.number(), - total_time: z.optional(types_duration), - total_time_in_millis: types_duration_value_unit_millis, + current: z.number(), + total: z.number(), + total_time: z.optional(types_duration), + total_time_in_millis: types_duration_value_unit_millis }); export const types_bulk_stats = z.object({ - total_operations: z.number(), - total_time: z.optional(types_duration), - total_time_in_millis: types_duration_value_unit_millis, - total_size: z.optional(types_byte_size), - total_size_in_bytes: z.number(), - avg_time: z.optional(types_duration), - avg_time_in_millis: types_duration_value_unit_millis, - avg_size: z.optional(types_byte_size), - avg_size_in_bytes: z.number(), + total_operations: z.number(), + total_time: z.optional(types_duration), + total_time_in_millis: types_duration_value_unit_millis, + total_size: z.optional(types_byte_size), + total_size_in_bytes: z.number(), + avg_time: z.optional(types_duration), + avg_time_in_millis: types_duration_value_unit_millis, + avg_size: z.optional(types_byte_size), + avg_size_in_bytes: z.number() }); export const indices_stats_shards_total_stats = z.object({ - total_count: z.number(), + total_count: z.number() }); export const indices_stats_shard_commit = z.object({ - generation: z.number(), - id: types_id, - num_docs: z.number(), - user_data: z.record(z.string(), z.string()), + generation: z.number(), + id: types_id, + num_docs: z.number(), + user_data: z.record(z.string(), z.string()) }); export const indices_stats_mapping_stats = z.object({ - total_count: z.number(), - total_estimated_overhead: z.optional(types_byte_size), - total_estimated_overhead_in_bytes: z.number(), + total_count: z.number(), + total_estimated_overhead: z.optional(types_byte_size), + total_estimated_overhead_in_bytes: z.number() }); export const indices_stats_shard_path = z.object({ - data_path: z.string(), - is_custom_data_path: z.boolean(), - state_path: z.string(), + data_path: z.string(), + is_custom_data_path: z.boolean(), + state_path: z.string() }); export const indices_stats_shard_query_cache = z.object({ - cache_count: z.number(), - cache_size: z.number(), - evictions: z.number(), - hit_count: z.number(), - memory_size_in_bytes: z.number(), - miss_count: z.number(), - total_count: z.number(), + cache_count: z.number(), + cache_size: z.number(), + evictions: z.number(), + hit_count: z.number(), + memory_size_in_bytes: z.number(), + miss_count: z.number(), + total_count: z.number() }); export const indices_stats_shard_lease = z.object({ - id: types_id, - retaining_seq_no: types_sequence_number, - timestamp: z.number(), - source: z.string(), + id: types_id, + retaining_seq_no: types_sequence_number, + timestamp: z.number(), + source: z.string() }); export const indices_stats_shard_retention_leases = z.object({ - primary_term: z.number(), - version: types_version_number, - leases: z.array(indices_stats_shard_lease), + primary_term: z.number(), + version: types_version_number, + leases: z.array(indices_stats_shard_lease) }); export const indices_stats_shard_routing_state = z.enum([ - 'UNASSIGNED', - 'INITIALIZING', - 'STARTED', - 'RELOCATING', + 'UNASSIGNED', + 'INITIALIZING', + 'STARTED', + 'RELOCATING' ]); export const indices_stats_shard_routing = z.object({ - node: z.string(), - primary: z.boolean(), - relocating_node: z.optional(z.union([z.string(), z.null()])), - state: indices_stats_shard_routing_state, + node: z.string(), + primary: z.boolean(), + relocating_node: z.optional(z.union([ + z.string(), + z.null() + ])), + state: indices_stats_shard_routing_state }); export const indices_stats_shard_sequence_number = z.object({ - global_checkpoint: z.number(), - local_checkpoint: z.number(), - max_seq_no: types_sequence_number, + global_checkpoint: z.number(), + local_checkpoint: z.number(), + max_seq_no: types_sequence_number }); export const indices_stats_index_metadata_state = z.enum(['open', 'close']); export const indices_update_aliases_remove_action = z.object({ - alias: z.optional(types_index_alias), - aliases: z.optional(z.union([types_index_alias, z.array(types_index_alias)])), - index: z.optional(types_index_name), - indices: z.optional(types_indices), - must_exist: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the alias must exist to perform the action.', - }) - ), + alias: z.optional(types_index_alias), + aliases: z.optional(z.union([ + types_index_alias, + z.array(types_index_alias) + ])), + index: z.optional(types_index_name), + indices: z.optional(types_indices), + must_exist: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the alias must exist to perform the action.' + })) }); export const indices_update_aliases_remove_index_action = z.object({ - index: z.optional(types_index_name), - indices: z.optional(types_indices), - must_exist: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the alias must exist to perform the action.', - }) - ), + index: z.optional(types_index_name), + indices: z.optional(types_indices), + must_exist: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the alias must exist to perform the action.' + })) }); export const indices_validate_query_indices_validation_explanation = z.object({ - error: z.optional(z.string()), - explanation: z.optional(z.string()), - index: types_index_name, - valid: z.boolean(), + error: z.optional(z.string()), + explanation: z.optional(z.string()), + index: types_index_name, + valid: z.boolean() }); /** * An object style representation of a single portion of a conversation. */ -export const inference_types_content_object = z - .object({ +export const inference_types_content_object = z.object({ text: z.string().register(z.globalRegistry, { - description: 'The text content.', + description: 'The text content.' }), type: z.string().register(z.globalRegistry, { - description: 'The type of content.', - }), - }) - .register(z.globalRegistry, { - description: 'An object style representation of a single portion of a conversation.', - }); + description: 'The type of content.' + }) +}).register(z.globalRegistry, { + description: 'An object style representation of a single portion of a conversation.' +}); export const inference_types_message_content = z.union([ - z.string(), - z.array(inference_types_content_object), + z.string(), + z.array(inference_types_content_object) ]); /** * The function that the model called. */ -export const inference_types_tool_call_function = z - .object({ +export const inference_types_tool_call_function = z.object({ arguments: z.string().register(z.globalRegistry, { - description: 'The arguments to call the function with in JSON format.', + description: 'The arguments to call the function with in JSON format.' }), name: z.string().register(z.globalRegistry, { - description: 'The name of the function to call.', - }), - }) - .register(z.globalRegistry, { - description: 'The function that the model called.', - }); + description: 'The name of the function to call.' + }) +}).register(z.globalRegistry, { + description: 'The function that the model called.' +}); /** * A tool call generated by the model. */ -export const inference_types_tool_call = z - .object({ +export const inference_types_tool_call = z.object({ id: types_id, function: inference_types_tool_call_function, type: z.string().register(z.globalRegistry, { - description: 'The type of the tool call.', - }), - }) - .register(z.globalRegistry, { - description: 'A tool call generated by the model.', - }); + description: 'The type of the tool call.' + }) +}).register(z.globalRegistry, { + description: 'A tool call generated by the model.' +}); /** * An object representing part of the conversation. */ -export const inference_types_message = z - .object({ +export const inference_types_message = z.object({ content: z.optional(inference_types_message_content), role: z.string().register(z.globalRegistry, { - description: - 'The role of the message author. Valid values are `user`, `assistant`, `system`, and `tool`.', + description: 'The role of the message author. Valid values are `user`, `assistant`, `system`, and `tool`.' }), tool_call_id: z.optional(types_id), - tool_calls: z.optional( - z.array(inference_types_tool_call).register(z.globalRegistry, { - description: - 'Only for `assistant` role messages. The tool calls generated by the model. If it\'s specified, the `content` field is optional.\nExample:\n```\n{\n "tool_calls": [\n {\n "id": "call_KcAjWtAww20AihPHphUh46Gd",\n "type": "function",\n "function": {\n "name": "get_current_weather",\n "arguments": "{\\"location\\":\\"Boston, MA\\"}"\n }\n }\n ]\n}\n```', - }) - ), - }) - .register(z.globalRegistry, { - description: 'An object representing part of the conversation.', - }); + tool_calls: z.optional(z.array(inference_types_tool_call).register(z.globalRegistry, { + description: 'Only for `assistant` role messages. The tool calls generated by the model. If it\'s specified, the `content` field is optional.\nExample:\n```\n{\n "tool_calls": [\n {\n "id": "call_KcAjWtAww20AihPHphUh46Gd",\n "type": "function",\n "function": {\n "name": "get_current_weather",\n "arguments": "{\\"location\\":\\"Boston, MA\\"}"\n }\n }\n ]\n}\n```' + })) +}).register(z.globalRegistry, { + description: 'An object representing part of the conversation.' +}); /** * The tool choice function. */ -export const inference_types_completion_tool_choice_function = z - .object({ +export const inference_types_completion_tool_choice_function = z.object({ name: z.string().register(z.globalRegistry, { - description: 'The name of the function to call.', - }), - }) - .register(z.globalRegistry, { - description: 'The tool choice function.', - }); + description: 'The name of the function to call.' + }) +}).register(z.globalRegistry, { + description: 'The tool choice function.' +}); /** * Controls which tool is called by the model. */ -export const inference_types_completion_tool_choice = z - .object({ +export const inference_types_completion_tool_choice = z.object({ type: z.string().register(z.globalRegistry, { - description: 'The type of the tool.', + description: 'The type of the tool.' }), - function: inference_types_completion_tool_choice_function, - }) - .register(z.globalRegistry, { - description: 'Controls which tool is called by the model.', - }); + function: inference_types_completion_tool_choice_function +}).register(z.globalRegistry, { + description: 'Controls which tool is called by the model.' +}); export const inference_types_completion_tool_type = z.union([ - z.string(), - inference_types_completion_tool_choice, + z.string(), + inference_types_completion_tool_choice ]); /** * The completion tool function definition. */ -export const inference_types_completion_tool_function = z - .object({ - description: z.optional( - z.string().register(z.globalRegistry, { - description: - 'A description of what the function does.\nThis is used by the model to choose when and how to call the function.', - }) - ), +export const inference_types_completion_tool_function = z.object({ + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of what the function does.\nThis is used by the model to choose when and how to call the function.' + })), name: z.string().register(z.globalRegistry, { - description: 'The name of the function.', - }), - parameters: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'The parameters the functional accepts. This should be formatted as a JSON object.', - }) - ), - strict: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Whether to enable schema adherence when generating the function call.', - }) - ), - }) - .register(z.globalRegistry, { - description: 'The completion tool function definition.', - }); + description: 'The name of the function.' + }), + parameters: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'The parameters the functional accepts. This should be formatted as a JSON object.' + })), + strict: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to enable schema adherence when generating the function call.' + })) +}).register(z.globalRegistry, { + description: 'The completion tool function definition.' +}); /** * A list of tools that the model can call. */ -export const inference_types_completion_tool = z - .object({ +export const inference_types_completion_tool = z.object({ type: z.string().register(z.globalRegistry, { - description: 'The type of tool.', + description: 'The type of tool.' }), - function: inference_types_completion_tool_function, - }) - .register(z.globalRegistry, { - description: 'A list of tools that the model can call.', - }); + function: inference_types_completion_tool_function +}).register(z.globalRegistry, { + description: 'A list of tools that the model can call.' +}); export const inference_types_request_chat_completion = z.object({ - messages: z.array(inference_types_message).register(z.globalRegistry, { - description: - 'A list of objects representing the conversation.\nRequests should generally only add new messages from the user (role `user`).\nThe other message roles (`assistant`, `system`, or `tool`) should generally only be copied from the response to a previous completion request, such that the messages array is built up throughout a conversation.', - }), - model: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The ID of the model to use. By default, the model ID is set to the value included when creating the inference endpoint.', - }) - ), - max_completion_tokens: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The upper bound limit for the number of tokens that can be generated for a completion request.', - }) - ), - stop: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'A sequence of strings to control when the model should stop generating additional tokens.', - }) - ), - temperature: z.optional( - z.number().register(z.globalRegistry, { - description: 'The sampling temperature to use.', - }) - ), - tool_choice: z.optional(inference_types_completion_tool_type), - tools: z.optional( - z.array(inference_types_completion_tool).register(z.globalRegistry, { - description: - 'A list of tools that the model can call.\nExample:\n```\n{\n "tools": [\n {\n "type": "function",\n "function": {\n "name": "get_price_of_item",\n "description": "Get the current price of an item",\n "parameters": {\n "type": "object",\n "properties": {\n "item": {\n "id": "12345"\n },\n "unit": {\n "type": "currency"\n }\n }\n }\n }\n }\n ]\n}\n```', - }) - ), - top_p: z.optional( - z.number().register(z.globalRegistry, { - description: 'Nucleus sampling, an alternative to sampling with temperature.', - }) - ), + messages: z.array(inference_types_message).register(z.globalRegistry, { + description: 'A list of objects representing the conversation.\nRequests should generally only add new messages from the user (role `user`).\nThe other message roles (`assistant`, `system`, or `tool`) should generally only be copied from the response to a previous completion request, such that the messages array is built up throughout a conversation.' + }), + model: z.optional(z.string().register(z.globalRegistry, { + description: 'The ID of the model to use. By default, the model ID is set to the value included when creating the inference endpoint.' + })), + max_completion_tokens: z.optional(z.number().register(z.globalRegistry, { + description: 'The upper bound limit for the number of tokens that can be generated for a completion request.' + })), + stop: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A sequence of strings to control when the model should stop generating additional tokens.' + })), + temperature: z.optional(z.number().register(z.globalRegistry, { + description: 'The sampling temperature to use.' + })), + tool_choice: z.optional(inference_types_completion_tool_type), + tools: z.optional(z.array(inference_types_completion_tool).register(z.globalRegistry, { + description: 'A list of tools that the model can call.\nExample:\n```\n{\n "tools": [\n {\n "type": "function",\n "function": {\n "name": "get_price_of_item",\n "description": "Get the current price of an item",\n "parameters": {\n "type": "object",\n "properties": {\n "item": {\n "id": "12345"\n },\n "unit": {\n "type": "currency"\n }\n }\n }\n }\n }\n ]\n}\n```' + })), + top_p: z.optional(z.number().register(z.globalRegistry, { + description: 'Nucleus sampling, an alternative to sampling with temperature.' + })) }); export const types_stream_result = z.record(z.string(), z.unknown()); @@ -16309,170 +13583,132 @@ export const inference_types_task_settings = z.record(z.string(), z.unknown()); /** * The completion result object */ -export const inference_types_completion_result = z - .object({ - result: z.string(), - }) - .register(z.globalRegistry, { - description: 'The completion result object', - }); +export const inference_types_completion_result = z.object({ + result: z.string() +}).register(z.globalRegistry, { + description: 'The completion result object' +}); /** * Defines the completion result. */ -export const inference_types_completion_inference_result = z - .object({ - completion: z.array(inference_types_completion_result), - }) - .register(z.globalRegistry, { - description: 'Defines the completion result.', - }); +export const inference_types_completion_inference_result = z.object({ + completion: z.array(inference_types_completion_result) +}).register(z.globalRegistry, { + description: 'Defines the completion result.' +}); export const inference_types_task_type = z.enum([ - 'sparse_embedding', - 'text_embedding', - 'rerank', - 'completion', - 'chat_completion', + 'sparse_embedding', + 'text_embedding', + 'rerank', + 'completion', + 'chat_completion' ]); /** * Acknowledged response. For dry_run, contains the list of pipelines which reference the inference endpoint */ -export const inference_types_delete_inference_endpoint_result = - types_acknowledged_response_base.and( - z.object({ - pipelines: z.array(z.string()), - }) - ); +export const inference_types_delete_inference_endpoint_result = types_acknowledged_response_base.and(z.object({ + pipelines: z.array(z.string()) +})); /** * Chunking configuration object */ -export const inference_types_inference_chunking_settings = z - .object({ - max_chunk_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum size of a chunk in words.\nThis value cannot be lower than `20` (for `sentence` strategy) or `10` (for `word` strategy).\nThis value should not exceed the window size for the associated model.', - }) - ), - overlap: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of overlapping words for chunks.\nIt is applicable only to a `word` chunking strategy.\nThis value cannot be higher than half the `max_chunk_size` value.', - }) - ), - sentence_overlap: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of overlapping sentences for chunks.\nIt is applicable only for a `sentence` chunking strategy.\nIt can be either `1` or `0`.', - }) - ), - separator_group: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Only applicable to the `recursive` strategy and required when using it.\n\nSets a predefined list of separators in the saved chunking settings based on the selected text type.\nValues can be `markdown` or `plaintext`.\n\nUsing this parameter is an alternative to manually specifying a custom `separators` list.', - }) - ), - separators: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'Only applicable to the `recursive` strategy and required when using it.\n\nA list of strings used as possible split points when chunking text.\n\nEach string can be a plain string or a regular expression (regex) pattern.\nThe system tries each separator in order to split the text, starting from the first item in the list.\n\nAfter splitting, it attempts to recombine smaller pieces into larger chunks that stay within\nthe `max_chunk_size` limit, to reduce the total number of chunks generated.', - }) - ), - strategy: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The chunking strategy: `sentence`, `word`, `none` or `recursive`.\n\n * If `strategy` is set to `recursive`, you must also specify:\n\n- `max_chunk_size`\n- either `separators` or`separator_group`\n\nLearn more about different chunking strategies in the linked documentation.', - }) - ), - }) - .register(z.globalRegistry, { - description: 'Chunking configuration object', - }); +export const inference_types_inference_chunking_settings = z.object({ + max_chunk_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum size of a chunk in words.\nThis value cannot be lower than `20` (for `sentence` strategy) or `10` (for `word` strategy).\nThis value should not exceed the window size for the associated model.' + })), + overlap: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of overlapping words for chunks.\nIt is applicable only to a `word` chunking strategy.\nThis value cannot be higher than half the `max_chunk_size` value.' + })), + sentence_overlap: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of overlapping sentences for chunks.\nIt is applicable only for a `sentence` chunking strategy.\nIt can be either `1` or `0`.' + })), + separator_group: z.optional(z.string().register(z.globalRegistry, { + description: 'Only applicable to the `recursive` strategy and required when using it.\n\nSets a predefined list of separators in the saved chunking settings based on the selected text type.\nValues can be `markdown` or `plaintext`.\n\nUsing this parameter is an alternative to manually specifying a custom `separators` list.' + })), + separators: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Only applicable to the `recursive` strategy and required when using it.\n\nA list of strings used as possible split points when chunking text.\n\nEach string can be a plain string or a regular expression (regex) pattern.\nThe system tries each separator in order to split the text, starting from the first item in the list.\n\nAfter splitting, it attempts to recombine smaller pieces into larger chunks that stay within\nthe `max_chunk_size` limit, to reduce the total number of chunks generated.' + })), + strategy: z.optional(z.string().register(z.globalRegistry, { + description: 'The chunking strategy: `sentence`, `word`, `none` or `recursive`.\n\n * If `strategy` is set to `recursive`, you must also specify:\n\n- `max_chunk_size`\n- either `separators` or`separator_group`\n\nLearn more about different chunking strategies in the linked documentation.' + })) +}).register(z.globalRegistry, { + description: 'Chunking configuration object' +}); export const inference_types_service_settings = z.record(z.string(), z.unknown()); /** * Configuration options when storing the inference endpoint */ -export const inference_types_inference_endpoint = z - .object({ +export const inference_types_inference_endpoint = z.object({ chunking_settings: z.optional(inference_types_inference_chunking_settings), service: z.string().register(z.globalRegistry, { - description: 'The service type', + description: 'The service type' }), service_settings: inference_types_service_settings, - task_settings: z.optional(inference_types_task_settings), - }) - .register(z.globalRegistry, { - description: 'Configuration options when storing the inference endpoint', - }); + task_settings: z.optional(inference_types_task_settings) +}).register(z.globalRegistry, { + description: 'Configuration options when storing the inference endpoint' +}); /** * Represents an inference endpoint as returned by the GET API */ -export const inference_types_inference_endpoint_info = inference_types_inference_endpoint.and( - z.object({ +export const inference_types_inference_endpoint_info = inference_types_inference_endpoint.and(z.object({ inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', + description: 'The inference Id' }), - task_type: inference_types_task_type, - }) -); + task_type: inference_types_task_type +})); /** * Text Embedding results containing bytes are represented as Dense * Vectors of bytes. */ export const inference_types_dense_byte_vector = z.array(types_byte).register(z.globalRegistry, { - description: - 'Text Embedding results containing bytes are represented as Dense\nVectors of bytes.', + description: 'Text Embedding results containing bytes are represented as Dense\nVectors of bytes.' }); /** * The text embedding result object for byte representation */ -export const inference_types_text_embedding_byte_result = z - .object({ - embedding: inference_types_dense_byte_vector, - }) - .register(z.globalRegistry, { - description: 'The text embedding result object for byte representation', - }); +export const inference_types_text_embedding_byte_result = z.object({ + embedding: inference_types_dense_byte_vector +}).register(z.globalRegistry, { + description: 'The text embedding result object for byte representation' +}); /** * Text Embedding results are represented as Dense Vectors * of floats. */ export const inference_types_dense_vector = z.array(z.number()).register(z.globalRegistry, { - description: 'Text Embedding results are represented as Dense Vectors\nof floats.', + description: 'Text Embedding results are represented as Dense Vectors\nof floats.' }); /** * The text embedding result object */ -export const inference_types_text_embedding_result = z - .object({ - embedding: inference_types_dense_vector, - }) - .register(z.globalRegistry, { - description: 'The text embedding result object', - }); +export const inference_types_text_embedding_result = z.object({ + embedding: inference_types_dense_vector +}).register(z.globalRegistry, { + description: 'The text embedding result object' +}); /** * Sparse Embedding tokens are represented as a dictionary * of string to double. */ -export const inference_types_sparse_vector = z - .record(z.string(), z.number()) - .register(z.globalRegistry, { - description: 'Sparse Embedding tokens are represented as a dictionary\nof string to double.', - }); +export const inference_types_sparse_vector = z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'Sparse Embedding tokens are represented as a dictionary\nof string to double.' +}); export const inference_types_sparse_embedding_result = z.object({ - embedding: inference_types_sparse_vector, + embedding: inference_types_sparse_vector }); /** @@ -16481,32 +13717,27 @@ export const inference_types_sparse_embedding_result = z.object({ * relevance_score: the relevance_score of the document relative to the query * text: Optional, the text of the document, if requested */ -export const inference_types_ranked_document = z - .object({ +export const inference_types_ranked_document = z.object({ index: z.number(), relevance_score: z.number(), - text: z.optional(z.string()), - }) - .register(z.globalRegistry, { - description: - 'The rerank result object representing a single ranked document\nid: the original index of the document in the request\nrelevance_score: the relevance_score of the document relative to the query\ntext: Optional, the text of the document, if requested', - }); + text: z.optional(z.string()) +}).register(z.globalRegistry, { + description: 'The rerank result object representing a single ranked document\nid: the original index of the document in the request\nrelevance_score: the relevance_score of the document relative to the query\ntext: Optional, the text of the document, if requested' +}); /** * InferenceResult is an aggregation of mutually exclusive variants */ -export const inference_types_inference_result = z - .object({ +export const inference_types_inference_result = z.object({ text_embedding_bytes: z.optional(z.array(inference_types_text_embedding_byte_result)), text_embedding_bits: z.optional(z.array(inference_types_text_embedding_byte_result)), text_embedding: z.optional(z.array(inference_types_text_embedding_result)), sparse_embedding: z.optional(z.array(inference_types_sparse_embedding_result)), completion: z.optional(z.array(inference_types_completion_result)), - rerank: z.optional(z.array(inference_types_ranked_document)), - }) - .register(z.globalRegistry, { - description: 'InferenceResult is an aggregation of mutually exclusive variants', - }); + rerank: z.optional(z.array(inference_types_ranked_document)) +}).register(z.globalRegistry, { + description: 'InferenceResult is an aggregation of mutually exclusive variants' +}); export const inference_types_ai21_task_type = z.enum(['completion', 'chat_completion']); @@ -16515,179 +13746,134 @@ export const inference_types_ai21_service_type = z.enum(['ai21']); /** * This setting helps to minimize the number of rate limit errors returned from the service. */ -export const inference_types_rate_limit_setting = z - .object({ - requests_per_minute: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of requests allowed per minute.\nBy default, the number of requests allowed per minute is set by each service as follows:\n\n* `alibabacloud-ai-search` service: `1000`\n* `anthropic` service: `50`\n* `azureaistudio` service: `240`\n* `azureopenai` service and task type `text_embedding`: `1440`\n* `azureopenai` service and task type `completion`: `120`\n* `cohere` service: `10000`\n* `contextualai` service: `1000`\n* `elastic` service and task type `chat_completion`: `240`\n* `googleaistudio` service: `360`\n* `googlevertexai` service: `30000`\n* `hugging_face` service: `3000`\n* `jinaai` service: `2000`\n* `llama` service: `3000`\n* `mistral` service: `240`\n* `openai` service and task type `text_embedding`: `3000`\n* `openai` service and task type `completion`: `500`\n* `openshift_ai` service: `3000`\n* `voyageai` service: `2000`\n* `watsonxai` service: `120`', - }) - ), - }) - .register(z.globalRegistry, { - description: - 'This setting helps to minimize the number of rate limit errors returned from the service.', - }); +export const inference_types_rate_limit_setting = z.object({ + requests_per_minute: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of requests allowed per minute.\nBy default, the number of requests allowed per minute is set by each service as follows:\n\n* `alibabacloud-ai-search` service: `1000`\n* `anthropic` service: `50`\n* `azureaistudio` service: `240`\n* `azureopenai` service and task type `text_embedding`: `1440`\n* `azureopenai` service and task type `completion`: `120`\n* `cohere` service: `10000`\n* `contextualai` service: `1000`\n* `elastic` service and task type `chat_completion`: `240`\n* `googleaistudio` service: `360`\n* `googlevertexai` service: `30000`\n* `hugging_face` service: `3000`\n* `jinaai` service: `2000`\n* `llama` service: `3000`\n* `mistral` service: `240`\n* `openai` service and task type `text_embedding`: `3000`\n* `openai` service and task type `completion`: `500`\n* `openshift_ai` service: `3000`\n* `voyageai` service: `2000`\n* `watsonxai` service: `120`' + })) +}).register(z.globalRegistry, { + description: 'This setting helps to minimize the number of rate limit errors returned from the service.' +}); export const inference_types_ai21_service_settings = z.object({ - model_id: z.string().register(z.globalRegistry, { - description: - 'The name of the model to use for the inference task.\nRefer to the AI21 models documentation for the list of supported models and versions.\nService has been tested and confirmed to be working for `completion` and `chat_completion` tasks with the following models:\n* `jamba-mini`\n* `jamba-large`', - }), - api_key: z.optional( - z.string().register(z.globalRegistry, { - description: - 'A valid API key for accessing AI21 API.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.', - }) - ), - rate_limit: z.optional(inference_types_rate_limit_setting), + model_id: z.string().register(z.globalRegistry, { + description: 'The name of the model to use for the inference task.\nRefer to the AI21 models documentation for the list of supported models and versions.\nService has been tested and confirmed to be working for `completion` and `chat_completion` tasks with the following models:\n* `jamba-mini`\n* `jamba-large`' + }), + api_key: z.optional(z.string().register(z.globalRegistry, { + description: 'A valid API key for accessing AI21 API.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.' + })), + rate_limit: z.optional(inference_types_rate_limit_setting) }); export const inference_types_task_type_ai21 = z.enum(['completion', 'chat_completion']); -export const inference_types_inference_endpoint_info_ai21 = inference_types_inference_endpoint.and( - z.object({ +export const inference_types_inference_endpoint_info_ai21 = inference_types_inference_endpoint.and(z.object({ inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', + description: 'The inference Id' }), - task_type: inference_types_task_type_ai21, - }) -); + task_type: inference_types_task_type_ai21 +})); export const inference_types_alibaba_cloud_task_type = z.enum([ - 'completion', - 'rerank', - 'sparse_embedding', - 'text_embedding', + 'completion', + 'rerank', + 'sparse_embedding', + 'text_embedding' ]); export const inference_types_alibaba_cloud_service_type = z.enum(['alibabacloud-ai-search']); export const inference_types_alibaba_cloud_service_settings = z.object({ - api_key: z.string().register(z.globalRegistry, { - description: 'A valid API key for the AlibabaCloud AI Search API.', - }), - host: z.string().register(z.globalRegistry, { - description: - 'The name of the host address used for the inference task.\nYou can find the host address in the API keys section of the documentation.', - }), - rate_limit: z.optional(inference_types_rate_limit_setting), - service_id: z.string().register(z.globalRegistry, { - description: - 'The name of the model service to use for the inference task.\nThe following service IDs are available for the `completion` task:\n\n* `ops-qwen-turbo`\n* `qwen-turbo`\n* `qwen-plus`\n* `qwen-max ÷ qwen-max-longcontext`\n\nThe following service ID is available for the `rerank` task:\n\n* `ops-bge-reranker-larger`\n\nThe following service ID is available for the `sparse_embedding` task:\n\n* `ops-text-sparse-embedding-001`\n\nThe following service IDs are available for the `text_embedding` task:\n\n`ops-text-embedding-001`\n`ops-text-embedding-zh-001`\n`ops-text-embedding-en-001`\n`ops-text-embedding-002`', - }), - workspace: z.string().register(z.globalRegistry, { - description: 'The name of the workspace used for the inference task.', - }), + api_key: z.string().register(z.globalRegistry, { + description: 'A valid API key for the AlibabaCloud AI Search API.' + }), + host: z.string().register(z.globalRegistry, { + description: 'The name of the host address used for the inference task.\nYou can find the host address in the API keys section of the documentation.' + }), + rate_limit: z.optional(inference_types_rate_limit_setting), + service_id: z.string().register(z.globalRegistry, { + description: 'The name of the model service to use for the inference task.\nThe following service IDs are available for the `completion` task:\n\n* `ops-qwen-turbo`\n* `qwen-turbo`\n* `qwen-plus`\n* `qwen-max ÷ qwen-max-longcontext`\n\nThe following service ID is available for the `rerank` task:\n\n* `ops-bge-reranker-larger`\n\nThe following service ID is available for the `sparse_embedding` task:\n\n* `ops-text-sparse-embedding-001`\n\nThe following service IDs are available for the `text_embedding` task:\n\n`ops-text-embedding-001`\n`ops-text-embedding-zh-001`\n`ops-text-embedding-en-001`\n`ops-text-embedding-002`' + }), + workspace: z.string().register(z.globalRegistry, { + description: 'The name of the workspace used for the inference task.' + }) }); export const inference_types_alibaba_cloud_task_settings = z.object({ - input_type: z.optional( - z.string().register(z.globalRegistry, { - description: - 'For a `sparse_embedding` or `text_embedding` task, specify the type of input passed to the model.\nValid values are:\n\n* `ingest` for storing document embeddings in a vector database.\n* `search` for storing embeddings of search queries run against a vector database to find relevant documents.', - }) - ), - return_token: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'For a `sparse_embedding` task, it affects whether the token name will be returned in the response.\nIt defaults to `false`, which means only the token ID will be returned in the response.', - }) - ), + input_type: z.optional(z.string().register(z.globalRegistry, { + description: 'For a `sparse_embedding` or `text_embedding` task, specify the type of input passed to the model.\nValid values are:\n\n* `ingest` for storing document embeddings in a vector database.\n* `search` for storing embeddings of search queries run against a vector database to find relevant documents.' + })), + return_token: z.optional(z.boolean().register(z.globalRegistry, { + description: 'For a `sparse_embedding` task, it affects whether the token name will be returned in the response.\nIt defaults to `false`, which means only the token ID will be returned in the response.' + })) }); export const inference_types_task_type_alibaba_cloud_ai = z.enum([ - 'text_embedding', - 'rerank', - 'completion', - 'sparse_embedding', + 'text_embedding', + 'rerank', + 'completion', + 'sparse_embedding' ]); -export const inference_types_inference_endpoint_info_alibaba_cloud_ai = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_alibaba_cloud_ai, - }) - ); +export const inference_types_inference_endpoint_info_alibaba_cloud_ai = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_alibaba_cloud_ai +})); export const inference_types_amazon_bedrock_task_type = z.enum(['completion', 'text_embedding']); export const inference_types_amazon_bedrock_service_type = z.enum(['amazonbedrock']); export const inference_types_amazon_bedrock_service_settings = z.object({ - access_key: z.string().register(z.globalRegistry, { - description: - 'A valid AWS access key that has permissions to use Amazon Bedrock and access to models for inference requests.', - }), - model: z.string().register(z.globalRegistry, { - description: - 'The base model ID or an ARN to a custom model based on a foundational model.\nThe base model IDs can be found in the Amazon Bedrock documentation.\nNote that the model ID must be available for the provider chosen and your IAM user must have access to the model.', - }), - provider: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The model provider for your deployment.\nNote that some providers may support only certain task types.\nSupported providers include:\n\n* `amazontitan` - available for `text_embedding` and `completion` task types\n* `anthropic` - available for `completion` task type only\n* `ai21labs` - available for `completion` task type only\n* `cohere` - available for `text_embedding` and `completion` task types\n* `meta` - available for `completion` task type only\n* `mistral` - available for `completion` task type only', + access_key: z.string().register(z.globalRegistry, { + description: 'A valid AWS access key that has permissions to use Amazon Bedrock and access to models for inference requests.' + }), + model: z.string().register(z.globalRegistry, { + description: 'The base model ID or an ARN to a custom model based on a foundational model.\nThe base model IDs can be found in the Amazon Bedrock documentation.\nNote that the model ID must be available for the provider chosen and your IAM user must have access to the model.' + }), + provider: z.optional(z.string().register(z.globalRegistry, { + description: 'The model provider for your deployment.\nNote that some providers may support only certain task types.\nSupported providers include:\n\n* `amazontitan` - available for `text_embedding` and `completion` task types\n* `anthropic` - available for `completion` task type only\n* `ai21labs` - available for `completion` task type only\n* `cohere` - available for `text_embedding` and `completion` task types\n* `meta` - available for `completion` task type only\n* `mistral` - available for `completion` task type only' + })), + region: z.string().register(z.globalRegistry, { + description: 'The region that your model or ARN is deployed in.\nThe list of available regions per model can be found in the Amazon Bedrock documentation.' + }), + rate_limit: z.optional(inference_types_rate_limit_setting), + secret_key: z.string().register(z.globalRegistry, { + description: 'A valid AWS secret key that is paired with the `access_key`.\nFor informationg about creating and managing access and secret keys, refer to the AWS documentation.' }) - ), - region: z.string().register(z.globalRegistry, { - description: - 'The region that your model or ARN is deployed in.\nThe list of available regions per model can be found in the Amazon Bedrock documentation.', - }), - rate_limit: z.optional(inference_types_rate_limit_setting), - secret_key: z.string().register(z.globalRegistry, { - description: - 'A valid AWS secret key that is paired with the `access_key`.\nFor informationg about creating and managing access and secret keys, refer to the AWS documentation.', - }), }); export const inference_types_amazon_bedrock_task_settings = z.object({ - max_new_tokens: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For a `completion` task, it sets the maximum number for the output tokens to be generated.', - }) - ), - temperature: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For a `completion` task, it is a number between 0.0 and 1.0 that controls the apparent creativity of the results.\nAt temperature 0.0 the model is most deterministic, at temperature 1.0 most random.\nIt should not be used if `top_p` or `top_k` is specified.', - }) - ), - top_k: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For a `completion` task, it limits samples to the top-K most likely words, balancing coherence and variability.\nIt is only available for anthropic, cohere, and mistral providers.\nIt is an alternative to `temperature`; it should not be used if `temperature` is specified.', - }) - ), - top_p: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For a `completion` task, it is a number in the range of 0.0 to 1.0, to eliminate low-probability tokens.\nTop-p uses nucleus sampling to select top tokens whose sum of likelihoods does not exceed a certain value, ensuring both variety and coherence.\nIt is an alternative to `temperature`; it should not be used if `temperature` is specified.', - }) - ), + max_new_tokens: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `completion` task, it sets the maximum number for the output tokens to be generated.' + })), + temperature: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `completion` task, it is a number between 0.0 and 1.0 that controls the apparent creativity of the results.\nAt temperature 0.0 the model is most deterministic, at temperature 1.0 most random.\nIt should not be used if `top_p` or `top_k` is specified.' + })), + top_k: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `completion` task, it limits samples to the top-K most likely words, balancing coherence and variability.\nIt is only available for anthropic, cohere, and mistral providers.\nIt is an alternative to `temperature`; it should not be used if `temperature` is specified.' + })), + top_p: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `completion` task, it is a number in the range of 0.0 to 1.0, to eliminate low-probability tokens.\nTop-p uses nucleus sampling to select top tokens whose sum of likelihoods does not exceed a certain value, ensuring both variety and coherence.\nIt is an alternative to `temperature`; it should not be used if `temperature` is specified.' + })) }); export const inference_types_task_type_amazon_bedrock = z.enum(['text_embedding', 'completion']); -export const inference_types_inference_endpoint_info_amazon_bedrock = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_amazon_bedrock, - }) - ); +export const inference_types_inference_endpoint_info_amazon_bedrock = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_amazon_bedrock +})); export const inference_types_task_type_amazon_sage_maker = z.enum([ - 'text_embedding', - 'completion', - 'chat_completion', - 'sparse_embedding', - 'rerank', + 'text_embedding', + 'completion', + 'chat_completion', + 'sparse_embedding', + 'rerank' ]); export const inference_types_amazon_sage_maker_service_type = z.enum(['amazon_sagemaker']); @@ -16695,1313 +13881,1015 @@ export const inference_types_amazon_sage_maker_service_type = z.enum(['amazon_sa export const inference_types_amazon_sage_maker_api = z.enum(['openai', 'elastic']); export const inference_types_amazon_sage_maker_service_settings = z.object({ - access_key: z.string().register(z.globalRegistry, { - description: - 'A valid AWS access key that has permissions to use Amazon SageMaker and access to models for invoking requests.', - }), - endpoint_name: z.string().register(z.globalRegistry, { - description: 'The name of the SageMaker endpoint.', - }), - api: inference_types_amazon_sage_maker_api, - region: z.string().register(z.globalRegistry, { - description: - 'The region that your endpoint or Amazon Resource Name (ARN) is deployed in.\nThe list of available regions per model can be found in the Amazon SageMaker documentation.', - }), - secret_key: z.string().register(z.globalRegistry, { - description: - 'A valid AWS secret key that is paired with the `access_key`.\nFor information about creating and managing access and secret keys, refer to the AWS documentation.', - }), - target_model: z.optional( - z.string().register(z.globalRegistry, { - description: 'The model ID when calling a multi-model endpoint.', - }) - ), - target_container_hostname: z.optional( - z.string().register(z.globalRegistry, { - description: 'The container to directly invoke when calling a multi-container endpoint.', - }) - ), - inference_component_name: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The inference component to directly invoke when calling a multi-component endpoint.', - }) - ), - batch_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of inputs in each batch. This value is used by inference ingestion pipelines\nwhen processing semantic values. It correlates to the number of times the SageMaker endpoint is\ninvoked (one per batch of input).', - }) - ), - dimensions: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of dimensions returned by the text embedding models. If this value is not provided, then\nit is guessed by making invoking the endpoint for the `text_embedding` task.', - }) - ), + access_key: z.string().register(z.globalRegistry, { + description: 'A valid AWS access key that has permissions to use Amazon SageMaker and access to models for invoking requests.' + }), + endpoint_name: z.string().register(z.globalRegistry, { + description: 'The name of the SageMaker endpoint.' + }), + api: inference_types_amazon_sage_maker_api, + region: z.string().register(z.globalRegistry, { + description: 'The region that your endpoint or Amazon Resource Name (ARN) is deployed in.\nThe list of available regions per model can be found in the Amazon SageMaker documentation.' + }), + secret_key: z.string().register(z.globalRegistry, { + description: 'A valid AWS secret key that is paired with the `access_key`.\nFor information about creating and managing access and secret keys, refer to the AWS documentation.' + }), + target_model: z.optional(z.string().register(z.globalRegistry, { + description: 'The model ID when calling a multi-model endpoint.' + })), + target_container_hostname: z.optional(z.string().register(z.globalRegistry, { + description: 'The container to directly invoke when calling a multi-container endpoint.' + })), + inference_component_name: z.optional(z.string().register(z.globalRegistry, { + description: 'The inference component to directly invoke when calling a multi-component endpoint.' + })), + batch_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of inputs in each batch. This value is used by inference ingestion pipelines\nwhen processing semantic values. It correlates to the number of times the SageMaker endpoint is\ninvoked (one per batch of input).' + })), + dimensions: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of dimensions returned by the text embedding models. If this value is not provided, then\nit is guessed by making invoking the endpoint for the `text_embedding` task.' + })) }); export const inference_types_amazon_sage_maker_task_settings = z.object({ - custom_attributes: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The AWS custom attributes passed verbatim through to the model running in the SageMaker Endpoint.\nValues will be returned in the `X-elastic-sagemaker-custom-attributes` header.', - }) - ), - enable_explanations: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The optional JMESPath expression used to override the EnableExplanations provided during endpoint creation.', - }) - ), - inference_id: z.optional( - z.string().register(z.globalRegistry, { - description: 'The capture data ID when enabled in the endpoint.', - }) - ), - session_id: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The stateful session identifier for a new or existing session.\nNew sessions will be returned in the `X-elastic-sagemaker-new-session-id` header.\nClosed sessions will be returned in the `X-elastic-sagemaker-closed-session-id` header.', - }) - ), - target_variant: z.optional( - z.string().register(z.globalRegistry, { - description: 'Specifies the variant when running with multi-variant Endpoints.', - }) - ), -}); - -export const inference_types_inference_endpoint_info_amazon_sage_maker = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_amazon_sage_maker, - }) - ); + custom_attributes: z.optional(z.string().register(z.globalRegistry, { + description: 'The AWS custom attributes passed verbatim through to the model running in the SageMaker Endpoint.\nValues will be returned in the `X-elastic-sagemaker-custom-attributes` header.' + })), + enable_explanations: z.optional(z.string().register(z.globalRegistry, { + description: 'The optional JMESPath expression used to override the EnableExplanations provided during endpoint creation.' + })), + inference_id: z.optional(z.string().register(z.globalRegistry, { + description: 'The capture data ID when enabled in the endpoint.' + })), + session_id: z.optional(z.string().register(z.globalRegistry, { + description: 'The stateful session identifier for a new or existing session.\nNew sessions will be returned in the `X-elastic-sagemaker-new-session-id` header.\nClosed sessions will be returned in the `X-elastic-sagemaker-closed-session-id` header.' + })), + target_variant: z.optional(z.string().register(z.globalRegistry, { + description: 'Specifies the variant when running with multi-variant Endpoints.' + })) +}); + +export const inference_types_inference_endpoint_info_amazon_sage_maker = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_amazon_sage_maker +})); export const inference_types_anthropic_task_type = z.enum(['completion']); export const inference_types_anthropic_service_type = z.enum(['anthropic']); export const inference_types_anthropic_service_settings = z.object({ - api_key: z.string().register(z.globalRegistry, { - description: 'A valid API key for the Anthropic API.', - }), - model_id: z.string().register(z.globalRegistry, { - description: - 'The name of the model to use for the inference task.\nRefer to the Anthropic documentation for the list of supported models.', - }), - rate_limit: z.optional(inference_types_rate_limit_setting), + api_key: z.string().register(z.globalRegistry, { + description: 'A valid API key for the Anthropic API.' + }), + model_id: z.string().register(z.globalRegistry, { + description: 'The name of the model to use for the inference task.\nRefer to the Anthropic documentation for the list of supported models.' + }), + rate_limit: z.optional(inference_types_rate_limit_setting) }); export const inference_types_anthropic_task_settings = z.object({ - max_tokens: z.number().register(z.globalRegistry, { - description: - 'For a `completion` task, it is the maximum number of tokens to generate before stopping.', - }), - temperature: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For a `completion` task, it is the amount of randomness injected into the response.\nFor more details about the supported range, refer to Anthropic documentation.', - }) - ), - top_k: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For a `completion` task, it specifies to only sample from the top K options for each subsequent token.\nIt is recommended for advanced use cases only.\nYou usually only need to use `temperature`.', - }) - ), - top_p: z.optional( - z.number().register(z.globalRegistry, { - description: - "For a `completion` task, it specifies to use Anthropic's nucleus sampling.\nIn nucleus sampling, Anthropic computes the cumulative distribution over all the options for each subsequent token in decreasing probability order and cuts it off once it reaches the specified probability.\nYou should either alter `temperature` or `top_p`, but not both.\nIt is recommended for advanced use cases only.\nYou usually only need to use `temperature`.", - }) - ), + max_tokens: z.number().register(z.globalRegistry, { + description: 'For a `completion` task, it is the maximum number of tokens to generate before stopping.' + }), + temperature: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `completion` task, it is the amount of randomness injected into the response.\nFor more details about the supported range, refer to Anthropic documentation.' + })), + top_k: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `completion` task, it specifies to only sample from the top K options for each subsequent token.\nIt is recommended for advanced use cases only.\nYou usually only need to use `temperature`.' + })), + top_p: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `completion` task, it specifies to use Anthropic\'s nucleus sampling.\nIn nucleus sampling, Anthropic computes the cumulative distribution over all the options for each subsequent token in decreasing probability order and cuts it off once it reaches the specified probability.\nYou should either alter `temperature` or `top_p`, but not both.\nIt is recommended for advanced use cases only.\nYou usually only need to use `temperature`.' + })) }); export const inference_types_task_type_anthropic = z.enum(['completion']); -export const inference_types_inference_endpoint_info_anthropic = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_anthropic, - }) - ); +export const inference_types_inference_endpoint_info_anthropic = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_anthropic +})); export const inference_types_azure_ai_studio_task_type = z.enum([ - 'completion', - 'rerank', - 'text_embedding', + 'completion', + 'rerank', + 'text_embedding' ]); export const inference_types_azure_ai_studio_service_type = z.enum(['azureaistudio']); export const inference_types_azure_ai_studio_service_settings = z.object({ - api_key: z.string().register(z.globalRegistry, { - description: - 'A valid API key of your Azure AI Studio model deployment.\nThis key can be found on the overview page for your deployment in the management section of your Azure AI Studio account.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.', - }), - endpoint_type: z.string().register(z.globalRegistry, { - description: - 'The type of endpoint that is available for deployment through Azure AI Studio: `token` or `realtime`.\nThe `token` endpoint type is for "pay as you go" endpoints that are billed per token.\nThe `realtime` endpoint type is for "real-time" endpoints that are billed per hour of usage.', - }), - target: z.string().register(z.globalRegistry, { - description: - 'The target URL of your Azure AI Studio model deployment.\nThis can be found on the overview page for your deployment in the management section of your Azure AI Studio account.', - }), - provider: z.string().register(z.globalRegistry, { - description: - 'The model provider for your deployment.\nNote that some providers may support only certain task types.\nSupported providers include:\n\n* `cohere` - available for `text_embedding`, `rerank` and `completion` task types\n* `databricks` - available for `completion` task type only\n* `meta` - available for `completion` task type only\n* `microsoft_phi` - available for `completion` task type only\n* `mistral` - available for `completion` task type only\n* `openai` - available for `text_embedding` and `completion` task types', - }), - rate_limit: z.optional(inference_types_rate_limit_setting), + api_key: z.string().register(z.globalRegistry, { + description: 'A valid API key of your Azure AI Studio model deployment.\nThis key can be found on the overview page for your deployment in the management section of your Azure AI Studio account.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.' + }), + endpoint_type: z.string().register(z.globalRegistry, { + description: 'The type of endpoint that is available for deployment through Azure AI Studio: `token` or `realtime`.\nThe `token` endpoint type is for "pay as you go" endpoints that are billed per token.\nThe `realtime` endpoint type is for "real-time" endpoints that are billed per hour of usage.' + }), + target: z.string().register(z.globalRegistry, { + description: 'The target URL of your Azure AI Studio model deployment.\nThis can be found on the overview page for your deployment in the management section of your Azure AI Studio account.' + }), + provider: z.string().register(z.globalRegistry, { + description: 'The model provider for your deployment.\nNote that some providers may support only certain task types.\nSupported providers include:\n\n* `cohere` - available for `text_embedding`, `rerank` and `completion` task types\n* `databricks` - available for `completion` task type only\n* `meta` - available for `completion` task type only\n* `microsoft_phi` - available for `completion` task type only\n* `mistral` - available for `completion` task type only\n* `openai` - available for `text_embedding` and `completion` task types' + }), + rate_limit: z.optional(inference_types_rate_limit_setting) }); export const inference_types_azure_ai_studio_task_settings = z.object({ - do_sample: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For a `completion` task, instruct the inference process to perform sampling.\nIt has no effect unless `temperature` or `top_p` is specified.', - }) - ), - max_new_tokens: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For a `completion` task, provide a hint for the maximum number of output tokens to be generated.', - }) - ), - temperature: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For a `completion` task, control the apparent creativity of generated completions with a sampling temperature.\nIt must be a number in the range of 0.0 to 2.0.\nIt should not be used if `top_p` is specified.', - }) - ), - top_p: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For a `completion` task, make the model consider the results of the tokens with nucleus sampling probability.\nIt is an alternative value to `temperature` and must be a number in the range of 0.0 to 2.0.\nIt should not be used if `temperature` is specified.', - }) - ), - user: z.optional( - z.string().register(z.globalRegistry, { - description: - 'For a `text_embedding` task, specify the user issuing the request.\nThis information can be used for abuse detection.', - }) - ), - return_documents: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'For a `rerank` task, return doc text within the results.', - }) - ), - top_n: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For a `rerank` task, the number of most relevant documents to return.\nIt defaults to the number of the documents.', - }) - ), + do_sample: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `completion` task, instruct the inference process to perform sampling.\nIt has no effect unless `temperature` or `top_p` is specified.' + })), + max_new_tokens: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `completion` task, provide a hint for the maximum number of output tokens to be generated.' + })), + temperature: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `completion` task, control the apparent creativity of generated completions with a sampling temperature.\nIt must be a number in the range of 0.0 to 2.0.\nIt should not be used if `top_p` is specified.' + })), + top_p: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `completion` task, make the model consider the results of the tokens with nucleus sampling probability.\nIt is an alternative value to `temperature` and must be a number in the range of 0.0 to 2.0.\nIt should not be used if `temperature` is specified.' + })), + user: z.optional(z.string().register(z.globalRegistry, { + description: 'For a `text_embedding` task, specify the user issuing the request.\nThis information can be used for abuse detection.' + })), + return_documents: z.optional(z.boolean().register(z.globalRegistry, { + description: 'For a `rerank` task, return doc text within the results.' + })), + top_n: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `rerank` task, the number of most relevant documents to return.\nIt defaults to the number of the documents.' + })) }); export const inference_types_task_type_azure_ai_studio = z.enum([ - 'text_embedding', - 'completion', - 'rerank', + 'text_embedding', + 'completion', + 'rerank' ]); -export const inference_types_inference_endpoint_info_azure_ai_studio = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_azure_ai_studio, - }) - ); +export const inference_types_inference_endpoint_info_azure_ai_studio = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_azure_ai_studio +})); export const inference_types_azure_open_ai_task_type = z.enum(['completion', 'text_embedding']); export const inference_types_azure_open_ai_service_type = z.enum(['azureopenai']); export const inference_types_azure_open_ai_service_settings = z.object({ - api_key: z.optional( - z.string().register(z.globalRegistry, { - description: - 'A valid API key for your Azure OpenAI account.\nYou must specify either `api_key` or `entra_id`.\nIf you do not provide either or you provide both, you will receive an error when you try to create your model.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.', - }) - ), - api_version: z.string().register(z.globalRegistry, { - description: - 'The Azure API version ID to use.\nIt is recommended to use the latest supported non-preview version.', - }), - deployment_id: z.string().register(z.globalRegistry, { - description: - 'The deployment name of your deployed models.\nYour Azure OpenAI deployments can be found though the Azure OpenAI Studio portal that is linked to your subscription.', - }), - entra_id: z.optional( - z.string().register(z.globalRegistry, { - description: - 'A valid Microsoft Entra token.\nYou must specify either `api_key` or `entra_id`.\nIf you do not provide either or you provide both, you will receive an error when you try to create your model.', + api_key: z.optional(z.string().register(z.globalRegistry, { + description: 'A valid API key for your Azure OpenAI account.\nYou must specify either `api_key` or `entra_id`.\nIf you do not provide either or you provide both, you will receive an error when you try to create your model.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.' + })), + api_version: z.string().register(z.globalRegistry, { + description: 'The Azure API version ID to use.\nIt is recommended to use the latest supported non-preview version.' + }), + deployment_id: z.string().register(z.globalRegistry, { + description: 'The deployment name of your deployed models.\nYour Azure OpenAI deployments can be found though the Azure OpenAI Studio portal that is linked to your subscription.' + }), + entra_id: z.optional(z.string().register(z.globalRegistry, { + description: 'A valid Microsoft Entra token.\nYou must specify either `api_key` or `entra_id`.\nIf you do not provide either or you provide both, you will receive an error when you try to create your model.' + })), + rate_limit: z.optional(inference_types_rate_limit_setting), + resource_name: z.string().register(z.globalRegistry, { + description: 'The name of your Azure OpenAI resource.\nYou can find this from the list of resources in the Azure Portal for your subscription.' }) - ), - rate_limit: z.optional(inference_types_rate_limit_setting), - resource_name: z.string().register(z.globalRegistry, { - description: - 'The name of your Azure OpenAI resource.\nYou can find this from the list of resources in the Azure Portal for your subscription.', - }), }); export const inference_types_azure_open_ai_task_settings = z.object({ - user: z.optional( - z.string().register(z.globalRegistry, { - description: - 'For a `completion` or `text_embedding` task, specify the user issuing the request.\nThis information can be used for abuse detection.', - }) - ), + user: z.optional(z.string().register(z.globalRegistry, { + description: 'For a `completion` or `text_embedding` task, specify the user issuing the request.\nThis information can be used for abuse detection.' + })) }); export const inference_types_task_type_azure_open_ai = z.enum(['text_embedding', 'completion']); -export const inference_types_inference_endpoint_info_azure_open_ai = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_azure_open_ai, - }) - ); +export const inference_types_inference_endpoint_info_azure_open_ai = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_azure_open_ai +})); -export const inference_types_cohere_task_type = z.enum(['completion', 'rerank', 'text_embedding']); +export const inference_types_cohere_task_type = z.enum([ + 'completion', + 'rerank', + 'text_embedding' +]); export const inference_types_cohere_service_type = z.enum(['cohere']); export const inference_types_cohere_embedding_type = z.enum([ - 'binary', - 'bit', - 'byte', - 'float', - 'int8', + 'binary', + 'bit', + 'byte', + 'float', + 'int8' ]); -export const inference_types_cohere_similarity_type = z.enum(['cosine', 'dot_product', 'l2_norm']); +export const inference_types_cohere_similarity_type = z.enum([ + 'cosine', + 'dot_product', + 'l2_norm' +]); export const inference_types_cohere_service_settings = z.object({ - api_key: z.string().register(z.globalRegistry, { - description: - 'A valid API key for your Cohere account.\nYou can find or create your Cohere API keys on the Cohere API key settings page.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.', - }), - embedding_type: z.optional(inference_types_cohere_embedding_type), - model_id: z.string().register(z.globalRegistry, { - description: - 'For a `completion`, `rerank`, or `text_embedding` task, the name of the model to use for the inference task.\n\n* For the available `completion` models, refer to the [Cohere command docs](https://docs.cohere.com/docs/models#command).\n* For the available `rerank` models, refer to the [Cohere rerank docs](https://docs.cohere.com/reference/rerank-1).\n* For the available `text_embedding` models, refer to [Cohere embed docs](https://docs.cohere.com/reference/embed).', - }), - rate_limit: z.optional(inference_types_rate_limit_setting), - similarity: z.optional(inference_types_cohere_similarity_type), + api_key: z.string().register(z.globalRegistry, { + description: 'A valid API key for your Cohere account.\nYou can find or create your Cohere API keys on the Cohere API key settings page.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.' + }), + embedding_type: z.optional(inference_types_cohere_embedding_type), + model_id: z.string().register(z.globalRegistry, { + description: 'For a `completion`, `rerank`, or `text_embedding` task, the name of the model to use for the inference task.\n\n* For the available `completion` models, refer to the [Cohere command docs](https://docs.cohere.com/docs/models#command).\n* For the available `rerank` models, refer to the [Cohere rerank docs](https://docs.cohere.com/reference/rerank-1).\n* For the available `text_embedding` models, refer to [Cohere embed docs](https://docs.cohere.com/reference/embed).' + }), + rate_limit: z.optional(inference_types_rate_limit_setting), + similarity: z.optional(inference_types_cohere_similarity_type) }); export const inference_types_cohere_input_type = z.enum([ - 'classification', - 'clustering', - 'ingest', - 'search', + 'classification', + 'clustering', + 'ingest', + 'search' ]); -export const inference_types_cohere_truncate_type = z.enum(['END', 'NONE', 'START']); +export const inference_types_cohere_truncate_type = z.enum([ + 'END', + 'NONE', + 'START' +]); export const inference_types_cohere_task_settings = z.object({ - input_type: inference_types_cohere_input_type, - return_documents: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'For a `rerank` task, return doc text within the results.', - }) - ), - top_n: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For a `rerank` task, the number of most relevant documents to return.\nIt defaults to the number of the documents.\nIf this inference endpoint is used in a `text_similarity_reranker` retriever query and `top_n` is set, it must be greater than or equal to `rank_window_size` in the query.', - }) - ), - truncate: z.optional(inference_types_cohere_truncate_type), + input_type: inference_types_cohere_input_type, + return_documents: z.optional(z.boolean().register(z.globalRegistry, { + description: 'For a `rerank` task, return doc text within the results.' + })), + top_n: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `rerank` task, the number of most relevant documents to return.\nIt defaults to the number of the documents.\nIf this inference endpoint is used in a `text_similarity_reranker` retriever query and `top_n` is set, it must be greater than or equal to `rank_window_size` in the query.' + })), + truncate: z.optional(inference_types_cohere_truncate_type) }); -export const inference_types_task_type_cohere = z.enum(['text_embedding', 'rerank', 'completion']); +export const inference_types_task_type_cohere = z.enum([ + 'text_embedding', + 'rerank', + 'completion' +]); -export const inference_types_inference_endpoint_info_cohere = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_cohere, - }) - ); +export const inference_types_inference_endpoint_info_cohere = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_cohere +})); export const inference_types_task_type_contextual_ai = z.enum(['rerank']); export const inference_types_contextual_ai_service_type = z.enum(['contextualai']); export const inference_types_contextual_ai_service_settings = z.object({ - api_key: z.string().register(z.globalRegistry, { - description: - 'A valid API key for your Contexutual AI account.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.', - }), - model_id: z.string().register(z.globalRegistry, { - description: - 'The name of the model to use for the inference task.\nRefer to the Contextual AI documentation for the list of available rerank models.', - }), - rate_limit: z.optional(inference_types_rate_limit_setting), + api_key: z.string().register(z.globalRegistry, { + description: 'A valid API key for your Contexutual AI account.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.' + }), + model_id: z.string().register(z.globalRegistry, { + description: 'The name of the model to use for the inference task.\nRefer to the Contextual AI documentation for the list of available rerank models.' + }), + rate_limit: z.optional(inference_types_rate_limit_setting) }); export const inference_types_contextual_ai_task_settings = z.object({ - instruction: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Instructions for the reranking model. Refer to \nOnly for the `rerank` task type.', - }) - ), - return_documents: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to return the source documents in the response.\nOnly for the `rerank` task type.', - }) - ), - top_k: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of most relevant documents to return.\nIf not specified, the reranking results of all documents will be returned.\nOnly for the `rerank` task type.', - }) - ), -}); - -export const inference_types_inference_endpoint_info_contextual_ai = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_contextual_ai, - }) - ); + instruction: z.optional(z.string().register(z.globalRegistry, { + description: 'Instructions for the reranking model. Refer to \nOnly for the `rerank` task type.' + })), + return_documents: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to return the source documents in the response.\nOnly for the `rerank` task type.' + })), + top_k: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of most relevant documents to return.\nIf not specified, the reranking results of all documents will be returned.\nOnly for the `rerank` task type.' + })) +}); + +export const inference_types_inference_endpoint_info_contextual_ai = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_contextual_ai +})); export const inference_types_custom_task_type = z.enum([ - 'text_embedding', - 'sparse_embedding', - 'rerank', - 'completion', + 'text_embedding', + 'sparse_embedding', + 'rerank', + 'completion' ]); export const inference_types_custom_service_type = z.enum(['custom']); export const inference_types_custom_request_params = z.object({ - content: z.string().register(z.globalRegistry, { - description: - 'The body structure of the request. It requires passing in the string-escaped result of the JSON format HTTP request body.\nFor example:\n```\n"request": "{\\"input\\":${input}}"\n```\n> info\n> The content string needs to be a single line except when using the Kibana console.', - }), + content: z.string().register(z.globalRegistry, { + description: 'The body structure of the request. It requires passing in the string-escaped result of the JSON format HTTP request body.\nFor example:\n```\n"request": "{\\"input\\":${input}}"\n```\n> info\n> The content string needs to be a single line except when using the Kibana console.' + }) }); export const inference_types_custom_response_params = z.object({ - json_parser: z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'Specifies the JSON parser that is used to parse the response from the custom service.\nDifferent task types require different json_parser parameters.\nFor example:\n```\n# text_embedding\n# For a response like this:\n\n{\n "object": "list",\n "data": [\n {\n "object": "embedding",\n "index": 0,\n "embedding": [\n 0.014539449,\n -0.015288644\n ]\n }\n ],\n "model": "text-embedding-ada-002-v2",\n "usage": {\n "prompt_tokens": 8,\n "total_tokens": 8\n }\n}\n\n# the json_parser definition should look like this:\n\n"response":{\n "json_parser":{\n "text_embeddings":"$.data[*].embedding[*]"\n }\n}\n\n# Elasticsearch supports the following embedding types:\n* float\n* byte\n* bit (or binary)\n\nTo specify the embedding type for the response, the `embedding_type`\nfield should be added in the `json_parser` object. Here\'s an example:\n"response":{\n "json_parser":{\n "text_embeddings":"$.data[*].embedding[*]",\n "embedding_type":"bit"\n }\n}\n\nIf `embedding_type` is not specified, it defaults to `float`.\n\n# sparse_embedding\n# For a response like this:\n\n{\n "request_id": "75C50B5B-E79E-4930-****-F48DBB392231",\n "latency": 22,\n "usage": {\n "token_count": 11\n },\n "result": {\n "sparse_embeddings": [\n {\n "index": 0,\n "embedding": [\n {\n "token_id": 6,\n "weight": 0.101\n },\n {\n "token_id": 163040,\n "weight": 0.28417\n }\n ]\n }\n ]\n }\n}\n\n# the json_parser definition should look like this:\n\n"response":{\n "json_parser":{\n "token_path":"$.result.sparse_embeddings[*].embedding[*].token_id",\n "weight_path":"$.result.sparse_embeddings[*].embedding[*].weight"\n }\n}\n\n# rerank\n# For a response like this:\n\n{\n "results": [\n {\n "index": 3,\n "relevance_score": 0.999071,\n "document": "abc"\n },\n {\n "index": 4,\n "relevance_score": 0.7867867,\n "document": "123"\n },\n {\n "index": 0,\n "relevance_score": 0.32713068,\n "document": "super"\n }\n ],\n}\n\n# the json_parser definition should look like this:\n\n"response":{\n "json_parser":{\n "reranked_index":"$.result.scores[*].index", // optional\n "relevance_score":"$.result.scores[*].score",\n "document_text":"xxx" // optional\n }\n}\n\n# completion\n# For a response like this:\n\n{\n "id": "chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT",\n "object": "chat.completion",\n "created": 1741569952,\n "model": "gpt-4.1-2025-04-14",\n "choices": [\n {\n "index": 0,\n "message": {\n "role": "assistant",\n "content": "Hello! How can I assist you today?",\n "refusal": null,\n "annotations": []\n },\n "logprobs": null,\n "finish_reason": "stop"\n }\n ]\n}\n\n# the json_parser definition should look like this:\n\n"response":{\n "json_parser":{\n "completion_result":"$.choices[*].message.content"\n }\n}', - }), + json_parser: z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'Specifies the JSON parser that is used to parse the response from the custom service.\nDifferent task types require different json_parser parameters.\nFor example:\n```\n# text_embedding\n# For a response like this:\n\n{\n "object": "list",\n "data": [\n {\n "object": "embedding",\n "index": 0,\n "embedding": [\n 0.014539449,\n -0.015288644\n ]\n }\n ],\n "model": "text-embedding-ada-002-v2",\n "usage": {\n "prompt_tokens": 8,\n "total_tokens": 8\n }\n}\n\n# the json_parser definition should look like this:\n\n"response":{\n "json_parser":{\n "text_embeddings":"$.data[*].embedding[*]"\n }\n}\n\n# Elasticsearch supports the following embedding types:\n* float\n* byte\n* bit (or binary)\n\nTo specify the embedding type for the response, the `embedding_type`\nfield should be added in the `json_parser` object. Here\'s an example:\n"response":{\n "json_parser":{\n "text_embeddings":"$.data[*].embedding[*]",\n "embedding_type":"bit"\n }\n}\n\nIf `embedding_type` is not specified, it defaults to `float`.\n\n# sparse_embedding\n# For a response like this:\n\n{\n "request_id": "75C50B5B-E79E-4930-****-F48DBB392231",\n "latency": 22,\n "usage": {\n "token_count": 11\n },\n "result": {\n "sparse_embeddings": [\n {\n "index": 0,\n "embedding": [\n {\n "token_id": 6,\n "weight": 0.101\n },\n {\n "token_id": 163040,\n "weight": 0.28417\n }\n ]\n }\n ]\n }\n}\n\n# the json_parser definition should look like this:\n\n"response":{\n "json_parser":{\n "token_path":"$.result.sparse_embeddings[*].embedding[*].token_id",\n "weight_path":"$.result.sparse_embeddings[*].embedding[*].weight"\n }\n}\n\n# rerank\n# For a response like this:\n\n{\n "results": [\n {\n "index": 3,\n "relevance_score": 0.999071,\n "document": "abc"\n },\n {\n "index": 4,\n "relevance_score": 0.7867867,\n "document": "123"\n },\n {\n "index": 0,\n "relevance_score": 0.32713068,\n "document": "super"\n }\n ],\n}\n\n# the json_parser definition should look like this:\n\n"response":{\n "json_parser":{\n "reranked_index":"$.result.scores[*].index", // optional\n "relevance_score":"$.result.scores[*].score",\n "document_text":"xxx" // optional\n }\n}\n\n# completion\n# For a response like this:\n\n{\n "id": "chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT",\n "object": "chat.completion",\n "created": 1741569952,\n "model": "gpt-4.1-2025-04-14",\n "choices": [\n {\n "index": 0,\n "message": {\n "role": "assistant",\n "content": "Hello! How can I assist you today?",\n "refusal": null,\n "annotations": []\n },\n "logprobs": null,\n "finish_reason": "stop"\n }\n ]\n}\n\n# the json_parser definition should look like this:\n\n"response":{\n "json_parser":{\n "completion_result":"$.choices[*].message.content"\n }\n}' + }) }); export const inference_types_custom_service_settings = z.object({ - batch_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Specifies the batch size used for the semantic_text field. If the field is not provided, the default is 10.\nThe batch size is the maximum number of inputs in a single request to the upstream service.\nThe chunk within the batch are controlled by the selected chunking strategy for the semantic_text field.', - }) - ), - headers: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'Specifies the HTTP header parameters – such as `Authentication` or `Content-Type` – that are required to access the custom service.\nFor example:\n```\n"headers":{\n "Authorization": "Bearer ${api_key}",\n "Content-Type": "application/json;charset=utf-8"\n}\n```', - }) - ), - input_type: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'Specifies the input type translation values that are used to replace the `${input_type}` template in the request body.\nFor example:\n```\n"input_type": {\n "translation": {\n "ingest": "do_ingest",\n "search": "do_search"\n },\n "default": "a_default"\n},\n```\nIf the subsequent inference requests come from a search context, the `search` key will be used and the template will be replaced with `do_search`.\nIf it comes from the ingest context `do_ingest` is used. If it\'s a different context that is not specified, the default value will be used. If no default is specified an empty string is used.\n`translation` can be:\n* `classification`\n* `clustering`\n* `ingest`\n* `search`', - }) - ), - query_parameters: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'Specifies the query parameters as a list of tuples. The arrays inside the `query_parameters` must have two items, a key and a value.\nFor example:\n```\n"query_parameters":[\n ["param_key", "some_value"],\n ["param_key", "another_value"],\n ["other_key", "other_value"]\n]\n```\nIf the base url is `https://www.elastic.co` it results in: `https://www.elastic.co?param_key=some_value¶m_key=another_value&other_key=other_value`.', - }) - ), - request: inference_types_custom_request_params, - response: inference_types_custom_response_params, - secret_parameters: z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'Specifies secret parameters, like `api_key` or `api_token`, that are required to access the custom service.\nFor example:\n```\n"secret_parameters":{\n "api_key":""\n}\n```', - }), - url: z.optional( - z.string().register(z.globalRegistry, { - description: 'The URL endpoint to use for the requests.', - }) - ), + batch_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the batch size used for the semantic_text field. If the field is not provided, the default is 10.\nThe batch size is the maximum number of inputs in a single request to the upstream service.\nThe chunk within the batch are controlled by the selected chunking strategy for the semantic_text field.' + })), + headers: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'Specifies the HTTP header parameters – such as `Authentication` or `Content-Type` – that are required to access the custom service.\nFor example:\n```\n"headers":{\n "Authorization": "Bearer ${api_key}",\n "Content-Type": "application/json;charset=utf-8"\n}\n```' + })), + input_type: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'Specifies the input type translation values that are used to replace the `${input_type}` template in the request body.\nFor example:\n```\n"input_type": {\n "translation": {\n "ingest": "do_ingest",\n "search": "do_search"\n },\n "default": "a_default"\n},\n```\nIf the subsequent inference requests come from a search context, the `search` key will be used and the template will be replaced with `do_search`.\nIf it comes from the ingest context `do_ingest` is used. If it\'s a different context that is not specified, the default value will be used. If no default is specified an empty string is used.\n`translation` can be:\n* `classification`\n* `clustering`\n* `ingest`\n* `search`' + })), + query_parameters: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'Specifies the query parameters as a list of tuples. The arrays inside the `query_parameters` must have two items, a key and a value.\nFor example:\n```\n"query_parameters":[\n ["param_key", "some_value"],\n ["param_key", "another_value"],\n ["other_key", "other_value"]\n]\n```\nIf the base url is `https://www.elastic.co` it results in: `https://www.elastic.co?param_key=some_value¶m_key=another_value&other_key=other_value`.' + })), + request: inference_types_custom_request_params, + response: inference_types_custom_response_params, + secret_parameters: z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'Specifies secret parameters, like `api_key` or `api_token`, that are required to access the custom service.\nFor example:\n```\n"secret_parameters":{\n "api_key":""\n}\n```' + }), + url: z.optional(z.string().register(z.globalRegistry, { + description: 'The URL endpoint to use for the requests.' + })) }); export const inference_types_custom_task_settings = z.object({ - parameters: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'Specifies parameters that are required to run the custom service. The parameters depend on the model your custom service uses.\nFor example:\n```\n"task_settings":{\n "parameters":{\n "input_type":"query",\n "return_token":true\n }\n}\n```', - }) - ), + parameters: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'Specifies parameters that are required to run the custom service. The parameters depend on the model your custom service uses.\nFor example:\n```\n"task_settings":{\n "parameters":{\n "input_type":"query",\n "return_token":true\n }\n}\n```' + })) }); export const inference_types_task_type_custom = z.enum([ - 'text_embedding', - 'sparse_embedding', - 'rerank', - 'completion', + 'text_embedding', + 'sparse_embedding', + 'rerank', + 'completion' ]); -export const inference_types_inference_endpoint_info_custom = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_custom, - }) - ); +export const inference_types_inference_endpoint_info_custom = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_custom +})); export const inference_types_task_type_deep_seek = z.enum(['completion', 'chat_completion']); export const inference_types_deep_seek_service_type = z.enum(['deepseek']); export const inference_types_deep_seek_service_settings = z.object({ - api_key: z.string().register(z.globalRegistry, { - description: - 'A valid API key for your DeepSeek account.\nYou can find or create your DeepSeek API keys on the DeepSeek API key page.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.', - }), - model_id: z.string().register(z.globalRegistry, { - description: - 'For a `completion` or `chat_completion` task, the name of the model to use for the inference task.\n\nFor the available `completion` and `chat_completion` models, refer to the [DeepSeek Models & Pricing docs](https://api-docs.deepseek.com/quick_start/pricing).', - }), - url: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The URL endpoint to use for the requests. Defaults to `https://api.deepseek.com/chat/completions`.', - }) - ), + api_key: z.string().register(z.globalRegistry, { + description: 'A valid API key for your DeepSeek account.\nYou can find or create your DeepSeek API keys on the DeepSeek API key page.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.' + }), + model_id: z.string().register(z.globalRegistry, { + description: 'For a `completion` or `chat_completion` task, the name of the model to use for the inference task.\n\nFor the available `completion` and `chat_completion` models, refer to the [DeepSeek Models & Pricing docs](https://api-docs.deepseek.com/quick_start/pricing).' + }), + url: z.optional(z.string().register(z.globalRegistry, { + description: 'The URL endpoint to use for the requests. Defaults to `https://api.deepseek.com/chat/completions`.' + })) }); -export const inference_types_inference_endpoint_info_deep_seek = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_deep_seek, - }) - ); +export const inference_types_inference_endpoint_info_deep_seek = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_deep_seek +})); export const inference_types_elasticsearch_task_type = z.enum([ - 'rerank', - 'sparse_embedding', - 'text_embedding', + 'rerank', + 'sparse_embedding', + 'text_embedding' ]); export const inference_types_elasticsearch_service_type = z.enum(['elasticsearch']); export const inference_types_adaptive_allocations = z.object({ - enabled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Turn on `adaptive_allocations`.', - }) - ), - max_number_of_allocations: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of allocations to scale to.\nIf set, it must be greater than or equal to `min_number_of_allocations`.', - }) - ), - min_number_of_allocations: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The minimum number of allocations to scale to.\nIf set, it must be greater than or equal to 0.\nIf not defined, the deployment scales to 0.', - }) - ), + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Turn on `adaptive_allocations`.' + })), + max_number_of_allocations: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of allocations to scale to.\nIf set, it must be greater than or equal to `min_number_of_allocations`.' + })), + min_number_of_allocations: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum number of allocations to scale to.\nIf set, it must be greater than or equal to 0.\nIf not defined, the deployment scales to 0.' + })) }); export const inference_types_elasticsearch_service_settings = z.object({ - adaptive_allocations: z.optional(inference_types_adaptive_allocations), - deployment_id: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The deployment identifier for a trained model deployment.\nWhen `deployment_id` is used the `model_id` is optional.', - }) - ), - model_id: z.string().register(z.globalRegistry, { - description: - 'The name of the model to use for the inference task.\nIt can be the ID of a built-in model (for example, `.multilingual-e5-small` for E5) or a text embedding model that was uploaded by using the Eland client.', - }), - num_allocations: z.optional( - z.number().register(z.globalRegistry, { - description: - "The total number of allocations that are assigned to the model across machine learning nodes.\nIncreasing this value generally increases the throughput.\nIf adaptive allocations are enabled, do not set this value because it's automatically set.", - }) - ), - num_threads: z.number().register(z.globalRegistry, { - description: - 'The number of threads used by each model allocation during inference.\nThis setting generally increases the speed per inference request.\nThe inference process is a compute-bound process; `threads_per_allocations` must not exceed the number of available allocated processors per node.\nThe value must be a power of 2.\nThe maximum value is 32.', - }), - long_document_strategy: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Available only for the `rerank` task type using the Elastic reranker model.\nControls the strategy used for processing long documents during inference.\n\nPossible values:\n- `truncate` (default): Processes only the beginning of each document.\n- `chunk`: Splits long documents into smaller parts (chunks) before inference.\n\nWhen `long_document_strategy` is set to `chunk`, Elasticsearch splits each document into smaller parts but still returns a single score per document.\nThat score reflects the highest relevance score among all chunks.', - }) - ), - max_chunks_per_doc: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Only for the `rerank` task type.\nLimits the number of chunks per document that are sent for inference when chunking is enabled.\nIf not set, all chunks generated for the document are processed.', - }) - ), + adaptive_allocations: z.optional(inference_types_adaptive_allocations), + deployment_id: z.optional(z.string().register(z.globalRegistry, { + description: 'The deployment identifier for a trained model deployment.\nWhen `deployment_id` is used the `model_id` is optional.' + })), + model_id: z.string().register(z.globalRegistry, { + description: 'The name of the model to use for the inference task.\nIt can be the ID of a built-in model (for example, `.multilingual-e5-small` for E5) or a text embedding model that was uploaded by using the Eland client.' + }), + num_allocations: z.optional(z.number().register(z.globalRegistry, { + description: 'The total number of allocations that are assigned to the model across machine learning nodes.\nIncreasing this value generally increases the throughput.\nIf adaptive allocations are enabled, do not set this value because it\'s automatically set.' + })), + num_threads: z.number().register(z.globalRegistry, { + description: 'The number of threads used by each model allocation during inference.\nThis setting generally increases the speed per inference request.\nThe inference process is a compute-bound process; `threads_per_allocations` must not exceed the number of available allocated processors per node.\nThe value must be a power of 2.\nThe maximum value is 32.' + }), + long_document_strategy: z.optional(z.string().register(z.globalRegistry, { + description: 'Available only for the `rerank` task type using the Elastic reranker model.\nControls the strategy used for processing long documents during inference.\n\nPossible values:\n- `truncate` (default): Processes only the beginning of each document.\n- `chunk`: Splits long documents into smaller parts (chunks) before inference.\n\nWhen `long_document_strategy` is set to `chunk`, Elasticsearch splits each document into smaller parts but still returns a single score per document.\nThat score reflects the highest relevance score among all chunks.' + })), + max_chunks_per_doc: z.optional(z.number().register(z.globalRegistry, { + description: 'Only for the `rerank` task type.\nLimits the number of chunks per document that are sent for inference when chunking is enabled.\nIf not set, all chunks generated for the document are processed.' + })) }); export const inference_types_elasticsearch_task_settings = z.object({ - return_documents: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'For a `rerank` task, return the document instead of only the index.', - }) - ), + return_documents: z.optional(z.boolean().register(z.globalRegistry, { + description: 'For a `rerank` task, return the document instead of only the index.' + })) }); export const inference_types_task_type_elasticsearch = z.enum([ - 'sparse_embedding', - 'text_embedding', - 'rerank', + 'sparse_embedding', + 'text_embedding', + 'rerank' ]); -export const inference_types_inference_endpoint_info_elasticsearch = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_elasticsearch, - }) - ); +export const inference_types_inference_endpoint_info_elasticsearch = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_elasticsearch +})); export const inference_types_elser_task_type = z.enum(['sparse_embedding']); export const inference_types_elser_service_type = z.enum(['elser']); export const inference_types_elser_service_settings = z.object({ - adaptive_allocations: z.optional(inference_types_adaptive_allocations), - num_allocations: z.number().register(z.globalRegistry, { - description: - "The total number of allocations this model is assigned across machine learning nodes.\nIncreasing this value generally increases the throughput.\nIf adaptive allocations is enabled, do not set this value because it's automatically set.", - }), - num_threads: z.number().register(z.globalRegistry, { - description: - 'The number of threads used by each model allocation during inference.\nIncreasing this value generally increases the speed per inference request.\nThe inference process is a compute-bound process; `threads_per_allocations` must not exceed the number of available allocated processors per node.\nThe value must be a power of 2.\nThe maximum value is 32.\n\n> info\n> If you want to optimize your ELSER endpoint for ingest, set the number of threads to 1. If you want to optimize your ELSER endpoint for search, set the number of threads to greater than 1.', - }), + adaptive_allocations: z.optional(inference_types_adaptive_allocations), + num_allocations: z.number().register(z.globalRegistry, { + description: 'The total number of allocations this model is assigned across machine learning nodes.\nIncreasing this value generally increases the throughput.\nIf adaptive allocations is enabled, do not set this value because it\'s automatically set.' + }), + num_threads: z.number().register(z.globalRegistry, { + description: 'The number of threads used by each model allocation during inference.\nIncreasing this value generally increases the speed per inference request.\nThe inference process is a compute-bound process; `threads_per_allocations` must not exceed the number of available allocated processors per node.\nThe value must be a power of 2.\nThe maximum value is 32.\n\n> info\n> If you want to optimize your ELSER endpoint for ingest, set the number of threads to 1. If you want to optimize your ELSER endpoint for search, set the number of threads to greater than 1.' + }) }); export const inference_types_task_type_elser = z.enum(['sparse_embedding']); -export const inference_types_inference_endpoint_info_elser = inference_types_inference_endpoint.and( - z.object({ +export const inference_types_inference_endpoint_info_elser = inference_types_inference_endpoint.and(z.object({ inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', + description: 'The inference Id' }), - task_type: inference_types_task_type_elser, - }) -); + task_type: inference_types_task_type_elser +})); export const inference_types_google_ai_studio_task_type = z.enum(['completion', 'text_embedding']); export const inference_types_google_ai_service_type = z.enum(['googleaistudio']); export const inference_types_google_ai_studio_service_settings = z.object({ - api_key: z.string().register(z.globalRegistry, { - description: 'A valid API key of your Google Gemini account.', - }), - model_id: z.string().register(z.globalRegistry, { - description: - 'The name of the model to use for the inference task.\nRefer to the Google documentation for the list of supported models.', - }), - rate_limit: z.optional(inference_types_rate_limit_setting), + api_key: z.string().register(z.globalRegistry, { + description: 'A valid API key of your Google Gemini account.' + }), + model_id: z.string().register(z.globalRegistry, { + description: 'The name of the model to use for the inference task.\nRefer to the Google documentation for the list of supported models.' + }), + rate_limit: z.optional(inference_types_rate_limit_setting) }); export const inference_types_task_type_google_ai_studio = z.enum(['text_embedding', 'completion']); -export const inference_types_inference_endpoint_info_google_ai_studio = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_google_ai_studio, - }) - ); +export const inference_types_inference_endpoint_info_google_ai_studio = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_google_ai_studio +})); export const inference_types_google_vertex_ai_task_type = z.enum([ - 'rerank', - 'text_embedding', - 'completion', - 'chat_completion', + 'rerank', + 'text_embedding', + 'completion', + 'chat_completion' ]); export const inference_types_google_vertex_ai_service_type = z.enum(['googlevertexai']); export const inference_types_google_model_garden_provider = z.enum([ - 'google', - 'anthropic', - 'meta', - 'hugging_face', - 'mistral', - 'ai21', + 'google', + 'anthropic', + 'meta', + 'hugging_face', + 'mistral', + 'ai21' ]); export const inference_types_google_vertex_ai_service_settings = z.object({ - provider: z.optional(inference_types_google_model_garden_provider), - url: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The URL for non-streaming `completion` requests to a Google Model Garden provider endpoint.\nIf both `url` and `streaming_url` are provided, each is used for its respective mode.\nIf `streaming_url` is not provided, `url` is also used for streaming `completion` and `chat_completion`.\nIf `provider` is not provided or set to `google` (Google Vertex AI), do not set `url` (or `streaming_url`).\nAt least one of `url` or `streaming_url` must be provided for Google Model Garden endpoint usage.\nCertain providers require separate URLs for streaming and non-streaming operations (e.g., Anthropic, Mistral, AI21). Others support both operation types through a single URL (e.g., Meta, Hugging Face).\nInformation on constructing the URL for various providers can be found in the Google Model Garden documentation for the model, or on the endpoint’s `Sample request` page. The request examples also illustrate the proper formatting for the `url`.', - }) - ), - streaming_url: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The URL for streaming `completion` and `chat_completion` requests to a Google Model Garden provider endpoint.\nIf both `streaming_url` and `url` are provided, each is used for its respective mode.\nIf `url` is not provided, `streaming_url` is also used for non-streaming `completion` requests.\nIf `provider` is not provided or set to `google` (Google Vertex AI), do not set `streaming_url` (or `url`).\nAt least one of `streaming_url` or `url` must be provided for Google Model Garden endpoint usage.\nCertain providers require separate URLs for streaming and non-streaming operations (e.g., Anthropic, Mistral, AI21). Others support both operation types through a single URL (e.g., Meta, Hugging Face).\nInformation on constructing the URL for various providers can be found in the Google Model Garden documentation for the model, or on the endpoint’s `Sample request` page. The request examples also illustrate the proper formatting for the `streaming_url`.', - }) - ), - location: z.optional( - z.string().register(z.globalRegistry, { - description: - "The name of the location to use for the inference task for the Google Vertex AI inference task.\nFor Google Vertex AI, when `provider` is omitted or `google` `location` is mandatory.\nFor Google Model Garden's `completion` and `chat_completion` tasks, when `provider` is a supported non-`google` value - `location` is ignored.\nRefer to the Google documentation for the list of supported locations.", - }) - ), - model_id: z.optional( - z.string().register(z.globalRegistry, { - description: - "The name of the model to use for the inference task.\nFor Google Vertex AI `model_id` is mandatory.\nFor Google Model Garden's `completion` and `chat_completion` tasks, when `provider` is a supported non-`google` value - `model_id` will be used for some providers that require it, otherwise - ignored.\nRefer to the Google documentation for the list of supported models for Google Vertex AI.", - }) - ), - project_id: z.optional( - z.string().register(z.globalRegistry, { - description: - "The name of the project to use for the Google Vertex AI inference task.\nFor Google Vertex AI `project_id` is mandatory.\nFor Google Model Garden's `completion` and `chat_completion` tasks, when `provider` is a supported non-`google` value - `project_id` is ignored.", - }) - ), - rate_limit: z.optional(inference_types_rate_limit_setting), - service_account_json: z.string().register(z.globalRegistry, { - description: 'A valid service account in JSON format for the Google Vertex AI API.', - }), - dimensions: z.optional( - z.number().register(z.globalRegistry, { - description: - "For a `text_embedding` task, the number of dimensions the resulting output embeddings should have.\nBy default, the model's standard output dimension is used.\nRefer to the Google documentation for more information.", - }) - ), + provider: z.optional(inference_types_google_model_garden_provider), + url: z.optional(z.string().register(z.globalRegistry, { + description: 'The URL for non-streaming `completion` requests to a Google Model Garden provider endpoint.\nIf both `url` and `streaming_url` are provided, each is used for its respective mode.\nIf `streaming_url` is not provided, `url` is also used for streaming `completion` and `chat_completion`.\nIf `provider` is not provided or set to `google` (Google Vertex AI), do not set `url` (or `streaming_url`).\nAt least one of `url` or `streaming_url` must be provided for Google Model Garden endpoint usage.\nCertain providers require separate URLs for streaming and non-streaming operations (e.g., Anthropic, Mistral, AI21). Others support both operation types through a single URL (e.g., Meta, Hugging Face).\nInformation on constructing the URL for various providers can be found in the Google Model Garden documentation for the model, or on the endpoint’s `Sample request` page. The request examples also illustrate the proper formatting for the `url`.' + })), + streaming_url: z.optional(z.string().register(z.globalRegistry, { + description: 'The URL for streaming `completion` and `chat_completion` requests to a Google Model Garden provider endpoint.\nIf both `streaming_url` and `url` are provided, each is used for its respective mode.\nIf `url` is not provided, `streaming_url` is also used for non-streaming `completion` requests.\nIf `provider` is not provided or set to `google` (Google Vertex AI), do not set `streaming_url` (or `url`).\nAt least one of `streaming_url` or `url` must be provided for Google Model Garden endpoint usage.\nCertain providers require separate URLs for streaming and non-streaming operations (e.g., Anthropic, Mistral, AI21). Others support both operation types through a single URL (e.g., Meta, Hugging Face).\nInformation on constructing the URL for various providers can be found in the Google Model Garden documentation for the model, or on the endpoint’s `Sample request` page. The request examples also illustrate the proper formatting for the `streaming_url`.' + })), + location: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the location to use for the inference task for the Google Vertex AI inference task.\nFor Google Vertex AI, when `provider` is omitted or `google` `location` is mandatory.\nFor Google Model Garden\'s `completion` and `chat_completion` tasks, when `provider` is a supported non-`google` value - `location` is ignored.\nRefer to the Google documentation for the list of supported locations.' + })), + model_id: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the model to use for the inference task.\nFor Google Vertex AI `model_id` is mandatory.\nFor Google Model Garden\'s `completion` and `chat_completion` tasks, when `provider` is a supported non-`google` value - `model_id` will be used for some providers that require it, otherwise - ignored.\nRefer to the Google documentation for the list of supported models for Google Vertex AI.' + })), + project_id: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the project to use for the Google Vertex AI inference task.\nFor Google Vertex AI `project_id` is mandatory.\nFor Google Model Garden\'s `completion` and `chat_completion` tasks, when `provider` is a supported non-`google` value - `project_id` is ignored.' + })), + rate_limit: z.optional(inference_types_rate_limit_setting), + service_account_json: z.string().register(z.globalRegistry, { + description: 'A valid service account in JSON format for the Google Vertex AI API.' + }), + dimensions: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `text_embedding` task, the number of dimensions the resulting output embeddings should have.\nBy default, the model\'s standard output dimension is used.\nRefer to the Google documentation for more information.' + })) }); export const inference_types_thinking_config = z.object({ - thinking_budget: z.optional( - z.number().register(z.globalRegistry, { - description: 'Indicates the desired thinking budget in tokens.', - }) - ), + thinking_budget: z.optional(z.number().register(z.globalRegistry, { + description: 'Indicates the desired thinking budget in tokens.' + })) }); export const inference_types_google_vertex_ai_task_settings = z.object({ - auto_truncate: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'For a `text_embedding` task, truncate inputs longer than the maximum token length automatically.', - }) - ), - top_n: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For a `rerank` task, the number of the top N documents that should be returned.', - }) - ), - thinking_config: z.optional(inference_types_thinking_config), - max_tokens: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For `completion` and `chat_completion` tasks, specifies the `max_tokens` value for requests sent to the Google Model Garden `anthropic` provider.\nIf `provider` is not set to `anthropic`, this field is ignored.\nIf `max_tokens` is specified - it must be a positive integer. If not specified, the default value of 1024 is used.\nAnthropic models require `max_tokens` to be set for each request. Please refer to the Anthropic documentation for more information.', - }) - ), + auto_truncate: z.optional(z.boolean().register(z.globalRegistry, { + description: 'For a `text_embedding` task, truncate inputs longer than the maximum token length automatically.' + })), + top_n: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `rerank` task, the number of the top N documents that should be returned.' + })), + thinking_config: z.optional(inference_types_thinking_config), + max_tokens: z.optional(z.number().register(z.globalRegistry, { + description: 'For `completion` and `chat_completion` tasks, specifies the `max_tokens` value for requests sent to the Google Model Garden `anthropic` provider.\nIf `provider` is not set to `anthropic`, this field is ignored.\nIf `max_tokens` is specified - it must be a positive integer. If not specified, the default value of 1024 is used.\nAnthropic models require `max_tokens` to be set for each request. Please refer to the Anthropic documentation for more information.' + })) }); export const inference_types_task_type_google_vertex_ai = z.enum([ - 'chat_completion', - 'completion', - 'text_embedding', - 'rerank', + 'chat_completion', + 'completion', + 'text_embedding', + 'rerank' ]); -export const inference_types_inference_endpoint_info_google_vertex_ai = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_google_vertex_ai, - }) - ); +export const inference_types_inference_endpoint_info_google_vertex_ai = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_google_vertex_ai +})); export const inference_types_hugging_face_task_type = z.enum([ - 'chat_completion', - 'completion', - 'rerank', - 'text_embedding', + 'chat_completion', + 'completion', + 'rerank', + 'text_embedding' ]); export const inference_types_hugging_face_service_type = z.enum(['hugging_face']); export const inference_types_hugging_face_service_settings = z.object({ - api_key: z.string().register(z.globalRegistry, { - description: - 'A valid access token for your HuggingFace account.\nYou can create or find your access tokens on the HuggingFace settings page.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.', - }), - rate_limit: z.optional(inference_types_rate_limit_setting), - url: z.string().register(z.globalRegistry, { - description: - "The URL endpoint to use for the requests.\nFor `completion` and `chat_completion` tasks, the deployed model must be compatible with the Hugging Face Chat Completion interface (see the linked external documentation for details). The endpoint URL for the request must include `/v1/chat/completions`.\nIf the model supports the OpenAI Chat Completion schema, a toggle should appear in the interface. Enabling this toggle doesn't change any model behavior, it reveals the full endpoint URL needed (which should include `/v1/chat/completions`) when configuring the inference endpoint in Elasticsearch. If the model doesn't support this schema, the toggle may not be shown.", - }), - model_id: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The name of the HuggingFace model to use for the inference task.\nFor `completion` and `chat_completion` tasks, this field is optional but may be required for certain models — particularly when using serverless inference endpoints.\nFor the `text_embedding` task, this field should not be included. Otherwise, the request will fail.', - }) - ), + api_key: z.string().register(z.globalRegistry, { + description: 'A valid access token for your HuggingFace account.\nYou can create or find your access tokens on the HuggingFace settings page.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.' + }), + rate_limit: z.optional(inference_types_rate_limit_setting), + url: z.string().register(z.globalRegistry, { + description: 'The URL endpoint to use for the requests.\nFor `completion` and `chat_completion` tasks, the deployed model must be compatible with the Hugging Face Chat Completion interface (see the linked external documentation for details). The endpoint URL for the request must include `/v1/chat/completions`.\nIf the model supports the OpenAI Chat Completion schema, a toggle should appear in the interface. Enabling this toggle doesn\'t change any model behavior, it reveals the full endpoint URL needed (which should include `/v1/chat/completions`) when configuring the inference endpoint in Elasticsearch. If the model doesn\'t support this schema, the toggle may not be shown.' + }), + model_id: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the HuggingFace model to use for the inference task.\nFor `completion` and `chat_completion` tasks, this field is optional but may be required for certain models — particularly when using serverless inference endpoints.\nFor the `text_embedding` task, this field should not be included. Otherwise, the request will fail.' + })) }); export const inference_types_hugging_face_task_settings = z.object({ - return_documents: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'For a `rerank` task, return doc text within the results.', - }) - ), - top_n: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For a `rerank` task, the number of most relevant documents to return.\nIt defaults to the number of the documents.', - }) - ), + return_documents: z.optional(z.boolean().register(z.globalRegistry, { + description: 'For a `rerank` task, return doc text within the results.' + })), + top_n: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `rerank` task, the number of most relevant documents to return.\nIt defaults to the number of the documents.' + })) }); export const inference_types_task_type_hugging_face = z.enum([ - 'chat_completion', - 'completion', - 'rerank', - 'text_embedding', + 'chat_completion', + 'completion', + 'rerank', + 'text_embedding' ]); -export const inference_types_inference_endpoint_info_hugging_face = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_hugging_face, - }) - ); +export const inference_types_inference_endpoint_info_hugging_face = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_hugging_face +})); export const inference_types_jina_ai_task_type = z.enum(['rerank', 'text_embedding']); export const inference_types_jina_ai_service_type = z.enum(['jinaai']); -export const inference_types_jina_ai_similarity_type = z.enum(['cosine', 'dot_product', 'l2_norm']); +export const inference_types_jina_ai_similarity_type = z.enum([ + 'cosine', + 'dot_product', + 'l2_norm' +]); export const inference_types_jina_ai_service_settings = z.object({ - api_key: z.string().register(z.globalRegistry, { - description: - 'A valid API key of your JinaAI account.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.', - }), - model_id: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The name of the model to use for the inference task.\nFor a `rerank` task, it is required.\nFor a `text_embedding` task, it is optional.', - }) - ), - rate_limit: z.optional(inference_types_rate_limit_setting), - similarity: z.optional(inference_types_jina_ai_similarity_type), + api_key: z.string().register(z.globalRegistry, { + description: 'A valid API key of your JinaAI account.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.' + }), + model_id: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the model to use for the inference task.\nFor a `rerank` task, it is required.\nFor a `text_embedding` task, it is optional.' + })), + rate_limit: z.optional(inference_types_rate_limit_setting), + similarity: z.optional(inference_types_jina_ai_similarity_type) }); export const inference_types_jina_ai_text_embedding_task = z.enum([ - 'classification', - 'clustering', - 'ingest', - 'search', + 'classification', + 'clustering', + 'ingest', + 'search' ]); export const inference_types_jina_ai_task_settings = z.object({ - return_documents: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'For a `rerank` task, return the doc text within the results.', - }) - ), - task: z.optional(inference_types_jina_ai_text_embedding_task), - top_n: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For a `rerank` task, the number of most relevant documents to return.\nIt defaults to the number of the documents.\nIf this inference endpoint is used in a `text_similarity_reranker` retriever query and `top_n` is set, it must be greater than or equal to `rank_window_size` in the query.', - }) - ), + return_documents: z.optional(z.boolean().register(z.globalRegistry, { + description: 'For a `rerank` task, return the doc text within the results.' + })), + task: z.optional(inference_types_jina_ai_text_embedding_task), + top_n: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `rerank` task, the number of most relevant documents to return.\nIt defaults to the number of the documents.\nIf this inference endpoint is used in a `text_similarity_reranker` retriever query and `top_n` is set, it must be greater than or equal to `rank_window_size` in the query.' + })) }); export const inference_types_task_type_jina_ai = z.enum(['text_embedding', 'rerank']); -export const inference_types_inference_endpoint_info_jina_ai = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_jina_ai, - }) - ); +export const inference_types_inference_endpoint_info_jina_ai = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_jina_ai +})); export const inference_types_llama_task_type = z.enum([ - 'text_embedding', - 'completion', - 'chat_completion', + 'text_embedding', + 'completion', + 'chat_completion' ]); export const inference_types_llama_service_type = z.enum(['llama']); -export const inference_types_llama_similarity_type = z.enum(['cosine', 'dot_product', 'l2_norm']); +export const inference_types_llama_similarity_type = z.enum([ + 'cosine', + 'dot_product', + 'l2_norm' +]); export const inference_types_llama_service_settings = z.object({ - url: z.string().register(z.globalRegistry, { - description: - 'The URL endpoint of the Llama stack endpoint.\nURL must contain:\n* For `text_embedding` task - `/v1/inference/embeddings`.\n* For `completion` and `chat_completion` tasks - `/v1/openai/v1/chat/completions`.', - }), - model_id: z.string().register(z.globalRegistry, { - description: - 'The name of the model to use for the inference task.\nRefer to the Llama downloading models documentation for different ways of getting a list of available models and downloading them.\nService has been tested and confirmed to be working with the following models:\n* For `text_embedding` task - `all-MiniLM-L6-v2`.\n* For `completion` and `chat_completion` tasks - `llama3.2:3b`.', - }), - max_input_tokens: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For a `text_embedding` task, the maximum number of tokens per input before chunking occurs.', - }) - ), - similarity: z.optional(inference_types_llama_similarity_type), - rate_limit: z.optional(inference_types_rate_limit_setting), + url: z.string().register(z.globalRegistry, { + description: 'The URL endpoint of the Llama stack endpoint.\nURL must contain:\n* For `text_embedding` task - `/v1/inference/embeddings`.\n* For `completion` and `chat_completion` tasks - `/v1/openai/v1/chat/completions`.' + }), + model_id: z.string().register(z.globalRegistry, { + description: 'The name of the model to use for the inference task.\nRefer to the Llama downloading models documentation for different ways of getting a list of available models and downloading them.\nService has been tested and confirmed to be working with the following models:\n* For `text_embedding` task - `all-MiniLM-L6-v2`.\n* For `completion` and `chat_completion` tasks - `llama3.2:3b`.' + }), + max_input_tokens: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `text_embedding` task, the maximum number of tokens per input before chunking occurs.' + })), + similarity: z.optional(inference_types_llama_similarity_type), + rate_limit: z.optional(inference_types_rate_limit_setting) }); export const inference_types_task_type_llama = z.enum([ - 'text_embedding', - 'chat_completion', - 'completion', + 'text_embedding', + 'chat_completion', + 'completion' ]); -export const inference_types_inference_endpoint_info_llama = inference_types_inference_endpoint.and( - z.object({ +export const inference_types_inference_endpoint_info_llama = inference_types_inference_endpoint.and(z.object({ inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', + description: 'The inference Id' }), - task_type: inference_types_task_type_llama, - }) -); + task_type: inference_types_task_type_llama +})); export const inference_types_mistral_task_type = z.enum([ - 'text_embedding', - 'completion', - 'chat_completion', + 'text_embedding', + 'completion', + 'chat_completion' ]); export const inference_types_mistral_service_type = z.enum(['mistral']); export const inference_types_mistral_service_settings = z.object({ - api_key: z.string().register(z.globalRegistry, { - description: - 'A valid API key of your Mistral account.\nYou can find your Mistral API keys or you can create a new one on the API Keys page.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.', - }), - max_input_tokens: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of tokens per input before chunking occurs.', - }) - ), - model: z.string().register(z.globalRegistry, { - description: - 'The name of the model to use for the inference task.\nRefer to the Mistral models documentation for the list of available models.', - }), - rate_limit: z.optional(inference_types_rate_limit_setting), + api_key: z.string().register(z.globalRegistry, { + description: 'A valid API key of your Mistral account.\nYou can find your Mistral API keys or you can create a new one on the API Keys page.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.' + }), + max_input_tokens: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of tokens per input before chunking occurs.' + })), + model: z.string().register(z.globalRegistry, { + description: 'The name of the model to use for the inference task.\nRefer to the Mistral models documentation for the list of available models.' + }), + rate_limit: z.optional(inference_types_rate_limit_setting) }); export const inference_types_task_type_mistral = z.enum([ - 'text_embedding', - 'chat_completion', - 'completion', + 'text_embedding', + 'chat_completion', + 'completion' ]); -export const inference_types_inference_endpoint_info_mistral = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_mistral, - }) - ); +export const inference_types_inference_endpoint_info_mistral = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_mistral +})); export const inference_types_open_ai_task_type = z.enum([ - 'chat_completion', - 'completion', - 'text_embedding', + 'chat_completion', + 'completion', + 'text_embedding' ]); export const inference_types_open_ai_service_type = z.enum(['openai']); export const inference_types_open_ai_service_settings = z.object({ - api_key: z.string().register(z.globalRegistry, { - description: - 'A valid API key of your OpenAI account.\nYou can find your OpenAI API keys in your OpenAI account under the API keys section.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.', - }), - dimensions: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of dimensions the resulting output embeddings should have.\nIt is supported only in `text-embedding-3` and later models.\nIf it is not set, the OpenAI defined default for the model is used.', - }) - ), - model_id: z.string().register(z.globalRegistry, { - description: - 'The name of the model to use for the inference task.\nRefer to the OpenAI documentation for the list of available text embedding models.', - }), - organization_id: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The unique identifier for your organization.\nYou can find the Organization ID in your OpenAI account under *Settings > Organizations*.', - }) - ), - rate_limit: z.optional(inference_types_rate_limit_setting), - url: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The URL endpoint to use for the requests.\nIt can be changed for testing purposes.', - }) - ), + api_key: z.string().register(z.globalRegistry, { + description: 'A valid API key of your OpenAI account.\nYou can find your OpenAI API keys in your OpenAI account under the API keys section.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.' + }), + dimensions: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of dimensions the resulting output embeddings should have.\nIt is supported only in `text-embedding-3` and later models.\nIf it is not set, the OpenAI defined default for the model is used.' + })), + model_id: z.string().register(z.globalRegistry, { + description: 'The name of the model to use for the inference task.\nRefer to the OpenAI documentation for the list of available text embedding models.' + }), + organization_id: z.optional(z.string().register(z.globalRegistry, { + description: 'The unique identifier for your organization.\nYou can find the Organization ID in your OpenAI account under *Settings > Organizations*.' + })), + rate_limit: z.optional(inference_types_rate_limit_setting), + url: z.optional(z.string().register(z.globalRegistry, { + description: 'The URL endpoint to use for the requests.\nIt can be changed for testing purposes.' + })) }); export const inference_types_open_ai_task_settings = z.object({ - user: z.optional( - z.string().register(z.globalRegistry, { - description: - 'For a `completion` or `text_embedding` task, specify the user issuing the request.\nThis information can be used for abuse detection.', - }) - ), - headers: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'Specifies custom HTTP header parameters.\nFor example:\n```\n"headers":{\n "Custom-Header": "Some-Value",\n "Another-Custom-Header": "Another-Value"\n}\n```', - }) - ), + user: z.optional(z.string().register(z.globalRegistry, { + description: 'For a `completion` or `text_embedding` task, specify the user issuing the request.\nThis information can be used for abuse detection.' + })), + headers: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'Specifies custom HTTP header parameters.\nFor example:\n```\n"headers":{\n "Custom-Header": "Some-Value",\n "Another-Custom-Header": "Another-Value"\n}\n```' + })) }); export const inference_types_task_type_open_ai = z.enum([ - 'text_embedding', - 'chat_completion', - 'completion', + 'text_embedding', + 'chat_completion', + 'completion' ]); -export const inference_types_inference_endpoint_info_open_ai = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_open_ai, - }) - ); +export const inference_types_inference_endpoint_info_open_ai = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_open_ai +})); export const inference_types_open_shift_ai_task_type = z.enum([ - 'text_embedding', - 'completion', - 'chat_completion', - 'rerank', + 'text_embedding', + 'completion', + 'chat_completion', + 'rerank' ]); export const inference_types_open_shift_ai_service_type = z.enum(['openshift_ai']); export const inference_types_open_shift_ai_similarity_type = z.enum([ - 'cosine', - 'dot_product', - 'l2_norm', + 'cosine', + 'dot_product', + 'l2_norm' ]); export const inference_types_open_shift_ai_service_settings = z.object({ - api_key: z.string().register(z.globalRegistry, { - description: - 'A valid API key for your OpenShift AI endpoint.\nCan be found in `Token authentication` section of model related information.', - }), - url: z.string().register(z.globalRegistry, { - description: 'The URL of the OpenShift AI hosted model endpoint.', - }), - model_id: z.optional( - z.string().register(z.globalRegistry, { - description: - "The name of the model to use for the inference task.\nRefer to the hosted model's documentation for the name if needed.\nService has been tested and confirmed to be working with the following models:\n* For `text_embedding` task - `gritlm-7b`.\n* For `completion` and `chat_completion` tasks - `llama-31-8b-instruct`.\n* For `rerank` task - `bge-reranker-v2-m3`.", - }) - ), - max_input_tokens: z.optional( - z.number().register(z.globalRegistry, { - description: - 'For a `text_embedding` task, the maximum number of tokens per input before chunking occurs.', - }) - ), - similarity: z.optional(inference_types_open_shift_ai_similarity_type), - rate_limit: z.optional(inference_types_rate_limit_setting), + api_key: z.string().register(z.globalRegistry, { + description: 'A valid API key for your OpenShift AI endpoint.\nCan be found in `Token authentication` section of model related information.' + }), + url: z.string().register(z.globalRegistry, { + description: 'The URL of the OpenShift AI hosted model endpoint.' + }), + model_id: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the model to use for the inference task.\nRefer to the hosted model\'s documentation for the name if needed.\nService has been tested and confirmed to be working with the following models:\n* For `text_embedding` task - `gritlm-7b`.\n* For `completion` and `chat_completion` tasks - `llama-31-8b-instruct`.\n* For `rerank` task - `bge-reranker-v2-m3`.' + })), + max_input_tokens: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `text_embedding` task, the maximum number of tokens per input before chunking occurs.' + })), + similarity: z.optional(inference_types_open_shift_ai_similarity_type), + rate_limit: z.optional(inference_types_rate_limit_setting) }); export const inference_types_open_shift_ai_task_settings = z.object({ - return_documents: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'For a `rerank` task, whether to return the source documents in the response.', - }) - ), - top_n: z.optional( - z.number().register(z.globalRegistry, { - description: 'For a `rerank` task, the number of most relevant documents to return.', - }) - ), + return_documents: z.optional(z.boolean().register(z.globalRegistry, { + description: 'For a `rerank` task, whether to return the source documents in the response.' + })), + top_n: z.optional(z.number().register(z.globalRegistry, { + description: 'For a `rerank` task, the number of most relevant documents to return.' + })) }); export const inference_types_task_type_open_shift_ai = z.enum([ - 'text_embedding', - 'chat_completion', - 'completion', - 'rerank', + 'text_embedding', + 'chat_completion', + 'completion', + 'rerank' ]); -export const inference_types_inference_endpoint_info_open_shift_ai = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_open_shift_ai, - }) - ); +export const inference_types_inference_endpoint_info_open_shift_ai = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_open_shift_ai +})); export const inference_types_voyage_ai_task_type = z.enum(['text_embedding', 'rerank']); export const inference_types_voyage_ai_service_type = z.enum(['voyageai']); export const inference_types_voyage_ai_service_settings = z.object({ - dimensions: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of dimensions for resulting output embeddings.\nThis setting maps to `output_dimension` in the VoyageAI documentation.\nOnly for the `text_embedding` task type.', - }) - ), - model_id: z.string().register(z.globalRegistry, { - description: - 'The name of the model to use for the inference task.\nRefer to the VoyageAI documentation for the list of available text embedding and rerank models.', - }), - rate_limit: z.optional(inference_types_rate_limit_setting), - embedding_type: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The data type for the embeddings to be returned.\nThis setting maps to `output_dtype` in the VoyageAI documentation.\nPermitted values: float, int8, bit.\n`int8` is a synonym of `byte` in the VoyageAI documentation.\n`bit` is a synonym of `binary` in the VoyageAI documentation.\nOnly for the `text_embedding` task type.', - }) - ), + dimensions: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of dimensions for resulting output embeddings.\nThis setting maps to `output_dimension` in the VoyageAI documentation.\nOnly for the `text_embedding` task type.' + })), + model_id: z.string().register(z.globalRegistry, { + description: 'The name of the model to use for the inference task.\nRefer to the VoyageAI documentation for the list of available text embedding and rerank models.' + }), + rate_limit: z.optional(inference_types_rate_limit_setting), + embedding_type: z.optional(z.number().register(z.globalRegistry, { + description: 'The data type for the embeddings to be returned.\nThis setting maps to `output_dtype` in the VoyageAI documentation.\nPermitted values: float, int8, bit.\n`int8` is a synonym of `byte` in the VoyageAI documentation.\n`bit` is a synonym of `binary` in the VoyageAI documentation.\nOnly for the `text_embedding` task type.' + })) }); export const inference_types_voyage_ai_task_settings = z.object({ - input_type: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Type of the input text.\nPermitted values: `ingest` (maps to `document` in the VoyageAI documentation), `search` (maps to `query` in the VoyageAI documentation).\nOnly for the `text_embedding` task type.', - }) - ), - return_documents: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to return the source documents in the response.\nOnly for the `rerank` task type.', - }) - ), - top_k: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of most relevant documents to return.\nIf not specified, the reranking results of all documents will be returned.\nOnly for the `rerank` task type.', - }) - ), - truncation: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Whether to truncate the input texts to fit within the context length.', - }) - ), + input_type: z.optional(z.string().register(z.globalRegistry, { + description: 'Type of the input text.\nPermitted values: `ingest` (maps to `document` in the VoyageAI documentation), `search` (maps to `query` in the VoyageAI documentation).\nOnly for the `text_embedding` task type.' + })), + return_documents: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to return the source documents in the response.\nOnly for the `rerank` task type.' + })), + top_k: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of most relevant documents to return.\nIf not specified, the reranking results of all documents will be returned.\nOnly for the `rerank` task type.' + })), + truncation: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to truncate the input texts to fit within the context length.' + })) }); export const inference_types_task_type_voyage_ai = z.enum(['text_embedding', 'rerank']); -export const inference_types_inference_endpoint_info_voyage_ai = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_voyage_ai, - }) - ); +export const inference_types_inference_endpoint_info_voyage_ai = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_voyage_ai +})); export const inference_types_watsonx_task_type = z.enum([ - 'text_embedding', - 'chat_completion', - 'completion', + 'text_embedding', + 'chat_completion', + 'completion' ]); export const inference_types_watsonx_service_type = z.enum(['watsonxai']); export const inference_types_watsonx_service_settings = z.object({ - api_key: z.string().register(z.globalRegistry, { - description: - 'A valid API key of your Watsonx account.\nYou can find your Watsonx API keys or you can create a new one on the API keys page.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.', - }), - api_version: z.string().register(z.globalRegistry, { - description: - 'A version parameter that takes a version date in the format of `YYYY-MM-DD`.\nFor the active version data parameters, refer to the Wastonx documentation.', - }), - model_id: z.string().register(z.globalRegistry, { - description: - 'The name of the model to use for the inference task.\nRefer to the IBM Embedding Models section in the Watsonx documentation for the list of available text embedding models.\nRefer to the IBM library - Foundation models in Watsonx.ai.', - }), - project_id: z.string().register(z.globalRegistry, { - description: 'The identifier of the IBM Cloud project to use for the inference task.', - }), - rate_limit: z.optional(inference_types_rate_limit_setting), - url: z.string().register(z.globalRegistry, { - description: 'The URL of the inference endpoint that you created on Watsonx.', - }), + api_key: z.string().register(z.globalRegistry, { + description: 'A valid API key of your Watsonx account.\nYou can find your Watsonx API keys or you can create a new one on the API keys page.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.' + }), + api_version: z.string().register(z.globalRegistry, { + description: 'A version parameter that takes a version date in the format of `YYYY-MM-DD`.\nFor the active version data parameters, refer to the Wastonx documentation.' + }), + model_id: z.string().register(z.globalRegistry, { + description: 'The name of the model to use for the inference task.\nRefer to the IBM Embedding Models section in the Watsonx documentation for the list of available text embedding models.\nRefer to the IBM library - Foundation models in Watsonx.ai.' + }), + project_id: z.string().register(z.globalRegistry, { + description: 'The identifier of the IBM Cloud project to use for the inference task.' + }), + rate_limit: z.optional(inference_types_rate_limit_setting), + url: z.string().register(z.globalRegistry, { + description: 'The URL of the inference endpoint that you created on Watsonx.' + }) }); export const inference_types_task_type_watsonx = z.enum([ - 'text_embedding', - 'chat_completion', - 'completion', + 'text_embedding', + 'chat_completion', + 'completion' ]); -export const inference_types_inference_endpoint_info_watsonx = - inference_types_inference_endpoint.and( - z.object({ - inference_id: z.string().register(z.globalRegistry, { - description: 'The inference Id', - }), - task_type: inference_types_task_type_watsonx, - }) - ); +export const inference_types_inference_endpoint_info_watsonx = inference_types_inference_endpoint.and(z.object({ + inference_id: z.string().register(z.globalRegistry, { + description: 'The inference Id' + }), + task_type: inference_types_task_type_watsonx +})); /** * Defines the response for a rerank request. */ -export const inference_types_reranked_inference_result = z - .object({ - rerank: z.array(inference_types_ranked_document), - }) - .register(z.globalRegistry, { - description: 'Defines the response for a rerank request.', - }); +export const inference_types_reranked_inference_result = z.object({ + rerank: z.array(inference_types_ranked_document) +}).register(z.globalRegistry, { + description: 'Defines the response for a rerank request.' +}); /** * The response format for the sparse embedding request. */ -export const inference_types_sparse_embedding_inference_result = z - .object({ - sparse_embedding: z.array(inference_types_sparse_embedding_result), - }) - .register(z.globalRegistry, { - description: 'The response format for the sparse embedding request.', - }); +export const inference_types_sparse_embedding_inference_result = z.object({ + sparse_embedding: z.array(inference_types_sparse_embedding_result) +}).register(z.globalRegistry, { + description: 'The response format for the sparse embedding request.' +}); /** * TextEmbeddingInferenceResult is an aggregation of mutually exclusive text_embedding variants */ -export const inference_types_text_embedding_inference_result = z - .object({ +export const inference_types_text_embedding_inference_result = z.object({ text_embedding_bytes: z.optional(z.array(inference_types_text_embedding_byte_result)), text_embedding_bits: z.optional(z.array(inference_types_text_embedding_byte_result)), - text_embedding: z.optional(z.array(inference_types_text_embedding_result)), - }) - .register(z.globalRegistry, { - description: - 'TextEmbeddingInferenceResult is an aggregation of mutually exclusive text_embedding variants', - }); + text_embedding: z.optional(z.array(inference_types_text_embedding_result)) +}).register(z.globalRegistry, { + description: 'TextEmbeddingInferenceResult is an aggregation of mutually exclusive text_embedding variants' +}); export const types_elasticsearch_version_info = z.object({ - build_date: types_date_time, - build_flavor: z.string().register(z.globalRegistry, { - description: 'The build flavor. For example, `default`.', - }), - build_hash: z.string().register(z.globalRegistry, { - description: "The Elasticsearch Git commit's SHA hash.", - }), - build_snapshot: z.boolean().register(z.globalRegistry, { - description: 'Indicates whether the Elasticsearch build was a snapshot.', - }), - build_type: z.string().register(z.globalRegistry, { - description: - 'The build type that corresponds to how Elasticsearch was installed.\nFor example, `docker`, `rpm`, or `tar`.', - }), - lucene_version: types_version_string, - minimum_index_compatibility_version: types_version_string, - minimum_wire_compatibility_version: types_version_string, - number: z.string().register(z.globalRegistry, { - description: - 'The Elasticsearch version number.\n\n::: IMPORTANT: For Serverless deployments, this static value is always `8.11.0` and is used solely for backward compatibility with legacy clients.\n Serverless environments are versionless and automatically upgraded, so this value can be safely ignored.', - }), + build_date: types_date_time, + build_flavor: z.string().register(z.globalRegistry, { + description: 'The build flavor. For example, `default`.' + }), + build_hash: z.string().register(z.globalRegistry, { + description: 'The Elasticsearch Git commit\'s SHA hash.' + }), + build_snapshot: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the Elasticsearch build was a snapshot.' + }), + build_type: z.string().register(z.globalRegistry, { + description: 'The build type that corresponds to how Elasticsearch was installed.\nFor example, `docker`, `rpm`, or `tar`.' + }), + lucene_version: types_version_string, + minimum_index_compatibility_version: types_version_string, + minimum_wire_compatibility_version: types_version_string, + number: z.string().register(z.globalRegistry, { + description: 'The Elasticsearch version number.\n\n::: IMPORTANT: For Serverless deployments, this static value is always `8.11.0` and is used solely for backward compatibility with legacy clients.\n Serverless environments are versionless and automatically upgraded, so this value can be safely ignored.' + }) }); export const ingest_geo_ip_stats_geo_ip_download_statistics = z.object({ - successful_downloads: z.number().register(z.globalRegistry, { - description: 'Total number of successful database downloads.', - }), - failed_downloads: z.number().register(z.globalRegistry, { - description: 'Total number of failed database downloads.', - }), - total_download_time: types_duration_value_unit_millis, - databases_count: z.number().register(z.globalRegistry, { - description: 'Current number of databases available for use.', - }), - skipped_updates: z.number().register(z.globalRegistry, { - description: 'Total number of database updates skipped.', - }), - expired_databases: z.number().register(z.globalRegistry, { - description: 'Total number of databases not updated after 30 days', - }), + successful_downloads: z.number().register(z.globalRegistry, { + description: 'Total number of successful database downloads.' + }), + failed_downloads: z.number().register(z.globalRegistry, { + description: 'Total number of failed database downloads.' + }), + total_download_time: types_duration_value_unit_millis, + databases_count: z.number().register(z.globalRegistry, { + description: 'Current number of databases available for use.' + }), + skipped_updates: z.number().register(z.globalRegistry, { + description: 'Total number of database updates skipped.' + }), + expired_databases: z.number().register(z.globalRegistry, { + description: 'Total number of databases not updated after 30 days' + }) }); export const ingest_geo_ip_stats_geo_ip_node_database_name = z.object({ - name: types_name, + name: types_name }); /** * Downloaded databases for the node. The field key is the node ID. */ -export const ingest_geo_ip_stats_geo_ip_node_databases = z - .object({ +export const ingest_geo_ip_stats_geo_ip_node_databases = z.object({ databases: z.array(ingest_geo_ip_stats_geo_ip_node_database_name).register(z.globalRegistry, { - description: 'Downloaded databases for the node.', + description: 'Downloaded databases for the node.' }), files_in_temp: z.array(z.string()).register(z.globalRegistry, { - description: - 'Downloaded database files, including related license files. Elasticsearch stores these files in the node’s temporary directory: $ES_TMPDIR/geoip-databases/.', - }), - }) - .register(z.globalRegistry, { - description: 'Downloaded databases for the node. The field key is the node ID.', - }); + description: 'Downloaded database files, including related license files. Elasticsearch stores these files in the node’s temporary directory: $ES_TMPDIR/geoip-databases/.' + }) +}).register(z.globalRegistry, { + description: 'Downloaded databases for the node. The field key is the node ID.' +}); export const ingest_types_maxmind = z.object({ - account_id: types_id, + account_id: types_id }); export const ingest_types_ipinfo = z.record(z.string(), z.unknown()); @@ -18011,118 +14899,110 @@ export const ingest_types_ipinfo = z.record(z.string(), z.unknown()); * At present, the only supported providers are `maxmind` and `ipinfo`, and the `maxmind` provider requires that an `account_id` (string) is configured. * A provider (either `maxmind` or `ipinfo`) must be specified. The web and local providers can be returned as read only configurations. */ -export const ingest_types_database_configuration = z - .object({ - name: types_name, - }) - .and( - z.object({ - maxmind: z.optional(ingest_types_maxmind), - ipinfo: z.optional(ingest_types_ipinfo), - }) - ); +export const ingest_types_database_configuration = z.object({ + name: types_name +}).and(z.object({ + maxmind: z.optional(ingest_types_maxmind), + ipinfo: z.optional(ingest_types_ipinfo) +})); export const ingest_get_geoip_database_database_configuration_metadata = z.object({ - id: types_id, - version: z.number(), - modified_date_millis: types_epoch_time_unit_millis, - database: ingest_types_database_configuration, + id: types_id, + version: z.number(), + modified_date_millis: types_epoch_time_unit_millis, + database: ingest_types_database_configuration }); export const ingest_types_web = z.record(z.string(), z.unknown()); export const ingest_types_local = z.object({ - type: z.string(), + type: z.string() }); -export const ingest_types_database_configuration_full = z - .object({ - name: types_name, - }) - .and( - z.object({ - web: z.optional(ingest_types_web), - local: z.optional(ingest_types_local), - maxmind: z.optional(ingest_types_maxmind), - ipinfo: z.optional(ingest_types_ipinfo), - }) - ); +export const ingest_types_database_configuration_full = z.object({ + name: types_name +}).and(z.object({ + web: z.optional(ingest_types_web), + local: z.optional(ingest_types_local), + maxmind: z.optional(ingest_types_maxmind), + ipinfo: z.optional(ingest_types_ipinfo) +})); export const ingest_get_ip_location_database_database_configuration_metadata = z.object({ - id: types_id, - version: types_version_number, - modified_date_millis: z.optional(types_epoch_time_unit_millis), - modified_date: z.optional(types_epoch_time_unit_millis), - database: ingest_types_database_configuration_full, + id: types_id, + version: types_version_number, + modified_date_millis: z.optional(types_epoch_time_unit_millis), + modified_date: z.optional(types_epoch_time_unit_millis), + database: ingest_types_database_configuration_full }); export const ingest_types_shape_type = z.enum(['geo_shape', 'shape']); export const ingest_types_convert_type = z.enum([ - 'integer', - 'long', - 'double', - 'float', - 'boolean', - 'ip', - 'string', - 'auto', + 'integer', + 'long', + 'double', + 'float', + 'boolean', + 'ip', + 'string', + 'auto' ]); -export const types_geo_shape_relation = z.enum(['intersects', 'disjoint', 'within', 'contains']); +export const types_geo_shape_relation = z.enum([ + 'intersects', + 'disjoint', + 'within', + 'contains' +]); export const ingest_types_fingerprint_digest = z.enum([ - 'MD5', - 'SHA-1', - 'SHA-256', - 'SHA-512', - 'MurmurHash3', + 'MD5', + 'SHA-1', + 'SHA-256', + 'SHA-512', + 'MurmurHash3' ]); -export const ingest_types_geo_grid_tile_type = z.enum(['geotile', 'geohex', 'geohash']); +export const ingest_types_geo_grid_tile_type = z.enum([ + 'geotile', + 'geohex', + 'geohash' +]); export const ingest_types_geo_grid_target_format = z.enum(['geojson', 'wkt']); export const types_grok_pattern = z.string(); export const ingest_types_inference_config_regression = z.object({ - results_field: z.optional(types_field), - num_top_feature_importance_values: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of feature importance values per document.', - }) - ), + results_field: z.optional(types_field), + num_top_feature_importance_values: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of feature importance values per document.' + })) }); export const ingest_types_inference_config_classification = z.object({ - num_top_classes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the number of top class predictions to return.', - }) - ), - num_top_feature_importance_values: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of feature importance values per document.', - }) - ), - results_field: z.optional(types_field), - top_classes_results_field: z.optional(types_field), - prediction_field_type: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Specifies the type of the predicted field to write.\nValid values are: `string`, `number`, `boolean`.', - }) - ), + num_top_classes: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the number of top class predictions to return.' + })), + num_top_feature_importance_values: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of feature importance values per document.' + })), + results_field: z.optional(types_field), + top_classes_results_field: z.optional(types_field), + prediction_field_type: z.optional(z.string().register(z.globalRegistry, { + description: 'Specifies the type of the predicted field to write.\nValid values are: `string`, `number`, `boolean`.' + })) }); export const ingest_types_inference_config = z.object({ - regression: z.optional(ingest_types_inference_config_regression), - classification: z.optional(ingest_types_inference_config_classification), + regression: z.optional(ingest_types_inference_config_regression), + classification: z.optional(ingest_types_inference_config_classification) }); export const ingest_types_input_config = z.object({ - input_field: z.string(), - output_field: z.string(), + input_field: z.string(), + output_field: z.string() }); export const ingest_types_json_processor_conflict_strategy = z.enum(['replace', 'merge']); @@ -18132,23 +15012,23 @@ export const ingest_types_user_agent_property = z.unknown(); export const ingest_types_field_access_pattern = z.enum(['classic', 'flexible']); export const ingest_types_document = z.object({ - _id: z.optional(types_id), - _index: z.optional(types_index_name), - _source: z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: 'JSON body for the document.', - }), + _id: z.optional(types_id), + _index: z.optional(types_index_name), + _source: z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'JSON body for the document.' + }) }); export const ingest_types_redact = z.object({ - _is_redacted: z.boolean().register(z.globalRegistry, { - description: 'indicates if document has been redacted', - }), + _is_redacted: z.boolean().register(z.globalRegistry, { + description: 'indicates if document has been redacted' + }) }); export const ingest_types_ingest = z.object({ - _redact: z.optional(ingest_types_redact), - timestamp: types_date_time, - pipeline: z.optional(types_name), + _redact: z.optional(ingest_types_redact), + timestamp: types_date_time, + pipeline: z.optional(types_name) }); /** @@ -18158,4879 +15038,3910 @@ export const ingest_types_ingest = z.object({ * Depending on the target language, code generators can keep the union or remove it and leniently parse * strings to the target type. */ -export const spec_utils_stringified_version_number = z.union([types_version_number, z.string()]); +export const spec_utils_stringified_version_number = z.union([ + types_version_number, + z.string() +]); /** * The simulated document, with optional metadata. */ -export const ingest_types_document_simulation = z - .object({ +export const ingest_types_document_simulation = z.object({ _id: types_id, _index: types_index_name, _ingest: ingest_types_ingest, - _routing: z.optional( - z.string().register(z.globalRegistry, { - description: 'Value used to send the document to a specific primary shard.', - }) - ), + _routing: z.optional(z.string().register(z.globalRegistry, { + description: 'Value used to send the document to a specific primary shard.' + })), _source: z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'JSON body for the document.', + description: 'JSON body for the document.' }), _version: z.optional(spec_utils_stringified_version_number), - _version_type: z.optional(types_version_type), - }) - .register(z.globalRegistry, { - description: 'The simulated document, with optional metadata.', - }); + _version_type: z.optional(types_version_type) +}).register(z.globalRegistry, { + description: 'The simulated document, with optional metadata.' +}); export const ingest_types_pipeline_simulation_status_options = z.enum([ - 'success', - 'error', - 'error_ignored', - 'skipped', - 'dropped', + 'success', + 'error', + 'error_ignored', + 'skipped', + 'dropped' ]); export const ingest_types_pipeline_processor_result = z.object({ - doc: z.optional(ingest_types_document_simulation), - tag: z.optional(z.string()), - processor_type: z.optional(z.string()), - status: z.optional(ingest_types_pipeline_simulation_status_options), - description: z.optional(z.string()), - ignored_error: z.optional(types_error_cause), - error: z.optional(types_error_cause), + doc: z.optional(ingest_types_document_simulation), + tag: z.optional(z.string()), + processor_type: z.optional(z.string()), + status: z.optional(ingest_types_pipeline_simulation_status_options), + description: z.optional(z.string()), + ignored_error: z.optional(types_error_cause), + error: z.optional(types_error_cause) }); export const ingest_types_simulate_document_result = z.object({ - doc: z.optional(ingest_types_document_simulation), - error: z.optional(types_error_cause), - processor_results: z.optional(z.array(ingest_types_pipeline_processor_result)), + doc: z.optional(ingest_types_document_simulation), + error: z.optional(types_error_cause), + processor_results: z.optional(z.array(ingest_types_pipeline_processor_result)) }); -export const license_types_license_status = z.enum(['active', 'valid', 'invalid', 'expired']); +export const license_types_license_status = z.enum([ + 'active', + 'valid', + 'invalid', + 'expired' +]); export const license_types_license_type = z.enum([ - 'missing', - 'trial', - 'basic', - 'standard', - 'dev', - 'silver', - 'gold', - 'platinum', - 'enterprise', + 'missing', + 'trial', + 'basic', + 'standard', + 'dev', + 'silver', + 'gold', + 'platinum', + 'enterprise' ]); export const license_get_license_information = z.object({ - expiry_date: z.optional(types_date_time), - expiry_date_in_millis: z.optional(types_epoch_time_unit_millis), - issue_date: types_date_time, - issue_date_in_millis: types_epoch_time_unit_millis, - issued_to: z.string(), - issuer: z.string(), - max_nodes: z.union([z.number(), z.string(), z.null()]), - max_resource_units: z.optional(z.union([z.number(), z.string(), z.null()])), - status: license_types_license_status, - type: license_types_license_type, - uid: types_uuid, - start_date_in_millis: types_epoch_time_unit_millis, + expiry_date: z.optional(types_date_time), + expiry_date_in_millis: z.optional(types_epoch_time_unit_millis), + issue_date: types_date_time, + issue_date_in_millis: types_epoch_time_unit_millis, + issued_to: z.string(), + issuer: z.string(), + max_nodes: z.union([ + z.number(), + z.string(), + z.null() + ]), + max_resource_units: z.optional(z.union([ + z.number(), + z.string(), + z.null() + ])), + status: license_types_license_status, + type: license_types_license_type, + uid: types_uuid, + start_date_in_millis: types_epoch_time_unit_millis }); export const license_types_license = z.object({ - expiry_date_in_millis: types_epoch_time_unit_millis, - issue_date_in_millis: types_epoch_time_unit_millis, - start_date_in_millis: z.optional(types_epoch_time_unit_millis), - issued_to: z.string(), - issuer: z.string(), - max_nodes: z.optional(z.union([z.number(), z.string(), z.null()])), - max_resource_units: z.optional(z.number()), - signature: z.string(), - type: license_types_license_type, - uid: z.string(), + expiry_date_in_millis: types_epoch_time_unit_millis, + issue_date_in_millis: types_epoch_time_unit_millis, + start_date_in_millis: z.optional(types_epoch_time_unit_millis), + issued_to: z.string(), + issuer: z.string(), + max_nodes: z.optional(z.union([ + z.number(), + z.string(), + z.null() + ])), + max_resource_units: z.optional(z.number()), + signature: z.string(), + type: license_types_license_type, + uid: z.string() }); export const license_post_acknowledgement = z.object({ - license: z.array(z.string()), - message: z.string(), + license: z.array(z.string()), + message: z.string() }); export const logstash_types_pipeline_metadata = z.object({ - type: z.string(), - version: z.string(), + type: z.string(), + version: z.string() }); export const logstash_types_pipeline_settings = z.object({ - 'pipeline.workers': z.number().register(z.globalRegistry, { - description: - 'The number of workers that will, in parallel, execute the filter and output stages of the pipeline.', - }), - 'pipeline.batch.size': z.number().register(z.globalRegistry, { - description: - 'The maximum number of events an individual worker thread will collect from inputs before attempting to execute its filters and outputs.', - }), - 'pipeline.batch.delay': z.number().register(z.globalRegistry, { - description: - 'When creating pipeline event batches, how long in milliseconds to wait for each event before dispatching an undersized batch to pipeline workers.', - }), - 'queue.type': z.string().register(z.globalRegistry, { - description: 'The internal queuing model to use for event buffering.', - }), - 'queue.max_bytes': z.string().register(z.globalRegistry, { - description: 'The total capacity of the queue (`queue.type: persisted`) in number of bytes.', - }), - 'queue.checkpoint.writes': z.number().register(z.globalRegistry, { - description: - 'The maximum number of written events before forcing a checkpoint when persistent queues are enabled (`queue.type: persisted`).', - }), + 'pipeline.workers': z.number().register(z.globalRegistry, { + description: 'The number of workers that will, in parallel, execute the filter and output stages of the pipeline.' + }), + 'pipeline.batch.size': z.number().register(z.globalRegistry, { + description: 'The maximum number of events an individual worker thread will collect from inputs before attempting to execute its filters and outputs.' + }), + 'pipeline.batch.delay': z.number().register(z.globalRegistry, { + description: 'When creating pipeline event batches, how long in milliseconds to wait for each event before dispatching an undersized batch to pipeline workers.' + }), + 'queue.type': z.string().register(z.globalRegistry, { + description: 'The internal queuing model to use for event buffering.' + }), + 'queue.max_bytes': z.string().register(z.globalRegistry, { + description: 'The total capacity of the queue (`queue.type: persisted`) in number of bytes.' + }), + 'queue.checkpoint.writes': z.number().register(z.globalRegistry, { + description: 'The maximum number of written events before forcing a checkpoint when persistent queues are enabled (`queue.type: persisted`).' + }) }); export const logstash_types_pipeline = z.object({ - description: z.string().register(z.globalRegistry, { - description: - 'A description of the pipeline.\nThis description is not used by Elasticsearch or Logstash.', - }), - last_modified: types_date_time, - pipeline: z.string().register(z.globalRegistry, { - description: 'The configuration for the pipeline.', - }), - pipeline_metadata: logstash_types_pipeline_metadata, - pipeline_settings: logstash_types_pipeline_settings, - username: z.string().register(z.globalRegistry, { - description: 'The user who last updated the pipeline.', - }), + description: z.string().register(z.globalRegistry, { + description: 'A description of the pipeline.\nThis description is not used by Elasticsearch or Logstash.' + }), + last_modified: types_date_time, + pipeline: z.string().register(z.globalRegistry, { + description: 'The configuration for the pipeline.' + }), + pipeline_metadata: logstash_types_pipeline_metadata, + pipeline_settings: logstash_types_pipeline_settings, + username: z.string().register(z.globalRegistry, { + description: 'The user who last updated the pipeline.' + }) }); export const global_mget_operation = z.object({ - _id: types_id, - _index: z.optional(types_index_name), - routing: z.optional(types_routing), - _source: z.optional(global_search_types_source_config), - stored_fields: z.optional(types_fields), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), + _id: types_id, + _index: z.optional(types_index_name), + routing: z.optional(types_routing), + _source: z.optional(global_search_types_source_config), + stored_fields: z.optional(types_fields), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type) }); export const global_mget_multi_get_error = z.object({ - error: types_error_cause, - _id: types_id, - _index: types_index_name, + error: types_error_cause, + _id: types_id, + _index: types_index_name }); export const global_mget_response_item = z.union([ - global_get_get_result, - global_mget_multi_get_error, + global_get_get_result, + global_mget_multi_get_error ]); export const migration_deprecations_deprecation_level = z.enum([ - 'none', - 'info', - 'warning', - 'critical', + 'none', + 'info', + 'warning', + 'critical' ]); export const migration_deprecations_deprecation = z.object({ - details: z.optional( - z.string().register(z.globalRegistry, { - description: 'Optional details about the deprecation warning.', - }) - ), - level: migration_deprecations_deprecation_level, - message: z.string().register(z.globalRegistry, { - description: 'Descriptive information about the deprecation warning.', - }), - url: z.string().register(z.globalRegistry, { - description: - 'A link to the breaking change documentation, where you can find more information about this change.', - }), - resolve_during_rolling_upgrade: z.boolean(), - _meta: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + details: z.optional(z.string().register(z.globalRegistry, { + description: 'Optional details about the deprecation warning.' + })), + level: migration_deprecations_deprecation_level, + message: z.string().register(z.globalRegistry, { + description: 'Descriptive information about the deprecation warning.' + }), + url: z.string().register(z.globalRegistry, { + description: 'A link to the breaking change documentation, where you can find more information about this change.' + }), + resolve_during_rolling_upgrade: z.boolean(), + _meta: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))) }); export const migration_get_feature_upgrade_status_migration_status = z.enum([ - 'NO_MIGRATION_NEEDED', - 'MIGRATION_NEEDED', - 'IN_PROGRESS', - 'ERROR', + 'NO_MIGRATION_NEEDED', + 'MIGRATION_NEEDED', + 'IN_PROGRESS', + 'ERROR' ]); export const migration_get_feature_upgrade_status_migration_feature_index_info = z.object({ - index: types_index_name, - version: types_version_string, - failure_cause: z.optional(types_error_cause), + index: types_index_name, + version: types_version_string, + failure_cause: z.optional(types_error_cause) }); export const migration_get_feature_upgrade_status_migration_feature = z.object({ - feature_name: z.string(), - minimum_index_version: types_version_string, - migration_status: migration_get_feature_upgrade_status_migration_status, - indices: z.array(migration_get_feature_upgrade_status_migration_feature_index_info), + feature_name: z.string(), + minimum_index_version: types_version_string, + migration_status: migration_get_feature_upgrade_status_migration_status, + indices: z.array(migration_get_feature_upgrade_status_migration_feature_index_info) }); export const migration_post_feature_upgrade_migration_feature = z.object({ - feature_name: z.string(), + feature_name: z.string() }); export const ml_types_rule_action = z.enum(['skip_result', 'skip_model_update']); -export const ml_types_applies_to = z.enum(['actual', 'typical', 'diff_from_typical', 'time']); +export const ml_types_applies_to = z.enum([ + 'actual', + 'typical', + 'diff_from_typical', + 'time' +]); -export const ml_types_condition_operator = z.enum(['gt', 'gte', 'lt', 'lte']); +export const ml_types_condition_operator = z.enum([ + 'gt', + 'gte', + 'lt', + 'lte' +]); export const ml_types_rule_condition = z.object({ - applies_to: ml_types_applies_to, - operator: ml_types_condition_operator, - value: z.number().register(z.globalRegistry, { - description: 'The value that is compared against the `applies_to` field using the operator.', - }), + applies_to: ml_types_applies_to, + operator: ml_types_condition_operator, + value: z.number().register(z.globalRegistry, { + description: 'The value that is compared against the `applies_to` field using the operator.' + }) }); export const ml_types_filter_type = z.enum(['include', 'exclude']); export const ml_types_filter_ref = z.object({ - filter_id: types_id, - filter_type: z.optional(ml_types_filter_type), + filter_id: types_id, + filter_type: z.optional(ml_types_filter_type) }); export const ml_types_detection_rule = z.object({ - actions: z.optional( - z.array(ml_types_rule_action).register(z.globalRegistry, { - description: - 'The set of actions to be triggered when the rule applies. If more than one action is specified the effects of all actions are combined.', - }) - ), - conditions: z.optional( - z.array(ml_types_rule_condition).register(z.globalRegistry, { - description: - 'An array of numeric conditions when the rule applies. A rule must either have a non-empty scope or at least one condition. Multiple conditions are combined together with a logical AND.', - }) - ), - scope: z.optional( - z.record(z.string(), ml_types_filter_ref).register(z.globalRegistry, { - description: - 'A scope of series where the rule applies. A rule must either have a non-empty scope or at least one condition. By default, the scope includes all series. Scoping is allowed for any of the fields that are also specified in `by_field_name`, `over_field_name`, or `partition_field_name`.', - }) - ), -}); - -export const ml_types_exclude_frequent = z.enum(['all', 'none', 'by', 'over']); + actions: z.optional(z.array(ml_types_rule_action).register(z.globalRegistry, { + description: 'The set of actions to be triggered when the rule applies. If more than one action is specified the effects of all actions are combined.' + })), + conditions: z.optional(z.array(ml_types_rule_condition).register(z.globalRegistry, { + description: 'An array of numeric conditions when the rule applies. A rule must either have a non-empty scope or at least one condition. Multiple conditions are combined together with a logical AND.' + })), + scope: z.optional(z.record(z.string(), ml_types_filter_ref).register(z.globalRegistry, { + description: 'A scope of series where the rule applies. A rule must either have a non-empty scope or at least one condition. By default, the scope includes all series. Scoping is allowed for any of the fields that are also specified in `by_field_name`, `over_field_name`, or `partition_field_name`.' + })) +}); + +export const ml_types_exclude_frequent = z.enum([ + 'all', + 'none', + 'by', + 'over' +]); export const ml_types_detector = z.object({ - by_field_name: z.optional(types_field), - custom_rules: z.optional( - z.array(ml_types_detection_rule).register(z.globalRegistry, { - description: - 'Custom rules enable you to customize the way detectors operate. For example, a rule may dictate conditions under which results should be skipped. Kibana refers to custom rules as job rules.', - }) - ), - detector_description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the detector.', - }) - ), - detector_index: z.optional( - z.number().register(z.globalRegistry, { - description: - 'A unique identifier for the detector. This identifier is based on the order of the detectors in the `analysis_config`, starting at zero. If you specify a value for this property, it is ignored.', - }) - ), - exclude_frequent: z.optional(ml_types_exclude_frequent), - field_name: z.optional(types_field), - function: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The analysis function that is used. For example, `count`, `rare`, `mean`, `min`, `max`, or `sum`.', - }) - ), - over_field_name: z.optional(types_field), - partition_field_name: z.optional(types_field), - use_null: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Defines whether a new series is used as the null series when there is no value for the by or partition fields.', - }) - ), + by_field_name: z.optional(types_field), + custom_rules: z.optional(z.array(ml_types_detection_rule).register(z.globalRegistry, { + description: 'Custom rules enable you to customize the way detectors operate. For example, a rule may dictate conditions under which results should be skipped. Kibana refers to custom rules as job rules.' + })), + detector_description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the detector.' + })), + detector_index: z.optional(z.number().register(z.globalRegistry, { + description: 'A unique identifier for the detector. This identifier is based on the order of the detectors in the `analysis_config`, starting at zero. If you specify a value for this property, it is ignored.' + })), + exclude_frequent: z.optional(ml_types_exclude_frequent), + field_name: z.optional(types_field), + function: z.optional(z.string().register(z.globalRegistry, { + description: 'The analysis function that is used. For example, `count`, `rare`, `mean`, `min`, `max`, or `sum`.' + })), + over_field_name: z.optional(types_field), + partition_field_name: z.optional(types_field), + use_null: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Defines whether a new series is used as the null series when there is no value for the by or partition fields.' + })) }); export const ml_types_per_partition_categorization = z.object({ - enabled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'To enable this setting, you must also set the `partition_field_name` property to the same value in every detector that uses the keyword `mlcategory`. Otherwise, job creation fails.', - }) - ), - stop_on_warn: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'This setting can be set to true only if per-partition categorization is enabled. If true, both categorization and subsequent anomaly detection stops for partitions where the categorization status changes to warn. This setting makes it viable to have a job where it is expected that categorization works well for some partitions but not others; you do not pay the cost of bad categorization forever in the partitions where it works badly.', - }) - ), + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'To enable this setting, you must also set the `partition_field_name` property to the same value in every detector that uses the keyword `mlcategory`. Otherwise, job creation fails.' + })), + stop_on_warn: z.optional(z.boolean().register(z.globalRegistry, { + description: 'This setting can be set to true only if per-partition categorization is enabled. If true, both categorization and subsequent anomaly detection stops for partitions where the categorization status changes to warn. This setting makes it viable to have a job where it is expected that categorization works well for some partitions but not others; you do not pay the cost of bad categorization forever in the partitions where it works badly.' + })) }); export const ml_types_dataframe_evaluation_classification_metrics_auc_roc = z.object({ - class_name: z.optional(types_name), - include_curve: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether or not the curve should be returned in addition to the score. Default value is false.', - }) - ), + class_name: z.optional(types_name), + include_curve: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether or not the curve should be returned in addition to the score. Default value is false.' + })) }); export const ml_types_dataframe_evaluation_metrics = z.object({ - auc_roc: z.optional(ml_types_dataframe_evaluation_classification_metrics_auc_roc), - precision: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'Precision of predictions (per-class and average).', - }) - ), - recall: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'Recall of predictions (per-class and average).', - }) - ), -}); - -export const ml_types_dataframe_evaluation_classification_metrics = - ml_types_dataframe_evaluation_metrics.and( - z.object({ - accuracy: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'Accuracy of predictions (per-class and overall).', - }) - ), - multiclass_confusion_matrix: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'Multiclass confusion matrix.', - }) - ), - }) - ); + auc_roc: z.optional(ml_types_dataframe_evaluation_classification_metrics_auc_roc), + precision: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Precision of predictions (per-class and average).' + })), + recall: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Recall of predictions (per-class and average).' + })) +}); + +export const ml_types_dataframe_evaluation_classification_metrics = ml_types_dataframe_evaluation_metrics.and(z.object({ + accuracy: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Accuracy of predictions (per-class and overall).' + })), + multiclass_confusion_matrix: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Multiclass confusion matrix.' + })) +})); export const ml_types_dataframe_evaluation_classification = z.object({ - actual_field: types_field, - predicted_field: z.optional(types_field), - top_classes_field: z.optional(types_field), - metrics: z.optional(ml_types_dataframe_evaluation_classification_metrics), + actual_field: types_field, + predicted_field: z.optional(types_field), + top_classes_field: z.optional(types_field), + metrics: z.optional(ml_types_dataframe_evaluation_classification_metrics) }); -export const ml_types_dataframe_evaluation_outlier_detection_metrics = - ml_types_dataframe_evaluation_metrics.and( - z.object({ - confusion_matrix: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'Accuracy of predictions (per-class and overall).', - }) - ), - }) - ); +export const ml_types_dataframe_evaluation_outlier_detection_metrics = ml_types_dataframe_evaluation_metrics.and(z.object({ + confusion_matrix: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Accuracy of predictions (per-class and overall).' + })) +})); export const ml_types_dataframe_evaluation_outlier_detection = z.object({ - actual_field: types_field, - predicted_probability_field: types_field, - metrics: z.optional(ml_types_dataframe_evaluation_outlier_detection_metrics), + actual_field: types_field, + predicted_probability_field: types_field, + metrics: z.optional(ml_types_dataframe_evaluation_outlier_detection_metrics) }); export const ml_types_dataframe_evaluation_regression_metrics_msle = z.object({ - offset: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Defines the transition point at which you switch from minimizing quadratic error to minimizing quadratic log error. Defaults to 1.', - }) - ), + offset: z.optional(z.number().register(z.globalRegistry, { + description: 'Defines the transition point at which you switch from minimizing quadratic error to minimizing quadratic log error. Defaults to 1.' + })) }); export const ml_types_dataframe_evaluation_regression_metrics_huber = z.object({ - delta: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Approximates 1/2 (prediction - actual)2 for values much less than delta and approximates a straight line with slope delta for values much larger than delta. Defaults to 1. Delta needs to be greater than 0.', - }) - ), + delta: z.optional(z.number().register(z.globalRegistry, { + description: 'Approximates 1/2 (prediction - actual)2 for values much less than delta and approximates a straight line with slope delta for values much larger than delta. Defaults to 1. Delta needs to be greater than 0.' + })) }); export const ml_types_dataframe_evaluation_regression_metrics = z.object({ - mse: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'Average squared difference between the predicted values and the actual (ground truth) value. For more information, read this wiki article.', - }) - ), - msle: z.optional(ml_types_dataframe_evaluation_regression_metrics_msle), - huber: z.optional(ml_types_dataframe_evaluation_regression_metrics_huber), - r_squared: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'Proportion of the variance in the dependent variable that is predictable from the independent variables.', - }) - ), + mse: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Average squared difference between the predicted values and the actual (ground truth) value. For more information, read this wiki article.' + })), + msle: z.optional(ml_types_dataframe_evaluation_regression_metrics_msle), + huber: z.optional(ml_types_dataframe_evaluation_regression_metrics_huber), + r_squared: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Proportion of the variance in the dependent variable that is predictable from the independent variables.' + })) }); export const ml_types_dataframe_evaluation_regression = z.object({ - actual_field: types_field, - predicted_field: types_field, - metrics: z.optional(ml_types_dataframe_evaluation_regression_metrics), + actual_field: types_field, + predicted_field: types_field, + metrics: z.optional(ml_types_dataframe_evaluation_regression_metrics) }); export const ml_types_dataframe_evaluation_container = z.object({ - classification: z.optional(ml_types_dataframe_evaluation_classification), - outlier_detection: z.optional(ml_types_dataframe_evaluation_outlier_detection), - regression: z.optional(ml_types_dataframe_evaluation_regression), + classification: z.optional(ml_types_dataframe_evaluation_classification), + outlier_detection: z.optional(ml_types_dataframe_evaluation_outlier_detection), + regression: z.optional(ml_types_dataframe_evaluation_regression) }); export const ml_evaluate_data_frame_dataframe_evaluation_summary_auc_roc_curve_item = z.object({ - tpr: z.number(), - fpr: z.number(), - threshold: z.number(), + tpr: z.number(), + fpr: z.number(), + threshold: z.number() }); export const ml_evaluate_data_frame_dataframe_evaluation_value = z.object({ - value: z.number(), + value: z.number() }); -export const ml_evaluate_data_frame_dataframe_evaluation_summary_auc_roc = - ml_evaluate_data_frame_dataframe_evaluation_value.and( - z.object({ - curve: z.optional( - z.array(ml_evaluate_data_frame_dataframe_evaluation_summary_auc_roc_curve_item) - ), - }) - ); +export const ml_evaluate_data_frame_dataframe_evaluation_summary_auc_roc = ml_evaluate_data_frame_dataframe_evaluation_value.and(z.object({ + curve: z.optional(z.array(ml_evaluate_data_frame_dataframe_evaluation_summary_auc_roc_curve_item)) +})); -export const ml_evaluate_data_frame_dataframe_evaluation_class = - ml_evaluate_data_frame_dataframe_evaluation_value.and( - z.object({ - class_name: types_name, - }) - ); +export const ml_evaluate_data_frame_dataframe_evaluation_class = ml_evaluate_data_frame_dataframe_evaluation_value.and(z.object({ + class_name: types_name +})); export const ml_evaluate_data_frame_dataframe_classification_summary_accuracy = z.object({ - classes: z.array(ml_evaluate_data_frame_dataframe_evaluation_class), - overall_accuracy: z.number(), + classes: z.array(ml_evaluate_data_frame_dataframe_evaluation_class), + overall_accuracy: z.number() }); export const ml_evaluate_data_frame_confusion_matrix_prediction = z.object({ - predicted_class: types_name, - count: z.number(), + predicted_class: types_name, + count: z.number() }); export const ml_evaluate_data_frame_confusion_matrix_item = z.object({ - actual_class: types_name, - actual_class_doc_count: z.number(), - predicted_classes: z.array(ml_evaluate_data_frame_confusion_matrix_prediction), - other_predicted_class_doc_count: z.number(), + actual_class: types_name, + actual_class_doc_count: z.number(), + predicted_classes: z.array(ml_evaluate_data_frame_confusion_matrix_prediction), + other_predicted_class_doc_count: z.number() }); -export const ml_evaluate_data_frame_dataframe_classification_summary_multiclass_confusion_matrix = - z.object({ +export const ml_evaluate_data_frame_dataframe_classification_summary_multiclass_confusion_matrix = z.object({ confusion_matrix: z.array(ml_evaluate_data_frame_confusion_matrix_item), - other_actual_class_count: z.number(), - }); + other_actual_class_count: z.number() +}); export const ml_evaluate_data_frame_dataframe_classification_summary_precision = z.object({ - classes: z.array(ml_evaluate_data_frame_dataframe_evaluation_class), - avg_precision: z.number(), + classes: z.array(ml_evaluate_data_frame_dataframe_evaluation_class), + avg_precision: z.number() }); export const ml_evaluate_data_frame_dataframe_classification_summary_recall = z.object({ - classes: z.array(ml_evaluate_data_frame_dataframe_evaluation_class), - avg_recall: z.number(), + classes: z.array(ml_evaluate_data_frame_dataframe_evaluation_class), + avg_recall: z.number() }); export const ml_evaluate_data_frame_dataframe_classification_summary = z.object({ - auc_roc: z.optional(ml_evaluate_data_frame_dataframe_evaluation_summary_auc_roc), - accuracy: z.optional(ml_evaluate_data_frame_dataframe_classification_summary_accuracy), - multiclass_confusion_matrix: z.optional( - ml_evaluate_data_frame_dataframe_classification_summary_multiclass_confusion_matrix - ), - precision: z.optional(ml_evaluate_data_frame_dataframe_classification_summary_precision), - recall: z.optional(ml_evaluate_data_frame_dataframe_classification_summary_recall), + auc_roc: z.optional(ml_evaluate_data_frame_dataframe_evaluation_summary_auc_roc), + accuracy: z.optional(ml_evaluate_data_frame_dataframe_classification_summary_accuracy), + multiclass_confusion_matrix: z.optional(ml_evaluate_data_frame_dataframe_classification_summary_multiclass_confusion_matrix), + precision: z.optional(ml_evaluate_data_frame_dataframe_classification_summary_precision), + recall: z.optional(ml_evaluate_data_frame_dataframe_classification_summary_recall) }); export const ml_evaluate_data_frame_confusion_matrix_threshold = z.object({ - tp: z.number().register(z.globalRegistry, { - description: 'True Positive', - }), - fp: z.number().register(z.globalRegistry, { - description: 'False Positive', - }), - tn: z.number().register(z.globalRegistry, { - description: 'True Negative', - }), - fn: z.number().register(z.globalRegistry, { - description: 'False Negative', - }), + tp: z.number().register(z.globalRegistry, { + description: 'True Positive' + }), + fp: z.number().register(z.globalRegistry, { + description: 'False Positive' + }), + tn: z.number().register(z.globalRegistry, { + description: 'True Negative' + }), + fn: z.number().register(z.globalRegistry, { + description: 'False Negative' + }) }); export const ml_evaluate_data_frame_dataframe_outlier_detection_summary = z.object({ - auc_roc: z.optional(ml_evaluate_data_frame_dataframe_evaluation_summary_auc_roc), - precision: z.optional( - z.record(z.string(), z.number()).register(z.globalRegistry, { - description: - 'Set the different thresholds of the outlier score at where the metric is calculated.', - }) - ), - recall: z.optional( - z.record(z.string(), z.number()).register(z.globalRegistry, { - description: - 'Set the different thresholds of the outlier score at where the metric is calculated.', - }) - ), - confusion_matrix: z.optional( - z - .record(z.string(), ml_evaluate_data_frame_confusion_matrix_threshold) - .register(z.globalRegistry, { - description: - 'Set the different thresholds of the outlier score at where the metrics (`tp` - true positive, `fp` - false positive, `tn` - true negative, `fn` - false negative) are calculated.', - }) - ), + auc_roc: z.optional(ml_evaluate_data_frame_dataframe_evaluation_summary_auc_roc), + precision: z.optional(z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'Set the different thresholds of the outlier score at where the metric is calculated.' + })), + recall: z.optional(z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'Set the different thresholds of the outlier score at where the metric is calculated.' + })), + confusion_matrix: z.optional(z.record(z.string(), ml_evaluate_data_frame_confusion_matrix_threshold).register(z.globalRegistry, { + description: 'Set the different thresholds of the outlier score at where the metrics (`tp` - true positive, `fp` - false positive, `tn` - true negative, `fn` - false negative) are calculated.' + })) }); export const ml_evaluate_data_frame_dataframe_regression_summary = z.object({ - huber: z.optional(ml_evaluate_data_frame_dataframe_evaluation_value), - mse: z.optional(ml_evaluate_data_frame_dataframe_evaluation_value), - msle: z.optional(ml_evaluate_data_frame_dataframe_evaluation_value), - r_squared: z.optional(ml_evaluate_data_frame_dataframe_evaluation_value), + huber: z.optional(ml_evaluate_data_frame_dataframe_evaluation_value), + mse: z.optional(ml_evaluate_data_frame_dataframe_evaluation_value), + msle: z.optional(ml_evaluate_data_frame_dataframe_evaluation_value), + r_squared: z.optional(ml_evaluate_data_frame_dataframe_evaluation_value) }); export const ml_types_dataframe_analysis_analyzed_fields = z.object({ - includes: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'An array of strings that defines the fields that will be excluded from the analysis. You do not need to add fields with unsupported data types to excludes, these fields are excluded from the analysis automatically.', - }) - ), - excludes: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'An array of strings that defines the fields that will be included in the analysis.', - }) - ), + includes: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'An array of strings that defines the fields that will be excluded from the analysis. You do not need to add fields with unsupported data types to excludes, these fields are excluded from the analysis automatically.' + })), + excludes: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'An array of strings that defines the fields that will be included in the analysis.' + })) }); export const ml_types_dataframe_analytics_destination = z.object({ - index: types_index_name, - results_field: z.optional(types_field), + index: types_index_name, + results_field: z.optional(types_field) }); export const ml_types_dataframe_analysis_feature_processor_frequency_encoding = z.object({ - feature_name: types_name, - field: types_field, - frequency_map: z.record(z.string(), z.number()).register(z.globalRegistry, { - description: - 'The resulting frequency map for the field value. If the field value is missing from the frequency_map, the resulting value is 0.', - }), + feature_name: types_name, + field: types_field, + frequency_map: z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'The resulting frequency map for the field value. If the field value is missing from the frequency_map, the resulting value is 0.' + }) }); export const ml_types_dataframe_analysis_feature_processor_multi_encoding = z.object({ - processors: z.array(z.number()).register(z.globalRegistry, { - description: 'The ordered array of custom processors to execute. Must be more than 1.', - }), + processors: z.array(z.number()).register(z.globalRegistry, { + description: 'The ordered array of custom processors to execute. Must be more than 1.' + }) }); export const ml_types_dataframe_analysis_feature_processor_n_gram_encoding = z.object({ - feature_prefix: z.optional( - z.string().register(z.globalRegistry, { - description: 'The feature name prefix. Defaults to ngram__.', - }) - ), - field: types_field, - length: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Specifies the length of the n-gram substring. Defaults to 50. Must be greater than 0.', - }) - ), - n_grams: z.array(z.number()).register(z.globalRegistry, { - description: - 'Specifies which n-grams to gather. It’s an array of integer values where the minimum value is 1, and a maximum value is 5.', - }), - start: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Specifies the zero-indexed start of the n-gram substring. Negative values are allowed for encoding n-grams of string suffixes. Defaults to 0.', - }) - ), - custom: z.optional(z.boolean()), + feature_prefix: z.optional(z.string().register(z.globalRegistry, { + description: 'The feature name prefix. Defaults to ngram__.' + })), + field: types_field, + length: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the length of the n-gram substring. Defaults to 50. Must be greater than 0.' + })), + n_grams: z.array(z.number()).register(z.globalRegistry, { + description: 'Specifies which n-grams to gather. It’s an array of integer values where the minimum value is 1, and a maximum value is 5.' + }), + start: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the zero-indexed start of the n-gram substring. Negative values are allowed for encoding n-grams of string suffixes. Defaults to 0.' + })), + custom: z.optional(z.boolean()) }); export const ml_types_dataframe_analysis_feature_processor_one_hot_encoding = z.object({ - field: types_field, - hot_map: z.string().register(z.globalRegistry, { - description: 'The one hot map mapping the field value with the column name.', - }), + field: types_field, + hot_map: z.string().register(z.globalRegistry, { + description: 'The one hot map mapping the field value with the column name.' + }) }); export const ml_types_dataframe_analysis_feature_processor_target_mean_encoding = z.object({ - default_value: z.number().register(z.globalRegistry, { - description: 'The default value if field value is not found in the target_map.', - }), - feature_name: types_name, - field: types_field, - target_map: z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'The field value to target mean transition map.', - }), + default_value: z.number().register(z.globalRegistry, { + description: 'The default value if field value is not found in the target_map.' + }), + feature_name: types_name, + field: types_field, + target_map: z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'The field value to target mean transition map.' + }) }); export const ml_types_dataframe_analysis_feature_processor = z.object({ - frequency_encoding: z.optional(ml_types_dataframe_analysis_feature_processor_frequency_encoding), - multi_encoding: z.optional(ml_types_dataframe_analysis_feature_processor_multi_encoding), - n_gram_encoding: z.optional(ml_types_dataframe_analysis_feature_processor_n_gram_encoding), - one_hot_encoding: z.optional(ml_types_dataframe_analysis_feature_processor_one_hot_encoding), - target_mean_encoding: z.optional( - ml_types_dataframe_analysis_feature_processor_target_mean_encoding - ), + frequency_encoding: z.optional(ml_types_dataframe_analysis_feature_processor_frequency_encoding), + multi_encoding: z.optional(ml_types_dataframe_analysis_feature_processor_multi_encoding), + n_gram_encoding: z.optional(ml_types_dataframe_analysis_feature_processor_n_gram_encoding), + one_hot_encoding: z.optional(ml_types_dataframe_analysis_feature_processor_one_hot_encoding), + target_mean_encoding: z.optional(ml_types_dataframe_analysis_feature_processor_target_mean_encoding) }); export const ml_types_dataframe_analysis = z.object({ - alpha: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero.', - }) - ), - dependent_variable: z.string().register(z.globalRegistry, { - description: - 'Defines which field of the document is to be predicted. It must match one of the fields in the index being used to train. If this field is missing from a document, then that document will not be used for training, but a prediction with the trained model will be generated for it. It is also known as continuous target variable.\nFor classification analysis, the data type of the field must be numeric (`integer`, `short`, `long`, `byte`), categorical (`ip` or `keyword`), or `boolean`. There must be no more than 30 different values in this field.\nFor regression analysis, the data type of the field must be numeric.', - }), - downsample_factor: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1.', - }) - ), - early_stopping_enabled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Advanced configuration option. Specifies whether the training process should finish if it is not finding any better performing models. If disabled, the training process can take significantly longer and the chance of finding a better performing model is unremarkable.', - }) - ), - eta: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1.', - }) - ), - eta_growth_rate_per_tree: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option. Specifies the rate at which `eta` increases for each new tree that is added to the forest. For example, a rate of 1.05 increases `eta` by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2.', - }) - ), - feature_bag_fraction: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization.', - }) - ), - feature_processors: z.optional( - z.array(ml_types_dataframe_analysis_feature_processor).register(z.globalRegistry, { - description: - 'Advanced configuration option. A collection of feature preprocessors that modify one or more included fields. The analysis uses the resulting one or more features instead of the original document field. However, these features are ephemeral; they are not stored in the destination index. Multiple `feature_processors` entries can refer to the same document fields. Automatic categorical feature encoding still occurs for the fields that are unprocessed by a custom processor or that have categorical values. Use this property only if you want to override the automatic feature encoding of the specified fields.', - }) - ), - gamma: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value.', - }) - ), - lambda: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value.', - }) - ), - max_optimization_rounds_per_hyperparameter: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization.', - }) - ), - max_trees: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization.', - }) - ), - num_top_feature_importance_values: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option. Specifies the maximum number of feature importance values per document to return. By default, no feature importance calculation occurs.', - }) - ), - prediction_field_name: z.optional(types_field), - randomize_seed: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Defines the seed for the random generator that is used to pick training data. By default, it is randomly generated. Set it to a specific value to use the same training data each time you start a job (assuming other related parameters such as `source` and `analyzed_fields` are the same).', - }) - ), - soft_tree_depth_limit: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.', - }) - ), - soft_tree_depth_tolerance: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01.', - }) - ), - training_percent: z.optional(types_percentage), -}); - -export const ml_types_dataframe_analysis_classification = ml_types_dataframe_analysis.and( - z.object({ + alpha: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero.' + })), + dependent_variable: z.string().register(z.globalRegistry, { + description: 'Defines which field of the document is to be predicted. It must match one of the fields in the index being used to train. If this field is missing from a document, then that document will not be used for training, but a prediction with the trained model will be generated for it. It is also known as continuous target variable.\nFor classification analysis, the data type of the field must be numeric (`integer`, `short`, `long`, `byte`), categorical (`ip` or `keyword`), or `boolean`. There must be no more than 30 different values in this field.\nFor regression analysis, the data type of the field must be numeric.' + }), + downsample_factor: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1.' + })), + early_stopping_enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Advanced configuration option. Specifies whether the training process should finish if it is not finding any better performing models. If disabled, the training process can take significantly longer and the chance of finding a better performing model is unremarkable.' + })), + eta: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1.' + })), + eta_growth_rate_per_tree: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option. Specifies the rate at which `eta` increases for each new tree that is added to the forest. For example, a rate of 1.05 increases `eta` by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2.' + })), + feature_bag_fraction: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization.' + })), + feature_processors: z.optional(z.array(ml_types_dataframe_analysis_feature_processor).register(z.globalRegistry, { + description: 'Advanced configuration option. A collection of feature preprocessors that modify one or more included fields. The analysis uses the resulting one or more features instead of the original document field. However, these features are ephemeral; they are not stored in the destination index. Multiple `feature_processors` entries can refer to the same document fields. Automatic categorical feature encoding still occurs for the fields that are unprocessed by a custom processor or that have categorical values. Use this property only if you want to override the automatic feature encoding of the specified fields.' + })), + gamma: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value.' + })), + lambda: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value.' + })), + max_optimization_rounds_per_hyperparameter: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization.' + })), + max_trees: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization.' + })), + num_top_feature_importance_values: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option. Specifies the maximum number of feature importance values per document to return. By default, no feature importance calculation occurs.' + })), + prediction_field_name: z.optional(types_field), + randomize_seed: z.optional(z.number().register(z.globalRegistry, { + description: 'Defines the seed for the random generator that is used to pick training data. By default, it is randomly generated. Set it to a specific value to use the same training data each time you start a job (assuming other related parameters such as `source` and `analyzed_fields` are the same).' + })), + soft_tree_depth_limit: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.' + })), + soft_tree_depth_tolerance: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01.' + })), + training_percent: z.optional(types_percentage) +}); + +export const ml_types_dataframe_analysis_classification = ml_types_dataframe_analysis.and(z.object({ class_assignment_objective: z.optional(z.string()), - num_top_classes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Defines the number of categories for which the predicted probabilities are reported. It must be non-negative or -1. If it is -1 or greater than the total number of categories, probabilities are reported for all categories; if you have a large number of categories, there could be a significant effect on the size of your destination index. NOTE: To use the AUC ROC evaluation method, `num_top_classes` must be set to -1 or a value greater than or equal to the total number of categories.', - }) - ), - }) -); + num_top_classes: z.optional(z.number().register(z.globalRegistry, { + description: 'Defines the number of categories for which the predicted probabilities are reported. It must be non-negative or -1. If it is -1 or greater than the total number of categories, probabilities are reported for all categories; if you have a large number of categories, there could be a significant effect on the size of your destination index. NOTE: To use the AUC ROC evaluation method, `num_top_classes` must be set to -1 or a value greater than or equal to the total number of categories.' + })) +})); export const ml_types_dataframe_analysis_outlier_detection = z.object({ - compute_feature_influence: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Specifies whether the feature influence calculation is enabled.', - }) - ), - feature_influence_threshold: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The minimum outlier score that a document needs to have in order to calculate its feature influence score. Value range: 0-1.', - }) - ), - method: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The method that outlier detection uses. Available methods are `lof`, `ldof`, `distance_kth_nn`, `distance_knn`, and `ensemble`. The default value is ensemble, which means that outlier detection uses an ensemble of different methods and normalises and combines their individual outlier scores to obtain the overall outlier score.', - }) - ), - n_neighbors: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Defines the value for how many nearest neighbors each method of outlier detection uses to calculate its outlier score. When the value is not set, different values are used for different ensemble members. This default behavior helps improve the diversity in the ensemble; only override it if you are confident that the value you choose is appropriate for the data set.', - }) - ), - outlier_fraction: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The proportion of the data set that is assumed to be outlying prior to outlier detection. For example, 0.05 means it is assumed that 5% of values are real outliers and 95% are inliers.', - }) - ), - standardization_enabled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the following operation is performed on the columns before computing outlier scores: `(x_i - mean(x_i)) / sd(x_i)`.', - }) - ), -}); - -export const ml_types_dataframe_analysis_regression = ml_types_dataframe_analysis.and( - z.object({ - loss_function: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The loss function used during regression. Available options are `mse` (mean squared error), `msle` (mean squared logarithmic error), `huber` (Pseudo-Huber loss).', - }) - ), - loss_function_parameter: z.optional( - z.number().register(z.globalRegistry, { - description: 'A positive number that is used as a parameter to the `loss_function`.', - }) - ), - }) -); + compute_feature_influence: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether the feature influence calculation is enabled.' + })), + feature_influence_threshold: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum outlier score that a document needs to have in order to calculate its feature influence score. Value range: 0-1.' + })), + method: z.optional(z.string().register(z.globalRegistry, { + description: 'The method that outlier detection uses. Available methods are `lof`, `ldof`, `distance_kth_nn`, `distance_knn`, and `ensemble`. The default value is ensemble, which means that outlier detection uses an ensemble of different methods and normalises and combines their individual outlier scores to obtain the overall outlier score.' + })), + n_neighbors: z.optional(z.number().register(z.globalRegistry, { + description: 'Defines the value for how many nearest neighbors each method of outlier detection uses to calculate its outlier score. When the value is not set, different values are used for different ensemble members. This default behavior helps improve the diversity in the ensemble; only override it if you are confident that the value you choose is appropriate for the data set.' + })), + outlier_fraction: z.optional(z.number().register(z.globalRegistry, { + description: 'The proportion of the data set that is assumed to be outlying prior to outlier detection. For example, 0.05 means it is assumed that 5% of values are real outliers and 95% are inliers.' + })), + standardization_enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the following operation is performed on the columns before computing outlier scores: `(x_i - mean(x_i)) / sd(x_i)`.' + })) +}); + +export const ml_types_dataframe_analysis_regression = ml_types_dataframe_analysis.and(z.object({ + loss_function: z.optional(z.string().register(z.globalRegistry, { + description: 'The loss function used during regression. Available options are `mse` (mean squared error), `msle` (mean squared logarithmic error), `huber` (Pseudo-Huber loss).' + })), + loss_function_parameter: z.optional(z.number().register(z.globalRegistry, { + description: 'A positive number that is used as a parameter to the `loss_function`.' + })) +})); export const ml_types_dataframe_analysis_container = z.object({ - classification: z.optional(ml_types_dataframe_analysis_classification), - outlier_detection: z.optional(ml_types_dataframe_analysis_outlier_detection), - regression: z.optional(ml_types_dataframe_analysis_regression), + classification: z.optional(ml_types_dataframe_analysis_classification), + outlier_detection: z.optional(ml_types_dataframe_analysis_outlier_detection), + regression: z.optional(ml_types_dataframe_analysis_regression) }); export const ml_types_dataframe_analytics_field_selection = z.object({ - is_included: z.boolean().register(z.globalRegistry, { - description: 'Whether the field is selected to be included in the analysis.', - }), - is_required: z.boolean().register(z.globalRegistry, { - description: 'Whether the field is required.', - }), - feature_type: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The feature type of this field for the analysis. May be categorical or numerical.', - }) - ), - mapping_types: z.array(z.string()).register(z.globalRegistry, { - description: 'The mapping types of the field.', - }), - name: types_field, - reason: z.optional( - z.string().register(z.globalRegistry, { - description: 'The reason a field is not selected to be included in the analysis.', - }) - ), + is_included: z.boolean().register(z.globalRegistry, { + description: 'Whether the field is selected to be included in the analysis.' + }), + is_required: z.boolean().register(z.globalRegistry, { + description: 'Whether the field is required.' + }), + feature_type: z.optional(z.string().register(z.globalRegistry, { + description: 'The feature type of this field for the analysis. May be categorical or numerical.' + })), + mapping_types: z.array(z.string()).register(z.globalRegistry, { + description: 'The mapping types of the field.' + }), + name: types_field, + reason: z.optional(z.string().register(z.globalRegistry, { + description: 'The reason a field is not selected to be included in the analysis.' + })) }); export const ml_types_dataframe_analytics_memory_estimation = z.object({ - expected_memory_with_disk: z.string().register(z.globalRegistry, { - description: - 'Estimated memory usage under the assumption that overflowing to disk is allowed during data frame analytics. expected_memory_with_disk is usually smaller than expected_memory_without_disk as using disk allows to limit the main memory needed to perform data frame analytics.', - }), - expected_memory_without_disk: z.string().register(z.globalRegistry, { - description: - 'Estimated memory usage under the assumption that the whole data frame analytics should happen in memory (i.e. without overflowing to disk).', - }), + expected_memory_with_disk: z.string().register(z.globalRegistry, { + description: 'Estimated memory usage under the assumption that overflowing to disk is allowed during data frame analytics. expected_memory_with_disk is usually smaller than expected_memory_without_disk as using disk allows to limit the main memory needed to perform data frame analytics.' + }), + expected_memory_without_disk: z.string().register(z.globalRegistry, { + description: 'Estimated memory usage under the assumption that the whole data frame analytics should happen in memory (i.e. without overflowing to disk).' + }) }); export const ml_types_page = z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of items.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of items to obtain.', - }) - ), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of items.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of items to obtain.' + })) }); export const types_duration_value_unit_seconds = types_unit_seconds; export const ml_types_bucket_influencer = z.object({ - anomaly_score: z.number().register(z.globalRegistry, { - description: - 'A normalized score between 0-100, which is calculated for each bucket influencer. This score might be updated as\nnewer data is analyzed.', - }), - bucket_span: types_duration_value_unit_seconds, - influencer_field_name: types_field, - initial_anomaly_score: z.number().register(z.globalRegistry, { - description: - 'The score between 0-100 for each bucket influencer. This score is the initial value that was calculated at the\ntime the bucket was processed.', - }), - is_interim: z.boolean().register(z.globalRegistry, { - description: - 'If true, this is an interim result. In other words, the results are calculated based on partial input data.', - }), - job_id: types_id, - probability: z.number().register(z.globalRegistry, { - description: - 'The probability that the bucket has this behavior, in the range 0 to 1. This value can be held to a high precision\nof over 300 decimal places, so the `anomaly_score` is provided as a human-readable and friendly interpretation of\nthis.', - }), - raw_anomaly_score: z.number().register(z.globalRegistry, { - description: 'Internal.', - }), - result_type: z.string().register(z.globalRegistry, { - description: 'Internal. This value is always set to `bucket_influencer`.', - }), - timestamp: types_epoch_time_unit_millis, - timestamp_string: z.optional(types_date_time), + anomaly_score: z.number().register(z.globalRegistry, { + description: 'A normalized score between 0-100, which is calculated for each bucket influencer. This score might be updated as\nnewer data is analyzed.' + }), + bucket_span: types_duration_value_unit_seconds, + influencer_field_name: types_field, + initial_anomaly_score: z.number().register(z.globalRegistry, { + description: 'The score between 0-100 for each bucket influencer. This score is the initial value that was calculated at the\ntime the bucket was processed.' + }), + is_interim: z.boolean().register(z.globalRegistry, { + description: 'If true, this is an interim result. In other words, the results are calculated based on partial input data.' + }), + job_id: types_id, + probability: z.number().register(z.globalRegistry, { + description: 'The probability that the bucket has this behavior, in the range 0 to 1. This value can be held to a high precision\nof over 300 decimal places, so the `anomaly_score` is provided as a human-readable and friendly interpretation of\nthis.' + }), + raw_anomaly_score: z.number().register(z.globalRegistry, { + description: 'Internal.' + }), + result_type: z.string().register(z.globalRegistry, { + description: 'Internal. This value is always set to `bucket_influencer`.' + }), + timestamp: types_epoch_time_unit_millis, + timestamp_string: z.optional(types_date_time) }); export const ml_types_bucket_summary = z.object({ - anomaly_score: z.number().register(z.globalRegistry, { - description: - 'The maximum anomaly score, between 0-100, for any of the bucket influencers. This is an overall, rate-limited\nscore for the job. All the anomaly records in the bucket contribute to this score. This value might be updated as\nnew data is analyzed.', - }), - bucket_influencers: z.array(ml_types_bucket_influencer), - bucket_span: types_duration_value_unit_seconds, - event_count: z.number().register(z.globalRegistry, { - description: 'The number of input data records processed in this bucket.', - }), - initial_anomaly_score: z.number().register(z.globalRegistry, { - description: - 'The maximum anomaly score for any of the bucket influencers. This is the initial value that was calculated at the\ntime the bucket was processed.', - }), - is_interim: z.boolean().register(z.globalRegistry, { - description: - 'If true, this is an interim result. In other words, the results are calculated based on partial input data.', - }), - job_id: types_id, - processing_time_ms: types_duration_value_unit_millis, - result_type: z.string().register(z.globalRegistry, { - description: 'Internal. This value is always set to bucket.', - }), - timestamp: types_epoch_time_unit_millis, - timestamp_string: z.optional(types_date_time), + anomaly_score: z.number().register(z.globalRegistry, { + description: 'The maximum anomaly score, between 0-100, for any of the bucket influencers. This is an overall, rate-limited\nscore for the job. All the anomaly records in the bucket contribute to this score. This value might be updated as\nnew data is analyzed.' + }), + bucket_influencers: z.array(ml_types_bucket_influencer), + bucket_span: types_duration_value_unit_seconds, + event_count: z.number().register(z.globalRegistry, { + description: 'The number of input data records processed in this bucket.' + }), + initial_anomaly_score: z.number().register(z.globalRegistry, { + description: 'The maximum anomaly score for any of the bucket influencers. This is the initial value that was calculated at the\ntime the bucket was processed.' + }), + is_interim: z.boolean().register(z.globalRegistry, { + description: 'If true, this is an interim result. In other words, the results are calculated based on partial input data.' + }), + job_id: types_id, + processing_time_ms: types_duration_value_unit_millis, + result_type: z.string().register(z.globalRegistry, { + description: 'Internal. This value is always set to bucket.' + }), + timestamp: types_epoch_time_unit_millis, + timestamp_string: z.optional(types_date_time) }); export const ml_types_calendar_event = z.object({ - calendar_id: z.optional(types_id), - event_id: z.optional(types_id), - description: z.string().register(z.globalRegistry, { - description: 'A description of the scheduled event.', - }), - end_time: types_date_time, - start_time: types_date_time, - skip_result: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'When true the model will not create results for this calendar period.', - }) - ), - skip_model_update: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'When true the model will not be updated for this calendar period.', - }) - ), - force_time_shift: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Shift time by this many seconds. For example adjust time for daylight savings changes', - }) - ), + calendar_id: z.optional(types_id), + event_id: z.optional(types_id), + description: z.string().register(z.globalRegistry, { + description: 'A description of the scheduled event.' + }), + end_time: types_date_time, + start_time: types_date_time, + skip_result: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When true the model will not create results for this calendar period.' + })), + skip_model_update: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When true the model will not be updated for this calendar period.' + })), + force_time_shift: z.optional(z.number().register(z.globalRegistry, { + description: 'Shift time by this many seconds. For example adjust time for daylight savings changes' + })) }); export const ml_get_calendars_calendar = z.object({ - calendar_id: types_id, - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the calendar.', + calendar_id: types_id, + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the calendar.' + })), + job_ids: z.array(types_id).register(z.globalRegistry, { + description: 'An array of anomaly detection job identifiers.' }) - ), - job_ids: z.array(types_id).register(z.globalRegistry, { - description: 'An array of anomaly detection job identifiers.', - }), }); export const types_category_id = z.number(); export const ml_types_category = z.object({ - category_id: types_ulong, - examples: z.array(z.string()).register(z.globalRegistry, { - description: 'A list of examples of actual values that matched the category.', - }), - grok_pattern: z.optional(types_grok_pattern), - job_id: types_id, - max_matching_length: types_ulong, - partition_field_name: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If per-partition categorization is enabled, this property identifies the field used to segment the categorization. It is not present when per-partition categorization is disabled.', - }) - ), - partition_field_value: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If per-partition categorization is enabled, this property identifies the value of the partition_field_name for the category. It is not present when per-partition categorization is disabled.', - }) - ), - regex: z.string().register(z.globalRegistry, { - description: 'A regular expression that is used to search for values that match the category.', - }), - terms: z.string().register(z.globalRegistry, { - description: - 'A space separated list of the common tokens that are matched in values of the category.', - }), - num_matches: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of messages that have been matched by this category. This is only guaranteed to have the latest accurate count after a job _flush or _close', - }) - ), - preferred_to_categories: z.optional( - z.array(types_id).register(z.globalRegistry, { - description: - 'A list of category_id entries that this current category encompasses. Any new message that is processed by the categorizer will match against this category and not any of the categories in this list. This is only guaranteed to have the latest accurate list of categories after a job _flush or _close', - }) - ), - p: z.optional(z.string()), - result_type: z.string(), - mlcategory: z.string(), + category_id: types_ulong, + examples: z.array(z.string()).register(z.globalRegistry, { + description: 'A list of examples of actual values that matched the category.' + }), + grok_pattern: z.optional(types_grok_pattern), + job_id: types_id, + max_matching_length: types_ulong, + partition_field_name: z.optional(z.string().register(z.globalRegistry, { + description: 'If per-partition categorization is enabled, this property identifies the field used to segment the categorization. It is not present when per-partition categorization is disabled.' + })), + partition_field_value: z.optional(z.string().register(z.globalRegistry, { + description: 'If per-partition categorization is enabled, this property identifies the value of the partition_field_name for the category. It is not present when per-partition categorization is disabled.' + })), + regex: z.string().register(z.globalRegistry, { + description: 'A regular expression that is used to search for values that match the category.' + }), + terms: z.string().register(z.globalRegistry, { + description: 'A space separated list of the common tokens that are matched in values of the category.' + }), + num_matches: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of messages that have been matched by this category. This is only guaranteed to have the latest accurate count after a job _flush or _close' + })), + preferred_to_categories: z.optional(z.array(types_id).register(z.globalRegistry, { + description: 'A list of category_id entries that this current category encompasses. Any new message that is processed by the categorizer will match against this category and not any of the categories in this list. This is only guaranteed to have the latest accurate list of categories after a job _flush or _close' + })), + p: z.optional(z.string()), + result_type: z.string(), + mlcategory: z.string() }); export const ml_types_api_key_authorization = z.object({ - id: z.string().register(z.globalRegistry, { - description: 'The identifier for the API key.', - }), - name: z.string().register(z.globalRegistry, { - description: 'The name of the API key.', - }), + id: z.string().register(z.globalRegistry, { + description: 'The identifier for the API key.' + }), + name: z.string().register(z.globalRegistry, { + description: 'The name of the API key.' + }) }); export const ml_types_dataframe_analytics_authorization = z.object({ - api_key: z.optional(ml_types_api_key_authorization), - roles: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'If a user ID was used for the most recent update to the job, its roles at the time of the update are listed in the response.', - }) - ), - service_account: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If a service account was used for the most recent update to the job, the account name is listed in the response.', - }) - ), + api_key: z.optional(ml_types_api_key_authorization), + roles: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'If a user ID was used for the most recent update to the job, its roles at the time of the update are listed in the response.' + })), + service_account: z.optional(z.string().register(z.globalRegistry, { + description: 'If a service account was used for the most recent update to the job, the account name is listed in the response.' + })) }); export const ml_types_hyperparameters = z.object({ - alpha: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option.\nMachine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly.\nThis parameter affects loss calculations by acting as a multiplier of the tree depth.\nHigher alpha values result in shallower trees and faster training times.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be greater than or equal to zero.', - }) - ), - lambda: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option.\nRegularization parameter to prevent overfitting on the training data set.\nMultiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest.\nA high lambda value causes training to favor small leaf weights.\nThis behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable.\nA small lambda value results in large individual trees and slower training.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be a nonnegative value.', - }) - ), - gamma: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option.\nRegularization parameter to prevent overfitting on the training data set.\nMultiplies a linear penalty associated with the size of individual trees in the forest.\nA high gamma value causes training to prefer small trees.\nA small gamma value results in larger individual trees and slower training.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be a nonnegative value.', - }) - ), - eta: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option.\nThe shrinkage applied to the weights.\nSmaller values result in larger forests which have a better generalization error.\nHowever, larger forests cause slower training.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be a value between `0.001` and `1`.', - }) - ), - eta_growth_rate_per_tree: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option.\nSpecifies the rate at which `eta` increases for each new tree that is added to the forest.\nFor example, a rate of 1.05 increases `eta` by 5% for each extra tree.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be between `0.5` and `2`.', - }) - ), - feature_bag_fraction: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option.\nDefines the fraction of features that will be used when selecting a random bag for each candidate split.\nBy default, this value is calculated during hyperparameter optimization.', - }) - ), - downsample_factor: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option.\nControls the fraction of data that is used to compute the derivatives of the loss function for tree training.\nA small value results in the use of a small fraction of the data.\nIf this value is set to be less than 1, accuracy typically improves.\nHowever, too small a value may result in poor convergence for the ensemble and so require more trees.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be greater than zero and less than or equal to 1.', - }) - ), - max_attempts_to_add_tree: z.optional( - z.number().register(z.globalRegistry, { - description: - 'If the algorithm fails to determine a non-trivial tree (more than a single leaf), this parameter determines how many of such consecutive failures are tolerated.\nOnce the number of attempts exceeds the threshold, the forest training stops.', - }) - ), - max_optimization_rounds_per_hyperparameter: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option.\nA multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure.\nThe maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter.\nBy default, this value is calculated during hyperparameter optimization.', - }) - ), - max_trees: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option.\nDefines the maximum number of decision trees in the forest.\nThe maximum value is 2000.\nBy default, this value is calculated during hyperparameter optimization.', - }) - ), - num_folds: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of folds for the cross-validation procedure.', - }) - ), - num_splits_per_feature: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Determines the maximum number of splits for every feature that can occur in a decision tree when the tree is trained.', - }) - ), - soft_tree_depth_limit: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option.\nMachine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly.\nThis soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be greater than or equal to 0.', - }) - ), - soft_tree_depth_tolerance: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option.\nThis option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be greater than or equal to 0.01.', - }) - ), + alpha: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option.\nMachine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly.\nThis parameter affects loss calculations by acting as a multiplier of the tree depth.\nHigher alpha values result in shallower trees and faster training times.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be greater than or equal to zero.' + })), + lambda: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option.\nRegularization parameter to prevent overfitting on the training data set.\nMultiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest.\nA high lambda value causes training to favor small leaf weights.\nThis behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable.\nA small lambda value results in large individual trees and slower training.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be a nonnegative value.' + })), + gamma: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option.\nRegularization parameter to prevent overfitting on the training data set.\nMultiplies a linear penalty associated with the size of individual trees in the forest.\nA high gamma value causes training to prefer small trees.\nA small gamma value results in larger individual trees and slower training.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be a nonnegative value.' + })), + eta: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option.\nThe shrinkage applied to the weights.\nSmaller values result in larger forests which have a better generalization error.\nHowever, larger forests cause slower training.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be a value between `0.001` and `1`.' + })), + eta_growth_rate_per_tree: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option.\nSpecifies the rate at which `eta` increases for each new tree that is added to the forest.\nFor example, a rate of 1.05 increases `eta` by 5% for each extra tree.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be between `0.5` and `2`.' + })), + feature_bag_fraction: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option.\nDefines the fraction of features that will be used when selecting a random bag for each candidate split.\nBy default, this value is calculated during hyperparameter optimization.' + })), + downsample_factor: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option.\nControls the fraction of data that is used to compute the derivatives of the loss function for tree training.\nA small value results in the use of a small fraction of the data.\nIf this value is set to be less than 1, accuracy typically improves.\nHowever, too small a value may result in poor convergence for the ensemble and so require more trees.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be greater than zero and less than or equal to 1.' + })), + max_attempts_to_add_tree: z.optional(z.number().register(z.globalRegistry, { + description: 'If the algorithm fails to determine a non-trivial tree (more than a single leaf), this parameter determines how many of such consecutive failures are tolerated.\nOnce the number of attempts exceeds the threshold, the forest training stops.' + })), + max_optimization_rounds_per_hyperparameter: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option.\nA multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure.\nThe maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter.\nBy default, this value is calculated during hyperparameter optimization.' + })), + max_trees: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option.\nDefines the maximum number of decision trees in the forest.\nThe maximum value is 2000.\nBy default, this value is calculated during hyperparameter optimization.' + })), + num_folds: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of folds for the cross-validation procedure.' + })), + num_splits_per_feature: z.optional(z.number().register(z.globalRegistry, { + description: 'Determines the maximum number of splits for every feature that can occur in a decision tree when the tree is trained.' + })), + soft_tree_depth_limit: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option.\nMachine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly.\nThis soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be greater than or equal to 0.' + })), + soft_tree_depth_tolerance: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option.\nThis option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`.\nBy default, this value is calculated during hyperparameter optimization.\nIt must be greater than or equal to 0.01.' + })) }); export const ml_types_timing_stats = z.object({ - elapsed_time: types_duration_value_unit_millis, - iteration_time: z.optional(types_duration_value_unit_millis), + elapsed_time: types_duration_value_unit_millis, + iteration_time: z.optional(types_duration_value_unit_millis) }); export const ml_types_validation_loss = z.object({ - fold_values: z.array(z.string()).register(z.globalRegistry, { - description: - 'Validation loss values for every added decision tree during the forest growing procedure.', - }), - loss_type: z.string().register(z.globalRegistry, { - description: 'The type of the loss metric. For example, binomial_logistic.', - }), + fold_values: z.array(z.string()).register(z.globalRegistry, { + description: 'Validation loss values for every added decision tree during the forest growing procedure.' + }), + loss_type: z.string().register(z.globalRegistry, { + description: 'The type of the loss metric. For example, binomial_logistic.' + }) }); export const ml_types_dataframe_analytics_stats_hyperparameters = z.object({ - hyperparameters: ml_types_hyperparameters, - iteration: z.number().register(z.globalRegistry, { - description: 'The number of iterations on the analysis.', - }), - timestamp: types_epoch_time_unit_millis, - timing_stats: ml_types_timing_stats, - validation_loss: ml_types_validation_loss, + hyperparameters: ml_types_hyperparameters, + iteration: z.number().register(z.globalRegistry, { + description: 'The number of iterations on the analysis.' + }), + timestamp: types_epoch_time_unit_millis, + timing_stats: ml_types_timing_stats, + validation_loss: ml_types_validation_loss }); export const ml_types_outlier_detection_parameters = z.object({ - compute_feature_influence: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Specifies whether the feature influence calculation is enabled.', - }) - ), - feature_influence_threshold: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The minimum outlier score that a document needs to have in order to calculate its feature influence score.\nValue range: 0-1', - }) - ), - method: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The method that outlier detection uses.\nAvailable methods are `lof`, `ldof`, `distance_kth_nn`, `distance_knn`, and `ensemble`.\nThe default value is ensemble, which means that outlier detection uses an ensemble of different methods and normalises and combines their individual outlier scores to obtain the overall outlier score.', - }) - ), - n_neighbors: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Defines the value for how many nearest neighbors each method of outlier detection uses to calculate its outlier score.\nWhen the value is not set, different values are used for different ensemble members.\nThis default behavior helps improve the diversity in the ensemble; only override it if you are confident that the value you choose is appropriate for the data set.', - }) - ), - outlier_fraction: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The proportion of the data set that is assumed to be outlying prior to outlier detection.\nFor example, 0.05 means it is assumed that 5% of values are real outliers and 95% are inliers.', - }) - ), - standardization_enabled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the following operation is performed on the columns before computing outlier scores: (x_i - mean(x_i)) / sd(x_i).', - }) - ), + compute_feature_influence: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether the feature influence calculation is enabled.' + })), + feature_influence_threshold: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum outlier score that a document needs to have in order to calculate its feature influence score.\nValue range: 0-1' + })), + method: z.optional(z.string().register(z.globalRegistry, { + description: 'The method that outlier detection uses.\nAvailable methods are `lof`, `ldof`, `distance_kth_nn`, `distance_knn`, and `ensemble`.\nThe default value is ensemble, which means that outlier detection uses an ensemble of different methods and normalises and combines their individual outlier scores to obtain the overall outlier score.' + })), + n_neighbors: z.optional(z.number().register(z.globalRegistry, { + description: 'Defines the value for how many nearest neighbors each method of outlier detection uses to calculate its outlier score.\nWhen the value is not set, different values are used for different ensemble members.\nThis default behavior helps improve the diversity in the ensemble; only override it if you are confident that the value you choose is appropriate for the data set.' + })), + outlier_fraction: z.optional(z.number().register(z.globalRegistry, { + description: 'The proportion of the data set that is assumed to be outlying prior to outlier detection.\nFor example, 0.05 means it is assumed that 5% of values are real outliers and 95% are inliers.' + })), + standardization_enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the following operation is performed on the columns before computing outlier scores: (x_i - mean(x_i)) / sd(x_i).' + })) }); export const ml_types_dataframe_analytics_stats_outlier_detection = z.object({ - parameters: ml_types_outlier_detection_parameters, - timestamp: types_epoch_time_unit_millis, - timing_stats: ml_types_timing_stats, + parameters: ml_types_outlier_detection_parameters, + timestamp: types_epoch_time_unit_millis, + timing_stats: ml_types_timing_stats }); export const ml_types_dataframe_analytics_stats_container = z.object({ - classification_stats: z.optional(ml_types_dataframe_analytics_stats_hyperparameters), - outlier_detection_stats: z.optional(ml_types_dataframe_analytics_stats_outlier_detection), - regression_stats: z.optional(ml_types_dataframe_analytics_stats_hyperparameters), + classification_stats: z.optional(ml_types_dataframe_analytics_stats_hyperparameters), + outlier_detection_stats: z.optional(ml_types_dataframe_analytics_stats_outlier_detection), + regression_stats: z.optional(ml_types_dataframe_analytics_stats_hyperparameters) }); export const ml_types_dataframe_analytics_stats_data_counts = z.object({ - skipped_docs_count: z.number().register(z.globalRegistry, { - description: - 'The number of documents that are skipped during the analysis because they contained values that are not supported by the analysis. For example, outlier detection does not support missing fields so it skips documents with missing fields. Likewise, all types of analysis skip documents that contain arrays with more than one element.', - }), - test_docs_count: z.number().register(z.globalRegistry, { - description: - 'The number of documents that are not used for training the model and can be used for testing.', - }), - training_docs_count: z.number().register(z.globalRegistry, { - description: 'The number of documents that are used for training the model.', - }), + skipped_docs_count: z.number().register(z.globalRegistry, { + description: 'The number of documents that are skipped during the analysis because they contained values that are not supported by the analysis. For example, outlier detection does not support missing fields so it skips documents with missing fields. Likewise, all types of analysis skip documents that contain arrays with more than one element.' + }), + test_docs_count: z.number().register(z.globalRegistry, { + description: 'The number of documents that are not used for training the model and can be used for testing.' + }), + training_docs_count: z.number().register(z.globalRegistry, { + description: 'The number of documents that are used for training the model.' + }) }); export const ml_types_dataframe_analytics_stats_memory_usage = z.object({ - memory_reestimate_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'This value is present when the status is hard_limit and it is a new estimate of how much memory the job needs.', - }) - ), - peak_usage_bytes: z.number().register(z.globalRegistry, { - description: 'The number of bytes used at the highest peak of memory usage.', - }), - status: z.string().register(z.globalRegistry, { - description: 'The memory usage status.', - }), - timestamp: z.optional(types_epoch_time_unit_millis), + memory_reestimate_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'This value is present when the status is hard_limit and it is a new estimate of how much memory the job needs.' + })), + peak_usage_bytes: z.number().register(z.globalRegistry, { + description: 'The number of bytes used at the highest peak of memory usage.' + }), + status: z.string().register(z.globalRegistry, { + description: 'The memory usage status.' + }), + timestamp: z.optional(types_epoch_time_unit_millis) }); export const types_node_attributes = z.object({ - attributes: z.record(z.string(), z.string()).register(z.globalRegistry, { - description: 'Lists node attributes.', - }), - ephemeral_id: types_id, - id: z.optional(types_node_id), - name: types_node_name, - transport_address: types_transport_address, + attributes: z.record(z.string(), z.string()).register(z.globalRegistry, { + description: 'Lists node attributes.' + }), + ephemeral_id: types_id, + id: z.optional(types_node_id), + name: types_node_name, + transport_address: types_transport_address }); export const ml_types_dataframe_analytics_stats_progress = z.object({ - phase: z.string().register(z.globalRegistry, { - description: 'Defines the phase of the data frame analytics job.', - }), - progress_percent: z.number().register(z.globalRegistry, { - description: 'The progress that the data frame analytics job has made expressed in percentage.', - }), + phase: z.string().register(z.globalRegistry, { + description: 'Defines the phase of the data frame analytics job.' + }), + progress_percent: z.number().register(z.globalRegistry, { + description: 'The progress that the data frame analytics job has made expressed in percentage.' + }) }); export const ml_types_dataframe_state = z.enum([ - 'started', - 'stopped', - 'starting', - 'stopping', - 'failed', + 'started', + 'stopped', + 'starting', + 'stopping', + 'failed' ]); export const ml_types_dataframe_analytics = z.object({ - analysis_stats: z.optional(ml_types_dataframe_analytics_stats_container), - assignment_explanation: z.optional( - z.string().register(z.globalRegistry, { - description: - 'For running jobs only, contains messages relating to the selection of a node to run the job.', - }) - ), - data_counts: ml_types_dataframe_analytics_stats_data_counts, - id: types_id, - memory_usage: ml_types_dataframe_analytics_stats_memory_usage, - node: z.optional(types_node_attributes), - progress: z.array(ml_types_dataframe_analytics_stats_progress).register(z.globalRegistry, { - description: 'The progress report of the data frame analytics job by phase.', - }), - state: ml_types_dataframe_state, + analysis_stats: z.optional(ml_types_dataframe_analytics_stats_container), + assignment_explanation: z.optional(z.string().register(z.globalRegistry, { + description: 'For running jobs only, contains messages relating to the selection of a node to run the job.' + })), + data_counts: ml_types_dataframe_analytics_stats_data_counts, + id: types_id, + memory_usage: ml_types_dataframe_analytics_stats_memory_usage, + node: z.optional(types_node_attributes), + progress: z.array(ml_types_dataframe_analytics_stats_progress).register(z.globalRegistry, { + description: 'The progress report of the data frame analytics job by phase.' + }), + state: ml_types_dataframe_state }); /** * Alternative representation of DiscoveryNode used in ml.get_job_stats and ml.get_datafeed_stats */ -export const ml_types_discovery_node_compact = z - .object({ +export const ml_types_discovery_node_compact = z.object({ name: types_name, ephemeral_id: types_id, id: types_id, transport_address: types_transport_address, - attributes: z.record(z.string(), z.string()), - }) - .register(z.globalRegistry, { - description: - 'Alternative representation of DiscoveryNode used in ml.get_job_stats and ml.get_datafeed_stats', - }); + attributes: z.record(z.string(), z.string()) +}).register(z.globalRegistry, { + description: 'Alternative representation of DiscoveryNode used in ml.get_job_stats and ml.get_datafeed_stats' +}); /** * Time unit for fractional milliseconds */ export const types_unit_float_millis = z.number().register(z.globalRegistry, { - description: 'Time unit for fractional milliseconds', + description: 'Time unit for fractional milliseconds' }); export const types_duration_value_unit_float_millis = types_unit_float_millis; export const ml_types_exponential_average_calculation_context = z.object({ - incremental_metric_value_ms: types_duration_value_unit_float_millis, - latest_timestamp: z.optional(types_epoch_time_unit_millis), - previous_exponential_average_ms: z.optional(types_duration_value_unit_float_millis), + incremental_metric_value_ms: types_duration_value_unit_float_millis, + latest_timestamp: z.optional(types_epoch_time_unit_millis), + previous_exponential_average_ms: z.optional(types_duration_value_unit_float_millis) }); export const ml_types_datafeed_timing_stats = z.object({ - bucket_count: z.number().register(z.globalRegistry, { - description: 'The number of buckets processed.', - }), - exponential_average_search_time_per_hour_ms: types_duration_value_unit_float_millis, - exponential_average_calculation_context: z.optional( - ml_types_exponential_average_calculation_context - ), - job_id: types_id, - search_count: z.number().register(z.globalRegistry, { - description: 'The number of searches run by the datafeed.', - }), - total_search_time_ms: types_duration_value_unit_float_millis, - average_search_time_per_bucket_ms: z.optional(types_duration_value_unit_float_millis), + bucket_count: z.number().register(z.globalRegistry, { + description: 'The number of buckets processed.' + }), + exponential_average_search_time_per_hour_ms: types_duration_value_unit_float_millis, + exponential_average_calculation_context: z.optional(ml_types_exponential_average_calculation_context), + job_id: types_id, + search_count: z.number().register(z.globalRegistry, { + description: 'The number of searches run by the datafeed.' + }), + total_search_time_ms: types_duration_value_unit_float_millis, + average_search_time_per_bucket_ms: z.optional(types_duration_value_unit_float_millis) }); export const ml_types_running_state_search_interval = z.object({ - end: z.optional(types_duration), - end_ms: types_duration_value_unit_millis, - start: z.optional(types_duration), - start_ms: types_duration_value_unit_millis, + end: z.optional(types_duration), + end_ms: types_duration_value_unit_millis, + start: z.optional(types_duration), + start_ms: types_duration_value_unit_millis }); export const ml_types_datafeed_running_state = z.object({ - real_time_configured: z.boolean().register(z.globalRegistry, { - description: - 'Indicates if the datafeed is "real-time"; meaning that the datafeed has no configured `end` time.', - }), - real_time_running: z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether the datafeed has finished running on the available past data.\nFor datafeeds without a configured `end` time, this means that the datafeed is now running on "real-time" data.', - }), - search_interval: z.optional(ml_types_running_state_search_interval), + real_time_configured: z.boolean().register(z.globalRegistry, { + description: 'Indicates if the datafeed is "real-time"; meaning that the datafeed has no configured `end` time.' + }), + real_time_running: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the datafeed has finished running on the available past data.\nFor datafeeds without a configured `end` time, this means that the datafeed is now running on "real-time" data.' + }), + search_interval: z.optional(ml_types_running_state_search_interval) }); export const ml_types_datafeed_stats = z.object({ - assignment_explanation: z.optional( - z.string().register(z.globalRegistry, { - description: - 'For started datafeeds only, contains messages relating to the selection of a node.', - }) - ), - datafeed_id: types_id, - node: z.optional(ml_types_discovery_node_compact), - state: ml_types_datafeed_state, - timing_stats: z.optional(ml_types_datafeed_timing_stats), - running_state: z.optional(ml_types_datafeed_running_state), + assignment_explanation: z.optional(z.string().register(z.globalRegistry, { + description: 'For started datafeeds only, contains messages relating to the selection of a node.' + })), + datafeed_id: types_id, + node: z.optional(ml_types_discovery_node_compact), + state: ml_types_datafeed_state, + timing_stats: z.optional(ml_types_datafeed_timing_stats), + running_state: z.optional(ml_types_datafeed_running_state) }); export const ml_types_datafeed_authorization = z.object({ - api_key: z.optional(ml_types_api_key_authorization), - roles: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'If a user ID was used for the most recent update to the datafeed, its roles at the time of the update are listed in the response.', - }) - ), - service_account: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If a service account was used for the most recent update to the datafeed, the account name is listed in the response.', - }) - ), + api_key: z.optional(ml_types_api_key_authorization), + roles: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'If a user ID was used for the most recent update to the datafeed, its roles at the time of the update are listed in the response.' + })), + service_account: z.optional(z.string().register(z.globalRegistry, { + description: 'If a service account was used for the most recent update to the datafeed, the account name is listed in the response.' + })) }); -export const ml_types_chunking_mode = z.enum(['auto', 'manual', 'off']); +export const ml_types_chunking_mode = z.enum([ + 'auto', + 'manual', + 'off' +]); export const ml_types_chunking_config = z.object({ - mode: ml_types_chunking_mode, - time_span: z.optional(types_duration), + mode: ml_types_chunking_mode, + time_span: z.optional(types_duration) }); export const ml_types_delayed_data_check_config = z.object({ - check_window: z.optional(types_duration), - enabled: z.boolean().register(z.globalRegistry, { - description: 'Specifies whether the datafeed periodically checks for delayed data.', - }), + check_window: z.optional(types_duration), + enabled: z.boolean().register(z.globalRegistry, { + description: 'Specifies whether the datafeed periodically checks for delayed data.' + }) }); /** * Controls how to deal with unavailable concrete indices (closed or missing), how wildcard expressions are expanded * to actual indices (all, closed or open indices) and how to deal with wildcard expressions that resolve to no indices. */ -export const types_indices_options = z - .object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or `_all` value targets only\nmissing or closed indices. This behavior applies even if the request targets other open indices. For example,\na request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), +export const types_indices_options = z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias, or `_all` value targets only\nmissing or closed indices. This behavior applies even if the request targets other open indices. For example,\na request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', - }) - ), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, concrete, expanded or aliased indices are ignored when frozen.', - }) - ), - }) - .register(z.globalRegistry, { - description: - 'Controls how to deal with unavailable concrete indices (closed or missing), how wildcard expressions are expanded\nto actual indices (all, closed or open indices) and how to deal with wildcard expressions that resolve to no indices.', - }); + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, missing or closed indices are not included in the response.' + })), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, concrete, expanded or aliased indices are ignored when frozen.' + })) +}).register(z.globalRegistry, { + description: 'Controls how to deal with unavailable concrete indices (closed or missing), how wildcard expressions are expanded\nto actual indices (all, closed or open indices) and how to deal with wildcard expressions that resolve to no indices.' +}); export const ml_types_filter = z.object({ - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the filter.', + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the filter.' + })), + filter_id: types_id, + items: z.array(z.string()).register(z.globalRegistry, { + description: 'An array of strings which is the filter item list.' }) - ), - filter_id: types_id, - items: z.array(z.string()).register(z.globalRegistry, { - description: 'An array of strings which is the filter item list.', - }), }); export const ml_types_influencer = z.object({ - bucket_span: types_duration_value_unit_seconds, - influencer_score: z.number().register(z.globalRegistry, { - description: - 'A normalized score between 0-100, which is based on the probability of the influencer in this bucket aggregated\nacross detectors. Unlike `initial_influencer_score`, this value is updated by a re-normalization process as new\ndata is analyzed.', - }), - influencer_field_name: types_field, - influencer_field_value: z.string().register(z.globalRegistry, { - description: 'The entity that influenced, contributed to, or was to blame for the anomaly.', - }), - initial_influencer_score: z.number().register(z.globalRegistry, { - description: - 'A normalized score between 0-100, which is based on the probability of the influencer aggregated across detectors.\nThis is the initial value that was calculated at the time the bucket was processed.', - }), - is_interim: z.boolean().register(z.globalRegistry, { - description: - 'If true, this is an interim result. In other words, the results are calculated based on partial input data.', - }), - job_id: types_id, - probability: z.number().register(z.globalRegistry, { - description: - 'The probability that the influencer has this behavior, in the range 0 to 1. This value can be held to a high\nprecision of over 300 decimal places, so the `influencer_score` is provided as a human-readable and friendly\ninterpretation of this value.', - }), - result_type: z.string().register(z.globalRegistry, { - description: 'Internal. This value is always set to `influencer`.', - }), - timestamp: types_epoch_time_unit_millis, - foo: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Additional influencer properties are added, depending on the fields being analyzed. For example, if it’s\nanalyzing `user_name` as an influencer, a field `user_name` is added to the result document. This\ninformation enables you to filter the anomaly results more easily.', - }) - ), + bucket_span: types_duration_value_unit_seconds, + influencer_score: z.number().register(z.globalRegistry, { + description: 'A normalized score between 0-100, which is based on the probability of the influencer in this bucket aggregated\nacross detectors. Unlike `initial_influencer_score`, this value is updated by a re-normalization process as new\ndata is analyzed.' + }), + influencer_field_name: types_field, + influencer_field_value: z.string().register(z.globalRegistry, { + description: 'The entity that influenced, contributed to, or was to blame for the anomaly.' + }), + initial_influencer_score: z.number().register(z.globalRegistry, { + description: 'A normalized score between 0-100, which is based on the probability of the influencer aggregated across detectors.\nThis is the initial value that was calculated at the time the bucket was processed.' + }), + is_interim: z.boolean().register(z.globalRegistry, { + description: 'If true, this is an interim result. In other words, the results are calculated based on partial input data.' + }), + job_id: types_id, + probability: z.number().register(z.globalRegistry, { + description: 'The probability that the influencer has this behavior, in the range 0 to 1. This value can be held to a high\nprecision of over 300 decimal places, so the `influencer_score` is provided as a human-readable and friendly\ninterpretation of this value.' + }), + result_type: z.string().register(z.globalRegistry, { + description: 'Internal. This value is always set to `influencer`.' + }), + timestamp: types_epoch_time_unit_millis, + foo: z.optional(z.string().register(z.globalRegistry, { + description: 'Additional influencer properties are added, depending on the fields being analyzed. For example, if it’s\nanalyzing `user_name` as an influencer, a field `user_name` is added to the result document. This\ninformation enables you to filter the anomaly results more easily.' + })) }); export const ml_types_data_counts = z.object({ - bucket_count: z.number(), - earliest_record_timestamp: z.optional(z.number()), - empty_bucket_count: z.number(), - input_bytes: z.number(), - input_field_count: z.number(), - input_record_count: z.number(), - invalid_date_count: z.number(), - job_id: types_id, - last_data_time: z.optional(z.number()), - latest_empty_bucket_timestamp: z.optional(z.number()), - latest_record_timestamp: z.optional(z.number()), - latest_sparse_bucket_timestamp: z.optional(z.number()), - latest_bucket_timestamp: z.optional(z.number()), - log_time: z.optional(z.number()), - missing_field_count: z.number(), - out_of_order_timestamp_count: z.number(), - processed_field_count: z.number(), - processed_record_count: z.number(), - sparse_bucket_count: z.number(), + bucket_count: z.number(), + earliest_record_timestamp: z.optional(z.number()), + empty_bucket_count: z.number(), + input_bytes: z.number(), + input_field_count: z.number(), + input_record_count: z.number(), + invalid_date_count: z.number(), + job_id: types_id, + last_data_time: z.optional(z.number()), + latest_empty_bucket_timestamp: z.optional(z.number()), + latest_record_timestamp: z.optional(z.number()), + latest_sparse_bucket_timestamp: z.optional(z.number()), + latest_bucket_timestamp: z.optional(z.number()), + log_time: z.optional(z.number()), + missing_field_count: z.number(), + out_of_order_timestamp_count: z.number(), + processed_field_count: z.number(), + processed_record_count: z.number(), + sparse_bucket_count: z.number() }); export const ml_types_job_statistics = z.object({ - avg: z.number(), - max: z.number(), - min: z.number(), - total: z.number(), + avg: z.number(), + max: z.number(), + min: z.number(), + total: z.number() }); export const ml_types_job_forecast_statistics = z.object({ - memory_bytes: z.optional(ml_types_job_statistics), - processing_time_ms: z.optional(ml_types_job_statistics), - records: z.optional(ml_types_job_statistics), - status: z.optional(z.record(z.string(), z.number())), - total: z.number(), - forecasted_jobs: z.number(), + memory_bytes: z.optional(ml_types_job_statistics), + processing_time_ms: z.optional(ml_types_job_statistics), + records: z.optional(ml_types_job_statistics), + status: z.optional(z.record(z.string(), z.number())), + total: z.number(), + forecasted_jobs: z.number() }); export const ml_types_model_size_stats = z.object({ - bucket_allocation_failures_count: z.number(), - job_id: types_id, - log_time: types_date_time, - memory_status: ml_types_memory_status, - model_bytes: types_byte_size, - model_bytes_exceeded: z.optional(types_byte_size), - model_bytes_memory_limit: z.optional(types_byte_size), - output_memory_allocator_bytes: z.optional(types_byte_size), - peak_model_bytes: z.optional(types_byte_size), - assignment_memory_basis: z.optional(z.string()), - result_type: z.string(), - total_by_field_count: z.number(), - total_over_field_count: z.number(), - total_partition_field_count: z.number(), - categorization_status: ml_types_categorization_status, - categorized_doc_count: z.number(), - dead_category_count: z.number(), - failed_category_count: z.number(), - frequent_category_count: z.number(), - rare_category_count: z.number(), - total_category_count: z.number(), - timestamp: z.optional(z.number()), + bucket_allocation_failures_count: z.number(), + job_id: types_id, + log_time: types_date_time, + memory_status: ml_types_memory_status, + model_bytes: types_byte_size, + model_bytes_exceeded: z.optional(types_byte_size), + model_bytes_memory_limit: z.optional(types_byte_size), + output_memory_allocator_bytes: z.optional(types_byte_size), + peak_model_bytes: z.optional(types_byte_size), + assignment_memory_basis: z.optional(z.string()), + result_type: z.string(), + total_by_field_count: z.number(), + total_over_field_count: z.number(), + total_partition_field_count: z.number(), + categorization_status: ml_types_categorization_status, + categorized_doc_count: z.number(), + dead_category_count: z.number(), + failed_category_count: z.number(), + frequent_category_count: z.number(), + rare_category_count: z.number(), + total_category_count: z.number(), + timestamp: z.optional(z.number()) }); export const ml_types_job_timing_stats = z.object({ - average_bucket_processing_time_ms: z.optional(types_duration_value_unit_float_millis), - bucket_count: z.number(), - exponential_average_bucket_processing_time_ms: z.optional(types_duration_value_unit_float_millis), - exponential_average_bucket_processing_time_per_hour_ms: types_duration_value_unit_float_millis, - job_id: types_id, - total_bucket_processing_time_ms: types_duration_value_unit_float_millis, - maximum_bucket_processing_time_ms: z.optional(types_duration_value_unit_float_millis), - minimum_bucket_processing_time_ms: z.optional(types_duration_value_unit_float_millis), + average_bucket_processing_time_ms: z.optional(types_duration_value_unit_float_millis), + bucket_count: z.number(), + exponential_average_bucket_processing_time_ms: z.optional(types_duration_value_unit_float_millis), + exponential_average_bucket_processing_time_per_hour_ms: types_duration_value_unit_float_millis, + job_id: types_id, + total_bucket_processing_time_ms: types_duration_value_unit_float_millis, + maximum_bucket_processing_time_ms: z.optional(types_duration_value_unit_float_millis), + minimum_bucket_processing_time_ms: z.optional(types_duration_value_unit_float_millis) }); export const ml_types_job_stats = z.object({ - assignment_explanation: z.optional( - z.string().register(z.globalRegistry, { - description: - 'For open anomaly detection jobs only, contains messages relating to the selection of a node to run the job.', - }) - ), - data_counts: ml_types_data_counts, - forecasts_stats: ml_types_job_forecast_statistics, - job_id: z.string().register(z.globalRegistry, { - description: 'Identifier for the anomaly detection job.', - }), - model_size_stats: ml_types_model_size_stats, - node: z.optional(ml_types_discovery_node_compact), - open_time: z.optional(types_date_time), - state: ml_types_job_state, - timing_stats: ml_types_job_timing_stats, - deleting: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates that the process of deleting the job is in progress but not yet completed. It is only reported when `true`.', - }) - ), + assignment_explanation: z.optional(z.string().register(z.globalRegistry, { + description: 'For open anomaly detection jobs only, contains messages relating to the selection of a node to run the job.' + })), + data_counts: ml_types_data_counts, + forecasts_stats: ml_types_job_forecast_statistics, + job_id: z.string().register(z.globalRegistry, { + description: 'Identifier for the anomaly detection job.' + }), + model_size_stats: ml_types_model_size_stats, + node: z.optional(ml_types_discovery_node_compact), + open_time: z.optional(types_date_time), + state: ml_types_job_state, + timing_stats: ml_types_job_timing_stats, + deleting: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates that the process of deleting the job is in progress but not yet completed. It is only reported when `true`.' + })) }); export const ml_types_analysis_limits = z.object({ - categorization_examples_limit: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of examples stored per category in memory and in the results data store. If you increase this value, more examples are available, however it requires that you have more storage available. If you set this value to 0, no examples are stored. NOTE: The `categorization_examples_limit` applies only to analysis that uses categorization.', - }) - ), - model_memory_limit: z.optional(types_byte_size), + categorization_examples_limit: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of examples stored per category in memory and in the results data store. If you increase this value, more examples are available, however it requires that you have more storage available. If you set this value to 0, no examples are stored. NOTE: The `categorization_examples_limit` applies only to analysis that uses categorization.' + })), + model_memory_limit: z.optional(types_byte_size) }); -export const ml_types_job_blocked_reason = z.enum(['delete', 'reset', 'revert']); +export const ml_types_job_blocked_reason = z.enum([ + 'delete', + 'reset', + 'revert' +]); export const ml_types_job_blocked = z.object({ - reason: ml_types_job_blocked_reason, - task_id: z.optional(types_task_id), + reason: ml_types_job_blocked_reason, + task_id: z.optional(types_task_id) }); /** * Custom metadata about the job */ -export const ml_types_custom_settings = z - .record(z.string(), z.unknown()) - .register(z.globalRegistry, { - description: 'Custom metadata about the job', - }); +export const ml_types_custom_settings = z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'Custom metadata about the job' +}); export const ml_types_data_description = z.object({ - format: z.optional( - z.string().register(z.globalRegistry, { - description: 'Only JSON format is supported at this time.', - }) - ), - time_field: z.optional(types_field), - time_format: z.optional( - z.string().register(z.globalRegistry, { - description: - "The time format, which can be `epoch`, `epoch_ms`, or a custom pattern. The value `epoch` refers to UNIX or Epoch time (the number of seconds since 1 Jan 1970). The value `epoch_ms` indicates that time is measured in milliseconds since the epoch. The `epoch` and `epoch_ms` time formats accept either integer or real values. Custom patterns must conform to the Java DateTimeFormatter class. When you use date-time formatting patterns, it is recommended that you provide the full date, time and time zone. For example: `yyyy-MM-dd'T'HH:mm:ssX`. If the pattern that you specify is not sufficient to produce a complete timestamp, job creation fails.", - }) - ), - field_delimiter: z.optional(z.string()), + format: z.optional(z.string().register(z.globalRegistry, { + description: 'Only JSON format is supported at this time.' + })), + time_field: z.optional(types_field), + time_format: z.optional(z.string().register(z.globalRegistry, { + description: 'The time format, which can be `epoch`, `epoch_ms`, or a custom pattern. The value `epoch` refers to UNIX or Epoch time (the number of seconds since 1 Jan 1970). The value `epoch_ms` indicates that time is measured in milliseconds since the epoch. The `epoch` and `epoch_ms` time formats accept either integer or real values. Custom patterns must conform to the Java DateTimeFormatter class. When you use date-time formatting patterns, it is recommended that you provide the full date, time and time zone. For example: `yyyy-MM-dd\'T\'HH:mm:ssX`. If the pattern that you specify is not sufficient to produce a complete timestamp, job creation fails.' + })), + field_delimiter: z.optional(z.string()) }); export const ml_types_model_plot_config = z.object({ - annotations_enabled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, enables calculation and storage of the model change annotations for each entity that is being analyzed.', - }) - ), - enabled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, enables calculation and storage of the model bounds for each entity that is being analyzed.', - }) - ), - terms: z.optional(types_field), + annotations_enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, enables calculation and storage of the model change annotations for each entity that is being analyzed.' + })), + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, enables calculation and storage of the model bounds for each entity that is being analyzed.' + })), + terms: z.optional(types_field) }); export const ml_get_memory_stats_jvm_stats = z.object({ - heap_max: z.optional(types_byte_size), - heap_max_in_bytes: z.number().register(z.globalRegistry, { - description: 'Maximum amount of memory, in bytes, available for use by the heap.', - }), - java_inference: z.optional(types_byte_size), - java_inference_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Amount of Java heap, in bytes, currently being used for caching inference models.', - }), - java_inference_max: z.optional(types_byte_size), - java_inference_max_in_bytes: z.number().register(z.globalRegistry, { - description: 'Maximum amount of Java heap, in bytes, to be used for caching inference models.', - }), + heap_max: z.optional(types_byte_size), + heap_max_in_bytes: z.number().register(z.globalRegistry, { + description: 'Maximum amount of memory, in bytes, available for use by the heap.' + }), + java_inference: z.optional(types_byte_size), + java_inference_in_bytes: z.number().register(z.globalRegistry, { + description: 'Amount of Java heap, in bytes, currently being used for caching inference models.' + }), + java_inference_max: z.optional(types_byte_size), + java_inference_max_in_bytes: z.number().register(z.globalRegistry, { + description: 'Maximum amount of Java heap, in bytes, to be used for caching inference models.' + }) }); export const ml_get_memory_stats_mem_ml_stats = z.object({ - anomaly_detectors: z.optional(types_byte_size), - anomaly_detectors_in_bytes: z.number().register(z.globalRegistry, { - description: 'Amount of native memory, in bytes, set aside for anomaly detection jobs.', - }), - data_frame_analytics: z.optional(types_byte_size), - data_frame_analytics_in_bytes: z.number().register(z.globalRegistry, { - description: 'Amount of native memory, in bytes, set aside for data frame analytics jobs.', - }), - max: z.optional(types_byte_size), - max_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Maximum amount of native memory (separate to the JVM heap), in bytes, that may be used by machine learning native processes.', - }), - native_code_overhead: z.optional(types_byte_size), - native_code_overhead_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Amount of native memory, in bytes, set aside for loading machine learning native code shared libraries.', - }), - native_inference: z.optional(types_byte_size), - native_inference_in_bytes: z.number().register(z.globalRegistry, { - description: - 'Amount of native memory, in bytes, set aside for trained models that have a PyTorch model_type.', - }), + anomaly_detectors: z.optional(types_byte_size), + anomaly_detectors_in_bytes: z.number().register(z.globalRegistry, { + description: 'Amount of native memory, in bytes, set aside for anomaly detection jobs.' + }), + data_frame_analytics: z.optional(types_byte_size), + data_frame_analytics_in_bytes: z.number().register(z.globalRegistry, { + description: 'Amount of native memory, in bytes, set aside for data frame analytics jobs.' + }), + max: z.optional(types_byte_size), + max_in_bytes: z.number().register(z.globalRegistry, { + description: 'Maximum amount of native memory (separate to the JVM heap), in bytes, that may be used by machine learning native processes.' + }), + native_code_overhead: z.optional(types_byte_size), + native_code_overhead_in_bytes: z.number().register(z.globalRegistry, { + description: 'Amount of native memory, in bytes, set aside for loading machine learning native code shared libraries.' + }), + native_inference: z.optional(types_byte_size), + native_inference_in_bytes: z.number().register(z.globalRegistry, { + description: 'Amount of native memory, in bytes, set aside for trained models that have a PyTorch model_type.' + }) }); export const ml_get_memory_stats_mem_stats = z.object({ - adjusted_total: z.optional(types_byte_size), - adjusted_total_in_bytes: z.number().register(z.globalRegistry, { - description: - 'If the amount of physical memory has been overridden using the `es.total_memory_bytes` system property\nthen this reports the overridden value in bytes. Otherwise it reports the same value as `total_in_bytes`.', - }), - total: z.optional(types_byte_size), - total_in_bytes: z.number().register(z.globalRegistry, { - description: 'Total amount of physical memory in bytes.', - }), - ml: ml_get_memory_stats_mem_ml_stats, + adjusted_total: z.optional(types_byte_size), + adjusted_total_in_bytes: z.number().register(z.globalRegistry, { + description: 'If the amount of physical memory has been overridden using the `es.total_memory_bytes` system property\nthen this reports the overridden value in bytes. Otherwise it reports the same value as `total_in_bytes`.' + }), + total: z.optional(types_byte_size), + total_in_bytes: z.number().register(z.globalRegistry, { + description: 'Total amount of physical memory in bytes.' + }), + ml: ml_get_memory_stats_mem_ml_stats }); export const ml_get_memory_stats_memory = z.object({ - attributes: z.record(z.string(), z.string()), - jvm: ml_get_memory_stats_jvm_stats, - mem: ml_get_memory_stats_mem_stats, - name: types_name, - roles: z.array(z.string()).register(z.globalRegistry, { - description: 'Roles assigned to the node.', - }), - transport_address: types_transport_address, - ephemeral_id: types_id, + attributes: z.record(z.string(), z.string()), + jvm: ml_get_memory_stats_jvm_stats, + mem: ml_get_memory_stats_mem_stats, + name: types_name, + roles: z.array(z.string()).register(z.globalRegistry, { + description: 'Roles assigned to the node.' + }), + transport_address: types_transport_address, + ephemeral_id: types_id }); export const ml_types_snapshot_upgrade_state = z.enum([ - 'loading_old_state', - 'saving_new_state', - 'stopped', - 'failed', + 'loading_old_state', + 'saving_new_state', + 'stopped', + 'failed' ]); export const ml_types_discovery_node_content = z.object({ - name: z.optional(types_name), - ephemeral_id: types_id, - transport_address: types_transport_address, - external_id: z.string(), - attributes: z.record(z.string(), z.string()), - roles: z.array(z.string()), - version: types_version_string, - min_index_version: z.number(), - max_index_version: z.number(), + name: z.optional(types_name), + ephemeral_id: types_id, + transport_address: types_transport_address, + external_id: z.string(), + attributes: z.record(z.string(), z.string()), + roles: z.array(z.string()), + version: types_version_string, + min_index_version: z.number(), + max_index_version: z.number() }); export const ml_types_discovery_node = z.record(z.string(), ml_types_discovery_node_content); export const ml_types_model_snapshot_upgrade = z.object({ - job_id: types_id, - snapshot_id: types_id, - state: ml_types_snapshot_upgrade_state, - node: ml_types_discovery_node, - assignment_explanation: z.string(), + job_id: types_id, + snapshot_id: types_id, + state: ml_types_snapshot_upgrade_state, + node: ml_types_discovery_node, + assignment_explanation: z.string() }); export const ml_types_model_snapshot = z.object({ - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'An optional description of the job.', - }) - ), - job_id: types_id, - latest_record_time_stamp: z.optional( - z.number().register(z.globalRegistry, { - description: 'The timestamp of the latest processed record.', - }) - ), - latest_result_time_stamp: z.optional( - z.number().register(z.globalRegistry, { - description: 'The timestamp of the latest bucket result.', + description: z.optional(z.string().register(z.globalRegistry, { + description: 'An optional description of the job.' + })), + job_id: types_id, + latest_record_time_stamp: z.optional(z.number().register(z.globalRegistry, { + description: 'The timestamp of the latest processed record.' + })), + latest_result_time_stamp: z.optional(z.number().register(z.globalRegistry, { + description: 'The timestamp of the latest bucket result.' + })), + min_version: types_version_string, + model_size_stats: z.optional(ml_types_model_size_stats), + retain: z.boolean().register(z.globalRegistry, { + description: 'If true, this snapshot will not be deleted during automatic cleanup of snapshots older than model_snapshot_retention_days. However, this snapshot will be deleted when the job is deleted. The default value is false.' + }), + snapshot_doc_count: z.number().register(z.globalRegistry, { + description: 'For internal use only.' + }), + snapshot_id: types_id, + timestamp: z.number().register(z.globalRegistry, { + description: 'The creation timestamp for the snapshot.' }) - ), - min_version: types_version_string, - model_size_stats: z.optional(ml_types_model_size_stats), - retain: z.boolean().register(z.globalRegistry, { - description: - 'If true, this snapshot will not be deleted during automatic cleanup of snapshots older than model_snapshot_retention_days. However, this snapshot will be deleted when the job is deleted. The default value is false.', - }), - snapshot_doc_count: z.number().register(z.globalRegistry, { - description: 'For internal use only.', - }), - snapshot_id: types_id, - timestamp: z.number().register(z.globalRegistry, { - description: 'The creation timestamp for the snapshot.', - }), }); export const ml_types_overall_bucket_job = z.object({ - job_id: types_id, - max_anomaly_score: z.number(), + job_id: types_id, + max_anomaly_score: z.number() }); export const ml_types_overall_bucket = z.object({ - bucket_span: types_duration_value_unit_seconds, - is_interim: z.boolean().register(z.globalRegistry, { - description: - 'If true, this is an interim result. In other words, the results are calculated based on partial input data.', - }), - jobs: z.array(ml_types_overall_bucket_job).register(z.globalRegistry, { - description: 'An array of objects that contain the max_anomaly_score per job_id.', - }), - overall_score: z.number().register(z.globalRegistry, { - description: 'The top_n average of the maximum bucket anomaly_score per job.', - }), - result_type: z.string().register(z.globalRegistry, { - description: 'Internal. This is always set to overall_bucket.', - }), - timestamp: types_epoch_time_unit_millis, - timestamp_string: z.optional(types_date_time), + bucket_span: types_duration_value_unit_seconds, + is_interim: z.boolean().register(z.globalRegistry, { + description: 'If true, this is an interim result. In other words, the results are calculated based on partial input data.' + }), + jobs: z.array(ml_types_overall_bucket_job).register(z.globalRegistry, { + description: 'An array of objects that contain the max_anomaly_score per job_id.' + }), + overall_score: z.number().register(z.globalRegistry, { + description: 'The top_n average of the maximum bucket anomaly_score per job.' + }), + result_type: z.string().register(z.globalRegistry, { + description: 'Internal. This is always set to overall_bucket.' + }), + timestamp: types_epoch_time_unit_millis, + timestamp_string: z.optional(types_date_time) }); export const ml_types_anomaly_explanation = z.object({ - anomaly_characteristics_impact: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Impact from the duration and magnitude of the detected anomaly relative to the historical average.', - }) - ), - anomaly_length: z.optional( - z.number().register(z.globalRegistry, { - description: 'Length of the detected anomaly in the number of buckets.', - }) - ), - anomaly_type: z.optional( - z.string().register(z.globalRegistry, { - description: 'Type of the detected anomaly: `spike` or `dip`.', - }) - ), - high_variance_penalty: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates reduction of anomaly score for the bucket with large confidence intervals. If a bucket has large confidence intervals, the score is reduced.', - }) - ), - incomplete_bucket_penalty: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If the bucket contains fewer samples than expected, the score is reduced.', - }) - ), - lower_confidence_bound: z.optional( - z.number().register(z.globalRegistry, { - description: 'Lower bound of the 95% confidence interval.', - }) - ), - multi_bucket_impact: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Impact of the deviation between actual and typical values in the past 12 buckets.', - }) - ), - single_bucket_impact: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Impact of the deviation between actual and typical values in the current bucket.', - }) - ), - typical_value: z.optional( - z.number().register(z.globalRegistry, { - description: 'Typical (expected) value for this bucket.', - }) - ), - upper_confidence_bound: z.optional( - z.number().register(z.globalRegistry, { - description: 'Upper bound of the 95% confidence interval.', - }) - ), + anomaly_characteristics_impact: z.optional(z.number().register(z.globalRegistry, { + description: 'Impact from the duration and magnitude of the detected anomaly relative to the historical average.' + })), + anomaly_length: z.optional(z.number().register(z.globalRegistry, { + description: 'Length of the detected anomaly in the number of buckets.' + })), + anomaly_type: z.optional(z.string().register(z.globalRegistry, { + description: 'Type of the detected anomaly: `spike` or `dip`.' + })), + high_variance_penalty: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates reduction of anomaly score for the bucket with large confidence intervals. If a bucket has large confidence intervals, the score is reduced.' + })), + incomplete_bucket_penalty: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If the bucket contains fewer samples than expected, the score is reduced.' + })), + lower_confidence_bound: z.optional(z.number().register(z.globalRegistry, { + description: 'Lower bound of the 95% confidence interval.' + })), + multi_bucket_impact: z.optional(z.number().register(z.globalRegistry, { + description: 'Impact of the deviation between actual and typical values in the past 12 buckets.' + })), + single_bucket_impact: z.optional(z.number().register(z.globalRegistry, { + description: 'Impact of the deviation between actual and typical values in the current bucket.' + })), + typical_value: z.optional(z.number().register(z.globalRegistry, { + description: 'Typical (expected) value for this bucket.' + })), + upper_confidence_bound: z.optional(z.number().register(z.globalRegistry, { + description: 'Upper bound of the 95% confidence interval.' + })) }); export const ml_types_geo_results = z.object({ - actual_point: z.optional( - z.string().register(z.globalRegistry, { - description: 'The actual value for the bucket formatted as a `geo_point`.', - }) - ), - typical_point: z.optional( - z.string().register(z.globalRegistry, { - description: 'The typical value for the bucket formatted as a `geo_point`.', - }) - ), + actual_point: z.optional(z.string().register(z.globalRegistry, { + description: 'The actual value for the bucket formatted as a `geo_point`.' + })), + typical_point: z.optional(z.string().register(z.globalRegistry, { + description: 'The typical value for the bucket formatted as a `geo_point`.' + })) }); export const ml_types_influence = z.object({ - influencer_field_name: z.string(), - influencer_field_values: z.array(z.string()), + influencer_field_name: z.string(), + influencer_field_values: z.array(z.string()) }); export const ml_types_anomaly_cause = z.object({ - actual: z.optional(z.array(z.number())), - by_field_name: z.optional(types_name), - by_field_value: z.optional(z.string()), - correlated_by_field_value: z.optional(z.string()), - field_name: z.optional(types_field), - function: z.optional(z.string()), - function_description: z.optional(z.string()), - geo_results: z.optional(ml_types_geo_results), - influencers: z.optional(z.array(ml_types_influence)), - over_field_name: z.optional(types_name), - over_field_value: z.optional(z.string()), - partition_field_name: z.optional(z.string()), - partition_field_value: z.optional(z.string()), - probability: z.number(), - typical: z.optional(z.array(z.number())), + actual: z.optional(z.array(z.number())), + by_field_name: z.optional(types_name), + by_field_value: z.optional(z.string()), + correlated_by_field_value: z.optional(z.string()), + field_name: z.optional(types_field), + function: z.optional(z.string()), + function_description: z.optional(z.string()), + geo_results: z.optional(ml_types_geo_results), + influencers: z.optional(z.array(ml_types_influence)), + over_field_name: z.optional(types_name), + over_field_value: z.optional(z.string()), + partition_field_name: z.optional(z.string()), + partition_field_value: z.optional(z.string()), + probability: z.number(), + typical: z.optional(z.array(z.number())) }); export const ml_types_anomaly = z.object({ - actual: z.optional( - z.array(z.number()).register(z.globalRegistry, { - description: 'The actual value for the bucket.', - }) - ), - anomaly_score_explanation: z.optional(ml_types_anomaly_explanation), - bucket_span: types_duration_value_unit_seconds, - by_field_name: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split.', - }) - ), - by_field_value: z.optional( - z.string().register(z.globalRegistry, { - description: 'The value of `by_field_name`.', - }) - ), - causes: z.optional( - z.array(ml_types_anomaly_cause).register(z.globalRegistry, { - description: - 'For population analysis, an over field must be specified in the detector. This property contains an array of anomaly records that are the causes for the anomaly that has been identified for the over field. This sub-resource contains the most anomalous records for the `over_field_name`. For scalability reasons, a maximum of the 10 most significant causes of the anomaly are returned. As part of the core analytical modeling, these low-level anomaly records are aggregated for their parent over field record. The `causes` resource contains similar elements to the record resource, namely `actual`, `typical`, `geo_results.actual_point`, `geo_results.typical_point`, `*_field_name` and `*_field_value`. Probability and scores are not applicable to causes.', - }) - ), - detector_index: z.number().register(z.globalRegistry, { - description: 'A unique identifier for the detector.', - }), - field_name: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Certain functions require a field to operate on, for example, `sum()`. For those functions, this value is the name of the field to be analyzed.', - }) - ), - function: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The function in which the anomaly occurs, as specified in the detector configuration. For example, `max`.', - }) - ), - function_description: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The description of the function in which the anomaly occurs, as specified in the detector configuration.', - }) - ), - geo_results: z.optional(ml_types_geo_results), - influencers: z.optional( - z.array(ml_types_influence).register(z.globalRegistry, { - description: - 'If influencers were specified in the detector configuration, this array contains influencers that contributed to or were to blame for an anomaly.', - }) - ), - initial_record_score: z.number().register(z.globalRegistry, { - description: - 'A normalized score between 0-100, which is based on the probability of the anomalousness of this record. This is the initial value that was calculated at the time the bucket was processed.', - }), - is_interim: z.boolean().register(z.globalRegistry, { - description: - 'If true, this is an interim result. In other words, the results are calculated based on partial input data.', - }), - job_id: z.string().register(z.globalRegistry, { - description: 'Identifier for the anomaly detection job.', - }), - over_field_name: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits.', - }) - ), - over_field_value: z.optional( - z.string().register(z.globalRegistry, { - description: 'The value of `over_field_name`.', - }) - ), - partition_field_name: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field.', - }) - ), - partition_field_value: z.optional( - z.string().register(z.globalRegistry, { - description: 'The value of `partition_field_name`.', - }) - ), - probability: z.number().register(z.globalRegistry, { - description: - 'The probability of the individual anomaly occurring, in the range 0 to 1. For example, `0.0000772031`. This value can be held to a high precision of over 300 decimal places, so the `record_score` is provided as a human-readable and friendly interpretation of this.', - }), - record_score: z.number().register(z.globalRegistry, { - description: - 'A normalized score between 0-100, which is based on the probability of the anomalousness of this record. Unlike `initial_record_score`, this value will be updated by a re-normalization process as new data is analyzed.', - }), - result_type: z.string().register(z.globalRegistry, { - description: 'Internal. This is always set to `record`.', - }), - timestamp: types_epoch_time_unit_millis, - typical: z.optional( - z.array(z.number()).register(z.globalRegistry, { - description: 'The typical value for the bucket, according to analytical modeling.', - }) - ), + actual: z.optional(z.array(z.number()).register(z.globalRegistry, { + description: 'The actual value for the bucket.' + })), + anomaly_score_explanation: z.optional(ml_types_anomaly_explanation), + bucket_span: types_duration_value_unit_seconds, + by_field_name: z.optional(z.string().register(z.globalRegistry, { + description: 'The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split.' + })), + by_field_value: z.optional(z.string().register(z.globalRegistry, { + description: 'The value of `by_field_name`.' + })), + causes: z.optional(z.array(ml_types_anomaly_cause).register(z.globalRegistry, { + description: 'For population analysis, an over field must be specified in the detector. This property contains an array of anomaly records that are the causes for the anomaly that has been identified for the over field. This sub-resource contains the most anomalous records for the `over_field_name`. For scalability reasons, a maximum of the 10 most significant causes of the anomaly are returned. As part of the core analytical modeling, these low-level anomaly records are aggregated for their parent over field record. The `causes` resource contains similar elements to the record resource, namely `actual`, `typical`, `geo_results.actual_point`, `geo_results.typical_point`, `*_field_name` and `*_field_value`. Probability and scores are not applicable to causes.' + })), + detector_index: z.number().register(z.globalRegistry, { + description: 'A unique identifier for the detector.' + }), + field_name: z.optional(z.string().register(z.globalRegistry, { + description: 'Certain functions require a field to operate on, for example, `sum()`. For those functions, this value is the name of the field to be analyzed.' + })), + function: z.optional(z.string().register(z.globalRegistry, { + description: 'The function in which the anomaly occurs, as specified in the detector configuration. For example, `max`.' + })), + function_description: z.optional(z.string().register(z.globalRegistry, { + description: 'The description of the function in which the anomaly occurs, as specified in the detector configuration.' + })), + geo_results: z.optional(ml_types_geo_results), + influencers: z.optional(z.array(ml_types_influence).register(z.globalRegistry, { + description: 'If influencers were specified in the detector configuration, this array contains influencers that contributed to or were to blame for an anomaly.' + })), + initial_record_score: z.number().register(z.globalRegistry, { + description: 'A normalized score between 0-100, which is based on the probability of the anomalousness of this record. This is the initial value that was calculated at the time the bucket was processed.' + }), + is_interim: z.boolean().register(z.globalRegistry, { + description: 'If true, this is an interim result. In other words, the results are calculated based on partial input data.' + }), + job_id: z.string().register(z.globalRegistry, { + description: 'Identifier for the anomaly detection job.' + }), + over_field_name: z.optional(z.string().register(z.globalRegistry, { + description: 'The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits.' + })), + over_field_value: z.optional(z.string().register(z.globalRegistry, { + description: 'The value of `over_field_name`.' + })), + partition_field_name: z.optional(z.string().register(z.globalRegistry, { + description: 'The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field.' + })), + partition_field_value: z.optional(z.string().register(z.globalRegistry, { + description: 'The value of `partition_field_name`.' + })), + probability: z.number().register(z.globalRegistry, { + description: 'The probability of the individual anomaly occurring, in the range 0 to 1. For example, `0.0000772031`. This value can be held to a high precision of over 300 decimal places, so the `record_score` is provided as a human-readable and friendly interpretation of this.' + }), + record_score: z.number().register(z.globalRegistry, { + description: 'A normalized score between 0-100, which is based on the probability of the anomalousness of this record. Unlike `initial_record_score`, this value will be updated by a re-normalization process as new data is analyzed.' + }), + result_type: z.string().register(z.globalRegistry, { + description: 'Internal. This is always set to `record`.' + }), + timestamp: types_epoch_time_unit_millis, + typical: z.optional(z.array(z.number()).register(z.globalRegistry, { + description: 'The typical value for the bucket, according to analytical modeling.' + })) }); export const ml_types_include = z.enum([ - 'definition', - 'feature_importance_baseline', - 'hyperparameters', - 'total_feature_importance', - 'definition_status', + 'definition', + 'feature_importance_baseline', + 'hyperparameters', + 'total_feature_importance', + 'definition_status' ]); -export const ml_types_trained_model_type = z.enum(['tree_ensemble', 'lang_ident', 'pytorch']); +export const ml_types_trained_model_type = z.enum([ + 'tree_ensemble', + 'lang_ident', + 'pytorch' +]); -export const ml_types_tokenization_truncate = z.enum(['first', 'second', 'none']); +export const ml_types_tokenization_truncate = z.enum([ + 'first', + 'second', + 'none' +]); export const ml_types_common_tokenization_config = z.object({ - do_lower_case: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Should the tokenizer lower case the text', - }) - ), - max_sequence_length: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum input sequence length for the model', - }) - ), - span: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Tokenization spanning options. Special value of -1 indicates no spanning takes place', - }) - ), - truncate: z.optional(ml_types_tokenization_truncate), - with_special_tokens: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Is tokenization completed with special tokens', - }) - ), + do_lower_case: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Should the tokenizer lower case the text' + })), + max_sequence_length: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum input sequence length for the model' + })), + span: z.optional(z.number().register(z.globalRegistry, { + description: 'Tokenization spanning options. Special value of -1 indicates no spanning takes place' + })), + truncate: z.optional(ml_types_tokenization_truncate), + with_special_tokens: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Is tokenization completed with special tokens' + })) }); /** * BERT and MPNet tokenization configuration options */ -export const ml_types_nlp_bert_tokenization_config = ml_types_common_tokenization_config.and( - z.record(z.string(), z.unknown()) -); +export const ml_types_nlp_bert_tokenization_config = ml_types_common_tokenization_config.and(z.record(z.string(), z.unknown())); /** * RoBERTa tokenization configuration options */ -export const ml_types_nlp_roberta_tokenization_config = ml_types_common_tokenization_config.and( - z.object({ - add_prefix_space: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Should the tokenizer prefix input with a space character', - }) - ), - }) -); +export const ml_types_nlp_roberta_tokenization_config = ml_types_common_tokenization_config.and(z.object({ + add_prefix_space: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Should the tokenizer prefix input with a space character' + })) +})); -export const ml_types_xlm_roberta_tokenization_config = ml_types_common_tokenization_config.and( - z.record(z.string(), z.unknown()) -); +export const ml_types_xlm_roberta_tokenization_config = ml_types_common_tokenization_config.and(z.record(z.string(), z.unknown())); /** * Tokenization options stored in inference configuration */ -export const ml_types_tokenization_config_container = z - .object({ +export const ml_types_tokenization_config_container = z.object({ bert: z.optional(ml_types_nlp_bert_tokenization_config), bert_ja: z.optional(ml_types_nlp_bert_tokenization_config), mpnet: z.optional(ml_types_nlp_bert_tokenization_config), roberta: z.optional(ml_types_nlp_roberta_tokenization_config), - xlm_roberta: z.optional(ml_types_xlm_roberta_tokenization_config), - }) - .register(z.globalRegistry, { - description: 'Tokenization options stored in inference configuration', - }); + xlm_roberta: z.optional(ml_types_xlm_roberta_tokenization_config) +}).register(z.globalRegistry, { + description: 'Tokenization options stored in inference configuration' +}); export const ml_types_vocabulary = z.object({ - index: types_index_name, + index: types_index_name }); /** * Text classification configuration options */ -export const ml_types_text_classification_inference_options = z - .object({ - num_top_classes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the number of top class predictions to return. Defaults to 0.', - }) - ), +export const ml_types_text_classification_inference_options = z.object({ + num_top_classes: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the number of top class predictions to return. Defaults to 0.' + })), tokenization: z.optional(ml_types_tokenization_config_container), - results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.', - }) - ), - classification_labels: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'Classification labels to apply other than the stored labels. Must have the same deminsions as the default configured labels', - }) - ), - vocabulary: z.optional(ml_types_vocabulary), - }) - .register(z.globalRegistry, { - description: 'Text classification configuration options', - }); + results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.' + })), + classification_labels: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Classification labels to apply other than the stored labels. Must have the same deminsions as the default configured labels' + })), + vocabulary: z.optional(ml_types_vocabulary) +}).register(z.globalRegistry, { + description: 'Text classification configuration options' +}); /** * Zero shot classification configuration options */ -export const ml_types_zero_shot_classification_inference_options = z - .object({ +export const ml_types_zero_shot_classification_inference_options = z.object({ tokenization: z.optional(ml_types_tokenization_config_container), - hypothesis_template: z.optional( - z.string().register(z.globalRegistry, { - description: 'Hypothesis template used when tokenizing labels for prediction', - }) - ), + hypothesis_template: z.optional(z.string().register(z.globalRegistry, { + description: 'Hypothesis template used when tokenizing labels for prediction' + })), classification_labels: z.array(z.string()).register(z.globalRegistry, { - description: - 'The zero shot classification labels indicating entailment, neutral, and contradiction\nMust contain exactly and only entailment, neutral, and contradiction', - }), - results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.', - }) - ), - multi_label: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Indicates if more than one true label exists.', - }) - ), - labels: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'The labels to predict.', - }) - ), - }) - .register(z.globalRegistry, { - description: 'Zero shot classification configuration options', - }); + description: 'The zero shot classification labels indicating entailment, neutral, and contradiction\nMust contain exactly and only entailment, neutral, and contradiction' + }), + results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.' + })), + multi_label: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates if more than one true label exists.' + })), + labels: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The labels to predict.' + })) +}).register(z.globalRegistry, { + description: 'Zero shot classification configuration options' +}); /** * Fill mask inference options */ -export const ml_types_fill_mask_inference_options = z - .object({ - mask_token: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The string/token which will be removed from incoming documents and replaced with the inference prediction(s).\nIn a response, this field contains the mask token for the specified model/tokenizer. Each model and tokenizer\nhas a predefined mask token which cannot be changed. Thus, it is recommended not to set this value in requests.\nHowever, if this field is present in a request, its value must match the predefined value for that model/tokenizer,\notherwise the request will fail.', - }) - ), - num_top_classes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the number of top class predictions to return. Defaults to 0.', - }) - ), +export const ml_types_fill_mask_inference_options = z.object({ + mask_token: z.optional(z.string().register(z.globalRegistry, { + description: 'The string/token which will be removed from incoming documents and replaced with the inference prediction(s).\nIn a response, this field contains the mask token for the specified model/tokenizer. Each model and tokenizer\nhas a predefined mask token which cannot be changed. Thus, it is recommended not to set this value in requests.\nHowever, if this field is present in a request, its value must match the predefined value for that model/tokenizer,\notherwise the request will fail.' + })), + num_top_classes: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the number of top class predictions to return. Defaults to 0.' + })), tokenization: z.optional(ml_types_tokenization_config_container), - results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.', - }) - ), - vocabulary: z.optional(ml_types_vocabulary), - }) - .register(z.globalRegistry, { - description: 'Fill mask inference options', - }); + results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.' + })), + vocabulary: z.optional(ml_types_vocabulary) +}).register(z.globalRegistry, { + description: 'Fill mask inference options' +}); /** * Named entity recognition options */ -export const ml_types_ner_inference_options = z - .object({ +export const ml_types_ner_inference_options = z.object({ tokenization: z.optional(ml_types_tokenization_config_container), - results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.', - }) - ), - classification_labels: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'The token classification labels. Must be IOB formatted tags', - }) - ), - vocabulary: z.optional(ml_types_vocabulary), - }) - .register(z.globalRegistry, { - description: 'Named entity recognition options', - }); + results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.' + })), + classification_labels: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The token classification labels. Must be IOB formatted tags' + })), + vocabulary: z.optional(ml_types_vocabulary) +}).register(z.globalRegistry, { + description: 'Named entity recognition options' +}); /** * Pass through configuration options */ -export const ml_types_pass_through_inference_options = z - .object({ +export const ml_types_pass_through_inference_options = z.object({ tokenization: z.optional(ml_types_tokenization_config_container), - results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.', - }) - ), - vocabulary: z.optional(ml_types_vocabulary), - }) - .register(z.globalRegistry, { - description: 'Pass through configuration options', - }); + results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.' + })), + vocabulary: z.optional(ml_types_vocabulary) +}).register(z.globalRegistry, { + description: 'Pass through configuration options' +}); /** * Text embedding inference options */ -export const ml_types_text_embedding_inference_options = z - .object({ - embedding_size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of dimensions in the embedding output', - }) - ), +export const ml_types_text_embedding_inference_options = z.object({ + embedding_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of dimensions in the embedding output' + })), tokenization: z.optional(ml_types_tokenization_config_container), - results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.', - }) - ), - vocabulary: z.optional(ml_types_vocabulary), - }) - .register(z.globalRegistry, { - description: 'Text embedding inference options', - }); + results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.' + })), + vocabulary: z.optional(ml_types_vocabulary) +}).register(z.globalRegistry, { + description: 'Text embedding inference options' +}); /** * Text expansion inference options */ -export const ml_types_text_expansion_inference_options = z - .object({ +export const ml_types_text_expansion_inference_options = z.object({ tokenization: z.optional(ml_types_tokenization_config_container), - results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.', - }) - ), - vocabulary: z.optional(ml_types_vocabulary), - }) - .register(z.globalRegistry, { - description: 'Text expansion inference options', - }); + results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.' + })), + vocabulary: z.optional(ml_types_vocabulary) +}).register(z.globalRegistry, { + description: 'Text expansion inference options' +}); /** * Question answering inference options */ -export const ml_types_question_answering_inference_options = z - .object({ - num_top_classes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the number of top class predictions to return. Defaults to 0.', - }) - ), +export const ml_types_question_answering_inference_options = z.object({ + num_top_classes: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the number of top class predictions to return. Defaults to 0.' + })), tokenization: z.optional(ml_types_tokenization_config_container), - results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.', - }) - ), - max_answer_length: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum answer length to consider', - }) - ), - }) - .register(z.globalRegistry, { - description: 'Question answering inference options', - }); + results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.' + })), + max_answer_length: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum answer length to consider' + })) +}).register(z.globalRegistry, { + description: 'Question answering inference options' +}); export const ml_types_trained_model_config_input = z.object({ - field_names: z.array(types_field).register(z.globalRegistry, { - description: 'An array of input field names for the model.', - }), + field_names: z.array(types_field).register(z.globalRegistry, { + description: 'An array of input field names for the model.' + }) }); export const ml_types_hyperparameter = z.object({ - absolute_importance: z.optional( - z.number().register(z.globalRegistry, { - description: - 'A positive number showing how much the parameter influences the variation of the loss function. For hyperparameters with values that are not specified by the user but tuned during hyperparameter optimization.', - }) - ), - name: types_name, - relative_importance: z.optional( - z.number().register(z.globalRegistry, { - description: - 'A number between 0 and 1 showing the proportion of influence on the variation of the loss function among all tuned hyperparameters. For hyperparameters with values that are not specified by the user but tuned during hyperparameter optimization.', + absolute_importance: z.optional(z.number().register(z.globalRegistry, { + description: 'A positive number showing how much the parameter influences the variation of the loss function. For hyperparameters with values that are not specified by the user but tuned during hyperparameter optimization.' + })), + name: types_name, + relative_importance: z.optional(z.number().register(z.globalRegistry, { + description: 'A number between 0 and 1 showing the proportion of influence on the variation of the loss function among all tuned hyperparameters. For hyperparameters with values that are not specified by the user but tuned during hyperparameter optimization.' + })), + supplied: z.boolean().register(z.globalRegistry, { + description: 'Indicates if the hyperparameter is specified by the user (true) or optimized (false).' + }), + value: z.number().register(z.globalRegistry, { + description: 'The value of the hyperparameter, either optimized or specified by the user.' }) - ), - supplied: z.boolean().register(z.globalRegistry, { - description: - 'Indicates if the hyperparameter is specified by the user (true) or optimized (false).', - }), - value: z.number().register(z.globalRegistry, { - description: 'The value of the hyperparameter, either optimized or specified by the user.', - }), }); export const ml_types_total_feature_importance_statistics = z.object({ - mean_magnitude: z.number().register(z.globalRegistry, { - description: - 'The average magnitude of this feature across all the training data. This value is the average of the absolute values of the importance for this feature.', - }), - max: z.number().register(z.globalRegistry, { - description: 'The maximum importance value across all the training data for this feature.', - }), - min: z.number().register(z.globalRegistry, { - description: 'The minimum importance value across all the training data for this feature.', - }), + mean_magnitude: z.number().register(z.globalRegistry, { + description: 'The average magnitude of this feature across all the training data. This value is the average of the absolute values of the importance for this feature.' + }), + max: z.number().register(z.globalRegistry, { + description: 'The maximum importance value across all the training data for this feature.' + }), + min: z.number().register(z.globalRegistry, { + description: 'The minimum importance value across all the training data for this feature.' + }) }); export const ml_types_total_feature_importance_class = z.object({ - class_name: types_name, - importance: z.array(ml_types_total_feature_importance_statistics).register(z.globalRegistry, { - description: - 'A collection of feature importance statistics related to the training data set for this particular feature.', - }), + class_name: types_name, + importance: z.array(ml_types_total_feature_importance_statistics).register(z.globalRegistry, { + description: 'A collection of feature importance statistics related to the training data set for this particular feature.' + }) }); export const ml_types_total_feature_importance = z.object({ - feature_name: types_name, - importance: z.array(ml_types_total_feature_importance_statistics).register(z.globalRegistry, { - description: - 'A collection of feature importance statistics related to the training data set for this particular feature.', - }), - classes: z.array(ml_types_total_feature_importance_class).register(z.globalRegistry, { - description: - 'If the trained model is a classification model, feature importance statistics are gathered per target class value.', - }), + feature_name: types_name, + importance: z.array(ml_types_total_feature_importance_statistics).register(z.globalRegistry, { + description: 'A collection of feature importance statistics related to the training data set for this particular feature.' + }), + classes: z.array(ml_types_total_feature_importance_class).register(z.globalRegistry, { + description: 'If the trained model is a classification model, feature importance statistics are gathered per target class value.' + }) }); export const ml_types_trained_model_config_metadata = z.object({ - model_aliases: z.optional(z.array(z.string())), - feature_importance_baseline: z.optional( - z.record(z.string(), z.string()).register(z.globalRegistry, { - description: - 'An object that contains the baseline for feature importance values. For regression analysis, it is a single value. For classification analysis, there is a value for each class.', - }) - ), - hyperparameters: z.optional( - z.array(ml_types_hyperparameter).register(z.globalRegistry, { - description: - 'List of the available hyperparameters optimized during the fine_parameter_tuning phase as well as specified by the user.', - }) - ), - total_feature_importance: z.optional( - z.array(ml_types_total_feature_importance).register(z.globalRegistry, { - description: - 'An array of the total feature importance for each feature used from the training data set. This array of objects is returned if data frame analytics trained the model and the request includes total_feature_importance in the include request parameter.', - }) - ), + model_aliases: z.optional(z.array(z.string())), + feature_importance_baseline: z.optional(z.record(z.string(), z.string()).register(z.globalRegistry, { + description: 'An object that contains the baseline for feature importance values. For regression analysis, it is a single value. For classification analysis, there is a value for each class.' + })), + hyperparameters: z.optional(z.array(ml_types_hyperparameter).register(z.globalRegistry, { + description: 'List of the available hyperparameters optimized during the fine_parameter_tuning phase as well as specified by the user.' + })), + total_feature_importance: z.optional(z.array(ml_types_total_feature_importance).register(z.globalRegistry, { + description: 'An array of the total feature importance for each feature used from the training data set. This array of objects is returned if data frame analytics trained the model and the request includes total_feature_importance in the include request parameter.' + })) }); export const ml_types_trained_model_prefix_strings = z.object({ - ingest: z.optional( - z.string().register(z.globalRegistry, { - description: 'String prepended to input at ingest', - }) - ), - search: z.optional( - z.string().register(z.globalRegistry, { - description: 'String prepended to input at search', - }) - ), + ingest: z.optional(z.string().register(z.globalRegistry, { + description: 'String prepended to input at ingest' + })), + search: z.optional(z.string().register(z.globalRegistry, { + description: 'String prepended to input at search' + })) }); export const ml_types_model_package_config = z.object({ - create_time: z.optional(types_epoch_time_unit_millis), - description: z.optional(z.string()), - inference_config: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - metadata: z.optional(types_metadata), - minimum_version: z.optional(z.string()), - model_repository: z.optional(z.string()), - model_type: z.optional(z.string()), - packaged_model_id: types_id, - platform_architecture: z.optional(z.string()), - prefix_strings: z.optional(ml_types_trained_model_prefix_strings), - size: z.optional(types_byte_size), - sha256: z.optional(z.string()), - tags: z.optional(z.array(z.string())), - vocabulary_file: z.optional(z.string()), + create_time: z.optional(types_epoch_time_unit_millis), + description: z.optional(z.string()), + inference_config: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + metadata: z.optional(types_metadata), + minimum_version: z.optional(z.string()), + model_repository: z.optional(z.string()), + model_type: z.optional(z.string()), + packaged_model_id: types_id, + platform_architecture: z.optional(z.string()), + prefix_strings: z.optional(ml_types_trained_model_prefix_strings), + size: z.optional(types_byte_size), + sha256: z.optional(z.string()), + tags: z.optional(z.array(z.string())), + vocabulary_file: z.optional(z.string()) }); export const ml_types_trained_model_location_index = z.object({ - name: types_index_name, + name: types_index_name }); export const ml_types_trained_model_location = z.object({ - index: ml_types_trained_model_location_index, + index: ml_types_trained_model_location_index }); export const ml_types_adaptive_allocations_settings = z.object({ - enabled: z.boolean().register(z.globalRegistry, { - description: 'If true, adaptive_allocations is enabled', - }), - min_number_of_allocations: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Specifies the minimum number of allocations to scale to.\nIf set, it must be greater than or equal to 0.\nIf not defined, the deployment scales to 0.', - }) - ), - max_number_of_allocations: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Specifies the maximum number of allocations to scale to.\nIf set, it must be greater than or equal to min_number_of_allocations.', - }) - ), + enabled: z.boolean().register(z.globalRegistry, { + description: 'If true, adaptive_allocations is enabled' + }), + min_number_of_allocations: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the minimum number of allocations to scale to.\nIf set, it must be greater than or equal to 0.\nIf not defined, the deployment scales to 0.' + })), + max_number_of_allocations: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of allocations to scale to.\nIf set, it must be greater than or equal to min_number_of_allocations.' + })) }); export const ml_types_deployment_allocation_state = z.enum([ - 'started', - 'starting', - 'fully_allocated', + 'started', + 'starting', + 'fully_allocated' ]); export const ml_types_trained_model_deployment_allocation_status = z.object({ - allocation_count: z.number().register(z.globalRegistry, { - description: 'The current number of nodes where the model is allocated.', - }), - state: ml_types_deployment_allocation_state, - target_allocation_count: z.number().register(z.globalRegistry, { - description: 'The desired number of nodes for model allocation.', - }), + allocation_count: z.number().register(z.globalRegistry, { + description: 'The current number of nodes where the model is allocated.' + }), + state: ml_types_deployment_allocation_state, + target_allocation_count: z.number().register(z.globalRegistry, { + description: 'The desired number of nodes for model allocation.' + }) }); export const ml_types_routing_state = z.enum([ - 'failed', - 'started', - 'starting', - 'stopped', - 'stopping', + 'failed', + 'started', + 'starting', + 'stopped', + 'stopping' ]); export const ml_types_trained_model_assignment_routing_state_and_reason = z.object({ - reason: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The reason for the current state. It is usually populated only when the\n`routing_state` is `failed`.', - }) - ), - routing_state: ml_types_routing_state, + reason: z.optional(z.string().register(z.globalRegistry, { + description: 'The reason for the current state. It is usually populated only when the\n`routing_state` is `failed`.' + })), + routing_state: ml_types_routing_state }); export const ml_types_trained_model_deployment_nodes_stats = z.object({ - average_inference_time_ms: z.optional(types_duration_value_unit_float_millis), - average_inference_time_ms_last_minute: z.optional(types_duration_value_unit_float_millis), - average_inference_time_ms_excluding_cache_hits: z.optional( - types_duration_value_unit_float_millis - ), - error_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of errors when evaluating the trained model.', - }) - ), - inference_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'The total number of inference calls made against this node for this model.', - }) - ), - inference_cache_hit_count: z.optional(z.number()), - inference_cache_hit_count_last_minute: z.optional(z.number()), - last_access: z.optional(types_epoch_time_unit_millis), - node: z.optional(ml_types_discovery_node), - number_of_allocations: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of allocations assigned to this node.', - }) - ), - number_of_pending_requests: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of inference requests queued to be processed.', - }) - ), - peak_throughput_per_minute: z.number(), - rejected_execution_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of inference requests that were not processed because the queue was full.', - }) - ), - routing_state: ml_types_trained_model_assignment_routing_state_and_reason, - start_time: z.optional(types_epoch_time_unit_millis), - threads_per_allocation: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of threads used by each allocation during inference.', - }) - ), - throughput_last_minute: z.number(), - timeout_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of inference requests that timed out before being processed.', - }) - ), + average_inference_time_ms: z.optional(types_duration_value_unit_float_millis), + average_inference_time_ms_last_minute: z.optional(types_duration_value_unit_float_millis), + average_inference_time_ms_excluding_cache_hits: z.optional(types_duration_value_unit_float_millis), + error_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of errors when evaluating the trained model.' + })), + inference_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The total number of inference calls made against this node for this model.' + })), + inference_cache_hit_count: z.optional(z.number()), + inference_cache_hit_count_last_minute: z.optional(z.number()), + last_access: z.optional(types_epoch_time_unit_millis), + node: z.optional(ml_types_discovery_node), + number_of_allocations: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of allocations assigned to this node.' + })), + number_of_pending_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of inference requests queued to be processed.' + })), + peak_throughput_per_minute: z.number(), + rejected_execution_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of inference requests that were not processed because the queue was full.' + })), + routing_state: ml_types_trained_model_assignment_routing_state_and_reason, + start_time: z.optional(types_epoch_time_unit_millis), + threads_per_allocation: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of threads used by each allocation during inference.' + })), + throughput_last_minute: z.number(), + timeout_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of inference requests that timed out before being processed.' + })) }); export const ml_types_training_priority = z.enum(['normal', 'low']); export const ml_types_deployment_assignment_state = z.enum([ - 'started', - 'starting', - 'stopping', - 'failed', + 'started', + 'starting', + 'stopping', + 'failed' ]); export const ml_types_trained_model_deployment_stats = z.object({ - adaptive_allocations: z.optional(ml_types_adaptive_allocations_settings), - allocation_status: z.optional(ml_types_trained_model_deployment_allocation_status), - cache_size: z.optional(types_byte_size), - deployment_id: types_id, - error_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'The sum of `error_count` for all nodes in the deployment.', - }) - ), - inference_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'The sum of `inference_count` for all nodes in the deployment.', - }) - ), - model_id: types_id, - nodes: z.array(ml_types_trained_model_deployment_nodes_stats).register(z.globalRegistry, { - description: - 'The deployment stats for each node that currently has the model allocated.\nIn serverless, stats are reported for a single unnamed virtual node.', - }), - number_of_allocations: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of allocations requested.', - }) - ), - peak_throughput_per_minute: z.number(), - priority: ml_types_training_priority, - queue_capacity: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of inference requests that can be queued before new requests are rejected.', - }) - ), - rejected_execution_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The sum of `rejected_execution_count` for all nodes in the deployment.\nIndividual nodes reject an inference request if the inference queue is full.\nThe queue size is controlled by the `queue_capacity` setting in the start\ntrained model deployment API.', - }) - ), - reason: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The reason for the current deployment state. Usually only populated when\nthe model is not deployed to a node.', - }) - ), - start_time: types_epoch_time_unit_millis, - state: z.optional(ml_types_deployment_assignment_state), - threads_per_allocation: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of threads used be each allocation during inference.', - }) - ), - timeout_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'The sum of `timeout_count` for all nodes in the deployment.', - }) - ), + adaptive_allocations: z.optional(ml_types_adaptive_allocations_settings), + allocation_status: z.optional(ml_types_trained_model_deployment_allocation_status), + cache_size: z.optional(types_byte_size), + deployment_id: types_id, + error_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The sum of `error_count` for all nodes in the deployment.' + })), + inference_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The sum of `inference_count` for all nodes in the deployment.' + })), + model_id: types_id, + nodes: z.array(ml_types_trained_model_deployment_nodes_stats).register(z.globalRegistry, { + description: 'The deployment stats for each node that currently has the model allocated.\nIn serverless, stats are reported for a single unnamed virtual node.' + }), + number_of_allocations: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of allocations requested.' + })), + peak_throughput_per_minute: z.number(), + priority: ml_types_training_priority, + queue_capacity: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of inference requests that can be queued before new requests are rejected.' + })), + rejected_execution_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The sum of `rejected_execution_count` for all nodes in the deployment.\nIndividual nodes reject an inference request if the inference queue is full.\nThe queue size is controlled by the `queue_capacity` setting in the start\ntrained model deployment API.' + })), + reason: z.optional(z.string().register(z.globalRegistry, { + description: 'The reason for the current deployment state. Usually only populated when\nthe model is not deployed to a node.' + })), + start_time: types_epoch_time_unit_millis, + state: z.optional(ml_types_deployment_assignment_state), + threads_per_allocation: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of threads used be each allocation during inference.' + })), + timeout_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The sum of `timeout_count` for all nodes in the deployment.' + })) }); export const ml_types_trained_model_inference_stats = z.object({ - cache_miss_count: z.number().register(z.globalRegistry, { - description: - 'The number of times the model was loaded for inference and was not retrieved from the cache.\nIf this number is close to the `inference_count`, the cache is not being appropriately used.\nThis can be solved by increasing the cache size or its time-to-live (TTL).\nRefer to general machine learning settings for the appropriate settings.', - }), - failure_count: z.number().register(z.globalRegistry, { - description: 'The number of failures when using the model for inference.', - }), - inference_count: z.number().register(z.globalRegistry, { - description: - 'The total number of times the model has been called for inference.\nThis is across all inference contexts, including all pipelines.', - }), - missing_all_fields_count: z.number().register(z.globalRegistry, { - description: - 'The number of inference calls where all the training features for the model were missing.', - }), - timestamp: types_epoch_time_unit_millis, + cache_miss_count: z.number().register(z.globalRegistry, { + description: 'The number of times the model was loaded for inference and was not retrieved from the cache.\nIf this number is close to the `inference_count`, the cache is not being appropriately used.\nThis can be solved by increasing the cache size or its time-to-live (TTL).\nRefer to general machine learning settings for the appropriate settings.' + }), + failure_count: z.number().register(z.globalRegistry, { + description: 'The number of failures when using the model for inference.' + }), + inference_count: z.number().register(z.globalRegistry, { + description: 'The total number of times the model has been called for inference.\nThis is across all inference contexts, including all pipelines.' + }), + missing_all_fields_count: z.number().register(z.globalRegistry, { + description: 'The number of inference calls where all the training features for the model were missing.' + }), + timestamp: types_epoch_time_unit_millis }); export const ml_types_trained_model_size_stats = z.object({ - model_size_bytes: types_byte_size, - required_native_memory_bytes: types_byte_size, + model_size_bytes: types_byte_size, + required_native_memory_bytes: types_byte_size }); export const ml_types_trained_model_stats = z.object({ - deployment_stats: z.optional(ml_types_trained_model_deployment_stats), - inference_stats: z.optional(ml_types_trained_model_inference_stats), - ingest: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'A collection of ingest stats for the model across all nodes.\nThe values are summations of the individual node statistics.\nThe format matches the ingest section in the nodes stats API.', + deployment_stats: z.optional(ml_types_trained_model_deployment_stats), + inference_stats: z.optional(ml_types_trained_model_inference_stats), + ingest: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'A collection of ingest stats for the model across all nodes.\nThe values are summations of the individual node statistics.\nThe format matches the ingest section in the nodes stats API.' + })), + model_id: types_id, + model_size_stats: ml_types_trained_model_size_stats, + pipeline_count: z.number().register(z.globalRegistry, { + description: 'The number of ingest pipelines that currently refer to the model.' }) - ), - model_id: types_id, - model_size_stats: ml_types_trained_model_size_stats, - pipeline_count: z.number().register(z.globalRegistry, { - description: 'The number of ingest pipelines that currently refer to the model.', - }), }); export const ml_types_nlp_tokenization_update_options = z.object({ - truncate: z.optional(ml_types_tokenization_truncate), - span: z.optional( - z.number().register(z.globalRegistry, { - description: 'Span options to apply', - }) - ), + truncate: z.optional(ml_types_tokenization_truncate), + span: z.optional(z.number().register(z.globalRegistry, { + description: 'Span options to apply' + })) }); export const ml_types_text_classification_inference_update_options = z.object({ - num_top_classes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the number of top class predictions to return. Defaults to 0.', - }) - ), - tokenization: z.optional(ml_types_nlp_tokenization_update_options), - results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.', - }) - ), - classification_labels: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'Classification labels to apply other than the stored labels. Must have the same deminsions as the default configured labels', - }) - ), + num_top_classes: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the number of top class predictions to return. Defaults to 0.' + })), + tokenization: z.optional(ml_types_nlp_tokenization_update_options), + results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.' + })), + classification_labels: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Classification labels to apply other than the stored labels. Must have the same deminsions as the default configured labels' + })) }); export const ml_types_zero_shot_classification_inference_update_options = z.object({ - tokenization: z.optional(ml_types_nlp_tokenization_update_options), - results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.', + tokenization: z.optional(ml_types_nlp_tokenization_update_options), + results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.' + })), + multi_label: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Update the configured multi label option. Indicates if more than one true label exists. Defaults to the configured value.' + })), + labels: z.array(z.string()).register(z.globalRegistry, { + description: 'The labels to predict.' }) - ), - multi_label: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Update the configured multi label option. Indicates if more than one true label exists. Defaults to the configured value.', - }) - ), - labels: z.array(z.string()).register(z.globalRegistry, { - description: 'The labels to predict.', - }), }); export const ml_types_fill_mask_inference_update_options = z.object({ - num_top_classes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the number of top class predictions to return. Defaults to 0.', - }) - ), - tokenization: z.optional(ml_types_nlp_tokenization_update_options), - results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.', - }) - ), + num_top_classes: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the number of top class predictions to return. Defaults to 0.' + })), + tokenization: z.optional(ml_types_nlp_tokenization_update_options), + results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.' + })) }); export const ml_types_ner_inference_update_options = z.object({ - tokenization: z.optional(ml_types_nlp_tokenization_update_options), - results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.', - }) - ), + tokenization: z.optional(ml_types_nlp_tokenization_update_options), + results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.' + })) }); export const ml_types_pass_through_inference_update_options = z.object({ - tokenization: z.optional(ml_types_nlp_tokenization_update_options), - results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.', - }) - ), + tokenization: z.optional(ml_types_nlp_tokenization_update_options), + results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.' + })) }); export const ml_types_text_embedding_inference_update_options = z.object({ - tokenization: z.optional(ml_types_nlp_tokenization_update_options), - results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.', - }) - ), + tokenization: z.optional(ml_types_nlp_tokenization_update_options), + results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.' + })) }); export const ml_types_text_expansion_inference_update_options = z.object({ - tokenization: z.optional(ml_types_nlp_tokenization_update_options), - results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.', - }) - ), + tokenization: z.optional(ml_types_nlp_tokenization_update_options), + results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.' + })) }); export const ml_types_question_answering_inference_update_options = z.object({ - question: z.string().register(z.globalRegistry, { - description: 'The question to answer given the inference context', - }), - num_top_classes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the number of top class predictions to return. Defaults to 0.', - }) - ), - tokenization: z.optional(ml_types_nlp_tokenization_update_options), - results_field: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.', - }) - ), - max_answer_length: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum answer length to consider for extraction', - }) - ), + question: z.string().register(z.globalRegistry, { + description: 'The question to answer given the inference context' + }), + num_top_classes: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the number of top class predictions to return. Defaults to 0.' + })), + tokenization: z.optional(ml_types_nlp_tokenization_update_options), + results_field: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.' + })), + max_answer_length: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum answer length to consider for extraction' + })) }); export const ml_types_inference_config_update_container = z.object({ - regression: z.optional(ml_types_regression_inference_options), - classification: z.optional(ml_types_classification_inference_options), - text_classification: z.optional(ml_types_text_classification_inference_update_options), - zero_shot_classification: z.optional(ml_types_zero_shot_classification_inference_update_options), - fill_mask: z.optional(ml_types_fill_mask_inference_update_options), - ner: z.optional(ml_types_ner_inference_update_options), - pass_through: z.optional(ml_types_pass_through_inference_update_options), - text_embedding: z.optional(ml_types_text_embedding_inference_update_options), - text_expansion: z.optional(ml_types_text_expansion_inference_update_options), - question_answering: z.optional(ml_types_question_answering_inference_update_options), + regression: z.optional(ml_types_regression_inference_options), + classification: z.optional(ml_types_classification_inference_options), + text_classification: z.optional(ml_types_text_classification_inference_update_options), + zero_shot_classification: z.optional(ml_types_zero_shot_classification_inference_update_options), + fill_mask: z.optional(ml_types_fill_mask_inference_update_options), + ner: z.optional(ml_types_ner_inference_update_options), + pass_through: z.optional(ml_types_pass_through_inference_update_options), + text_embedding: z.optional(ml_types_text_embedding_inference_update_options), + text_expansion: z.optional(ml_types_text_expansion_inference_update_options), + question_answering: z.optional(ml_types_question_answering_inference_update_options) }); export const ml_types_trained_model_entities = z.object({ - class_name: z.string(), - class_probability: z.number(), - entity: z.string(), - start_pos: z.number(), - end_pos: z.number(), + class_name: z.string(), + class_probability: z.number(), + entity: z.string(), + start_pos: z.number(), + end_pos: z.number() }); -export const ml_types_predicted_value = z.union([types_scalar_value, z.array(types_scalar_value)]); +export const ml_types_predicted_value = z.union([ + types_scalar_value, + z.array(types_scalar_value) +]); export const ml_types_top_class_entry = z.object({ - class_name: z.string(), - class_probability: z.number(), - class_score: z.number(), + class_name: z.string(), + class_probability: z.number(), + class_score: z.number() }); export const ml_types_trained_model_inference_class_importance = z.object({ - class_name: z.string(), - importance: z.number(), + class_name: z.string(), + importance: z.number() }); export const ml_types_trained_model_inference_feature_importance = z.object({ - feature_name: z.string(), - importance: z.optional(z.number()), - classes: z.optional(z.array(ml_types_trained_model_inference_class_importance)), + feature_name: z.string(), + importance: z.optional(z.number()), + classes: z.optional(z.array(ml_types_trained_model_inference_class_importance)) }); export const ml_types_inference_response_result = z.object({ - entities: z.optional( - z.array(ml_types_trained_model_entities).register(z.globalRegistry, { - description: - 'If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.', - }) - ), - is_truncated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "Indicates whether the input text was truncated to meet the model's maximum sequence length limit. This property\nis present only when it is true.", - }) - ), - predicted_value: z.optional( - z.union([ml_types_predicted_value, z.array(ml_types_predicted_value)]) - ), - predicted_value_sequence: z.optional( - z.string().register(z.globalRegistry, { - description: - 'For fill mask tasks, the response contains the input text sequence with the mask token replaced by the predicted\nvalue.\nAdditionally', - }) - ), - prediction_probability: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies a probability for the predicted value.', - }) - ), - prediction_score: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies a confidence score for the predicted value.', - }) - ), - top_classes: z.optional( - z.array(ml_types_top_class_entry).register(z.globalRegistry, { - description: - 'For fill mask, text classification, and zero shot classification tasks, the response contains a list of top\nclass entries.', - }) - ), - warning: z.optional( - z.string().register(z.globalRegistry, { - description: 'If the request failed, the response contains the reason for the failure.', - }) - ), - feature_importance: z.optional( - z.array(ml_types_trained_model_inference_feature_importance).register(z.globalRegistry, { - description: - 'The feature importance for the inference results. Relevant only for classification or regression models', - }) - ), + entities: z.optional(z.array(ml_types_trained_model_entities).register(z.globalRegistry, { + description: 'If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.' + })), + is_truncated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the input text was truncated to meet the model\'s maximum sequence length limit. This property\nis present only when it is true.' + })), + predicted_value: z.optional(z.union([ + ml_types_predicted_value, + z.array(ml_types_predicted_value) + ])), + predicted_value_sequence: z.optional(z.string().register(z.globalRegistry, { + description: 'For fill mask tasks, the response contains the input text sequence with the mask token replaced by the predicted\nvalue.\nAdditionally' + })), + prediction_probability: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies a probability for the predicted value.' + })), + prediction_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies a confidence score for the predicted value.' + })), + top_classes: z.optional(z.array(ml_types_top_class_entry).register(z.globalRegistry, { + description: 'For fill mask, text classification, and zero shot classification tasks, the response contains a list of top\nclass entries.' + })), + warning: z.optional(z.string().register(z.globalRegistry, { + description: 'If the request failed, the response contains the reason for the failure.' + })), + feature_importance: z.optional(z.array(ml_types_trained_model_inference_feature_importance).register(z.globalRegistry, { + description: 'The feature importance for the inference results. Relevant only for classification or regression models' + })) }); export const ml_info_datafeeds = z.object({ - scroll_size: z.number(), + scroll_size: z.number() }); export const ml_info_limits = z.object({ - max_single_ml_node_processors: z.optional(z.number()), - total_ml_processors: z.optional(z.number()), - max_model_memory_limit: z.optional(types_byte_size), - effective_max_model_memory_limit: z.optional(types_byte_size), - total_ml_memory: types_byte_size, + max_single_ml_node_processors: z.optional(z.number()), + total_ml_processors: z.optional(z.number()), + max_model_memory_limit: z.optional(types_byte_size), + effective_max_model_memory_limit: z.optional(types_byte_size), + total_ml_memory: types_byte_size }); export const ml_info_native_code = z.object({ - build_hash: z.string(), - version: types_version_string, + build_hash: z.string(), + version: types_version_string }); -export const types_http_headers = z.record(z.string(), z.union([z.string(), z.array(z.string())])); +export const types_http_headers = z.record(z.string(), z.union([ + z.string(), + z.array(z.string()) +])); export const ml_types_detector_read = z.object({ - by_field_name: z.optional(types_field), - custom_rules: z.optional( - z.array(ml_types_detection_rule).register(z.globalRegistry, { - description: - 'An array of custom rule objects, which enable you to customize the way detectors operate.\nFor example, a rule may dictate to the detector conditions under which results should be skipped.\nKibana refers to custom rules as job rules.', - }) - ), - detector_description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the detector.', - }) - ), - detector_index: z.optional( - z.number().register(z.globalRegistry, { - description: - 'A unique identifier for the detector.\nThis identifier is based on the order of the detectors in the `analysis_config`, starting at zero.', - }) - ), - exclude_frequent: z.optional(ml_types_exclude_frequent), - field_name: z.optional(types_field), - function: z.string().register(z.globalRegistry, { - description: - 'The analysis function that is used.\nFor example, `count`, `rare`, `mean`, `min`, `max`, and `sum`.', - }), - over_field_name: z.optional(types_field), - partition_field_name: z.optional(types_field), - use_null: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Defines whether a new series is used as the null series when there is no value for the by or partition fields.', - }) - ), + by_field_name: z.optional(types_field), + custom_rules: z.optional(z.array(ml_types_detection_rule).register(z.globalRegistry, { + description: 'An array of custom rule objects, which enable you to customize the way detectors operate.\nFor example, a rule may dictate to the detector conditions under which results should be skipped.\nKibana refers to custom rules as job rules.' + })), + detector_description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the detector.' + })), + detector_index: z.optional(z.number().register(z.globalRegistry, { + description: 'A unique identifier for the detector.\nThis identifier is based on the order of the detectors in the `analysis_config`, starting at zero.' + })), + exclude_frequent: z.optional(ml_types_exclude_frequent), + field_name: z.optional(types_field), + function: z.string().register(z.globalRegistry, { + description: 'The analysis function that is used.\nFor example, `count`, `rare`, `mean`, `min`, `max`, and `sum`.' + }), + over_field_name: z.optional(types_field), + partition_field_name: z.optional(types_field), + use_null: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Defines whether a new series is used as the null series when there is no value for the by or partition fields.' + })) }); export const ml_put_trained_model_frequency_encoding_preprocessor = z.object({ - field: z.string(), - feature_name: z.string(), - frequency_map: z.record(z.string(), z.number()), + field: z.string(), + feature_name: z.string(), + frequency_map: z.record(z.string(), z.number()) }); export const ml_put_trained_model_one_hot_encoding_preprocessor = z.object({ - field: z.string(), - hot_map: z.record(z.string(), z.string()), + field: z.string(), + hot_map: z.record(z.string(), z.string()) }); export const ml_put_trained_model_target_mean_encoding_preprocessor = z.object({ - field: z.string(), - feature_name: z.string(), - target_map: z.record(z.string(), z.number()), - default_value: z.number(), + field: z.string(), + feature_name: z.string(), + target_map: z.record(z.string(), z.number()), + default_value: z.number() }); export const ml_put_trained_model_preprocessor = z.object({ - frequency_encoding: z.optional(ml_put_trained_model_frequency_encoding_preprocessor), - one_hot_encoding: z.optional(ml_put_trained_model_one_hot_encoding_preprocessor), - target_mean_encoding: z.optional(ml_put_trained_model_target_mean_encoding_preprocessor), + frequency_encoding: z.optional(ml_put_trained_model_frequency_encoding_preprocessor), + one_hot_encoding: z.optional(ml_put_trained_model_one_hot_encoding_preprocessor), + target_mean_encoding: z.optional(ml_put_trained_model_target_mean_encoding_preprocessor) }); export const ml_put_trained_model_trained_model_tree_node = z.object({ - decision_type: z.optional(z.string()), - default_left: z.optional(z.boolean()), - leaf_value: z.optional(z.number()), - left_child: z.optional(z.number()), - node_index: z.number(), - right_child: z.optional(z.number()), - split_feature: z.optional(z.number()), - split_gain: z.optional(z.number()), - threshold: z.optional(z.number()), + decision_type: z.optional(z.string()), + default_left: z.optional(z.boolean()), + leaf_value: z.optional(z.number()), + left_child: z.optional(z.number()), + node_index: z.number(), + right_child: z.optional(z.number()), + split_feature: z.optional(z.number()), + split_gain: z.optional(z.number()), + threshold: z.optional(z.number()) }); export const ml_put_trained_model_trained_model_tree = z.object({ - classification_labels: z.optional(z.array(z.string())), - feature_names: z.array(z.string()), - target_type: z.optional(z.string()), - tree_structure: z.array(ml_put_trained_model_trained_model_tree_node), + classification_labels: z.optional(z.array(z.string())), + feature_names: z.array(z.string()), + target_type: z.optional(z.string()), + tree_structure: z.array(ml_put_trained_model_trained_model_tree_node) }); export const ml_put_trained_model_weights = z.object({ - weights: z.number(), + weights: z.number() }); export const ml_put_trained_model_aggregate_output = z.object({ - logistic_regression: z.optional(ml_put_trained_model_weights), - weighted_sum: z.optional(ml_put_trained_model_weights), - weighted_mode: z.optional(ml_put_trained_model_weights), - exponent: z.optional(ml_put_trained_model_weights), + logistic_regression: z.optional(ml_put_trained_model_weights), + weighted_sum: z.optional(ml_put_trained_model_weights), + weighted_mode: z.optional(ml_put_trained_model_weights), + exponent: z.optional(ml_put_trained_model_weights) }); export const ml_put_trained_model_input = z.object({ - field_names: types_names, + field_names: types_names }); export const ml_types_trained_model_assignment_routing_table = z.object({ - reason: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The reason for the current state. It is usually populated only when the\n`routing_state` is `failed`.', + reason: z.optional(z.string().register(z.globalRegistry, { + description: 'The reason for the current state. It is usually populated only when the\n`routing_state` is `failed`.' + })), + routing_state: ml_types_routing_state, + current_allocations: z.number().register(z.globalRegistry, { + description: 'Current number of allocations.' + }), + target_allocations: z.number().register(z.globalRegistry, { + description: 'Target number of allocations.' }) - ), - routing_state: ml_types_routing_state, - current_allocations: z.number().register(z.globalRegistry, { - description: 'Current number of allocations.', - }), - target_allocations: z.number().register(z.globalRegistry, { - description: 'Target number of allocations.', - }), }); export const ml_types_trained_model_assignment_task_parameters = z.object({ - model_bytes: types_byte_size, - model_id: types_id, - deployment_id: types_id, - cache_size: z.optional(types_byte_size), - number_of_allocations: z.number().register(z.globalRegistry, { - description: 'The total number of allocations this model is assigned across ML nodes.', - }), - priority: ml_types_training_priority, - per_deployment_memory_bytes: types_byte_size, - per_allocation_memory_bytes: types_byte_size, - queue_capacity: z.number().register(z.globalRegistry, { - description: 'Number of inference requests are allowed in the queue at a time.', - }), - threads_per_allocation: z.number().register(z.globalRegistry, { - description: 'Number of threads per allocation.', - }), + model_bytes: types_byte_size, + model_id: types_id, + deployment_id: types_id, + cache_size: z.optional(types_byte_size), + number_of_allocations: z.number().register(z.globalRegistry, { + description: 'The total number of allocations this model is assigned across ML nodes.' + }), + priority: ml_types_training_priority, + per_deployment_memory_bytes: types_byte_size, + per_allocation_memory_bytes: types_byte_size, + queue_capacity: z.number().register(z.globalRegistry, { + description: 'Number of inference requests are allowed in the queue at a time.' + }), + threads_per_allocation: z.number().register(z.globalRegistry, { + description: 'Number of threads per allocation.' + }) }); export const ml_types_trained_model_assignment = z.object({ - adaptive_allocations: z.optional( - z.union([ml_types_adaptive_allocations_settings, z.string(), z.null()]) - ), - assignment_state: ml_types_deployment_assignment_state, - max_assigned_allocations: z.optional(z.number()), - reason: z.optional(z.string()), - routing_table: z - .record(z.string(), ml_types_trained_model_assignment_routing_table) - .register(z.globalRegistry, { - description: 'The allocation state for each node.', + adaptive_allocations: z.optional(z.union([ + ml_types_adaptive_allocations_settings, + z.string(), + z.null() + ])), + assignment_state: ml_types_deployment_assignment_state, + max_assigned_allocations: z.optional(z.number()), + reason: z.optional(z.string()), + routing_table: z.record(z.string(), ml_types_trained_model_assignment_routing_table).register(z.globalRegistry, { + description: 'The allocation state for each node.' }), - start_time: types_date_time, - task_parameters: ml_types_trained_model_assignment_task_parameters, + start_time: types_date_time, + task_parameters: ml_types_trained_model_assignment_task_parameters }); export const ml_types_analysis_memory_limit = z.object({ - model_memory_limit: z.string().register(z.globalRegistry, { - description: - 'Limits can be applied for the resources required to hold the mathematical models in memory. These limits are approximate and can be set per job. They do not control the memory used by other processes, for example the Elasticsearch Java processes.', - }), + model_memory_limit: z.string().register(z.globalRegistry, { + description: 'Limits can be applied for the resources required to hold the mathematical models in memory. These limits are approximate and can be set per job. They do not control the memory used by other processes, for example the Elasticsearch Java processes.' + }) }); export const ml_types_detector_update = z.object({ - detector_index: z.number().register(z.globalRegistry, { - description: - 'A unique identifier for the detector.\nThis identifier is based on the order of the detectors in the `analysis_config`, starting at zero.', - }), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the detector.', - }) - ), - custom_rules: z.optional( - z.array(ml_types_detection_rule).register(z.globalRegistry, { - description: - 'An array of custom rule objects, which enable you to customize the way detectors operate.\nFor example, a rule may dictate to the detector conditions under which results should be skipped.\nKibana refers to custom rules as job rules.', - }) - ), + detector_index: z.number().register(z.globalRegistry, { + description: 'A unique identifier for the detector.\nThis identifier is based on the order of the detectors in the `analysis_config`, starting at zero.' + }), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the detector.' + })), + custom_rules: z.optional(z.array(ml_types_detection_rule).register(z.globalRegistry, { + description: 'An array of custom rule objects, which enable you to customize the way detectors operate.\nFor example, a rule may dictate to the detector conditions under which results should be skipped.\nKibana refers to custom rules as job rules.' + })) }); export const global_termvectors_filter = z.object({ - max_doc_freq: z.optional( - z.number().register(z.globalRegistry, { - description: 'Ignore words which occur in more than this many docs.\nDefaults to unbounded.', - }) - ), - max_num_terms: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of terms that must be returned per field.', - }) - ), - max_term_freq: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Ignore words with more than this frequency in the source doc.\nIt defaults to unbounded.', - }) - ), - max_word_length: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum word length above which words will be ignored.\nDefaults to unbounded.', - }) - ), - min_doc_freq: z.optional( - z.number().register(z.globalRegistry, { - description: 'Ignore terms which do not occur in at least this many docs.', - }) - ), - min_term_freq: z.optional( - z.number().register(z.globalRegistry, { - description: 'Ignore words with less than this frequency in the source doc.', - }) - ), - min_word_length: z.optional( - z.number().register(z.globalRegistry, { - description: 'The minimum word length below which words will be ignored.', - }) - ), + max_doc_freq: z.optional(z.number().register(z.globalRegistry, { + description: 'Ignore words which occur in more than this many docs.\nDefaults to unbounded.' + })), + max_num_terms: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of terms that must be returned per field.' + })), + max_term_freq: z.optional(z.number().register(z.globalRegistry, { + description: 'Ignore words with more than this frequency in the source doc.\nIt defaults to unbounded.' + })), + max_word_length: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum word length above which words will be ignored.\nDefaults to unbounded.' + })), + min_doc_freq: z.optional(z.number().register(z.globalRegistry, { + description: 'Ignore terms which do not occur in at least this many docs.' + })), + min_term_freq: z.optional(z.number().register(z.globalRegistry, { + description: 'Ignore words with less than this frequency in the source doc.' + })), + min_word_length: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum word length below which words will be ignored.' + })) }); - -export const global_mtermvectors_operation = z.object({ - _id: z.optional(types_id), - _index: z.optional(types_index_name), - doc: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'An artificial document (a document not present in the index) for which you want to retrieve term vectors.', - }) - ), - fields: z.optional(types_fields), - field_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies.', - }) - ), - filter: z.optional(global_termvectors_filter), - offsets: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term offsets.', - }) - ), - payloads: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term payloads.', - }) - ), - positions: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term positions.', - }) - ), - routing: z.optional(types_routing), - term_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the response includes term frequency and document frequency.', - }) - ), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), + +export const global_mtermvectors_operation = z.object({ + _id: z.optional(types_id), + _index: z.optional(types_index_name), + doc: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'An artificial document (a document not present in the index) for which you want to retrieve term vectors.' + })), + fields: z.optional(types_fields), + field_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies.' + })), + filter: z.optional(global_termvectors_filter), + offsets: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term offsets.' + })), + payloads: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term payloads.' + })), + positions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term positions.' + })), + routing: z.optional(types_routing), + term_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the response includes term frequency and document frequency.' + })), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type) }); export const global_termvectors_field_statistics = z.object({ - doc_count: z.number(), - sum_doc_freq: z.number(), - sum_ttf: z.number(), + doc_count: z.number(), + sum_doc_freq: z.number(), + sum_ttf: z.number() }); export const global_termvectors_token = z.object({ - end_offset: z.optional(z.number()), - payload: z.optional(z.string()), - position: z.number(), - start_offset: z.optional(z.number()), + end_offset: z.optional(z.number()), + payload: z.optional(z.string()), + position: z.number(), + start_offset: z.optional(z.number()) }); export const global_termvectors_term = z.object({ - doc_freq: z.optional(z.number()), - score: z.optional(z.number()), - term_freq: z.number(), - tokens: z.optional(z.array(global_termvectors_token)), - ttf: z.optional(z.number()), + doc_freq: z.optional(z.number()), + score: z.optional(z.number()), + term_freq: z.number(), + tokens: z.optional(z.array(global_termvectors_token)), + ttf: z.optional(z.number()) }); export const global_termvectors_term_vector = z.object({ - field_statistics: z.optional(global_termvectors_field_statistics), - terms: z.record(z.string(), global_termvectors_term), + field_statistics: z.optional(global_termvectors_field_statistics), + terms: z.record(z.string(), global_termvectors_term) }); export const global_mtermvectors_term_vectors_result = z.object({ - _id: z.optional(types_id), - _index: types_index_name, - _version: z.optional(types_version_number), - took: z.optional(z.number()), - found: z.optional(z.boolean()), - term_vectors: z.optional(z.record(z.string(), global_termvectors_term_vector)), - error: z.optional(types_error_cause), + _id: z.optional(types_id), + _index: types_index_name, + _version: z.optional(types_version_number), + took: z.optional(z.number()), + found: z.optional(z.boolean()), + term_vectors: z.optional(z.record(z.string(), global_termvectors_term_vector)), + error: z.optional(types_error_cause) }); export const nodes_types_repository_location = z.object({ - base_path: z.string(), - container: z.optional( - z.string().register(z.globalRegistry, { - description: 'Container name (Azure)', - }) - ), - bucket: z.optional( - z.string().register(z.globalRegistry, { - description: 'Bucket name (GCP, S3)', - }) - ), + base_path: z.string(), + container: z.optional(z.string().register(z.globalRegistry, { + description: 'Container name (Azure)' + })), + bucket: z.optional(z.string().register(z.globalRegistry, { + description: 'Bucket name (GCP, S3)' + })) }); export const nodes_types_request_counts = z.object({ - GetBlobProperties: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of Get Blob Properties requests (Azure)', - }) - ), - GetBlob: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of Get Blob requests (Azure)', - }) - ), - ListBlobs: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of List Blobs requests (Azure)', - }) - ), - PutBlob: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of Put Blob requests (Azure)', - }) - ), - PutBlock: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of Put Block (Azure)', - }) - ), - PutBlockList: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of Put Block List requests', - }) - ), - GetObject: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of get object requests (GCP, S3)', - }) - ), - ListObjects: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of list objects requests (GCP, S3)', - }) - ), - InsertObject: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Number of insert object requests, including simple, multipart and resumable uploads. Resumable uploads\ncan perform multiple http requests to insert a single object but they are considered as a single request\nsince they are billed as an individual operation. (GCP)', - }) - ), - PutObject: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of PutObject requests (S3)', - }) - ), - PutMultipartObject: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Number of Multipart requests, including CreateMultipartUpload, UploadPart and CompleteMultipartUpload requests (S3)', - }) - ), + GetBlobProperties: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of Get Blob Properties requests (Azure)' + })), + GetBlob: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of Get Blob requests (Azure)' + })), + ListBlobs: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of List Blobs requests (Azure)' + })), + PutBlob: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of Put Blob requests (Azure)' + })), + PutBlock: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of Put Block (Azure)' + })), + PutBlockList: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of Put Block List requests' + })), + GetObject: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of get object requests (GCP, S3)' + })), + ListObjects: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of list objects requests (GCP, S3)' + })), + InsertObject: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of insert object requests, including simple, multipart and resumable uploads. Resumable uploads\ncan perform multiple http requests to insert a single object but they are considered as a single request\nsince they are billed as an individual operation. (GCP)' + })), + PutObject: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of PutObject requests (S3)' + })), + PutMultipartObject: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of Multipart requests, including CreateMultipartUpload, UploadPart and CompleteMultipartUpload requests (S3)' + })) }); export const nodes_types_repository_metering_information = z.object({ - repository_name: types_name, - repository_type: z.string().register(z.globalRegistry, { - description: 'Repository type.', - }), - repository_location: nodes_types_repository_location, - repository_ephemeral_id: types_id, - repository_started_at: types_epoch_time_unit_millis, - repository_stopped_at: z.optional(types_epoch_time_unit_millis), - archived: z.boolean().register(z.globalRegistry, { - description: - 'A flag that tells whether or not this object has been archived. When a repository is closed or updated the\nrepository metering information is archived and kept for a certain period of time. This allows retrieving the\nrepository metering information of previous repository instantiations.', - }), - cluster_version: z.optional(types_version_number), - request_counts: nodes_types_request_counts, -}); - -export const nodes_clear_repositories_metering_archive_response_base = - nodes_types_nodes_response_base.and( - z.object({ - cluster_name: types_name, - nodes: z - .record(z.string(), nodes_types_repository_metering_information) - .register(z.globalRegistry, { - description: - 'Contains repositories metering information for the nodes selected by the request.', - }), + repository_name: types_name, + repository_type: z.string().register(z.globalRegistry, { + description: 'Repository type.' + }), + repository_location: nodes_types_repository_location, + repository_ephemeral_id: types_id, + repository_started_at: types_epoch_time_unit_millis, + repository_stopped_at: z.optional(types_epoch_time_unit_millis), + archived: z.boolean().register(z.globalRegistry, { + description: 'A flag that tells whether or not this object has been archived. When a repository is closed or updated the\nrepository metering information is archived and kept for a certain period of time. This allows retrieving the\nrepository metering information of previous repository instantiations.' + }), + cluster_version: z.optional(types_version_number), + request_counts: nodes_types_request_counts +}); + +export const nodes_clear_repositories_metering_archive_response_base = nodes_types_nodes_response_base.and(z.object({ + cluster_name: types_name, + nodes: z.record(z.string(), nodes_types_repository_metering_information).register(z.globalRegistry, { + description: 'Contains repositories metering information for the nodes selected by the request.' }) - ); +})); -export const nodes_get_repositories_metering_info_response_base = - nodes_types_nodes_response_base.and( - z.object({ - cluster_name: types_name, - nodes: z - .record(z.string(), nodes_types_repository_metering_information) - .register(z.globalRegistry, { - description: - 'Contains repositories metering information for the nodes selected by the request.', - }), +export const nodes_get_repositories_metering_info_response_base = nodes_types_nodes_response_base.and(z.object({ + cluster_name: types_name, + nodes: z.record(z.string(), nodes_types_repository_metering_information).register(z.globalRegistry, { + description: 'Contains repositories metering information for the nodes selected by the request.' }) - ); +})); -export const types_thread_type = z.enum(['cpu', 'wait', 'block', 'gpu', 'mem']); +export const types_thread_type = z.enum([ + 'cpu', + 'wait', + 'block', + 'gpu', + 'mem' +]); export const nodes_info_nodes_info_metric = z.enum([ - '_all', - '_none', - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'remote_cluster_server', - 'plugins', - 'ingest', - 'aggregations', - 'indices', + '_all', + '_none', + 'settings', + 'os', + 'process', + 'jvm', + 'thread_pool', + 'transport', + 'http', + 'remote_cluster_server', + 'plugins', + 'ingest', + 'aggregations', + 'indices' ]); export const nodes_info_nodes_info_metrics = z.union([ - nodes_info_nodes_info_metric, - z.array(nodes_info_nodes_info_metric), + nodes_info_nodes_info_metric, + z.array(nodes_info_nodes_info_metric) ]); export const nodes_info_node_info_http = z.object({ - bound_address: z.array(z.string()), - max_content_length: z.optional(types_byte_size), - max_content_length_in_bytes: z.number(), - publish_address: z.string(), + bound_address: z.array(z.string()), + max_content_length: z.optional(types_byte_size), + max_content_length_in_bytes: z.number(), + publish_address: z.string() }); export const nodes_info_node_info_jvm_memory = z.object({ - direct_max: z.optional(types_byte_size), - direct_max_in_bytes: z.number(), - heap_init: z.optional(types_byte_size), - heap_init_in_bytes: z.number(), - heap_max: z.optional(types_byte_size), - heap_max_in_bytes: z.number(), - non_heap_init: z.optional(types_byte_size), - non_heap_init_in_bytes: z.number(), - non_heap_max: z.optional(types_byte_size), - non_heap_max_in_bytes: z.number(), + direct_max: z.optional(types_byte_size), + direct_max_in_bytes: z.number(), + heap_init: z.optional(types_byte_size), + heap_init_in_bytes: z.number(), + heap_max: z.optional(types_byte_size), + heap_max_in_bytes: z.number(), + non_heap_init: z.optional(types_byte_size), + non_heap_init_in_bytes: z.number(), + non_heap_max: z.optional(types_byte_size), + non_heap_max_in_bytes: z.number() }); export const nodes_info_node_jvm_info = z.object({ - gc_collectors: z.array(z.string()), - mem: nodes_info_node_info_jvm_memory, - memory_pools: z.array(z.string()), - pid: z.number(), - start_time_in_millis: types_epoch_time_unit_millis, - version: types_version_string, - vm_name: types_name, - vm_vendor: z.string(), - vm_version: types_version_string, - using_bundled_jdk: z.boolean(), - using_compressed_ordinary_object_pointers: z.optional(z.union([z.boolean(), z.string()])), - input_arguments: z.array(z.string()), + gc_collectors: z.array(z.string()), + mem: nodes_info_node_info_jvm_memory, + memory_pools: z.array(z.string()), + pid: z.number(), + start_time_in_millis: types_epoch_time_unit_millis, + version: types_version_string, + vm_name: types_name, + vm_vendor: z.string(), + vm_version: types_version_string, + using_bundled_jdk: z.boolean(), + using_compressed_ordinary_object_pointers: z.optional(z.union([ + z.boolean(), + z.string() + ])), + input_arguments: z.array(z.string()) }); export const nodes_info_node_info_oscpu = z.object({ - cache_size: z.string(), - cache_size_in_bytes: z.number(), - cores_per_socket: z.number(), - mhz: z.number(), - model: z.string(), - total_cores: z.number(), - total_sockets: z.number(), - vendor: z.string(), + cache_size: z.string(), + cache_size_in_bytes: z.number(), + cores_per_socket: z.number(), + mhz: z.number(), + model: z.string(), + total_cores: z.number(), + total_sockets: z.number(), + vendor: z.string() }); export const nodes_info_node_info_memory = z.object({ - total: z.string(), - total_in_bytes: z.number(), + total: z.string(), + total_in_bytes: z.number() }); export const nodes_info_node_operating_system_info = z.object({ - arch: z.string().register(z.globalRegistry, { - description: 'Name of the JVM architecture (ex: amd64, x86)', - }), - available_processors: z.number().register(z.globalRegistry, { - description: 'Number of processors available to the Java virtual machine', - }), - allocated_processors: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of processors actually used to calculate thread pool size. This number can be set with the node.processors setting of a node and defaults to the number of processors reported by the OS.', - }) - ), - name: types_name, - pretty_name: types_name, - refresh_interval_in_millis: types_duration_value_unit_millis, - version: types_version_string, - cpu: z.optional(nodes_info_node_info_oscpu), - mem: z.optional(nodes_info_node_info_memory), - swap: z.optional(nodes_info_node_info_memory), + arch: z.string().register(z.globalRegistry, { + description: 'Name of the JVM architecture (ex: amd64, x86)' + }), + available_processors: z.number().register(z.globalRegistry, { + description: 'Number of processors available to the Java virtual machine' + }), + allocated_processors: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of processors actually used to calculate thread pool size. This number can be set with the node.processors setting of a node and defaults to the number of processors reported by the OS.' + })), + name: types_name, + pretty_name: types_name, + refresh_interval_in_millis: types_duration_value_unit_millis, + version: types_version_string, + cpu: z.optional(nodes_info_node_info_oscpu), + mem: z.optional(nodes_info_node_info_memory), + swap: z.optional(nodes_info_node_info_memory) }); export const nodes_info_node_process_info = z.object({ - id: z.number().register(z.globalRegistry, { - description: 'Process identifier (PID)', - }), - mlockall: z.boolean().register(z.globalRegistry, { - description: 'Indicates if the process address space has been successfully locked in memory', - }), - refresh_interval_in_millis: types_duration_value_unit_millis, + id: z.number().register(z.globalRegistry, { + description: 'Process identifier (PID)' + }), + mlockall: z.boolean().register(z.globalRegistry, { + description: 'Indicates if the process address space has been successfully locked in memory' + }), + refresh_interval_in_millis: types_duration_value_unit_millis }); export const nodes_info_node_info_settings_cluster_election = z.object({ - strategy: types_name, + strategy: types_name }); export const nodes_info_deprecation_indexing = z.object({ - enabled: z.union([z.boolean(), z.string()]), + enabled: z.union([ + z.boolean(), + z.string() + ]) }); export const nodes_info_node_info_settings_cluster = z.object({ - name: types_name, - routing: z.optional(indices_types_index_routing), - election: nodes_info_node_info_settings_cluster_election, - initial_master_nodes: z.optional(z.union([z.array(z.string()), z.string()])), - deprecation_indexing: z.optional(nodes_info_deprecation_indexing), + name: types_name, + routing: z.optional(indices_types_index_routing), + election: nodes_info_node_info_settings_cluster_election, + initial_master_nodes: z.optional(z.union([ + z.array(z.string()), + z.string() + ])), + deprecation_indexing: z.optional(nodes_info_deprecation_indexing) }); export const nodes_info_node_info_settings_node = z.object({ - name: types_name, - attr: z.record(z.string(), z.record(z.string(), z.unknown())), - max_local_storage_nodes: z.optional(z.string()), + name: types_name, + attr: z.record(z.string(), z.record(z.string(), z.unknown())), + max_local_storage_nodes: z.optional(z.string()) }); export const nodes_info_node_info_path = z.object({ - logs: z.optional(z.string()), - home: z.optional(z.string()), - repo: z.optional(z.array(z.string())), - data: z.optional(z.union([z.string(), z.array(z.string())])), + logs: z.optional(z.string()), + home: z.optional(z.string()), + repo: z.optional(z.array(z.string())), + data: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])) }); export const nodes_info_node_info_repositories_url = z.object({ - allowed_urls: z.string(), + allowed_urls: z.string() }); export const nodes_info_node_info_repositories = z.object({ - url: nodes_info_node_info_repositories_url, + url: nodes_info_node_info_repositories_url }); export const nodes_info_node_info_discover = z.object({ - seed_hosts: z.optional(z.union([z.array(z.string()), z.string()])), - type: z.optional(z.string()), - seed_providers: z.optional(z.array(z.string())), + seed_hosts: z.optional(z.union([ + z.array(z.string()), + z.string() + ])), + type: z.optional(z.string()), + seed_providers: z.optional(z.array(z.string())) }); export const nodes_info_node_info_action = z.object({ - destructive_requires_name: z.string(), + destructive_requires_name: z.string() }); export const nodes_info_node_info_client = z.object({ - type: z.string(), + type: z.string() }); export const nodes_info_node_info_settings_http_type = z.object({ - default: z.string(), + default: z.string() }); export const nodes_info_node_info_settings_http = z.object({ - type: nodes_info_node_info_settings_http_type, - 'type.default': z.optional(z.string()), - compression: z.optional(z.union([z.boolean(), z.string()])), - port: z.optional(z.union([z.number(), z.string()])), + type: nodes_info_node_info_settings_http_type, + 'type.default': z.optional(z.string()), + compression: z.optional(z.union([ + z.boolean(), + z.string() + ])), + port: z.optional(z.union([ + z.number(), + z.string() + ])) }); export const nodes_info_node_info_bootstrap = z.object({ - memory_lock: z.string(), + memory_lock: z.string() }); export const nodes_info_node_info_settings_transport_type = z.object({ - default: z.string(), + default: z.string() }); export const nodes_info_node_info_settings_transport_features = z.object({ - 'x-pack': z.string(), + 'x-pack': z.string() }); export const nodes_info_node_info_settings_transport = z.object({ - type: nodes_info_node_info_settings_transport_type, - 'type.default': z.optional(z.string()), - features: z.optional(nodes_info_node_info_settings_transport_features), + type: nodes_info_node_info_settings_transport_type, + 'type.default': z.optional(z.string()), + features: z.optional(nodes_info_node_info_settings_transport_features) }); export const nodes_info_node_info_settings_network = z.object({ - host: z.optional(z.union([types_host, z.array(types_host)])), + host: z.optional(z.union([ + types_host, + z.array(types_host) + ])) }); export const nodes_info_node_info_xpack_license_type = z.object({ - type: z.string(), + type: z.string() }); export const nodes_info_node_info_xpack_license = z.object({ - self_generated: nodes_info_node_info_xpack_license_type, + self_generated: nodes_info_node_info_xpack_license_type }); export const nodes_info_node_info_xpack_security_ssl = z.object({ - ssl: z.record(z.string(), z.string()), + ssl: z.record(z.string(), z.string()) }); export const nodes_info_node_info_xpack_security_authc_realms_status = z.object({ - enabled: z.optional(z.string()), - order: z.string(), + enabled: z.optional(z.string()), + order: z.string() }); export const nodes_info_node_info_xpack_security_authc_realms = z.object({ - file: z.optional(z.record(z.string(), nodes_info_node_info_xpack_security_authc_realms_status)), - native: z.optional(z.record(z.string(), nodes_info_node_info_xpack_security_authc_realms_status)), - pki: z.optional(z.record(z.string(), nodes_info_node_info_xpack_security_authc_realms_status)), + file: z.optional(z.record(z.string(), nodes_info_node_info_xpack_security_authc_realms_status)), + native: z.optional(z.record(z.string(), nodes_info_node_info_xpack_security_authc_realms_status)), + pki: z.optional(z.record(z.string(), nodes_info_node_info_xpack_security_authc_realms_status)) }); export const nodes_info_node_info_xpack_security_authc_token = z.object({ - enabled: z.string(), + enabled: z.string() }); export const nodes_info_node_info_xpack_security_authc = z.object({ - realms: z.optional(nodes_info_node_info_xpack_security_authc_realms), - token: z.optional(nodes_info_node_info_xpack_security_authc_token), + realms: z.optional(nodes_info_node_info_xpack_security_authc_realms), + token: z.optional(nodes_info_node_info_xpack_security_authc_token) }); export const nodes_info_node_info_xpack_security = z.object({ - http: z.optional(nodes_info_node_info_xpack_security_ssl), - enabled: z.string(), - transport: z.optional(nodes_info_node_info_xpack_security_ssl), - authc: z.optional(nodes_info_node_info_xpack_security_authc), + http: z.optional(nodes_info_node_info_xpack_security_ssl), + enabled: z.string(), + transport: z.optional(nodes_info_node_info_xpack_security_ssl), + authc: z.optional(nodes_info_node_info_xpack_security_authc) }); export const nodes_info_node_info_xpack_ml = z.object({ - use_auto_machine_memory_percent: z.optional(z.boolean()), + use_auto_machine_memory_percent: z.optional(z.boolean()) }); export const nodes_info_node_info_xpack = z.object({ - license: z.optional(nodes_info_node_info_xpack_license), - security: nodes_info_node_info_xpack_security, - notification: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - ml: z.optional(nodes_info_node_info_xpack_ml), + license: z.optional(nodes_info_node_info_xpack_license), + security: nodes_info_node_info_xpack_security, + notification: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + ml: z.optional(nodes_info_node_info_xpack_ml) }); export const nodes_info_node_info_script = z.object({ - allowed_types: z.string(), - disable_max_compilations_rate: z.optional(z.string()), + allowed_types: z.string(), + disable_max_compilations_rate: z.optional(z.string()) }); export const nodes_info_node_info_search_remote = z.object({ - connect: z.string(), + connect: z.string() }); export const nodes_info_node_info_search = z.object({ - remote: nodes_info_node_info_search_remote, + remote: nodes_info_node_info_search_remote }); export const nodes_info_node_info_ingest_downloader = z.object({ - enabled: z.string(), + enabled: z.string() }); export const nodes_info_node_info_ingest_info = z.object({ - downloader: nodes_info_node_info_ingest_downloader, + downloader: nodes_info_node_info_ingest_downloader }); export const nodes_info_node_info_settings_ingest = z.object({ - attachment: z.optional(nodes_info_node_info_ingest_info), - append: z.optional(nodes_info_node_info_ingest_info), - csv: z.optional(nodes_info_node_info_ingest_info), - convert: z.optional(nodes_info_node_info_ingest_info), - date: z.optional(nodes_info_node_info_ingest_info), - date_index_name: z.optional(nodes_info_node_info_ingest_info), - dot_expander: z.optional(nodes_info_node_info_ingest_info), - enrich: z.optional(nodes_info_node_info_ingest_info), - fail: z.optional(nodes_info_node_info_ingest_info), - foreach: z.optional(nodes_info_node_info_ingest_info), - json: z.optional(nodes_info_node_info_ingest_info), - user_agent: z.optional(nodes_info_node_info_ingest_info), - kv: z.optional(nodes_info_node_info_ingest_info), - geoip: z.optional(nodes_info_node_info_ingest_info), - grok: z.optional(nodes_info_node_info_ingest_info), - gsub: z.optional(nodes_info_node_info_ingest_info), - join: z.optional(nodes_info_node_info_ingest_info), - lowercase: z.optional(nodes_info_node_info_ingest_info), - remove: z.optional(nodes_info_node_info_ingest_info), - rename: z.optional(nodes_info_node_info_ingest_info), - script: z.optional(nodes_info_node_info_ingest_info), - set: z.optional(nodes_info_node_info_ingest_info), - sort: z.optional(nodes_info_node_info_ingest_info), - split: z.optional(nodes_info_node_info_ingest_info), - trim: z.optional(nodes_info_node_info_ingest_info), - uppercase: z.optional(nodes_info_node_info_ingest_info), - urldecode: z.optional(nodes_info_node_info_ingest_info), - bytes: z.optional(nodes_info_node_info_ingest_info), - dissect: z.optional(nodes_info_node_info_ingest_info), - set_security_user: z.optional(nodes_info_node_info_ingest_info), - pipeline: z.optional(nodes_info_node_info_ingest_info), - drop: z.optional(nodes_info_node_info_ingest_info), - circle: z.optional(nodes_info_node_info_ingest_info), - inference: z.optional(nodes_info_node_info_ingest_info), + attachment: z.optional(nodes_info_node_info_ingest_info), + append: z.optional(nodes_info_node_info_ingest_info), + csv: z.optional(nodes_info_node_info_ingest_info), + convert: z.optional(nodes_info_node_info_ingest_info), + date: z.optional(nodes_info_node_info_ingest_info), + date_index_name: z.optional(nodes_info_node_info_ingest_info), + dot_expander: z.optional(nodes_info_node_info_ingest_info), + enrich: z.optional(nodes_info_node_info_ingest_info), + fail: z.optional(nodes_info_node_info_ingest_info), + foreach: z.optional(nodes_info_node_info_ingest_info), + json: z.optional(nodes_info_node_info_ingest_info), + user_agent: z.optional(nodes_info_node_info_ingest_info), + kv: z.optional(nodes_info_node_info_ingest_info), + geoip: z.optional(nodes_info_node_info_ingest_info), + grok: z.optional(nodes_info_node_info_ingest_info), + gsub: z.optional(nodes_info_node_info_ingest_info), + join: z.optional(nodes_info_node_info_ingest_info), + lowercase: z.optional(nodes_info_node_info_ingest_info), + remove: z.optional(nodes_info_node_info_ingest_info), + rename: z.optional(nodes_info_node_info_ingest_info), + script: z.optional(nodes_info_node_info_ingest_info), + set: z.optional(nodes_info_node_info_ingest_info), + sort: z.optional(nodes_info_node_info_ingest_info), + split: z.optional(nodes_info_node_info_ingest_info), + trim: z.optional(nodes_info_node_info_ingest_info), + uppercase: z.optional(nodes_info_node_info_ingest_info), + urldecode: z.optional(nodes_info_node_info_ingest_info), + bytes: z.optional(nodes_info_node_info_ingest_info), + dissect: z.optional(nodes_info_node_info_ingest_info), + set_security_user: z.optional(nodes_info_node_info_ingest_info), + pipeline: z.optional(nodes_info_node_info_ingest_info), + drop: z.optional(nodes_info_node_info_ingest_info), + circle: z.optional(nodes_info_node_info_ingest_info), + inference: z.optional(nodes_info_node_info_ingest_info) }); export const nodes_info_node_info_settings = z.object({ - cluster: nodes_info_node_info_settings_cluster, - node: nodes_info_node_info_settings_node, - path: z.optional(nodes_info_node_info_path), - repositories: z.optional(nodes_info_node_info_repositories), - discovery: z.optional(nodes_info_node_info_discover), - action: z.optional(nodes_info_node_info_action), - client: z.optional(nodes_info_node_info_client), - http: nodes_info_node_info_settings_http, - bootstrap: z.optional(nodes_info_node_info_bootstrap), - transport: nodes_info_node_info_settings_transport, - network: z.optional(nodes_info_node_info_settings_network), - xpack: z.optional(nodes_info_node_info_xpack), - script: z.optional(nodes_info_node_info_script), - search: z.optional(nodes_info_node_info_search), - ingest: z.optional(nodes_info_node_info_settings_ingest), + cluster: nodes_info_node_info_settings_cluster, + node: nodes_info_node_info_settings_node, + path: z.optional(nodes_info_node_info_path), + repositories: z.optional(nodes_info_node_info_repositories), + discovery: z.optional(nodes_info_node_info_discover), + action: z.optional(nodes_info_node_info_action), + client: z.optional(nodes_info_node_info_client), + http: nodes_info_node_info_settings_http, + bootstrap: z.optional(nodes_info_node_info_bootstrap), + transport: nodes_info_node_info_settings_transport, + network: z.optional(nodes_info_node_info_settings_network), + xpack: z.optional(nodes_info_node_info_xpack), + script: z.optional(nodes_info_node_info_script), + search: z.optional(nodes_info_node_info_search), + ingest: z.optional(nodes_info_node_info_settings_ingest) }); export const nodes_info_node_thread_pool_info = z.object({ - core: z.optional(z.number()), - keep_alive: z.optional(types_duration), - max: z.optional(z.number()), - queue_size: z.number(), - size: z.optional(z.number()), - type: z.string(), + core: z.optional(z.number()), + keep_alive: z.optional(types_duration), + max: z.optional(z.number()), + queue_size: z.number(), + size: z.optional(z.number()), + type: z.string() }); export const nodes_info_node_info_transport = z.object({ - bound_address: z.array(z.string()), - publish_address: z.string(), - profiles: z.record(z.string(), z.string()), + bound_address: z.array(z.string()), + publish_address: z.string(), + profiles: z.record(z.string(), z.string()) }); export const nodes_info_node_info_ingest_processor = z.object({ - type: z.string(), + type: z.string() }); export const nodes_info_node_info_ingest = z.object({ - processors: z.array(nodes_info_node_info_ingest_processor), + processors: z.array(nodes_info_node_info_ingest_processor) }); export const nodes_info_node_info_aggregation = z.object({ - types: z.array(z.string()), + types: z.array(z.string()) }); export const nodes_info_remove_cluster_server = z.object({ - bound_address: z.array(types_transport_address), - publish_address: types_transport_address, + bound_address: z.array(types_transport_address), + publish_address: types_transport_address }); export const nodes_info_node_info = z.object({ - attributes: z.record(z.string(), z.string()), - build_flavor: z.string(), - build_hash: z.string().register(z.globalRegistry, { - description: 'Short hash of the last git commit in this release.', - }), - build_type: z.string(), - component_versions: z.record(z.string(), z.number()), - host: types_host, - http: z.optional(nodes_info_node_info_http), - index_version: types_version_number, - ip: types_ip, - jvm: z.optional(nodes_info_node_jvm_info), - name: types_name, - os: z.optional(nodes_info_node_operating_system_info), - plugins: z.optional(z.array(types_plugin_stats)), - process: z.optional(nodes_info_node_process_info), - roles: types_node_roles, - settings: z.optional(nodes_info_node_info_settings), - thread_pool: z.optional(z.record(z.string(), nodes_info_node_thread_pool_info)), - total_indexing_buffer: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Total heap allowed to be used to hold recently indexed documents before they must be written to disk. This size is a shared pool across all shards on this node, and is controlled by Indexing Buffer settings.', - }) - ), - total_indexing_buffer_in_bytes: z.optional(types_byte_size), - transport: z.optional(nodes_info_node_info_transport), - transport_address: types_transport_address, - transport_version: types_version_number, - version: types_version_string, - modules: z.optional(z.array(types_plugin_stats)), - ingest: z.optional(nodes_info_node_info_ingest), - aggregations: z.optional(z.record(z.string(), nodes_info_node_info_aggregation)), - remote_cluster_server: z.optional(nodes_info_remove_cluster_server), -}); - -export const nodes_info_response_base = nodes_types_nodes_response_base.and( - z.object({ + attributes: z.record(z.string(), z.string()), + build_flavor: z.string(), + build_hash: z.string().register(z.globalRegistry, { + description: 'Short hash of the last git commit in this release.' + }), + build_type: z.string(), + component_versions: z.record(z.string(), z.number()), + host: types_host, + http: z.optional(nodes_info_node_info_http), + index_version: types_version_number, + ip: types_ip, + jvm: z.optional(nodes_info_node_jvm_info), + name: types_name, + os: z.optional(nodes_info_node_operating_system_info), + plugins: z.optional(z.array(types_plugin_stats)), + process: z.optional(nodes_info_node_process_info), + roles: types_node_roles, + settings: z.optional(nodes_info_node_info_settings), + thread_pool: z.optional(z.record(z.string(), nodes_info_node_thread_pool_info)), + total_indexing_buffer: z.optional(z.number().register(z.globalRegistry, { + description: 'Total heap allowed to be used to hold recently indexed documents before they must be written to disk. This size is a shared pool across all shards on this node, and is controlled by Indexing Buffer settings.' + })), + total_indexing_buffer_in_bytes: z.optional(types_byte_size), + transport: z.optional(nodes_info_node_info_transport), + transport_address: types_transport_address, + transport_version: types_version_number, + version: types_version_string, + modules: z.optional(z.array(types_plugin_stats)), + ingest: z.optional(nodes_info_node_info_ingest), + aggregations: z.optional(z.record(z.string(), nodes_info_node_info_aggregation)), + remote_cluster_server: z.optional(nodes_info_remove_cluster_server) +}); + +export const nodes_info_response_base = nodes_types_nodes_response_base.and(z.object({ cluster_name: types_name, - nodes: z.record(z.string(), nodes_info_node_info), - }) -); + nodes: z.record(z.string(), nodes_info_node_info) +})); export const types_password = z.string(); export const nodes_types_node_reload_result = z.object({ - name: types_name, - reload_exception: z.optional(types_error_cause), + name: types_name, + reload_exception: z.optional(types_error_cause) }); -export const nodes_reload_secure_settings_response_base = nodes_types_nodes_response_base.and( - z.object({ +export const nodes_reload_secure_settings_response_base = nodes_types_nodes_response_base.and(z.object({ cluster_name: types_name, - nodes: z.record(z.string(), nodes_types_node_reload_result), - }) -); + nodes: z.record(z.string(), nodes_types_node_reload_result) +})); export const nodes_stats_node_stats_metric = z.enum([ - '_all', - '_none', - 'indices', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'fs', - 'transport', - 'http', - 'breaker', - 'script', - 'discovery', - 'ingest', - 'adaptive_selection', - 'script_cache', - 'indexing_pressure', - 'repositories', - 'allocations', + '_all', + '_none', + 'indices', + 'os', + 'process', + 'jvm', + 'thread_pool', + 'fs', + 'transport', + 'http', + 'breaker', + 'script', + 'discovery', + 'ingest', + 'adaptive_selection', + 'script_cache', + 'indexing_pressure', + 'repositories', + 'allocations' ]); export const nodes_stats_node_stats_metrics = z.union([ - nodes_stats_node_stats_metric, - z.array(nodes_stats_node_stats_metric), + nodes_stats_node_stats_metric, + z.array(nodes_stats_node_stats_metric) ]); -export const types_node_stats_level = z.enum(['node', 'indices', 'shards']); +export const types_node_stats_level = z.enum([ + 'node', + 'indices', + 'shards' +]); export const nodes_types_adaptive_selection = z.object({ - avg_queue_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The exponentially weighted moving average queue size of search requests on the keyed node.', - }) - ), - avg_response_time: z.optional(types_duration), - avg_response_time_ns: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The exponentially weighted moving average response time, in nanoseconds, of search requests on the keyed node.', - }) - ), - avg_service_time: z.optional(types_duration), - avg_service_time_ns: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The exponentially weighted moving average service time, in nanoseconds, of search requests on the keyed node.', - }) - ), - outgoing_searches: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of outstanding search requests to the keyed node from the node these stats are for.', - }) - ), - rank: z.optional( - z.string().register(z.globalRegistry, { - description: 'The rank of this node; used for shard selection when routing search requests.', - }) - ), + avg_queue_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The exponentially weighted moving average queue size of search requests on the keyed node.' + })), + avg_response_time: z.optional(types_duration), + avg_response_time_ns: z.optional(z.number().register(z.globalRegistry, { + description: 'The exponentially weighted moving average response time, in nanoseconds, of search requests on the keyed node.' + })), + avg_service_time: z.optional(types_duration), + avg_service_time_ns: z.optional(z.number().register(z.globalRegistry, { + description: 'The exponentially weighted moving average service time, in nanoseconds, of search requests on the keyed node.' + })), + outgoing_searches: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of outstanding search requests to the keyed node from the node these stats are for.' + })), + rank: z.optional(z.string().register(z.globalRegistry, { + description: 'The rank of this node; used for shard selection when routing search requests.' + })) }); export const nodes_types_breaker = z.object({ - estimated_size: z.optional( - z.string().register(z.globalRegistry, { - description: 'Estimated memory used for the operation.', - }) - ), - estimated_size_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Estimated memory used, in bytes, for the operation.', - }) - ), - limit_size: z.optional( - z.string().register(z.globalRegistry, { - description: 'Memory limit for the circuit breaker.', - }) - ), - limit_size_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Memory limit, in bytes, for the circuit breaker.', - }) - ), - overhead: z.optional( - z.number().register(z.globalRegistry, { - description: - 'A constant that all estimates for the circuit breaker are multiplied with to calculate a final estimate.', - }) - ), - tripped: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Total number of times the circuit breaker has been triggered and prevented an out of memory error.', - }) - ), + estimated_size: z.optional(z.string().register(z.globalRegistry, { + description: 'Estimated memory used for the operation.' + })), + estimated_size_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Estimated memory used, in bytes, for the operation.' + })), + limit_size: z.optional(z.string().register(z.globalRegistry, { + description: 'Memory limit for the circuit breaker.' + })), + limit_size_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Memory limit, in bytes, for the circuit breaker.' + })), + overhead: z.optional(z.number().register(z.globalRegistry, { + description: 'A constant that all estimates for the circuit breaker are multiplied with to calculate a final estimate.' + })), + tripped: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of times the circuit breaker has been triggered and prevented an out of memory error.' + })) }); export const nodes_types_data_path_stats = z.object({ - available: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Total amount of disk space available to this Java virtual machine on this file store.', - }) - ), - available_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Total number of bytes available to this Java virtual machine on this file store.', - }) - ), - disk_queue: z.optional(z.string()), - disk_reads: z.optional(z.number()), - disk_read_size: z.optional(z.string()), - disk_read_size_in_bytes: z.optional(z.number()), - disk_writes: z.optional(z.number()), - disk_write_size: z.optional(z.string()), - disk_write_size_in_bytes: z.optional(z.number()), - free: z.optional( - z.string().register(z.globalRegistry, { - description: 'Total amount of unallocated disk space in the file store.', - }) - ), - free_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total number of unallocated bytes in the file store.', - }) - ), - mount: z.optional( - z.string().register(z.globalRegistry, { - description: 'Mount point of the file store (for example: `/dev/sda2`).', - }) - ), - path: z.optional( - z.string().register(z.globalRegistry, { - description: 'Path to the file store.', - }) - ), - total: z.optional( - z.string().register(z.globalRegistry, { - description: 'Total size of the file store.', - }) - ), - total_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total size of the file store in bytes.', - }) - ), - type: z.optional( - z.string().register(z.globalRegistry, { - description: 'Type of the file store (ex: ext4).', - }) - ), + available: z.optional(z.string().register(z.globalRegistry, { + description: 'Total amount of disk space available to this Java virtual machine on this file store.' + })), + available_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of bytes available to this Java virtual machine on this file store.' + })), + disk_queue: z.optional(z.string()), + disk_reads: z.optional(z.number()), + disk_read_size: z.optional(z.string()), + disk_read_size_in_bytes: z.optional(z.number()), + disk_writes: z.optional(z.number()), + disk_write_size: z.optional(z.string()), + disk_write_size_in_bytes: z.optional(z.number()), + free: z.optional(z.string().register(z.globalRegistry, { + description: 'Total amount of unallocated disk space in the file store.' + })), + free_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of unallocated bytes in the file store.' + })), + mount: z.optional(z.string().register(z.globalRegistry, { + description: 'Mount point of the file store (for example: `/dev/sda2`).' + })), + path: z.optional(z.string().register(z.globalRegistry, { + description: 'Path to the file store.' + })), + total: z.optional(z.string().register(z.globalRegistry, { + description: 'Total size of the file store.' + })), + total_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Total size of the file store in bytes.' + })), + type: z.optional(z.string().register(z.globalRegistry, { + description: 'Type of the file store (ex: ext4).' + })) }); export const nodes_types_file_system_total = z.object({ - available: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Total disk space available to this Java virtual machine on all file stores.\nDepending on OS or process level restrictions, this might appear less than `free`.\nThis is the actual amount of free disk space the Elasticsearch node can utilise.', - }) - ), - available_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Total number of bytes available to this Java virtual machine on all file stores.\nDepending on OS or process level restrictions, this might appear less than `free_in_bytes`.\nThis is the actual amount of free disk space the Elasticsearch node can utilise.', - }) - ), - free: z.optional( - z.string().register(z.globalRegistry, { - description: 'Total unallocated disk space in all file stores.', - }) - ), - free_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total number of unallocated bytes in all file stores.', - }) - ), - total: z.optional( - z.string().register(z.globalRegistry, { - description: 'Total size of all file stores.', - }) - ), - total_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total size of all file stores in bytes.', - }) - ), + available: z.optional(z.string().register(z.globalRegistry, { + description: 'Total disk space available to this Java virtual machine on all file stores.\nDepending on OS or process level restrictions, this might appear less than `free`.\nThis is the actual amount of free disk space the Elasticsearch node can utilise.' + })), + available_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of bytes available to this Java virtual machine on all file stores.\nDepending on OS or process level restrictions, this might appear less than `free_in_bytes`.\nThis is the actual amount of free disk space the Elasticsearch node can utilise.' + })), + free: z.optional(z.string().register(z.globalRegistry, { + description: 'Total unallocated disk space in all file stores.' + })), + free_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of unallocated bytes in all file stores.' + })), + total: z.optional(z.string().register(z.globalRegistry, { + description: 'Total size of all file stores.' + })), + total_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Total size of all file stores in bytes.' + })) }); export const nodes_types_io_stat_device = z.object({ - device_name: z.optional( - z.string().register(z.globalRegistry, { - description: 'The Linux device name.', - }) - ), - operations: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The total number of read and write operations for the device completed since starting Elasticsearch.', - }) - ), - read_kilobytes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The total number of kilobytes read for the device since starting Elasticsearch.', - }) - ), - read_operations: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The total number of read operations for the device completed since starting Elasticsearch.', - }) - ), - write_kilobytes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The total number of kilobytes written for the device since starting Elasticsearch.', - }) - ), - write_operations: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The total number of write operations for the device completed since starting Elasticsearch.', - }) - ), + device_name: z.optional(z.string().register(z.globalRegistry, { + description: 'The Linux device name.' + })), + operations: z.optional(z.number().register(z.globalRegistry, { + description: 'The total number of read and write operations for the device completed since starting Elasticsearch.' + })), + read_kilobytes: z.optional(z.number().register(z.globalRegistry, { + description: 'The total number of kilobytes read for the device since starting Elasticsearch.' + })), + read_operations: z.optional(z.number().register(z.globalRegistry, { + description: 'The total number of read operations for the device completed since starting Elasticsearch.' + })), + write_kilobytes: z.optional(z.number().register(z.globalRegistry, { + description: 'The total number of kilobytes written for the device since starting Elasticsearch.' + })), + write_operations: z.optional(z.number().register(z.globalRegistry, { + description: 'The total number of write operations for the device completed since starting Elasticsearch.' + })) }); export const nodes_types_io_stats = z.object({ - devices: z.optional( - z.array(nodes_types_io_stat_device).register(z.globalRegistry, { - description: - 'Array of disk metrics for each device that is backing an Elasticsearch data path.\nThese disk metrics are probed periodically and averages between the last probe and the current probe are computed.', - }) - ), - total: z.optional(nodes_types_io_stat_device), + devices: z.optional(z.array(nodes_types_io_stat_device).register(z.globalRegistry, { + description: 'Array of disk metrics for each device that is backing an Elasticsearch data path.\nThese disk metrics are probed periodically and averages between the last probe and the current probe are computed.' + })), + total: z.optional(nodes_types_io_stat_device) }); export const nodes_types_file_system = z.object({ - data: z.optional( - z.array(nodes_types_data_path_stats).register(z.globalRegistry, { - description: 'List of all file stores.', - }) - ), - timestamp: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Last time the file stores statistics were refreshed.\nRecorded in milliseconds since the Unix Epoch.', - }) - ), - total: z.optional(nodes_types_file_system_total), - io_stats: z.optional(nodes_types_io_stats), + data: z.optional(z.array(nodes_types_data_path_stats).register(z.globalRegistry, { + description: 'List of all file stores.' + })), + timestamp: z.optional(z.number().register(z.globalRegistry, { + description: 'Last time the file stores statistics were refreshed.\nRecorded in milliseconds since the Unix Epoch.' + })), + total: z.optional(nodes_types_file_system_total), + io_stats: z.optional(nodes_types_io_stats) }); export const nodes_types_node_buffer_pool = z.object({ - count: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of buffer pools.', - }) - ), - total_capacity: z.optional( - z.string().register(z.globalRegistry, { - description: 'Total capacity of buffer pools.', - }) - ), - total_capacity_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total capacity of buffer pools in bytes.', - }) - ), - used: z.optional( - z.string().register(z.globalRegistry, { - description: 'Size of buffer pools.', - }) - ), - used_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Size of buffer pools in bytes.', - }) - ), + count: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of buffer pools.' + })), + total_capacity: z.optional(z.string().register(z.globalRegistry, { + description: 'Total capacity of buffer pools.' + })), + total_capacity_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Total capacity of buffer pools in bytes.' + })), + used: z.optional(z.string().register(z.globalRegistry, { + description: 'Size of buffer pools.' + })), + used_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Size of buffer pools in bytes.' + })) }); export const nodes_types_jvm_classes = z.object({ - current_loaded_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of classes currently loaded by JVM.', - }) - ), - total_loaded_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total number of classes loaded since the JVM started.', - }) - ), - total_unloaded_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total number of classes unloaded since the JVM started.', - }) - ), + current_loaded_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of classes currently loaded by JVM.' + })), + total_loaded_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of classes loaded since the JVM started.' + })), + total_unloaded_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of classes unloaded since the JVM started.' + })) }); export const nodes_types_garbage_collector_total = z.object({ - collection_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total number of JVM garbage collectors that collect objects.', - }) - ), - collection_time: z.optional( - z.string().register(z.globalRegistry, { - description: 'Total time spent by JVM collecting objects.', - }) - ), - collection_time_in_millis: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total time, in milliseconds, spent by JVM collecting objects.', - }) - ), + collection_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of JVM garbage collectors that collect objects.' + })), + collection_time: z.optional(z.string().register(z.globalRegistry, { + description: 'Total time spent by JVM collecting objects.' + })), + collection_time_in_millis: z.optional(z.number().register(z.globalRegistry, { + description: 'Total time, in milliseconds, spent by JVM collecting objects.' + })) }); export const nodes_types_garbage_collector = z.object({ - collectors: z.optional( - z.record(z.string(), nodes_types_garbage_collector_total).register(z.globalRegistry, { - description: 'Contains statistics about JVM garbage collectors for the node.', - }) - ), + collectors: z.optional(z.record(z.string(), nodes_types_garbage_collector_total).register(z.globalRegistry, { + description: 'Contains statistics about JVM garbage collectors for the node.' + })) }); export const nodes_types_pool = z.object({ - used_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Memory, in bytes, used by the heap.', - }) - ), - max_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum amount of memory, in bytes, available for use by the heap.', - }) - ), - peak_used_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Largest amount of memory, in bytes, historically used by the heap.', - }) - ), - peak_max_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Largest amount of memory, in bytes, historically used by the heap.', - }) - ), + used_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Memory, in bytes, used by the heap.' + })), + max_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum amount of memory, in bytes, available for use by the heap.' + })), + peak_used_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Largest amount of memory, in bytes, historically used by the heap.' + })), + peak_max_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Largest amount of memory, in bytes, historically used by the heap.' + })) }); export const nodes_types_jvm_memory_stats = z.object({ - heap_used_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Memory, in bytes, currently in use by the heap.', - }) - ), - heap_used_percent: z.optional( - z.number().register(z.globalRegistry, { - description: 'Percentage of memory currently in use by the heap.', - }) - ), - heap_committed_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Amount of memory, in bytes, available for use by the heap.', - }) - ), - heap_max_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum amount of memory, in bytes, available for use by the heap.', - }) - ), - heap_max: z.optional(types_byte_size), - non_heap_used_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Non-heap memory used, in bytes.', - }) - ), - non_heap_committed_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Amount of non-heap memory available, in bytes.', - }) - ), - pools: z.optional( - z.record(z.string(), nodes_types_pool).register(z.globalRegistry, { - description: 'Contains statistics about heap memory usage for the node.', - }) - ), + heap_used_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Memory, in bytes, currently in use by the heap.' + })), + heap_used_percent: z.optional(z.number().register(z.globalRegistry, { + description: 'Percentage of memory currently in use by the heap.' + })), + heap_committed_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Amount of memory, in bytes, available for use by the heap.' + })), + heap_max_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum amount of memory, in bytes, available for use by the heap.' + })), + heap_max: z.optional(types_byte_size), + non_heap_used_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Non-heap memory used, in bytes.' + })), + non_heap_committed_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Amount of non-heap memory available, in bytes.' + })), + pools: z.optional(z.record(z.string(), nodes_types_pool).register(z.globalRegistry, { + description: 'Contains statistics about heap memory usage for the node.' + })) }); export const nodes_types_jvm_threads = z.object({ - count: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of active threads in use by JVM.', - }) - ), - peak_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'Highest number of threads used by JVM.', - }) - ), + count: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of active threads in use by JVM.' + })), + peak_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Highest number of threads used by JVM.' + })) }); export const nodes_types_jvm = z.object({ - buffer_pools: z.optional( - z.record(z.string(), nodes_types_node_buffer_pool).register(z.globalRegistry, { - description: 'Contains statistics about JVM buffer pools for the node.', - }) - ), - classes: z.optional(nodes_types_jvm_classes), - gc: z.optional(nodes_types_garbage_collector), - mem: z.optional(nodes_types_jvm_memory_stats), - threads: z.optional(nodes_types_jvm_threads), - timestamp: z.optional( - z.number().register(z.globalRegistry, { - description: 'Last time JVM statistics were refreshed.', - }) - ), - uptime: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Human-readable JVM uptime.\nOnly returned if the `human` query parameter is `true`.', - }) - ), - uptime_in_millis: z.optional( - z.number().register(z.globalRegistry, { - description: 'JVM uptime in milliseconds.', - }) - ), + buffer_pools: z.optional(z.record(z.string(), nodes_types_node_buffer_pool).register(z.globalRegistry, { + description: 'Contains statistics about JVM buffer pools for the node.' + })), + classes: z.optional(nodes_types_jvm_classes), + gc: z.optional(nodes_types_garbage_collector), + mem: z.optional(nodes_types_jvm_memory_stats), + threads: z.optional(nodes_types_jvm_threads), + timestamp: z.optional(z.number().register(z.globalRegistry, { + description: 'Last time JVM statistics were refreshed.' + })), + uptime: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable JVM uptime.\nOnly returned if the `human` query parameter is `true`.' + })), + uptime_in_millis: z.optional(z.number().register(z.globalRegistry, { + description: 'JVM uptime in milliseconds.' + })) }); export const nodes_types_cpu = z.object({ - percent: z.optional(z.number()), - sys: z.optional(types_duration), - sys_in_millis: z.optional(types_duration_value_unit_millis), - total: z.optional(types_duration), - total_in_millis: z.optional(types_duration_value_unit_millis), - user: z.optional(types_duration), - user_in_millis: z.optional(types_duration_value_unit_millis), - load_average: z.optional(z.record(z.string(), z.number())), + percent: z.optional(z.number()), + sys: z.optional(types_duration), + sys_in_millis: z.optional(types_duration_value_unit_millis), + total: z.optional(types_duration), + total_in_millis: z.optional(types_duration_value_unit_millis), + user: z.optional(types_duration), + user_in_millis: z.optional(types_duration_value_unit_millis), + load_average: z.optional(z.record(z.string(), z.number())) }); export const nodes_types_memory_stats = z.object({ - adjusted_total_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'If the amount of physical memory has been overridden using the `es`.`total_memory_bytes` system property then this reports the overridden value in bytes.\nOtherwise it reports the same value as `total_in_bytes`.', - }) - ), - resident: z.optional(z.string()), - resident_in_bytes: z.optional(z.number()), - share: z.optional(z.string()), - share_in_bytes: z.optional(z.number()), - total_virtual: z.optional(z.string()), - total_virtual_in_bytes: z.optional(z.number()), - total_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total amount of physical memory in bytes.', - }) - ), - free_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Amount of free physical memory in bytes.', - }) - ), - used_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'Amount of used physical memory in bytes.', - }) - ), -}); - -export const nodes_types_extended_memory_stats = nodes_types_memory_stats.and( - z.object({ - free_percent: z.optional( - z.number().register(z.globalRegistry, { - description: 'Percentage of free memory.', - }) - ), - used_percent: z.optional( - z.number().register(z.globalRegistry, { - description: 'Percentage of used memory.', - }) - ), - }) -); + adjusted_total_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'If the amount of physical memory has been overridden using the `es`.`total_memory_bytes` system property then this reports the overridden value in bytes.\nOtherwise it reports the same value as `total_in_bytes`.' + })), + resident: z.optional(z.string()), + resident_in_bytes: z.optional(z.number()), + share: z.optional(z.string()), + share_in_bytes: z.optional(z.number()), + total_virtual: z.optional(z.string()), + total_virtual_in_bytes: z.optional(z.number()), + total_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Total amount of physical memory in bytes.' + })), + free_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Amount of free physical memory in bytes.' + })), + used_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Amount of used physical memory in bytes.' + })) +}); + +export const nodes_types_extended_memory_stats = nodes_types_memory_stats.and(z.object({ + free_percent: z.optional(z.number().register(z.globalRegistry, { + description: 'Percentage of free memory.' + })), + used_percent: z.optional(z.number().register(z.globalRegistry, { + description: 'Percentage of used memory.' + })) +})); export const nodes_types_cpu_acct = z.object({ - control_group: z.optional( - z.string().register(z.globalRegistry, { - description: 'The `cpuacct` control group to which the Elasticsearch process belongs.', - }) - ), - usage_nanos: z.optional(types_duration_value_unit_nanos), + control_group: z.optional(z.string().register(z.globalRegistry, { + description: 'The `cpuacct` control group to which the Elasticsearch process belongs.' + })), + usage_nanos: z.optional(types_duration_value_unit_nanos) }); export const nodes_types_cgroup_cpu_stat = z.object({ - number_of_elapsed_periods: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of reporting periods (as specified by `cfs_period_micros`) that have elapsed.', - }) - ), - number_of_times_throttled: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of times all tasks in the same cgroup as the Elasticsearch process have been throttled.', - }) - ), - time_throttled_nanos: z.optional(types_duration_value_unit_nanos), + number_of_elapsed_periods: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of reporting periods (as specified by `cfs_period_micros`) that have elapsed.' + })), + number_of_times_throttled: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of times all tasks in the same cgroup as the Elasticsearch process have been throttled.' + })), + time_throttled_nanos: z.optional(types_duration_value_unit_nanos) }); export const nodes_types_cgroup_cpu = z.object({ - control_group: z.optional( - z.string().register(z.globalRegistry, { - description: 'The `cpu` control group to which the Elasticsearch process belongs.', - }) - ), - cfs_period_micros: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The period of time, in microseconds, for how regularly all tasks in the same cgroup as the Elasticsearch process should have their access to CPU resources reallocated.', - }) - ), - cfs_quota_micros: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The total amount of time, in microseconds, for which all tasks in the same cgroup as the Elasticsearch process can run during one period `cfs_period_micros`.', - }) - ), - stat: z.optional(nodes_types_cgroup_cpu_stat), + control_group: z.optional(z.string().register(z.globalRegistry, { + description: 'The `cpu` control group to which the Elasticsearch process belongs.' + })), + cfs_period_micros: z.optional(z.number().register(z.globalRegistry, { + description: 'The period of time, in microseconds, for how regularly all tasks in the same cgroup as the Elasticsearch process should have their access to CPU resources reallocated.' + })), + cfs_quota_micros: z.optional(z.number().register(z.globalRegistry, { + description: 'The total amount of time, in microseconds, for which all tasks in the same cgroup as the Elasticsearch process can run during one period `cfs_period_micros`.' + })), + stat: z.optional(nodes_types_cgroup_cpu_stat) }); export const nodes_types_cgroup_memory = z.object({ - control_group: z.optional( - z.string().register(z.globalRegistry, { - description: 'The `memory` control group to which the Elasticsearch process belongs.', - }) - ), - limit_in_bytes: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The maximum amount of user memory (including file cache) allowed for all tasks in the same cgroup as the Elasticsearch process.\nThis value can be too big to store in a `long`, so is returned as a string so that the value returned can exactly match what the underlying operating system interface returns.\nAny value that is too large to parse into a `long` almost certainly means no limit has been set for the cgroup.', - }) - ), - usage_in_bytes: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The total current memory usage by processes in the cgroup, in bytes, by all tasks in the same cgroup as the Elasticsearch process.\nThis value is stored as a string for consistency with `limit_in_bytes`.', - }) - ), + control_group: z.optional(z.string().register(z.globalRegistry, { + description: 'The `memory` control group to which the Elasticsearch process belongs.' + })), + limit_in_bytes: z.optional(z.string().register(z.globalRegistry, { + description: 'The maximum amount of user memory (including file cache) allowed for all tasks in the same cgroup as the Elasticsearch process.\nThis value can be too big to store in a `long`, so is returned as a string so that the value returned can exactly match what the underlying operating system interface returns.\nAny value that is too large to parse into a `long` almost certainly means no limit has been set for the cgroup.' + })), + usage_in_bytes: z.optional(z.string().register(z.globalRegistry, { + description: 'The total current memory usage by processes in the cgroup, in bytes, by all tasks in the same cgroup as the Elasticsearch process.\nThis value is stored as a string for consistency with `limit_in_bytes`.' + })) }); export const nodes_types_cgroup = z.object({ - cpuacct: z.optional(nodes_types_cpu_acct), - cpu: z.optional(nodes_types_cgroup_cpu), - memory: z.optional(nodes_types_cgroup_memory), + cpuacct: z.optional(nodes_types_cpu_acct), + cpu: z.optional(nodes_types_cgroup_cpu), + memory: z.optional(nodes_types_cgroup_memory) }); export const nodes_types_operating_system = z.object({ - cpu: z.optional(nodes_types_cpu), - mem: z.optional(nodes_types_extended_memory_stats), - swap: z.optional(nodes_types_memory_stats), - cgroup: z.optional(nodes_types_cgroup), - timestamp: z.optional(z.number()), + cpu: z.optional(nodes_types_cpu), + mem: z.optional(nodes_types_extended_memory_stats), + swap: z.optional(nodes_types_memory_stats), + cgroup: z.optional(nodes_types_cgroup), + timestamp: z.optional(z.number()) }); export const nodes_types_process = z.object({ - cpu: z.optional(nodes_types_cpu), - mem: z.optional(nodes_types_memory_stats), - open_file_descriptors: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Number of opened file descriptors associated with the current or `-1` if not supported.', - }) - ), - max_file_descriptors: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of file descriptors allowed on the system, or `-1` if not supported.', - }) - ), - timestamp: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Last time the statistics were refreshed.\nRecorded in milliseconds since the Unix Epoch.', - }) - ), + cpu: z.optional(nodes_types_cpu), + mem: z.optional(nodes_types_memory_stats), + open_file_descriptors: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of opened file descriptors associated with the current or `-1` if not supported.' + })), + max_file_descriptors: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of file descriptors allowed on the system, or `-1` if not supported.' + })), + timestamp: z.optional(z.number().register(z.globalRegistry, { + description: 'Last time the statistics were refreshed.\nRecorded in milliseconds since the Unix Epoch.' + })) }); export const nodes_types_script_cache = z.object({ - cache_evictions: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total number of times the script cache has evicted old data.', - }) - ), - compilation_limit_triggered: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Total number of times the script compilation circuit breaker has limited inline script compilations.', - }) - ), - compilations: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total number of inline script compilations performed by the node.', - }) - ), - context: z.optional(z.string()), + cache_evictions: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of times the script cache has evicted old data.' + })), + compilation_limit_triggered: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of times the script compilation circuit breaker has limited inline script compilations.' + })), + compilations: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of inline script compilations performed by the node.' + })), + context: z.optional(z.string()) }); export const nodes_types_transport_histogram = z.object({ - count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of times a transport thread took a period of time within the bounds of this bucket to handle an inbound message.', - }) - ), - lt_millis: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The exclusive upper bound of the bucket in milliseconds.\nMay be omitted on the last bucket if this bucket has no upper bound.', - }) - ), - ge_millis: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The inclusive lower bound of the bucket in milliseconds. May be omitted on the first bucket if this bucket has no lower bound.', - }) - ), + count: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of times a transport thread took a period of time within the bounds of this bucket to handle an inbound message.' + })), + lt_millis: z.optional(z.number().register(z.globalRegistry, { + description: 'The exclusive upper bound of the bucket in milliseconds.\nMay be omitted on the last bucket if this bucket has no upper bound.' + })), + ge_millis: z.optional(z.number().register(z.globalRegistry, { + description: 'The inclusive lower bound of the bucket in milliseconds. May be omitted on the first bucket if this bucket has no lower bound.' + })) }); export const nodes_types_transport = z.object({ - inbound_handling_time_histogram: z.optional( - z.array(nodes_types_transport_histogram).register(z.globalRegistry, { - description: - 'The distribution of the time spent handling each inbound message on a transport thread, represented as a histogram.', - }) - ), - outbound_handling_time_histogram: z.optional( - z.array(nodes_types_transport_histogram).register(z.globalRegistry, { - description: - 'The distribution of the time spent sending each outbound transport message on a transport thread, represented as a histogram.', - }) - ), - rx_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Total number of RX (receive) packets received by the node during internal cluster communication.', - }) - ), - rx_size: z.optional( - z.string().register(z.globalRegistry, { - description: 'Size of RX packets received by the node during internal cluster communication.', - }) - ), - rx_size_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Size, in bytes, of RX packets received by the node during internal cluster communication.', - }) - ), - server_open: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Current number of inbound TCP connections used for internal communication between nodes.', - }) - ), - tx_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Total number of TX (transmit) packets sent by the node during internal cluster communication.', - }) - ), - tx_size: z.optional( - z.string().register(z.globalRegistry, { - description: 'Size of TX packets sent by the node during internal cluster communication.', - }) - ), - tx_size_in_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Size, in bytes, of TX packets sent by the node during internal cluster communication.', - }) - ), - total_outbound_connections: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The cumulative number of outbound transport connections that this node has opened since it started.\nEach transport connection may comprise multiple TCP connections but is only counted once in this statistic.\nTransport connections are typically long-lived so this statistic should remain constant in a stable cluster.', - }) - ), + inbound_handling_time_histogram: z.optional(z.array(nodes_types_transport_histogram).register(z.globalRegistry, { + description: 'The distribution of the time spent handling each inbound message on a transport thread, represented as a histogram.' + })), + outbound_handling_time_histogram: z.optional(z.array(nodes_types_transport_histogram).register(z.globalRegistry, { + description: 'The distribution of the time spent sending each outbound transport message on a transport thread, represented as a histogram.' + })), + rx_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of RX (receive) packets received by the node during internal cluster communication.' + })), + rx_size: z.optional(z.string().register(z.globalRegistry, { + description: 'Size of RX packets received by the node during internal cluster communication.' + })), + rx_size_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Size, in bytes, of RX packets received by the node during internal cluster communication.' + })), + server_open: z.optional(z.number().register(z.globalRegistry, { + description: 'Current number of inbound TCP connections used for internal communication between nodes.' + })), + tx_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of TX (transmit) packets sent by the node during internal cluster communication.' + })), + tx_size: z.optional(z.string().register(z.globalRegistry, { + description: 'Size of TX packets sent by the node during internal cluster communication.' + })), + tx_size_in_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'Size, in bytes, of TX packets sent by the node during internal cluster communication.' + })), + total_outbound_connections: z.optional(z.number().register(z.globalRegistry, { + description: 'The cumulative number of outbound transport connections that this node has opened since it started.\nEach transport connection may comprise multiple TCP connections but is only counted once in this statistic.\nTransport connections are typically long-lived so this statistic should remain constant in a stable cluster.' + })) }); export const nodes_types_cluster_state_queue = z.object({ - total: z.optional( - z.number().register(z.globalRegistry, { - description: 'Total number of cluster states in queue.', - }) - ), - pending: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of pending cluster states in queue.', - }) - ), - committed: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of committed cluster states in queue.', - }) - ), + total: z.optional(z.number().register(z.globalRegistry, { + description: 'Total number of cluster states in queue.' + })), + pending: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of pending cluster states in queue.' + })), + committed: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of committed cluster states in queue.' + })) }); export const nodes_types_published_cluster_states = z.object({ - full_states: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of published cluster states.', - }) - ), - incompatible_diffs: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of incompatible differences between published cluster states.', - }) - ), - compatible_diffs: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of compatible differences between published cluster states.', - }) - ), + full_states: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of published cluster states.' + })), + incompatible_diffs: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of incompatible differences between published cluster states.' + })), + compatible_diffs: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of compatible differences between published cluster states.' + })) }); export const nodes_types_cluster_state_update = z.object({ - count: z.number().register(z.globalRegistry, { - description: - 'The number of cluster state update attempts that did not change the cluster state since the node started.', - }), - computation_time: z.optional(types_duration), - computation_time_millis: z.optional(types_duration_value_unit_millis), - publication_time: z.optional(types_duration), - publication_time_millis: z.optional(types_duration_value_unit_millis), - context_construction_time: z.optional(types_duration), - context_construction_time_millis: z.optional(types_duration_value_unit_millis), - commit_time: z.optional(types_duration), - commit_time_millis: z.optional(types_duration_value_unit_millis), - completion_time: z.optional(types_duration), - completion_time_millis: z.optional(types_duration_value_unit_millis), - master_apply_time: z.optional(types_duration), - master_apply_time_millis: z.optional(types_duration_value_unit_millis), - notification_time: z.optional(types_duration), - notification_time_millis: z.optional(types_duration_value_unit_millis), + count: z.number().register(z.globalRegistry, { + description: 'The number of cluster state update attempts that did not change the cluster state since the node started.' + }), + computation_time: z.optional(types_duration), + computation_time_millis: z.optional(types_duration_value_unit_millis), + publication_time: z.optional(types_duration), + publication_time_millis: z.optional(types_duration_value_unit_millis), + context_construction_time: z.optional(types_duration), + context_construction_time_millis: z.optional(types_duration_value_unit_millis), + commit_time: z.optional(types_duration), + commit_time_millis: z.optional(types_duration_value_unit_millis), + completion_time: z.optional(types_duration), + completion_time_millis: z.optional(types_duration_value_unit_millis), + master_apply_time: z.optional(types_duration), + master_apply_time_millis: z.optional(types_duration_value_unit_millis), + notification_time: z.optional(types_duration), + notification_time_millis: z.optional(types_duration_value_unit_millis) }); export const nodes_types_serialized_cluster_state_detail = z.object({ - count: z.optional(z.number()), - uncompressed_size: z.optional(z.string()), - uncompressed_size_in_bytes: z.optional(z.number()), - compressed_size: z.optional(z.string()), - compressed_size_in_bytes: z.optional(z.number()), + count: z.optional(z.number()), + uncompressed_size: z.optional(z.string()), + uncompressed_size_in_bytes: z.optional(z.number()), + compressed_size: z.optional(z.string()), + compressed_size_in_bytes: z.optional(z.number()) }); export const nodes_types_serialized_cluster_state = z.object({ - full_states: z.optional(nodes_types_serialized_cluster_state_detail), - diffs: z.optional(nodes_types_serialized_cluster_state_detail), + full_states: z.optional(nodes_types_serialized_cluster_state_detail), + diffs: z.optional(nodes_types_serialized_cluster_state_detail) }); export const nodes_types_recording = z.object({ - name: z.optional(z.string()), - cumulative_execution_count: z.optional(z.number()), - cumulative_execution_time: z.optional(types_duration), - cumulative_execution_time_millis: z.optional(types_duration_value_unit_millis), + name: z.optional(z.string()), + cumulative_execution_count: z.optional(z.number()), + cumulative_execution_time: z.optional(types_duration), + cumulative_execution_time_millis: z.optional(types_duration_value_unit_millis) }); export const nodes_types_cluster_applied_stats = z.object({ - recordings: z.optional(z.array(nodes_types_recording)), + recordings: z.optional(z.array(nodes_types_recording)) }); export const nodes_types_discovery = z.object({ - cluster_state_queue: z.optional(nodes_types_cluster_state_queue), - published_cluster_states: z.optional(nodes_types_published_cluster_states), - cluster_state_update: z.optional( - z.record(z.string(), nodes_types_cluster_state_update).register(z.globalRegistry, { - description: - 'Contains low-level statistics about how long various activities took during cluster state updates while the node was the elected master.\nOmitted if the node is not master-eligible.\nEvery field whose name ends in `_time` within this object is also represented as a raw number of milliseconds in a field whose name ends in `_time_millis`.\nThe human-readable fields with a `_time` suffix are only returned if requested with the `?human=true` query parameter.', - }) - ), - serialized_cluster_states: z.optional(nodes_types_serialized_cluster_state), - cluster_applier_stats: z.optional(nodes_types_cluster_applied_stats), + cluster_state_queue: z.optional(nodes_types_cluster_state_queue), + published_cluster_states: z.optional(nodes_types_published_cluster_states), + cluster_state_update: z.optional(z.record(z.string(), nodes_types_cluster_state_update).register(z.globalRegistry, { + description: 'Contains low-level statistics about how long various activities took during cluster state updates while the node was the elected master.\nOmitted if the node is not master-eligible.\nEvery field whose name ends in `_time` within this object is also represented as a raw number of milliseconds in a field whose name ends in `_time_millis`.\nThe human-readable fields with a `_time` suffix are only returned if requested with the `?human=true` query parameter.' + })), + serialized_cluster_states: z.optional(nodes_types_serialized_cluster_state), + cluster_applier_stats: z.optional(nodes_types_cluster_applied_stats) }); export const nodes_types_indexing_pressure = z.object({ - memory: z.optional(nodes_types_indexing_pressure_memory), + memory: z.optional(nodes_types_indexing_pressure_memory) }); -export const nodes_usage_nodes_usage_metric = z.enum(['_all', 'rest_actions', 'aggregations']); +export const nodes_usage_nodes_usage_metric = z.enum([ + '_all', + 'rest_actions', + 'aggregations' +]); export const nodes_usage_nodes_usage_metrics = z.union([ - nodes_usage_nodes_usage_metric, - z.array(nodes_usage_nodes_usage_metric), + nodes_usage_nodes_usage_metric, + z.array(nodes_usage_nodes_usage_metric) ]); export const nodes_usage_node_usage = z.object({ - rest_actions: z.record(z.string(), z.number()), - since: types_epoch_time_unit_millis, - timestamp: types_epoch_time_unit_millis, - aggregations: z.record(z.string(), z.record(z.string(), z.unknown())), + rest_actions: z.record(z.string(), z.number()), + since: types_epoch_time_unit_millis, + timestamp: types_epoch_time_unit_millis, + aggregations: z.record(z.string(), z.record(z.string(), z.unknown())) }); -export const nodes_usage_response_base = nodes_types_nodes_response_base.and( - z.object({ +export const nodes_usage_response_base = nodes_types_nodes_response_base.and(z.object({ cluster_name: types_name, - nodes: z.record(z.string(), nodes_usage_node_usage), - }) -); + nodes: z.record(z.string(), nodes_usage_node_usage) +})); export const query_rules_types_query_rule_type = z.enum(['pinned', 'exclude']); export const query_rules_types_query_rule_criteria_type = z.enum([ - 'global', - 'exact', - 'exact_fuzzy', - 'fuzzy', - 'prefix', - 'suffix', - 'contains', - 'lt', - 'lte', - 'gt', - 'gte', - 'always', + 'global', + 'exact', + 'exact_fuzzy', + 'fuzzy', + 'prefix', + 'suffix', + 'contains', + 'lt', + 'lte', + 'gt', + 'gte', + 'always' ]); export const query_rules_types_query_rule_criteria = z.object({ - type: query_rules_types_query_rule_criteria_type, - metadata: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The metadata field to match against.\nThis metadata will be used to match against `match_criteria` sent in the rule.\nIt is required for all criteria types except `always`.', - }) - ), - values: z.optional( - z.array(z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'The values to match against the `metadata` field.\nOnly one value must match for the criteria to be met.\nIt is required for all criteria types except `always`.', - }) - ), + type: query_rules_types_query_rule_criteria_type, + metadata: z.optional(z.string().register(z.globalRegistry, { + description: 'The metadata field to match against.\nThis metadata will be used to match against `match_criteria` sent in the rule.\nIt is required for all criteria types except `always`.' + })), + values: z.optional(z.array(z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'The values to match against the `metadata` field.\nOnly one value must match for the criteria to be met.\nIt is required for all criteria types except `always`.' + })) }); export const query_rules_types_query_rule_actions = z.object({ - ids: z.optional( - z.array(types_id).register(z.globalRegistry, { - description: - 'The unique document IDs of the documents to apply the rule to.\nOnly one of `ids` or `docs` may be specified and at least one must be specified.', - }) - ), - docs: z.optional( - z.array(types_query_dsl_pinned_doc).register(z.globalRegistry, { - description: - 'The documents to apply the rule to.\nOnly one of `ids` or `docs` may be specified and at least one must be specified.\nThere is a maximum value of 100 documents in a rule.\nYou can specify the following attributes for each document:\n\n* `_index`: The index of the document to pin.\n* `_id`: The unique document ID.', - }) - ), + ids: z.optional(z.array(types_id).register(z.globalRegistry, { + description: 'The unique document IDs of the documents to apply the rule to.\nOnly one of `ids` or `docs` may be specified and at least one must be specified.' + })), + docs: z.optional(z.array(types_query_dsl_pinned_doc).register(z.globalRegistry, { + description: 'The documents to apply the rule to.\nOnly one of `ids` or `docs` may be specified and at least one must be specified.\nThere is a maximum value of 100 documents in a rule.\nYou can specify the following attributes for each document:\n\n* `_index`: The index of the document to pin.\n* `_id`: The unique document ID.' + })) }); export const query_rules_types_query_rule = z.object({ - rule_id: types_id, - type: query_rules_types_query_rule_type, - criteria: z.union([ - query_rules_types_query_rule_criteria, - z.array(query_rules_types_query_rule_criteria), - ]), - actions: query_rules_types_query_rule_actions, - priority: z.optional(z.number()), + rule_id: types_id, + type: query_rules_types_query_rule_type, + criteria: z.union([ + query_rules_types_query_rule_criteria, + z.array(query_rules_types_query_rule_criteria) + ]), + actions: query_rules_types_query_rule_actions, + priority: z.optional(z.number()) }); export const query_rules_types_query_ruleset = z.object({ - ruleset_id: types_id, - rules: z.array(query_rules_types_query_rule).register(z.globalRegistry, { - description: 'Rules associated with the query ruleset.', - }), + ruleset_id: types_id, + rules: z.array(query_rules_types_query_rule).register(z.globalRegistry, { + description: 'Rules associated with the query ruleset.' + }) }); export const query_rules_list_rulesets_query_ruleset_list_item = z.object({ - ruleset_id: types_id, - rule_total_count: z.number().register(z.globalRegistry, { - description: 'The number of rules associated with the ruleset.', - }), - rule_criteria_types_counts: z.record(z.string(), z.number()).register(z.globalRegistry, { - description: - 'A map of criteria type (for example, `exact`) to the number of rules of that type.\n\nNOTE: The counts in `rule_criteria_types_counts` may be larger than the value of `rule_total_count` because a rule may have multiple criteria.', - }), - rule_type_counts: z.record(z.string(), z.number()).register(z.globalRegistry, { - description: 'A map of rule type (for example, `pinned`) to the number of rules of that type.', - }), + ruleset_id: types_id, + rule_total_count: z.number().register(z.globalRegistry, { + description: 'The number of rules associated with the ruleset.' + }), + rule_criteria_types_counts: z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'A map of criteria type (for example, `exact`) to the number of rules of that type.\n\nNOTE: The counts in `rule_criteria_types_counts` may be larger than the value of `rule_total_count` because a rule may have multiple criteria.' + }), + rule_type_counts: z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'A map of rule type (for example, `pinned`) to the number of rules of that type.' + }) }); export const query_rules_test_query_ruleset_matched_rule = z.object({ - ruleset_id: types_id, - rule_id: types_id, + ruleset_id: types_id, + rule_id: types_id }); export const global_rank_eval_document_rating = z.object({ - _id: types_id, - _index: types_index_name, - rating: z.number().register(z.globalRegistry, { - description: 'The document’s relevance with regard to this search request.', - }), + _id: types_id, + _index: types_index_name, + rating: z.number().register(z.globalRegistry, { + description: 'The document’s relevance with regard to this search request.' + }) }); export const global_rank_eval_rank_eval_metric_base = z.object({ - k: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query.', - }) - ), + k: z.optional(z.number().register(z.globalRegistry, { + description: 'Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query.' + })) }); -export const global_rank_eval_rank_eval_metric_rating_treshold = - global_rank_eval_rank_eval_metric_base.and( - z.object({ - relevant_rating_threshold: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Sets the rating threshold above which documents are considered to be "relevant".', - }) - ), - }) - ); +export const global_rank_eval_rank_eval_metric_rating_treshold = global_rank_eval_rank_eval_metric_base.and(z.object({ + relevant_rating_threshold: z.optional(z.number().register(z.globalRegistry, { + description: 'Sets the rating threshold above which documents are considered to be "relevant".' + })) +})); /** * Precision at K (P@k) */ -export const global_rank_eval_rank_eval_metric_precision = - global_rank_eval_rank_eval_metric_rating_treshold.and( - z.object({ - ignore_unlabeled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Controls how unlabeled documents in the search results are counted. If set to true, unlabeled documents are ignored and neither count as relevant or irrelevant. Set to false (the default), they are treated as irrelevant.', - }) - ), - }) - ); +export const global_rank_eval_rank_eval_metric_precision = global_rank_eval_rank_eval_metric_rating_treshold.and(z.object({ + ignore_unlabeled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Controls how unlabeled documents in the search results are counted. If set to true, unlabeled documents are ignored and neither count as relevant or irrelevant. Set to false (the default), they are treated as irrelevant.' + })) +})); /** * Recall at K (R@k) */ -export const global_rank_eval_rank_eval_metric_recall = - global_rank_eval_rank_eval_metric_rating_treshold.and(z.record(z.string(), z.unknown())); +export const global_rank_eval_rank_eval_metric_recall = global_rank_eval_rank_eval_metric_rating_treshold.and(z.record(z.string(), z.unknown())); /** * Mean Reciprocal Rank */ -export const global_rank_eval_rank_eval_metric_mean_reciprocal_rank = - global_rank_eval_rank_eval_metric_rating_treshold.and(z.record(z.string(), z.unknown())); +export const global_rank_eval_rank_eval_metric_mean_reciprocal_rank = global_rank_eval_rank_eval_metric_rating_treshold.and(z.record(z.string(), z.unknown())); /** * Discounted cumulative gain (DCG) */ -export const global_rank_eval_rank_eval_metric_discounted_cumulative_gain = - global_rank_eval_rank_eval_metric_base.and( - z.object({ - normalize: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If set to true, this metric will calculate the Normalized DCG.', - }) - ), - }) - ); +export const global_rank_eval_rank_eval_metric_discounted_cumulative_gain = global_rank_eval_rank_eval_metric_base.and(z.object({ + normalize: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If set to true, this metric will calculate the Normalized DCG.' + })) +})); /** * Expected Reciprocal Rank (ERR) */ -export const global_rank_eval_rank_eval_metric_expected_reciprocal_rank = - global_rank_eval_rank_eval_metric_base.and( - z.object({ - maximum_relevance: z.number().register(z.globalRegistry, { - description: 'The highest relevance grade used in the user-supplied relevance judgments.', - }), +export const global_rank_eval_rank_eval_metric_expected_reciprocal_rank = global_rank_eval_rank_eval_metric_base.and(z.object({ + maximum_relevance: z.number().register(z.globalRegistry, { + description: 'The highest relevance grade used in the user-supplied relevance judgments.' }) - ); +})); export const global_rank_eval_rank_eval_metric = z.object({ - precision: z.optional(global_rank_eval_rank_eval_metric_precision), - recall: z.optional(global_rank_eval_rank_eval_metric_recall), - mean_reciprocal_rank: z.optional(global_rank_eval_rank_eval_metric_mean_reciprocal_rank), - dcg: z.optional(global_rank_eval_rank_eval_metric_discounted_cumulative_gain), - expected_reciprocal_rank: z.optional(global_rank_eval_rank_eval_metric_expected_reciprocal_rank), + precision: z.optional(global_rank_eval_rank_eval_metric_precision), + recall: z.optional(global_rank_eval_rank_eval_metric_recall), + mean_reciprocal_rank: z.optional(global_rank_eval_rank_eval_metric_mean_reciprocal_rank), + dcg: z.optional(global_rank_eval_rank_eval_metric_discounted_cumulative_gain), + expected_reciprocal_rank: z.optional(global_rank_eval_rank_eval_metric_expected_reciprocal_rank) }); export const global_rank_eval_unrated_document = z.object({ - _id: types_id, - _index: types_index_name, + _id: types_id, + _index: types_index_name }); export const global_rank_eval_rank_eval_hit = z.object({ - _id: types_id, - _index: types_index_name, - _score: z.number(), + _id: types_id, + _index: types_index_name, + _score: z.number() }); export const global_rank_eval_rank_eval_hit_item = z.object({ - hit: global_rank_eval_rank_eval_hit, - rating: z.optional(z.union([z.number(), z.string(), z.null()])), + hit: global_rank_eval_rank_eval_hit, + rating: z.optional(z.union([ + z.number(), + z.string(), + z.null() + ])) }); export const global_rank_eval_rank_eval_metric_detail = z.object({ - metric_score: z.number().register(z.globalRegistry, { - description: - 'The metric_score in the details section shows the contribution of this query to the global quality metric score', - }), - unrated_docs: z.array(global_rank_eval_unrated_document).register(z.globalRegistry, { - description: - 'The unrated_docs section contains an _index and _id entry for each document in the search result for this query that didn’t have a ratings value. This can be used to ask the user to supply ratings for these documents', - }), - hits: z.array(global_rank_eval_rank_eval_hit_item).register(z.globalRegistry, { - description: - 'The hits section shows a grouping of the search results with their supplied ratings', - }), - metric_details: z - .record(z.string(), z.record(z.string(), z.record(z.string(), z.unknown()))) - .register(z.globalRegistry, { - description: - 'The metric_details give additional information about the calculated quality metric (e.g. how many of the retrieved documents were relevant). The content varies for each metric but allows for better interpretation of the results', + metric_score: z.number().register(z.globalRegistry, { + description: 'The metric_score in the details section shows the contribution of this query to the global quality metric score' + }), + unrated_docs: z.array(global_rank_eval_unrated_document).register(z.globalRegistry, { + description: 'The unrated_docs section contains an _index and _id entry for each document in the search result for this query that didn’t have a ratings value. This can be used to ask the user to supply ratings for these documents' }), + hits: z.array(global_rank_eval_rank_eval_hit_item).register(z.globalRegistry, { + description: 'The hits section shows a grouping of the search results with their supplied ratings' + }), + metric_details: z.record(z.string(), z.record(z.string(), z.record(z.string(), z.unknown()))).register(z.globalRegistry, { + description: 'The metric_details give additional information about the calculated quality metric (e.g. how many of the retrieved documents were relevant). The content varies for each metric but allows for better interpretation of the results' + }) }); export const global_reindex_destination = z.object({ - index: types_index_name, - op_type: z.optional(types_op_type), - pipeline: z.optional( - z.string().register(z.globalRegistry, { - description: 'The name of the pipeline to use.', - }) - ), - routing: z.optional(types_routing), - version_type: z.optional(types_version_type), + index: types_index_name, + op_type: z.optional(types_op_type), + pipeline: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the pipeline to use.' + })), + routing: z.optional(types_routing), + version_type: z.optional(types_version_type) }); export const types_username = z.string(); export const global_reindex_remote_source = z.object({ - connect_timeout: z.optional(types_duration), - headers: z.optional( - z.record(z.string(), z.string()).register(z.globalRegistry, { - description: 'An object containing the headers of the request.', - }) - ), - host: types_host, - username: z.optional(types_username), - password: z.optional(types_password), - api_key: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The API key to use for authentication with the remote host (as an alternative to basic auth when the remote cluster is in Elastic Cloud).\n(It is not permitted to set this and also to set an `Authorization` header via `headers`.)', - }) - ), - socket_timeout: z.optional(types_duration), + connect_timeout: z.optional(types_duration), + headers: z.optional(z.record(z.string(), z.string()).register(z.globalRegistry, { + description: 'An object containing the headers of the request.' + })), + host: types_host, + username: z.optional(types_username), + password: z.optional(types_password), + api_key: z.optional(z.string().register(z.globalRegistry, { + description: 'The API key to use for authentication with the remote host (as an alternative to basic auth when the remote cluster is in Elastic Cloud).\n(It is not permitted to set this and also to set an `Authorization` header via `headers`.)' + })), + socket_timeout: z.optional(types_duration) }); export const global_reindex_rethrottle_reindex_status = z.object({ - batches: z.number().register(z.globalRegistry, { - description: 'The number of scroll responses pulled back by the reindex.', - }), - created: z.number().register(z.globalRegistry, { - description: 'The number of documents that were successfully created.', - }), - deleted: z.number().register(z.globalRegistry, { - description: 'The number of documents that were successfully deleted.', - }), - noops: z.number().register(z.globalRegistry, { - description: - 'The number of documents that were ignored because the script used for the reindex returned a `noop` value for `ctx.op`.', - }), - requests_per_second: z.number().register(z.globalRegistry, { - description: 'The number of requests per second effectively executed during the reindex.', - }), - retries: types_retries, - throttled: z.optional(types_duration), - throttled_millis: types_duration_value_unit_millis, - throttled_until: z.optional(types_duration), - throttled_until_millis: types_duration_value_unit_millis, - total: z.number().register(z.globalRegistry, { - description: 'The number of documents that were successfully processed.', - }), - updated: z.number().register(z.globalRegistry, { - description: - 'The number of documents that were successfully updated, for example, a document with same ID already existed prior to reindex updating it.', - }), - version_conflicts: z.number().register(z.globalRegistry, { - description: 'The number of version conflicts that reindex hits.', - }), + batches: z.number().register(z.globalRegistry, { + description: 'The number of scroll responses pulled back by the reindex.' + }), + created: z.number().register(z.globalRegistry, { + description: 'The number of documents that were successfully created.' + }), + deleted: z.number().register(z.globalRegistry, { + description: 'The number of documents that were successfully deleted.' + }), + noops: z.number().register(z.globalRegistry, { + description: 'The number of documents that were ignored because the script used for the reindex returned a `noop` value for `ctx.op`.' + }), + requests_per_second: z.number().register(z.globalRegistry, { + description: 'The number of requests per second effectively executed during the reindex.' + }), + retries: types_retries, + throttled: z.optional(types_duration), + throttled_millis: types_duration_value_unit_millis, + throttled_until: z.optional(types_duration), + throttled_until_millis: types_duration_value_unit_millis, + total: z.number().register(z.globalRegistry, { + description: 'The number of documents that were successfully processed.' + }), + updated: z.number().register(z.globalRegistry, { + description: 'The number of documents that were successfully updated, for example, a document with same ID already existed prior to reindex updating it.' + }), + version_conflicts: z.number().register(z.globalRegistry, { + description: 'The number of version conflicts that reindex hits.' + }) }); export const global_reindex_rethrottle_reindex_task = z.object({ - action: z.string(), - cancellable: z.boolean(), - description: z.string(), - id: z.number(), - node: types_name, - running_time_in_nanos: types_duration_value_unit_nanos, - start_time_in_millis: types_epoch_time_unit_millis, - status: global_reindex_rethrottle_reindex_status, - type: z.string(), - headers: types_http_headers, + action: z.string(), + cancellable: z.boolean(), + description: z.string(), + id: z.number(), + node: types_name, + running_time_in_nanos: types_duration_value_unit_nanos, + start_time_in_millis: types_epoch_time_unit_millis, + status: global_reindex_rethrottle_reindex_status, + type: z.string(), + headers: types_http_headers }); export const spec_utils_base_node = z.object({ - attributes: z.record(z.string(), z.string()), - host: types_host, - ip: types_ip, - name: types_name, - roles: z.optional(types_node_roles), - transport_address: types_transport_address, + attributes: z.record(z.string(), z.string()), + host: types_host, + ip: types_ip, + name: types_name, + roles: z.optional(types_node_roles), + transport_address: types_transport_address }); -export const global_reindex_rethrottle_reindex_node = spec_utils_base_node.and( - z.object({ - tasks: z.record(z.string(), global_reindex_rethrottle_reindex_task), - }) -); +export const global_reindex_rethrottle_reindex_node = spec_utils_base_node.and(z.object({ + tasks: z.record(z.string(), global_reindex_rethrottle_reindex_task) +})); export const rollup_types_date_histogram_grouping = z.object({ - delay: z.optional(types_duration), - field: types_field, - format: z.optional(z.string()), - interval: z.optional(types_duration), - calendar_interval: z.optional(types_duration), - fixed_interval: z.optional(types_duration), - time_zone: z.optional(types_time_zone), + delay: z.optional(types_duration), + field: types_field, + format: z.optional(z.string()), + interval: z.optional(types_duration), + calendar_interval: z.optional(types_duration), + fixed_interval: z.optional(types_duration), + time_zone: z.optional(types_time_zone) }); export const rollup_types_histogram_grouping = z.object({ - fields: types_fields, - interval: z.number().register(z.globalRegistry, { - description: - 'The interval of histogram buckets to be generated when rolling up.\nFor example, a value of `5` creates buckets that are five units wide (`0-5`, `5-10`, etc).\nNote that only one interval can be specified in the histogram group, meaning that all fields being grouped via the histogram must share the same interval.', - }), + fields: types_fields, + interval: z.number().register(z.globalRegistry, { + description: 'The interval of histogram buckets to be generated when rolling up.\nFor example, a value of `5` creates buckets that are five units wide (`0-5`, `5-10`, etc).\nNote that only one interval can be specified in the histogram group, meaning that all fields being grouped via the histogram must share the same interval.' + }) }); export const rollup_types_terms_grouping = z.object({ - fields: types_fields, + fields: types_fields }); export const rollup_types_groupings = z.object({ - date_histogram: z.optional(rollup_types_date_histogram_grouping), - histogram: z.optional(rollup_types_histogram_grouping), - terms: z.optional(rollup_types_terms_grouping), + date_histogram: z.optional(rollup_types_date_histogram_grouping), + histogram: z.optional(rollup_types_histogram_grouping), + terms: z.optional(rollup_types_terms_grouping) }); -export const rollup_types_metric = z.enum(['min', 'max', 'sum', 'avg', 'value_count']); +export const rollup_types_metric = z.enum([ + 'min', + 'max', + 'sum', + 'avg', + 'value_count' +]); export const rollup_types_field_metric = z.object({ - field: types_field, - metrics: z.array(rollup_types_metric).register(z.globalRegistry, { - description: - 'An array of metrics to collect for the field. At least one metric must be configured.', - }), + field: types_field, + metrics: z.array(rollup_types_metric).register(z.globalRegistry, { + description: 'An array of metrics to collect for the field. At least one metric must be configured.' + }) }); export const rollup_get_jobs_rollup_job_configuration = z.object({ - cron: z.string(), - groups: rollup_types_groupings, - id: types_id, - index_pattern: z.string(), - metrics: z.array(rollup_types_field_metric), - page_size: z.number(), - rollup_index: types_index_name, - timeout: types_duration, + cron: z.string(), + groups: rollup_types_groupings, + id: types_id, + index_pattern: z.string(), + metrics: z.array(rollup_types_field_metric), + page_size: z.number(), + rollup_index: types_index_name, + timeout: types_duration }); export const rollup_get_jobs_rollup_job_stats = z.object({ - documents_processed: z.number(), - index_failures: z.number(), - index_time_in_ms: types_duration_value_unit_millis, - index_total: z.number(), - pages_processed: z.number(), - rollups_indexed: z.number(), - search_failures: z.number(), - search_time_in_ms: types_duration_value_unit_millis, - search_total: z.number(), - trigger_count: z.number(), - processing_time_in_ms: types_duration_value_unit_millis, - processing_total: z.number(), + documents_processed: z.number(), + index_failures: z.number(), + index_time_in_ms: types_duration_value_unit_millis, + index_total: z.number(), + pages_processed: z.number(), + rollups_indexed: z.number(), + search_failures: z.number(), + search_time_in_ms: types_duration_value_unit_millis, + search_total: z.number(), + trigger_count: z.number(), + processing_time_in_ms: types_duration_value_unit_millis, + processing_total: z.number() }); export const rollup_get_jobs_indexing_job_state = z.enum([ - 'started', - 'indexing', - 'stopping', - 'stopped', - 'aborting', + 'started', + 'indexing', + 'stopping', + 'stopped', + 'aborting' ]); export const rollup_get_jobs_rollup_job_status = z.object({ - current_position: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - job_state: rollup_get_jobs_indexing_job_state, - upgraded_doc_id: z.optional(z.boolean()), + current_position: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + job_state: rollup_get_jobs_indexing_job_state, + upgraded_doc_id: z.optional(z.boolean()) }); export const rollup_get_jobs_rollup_job = z.object({ - config: rollup_get_jobs_rollup_job_configuration, - stats: rollup_get_jobs_rollup_job_stats, - status: rollup_get_jobs_rollup_job_status, + config: rollup_get_jobs_rollup_job_configuration, + stats: rollup_get_jobs_rollup_job_stats, + status: rollup_get_jobs_rollup_job_status }); export const rollup_get_rollup_caps_rollup_field_summary = z.object({ - agg: z.string(), - calendar_interval: z.optional(types_duration), - time_zone: z.optional(types_time_zone), + agg: z.string(), + calendar_interval: z.optional(types_duration), + time_zone: z.optional(types_time_zone) }); export const rollup_get_rollup_caps_rollup_capability_summary = z.object({ - fields: z.record(z.string(), z.array(rollup_get_rollup_caps_rollup_field_summary)), - index_pattern: z.string(), - job_id: z.string(), - rollup_index: z.string(), + fields: z.record(z.string(), z.array(rollup_get_rollup_caps_rollup_field_summary)), + index_pattern: z.string(), + job_id: z.string(), + rollup_index: z.string() }); export const rollup_get_rollup_caps_rollup_capabilities = z.object({ - rollup_jobs: z - .array(rollup_get_rollup_caps_rollup_capability_summary) - .register(z.globalRegistry, { - description: - 'There can be multiple, independent jobs configured for a single index or index pattern. Each of these jobs may have different configurations, so the API returns a list of all the various configurations available.', - }), + rollup_jobs: z.array(rollup_get_rollup_caps_rollup_capability_summary).register(z.globalRegistry, { + description: 'There can be multiple, independent jobs configured for a single index or index pattern. Each of these jobs may have different configurations, so the API returns a list of all the various configurations available.' + }) }); export const rollup_get_rollup_index_caps_rollup_job_summary_field = z.object({ - agg: z.string(), - time_zone: z.optional(types_time_zone), - calendar_interval: z.optional(types_duration), + agg: z.string(), + time_zone: z.optional(types_time_zone), + calendar_interval: z.optional(types_duration) }); export const rollup_get_rollup_index_caps_rollup_job_summary = z.object({ - fields: z.record(z.string(), z.array(rollup_get_rollup_index_caps_rollup_job_summary_field)), - index_pattern: z.string(), - job_id: types_id, - rollup_index: types_index_name, + fields: z.record(z.string(), z.array(rollup_get_rollup_index_caps_rollup_job_summary_field)), + index_pattern: z.string(), + job_id: types_id, + rollup_index: types_index_name }); export const rollup_get_rollup_index_caps_index_capabilities = z.object({ - rollup_jobs: z.array(rollup_get_rollup_index_caps_rollup_job_summary), + rollup_jobs: z.array(rollup_get_rollup_index_caps_rollup_job_summary) }); export const global_scripts_painless_execute_painless_context = z.enum([ - 'painless_test', - 'filter', - 'score', - 'boolean_field', - 'date_field', - 'double_field', - 'geo_point_field', - 'ip_field', - 'keyword_field', - 'long_field', - 'composite_field', + 'painless_test', + 'filter', + 'score', + 'boolean_field', + 'date_field', + 'double_field', + 'geo_point_field', + 'ip_field', + 'keyword_field', + 'long_field', + 'composite_field' ]); export const search_application_types_event_data_stream = z.object({ - name: types_index_name, + name: types_index_name }); export const search_application_types_analytics_collection = z.object({ - event_data_stream: search_application_types_event_data_stream, + event_data_stream: search_application_types_event_data_stream }); -export const search_application_types_event_type = z.enum(['page_view', 'search', 'search_click']); +export const search_application_types_event_type = z.enum([ + 'page_view', + 'search', + 'search_click' +]); -export const search_application_put_behavioral_analytics_analytics_acknowledge_response_base = - types_acknowledged_response_base.and( - z.object({ - name: types_name, - }) - ); +export const search_application_put_behavioral_analytics_analytics_acknowledge_response_base = types_acknowledged_response_base.and(z.object({ + name: types_name +})); export const global_search_mvt_types_zoom_level = z.number(); @@ -23038,223 +18949,240 @@ export const global_search_mvt_types_coordinate = z.number(); export const global_search_mvt_types_grid_aggregation_type = z.enum(['geotile', 'geohex']); -export const global_search_mvt_types_grid_type = z.enum(['grid', 'point', 'centroid']); +export const global_search_mvt_types_grid_type = z.enum([ + 'grid', + 'point', + 'centroid' +]); export const types_mapbox_vector_tiles = z.record(z.string(), z.unknown()); export const global_search_shards_search_shards_node_attributes = z.object({ - name: types_node_name, - ephemeral_id: types_id, - transport_address: types_transport_address, - external_id: z.string(), - attributes: z.record(z.string(), z.string()).register(z.globalRegistry, { - description: 'Lists node attributes.', - }), - roles: types_node_roles, - version: types_version_string, - min_index_version: z.number(), - max_index_version: z.number(), + name: types_node_name, + ephemeral_id: types_id, + transport_address: types_transport_address, + external_id: z.string(), + attributes: z.record(z.string(), z.string()).register(z.globalRegistry, { + description: 'Lists node attributes.' + }), + roles: types_node_roles, + version: types_version_string, + min_index_version: z.number(), + max_index_version: z.number() }); export const types_relocation_failure_info = z.object({ - failed_attempts: z.number(), + failed_attempts: z.number() }); export const types_node_shard = z.object({ - state: indices_stats_shard_routing_state, - primary: z.boolean(), - node: z.optional(types_node_name), - shard: z.number(), - index: types_index_name, - allocation_id: z.optional(z.record(z.string(), types_id)), - recovery_source: z.optional(z.record(z.string(), types_id)), - unassigned_info: z.optional(cluster_allocation_explain_unassigned_information), - relocating_node: z.optional(z.union([types_node_id, z.string(), z.null()])), - relocation_failure_info: z.optional(types_relocation_failure_info), + state: indices_stats_shard_routing_state, + primary: z.boolean(), + node: z.optional(types_node_name), + shard: z.number(), + index: types_index_name, + allocation_id: z.optional(z.record(z.string(), types_id)), + recovery_source: z.optional(z.record(z.string(), types_id)), + unassigned_info: z.optional(cluster_allocation_explain_unassigned_information), + relocating_node: z.optional(z.union([ + types_node_id, + z.string(), + z.null() + ])), + relocation_failure_info: z.optional(types_relocation_failure_info) }); export const searchable_snapshots_cache_stats_shared = z.object({ - reads: z.number(), - bytes_read_in_bytes: types_byte_size, - writes: z.number(), - bytes_written_in_bytes: types_byte_size, - evictions: z.number(), - num_regions: z.number(), - size_in_bytes: types_byte_size, - region_size_in_bytes: types_byte_size, + reads: z.number(), + bytes_read_in_bytes: types_byte_size, + writes: z.number(), + bytes_written_in_bytes: types_byte_size, + evictions: z.number(), + num_regions: z.number(), + size_in_bytes: types_byte_size, + region_size_in_bytes: types_byte_size }); export const searchable_snapshots_cache_stats_node = z.object({ - shared_cache: searchable_snapshots_cache_stats_shared, + shared_cache: searchable_snapshots_cache_stats_shared }); export const searchable_snapshots_mount_mounted_snapshot = z.object({ - snapshot: types_name, - indices: types_indices, - shards: types_shard_statistics, + snapshot: types_name, + indices: types_indices, + shards: types_shard_statistics }); -export const searchable_snapshots_types_stats_level = z.enum(['cluster', 'indices', 'shards']); +export const searchable_snapshots_types_stats_level = z.enum([ + 'cluster', + 'indices', + 'shards' +]); export const security_types_grant_type = z.enum(['password', 'access_token']); export const security_types_user_profile_hit_metadata = z.object({ - _primary_term: z.number(), - _seq_no: types_sequence_number, + _primary_term: z.number(), + _seq_no: types_sequence_number }); export const security_types_user_profile_id = z.string(); export const security_types_user_profile_user = z.object({ - email: z.optional(z.union([z.string(), z.null()])), - full_name: z.optional(z.union([types_name, z.string(), z.null()])), - realm_name: types_name, - realm_domain: z.optional(types_name), - roles: z.array(z.string()), - username: types_username, + email: z.optional(z.union([ + z.string(), + z.null() + ])), + full_name: z.optional(z.union([ + types_name, + z.string(), + z.null() + ])), + realm_name: types_name, + realm_domain: z.optional(types_name), + roles: z.array(z.string()), + username: types_username }); export const security_types_user_profile = z.object({ - uid: security_types_user_profile_id, - user: security_types_user_profile_user, - data: z.record(z.string(), z.record(z.string(), z.unknown())), - labels: z.record(z.string(), z.record(z.string(), z.unknown())), - enabled: z.optional(z.boolean()), + uid: security_types_user_profile_id, + user: security_types_user_profile_user, + data: z.record(z.string(), z.record(z.string(), z.unknown())), + labels: z.record(z.string(), z.record(z.string(), z.unknown())), + enabled: z.optional(z.boolean()) }); -export const security_types_user_profile_with_metadata = security_types_user_profile.and( - z.object({ +export const security_types_user_profile_with_metadata = security_types_user_profile.and(z.object({ last_synchronized: z.number(), - _doc: security_types_user_profile_hit_metadata, - }) -); + _doc: security_types_user_profile_hit_metadata +})); export const security_types_api_key_managed_by = z.enum(['cloud', 'elasticsearch']); export const security_authenticate_authenticate_api_key = z.object({ - id: types_id, - name: z.optional(types_name), - managed_by: security_types_api_key_managed_by, - internal: z.optional(z.boolean()), + id: types_id, + name: z.optional(types_name), + managed_by: security_types_api_key_managed_by, + internal: z.optional(z.boolean()) }); export const security_types_realm_info = z.object({ - name: types_name, - type: z.string(), + name: types_name, + type: z.string() }); export const security_authenticate_token = z.object({ - name: types_name, - type: z.optional(z.string()), + name: types_name, + type: z.optional(z.string()) }); export const security_types_bulk_error = z.object({ - count: z.number().register(z.globalRegistry, { - description: 'The number of errors', - }), - details: z.record(z.string(), types_error_cause).register(z.globalRegistry, { - description: 'Details about the errors, keyed by role name', - }), + count: z.number().register(z.globalRegistry, { + description: 'The number of errors' + }), + details: z.record(z.string(), types_error_cause).register(z.globalRegistry, { + description: 'Details about the errors, keyed by role name' + }) }); export const security_types_cluster_privilege = z.union([ - z.enum([ - 'all', - 'cancel_task', - 'create_snapshot', - 'cross_cluster_replication', - 'cross_cluster_search', - 'delegate_pki', - 'grant_api_key', - 'manage', - 'manage_api_key', - 'manage_autoscaling', - 'manage_behavioral_analytics', - 'manage_ccr', - 'manage_data_frame_transforms', - 'manage_data_stream_global_retention', - 'manage_enrich', - 'manage_esql', - 'manage_ilm', - 'manage_index_templates', - 'manage_inference', - 'manage_ingest_pipelines', - 'manage_logstash_pipelines', - 'manage_ml', - 'manage_oidc', - 'manage_own_api_key', - 'manage_pipeline', - 'manage_rollup', - 'manage_saml', - 'manage_search_application', - 'manage_search_query_rules', - 'manage_search_synonyms', - 'manage_security', - 'manage_service_account', - 'manage_slm', - 'manage_token', - 'manage_transform', - 'manage_user_profile', - 'manage_watcher', - 'monitor', - 'monitor_data_frame_transforms', - 'monitor_data_stream_global_retention', - 'monitor_enrich', - 'monitor_esql', - 'monitor_inference', - 'monitor_ml', - 'monitor_rollup', - 'monitor_snapshot', - 'monitor_stats', - 'monitor_text_structure', - 'monitor_transform', - 'monitor_watcher', - 'none', - 'post_behavioral_analytics_event', - 'read_ccr', - 'read_fleet_secrets', - 'read_ilm', - 'read_pipeline', - 'read_security', - 'read_slm', - 'transport_client', - 'write_connector_secrets', - 'write_fleet_secrets', - ]), - z.string(), + z.enum([ + 'all', + 'cancel_task', + 'create_snapshot', + 'cross_cluster_replication', + 'cross_cluster_search', + 'delegate_pki', + 'grant_api_key', + 'manage', + 'manage_api_key', + 'manage_autoscaling', + 'manage_behavioral_analytics', + 'manage_ccr', + 'manage_data_frame_transforms', + 'manage_data_stream_global_retention', + 'manage_enrich', + 'manage_esql', + 'manage_ilm', + 'manage_index_templates', + 'manage_inference', + 'manage_ingest_pipelines', + 'manage_logstash_pipelines', + 'manage_ml', + 'manage_oidc', + 'manage_own_api_key', + 'manage_pipeline', + 'manage_rollup', + 'manage_saml', + 'manage_search_application', + 'manage_search_query_rules', + 'manage_search_synonyms', + 'manage_security', + 'manage_service_account', + 'manage_slm', + 'manage_token', + 'manage_transform', + 'manage_user_profile', + 'manage_watcher', + 'monitor', + 'monitor_data_frame_transforms', + 'monitor_data_stream_global_retention', + 'monitor_enrich', + 'monitor_esql', + 'monitor_inference', + 'monitor_ml', + 'monitor_rollup', + 'monitor_snapshot', + 'monitor_stats', + 'monitor_text_structure', + 'monitor_transform', + 'monitor_watcher', + 'none', + 'post_behavioral_analytics_event', + 'read_ccr', + 'read_fleet_secrets', + 'read_ilm', + 'read_pipeline', + 'read_security', + 'read_slm', + 'transport_client', + 'write_connector_secrets', + 'write_fleet_secrets' + ]), + z.string() ]); export const security_types_field_security = z.object({ - except: z.optional(types_fields), - grant: z.optional(types_fields), + except: z.optional(types_fields), + grant: z.optional(types_fields) }); export const security_types_index_privilege = z.union([ - z.enum([ - 'all', - 'auto_configure', - 'create', - 'create_doc', - 'create_index', - 'cross_cluster_replication', - 'cross_cluster_replication_internal', - 'delete', - 'delete_index', - 'index', - 'maintenance', - 'manage', - 'manage_data_stream_lifecycle', - 'manage_follow_index', - 'manage_ilm', - 'manage_leader_index', - 'monitor', - 'none', - 'read', - 'read_cross_cluster', - 'view_index_metadata', - 'write', - ]), - z.string(), + z.enum([ + 'all', + 'auto_configure', + 'create', + 'create_doc', + 'create_index', + 'cross_cluster_replication', + 'cross_cluster_replication_internal', + 'delete', + 'delete_index', + 'index', + 'maintenance', + 'manage', + 'manage_data_stream_lifecycle', + 'manage_follow_index', + 'manage_ilm', + 'manage_leader_index', + 'monitor', + 'none', + 'read', + 'read_cross_cluster', + 'view_index_metadata', + 'write' + ]), + z.string() ]); export const security_types_remote_cluster_privilege = z.enum(['monitor_enrich', 'monitor_stats']); @@ -23262,57 +19190,52 @@ export const security_types_remote_cluster_privilege = z.enum(['monitor_enrich', /** * The subset of cluster level privileges that can be defined for remote clusters. */ -export const security_types_remote_cluster_privileges = z - .object({ +export const security_types_remote_cluster_privileges = z.object({ clusters: types_names, privileges: z.array(security_types_remote_cluster_privilege).register(z.globalRegistry, { - description: - 'The cluster level privileges that owners of the role have on the remote cluster.', - }), - }) - .register(z.globalRegistry, { - description: 'The subset of cluster level privileges that can be defined for remote clusters.', - }); + description: 'The cluster level privileges that owners of the role have on the remote cluster.' + }) +}).register(z.globalRegistry, { + description: 'The subset of cluster level privileges that can be defined for remote clusters.' +}); export const security_types_manage_user_privileges = z.object({ - applications: z.array(z.string()), + applications: z.array(z.string()) }); export const security_types_application_global_user_privileges = z.object({ - manage: security_types_manage_user_privileges, + manage: security_types_manage_user_privileges }); export const security_types_global_privilege = z.object({ - application: security_types_application_global_user_privileges, + application: security_types_application_global_user_privileges }); export const security_types_application_privileges = z.object({ - application: z.string().register(z.globalRegistry, { - description: 'The name of the application to which this entry applies.', - }), - privileges: z.array(z.string()).register(z.globalRegistry, { - description: - 'A list of strings, where each element is the name of an application privilege or action.', - }), - resources: z.array(z.string()).register(z.globalRegistry, { - description: 'A list resources to which the privileges are applied.', - }), + application: z.string().register(z.globalRegistry, { + description: 'The name of the application to which this entry applies.' + }), + privileges: z.array(z.string()).register(z.globalRegistry, { + description: 'A list of strings, where each element is the name of an application privilege or action.' + }), + resources: z.array(z.string()).register(z.globalRegistry, { + description: 'A list resources to which the privileges are applied.' + }) }); export const security_types_restriction_workflow = z.union([ - z.enum(['search_application_query']), - z.string(), + z.enum(['search_application_query']), + z.string() ]); export const security_types_restriction = z.object({ - workflows: z.array(security_types_restriction_workflow).register(z.globalRegistry, { - description: - 'A list of workflows to which the API key is restricted.\nNOTE: In order to use a role restriction, an API key must be created with a single role descriptor.', - }), + workflows: z.array(security_types_restriction_workflow).register(z.globalRegistry, { + description: 'A list of workflows to which the API key is restricted.\nNOTE: In order to use a role restriction, an API key must be created with a single role descriptor.' + }) }); export const security_types_cluster_node = z.object({ - name: types_name, + name: types_name }); export const types_namespace = z.string(); @@ -23320,2228 +19243,2054 @@ export const types_namespace = z.string(); export const types_service = z.string(); export const security_types_replication_access = z.object({ - names: z.union([types_index_name, z.array(types_index_name)]), - allow_restricted_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'This needs to be set to true if the patterns in the names field should cover system indices.', - }) - ), + names: z.union([ + types_index_name, + z.array(types_index_name) + ]), + allow_restricted_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'This needs to be set to true if the patterns in the names field should cover system indices.' + })) }); export const security_create_service_token_token = z.object({ - name: types_name, - value: z.string(), + name: types_name, + value: z.string() }); export const security_delegate_pki_authentication_realm = z.object({ - name: z.string(), - type: z.string(), - domain: z.optional(z.string()), + name: z.string(), + type: z.string(), + domain: z.optional(z.string()) }); export const security_delegate_pki_authentication = z.object({ - username: z.string(), - roles: z.array(z.string()), - full_name: z.union([z.string(), z.null()]), - email: z.union([z.string(), z.null()]), - token: z.optional(z.record(z.string(), z.string())), - metadata: types_metadata, - enabled: z.boolean(), - authentication_realm: security_delegate_pki_authentication_realm, - lookup_realm: security_delegate_pki_authentication_realm, - authentication_type: z.string(), - api_key: z.optional(z.record(z.string(), z.string())), + username: z.string(), + roles: z.array(z.string()), + full_name: z.union([ + z.string(), + z.null() + ]), + email: z.union([ + z.string(), + z.null() + ]), + token: z.optional(z.record(z.string(), z.string())), + metadata: types_metadata, + enabled: z.boolean(), + authentication_realm: security_delegate_pki_authentication_realm, + lookup_realm: security_delegate_pki_authentication_realm, + authentication_type: z.string(), + api_key: z.optional(z.record(z.string(), z.string())) }); export const security_delete_privileges_found_status = z.object({ - found: z.boolean(), + found: z.boolean() }); export const security_enroll_kibana_token = z.object({ - name: z.string().register(z.globalRegistry, { - description: 'The name of the bearer token for the `elastic/kibana` service account.', - }), - value: z.string().register(z.globalRegistry, { - description: - 'The value of the bearer token for the `elastic/kibana` service account.\nUse this value to authenticate the service account with Elasticsearch.', - }), + name: z.string().register(z.globalRegistry, { + description: 'The name of the bearer token for the `elastic/kibana` service account.' + }), + value: z.string().register(z.globalRegistry, { + description: 'The value of the bearer token for the `elastic/kibana` service account.\nUse this value to authenticate the service account with Elasticsearch.' + }) }); export const security_types_api_key_type = z.enum(['rest', 'cross_cluster']); export const security_put_privileges_actions = z.object({ - actions: z.array(z.string()), - application: z.optional(z.string()), - name: z.optional(types_name), - metadata: z.optional(types_metadata), + actions: z.array(z.string()), + application: z.optional(z.string()), + name: z.optional(types_name), + metadata: z.optional(types_metadata) }); export const security_types_template_format = z.enum(['string', 'json']); export const security_types_role_mapping_rule = z.object({ - get any() { - return z.optional(z.array(z.lazy((): any => security_types_role_mapping_rule))); - }, - get all() { - return z.optional(z.array(z.lazy((): any => security_types_role_mapping_rule))); - }, - field: z.optional(z.record(z.string(), z.union([types_field_value, z.array(types_field_value)]))), - get except() { - return z.optional(z.lazy((): any => security_types_role_mapping_rule)); - }, + get any() { + return z.optional(z.array(z.lazy((): any => security_types_role_mapping_rule))); + }, + get all() { + return z.optional(z.array(z.lazy((): any => security_types_role_mapping_rule))); + }, + field: z.optional(z.record(z.string(), z.union([ + types_field_value, + z.array(types_field_value) + ]))), + get except() { + return z.optional(z.lazy((): any => security_types_role_mapping_rule)); + } }); export const security_get_service_credentials_nodes_credentials_file_token = z.object({ - nodes: z.array(z.string()), + nodes: z.array(z.string()) }); export const security_get_service_credentials_nodes_credentials = z.object({ - _nodes: types_node_statistics, - file_tokens: z - .record(z.string(), security_get_service_credentials_nodes_credentials_file_token) - .register(z.globalRegistry, { - description: 'File-backed tokens collected from all nodes', - }), + _nodes: types_node_statistics, + file_tokens: z.record(z.string(), security_get_service_credentials_nodes_credentials_file_token).register(z.globalRegistry, { + description: 'File-backed tokens collected from all nodes' + }) }); export const xpack_usage_security_roles_dls_bit_set_cache = z.object({ - count: z.number().register(z.globalRegistry, { - description: 'Number of entries in the cache.', - }), - memory: z.optional(types_byte_size), - memory_in_bytes: types_ulong, - hits: z.number().register(z.globalRegistry, { - description: 'Total number of cache hits.', - }), - misses: z.number().register(z.globalRegistry, { - description: 'Total number of cache misses.', - }), - evictions: z.number().register(z.globalRegistry, { - description: 'Total number of cache evictions.', - }), - hits_time_in_millis: types_duration_value_unit_millis, - misses_time_in_millis: types_duration_value_unit_millis, + count: z.number().register(z.globalRegistry, { + description: 'Number of entries in the cache.' + }), + memory: z.optional(types_byte_size), + memory_in_bytes: types_ulong, + hits: z.number().register(z.globalRegistry, { + description: 'Total number of cache hits.' + }), + misses: z.number().register(z.globalRegistry, { + description: 'Total number of cache misses.' + }), + evictions: z.number().register(z.globalRegistry, { + description: 'Total number of cache evictions.' + }), + hits_time_in_millis: types_duration_value_unit_millis, + misses_time_in_millis: types_duration_value_unit_millis }); export const xpack_usage_security_roles_dls = z.object({ - bit_set_cache: xpack_usage_security_roles_dls_bit_set_cache, + bit_set_cache: xpack_usage_security_roles_dls_bit_set_cache }); export const security_types_roles_stats = z.object({ - dls: xpack_usage_security_roles_dls, + dls: xpack_usage_security_roles_dls }); export const security_types_node_security_stats = z.object({ - roles: security_types_roles_stats, + roles: security_types_roles_stats }); export const security_get_token_access_token_grant_type = z.enum([ - 'password', - 'client_credentials', - '_kerberos', - 'refresh_token', + 'password', + 'client_credentials', + '_kerberos', + 'refresh_token' ]); export const security_get_token_user_realm = z.object({ - name: types_name, - type: z.string(), + name: types_name, + type: z.string() }); export const security_get_token_authentication_provider = z.object({ - type: z.string(), - name: types_name, + type: z.string(), + name: types_name }); export const security_types_user = z.object({ - email: z.optional(z.union([z.string(), z.null()])), - full_name: z.optional(z.union([types_name, z.string(), z.null()])), - metadata: types_metadata, - roles: z.array(z.string()), - username: types_username, - enabled: z.boolean(), - profile_uid: z.optional(security_types_user_profile_id), + email: z.optional(z.union([ + z.string(), + z.null() + ])), + full_name: z.optional(z.union([ + types_name, + z.string(), + z.null() + ])), + metadata: types_metadata, + roles: z.array(z.string()), + username: types_username, + enabled: z.boolean(), + profile_uid: z.optional(security_types_user_profile_id) }); -export const security_get_token_authenticated_user = security_types_user.and( - z.object({ +export const security_get_token_authenticated_user = security_types_user.and(z.object({ authentication_realm: security_get_token_user_realm, lookup_realm: security_get_token_user_realm, authentication_provider: z.optional(security_get_token_authentication_provider), - authentication_type: z.string(), - }) -); + authentication_type: z.string() +})); export const security_get_user_profile_get_user_profile_errors = z.object({ - count: z.number(), - details: z.record(z.string(), types_error_cause), + count: z.number(), + details: z.record(z.string(), types_error_cause) }); export const security_grant_api_key_api_key_grant_type = z.enum(['access_token', 'password']); export const security_has_privileges_application_privileges_check = z.object({ - application: z.string().register(z.globalRegistry, { - description: 'The name of the application.', - }), - privileges: z.array(z.string()).register(z.globalRegistry, { - description: - 'A list of the privileges that you want to check for the specified resources.\nIt may be either application privilege names or the names of actions that are granted by those privileges', - }), - resources: z.array(z.string()).register(z.globalRegistry, { - description: 'A list of resource names against which the privileges should be checked.', - }), + application: z.string().register(z.globalRegistry, { + description: 'The name of the application.' + }), + privileges: z.array(z.string()).register(z.globalRegistry, { + description: 'A list of the privileges that you want to check for the specified resources.\nIt may be either application privilege names or the names of actions that are granted by those privileges' + }), + resources: z.array(z.string()).register(z.globalRegistry, { + description: 'A list of resource names against which the privileges should be checked.' + }) }); export const security_has_privileges_index_privileges_check = z.object({ - names: types_indices, - privileges: z.array(security_types_index_privilege).register(z.globalRegistry, { - description: 'A list of the privileges that you want to check for the specified indices.', - }), - allow_restricted_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'This needs to be set to `true` (default is `false`) if using wildcards or regexps for patterns that cover restricted indices.\nImplicitly, restricted indices do not match index patterns because restricted indices usually have limited privileges and including them in pattern tests would render most such tests false.\nIf restricted indices are explicitly included in the names list, privileges will be checked against them regardless of the value of `allow_restricted_indices`.', - }) - ), + names: types_indices, + privileges: z.array(security_types_index_privilege).register(z.globalRegistry, { + description: 'A list of the privileges that you want to check for the specified indices.' + }), + allow_restricted_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'This needs to be set to `true` (default is `false`) if using wildcards or regexps for patterns that cover restricted indices.\nImplicitly, restricted indices do not match index patterns because restricted indices usually have limited privileges and including them in pattern tests would render most such tests false.\nIf restricted indices are explicitly included in the names list, privileges will be checked against them regardless of the value of `allow_restricted_indices`.' + })) }); export const security_has_privileges_privileges = z.record(z.string(), z.boolean()); -export const security_has_privileges_resource_privileges = z.record( - z.string(), - security_has_privileges_privileges -); +export const security_has_privileges_resource_privileges = z.record(z.string(), security_has_privileges_privileges); -export const security_has_privileges_applications_privileges = z.record( - z.string(), - security_has_privileges_resource_privileges -); +export const security_has_privileges_applications_privileges = z.record(z.string(), security_has_privileges_resource_privileges); export const security_has_privileges_user_profile_privileges_check = z.object({ - application: z.optional(z.array(security_has_privileges_application_privileges_check)), - cluster: z.optional( - z.array(security_types_cluster_privilege).register(z.globalRegistry, { - description: 'A list of the cluster privileges that you want to check.', - }) - ), - index: z.optional(z.array(security_has_privileges_index_privileges_check)), + application: z.optional(z.array(security_has_privileges_application_privileges_check)), + cluster: z.optional(z.array(security_types_cluster_privilege).register(z.globalRegistry, { + description: 'A list of the cluster privileges that you want to check.' + })), + index: z.optional(z.array(security_has_privileges_index_privileges_check)) }); export const security_has_privileges_user_profile_has_privileges_user_profile_errors = z.object({ - count: z.number(), - details: z.record(z.string(), types_error_cause), + count: z.number(), + details: z.record(z.string(), types_error_cause) }); export const security_types_created_status = z.object({ - created: z.boolean(), + created: z.boolean() }); export const security_query_api_keys_api_key_aggregate = z.union([ - types_aggregations_cardinality_aggregate, - types_aggregations_value_count_aggregate, - types_aggregations_string_terms_aggregate, - types_aggregations_long_terms_aggregate, - types_aggregations_double_terms_aggregate, - types_aggregations_unmapped_terms_aggregate, - types_aggregations_multi_terms_aggregate, - types_aggregations_missing_aggregate, - types_aggregations_filter_aggregate, - types_aggregations_filters_aggregate, - types_aggregations_range_aggregate, - types_aggregations_date_range_aggregate, - types_aggregations_composite_aggregate, -]); - -export const security_query_user_query_user = security_types_user.and( - z.object({ - _sort: z.optional(types_sort_results), - }) -); + types_aggregations_cardinality_aggregate, + types_aggregations_value_count_aggregate, + types_aggregations_string_terms_aggregate, + types_aggregations_long_terms_aggregate, + types_aggregations_double_terms_aggregate, + types_aggregations_unmapped_terms_aggregate, + types_aggregations_multi_terms_aggregate, + types_aggregations_missing_aggregate, + types_aggregations_filter_aggregate, + types_aggregations_filters_aggregate, + types_aggregations_range_aggregate, + types_aggregations_date_range_aggregate, + types_aggregations_composite_aggregate +]); + +export const security_query_user_query_user = security_types_user.and(z.object({ + _sort: z.optional(types_sort_results) +})); export const security_suggest_user_profiles_hint = z.object({ - uids: z.optional( - z.array(security_types_user_profile_id).register(z.globalRegistry, { - description: 'A list of profile UIDs to match against.', - }) - ), - labels: z.optional( - z.record(z.string(), z.union([z.string(), z.array(z.string())])).register(z.globalRegistry, { - description: - 'A single key-value pair to match against the labels section\nof a profile. A profile is considered matching if it matches\nat least one of the strings.', - }) - ), + uids: z.optional(z.array(security_types_user_profile_id).register(z.globalRegistry, { + description: 'A list of profile UIDs to match against.' + })), + labels: z.optional(z.record(z.string(), z.union([ + z.string(), + z.array(z.string()) + ])).register(z.globalRegistry, { + description: 'A single key-value pair to match against the labels section\nof a profile. A profile is considered matching if it matches\nat least one of the strings.' + })) }); export const security_suggest_user_profiles_total_user_profiles = z.object({ - value: z.number(), - relation: types_relation_name, + value: z.number(), + relation: types_relation_name }); export const simulate_ingest_merge_type = z.enum(['index', 'template']); export const slm_types_in_progress = z.object({ - name: types_name, - start_time_millis: types_epoch_time_unit_millis, - state: z.string(), - uuid: types_uuid, + name: types_name, + start_time_millis: types_epoch_time_unit_millis, + state: z.string(), + uuid: types_uuid }); export const slm_types_invocation = z.object({ - snapshot_name: types_name, - time: types_date_time, + snapshot_name: types_name, + time: types_date_time }); export const slm_types_configuration = z.object({ - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices.', - }) - ), - indices: z.optional(types_indices), - include_global_state: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the current global state is included in the snapshot.', - }) - ), - feature_states: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'A list of feature states to be included in this snapshot. A list of features available for inclusion in the snapshot and their descriptions be can be retrieved using the get features API.\nEach feature state includes one or more system indices containing data necessary for the function of that feature. Providing an empty array will include no feature states in the snapshot, regardless of the value of include_global_state. By default, all available feature states will be included in the snapshot if include_global_state is true, or no feature states if include_global_state is false.', - }) - ), - metadata: z.optional(types_metadata), - partial: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available.', - }) - ), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices.' + })), + indices: z.optional(types_indices), + include_global_state: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the current global state is included in the snapshot.' + })), + feature_states: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A list of feature states to be included in this snapshot. A list of features available for inclusion in the snapshot and their descriptions be can be retrieved using the get features API.\nEach feature state includes one or more system indices containing data necessary for the function of that feature. Providing an empty array will include no feature states in the snapshot, regardless of the value of include_global_state. By default, all available feature states will be included in the snapshot if include_global_state is true, or no feature states if include_global_state is false.' + })), + metadata: z.optional(types_metadata), + partial: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available.' + })) }); export const slm_types_retention = z.object({ - expire_after: types_duration, - max_count: z.number().register(z.globalRegistry, { - description: - 'Maximum number of snapshots to retain, even if the snapshots have not yet expired. If the number of snapshots in the repository exceeds this limit, the policy retains the most recent snapshots and deletes older snapshots.', - }), - min_count: z.number().register(z.globalRegistry, { - description: 'Minimum number of snapshots to retain, even if the snapshots have expired.', - }), + expire_after: types_duration, + max_count: z.number().register(z.globalRegistry, { + description: 'Maximum number of snapshots to retain, even if the snapshots have not yet expired. If the number of snapshots in the repository exceeds this limit, the policy retains the most recent snapshots and deletes older snapshots.' + }), + min_count: z.number().register(z.globalRegistry, { + description: 'Minimum number of snapshots to retain, even if the snapshots have expired.' + }) }); export const watcher_types_cron_expression = z.string(); export const slm_types_policy = z.object({ - config: z.optional(slm_types_configuration), - name: types_name, - repository: z.string(), - retention: z.optional(slm_types_retention), - schedule: watcher_types_cron_expression, + config: z.optional(slm_types_configuration), + name: types_name, + repository: z.string(), + retention: z.optional(slm_types_retention), + schedule: watcher_types_cron_expression }); export const slm_types_statistics = z.object({ - retention_deletion_time: z.optional(types_duration), - retention_deletion_time_millis: z.optional(types_duration_value_unit_millis), - retention_failed: z.optional(z.number()), - retention_runs: z.optional(z.number()), - retention_timed_out: z.optional(z.number()), - policy: z.optional(types_id), - total_snapshots_deleted: z.optional(z.number()), - total_snapshot_deletion_failures: z.optional(z.number()), - total_snapshots_failed: z.optional(z.number()), - total_snapshots_taken: z.optional(z.number()), + retention_deletion_time: z.optional(types_duration), + retention_deletion_time_millis: z.optional(types_duration_value_unit_millis), + retention_failed: z.optional(z.number()), + retention_runs: z.optional(z.number()), + retention_timed_out: z.optional(z.number()), + policy: z.optional(types_id), + total_snapshots_deleted: z.optional(z.number()), + total_snapshot_deletion_failures: z.optional(z.number()), + total_snapshots_failed: z.optional(z.number()), + total_snapshots_taken: z.optional(z.number()) }); export const slm_types_snapshot_lifecycle = z.object({ - in_progress: z.optional(slm_types_in_progress), - last_failure: z.optional(slm_types_invocation), - last_success: z.optional(slm_types_invocation), - modified_date: z.optional(types_date_time), - modified_date_millis: types_epoch_time_unit_millis, - next_execution: z.optional(types_date_time), - next_execution_millis: types_epoch_time_unit_millis, - policy: slm_types_policy, - version: types_version_number, - stats: slm_types_statistics, + in_progress: z.optional(slm_types_in_progress), + last_failure: z.optional(slm_types_invocation), + last_success: z.optional(slm_types_invocation), + modified_date: z.optional(types_date_time), + modified_date_millis: types_epoch_time_unit_millis, + next_execution: z.optional(types_date_time), + next_execution_millis: types_epoch_time_unit_millis, + policy: slm_types_policy, + version: types_version_number, + stats: slm_types_statistics }); export const slm_types_snapshot_policy_stats = z.object({ - policy: z.string(), - snapshots_taken: z.number(), - snapshots_failed: z.number(), - snapshots_deleted: z.number(), - snapshot_deletion_failures: z.number(), + policy: z.string(), + snapshots_taken: z.number(), + snapshots_failed: z.number(), + snapshots_deleted: z.number(), + snapshot_deletion_failures: z.number() }); export const snapshot_cleanup_repository_cleanup_repository_results = z.object({ - deleted_blobs: z.number().register(z.globalRegistry, { - description: - 'The number of binary large objects (blobs) removed from the snapshot repository during cleanup operations.\nA non-zero value indicates that unreferenced blobs were found and subsequently cleaned up.', - }), - deleted_bytes: z.number().register(z.globalRegistry, { - description: 'The number of bytes freed by cleanup operations.', - }), + deleted_blobs: z.number().register(z.globalRegistry, { + description: 'The number of binary large objects (blobs) removed from the snapshot repository during cleanup operations.\nA non-zero value indicates that unreferenced blobs were found and subsequently cleaned up.' + }), + deleted_bytes: z.number().register(z.globalRegistry, { + description: 'The number of bytes freed by cleanup operations.' + }) }); export const snapshot_types_snapshot_shard_failure = z.object({ - index: types_index_name, - node_id: z.optional(types_id), - reason: z.string(), - shard_id: z.number(), - index_uuid: types_id, - status: z.string(), + index: types_index_name, + node_id: z.optional(types_id), + reason: z.string(), + shard_id: z.number(), + index_uuid: types_id, + status: z.string() }); export const snapshot_types_index_details = z.object({ - shard_count: z.number(), - size: z.optional(types_byte_size), - size_in_bytes: z.number(), - max_segments_per_shard: z.number(), + shard_count: z.number(), + size: z.optional(types_byte_size), + size_in_bytes: z.number(), + max_segments_per_shard: z.number() }); export const snapshot_types_info_feature_state = z.object({ - feature_name: z.string(), - indices: types_indices, + feature_name: z.string(), + indices: types_indices }); export const snapshot_types_snapshot_info = z.object({ - data_streams: z.array(z.string()), - duration: z.optional(types_duration), - duration_in_millis: z.optional(types_duration_value_unit_millis), - end_time: z.optional(types_date_time), - end_time_in_millis: z.optional(types_epoch_time_unit_millis), - failures: z.optional(z.array(snapshot_types_snapshot_shard_failure)), - include_global_state: z.optional(z.boolean()), - indices: z.optional(z.array(types_index_name)), - index_details: z.optional(z.record(z.string(), snapshot_types_index_details)), - metadata: z.optional(types_metadata), - reason: z.optional(z.string()), - repository: z.optional(types_name), - snapshot: types_name, - shards: z.optional(types_shard_statistics), - start_time: z.optional(types_date_time), - start_time_in_millis: z.optional(types_epoch_time_unit_millis), - state: z.optional(z.string()), - uuid: types_uuid, - version: z.optional(types_version_string), - version_id: z.optional(types_version_number), - feature_states: z.optional(z.array(snapshot_types_info_feature_state)), + data_streams: z.array(z.string()), + duration: z.optional(types_duration), + duration_in_millis: z.optional(types_duration_value_unit_millis), + end_time: z.optional(types_date_time), + end_time_in_millis: z.optional(types_epoch_time_unit_millis), + failures: z.optional(z.array(snapshot_types_snapshot_shard_failure)), + include_global_state: z.optional(z.boolean()), + indices: z.optional(z.array(types_index_name)), + index_details: z.optional(z.record(z.string(), snapshot_types_index_details)), + metadata: z.optional(types_metadata), + reason: z.optional(z.string()), + repository: z.optional(types_name), + snapshot: types_name, + shards: z.optional(types_shard_statistics), + start_time: z.optional(types_date_time), + start_time_in_millis: z.optional(types_epoch_time_unit_millis), + state: z.optional(z.string()), + uuid: types_uuid, + version: z.optional(types_version_string), + version_id: z.optional(types_version_number), + feature_states: z.optional(z.array(snapshot_types_info_feature_state)) }); export const snapshot_types_repository_settings_base = z.object({ - chunk_size: z.optional(types_byte_size), - compress: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "When set to `true`, metadata files are stored in compressed format.\nThis setting doesn't affect index files that are already compressed by default.", - }) - ), - max_restore_bytes_per_sec: z.optional(types_byte_size), - max_snapshot_bytes_per_sec: z.optional(types_byte_size), -}); - -export const snapshot_types_azure_repository_settings = snapshot_types_repository_settings_base.and( - z.object({ - base_path: z.optional( - z.string().register(z.globalRegistry, { - description: - "The path to the repository data within the container.\nIt defaults to the root directory.\n\nNOTE: Don't set `base_path` when configuring a snapshot repository for Elastic Cloud Enterprise.\nElastic Cloud Enterprise automatically generates the `base_path` for each deployment so that multiple deployments can share the same bucket.", - }) - ), - client: z.optional( - z.string().register(z.globalRegistry, { - description: 'The name of the Azure repository client to use.', - }) - ), - container: z.optional( - z.string().register(z.globalRegistry, { - description: 'The Azure container.', - }) - ), - delete_objects_max_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maxmimum batch size, between 1 and 256, used for `BlobBatch` requests.\nDefaults to 256 which is the maximum number supported by the Azure blob batch API.', - }) - ), - location_mode: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Either `primary_only` or `secondary_only`.\nNote that if you set it to `secondary_only`, it will force `readonly` to `true`.', - }) - ), - max_concurrent_batch_deletes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of concurrent batch delete requests that will be submitted for any individual bulk delete with `BlobBatch`.\nNote that the effective number of concurrent deletes is further limited by the Azure client connection and event loop thread limits.\nDefaults to 10, minimum is 1, maximum is 100.', - }) - ), - readonly: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository.', - }) - ), - }) -); + chunk_size: z.optional(types_byte_size), + compress: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When set to `true`, metadata files are stored in compressed format.\nThis setting doesn\'t affect index files that are already compressed by default.' + })), + max_restore_bytes_per_sec: z.optional(types_byte_size), + max_snapshot_bytes_per_sec: z.optional(types_byte_size) +}); + +export const snapshot_types_azure_repository_settings = snapshot_types_repository_settings_base.and(z.object({ + base_path: z.optional(z.string().register(z.globalRegistry, { + description: 'The path to the repository data within the container.\nIt defaults to the root directory.\n\nNOTE: Don\'t set `base_path` when configuring a snapshot repository for Elastic Cloud Enterprise.\nElastic Cloud Enterprise automatically generates the `base_path` for each deployment so that multiple deployments can share the same bucket.' + })), + client: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the Azure repository client to use.' + })), + container: z.optional(z.string().register(z.globalRegistry, { + description: 'The Azure container.' + })), + delete_objects_max_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maxmimum batch size, between 1 and 256, used for `BlobBatch` requests.\nDefaults to 256 which is the maximum number supported by the Azure blob batch API.' + })), + location_mode: z.optional(z.string().register(z.globalRegistry, { + description: 'Either `primary_only` or `secondary_only`.\nNote that if you set it to `secondary_only`, it will force `readonly` to `true`.' + })), + max_concurrent_batch_deletes: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of concurrent batch delete requests that will be submitted for any individual bulk delete with `BlobBatch`.\nNote that the effective number of concurrent deletes is further limited by the Azure client connection and event loop thread limits.\nDefaults to 10, minimum is 1, maximum is 100.' + })), + readonly: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository.' + })) +})); export const snapshot_types_repository_base = z.object({ - uuid: z.optional(types_uuid), + uuid: z.optional(types_uuid) }); -export const snapshot_types_azure_repository = snapshot_types_repository_base.and( - z.object({ +export const snapshot_types_azure_repository = snapshot_types_repository_base.and(z.object({ type: z.enum(['azure']).register(z.globalRegistry, { - description: 'The Azure repository type.', + description: 'The Azure repository type.' }), - settings: z.optional(snapshot_types_azure_repository_settings), - }) -); + settings: z.optional(snapshot_types_azure_repository_settings) +})); -export const snapshot_types_gcs_repository_settings = snapshot_types_repository_settings_base.and( - z.object({ +export const snapshot_types_gcs_repository_settings = snapshot_types_repository_settings_base.and(z.object({ bucket: z.string().register(z.globalRegistry, { - description: 'The name of the bucket to be used for snapshots.', - }), - application_name: z.optional( - z.string().register(z.globalRegistry, { - description: 'The name used by the client when it uses the Google Cloud Storage service.', - }) - ), - base_path: z.optional( - z.string().register(z.globalRegistry, { - description: - "The path to the repository data within the bucket.\nIt defaults to the root of the bucket.\n\nNOTE: Don't set `base_path` when configuring a snapshot repository for Elastic Cloud Enterprise.\nElastic Cloud Enterprise automatically generates the `base_path` for each deployment so that multiple deployments can share the same bucket.", - }) - ), - client: z.optional( - z.string().register(z.globalRegistry, { - description: 'The name of the client to use to connect to Google Cloud Storage.', - }) - ), - readonly: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\n\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository.', - }) - ), - }) -); - -export const snapshot_types_gcs_repository = snapshot_types_repository_base.and( - z.object({ + description: 'The name of the bucket to be used for snapshots.' + }), + application_name: z.optional(z.string().register(z.globalRegistry, { + description: 'The name used by the client when it uses the Google Cloud Storage service.' + })), + base_path: z.optional(z.string().register(z.globalRegistry, { + description: 'The path to the repository data within the bucket.\nIt defaults to the root of the bucket.\n\nNOTE: Don\'t set `base_path` when configuring a snapshot repository for Elastic Cloud Enterprise.\nElastic Cloud Enterprise automatically generates the `base_path` for each deployment so that multiple deployments can share the same bucket.' + })), + client: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the client to use to connect to Google Cloud Storage.' + })), + readonly: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\n\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository.' + })) +})); + +export const snapshot_types_gcs_repository = snapshot_types_repository_base.and(z.object({ type: z.enum(['gcs']).register(z.globalRegistry, { - description: 'The Google Cloud Storage repository type.', + description: 'The Google Cloud Storage repository type.' }), - settings: snapshot_types_gcs_repository_settings, - }) -); + settings: snapshot_types_gcs_repository_settings +})); -export const snapshot_types_s3_repository_settings = snapshot_types_repository_settings_base.and( - z.object({ +export const snapshot_types_s3_repository_settings = snapshot_types_repository_settings_base.and(z.object({ bucket: z.string().register(z.globalRegistry, { - description: - "The name of the S3 bucket to use for snapshots.\nThe bucket name must adhere to Amazon's S3 bucket naming rules.", - }), - base_path: z.optional( - z.string().register(z.globalRegistry, { - description: - "The path to the repository data within its bucket.\nIt defaults to an empty string, meaning that the repository is at the root of the bucket.\nThe value of this setting should not start or end with a forward slash (`/`).\n\nNOTE: Don't set base_path when configuring a snapshot repository for Elastic Cloud Enterprise.\nElastic Cloud Enterprise automatically generates the `base_path` for each deployment so that multiple deployments may share the same bucket.", - }) - ), + description: 'The name of the S3 bucket to use for snapshots.\nThe bucket name must adhere to Amazon\'s S3 bucket naming rules.' + }), + base_path: z.optional(z.string().register(z.globalRegistry, { + description: 'The path to the repository data within its bucket.\nIt defaults to an empty string, meaning that the repository is at the root of the bucket.\nThe value of this setting should not start or end with a forward slash (`/`).\n\nNOTE: Don\'t set base_path when configuring a snapshot repository for Elastic Cloud Enterprise.\nElastic Cloud Enterprise automatically generates the `base_path` for each deployment so that multiple deployments may share the same bucket.' + })), buffer_size: z.optional(types_byte_size), - canned_acl: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The S3 repository supports all S3 canned ACLs: `private`, `public-read`, `public-read-write`, `authenticated-read`, `log-delivery-write`, `bucket-owner-read`, `bucket-owner-full-control`.\nYou could specify a canned ACL using the `canned_acl` setting.\nWhen the S3 repository creates buckets and objects, it adds the canned ACL into the buckets and objects.', - }) - ), - client: z.optional( - z.string().register(z.globalRegistry, { - description: 'The name of the S3 client to use to connect to S3.', - }) - ), - delete_objects_max_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maxmimum batch size, between 1 and 1000, used for `DeleteObjects` requests.\nDefaults to 1000 which is the maximum number supported by the AWS DeleteObjects API.', - }) - ), + canned_acl: z.optional(z.string().register(z.globalRegistry, { + description: 'The S3 repository supports all S3 canned ACLs: `private`, `public-read`, `public-read-write`, `authenticated-read`, `log-delivery-write`, `bucket-owner-read`, `bucket-owner-full-control`.\nYou could specify a canned ACL using the `canned_acl` setting.\nWhen the S3 repository creates buckets and objects, it adds the canned ACL into the buckets and objects.' + })), + client: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the S3 client to use to connect to S3.' + })), + delete_objects_max_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maxmimum batch size, between 1 and 1000, used for `DeleteObjects` requests.\nDefaults to 1000 which is the maximum number supported by the AWS DeleteObjects API.' + })), get_register_retry_delay: z.optional(types_duration), - max_multipart_parts: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of parts that Elasticsearch will write during a multipart upload of a single object.\nFiles which are larger than `buffer_size × max_multipart_parts` will be chunked into several smaller objects.\nElasticsearch may also split a file across multiple objects to satisfy other constraints such as the `chunk_size` limit.\nDefaults to `10000` which is the maximum number of parts in a multipart upload in AWS S3.', - }) - ), - max_multipart_upload_cleanup_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of possibly-dangling multipart uploads to clean up in each batch of snapshot deletions.\nDefaults to 1000 which is the maximum number supported by the AWS ListMultipartUploads API.\nIf set to `0`, Elasticsearch will not attempt to clean up dangling multipart uploads.', - }) - ), - readonly: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\n\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository.', - }) - ), - server_side_encryption: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When set to `true`, files are encrypted on server side using an AES256 algorithm.', - }) - ), - storage_class: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The S3 storage class for objects written to the repository.\nValues may be `standard`, `reduced_redundancy`, `standard_ia`, `onezone_ia`, and `intelligent_tiering`.', - }) - ), + max_multipart_parts: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of parts that Elasticsearch will write during a multipart upload of a single object.\nFiles which are larger than `buffer_size × max_multipart_parts` will be chunked into several smaller objects.\nElasticsearch may also split a file across multiple objects to satisfy other constraints such as the `chunk_size` limit.\nDefaults to `10000` which is the maximum number of parts in a multipart upload in AWS S3.' + })), + max_multipart_upload_cleanup_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of possibly-dangling multipart uploads to clean up in each batch of snapshot deletions.\nDefaults to 1000 which is the maximum number supported by the AWS ListMultipartUploads API.\nIf set to `0`, Elasticsearch will not attempt to clean up dangling multipart uploads.' + })), + readonly: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\n\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository.' + })), + server_side_encryption: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When set to `true`, files are encrypted on server side using an AES256 algorithm.' + })), + storage_class: z.optional(z.string().register(z.globalRegistry, { + description: 'The S3 storage class for objects written to the repository.\nValues may be `standard`, `reduced_redundancy`, `standard_ia`, `onezone_ia`, and `intelligent_tiering`.' + })), 'throttled_delete_retry.delay_increment': z.optional(types_duration), 'throttled_delete_retry.maximum_delay': z.optional(types_duration), - 'throttled_delete_retry.maximum_number_of_retries': z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number times to retry a throttled snapshot deletion.\nThe default is 10 and the minimum value is 0 which will disable retries altogether.\nNote that if retries are enabled in the Azure client, each of these retries comprises that many client-level retries.', - }) - ), - }) -); - -export const snapshot_types_s3_repository = snapshot_types_repository_base.and( - z.object({ + 'throttled_delete_retry.maximum_number_of_retries': z.optional(z.number().register(z.globalRegistry, { + description: 'The number times to retry a throttled snapshot deletion.\nThe default is 10 and the minimum value is 0 which will disable retries altogether.\nNote that if retries are enabled in the Azure client, each of these retries comprises that many client-level retries.' + })) +})); + +export const snapshot_types_s3_repository = snapshot_types_repository_base.and(z.object({ type: z.enum(['s3']).register(z.globalRegistry, { - description: 'The S3 repository type.', + description: 'The S3 repository type.' }), - settings: snapshot_types_s3_repository_settings, - }) -); - -export const snapshot_types_shared_file_system_repository_settings = - snapshot_types_repository_settings_base.and( - z.object({ - location: z.string().register(z.globalRegistry, { - description: - 'The location of the shared filesystem used to store and retrieve snapshots.\nThis location must be registered in the `path.repo` setting on all master and data nodes in the cluster.\nUnlike `path.repo`, this setting supports only a single file path.', - }), - max_number_of_snapshots: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of snapshots the repository can contain.\nThe default is `Integer.MAX_VALUE`, which is 2^31-1 or `2147483647`.', - }) - ), - readonly: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\n\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository.', - }) - ), - }) - ); + settings: snapshot_types_s3_repository_settings +})); -export const snapshot_types_shared_file_system_repository = snapshot_types_repository_base.and( - z.object({ +export const snapshot_types_shared_file_system_repository_settings = snapshot_types_repository_settings_base.and(z.object({ + location: z.string().register(z.globalRegistry, { + description: 'The location of the shared filesystem used to store and retrieve snapshots.\nThis location must be registered in the `path.repo` setting on all master and data nodes in the cluster.\nUnlike `path.repo`, this setting supports only a single file path.' + }), + max_number_of_snapshots: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of snapshots the repository can contain.\nThe default is `Integer.MAX_VALUE`, which is 2^31-1 or `2147483647`.' + })), + readonly: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\n\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository.' + })) +})); + +export const snapshot_types_shared_file_system_repository = snapshot_types_repository_base.and(z.object({ type: z.enum(['fs']).register(z.globalRegistry, { - description: 'The shared file system repository type.', + description: 'The shared file system repository type.' }), - settings: snapshot_types_shared_file_system_repository_settings, - }) -); - -export const snapshot_types_read_only_url_repository_settings = - snapshot_types_repository_settings_base.and( - z.object({ - http_max_retries: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of retries for HTTP and HTTPS URLs.', - }) - ), - http_socket_timeout: z.optional(types_duration), - max_number_of_snapshots: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of snapshots the repository can contain.\nThe default is `Integer.MAX_VALUE`, which is 2^31-1 or `2147483647`.', - }) - ), - url: z.string().register(z.globalRegistry, { - description: - "The URL location of the root of the shared filesystem repository.\nThe following protocols are supported:\n\n* `file`\n* `ftp`\n* `http`\n* `https`\n* `jar`\n\nURLs using the HTTP, HTTPS, or FTP protocols must be explicitly allowed with the `repositories.url.allowed_urls` cluster setting.\nThis setting supports wildcards in the place of a host, path, query, or fragment in the URL.\n\nURLs using the file protocol must point to the location of a shared filesystem accessible to all master and data nodes in the cluster.\nThis location must be registered in the `path.repo` setting.\nYou don't need to register URLs using the FTP, HTTP, HTTPS, or JAR protocols in the `path.repo` setting.", - }), - }) - ); - -export const snapshot_types_read_only_url_repository = snapshot_types_repository_base.and( - z.object({ + settings: snapshot_types_shared_file_system_repository_settings +})); + +export const snapshot_types_read_only_url_repository_settings = snapshot_types_repository_settings_base.and(z.object({ + http_max_retries: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of retries for HTTP and HTTPS URLs.' + })), + http_socket_timeout: z.optional(types_duration), + max_number_of_snapshots: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of snapshots the repository can contain.\nThe default is `Integer.MAX_VALUE`, which is 2^31-1 or `2147483647`.' + })), + url: z.string().register(z.globalRegistry, { + description: 'The URL location of the root of the shared filesystem repository.\nThe following protocols are supported:\n\n* `file`\n* `ftp`\n* `http`\n* `https`\n* `jar`\n\nURLs using the HTTP, HTTPS, or FTP protocols must be explicitly allowed with the `repositories.url.allowed_urls` cluster setting.\nThis setting supports wildcards in the place of a host, path, query, or fragment in the URL.\n\nURLs using the file protocol must point to the location of a shared filesystem accessible to all master and data nodes in the cluster.\nThis location must be registered in the `path.repo` setting.\nYou don\'t need to register URLs using the FTP, HTTP, HTTPS, or JAR protocols in the `path.repo` setting.' + }) +})); + +export const snapshot_types_read_only_url_repository = snapshot_types_repository_base.and(z.object({ type: z.enum(['url']).register(z.globalRegistry, { - description: 'The read-only URL repository type.', + description: 'The read-only URL repository type.' }), - settings: snapshot_types_read_only_url_repository_settings, - }) -); - -export const snapshot_types_source_only_repository_settings = - snapshot_types_repository_settings_base.and( - z.object({ - delegate_type: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The delegated repository type. For valid values, refer to the `type` parameter.\nSource repositories can use `settings` properties for its delegated repository type.', - }) - ), - max_number_of_snapshots: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of snapshots the repository can contain.\nThe default is `Integer.MAX_VALUE`, which is 2^31-1 or `2147483647`.', - }) - ), - read_only: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\n\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository.', - }) - ), - }) - ); - -export const snapshot_types_source_only_repository = snapshot_types_repository_base.and( - z.object({ + settings: snapshot_types_read_only_url_repository_settings +})); + +export const snapshot_types_source_only_repository_settings = snapshot_types_repository_settings_base.and(z.object({ + delegate_type: z.optional(z.string().register(z.globalRegistry, { + description: 'The delegated repository type. For valid values, refer to the `type` parameter.\nSource repositories can use `settings` properties for its delegated repository type.' + })), + max_number_of_snapshots: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of snapshots the repository can contain.\nThe default is `Integer.MAX_VALUE`, which is 2^31-1 or `2147483647`.' + })), + read_only: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the repository is read-only.\nThe cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.\n\nOnly a cluster with write access can create snapshots in the repository.\nAll other clusters connected to the repository should have the `readonly` parameter set to `true`.\n\nIf `false`, the cluster can write to the repository and create snapshots in it.\n\nIMPORTANT: If you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository.\nHaving multiple clusters write to the repository at the same time risks corrupting the contents of the repository.' + })) +})); + +export const snapshot_types_source_only_repository = snapshot_types_repository_base.and(z.object({ type: z.enum(['source']).register(z.globalRegistry, { - description: 'The source-only repository type.', + description: 'The source-only repository type.' }), - settings: snapshot_types_source_only_repository_settings, - }) -); + settings: snapshot_types_source_only_repository_settings +})); export const snapshot_types_repository = z.union([ - z - .object({ - type: z.literal('azure'), - }) - .and(snapshot_types_azure_repository), - z - .object({ - type: z.literal('gcs'), - }) - .and(snapshot_types_gcs_repository), - z - .object({ - type: z.literal('s3'), - }) - .and(snapshot_types_s3_repository), - z - .object({ - type: z.literal('fs'), - }) - .and(snapshot_types_shared_file_system_repository), - z - .object({ - type: z.literal('url'), - }) - .and(snapshot_types_read_only_url_repository), - z - .object({ - type: z.literal('source'), - }) - .and(snapshot_types_source_only_repository), + z.object({ + type: z.literal('azure') + }).and(snapshot_types_azure_repository), + z.object({ + type: z.literal('gcs') + }).and(snapshot_types_gcs_repository), + z.object({ + type: z.literal('s3') + }).and(snapshot_types_s3_repository), + z.object({ + type: z.literal('fs') + }).and(snapshot_types_shared_file_system_repository), + z.object({ + type: z.literal('url') + }).and(snapshot_types_read_only_url_repository), + z.object({ + type: z.literal('source') + }).and(snapshot_types_source_only_repository) ]); export const snapshot_types_snapshot_sort = z.enum([ - 'start_time', - 'duration', - 'name', - 'index_count', - 'repository', - 'shard_count', - 'failed_shard_count', + 'start_time', + 'duration', + 'name', + 'index_count', + 'repository', + 'shard_count', + 'failed_shard_count' ]); export const snapshot_types_snapshot_state = z.enum([ - 'IN_PROGRESS', - 'SUCCESS', - 'FAILED', - 'PARTIAL', - 'INCOMPATIBLE', + 'IN_PROGRESS', + 'SUCCESS', + 'FAILED', + 'PARTIAL', + 'INCOMPATIBLE' ]); export const snapshot_get_snapshot_response_item = z.object({ - repository: types_name, - snapshots: z.optional(z.array(snapshot_types_snapshot_info)), - error: z.optional(types_error_cause), + repository: types_name, + snapshots: z.optional(z.array(snapshot_types_snapshot_info)), + error: z.optional(types_error_cause) }); export const snapshot_repository_analyze_snapshot_node_info = z.object({ - id: types_id, - name: types_name, + id: types_id, + name: types_name }); export const snapshot_repository_analyze_read_blob_details = z.object({ - before_write_complete: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether the read operation may have started before the write operation was complete.', - }) - ), - elapsed: z.optional(types_duration), - elapsed_nanos: z.optional(types_duration_value_unit_nanos), - first_byte_time: z.optional(types_duration), - first_byte_time_nanos: types_duration_value_unit_nanos, - found: z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether the blob was found by the read operation.\nIf the read was started before the write completed or the write was ended before completion, it might be false.', - }), - node: snapshot_repository_analyze_snapshot_node_info, - throttled: z.optional(types_duration), - throttled_nanos: z.optional(types_duration_value_unit_nanos), + before_write_complete: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the read operation may have started before the write operation was complete.' + })), + elapsed: z.optional(types_duration), + elapsed_nanos: z.optional(types_duration_value_unit_nanos), + first_byte_time: z.optional(types_duration), + first_byte_time_nanos: types_duration_value_unit_nanos, + found: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the blob was found by the read operation.\nIf the read was started before the write completed or the write was ended before completion, it might be false.' + }), + node: snapshot_repository_analyze_snapshot_node_info, + throttled: z.optional(types_duration), + throttled_nanos: z.optional(types_duration_value_unit_nanos) }); export const snapshot_repository_analyze_blob_details = z.object({ - name: z.string().register(z.globalRegistry, { - description: 'The name of the blob.', - }), - overwritten: z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether the blob was overwritten while the read operations were ongoing.\n /**', - }), - read_early: z.boolean(), - read_end: z.number().register(z.globalRegistry, { - description: 'The position, in bytes, at which read operations completed.', - }), - read_start: z.number().register(z.globalRegistry, { - description: 'The position, in bytes, at which read operations started.', - }), - reads: snapshot_repository_analyze_read_blob_details, - size: types_byte_size, - size_bytes: z.number().register(z.globalRegistry, { - description: 'The size of the blob in bytes.', - }), + name: z.string().register(z.globalRegistry, { + description: 'The name of the blob.' + }), + overwritten: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the blob was overwritten while the read operations were ongoing.\n /**' + }), + read_early: z.boolean(), + read_end: z.number().register(z.globalRegistry, { + description: 'The position, in bytes, at which read operations completed.' + }), + read_start: z.number().register(z.globalRegistry, { + description: 'The position, in bytes, at which read operations started.' + }), + reads: snapshot_repository_analyze_read_blob_details, + size: types_byte_size, + size_bytes: z.number().register(z.globalRegistry, { + description: 'The size of the blob in bytes.' + }) }); export const snapshot_repository_analyze_details_info = z.object({ - blob: snapshot_repository_analyze_blob_details, - overwrite_elapsed: z.optional(types_duration), - overwrite_elapsed_nanos: z.optional(types_duration_value_unit_nanos), - write_elapsed: types_duration, - write_elapsed_nanos: types_duration_value_unit_nanos, - write_throttled: types_duration, - write_throttled_nanos: types_duration_value_unit_nanos, - writer_node: snapshot_repository_analyze_snapshot_node_info, + blob: snapshot_repository_analyze_blob_details, + overwrite_elapsed: z.optional(types_duration), + overwrite_elapsed_nanos: z.optional(types_duration_value_unit_nanos), + write_elapsed: types_duration, + write_elapsed_nanos: types_duration_value_unit_nanos, + write_throttled: types_duration, + write_throttled_nanos: types_duration_value_unit_nanos, + writer_node: snapshot_repository_analyze_snapshot_node_info }); export const snapshot_repository_analyze_read_summary_info = z.object({ - count: z.number().register(z.globalRegistry, { - description: 'The number of read operations performed in the test.', - }), - max_wait: types_duration, - max_wait_nanos: types_duration_value_unit_nanos, - total_elapsed: types_duration, - total_elapsed_nanos: types_duration_value_unit_nanos, - total_size: types_byte_size, - total_size_bytes: z.number().register(z.globalRegistry, { - description: 'The total size of all the blobs or partial blobs read in the test, in bytes.', - }), - total_throttled: types_duration, - total_throttled_nanos: types_duration_value_unit_nanos, - total_wait: types_duration, - total_wait_nanos: types_duration_value_unit_nanos, + count: z.number().register(z.globalRegistry, { + description: 'The number of read operations performed in the test.' + }), + max_wait: types_duration, + max_wait_nanos: types_duration_value_unit_nanos, + total_elapsed: types_duration, + total_elapsed_nanos: types_duration_value_unit_nanos, + total_size: types_byte_size, + total_size_bytes: z.number().register(z.globalRegistry, { + description: 'The total size of all the blobs or partial blobs read in the test, in bytes.' + }), + total_throttled: types_duration, + total_throttled_nanos: types_duration_value_unit_nanos, + total_wait: types_duration, + total_wait_nanos: types_duration_value_unit_nanos }); export const snapshot_repository_analyze_write_summary_info = z.object({ - count: z.number().register(z.globalRegistry, { - description: 'The number of write operations performed in the test.', - }), - total_elapsed: types_duration, - total_elapsed_nanos: types_duration_value_unit_nanos, - total_size: types_byte_size, - total_size_bytes: z.number().register(z.globalRegistry, { - description: 'The total size of all the blobs written in the test, in bytes.', - }), - total_throttled: types_duration, - total_throttled_nanos: z.number().register(z.globalRegistry, { - description: - 'The total time spent waiting due to the `max_snapshot_bytes_per_sec` throttle, in nanoseconds.', - }), + count: z.number().register(z.globalRegistry, { + description: 'The number of write operations performed in the test.' + }), + total_elapsed: types_duration, + total_elapsed_nanos: types_duration_value_unit_nanos, + total_size: types_byte_size, + total_size_bytes: z.number().register(z.globalRegistry, { + description: 'The total size of all the blobs written in the test, in bytes.' + }), + total_throttled: types_duration, + total_throttled_nanos: z.number().register(z.globalRegistry, { + description: 'The total time spent waiting due to the `max_snapshot_bytes_per_sec` throttle, in nanoseconds.' + }) }); export const snapshot_repository_analyze_summary_info = z.object({ - read: snapshot_repository_analyze_read_summary_info, - write: snapshot_repository_analyze_write_summary_info, + read: snapshot_repository_analyze_read_summary_info, + write: snapshot_repository_analyze_write_summary_info }); export const snapshot_restore_snapshot_restore = z.object({ - indices: z.array(types_index_name), - snapshot: z.string(), - shards: types_shard_statistics, + indices: z.array(types_index_name), + snapshot: z.string(), + shards: types_shard_statistics }); export const snapshot_types_shards_stats_stage = z.enum([ - 'DONE', - 'FAILURE', - 'FINALIZE', - 'INIT', - 'STARTED', + 'DONE', + 'FAILURE', + 'FINALIZE', + 'INIT', + 'STARTED' ]); export const snapshot_types_shards_stats_summary_item = z.object({ - file_count: z.number(), - size_in_bytes: z.number(), + file_count: z.number(), + size_in_bytes: z.number() }); export const snapshot_types_shards_stats_summary = z.object({ - incremental: snapshot_types_shards_stats_summary_item, - total: snapshot_types_shards_stats_summary_item, - start_time_in_millis: types_epoch_time_unit_millis, - time: z.optional(types_duration), - time_in_millis: types_duration_value_unit_millis, + incremental: snapshot_types_shards_stats_summary_item, + total: snapshot_types_shards_stats_summary_item, + start_time_in_millis: types_epoch_time_unit_millis, + time: z.optional(types_duration), + time_in_millis: types_duration_value_unit_millis }); export const snapshot_types_snapshot_shards_status = z.object({ - stage: snapshot_types_shards_stats_stage, - stats: snapshot_types_shards_stats_summary, + stage: snapshot_types_shards_stats_stage, + stats: snapshot_types_shards_stats_summary }); export const snapshot_types_shards_stats = z.object({ - done: z.number().register(z.globalRegistry, { - description: 'The number of shards that initialized, started, and finalized successfully.', - }), - failed: z.number().register(z.globalRegistry, { - description: 'The number of shards that failed to be included in the snapshot.', - }), - finalizing: z.number().register(z.globalRegistry, { - description: 'The number of shards that are finalizing but are not done.', - }), - initializing: z.number().register(z.globalRegistry, { - description: 'The number of shards that are still initializing.', - }), - started: z.number().register(z.globalRegistry, { - description: 'The number of shards that have started but are not finalized.', - }), - total: z.number().register(z.globalRegistry, { - description: 'The total number of shards included in the snapshot.', - }), + done: z.number().register(z.globalRegistry, { + description: 'The number of shards that initialized, started, and finalized successfully.' + }), + failed: z.number().register(z.globalRegistry, { + description: 'The number of shards that failed to be included in the snapshot.' + }), + finalizing: z.number().register(z.globalRegistry, { + description: 'The number of shards that are finalizing but are not done.' + }), + initializing: z.number().register(z.globalRegistry, { + description: 'The number of shards that are still initializing.' + }), + started: z.number().register(z.globalRegistry, { + description: 'The number of shards that have started but are not finalized.' + }), + total: z.number().register(z.globalRegistry, { + description: 'The total number of shards included in the snapshot.' + }) }); export const snapshot_types_file_count_snapshot_stats = z.object({ - file_count: z.number(), - size_in_bytes: z.number(), + file_count: z.number(), + size_in_bytes: z.number() }); export const snapshot_types_snapshot_stats = z.object({ - incremental: snapshot_types_file_count_snapshot_stats, - start_time_in_millis: types_epoch_time_unit_millis, - time: z.optional(types_duration), - time_in_millis: types_duration_value_unit_millis, - total: snapshot_types_file_count_snapshot_stats, + incremental: snapshot_types_file_count_snapshot_stats, + start_time_in_millis: types_epoch_time_unit_millis, + time: z.optional(types_duration), + time_in_millis: types_duration_value_unit_millis, + total: snapshot_types_file_count_snapshot_stats }); export const snapshot_types_snapshot_index_stats = z.object({ - shards: z.record(z.string(), snapshot_types_snapshot_shards_status), - shards_stats: snapshot_types_shards_stats, - stats: snapshot_types_snapshot_stats, + shards: z.record(z.string(), snapshot_types_snapshot_shards_status), + shards_stats: snapshot_types_shards_stats, + stats: snapshot_types_snapshot_stats }); export const snapshot_types_status = z.object({ - include_global_state: z.boolean().register(z.globalRegistry, { - description: 'Indicates whether the current cluster state is included in the snapshot.', - }), - indices: z.record(z.string(), snapshot_types_snapshot_index_stats), - repository: z.string().register(z.globalRegistry, { - description: 'The name of the repository that includes the snapshot.', - }), - shards_stats: snapshot_types_shards_stats, - snapshot: z.string().register(z.globalRegistry, { - description: 'The name of the snapshot.', - }), - state: z.string().register(z.globalRegistry, { - description: - 'The current snapshot state:\n\n* `FAILED`: The snapshot finished with an error and failed to store any data.\n* `STARTED`: The snapshot is currently running.\n* `SUCCESS`: The snapshot completed.', - }), - stats: snapshot_types_snapshot_stats, - uuid: types_uuid, + include_global_state: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the current cluster state is included in the snapshot.' + }), + indices: z.record(z.string(), snapshot_types_snapshot_index_stats), + repository: z.string().register(z.globalRegistry, { + description: 'The name of the repository that includes the snapshot.' + }), + shards_stats: snapshot_types_shards_stats, + snapshot: z.string().register(z.globalRegistry, { + description: 'The name of the snapshot.' + }), + state: z.string().register(z.globalRegistry, { + description: 'The current snapshot state:\n\n* `FAILED`: The snapshot finished with an error and failed to store any data.\n* `STARTED`: The snapshot is currently running.\n* `SUCCESS`: The snapshot completed.' + }), + stats: snapshot_types_snapshot_stats, + uuid: types_uuid }); export const snapshot_verify_repository_compact_node_info = z.object({ - name: types_name, + name: types_name }); export const sql_types_column = z.object({ - name: types_name, - type: z.string(), + name: types_name, + type: z.string() }); export const sql_types_row = z.array(z.record(z.string(), z.unknown())); -export const sql_query_sql_format = z.enum(['csv', 'json', 'tsv', 'txt', 'yaml', 'cbor', 'smile']); +export const sql_query_sql_format = z.enum([ + 'csv', + 'json', + 'tsv', + 'txt', + 'yaml', + 'cbor', + 'smile' +]); export const ssl_certificates_certificate_information = z.object({ - alias: z.union([z.string(), z.null()]), - expiry: types_date_time, - format: z.string().register(z.globalRegistry, { - description: 'The format of the file.\nValid values include `jks`, `PKCS12`, and `PEM`.', - }), - has_private_key: z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether Elasticsearch has access to the private key for this certificate.', - }), - issuer: z.optional( - z.string().register(z.globalRegistry, { - description: "The Distinguished Name of the certificate's issuer.", + alias: z.union([ + z.string(), + z.null() + ]), + expiry: types_date_time, + format: z.string().register(z.globalRegistry, { + description: 'The format of the file.\nValid values include `jks`, `PKCS12`, and `PEM`.' + }), + has_private_key: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether Elasticsearch has access to the private key for this certificate.' + }), + issuer: z.optional(z.string().register(z.globalRegistry, { + description: 'The Distinguished Name of the certificate\'s issuer.' + })), + path: z.string().register(z.globalRegistry, { + description: 'The path to the certificate, as configured in the `elasticsearch.yml` file.' + }), + serial_number: z.string().register(z.globalRegistry, { + description: 'The hexadecimal representation of the certificate\'s serial number.' + }), + subject_dn: z.string().register(z.globalRegistry, { + description: 'The Distinguished Name of the certificate\'s subject.' }) - ), - path: z.string().register(z.globalRegistry, { - description: 'The path to the certificate, as configured in the `elasticsearch.yml` file.', - }), - serial_number: z.string().register(z.globalRegistry, { - description: "The hexadecimal representation of the certificate's serial number.", - }), - subject_dn: z.string().register(z.globalRegistry, { - description: "The Distinguished Name of the certificate's subject.", - }), }); export const synonyms_types_synonyms_update_result = z.object({ - result: types_result, - reload_analyzers_details: z.optional(indices_reload_search_analyzers_reload_result), + result: types_result, + reload_analyzers_details: z.optional(indices_reload_search_analyzers_reload_result) }); export const synonyms_types_synonym_string = z.string(); export const synonyms_types_synonym_rule_read = z.object({ - id: types_id, - synonyms: synonyms_types_synonym_string, + id: types_id, + synonyms: synonyms_types_synonym_string }); export const synonyms_get_synonyms_sets_synonyms_set_item = z.object({ - synonyms_set: types_id, - count: z.number().register(z.globalRegistry, { - description: 'Number of synonym rules that the synonym set contains', - }), + synonyms_set: types_id, + count: z.number().register(z.globalRegistry, { + description: 'Number of synonym rules that the synonym set contains' + }) }); export const synonyms_types_synonym_rule = z.object({ - id: z.optional(types_id), - synonyms: synonyms_types_synonym_string, + id: z.optional(types_id), + synonyms: synonyms_types_synonym_string }); -export const tasks_types_group_by = z.enum(['nodes', 'parents', 'none']); +export const tasks_types_group_by = z.enum([ + 'nodes', + 'parents', + 'none' +]); export const text_structure_types_ecs_compatibility_type = z.enum(['disabled', 'v1']); export const text_structure_types_format_type = z.enum([ - 'delimited', - 'ndjson', - 'semi_structured_text', - 'xml', + 'delimited', + 'ndjson', + 'semi_structured_text', + 'xml' ]); export const text_structure_types_top_hit = z.object({ - count: z.number(), - value: z.record(z.string(), z.unknown()), + count: z.number(), + value: z.record(z.string(), z.unknown()) }); export const text_structure_types_field_stat = z.object({ - count: z.number(), - cardinality: z.number(), - top_hits: z.array(text_structure_types_top_hit), - mean_value: z.optional(z.number()), - median_value: z.optional(z.number()), - max_value: z.optional(z.number()), - min_value: z.optional(z.number()), - earliest: z.optional(z.string()), - latest: z.optional(z.string()), + count: z.number(), + cardinality: z.number(), + top_hits: z.array(text_structure_types_top_hit), + mean_value: z.optional(z.number()), + median_value: z.optional(z.number()), + max_value: z.optional(z.number()), + min_value: z.optional(z.number()), + earliest: z.optional(z.string()), + latest: z.optional(z.string()) }); export const text_structure_find_structure_find_structure_format = z.enum([ - 'ndjson', - 'xml', - 'delimited', - 'semi_structured_text', + 'ndjson', + 'xml', + 'delimited', + 'semi_structured_text' ]); export const text_structure_test_grok_pattern_matched_field = z.object({ - match: z.string(), - offset: z.number(), - length: z.number(), + match: z.string(), + offset: z.number(), + length: z.number() }); export const text_structure_test_grok_pattern_matched_text = z.object({ - matched: z.boolean(), - fields: z.optional(z.record(z.string(), z.array(text_structure_test_grok_pattern_matched_field))), + matched: z.boolean(), + fields: z.optional(z.record(z.string(), z.array(text_structure_test_grok_pattern_matched_field))) }); -export const transform_get_node_stats_transform_node_stats_details = z.object({ - registered_transform_count: z.number(), - peek_transform: z.optional(z.string()), +export const transform_get_node_stats_transform_scheduler_stats = z.object({ + registered_transform_count: z.number(), + peek_transform: z.optional(z.string()) }); -export const transform_get_node_stats_scheduler = z.object({ - scheduler: transform_get_node_stats_transform_node_stats_details, +export const transform_get_node_stats_transform_node_stats = z.object({ + scheduler: transform_get_node_stats_transform_scheduler_stats }); -export const transform_get_node_stats_transform_node_stats = z.object({ - total: transform_get_node_stats_scheduler, +export const transform_get_node_stats_transform_node_full_stats = z.object({ + total: transform_get_node_stats_transform_node_stats }); export const ml_types_transform_authorization = z.object({ - api_key: z.optional(ml_types_api_key_authorization), - roles: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'If a user ID was used for the most recent update to the transform, its roles at the time of the update are listed in the response.', - }) - ), - service_account: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If a service account was used for the most recent update to the transform, the account name is listed in the response.', - }) - ), + api_key: z.optional(ml_types_api_key_authorization), + roles: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'If a user ID was used for the most recent update to the transform, its roles at the time of the update are listed in the response.' + })), + service_account: z.optional(z.string().register(z.globalRegistry, { + description: 'If a service account was used for the most recent update to the transform, the account name is listed in the response.' + })) }); export const transform_types_latest = z.object({ - sort: types_field, - unique_key: z.array(types_field).register(z.globalRegistry, { - description: 'Specifies an array of one or more fields that are used to group the data.', - }), + sort: types_field, + unique_key: z.array(types_field).register(z.globalRegistry, { + description: 'Specifies an array of one or more fields that are used to group the data.' + }) }); export const transform_types_retention_policy = z.object({ - field: types_field, - max_age: types_duration, + field: types_field, + max_age: types_duration }); export const transform_types_retention_policy_container = z.object({ - time: z.optional(transform_types_retention_policy), + time: z.optional(transform_types_retention_policy) }); /** * The source of the data for the transform. */ -export const transform_types_settings = z - .object({ - align_checkpoints: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether the transform checkpoint ranges should be optimized for performance. Such optimization can align\ncheckpoint ranges with the date histogram interval when date histogram is specified as a group source in the\ntransform config. As a result, less document updates in the destination index will be performed thus improving\noverall performance.', - }) - ), - dates_as_epoch_millis: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Defines if dates in the ouput should be written as ISO formatted string or as millis since epoch. epoch_millis was\nthe default for transforms created before version 7.11. For compatible output set this value to `true`.', - }) - ), - deduce_mappings: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether the transform should deduce the destination index mappings from the transform configuration.', - }) - ), - docs_per_second: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Specifies a limit on the number of input documents per second. This setting throttles the transform by adding a\nwait time between search requests. The default value is null, which disables throttling.', - }) - ), - max_page_search_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Defines the initial page size to use for the composite aggregation for each checkpoint. If circuit breaker\nexceptions occur, the page size is dynamically adjusted to a lower value. The minimum value is `10` and the\nmaximum is `65,536`.', - }) - ), - use_point_in_time: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether the transform checkpoint will use the Point In Time API while searching over the source index.\nIn general, Point In Time is an optimization that will reduce pressure on the source index by reducing the amount\nof refreshes and merges, but it can be expensive if a large number of Point In Times are opened and closed for a\ngiven index. The benefits and impact depend on the data being searched, the ingest rate into the source index, and\nthe amount of other consumers searching the same source index.', - }) - ), - unattended: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the transform runs in unattended mode. In unattended mode, the transform retries indefinitely in case\nof an error which means the transform never fails. Setting the number of retries other than infinite fails in\nvalidation.', - }) - ), - }) - .register(z.globalRegistry, { - description: 'The source of the data for the transform.', - }); +export const transform_types_settings = z.object({ + align_checkpoints: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether the transform checkpoint ranges should be optimized for performance. Such optimization can align\ncheckpoint ranges with the date histogram interval when date histogram is specified as a group source in the\ntransform config. As a result, less document updates in the destination index will be performed thus improving\noverall performance.' + })), + dates_as_epoch_millis: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Defines if dates in the ouput should be written as ISO formatted string or as millis since epoch. epoch_millis was\nthe default for transforms created before version 7.11. For compatible output set this value to `true`.' + })), + deduce_mappings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether the transform should deduce the destination index mappings from the transform configuration.' + })), + docs_per_second: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies a limit on the number of input documents per second. This setting throttles the transform by adding a\nwait time between search requests. The default value is null, which disables throttling.' + })), + max_page_search_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Defines the initial page size to use for the composite aggregation for each checkpoint. If circuit breaker\nexceptions occur, the page size is dynamically adjusted to a lower value. The minimum value is `10` and the\nmaximum is `65,536`.' + })), + use_point_in_time: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether the transform checkpoint will use the Point In Time API while searching over the source index.\nIn general, Point In Time is an optimization that will reduce pressure on the source index by reducing the amount\nof refreshes and merges, but it can be expensive if a large number of Point In Times are opened and closed for a\ngiven index. The benefits and impact depend on the data being searched, the ingest rate into the source index, and\nthe amount of other consumers searching the same source index.' + })), + unattended: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the transform runs in unattended mode. In unattended mode, the transform retries indefinitely in case\nof an error which means the transform never fails. Setting the number of retries other than infinite fails in\nvalidation.' + })) +}).register(z.globalRegistry, { + description: 'The source of the data for the transform.' +}); export const transform_types_time_sync = z.object({ - delay: z.optional(types_duration), - field: types_field, + delay: z.optional(types_duration), + field: types_field }); export const transform_types_sync_container = z.object({ - time: z.optional(transform_types_time_sync), + time: z.optional(transform_types_time_sync) }); export const transform_get_transform_stats_transform_progress = z.object({ - docs_indexed: z.number(), - docs_processed: z.number(), - docs_remaining: z.optional(z.number()), - percent_complete: z.optional(z.number()), - total_docs: z.optional(z.number()), + docs_indexed: z.number(), + docs_processed: z.number(), + docs_remaining: z.optional(z.number()), + percent_complete: z.optional(z.number()), + total_docs: z.optional(z.number()) }); export const transform_get_transform_stats_checkpoint_stats = z.object({ - checkpoint: z.number(), - checkpoint_progress: z.optional(transform_get_transform_stats_transform_progress), - timestamp: z.optional(types_date_time), - timestamp_millis: z.optional(types_epoch_time_unit_millis), - time_upper_bound: z.optional(types_date_time), - time_upper_bound_millis: z.optional(types_epoch_time_unit_millis), + checkpoint: z.number(), + checkpoint_progress: z.optional(transform_get_transform_stats_transform_progress), + timestamp: z.optional(types_date_time), + timestamp_millis: z.optional(types_epoch_time_unit_millis), + time_upper_bound: z.optional(types_date_time), + time_upper_bound_millis: z.optional(types_epoch_time_unit_millis) }); export const transform_get_transform_stats_checkpointing = z.object({ - changes_last_detected_at: z.optional(z.number()), - changes_last_detected_at_string: z.optional(types_date_time), - last: transform_get_transform_stats_checkpoint_stats, - next: z.optional(transform_get_transform_stats_checkpoint_stats), - operations_behind: z.optional(z.number()), - last_search_time: z.optional(z.number()), - last_search_time_string: z.optional(types_date_time), + changes_last_detected_at: z.optional(z.number()), + changes_last_detected_at_string: z.optional(types_date_time), + last: transform_get_transform_stats_checkpoint_stats, + next: z.optional(transform_get_transform_stats_checkpoint_stats), + operations_behind: z.optional(z.number()), + last_search_time: z.optional(z.number()), + last_search_time_string: z.optional(types_date_time) }); export const transform_get_transform_stats_transform_health_issue = z.object({ - type: z.string().register(z.globalRegistry, { - description: 'The type of the issue', - }), - issue: z.string().register(z.globalRegistry, { - description: 'A description of the issue', - }), - details: z.optional( - z.string().register(z.globalRegistry, { - description: 'Details about the issue', - }) - ), - count: z.number().register(z.globalRegistry, { - description: 'Number of times this issue has occurred since it started', - }), - first_occurrence: z.optional(types_epoch_time_unit_millis), - first_occurence_string: z.optional(types_date_time), + type: z.string().register(z.globalRegistry, { + description: 'The type of the issue' + }), + issue: z.string().register(z.globalRegistry, { + description: 'A description of the issue' + }), + details: z.optional(z.string().register(z.globalRegistry, { + description: 'Details about the issue' + })), + count: z.number().register(z.globalRegistry, { + description: 'Number of times this issue has occurred since it started' + }), + first_occurrence: z.optional(types_epoch_time_unit_millis), + first_occurence_string: z.optional(types_date_time) }); export const transform_get_transform_stats_transform_stats_health = z.object({ - status: types_health_status, - issues: z.optional( - z.array(transform_get_transform_stats_transform_health_issue).register(z.globalRegistry, { - description: - 'If a non-healthy status is returned, contains a list of issues of the transform.', - }) - ), + status: types_health_status, + issues: z.optional(z.array(transform_get_transform_stats_transform_health_issue).register(z.globalRegistry, { + description: 'If a non-healthy status is returned, contains a list of issues of the transform.' + })) }); export const transform_get_transform_stats_transform_indexer_stats = z.object({ - delete_time_in_ms: z.optional(types_epoch_time_unit_millis), - documents_indexed: z.number(), - documents_deleted: z.optional(z.number()), - documents_processed: z.number(), - exponential_avg_checkpoint_duration_ms: types_duration_value_unit_float_millis, - exponential_avg_documents_indexed: z.number(), - exponential_avg_documents_processed: z.number(), - index_failures: z.number(), - index_time_in_ms: types_duration_value_unit_millis, - index_total: z.number(), - pages_processed: z.number(), - processing_time_in_ms: types_duration_value_unit_millis, - processing_total: z.number(), - search_failures: z.number(), - search_time_in_ms: types_duration_value_unit_millis, - search_total: z.number(), - trigger_count: z.number(), + delete_time_in_ms: z.optional(types_epoch_time_unit_millis), + documents_indexed: z.number(), + documents_deleted: z.optional(z.number()), + documents_processed: z.number(), + exponential_avg_checkpoint_duration_ms: types_duration_value_unit_float_millis, + exponential_avg_documents_indexed: z.number(), + exponential_avg_documents_processed: z.number(), + index_failures: z.number(), + index_time_in_ms: types_duration_value_unit_millis, + index_total: z.number(), + pages_processed: z.number(), + processing_time_in_ms: types_duration_value_unit_millis, + processing_total: z.number(), + search_failures: z.number(), + search_time_in_ms: types_duration_value_unit_millis, + search_total: z.number(), + trigger_count: z.number() }); export const transform_get_transform_stats_transform_stats = z.object({ - checkpointing: transform_get_transform_stats_checkpointing, - health: z.optional(transform_get_transform_stats_transform_stats_health), - id: types_id, - node: z.optional(types_node_attributes), - reason: z.optional(z.string()), - state: z.string(), - stats: transform_get_transform_stats_transform_indexer_stats, + checkpointing: transform_get_transform_stats_checkpointing, + health: z.optional(transform_get_transform_stats_transform_stats_health), + id: types_id, + node: z.optional(types_node_attributes), + reason: z.optional(z.string()), + state: z.string(), + stats: transform_get_transform_stats_transform_indexer_stats }); export const transform_types_destination = z.object({ - index: z.optional(types_index_name), - pipeline: z.optional( - z.string().register(z.globalRegistry, { - description: 'The unique identifier for an ingest pipeline.', - }) - ), + index: z.optional(types_index_name), + pipeline: z.optional(z.string().register(z.globalRegistry, { + description: 'The unique identifier for an ingest pipeline.' + })) }); -export const global_update_update_write_response_base = types_write_response_base.and( - z.object({ - get: z.optional(types_inline_get), - }) -); +export const global_update_update_write_response_base = types_write_response_base.and(z.object({ + get: z.optional(types_inline_get) +})); -export const global_update_by_query_rethrottle_update_by_query_rethrottle_node = - spec_utils_base_node.and( - z.object({ - tasks: z.record(z.string(), tasks_types_task_info), - }) - ); +export const global_update_by_query_rethrottle_update_by_query_rethrottle_node = spec_utils_base_node.and(z.object({ + tasks: z.record(z.string(), tasks_types_task_info) +})); export const watcher_types_acknowledgement_options = z.enum([ - 'awaits_successful_execution', - 'ackable', - 'acked', + 'awaits_successful_execution', + 'ackable', + 'acked' ]); export const watcher_types_acknowledge_state = z.object({ - state: watcher_types_acknowledgement_options, - timestamp: types_date_time, + state: watcher_types_acknowledgement_options, + timestamp: types_date_time }); export const watcher_types_execution_state = z.object({ - successful: z.boolean(), - timestamp: types_date_time, - reason: z.optional(z.string()), + successful: z.boolean(), + timestamp: types_date_time, + reason: z.optional(z.string()) }); export const watcher_types_throttle_state = z.object({ - reason: z.string(), - timestamp: types_date_time, + reason: z.string(), + timestamp: types_date_time }); export const watcher_types_action_status = z.object({ - ack: watcher_types_acknowledge_state, - last_execution: z.optional(watcher_types_execution_state), - last_successful_execution: z.optional(watcher_types_execution_state), - last_throttle: z.optional(watcher_types_throttle_state), + ack: watcher_types_acknowledge_state, + last_execution: z.optional(watcher_types_execution_state), + last_successful_execution: z.optional(watcher_types_execution_state), + last_throttle: z.optional(watcher_types_throttle_state) }); export const watcher_types_actions = z.record(z.string(), watcher_types_action_status); export const watcher_types_activation_state = z.object({ - active: z.boolean(), - timestamp: types_date_time, + active: z.boolean(), + timestamp: types_date_time }); export const watcher_types_watch_status = z.object({ - actions: watcher_types_actions, - last_checked: z.optional(types_date_time), - last_met_condition: z.optional(types_date_time), - state: watcher_types_activation_state, - version: types_version_number, - execution_state: z.optional(z.string()), + actions: watcher_types_actions, + last_checked: z.optional(types_date_time), + last_met_condition: z.optional(types_date_time), + state: watcher_types_activation_state, + version: types_version_number, + execution_state: z.optional(z.string()) }); export const watcher_types_activation_status = z.object({ - actions: watcher_types_actions, - state: watcher_types_activation_state, - version: types_version_number, + actions: watcher_types_actions, + state: watcher_types_activation_state, + version: types_version_number }); export const watcher_types_action_execution_mode = z.enum([ - 'simulate', - 'force_simulate', - 'execute', - 'force_execute', - 'skip', + 'simulate', + 'force_simulate', + 'execute', + 'force_execute', + 'skip' ]); export const watcher_types_simulated_actions = z.object({ - actions: z.array(z.string()), - get all() { - return z.lazy((): any => watcher_types_simulated_actions); - }, - use_all: z.boolean(), + actions: z.array(z.string()), + get all() { + return z.lazy((): any => watcher_types_simulated_actions); + }, + use_all: z.boolean() }); export const watcher_types_schedule_trigger_event = z.object({ - scheduled_time: types_date_time, - triggered_time: z.optional(types_date_time), + scheduled_time: types_date_time, + triggered_time: z.optional(types_date_time) }); export const watcher_types_action_type = z.enum([ - 'email', - 'webhook', - 'index', - 'logging', - 'slack', - 'pagerduty', + 'email', + 'webhook', + 'index', + 'logging', + 'slack', + 'pagerduty' ]); export const watcher_types_always_condition = z.record(z.string(), z.unknown()); export const watcher_types_array_compare_condition = z.object({ - path: z.string(), + path: z.string() }); export const watcher_types_never_condition = z.record(z.string(), z.unknown()); export const watcher_types_search_template_request_body = z.object({ - explain: z.optional(z.boolean()), - id: z.optional(types_id), - params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - profile: z.optional(z.boolean()), - source: z.optional( - z.string().register(z.globalRegistry, { - description: - "An inline search template. Supports the same parameters as the search API's\nrequest body. Also supports Mustache variables. If no id is specified, this\nparameter is required.", - }) - ), + explain: z.optional(z.boolean()), + id: z.optional(types_id), + params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + profile: z.optional(z.boolean()), + source: z.optional(z.string().register(z.globalRegistry, { + description: 'An inline search template. Supports the same parameters as the search API\'s\nrequest body. Also supports Mustache variables. If no id is specified, this\nparameter is required.' + })) }); export const watcher_types_index_action = z.object({ - index: types_index_name, - doc_id: z.optional(types_id), - refresh: z.optional(types_refresh), - op_type: z.optional(types_op_type), - timeout: z.optional(types_duration), - execution_time_field: z.optional(types_field), + index: types_index_name, + doc_id: z.optional(types_id), + refresh: z.optional(types_refresh), + op_type: z.optional(types_op_type), + timeout: z.optional(types_duration), + execution_time_field: z.optional(types_field) }); export const watcher_types_logging_action = z.object({ - level: z.optional(z.string()), - text: z.string(), - category: z.optional(z.string()), + level: z.optional(z.string()), + text: z.string(), + category: z.optional(z.string()) }); export const watcher_types_email_body = z.object({ - html: z.optional(z.string()), - text: z.optional(z.string()), + html: z.optional(z.string()), + text: z.optional(z.string()) }); -export const watcher_types_email_priority = z.enum(['lowest', 'low', 'normal', 'high', 'highest']); +export const watcher_types_email_priority = z.enum([ + 'lowest', + 'low', + 'normal', + 'high', + 'highest' +]); export const watcher_types_http_input_basic_authentication = z.object({ - password: types_password, - username: types_username, + password: types_password, + username: types_username }); export const watcher_types_http_input_authentication = z.object({ - basic: watcher_types_http_input_basic_authentication, + basic: watcher_types_http_input_basic_authentication }); -export const watcher_types_http_input_method = z.enum(['head', 'get', 'post', 'put', 'delete']); +export const watcher_types_http_input_method = z.enum([ + 'head', + 'get', + 'post', + 'put', + 'delete' +]); export const watcher_types_http_input_proxy = z.object({ - host: types_host, - port: types_uint, + host: types_host, + port: types_uint }); export const watcher_types_connection_scheme = z.enum(['http', 'https']); export const watcher_types_http_input_request_definition = z.object({ - auth: z.optional(watcher_types_http_input_authentication), - body: z.optional(z.string()), - connection_timeout: z.optional(types_duration), - headers: z.optional(z.record(z.string(), z.string())), - host: z.optional(types_host), - method: z.optional(watcher_types_http_input_method), - params: z.optional(z.record(z.string(), z.string())), - path: z.optional(z.string()), - port: z.optional(types_uint), - proxy: z.optional(watcher_types_http_input_proxy), - read_timeout: z.optional(types_duration), - scheme: z.optional(watcher_types_connection_scheme), - url: z.optional(z.string()), + auth: z.optional(watcher_types_http_input_authentication), + body: z.optional(z.string()), + connection_timeout: z.optional(types_duration), + headers: z.optional(z.record(z.string(), z.string())), + host: z.optional(types_host), + method: z.optional(watcher_types_http_input_method), + params: z.optional(z.record(z.string(), z.string())), + path: z.optional(z.string()), + port: z.optional(types_uint), + proxy: z.optional(watcher_types_http_input_proxy), + read_timeout: z.optional(types_duration), + scheme: z.optional(watcher_types_connection_scheme), + url: z.optional(z.string()) }); export const watcher_types_http_email_attachment = z.object({ - content_type: z.optional(z.string()), - inline: z.optional(z.boolean()), - request: z.optional(watcher_types_http_input_request_definition), + content_type: z.optional(z.string()), + inline: z.optional(z.boolean()), + request: z.optional(watcher_types_http_input_request_definition) }); export const watcher_types_reporting_email_attachment = z.object({ - url: z.string(), - inline: z.optional(z.boolean()), - retries: z.optional(z.number()), - interval: z.optional(types_duration), - request: z.optional(watcher_types_http_input_request_definition), + url: z.string(), + inline: z.optional(z.boolean()), + retries: z.optional(z.number()), + interval: z.optional(types_duration), + request: z.optional(watcher_types_http_input_request_definition) }); export const watcher_types_data_attachment_format = z.enum(['json', 'yaml']); export const watcher_types_data_email_attachment = z.object({ - format: z.optional(watcher_types_data_attachment_format), + format: z.optional(watcher_types_data_attachment_format) }); export const watcher_types_email_attachment_container = z.object({ - http: z.optional(watcher_types_http_email_attachment), - reporting: z.optional(watcher_types_reporting_email_attachment), - data: z.optional(watcher_types_data_email_attachment), + http: z.optional(watcher_types_http_email_attachment), + reporting: z.optional(watcher_types_reporting_email_attachment), + data: z.optional(watcher_types_data_email_attachment) }); export const watcher_types_email = z.object({ - id: z.optional(types_id), - bcc: z.optional(z.union([z.string(), z.array(z.string())])), - body: z.optional(watcher_types_email_body), - cc: z.optional(z.union([z.string(), z.array(z.string())])), - from: z.optional(z.string()), - priority: z.optional(watcher_types_email_priority), - reply_to: z.optional(z.union([z.string(), z.array(z.string())])), - sent_date: z.optional(types_date_time), - subject: z.string(), - to: z.union([z.string(), z.array(z.string())]), - attachments: z.optional(z.record(z.string(), watcher_types_email_attachment_container)), -}); - -export const watcher_types_email_action = watcher_types_email.and( - z.record(z.string(), z.unknown()) -); + id: z.optional(types_id), + bcc: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + body: z.optional(watcher_types_email_body), + cc: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + from: z.optional(z.string()), + priority: z.optional(watcher_types_email_priority), + reply_to: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + sent_date: z.optional(types_date_time), + subject: z.string(), + to: z.union([ + z.string(), + z.array(z.string()) + ]), + attachments: z.optional(z.record(z.string(), watcher_types_email_attachment_container)) +}); + +export const watcher_types_email_action = watcher_types_email.and(z.record(z.string(), z.unknown())); export const watcher_types_pager_duty_context_type = z.enum(['link', 'image']); export const watcher_types_pager_duty_context = z.object({ - href: z.optional(z.string()), - src: z.optional(z.string()), - type: watcher_types_pager_duty_context_type, + href: z.optional(z.string()), + src: z.optional(z.string()), + type: watcher_types_pager_duty_context_type }); -export const watcher_types_pager_duty_event_type = z.enum(['trigger', 'resolve', 'acknowledge']); +export const watcher_types_pager_duty_event_type = z.enum([ + 'trigger', + 'resolve', + 'acknowledge' +]); export const watcher_types_pager_duty_event_proxy = z.object({ - host: z.optional(types_host), - port: z.optional(z.number()), + host: z.optional(types_host), + port: z.optional(z.number()) }); export const watcher_types_pager_duty_event = z.object({ - account: z.optional(z.string()), - attach_payload: z.boolean(), - client: z.optional(z.string()), - client_url: z.optional(z.string()), - contexts: z.optional(z.array(watcher_types_pager_duty_context)), - description: z.string(), - event_type: z.optional(watcher_types_pager_duty_event_type), - incident_key: z.string(), - proxy: z.optional(watcher_types_pager_duty_event_proxy), + account: z.optional(z.string()), + attach_payload: z.boolean(), + client: z.optional(z.string()), + client_url: z.optional(z.string()), + contexts: z.optional(z.array(watcher_types_pager_duty_context)), + description: z.string(), + event_type: z.optional(watcher_types_pager_duty_event_type), + incident_key: z.string(), + proxy: z.optional(watcher_types_pager_duty_event_proxy) }); -export const watcher_types_pager_duty_action = watcher_types_pager_duty_event.and( - z.record(z.string(), z.unknown()) -); +export const watcher_types_pager_duty_action = watcher_types_pager_duty_event.and(z.record(z.string(), z.unknown())); export const watcher_types_slack_attachment_field = z.object({ - short: z.boolean(), - title: z.string(), - value: z.string(), + short: z.boolean(), + title: z.string(), + value: z.string() }); export const watcher_types_slack_attachment = z.object({ - author_icon: z.optional(z.string()), - author_link: z.optional(z.string()), - author_name: z.string(), - color: z.optional(z.string()), - fallback: z.optional(z.string()), - fields: z.optional(z.array(watcher_types_slack_attachment_field)), - footer: z.optional(z.string()), - footer_icon: z.optional(z.string()), - image_url: z.optional(z.string()), - pretext: z.optional(z.string()), - text: z.optional(z.string()), - thumb_url: z.optional(z.string()), - title: z.string(), - title_link: z.optional(z.string()), - ts: z.optional(types_epoch_time_unit_seconds), + author_icon: z.optional(z.string()), + author_link: z.optional(z.string()), + author_name: z.string(), + color: z.optional(z.string()), + fallback: z.optional(z.string()), + fields: z.optional(z.array(watcher_types_slack_attachment_field)), + footer: z.optional(z.string()), + footer_icon: z.optional(z.string()), + image_url: z.optional(z.string()), + pretext: z.optional(z.string()), + text: z.optional(z.string()), + thumb_url: z.optional(z.string()), + title: z.string(), + title_link: z.optional(z.string()), + ts: z.optional(types_epoch_time_unit_seconds) }); export const watcher_types_slack_dynamic_attachment = z.object({ - attachment_template: watcher_types_slack_attachment, - list_path: z.string(), + attachment_template: watcher_types_slack_attachment, + list_path: z.string() }); export const watcher_types_slack_message = z.object({ - attachments: z.array(watcher_types_slack_attachment), - dynamic_attachments: z.optional(watcher_types_slack_dynamic_attachment), - from: z.string(), - icon: z.optional(z.string()), - text: z.string(), - to: z.array(z.string()), + attachments: z.array(watcher_types_slack_attachment), + dynamic_attachments: z.optional(watcher_types_slack_dynamic_attachment), + from: z.string(), + icon: z.optional(z.string()), + text: z.string(), + to: z.array(z.string()) }); export const watcher_types_slack_action = z.object({ - account: z.optional(z.string()), - message: watcher_types_slack_message, + account: z.optional(z.string()), + message: watcher_types_slack_message }); -export const watcher_types_webhook_action = watcher_types_http_input_request_definition.and( - z.record(z.string(), z.unknown()) -); +export const watcher_types_webhook_action = watcher_types_http_input_request_definition.and(z.record(z.string(), z.unknown())); -export const watcher_types_response_content_type = z.enum(['json', 'yaml', 'text']); +export const watcher_types_response_content_type = z.enum([ + 'json', + 'yaml', + 'text' +]); export const watcher_types_http_input = z.object({ - extract: z.optional(z.array(z.string())), - request: z.optional(watcher_types_http_input_request_definition), - response_content_type: z.optional(watcher_types_response_content_type), + extract: z.optional(z.array(z.string())), + request: z.optional(watcher_types_http_input_request_definition), + response_content_type: z.optional(watcher_types_response_content_type) }); export const watcher_types_daily_schedule = z.object({ - at: z.array(watcher_types_schedule_time_of_day), + at: z.array(watcher_types_schedule_time_of_day) }); export const watcher_types_hourly_schedule = z.object({ - minute: z.array(z.number()), + minute: z.array(z.number()) }); export const watcher_types_time_of_month = z.object({ - at: z.array(z.string()), - on: z.array(z.number()), + at: z.array(z.string()), + on: z.array(z.number()) }); export const watcher_types_day = z.enum([ - 'sunday', - 'monday', - 'tuesday', - 'wednesday', - 'thursday', - 'friday', - 'saturday', + 'sunday', + 'monday', + 'tuesday', + 'wednesday', + 'thursday', + 'friday', + 'saturday' ]); export const watcher_types_time_of_week = z.object({ - at: z.array(z.string()), - on: z.array(watcher_types_day), + at: z.array(z.string()), + on: z.array(watcher_types_day) }); export const watcher_types_month = z.enum([ - 'january', - 'february', - 'march', - 'april', - 'may', - 'june', - 'july', - 'august', - 'september', - 'october', - 'november', - 'december', + 'january', + 'february', + 'march', + 'april', + 'may', + 'june', + 'july', + 'august', + 'september', + 'october', + 'november', + 'december' ]); export const watcher_types_time_of_year = z.object({ - at: z.array(z.string()), - int: z.array(watcher_types_month), - on: z.array(z.number()), + at: z.array(z.string()), + int: z.array(watcher_types_month), + on: z.array(z.number()) }); export const watcher_types_schedule_container = z.object({ - timezone: z.optional(z.string()), - cron: z.optional(watcher_types_cron_expression), - daily: z.optional(watcher_types_daily_schedule), - hourly: z.optional(watcher_types_hourly_schedule), - interval: z.optional(types_duration), - monthly: z.optional(z.union([watcher_types_time_of_month, z.array(watcher_types_time_of_month)])), - weekly: z.optional(z.union([watcher_types_time_of_week, z.array(watcher_types_time_of_week)])), - yearly: z.optional(z.union([watcher_types_time_of_year, z.array(watcher_types_time_of_year)])), + timezone: z.optional(z.string()), + cron: z.optional(watcher_types_cron_expression), + daily: z.optional(watcher_types_daily_schedule), + hourly: z.optional(watcher_types_hourly_schedule), + interval: z.optional(types_duration), + monthly: z.optional(z.union([ + watcher_types_time_of_month, + z.array(watcher_types_time_of_month) + ])), + weekly: z.optional(z.union([ + watcher_types_time_of_week, + z.array(watcher_types_time_of_week) + ])), + yearly: z.optional(z.union([ + watcher_types_time_of_year, + z.array(watcher_types_time_of_year) + ])) }); export const watcher_types_trigger_container = z.object({ - schedule: z.optional(watcher_types_schedule_container), + schedule: z.optional(watcher_types_schedule_container) }); export const watcher_types_email_result = z.object({ - account: z.optional(z.string()), - message: watcher_types_email, - reason: z.optional(z.string()), + account: z.optional(z.string()), + message: watcher_types_email, + reason: z.optional(z.string()) }); export const watcher_types_index_result_summary = z.object({ - created: z.boolean(), - id: types_id, - index: types_index_name, - result: types_result, - version: types_version_number, + created: z.boolean(), + id: types_id, + index: types_index_name, + result: types_result, + version: types_version_number }); export const watcher_types_index_result = z.object({ - response: watcher_types_index_result_summary, + response: watcher_types_index_result_summary }); export const watcher_types_logging_result = z.object({ - logged_text: z.string(), + logged_text: z.string() }); -export const watcher_types_http_input_request_result = - watcher_types_http_input_request_definition.and(z.record(z.string(), z.unknown())); +export const watcher_types_http_input_request_result = watcher_types_http_input_request_definition.and(z.record(z.string(), z.unknown())); export const watcher_types_http_input_response_result = z.object({ - body: z.string(), - headers: types_http_headers, - status: z.number(), + body: z.string(), + headers: types_http_headers, + status: z.number() }); export const watcher_types_pager_duty_result = z.object({ - event: watcher_types_pager_duty_event, - reason: z.optional(z.string()), - request: z.optional(watcher_types_http_input_request_result), - response: z.optional(watcher_types_http_input_response_result), + event: watcher_types_pager_duty_event, + reason: z.optional(z.string()), + request: z.optional(watcher_types_http_input_request_result), + response: z.optional(watcher_types_http_input_response_result) }); export const watcher_types_slack_result = z.object({ - account: z.optional(z.string()), - message: watcher_types_slack_message, + account: z.optional(z.string()), + message: watcher_types_slack_message }); export const watcher_types_action_status_options = z.enum([ - 'success', - 'failure', - 'simulated', - 'throttled', + 'success', + 'failure', + 'simulated', + 'throttled' ]); export const watcher_types_webhook_result = z.object({ - request: watcher_types_http_input_request_result, - response: z.optional(watcher_types_http_input_response_result), + request: watcher_types_http_input_request_result, + response: z.optional(watcher_types_http_input_response_result) }); export const watcher_types_execution_result_action = z.object({ - email: z.optional(watcher_types_email_result), - id: types_id, - index: z.optional(watcher_types_index_result), - logging: z.optional(watcher_types_logging_result), - pagerduty: z.optional(watcher_types_pager_duty_result), - reason: z.optional(z.string()), - slack: z.optional(watcher_types_slack_result), - status: watcher_types_action_status_options, - type: watcher_types_action_type, - webhook: z.optional(watcher_types_webhook_result), - error: z.optional(types_error_cause), + email: z.optional(watcher_types_email_result), + id: types_id, + index: z.optional(watcher_types_index_result), + logging: z.optional(watcher_types_logging_result), + pagerduty: z.optional(watcher_types_pager_duty_result), + reason: z.optional(z.string()), + slack: z.optional(watcher_types_slack_result), + status: watcher_types_action_status_options, + type: watcher_types_action_type, + webhook: z.optional(watcher_types_webhook_result), + error: z.optional(types_error_cause) }); export const watcher_types_condition_type = z.enum([ - 'always', - 'never', - 'script', - 'compare', - 'array_compare', + 'always', + 'never', + 'script', + 'compare', + 'array_compare' ]); export const watcher_types_execution_result_condition = z.object({ - met: z.boolean(), - status: watcher_types_action_status_options, - type: watcher_types_condition_type, + met: z.boolean(), + status: watcher_types_action_status_options, + type: watcher_types_condition_type }); -export const watcher_types_input_type = z.enum(['http', 'search', 'simple']); +export const watcher_types_input_type = z.enum([ + 'http', + 'search', + 'simple' +]); export const watcher_types_execution_result_input = z.object({ - payload: z.record(z.string(), z.record(z.string(), z.unknown())), - status: watcher_types_action_status_options, - type: watcher_types_input_type, + payload: z.record(z.string(), z.record(z.string(), z.unknown())), + status: watcher_types_action_status_options, + type: watcher_types_input_type }); export const watcher_types_execution_result = z.object({ - actions: z.array(watcher_types_execution_result_action), - condition: watcher_types_execution_result_condition, - execution_duration: types_duration_value_unit_millis, - execution_time: types_date_time, - input: watcher_types_execution_result_input, + actions: z.array(watcher_types_execution_result_action), + condition: watcher_types_execution_result_condition, + execution_duration: types_duration_value_unit_millis, + execution_time: types_date_time, + input: watcher_types_execution_result_input }); export const watcher_types_execution_status = z.enum([ - 'awaits_execution', - 'checking', - 'execution_not_needed', - 'throttled', - 'executed', - 'failed', - 'deleted_while_queued', - 'not_executed_already_queued', + 'awaits_execution', + 'checking', + 'execution_not_needed', + 'throttled', + 'executed', + 'failed', + 'deleted_while_queued', + 'not_executed_already_queued' ]); export const watcher_types_trigger_event_container = z.object({ - schedule: z.optional(watcher_types_schedule_trigger_event), + schedule: z.optional(watcher_types_schedule_trigger_event) }); export const watcher_types_trigger_event_result = z.object({ - manual: watcher_types_trigger_event_container, - triggered_time: types_date_time, - type: z.string(), + manual: watcher_types_trigger_event_container, + triggered_time: types_date_time, + type: z.string() }); export const watcher_stats_watcher_metric = z.enum([ - '_all', - 'all', - 'queued_watches', - 'current_watches', - 'pending_watches', + '_all', + 'all', + 'queued_watches', + 'current_watches', + 'pending_watches' ]); export const watcher_types_execution_phase = z.enum([ - 'awaits_execution', - 'started', - 'input', - 'condition', - 'actions', - 'watch_transform', - 'aborted', - 'finished', + 'awaits_execution', + 'started', + 'input', + 'condition', + 'actions', + 'watch_transform', + 'aborted', + 'finished' ]); export const watcher_stats_watch_record_queued_stats = z.object({ - execution_time: types_date_time, + execution_time: types_date_time }); -export const watcher_stats_watch_record_stats = watcher_stats_watch_record_queued_stats.and( - z.object({ +export const watcher_stats_watch_record_stats = watcher_stats_watch_record_queued_stats.and(z.object({ execution_phase: watcher_types_execution_phase, triggered_time: types_date_time, executed_actions: z.optional(z.array(z.string())), watch_id: types_id, - watch_record_id: types_id, - }) -); + watch_record_id: types_id +})); export const watcher_types_execution_thread_pool = z.object({ - max_size: z.number().register(z.globalRegistry, { - description: - 'The largest size of the execution thread pool, which indicates the largest number of concurrent running watches.', - }), - queue_size: z.number().register(z.globalRegistry, { - description: 'The number of watches that were triggered and are currently queued.', - }), + max_size: z.number().register(z.globalRegistry, { + description: 'The largest size of the execution thread pool, which indicates the largest number of concurrent running watches.' + }), + queue_size: z.number().register(z.globalRegistry, { + description: 'The number of watches that were triggered and are currently queued.' + }) }); -export const watcher_stats_watcher_state = z.enum(['stopped', 'starting', 'started', 'stopping']); +export const watcher_stats_watcher_state = z.enum([ + 'stopped', + 'starting', + 'started', + 'stopping' +]); export const watcher_stats_watcher_node_stats = z.object({ - current_watches: z.optional( - z.array(watcher_stats_watch_record_stats).register(z.globalRegistry, { - description: - 'The current executing watches metric gives insight into the watches that are currently being executed by Watcher.\nAdditional information is shared per watch that is currently executing.\nThis information includes the `watch_id`, the time its execution started and its current execution phase.\nTo include this metric, the `metric` option should be set to `current_watches` or `_all`.\nIn addition you can also specify the `emit_stacktraces=true` parameter, which adds stack traces for each watch that is being run.\nThese stack traces can give you more insight into an execution of a watch.', - }) - ), - execution_thread_pool: watcher_types_execution_thread_pool, - queued_watches: z.optional( - z.array(watcher_stats_watch_record_queued_stats).register(z.globalRegistry, { - description: - "Watcher moderates the execution of watches such that their execution won't put too much pressure on the node and its resources.\nIf too many watches trigger concurrently and there isn't enough capacity to run them all, some of the watches are queued, waiting for the current running watches to finish.s\nThe queued watches metric gives insight on these queued watches.\n\nTo include this metric, the `metric` option should include `queued_watches` or `_all`.", - }) - ), - watch_count: z.number().register(z.globalRegistry, { - description: 'The number of watches currently registered.', - }), - watcher_state: watcher_stats_watcher_state, - node_id: types_id, + current_watches: z.optional(z.array(watcher_stats_watch_record_stats).register(z.globalRegistry, { + description: 'The current executing watches metric gives insight into the watches that are currently being executed by Watcher.\nAdditional information is shared per watch that is currently executing.\nThis information includes the `watch_id`, the time its execution started and its current execution phase.\nTo include this metric, the `metric` option should be set to `current_watches` or `_all`.\nIn addition you can also specify the `emit_stacktraces=true` parameter, which adds stack traces for each watch that is being run.\nThese stack traces can give you more insight into an execution of a watch.' + })), + execution_thread_pool: watcher_types_execution_thread_pool, + queued_watches: z.optional(z.array(watcher_stats_watch_record_queued_stats).register(z.globalRegistry, { + description: 'Watcher moderates the execution of watches such that their execution won\'t put too much pressure on the node and its resources.\nIf too many watches trigger concurrently and there isn\'t enough capacity to run them all, some of the watches are queued, waiting for the current running watches to finish.s\nThe queued watches metric gives insight on these queued watches.\n\nTo include this metric, the `metric` option should include `queued_watches` or `_all`.' + })), + watch_count: z.number().register(z.globalRegistry, { + description: 'The number of watches currently registered.' + }), + watcher_state: watcher_stats_watcher_state, + node_id: types_id }); -export const xpack_info_x_pack_category = z.enum(['build', 'features', 'license']); +export const xpack_info_x_pack_category = z.enum([ + 'build', + 'features', + 'license' +]); export const xpack_info_build_information = z.object({ - date: types_date_time, - hash: z.string(), + date: types_date_time, + hash: z.string() }); export const xpack_info_native_code_information = z.object({ - build_hash: z.string(), - version: types_version_string, + build_hash: z.string(), + version: types_version_string }); export const xpack_info_feature = z.object({ - available: z.boolean(), - description: z.optional(z.string()), - enabled: z.boolean(), - native_code_info: z.optional(xpack_info_native_code_information), + available: z.boolean(), + description: z.optional(z.string()), + enabled: z.boolean(), + native_code_info: z.optional(xpack_info_native_code_information) }); export const xpack_info_features = z.object({ - aggregate_metric: xpack_info_feature, - analytics: xpack_info_feature, - ccr: xpack_info_feature, - data_streams: xpack_info_feature, - data_tiers: xpack_info_feature, - enrich: xpack_info_feature, - enterprise_search: xpack_info_feature, - eql: xpack_info_feature, - esql: xpack_info_feature, - graph: xpack_info_feature, - ilm: xpack_info_feature, - logstash: xpack_info_feature, - logsdb: xpack_info_feature, - ml: xpack_info_feature, - monitoring: xpack_info_feature, - rollup: xpack_info_feature, - runtime_fields: z.optional(xpack_info_feature), - searchable_snapshots: xpack_info_feature, - security: xpack_info_feature, - slm: xpack_info_feature, - spatial: xpack_info_feature, - sql: xpack_info_feature, - transform: xpack_info_feature, - universal_profiling: xpack_info_feature, - voting_only: xpack_info_feature, - watcher: xpack_info_feature, - archive: xpack_info_feature, + aggregate_metric: xpack_info_feature, + analytics: xpack_info_feature, + ccr: xpack_info_feature, + data_streams: xpack_info_feature, + data_tiers: xpack_info_feature, + enrich: xpack_info_feature, + enterprise_search: xpack_info_feature, + eql: xpack_info_feature, + esql: xpack_info_feature, + graph: xpack_info_feature, + ilm: xpack_info_feature, + logstash: xpack_info_feature, + logsdb: xpack_info_feature, + ml: xpack_info_feature, + monitoring: xpack_info_feature, + rollup: xpack_info_feature, + runtime_fields: z.optional(xpack_info_feature), + searchable_snapshots: xpack_info_feature, + security: xpack_info_feature, + slm: xpack_info_feature, + spatial: xpack_info_feature, + sql: xpack_info_feature, + transform: xpack_info_feature, + universal_profiling: xpack_info_feature, + voting_only: xpack_info_feature, + watcher: xpack_info_feature, + archive: xpack_info_feature }); export const xpack_info_minimal_license_information = z.object({ - expiry_date_in_millis: types_epoch_time_unit_millis, - mode: license_types_license_type, - status: license_types_license_status, - type: license_types_license_type, - uid: z.string(), + expiry_date_in_millis: types_epoch_time_unit_millis, + mode: license_types_license_type, + status: license_types_license_status, + type: license_types_license_type, + uid: z.string() }); export const xpack_usage_base = z.object({ - available: z.boolean(), - enabled: z.boolean(), + available: z.boolean(), + enabled: z.boolean() }); -export const xpack_usage_analytics_statistics = z.object({ - boxplot_usage: z.number(), - cumulative_cardinality_usage: z.number(), - string_stats_usage: z.number(), - top_metrics_usage: z.number(), - t_test_usage: z.number(), - moving_percentiles_usage: z.number(), - normalize_usage: z.number(), - rate_usage: z.number(), - multi_terms_usage: z.optional(z.number()), -}); - -export const xpack_usage_analytics = xpack_usage_base.and( - z.object({ - stats: xpack_usage_analytics_statistics, - }) -); - -export const xpack_usage_archive = xpack_usage_base.and( - z.object({ - indices_count: z.number(), - }) -); +export const xpack_usage_analytics_statistics = z.object({ + boxplot_usage: z.number(), + cumulative_cardinality_usage: z.number(), + string_stats_usage: z.number(), + top_metrics_usage: z.number(), + t_test_usage: z.number(), + moving_percentiles_usage: z.number(), + normalize_usage: z.number(), + rate_usage: z.number(), + multi_terms_usage: z.optional(z.number()) +}); + +export const xpack_usage_analytics = xpack_usage_base.and(z.object({ + stats: xpack_usage_analytics_statistics +})); + +export const xpack_usage_archive = xpack_usage_base.and(z.object({ + indices_count: z.number() +})); export const xpack_usage_watcher_action_totals = z.object({ - total: types_duration, - total_time_in_ms: types_duration_value_unit_millis, + total: types_duration, + total_time_in_ms: types_duration_value_unit_millis }); export const xpack_usage_watcher_actions = z.object({ - actions: z.record(z.string(), xpack_usage_watcher_action_totals), + actions: z.record(z.string(), xpack_usage_watcher_action_totals) }); export const xpack_usage_counter = z.object({ - active: z.number(), - total: z.number(), + active: z.number(), + total: z.number() }); -export const xpack_usage_watcher_watch_trigger_schedule = xpack_usage_counter.and( - z.object({ +export const xpack_usage_watcher_watch_trigger_schedule = xpack_usage_counter.and(z.object({ cron: xpack_usage_counter, - _all: xpack_usage_counter, - }) -); + _all: xpack_usage_counter +})); export const xpack_usage_watcher_watch_trigger = z.object({ - schedule: z.optional(xpack_usage_watcher_watch_trigger_schedule), - _all: xpack_usage_counter, + schedule: z.optional(xpack_usage_watcher_watch_trigger_schedule), + _all: xpack_usage_counter }); export const xpack_usage_watcher_watch = z.object({ - input: z.record(z.string(), xpack_usage_counter), - condition: z.optional(z.record(z.string(), xpack_usage_counter)), - action: z.optional(z.record(z.string(), xpack_usage_counter)), - trigger: xpack_usage_watcher_watch_trigger, + input: z.record(z.string(), xpack_usage_counter), + condition: z.optional(z.record(z.string(), xpack_usage_counter)), + action: z.optional(z.record(z.string(), xpack_usage_counter)), + trigger: xpack_usage_watcher_watch_trigger }); -export const xpack_usage_watcher = xpack_usage_base.and( - z.object({ +export const xpack_usage_watcher = xpack_usage_base.and(z.object({ execution: xpack_usage_watcher_actions, watch: xpack_usage_watcher_watch, - count: xpack_usage_counter, - }) -); + count: xpack_usage_counter +})); -export const xpack_usage_ccr = xpack_usage_base.and( - z.object({ +export const xpack_usage_ccr = xpack_usage_base.and(z.object({ auto_follow_patterns_count: z.number(), - follower_indices_count: z.number(), - }) -); + follower_indices_count: z.number() +})); -export const xpack_usage_data_streams = xpack_usage_base.and( - z.object({ +export const xpack_usage_data_streams = xpack_usage_base.and(z.object({ data_streams: z.number(), - indices_count: z.number(), - }) -); + indices_count: z.number() +})); export const xpack_usage_data_tier_phase_statistics = z.object({ - node_count: z.number(), - index_count: z.number(), - total_shard_count: z.number(), - primary_shard_count: z.number(), - doc_count: z.number(), - total_size_bytes: z.number(), - primary_size_bytes: z.number(), - primary_shard_size_avg_bytes: z.number(), - primary_shard_size_median_bytes: z.number(), - primary_shard_size_mad_bytes: z.number(), -}); - -export const xpack_usage_data_tiers = xpack_usage_base.and( - z.object({ + node_count: z.number(), + index_count: z.number(), + total_shard_count: z.number(), + primary_shard_count: z.number(), + doc_count: z.number(), + total_size_bytes: z.number(), + primary_size_bytes: z.number(), + primary_shard_size_avg_bytes: z.number(), + primary_shard_size_median_bytes: z.number(), + primary_shard_size_mad_bytes: z.number() +}); + +export const xpack_usage_data_tiers = xpack_usage_base.and(z.object({ data_warm: xpack_usage_data_tier_phase_statistics, data_frozen: z.optional(xpack_usage_data_tier_phase_statistics), data_cold: xpack_usage_data_tier_phase_statistics, data_content: xpack_usage_data_tier_phase_statistics, - data_hot: xpack_usage_data_tier_phase_statistics, - }) -); + data_hot: xpack_usage_data_tier_phase_statistics +})); export const xpack_usage_eql_features_join = z.object({ - join_queries_two: types_uint, - join_queries_three: types_uint, - join_until: types_uint, - join_queries_five_or_more: types_uint, - join_queries_four: types_uint, + join_queries_two: types_uint, + join_queries_three: types_uint, + join_until: types_uint, + join_queries_five_or_more: types_uint, + join_queries_four: types_uint }); export const xpack_usage_eql_features_keys = z.object({ - join_keys_two: types_uint, - join_keys_one: types_uint, - join_keys_three: types_uint, - join_keys_five_or_more: types_uint, - join_keys_four: types_uint, + join_keys_two: types_uint, + join_keys_one: types_uint, + join_keys_three: types_uint, + join_keys_five_or_more: types_uint, + join_keys_four: types_uint }); export const xpack_usage_eql_features_pipes = z.object({ - pipe_tail: types_uint, - pipe_head: types_uint, + pipe_tail: types_uint, + pipe_head: types_uint }); export const xpack_usage_eql_features_sequences = z.object({ - sequence_queries_three: types_uint, - sequence_queries_four: types_uint, - sequence_queries_two: types_uint, - sequence_until: types_uint, - sequence_queries_five_or_more: types_uint, - sequence_maxspan: types_uint, + sequence_queries_three: types_uint, + sequence_queries_four: types_uint, + sequence_queries_two: types_uint, + sequence_until: types_uint, + sequence_queries_five_or_more: types_uint, + sequence_maxspan: types_uint }); export const xpack_usage_eql_features = z.object({ - join: types_uint, - joins: xpack_usage_eql_features_join, - keys: xpack_usage_eql_features_keys, - event: types_uint, - pipes: xpack_usage_eql_features_pipes, - sequence: types_uint, - sequences: xpack_usage_eql_features_sequences, + join: types_uint, + joins: xpack_usage_eql_features_join, + keys: xpack_usage_eql_features_keys, + event: types_uint, + pipes: xpack_usage_eql_features_pipes, + sequence: types_uint, + sequences: xpack_usage_eql_features_sequences }); export const xpack_usage_query = z.object({ - count: z.optional(z.number()), - failed: z.optional(z.number()), - paging: z.optional(z.number()), - total: z.optional(z.number()), + count: z.optional(z.number()), + failed: z.optional(z.number()), + paging: z.optional(z.number()), + total: z.optional(z.number()) }); -export const xpack_usage_eql = xpack_usage_base.and( - z.object({ +export const xpack_usage_eql = xpack_usage_base.and(z.object({ features: xpack_usage_eql_features, - queries: z.record(z.string(), xpack_usage_query), - }) -); + queries: z.record(z.string(), xpack_usage_query) +})); -export const xpack_usage_flattened = xpack_usage_base.and( - z.object({ - field_count: z.number(), - }) -); +export const xpack_usage_flattened = xpack_usage_base.and(z.object({ + field_count: z.number() +})); export const xpack_usage_invocations = z.object({ - total: z.number(), + total: z.number() }); -export const xpack_usage_health_statistics = xpack_usage_base.and( - z.object({ - invocations: xpack_usage_invocations, - }) -); +export const xpack_usage_health_statistics = xpack_usage_base.and(z.object({ + invocations: xpack_usage_invocations +})); export const xpack_usage_phase = z.object({ - actions: z.array(z.string()), - min_age: types_duration_value_unit_millis, + actions: z.array(z.string()), + min_age: types_duration_value_unit_millis }); export const xpack_usage_phases = z.object({ - cold: z.optional(xpack_usage_phase), - delete: z.optional(xpack_usage_phase), - frozen: z.optional(xpack_usage_phase), - hot: z.optional(xpack_usage_phase), - warm: z.optional(xpack_usage_phase), + cold: z.optional(xpack_usage_phase), + delete: z.optional(xpack_usage_phase), + frozen: z.optional(xpack_usage_phase), + hot: z.optional(xpack_usage_phase), + warm: z.optional(xpack_usage_phase) }); export const xpack_usage_ilm_policy_statistics = z.object({ - indices_managed: z.number(), - phases: xpack_usage_phases, + indices_managed: z.number(), + phases: xpack_usage_phases }); export const xpack_usage_ilm = z.object({ - policy_count: z.number(), - policy_stats: z.array(xpack_usage_ilm_policy_statistics), + policy_count: z.number(), + policy_stats: z.array(xpack_usage_ilm_policy_statistics) }); export const xpack_usage_datafeed = z.object({ - count: z.number(), + count: z.number() }); export const xpack_usage_ml_job_forecasts = z.object({ - total: z.number(), - forecasted_jobs: z.number(), + total: z.number(), + forecasted_jobs: z.number() }); export const xpack_usage_job_usage = z.object({ - count: z.number(), - created_by: z.record(z.string(), z.number()), - detectors: ml_types_job_statistics, - forecasts: xpack_usage_ml_job_forecasts, - model_size: ml_types_job_statistics, + count: z.number(), + created_by: z.record(z.string(), z.number()), + detectors: ml_types_job_statistics, + forecasts: xpack_usage_ml_job_forecasts, + model_size: ml_types_job_statistics }); export const xpack_usage_ml_data_frame_analytics_jobs_memory = z.object({ - peak_usage_bytes: ml_types_job_statistics, + peak_usage_bytes: ml_types_job_statistics }); export const xpack_usage_ml_data_frame_analytics_jobs_count = z.object({ - count: z.number(), + count: z.number() }); export const xpack_usage_ml_data_frame_analytics_jobs_analysis = z.object({ - classification: z.optional(z.number()), - outlier_detection: z.optional(z.number()), - regression: z.optional(z.number()), + classification: z.optional(z.number()), + outlier_detection: z.optional(z.number()), + regression: z.optional(z.number()) }); export const xpack_usage_ml_data_frame_analytics_jobs = z.object({ - memory_usage: z.optional(xpack_usage_ml_data_frame_analytics_jobs_memory), - _all: xpack_usage_ml_data_frame_analytics_jobs_count, - analysis_counts: z.optional(xpack_usage_ml_data_frame_analytics_jobs_analysis), - stopped: z.optional(xpack_usage_ml_data_frame_analytics_jobs_count), + memory_usage: z.optional(xpack_usage_ml_data_frame_analytics_jobs_memory), + _all: xpack_usage_ml_data_frame_analytics_jobs_count, + analysis_counts: z.optional(xpack_usage_ml_data_frame_analytics_jobs_analysis), + stopped: z.optional(xpack_usage_ml_data_frame_analytics_jobs_count) }); export const xpack_usage_ml_inference_ingest_processor_count = z.object({ - max: z.number(), - sum: z.number(), - min: z.number(), + max: z.number(), + sum: z.number(), + min: z.number() }); export const xpack_usage_ml_counter = z.object({ - count: z.number(), + count: z.number() }); export const xpack_usage_ml_inference_ingest_processor = z.object({ - num_docs_processed: xpack_usage_ml_inference_ingest_processor_count, - pipelines: xpack_usage_ml_counter, - num_failures: xpack_usage_ml_inference_ingest_processor_count, - time_ms: xpack_usage_ml_inference_ingest_processor_count, + num_docs_processed: xpack_usage_ml_inference_ingest_processor_count, + pipelines: xpack_usage_ml_counter, + num_failures: xpack_usage_ml_inference_ingest_processor_count, + time_ms: xpack_usage_ml_inference_ingest_processor_count }); export const xpack_usage_ml_inference_trained_models_count = z.object({ - total: z.number(), - prepackaged: z.number(), - other: z.number(), - pass_through: z.optional(z.number()), - regression: z.optional(z.number()), - classification: z.optional(z.number()), - ner: z.optional(z.number()), - text_embedding: z.optional(z.number()), + total: z.number(), + prepackaged: z.number(), + other: z.number(), + pass_through: z.optional(z.number()), + regression: z.optional(z.number()), + classification: z.optional(z.number()), + ner: z.optional(z.number()), + text_embedding: z.optional(z.number()) }); export const xpack_usage_ml_inference_trained_models = z.object({ - estimated_operations: z.optional(ml_types_job_statistics), - estimated_heap_memory_usage_bytes: z.optional(ml_types_job_statistics), - count: z.optional(xpack_usage_ml_inference_trained_models_count), - _all: xpack_usage_ml_counter, - model_size_bytes: z.optional(ml_types_job_statistics), + estimated_operations: z.optional(ml_types_job_statistics), + estimated_heap_memory_usage_bytes: z.optional(ml_types_job_statistics), + count: z.optional(xpack_usage_ml_inference_trained_models_count), + _all: xpack_usage_ml_counter, + model_size_bytes: z.optional(ml_types_job_statistics) }); export const xpack_usage_ml_inference_deployments_time_ms = z.object({ - avg: z.number(), + avg: z.number() }); export const xpack_usage_ml_inference_deployments = z.object({ - count: z.number(), - inference_counts: ml_types_job_statistics, - model_sizes_bytes: ml_types_job_statistics, - time_ms: xpack_usage_ml_inference_deployments_time_ms, + count: z.number(), + inference_counts: ml_types_job_statistics, + model_sizes_bytes: ml_types_job_statistics, + time_ms: xpack_usage_ml_inference_deployments_time_ms }); export const xpack_usage_ml_inference = z.object({ - ingest_processors: z.record(z.string(), xpack_usage_ml_inference_ingest_processor), - trained_models: xpack_usage_ml_inference_trained_models, - deployments: z.optional(xpack_usage_ml_inference_deployments), + ingest_processors: z.record(z.string(), xpack_usage_ml_inference_ingest_processor), + trained_models: xpack_usage_ml_inference_trained_models, + deployments: z.optional(xpack_usage_ml_inference_deployments) }); -export const xpack_usage_machine_learning = xpack_usage_base.and( - z.object({ +export const xpack_usage_machine_learning = xpack_usage_base.and(z.object({ datafeeds: z.record(z.string(), xpack_usage_datafeed), jobs: z.record(z.string(), xpack_usage_job_usage).register(z.globalRegistry, { - description: - 'Job usage statistics. The `_all` entry is always present and gathers statistics for all jobs.', + description: 'Job usage statistics. The `_all` entry is always present and gathers statistics for all jobs.' }), node_count: z.number(), data_frame_analytics_jobs: xpack_usage_ml_data_frame_analytics_jobs, - inference: xpack_usage_ml_inference, - }) -); + inference: xpack_usage_ml_inference +})); -export const xpack_usage_monitoring = xpack_usage_base.and( - z.object({ +export const xpack_usage_monitoring = xpack_usage_base.and(z.object({ collection_enabled: z.boolean(), - enabled_exporters: z.record(z.string(), z.number()), - }) -); + enabled_exporters: z.record(z.string(), z.number()) +})); export const xpack_usage_runtime_fields_type = z.object({ - chars_max: z.number(), - chars_total: z.number(), - count: z.number(), - doc_max: z.number(), - doc_total: z.number(), - index_count: z.number(), - lang: z.array(z.string()), - lines_max: z.number(), - lines_total: z.number(), - name: types_field, - scriptless_count: z.number(), - shadowed_count: z.number(), - source_max: z.number(), - source_total: z.number(), -}); - -export const xpack_usage_runtime_field_types = xpack_usage_base.and( - z.object({ - field_types: z.array(xpack_usage_runtime_fields_type), - }) -); - -export const xpack_usage_searchable_snapshots = xpack_usage_base.and( - z.object({ + chars_max: z.number(), + chars_total: z.number(), + count: z.number(), + doc_max: z.number(), + doc_total: z.number(), + index_count: z.number(), + lang: z.array(z.string()), + lines_max: z.number(), + lines_total: z.number(), + name: types_field, + scriptless_count: z.number(), + shadowed_count: z.number(), + source_max: z.number(), + source_total: z.number() +}); + +export const xpack_usage_runtime_field_types = xpack_usage_base.and(z.object({ + field_types: z.array(xpack_usage_runtime_fields_type) +})); + +export const xpack_usage_searchable_snapshots = xpack_usage_base.and(z.object({ indices_count: z.number(), full_copy_indices_count: z.optional(z.number()), - shared_cache_indices_count: z.optional(z.number()), - }) -); + shared_cache_indices_count: z.optional(z.number()) +})); export const xpack_usage_feature_toggle = z.object({ - enabled: z.boolean(), + enabled: z.boolean() }); -export const xpack_usage_audit = xpack_usage_feature_toggle.and( - z.object({ - outputs: z.optional(z.array(z.string())), - }) -); +export const xpack_usage_audit = xpack_usage_feature_toggle.and(z.object({ + outputs: z.optional(z.array(z.string())) +})); export const xpack_usage_ip_filter = z.object({ - http: z.boolean(), - transport: z.boolean(), + http: z.boolean(), + transport: z.boolean() }); export const xpack_usage_realm_cache = z.object({ - size: z.number(), + size: z.number() }); -export const xpack_usage_realm = xpack_usage_base.and( - z.object({ +export const xpack_usage_realm = xpack_usage_base.and(z.object({ name: z.optional(z.array(z.string())), order: z.optional(z.array(z.number())), size: z.optional(z.array(z.number())), @@ -25549,40 +21298,38 @@ export const xpack_usage_realm = xpack_usage_base.and( has_authorization_realms: z.optional(z.array(z.boolean())), has_default_username_pattern: z.optional(z.array(z.boolean())), has_truststore: z.optional(z.array(z.boolean())), - is_authentication_delegated: z.optional(z.array(z.boolean())), - }) -); + is_authentication_delegated: z.optional(z.array(z.boolean())) +})); export const xpack_usage_role_mapping = z.object({ - enabled: z.number(), - size: z.number(), + enabled: z.number(), + size: z.number() }); export const xpack_usage_security_roles_native = z.object({ - dls: z.boolean(), - fls: z.boolean(), - size: z.number(), + dls: z.boolean(), + fls: z.boolean(), + size: z.number() }); export const xpack_usage_security_roles_file = z.object({ - dls: z.boolean(), - fls: z.boolean(), - size: z.number(), + dls: z.boolean(), + fls: z.boolean(), + size: z.number() }); export const xpack_usage_security_roles = z.object({ - native: xpack_usage_security_roles_native, - dls: xpack_usage_security_roles_dls, - file: xpack_usage_security_roles_file, + native: xpack_usage_security_roles_native, + dls: xpack_usage_security_roles_dls, + file: xpack_usage_security_roles_file }); export const xpack_usage_ssl = z.object({ - http: xpack_usage_feature_toggle, - transport: xpack_usage_feature_toggle, + http: xpack_usage_feature_toggle, + transport: xpack_usage_feature_toggle }); -export const xpack_usage_security = xpack_usage_base.and( - z.object({ +export const xpack_usage_security = xpack_usage_base.and(z.object({ api_key_service: xpack_usage_feature_toggle, anonymous: xpack_usage_feature_toggle, audit: xpack_usage_audit, @@ -25594,3616 +21341,2595 @@ export const xpack_usage_security = xpack_usage_base.and( ssl: xpack_usage_ssl, system_key: z.optional(xpack_usage_feature_toggle), token_service: xpack_usage_feature_toggle, - operator_privileges: xpack_usage_base, - }) -); + operator_privileges: xpack_usage_base +})); -export const xpack_usage_slm = xpack_usage_base.and( - z.object({ +export const xpack_usage_slm = xpack_usage_base.and(z.object({ policy_count: z.optional(z.number()), - policy_stats: z.optional(slm_types_statistics), - }) -); + policy_stats: z.optional(slm_types_statistics) +})); -export const xpack_usage_sql = xpack_usage_base.and( - z.object({ +export const xpack_usage_sql = xpack_usage_base.and(z.object({ features: z.record(z.string(), z.number()), - queries: z.record(z.string(), xpack_usage_query), - }) -); + queries: z.record(z.string(), xpack_usage_query) +})); -export const xpack_usage_vector = xpack_usage_base.and( - z.object({ +export const xpack_usage_vector = xpack_usage_base.and(z.object({ dense_vector_dims_avg_count: z.number(), dense_vector_fields_count: z.number(), - sparse_vector_fields_count: z.optional(z.number()), - }) -); - -export const async_search_types_async_search_document_response_base = - async_search_types_async_search_response_base.and( - z.lazy(() => - z.object({ - get response() { - return z.lazy((): any => async_search_types_async_search); - }, - }) - ) - ); + sparse_vector_fields_count: z.optional(z.number()) +})); + +export const async_search_types_async_search_document_response_base = async_search_types_async_search_response_base.and(z.lazy(() => z.object({ + get response() { + return z.lazy((): any => async_search_types_async_search); + } +}))); export const async_search_types_async_search = z.object({ - get aggregations() { - return z.optional( - z - .record( - z.string(), - z.lazy((): any => types_aggregations_aggregate) - ) - .register(z.globalRegistry, { - description: - 'Partial aggregations results, coming from the shards that have already completed running the query.', - }) - ); - }, - _clusters: z.optional(types_cluster_statistics), - fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - get hits() { - return z.lazy((): any => global_search_types_hits_metadata); - }, - max_score: z.optional(z.number()), - num_reduce_phases: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Indicates how many reductions of the results have been performed.\nIf this number increases compared to the last retrieved results for a get asynch search request, you can expect additional results included in the search response.', - }) - ), - profile: z.optional(global_search_types_profile), - pit_id: z.optional(types_id), - _scroll_id: z.optional(types_scroll_id), - _shards: types_shard_statistics, - suggest: z.optional(z.record(z.string(), z.array(global_search_types_suggest))), - terminated_early: z.optional(z.boolean()), - timed_out: z.boolean(), - took: z.number(), + get aggregations() { + return z.optional(z.record(z.string(), z.lazy((): any => types_aggregations_aggregate)).register(z.globalRegistry, { + description: 'Partial aggregations results, coming from the shards that have already completed running the query.' + })); + }, + _clusters: z.optional(types_cluster_statistics), + fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + get hits() { + return z.lazy((): any => global_search_types_hits_metadata); + }, + max_score: z.optional(z.number()), + num_reduce_phases: z.optional(z.number().register(z.globalRegistry, { + description: 'Indicates how many reductions of the results have been performed.\nIf this number increases compared to the last retrieved results for a get asynch search request, you can expect additional results included in the search response.' + })), + profile: z.optional(global_search_types_profile), + pit_id: z.optional(types_id), + _scroll_id: z.optional(types_scroll_id), + _shards: types_shard_statistics, + suggest: z.optional(z.record(z.string(), z.array(global_search_types_suggest))), + terminated_early: z.optional(z.boolean()), + timed_out: z.boolean(), + took: z.number() }); export const types_aggregations_aggregate = z.union([ - types_aggregations_cardinality_aggregate, - types_aggregations_hdr_percentiles_aggregate, - types_aggregations_hdr_percentile_ranks_aggregate, - types_aggregations_t_digest_percentiles_aggregate, - types_aggregations_t_digest_percentile_ranks_aggregate, - types_aggregations_percentiles_bucket_aggregate, - types_aggregations_median_absolute_deviation_aggregate, - types_aggregations_min_aggregate, - types_aggregations_max_aggregate, - types_aggregations_sum_aggregate, - types_aggregations_avg_aggregate, - types_aggregations_weighted_avg_aggregate, - types_aggregations_value_count_aggregate, - types_aggregations_simple_value_aggregate, - types_aggregations_derivative_aggregate, - types_aggregations_bucket_metric_value_aggregate, - types_aggregations_change_point_aggregate, - types_aggregations_stats_aggregate, - types_aggregations_stats_bucket_aggregate, - types_aggregations_extended_stats_aggregate, - types_aggregations_extended_stats_bucket_aggregate, - types_aggregations_cartesian_bounds_aggregate, - types_aggregations_cartesian_centroid_aggregate, - types_aggregations_geo_bounds_aggregate, - types_aggregations_geo_centroid_aggregate, - types_aggregations_histogram_aggregate, - types_aggregations_date_histogram_aggregate, - types_aggregations_auto_date_histogram_aggregate, - types_aggregations_variable_width_histogram_aggregate, - types_aggregations_string_terms_aggregate, - types_aggregations_long_terms_aggregate, - types_aggregations_double_terms_aggregate, - types_aggregations_unmapped_terms_aggregate, - types_aggregations_long_rare_terms_aggregate, - types_aggregations_string_rare_terms_aggregate, - types_aggregations_unmapped_rare_terms_aggregate, - types_aggregations_multi_terms_aggregate, - types_aggregations_missing_aggregate, - types_aggregations_nested_aggregate, - types_aggregations_reverse_nested_aggregate, - types_aggregations_global_aggregate, - types_aggregations_filter_aggregate, - types_aggregations_children_aggregate, - types_aggregations_parent_aggregate, - types_aggregations_sampler_aggregate, - types_aggregations_unmapped_sampler_aggregate, - types_aggregations_geo_hash_grid_aggregate, - types_aggregations_geo_tile_grid_aggregate, - types_aggregations_geo_hex_grid_aggregate, - types_aggregations_range_aggregate, - types_aggregations_date_range_aggregate, - types_aggregations_geo_distance_aggregate, - types_aggregations_ip_range_aggregate, - types_aggregations_ip_prefix_aggregate, - types_aggregations_filters_aggregate, - types_aggregations_adjacency_matrix_aggregate, - types_aggregations_significant_long_terms_aggregate, - types_aggregations_significant_string_terms_aggregate, - types_aggregations_unmapped_significant_terms_aggregate, - types_aggregations_composite_aggregate, - types_aggregations_frequent_item_sets_aggregate, - types_aggregations_time_series_aggregate, - types_aggregations_scripted_metric_aggregate, - z.lazy((): any => types_aggregations_top_hits_aggregate), - types_aggregations_inference_aggregate, - types_aggregations_string_stats_aggregate, - types_aggregations_box_plot_aggregate, - types_aggregations_top_metrics_aggregate, - types_aggregations_t_test_aggregate, - types_aggregations_rate_aggregate, - types_aggregations_cumulative_cardinality_aggregate, - types_aggregations_matrix_stats_aggregate, - types_aggregations_geo_line_aggregate, -]); - -export const types_aggregations_top_hits_aggregate = types_aggregations_aggregate_base.and( - z.lazy(() => - z.object({ - get hits() { + types_aggregations_cardinality_aggregate, + types_aggregations_hdr_percentiles_aggregate, + types_aggregations_hdr_percentile_ranks_aggregate, + types_aggregations_t_digest_percentiles_aggregate, + types_aggregations_t_digest_percentile_ranks_aggregate, + types_aggregations_percentiles_bucket_aggregate, + types_aggregations_median_absolute_deviation_aggregate, + types_aggregations_min_aggregate, + types_aggregations_max_aggregate, + types_aggregations_sum_aggregate, + types_aggregations_avg_aggregate, + types_aggregations_weighted_avg_aggregate, + types_aggregations_value_count_aggregate, + types_aggregations_simple_value_aggregate, + types_aggregations_derivative_aggregate, + types_aggregations_bucket_metric_value_aggregate, + types_aggregations_change_point_aggregate, + types_aggregations_stats_aggregate, + types_aggregations_stats_bucket_aggregate, + types_aggregations_extended_stats_aggregate, + types_aggregations_extended_stats_bucket_aggregate, + types_aggregations_cartesian_bounds_aggregate, + types_aggregations_cartesian_centroid_aggregate, + types_aggregations_geo_bounds_aggregate, + types_aggregations_geo_centroid_aggregate, + types_aggregations_histogram_aggregate, + types_aggregations_date_histogram_aggregate, + types_aggregations_auto_date_histogram_aggregate, + types_aggregations_variable_width_histogram_aggregate, + types_aggregations_string_terms_aggregate, + types_aggregations_long_terms_aggregate, + types_aggregations_double_terms_aggregate, + types_aggregations_unmapped_terms_aggregate, + types_aggregations_long_rare_terms_aggregate, + types_aggregations_string_rare_terms_aggregate, + types_aggregations_unmapped_rare_terms_aggregate, + types_aggregations_multi_terms_aggregate, + types_aggregations_missing_aggregate, + types_aggregations_nested_aggregate, + types_aggregations_reverse_nested_aggregate, + types_aggregations_global_aggregate, + types_aggregations_filter_aggregate, + types_aggregations_children_aggregate, + types_aggregations_parent_aggregate, + types_aggregations_sampler_aggregate, + types_aggregations_unmapped_sampler_aggregate, + types_aggregations_geo_hash_grid_aggregate, + types_aggregations_geo_tile_grid_aggregate, + types_aggregations_geo_hex_grid_aggregate, + types_aggregations_range_aggregate, + types_aggregations_date_range_aggregate, + types_aggregations_geo_distance_aggregate, + types_aggregations_ip_range_aggregate, + types_aggregations_ip_prefix_aggregate, + types_aggregations_filters_aggregate, + types_aggregations_adjacency_matrix_aggregate, + types_aggregations_significant_long_terms_aggregate, + types_aggregations_significant_string_terms_aggregate, + types_aggregations_unmapped_significant_terms_aggregate, + types_aggregations_composite_aggregate, + types_aggregations_frequent_item_sets_aggregate, + types_aggregations_time_series_aggregate, + types_aggregations_scripted_metric_aggregate, + z.lazy((): any => types_aggregations_top_hits_aggregate), + types_aggregations_inference_aggregate, + types_aggregations_string_stats_aggregate, + types_aggregations_box_plot_aggregate, + types_aggregations_top_metrics_aggregate, + types_aggregations_t_test_aggregate, + types_aggregations_rate_aggregate, + types_aggregations_cumulative_cardinality_aggregate, + types_aggregations_matrix_stats_aggregate, + types_aggregations_geo_line_aggregate +]); + +export const types_aggregations_top_hits_aggregate = types_aggregations_aggregate_base.and(z.lazy(() => z.object({ + get hits() { return z.lazy((): any => global_search_types_hits_metadata); - }, - }) - ) -); + } +}))); export const global_search_types_hits_metadata = z.object({ - total: z.optional(z.union([global_search_types_total_hits, z.number()])), - get hits() { - return z.array(z.lazy((): any => global_search_types_hit)); - }, - max_score: z.optional(z.union([z.number(), z.string(), z.null()])), + total: z.optional(z.union([ + global_search_types_total_hits, + z.number() + ])), + get hits() { + return z.array(z.lazy((): any => global_search_types_hit)); + }, + max_score: z.optional(z.union([ + z.number(), + z.string(), + z.null() + ])) }); export const global_search_types_hit = z.object({ - _index: types_index_name, - _id: z.optional(types_id), - _score: z.optional(z.union([z.number(), z.string(), z.null()])), - _explanation: z.optional(global_explain_explanation), - fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - highlight: z.optional(z.record(z.string(), z.array(z.string()))), - get inner_hits() { - return z.optional( - z.record( + _index: types_index_name, + _id: z.optional(types_id), + _score: z.optional(z.union([ + z.number(), z.string(), - z.lazy((): any => global_search_types_inner_hits_result) - ) - ); - }, - matched_queries: z.optional(z.union([z.array(z.string()), z.record(z.string(), z.number())])), - _nested: z.optional(global_search_types_nested_identity), - _ignored: z.optional(z.array(z.string())), - ignored_field_values: z.optional( - z.record(z.string(), z.array(z.record(z.string(), z.unknown()))) - ), - _shard: z.optional(z.string()), - _node: z.optional(z.string()), - _routing: z.optional(z.string()), - _source: z.optional(z.record(z.string(), z.unknown())), - _rank: z.optional(z.number()), - _seq_no: z.optional(types_sequence_number), - _primary_term: z.optional(z.number()), - _version: z.optional(types_version_number), - sort: z.optional(types_sort_results), + z.null() + ])), + _explanation: z.optional(global_explain_explanation), + fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + highlight: z.optional(z.record(z.string(), z.array(z.string()))), + get inner_hits() { + return z.optional(z.record(z.string(), z.lazy((): any => global_search_types_inner_hits_result))); + }, + matched_queries: z.optional(z.union([ + z.array(z.string()), + z.record(z.string(), z.number()) + ])), + _nested: z.optional(global_search_types_nested_identity), + _ignored: z.optional(z.array(z.string())), + ignored_field_values: z.optional(z.record(z.string(), z.array(z.record(z.string(), z.unknown())))), + _shard: z.optional(z.string()), + _node: z.optional(z.string()), + _routing: z.optional(z.string()), + _source: z.optional(z.record(z.string(), z.unknown())), + _rank: z.optional(z.number()), + _seq_no: z.optional(types_sequence_number), + _primary_term: z.optional(z.number()), + _version: z.optional(types_version_number), + sort: z.optional(types_sort_results) }); export const global_search_types_inner_hits_result = z.object({ - hits: global_search_types_hits_metadata, + hits: global_search_types_hits_metadata }); -export const types_aggregations_aggregation_container = z - .object({ +export const types_aggregations_aggregation_container = z.object({ get aggregations() { - return z.optional( - z - .record( - z.string(), - z.lazy((): any => types_aggregations_aggregation_container) - ) - .register(z.globalRegistry, { - description: - 'Sub-aggregations for this aggregation.\nOnly applies to bucket aggregations.', - }) - ); + return z.optional(z.record(z.string(), z.lazy((): any => types_aggregations_aggregation_container)).register(z.globalRegistry, { + description: 'Sub-aggregations for this aggregation.\nOnly applies to bucket aggregations.' + })); }, - meta: z.optional(types_metadata), - }) - .and( - z.lazy(() => - z.object({ - get adjacency_matrix() { - return z.optional(z.lazy((): any => types_aggregations_adjacency_matrix_aggregation)); - }, - get auto_date_histogram() { - return z.optional(z.lazy((): any => types_aggregations_auto_date_histogram_aggregation)); - }, - get avg() { - return z.optional(z.lazy((): any => types_aggregations_average_aggregation)); - }, - avg_bucket: z.optional(types_aggregations_average_bucket_aggregation), - get boxplot() { - return z.optional(z.lazy((): any => types_aggregations_boxplot_aggregation)); - }, - get bucket_script() { - return z.optional(z.lazy((): any => types_aggregations_bucket_script_aggregation)); - }, - get bucket_selector() { - return z.optional(z.lazy((): any => types_aggregations_bucket_selector_aggregation)); - }, - get bucket_sort() { - return z.optional(z.lazy((): any => types_aggregations_bucket_sort_aggregation)); - }, - bucket_count_ks_test: z.optional(types_aggregations_bucket_ks_aggregation), - bucket_correlation: z.optional(types_aggregations_bucket_correlation_aggregation), - get cardinality() { - return z.optional(z.lazy((): any => types_aggregations_cardinality_aggregation)); - }, - get cartesian_bounds() { - return z.optional(z.lazy((): any => types_aggregations_cartesian_bounds_aggregation)); - }, - get cartesian_centroid() { - return z.optional(z.lazy((): any => types_aggregations_cartesian_centroid_aggregation)); - }, - categorize_text: z.optional(types_aggregations_categorize_text_aggregation), - change_point: z.optional(types_aggregations_change_point_aggregation), - children: z.optional(types_aggregations_children_aggregation), - get composite() { - return z.optional(z.lazy((): any => types_aggregations_composite_aggregation)); - }, - cumulative_cardinality: z.optional(types_aggregations_cumulative_cardinality_aggregation), - cumulative_sum: z.optional(types_aggregations_cumulative_sum_aggregation), - get date_histogram() { - return z.optional(z.lazy((): any => types_aggregations_date_histogram_aggregation)); - }, - date_range: z.optional(types_aggregations_date_range_aggregation), - derivative: z.optional(types_aggregations_derivative_aggregation), - get diversified_sampler() { - return z.optional(z.lazy((): any => types_aggregations_diversified_sampler_aggregation)); - }, - get extended_stats() { - return z.optional(z.lazy((): any => types_aggregations_extended_stats_aggregation)); - }, - extended_stats_bucket: z.optional(types_aggregations_extended_stats_bucket_aggregation), - get frequent_item_sets() { - return z.optional(z.lazy((): any => types_aggregations_frequent_item_sets_aggregation)); - }, - get filter() { - return z.optional(z.lazy((): any => types_query_dsl_query_container)); - }, - get filters() { - return z.optional(z.lazy((): any => types_aggregations_filters_aggregation)); - }, - get geo_bounds() { - return z.optional(z.lazy((): any => types_aggregations_geo_bounds_aggregation)); - }, - get geo_centroid() { - return z.optional(z.lazy((): any => types_aggregations_geo_centroid_aggregation)); - }, - geo_distance: z.optional(types_aggregations_geo_distance_aggregation), - geohash_grid: z.optional(types_aggregations_geo_hash_grid_aggregation), - geo_line: z.optional(types_aggregations_geo_line_aggregation), - geotile_grid: z.optional(types_aggregations_geo_tile_grid_aggregation), - geohex_grid: z.optional(types_aggregations_geohex_grid_aggregation), - global: z.optional(types_aggregations_global_aggregation), - get histogram() { - return z.optional(z.lazy((): any => types_aggregations_histogram_aggregation)); - }, - ip_range: z.optional(types_aggregations_ip_range_aggregation), - ip_prefix: z.optional(types_aggregations_ip_prefix_aggregation), - inference: z.optional(types_aggregations_inference_aggregation), - line: z.optional(types_aggregations_geo_line_aggregation), - matrix_stats: z.optional(types_aggregations_matrix_stats_aggregation), - get max() { - return z.optional(z.lazy((): any => types_aggregations_max_aggregation)); - }, - max_bucket: z.optional(types_aggregations_max_bucket_aggregation), - get median_absolute_deviation() { - return z.optional( - z.lazy((): any => types_aggregations_median_absolute_deviation_aggregation) - ); - }, - get min() { - return z.optional(z.lazy((): any => types_aggregations_min_aggregation)); - }, - min_bucket: z.optional(types_aggregations_min_bucket_aggregation), - missing: z.optional(types_aggregations_missing_aggregation), - moving_avg: z.optional(types_aggregations_moving_average_aggregation), - moving_percentiles: z.optional(types_aggregations_moving_percentiles_aggregation), - moving_fn: z.optional(types_aggregations_moving_function_aggregation), - multi_terms: z.optional(types_aggregations_multi_terms_aggregation), - nested: z.optional(types_aggregations_nested_aggregation), - normalize: z.optional(types_aggregations_normalize_aggregation), - parent: z.optional(types_aggregations_parent_aggregation), - get percentile_ranks() { - return z.optional(z.lazy((): any => types_aggregations_percentile_ranks_aggregation)); - }, - get percentiles() { - return z.optional(z.lazy((): any => types_aggregations_percentiles_aggregation)); - }, - percentiles_bucket: z.optional(types_aggregations_percentiles_bucket_aggregation), - get range() { - return z.optional(z.lazy((): any => types_aggregations_range_aggregation)); - }, - rare_terms: z.optional(types_aggregations_rare_terms_aggregation), - get rate() { - return z.optional(z.lazy((): any => types_aggregations_rate_aggregation)); - }, - reverse_nested: z.optional(types_aggregations_reverse_nested_aggregation), - random_sampler: z.optional(types_aggregations_random_sampler_aggregation), - sampler: z.optional(types_aggregations_sampler_aggregation), - get scripted_metric() { - return z.optional(z.lazy((): any => types_aggregations_scripted_metric_aggregation)); - }, - serial_diff: z.optional(types_aggregations_serial_differencing_aggregation), - get significant_terms() { - return z.optional(z.lazy((): any => types_aggregations_significant_terms_aggregation)); - }, - get significant_text() { - return z.optional(z.lazy((): any => types_aggregations_significant_text_aggregation)); - }, - get stats() { - return z.optional(z.lazy((): any => types_aggregations_stats_aggregation)); - }, - stats_bucket: z.optional(types_aggregations_stats_bucket_aggregation), - get string_stats() { - return z.optional(z.lazy((): any => types_aggregations_string_stats_aggregation)); - }, - get sum() { - return z.optional(z.lazy((): any => types_aggregations_sum_aggregation)); - }, - sum_bucket: z.optional(types_aggregations_sum_bucket_aggregation), - get terms() { - return z.optional(z.lazy((): any => types_aggregations_terms_aggregation)); - }, - time_series: z.optional(types_aggregations_time_series_aggregation), - get top_hits() { - return z.optional(z.lazy((): any => types_aggregations_top_hits_aggregation)); - }, - get t_test() { - return z.optional(z.lazy((): any => types_aggregations_t_test_aggregation)); - }, - get top_metrics() { - return z.optional(z.lazy((): any => types_aggregations_top_metrics_aggregation)); - }, - get value_count() { - return z.optional(z.lazy((): any => types_aggregations_value_count_aggregation)); - }, - get weighted_avg() { - return z.optional(z.lazy((): any => types_aggregations_weighted_average_aggregation)); - }, - get variable_width_histogram() { - return z.optional( - z.lazy((): any => types_aggregations_variable_width_histogram_aggregation) - ); - }, - }) - ) - ); - -export const types_aggregations_adjacency_matrix_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.lazy(() => - z.object({ - get filters() { - return z.optional( - z - .record( - z.string(), - z.lazy((): any => types_query_dsl_query_container) - ) - .register(z.globalRegistry, { - description: 'Filters used to create buckets.\nAt least one filter is required.', - }) - ); - }, - separator: z.optional( - z.string().register(z.globalRegistry, { - description: 'Separator used to concatenate filter names. Defaults to &.', - }) - ), - }) - ) - ); + meta: z.optional(types_metadata) +}).and(z.lazy(() => z.object({ + get adjacency_matrix() { + return z.optional(z.lazy((): any => types_aggregations_adjacency_matrix_aggregation)); + }, + get auto_date_histogram() { + return z.optional(z.lazy((): any => types_aggregations_auto_date_histogram_aggregation)); + }, + get avg() { + return z.optional(z.lazy((): any => types_aggregations_average_aggregation)); + }, + avg_bucket: z.optional(types_aggregations_average_bucket_aggregation), + get boxplot() { + return z.optional(z.lazy((): any => types_aggregations_boxplot_aggregation)); + }, + get bucket_script() { + return z.optional(z.lazy((): any => types_aggregations_bucket_script_aggregation)); + }, + get bucket_selector() { + return z.optional(z.lazy((): any => types_aggregations_bucket_selector_aggregation)); + }, + get bucket_sort() { + return z.optional(z.lazy((): any => types_aggregations_bucket_sort_aggregation)); + }, + bucket_count_ks_test: z.optional(types_aggregations_bucket_ks_aggregation), + bucket_correlation: z.optional(types_aggregations_bucket_correlation_aggregation), + get cardinality() { + return z.optional(z.lazy((): any => types_aggregations_cardinality_aggregation)); + }, + get cartesian_bounds() { + return z.optional(z.lazy((): any => types_aggregations_cartesian_bounds_aggregation)); + }, + get cartesian_centroid() { + return z.optional(z.lazy((): any => types_aggregations_cartesian_centroid_aggregation)); + }, + categorize_text: z.optional(types_aggregations_categorize_text_aggregation), + change_point: z.optional(types_aggregations_change_point_aggregation), + children: z.optional(types_aggregations_children_aggregation), + get composite() { + return z.optional(z.lazy((): any => types_aggregations_composite_aggregation)); + }, + cumulative_cardinality: z.optional(types_aggregations_cumulative_cardinality_aggregation), + cumulative_sum: z.optional(types_aggregations_cumulative_sum_aggregation), + get date_histogram() { + return z.optional(z.lazy((): any => types_aggregations_date_histogram_aggregation)); + }, + date_range: z.optional(types_aggregations_date_range_aggregation), + derivative: z.optional(types_aggregations_derivative_aggregation), + get diversified_sampler() { + return z.optional(z.lazy((): any => types_aggregations_diversified_sampler_aggregation)); + }, + get extended_stats() { + return z.optional(z.lazy((): any => types_aggregations_extended_stats_aggregation)); + }, + extended_stats_bucket: z.optional(types_aggregations_extended_stats_bucket_aggregation), + get frequent_item_sets() { + return z.optional(z.lazy((): any => types_aggregations_frequent_item_sets_aggregation)); + }, + get filter() { + return z.optional(z.lazy((): any => types_query_dsl_query_container)); + }, + get filters() { + return z.optional(z.lazy((): any => types_aggregations_filters_aggregation)); + }, + get geo_bounds() { + return z.optional(z.lazy((): any => types_aggregations_geo_bounds_aggregation)); + }, + get geo_centroid() { + return z.optional(z.lazy((): any => types_aggregations_geo_centroid_aggregation)); + }, + geo_distance: z.optional(types_aggregations_geo_distance_aggregation), + geohash_grid: z.optional(types_aggregations_geo_hash_grid_aggregation), + geo_line: z.optional(types_aggregations_geo_line_aggregation), + geotile_grid: z.optional(types_aggregations_geo_tile_grid_aggregation), + geohex_grid: z.optional(types_aggregations_geohex_grid_aggregation), + global: z.optional(types_aggregations_global_aggregation), + get histogram() { + return z.optional(z.lazy((): any => types_aggregations_histogram_aggregation)); + }, + ip_range: z.optional(types_aggregations_ip_range_aggregation), + ip_prefix: z.optional(types_aggregations_ip_prefix_aggregation), + inference: z.optional(types_aggregations_inference_aggregation), + line: z.optional(types_aggregations_geo_line_aggregation), + matrix_stats: z.optional(types_aggregations_matrix_stats_aggregation), + get max() { + return z.optional(z.lazy((): any => types_aggregations_max_aggregation)); + }, + max_bucket: z.optional(types_aggregations_max_bucket_aggregation), + get median_absolute_deviation() { + return z.optional(z.lazy((): any => types_aggregations_median_absolute_deviation_aggregation)); + }, + get min() { + return z.optional(z.lazy((): any => types_aggregations_min_aggregation)); + }, + min_bucket: z.optional(types_aggregations_min_bucket_aggregation), + missing: z.optional(types_aggregations_missing_aggregation), + moving_avg: z.optional(types_aggregations_moving_average_aggregation), + moving_percentiles: z.optional(types_aggregations_moving_percentiles_aggregation), + moving_fn: z.optional(types_aggregations_moving_function_aggregation), + multi_terms: z.optional(types_aggregations_multi_terms_aggregation), + nested: z.optional(types_aggregations_nested_aggregation), + normalize: z.optional(types_aggregations_normalize_aggregation), + parent: z.optional(types_aggregations_parent_aggregation), + get percentile_ranks() { + return z.optional(z.lazy((): any => types_aggregations_percentile_ranks_aggregation)); + }, + get percentiles() { + return z.optional(z.lazy((): any => types_aggregations_percentiles_aggregation)); + }, + percentiles_bucket: z.optional(types_aggregations_percentiles_bucket_aggregation), + get range() { + return z.optional(z.lazy((): any => types_aggregations_range_aggregation)); + }, + rare_terms: z.optional(types_aggregations_rare_terms_aggregation), + get rate() { + return z.optional(z.lazy((): any => types_aggregations_rate_aggregation)); + }, + reverse_nested: z.optional(types_aggregations_reverse_nested_aggregation), + random_sampler: z.optional(types_aggregations_random_sampler_aggregation), + sampler: z.optional(types_aggregations_sampler_aggregation), + get scripted_metric() { + return z.optional(z.lazy((): any => types_aggregations_scripted_metric_aggregation)); + }, + serial_diff: z.optional(types_aggregations_serial_differencing_aggregation), + get significant_terms() { + return z.optional(z.lazy((): any => types_aggregations_significant_terms_aggregation)); + }, + get significant_text() { + return z.optional(z.lazy((): any => types_aggregations_significant_text_aggregation)); + }, + get stats() { + return z.optional(z.lazy((): any => types_aggregations_stats_aggregation)); + }, + stats_bucket: z.optional(types_aggregations_stats_bucket_aggregation), + get string_stats() { + return z.optional(z.lazy((): any => types_aggregations_string_stats_aggregation)); + }, + get sum() { + return z.optional(z.lazy((): any => types_aggregations_sum_aggregation)); + }, + sum_bucket: z.optional(types_aggregations_sum_bucket_aggregation), + get terms() { + return z.optional(z.lazy((): any => types_aggregations_terms_aggregation)); + }, + time_series: z.optional(types_aggregations_time_series_aggregation), + get top_hits() { + return z.optional(z.lazy((): any => types_aggregations_top_hits_aggregation)); + }, + get t_test() { + return z.optional(z.lazy((): any => types_aggregations_t_test_aggregation)); + }, + get top_metrics() { + return z.optional(z.lazy((): any => types_aggregations_top_metrics_aggregation)); + }, + get value_count() { + return z.optional(z.lazy((): any => types_aggregations_value_count_aggregation)); + }, + get weighted_avg() { + return z.optional(z.lazy((): any => types_aggregations_weighted_average_aggregation)); + }, + get variable_width_histogram() { + return z.optional(z.lazy((): any => types_aggregations_variable_width_histogram_aggregation)); + } +}))); + +export const types_aggregations_adjacency_matrix_aggregation = types_aggregations_bucket_aggregation_base.and(z.lazy(() => z.object({ + get filters() { + return z.optional(z.record(z.string(), z.lazy((): any => types_query_dsl_query_container)).register(z.globalRegistry, { + description: 'Filters used to create buckets.\nAt least one filter is required.' + })); + }, + separator: z.optional(z.string().register(z.globalRegistry, { + description: 'Separator used to concatenate filter names. Defaults to &.' + })) +}))); /** * An Elasticsearch Query DSL (Domain Specific Language) object that defines a query. */ -export const types_query_dsl_query_container = z - .object({ +export const types_query_dsl_query_container = z.object({ get bool() { - return z.optional(z.lazy((): any => types_query_dsl_bool_query)); + return z.optional(z.lazy((): any => types_query_dsl_bool_query)); }, get boosting() { - return z.optional(z.lazy((): any => types_query_dsl_boosting_query)); + return z.optional(z.lazy((): any => types_query_dsl_boosting_query)); }, common: z.optional(z.record(z.string(), types_query_dsl_common_terms_query)), combined_fields: z.optional(types_query_dsl_combined_fields_query), get constant_score() { - return z.optional(z.lazy((): any => types_query_dsl_constant_score_query)); + return z.optional(z.lazy((): any => types_query_dsl_constant_score_query)); }, get dis_max() { - return z.optional(z.lazy((): any => types_query_dsl_dis_max_query)); + return z.optional(z.lazy((): any => types_query_dsl_dis_max_query)); }, distance_feature: z.optional(types_query_dsl_distance_feature_query), exists: z.optional(types_query_dsl_exists_query), get function_score() { - return z.optional(z.lazy((): any => types_query_dsl_function_score_query)); + return z.optional(z.lazy((): any => types_query_dsl_function_score_query)); }, - fuzzy: z.optional( - z.record(z.string(), types_query_dsl_fuzzy_query).register(z.globalRegistry, { - description: - 'Returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance.', - }) - ), + fuzzy: z.optional(z.record(z.string(), types_query_dsl_fuzzy_query).register(z.globalRegistry, { + description: 'Returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance.' + })), geo_bounding_box: z.optional(types_query_dsl_geo_bounding_box_query), geo_distance: z.optional(types_query_dsl_geo_distance_query), - geo_grid: z.optional( - z.record(z.string(), types_query_dsl_geo_grid_query).register(z.globalRegistry, { - description: - 'Matches `geo_point` and `geo_shape` values that intersect a grid cell from a GeoGrid aggregation.', - }) - ), + geo_grid: z.optional(z.record(z.string(), types_query_dsl_geo_grid_query).register(z.globalRegistry, { + description: 'Matches `geo_point` and `geo_shape` values that intersect a grid cell from a GeoGrid aggregation.' + })), geo_polygon: z.optional(types_query_dsl_geo_polygon_query), geo_shape: z.optional(types_query_dsl_geo_shape_query), get has_child() { - return z.optional(z.lazy((): any => types_query_dsl_has_child_query)); + return z.optional(z.lazy((): any => types_query_dsl_has_child_query)); }, get has_parent() { - return z.optional(z.lazy((): any => types_query_dsl_has_parent_query)); + return z.optional(z.lazy((): any => types_query_dsl_has_parent_query)); }, ids: z.optional(types_query_dsl_ids_query), get intervals() { - return z.optional( - z - .record( - z.string(), - z.lazy((): any => types_query_dsl_intervals_query) - ) - .register(z.globalRegistry, { - description: 'Returns documents based on the order and proximity of matching terms.', - }) - ); + return z.optional(z.record(z.string(), z.lazy((): any => types_query_dsl_intervals_query)).register(z.globalRegistry, { + description: 'Returns documents based on the order and proximity of matching terms.' + })); }, get knn() { - return z.optional(z.lazy((): any => types_knn_query)); + return z.optional(z.lazy((): any => types_knn_query)); }, - match: z.optional( - z.record(z.string(), types_query_dsl_match_query).register(z.globalRegistry, { - description: - 'Returns documents that match a provided text, number, date or boolean value.\nThe provided text is analyzed before matching.', - }) - ), + match: z.optional(z.record(z.string(), types_query_dsl_match_query).register(z.globalRegistry, { + description: 'Returns documents that match a provided text, number, date or boolean value.\nThe provided text is analyzed before matching.' + })), match_all: z.optional(types_query_dsl_match_all_query), - match_bool_prefix: z.optional( - z.record(z.string(), types_query_dsl_match_bool_prefix_query).register(z.globalRegistry, { - description: - 'Analyzes its input and constructs a `bool` query from the terms.\nEach term except the last is used in a `term` query.\nThe last term is used in a prefix query.', - }) - ), + match_bool_prefix: z.optional(z.record(z.string(), types_query_dsl_match_bool_prefix_query).register(z.globalRegistry, { + description: 'Analyzes its input and constructs a `bool` query from the terms.\nEach term except the last is used in a `term` query.\nThe last term is used in a prefix query.' + })), match_none: z.optional(types_query_dsl_match_none_query), - match_phrase: z.optional( - z.record(z.string(), types_query_dsl_match_phrase_query).register(z.globalRegistry, { - description: 'Analyzes the text and creates a phrase query out of the analyzed text.', - }) - ), - match_phrase_prefix: z.optional( - z.record(z.string(), types_query_dsl_match_phrase_prefix_query).register(z.globalRegistry, { - description: - 'Returns documents that contain the words of a provided text, in the same order as provided.\nThe last term of the provided text is treated as a prefix, matching any words that begin with that term.', - }) - ), + match_phrase: z.optional(z.record(z.string(), types_query_dsl_match_phrase_query).register(z.globalRegistry, { + description: 'Analyzes the text and creates a phrase query out of the analyzed text.' + })), + match_phrase_prefix: z.optional(z.record(z.string(), types_query_dsl_match_phrase_prefix_query).register(z.globalRegistry, { + description: 'Returns documents that contain the words of a provided text, in the same order as provided.\nThe last term of the provided text is treated as a prefix, matching any words that begin with that term.' + })), more_like_this: z.optional(types_query_dsl_more_like_this_query), multi_match: z.optional(types_query_dsl_multi_match_query), get nested() { - return z.optional(z.lazy((): any => types_query_dsl_nested_query)); + return z.optional(z.lazy((): any => types_query_dsl_nested_query)); }, parent_id: z.optional(types_query_dsl_parent_id_query), percolate: z.optional(types_query_dsl_percolate_query), get pinned() { - return z.optional(z.lazy((): any => types_query_dsl_pinned_query)); + return z.optional(z.lazy((): any => types_query_dsl_pinned_query)); }, - prefix: z.optional( - z.record(z.string(), types_query_dsl_prefix_query).register(z.globalRegistry, { - description: 'Returns documents that contain a specific prefix in a provided field.', - }) - ), + prefix: z.optional(z.record(z.string(), types_query_dsl_prefix_query).register(z.globalRegistry, { + description: 'Returns documents that contain a specific prefix in a provided field.' + })), query_string: z.optional(types_query_dsl_query_string_query), - range: z.optional( - z.record(z.string(), types_query_dsl_range_query).register(z.globalRegistry, { - description: 'Returns documents that contain terms within a provided range.', - }) - ), + range: z.optional(z.record(z.string(), types_query_dsl_range_query).register(z.globalRegistry, { + description: 'Returns documents that contain terms within a provided range.' + })), rank_feature: z.optional(types_query_dsl_rank_feature_query), - regexp: z.optional( - z.record(z.string(), types_query_dsl_regexp_query).register(z.globalRegistry, { - description: 'Returns documents that contain terms matching a regular expression.', - }) - ), + regexp: z.optional(z.record(z.string(), types_query_dsl_regexp_query).register(z.globalRegistry, { + description: 'Returns documents that contain terms matching a regular expression.' + })), get rule() { - return z.optional(z.lazy((): any => types_query_dsl_rule_query)); + return z.optional(z.lazy((): any => types_query_dsl_rule_query)); }, get script() { - return z.optional(z.lazy((): any => types_query_dsl_script_query)); + return z.optional(z.lazy((): any => types_query_dsl_script_query)); }, get script_score() { - return z.optional(z.lazy((): any => types_query_dsl_script_score_query)); + return z.optional(z.lazy((): any => types_query_dsl_script_score_query)); }, semantic: z.optional(types_query_dsl_semantic_query), shape: z.optional(types_query_dsl_shape_query), simple_query_string: z.optional(types_query_dsl_simple_query_string_query), get span_containing() { - return z.optional(z.lazy((): any => types_query_dsl_span_containing_query)); + return z.optional(z.lazy((): any => types_query_dsl_span_containing_query)); }, get span_field_masking() { - return z.optional(z.lazy((): any => types_query_dsl_span_field_masking_query)); + return z.optional(z.lazy((): any => types_query_dsl_span_field_masking_query)); }, get span_first() { - return z.optional(z.lazy((): any => types_query_dsl_span_first_query)); + return z.optional(z.lazy((): any => types_query_dsl_span_first_query)); }, get span_multi() { - return z.optional(z.lazy((): any => types_query_dsl_span_multi_term_query)); + return z.optional(z.lazy((): any => types_query_dsl_span_multi_term_query)); }, get span_near() { - return z.optional(z.lazy((): any => types_query_dsl_span_near_query)); + return z.optional(z.lazy((): any => types_query_dsl_span_near_query)); }, get span_not() { - return z.optional(z.lazy((): any => types_query_dsl_span_not_query)); + return z.optional(z.lazy((): any => types_query_dsl_span_not_query)); }, get span_or() { - return z.optional(z.lazy((): any => types_query_dsl_span_or_query)); + return z.optional(z.lazy((): any => types_query_dsl_span_or_query)); }, - span_term: z.optional( - z.record(z.string(), types_query_dsl_span_term_query).register(z.globalRegistry, { - description: 'Matches spans containing a term.', - }) - ), + span_term: z.optional(z.record(z.string(), types_query_dsl_span_term_query).register(z.globalRegistry, { + description: 'Matches spans containing a term.' + })), get span_within() { - return z.optional(z.lazy((): any => types_query_dsl_span_within_query)); + return z.optional(z.lazy((): any => types_query_dsl_span_within_query)); }, sparse_vector: z.optional(types_query_dsl_sparse_vector_query), - term: z.optional( - z.record(z.string(), types_query_dsl_term_query).register(z.globalRegistry, { - description: - "Returns documents that contain an exact term in a provided field.\nTo return a document, the query term must exactly match the queried field's value, including whitespace and capitalization.", - }) - ), + term: z.optional(z.record(z.string(), types_query_dsl_term_query).register(z.globalRegistry, { + description: 'Returns documents that contain an exact term in a provided field.\nTo return a document, the query term must exactly match the queried field\'s value, including whitespace and capitalization.' + })), terms: z.optional(types_query_dsl_terms_query), get terms_set() { - return z.optional( - z - .record( - z.string(), - z.lazy((): any => types_query_dsl_terms_set_query) - ) - .register(z.globalRegistry, { - description: - 'Returns documents that contain a minimum number of exact terms in a provided field.\nTo return a document, a required number of terms must exactly match the field values, including whitespace and capitalization.', - }) - ); + return z.optional(z.record(z.string(), z.lazy((): any => types_query_dsl_terms_set_query)).register(z.globalRegistry, { + description: 'Returns documents that contain a minimum number of exact terms in a provided field.\nTo return a document, a required number of terms must exactly match the field values, including whitespace and capitalization.' + })); }, - text_expansion: z.optional( - z.record(z.string(), types_query_dsl_text_expansion_query).register(z.globalRegistry, { - description: - 'Uses a natural language processing model to convert the query text into a list of token-weight pairs which are then used in a query against a sparse vector or rank features field.', - }) - ), - weighted_tokens: z.optional( - z.record(z.string(), types_query_dsl_weighted_tokens_query).register(z.globalRegistry, { - description: - 'Supports returning text_expansion query results by sending in precomputed tokens with the query.', - }) - ), - wildcard: z.optional( - z.record(z.string(), types_query_dsl_wildcard_query).register(z.globalRegistry, { - description: 'Returns documents that contain terms matching a wildcard pattern.', - }) - ), + text_expansion: z.optional(z.record(z.string(), types_query_dsl_text_expansion_query).register(z.globalRegistry, { + description: 'Uses a natural language processing model to convert the query text into a list of token-weight pairs which are then used in a query against a sparse vector or rank features field.' + })), + weighted_tokens: z.optional(z.record(z.string(), types_query_dsl_weighted_tokens_query).register(z.globalRegistry, { + description: 'Supports returning text_expansion query results by sending in precomputed tokens with the query.' + })), + wildcard: z.optional(z.record(z.string(), types_query_dsl_wildcard_query).register(z.globalRegistry, { + description: 'Returns documents that contain terms matching a wildcard pattern.' + })), wrapper: z.optional(types_query_dsl_wrapper_query), - type: z.optional(types_query_dsl_type_query), - }) - .register(z.globalRegistry, { - description: - 'An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.', - }); - -export const types_query_dsl_bool_query = types_query_dsl_query_base.and( - z.object({ - filter: z.optional( - z.union([types_query_dsl_query_container, z.array(types_query_dsl_query_container)]) - ), + type: z.optional(types_query_dsl_type_query) +}).register(z.globalRegistry, { + description: 'An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.' +}); + +export const types_query_dsl_bool_query = types_query_dsl_query_base.and(z.object({ + filter: z.optional(z.union([ + types_query_dsl_query_container, + z.array(types_query_dsl_query_container) + ])), minimum_should_match: z.optional(types_minimum_should_match), - must: z.optional( - z.union([types_query_dsl_query_container, z.array(types_query_dsl_query_container)]) - ), - must_not: z.optional( - z.union([types_query_dsl_query_container, z.array(types_query_dsl_query_container)]) - ), - should: z.optional( - z.union([types_query_dsl_query_container, z.array(types_query_dsl_query_container)]) - ), - }) -); - -export const types_query_dsl_boosting_query = types_query_dsl_query_base.and( - z.object({ + must: z.optional(z.union([ + types_query_dsl_query_container, + z.array(types_query_dsl_query_container) + ])), + must_not: z.optional(z.union([ + types_query_dsl_query_container, + z.array(types_query_dsl_query_container) + ])), + should: z.optional(z.union([ + types_query_dsl_query_container, + z.array(types_query_dsl_query_container) + ])) +})); + +export const types_query_dsl_boosting_query = types_query_dsl_query_base.and(z.object({ negative_boost: z.number().register(z.globalRegistry, { - description: - 'Floating point number between 0 and 1.0 used to decrease the relevance scores of documents matching the `negative` query.', + description: 'Floating point number between 0 and 1.0 used to decrease the relevance scores of documents matching the `negative` query.' }), negative: types_query_dsl_query_container, - positive: types_query_dsl_query_container, - }) -); - -export const types_query_dsl_constant_score_query = types_query_dsl_query_base.and( - z.object({ - filter: types_query_dsl_query_container, - }) -); - -export const types_query_dsl_dis_max_query = types_query_dsl_query_base.and( - z.object({ + positive: types_query_dsl_query_container +})); + +export const types_query_dsl_constant_score_query = types_query_dsl_query_base.and(z.object({ + filter: types_query_dsl_query_container +})); + +export const types_query_dsl_dis_max_query = types_query_dsl_query_base.and(z.object({ queries: z.array(types_query_dsl_query_container).register(z.globalRegistry, { - description: - 'One or more query clauses.\nReturned documents must match one or more of these queries.\nIf a document matches multiple queries, Elasticsearch uses the highest relevance score.', - }), - tie_breaker: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Floating point number between 0 and 1.0 used to increase the relevance scores of documents matching multiple query clauses.', - }) - ), - }) -); - -export const types_query_dsl_function_score_query = types_query_dsl_query_base.and( - z.lazy(() => - z.object({ - boost_mode: z.optional(types_query_dsl_function_boost_mode), - get functions() { - return z.optional( - z - .array(z.lazy((): any => types_query_dsl_function_score_container)) - .register(z.globalRegistry, { - description: - 'One or more functions that compute a new score for each document returned by the query.', - }) - ); - }, - max_boost: z.optional( - z.number().register(z.globalRegistry, { - description: 'Restricts the new score to not exceed the provided limit.', - }) - ), - min_score: z.optional( - z.number().register(z.globalRegistry, { - description: 'Excludes documents that do not meet the provided score threshold.', - }) - ), - query: z.optional(types_query_dsl_query_container), - score_mode: z.optional(types_query_dsl_function_score_mode), - }) - ) -); + description: 'One or more query clauses.\nReturned documents must match one or more of these queries.\nIf a document matches multiple queries, Elasticsearch uses the highest relevance score.' + }), + tie_breaker: z.optional(z.number().register(z.globalRegistry, { + description: 'Floating point number between 0 and 1.0 used to increase the relevance scores of documents matching multiple query clauses.' + })) +})); + +export const types_query_dsl_function_score_query = types_query_dsl_query_base.and(z.lazy(() => z.object({ + boost_mode: z.optional(types_query_dsl_function_boost_mode), + get functions() { + return z.optional(z.array(z.lazy((): any => types_query_dsl_function_score_container)).register(z.globalRegistry, { + description: 'One or more functions that compute a new score for each document returned by the query.' + })); + }, + max_boost: z.optional(z.number().register(z.globalRegistry, { + description: 'Restricts the new score to not exceed the provided limit.' + })), + min_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Excludes documents that do not meet the provided score threshold.' + })), + query: z.optional(types_query_dsl_query_container), + score_mode: z.optional(types_query_dsl_function_score_mode) +}))); -export const types_query_dsl_function_score_container = z - .object({ +export const types_query_dsl_function_score_container = z.object({ filter: z.optional(types_query_dsl_query_container), - weight: z.optional(z.number()), - }) - .and( - z.lazy(() => - z.object({ - exp: z.optional(types_query_dsl_decay_function), - gauss: z.optional(types_query_dsl_decay_function), - linear: z.optional(types_query_dsl_decay_function), - field_value_factor: z.optional(types_query_dsl_field_value_factor_score_function), - random_score: z.optional(types_query_dsl_random_score_function), - get script_score() { - return z.optional(z.lazy((): any => types_query_dsl_script_score_function)); - }, - }) - ) - ); + weight: z.optional(z.number()) +}).and(z.lazy(() => z.object({ + exp: z.optional(types_query_dsl_decay_function), + gauss: z.optional(types_query_dsl_decay_function), + linear: z.optional(types_query_dsl_decay_function), + field_value_factor: z.optional(types_query_dsl_field_value_factor_score_function), + random_score: z.optional(types_query_dsl_random_score_function), + get script_score() { + return z.optional(z.lazy((): any => types_query_dsl_script_score_function)); + } +}))); export const types_query_dsl_script_score_function = z.object({ - get script() { - return z.lazy((): any => types_script); - }, + get script() { + return z.lazy((): any => types_script); + } }); export const types_script = z.object({ - get source() { - return z.optional(z.lazy((): any => types_script_source)); - }, - id: z.optional(types_id), - params: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'Specifies any named parameters that are passed into the script as variables.\nUse parameters instead of hard-coded values to decrease compile time.', - }) - ), - lang: z.optional(types_script_language), - options: z.optional(z.record(z.string(), z.string())), + get source() { + return z.optional(z.lazy((): any => types_script_source)); + }, + id: z.optional(types_id), + params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Specifies any named parameters that are passed into the script as variables.\nUse parameters instead of hard-coded values to decrease compile time.' + })), + lang: z.optional(types_script_language), + options: z.optional(z.record(z.string(), z.string())) }); export const types_script_source = z.union([ - z.string(), - z.lazy((): any => global_search_types_search_request_body), + z.string(), + z.lazy((): any => global_search_types_search_request_body) ]); export const global_search_types_search_request_body = z.object({ - aggregations: z.optional( - z.record(z.string(), types_aggregations_aggregation_container).register(z.globalRegistry, { - description: 'Defines the aggregations that are run as part of the search request.', - }) - ), - get collapse() { - return z.optional(z.lazy((): any => global_search_types_field_collapse)); - }, - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns detailed information about score computation as part of a hit.', - }) - ), - ext: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'Configuration of search extensions defined by Elasticsearch plugins.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The starting document offset, which must be non-negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', - }) - ), - get highlight() { - return z.optional(z.lazy((): any => global_search_types_highlight)); - }, - track_total_hits: z.optional(global_search_types_track_hits), - indices_boost: z.optional( - z.array(z.record(z.string(), z.number())).register(z.globalRegistry, { - description: - 'Boost the `_score` of documents from specified indices.\nThe boost value is the factor by which scores are multiplied.\nA boost value greater than `1.0` increases the score.\nA boost value between `0` and `1.0` decreases the score.', - }) - ), - docvalue_fields: z.optional( - z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { - description: - 'An array of wildcard (`*`) field patterns.\nThe request returns doc values for field names matching these patterns in the `hits.fields` property of the response.', - }) - ), - knn: z.optional( - z.union([z.lazy((): any => types_knn_search), z.array(z.lazy((): any => types_knn_search))]) - ), - rank: z.optional(types_rank_container), - min_score: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The minimum `_score` for matching documents.\nDocuments with a lower `_score` are not included in search results or results collected by aggregations.', - }) - ), - post_filter: z.optional(types_query_dsl_query_container), - profile: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` to return detailed timing information about the execution of individual components in a search request.\nNOTE: This is a debugging tool and adds significant overhead to search execution.', - }) - ), - query: z.optional(types_query_dsl_query_container), - rescore: z.optional( - z.union([ - z.lazy((): any => global_search_types_rescore), - z.array(z.lazy((): any => global_search_types_rescore)), - ]) - ), - get retriever() { - return z.optional(z.lazy((): any => types_retriever_container)); - }, - get script_fields() { - return z.optional( - z - .record( - z.string(), - z.lazy((): any => types_script_field) - ) - .register(z.globalRegistry, { - description: 'Retrieve a script evaluation (based on different fields) for each hit.', - }) - ); - }, - search_after: z.optional(types_sort_results), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of hits to return, which must not be negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` property.', - }) - ), - slice: z.optional(types_sliced_scroll), - get sort() { - return z.optional(z.lazy((): any => types_sort)); - }, - _source: z.optional(global_search_types_source_config), - fields: z.optional( - z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { - description: - 'An array of wildcard (`*`) field patterns.\nThe request returns values for field names matching these patterns in the `hits.fields` property of the response.', - }) - ), - suggest: z.optional(global_search_types_suggester), - terminate_after: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this property to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this property for requests that target data streams with backing indices across multiple data tiers.\n\nIf set to `0` (default), the query does not terminate early.', - }) - ), - timeout: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The period of time to wait for a response from each shard.\nIf no response is received before the timeout expires, the request fails and returns an error.\nDefaults to no timeout.', - }) - ), - track_scores: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, calculate and return document scores, even if the scores are not used for sorting.', - }) - ), - version: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request returns the document version as part of a hit.', - }) - ), - seq_no_primary_term: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns sequence number and primary term of the last modification of each hit.', - }) - ), - stored_fields: z.optional(types_fields), - pit: z.optional(global_search_types_point_in_time_reference), - get runtime_mappings() { - return z.optional(z.lazy((): any => types_mapping_runtime_fields)); - }, - stats: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'The stats groups to associate with the search.\nEach group maintains a statistics aggregation for its associated searches.\nYou can retrieve these stats using the indices stats API.', - }) - ), + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container).register(z.globalRegistry, { + description: 'Defines the aggregations that are run as part of the search request.' + })), + get collapse() { + return z.optional(z.lazy((): any => global_search_types_field_collapse)); + }, + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns detailed information about score computation as part of a hit.' + })), + ext: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Configuration of search extensions defined by Elasticsearch plugins.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'The starting document offset, which must be non-negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' + })), + get highlight() { + return z.optional(z.lazy((): any => global_search_types_highlight)); + }, + track_total_hits: z.optional(global_search_types_track_hits), + indices_boost: z.optional(z.array(z.record(z.string(), z.number())).register(z.globalRegistry, { + description: 'Boost the `_score` of documents from specified indices.\nThe boost value is the factor by which scores are multiplied.\nA boost value greater than `1.0` increases the score.\nA boost value between `0` and `1.0` decreases the score.' + })), + docvalue_fields: z.optional(z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { + description: 'An array of wildcard (`*`) field patterns.\nThe request returns doc values for field names matching these patterns in the `hits.fields` property of the response.' + })), + knn: z.optional(z.union([ + z.lazy((): any => types_knn_search), + z.array(z.lazy((): any => types_knn_search)) + ])), + rank: z.optional(types_rank_container), + min_score: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum `_score` for matching documents.\nDocuments with a lower `_score` are not included in search results or results collected by aggregations.' + })), + post_filter: z.optional(types_query_dsl_query_container), + profile: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` to return detailed timing information about the execution of individual components in a search request.\nNOTE: This is a debugging tool and adds significant overhead to search execution.' + })), + query: z.optional(types_query_dsl_query_container), + rescore: z.optional(z.union([ + z.lazy((): any => global_search_types_rescore), + z.array(z.lazy((): any => global_search_types_rescore)) + ])), + get retriever() { + return z.optional(z.lazy((): any => types_retriever_container)); + }, + get script_fields() { + return z.optional(z.record(z.string(), z.lazy((): any => types_script_field)).register(z.globalRegistry, { + description: 'Retrieve a script evaluation (based on different fields) for each hit.' + })); + }, + search_after: z.optional(types_sort_results), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of hits to return, which must not be negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` property.' + })), + slice: z.optional(types_sliced_scroll), + get sort() { + return z.optional(z.lazy((): any => types_sort)); + }, + _source: z.optional(global_search_types_source_config), + fields: z.optional(z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { + description: 'An array of wildcard (`*`) field patterns.\nThe request returns values for field names matching these patterns in the `hits.fields` property of the response.' + })), + suggest: z.optional(global_search_types_suggester), + terminate_after: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this property to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this property for requests that target data streams with backing indices across multiple data tiers.\n\nIf set to `0` (default), the query does not terminate early.' + })), + timeout: z.optional(z.string().register(z.globalRegistry, { + description: 'The period of time to wait for a response from each shard.\nIf no response is received before the timeout expires, the request fails and returns an error.\nDefaults to no timeout.' + })), + track_scores: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, calculate and return document scores, even if the scores are not used for sorting.' + })), + version: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns the document version as part of a hit.' + })), + seq_no_primary_term: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns sequence number and primary term of the last modification of each hit.' + })), + stored_fields: z.optional(types_fields), + pit: z.optional(global_search_types_point_in_time_reference), + get runtime_mappings() { + return z.optional(z.lazy((): any => types_mapping_runtime_fields)); + }, + stats: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The stats groups to associate with the search.\nEach group maintains a statistics aggregation for its associated searches.\nYou can retrieve these stats using the indices stats API.' + })) }); export const global_search_types_field_collapse = z.object({ - field: types_field, - inner_hits: z.optional( - z.union([ - z.lazy((): any => global_search_types_inner_hits), - z.array(z.lazy((): any => global_search_types_inner_hits)), - ]) - ), - max_concurrent_group_searches: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of concurrent requests allowed to retrieve the inner_hits per group', - }) - ), - get collapse() { - return z.optional(z.lazy((): any => global_search_types_field_collapse)); - }, + field: types_field, + inner_hits: z.optional(z.union([ + z.lazy((): any => global_search_types_inner_hits), + z.array(z.lazy((): any => global_search_types_inner_hits)) + ])), + max_concurrent_group_searches: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of concurrent requests allowed to retrieve the inner_hits per group' + })), + get collapse() { + return z.optional(z.lazy((): any => global_search_types_field_collapse)); + } }); export const global_search_types_inner_hits = z.object({ - name: z.optional(types_name), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of hits to return per `inner_hits`.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Inner hit starting document offset.', - }) - ), - collapse: z.optional(global_search_types_field_collapse), - docvalue_fields: z.optional(z.array(types_query_dsl_field_and_format)), - explain: z.optional(z.boolean()), - get highlight() { - return z.optional(z.lazy((): any => global_search_types_highlight)); - }, - ignore_unmapped: z.optional(z.boolean()), - get script_fields() { - return z.optional( - z.record( - z.string(), - z.lazy((): any => types_script_field) - ) - ); - }, - seq_no_primary_term: z.optional(z.boolean()), - fields: z.optional(z.array(types_field)), - get sort() { - return z.optional(z.lazy((): any => types_sort)); - }, - _source: z.optional(global_search_types_source_config), - stored_fields: z.optional(types_fields), - track_scores: z.optional(z.boolean()), - version: z.optional(z.boolean()), -}); - -export const global_search_types_highlight = z - .lazy((): any => global_search_types_highlight_base) - .and( - z.object({ - encoder: z.optional(global_search_types_highlighter_encoder), - fields: z.union([ - z.record( - z.string(), - z.lazy((): any => global_search_types_highlight_field) - ), - z.array( - z.record( - z.string(), - z.lazy((): any => global_search_types_highlight_field) - ) - ), - ]), - }) - ); + name: z.optional(types_name), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of hits to return per `inner_hits`.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Inner hit starting document offset.' + })), + collapse: z.optional(global_search_types_field_collapse), + docvalue_fields: z.optional(z.array(types_query_dsl_field_and_format)), + explain: z.optional(z.boolean()), + get highlight() { + return z.optional(z.lazy((): any => global_search_types_highlight)); + }, + ignore_unmapped: z.optional(z.boolean()), + get script_fields() { + return z.optional(z.record(z.string(), z.lazy((): any => types_script_field))); + }, + seq_no_primary_term: z.optional(z.boolean()), + fields: z.optional(z.array(types_field)), + get sort() { + return z.optional(z.lazy((): any => types_sort)); + }, + _source: z.optional(global_search_types_source_config), + stored_fields: z.optional(types_fields), + track_scores: z.optional(z.boolean()), + version: z.optional(z.boolean()) +}); -export const global_search_types_highlight_field = z - .lazy((): any => global_search_types_highlight_base) - .and( - z.object({ - fragment_offset: z.optional(z.number()), - matched_fields: z.optional(types_fields), - }) - ); +export const global_search_types_highlight = z.lazy((): any => global_search_types_highlight_base).and(z.object({ + encoder: z.optional(global_search_types_highlighter_encoder), + fields: z.union([ + z.record(z.string(), z.lazy((): any => global_search_types_highlight_field)), + z.array(z.record(z.string(), z.lazy((): any => global_search_types_highlight_field))) + ]) +})); + +export const global_search_types_highlight_field = z.lazy((): any => global_search_types_highlight_base).and(z.object({ + fragment_offset: z.optional(z.number()), + matched_fields: z.optional(types_fields) +})); export const global_search_types_highlight_base = z.object({ - type: z.optional(global_search_types_highlighter_type), - boundary_chars: z.optional( - z.string().register(z.globalRegistry, { - description: 'A string that contains each boundary character.', - }) - ), - boundary_max_scan: z.optional( - z.number().register(z.globalRegistry, { - description: 'How far to scan for boundary characters.', - }) - ), - boundary_scanner: z.optional(global_search_types_boundary_scanner), - boundary_scanner_locale: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Controls which locale is used to search for sentence and word boundaries.\nThis parameter takes a form of a language tag, for example: `"en-US"`, `"fr-FR"`, `"ja-JP"`.', - }) - ), - force_source: z.optional(z.boolean()), - fragmenter: z.optional(global_search_types_highlighter_fragmenter), - fragment_size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The size of the highlighted fragment in characters.', - }) - ), - highlight_filter: z.optional(z.boolean()), - highlight_query: z.optional(types_query_dsl_query_container), - max_fragment_length: z.optional(z.number()), - max_analyzed_offset: z.optional( - z.number().register(z.globalRegistry, { - description: - 'If set to a non-negative value, highlighting stops at this defined maximum limit.\nThe rest of the text is not processed, thus not highlighted and no error is returned\nThe `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it’s set to lower value than the query setting.', - }) - ), - no_match_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight.', - }) - ), - number_of_fragments: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of fragments to return.\nIf the number of fragments is set to `0`, no fragments are returned.\nInstead, the entire field contents are highlighted and returned.\nThis can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required.\nIf `number_of_fragments` is `0`, `fragment_size` is ignored.', - }) - ), - options: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - order: z.optional(global_search_types_highlighter_order), - phrase_limit: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Controls the number of matching phrases in a document that are considered.\nPrevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory.\nWhen using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory.\nOnly supported by the `fvh` highlighter.', - }) - ), - post_tags: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text.\nBy default, highlighted text is wrapped in `` and `` tags.', - }) - ), - pre_tags: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'Use in conjunction with `post_tags` to define the HTML tags to use for the highlighted text.\nBy default, highlighted text is wrapped in `` and `` tags.', - }) - ), - require_field_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'By default, only fields that contains a query match are highlighted.\nSet to `false` to highlight all fields.', - }) - ), - tags_schema: z.optional(global_search_types_highlighter_tags_schema), + type: z.optional(global_search_types_highlighter_type), + boundary_chars: z.optional(z.string().register(z.globalRegistry, { + description: 'A string that contains each boundary character.' + })), + boundary_max_scan: z.optional(z.number().register(z.globalRegistry, { + description: 'How far to scan for boundary characters.' + })), + boundary_scanner: z.optional(global_search_types_boundary_scanner), + boundary_scanner_locale: z.optional(z.string().register(z.globalRegistry, { + description: 'Controls which locale is used to search for sentence and word boundaries.\nThis parameter takes a form of a language tag, for example: `"en-US"`, `"fr-FR"`, `"ja-JP"`.' + })), + force_source: z.optional(z.boolean()), + fragmenter: z.optional(global_search_types_highlighter_fragmenter), + fragment_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The size of the highlighted fragment in characters.' + })), + highlight_filter: z.optional(z.boolean()), + highlight_query: z.optional(types_query_dsl_query_container), + max_fragment_length: z.optional(z.number()), + max_analyzed_offset: z.optional(z.number().register(z.globalRegistry, { + description: 'If set to a non-negative value, highlighting stops at this defined maximum limit.\nThe rest of the text is not processed, thus not highlighted and no error is returned\nThe `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it’s set to lower value than the query setting.' + })), + no_match_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight.' + })), + number_of_fragments: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of fragments to return.\nIf the number of fragments is set to `0`, no fragments are returned.\nInstead, the entire field contents are highlighted and returned.\nThis can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required.\nIf `number_of_fragments` is `0`, `fragment_size` is ignored.' + })), + options: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + order: z.optional(global_search_types_highlighter_order), + phrase_limit: z.optional(z.number().register(z.globalRegistry, { + description: 'Controls the number of matching phrases in a document that are considered.\nPrevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory.\nWhen using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory.\nOnly supported by the `fvh` highlighter.' + })), + post_tags: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text.\nBy default, highlighted text is wrapped in `` and `` tags.' + })), + pre_tags: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Use in conjunction with `post_tags` to define the HTML tags to use for the highlighted text.\nBy default, highlighted text is wrapped in `` and `` tags.' + })), + require_field_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'By default, only fields that contains a query match are highlighted.\nSet to `false` to highlight all fields.' + })), + tags_schema: z.optional(global_search_types_highlighter_tags_schema) }); export const types_script_field = z.object({ - script: types_script, - ignore_failure: z.optional(z.boolean()), + script: types_script, + ignore_failure: z.optional(z.boolean()) }); export const types_sort = z.union([ - z.lazy((): any => types_sort_combinations), - z.array(z.lazy((): any => types_sort_combinations)), + z.lazy((): any => types_sort_combinations), + z.array(z.lazy((): any => types_sort_combinations)) ]); export const types_sort_combinations = z.union([ - types_field, - z.lazy((): any => types_sort_options), + types_field, + z.lazy((): any => types_sort_options) ]); export const types_sort_options = z.object({ - _score: z.optional(types_score_sort), - _doc: z.optional(types_score_sort), - get _geo_distance() { - return z.optional(z.lazy((): any => types_geo_distance_sort)); - }, - get _script() { - return z.optional(z.lazy((): any => types_script_sort)); - }, + _score: z.optional(types_score_sort), + _doc: z.optional(types_score_sort), + get _geo_distance() { + return z.optional(z.lazy((): any => types_geo_distance_sort)); + }, + get _script() { + return z.optional(z.lazy((): any => types_script_sort)); + } }); export const types_geo_distance_sort = z.object({ - mode: z.optional(types_sort_mode), - distance_type: z.optional(types_geo_distance_type), - ignore_unmapped: z.optional(z.boolean()), - order: z.optional(types_sort_order), - unit: z.optional(types_distance_unit), - get nested() { - return z.optional(z.lazy((): any => types_nested_sort_value)); - }, + mode: z.optional(types_sort_mode), + distance_type: z.optional(types_geo_distance_type), + ignore_unmapped: z.optional(z.boolean()), + order: z.optional(types_sort_order), + unit: z.optional(types_distance_unit), + get nested() { + return z.optional(z.lazy((): any => types_nested_sort_value)); + } }); export const types_nested_sort_value = z.object({ - filter: z.optional(types_query_dsl_query_container), - max_children: z.optional(z.number()), - get nested() { - return z.optional(z.lazy((): any => types_nested_sort_value)); - }, - path: types_field, + filter: z.optional(types_query_dsl_query_container), + max_children: z.optional(z.number()), + get nested() { + return z.optional(z.lazy((): any => types_nested_sort_value)); + }, + path: types_field }); export const types_script_sort = z.object({ - order: z.optional(types_sort_order), - script: types_script, - type: z.optional(types_script_sort_type), - mode: z.optional(types_sort_mode), - nested: z.optional(types_nested_sort_value), + order: z.optional(types_sort_order), + script: types_script, + type: z.optional(types_script_sort_type), + mode: z.optional(types_sort_mode), + nested: z.optional(types_nested_sort_value) }); export const types_knn_search = z.object({ - field: types_field, - query_vector: z.optional(types_query_vector), - query_vector_builder: z.optional(types_query_vector_builder), - k: z.optional( - z.number().register(z.globalRegistry, { - description: 'The final number of nearest neighbors to return as top hits', - }) - ), - num_candidates: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of nearest neighbor candidates to consider per shard', - }) - ), - visit_percentage: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The percentage of vectors to explore per shard while doing knn search with bbq_disk', - }) - ), - boost: z.optional( - z.number().register(z.globalRegistry, { - description: 'Boost value to apply to kNN scores', - }) - ), - filter: z.optional( - z.union([types_query_dsl_query_container, z.array(types_query_dsl_query_container)]) - ), - similarity: z.optional( - z.number().register(z.globalRegistry, { - description: 'The minimum similarity for a vector to be considered a match', - }) - ), - inner_hits: z.optional(global_search_types_inner_hits), - rescore_vector: z.optional(types_rescore_vector), -}); - -export const global_search_types_rescore = z - .object({ - window_size: z.optional(z.number()), - }) - .and( - z.lazy(() => - z.object({ - get query() { - return z.optional(z.lazy((): any => global_search_types_rescore_query)); - }, - learning_to_rank: z.optional(global_search_types_learning_to_rank), - get script() { - return z.optional(z.lazy((): any => global_search_types_script_rescore)); - }, - }) - ) - ); + field: types_field, + query_vector: z.optional(types_query_vector), + query_vector_builder: z.optional(types_query_vector_builder), + k: z.optional(z.number().register(z.globalRegistry, { + description: 'The final number of nearest neighbors to return as top hits' + })), + num_candidates: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of nearest neighbor candidates to consider per shard' + })), + visit_percentage: z.optional(z.number().register(z.globalRegistry, { + description: 'The percentage of vectors to explore per shard while doing knn search with bbq_disk' + })), + boost: z.optional(z.number().register(z.globalRegistry, { + description: 'Boost value to apply to kNN scores' + })), + filter: z.optional(z.union([ + types_query_dsl_query_container, + z.array(types_query_dsl_query_container) + ])), + similarity: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum similarity for a vector to be considered a match' + })), + inner_hits: z.optional(global_search_types_inner_hits), + rescore_vector: z.optional(types_rescore_vector) +}); + +export const global_search_types_rescore = z.object({ + window_size: z.optional(z.number()) +}).and(z.lazy(() => z.object({ + get query() { + return z.optional(z.lazy((): any => global_search_types_rescore_query)); + }, + learning_to_rank: z.optional(global_search_types_learning_to_rank), + get script() { + return z.optional(z.lazy((): any => global_search_types_script_rescore)); + } +}))); export const global_search_types_rescore_query = z.object({ - rescore_query: types_query_dsl_query_container, - query_weight: z.optional( - z.number().register(z.globalRegistry, { - description: 'Relative importance of the original query versus the rescore query.', - }) - ), - rescore_query_weight: z.optional( - z.number().register(z.globalRegistry, { - description: 'Relative importance of the rescore query versus the original query.', - }) - ), - score_mode: z.optional(global_search_types_score_mode), + rescore_query: types_query_dsl_query_container, + query_weight: z.optional(z.number().register(z.globalRegistry, { + description: 'Relative importance of the original query versus the rescore query.' + })), + rescore_query_weight: z.optional(z.number().register(z.globalRegistry, { + description: 'Relative importance of the rescore query versus the original query.' + })), + score_mode: z.optional(global_search_types_score_mode) }); export const global_search_types_script_rescore = z.object({ - script: types_script, + script: types_script }); export const types_retriever_container = z.object({ - get standard() { - return z.optional(z.lazy((): any => types_standard_retriever)); - }, - get knn() { - return z.optional(z.lazy((): any => types_knn_retriever)); - }, - get rrf() { - return z.optional(z.lazy((): any => types_rrf_retriever)); - }, - get text_similarity_reranker() { - return z.optional(z.lazy((): any => types_text_similarity_reranker)); - }, - get rule() { - return z.optional(z.lazy((): any => types_rule_retriever)); - }, - get rescorer() { - return z.optional(z.lazy((): any => types_rescorer_retriever)); - }, - get linear() { - return z.optional(z.lazy((): any => types_linear_retriever)); - }, - get pinned() { - return z.optional(z.lazy((): any => types_pinned_retriever)); - }, - get diversify() { - return z.optional(z.lazy((): any => types_diversify_retriever)); - }, -}); - -export const types_standard_retriever = z - .lazy((): any => types_retriever_base) - .and( - z.object({ - query: z.optional(types_query_dsl_query_container), - search_after: z.optional(types_sort_results), - terminate_after: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum number of documents to collect for each shard.', - }) - ), - sort: z.optional(types_sort), - collapse: z.optional(global_search_types_field_collapse), - }) - ); - -export const types_retriever_base = z.object({ - filter: z.optional( - z.union([types_query_dsl_query_container, z.array(types_query_dsl_query_container)]) - ), - min_score: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Minimum _score for matching documents. Documents with a lower _score are not included in the top documents.', - }) - ), - _name: z.optional( - z.string().register(z.globalRegistry, { - description: 'Retriever name.', - }) - ), + get standard() { + return z.optional(z.lazy((): any => types_standard_retriever)); + }, + get knn() { + return z.optional(z.lazy((): any => types_knn_retriever)); + }, + get rrf() { + return z.optional(z.lazy((): any => types_rrf_retriever)); + }, + get text_similarity_reranker() { + return z.optional(z.lazy((): any => types_text_similarity_reranker)); + }, + get rule() { + return z.optional(z.lazy((): any => types_rule_retriever)); + }, + get rescorer() { + return z.optional(z.lazy((): any => types_rescorer_retriever)); + }, + get linear() { + return z.optional(z.lazy((): any => types_linear_retriever)); + }, + get pinned() { + return z.optional(z.lazy((): any => types_pinned_retriever)); + }, + get diversify() { + return z.optional(z.lazy((): any => types_diversify_retriever)); + } }); -export const types_knn_retriever = types_retriever_base.and( - z.object({ +export const types_standard_retriever = z.lazy((): any => types_retriever_base).and(z.object({ + query: z.optional(types_query_dsl_query_container), + search_after: z.optional(types_sort_results), + terminate_after: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of documents to collect for each shard.' + })), + sort: z.optional(types_sort), + collapse: z.optional(global_search_types_field_collapse) +})); + +export const types_retriever_base = z.object({ + filter: z.optional(z.union([ + types_query_dsl_query_container, + z.array(types_query_dsl_query_container) + ])), + min_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Minimum _score for matching documents. Documents with a lower _score are not included in the top documents.' + })), + _name: z.optional(z.string().register(z.globalRegistry, { + description: 'Retriever name.' + })) +}); + +export const types_knn_retriever = types_retriever_base.and(z.object({ field: z.string().register(z.globalRegistry, { - description: 'The name of the vector field to search against.', + description: 'The name of the vector field to search against.' }), query_vector: z.optional(types_query_vector), query_vector_builder: z.optional(types_query_vector_builder), k: z.number().register(z.globalRegistry, { - description: 'Number of nearest neighbors to return as top hits.', + description: 'Number of nearest neighbors to return as top hits.' }), num_candidates: z.number().register(z.globalRegistry, { - description: 'Number of nearest neighbor candidates to consider per shard.', - }), - visit_percentage: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The percentage of vectors to explore per shard while doing knn search with bbq_disk', - }) - ), - similarity: z.optional( - z.number().register(z.globalRegistry, { - description: 'The minimum similarity required for a document to be considered a match.', - }) - ), - rescore_vector: z.optional(types_rescore_vector), - }) -); - -export const types_rrf_retriever = types_retriever_base.and( - z.lazy(() => - z.object({ - get retrievers() { + description: 'Number of nearest neighbor candidates to consider per shard.' + }), + visit_percentage: z.optional(z.number().register(z.globalRegistry, { + description: 'The percentage of vectors to explore per shard while doing knn search with bbq_disk' + })), + similarity: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum similarity required for a document to be considered a match.' + })), + rescore_vector: z.optional(types_rescore_vector) +})); + +export const types_rrf_retriever = types_retriever_base.and(z.lazy(() => z.object({ + get retrievers() { return z.array(z.lazy((): any => types_rrf_retriever_entry)).register(z.globalRegistry, { - description: - 'A list of child retrievers to specify which sets of returned top documents will have the RRF formula applied to them. Each retriever can optionally include a weight parameter.', + description: 'A list of child retrievers to specify which sets of returned top documents will have the RRF formula applied to them. Each retriever can optionally include a weight parameter.' }); - }, - rank_constant: z.optional( - z.number().register(z.globalRegistry, { - description: - 'This value determines how much influence documents in individual result sets per query have over the final ranked result set.', - }) - ), - rank_window_size: z.optional( - z.number().register(z.globalRegistry, { - description: 'This value determines the size of the individual result sets per query.', - }) - ), - query: z.optional(z.string()), - fields: z.optional(z.array(z.string())), - }) - ) -); + }, + rank_constant: z.optional(z.number().register(z.globalRegistry, { + description: 'This value determines how much influence documents in individual result sets per query have over the final ranked result set.' + })), + rank_window_size: z.optional(z.number().register(z.globalRegistry, { + description: 'This value determines the size of the individual result sets per query.' + })), + query: z.optional(z.string()), + fields: z.optional(z.array(z.string())) +}))); /** * Either a direct RetrieverContainer (backward compatible) or an RRFRetrieverComponent with weight. */ export const types_rrf_retriever_entry = z.union([ - types_retriever_container, - z.lazy((): any => types_rrf_retriever_component), + types_retriever_container, + z.lazy((): any => types_rrf_retriever_component) ]); /** * Wraps a retriever with an optional weight for RRF scoring. */ -export const types_rrf_retriever_component = z - .object({ +export const types_rrf_retriever_component = z.object({ retriever: types_retriever_container, - weight: z.optional( - z.number().register(z.globalRegistry, { - description: - "Weight multiplier for this retriever's contribution to the RRF score. Higher values increase influence. Defaults to 1.0 if not specified. Must be non-negative.", - }) - ), - }) - .register(z.globalRegistry, { - description: 'Wraps a retriever with an optional weight for RRF scoring.', - }); - -export const types_text_similarity_reranker = types_retriever_base.and( - z.object({ + weight: z.optional(z.number().register(z.globalRegistry, { + description: 'Weight multiplier for this retriever\'s contribution to the RRF score. Higher values increase influence. Defaults to 1.0 if not specified. Must be non-negative.' + })) +}).register(z.globalRegistry, { + description: 'Wraps a retriever with an optional weight for RRF scoring.' +}); + +export const types_text_similarity_reranker = types_retriever_base.and(z.object({ retriever: types_retriever_container, - rank_window_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'This value determines how many documents we will consider from the nested retriever.', - }) - ), - inference_id: z.optional( - z.string().register(z.globalRegistry, { - description: 'Unique identifier of the inference endpoint created using the inference API.', - }) - ), + rank_window_size: z.optional(z.number().register(z.globalRegistry, { + description: 'This value determines how many documents we will consider from the nested retriever.' + })), + inference_id: z.optional(z.string().register(z.globalRegistry, { + description: 'Unique identifier of the inference endpoint created using the inference API.' + })), inference_text: z.string().register(z.globalRegistry, { - description: 'The text snippet used as the basis for similarity comparison.', + description: 'The text snippet used as the basis for similarity comparison.' }), field: z.string().register(z.globalRegistry, { - description: - 'The document field to be used for text similarity comparisons. This field should contain the text that will be evaluated against the inference_text.', + description: 'The document field to be used for text similarity comparisons. This field should contain the text that will be evaluated against the inference_text.' }), - chunk_rescorer: z.optional(types_chunk_rescorer), - }) -); + chunk_rescorer: z.optional(types_chunk_rescorer) +})); -export const types_rule_retriever = types_retriever_base.and( - z.object({ - ruleset_ids: z.union([types_id, z.array(types_id)]), +export const types_rule_retriever = types_retriever_base.and(z.object({ + ruleset_ids: z.union([ + types_id, + z.array(types_id) + ]), match_criteria: z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'The match criteria that will determine if a rule in the provided rulesets should be applied.', + description: 'The match criteria that will determine if a rule in the provided rulesets should be applied.' }), retriever: types_retriever_container, - rank_window_size: z.optional( - z.number().register(z.globalRegistry, { - description: 'This value determines the size of the individual result set.', - }) - ), - }) -); - -export const types_rescorer_retriever = types_retriever_base.and( - z.object({ + rank_window_size: z.optional(z.number().register(z.globalRegistry, { + description: 'This value determines the size of the individual result set.' + })) +})); + +export const types_rescorer_retriever = types_retriever_base.and(z.object({ retriever: types_retriever_container, - rescore: z.union([global_search_types_rescore, z.array(global_search_types_rescore)]), - }) -); + rescore: z.union([ + global_search_types_rescore, + z.array(global_search_types_rescore) + ]) +})); -export const types_linear_retriever = types_retriever_base.and( - z.lazy(() => - z.object({ - get retrievers() { - return z.optional( - z.array(z.lazy((): any => types_inner_retriever)).register(z.globalRegistry, { - description: 'Inner retrievers.', - }) - ); - }, - rank_window_size: z.optional(z.number()), - query: z.optional(z.string()), - fields: z.optional(z.array(z.string())), - normalizer: z.optional(types_score_normalizer), - }) - ) -); +export const types_linear_retriever = types_retriever_base.and(z.lazy(() => z.object({ + get retrievers() { + return z.optional(z.array(z.lazy((): any => types_inner_retriever)).register(z.globalRegistry, { + description: 'Inner retrievers.' + })); + }, + rank_window_size: z.optional(z.number()), + query: z.optional(z.string()), + fields: z.optional(z.array(z.string())), + normalizer: z.optional(types_score_normalizer) +}))); export const types_inner_retriever = z.object({ - retriever: types_retriever_container, - weight: z.number(), - normalizer: types_score_normalizer, + retriever: types_retriever_container, + weight: z.number(), + normalizer: types_score_normalizer }); -export const types_pinned_retriever = types_retriever_base.and( - z.object({ +export const types_pinned_retriever = types_retriever_base.and(z.object({ retriever: types_retriever_container, ids: z.optional(z.array(z.string())), docs: z.optional(z.array(types_specified_document)), - rank_window_size: z.optional(z.number()), - }) -); + rank_window_size: z.optional(z.number()) +})); -export const types_diversify_retriever = types_retriever_base.and( - z.object({ +export const types_diversify_retriever = types_retriever_base.and(z.object({ type: types_diversify_retriever_types, field: z.string().register(z.globalRegistry, { - description: 'The document field on which to diversify results on.', + description: 'The document field on which to diversify results on.' }), retriever: types_retriever_container, - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of top documents to return after diversification.', - }) - ), - rank_window_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of top documents from the nested retriever to consider for diversification.', - }) - ), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of top documents to return after diversification.' + })), + rank_window_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of top documents from the nested retriever to consider for diversification.' + })), query_vector: z.optional(types_query_vector), - lambda: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Controls the trade-off between relevance and diversity for MMR. A value of 0.0 focuses solely on diversity, while a value of 1.0 focuses solely on relevance. Required for MMR', - }) - ), - }) -); - -export const types_mapping_runtime_fields = z.record( - z.string(), - z.lazy((): any => types_mapping_runtime_field) -); + lambda: z.optional(z.number().register(z.globalRegistry, { + description: 'Controls the trade-off between relevance and diversity for MMR. A value of 0.0 focuses solely on diversity, while a value of 1.0 focuses solely on relevance. Required for MMR' + })) +})); + +export const types_mapping_runtime_fields = z.record(z.string(), z.lazy((): any => types_mapping_runtime_field)); export const types_mapping_runtime_field = z.object({ - fields: z.optional( - z.record(z.string(), types_mapping_composite_sub_field).register(z.globalRegistry, { - description: 'For type `composite`', - }) - ), - fetch_fields: z.optional( - z.array(types_mapping_runtime_field_fetch_fields).register(z.globalRegistry, { - description: 'For type `lookup`', - }) - ), - format: z.optional( - z.string().register(z.globalRegistry, { - description: 'A custom format for `date` type runtime fields.', - }) - ), - input_field: z.optional(types_field), - target_field: z.optional(types_field), - target_index: z.optional(types_index_name), - script: z.optional(types_script), - type: types_mapping_runtime_field_type, -}); - -export const types_query_dsl_has_child_query = types_query_dsl_query_base.and( - z.object({ - ignore_unmapped: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether to ignore an unmapped `type` and not return any documents instead of an error.', - }) - ), + fields: z.optional(z.record(z.string(), types_mapping_composite_sub_field).register(z.globalRegistry, { + description: 'For type `composite`' + })), + fetch_fields: z.optional(z.array(types_mapping_runtime_field_fetch_fields).register(z.globalRegistry, { + description: 'For type `lookup`' + })), + format: z.optional(z.string().register(z.globalRegistry, { + description: 'A custom format for `date` type runtime fields.' + })), + input_field: z.optional(types_field), + target_field: z.optional(types_field), + target_index: z.optional(types_index_name), + script: z.optional(types_script), + type: types_mapping_runtime_field_type +}); + +export const types_query_dsl_has_child_query = types_query_dsl_query_base.and(z.object({ + ignore_unmapped: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether to ignore an unmapped `type` and not return any documents instead of an error.' + })), inner_hits: z.optional(global_search_types_inner_hits), - max_children: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of child documents that match the query allowed for a returned parent document.\nIf the parent document exceeds this limit, it is excluded from the search results.', - }) - ), - min_children: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Minimum number of child documents that match the query required to match the query for a returned parent document.\nIf the parent document does not meet this limit, it is excluded from the search results.', - }) - ), + max_children: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of child documents that match the query allowed for a returned parent document.\nIf the parent document exceeds this limit, it is excluded from the search results.' + })), + min_children: z.optional(z.number().register(z.globalRegistry, { + description: 'Minimum number of child documents that match the query required to match the query for a returned parent document.\nIf the parent document does not meet this limit, it is excluded from the search results.' + })), query: types_query_dsl_query_container, score_mode: z.optional(types_query_dsl_child_score_mode), - type: types_relation_name, - }) -); - -export const types_query_dsl_has_parent_query = types_query_dsl_query_base.and( - z.object({ - ignore_unmapped: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether to ignore an unmapped `parent_type` and not return any documents instead of an error.\nYou can use this parameter to query multiple indices that may not contain the `parent_type`.', - }) - ), + type: types_relation_name +})); + +export const types_query_dsl_has_parent_query = types_query_dsl_query_base.and(z.object({ + ignore_unmapped: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether to ignore an unmapped `parent_type` and not return any documents instead of an error.\nYou can use this parameter to query multiple indices that may not contain the `parent_type`.' + })), inner_hits: z.optional(global_search_types_inner_hits), parent_type: types_relation_name, query: types_query_dsl_query_container, - score: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether the relevance score of a matching parent document is aggregated into its child documents.', - }) - ), - }) -); - -export const types_query_dsl_intervals_query = types_query_dsl_query_base.and( - z.lazy(() => - z.object({ - get all_of() { + score: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the relevance score of a matching parent document is aggregated into its child documents.' + })) +})); + +export const types_query_dsl_intervals_query = types_query_dsl_query_base.and(z.lazy(() => z.object({ + get all_of() { return z.optional(z.lazy((): any => types_query_dsl_intervals_all_of)); - }, - get any_of() { + }, + get any_of() { return z.optional(z.lazy((): any => types_query_dsl_intervals_any_of)); - }, - fuzzy: z.optional(types_query_dsl_intervals_fuzzy), - get match() { + }, + fuzzy: z.optional(types_query_dsl_intervals_fuzzy), + get match() { return z.optional(z.lazy((): any => types_query_dsl_intervals_match)); - }, - prefix: z.optional(types_query_dsl_intervals_prefix), - range: z.optional(types_query_dsl_intervals_range), - regexp: z.optional(types_query_dsl_intervals_regexp), - wildcard: z.optional(types_query_dsl_intervals_wildcard), - }) - ) -); + }, + prefix: z.optional(types_query_dsl_intervals_prefix), + range: z.optional(types_query_dsl_intervals_range), + regexp: z.optional(types_query_dsl_intervals_regexp), + wildcard: z.optional(types_query_dsl_intervals_wildcard) +}))); export const types_query_dsl_intervals_all_of = z.object({ - get intervals() { - return z - .array(z.lazy((): any => types_query_dsl_intervals_container)) - .register(z.globalRegistry, { - description: - 'An array of rules to combine. All rules must produce a match in a document for the overall source to match.', - }); - }, - max_gaps: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of positions between the matching terms.\nIntervals produced by the rules further apart than this are not considered matches.', - }) - ), - ordered: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, intervals produced by the rules should appear in the order in which they are specified.', - }) - ), - get filter() { - return z.optional(z.lazy((): any => types_query_dsl_intervals_filter)); - }, + get intervals() { + return z.array(z.lazy((): any => types_query_dsl_intervals_container)).register(z.globalRegistry, { + description: 'An array of rules to combine. All rules must produce a match in a document for the overall source to match.' + }); + }, + max_gaps: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of positions between the matching terms.\nIntervals produced by the rules further apart than this are not considered matches.' + })), + ordered: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, intervals produced by the rules should appear in the order in which they are specified.' + })), + get filter() { + return z.optional(z.lazy((): any => types_query_dsl_intervals_filter)); + } }); export const types_query_dsl_intervals_container = z.object({ - all_of: z.optional(types_query_dsl_intervals_all_of), - get any_of() { - return z.optional(z.lazy((): any => types_query_dsl_intervals_any_of)); - }, - fuzzy: z.optional(types_query_dsl_intervals_fuzzy), - get match() { - return z.optional(z.lazy((): any => types_query_dsl_intervals_match)); - }, - prefix: z.optional(types_query_dsl_intervals_prefix), - range: z.optional(types_query_dsl_intervals_range), - regexp: z.optional(types_query_dsl_intervals_regexp), - wildcard: z.optional(types_query_dsl_intervals_wildcard), + all_of: z.optional(types_query_dsl_intervals_all_of), + get any_of() { + return z.optional(z.lazy((): any => types_query_dsl_intervals_any_of)); + }, + fuzzy: z.optional(types_query_dsl_intervals_fuzzy), + get match() { + return z.optional(z.lazy((): any => types_query_dsl_intervals_match)); + }, + prefix: z.optional(types_query_dsl_intervals_prefix), + range: z.optional(types_query_dsl_intervals_range), + regexp: z.optional(types_query_dsl_intervals_regexp), + wildcard: z.optional(types_query_dsl_intervals_wildcard) }); export const types_query_dsl_intervals_any_of = z.object({ - intervals: z.array(types_query_dsl_intervals_container).register(z.globalRegistry, { - description: 'An array of rules to match.', - }), - get filter() { - return z.optional(z.lazy((): any => types_query_dsl_intervals_filter)); - }, + intervals: z.array(types_query_dsl_intervals_container).register(z.globalRegistry, { + description: 'An array of rules to match.' + }), + get filter() { + return z.optional(z.lazy((): any => types_query_dsl_intervals_filter)); + } }); export const types_query_dsl_intervals_filter = z.object({ - after: z.optional(types_query_dsl_intervals_container), - before: z.optional(types_query_dsl_intervals_container), - contained_by: z.optional(types_query_dsl_intervals_container), - containing: z.optional(types_query_dsl_intervals_container), - not_contained_by: z.optional(types_query_dsl_intervals_container), - not_containing: z.optional(types_query_dsl_intervals_container), - not_overlapping: z.optional(types_query_dsl_intervals_container), - overlapping: z.optional(types_query_dsl_intervals_container), - script: z.optional(types_script), + after: z.optional(types_query_dsl_intervals_container), + before: z.optional(types_query_dsl_intervals_container), + contained_by: z.optional(types_query_dsl_intervals_container), + containing: z.optional(types_query_dsl_intervals_container), + not_contained_by: z.optional(types_query_dsl_intervals_container), + not_containing: z.optional(types_query_dsl_intervals_container), + not_overlapping: z.optional(types_query_dsl_intervals_container), + overlapping: z.optional(types_query_dsl_intervals_container), + script: z.optional(types_script) }); export const types_query_dsl_intervals_match = z.object({ - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: 'Analyzer used to analyze terms in the query.', - }) - ), - max_gaps: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of positions between the matching terms.\nTerms further apart than this are not considered matches.', - }) - ), - ordered: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, matching terms must appear in their specified order.', - }) - ), - query: z.string().register(z.globalRegistry, { - description: 'Text you wish to find in the provided field.', - }), - use_field: z.optional(types_field), - filter: z.optional(types_query_dsl_intervals_filter), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer used to analyze terms in the query.' + })), + max_gaps: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of positions between the matching terms.\nTerms further apart than this are not considered matches.' + })), + ordered: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, matching terms must appear in their specified order.' + })), + query: z.string().register(z.globalRegistry, { + description: 'Text you wish to find in the provided field.' + }), + use_field: z.optional(types_field), + filter: z.optional(types_query_dsl_intervals_filter) }); -export const types_knn_query = types_query_dsl_query_base.and( - z.object({ +export const types_knn_query = types_query_dsl_query_base.and(z.object({ field: types_field, query_vector: z.optional(types_query_vector), query_vector_builder: z.optional(types_query_vector_builder), - num_candidates: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of nearest neighbor candidates to consider per shard', - }) - ), - visit_percentage: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The percentage of vectors to explore per shard while doing knn search with bbq_disk', - }) - ), - k: z.optional( - z.number().register(z.globalRegistry, { - description: 'The final number of nearest neighbors to return as top hits', - }) - ), - filter: z.optional( - z.union([types_query_dsl_query_container, z.array(types_query_dsl_query_container)]) - ), - similarity: z.optional( - z.number().register(z.globalRegistry, { - description: 'The minimum similarity for a vector to be considered a match', - }) - ), - rescore_vector: z.optional(types_rescore_vector), - }) -); - -export const types_query_dsl_nested_query = types_query_dsl_query_base.and( - z.object({ - ignore_unmapped: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether to ignore an unmapped path and not return any documents instead of an error.', - }) - ), + num_candidates: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of nearest neighbor candidates to consider per shard' + })), + visit_percentage: z.optional(z.number().register(z.globalRegistry, { + description: 'The percentage of vectors to explore per shard while doing knn search with bbq_disk' + })), + k: z.optional(z.number().register(z.globalRegistry, { + description: 'The final number of nearest neighbors to return as top hits' + })), + filter: z.optional(z.union([ + types_query_dsl_query_container, + z.array(types_query_dsl_query_container) + ])), + similarity: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum similarity for a vector to be considered a match' + })), + rescore_vector: z.optional(types_rescore_vector) +})); + +export const types_query_dsl_nested_query = types_query_dsl_query_base.and(z.object({ + ignore_unmapped: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether to ignore an unmapped path and not return any documents instead of an error.' + })), inner_hits: z.optional(global_search_types_inner_hits), path: types_field, query: types_query_dsl_query_container, - score_mode: z.optional(types_query_dsl_child_score_mode), - }) -); - -export const types_query_dsl_pinned_query = types_query_dsl_query_base.and( - z - .object({ - organic: types_query_dsl_query_container, - }) - .and( - z.object({ - ids: z.optional( - z.array(types_id).register(z.globalRegistry, { - description: - 'Document IDs listed in the order they are to appear in results.\nRequired if `docs` is not specified.', - }) - ), - docs: z.optional( - z.array(types_query_dsl_pinned_doc).register(z.globalRegistry, { - description: - 'Documents listed in the order they are to appear in results.\nRequired if `ids` is not specified.', - }) - ), - }) - ) -); - -export const types_query_dsl_rule_query = types_query_dsl_query_base.and( - z.object({ + score_mode: z.optional(types_query_dsl_child_score_mode) +})); + +export const types_query_dsl_pinned_query = types_query_dsl_query_base.and(z.object({ + organic: types_query_dsl_query_container +}).and(z.object({ + ids: z.optional(z.array(types_id).register(z.globalRegistry, { + description: 'Document IDs listed in the order they are to appear in results.\nRequired if `docs` is not specified.' + })), + docs: z.optional(z.array(types_query_dsl_pinned_doc).register(z.globalRegistry, { + description: 'Documents listed in the order they are to appear in results.\nRequired if `ids` is not specified.' + })) +}))); + +export const types_query_dsl_rule_query = types_query_dsl_query_base.and(z.object({ organic: types_query_dsl_query_container, - ruleset_ids: z.optional(z.union([types_id, z.array(types_id)])), + ruleset_ids: z.optional(z.union([ + types_id, + z.array(types_id) + ])), ruleset_id: z.optional(z.string()), - match_criteria: z.record(z.string(), z.unknown()), - }) -); + match_criteria: z.record(z.string(), z.unknown()) +})); -export const types_query_dsl_script_query = types_query_dsl_query_base.and( - z.object({ - script: types_script, - }) -); - -export const types_query_dsl_script_score_query = types_query_dsl_query_base.and( - z.object({ - min_score: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Documents with a score lower than this floating point number are excluded from the search results.', - }) - ), +export const types_query_dsl_script_query = types_query_dsl_query_base.and(z.object({ + script: types_script +})); + +export const types_query_dsl_script_score_query = types_query_dsl_query_base.and(z.object({ + min_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Documents with a score lower than this floating point number are excluded from the search results.' + })), query: types_query_dsl_query_container, - script: types_script, - }) -); + script: types_script +})); -export const types_query_dsl_span_containing_query = types_query_dsl_query_base.and( - z.lazy(() => - z.object({ - get big() { +export const types_query_dsl_span_containing_query = types_query_dsl_query_base.and(z.lazy(() => z.object({ + get big() { return z.lazy((): any => types_query_dsl_span_query); - }, - get little() { + }, + get little() { return z.lazy((): any => types_query_dsl_span_query); - }, - }) - ) -); + } +}))); export const types_query_dsl_span_query = z.object({ - span_containing: z.optional(types_query_dsl_span_containing_query), - get span_field_masking() { - return z.optional(z.lazy((): any => types_query_dsl_span_field_masking_query)); - }, - get span_first() { - return z.optional(z.lazy((): any => types_query_dsl_span_first_query)); - }, - span_gap: z.optional(types_query_dsl_span_gap_query), - get span_multi() { - return z.optional(z.lazy((): any => types_query_dsl_span_multi_term_query)); - }, - get span_near() { - return z.optional(z.lazy((): any => types_query_dsl_span_near_query)); - }, - get span_not() { - return z.optional(z.lazy((): any => types_query_dsl_span_not_query)); - }, - get span_or() { - return z.optional(z.lazy((): any => types_query_dsl_span_or_query)); - }, - span_term: z.optional( - z.record(z.string(), types_query_dsl_span_term_query).register(z.globalRegistry, { - description: 'The equivalent of the `term` query but for use with other span queries.', - }) - ), - get span_within() { - return z.optional(z.lazy((): any => types_query_dsl_span_within_query)); - }, + span_containing: z.optional(types_query_dsl_span_containing_query), + get span_field_masking() { + return z.optional(z.lazy((): any => types_query_dsl_span_field_masking_query)); + }, + get span_first() { + return z.optional(z.lazy((): any => types_query_dsl_span_first_query)); + }, + span_gap: z.optional(types_query_dsl_span_gap_query), + get span_multi() { + return z.optional(z.lazy((): any => types_query_dsl_span_multi_term_query)); + }, + get span_near() { + return z.optional(z.lazy((): any => types_query_dsl_span_near_query)); + }, + get span_not() { + return z.optional(z.lazy((): any => types_query_dsl_span_not_query)); + }, + get span_or() { + return z.optional(z.lazy((): any => types_query_dsl_span_or_query)); + }, + span_term: z.optional(z.record(z.string(), types_query_dsl_span_term_query).register(z.globalRegistry, { + description: 'The equivalent of the `term` query but for use with other span queries.' + })), + get span_within() { + return z.optional(z.lazy((): any => types_query_dsl_span_within_query)); + } }); -export const types_query_dsl_span_field_masking_query = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_span_field_masking_query = types_query_dsl_query_base.and(z.object({ field: types_field, - query: types_query_dsl_span_query, - }) -); + query: types_query_dsl_span_query +})); -export const types_query_dsl_span_first_query = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_span_first_query = types_query_dsl_query_base.and(z.object({ end: z.number().register(z.globalRegistry, { - description: 'Controls the maximum end position permitted in a match.', + description: 'Controls the maximum end position permitted in a match.' }), - match: types_query_dsl_span_query, - }) -); + match: types_query_dsl_span_query +})); -export const types_query_dsl_span_multi_term_query = types_query_dsl_query_base.and( - z.object({ - match: types_query_dsl_query_container, - }) -); +export const types_query_dsl_span_multi_term_query = types_query_dsl_query_base.and(z.object({ + match: types_query_dsl_query_container +})); -export const types_query_dsl_span_near_query = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_span_near_query = types_query_dsl_query_base.and(z.object({ clauses: z.array(types_query_dsl_span_query).register(z.globalRegistry, { - description: 'Array of one or more other span type queries.', - }), - in_order: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Controls whether matches are required to be in-order.', - }) - ), - slop: z.optional( - z.number().register(z.globalRegistry, { - description: 'Controls the maximum number of intervening unmatched positions permitted.', - }) - ), - }) -); - -export const types_query_dsl_span_not_query = types_query_dsl_query_base.and( - z.object({ - dist: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of tokens from within the include span that can’t have overlap with the exclude span.\nEquivalent to setting both `pre` and `post`.', - }) - ), + description: 'Array of one or more other span type queries.' + }), + in_order: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Controls whether matches are required to be in-order.' + })), + slop: z.optional(z.number().register(z.globalRegistry, { + description: 'Controls the maximum number of intervening unmatched positions permitted.' + })) +})); + +export const types_query_dsl_span_not_query = types_query_dsl_query_base.and(z.object({ + dist: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of tokens from within the include span that can’t have overlap with the exclude span.\nEquivalent to setting both `pre` and `post`.' + })), exclude: types_query_dsl_span_query, include: types_query_dsl_span_query, - post: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of tokens after the include span that can’t have overlap with the exclude span.', - }) - ), - pre: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of tokens before the include span that can’t have overlap with the exclude span.', - }) - ), - }) -); - -export const types_query_dsl_span_or_query = types_query_dsl_query_base.and( - z.object({ + post: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of tokens after the include span that can’t have overlap with the exclude span.' + })), + pre: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of tokens before the include span that can’t have overlap with the exclude span.' + })) +})); + +export const types_query_dsl_span_or_query = types_query_dsl_query_base.and(z.object({ clauses: z.array(types_query_dsl_span_query).register(z.globalRegistry, { - description: 'Array of one or more other span type queries.', - }), - }) -); + description: 'Array of one or more other span type queries.' + }) +})); -export const types_query_dsl_span_within_query = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_span_within_query = types_query_dsl_query_base.and(z.object({ big: types_query_dsl_span_query, - little: types_query_dsl_span_query, - }) -); + little: types_query_dsl_span_query +})); -export const types_query_dsl_terms_set_query = types_query_dsl_query_base.and( - z.object({ +export const types_query_dsl_terms_set_query = types_query_dsl_query_base.and(z.object({ minimum_should_match: z.optional(types_minimum_should_match), minimum_should_match_field: z.optional(types_field), minimum_should_match_script: z.optional(types_script), terms: z.array(types_field_value).register(z.globalRegistry, { - description: 'Array of terms you wish to find in the provided field.', - }), - }) -); - -export const types_aggregations_auto_date_histogram_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - buckets: z.optional( - z.number().register(z.globalRegistry, { - description: 'The target number of buckets.', - }) - ), - field: z.optional(types_field), - format: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The date format used to format `key_as_string` in the response.\nIf no `format` is specified, the first date format specified in the field mapping is used.', - }) - ), - minimum_interval: z.optional(types_aggregations_minimum_interval), - missing: z.optional(types_date_time), - offset: z.optional( - z.string().register(z.globalRegistry, { - description: 'Time zone specified as a ISO 8601 UTC offset.', - }) - ), - params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - script: z.optional(types_script), - time_zone: z.optional(types_time_zone), + description: 'Array of terms you wish to find in the provided field.' }) - ); +})); + +export const types_aggregations_auto_date_histogram_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + buckets: z.optional(z.number().register(z.globalRegistry, { + description: 'The target number of buckets.' + })), + field: z.optional(types_field), + format: z.optional(z.string().register(z.globalRegistry, { + description: 'The date format used to format `key_as_string` in the response.\nIf no `format` is specified, the first date format specified in the field mapping is used.' + })), + minimum_interval: z.optional(types_aggregations_minimum_interval), + missing: z.optional(types_date_time), + offset: z.optional(z.string().register(z.globalRegistry, { + description: 'Time zone specified as a ISO 8601 UTC offset.' + })), + params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + script: z.optional(types_script), + time_zone: z.optional(types_time_zone) +})); -export const types_aggregations_average_aggregation = z - .lazy((): any => types_aggregations_format_metric_aggregation_base) - .and(z.record(z.string(), z.unknown())); +export const types_aggregations_average_aggregation = z.lazy((): any => types_aggregations_format_metric_aggregation_base).and(z.record(z.string(), z.unknown())); -export const types_aggregations_format_metric_aggregation_base = z - .lazy((): any => types_aggregations_metric_aggregation_base) - .and( - z.object({ - format: z.optional(z.string()), - }) - ); +export const types_aggregations_format_metric_aggregation_base = z.lazy((): any => types_aggregations_metric_aggregation_base).and(z.object({ + format: z.optional(z.string()) +})); export const types_aggregations_metric_aggregation_base = z.object({ - field: z.optional(types_field), - missing: z.optional(types_aggregations_missing), - script: z.optional(types_script), + field: z.optional(types_field), + missing: z.optional(types_aggregations_missing), + script: z.optional(types_script) }); -export const types_aggregations_boxplot_aggregation = - types_aggregations_metric_aggregation_base.and( - z.object({ - compression: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error.', - }) - ), - execution_hint: z.optional(types_aggregations_t_digest_execution_hint), - }) - ); +export const types_aggregations_boxplot_aggregation = types_aggregations_metric_aggregation_base.and(z.object({ + compression: z.optional(z.number().register(z.globalRegistry, { + description: 'Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error.' + })), + execution_hint: z.optional(types_aggregations_t_digest_execution_hint) +})); -export const types_aggregations_bucket_script_aggregation = - types_aggregations_pipeline_aggregation_base.and( - z.object({ - script: z.optional(types_script), - }) - ); +export const types_aggregations_bucket_script_aggregation = types_aggregations_pipeline_aggregation_base.and(z.object({ + script: z.optional(types_script) +})); -export const types_aggregations_bucket_selector_aggregation = - types_aggregations_pipeline_aggregation_base.and( - z.object({ - script: z.optional(types_script), - }) - ); - -export const types_aggregations_bucket_sort_aggregation = types_aggregations_aggregation.and( - z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Buckets in positions prior to `from` will be truncated.', - }) - ), - gap_policy: z.optional(types_aggregations_gap_policy), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of buckets to return.\nDefaults to all buckets of the parent aggregation.', - }) - ), - sort: z.optional(types_sort), - }) -); +export const types_aggregations_bucket_selector_aggregation = types_aggregations_pipeline_aggregation_base.and(z.object({ + script: z.optional(types_script) +})); -export const types_aggregations_cardinality_aggregation = - types_aggregations_metric_aggregation_base.and( - z.object({ - precision_threshold: z.optional( - z.number().register(z.globalRegistry, { - description: - 'A unique count below which counts are expected to be close to accurate.\nThis allows to trade memory for accuracy.', - }) - ), - rehash: z.optional(z.boolean()), - execution_hint: z.optional(types_aggregations_cardinality_execution_mode), - }) - ); - -export const types_aggregations_cartesian_bounds_aggregation = - types_aggregations_metric_aggregation_base.and(z.record(z.string(), z.unknown())); - -export const types_aggregations_cartesian_centroid_aggregation = - types_aggregations_metric_aggregation_base.and(z.record(z.string(), z.unknown())); - -export const types_aggregations_composite_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.lazy(() => - z.object({ - after: z.optional(types_aggregations_composite_aggregate_key), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of composite buckets that should be returned.', - }) - ), - get sources() { - return z.optional( - z - .array( - z.record( - z.string(), - z.lazy((): any => types_aggregations_composite_aggregation_source) - ) - ) - .register(z.globalRegistry, { - description: - 'The value sources used to build composite buckets.\nKeys are returned in the order of the `sources` definition.', - }) - ); - }, - }) - ) - ); +export const types_aggregations_bucket_sort_aggregation = types_aggregations_aggregation.and(z.object({ + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Buckets in positions prior to `from` will be truncated.' + })), + gap_policy: z.optional(types_aggregations_gap_policy), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of buckets to return.\nDefaults to all buckets of the parent aggregation.' + })), + sort: z.optional(types_sort) +})); + +export const types_aggregations_cardinality_aggregation = types_aggregations_metric_aggregation_base.and(z.object({ + precision_threshold: z.optional(z.number().register(z.globalRegistry, { + description: 'A unique count below which counts are expected to be close to accurate.\nThis allows to trade memory for accuracy.' + })), + rehash: z.optional(z.boolean()), + execution_hint: z.optional(types_aggregations_cardinality_execution_mode) +})); + +export const types_aggregations_cartesian_bounds_aggregation = types_aggregations_metric_aggregation_base.and(z.record(z.string(), z.unknown())); + +export const types_aggregations_cartesian_centroid_aggregation = types_aggregations_metric_aggregation_base.and(z.record(z.string(), z.unknown())); + +export const types_aggregations_composite_aggregation = types_aggregations_bucket_aggregation_base.and(z.lazy(() => z.object({ + after: z.optional(types_aggregations_composite_aggregate_key), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of composite buckets that should be returned.' + })), + get sources() { + return z.optional(z.array(z.record(z.string(), z.lazy((): any => types_aggregations_composite_aggregation_source))).register(z.globalRegistry, { + description: 'The value sources used to build composite buckets.\nKeys are returned in the order of the `sources` definition.' + })); + } +}))); export const types_aggregations_composite_aggregation_source = z.object({ - get terms() { - return z.optional(z.lazy((): any => types_aggregations_composite_terms_aggregation)); - }, - get histogram() { - return z.optional(z.lazy((): any => types_aggregations_composite_histogram_aggregation)); - }, - get date_histogram() { - return z.optional(z.lazy((): any => types_aggregations_composite_date_histogram_aggregation)); - }, - get geotile_grid() { - return z.optional(z.lazy((): any => types_aggregations_composite_geo_tile_grid_aggregation)); - }, -}); - -export const types_aggregations_composite_terms_aggregation = z - .lazy((): any => types_aggregations_composite_aggregation_base) - .and(z.record(z.string(), z.unknown())); - -export const types_aggregations_composite_aggregation_base = z.object({ - field: z.optional(types_field), - missing_bucket: z.optional(z.boolean()), - missing_order: z.optional(types_aggregations_missing_order), - script: z.optional(types_script), - value_type: z.optional(types_aggregations_value_type), - order: z.optional(types_sort_order), + get terms() { + return z.optional(z.lazy((): any => types_aggregations_composite_terms_aggregation)); + }, + get histogram() { + return z.optional(z.lazy((): any => types_aggregations_composite_histogram_aggregation)); + }, + get date_histogram() { + return z.optional(z.lazy((): any => types_aggregations_composite_date_histogram_aggregation)); + }, + get geotile_grid() { + return z.optional(z.lazy((): any => types_aggregations_composite_geo_tile_grid_aggregation)); + } }); -export const types_aggregations_composite_histogram_aggregation = - types_aggregations_composite_aggregation_base.and( - z.object({ - interval: z.number(), - }) - ); - -export const types_aggregations_composite_date_histogram_aggregation = - types_aggregations_composite_aggregation_base.and( - z.object({ - format: z.optional(z.string()), - calendar_interval: z.optional(types_duration_large), - fixed_interval: z.optional(types_duration_large), - offset: z.optional(types_duration), - time_zone: z.optional(types_time_zone), - }) - ); - -export const types_aggregations_composite_geo_tile_grid_aggregation = - types_aggregations_composite_aggregation_base.and( - z.object({ - precision: z.optional(z.number()), - bounds: z.optional(types_geo_bounds), - }) - ); +export const types_aggregations_composite_terms_aggregation = z.lazy((): any => types_aggregations_composite_aggregation_base).and(z.record(z.string(), z.unknown())); -export const types_aggregations_date_histogram_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - calendar_interval: z.optional(types_aggregations_calendar_interval), - extended_bounds: z.optional(types_aggregations_extended_bounds_field_date_math), - hard_bounds: z.optional(types_aggregations_extended_bounds_field_date_math), - field: z.optional(types_field), - fixed_interval: z.optional(types_duration), - format: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The date format used to format `key_as_string` in the response.\nIf no `format` is specified, the first date format specified in the field mapping is used.', - }) - ), - interval: z.optional(types_duration), - min_doc_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Only returns buckets that have `min_doc_count` number of documents.\nBy default, all buckets between the first bucket that matches documents and the last one are returned.', - }) - ), - missing: z.optional(types_date_time), - offset: z.optional(types_duration), - order: z.optional(types_aggregations_aggregate_order), - params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - script: z.optional(types_script), - time_zone: z.optional(types_time_zone), - keyed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` to associate a unique string key with each bucket and return the ranges as a hash rather than an array.', - }) - ), - }) - ); +export const types_aggregations_composite_aggregation_base = z.object({ + field: z.optional(types_field), + missing_bucket: z.optional(z.boolean()), + missing_order: z.optional(types_aggregations_missing_order), + script: z.optional(types_script), + value_type: z.optional(types_aggregations_value_type), + order: z.optional(types_sort_order) +}); -export const types_aggregations_diversified_sampler_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - execution_hint: z.optional(types_aggregations_sampler_aggregation_execution_hint), - max_docs_per_value: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Limits how many documents are permitted per choice of de-duplicating value.', - }) - ), - script: z.optional(types_script), - shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Limits how many top-scoring documents are collected in the sample processed on each shard.', - }) - ), - field: z.optional(types_field), - }) - ); +export const types_aggregations_composite_histogram_aggregation = types_aggregations_composite_aggregation_base.and(z.object({ + interval: z.number() +})); -export const types_aggregations_extended_stats_aggregation = - types_aggregations_format_metric_aggregation_base.and( - z.object({ - sigma: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of standard deviations above/below the mean to display.', - }) - ), - }) - ); +export const types_aggregations_composite_date_histogram_aggregation = types_aggregations_composite_aggregation_base.and(z.object({ + format: z.optional(z.string()), + calendar_interval: z.optional(types_duration_large), + fixed_interval: z.optional(types_duration_large), + offset: z.optional(types_duration), + time_zone: z.optional(types_time_zone) +})); + +export const types_aggregations_composite_geo_tile_grid_aggregation = types_aggregations_composite_aggregation_base.and(z.object({ + precision: z.optional(z.number()), + bounds: z.optional(types_geo_bounds) +})); + +export const types_aggregations_date_histogram_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + calendar_interval: z.optional(types_aggregations_calendar_interval), + extended_bounds: z.optional(types_aggregations_extended_bounds_field_date_math), + hard_bounds: z.optional(types_aggregations_extended_bounds_field_date_math), + field: z.optional(types_field), + fixed_interval: z.optional(types_duration), + format: z.optional(z.string().register(z.globalRegistry, { + description: 'The date format used to format `key_as_string` in the response.\nIf no `format` is specified, the first date format specified in the field mapping is used.' + })), + interval: z.optional(types_duration), + min_doc_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Only returns buckets that have `min_doc_count` number of documents.\nBy default, all buckets between the first bucket that matches documents and the last one are returned.' + })), + missing: z.optional(types_date_time), + offset: z.optional(types_duration), + order: z.optional(types_aggregations_aggregate_order), + params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + script: z.optional(types_script), + time_zone: z.optional(types_time_zone), + keyed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` to associate a unique string key with each bucket and return the ranges as a hash rather than an array.' + })) +})); + +export const types_aggregations_diversified_sampler_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + execution_hint: z.optional(types_aggregations_sampler_aggregation_execution_hint), + max_docs_per_value: z.optional(z.number().register(z.globalRegistry, { + description: 'Limits how many documents are permitted per choice of de-duplicating value.' + })), + script: z.optional(types_script), + shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Limits how many top-scoring documents are collected in the sample processed on each shard.' + })), + field: z.optional(types_field) +})); + +export const types_aggregations_extended_stats_aggregation = types_aggregations_format_metric_aggregation_base.and(z.object({ + sigma: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of standard deviations above/below the mean to display.' + })) +})); export const types_aggregations_frequent_item_sets_aggregation = z.object({ - fields: z.array(types_aggregations_frequent_item_sets_field).register(z.globalRegistry, { - description: 'Fields to analyze.', - }), - minimum_set_size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The minimum size of one item set.', - }) - ), - minimum_support: z.optional( - z.number().register(z.globalRegistry, { - description: 'The minimum support of one item set.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of top item sets to return.', - }) - ), - filter: z.optional(types_query_dsl_query_container), -}); - -export const types_aggregations_filters_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.lazy(() => - z.object({ - get filters() { - return z.optional(z.lazy((): any => types_aggregations_buckets_query_container)); - }, - other_bucket: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` to add a bucket to the response which will contain all documents that do not match any of the given filters.', - }) - ), - other_bucket_key: z.optional( - z.string().register(z.globalRegistry, { - description: 'The key with which the other bucket is returned.', - }) - ), - keyed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'By default, the named filters aggregation returns the buckets as an object.\nSet to `false` to return the buckets as an array of objects.', - }) - ), - }) - ) - ); + fields: z.array(types_aggregations_frequent_item_sets_field).register(z.globalRegistry, { + description: 'Fields to analyze.' + }), + minimum_set_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum size of one item set.' + })), + minimum_support: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum support of one item set.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of top item sets to return.' + })), + filter: z.optional(types_query_dsl_query_container) +}); + +export const types_aggregations_filters_aggregation = types_aggregations_bucket_aggregation_base.and(z.lazy(() => z.object({ + get filters() { + return z.optional(z.lazy((): any => types_aggregations_buckets_query_container)); + }, + other_bucket: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` to add a bucket to the response which will contain all documents that do not match any of the given filters.' + })), + other_bucket_key: z.optional(z.string().register(z.globalRegistry, { + description: 'The key with which the other bucket is returned.' + })), + keyed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'By default, the named filters aggregation returns the buckets as an object.\nSet to `false` to return the buckets as an array of objects.' + })) +}))); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_query_container = z.union([ - z.record(z.string(), types_query_dsl_query_container), - z.array(types_query_dsl_query_container), + z.record(z.string(), types_query_dsl_query_container), + z.array(types_query_dsl_query_container) ]); -export const types_aggregations_geo_bounds_aggregation = - types_aggregations_metric_aggregation_base.and( - z.object({ - wrap_longitude: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether the bounding box should be allowed to overlap the international date line.', - }) - ), - }) - ); - -export const types_aggregations_geo_centroid_aggregation = - types_aggregations_metric_aggregation_base.and( - z.object({ - count: z.optional(z.number()), - location: z.optional(types_geo_location), - }) - ); - -export const types_aggregations_histogram_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - extended_bounds: z.optional(types_aggregations_extended_boundsdouble), - hard_bounds: z.optional(types_aggregations_extended_boundsdouble), - field: z.optional(types_field), - interval: z.optional( - z.number().register(z.globalRegistry, { - description: 'The interval for the buckets.\nMust be a positive decimal.', - }) - ), - min_doc_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Only returns buckets that have `min_doc_count` number of documents.\nBy default, the response will fill gaps in the histogram with empty buckets.', - }) - ), - missing: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The value to apply to documents that do not have a value.\nBy default, documents without a value are ignored.', - }) - ), - offset: z.optional( - z.number().register(z.globalRegistry, { - description: - 'By default, the bucket keys start with 0 and then continue in even spaced steps of `interval`.\nThe bucket boundaries can be shifted by using the `offset` option.', - }) - ), - order: z.optional(types_aggregations_aggregate_order), - script: z.optional(types_script), - format: z.optional(z.string()), - keyed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, returns buckets as a hash instead of an array, keyed by the bucket keys.', - }) - ), - }) - ); - -export const types_aggregations_max_aggregation = - types_aggregations_format_metric_aggregation_base.and(z.record(z.string(), z.unknown())); - -export const types_aggregations_median_absolute_deviation_aggregation = - types_aggregations_format_metric_aggregation_base.and( - z.object({ - compression: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error.', - }) - ), - execution_hint: z.optional(types_aggregations_t_digest_execution_hint), - }) - ); - -export const types_aggregations_min_aggregation = - types_aggregations_format_metric_aggregation_base.and(z.record(z.string(), z.unknown())); +export const types_aggregations_geo_bounds_aggregation = types_aggregations_metric_aggregation_base.and(z.object({ + wrap_longitude: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether the bounding box should be allowed to overlap the international date line.' + })) +})); -export const types_aggregations_percentile_ranks_aggregation = - types_aggregations_format_metric_aggregation_base.and( - z.object({ - keyed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'By default, the aggregation associates a unique string key with each bucket and returns the ranges as a hash rather than an array.\nSet to `false` to disable this behavior.', - }) - ), - values: z.optional(z.union([z.array(z.number()), z.string(), z.null()])), - hdr: z.optional(types_aggregations_hdr_method), - tdigest: z.optional(types_aggregations_t_digest), - }) - ); - -export const types_aggregations_percentiles_aggregation = - types_aggregations_format_metric_aggregation_base.and( - z.object({ - keyed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'By default, the aggregation associates a unique string key with each bucket and returns the ranges as a hash rather than an array.\nSet to `false` to disable this behavior.', - }) - ), - percents: z.optional(z.union([z.number(), z.array(z.number())])), - hdr: z.optional(types_aggregations_hdr_method), - tdigest: z.optional(types_aggregations_t_digest), - }) - ); +export const types_aggregations_geo_centroid_aggregation = types_aggregations_metric_aggregation_base.and(z.object({ + count: z.optional(z.number()), + location: z.optional(types_geo_location) +})); -export const types_aggregations_range_aggregation = types_aggregations_bucket_aggregation_base.and( - z.object({ +export const types_aggregations_histogram_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + extended_bounds: z.optional(types_aggregations_extended_boundsdouble), + hard_bounds: z.optional(types_aggregations_extended_boundsdouble), field: z.optional(types_field), - missing: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The value to apply to documents that do not have a value.\nBy default, documents without a value are ignored.', - }) - ), - ranges: z.optional( - z.array(types_aggregations_aggregation_range).register(z.globalRegistry, { - description: 'An array of ranges used to bucket documents.', - }) - ), + interval: z.optional(z.number().register(z.globalRegistry, { + description: 'The interval for the buckets.\nMust be a positive decimal.' + })), + min_doc_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Only returns buckets that have `min_doc_count` number of documents.\nBy default, the response will fill gaps in the histogram with empty buckets.' + })), + missing: z.optional(z.number().register(z.globalRegistry, { + description: 'The value to apply to documents that do not have a value.\nBy default, documents without a value are ignored.' + })), + offset: z.optional(z.number().register(z.globalRegistry, { + description: 'By default, the bucket keys start with 0 and then continue in even spaced steps of `interval`.\nThe bucket boundaries can be shifted by using the `offset` option.' + })), + order: z.optional(types_aggregations_aggregate_order), script: z.optional(types_script), - keyed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` to associate a unique string key with each bucket and return the ranges as a hash rather than an array.', - }) - ), format: z.optional(z.string()), - }) -); - -export const types_aggregations_rate_aggregation = - types_aggregations_format_metric_aggregation_base.and( - z.object({ - unit: z.optional(types_aggregations_calendar_interval), - mode: z.optional(types_aggregations_rate_mode), - }) - ); - -export const types_aggregations_scripted_metric_aggregation = - types_aggregations_metric_aggregation_base.and( - z.object({ - combine_script: z.optional(types_script), - init_script: z.optional(types_script), - map_script: z.optional(types_script), - params: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'A global object with script parameters for `init`, `map` and `combine` scripts.\nIt is shared between the scripts.', - }) - ), - reduce_script: z.optional(types_script), - }) - ); - -export const types_aggregations_significant_terms_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.lazy(() => - z.object({ - background_filter: z.optional(types_query_dsl_query_container), - chi_square: z.optional(types_aggregations_chi_square_heuristic), - exclude: z.optional(types_aggregations_terms_exclude), - execution_hint: z.optional(types_aggregations_terms_aggregation_execution_hint), - field: z.optional(types_field), - gnd: z.optional(types_aggregations_google_normalized_distance_heuristic), - include: z.optional(types_aggregations_terms_include), - jlh: z.optional(types_empty_object), - min_doc_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'Only return terms that are found in more than `min_doc_count` hits.', - }) - ), - mutual_information: z.optional(types_aggregations_mutual_information_heuristic), - percentage: z.optional(types_aggregations_percentage_score_heuristic), - get script_heuristic() { - return z.optional(z.lazy((): any => types_aggregations_scripted_heuristic)); - }, - p_value: z.optional(types_aggregations_p_value_heuristic), - shard_min_doc_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`.\nTerms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.', - }) - ), - shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Can be used to control the volumes of candidate terms produced by each shard.\nBy default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of buckets returned out of the overall terms list.', - }) - ), - }) - ) - ); + keyed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns buckets as a hash instead of an array, keyed by the bucket keys.' + })) +})); + +export const types_aggregations_max_aggregation = types_aggregations_format_metric_aggregation_base.and(z.record(z.string(), z.unknown())); + +export const types_aggregations_median_absolute_deviation_aggregation = types_aggregations_format_metric_aggregation_base.and(z.object({ + compression: z.optional(z.number().register(z.globalRegistry, { + description: 'Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error.' + })), + execution_hint: z.optional(types_aggregations_t_digest_execution_hint) +})); + +export const types_aggregations_min_aggregation = types_aggregations_format_metric_aggregation_base.and(z.record(z.string(), z.unknown())); + +export const types_aggregations_percentile_ranks_aggregation = types_aggregations_format_metric_aggregation_base.and(z.object({ + keyed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'By default, the aggregation associates a unique string key with each bucket and returns the ranges as a hash rather than an array.\nSet to `false` to disable this behavior.' + })), + values: z.optional(z.union([ + z.array(z.number()), + z.string(), + z.null() + ])), + hdr: z.optional(types_aggregations_hdr_method), + tdigest: z.optional(types_aggregations_t_digest) +})); + +export const types_aggregations_percentiles_aggregation = types_aggregations_format_metric_aggregation_base.and(z.object({ + keyed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'By default, the aggregation associates a unique string key with each bucket and returns the ranges as a hash rather than an array.\nSet to `false` to disable this behavior.' + })), + percents: z.optional(z.union([ + z.number(), + z.array(z.number()) + ])), + hdr: z.optional(types_aggregations_hdr_method), + tdigest: z.optional(types_aggregations_t_digest) +})); + +export const types_aggregations_range_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + field: z.optional(types_field), + missing: z.optional(z.number().register(z.globalRegistry, { + description: 'The value to apply to documents that do not have a value.\nBy default, documents without a value are ignored.' + })), + ranges: z.optional(z.array(types_aggregations_aggregation_range).register(z.globalRegistry, { + description: 'An array of ranges used to bucket documents.' + })), + script: z.optional(types_script), + keyed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` to associate a unique string key with each bucket and return the ranges as a hash rather than an array.' + })), + format: z.optional(z.string()) +})); + +export const types_aggregations_rate_aggregation = types_aggregations_format_metric_aggregation_base.and(z.object({ + unit: z.optional(types_aggregations_calendar_interval), + mode: z.optional(types_aggregations_rate_mode) +})); + +export const types_aggregations_scripted_metric_aggregation = types_aggregations_metric_aggregation_base.and(z.object({ + combine_script: z.optional(types_script), + init_script: z.optional(types_script), + map_script: z.optional(types_script), + params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'A global object with script parameters for `init`, `map` and `combine` scripts.\nIt is shared between the scripts.' + })), + reduce_script: z.optional(types_script) +})); + +export const types_aggregations_significant_terms_aggregation = types_aggregations_bucket_aggregation_base.and(z.lazy(() => z.object({ + background_filter: z.optional(types_query_dsl_query_container), + chi_square: z.optional(types_aggregations_chi_square_heuristic), + exclude: z.optional(types_aggregations_terms_exclude), + execution_hint: z.optional(types_aggregations_terms_aggregation_execution_hint), + field: z.optional(types_field), + gnd: z.optional(types_aggregations_google_normalized_distance_heuristic), + include: z.optional(types_aggregations_terms_include), + jlh: z.optional(types_empty_object), + min_doc_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Only return terms that are found in more than `min_doc_count` hits.' + })), + mutual_information: z.optional(types_aggregations_mutual_information_heuristic), + percentage: z.optional(types_aggregations_percentage_score_heuristic), + get script_heuristic() { + return z.optional(z.lazy((): any => types_aggregations_scripted_heuristic)); + }, + p_value: z.optional(types_aggregations_p_value_heuristic), + shard_min_doc_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`.\nTerms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.' + })), + shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Can be used to control the volumes of candidate terms produced by each shard.\nBy default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of buckets returned out of the overall terms list.' + })) +}))); export const types_aggregations_scripted_heuristic = z.object({ - script: types_script, + script: types_script }); -export const types_aggregations_significant_text_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.object({ - background_filter: z.optional(types_query_dsl_query_container), - chi_square: z.optional(types_aggregations_chi_square_heuristic), - exclude: z.optional(types_aggregations_terms_exclude), - execution_hint: z.optional(types_aggregations_terms_aggregation_execution_hint), - field: z.optional(types_field), - filter_duplicate_text: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Whether to out duplicate text to deal with noisy data.', - }) - ), - gnd: z.optional(types_aggregations_google_normalized_distance_heuristic), - include: z.optional(types_aggregations_terms_include), - jlh: z.optional(types_empty_object), - min_doc_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'Only return values that are found in more than `min_doc_count` hits.', - }) - ), - mutual_information: z.optional(types_aggregations_mutual_information_heuristic), - percentage: z.optional(types_aggregations_percentage_score_heuristic), - script_heuristic: z.optional(types_aggregations_scripted_heuristic), - shard_min_doc_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Regulates the certainty a shard has if the values should actually be added to the candidate list or not with respect to the min_doc_count.\nValues will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.', - }) - ), - shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of candidate terms produced by each shard.\nBy default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of buckets returned out of the overall terms list.', - }) - ), - source_fields: z.optional(types_fields), - }) - ); - -export const types_aggregations_stats_aggregation = - types_aggregations_format_metric_aggregation_base.and(z.record(z.string(), z.unknown())); - -export const types_aggregations_string_stats_aggregation = - types_aggregations_metric_aggregation_base.and( - z.object({ - show_distribution: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Shows the probability distribution for all characters.', - }) - ), - }) - ); - -export const types_aggregations_sum_aggregation = - types_aggregations_format_metric_aggregation_base.and(z.record(z.string(), z.unknown())); - -export const types_aggregations_terms_aggregation = types_aggregations_bucket_aggregation_base.and( - z.object({ +export const types_aggregations_significant_text_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ + background_filter: z.optional(types_query_dsl_query_container), + chi_square: z.optional(types_aggregations_chi_square_heuristic), + exclude: z.optional(types_aggregations_terms_exclude), + execution_hint: z.optional(types_aggregations_terms_aggregation_execution_hint), + field: z.optional(types_field), + filter_duplicate_text: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to out duplicate text to deal with noisy data.' + })), + gnd: z.optional(types_aggregations_google_normalized_distance_heuristic), + include: z.optional(types_aggregations_terms_include), + jlh: z.optional(types_empty_object), + min_doc_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Only return values that are found in more than `min_doc_count` hits.' + })), + mutual_information: z.optional(types_aggregations_mutual_information_heuristic), + percentage: z.optional(types_aggregations_percentage_score_heuristic), + script_heuristic: z.optional(types_aggregations_scripted_heuristic), + shard_min_doc_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Regulates the certainty a shard has if the values should actually be added to the candidate list or not with respect to the min_doc_count.\nValues will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.' + })), + shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of candidate terms produced by each shard.\nBy default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of buckets returned out of the overall terms list.' + })), + source_fields: z.optional(types_fields) +})); + +export const types_aggregations_stats_aggregation = types_aggregations_format_metric_aggregation_base.and(z.record(z.string(), z.unknown())); + +export const types_aggregations_string_stats_aggregation = types_aggregations_metric_aggregation_base.and(z.object({ + show_distribution: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Shows the probability distribution for all characters.' + })) +})); + +export const types_aggregations_sum_aggregation = types_aggregations_format_metric_aggregation_base.and(z.record(z.string(), z.unknown())); + +export const types_aggregations_terms_aggregation = types_aggregations_bucket_aggregation_base.and(z.object({ collect_mode: z.optional(types_aggregations_terms_aggregation_collect_mode), exclude: z.optional(types_aggregations_terms_exclude), execution_hint: z.optional(types_aggregations_terms_aggregation_execution_hint), field: z.optional(types_field), include: z.optional(types_aggregations_terms_include), - min_doc_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'Only return values that are found in more than `min_doc_count` hits.', - }) - ), + min_doc_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Only return values that are found in more than `min_doc_count` hits.' + })), missing: z.optional(types_aggregations_missing), missing_order: z.optional(types_aggregations_missing_order), missing_bucket: z.optional(z.boolean()), - value_type: z.optional( - z.string().register(z.globalRegistry, { - description: 'Coerced unmapped fields into the specified type.', - }) - ), + value_type: z.optional(z.string().register(z.globalRegistry, { + description: 'Coerced unmapped fields into the specified type.' + })), order: z.optional(types_aggregations_aggregate_order), script: z.optional(types_script), - shard_min_doc_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`.\nTerms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.', - }) - ), - shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of candidate terms produced by each shard.\nBy default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.', - }) - ), - show_term_doc_count_error: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` to return the `doc_count_error_upper_bound`, which is an upper bound to the error on the `doc_count` returned by each shard.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of buckets returned out of the overall terms list.', - }) - ), - format: z.optional(z.string()), - }) -); + shard_min_doc_count: z.optional(z.number().register(z.globalRegistry, { + description: 'Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`.\nTerms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.' + })), + shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of candidate terms produced by each shard.\nBy default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.' + })), + show_term_doc_count_error: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` to return the `doc_count_error_upper_bound`, which is an upper bound to the error on the `doc_count` returned by each shard.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of buckets returned out of the overall terms list.' + })), + format: z.optional(z.string()) +})); + +export const types_aggregations_top_hits_aggregation = types_aggregations_metric_aggregation_base.and(z.object({ + docvalue_fields: z.optional(z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { + description: 'Fields for which to return doc values.' + })), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns detailed information about score computation as part of a hit.' + })), + fields: z.optional(z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { + description: 'Array of wildcard (*) patterns. The request returns values for field names\nmatching these patterns in the hits.fields property of the response.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Starting document offset.' + })), + highlight: z.optional(global_search_types_highlight), + script_fields: z.optional(z.record(z.string(), types_script_field).register(z.globalRegistry, { + description: 'Returns the result of one or more script evaluations for each hit.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of top matching hits to return per bucket.' + })), + sort: z.optional(types_sort), + _source: z.optional(global_search_types_source_config), + stored_fields: z.optional(types_fields), + track_scores: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, calculates and returns document scores, even if the scores are not used for sorting.' + })), + version: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns document version as part of a hit.' + })), + seq_no_primary_term: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns sequence number and primary term of the last modification of each hit.' + })) +})); + +export const types_aggregations_t_test_aggregation = types_aggregations_aggregation.and(z.lazy(() => z.object({ + get a() { + return z.optional(z.lazy((): any => types_aggregations_test_population)); + }, + get b() { + return z.optional(z.lazy((): any => types_aggregations_test_population)); + }, + type: z.optional(types_aggregations_t_test_type) +}))); + +export const types_aggregations_test_population = z.object({ + field: types_field, + script: z.optional(types_script), + filter: z.optional(types_query_dsl_query_container) +}); + +export const types_aggregations_top_metrics_aggregation = types_aggregations_metric_aggregation_base.and(z.object({ + metrics: z.optional(z.union([ + types_aggregations_top_metrics_value, + z.array(types_aggregations_top_metrics_value) + ])), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of top documents from which to return metrics.' + })), + sort: z.optional(types_sort) +})); + +export const types_aggregations_value_count_aggregation = z.lazy((): any => types_aggregations_formattable_metric_aggregation).and(z.record(z.string(), z.unknown())); + +export const types_aggregations_formattable_metric_aggregation = types_aggregations_metric_aggregation_base.and(z.object({ + format: z.optional(z.string()) +})); + +export const types_aggregations_weighted_average_aggregation = types_aggregations_aggregation.and(z.lazy(() => z.object({ + format: z.optional(z.string().register(z.globalRegistry, { + description: 'A numeric response formatter.' + })), + get value() { + return z.optional(z.lazy((): any => types_aggregations_weighted_average_value)); + }, + value_type: z.optional(types_aggregations_value_type), + get weight() { + return z.optional(z.lazy((): any => types_aggregations_weighted_average_value)); + } +}))); + +export const types_aggregations_weighted_average_value = z.object({ + field: z.optional(types_field), + missing: z.optional(z.number().register(z.globalRegistry, { + description: 'A value or weight to use if the field is missing.' + })), + script: z.optional(types_script) +}); + +export const types_aggregations_variable_width_histogram_aggregation = z.object({ + field: z.optional(types_field), + buckets: z.optional(z.number().register(z.globalRegistry, { + description: 'The target number of buckets.' + })), + shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of buckets that the coordinating node will request from each shard.\nDefaults to `buckets * 50`.' + })), + initial_buffer: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the number of individual documents that will be stored in memory on a shard before the initial bucketing algorithm is run.\nDefaults to `min(10 * shard_size, 50000)`.' + })), + script: z.optional(types_script) +}); + +export const global_bulk_update_action = z.object({ + detect_noop: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the `result` in the response is set to \'noop\' when no changes to the document occur.' + })), + doc: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'A partial update to an existing document.' + })), + doc_as_upsert: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` to use the contents of `doc` as the value of `upsert`.' + })), + script: z.optional(types_script), + scripted_upsert: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` to run the script whether or not the document exists.' + })), + _source: z.optional(global_search_types_source_config), + upsert: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'If the document does not already exist, the contents of `upsert` are inserted as a new document.\nIf the document exists, the `script` is run.' + })) +}); + +export const indices_types_index_settings = z.object({ + get index() { + return z.optional(z.lazy((): any => indices_types_index_settings)); + }, + mode: z.optional(z.string()), + routing_path: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + soft_deletes: z.optional(indices_types_soft_deletes), + sort: z.optional(indices_types_index_segment_sort), + number_of_shards: z.optional(z.union([ + z.number(), + z.string() + ])), + number_of_replicas: z.optional(z.union([ + z.number(), + z.string() + ])), + number_of_routing_shards: z.optional(z.number()), + check_on_startup: z.optional(indices_types_index_check_on_startup), + codec: z.optional(z.string()), + routing_partition_size: z.optional(spec_utils_stringifiedinteger), + load_fixed_bitset_filters_eagerly: z.optional(z.boolean()), + hidden: z.optional(z.union([ + z.boolean(), + z.string() + ])), + auto_expand_replicas: z.optional(z.union([ + z.string(), + spec_utils_null_value + ])), + merge: z.optional(indices_types_merge), + search: z.optional(indices_types_settings_search), + refresh_interval: z.optional(types_duration), + max_result_window: z.optional(z.number()), + max_inner_result_window: z.optional(z.number()), + max_rescore_window: z.optional(z.number()), + max_docvalue_fields_search: z.optional(z.number()), + max_script_fields: z.optional(z.number()), + max_ngram_diff: z.optional(z.number()), + max_shingle_diff: z.optional(z.number()), + blocks: z.optional(indices_types_index_setting_blocks), + max_refresh_listeners: z.optional(z.number()), + analyze: z.optional(indices_types_settings_analyze), + highlight: z.optional(indices_types_settings_highlight), + max_terms_count: z.optional(z.number()), + max_regex_length: z.optional(z.number()), + routing: z.optional(indices_types_index_routing), + gc_deletes: z.optional(types_duration), + default_pipeline: z.optional(types_pipeline_name), + final_pipeline: z.optional(types_pipeline_name), + lifecycle: z.optional(indices_types_index_settings_lifecycle), + provided_name: z.optional(types_name), + creation_date: z.optional(spec_utils_stringified_epoch_time_unit_millis), + creation_date_string: z.optional(types_date_time), + uuid: z.optional(types_uuid), + version: z.optional(indices_types_index_versioning), + verified_before_close: z.optional(z.union([ + z.boolean(), + z.string() + ])), + format: z.optional(z.union([ + z.string(), + z.number() + ])), + max_slices_per_scroll: z.optional(z.number()), + translog: z.optional(indices_types_translog), + query_string: z.optional(indices_types_settings_query_string), + priority: z.optional(z.union([ + z.number(), + z.string() + ])), + top_metrics_max_size: z.optional(z.number()), + get analysis() { + return z.optional(z.lazy((): any => indices_types_index_settings_analysis)); + }, + get settings() { + return z.optional(z.lazy((): any => indices_types_index_settings)); + }, + time_series: z.optional(indices_types_index_settings_time_series), + queries: z.optional(indices_types_queries), + get similarity() { + return z.optional(z.record(z.string(), z.lazy((): any => indices_types_settings_similarity)).register(z.globalRegistry, { + description: 'Configure custom similarity settings to customize how search results are scored.' + })); + }, + mapping: z.optional(indices_types_mapping_limit_settings), + 'indexing.slowlog': z.optional(indices_types_indexing_slowlog_settings), + indexing_pressure: z.optional(indices_types_indexing_pressure), + store: z.optional(indices_types_storage) +}); + +export const indices_types_index_settings_analysis = z.object({ + analyzer: z.optional(z.record(z.string(), types_analysis_analyzer)), + char_filter: z.optional(z.record(z.string(), types_analysis_char_filter)), + get filter() { + return z.optional(z.record(z.string(), z.lazy((): any => types_analysis_token_filter))); + }, + normalizer: z.optional(z.record(z.string(), types_analysis_normalizer)), + tokenizer: z.optional(z.record(z.string(), types_analysis_tokenizer)) +}); + +export const types_analysis_token_filter = z.union([ + z.string(), + z.lazy((): any => types_analysis_token_filter_definition) +]); -export const types_aggregations_top_hits_aggregation = - types_aggregations_metric_aggregation_base.and( +export const types_analysis_token_filter_definition = z.union([ + z.object({ + type: z.literal('apostrophe') + }).and(types_analysis_apostrophe_token_filter), + z.object({ + type: z.literal('arabic_stem') + }).and(types_analysis_arabic_stem_token_filter), + z.object({ + type: z.literal('arabic_normalization') + }).and(types_analysis_arabic_normalization_token_filter), + z.object({ + type: z.literal('asciifolding') + }).and(types_analysis_ascii_folding_token_filter), + z.object({ + type: z.literal('bengali_normalization') + }).and(types_analysis_bengali_normalization_token_filter), + z.object({ + type: z.literal('brazilian_stem') + }).and(types_analysis_brazilian_stem_token_filter), + z.object({ + type: z.literal('cjk_bigram') + }).and(types_analysis_cjk_bigram_token_filter), + z.object({ + type: z.literal('cjk_width') + }).and(types_analysis_cjk_width_token_filter), + z.object({ + type: z.literal('classic') + }).and(types_analysis_classic_token_filter), + z.object({ + type: z.literal('common_grams') + }).and(types_analysis_common_grams_token_filter), + z.object({ + type: z.literal('condition') + }).and(z.lazy(() => z.lazy((): any => types_analysis_condition_token_filter))), + z.object({ + type: z.literal('czech_stem') + }).and(types_analysis_czech_stem_token_filter), + z.object({ + type: z.literal('decimal_digit') + }).and(types_analysis_decimal_digit_token_filter), + z.object({ + type: z.literal('delimited_payload') + }).and(types_analysis_delimited_payload_token_filter), + z.object({ + type: z.literal('dutch_stem') + }).and(types_analysis_dutch_stem_token_filter), + z.object({ + type: z.literal('edge_ngram') + }).and(types_analysis_edge_n_gram_token_filter), + z.object({ + type: z.literal('elision') + }).and(types_analysis_elision_token_filter), + z.object({ + type: z.literal('fingerprint') + }).and(types_analysis_fingerprint_token_filter), + z.object({ + type: z.literal('flatten_graph') + }).and(types_analysis_flatten_graph_token_filter), + z.object({ + type: z.literal('french_stem') + }).and(types_analysis_french_stem_token_filter), + z.object({ + type: z.literal('german_normalization') + }).and(types_analysis_german_normalization_token_filter), + z.object({ + type: z.literal('german_stem') + }).and(types_analysis_german_stem_token_filter), + z.object({ + type: z.literal('hindi_normalization') + }).and(types_analysis_hindi_normalization_token_filter), + z.object({ + type: z.literal('hunspell') + }).and(types_analysis_hunspell_token_filter), + z.object({ + type: z.literal('hyphenation_decompounder') + }).and(types_analysis_hyphenation_decompounder_token_filter), + z.object({ + type: z.literal('indic_normalization') + }).and(types_analysis_indic_normalization_token_filter), + z.object({ + type: z.literal('keep_types') + }).and(types_analysis_keep_types_token_filter), + z.object({ + type: z.literal('keep') + }).and(types_analysis_keep_words_token_filter), + z.object({ + type: z.literal('keyword_marker') + }).and(types_analysis_keyword_marker_token_filter), + z.object({ + type: z.literal('keyword_repeat') + }).and(types_analysis_keyword_repeat_token_filter), + z.object({ + type: z.literal('kstem') + }).and(types_analysis_k_stem_token_filter), + z.object({ + type: z.literal('length') + }).and(types_analysis_length_token_filter), + z.object({ + type: z.literal('limit') + }).and(types_analysis_limit_token_count_token_filter), + z.object({ + type: z.literal('lowercase') + }).and(types_analysis_lowercase_token_filter), + z.object({ + type: z.literal('min_hash') + }).and(types_analysis_min_hash_token_filter), + z.object({ + type: z.literal('multiplexer') + }).and(types_analysis_multiplexer_token_filter), + z.object({ + type: z.literal('ngram') + }).and(types_analysis_n_gram_token_filter), + z.object({ + type: z.literal('nori_part_of_speech') + }).and(types_analysis_nori_part_of_speech_token_filter), + z.object({ + type: z.literal('pattern_capture') + }).and(types_analysis_pattern_capture_token_filter), + z.object({ + type: z.literal('pattern_replace') + }).and(types_analysis_pattern_replace_token_filter), + z.object({ + type: z.literal('persian_normalization') + }).and(types_analysis_persian_normalization_token_filter), + z.object({ + type: z.literal('persian_stem') + }).and(types_analysis_persian_stem_token_filter), + z.object({ + type: z.literal('porter_stem') + }).and(types_analysis_porter_stem_token_filter), + z.object({ + type: z.literal('predicate_token_filter') + }).and(z.lazy(() => z.lazy((): any => types_analysis_predicate_token_filter))), + z.object({ + type: z.literal('remove_duplicates') + }).and(types_analysis_remove_duplicates_token_filter), + z.object({ + type: z.literal('reverse') + }).and(types_analysis_reverse_token_filter), + z.object({ + type: z.literal('russian_stem') + }).and(types_analysis_russian_stem_token_filter), + z.object({ + type: z.literal('scandinavian_folding') + }).and(types_analysis_scandinavian_folding_token_filter), + z.object({ + type: z.literal('scandinavian_normalization') + }).and(types_analysis_scandinavian_normalization_token_filter), + z.object({ + type: z.literal('serbian_normalization') + }).and(types_analysis_serbian_normalization_token_filter), + z.object({ + type: z.literal('shingle') + }).and(types_analysis_shingle_token_filter), + z.object({ + type: z.literal('snowball') + }).and(types_analysis_snowball_token_filter), + z.object({ + type: z.literal('sorani_normalization') + }).and(types_analysis_sorani_normalization_token_filter), + z.object({ + type: z.literal('stemmer_override') + }).and(types_analysis_stemmer_override_token_filter), + z.object({ + type: z.literal('stemmer') + }).and(types_analysis_stemmer_token_filter), + z.object({ + type: z.literal('stop') + }).and(types_analysis_stop_token_filter), + z.object({ + type: z.literal('synonym_graph') + }).and(types_analysis_synonym_graph_token_filter), + z.object({ + type: z.literal('synonym') + }).and(types_analysis_synonym_token_filter), + z.object({ + type: z.literal('trim') + }).and(types_analysis_trim_token_filter), + z.object({ + type: z.literal('truncate') + }).and(types_analysis_truncate_token_filter), + z.object({ + type: z.literal('unique') + }).and(types_analysis_unique_token_filter), + z.object({ + type: z.literal('uppercase') + }).and(types_analysis_uppercase_token_filter), + z.object({ + type: z.literal('word_delimiter_graph') + }).and(types_analysis_word_delimiter_graph_token_filter), + z.object({ + type: z.literal('word_delimiter') + }).and(types_analysis_word_delimiter_token_filter), + z.object({ + type: z.literal('ja_stop') + }).and(types_analysis_ja_stop_token_filter), z.object({ - docvalue_fields: z.optional( - z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { - description: 'Fields for which to return doc values.', - }) - ), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, returns detailed information about score computation as part of a hit.', - }) - ), - fields: z.optional( - z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { - description: - 'Array of wildcard (*) patterns. The request returns values for field names\nmatching these patterns in the hits.fields property of the response.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Starting document offset.', - }) - ), - highlight: z.optional(global_search_types_highlight), - script_fields: z.optional( - z.record(z.string(), types_script_field).register(z.globalRegistry, { - description: 'Returns the result of one or more script evaluations for each hit.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of top matching hits to return per bucket.', - }) - ), - sort: z.optional(types_sort), - _source: z.optional(global_search_types_source_config), - stored_fields: z.optional(types_fields), - track_scores: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, calculates and returns document scores, even if the scores are not used for sorting.', - }) - ), - version: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns document version as part of a hit.', - }) - ), - seq_no_primary_term: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, returns sequence number and primary term of the last modification of each hit.', - }) - ), - }) - ); - -export const types_aggregations_t_test_aggregation = types_aggregations_aggregation.and( - z.lazy(() => + type: z.literal('kuromoji_stemmer') + }).and(types_analysis_kuromoji_stemmer_token_filter), z.object({ - get a() { - return z.optional(z.lazy((): any => types_aggregations_test_population)); - }, - get b() { - return z.optional(z.lazy((): any => types_aggregations_test_population)); - }, - type: z.optional(types_aggregations_t_test_type), - }) - ) -); - -export const types_aggregations_test_population = z.object({ - field: types_field, - script: z.optional(types_script), - filter: z.optional(types_query_dsl_query_container), -}); - -export const types_aggregations_top_metrics_aggregation = - types_aggregations_metric_aggregation_base.and( + type: z.literal('kuromoji_readingform') + }).and(types_analysis_kuromoji_reading_form_token_filter), z.object({ - metrics: z.optional( - z.union([ - types_aggregations_top_metrics_value, - z.array(types_aggregations_top_metrics_value), - ]) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of top documents from which to return metrics.', - }) - ), - sort: z.optional(types_sort), - }) - ); - -export const types_aggregations_value_count_aggregation = z - .lazy((): any => types_aggregations_formattable_metric_aggregation) - .and(z.record(z.string(), z.unknown())); - -export const types_aggregations_formattable_metric_aggregation = - types_aggregations_metric_aggregation_base.and( + type: z.literal('kuromoji_part_of_speech') + }).and(types_analysis_kuromoji_part_of_speech_token_filter), z.object({ - format: z.optional(z.string()), - }) - ); - -export const types_aggregations_weighted_average_aggregation = types_aggregations_aggregation.and( - z.lazy(() => + type: z.literal('icu_collation') + }).and(types_analysis_icu_collation_token_filter), z.object({ - format: z.optional( - z.string().register(z.globalRegistry, { - description: 'A numeric response formatter.', - }) - ), - get value() { - return z.optional(z.lazy((): any => types_aggregations_weighted_average_value)); - }, - value_type: z.optional(types_aggregations_value_type), - get weight() { - return z.optional(z.lazy((): any => types_aggregations_weighted_average_value)); - }, - }) - ) -); - -export const types_aggregations_weighted_average_value = z.object({ - field: z.optional(types_field), - missing: z.optional( - z.number().register(z.globalRegistry, { - description: 'A value or weight to use if the field is missing.', - }) - ), - script: z.optional(types_script), -}); - -export const types_aggregations_variable_width_histogram_aggregation = z.object({ - field: z.optional(types_field), - buckets: z.optional( - z.number().register(z.globalRegistry, { - description: 'The target number of buckets.', - }) - ), - shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of buckets that the coordinating node will request from each shard.\nDefaults to `buckets * 50`.', - }) - ), - initial_buffer: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Specifies the number of individual documents that will be stored in memory on a shard before the initial bucketing algorithm is run.\nDefaults to `min(10 * shard_size, 50000)`.', - }) - ), - script: z.optional(types_script), -}); - -export const global_bulk_update_action = z.object({ - detect_noop: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If true, the `result` in the response is set to 'noop' when no changes to the document occur.", - }) - ), - doc: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: 'A partial update to an existing document.', - }) - ), - doc_as_upsert: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Set to `true` to use the contents of `doc` as the value of `upsert`.', - }) - ), - script: z.optional(types_script), - scripted_upsert: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Set to `true` to run the script whether or not the document exists.', - }) - ), - _source: z.optional(global_search_types_source_config), - upsert: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'If the document does not already exist, the contents of `upsert` are inserted as a new document.\nIf the document exists, the `script` is run.', - }) - ), -}); - -export const indices_types_index_settings = z.object({ - get index() { - return z.optional(z.lazy((): any => indices_types_index_settings)); - }, - mode: z.optional(z.string()), - routing_path: z.optional(z.union([z.string(), z.array(z.string())])), - soft_deletes: z.optional(indices_types_soft_deletes), - sort: z.optional(indices_types_index_segment_sort), - number_of_shards: z.optional(z.union([z.number(), z.string()])), - number_of_replicas: z.optional(z.union([z.number(), z.string()])), - number_of_routing_shards: z.optional(z.number()), - check_on_startup: z.optional(indices_types_index_check_on_startup), - codec: z.optional(z.string()), - routing_partition_size: z.optional(spec_utils_stringifiedinteger), - load_fixed_bitset_filters_eagerly: z.optional(z.boolean()), - hidden: z.optional(z.union([z.boolean(), z.string()])), - auto_expand_replicas: z.optional(z.union([z.string(), spec_utils_null_value])), - merge: z.optional(indices_types_merge), - search: z.optional(indices_types_settings_search), - refresh_interval: z.optional(types_duration), - max_result_window: z.optional(z.number()), - max_inner_result_window: z.optional(z.number()), - max_rescore_window: z.optional(z.number()), - max_docvalue_fields_search: z.optional(z.number()), - max_script_fields: z.optional(z.number()), - max_ngram_diff: z.optional(z.number()), - max_shingle_diff: z.optional(z.number()), - blocks: z.optional(indices_types_index_setting_blocks), - max_refresh_listeners: z.optional(z.number()), - analyze: z.optional(indices_types_settings_analyze), - highlight: z.optional(indices_types_settings_highlight), - max_terms_count: z.optional(z.number()), - max_regex_length: z.optional(z.number()), - routing: z.optional(indices_types_index_routing), - gc_deletes: z.optional(types_duration), - default_pipeline: z.optional(types_pipeline_name), - final_pipeline: z.optional(types_pipeline_name), - lifecycle: z.optional(indices_types_index_settings_lifecycle), - provided_name: z.optional(types_name), - creation_date: z.optional(spec_utils_stringified_epoch_time_unit_millis), - creation_date_string: z.optional(types_date_time), - uuid: z.optional(types_uuid), - version: z.optional(indices_types_index_versioning), - verified_before_close: z.optional(z.union([z.boolean(), z.string()])), - format: z.optional(z.union([z.string(), z.number()])), - max_slices_per_scroll: z.optional(z.number()), - translog: z.optional(indices_types_translog), - query_string: z.optional(indices_types_settings_query_string), - priority: z.optional(z.union([z.number(), z.string()])), - top_metrics_max_size: z.optional(z.number()), - get analysis() { - return z.optional(z.lazy((): any => indices_types_index_settings_analysis)); - }, - get settings() { - return z.optional(z.lazy((): any => indices_types_index_settings)); - }, - time_series: z.optional(indices_types_index_settings_time_series), - queries: z.optional(indices_types_queries), - get similarity() { - return z.optional( - z - .record( - z.string(), - z.lazy((): any => indices_types_settings_similarity) - ) - .register(z.globalRegistry, { - description: - 'Configure custom similarity settings to customize how search results are scored.', - }) - ); - }, - mapping: z.optional(indices_types_mapping_limit_settings), - 'indexing.slowlog': z.optional(indices_types_indexing_slowlog_settings), - indexing_pressure: z.optional(indices_types_indexing_pressure), - store: z.optional(indices_types_storage), -}); - -export const indices_types_index_settings_analysis = z.object({ - analyzer: z.optional(z.record(z.string(), types_analysis_analyzer)), - char_filter: z.optional(z.record(z.string(), types_analysis_char_filter)), - get filter() { - return z.optional( - z.record( - z.string(), - z.lazy((): any => types_analysis_token_filter) - ) - ); - }, - normalizer: z.optional(z.record(z.string(), types_analysis_normalizer)), - tokenizer: z.optional(z.record(z.string(), types_analysis_tokenizer)), -}); - -export const types_analysis_token_filter = z.union([ - z.string(), - z.lazy((): any => types_analysis_token_filter_definition), -]); - -export const types_analysis_token_filter_definition = z.union([ - z - .object({ - type: z.literal('apostrophe'), - }) - .and(types_analysis_apostrophe_token_filter), - z - .object({ - type: z.literal('arabic_stem'), - }) - .and(types_analysis_arabic_stem_token_filter), - z - .object({ - type: z.literal('arabic_normalization'), - }) - .and(types_analysis_arabic_normalization_token_filter), - z - .object({ - type: z.literal('asciifolding'), - }) - .and(types_analysis_ascii_folding_token_filter), - z - .object({ - type: z.literal('bengali_normalization'), - }) - .and(types_analysis_bengali_normalization_token_filter), - z - .object({ - type: z.literal('brazilian_stem'), - }) - .and(types_analysis_brazilian_stem_token_filter), - z - .object({ - type: z.literal('cjk_bigram'), - }) - .and(types_analysis_cjk_bigram_token_filter), - z - .object({ - type: z.literal('cjk_width'), - }) - .and(types_analysis_cjk_width_token_filter), - z - .object({ - type: z.literal('classic'), - }) - .and(types_analysis_classic_token_filter), - z - .object({ - type: z.literal('common_grams'), - }) - .and(types_analysis_common_grams_token_filter), - z - .object({ - type: z.literal('condition'), - }) - .and(z.lazy(() => z.lazy((): any => types_analysis_condition_token_filter))), - z - .object({ - type: z.literal('czech_stem'), - }) - .and(types_analysis_czech_stem_token_filter), - z - .object({ - type: z.literal('decimal_digit'), - }) - .and(types_analysis_decimal_digit_token_filter), - z - .object({ - type: z.literal('delimited_payload'), - }) - .and(types_analysis_delimited_payload_token_filter), - z - .object({ - type: z.literal('dutch_stem'), - }) - .and(types_analysis_dutch_stem_token_filter), - z - .object({ - type: z.literal('edge_ngram'), - }) - .and(types_analysis_edge_n_gram_token_filter), - z - .object({ - type: z.literal('elision'), - }) - .and(types_analysis_elision_token_filter), - z - .object({ - type: z.literal('fingerprint'), - }) - .and(types_analysis_fingerprint_token_filter), - z - .object({ - type: z.literal('flatten_graph'), - }) - .and(types_analysis_flatten_graph_token_filter), - z - .object({ - type: z.literal('french_stem'), - }) - .and(types_analysis_french_stem_token_filter), - z - .object({ - type: z.literal('german_normalization'), - }) - .and(types_analysis_german_normalization_token_filter), - z - .object({ - type: z.literal('german_stem'), - }) - .and(types_analysis_german_stem_token_filter), - z - .object({ - type: z.literal('hindi_normalization'), - }) - .and(types_analysis_hindi_normalization_token_filter), - z - .object({ - type: z.literal('hunspell'), - }) - .and(types_analysis_hunspell_token_filter), - z - .object({ - type: z.literal('hyphenation_decompounder'), - }) - .and(types_analysis_hyphenation_decompounder_token_filter), - z - .object({ - type: z.literal('indic_normalization'), - }) - .and(types_analysis_indic_normalization_token_filter), - z - .object({ - type: z.literal('keep_types'), - }) - .and(types_analysis_keep_types_token_filter), - z - .object({ - type: z.literal('keep'), - }) - .and(types_analysis_keep_words_token_filter), - z - .object({ - type: z.literal('keyword_marker'), - }) - .and(types_analysis_keyword_marker_token_filter), - z - .object({ - type: z.literal('keyword_repeat'), - }) - .and(types_analysis_keyword_repeat_token_filter), - z - .object({ - type: z.literal('kstem'), - }) - .and(types_analysis_k_stem_token_filter), - z - .object({ - type: z.literal('length'), - }) - .and(types_analysis_length_token_filter), - z - .object({ - type: z.literal('limit'), - }) - .and(types_analysis_limit_token_count_token_filter), - z - .object({ - type: z.literal('lowercase'), - }) - .and(types_analysis_lowercase_token_filter), - z - .object({ - type: z.literal('min_hash'), - }) - .and(types_analysis_min_hash_token_filter), - z - .object({ - type: z.literal('multiplexer'), - }) - .and(types_analysis_multiplexer_token_filter), - z - .object({ - type: z.literal('ngram'), - }) - .and(types_analysis_n_gram_token_filter), - z - .object({ - type: z.literal('nori_part_of_speech'), - }) - .and(types_analysis_nori_part_of_speech_token_filter), - z - .object({ - type: z.literal('pattern_capture'), - }) - .and(types_analysis_pattern_capture_token_filter), - z - .object({ - type: z.literal('pattern_replace'), - }) - .and(types_analysis_pattern_replace_token_filter), - z - .object({ - type: z.literal('persian_normalization'), - }) - .and(types_analysis_persian_normalization_token_filter), - z - .object({ - type: z.literal('persian_stem'), - }) - .and(types_analysis_persian_stem_token_filter), - z - .object({ - type: z.literal('porter_stem'), - }) - .and(types_analysis_porter_stem_token_filter), - z - .object({ - type: z.literal('predicate_token_filter'), - }) - .and(z.lazy(() => z.lazy((): any => types_analysis_predicate_token_filter))), - z - .object({ - type: z.literal('remove_duplicates'), - }) - .and(types_analysis_remove_duplicates_token_filter), - z - .object({ - type: z.literal('reverse'), - }) - .and(types_analysis_reverse_token_filter), - z - .object({ - type: z.literal('russian_stem'), - }) - .and(types_analysis_russian_stem_token_filter), - z - .object({ - type: z.literal('scandinavian_folding'), - }) - .and(types_analysis_scandinavian_folding_token_filter), - z - .object({ - type: z.literal('scandinavian_normalization'), - }) - .and(types_analysis_scandinavian_normalization_token_filter), - z - .object({ - type: z.literal('serbian_normalization'), - }) - .and(types_analysis_serbian_normalization_token_filter), - z - .object({ - type: z.literal('shingle'), - }) - .and(types_analysis_shingle_token_filter), - z - .object({ - type: z.literal('snowball'), - }) - .and(types_analysis_snowball_token_filter), - z - .object({ - type: z.literal('sorani_normalization'), - }) - .and(types_analysis_sorani_normalization_token_filter), - z - .object({ - type: z.literal('stemmer_override'), - }) - .and(types_analysis_stemmer_override_token_filter), - z - .object({ - type: z.literal('stemmer'), - }) - .and(types_analysis_stemmer_token_filter), - z - .object({ - type: z.literal('stop'), - }) - .and(types_analysis_stop_token_filter), - z - .object({ - type: z.literal('synonym_graph'), - }) - .and(types_analysis_synonym_graph_token_filter), - z - .object({ - type: z.literal('synonym'), - }) - .and(types_analysis_synonym_token_filter), - z - .object({ - type: z.literal('trim'), - }) - .and(types_analysis_trim_token_filter), - z - .object({ - type: z.literal('truncate'), - }) - .and(types_analysis_truncate_token_filter), - z - .object({ - type: z.literal('unique'), - }) - .and(types_analysis_unique_token_filter), - z - .object({ - type: z.literal('uppercase'), - }) - .and(types_analysis_uppercase_token_filter), - z - .object({ - type: z.literal('word_delimiter_graph'), - }) - .and(types_analysis_word_delimiter_graph_token_filter), - z - .object({ - type: z.literal('word_delimiter'), - }) - .and(types_analysis_word_delimiter_token_filter), - z - .object({ - type: z.literal('ja_stop'), - }) - .and(types_analysis_ja_stop_token_filter), - z - .object({ - type: z.literal('kuromoji_stemmer'), - }) - .and(types_analysis_kuromoji_stemmer_token_filter), - z - .object({ - type: z.literal('kuromoji_readingform'), - }) - .and(types_analysis_kuromoji_reading_form_token_filter), - z - .object({ - type: z.literal('kuromoji_part_of_speech'), - }) - .and(types_analysis_kuromoji_part_of_speech_token_filter), - z - .object({ - type: z.literal('icu_collation'), - }) - .and(types_analysis_icu_collation_token_filter), - z - .object({ - type: z.literal('icu_folding'), - }) - .and(types_analysis_icu_folding_token_filter), - z - .object({ - type: z.literal('icu_normalizer'), - }) - .and(types_analysis_icu_normalization_token_filter), - z - .object({ - type: z.literal('icu_transform'), - }) - .and(types_analysis_icu_transform_token_filter), - z - .object({ - type: z.literal('phonetic'), - }) - .and(types_analysis_phonetic_token_filter), - z - .object({ - type: z.literal('dictionary_decompounder'), - }) - .and(types_analysis_dictionary_decompounder_token_filter), + type: z.literal('icu_folding') + }).and(types_analysis_icu_folding_token_filter), + z.object({ + type: z.literal('icu_normalizer') + }).and(types_analysis_icu_normalization_token_filter), + z.object({ + type: z.literal('icu_transform') + }).and(types_analysis_icu_transform_token_filter), + z.object({ + type: z.literal('phonetic') + }).and(types_analysis_phonetic_token_filter), + z.object({ + type: z.literal('dictionary_decompounder') + }).and(types_analysis_dictionary_decompounder_token_filter) ]); -export const types_analysis_condition_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_condition_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['condition']), filter: z.array(z.string()).register(z.globalRegistry, { - description: - 'Array of token filters. If a token matches the predicate script in the `script` parameter, these filters are applied to the token in the order provided.', + description: 'Array of token filters. If a token matches the predicate script in the `script` parameter, these filters are applied to the token in the order provided.' }), - script: types_script, - }) -); + script: types_script +})); -export const types_analysis_predicate_token_filter = types_analysis_token_filter_base.and( - z.object({ +export const types_analysis_predicate_token_filter = types_analysis_token_filter_base.and(z.object({ type: z.enum(['predicate_token_filter']), - script: types_script, - }) -); + script: types_script +})); export const indices_types_settings_similarity = z.union([ - z - .object({ - type: z.literal('BM25'), - }) - .and(indices_types_settings_similarity_bm25), - z - .object({ - type: z.literal('boolean'), - }) - .and(indices_types_settings_similarity_boolean), - z - .object({ - type: z.literal('DFI'), - }) - .and(indices_types_settings_similarity_dfi), - z - .object({ - type: z.literal('DFR'), - }) - .and(indices_types_settings_similarity_dfr), - z - .object({ - type: z.literal('IB'), - }) - .and(indices_types_settings_similarity_ib), - z - .object({ - type: z.literal('LMDirichlet'), - }) - .and(indices_types_settings_similarity_lmd), - z - .object({ - type: z.literal('LMJelinekMercer'), - }) - .and(indices_types_settings_similarity_lmj), - z - .object({ - type: z.literal('scripted'), - }) - .and(z.lazy(() => z.lazy((): any => indices_types_settings_similarity_scripted))), + z.object({ + type: z.literal('BM25') + }).and(indices_types_settings_similarity_bm25), + z.object({ + type: z.literal('boolean') + }).and(indices_types_settings_similarity_boolean), + z.object({ + type: z.literal('DFI') + }).and(indices_types_settings_similarity_dfi), + z.object({ + type: z.literal('DFR') + }).and(indices_types_settings_similarity_dfr), + z.object({ + type: z.literal('IB') + }).and(indices_types_settings_similarity_ib), + z.object({ + type: z.literal('LMDirichlet') + }).and(indices_types_settings_similarity_lmd), + z.object({ + type: z.literal('LMJelinekMercer') + }).and(indices_types_settings_similarity_lmj), + z.object({ + type: z.literal('scripted') + }).and(z.lazy(() => z.lazy((): any => indices_types_settings_similarity_scripted))) ]); export const indices_types_settings_similarity_scripted = z.object({ - type: z.enum(['scripted']), - script: types_script, - weight_script: z.optional(types_script), + type: z.enum(['scripted']), + script: types_script, + weight_script: z.optional(types_script) }); export const cluster_types_component_template = z.object({ - name: types_name, - get component_template() { - return z.lazy((): any => cluster_types_component_template_node); - }, + name: types_name, + get component_template() { + return z.lazy((): any => cluster_types_component_template_node); + } }); export const cluster_types_component_template_node = z.object({ - get template() { - return z.lazy((): any => cluster_types_component_template_summary); - }, - version: z.optional(types_version_number), - _meta: z.optional(types_metadata), - deprecated: z.optional(z.boolean()), - created_date: z.optional(types_date_time), - created_date_millis: z.optional(types_epoch_time_unit_millis), - modified_date: z.optional(types_date_time), - modified_date_millis: z.optional(types_epoch_time_unit_millis), + get template() { + return z.lazy((): any => cluster_types_component_template_summary); + }, + version: z.optional(types_version_number), + _meta: z.optional(types_metadata), + deprecated: z.optional(z.boolean()), + created_date: z.optional(types_date_time), + created_date_millis: z.optional(types_epoch_time_unit_millis), + modified_date: z.optional(types_date_time), + modified_date_millis: z.optional(types_epoch_time_unit_millis) }); export const cluster_types_component_template_summary = z.object({ - _meta: z.optional(types_metadata), - version: z.optional(types_version_number), - settings: z.optional(z.record(z.string(), indices_types_index_settings)), - get mappings() { - return z.optional(z.lazy((): any => types_mapping_type_mapping)); - }, - get aliases() { - return z.optional( - z.record( + _meta: z.optional(types_metadata), + version: z.optional(types_version_number), + settings: z.optional(z.record(z.string(), indices_types_index_settings)), + get mappings() { + return z.optional(z.lazy((): any => types_mapping_type_mapping)); + }, + get aliases() { + return z.optional(z.record(z.string(), z.lazy((): any => indices_types_alias_definition))); + }, + lifecycle: z.optional(indices_types_data_stream_lifecycle_with_rollover), + data_stream_options: z.optional(z.union([ + indices_types_data_stream_options_template, z.string(), - z.lazy((): any => indices_types_alias_definition) - ) - ); - }, - lifecycle: z.optional(indices_types_data_stream_lifecycle_with_rollover), - data_stream_options: z.optional( - z.union([indices_types_data_stream_options_template, z.string(), z.null()]) - ), + z.null() + ])) }); export const types_mapping_type_mapping = z.object({ - all_field: z.optional(types_mapping_all_field), - date_detection: z.optional(z.boolean()), - dynamic: z.optional(types_mapping_dynamic_mapping), - dynamic_date_formats: z.optional(z.array(z.string())), - get dynamic_templates() { - return z.optional( - z.array( - z.record( - z.string(), - z.lazy((): any => types_mapping_dynamic_template) - ) - ) - ); - }, - _field_names: z.optional(types_mapping_field_names_field), - index_field: z.optional(types_mapping_index_field), - _meta: z.optional(types_metadata), - numeric_detection: z.optional(z.boolean()), - get properties() { - return z.optional( - z.record( + all_field: z.optional(types_mapping_all_field), + date_detection: z.optional(z.boolean()), + dynamic: z.optional(types_mapping_dynamic_mapping), + dynamic_date_formats: z.optional(z.array(z.string())), + get dynamic_templates() { + return z.optional(z.array(z.record(z.string(), z.lazy((): any => types_mapping_dynamic_template)))); + }, + _field_names: z.optional(types_mapping_field_names_field), + index_field: z.optional(types_mapping_index_field), + _meta: z.optional(types_metadata), + numeric_detection: z.optional(z.boolean()), + get properties() { + return z.optional(z.record(z.string(), z.lazy((): any => types_mapping_property))); + }, + _routing: z.optional(types_mapping_routing_field), + _size: z.optional(types_mapping_size_field), + _source: z.optional(types_mapping_source_field), + runtime: z.optional(z.record(z.string(), types_mapping_runtime_field)), + enabled: z.optional(z.boolean()), + subobjects: z.optional(types_mapping_subobjects), + _data_stream_timestamp: z.optional(types_mapping_data_stream_timestamp) +}); + +export const types_mapping_dynamic_template = z.object({ + match: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + path_match: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + unmatch: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + path_unmatch: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + match_mapping_type: z.optional(z.union([ z.string(), - z.lazy((): any => types_mapping_property) - ) - ); - }, - _routing: z.optional(types_mapping_routing_field), - _size: z.optional(types_mapping_size_field), - _source: z.optional(types_mapping_source_field), - runtime: z.optional(z.record(z.string(), types_mapping_runtime_field)), - enabled: z.optional(z.boolean()), - subobjects: z.optional(types_mapping_subobjects), - _data_stream_timestamp: z.optional(types_mapping_data_stream_timestamp), -}); - -export const types_mapping_dynamic_template = z - .object({ - match: z.optional(z.union([z.string(), z.array(z.string())])), - path_match: z.optional(z.union([z.string(), z.array(z.string())])), - unmatch: z.optional(z.union([z.string(), z.array(z.string())])), - path_unmatch: z.optional(z.union([z.string(), z.array(z.string())])), - match_mapping_type: z.optional(z.union([z.string(), z.array(z.string())])), - unmatch_mapping_type: z.optional(z.union([z.string(), z.array(z.string())])), - match_pattern: z.optional(types_mapping_match_type), - }) - .and( - z.lazy(() => - z.object({ - get mapping() { - return z.optional(z.lazy((): any => types_mapping_property)); - }, - runtime: z.optional(types_mapping_runtime_field), - }) - ) - ); + z.array(z.string()) + ])), + unmatch_mapping_type: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + match_pattern: z.optional(types_mapping_match_type) +}).and(z.lazy(() => z.object({ + get mapping() { + return z.optional(z.lazy((): any => types_mapping_property)); + }, + runtime: z.optional(types_mapping_runtime_field) +}))); export const types_mapping_property = z.union([ - z - .object({ - type: z.literal('binary'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_binary_property))), - z - .object({ - type: z.literal('boolean'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_boolean_property))), - z - .object({ - type: z.literal('{dynamic_type}'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_dynamic_property))), - z - .object({ - type: z.literal('join'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_join_property))), - z - .object({ - type: z.literal('keyword'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_keyword_property))), - z - .object({ - type: z.literal('match_only_text'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_match_only_text_property))), - z - .object({ - type: z.literal('percolator'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_percolator_property))), - z - .object({ - type: z.literal('rank_feature'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_rank_feature_property))), - z - .object({ - type: z.literal('rank_features'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_rank_features_property))), - z - .object({ - type: z.literal('search_as_you_type'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_search_as_you_type_property))), - z - .object({ - type: z.literal('text'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_text_property))), - z - .object({ - type: z.literal('version'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_version_property))), - z - .object({ - type: z.literal('wildcard'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_wildcard_property))), - z - .object({ - type: z.literal('date_nanos'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_date_nanos_property))), - z - .object({ - type: z.literal('date'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_date_property))), - z - .object({ - type: z.literal('aggregate_metric_double'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_aggregate_metric_double_property))), - z - .object({ - type: z.literal('dense_vector'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_dense_vector_property))), - z - .object({ - type: z.literal('flattened'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_flattened_property))), - z - .object({ - type: z.literal('nested'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_nested_property))), - z - .object({ - type: z.literal('object'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_object_property))), - z - .object({ - type: z.literal('passthrough'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_passthrough_object_property))), - z - .object({ - type: z.literal('rank_vectors'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_rank_vector_property))), - z - .object({ - type: z.literal('semantic_text'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_semantic_text_property))), - z - .object({ - type: z.literal('sparse_vector'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_sparse_vector_property))), - z - .object({ - type: z.literal('completion'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_completion_property))), - z - .object({ - type: z.literal('constant_keyword'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_constant_keyword_property))), - z - .object({ - type: z.literal('counted_keyword'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_counted_keyword_property))), - z - .object({ - type: z.literal('alias'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_field_alias_property))), - z - .object({ - type: z.literal('histogram'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_histogram_property))), - z - .object({ - type: z.literal('ip'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_ip_property))), - z - .object({ - type: z.literal('murmur3'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_murmur3_hash_property))), - z - .object({ - type: z.literal('token_count'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_token_count_property))), - z - .object({ - type: z.literal('geo_point'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_geo_point_property))), - z - .object({ - type: z.literal('geo_shape'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_geo_shape_property))), - z - .object({ - type: z.literal('point'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_point_property))), - z - .object({ - type: z.literal('shape'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_shape_property))), - z - .object({ - type: z.literal('byte'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_byte_number_property))), - z - .object({ - type: z.literal('double'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_double_number_property))), - z - .object({ - type: z.literal('float'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_float_number_property))), - z - .object({ - type: z.literal('half_float'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_half_float_number_property))), - z - .object({ - type: z.literal('integer'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_integer_number_property))), - z - .object({ - type: z.literal('long'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_long_number_property))), - z - .object({ - type: z.literal('scaled_float'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_scaled_float_number_property))), - z - .object({ - type: z.literal('short'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_short_number_property))), - z - .object({ - type: z.literal('unsigned_long'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_unsigned_long_number_property))), - z - .object({ - type: z.literal('date_range'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_date_range_property))), - z - .object({ - type: z.literal('double_range'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_double_range_property))), - z - .object({ - type: z.literal('float_range'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_float_range_property))), - z - .object({ - type: z.literal('integer_range'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_integer_range_property))), - z - .object({ - type: z.literal('ip_range'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_ip_range_property))), - z - .object({ - type: z.literal('long_range'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_long_range_property))), - z - .object({ - type: z.literal('icu_collation_keyword'), - }) - .and(z.lazy(() => z.lazy((): any => types_mapping_icu_collation_property))), + z.object({ + type: z.literal('binary') + }).and(z.lazy(() => z.lazy((): any => types_mapping_binary_property))), + z.object({ + type: z.literal('boolean') + }).and(z.lazy(() => z.lazy((): any => types_mapping_boolean_property))), + z.object({ + type: z.literal('{dynamic_type}') + }).and(z.lazy(() => z.lazy((): any => types_mapping_dynamic_property))), + z.object({ + type: z.literal('join') + }).and(z.lazy(() => z.lazy((): any => types_mapping_join_property))), + z.object({ + type: z.literal('keyword') + }).and(z.lazy(() => z.lazy((): any => types_mapping_keyword_property))), + z.object({ + type: z.literal('match_only_text') + }).and(z.lazy(() => z.lazy((): any => types_mapping_match_only_text_property))), + z.object({ + type: z.literal('percolator') + }).and(z.lazy(() => z.lazy((): any => types_mapping_percolator_property))), + z.object({ + type: z.literal('rank_feature') + }).and(z.lazy(() => z.lazy((): any => types_mapping_rank_feature_property))), + z.object({ + type: z.literal('rank_features') + }).and(z.lazy(() => z.lazy((): any => types_mapping_rank_features_property))), + z.object({ + type: z.literal('search_as_you_type') + }).and(z.lazy(() => z.lazy((): any => types_mapping_search_as_you_type_property))), + z.object({ + type: z.literal('text') + }).and(z.lazy(() => z.lazy((): any => types_mapping_text_property))), + z.object({ + type: z.literal('version') + }).and(z.lazy(() => z.lazy((): any => types_mapping_version_property))), + z.object({ + type: z.literal('wildcard') + }).and(z.lazy(() => z.lazy((): any => types_mapping_wildcard_property))), + z.object({ + type: z.literal('date_nanos') + }).and(z.lazy(() => z.lazy((): any => types_mapping_date_nanos_property))), + z.object({ + type: z.literal('date') + }).and(z.lazy(() => z.lazy((): any => types_mapping_date_property))), + z.object({ + type: z.literal('aggregate_metric_double') + }).and(z.lazy(() => z.lazy((): any => types_mapping_aggregate_metric_double_property))), + z.object({ + type: z.literal('dense_vector') + }).and(z.lazy(() => z.lazy((): any => types_mapping_dense_vector_property))), + z.object({ + type: z.literal('flattened') + }).and(z.lazy(() => z.lazy((): any => types_mapping_flattened_property))), + z.object({ + type: z.literal('nested') + }).and(z.lazy(() => z.lazy((): any => types_mapping_nested_property))), + z.object({ + type: z.literal('object') + }).and(z.lazy(() => z.lazy((): any => types_mapping_object_property))), + z.object({ + type: z.literal('passthrough') + }).and(z.lazy(() => z.lazy((): any => types_mapping_passthrough_object_property))), + z.object({ + type: z.literal('rank_vectors') + }).and(z.lazy(() => z.lazy((): any => types_mapping_rank_vector_property))), + z.object({ + type: z.literal('semantic_text') + }).and(z.lazy(() => z.lazy((): any => types_mapping_semantic_text_property))), + z.object({ + type: z.literal('sparse_vector') + }).and(z.lazy(() => z.lazy((): any => types_mapping_sparse_vector_property))), + z.object({ + type: z.literal('completion') + }).and(z.lazy(() => z.lazy((): any => types_mapping_completion_property))), + z.object({ + type: z.literal('constant_keyword') + }).and(z.lazy(() => z.lazy((): any => types_mapping_constant_keyword_property))), + z.object({ + type: z.literal('counted_keyword') + }).and(z.lazy(() => z.lazy((): any => types_mapping_counted_keyword_property))), + z.object({ + type: z.literal('alias') + }).and(z.lazy(() => z.lazy((): any => types_mapping_field_alias_property))), + z.object({ + type: z.literal('histogram') + }).and(z.lazy(() => z.lazy((): any => types_mapping_histogram_property))), + z.object({ + type: z.literal('ip') + }).and(z.lazy(() => z.lazy((): any => types_mapping_ip_property))), + z.object({ + type: z.literal('murmur3') + }).and(z.lazy(() => z.lazy((): any => types_mapping_murmur3_hash_property))), + z.object({ + type: z.literal('token_count') + }).and(z.lazy(() => z.lazy((): any => types_mapping_token_count_property))), + z.object({ + type: z.literal('geo_point') + }).and(z.lazy(() => z.lazy((): any => types_mapping_geo_point_property))), + z.object({ + type: z.literal('geo_shape') + }).and(z.lazy(() => z.lazy((): any => types_mapping_geo_shape_property))), + z.object({ + type: z.literal('point') + }).and(z.lazy(() => z.lazy((): any => types_mapping_point_property))), + z.object({ + type: z.literal('shape') + }).and(z.lazy(() => z.lazy((): any => types_mapping_shape_property))), + z.object({ + type: z.literal('byte') + }).and(z.lazy(() => z.lazy((): any => types_mapping_byte_number_property))), + z.object({ + type: z.literal('double') + }).and(z.lazy(() => z.lazy((): any => types_mapping_double_number_property))), + z.object({ + type: z.literal('float') + }).and(z.lazy(() => z.lazy((): any => types_mapping_float_number_property))), + z.object({ + type: z.literal('half_float') + }).and(z.lazy(() => z.lazy((): any => types_mapping_half_float_number_property))), + z.object({ + type: z.literal('integer') + }).and(z.lazy(() => z.lazy((): any => types_mapping_integer_number_property))), + z.object({ + type: z.literal('long') + }).and(z.lazy(() => z.lazy((): any => types_mapping_long_number_property))), + z.object({ + type: z.literal('scaled_float') + }).and(z.lazy(() => z.lazy((): any => types_mapping_scaled_float_number_property))), + z.object({ + type: z.literal('short') + }).and(z.lazy(() => z.lazy((): any => types_mapping_short_number_property))), + z.object({ + type: z.literal('unsigned_long') + }).and(z.lazy(() => z.lazy((): any => types_mapping_unsigned_long_number_property))), + z.object({ + type: z.literal('date_range') + }).and(z.lazy(() => z.lazy((): any => types_mapping_date_range_property))), + z.object({ + type: z.literal('double_range') + }).and(z.lazy(() => z.lazy((): any => types_mapping_double_range_property))), + z.object({ + type: z.literal('float_range') + }).and(z.lazy(() => z.lazy((): any => types_mapping_float_range_property))), + z.object({ + type: z.literal('integer_range') + }).and(z.lazy(() => z.lazy((): any => types_mapping_integer_range_property))), + z.object({ + type: z.literal('ip_range') + }).and(z.lazy(() => z.lazy((): any => types_mapping_ip_range_property))), + z.object({ + type: z.literal('long_range') + }).and(z.lazy(() => z.lazy((): any => types_mapping_long_range_property))), + z.object({ + type: z.literal('icu_collation_keyword') + }).and(z.lazy(() => z.lazy((): any => types_mapping_icu_collation_property))) ]); -export const types_mapping_binary_property = z - .lazy((): any => types_mapping_doc_values_property_base) - .and( - z.object({ - type: z.enum(['binary']), - }) - ); +export const types_mapping_binary_property = z.lazy((): any => types_mapping_doc_values_property_base).and(z.object({ + type: z.enum(['binary']) +})); -export const types_mapping_doc_values_property_base = z - .lazy((): any => types_mapping_core_property_base) - .and( - z.object({ - doc_values: z.optional(z.boolean()), - }) - ); +export const types_mapping_doc_values_property_base = z.lazy((): any => types_mapping_core_property_base).and(z.object({ + doc_values: z.optional(z.boolean()) +})); -export const types_mapping_core_property_base = z - .lazy((): any => types_mapping_property_base) - .and( - z.object({ - copy_to: z.optional(types_fields), - store: z.optional(z.boolean()), - }) - ); +export const types_mapping_core_property_base = z.lazy((): any => types_mapping_property_base).and(z.object({ + copy_to: z.optional(types_fields), + store: z.optional(z.boolean()) +})); export const types_mapping_property_base = z.object({ - meta: z.optional( - z.record(z.string(), z.string()).register(z.globalRegistry, { - description: 'Metadata about the field.', - }) - ), - properties: z.optional(z.record(z.string(), types_mapping_property)), - ignore_above: z.optional(z.number()), - dynamic: z.optional(types_mapping_dynamic_mapping), - fields: z.optional(z.record(z.string(), types_mapping_property)), - synthetic_source_keep: z.optional(types_mapping_synthetic_source_keep_enum), + meta: z.optional(z.record(z.string(), z.string()).register(z.globalRegistry, { + description: 'Metadata about the field.' + })), + properties: z.optional(z.record(z.string(), types_mapping_property)), + ignore_above: z.optional(z.number()), + dynamic: z.optional(types_mapping_dynamic_mapping), + fields: z.optional(z.record(z.string(), types_mapping_property)), + synthetic_source_keep: z.optional(types_mapping_synthetic_source_keep_enum) }); -export const types_mapping_boolean_property = types_mapping_doc_values_property_base.and( - z.object({ +export const types_mapping_boolean_property = types_mapping_doc_values_property_base.and(z.object({ boost: z.optional(z.number()), fielddata: z.optional(indices_types_numeric_fielddata), index: z.optional(z.boolean()), @@ -29211,18 +23937,13 @@ export const types_mapping_boolean_property = types_mapping_doc_values_property_ ignore_malformed: z.optional(z.boolean()), script: z.optional(types_script), on_script_error: z.optional(types_mapping_on_script_error), - time_series_dimension: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false.', - }) - ), - type: z.enum(['boolean']), - }) -); - -export const types_mapping_dynamic_property = types_mapping_doc_values_property_base.and( - z.object({ + time_series_dimension: z.optional(z.boolean().register(z.globalRegistry, { + description: 'For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false.' + })), + type: z.enum(['boolean']) +})); + +export const types_mapping_dynamic_property = types_mapping_doc_values_property_base.and(z.object({ type: z.enum(['{dynamic_type}']), enabled: z.optional(z.boolean()), null_value: z.optional(types_field_value), @@ -29237,7 +23958,11 @@ export const types_mapping_dynamic_property = types_mapping_doc_values_property_ index: z.optional(z.boolean()), index_options: z.optional(types_mapping_index_options), index_phrases: z.optional(z.boolean()), - index_prefixes: z.optional(z.union([types_mapping_text_index_prefixes, z.string(), z.null()])), + index_prefixes: z.optional(z.union([ + types_mapping_text_index_prefixes, + z.string(), + z.null() + ])), norms: z.optional(z.boolean()), position_increment_gap: z.optional(z.number()), search_analyzer: z.optional(z.string()), @@ -29245,22 +23970,19 @@ export const types_mapping_dynamic_property = types_mapping_doc_values_property_ term_vector: z.optional(types_mapping_term_vector_option), format: z.optional(z.string()), precision_step: z.optional(z.number()), - locale: z.optional(z.string()), - }) -); - -export const types_mapping_join_property = types_mapping_property_base.and( - z.object({ - relations: z.optional( - z.record(z.string(), z.union([types_relation_name, z.array(types_relation_name)])) - ), + locale: z.optional(z.string()) +})); + +export const types_mapping_join_property = types_mapping_property_base.and(z.object({ + relations: z.optional(z.record(z.string(), z.union([ + types_relation_name, + z.array(types_relation_name) + ]))), eager_global_ordinals: z.optional(z.boolean()), - type: z.enum(['join']), - }) -); + type: z.enum(['join']) +})); -export const types_mapping_keyword_property = types_mapping_doc_values_property_base.and( - z.object({ +export const types_mapping_keyword_property = types_mapping_doc_values_property_base.and(z.object({ boost: z.optional(z.number()), eager_global_ordinals: z.optional(z.boolean()), index: z.optional(z.boolean()), @@ -29270,17 +23992,16 @@ export const types_mapping_keyword_property = types_mapping_doc_values_property_ normalizer: z.optional(z.string()), norms: z.optional(z.boolean()), null_value: z.optional(z.string()), - similarity: z.optional(z.union([z.string(), z.null()])), + similarity: z.optional(z.union([ + z.string(), + z.null() + ])), split_queries_on_whitespace: z.optional(z.boolean()), - time_series_dimension: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false.', - }) - ), - type: z.enum(['keyword']), - }) -); + time_series_dimension: z.optional(z.boolean().register(z.globalRegistry, { + description: 'For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false.' + })), + type: z.enum(['keyword']) +})); /** * A variant of text that trades scoring and efficiency of positional queries for space efficiency. This field @@ -29289,49 +24010,34 @@ export const types_mapping_keyword_property = types_mapping_doc_values_property_ * that need positions such as the match_phrase query perform slower as they need to look at the _source document * to verify whether a phrase matches. All queries return constant scores that are equal to 1.0. */ -export const types_mapping_match_only_text_property = z - .object({ +export const types_mapping_match_only_text_property = z.object({ type: z.enum(['match_only_text']), - fields: z.optional( - z.record(z.string(), types_mapping_property).register(z.globalRegistry, { - description: - 'Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one\nfield for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.', - }) - ), - meta: z.optional( - z.record(z.string(), z.string()).register(z.globalRegistry, { - description: 'Metadata about the field.', - }) - ), - copy_to: z.optional(types_fields), - }) - .register(z.globalRegistry, { - description: - 'A variant of text that trades scoring and efficiency of positional queries for space efficiency. This field\neffectively stores data the same way as a text field that only indexes documents (index_options: docs) and\ndisables norms (norms: false). Term queries perform as fast if not faster as on text fields, however queries\nthat need positions such as the match_phrase query perform slower as they need to look at the _source document\nto verify whether a phrase matches. All queries return constant scores that are equal to 1.0.', - }); - -export const types_mapping_percolator_property = types_mapping_property_base.and( - z.object({ - type: z.enum(['percolator']), - }) -); - -export const types_mapping_rank_feature_property = types_mapping_property_base.and( - z.object({ + fields: z.optional(z.record(z.string(), types_mapping_property).register(z.globalRegistry, { + description: 'Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one\nfield for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.' + })), + meta: z.optional(z.record(z.string(), z.string()).register(z.globalRegistry, { + description: 'Metadata about the field.' + })), + copy_to: z.optional(types_fields) +}).register(z.globalRegistry, { + description: 'A variant of text that trades scoring and efficiency of positional queries for space efficiency. This field\neffectively stores data the same way as a text field that only indexes documents (index_options: docs) and\ndisables norms (norms: false). Term queries perform as fast if not faster as on text fields, however queries\nthat need positions such as the match_phrase query perform slower as they need to look at the _source document\nto verify whether a phrase matches. All queries return constant scores that are equal to 1.0.' +}); + +export const types_mapping_percolator_property = types_mapping_property_base.and(z.object({ + type: z.enum(['percolator']) +})); + +export const types_mapping_rank_feature_property = types_mapping_property_base.and(z.object({ positive_score_impact: z.optional(z.boolean()), - type: z.enum(['rank_feature']), - }) -); + type: z.enum(['rank_feature']) +})); -export const types_mapping_rank_features_property = types_mapping_property_base.and( - z.object({ +export const types_mapping_rank_features_property = types_mapping_property_base.and(z.object({ positive_score_impact: z.optional(z.boolean()), - type: z.enum(['rank_features']), - }) -); + type: z.enum(['rank_features']) +})); -export const types_mapping_search_as_you_type_property = types_mapping_core_property_base.and( - z.object({ +export const types_mapping_search_as_you_type_property = types_mapping_core_property_base.and(z.object({ analyzer: z.optional(z.string()), index: z.optional(z.boolean()), index_options: z.optional(types_mapping_index_options), @@ -29339,14 +24045,15 @@ export const types_mapping_search_as_you_type_property = types_mapping_core_prop norms: z.optional(z.boolean()), search_analyzer: z.optional(z.string()), search_quote_analyzer: z.optional(z.string()), - similarity: z.optional(z.union([z.string(), z.null()])), + similarity: z.optional(z.union([ + z.string(), + z.null() + ])), term_vector: z.optional(types_mapping_term_vector_option), - type: z.enum(['search_as_you_type']), - }) -); + type: z.enum(['search_as_you_type']) +})); -export const types_mapping_text_property = types_mapping_core_property_base.and( - z.object({ +export const types_mapping_text_property = types_mapping_core_property_base.and(z.object({ analyzer: z.optional(z.string()), boost: z.optional(z.number()), eager_global_ordinals: z.optional(z.boolean()), @@ -29355,32 +24062,33 @@ export const types_mapping_text_property = types_mapping_core_property_base.and( index: z.optional(z.boolean()), index_options: z.optional(types_mapping_index_options), index_phrases: z.optional(z.boolean()), - index_prefixes: z.optional(z.union([types_mapping_text_index_prefixes, z.string(), z.null()])), + index_prefixes: z.optional(z.union([ + types_mapping_text_index_prefixes, + z.string(), + z.null() + ])), norms: z.optional(z.boolean()), position_increment_gap: z.optional(z.number()), search_analyzer: z.optional(z.string()), search_quote_analyzer: z.optional(z.string()), - similarity: z.optional(z.union([z.string(), z.null()])), + similarity: z.optional(z.union([ + z.string(), + z.null() + ])), term_vector: z.optional(types_mapping_term_vector_option), - type: z.enum(['text']), - }) -); - -export const types_mapping_version_property = types_mapping_doc_values_property_base.and( - z.object({ - type: z.enum(['version']), - }) -); - -export const types_mapping_wildcard_property = types_mapping_doc_values_property_base.and( - z.object({ + type: z.enum(['text']) +})); + +export const types_mapping_version_property = types_mapping_doc_values_property_base.and(z.object({ + type: z.enum(['version']) +})); + +export const types_mapping_wildcard_property = types_mapping_doc_values_property_base.and(z.object({ type: z.enum(['wildcard']), - null_value: z.optional(z.string()), - }) -); + null_value: z.optional(z.string()) +})); -export const types_mapping_date_nanos_property = types_mapping_doc_values_property_base.and( - z.object({ +export const types_mapping_date_nanos_property = types_mapping_doc_values_property_base.and(z.object({ boost: z.optional(z.number()), format: z.optional(z.string()), ignore_malformed: z.optional(z.boolean()), @@ -29389,12 +24097,10 @@ export const types_mapping_date_nanos_property = types_mapping_doc_values_proper on_script_error: z.optional(types_mapping_on_script_error), null_value: z.optional(types_date_time), precision_step: z.optional(z.number()), - type: z.enum(['date_nanos']), - }) -); + type: z.enum(['date_nanos']) +})); -export const types_mapping_date_property = types_mapping_doc_values_property_base.and( - z.object({ +export const types_mapping_date_property = types_mapping_doc_values_property_base.and(z.object({ boost: z.optional(z.number()), fielddata: z.optional(indices_types_numeric_fielddata), format: z.optional(z.string()), @@ -29405,42 +24111,31 @@ export const types_mapping_date_property = types_mapping_doc_values_property_bas null_value: z.optional(types_date_time), precision_step: z.optional(z.number()), locale: z.optional(z.string()), - type: z.enum(['date']), - }) -); + type: z.enum(['date']) +})); -export const types_mapping_aggregate_metric_double_property = types_mapping_property_base.and( - z.object({ +export const types_mapping_aggregate_metric_double_property = types_mapping_property_base.and(z.object({ type: z.enum(['aggregate_metric_double']), default_metric: z.string(), ignore_malformed: z.optional(z.boolean()), metrics: z.array(z.string()), - time_series_metric: z.optional(types_mapping_time_series_metric_type), - }) -); + time_series_metric: z.optional(types_mapping_time_series_metric_type) +})); -export const types_mapping_dense_vector_property = types_mapping_property_base.and( - z.object({ +export const types_mapping_dense_vector_property = types_mapping_property_base.and(z.object({ type: z.enum(['dense_vector']), - dims: z.optional( - z.number().register(z.globalRegistry, { - description: - "Number of vector dimensions. Can't exceed `4096`. If `dims` is not specified, it will be set to the length of\nthe first vector added to the field.", - }) - ), + dims: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of vector dimensions. Can\'t exceed `4096`. If `dims` is not specified, it will be set to the length of\nthe first vector added to the field.' + })), element_type: z.optional(types_mapping_dense_vector_element_type), - index: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, you can search this field using the kNN search API.', - }) - ), + index: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, you can search this field using the kNN search API.' + })), index_options: z.optional(types_mapping_dense_vector_index_options), - similarity: z.optional(types_mapping_dense_vector_similarity), - }) -); + similarity: z.optional(types_mapping_dense_vector_similarity) +})); -export const types_mapping_flattened_property = types_mapping_property_base.and( - z.object({ +export const types_mapping_flattened_property = types_mapping_property_base.and(z.object({ boost: z.optional(z.number()), depth_limit: z.optional(z.number()), doc_values: z.optional(z.boolean()), @@ -29451,147 +24146,117 @@ export const types_mapping_flattened_property = types_mapping_property_base.and( similarity: z.optional(z.string()), split_queries_on_whitespace: z.optional(z.boolean()), time_series_dimensions: z.optional(z.array(z.string())), - type: z.enum(['flattened']), - }) -); + type: z.enum(['flattened']) +})); -export const types_mapping_nested_property = types_mapping_core_property_base.and( - z.object({ +export const types_mapping_nested_property = types_mapping_core_property_base.and(z.object({ enabled: z.optional(z.boolean()), include_in_parent: z.optional(z.boolean()), include_in_root: z.optional(z.boolean()), - type: z.enum(['nested']), - }) -); + type: z.enum(['nested']) +})); -export const types_mapping_object_property = types_mapping_core_property_base.and( - z.object({ +export const types_mapping_object_property = types_mapping_core_property_base.and(z.object({ enabled: z.optional(z.boolean()), subobjects: z.optional(types_mapping_subobjects), - type: z.optional(z.enum(['object'])), - }) -); + type: z.optional(z.enum(['object'])) +})); -export const types_mapping_passthrough_object_property = types_mapping_core_property_base.and( - z.object({ +export const types_mapping_passthrough_object_property = types_mapping_core_property_base.and(z.object({ type: z.optional(z.enum(['passthrough'])), enabled: z.optional(z.boolean()), priority: z.optional(z.number()), - time_series_dimension: z.optional(z.boolean()), - }) -); + time_series_dimension: z.optional(z.boolean()) +})); /** * Technical preview */ -export const types_mapping_rank_vector_property = types_mapping_property_base.and( - z.object({ +export const types_mapping_rank_vector_property = types_mapping_property_base.and(z.object({ type: z.enum(['rank_vectors']), element_type: z.optional(types_mapping_rank_vector_element_type), - dims: z.optional(z.number()), - }) -); + dims: z.optional(z.number()) +})); export const types_mapping_semantic_text_property = z.object({ - type: z.enum(['semantic_text']), - meta: z.optional(z.record(z.string(), z.string())), - inference_id: z.optional(types_id), - search_inference_id: z.optional(types_id), - index_options: z.optional(types_mapping_semantic_text_index_options), - chunking_settings: z.optional(z.union([types_mapping_chunking_settings, z.string(), z.null()])), - fields: z.optional( - z.record(z.string(), types_mapping_property).register(z.globalRegistry, { - description: - 'Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one\nfield for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.', - }) - ), + type: z.enum(['semantic_text']), + meta: z.optional(z.record(z.string(), z.string())), + inference_id: z.optional(types_id), + search_inference_id: z.optional(types_id), + index_options: z.optional(types_mapping_semantic_text_index_options), + chunking_settings: z.optional(z.union([ + types_mapping_chunking_settings, + z.string(), + z.null() + ])), + fields: z.optional(z.record(z.string(), types_mapping_property).register(z.globalRegistry, { + description: 'Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one\nfield for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.' + })) }); -export const types_mapping_sparse_vector_property = types_mapping_property_base.and( - z.object({ +export const types_mapping_sparse_vector_property = types_mapping_property_base.and(z.object({ store: z.optional(z.boolean()), type: z.enum(['sparse_vector']), - index_options: z.optional(types_mapping_sparse_vector_index_options), - }) -); + index_options: z.optional(types_mapping_sparse_vector_index_options) +})); -export const types_mapping_completion_property = types_mapping_doc_values_property_base.and( - z.object({ +export const types_mapping_completion_property = types_mapping_doc_values_property_base.and(z.object({ analyzer: z.optional(z.string()), contexts: z.optional(z.array(types_mapping_suggest_context)), max_input_length: z.optional(z.number()), preserve_position_increments: z.optional(z.boolean()), preserve_separators: z.optional(z.boolean()), search_analyzer: z.optional(z.string()), - type: z.enum(['completion']), - }) -); + type: z.enum(['completion']) +})); -export const types_mapping_constant_keyword_property = types_mapping_property_base.and( - z.object({ +export const types_mapping_constant_keyword_property = types_mapping_property_base.and(z.object({ value: z.optional(z.record(z.string(), z.unknown())), - type: z.enum(['constant_keyword']), - }) -); + type: z.enum(['constant_keyword']) +})); -export const types_mapping_counted_keyword_property = types_mapping_property_base.and( - z.object({ +export const types_mapping_counted_keyword_property = types_mapping_property_base.and(z.object({ type: z.enum(['counted_keyword']), - index: z.optional(z.boolean()), - }) -); + index: z.optional(z.boolean()) +})); -export const types_mapping_field_alias_property = types_mapping_property_base.and( - z.object({ +export const types_mapping_field_alias_property = types_mapping_property_base.and(z.object({ path: z.optional(types_field), - type: z.enum(['alias']), - }) -); + type: z.enum(['alias']) +})); -export const types_mapping_histogram_property = types_mapping_property_base.and( - z.object({ +export const types_mapping_histogram_property = types_mapping_property_base.and(z.object({ ignore_malformed: z.optional(z.boolean()), - type: z.enum(['histogram']), - }) -); + type: z.enum(['histogram']) +})); -export const types_mapping_ip_property = types_mapping_doc_values_property_base.and( - z.object({ +export const types_mapping_ip_property = types_mapping_doc_values_property_base.and(z.object({ boost: z.optional(z.number()), index: z.optional(z.boolean()), ignore_malformed: z.optional(z.boolean()), null_value: z.optional(z.string()), on_script_error: z.optional(types_mapping_on_script_error), script: z.optional(types_script), - time_series_dimension: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false.', - }) - ), - type: z.enum(['ip']), - }) -); - -export const types_mapping_murmur3_hash_property = types_mapping_doc_values_property_base.and( - z.object({ - type: z.enum(['murmur3']), - }) -); - -export const types_mapping_token_count_property = types_mapping_doc_values_property_base.and( - z.object({ + time_series_dimension: z.optional(z.boolean().register(z.globalRegistry, { + description: 'For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false.' + })), + type: z.enum(['ip']) +})); + +export const types_mapping_murmur3_hash_property = types_mapping_doc_values_property_base.and(z.object({ + type: z.enum(['murmur3']) +})); + +export const types_mapping_token_count_property = types_mapping_doc_values_property_base.and(z.object({ analyzer: z.optional(z.string()), boost: z.optional(z.number()), index: z.optional(z.boolean()), null_value: z.optional(z.number()), enable_position_increments: z.optional(z.boolean()), - type: z.enum(['token_count']), - }) -); + type: z.enum(['token_count']) +})); -export const types_mapping_geo_point_property = types_mapping_doc_values_property_base.and( - z.object({ +export const types_mapping_geo_point_property = types_mapping_doc_values_property_base.and(z.object({ ignore_malformed: z.optional(z.boolean()), ignore_z_value: z.optional(z.boolean()), null_value: z.optional(types_geo_location), @@ -29599,60 +24264,48 @@ export const types_mapping_geo_point_property = types_mapping_doc_values_propert on_script_error: z.optional(types_mapping_on_script_error), script: z.optional(types_script), type: z.enum(['geo_point']), - time_series_metric: z.optional(types_mapping_geo_point_metric_type), - }) -); + time_series_metric: z.optional(types_mapping_geo_point_metric_type) +})); /** * The `geo_shape` data type facilitates the indexing of and searching with arbitrary geo shapes such as rectangles * and polygons. */ -export const types_mapping_geo_shape_property = types_mapping_doc_values_property_base.and( - z.object({ +export const types_mapping_geo_shape_property = types_mapping_doc_values_property_base.and(z.object({ coerce: z.optional(z.boolean()), ignore_malformed: z.optional(z.boolean()), ignore_z_value: z.optional(z.boolean()), index: z.optional(z.boolean()), orientation: z.optional(types_mapping_geo_orientation), strategy: z.optional(types_mapping_geo_strategy), - type: z.enum(['geo_shape']), - }) -); + type: z.enum(['geo_shape']) +})); -export const types_mapping_point_property = types_mapping_doc_values_property_base.and( - z.object({ +export const types_mapping_point_property = types_mapping_doc_values_property_base.and(z.object({ ignore_malformed: z.optional(z.boolean()), ignore_z_value: z.optional(z.boolean()), null_value: z.optional(z.string()), - type: z.enum(['point']), - }) -); + type: z.enum(['point']) +})); /** * The `shape` data type facilitates the indexing of and searching with arbitrary `x, y` cartesian shapes such as * rectangles and polygons. */ -export const types_mapping_shape_property = types_mapping_doc_values_property_base.and( - z.object({ +export const types_mapping_shape_property = types_mapping_doc_values_property_base.and(z.object({ coerce: z.optional(z.boolean()), ignore_malformed: z.optional(z.boolean()), ignore_z_value: z.optional(z.boolean()), orientation: z.optional(types_mapping_geo_orientation), - type: z.enum(['shape']), - }) -); + type: z.enum(['shape']) +})); -export const types_mapping_byte_number_property = z - .lazy((): any => types_mapping_number_property_base) - .and( - z.object({ - type: z.enum(['byte']), - null_value: z.optional(types_byte), - }) - ); +export const types_mapping_byte_number_property = z.lazy((): any => types_mapping_number_property_base).and(z.object({ + type: z.enum(['byte']), + null_value: z.optional(types_byte) +})); -export const types_mapping_number_property_base = types_mapping_doc_values_property_base.and( - z.object({ +export const types_mapping_number_property_base = types_mapping_doc_values_property_base.and(z.object({ boost: z.optional(z.number()), coerce: z.optional(z.boolean()), ignore_malformed: z.optional(z.boolean()), @@ -29660,135 +24313,93 @@ export const types_mapping_number_property_base = types_mapping_doc_values_prope on_script_error: z.optional(types_mapping_on_script_error), script: z.optional(types_script), time_series_metric: z.optional(types_mapping_time_series_metric_type), - time_series_dimension: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false.', - }) - ), - }) -); - -export const types_mapping_double_number_property = types_mapping_number_property_base.and( - z.object({ + time_series_dimension: z.optional(z.boolean().register(z.globalRegistry, { + description: 'For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false.' + })) +})); + +export const types_mapping_double_number_property = types_mapping_number_property_base.and(z.object({ type: z.enum(['double']), - null_value: z.optional(z.number()), - }) -); + null_value: z.optional(z.number()) +})); -export const types_mapping_float_number_property = types_mapping_number_property_base.and( - z.object({ +export const types_mapping_float_number_property = types_mapping_number_property_base.and(z.object({ type: z.enum(['float']), - null_value: z.optional(z.number()), - }) -); + null_value: z.optional(z.number()) +})); -export const types_mapping_half_float_number_property = types_mapping_number_property_base.and( - z.object({ +export const types_mapping_half_float_number_property = types_mapping_number_property_base.and(z.object({ type: z.enum(['half_float']), - null_value: z.optional(z.number()), - }) -); + null_value: z.optional(z.number()) +})); -export const types_mapping_integer_number_property = types_mapping_number_property_base.and( - z.object({ +export const types_mapping_integer_number_property = types_mapping_number_property_base.and(z.object({ type: z.enum(['integer']), - null_value: z.optional(z.number()), - }) -); + null_value: z.optional(z.number()) +})); -export const types_mapping_long_number_property = types_mapping_number_property_base.and( - z.object({ +export const types_mapping_long_number_property = types_mapping_number_property_base.and(z.object({ type: z.enum(['long']), - null_value: z.optional(z.number()), - }) -); + null_value: z.optional(z.number()) +})); -export const types_mapping_scaled_float_number_property = types_mapping_number_property_base.and( - z.object({ +export const types_mapping_scaled_float_number_property = types_mapping_number_property_base.and(z.object({ type: z.enum(['scaled_float']), null_value: z.optional(z.number()), - scaling_factor: z.optional(z.number()), - }) -); + scaling_factor: z.optional(z.number()) +})); -export const types_mapping_short_number_property = types_mapping_number_property_base.and( - z.object({ +export const types_mapping_short_number_property = types_mapping_number_property_base.and(z.object({ type: z.enum(['short']), - null_value: z.optional(types_short), - }) -); + null_value: z.optional(types_short) +})); -export const types_mapping_unsigned_long_number_property = types_mapping_number_property_base.and( - z.object({ +export const types_mapping_unsigned_long_number_property = types_mapping_number_property_base.and(z.object({ type: z.enum(['unsigned_long']), - null_value: z.optional(types_ulong), - }) -); + null_value: z.optional(types_ulong) +})); -export const types_mapping_date_range_property = z - .lazy((): any => types_mapping_range_property_base) - .and( - z.object({ - format: z.optional(z.string()), - type: z.enum(['date_range']), - }) - ); +export const types_mapping_date_range_property = z.lazy((): any => types_mapping_range_property_base).and(z.object({ + format: z.optional(z.string()), + type: z.enum(['date_range']) +})); -export const types_mapping_range_property_base = types_mapping_doc_values_property_base.and( - z.object({ +export const types_mapping_range_property_base = types_mapping_doc_values_property_base.and(z.object({ boost: z.optional(z.number()), coerce: z.optional(z.boolean()), - index: z.optional(z.boolean()), - }) -); - -export const types_mapping_double_range_property = types_mapping_range_property_base.and( - z.object({ - type: z.enum(['double_range']), - }) -); - -export const types_mapping_float_range_property = types_mapping_range_property_base.and( - z.object({ - type: z.enum(['float_range']), - }) -); - -export const types_mapping_integer_range_property = types_mapping_range_property_base.and( - z.object({ - type: z.enum(['integer_range']), - }) -); - -export const types_mapping_ip_range_property = types_mapping_range_property_base.and( - z.object({ - type: z.enum(['ip_range']), - }) -); - -export const types_mapping_long_range_property = types_mapping_range_property_base.and( - z.object({ - type: z.enum(['long_range']), - }) -); - -export const types_mapping_icu_collation_property = types_mapping_doc_values_property_base.and( - z.object({ + index: z.optional(z.boolean()) +})); + +export const types_mapping_double_range_property = types_mapping_range_property_base.and(z.object({ + type: z.enum(['double_range']) +})); + +export const types_mapping_float_range_property = types_mapping_range_property_base.and(z.object({ + type: z.enum(['float_range']) +})); + +export const types_mapping_integer_range_property = types_mapping_range_property_base.and(z.object({ + type: z.enum(['integer_range']) +})); + +export const types_mapping_ip_range_property = types_mapping_range_property_base.and(z.object({ + type: z.enum(['ip_range']) +})); + +export const types_mapping_long_range_property = types_mapping_range_property_base.and(z.object({ + type: z.enum(['long_range']) +})); + +export const types_mapping_icu_collation_property = types_mapping_doc_values_property_base.and(z.object({ type: z.enum(['icu_collation_keyword']), norms: z.optional(z.boolean()), index_options: z.optional(types_mapping_index_options), - index: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Should the field be searchable?', - }) - ), - null_value: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Accepts a string value which is substituted for any explicit null values. Defaults to null, which means the field is treated as missing.', - }) - ), + index: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Should the field be searchable?' + })), + null_value: z.optional(z.string().register(z.globalRegistry, { + description: 'Accepts a string value which is substituted for any explicit null values. Defaults to null, which means the field is treated as missing.' + })), rules: z.optional(z.string()), language: z.optional(z.string()), country: z.optional(z.string()), @@ -29800,750 +24411,627 @@ export const types_mapping_icu_collation_property = types_mapping_doc_values_pro case_first: z.optional(types_analysis_icu_collation_case_first), numeric: z.optional(z.boolean()), variable_top: z.optional(z.string()), - hiragana_quaternary_mode: z.optional(z.boolean()), - }) -); + hiragana_quaternary_mode: z.optional(z.boolean()) +})); export const indices_types_alias_definition = z.object({ - filter: z.optional(types_query_dsl_query_container), - index_routing: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Value used to route indexing operations to a specific shard.\nIf specified, this overwrites the `routing` value for indexing operations.', - }) - ), - is_write_index: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the index is the write index for the alias.', - }) - ), - routing: z.optional( - z.string().register(z.globalRegistry, { - description: 'Value used to route indexing and search operations to a specific shard.', - }) - ), - search_routing: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Value used to route search operations to a specific shard.\nIf specified, this overwrites the `routing` value for search operations.', - }) - ), - is_hidden: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the alias is hidden.\nAll indices for the alias must have the same `is_hidden` value.', - }) - ), + filter: z.optional(types_query_dsl_query_container), + index_routing: z.optional(z.string().register(z.globalRegistry, { + description: 'Value used to route indexing operations to a specific shard.\nIf specified, this overwrites the `routing` value for indexing operations.' + })), + is_write_index: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the index is the write index for the alias.' + })), + routing: z.optional(z.string().register(z.globalRegistry, { + description: 'Value used to route indexing and search operations to a specific shard.' + })), + search_routing: z.optional(z.string().register(z.globalRegistry, { + description: 'Value used to route search operations to a specific shard.\nIf specified, this overwrites the `routing` value for search operations.' + })), + is_hidden: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the alias is hidden.\nAll indices for the alias must have the same `is_hidden` value.' + })) }); export const indices_types_index_state = z.object({ - get aliases() { - return z.optional( - z.record( - z.string(), - z.lazy((): any => indices_types_alias) - ) - ); - }, - mappings: z.optional(types_mapping_type_mapping), - settings: z.optional(indices_types_index_settings), - defaults: z.optional(indices_types_index_settings), - data_stream: z.optional(types_data_stream_name), - lifecycle: z.optional(indices_types_data_stream_lifecycle), + get aliases() { + return z.optional(z.record(z.string(), z.lazy((): any => indices_types_alias))); + }, + mappings: z.optional(types_mapping_type_mapping), + settings: z.optional(indices_types_index_settings), + defaults: z.optional(indices_types_index_settings), + data_stream: z.optional(types_data_stream_name), + lifecycle: z.optional(indices_types_data_stream_lifecycle) }); export const indices_types_alias = z.object({ - filter: z.optional(types_query_dsl_query_container), - index_routing: z.optional(types_routing), - is_hidden: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the alias is hidden.\nAll indices for the alias must have the same `is_hidden` value.', - }) - ), - is_write_index: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the index is the write index for the alias.', - }) - ), - routing: z.optional(types_routing), - search_routing: z.optional(types_routing), + filter: z.optional(types_query_dsl_query_container), + index_routing: z.optional(types_routing), + is_hidden: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the alias is hidden.\nAll indices for the alias must have the same `is_hidden` value.' + })), + is_write_index: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the index is the write index for the alias.' + })), + routing: z.optional(types_routing), + search_routing: z.optional(types_routing) }); export const enrich_types_summary = z.object({ - get config() { - return z.record( - z.string(), - z.lazy((): any => enrich_types_policy) - ); - }, + get config() { + return z.record(z.string(), z.lazy((): any => enrich_types_policy)); + } }); export const enrich_types_policy = z.object({ - enrich_fields: types_fields, - indices: types_indices, - match_field: types_field, - query: z.optional(types_query_dsl_query_container), - name: z.optional(types_name), - elasticsearch_version: z.optional(z.string()), + enrich_fields: types_fields, + indices: types_indices, + match_field: types_field, + query: z.optional(types_query_dsl_query_container), + name: z.optional(types_name), + elasticsearch_version: z.optional(z.string()) }); export const global_msearch_request_item = z.union([ - global_msearch_multisearch_header, - global_search_types_search_request_body, + global_msearch_multisearch_header, + global_search_types_search_request_body ]); export const global_msearch_response_item = z.union([ - z.lazy((): any => global_msearch_multi_search_item), - types_error_response_base, + z.lazy((): any => global_msearch_multi_search_item), + types_error_response_base ]); -export const global_msearch_multi_search_item = z - .lazy((): any => global_search_response_body) - .and( - z.object({ - status: z.optional(z.number()), - }) - ); +export const global_msearch_multi_search_item = z.lazy((): any => global_search_response_body).and(z.object({ + status: z.optional(z.number()) +})); export const global_search_response_body = z.object({ - took: z.number().register(z.globalRegistry, { - description: - 'The number of milliseconds it took Elasticsearch to run the request.\nThis value is calculated by measuring the time elapsed between receipt of a request on the coordinating node and the time at which the coordinating node is ready to send the response.\nIt includes:\n\n* Communication time between the coordinating node and data nodes\n* Time the request spends in the search thread pool, queued for execution\n* Actual run time\n\nIt does not include:\n\n* Time needed to send the request to Elasticsearch\n* Time needed to serialize the JSON response\n* Time needed to send the response to a client', - }), - timed_out: z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request timed out before completion; returned results may be partial or empty.', - }), - _shards: types_shard_statistics, - hits: global_search_types_hits_metadata, - aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)), - _clusters: z.optional(types_cluster_statistics), - fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - max_score: z.optional(z.number()), - num_reduce_phases: z.optional(z.number()), - profile: z.optional(global_search_types_profile), - pit_id: z.optional(types_id), - _scroll_id: z.optional(types_scroll_id), - suggest: z.optional(z.record(z.string(), z.array(global_search_types_suggest))), - terminated_early: z.optional(z.boolean()), + took: z.number().register(z.globalRegistry, { + description: 'The number of milliseconds it took Elasticsearch to run the request.\nThis value is calculated by measuring the time elapsed between receipt of a request on the coordinating node and the time at which the coordinating node is ready to send the response.\nIt includes:\n\n* Communication time between the coordinating node and data nodes\n* Time the request spends in the search thread pool, queued for execution\n* Actual run time\n\nIt does not include:\n\n* Time needed to send the request to Elasticsearch\n* Time needed to serialize the JSON response\n* Time needed to send the response to a client' + }), + timed_out: z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request timed out before completion; returned results may be partial or empty.' + }), + _shards: types_shard_statistics, + hits: global_search_types_hits_metadata, + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)), + _clusters: z.optional(types_cluster_statistics), + fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + max_score: z.optional(z.number()), + num_reduce_phases: z.optional(z.number()), + profile: z.optional(global_search_types_profile), + pit_id: z.optional(types_id), + _scroll_id: z.optional(types_scroll_id), + suggest: z.optional(z.record(z.string(), z.array(global_search_types_suggest))), + terminated_early: z.optional(z.boolean()) }); export const types_stored_script = z.object({ - lang: types_script_language, - options: z.optional(z.record(z.string(), z.string())), - source: types_script_source, + lang: types_script_language, + options: z.optional(z.record(z.string(), z.string())), + source: types_script_source }); export const graph_types_hop = z.object({ - get connections() { - return z.optional(z.lazy((): any => graph_types_hop)); - }, - query: z.optional(types_query_dsl_query_container), - vertices: z.array(graph_types_vertex_definition).register(z.globalRegistry, { - description: 'Contains the fields you are interested in.', - }), + get connections() { + return z.optional(z.lazy((): any => graph_types_hop)); + }, + query: z.optional(types_query_dsl_query_container), + vertices: z.array(graph_types_vertex_definition).register(z.globalRegistry, { + description: 'Contains the fields you are interested in.' + }) }); export const indices_create_from_create_from = z.object({ - mappings_override: z.optional(types_mapping_type_mapping), - settings_override: z.optional(indices_types_index_settings), - remove_index_blocks: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If index blocks should be removed when creating destination index (optional)', - }) - ), + mappings_override: z.optional(types_mapping_type_mapping), + settings_override: z.optional(indices_types_index_settings), + remove_index_blocks: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If index blocks should be removed when creating destination index (optional)' + })) }); export const indices_get_alias_types_index_aliases = z.object({ - aliases: z.record(z.string(), indices_types_alias_definition), + aliases: z.record(z.string(), indices_types_alias_definition) }); export const indices_types_data_stream = z.object({ - _meta: z.optional(types_metadata), - allow_custom_routing: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the data stream allows custom routing on write request.', - }) - ), - failure_store: z.optional(indices_types_failure_store), - generation: z.number().register(z.globalRegistry, { - description: - 'Current generation for the data stream. This number acts as a cumulative count of the stream’s rollovers, starting at 1.', - }), - hidden: z.boolean().register(z.globalRegistry, { - description: 'If `true`, the data stream is hidden.', - }), - ilm_policy: z.optional(types_name), - next_generation_managed_by: indices_types_managed_by, - prefer_ilm: z.boolean().register(z.globalRegistry, { - description: - 'Indicates if ILM should take precedence over DSL in case both are configured to managed this data stream.', - }), - indices: z.array(indices_types_data_stream_index).register(z.globalRegistry, { - description: - 'Array of objects containing information about the data stream’s backing indices.\nThe last item in this array contains information about the stream’s current write index.', - }), - lifecycle: z.optional(indices_types_data_stream_lifecycle_with_rollover), - name: types_data_stream_name, - replicated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the data stream is created and managed by cross-cluster replication and the local cluster can not write into this data stream or change its mappings.', - }) - ), - rollover_on_write: z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the next write to this data stream will trigger a rollover first and the document will be indexed in the new backing index. If the rollover fails the indexing request will fail too.', - }), - settings: indices_types_index_settings, - mappings: z.optional(types_mapping_type_mapping), - status: types_health_status, - system: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the data stream is created and managed by an Elastic stack component and cannot be modified through normal user interaction.', - }) - ), - template: types_name, - timestamp_field: indices_types_data_stream_timestamp_field, - index_mode: z.optional(indices_types_index_mode), + _meta: z.optional(types_metadata), + allow_custom_routing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the data stream allows custom routing on write request.' + })), + failure_store: z.optional(indices_types_failure_store), + generation: z.number().register(z.globalRegistry, { + description: 'Current generation for the data stream. This number acts as a cumulative count of the stream’s rollovers, starting at 1.' + }), + hidden: z.boolean().register(z.globalRegistry, { + description: 'If `true`, the data stream is hidden.' + }), + ilm_policy: z.optional(types_name), + next_generation_managed_by: indices_types_managed_by, + prefer_ilm: z.boolean().register(z.globalRegistry, { + description: 'Indicates if ILM should take precedence over DSL in case both are configured to managed this data stream.' + }), + indices: z.array(indices_types_data_stream_index).register(z.globalRegistry, { + description: 'Array of objects containing information about the data stream’s backing indices.\nThe last item in this array contains information about the stream’s current write index.' + }), + lifecycle: z.optional(indices_types_data_stream_lifecycle_with_rollover), + name: types_data_stream_name, + replicated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the data stream is created and managed by cross-cluster replication and the local cluster can not write into this data stream or change its mappings.' + })), + rollover_on_write: z.boolean().register(z.globalRegistry, { + description: 'If `true`, the next write to this data stream will trigger a rollover first and the document will be indexed in the new backing index. If the rollover fails the indexing request will fail too.' + }), + settings: indices_types_index_settings, + mappings: z.optional(types_mapping_type_mapping), + status: types_health_status, + system: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the data stream is created and managed by an Elastic stack component and cannot be modified through normal user interaction.' + })), + template: types_name, + timestamp_field: indices_types_data_stream_timestamp_field, + index_mode: z.optional(indices_types_index_mode) }); export const indices_get_data_stream_mappings_data_stream_mappings = z.object({ - name: z.string().register(z.globalRegistry, { - description: 'The name of the data stream.', - }), - mappings: types_mapping_type_mapping, - effective_mappings: types_mapping_type_mapping, + name: z.string().register(z.globalRegistry, { + description: 'The name of the data stream.' + }), + mappings: types_mapping_type_mapping, + effective_mappings: types_mapping_type_mapping }); export const indices_get_data_stream_settings_data_stream_settings = z.object({ - name: z.string().register(z.globalRegistry, { - description: 'The name of the data stream.', - }), - settings: indices_types_index_settings, - effective_settings: indices_types_index_settings, + name: z.string().register(z.globalRegistry, { + description: 'The name of the data stream.' + }), + settings: indices_types_index_settings, + effective_settings: indices_types_index_settings }); export const indices_get_field_mapping_type_field_mappings = z.object({ - get mappings() { - return z.record( - z.string(), - z.lazy((): any => types_mapping_field_mapping) - ); - }, + get mappings() { + return z.record(z.string(), z.lazy((): any => types_mapping_field_mapping)); + } }); export const types_mapping_field_mapping = z.object({ - full_name: z.string(), - mapping: z.record(z.string(), types_mapping_property), + full_name: z.string(), + mapping: z.record(z.string(), types_mapping_property) }); export const indices_get_index_template_index_template_item = z.object({ - name: types_name, - get index_template() { - return z.lazy((): any => indices_types_index_template); - }, + name: types_name, + get index_template() { + return z.lazy((): any => indices_types_index_template); + } }); export const indices_types_index_template = z.object({ - index_patterns: types_names, - composed_of: z.array(types_name).register(z.globalRegistry, { - description: - 'An ordered list of component template names.\nComponent templates are merged in the order specified, meaning that the last component template specified has the highest precedence.', - }), - get template() { - return z.optional(z.lazy((): any => indices_types_index_template_summary)); - }, - version: z.optional(types_version_number), - priority: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Priority to determine index template precedence when a new data stream or index is created.\nThe index template with the highest priority is chosen.\nIf no priority is specified the template is treated as though it is of priority 0 (lowest priority).\nThis number is not automatically generated by Elasticsearch.', - }) - ), - _meta: z.optional(types_metadata), - allow_auto_create: z.optional(z.boolean()), - data_stream: z.optional(indices_types_index_template_data_stream_configuration), - deprecated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Marks this index template as deprecated.\nWhen creating or updating a non-deprecated index template that uses deprecated components,\nElasticsearch will emit a deprecation warning.', - }) - ), - ignore_missing_component_templates: z.optional(types_names), - created_date: z.optional(types_date_time), - created_date_millis: z.optional(types_epoch_time_unit_millis), - modified_date: z.optional(types_date_time), - modified_date_millis: z.optional(types_epoch_time_unit_millis), + index_patterns: types_names, + composed_of: z.array(types_name).register(z.globalRegistry, { + description: 'An ordered list of component template names.\nComponent templates are merged in the order specified, meaning that the last component template specified has the highest precedence.' + }), + get template() { + return z.optional(z.lazy((): any => indices_types_index_template_summary)); + }, + version: z.optional(types_version_number), + priority: z.optional(z.number().register(z.globalRegistry, { + description: 'Priority to determine index template precedence when a new data stream or index is created.\nThe index template with the highest priority is chosen.\nIf no priority is specified the template is treated as though it is of priority 0 (lowest priority).\nThis number is not automatically generated by Elasticsearch.' + })), + _meta: z.optional(types_metadata), + allow_auto_create: z.optional(z.boolean()), + data_stream: z.optional(indices_types_index_template_data_stream_configuration), + deprecated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Marks this index template as deprecated.\nWhen creating or updating a non-deprecated index template that uses deprecated components,\nElasticsearch will emit a deprecation warning.' + })), + ignore_missing_component_templates: z.optional(types_names), + created_date: z.optional(types_date_time), + created_date_millis: z.optional(types_epoch_time_unit_millis), + modified_date: z.optional(types_date_time), + modified_date_millis: z.optional(types_epoch_time_unit_millis) }); export const indices_types_index_template_summary = z.object({ - aliases: z.optional( - z.record(z.string(), indices_types_alias).register(z.globalRegistry, { - description: - 'Aliases to add.\nIf the index template includes a `data_stream` object, these are data stream aliases.\nOtherwise, these are index aliases.\nData stream aliases ignore the `index_routing`, `routing`, and `search_routing` options.', - }) - ), - mappings: z.optional(types_mapping_type_mapping), - settings: z.optional(indices_types_index_settings), - lifecycle: z.optional(indices_types_data_stream_lifecycle_with_rollover), - data_stream_options: z.optional( - z.union([indices_types_data_stream_options_template, z.string(), z.null()]) - ), + aliases: z.optional(z.record(z.string(), indices_types_alias).register(z.globalRegistry, { + description: 'Aliases to add.\nIf the index template includes a `data_stream` object, these are data stream aliases.\nOtherwise, these are index aliases.\nData stream aliases ignore the `index_routing`, `routing`, and `search_routing` options.' + })), + mappings: z.optional(types_mapping_type_mapping), + settings: z.optional(indices_types_index_settings), + lifecycle: z.optional(indices_types_data_stream_lifecycle_with_rollover), + data_stream_options: z.optional(z.union([ + indices_types_data_stream_options_template, + z.string(), + z.null() + ])) }); export const indices_get_mapping_index_mapping_record = z.object({ - item: z.optional(types_mapping_type_mapping), - mappings: types_mapping_type_mapping, + item: z.optional(types_mapping_type_mapping), + mappings: types_mapping_type_mapping }); export const indices_types_template_mapping = z.object({ - aliases: z.record(z.string(), indices_types_alias), - index_patterns: z.array(types_name), - mappings: types_mapping_type_mapping, - order: z.number(), - settings: z.record(z.string(), z.record(z.string(), z.unknown())), - version: z.optional(types_version_number), + aliases: z.record(z.string(), indices_types_alias), + index_patterns: z.array(types_name), + mappings: types_mapping_type_mapping, + order: z.number(), + settings: z.record(z.string(), z.record(z.string(), z.unknown())), + version: z.optional(types_version_number) }); export const indices_put_data_stream_mappings_updated_data_stream_mappings = z.object({ - name: types_index_name, - applied_to_data_stream: z.boolean().register(z.globalRegistry, { - description: - 'If the mappings were successfully applied to the data stream (or would have been, if running in `dry_run`\nmode), it is `true`. If an error occurred, it is `false`.', - }), - error: z.optional( - z.string().register(z.globalRegistry, { - description: 'A message explaining why the mappings could not be applied to the data stream.', - }) - ), - mappings: z.optional(types_mapping_type_mapping), - effective_mappings: z.optional(types_mapping_type_mapping), + name: types_index_name, + applied_to_data_stream: z.boolean().register(z.globalRegistry, { + description: 'If the mappings were successfully applied to the data stream (or would have been, if running in `dry_run`\nmode), it is `true`. If an error occurred, it is `false`.' + }), + error: z.optional(z.string().register(z.globalRegistry, { + description: 'A message explaining why the mappings could not be applied to the data stream.' + })), + mappings: z.optional(types_mapping_type_mapping), + effective_mappings: z.optional(types_mapping_type_mapping) }); export const indices_put_data_stream_settings_updated_data_stream_settings = z.object({ - name: types_index_name, - applied_to_data_stream: z.boolean().register(z.globalRegistry, { - description: - 'If the settings were successfully applied to the data stream (or would have been, if running in `dry_run`\nmode), it is `true`. If an error occurred, it is `false`.', - }), - error: z.optional( - z.string().register(z.globalRegistry, { - description: 'A message explaining why the settings could not be applied to the data stream.', - }) - ), - settings: indices_types_index_settings, - effective_settings: indices_types_index_settings, - index_settings_results: indices_put_data_stream_settings_index_setting_results, + name: types_index_name, + applied_to_data_stream: z.boolean().register(z.globalRegistry, { + description: 'If the settings were successfully applied to the data stream (or would have been, if running in `dry_run`\nmode), it is `true`. If an error occurred, it is `false`.' + }), + error: z.optional(z.string().register(z.globalRegistry, { + description: 'A message explaining why the settings could not be applied to the data stream.' + })), + settings: indices_types_index_settings, + effective_settings: indices_types_index_settings, + index_settings_results: indices_put_data_stream_settings_index_setting_results }); export const indices_put_index_template_index_template_mapping = z.object({ - aliases: z.optional( - z.record(z.string(), indices_types_alias).register(z.globalRegistry, { - description: - 'Aliases to add.\nIf the index template includes a `data_stream` object, these are data stream aliases.\nOtherwise, these are index aliases.\nData stream aliases ignore the `index_routing`, `routing`, and `search_routing` options.', - }) - ), - mappings: z.optional(types_mapping_type_mapping), - settings: z.optional(indices_types_index_settings), - lifecycle: z.optional(indices_types_data_stream_lifecycle), + aliases: z.optional(z.record(z.string(), indices_types_alias).register(z.globalRegistry, { + description: 'Aliases to add.\nIf the index template includes a `data_stream` object, these are data stream aliases.\nOtherwise, these are index aliases.\nData stream aliases ignore the `index_routing`, `routing`, and `search_routing` options.' + })), + mappings: z.optional(types_mapping_type_mapping), + settings: z.optional(indices_types_index_settings), + lifecycle: z.optional(indices_types_data_stream_lifecycle) }); export const indices_simulate_template_template = z.object({ - aliases: z.record(z.string(), indices_types_alias), - mappings: types_mapping_type_mapping, - settings: indices_types_index_settings, + aliases: z.record(z.string(), indices_types_alias), + mappings: types_mapping_type_mapping, + settings: indices_types_index_settings }); export const indices_stats_indices_stats = z.object({ - get primaries() { - return z.optional(z.lazy((): any => indices_stats_index_stats)); - }, - get shards() { - return z.optional(z.record(z.string(), z.array(z.lazy((): any => indices_stats_shard_stats)))); - }, - get total() { - return z.optional(z.lazy((): any => indices_stats_index_stats)); - }, - uuid: z.optional(types_uuid), - health: z.optional(types_health_status), - status: z.optional(indices_stats_index_metadata_state), + get primaries() { + return z.optional(z.lazy((): any => indices_stats_index_stats)); + }, + get shards() { + return z.optional(z.record(z.string(), z.array(z.lazy((): any => indices_stats_shard_stats)))); + }, + get total() { + return z.optional(z.lazy((): any => indices_stats_index_stats)); + }, + uuid: z.optional(types_uuid), + health: z.optional(types_health_status), + status: z.optional(indices_stats_index_metadata_state) }); export const indices_stats_index_stats = z.object({ - completion: z.optional(types_completion_stats), - docs: z.optional(types_doc_stats), - fielddata: z.optional(types_fielddata_stats), - flush: z.optional(types_flush_stats), - get: z.optional(types_get_stats), - indexing: z.optional(types_indexing_stats), - indices: z.optional(indices_stats_indices_stats), - merges: z.optional(types_merges_stats), - query_cache: z.optional(types_query_cache_stats), - recovery: z.optional(types_recovery_stats), - refresh: z.optional(types_refresh_stats), - request_cache: z.optional(types_request_cache_stats), - search: z.optional(types_search_stats), - segments: z.optional(types_segments_stats), - store: z.optional(types_store_stats), - translog: z.optional(types_translog_stats), - warmer: z.optional(types_warmer_stats), - bulk: z.optional(types_bulk_stats), - shard_stats: z.optional(indices_stats_shards_total_stats), + completion: z.optional(types_completion_stats), + docs: z.optional(types_doc_stats), + fielddata: z.optional(types_fielddata_stats), + flush: z.optional(types_flush_stats), + get: z.optional(types_get_stats), + indexing: z.optional(types_indexing_stats), + indices: z.optional(indices_stats_indices_stats), + merges: z.optional(types_merges_stats), + query_cache: z.optional(types_query_cache_stats), + recovery: z.optional(types_recovery_stats), + refresh: z.optional(types_refresh_stats), + request_cache: z.optional(types_request_cache_stats), + search: z.optional(types_search_stats), + segments: z.optional(types_segments_stats), + store: z.optional(types_store_stats), + translog: z.optional(types_translog_stats), + warmer: z.optional(types_warmer_stats), + bulk: z.optional(types_bulk_stats), + shard_stats: z.optional(indices_stats_shards_total_stats) }); export const indices_stats_shard_stats = z.object({ - commit: z.optional(indices_stats_shard_commit), - completion: z.optional(types_completion_stats), - docs: z.optional(types_doc_stats), - fielddata: z.optional(types_fielddata_stats), - flush: z.optional(types_flush_stats), - get: z.optional(types_get_stats), - indexing: z.optional(types_indexing_stats), - mappings: z.optional(indices_stats_mapping_stats), - merges: z.optional(types_merges_stats), - shard_path: z.optional(indices_stats_shard_path), - query_cache: z.optional(indices_stats_shard_query_cache), - recovery: z.optional(types_recovery_stats), - refresh: z.optional(types_refresh_stats), - request_cache: z.optional(types_request_cache_stats), - retention_leases: z.optional(indices_stats_shard_retention_leases), - routing: z.optional(indices_stats_shard_routing), - search: z.optional(types_search_stats), - segments: z.optional(types_segments_stats), - seq_no: z.optional(indices_stats_shard_sequence_number), - store: z.optional(types_store_stats), - translog: z.optional(types_translog_stats), - warmer: z.optional(types_warmer_stats), - bulk: z.optional(types_bulk_stats), - shards: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - shard_stats: z.optional(indices_stats_shards_total_stats), - indices: z.optional(indices_stats_indices_stats), + commit: z.optional(indices_stats_shard_commit), + completion: z.optional(types_completion_stats), + docs: z.optional(types_doc_stats), + fielddata: z.optional(types_fielddata_stats), + flush: z.optional(types_flush_stats), + get: z.optional(types_get_stats), + indexing: z.optional(types_indexing_stats), + mappings: z.optional(indices_stats_mapping_stats), + merges: z.optional(types_merges_stats), + shard_path: z.optional(indices_stats_shard_path), + query_cache: z.optional(indices_stats_shard_query_cache), + recovery: z.optional(types_recovery_stats), + refresh: z.optional(types_refresh_stats), + request_cache: z.optional(types_request_cache_stats), + retention_leases: z.optional(indices_stats_shard_retention_leases), + routing: z.optional(indices_stats_shard_routing), + search: z.optional(types_search_stats), + segments: z.optional(types_segments_stats), + seq_no: z.optional(indices_stats_shard_sequence_number), + store: z.optional(types_store_stats), + translog: z.optional(types_translog_stats), + warmer: z.optional(types_warmer_stats), + bulk: z.optional(types_bulk_stats), + shards: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + shard_stats: z.optional(indices_stats_shards_total_stats), + indices: z.optional(indices_stats_indices_stats) }); export const indices_update_aliases_action = z.object({ - get add() { - return z.optional(z.lazy((): any => indices_update_aliases_add_action)); - }, - remove: z.optional(indices_update_aliases_remove_action), - remove_index: z.optional(indices_update_aliases_remove_index_action), + get add() { + return z.optional(z.lazy((): any => indices_update_aliases_add_action)); + }, + remove: z.optional(indices_update_aliases_remove_action), + remove_index: z.optional(indices_update_aliases_remove_index_action) }); export const indices_update_aliases_add_action = z.object({ - alias: z.optional(types_index_alias), - aliases: z.optional(z.union([types_index_alias, z.array(types_index_alias)])), - filter: z.optional(types_query_dsl_query_container), - index: z.optional(types_index_name), - indices: z.optional(types_indices), - index_routing: z.optional(types_routing), - is_hidden: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the alias is hidden.', - }) - ), - is_write_index: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, sets the write index or data stream for the alias.', - }) - ), - routing: z.optional(types_routing), - search_routing: z.optional(types_routing), - must_exist: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the alias must exist to perform the action.', - }) - ), + alias: z.optional(types_index_alias), + aliases: z.optional(z.union([ + types_index_alias, + z.array(types_index_alias) + ])), + filter: z.optional(types_query_dsl_query_container), + index: z.optional(types_index_name), + indices: z.optional(types_indices), + index_routing: z.optional(types_routing), + is_hidden: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the alias is hidden.' + })), + is_write_index: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, sets the write index or data stream for the alias.' + })), + routing: z.optional(types_routing), + search_routing: z.optional(types_routing), + must_exist: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the alias must exist to perform the action.' + })) }); export const ingest_types_pipeline = z.object({ - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'Description of the ingest pipeline.', - }) - ), - get on_failure() { - return z.optional( - z.array(z.lazy((): any => ingest_types_processor_container)).register(z.globalRegistry, { - description: 'Processors to run immediately after a processor failure.', - }) - ); - }, - get processors() { - return z.optional( - z.array(z.lazy((): any => ingest_types_processor_container)).register(z.globalRegistry, { - description: - 'Processors used to perform transformations on documents before indexing.\nProcessors run sequentially in the order specified.', - }) - ); - }, - version: z.optional(types_version_number), - deprecated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Marks this ingest pipeline as deprecated.\nWhen a deprecated ingest pipeline is referenced as the default or final pipeline when creating or updating a non-deprecated index template, Elasticsearch will emit a deprecation warning.', - }) - ), - _meta: z.optional(types_metadata), - created_date: z.optional(types_date_time), - created_date_millis: z.optional(types_epoch_time_unit_millis), - modified_date: z.optional(types_date_time), - modified_date_millis: z.optional(types_epoch_time_unit_millis), - field_access_pattern: z.optional(ingest_types_field_access_pattern), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Description of the ingest pipeline.' + })), + get on_failure() { + return z.optional(z.array(z.lazy((): any => ingest_types_processor_container)).register(z.globalRegistry, { + description: 'Processors to run immediately after a processor failure.' + })); + }, + get processors() { + return z.optional(z.array(z.lazy((): any => ingest_types_processor_container)).register(z.globalRegistry, { + description: 'Processors used to perform transformations on documents before indexing.\nProcessors run sequentially in the order specified.' + })); + }, + version: z.optional(types_version_number), + deprecated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Marks this ingest pipeline as deprecated.\nWhen a deprecated ingest pipeline is referenced as the default or final pipeline when creating or updating a non-deprecated index template, Elasticsearch will emit a deprecation warning.' + })), + _meta: z.optional(types_metadata), + created_date: z.optional(types_date_time), + created_date_millis: z.optional(types_epoch_time_unit_millis), + modified_date: z.optional(types_date_time), + modified_date_millis: z.optional(types_epoch_time_unit_millis), + field_access_pattern: z.optional(ingest_types_field_access_pattern) }); export const ingest_types_processor_container = z.object({ - get append() { - return z.optional(z.lazy((): any => ingest_types_append_processor)); - }, - get attachment() { - return z.optional(z.lazy((): any => ingest_types_attachment_processor)); - }, - get bytes() { - return z.optional(z.lazy((): any => ingest_types_bytes_processor)); - }, - get circle() { - return z.optional(z.lazy((): any => ingest_types_circle_processor)); - }, - get community_id() { - return z.optional(z.lazy((): any => ingest_types_community_id_processor)); - }, - get convert() { - return z.optional(z.lazy((): any => ingest_types_convert_processor)); - }, - get csv() { - return z.optional(z.lazy((): any => ingest_types_csv_processor)); - }, - get date() { - return z.optional(z.lazy((): any => ingest_types_date_processor)); - }, - get date_index_name() { - return z.optional(z.lazy((): any => ingest_types_date_index_name_processor)); - }, - get dissect() { - return z.optional(z.lazy((): any => ingest_types_dissect_processor)); - }, - get dot_expander() { - return z.optional(z.lazy((): any => ingest_types_dot_expander_processor)); - }, - get drop() { - return z.optional(z.lazy((): any => ingest_types_drop_processor)); - }, - get enrich() { - return z.optional(z.lazy((): any => ingest_types_enrich_processor)); - }, - get fail() { - return z.optional(z.lazy((): any => ingest_types_fail_processor)); - }, - get fingerprint() { - return z.optional(z.lazy((): any => ingest_types_fingerprint_processor)); - }, - get foreach() { - return z.optional(z.lazy((): any => ingest_types_foreach_processor)); - }, - get ip_location() { - return z.optional(z.lazy((): any => ingest_types_ip_location_processor)); - }, - get geo_grid() { - return z.optional(z.lazy((): any => ingest_types_geo_grid_processor)); - }, - get geoip() { - return z.optional(z.lazy((): any => ingest_types_geo_ip_processor)); - }, - get grok() { - return z.optional(z.lazy((): any => ingest_types_grok_processor)); - }, - get gsub() { - return z.optional(z.lazy((): any => ingest_types_gsub_processor)); - }, - get html_strip() { - return z.optional(z.lazy((): any => ingest_types_html_strip_processor)); - }, - get inference() { - return z.optional(z.lazy((): any => ingest_types_inference_processor)); - }, - get join() { - return z.optional(z.lazy((): any => ingest_types_join_processor)); - }, - get json() { - return z.optional(z.lazy((): any => ingest_types_json_processor)); - }, - get kv() { - return z.optional(z.lazy((): any => ingest_types_key_value_processor)); - }, - get lowercase() { - return z.optional(z.lazy((): any => ingest_types_lowercase_processor)); - }, - get network_direction() { - return z.optional(z.lazy((): any => ingest_types_network_direction_processor)); - }, - get pipeline() { - return z.optional(z.lazy((): any => ingest_types_pipeline_processor)); - }, - get redact() { - return z.optional(z.lazy((): any => ingest_types_redact_processor)); - }, - get registered_domain() { - return z.optional(z.lazy((): any => ingest_types_registered_domain_processor)); - }, - get remove() { - return z.optional(z.lazy((): any => ingest_types_remove_processor)); - }, - get rename() { - return z.optional(z.lazy((): any => ingest_types_rename_processor)); - }, - get reroute() { - return z.optional(z.lazy((): any => ingest_types_reroute_processor)); - }, - get script() { - return z.optional(z.lazy((): any => ingest_types_script_processor)); - }, - get set() { - return z.optional(z.lazy((): any => ingest_types_set_processor)); - }, - get set_security_user() { - return z.optional(z.lazy((): any => ingest_types_set_security_user_processor)); - }, - get sort() { - return z.optional(z.lazy((): any => ingest_types_sort_processor)); - }, - get split() { - return z.optional(z.lazy((): any => ingest_types_split_processor)); - }, - get terminate() { - return z.optional(z.lazy((): any => ingest_types_terminate_processor)); - }, - get trim() { - return z.optional(z.lazy((): any => ingest_types_trim_processor)); - }, - get uppercase() { - return z.optional(z.lazy((): any => ingest_types_uppercase_processor)); - }, - get urldecode() { - return z.optional(z.lazy((): any => ingest_types_url_decode_processor)); - }, - get uri_parts() { - return z.optional(z.lazy((): any => ingest_types_uri_parts_processor)); - }, - get user_agent() { - return z.optional(z.lazy((): any => ingest_types_user_agent_processor)); - }, -}); - -export const ingest_types_append_processor = z - .lazy((): any => ingest_types_processor_base) - .and( - z.object({ - field: types_field, - value: z.optional( - z.union([z.record(z.string(), z.unknown()), z.array(z.record(z.string(), z.unknown()))]) - ), - copy_from: z.optional(types_field), - allow_duplicates: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the processor does not append values already present in the field.', - }) - ), - }) - ); - -export const ingest_types_processor_base = z.object({ - description: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Description of the processor.\nUseful for describing the purpose of the processor or its configuration.', - }) - ), - if: z.optional(types_script), - ignore_failure: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Ignore failures for the processor.', - }) - ), - on_failure: z.optional( - z.array(ingest_types_processor_container).register(z.globalRegistry, { - description: 'Handle failures for the processor.', - }) - ), - tag: z.optional( - z.string().register(z.globalRegistry, { - description: 'Identifier for the processor.\nUseful for debugging and metrics.', - }) - ), + get append() { + return z.optional(z.lazy((): any => ingest_types_append_processor)); + }, + get attachment() { + return z.optional(z.lazy((): any => ingest_types_attachment_processor)); + }, + get bytes() { + return z.optional(z.lazy((): any => ingest_types_bytes_processor)); + }, + get circle() { + return z.optional(z.lazy((): any => ingest_types_circle_processor)); + }, + get community_id() { + return z.optional(z.lazy((): any => ingest_types_community_id_processor)); + }, + get convert() { + return z.optional(z.lazy((): any => ingest_types_convert_processor)); + }, + get csv() { + return z.optional(z.lazy((): any => ingest_types_csv_processor)); + }, + get date() { + return z.optional(z.lazy((): any => ingest_types_date_processor)); + }, + get date_index_name() { + return z.optional(z.lazy((): any => ingest_types_date_index_name_processor)); + }, + get dissect() { + return z.optional(z.lazy((): any => ingest_types_dissect_processor)); + }, + get dot_expander() { + return z.optional(z.lazy((): any => ingest_types_dot_expander_processor)); + }, + get drop() { + return z.optional(z.lazy((): any => ingest_types_drop_processor)); + }, + get enrich() { + return z.optional(z.lazy((): any => ingest_types_enrich_processor)); + }, + get fail() { + return z.optional(z.lazy((): any => ingest_types_fail_processor)); + }, + get fingerprint() { + return z.optional(z.lazy((): any => ingest_types_fingerprint_processor)); + }, + get foreach() { + return z.optional(z.lazy((): any => ingest_types_foreach_processor)); + }, + get ip_location() { + return z.optional(z.lazy((): any => ingest_types_ip_location_processor)); + }, + get geo_grid() { + return z.optional(z.lazy((): any => ingest_types_geo_grid_processor)); + }, + get geoip() { + return z.optional(z.lazy((): any => ingest_types_geo_ip_processor)); + }, + get grok() { + return z.optional(z.lazy((): any => ingest_types_grok_processor)); + }, + get gsub() { + return z.optional(z.lazy((): any => ingest_types_gsub_processor)); + }, + get html_strip() { + return z.optional(z.lazy((): any => ingest_types_html_strip_processor)); + }, + get inference() { + return z.optional(z.lazy((): any => ingest_types_inference_processor)); + }, + get join() { + return z.optional(z.lazy((): any => ingest_types_join_processor)); + }, + get json() { + return z.optional(z.lazy((): any => ingest_types_json_processor)); + }, + get kv() { + return z.optional(z.lazy((): any => ingest_types_key_value_processor)); + }, + get lowercase() { + return z.optional(z.lazy((): any => ingest_types_lowercase_processor)); + }, + get network_direction() { + return z.optional(z.lazy((): any => ingest_types_network_direction_processor)); + }, + get pipeline() { + return z.optional(z.lazy((): any => ingest_types_pipeline_processor)); + }, + get redact() { + return z.optional(z.lazy((): any => ingest_types_redact_processor)); + }, + get registered_domain() { + return z.optional(z.lazy((): any => ingest_types_registered_domain_processor)); + }, + get remove() { + return z.optional(z.lazy((): any => ingest_types_remove_processor)); + }, + get rename() { + return z.optional(z.lazy((): any => ingest_types_rename_processor)); + }, + get reroute() { + return z.optional(z.lazy((): any => ingest_types_reroute_processor)); + }, + get script() { + return z.optional(z.lazy((): any => ingest_types_script_processor)); + }, + get set() { + return z.optional(z.lazy((): any => ingest_types_set_processor)); + }, + get set_security_user() { + return z.optional(z.lazy((): any => ingest_types_set_security_user_processor)); + }, + get sort() { + return z.optional(z.lazy((): any => ingest_types_sort_processor)); + }, + get split() { + return z.optional(z.lazy((): any => ingest_types_split_processor)); + }, + get terminate() { + return z.optional(z.lazy((): any => ingest_types_terminate_processor)); + }, + get trim() { + return z.optional(z.lazy((): any => ingest_types_trim_processor)); + }, + get uppercase() { + return z.optional(z.lazy((): any => ingest_types_uppercase_processor)); + }, + get urldecode() { + return z.optional(z.lazy((): any => ingest_types_url_decode_processor)); + }, + get uri_parts() { + return z.optional(z.lazy((): any => ingest_types_uri_parts_processor)); + }, + get user_agent() { + return z.optional(z.lazy((): any => ingest_types_user_agent_processor)); + } }); -export const ingest_types_attachment_processor = ingest_types_processor_base.and( - z.object({ +export const ingest_types_append_processor = z.lazy((): any => ingest_types_processor_base).and(z.object({ + field: types_field, + value: z.optional(z.union([ + z.record(z.string(), z.unknown()), + z.array(z.record(z.string(), z.unknown())) + ])), + copy_from: z.optional(types_field), + allow_duplicates: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the processor does not append values already present in the field.' + })) +})); + +export const ingest_types_processor_base = z.object({ + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Description of the processor.\nUseful for describing the purpose of the processor or its configuration.' + })), + if: z.optional(types_script), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Ignore failures for the processor.' + })), + on_failure: z.optional(z.array(ingest_types_processor_container).register(z.globalRegistry, { + description: 'Handle failures for the processor.' + })), + tag: z.optional(z.string().register(z.globalRegistry, { + description: 'Identifier for the processor.\nUseful for debugging and metrics.' + })) +}); + +export const ingest_types_attachment_processor = ingest_types_processor_base.and(z.object({ field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and field does not exist, the processor quietly exits without modifying the document.', - }) - ), - indexed_chars: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of chars being used for extraction to prevent huge fields.\nUse `-1` for no limit.', - }) - ), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and field does not exist, the processor quietly exits without modifying the document.' + })), + indexed_chars: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of chars being used for extraction to prevent huge fields.\nUse `-1` for no limit.' + })), indexed_chars_field: z.optional(types_field), - properties: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'Array of properties to select to be stored.\nCan be `content`, `title`, `name`, `author`, `keywords`, `date`, `content_type`, `content_length`, `language`.', - }) - ), + properties: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Array of properties to select to be stored.\nCan be `content`, `title`, `name`, `author`, `keywords`, `date`, `content_type`, `content_length`, `language`.' + })), target_field: z.optional(types_field), - remove_binary: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the binary field will be removed from the document', - }) - ), - resource_name: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Field containing the name of the resource to decode.\nIf specified, the processor passes this resource name to the underlying Tika library to enable Resource Name Based Detection.', - }) - ), - }) -); - -export const ingest_types_bytes_processor = ingest_types_processor_base.and( - z.object({ + remove_binary: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the binary field will be removed from the document' + })), + resource_name: z.optional(z.string().register(z.globalRegistry, { + description: 'Field containing the name of the resource to decode.\nIf specified, the processor passes this resource name to the underlying Tika library to enable Resource Name Based Detection.' + })) +})); + +export const ingest_types_bytes_processor = ingest_types_processor_base.and(z.object({ field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.', - }) - ), - target_field: z.optional(types_field), - }) -); + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' + })), + target_field: z.optional(types_field) +})); -export const ingest_types_circle_processor = ingest_types_processor_base.and( - z.object({ +export const ingest_types_circle_processor = ingest_types_processor_base.and(z.object({ error_distance: z.number().register(z.globalRegistry, { - description: - 'The difference between the resulting inscribed distance from center to side and the circle’s radius (measured in meters for `geo_shape`, unit-less for `shape`).', + description: 'The difference between the resulting inscribed distance from center to side and the circle’s radius (measured in meters for `geo_shape`, unit-less for `shape`).' }), field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.', - }) - ), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' + })), shape_type: ingest_types_shape_type, - target_field: z.optional(types_field), - }) -); + target_field: z.optional(types_field) +})); -export const ingest_types_community_id_processor = ingest_types_processor_base.and( - z.object({ +export const ingest_types_community_id_processor = ingest_types_processor_base.and(z.object({ source_ip: z.optional(types_field), source_port: z.optional(types_field), destination_ip: z.optional(types_field), @@ -30553,290 +25041,174 @@ export const ingest_types_community_id_processor = ingest_types_processor_base.a icmp_code: z.optional(types_field), transport: z.optional(types_field), target_field: z.optional(types_field), - seed: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Seed for the community ID hash. Must be between 0 and 65535 (inclusive). The\nseed can prevent hash collisions between network domains, such as a staging\nand production network that use the same addressing scheme.', - }) - ), - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true and any required fields are missing, the processor quietly exits\nwithout modifying the document.', - }) - ), - }) -); - -export const ingest_types_convert_processor = ingest_types_processor_base.and( - z.object({ + seed: z.optional(z.number().register(z.globalRegistry, { + description: 'Seed for the community ID hash. Must be between 0 and 65535 (inclusive). The\nseed can prevent hash collisions between network domains, such as a staging\nand production network that use the same addressing scheme.' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true and any required fields are missing, the processor quietly exits\nwithout modifying the document.' + })) +})); + +export const ingest_types_convert_processor = ingest_types_processor_base.and(z.object({ field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.', - }) - ), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' + })), target_field: z.optional(types_field), - type: ingest_types_convert_type, - }) -); - -export const ingest_types_csv_processor = ingest_types_processor_base.and( - z.object({ - empty_value: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'Value used to fill empty fields.\nEmpty fields are skipped if this is not provided.\nAn empty field is one with no value (2 consecutive separators) or empty quotes (`""`).', - }) - ), + type: ingest_types_convert_type +})); + +export const ingest_types_csv_processor = ingest_types_processor_base.and(z.object({ + empty_value: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'Value used to fill empty fields.\nEmpty fields are skipped if this is not provided.\nAn empty field is one with no value (2 consecutive separators) or empty quotes (`""`).' + })), field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.', - }) - ), - quote: z.optional( - z.string().register(z.globalRegistry, { - description: 'Quote used in CSV, has to be single character string.', - }) - ), - separator: z.optional( - z.string().register(z.globalRegistry, { - description: 'Separator used in CSV, has to be single character string.', - }) - ), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' + })), + quote: z.optional(z.string().register(z.globalRegistry, { + description: 'Quote used in CSV, has to be single character string.' + })), + separator: z.optional(z.string().register(z.globalRegistry, { + description: 'Separator used in CSV, has to be single character string.' + })), target_fields: types_fields, - trim: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Trim whitespaces in unquoted fields.', - }) - ), - }) -); - -export const ingest_types_date_processor = ingest_types_processor_base.and( - z.object({ + trim: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Trim whitespaces in unquoted fields.' + })) +})); + +export const ingest_types_date_processor = ingest_types_processor_base.and(z.object({ field: types_field, formats: z.array(z.string()).register(z.globalRegistry, { - description: - 'An array of the expected date formats.\nCan be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.', - }), - locale: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The locale to use when parsing the date, relevant when parsing month names or week days.\nSupports template snippets.', - }) - ), + description: 'An array of the expected date formats.\nCan be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.' + }), + locale: z.optional(z.string().register(z.globalRegistry, { + description: 'The locale to use when parsing the date, relevant when parsing month names or week days.\nSupports template snippets.' + })), target_field: z.optional(types_field), - timezone: z.optional( - z.string().register(z.globalRegistry, { - description: 'The timezone to use when parsing the date.\nSupports template snippets.', - }) - ), - output_format: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The format to use when writing the date to target_field. Must be a valid\njava time pattern.', - }) - ), - }) -); - -export const ingest_types_date_index_name_processor = ingest_types_processor_base.and( - z.object({ - date_formats: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'An array of the expected date formats for parsing dates / timestamps in the document being preprocessed.\nCan be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.', - }) - ), + timezone: z.optional(z.string().register(z.globalRegistry, { + description: 'The timezone to use when parsing the date.\nSupports template snippets.' + })), + output_format: z.optional(z.string().register(z.globalRegistry, { + description: 'The format to use when writing the date to target_field. Must be a valid\njava time pattern.' + })) +})); + +export const ingest_types_date_index_name_processor = ingest_types_processor_base.and(z.object({ + date_formats: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'An array of the expected date formats for parsing dates / timestamps in the document being preprocessed.\nCan be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.' + })), date_rounding: z.string().register(z.globalRegistry, { - description: - 'How to round the date when formatting the date into the index name. Valid values are:\n`y` (year), `M` (month), `w` (week), `d` (day), `h` (hour), `m` (minute) and `s` (second).\nSupports template snippets.', + description: 'How to round the date when formatting the date into the index name. Valid values are:\n`y` (year), `M` (month), `w` (week), `d` (day), `h` (hour), `m` (minute) and `s` (second).\nSupports template snippets.' }), field: types_field, - index_name_format: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The format to be used when printing the parsed date into the index name.\nA valid java time pattern is expected here.\nSupports template snippets.', - }) - ), - index_name_prefix: z.optional( - z.string().register(z.globalRegistry, { - description: - 'A prefix of the index name to be prepended before the printed date.\nSupports template snippets.', - }) - ), - locale: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The locale to use when parsing the date from the document being preprocessed, relevant when parsing month names or week days.', - }) - ), - timezone: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names.', - }) - ), - }) -); - -export const ingest_types_dissect_processor = ingest_types_processor_base.and( - z.object({ - append_separator: z.optional( - z.string().register(z.globalRegistry, { - description: 'The character(s) that separate the appended fields.', - }) - ), + index_name_format: z.optional(z.string().register(z.globalRegistry, { + description: 'The format to be used when printing the parsed date into the index name.\nA valid java time pattern is expected here.\nSupports template snippets.' + })), + index_name_prefix: z.optional(z.string().register(z.globalRegistry, { + description: 'A prefix of the index name to be prepended before the printed date.\nSupports template snippets.' + })), + locale: z.optional(z.string().register(z.globalRegistry, { + description: 'The locale to use when parsing the date from the document being preprocessed, relevant when parsing month names or week days.' + })), + timezone: z.optional(z.string().register(z.globalRegistry, { + description: 'The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names.' + })) +})); + +export const ingest_types_dissect_processor = ingest_types_processor_base.and(z.object({ + append_separator: z.optional(z.string().register(z.globalRegistry, { + description: 'The character(s) that separate the appended fields.' + })), field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.', - }) - ), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' + })), pattern: z.string().register(z.globalRegistry, { - description: 'The pattern to apply to the field.', - }), - }) -); + description: 'The pattern to apply to the field.' + }) +})); -export const ingest_types_dot_expander_processor = ingest_types_processor_base.and( - z.object({ +export const ingest_types_dot_expander_processor = ingest_types_processor_base.and(z.object({ field: types_field, - override: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Controls the behavior when there is already an existing nested object that conflicts with the expanded field.\nWhen `false`, the processor will merge conflicts by combining the old and the new values into an array.\nWhen `true`, the value from the expanded field will overwrite the existing value.', - }) - ), - path: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field that contains the field to expand.\nOnly required if the field to expand is part another object field, because the `field` option can only understand leaf fields.', - }) - ), - }) -); - -export const ingest_types_drop_processor = ingest_types_processor_base.and( - z.record(z.string(), z.unknown()) -); - -export const ingest_types_enrich_processor = ingest_types_processor_base.and( - z.object({ + override: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Controls the behavior when there is already an existing nested object that conflicts with the expanded field.\nWhen `false`, the processor will merge conflicts by combining the old and the new values into an array.\nWhen `true`, the value from the expanded field will overwrite the existing value.' + })), + path: z.optional(z.string().register(z.globalRegistry, { + description: 'The field that contains the field to expand.\nOnly required if the field to expand is part another object field, because the `field` option can only understand leaf fields.' + })) +})); + +export const ingest_types_drop_processor = ingest_types_processor_base.and(z.record(z.string(), z.unknown())); + +export const ingest_types_enrich_processor = ingest_types_processor_base.and(z.object({ field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.', - }) - ), - max_matches: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of matched documents to include under the configured target field.\nThe `target_field` will be turned into a json array if `max_matches` is higher than 1, otherwise `target_field` will become a json object.\nIn order to avoid documents getting too large, the maximum allowed value is 128.', - }) - ), - override: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If processor will update fields with pre-existing non-null-valued field.\nWhen set to `false`, such fields will not be touched.', - }) - ), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' + })), + max_matches: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of matched documents to include under the configured target field.\nThe `target_field` will be turned into a json array if `max_matches` is higher than 1, otherwise `target_field` will become a json object.\nIn order to avoid documents getting too large, the maximum allowed value is 128.' + })), + override: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If processor will update fields with pre-existing non-null-valued field.\nWhen set to `false`, such fields will not be touched.' + })), policy_name: z.string().register(z.globalRegistry, { - description: 'The name of the enrich policy to use.', + description: 'The name of the enrich policy to use.' }), shape_relation: z.optional(types_geo_shape_relation), - target_field: types_field, - }) -); + target_field: types_field +})); -export const ingest_types_fail_processor = ingest_types_processor_base.and( - z.object({ +export const ingest_types_fail_processor = ingest_types_processor_base.and(z.object({ message: z.string().register(z.globalRegistry, { - description: 'The error message thrown by the processor.\nSupports template snippets.', - }), - }) -); + description: 'The error message thrown by the processor.\nSupports template snippets.' + }) +})); -export const ingest_types_fingerprint_processor = ingest_types_processor_base.and( - z.object({ +export const ingest_types_fingerprint_processor = ingest_types_processor_base.and(z.object({ fields: types_fields, target_field: z.optional(types_field), - salt: z.optional( - z.string().register(z.globalRegistry, { - description: 'Salt value for the hash function.', - }) - ), + salt: z.optional(z.string().register(z.globalRegistry, { + description: 'Salt value for the hash function.' + })), method: z.optional(ingest_types_fingerprint_digest), - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the processor ignores any missing fields. If all fields are\nmissing, the processor silently exits without modifying the document.', - }) - ), - }) -); - -export const ingest_types_foreach_processor = ingest_types_processor_base.and( - z.object({ + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the processor ignores any missing fields. If all fields are\nmissing, the processor silently exits without modifying the document.' + })) +})); + +export const ingest_types_foreach_processor = ingest_types_processor_base.and(z.object({ field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the processor silently exits without changing the document if the `field` is `null` or missing.', - }) - ), - processor: ingest_types_processor_container, - }) -); - -export const ingest_types_ip_location_processor = ingest_types_processor_base.and( - z.object({ - database_file: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The database filename referring to a database the module ships with (GeoLite2-City.mmdb, GeoLite2-Country.mmdb, or GeoLite2-ASN.mmdb) or a custom database in the ingest-geoip config directory.', - }) - ), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the processor silently exits without changing the document if the `field` is `null` or missing.' + })), + processor: ingest_types_processor_container +})); + +export const ingest_types_ip_location_processor = ingest_types_processor_base.and(z.object({ + database_file: z.optional(z.string().register(z.globalRegistry, { + description: 'The database filename referring to a database the module ships with (GeoLite2-City.mmdb, GeoLite2-Country.mmdb, or GeoLite2-ASN.mmdb) or a custom database in the ingest-geoip config directory.' + })), field: types_field, - first_only: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, only the first found IP location data will be returned, even if the field contains an array.', - }) - ), - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.', - }) - ), - properties: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'Controls what properties are added to the `target_field` based on the IP location lookup.', - }) - ), + first_only: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, only the first found IP location data will be returned, even if the field contains an array.' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' + })), + properties: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Controls what properties are added to the `target_field` based on the IP location lookup.' + })), target_field: z.optional(types_field), - download_database_on_pipeline_creation: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` (and if `ingest.geoip.downloader.eager.download` is `false`), the missing database is downloaded when the pipeline is created.\nElse, the download is triggered by when the pipeline is used as the `default_pipeline` or `final_pipeline` in an index.', - }) - ), - }) -); - -export const ingest_types_geo_grid_processor = ingest_types_processor_base.and( - z.object({ + download_database_on_pipeline_creation: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` (and if `ingest.geoip.downloader.eager.download` is `false`), the missing database is downloaded when the pipeline is created.\nElse, the download is triggered by when the pipeline is used as the `default_pipeline` or `final_pipeline` in an index.' + })) +})); + +export const ingest_types_geo_grid_processor = ingest_types_processor_base.and(z.object({ field: z.string().register(z.globalRegistry, { - description: - 'The field to interpret as a geo-tile.=\nThe field format is determined by the `tile_type`.', + description: 'The field to interpret as a geo-tile.=\nThe field format is determined by the `tile_type`.' }), tile_type: ingest_types_geo_grid_tile_type, target_field: z.optional(types_field), @@ -30844,1204 +25216,856 @@ export const ingest_types_geo_grid_processor = ingest_types_processor_base.and( children_field: z.optional(types_field), non_children_field: z.optional(types_field), precision_field: z.optional(types_field), - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.', - }) - ), - target_format: z.optional(ingest_types_geo_grid_target_format), - }) -); - -export const ingest_types_geo_ip_processor = ingest_types_processor_base.and( - z.object({ - database_file: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The database filename referring to a database the module ships with (GeoLite2-City.mmdb, GeoLite2-Country.mmdb, or GeoLite2-ASN.mmdb) or a custom database in the ingest-geoip config directory.', - }) - ), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' + })), + target_format: z.optional(ingest_types_geo_grid_target_format) +})); + +export const ingest_types_geo_ip_processor = ingest_types_processor_base.and(z.object({ + database_file: z.optional(z.string().register(z.globalRegistry, { + description: 'The database filename referring to a database the module ships with (GeoLite2-City.mmdb, GeoLite2-Country.mmdb, or GeoLite2-ASN.mmdb) or a custom database in the ingest-geoip config directory.' + })), field: types_field, - first_only: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, only the first found geoip data will be returned, even if the field contains an array.', - }) - ), - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.', - }) - ), - properties: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'Controls what properties are added to the `target_field` based on the geoip lookup.', - }) - ), + first_only: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, only the first found geoip data will be returned, even if the field contains an array.' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' + })), + properties: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Controls what properties are added to the `target_field` based on the geoip lookup.' + })), target_field: z.optional(types_field), - download_database_on_pipeline_creation: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` (and if `ingest.geoip.downloader.eager.download` is `false`), the missing database is downloaded when the pipeline is created.\nElse, the download is triggered by when the pipeline is used as the `default_pipeline` or `final_pipeline` in an index.', - }) - ), - }) -); - -export const ingest_types_grok_processor = ingest_types_processor_base.and( - z.object({ - ecs_compatibility: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Must be disabled or v1. If v1, the processor uses patterns with Elastic\nCommon Schema (ECS) field names.', - }) - ), + download_database_on_pipeline_creation: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` (and if `ingest.geoip.downloader.eager.download` is `false`), the missing database is downloaded when the pipeline is created.\nElse, the download is triggered by when the pipeline is used as the `default_pipeline` or `final_pipeline` in an index.' + })) +})); + +export const ingest_types_grok_processor = ingest_types_processor_base.and(z.object({ + ecs_compatibility: z.optional(z.string().register(z.globalRegistry, { + description: 'Must be disabled or v1. If v1, the processor uses patterns with Elastic\nCommon Schema (ECS) field names.' + })), field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.', - }) - ), - pattern_definitions: z.optional( - z.record(z.string(), z.string()).register(z.globalRegistry, { - description: - 'A map of pattern-name and pattern tuples defining custom patterns to be used by the current processor.\nPatterns matching existing names will override the pre-existing definition.', - }) - ), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' + })), + pattern_definitions: z.optional(z.record(z.string(), z.string()).register(z.globalRegistry, { + description: 'A map of pattern-name and pattern tuples defining custom patterns to be used by the current processor.\nPatterns matching existing names will override the pre-existing definition.' + })), patterns: z.array(types_grok_pattern).register(z.globalRegistry, { - description: - 'An ordered list of grok expression to match and extract named captures with.\nReturns on the first expression in the list that matches.', - }), - trace_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When `true`, `_ingest._grok_match_index` will be inserted into your matched document’s metadata with the index into the pattern found in `patterns` that matched.', - }) - ), - }) -); - -export const ingest_types_gsub_processor = ingest_types_processor_base.and( - z.object({ + description: 'An ordered list of grok expression to match and extract named captures with.\nReturns on the first expression in the list that matches.' + }), + trace_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When `true`, `_ingest._grok_match_index` will be inserted into your matched document’s metadata with the index into the pattern found in `patterns` that matched.' + })) +})); + +export const ingest_types_gsub_processor = ingest_types_processor_base.and(z.object({ field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.', - }) - ), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' + })), pattern: z.string().register(z.globalRegistry, { - description: 'The pattern to be replaced.', + description: 'The pattern to be replaced.' }), replacement: z.string().register(z.globalRegistry, { - description: 'The string to replace the matching patterns with.', + description: 'The string to replace the matching patterns with.' }), - target_field: z.optional(types_field), - }) -); + target_field: z.optional(types_field) +})); -export const ingest_types_html_strip_processor = ingest_types_processor_base.and( - z.object({ +export const ingest_types_html_strip_processor = ingest_types_processor_base.and(z.object({ field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document,', - }) - ), - target_field: z.optional(types_field), - }) -); + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document,' + })), + target_field: z.optional(types_field) +})); -export const ingest_types_inference_processor = ingest_types_processor_base.and( - z.object({ +export const ingest_types_inference_processor = ingest_types_processor_base.and(z.object({ model_id: types_id, target_field: z.optional(types_field), - field_map: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'Maps the document field names to the known field names of the model.\nThis mapping takes precedence over any default mappings provided in the model configuration.', - }) - ), + field_map: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Maps the document field names to the known field names of the model.\nThis mapping takes precedence over any default mappings provided in the model configuration.' + })), inference_config: z.optional(ingest_types_inference_config), - input_output: z.optional( - z.union([ingest_types_input_config, z.array(ingest_types_input_config)]) - ), - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true and any of the input fields defined in input_ouput are missing\nthen those missing fields are quietly ignored, otherwise a missing field causes a failure.\nOnly applies when using input_output configurations to explicitly list the input fields.', - }) - ), - }) -); - -export const ingest_types_join_processor = ingest_types_processor_base.and( - z.object({ + input_output: z.optional(z.union([ + ingest_types_input_config, + z.array(ingest_types_input_config) + ])), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true and any of the input fields defined in input_ouput are missing\nthen those missing fields are quietly ignored, otherwise a missing field causes a failure.\nOnly applies when using input_output configurations to explicitly list the input fields.' + })) +})); + +export const ingest_types_join_processor = ingest_types_processor_base.and(z.object({ field: types_field, separator: z.string().register(z.globalRegistry, { - description: 'The separator character.', + description: 'The separator character.' }), - target_field: z.optional(types_field), - }) -); - -export const ingest_types_json_processor = ingest_types_processor_base.and( - z.object({ - add_to_root: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Flag that forces the parsed JSON to be added at the top level of the document.\n`target_field` must not be set when this option is chosen.', - }) - ), + target_field: z.optional(types_field) +})); + +export const ingest_types_json_processor = ingest_types_processor_base.and(z.object({ + add_to_root: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Flag that forces the parsed JSON to be added at the top level of the document.\n`target_field` must not be set when this option is chosen.' + })), add_to_root_conflict_strategy: z.optional(ingest_types_json_processor_conflict_strategy), - allow_duplicate_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When set to `true`, the JSON parser will not fail if the JSON contains duplicate keys.\nInstead, the last encountered value for any duplicate key wins.', - }) - ), + allow_duplicate_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When set to `true`, the JSON parser will not fail if the JSON contains duplicate keys.\nInstead, the last encountered value for any duplicate key wins.' + })), field: types_field, - target_field: z.optional(types_field), - }) -); - -export const ingest_types_key_value_processor = ingest_types_processor_base.and( - z.object({ - exclude_keys: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'List of keys to exclude from document.', - }) - ), + target_field: z.optional(types_field) +})); + +export const ingest_types_key_value_processor = ingest_types_processor_base.and(z.object({ + exclude_keys: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'List of keys to exclude from document.' + })), field: types_field, field_split: z.string().register(z.globalRegistry, { - description: 'Regex pattern to use for splitting key-value pairs.', - }), - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.', - }) - ), - include_keys: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'List of keys to filter and insert into document.\nDefaults to including all keys.', - }) - ), - prefix: z.optional( - z.string().register(z.globalRegistry, { - description: 'Prefix to be added to extracted keys.', - }) - ), - strip_brackets: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`. strip brackets `()`, `<>`, `[]` as well as quotes `\'` and `"` from extracted values.', - }) - ), + description: 'Regex pattern to use for splitting key-value pairs.' + }), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' + })), + include_keys: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'List of keys to filter and insert into document.\nDefaults to including all keys.' + })), + prefix: z.optional(z.string().register(z.globalRegistry, { + description: 'Prefix to be added to extracted keys.' + })), + strip_brackets: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`. strip brackets `()`, `<>`, `[]` as well as quotes `\'` and `"` from extracted values.' + })), target_field: z.optional(types_field), - trim_key: z.optional( - z.string().register(z.globalRegistry, { - description: 'String of characters to trim from extracted keys.', - }) - ), - trim_value: z.optional( - z.string().register(z.globalRegistry, { - description: 'String of characters to trim from extracted values.', - }) - ), + trim_key: z.optional(z.string().register(z.globalRegistry, { + description: 'String of characters to trim from extracted keys.' + })), + trim_value: z.optional(z.string().register(z.globalRegistry, { + description: 'String of characters to trim from extracted values.' + })), value_split: z.string().register(z.globalRegistry, { - description: - 'Regex pattern to use for splitting the key from the value within a key-value pair.', - }), - }) -); + description: 'Regex pattern to use for splitting the key from the value within a key-value pair.' + }) +})); -export const ingest_types_lowercase_processor = ingest_types_processor_base.and( - z.object({ +export const ingest_types_lowercase_processor = ingest_types_processor_base.and(z.object({ field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.', - }) - ), - target_field: z.optional(types_field), - }) -); + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' + })), + target_field: z.optional(types_field) +})); -export const ingest_types_network_direction_processor = ingest_types_processor_base.and( - z.object({ +export const ingest_types_network_direction_processor = ingest_types_processor_base.and(z.object({ source_ip: z.optional(types_field), destination_ip: z.optional(types_field), target_field: z.optional(types_field), - internal_networks: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'List of internal networks. Supports IPv4 and IPv6 addresses and ranges in\nCIDR notation. Also supports the named ranges listed below. These may be\nconstructed with template snippets. Must specify only one of\ninternal_networks or internal_networks_field.', - }) - ), + internal_networks: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'List of internal networks. Supports IPv4 and IPv6 addresses and ranges in\nCIDR notation. Also supports the named ranges listed below. These may be\nconstructed with template snippets. Must specify only one of\ninternal_networks or internal_networks_field.' + })), internal_networks_field: z.optional(types_field), - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true and any required fields are missing, the processor quietly exits\nwithout modifying the document.', - }) - ), - }) -); - -export const ingest_types_pipeline_processor = ingest_types_processor_base.and( - z.object({ + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true and any required fields are missing, the processor quietly exits\nwithout modifying the document.' + })) +})); + +export const ingest_types_pipeline_processor = ingest_types_processor_base.and(z.object({ name: types_name, - ignore_missing_pipeline: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Whether to ignore missing pipelines instead of failing.', - }) - ), - }) -); - -export const ingest_types_redact_processor = ingest_types_processor_base.and( - z.object({ + ignore_missing_pipeline: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore missing pipelines instead of failing.' + })) +})); + +export const ingest_types_redact_processor = ingest_types_processor_base.and(z.object({ field: types_field, patterns: z.array(types_grok_pattern).register(z.globalRegistry, { - description: 'A list of grok expressions to match and redact named captures with', + description: 'A list of grok expressions to match and redact named captures with' }), pattern_definitions: z.optional(z.record(z.string(), z.string())), - prefix: z.optional( - z.string().register(z.globalRegistry, { - description: 'Start a redacted section with this token', - }) - ), - suffix: z.optional( - z.string().register(z.globalRegistry, { - description: 'End a redacted section with this token', - }) - ), - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.', - }) - ), - skip_if_unlicensed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and the current license does not support running redact processors, then the processor quietly exits without modifying the document', - }) - ), - trace_redact: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` then ingest metadata `_ingest._redact._is_redacted` is set to `true` if the document has been redacted', - }) - ), - }) -); - -export const ingest_types_registered_domain_processor = ingest_types_processor_base.and( - z.object({ + prefix: z.optional(z.string().register(z.globalRegistry, { + description: 'Start a redacted section with this token' + })), + suffix: z.optional(z.string().register(z.globalRegistry, { + description: 'End a redacted section with this token' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' + })), + skip_if_unlicensed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and the current license does not support running redact processors, then the processor quietly exits without modifying the document' + })), + trace_redact: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` then ingest metadata `_ingest._redact._is_redacted` is set to `true` if the document has been redacted' + })) +})); + +export const ingest_types_registered_domain_processor = ingest_types_processor_base.and(z.object({ field: types_field, target_field: z.optional(types_field), - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true and any required fields are missing, the processor quietly exits\nwithout modifying the document.', - }) - ), - }) -); - -export const ingest_types_remove_processor = ingest_types_processor_base.and( - z.object({ + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true and any required fields are missing, the processor quietly exits\nwithout modifying the document.' + })) +})); + +export const ingest_types_remove_processor = ingest_types_processor_base.and(z.object({ field: types_fields, keep: z.optional(types_fields), - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.', - }) - ), - }) -); - -export const ingest_types_rename_processor = ingest_types_processor_base.and( - z.object({ + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' + })) +})); + +export const ingest_types_rename_processor = ingest_types_processor_base.and(z.object({ field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.', - }) - ), - target_field: types_field, - }) -); - -export const ingest_types_reroute_processor = ingest_types_processor_base.and( - z.object({ - destination: z.optional( - z.string().register(z.globalRegistry, { - description: - 'A static value for the target. Can’t be set when the dataset or namespace option is set.', - }) - ), - dataset: z.optional(z.union([z.string(), z.array(z.string())])), - namespace: z.optional(z.union([z.string(), z.array(z.string())])), - }) -); - -export const ingest_types_script_processor = ingest_types_processor_base.and( - z.object({ + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' + })), + target_field: types_field +})); + +export const ingest_types_reroute_processor = ingest_types_processor_base.and(z.object({ + destination: z.optional(z.string().register(z.globalRegistry, { + description: 'A static value for the target. Can’t be set when the dataset or namespace option is set.' + })), + dataset: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + namespace: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])) +})); + +export const ingest_types_script_processor = ingest_types_processor_base.and(z.object({ id: z.optional(types_id), lang: z.optional(types_script_language), - params: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'Object containing parameters for the script.', - }) - ), - source: z.optional(types_script_source), - }) -); + params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Object containing parameters for the script.' + })), + source: z.optional(types_script_source) +})); -export const ingest_types_set_processor = ingest_types_processor_base.and( - z.object({ +export const ingest_types_set_processor = ingest_types_processor_base.and(z.object({ copy_from: z.optional(types_field), field: types_field, - ignore_empty_value: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `value` is a template snippet that evaluates to `null` or the empty string, the processor quietly exits without modifying the document.', - }) - ), - media_type: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The media type for encoding `value`.\nApplies only when value is a template snippet.\nMust be one of `application/json`, `text/plain`, or `application/x-www-form-urlencoded`.', - }) - ), - override: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` processor will update fields with pre-existing non-null-valued field.\nWhen set to `false`, such fields will not be touched.', - }) - ), - value: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'The value to be set for the field.\nSupports template snippets.\nMay specify only one of `value` or `copy_from`.', - }) - ), - }) -); - -export const ingest_types_set_security_user_processor = ingest_types_processor_base.and( - z.object({ + ignore_empty_value: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `value` is a template snippet that evaluates to `null` or the empty string, the processor quietly exits without modifying the document.' + })), + media_type: z.optional(z.string().register(z.globalRegistry, { + description: 'The media type for encoding `value`.\nApplies only when value is a template snippet.\nMust be one of `application/json`, `text/plain`, or `application/x-www-form-urlencoded`.' + })), + override: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` processor will update fields with pre-existing non-null-valued field.\nWhen set to `false`, such fields will not be touched.' + })), + value: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'The value to be set for the field.\nSupports template snippets.\nMay specify only one of `value` or `copy_from`.' + })) +})); + +export const ingest_types_set_security_user_processor = ingest_types_processor_base.and(z.object({ field: types_field, - properties: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'Controls what user related properties are added to the field.', - }) - ), - }) -); - -export const ingest_types_sort_processor = ingest_types_processor_base.and( - z.object({ + properties: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Controls what user related properties are added to the field.' + })) +})); + +export const ingest_types_sort_processor = ingest_types_processor_base.and(z.object({ field: types_field, order: z.optional(types_sort_order), - target_field: z.optional(types_field), - }) -); + target_field: z.optional(types_field) +})); -export const ingest_types_split_processor = ingest_types_processor_base.and( - z.object({ +export const ingest_types_split_processor = ingest_types_processor_base.and(z.object({ field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.', - }) - ), - preserve_trailing: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Preserves empty trailing fields, if any.', - }) - ), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' + })), + preserve_trailing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Preserves empty trailing fields, if any.' + })), separator: z.string().register(z.globalRegistry, { - description: 'A regex which matches the separator, for example, `,` or `\\s+`.', + description: 'A regex which matches the separator, for example, `,` or `\\s+`.' }), - target_field: z.optional(types_field), - }) -); + target_field: z.optional(types_field) +})); -export const ingest_types_terminate_processor = ingest_types_processor_base.and( - z.record(z.string(), z.unknown()) -); +export const ingest_types_terminate_processor = ingest_types_processor_base.and(z.record(z.string(), z.unknown())); -export const ingest_types_trim_processor = ingest_types_processor_base.and( - z.object({ +export const ingest_types_trim_processor = ingest_types_processor_base.and(z.object({ field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.', - }) - ), - target_field: z.optional(types_field), - }) -); + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' + })), + target_field: z.optional(types_field) +})); -export const ingest_types_uppercase_processor = ingest_types_processor_base.and( - z.object({ +export const ingest_types_uppercase_processor = ingest_types_processor_base.and(z.object({ field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.', - }) - ), - target_field: z.optional(types_field), - }) -); + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' + })), + target_field: z.optional(types_field) +})); -export const ingest_types_url_decode_processor = ingest_types_processor_base.and( - z.object({ +export const ingest_types_url_decode_processor = ingest_types_processor_base.and(z.object({ field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.', - }) - ), - target_field: z.optional(types_field), - }) -); + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.' + })), + target_field: z.optional(types_field) +})); -export const ingest_types_uri_parts_processor = ingest_types_processor_base.and( - z.object({ +export const ingest_types_uri_parts_processor = ingest_types_processor_base.and(z.object({ field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.', - }) - ), - keep_original: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the processor copies the unparsed URI to `.original`.', - }) - ), - remove_if_successful: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the processor removes the `field` after parsing the URI string.\nIf parsing fails, the processor does not remove the `field`.', - }) - ), - target_field: z.optional(types_field), - }) -); - -export const ingest_types_user_agent_processor = ingest_types_processor_base.and( - z.object({ + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' + })), + keep_original: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the processor copies the unparsed URI to `.original`.' + })), + remove_if_successful: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the processor removes the `field` after parsing the URI string.\nIf parsing fails, the processor does not remove the `field`.' + })), + target_field: z.optional(types_field) +})); + +export const ingest_types_user_agent_processor = ingest_types_processor_base.and(z.object({ field: types_field, - ignore_missing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.', - }) - ), - regex_file: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The name of the file in the `config/ingest-user-agent` directory containing the regular expressions for parsing the user agent string. Both the directory and the file have to be created before starting Elasticsearch. If not specified, ingest-user-agent will use the `regexes.yaml` from uap-core it ships with.', - }) - ), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and `field` does not exist, the processor quietly exits without modifying the document.' + })), + regex_file: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the file in the `config/ingest-user-agent` directory containing the regular expressions for parsing the user agent string. Both the directory and the file have to be created before starting Elasticsearch. If not specified, ingest-user-agent will use the `regexes.yaml` from uap-core it ships with.' + })), target_field: z.optional(types_field), - properties: z.optional( - z.array(ingest_types_user_agent_property).register(z.globalRegistry, { - description: 'Controls what properties are added to `target_field`.', - }) - ), - extract_device_type: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Extracts device type from the user agent string on a best-effort basis.', - }) - ), - }) -); + properties: z.optional(z.array(ingest_types_user_agent_property).register(z.globalRegistry, { + description: 'Controls what properties are added to `target_field`.' + })), + extract_device_type: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Extracts device type from the user agent string on a best-effort basis.' + })) +})); export const ml_types_analysis_config = z.object({ - bucket_span: z.optional(types_duration), - get categorization_analyzer() { - return z.optional(z.lazy((): any => ml_types_categorization_analyzer)); - }, - categorization_field_name: z.optional(types_field), - categorization_filters: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'If `categorization_field_name` is specified, you can also define optional filters. This property expects an array of regular expressions. The expressions are used to filter out matching sequences from the categorization field values. You can use this functionality to fine tune the categorization by excluding sequences from consideration when categories are defined. For example, you can exclude SQL statements that appear in your log files. This property cannot be used at the same time as `categorization_analyzer`. If you only want to define simple regular expression filters that are applied prior to tokenization, setting this property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering, use the `categorization_analyzer` property instead and include the filters as pattern_replace character filters. The effect is exactly the same.', - }) - ), - detectors: z.array(ml_types_detector).register(z.globalRegistry, { - description: - 'Detector configuration objects specify which data fields a job analyzes. They also specify which analytical functions are used. You can specify multiple detectors for a job. If the detectors array does not contain at least one detector, no analysis can occur and an error is returned.', - }), - influencers: z.optional( - z.array(types_field).register(z.globalRegistry, { - description: - 'A comma separated list of influencer field names. Typically these can be the by, over, or partition fields that are used in the detector configuration. You might also want to use a field name that is not specifically named in a detector, but is available as part of the input data. When you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity.', - }) - ), - latency: z.optional(types_duration), - model_prune_window: z.optional(types_duration), - multivariate_by_fields: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'This functionality is reserved for internal use. It is not supported for use in customer environments and is not subject to the support SLA of official GA features. If set to `true`, the analysis will automatically find correlations between metrics for a given by field value and report anomalies when those correlations cease to hold. For example, suppose CPU and memory usage on host A is usually highly correlated with the same metrics on host B. Perhaps this correlation occurs because they are running a load-balanced application. If you enable this property, anomalies will be reported when, for example, CPU usage on host A is high and the value of CPU usage on host B is low. That is to say, you’ll see an anomaly when the CPU of host A is unusual given the CPU of host B. To use the `multivariate_by_fields` property, you must also specify `by_field_name` in your detector.', - }) - ), - per_partition_categorization: z.optional(ml_types_per_partition_categorization), - summary_count_field_name: z.optional(types_field), + bucket_span: z.optional(types_duration), + get categorization_analyzer() { + return z.optional(z.lazy((): any => ml_types_categorization_analyzer)); + }, + categorization_field_name: z.optional(types_field), + categorization_filters: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'If `categorization_field_name` is specified, you can also define optional filters. This property expects an array of regular expressions. The expressions are used to filter out matching sequences from the categorization field values. You can use this functionality to fine tune the categorization by excluding sequences from consideration when categories are defined. For example, you can exclude SQL statements that appear in your log files. This property cannot be used at the same time as `categorization_analyzer`. If you only want to define simple regular expression filters that are applied prior to tokenization, setting this property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering, use the `categorization_analyzer` property instead and include the filters as pattern_replace character filters. The effect is exactly the same.' + })), + detectors: z.array(ml_types_detector).register(z.globalRegistry, { + description: 'Detector configuration objects specify which data fields a job analyzes. They also specify which analytical functions are used. You can specify multiple detectors for a job. If the detectors array does not contain at least one detector, no analysis can occur and an error is returned.' + }), + influencers: z.optional(z.array(types_field).register(z.globalRegistry, { + description: 'A comma separated list of influencer field names. Typically these can be the by, over, or partition fields that are used in the detector configuration. You might also want to use a field name that is not specifically named in a detector, but is available as part of the input data. When you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity.' + })), + latency: z.optional(types_duration), + model_prune_window: z.optional(types_duration), + multivariate_by_fields: z.optional(z.boolean().register(z.globalRegistry, { + description: 'This functionality is reserved for internal use. It is not supported for use in customer environments and is not subject to the support SLA of official GA features. If set to `true`, the analysis will automatically find correlations between metrics for a given by field value and report anomalies when those correlations cease to hold. For example, suppose CPU and memory usage on host A is usually highly correlated with the same metrics on host B. Perhaps this correlation occurs because they are running a load-balanced application. If you enable this property, anomalies will be reported when, for example, CPU usage on host A is high and the value of CPU usage on host B is low. That is to say, you’ll see an anomaly when the CPU of host A is unusual given the CPU of host B. To use the `multivariate_by_fields` property, you must also specify `by_field_name` in your detector.' + })), + per_partition_categorization: z.optional(ml_types_per_partition_categorization), + summary_count_field_name: z.optional(types_field) }); export const ml_types_categorization_analyzer = z.union([ - z.string(), - z.lazy((): any => ml_types_categorization_analyzer_definition), + z.string(), + z.lazy((): any => ml_types_categorization_analyzer_definition) ]); export const ml_types_categorization_analyzer_definition = z.object({ - char_filter: z.optional( - z.array(types_analysis_char_filter).register(z.globalRegistry, { - description: - 'One or more character filters. In addition to the built-in character filters, other plugins can provide more character filters. If this property is not specified, no character filters are applied prior to categorization. If you are customizing some other aspect of the analyzer and you need to achieve the equivalent of `categorization_filters` (which are not permitted when some other aspect of the analyzer is customized), add them here as pattern replace character filters.', - }) - ), - filter: z.optional( - z.array(types_analysis_token_filter).register(z.globalRegistry, { - description: - 'One or more token filters. In addition to the built-in token filters, other plugins can provide more token filters. If this property is not specified, no token filters are applied prior to categorization.', - }) - ), - tokenizer: z.optional(types_analysis_tokenizer), + char_filter: z.optional(z.array(types_analysis_char_filter).register(z.globalRegistry, { + description: 'One or more character filters. In addition to the built-in character filters, other plugins can provide more character filters. If this property is not specified, no character filters are applied prior to categorization. If you are customizing some other aspect of the analyzer and you need to achieve the equivalent of `categorization_filters` (which are not permitted when some other aspect of the analyzer is customized), add them here as pattern replace character filters.' + })), + filter: z.optional(z.array(types_analysis_token_filter).register(z.globalRegistry, { + description: 'One or more token filters. In addition to the built-in token filters, other plugins can provide more token filters. If this property is not specified, no token filters are applied prior to categorization.' + })), + tokenizer: z.optional(types_analysis_tokenizer) }); export const ml_types_dataframe_analytics_source = z.object({ - index: types_indices, - query: z.optional(types_query_dsl_query_container), - runtime_mappings: z.optional(types_mapping_runtime_fields), - _source: z.optional(ml_types_dataframe_analysis_analyzed_fields), + index: types_indices, + query: z.optional(types_query_dsl_query_container), + runtime_mappings: z.optional(types_mapping_runtime_fields), + _source: z.optional(ml_types_dataframe_analysis_analyzed_fields) }); export const ml_types_dataframe_analytics_summary = z.object({ - allow_lazy_start: z.optional(z.boolean()), - analysis: ml_types_dataframe_analysis_container, - analyzed_fields: z.optional(ml_types_dataframe_analysis_analyzed_fields), - authorization: z.optional(ml_types_dataframe_analytics_authorization), - create_time: z.optional(types_epoch_time_unit_millis), - description: z.optional(z.string()), - dest: ml_types_dataframe_analytics_destination, - id: types_id, - max_num_threads: z.optional(z.number()), - model_memory_limit: z.optional(z.string()), - source: ml_types_dataframe_analytics_source, - version: z.optional(types_version_string), - _meta: z.optional(types_metadata), + allow_lazy_start: z.optional(z.boolean()), + analysis: ml_types_dataframe_analysis_container, + analyzed_fields: z.optional(ml_types_dataframe_analysis_analyzed_fields), + authorization: z.optional(ml_types_dataframe_analytics_authorization), + create_time: z.optional(types_epoch_time_unit_millis), + description: z.optional(z.string()), + dest: ml_types_dataframe_analytics_destination, + id: types_id, + max_num_threads: z.optional(z.number()), + model_memory_limit: z.optional(z.string()), + source: ml_types_dataframe_analytics_source, + version: z.optional(types_version_string), + _meta: z.optional(types_metadata) }); export const ml_types_datafeed = z.object({ - aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container)), - authorization: z.optional(ml_types_datafeed_authorization), - chunking_config: z.optional(ml_types_chunking_config), - datafeed_id: types_id, - frequency: z.optional(types_duration), - indices: z.array(z.string()), - indexes: z.optional(z.array(z.string())), - job_id: types_id, - max_empty_searches: z.optional(z.number()), - query: types_query_dsl_query_container, - query_delay: z.optional(types_duration), - script_fields: z.optional(z.record(z.string(), types_script_field)), - scroll_size: z.optional(z.number()), - delayed_data_check_config: ml_types_delayed_data_check_config, - runtime_mappings: z.optional(types_mapping_runtime_fields), - indices_options: z.optional(types_indices_options), + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container)), + authorization: z.optional(ml_types_datafeed_authorization), + chunking_config: z.optional(ml_types_chunking_config), + datafeed_id: types_id, + frequency: z.optional(types_duration), + indices: z.array(z.string()), + indexes: z.optional(z.array(z.string())), + job_id: types_id, + max_empty_searches: z.optional(z.number()), + query: types_query_dsl_query_container, + query_delay: z.optional(types_duration), + script_fields: z.optional(z.record(z.string(), types_script_field)), + scroll_size: z.optional(z.number()), + delayed_data_check_config: ml_types_delayed_data_check_config, + runtime_mappings: z.optional(types_mapping_runtime_fields), + indices_options: z.optional(types_indices_options) }); export const ml_types_job = z.object({ - allow_lazy_open: z.boolean().register(z.globalRegistry, { - description: - 'Advanced configuration option.\nSpecifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node.', - }), - analysis_config: ml_types_analysis_config, - analysis_limits: z.optional(ml_types_analysis_limits), - background_persist_interval: z.optional(types_duration), - blocked: z.optional(ml_types_job_blocked), - create_time: z.optional(types_date_time), - custom_settings: z.optional(ml_types_custom_settings), - daily_model_snapshot_retention_after_days: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option, which affects the automatic removal of old model snapshots for this job.\nIt specifies a period of time (in days) after which only the first snapshot per day is retained.\nThis period is relative to the timestamp of the most recent snapshot for this job.\nValid values range from 0 to `model_snapshot_retention_days`.', - }) - ), - data_description: ml_types_data_description, - datafeed_config: z.optional(ml_types_datafeed), - deleting: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates that the process of deleting the job is in progress but not yet completed.\nIt is only reported when `true`.', - }) - ), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the job.', - }) - ), - finished_time: z.optional(types_date_time), - groups: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'A list of job groups.\nA job can belong to no groups or many.', - }) - ), - job_id: types_id, - job_type: z.optional( - z.string().register(z.globalRegistry, { - description: 'Reserved for future use, currently set to `anomaly_detector`.', - }) - ), - job_version: z.optional(types_version_string), - model_plot_config: z.optional(ml_types_model_plot_config), - model_snapshot_id: z.optional(types_id), - model_snapshot_retention_days: z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option, which affects the automatic removal of old model snapshots for this job.\nIt specifies the maximum period of time (in days) that snapshots are retained.\nThis period is relative to the timestamp of the most recent snapshot for this job.\nBy default, snapshots ten days older than the newest snapshot are deleted.', - }), - renormalization_window_days: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option.\nThe period over which adjustments to the score are applied, as new data is seen.\nThe default value is the longer of 30 days or 100 `bucket_spans`.', - }) - ), - results_index_name: types_index_name, - results_retention_days: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option.\nThe period of time (in days) that results are retained.\nAge is calculated relative to the timestamp of the latest bucket result.\nIf this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch.\nThe default value is null, which means all results are retained.\nAnnotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results.\nAnnotations added by users are retained forever.', - }) - ), + allow_lazy_open: z.boolean().register(z.globalRegistry, { + description: 'Advanced configuration option.\nSpecifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node.' + }), + analysis_config: ml_types_analysis_config, + analysis_limits: z.optional(ml_types_analysis_limits), + background_persist_interval: z.optional(types_duration), + blocked: z.optional(ml_types_job_blocked), + create_time: z.optional(types_date_time), + custom_settings: z.optional(ml_types_custom_settings), + daily_model_snapshot_retention_after_days: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option, which affects the automatic removal of old model snapshots for this job.\nIt specifies a period of time (in days) after which only the first snapshot per day is retained.\nThis period is relative to the timestamp of the most recent snapshot for this job.\nValid values range from 0 to `model_snapshot_retention_days`.' + })), + data_description: ml_types_data_description, + datafeed_config: z.optional(ml_types_datafeed), + deleting: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates that the process of deleting the job is in progress but not yet completed.\nIt is only reported when `true`.' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the job.' + })), + finished_time: z.optional(types_date_time), + groups: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A list of job groups.\nA job can belong to no groups or many.' + })), + job_id: types_id, + job_type: z.optional(z.string().register(z.globalRegistry, { + description: 'Reserved for future use, currently set to `anomaly_detector`.' + })), + job_version: z.optional(types_version_string), + model_plot_config: z.optional(ml_types_model_plot_config), + model_snapshot_id: z.optional(types_id), + model_snapshot_retention_days: z.number().register(z.globalRegistry, { + description: 'Advanced configuration option, which affects the automatic removal of old model snapshots for this job.\nIt specifies the maximum period of time (in days) that snapshots are retained.\nThis period is relative to the timestamp of the most recent snapshot for this job.\nBy default, snapshots ten days older than the newest snapshot are deleted.' + }), + renormalization_window_days: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option.\nThe period over which adjustments to the score are applied, as new data is seen.\nThe default value is the longer of 30 days or 100 `bucket_spans`.' + })), + results_index_name: types_index_name, + results_retention_days: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option.\nThe period of time (in days) that results are retained.\nAge is calculated relative to the timestamp of the latest bucket result.\nIf this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch.\nThe default value is null, which means all results are retained.\nAnnotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results.\nAnnotations added by users are retained forever.' + })) }); export const ml_types_trained_model_config = z.object({ - model_id: types_id, - model_type: z.optional(ml_types_trained_model_type), - tags: z.array(z.string()).register(z.globalRegistry, { - description: 'A comma delimited string of tags. A trained model can have many tags, or none.', - }), - version: z.optional(types_version_string), - compressed_definition: z.optional(z.string()), - created_by: z.optional( - z.string().register(z.globalRegistry, { - description: 'Information on the creator of the trained model.', - }) - ), - create_time: z.optional(types_date_time), - default_field_map: z.optional( - z.record(z.string(), z.string()).register(z.globalRegistry, { - description: 'Any field map described in the inference configuration takes precedence.', - }) - ), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'The free-text description of the trained model.', - }) - ), - estimated_heap_memory_usage_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: 'The estimated heap usage in bytes to keep the trained model in memory.', - }) - ), - estimated_operations: z.optional( - z.number().register(z.globalRegistry, { - description: 'The estimated number of operations to use the trained model.', - }) - ), - fully_defined: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'True if the full model definition is present.', - }) - ), - get inference_config() { - return z.optional(z.lazy((): any => ml_types_inference_config_create_container)); - }, - input: ml_types_trained_model_config_input, - license_level: z.optional( - z.string().register(z.globalRegistry, { - description: 'The license level of the trained model.', - }) - ), - metadata: z.optional(ml_types_trained_model_config_metadata), - model_size_bytes: z.optional(types_byte_size), - model_package: z.optional(ml_types_model_package_config), - location: z.optional(ml_types_trained_model_location), - platform_architecture: z.optional(z.string()), - prefix_strings: z.optional(ml_types_trained_model_prefix_strings), + model_id: types_id, + model_type: z.optional(ml_types_trained_model_type), + tags: z.array(z.string()).register(z.globalRegistry, { + description: 'A comma delimited string of tags. A trained model can have many tags, or none.' + }), + version: z.optional(types_version_string), + compressed_definition: z.optional(z.string()), + created_by: z.optional(z.string().register(z.globalRegistry, { + description: 'Information on the creator of the trained model.' + })), + create_time: z.optional(types_date_time), + default_field_map: z.optional(z.record(z.string(), z.string()).register(z.globalRegistry, { + description: 'Any field map described in the inference configuration takes precedence.' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'The free-text description of the trained model.' + })), + estimated_heap_memory_usage_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'The estimated heap usage in bytes to keep the trained model in memory.' + })), + estimated_operations: z.optional(z.number().register(z.globalRegistry, { + description: 'The estimated number of operations to use the trained model.' + })), + fully_defined: z.optional(z.boolean().register(z.globalRegistry, { + description: 'True if the full model definition is present.' + })), + get inference_config() { + return z.optional(z.lazy((): any => ml_types_inference_config_create_container)); + }, + input: ml_types_trained_model_config_input, + license_level: z.optional(z.string().register(z.globalRegistry, { + description: 'The license level of the trained model.' + })), + metadata: z.optional(ml_types_trained_model_config_metadata), + model_size_bytes: z.optional(types_byte_size), + model_package: z.optional(ml_types_model_package_config), + location: z.optional(ml_types_trained_model_location), + platform_architecture: z.optional(z.string()), + prefix_strings: z.optional(ml_types_trained_model_prefix_strings) }); /** * Inference configuration provided when storing the model config */ -export const ml_types_inference_config_create_container = z - .object({ +export const ml_types_inference_config_create_container = z.object({ regression: z.optional(ml_types_regression_inference_options), classification: z.optional(ml_types_classification_inference_options), text_classification: z.optional(ml_types_text_classification_inference_options), zero_shot_classification: z.optional(ml_types_zero_shot_classification_inference_options), fill_mask: z.optional(ml_types_fill_mask_inference_options), get learning_to_rank() { - return z.optional(z.lazy((): any => ml_types_learning_to_rank_config)); + return z.optional(z.lazy((): any => ml_types_learning_to_rank_config)); }, ner: z.optional(ml_types_ner_inference_options), pass_through: z.optional(ml_types_pass_through_inference_options), text_embedding: z.optional(ml_types_text_embedding_inference_options), text_expansion: z.optional(ml_types_text_expansion_inference_options), - question_answering: z.optional(ml_types_question_answering_inference_options), - }) - .register(z.globalRegistry, { - description: 'Inference configuration provided when storing the model config', - }); + question_answering: z.optional(ml_types_question_answering_inference_options) +}).register(z.globalRegistry, { + description: 'Inference configuration provided when storing the model config' +}); export const ml_types_learning_to_rank_config = z.object({ - default_params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - get feature_extractors() { - return z.optional( - z.array( - z.record( - z.string(), - z.lazy((): any => ml_types_feature_extractor) - ) - ) - ); - }, - num_top_feature_importance_values: z.number(), + default_params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + get feature_extractors() { + return z.optional(z.array(z.record(z.string(), z.lazy((): any => ml_types_feature_extractor)))); + }, + num_top_feature_importance_values: z.number() }); export const ml_types_feature_extractor = z.lazy((): any => ml_types_query_feature_extractor); export const ml_types_query_feature_extractor = z.object({ - default_score: z.optional(z.number()), - feature_name: z.string(), - query: types_query_dsl_query_container, + default_score: z.optional(z.number()), + feature_name: z.string(), + query: types_query_dsl_query_container }); export const ml_info_defaults = z.object({ - get anomaly_detectors() { - return z.lazy((): any => ml_info_anomaly_detectors); - }, - datafeeds: ml_info_datafeeds, + get anomaly_detectors() { + return z.lazy((): any => ml_info_anomaly_detectors); + }, + datafeeds: ml_info_datafeeds }); export const ml_info_anomaly_detectors = z.object({ - categorization_analyzer: ml_types_categorization_analyzer, - categorization_examples_limit: z.number(), - model_memory_limit: z.string(), - model_snapshot_retention_days: z.number(), - daily_model_snapshot_retention_after_days: z.number(), + categorization_analyzer: ml_types_categorization_analyzer, + categorization_examples_limit: z.number(), + model_memory_limit: z.string(), + model_snapshot_retention_days: z.number(), + daily_model_snapshot_retention_after_days: z.number() }); export const ml_preview_data_frame_analytics_dataframe_preview_config = z.object({ - source: ml_types_dataframe_analytics_source, - analysis: ml_types_dataframe_analysis_container, - model_memory_limit: z.optional(z.string()), - max_num_threads: z.optional(z.number()), - analyzed_fields: z.optional(ml_types_dataframe_analysis_analyzed_fields), + source: ml_types_dataframe_analytics_source, + analysis: ml_types_dataframe_analysis_container, + model_memory_limit: z.optional(z.string()), + max_num_threads: z.optional(z.number()), + analyzed_fields: z.optional(ml_types_dataframe_analysis_analyzed_fields) }); export const ml_types_datafeed_config = z.object({ - aggregations: z.optional( - z.record(z.string(), types_aggregations_aggregation_container).register(z.globalRegistry, { - description: - 'If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data.', - }) - ), - chunking_config: z.optional(ml_types_chunking_config), - datafeed_id: z.optional(types_id), - delayed_data_check_config: z.optional(ml_types_delayed_data_check_config), - frequency: z.optional(types_duration), - indices: z.optional(types_indices), - indices_options: z.optional(types_indices_options), - job_id: z.optional(types_id), - max_empty_searches: z.optional( - z.number().register(z.globalRegistry, { - description: - 'If a real-time datafeed has never seen any data (including during any initial training period) then it will automatically stop itself and close its associated job after this many real-time searches that return no documents. In other words, it will stop after `frequency` times `max_empty_searches` of real-time operation. If not set then a datafeed with no end time that sees no data will remain started until it is explicitly stopped.', - }) - ), - query: z.optional(types_query_dsl_query_container), - query_delay: z.optional(types_duration), - runtime_mappings: z.optional(types_mapping_runtime_fields), - script_fields: z.optional( - z.record(z.string(), types_script_field).register(z.globalRegistry, { - description: - 'Specifies scripts that evaluate custom expressions and returns script fields to the datafeed. The detector configuration objects in a job can contain functions that use these script fields.', - }) - ), - scroll_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations. The maximum value is the value of `index.max_result_window`, which is 10,000 by default.', - }) - ), + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container).register(z.globalRegistry, { + description: 'If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data.' + })), + chunking_config: z.optional(ml_types_chunking_config), + datafeed_id: z.optional(types_id), + delayed_data_check_config: z.optional(ml_types_delayed_data_check_config), + frequency: z.optional(types_duration), + indices: z.optional(types_indices), + indices_options: z.optional(types_indices_options), + job_id: z.optional(types_id), + max_empty_searches: z.optional(z.number().register(z.globalRegistry, { + description: 'If a real-time datafeed has never seen any data (including during any initial training period) then it will automatically stop itself and close its associated job after this many real-time searches that return no documents. In other words, it will stop after `frequency` times `max_empty_searches` of real-time operation. If not set then a datafeed with no end time that sees no data will remain started until it is explicitly stopped.' + })), + query: z.optional(types_query_dsl_query_container), + query_delay: z.optional(types_duration), + runtime_mappings: z.optional(types_mapping_runtime_fields), + script_fields: z.optional(z.record(z.string(), types_script_field).register(z.globalRegistry, { + description: 'Specifies scripts that evaluate custom expressions and returns script fields to the datafeed. The detector configuration objects in a job can contain functions that use these script fields.' + })), + scroll_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations. The maximum value is the value of `index.max_result_window`, which is 10,000 by default.' + })) }); export const ml_types_job_config = z.object({ - allow_lazy_open: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node.', - }) - ), - analysis_config: ml_types_analysis_config, - analysis_limits: z.optional(ml_types_analysis_limits), - background_persist_interval: z.optional(types_duration), - custom_settings: z.optional(ml_types_custom_settings), - daily_model_snapshot_retention_after_days: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option, which affects the automatic removal of old model snapshots for this job.\nIt specifies a period of time (in days) after which only the first snapshot per day is retained.\nThis period is relative to the timestamp of the most recent snapshot for this job.', - }) - ), - data_description: ml_types_data_description, - datafeed_config: z.optional(ml_types_datafeed_config), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the job.', - }) - ), - groups: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'A list of job groups. A job can belong to no groups or many.', - }) - ), - job_id: z.optional(types_id), - model_plot_config: z.optional(ml_types_model_plot_config), - model_snapshot_retention_days: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option, which affects the automatic removal of old model snapshots for this job.\nIt specifies the maximum period of time (in days) that snapshots are retained.\nThis period is relative to the timestamp of the most recent snapshot for this job.\nThe default value is `10`, which means snapshots ten days older than the newest snapshot are deleted.', - }) - ), - renormalization_window_days: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option.\nThe period over which adjustments to the score are applied, as new data is seen.\nThe default value is the longer of 30 days or 100 `bucket_spans`.', - }) - ), - results_index_name: z.optional(types_index_name), - results_retention_days: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option.\nThe period of time (in days) that results are retained.\nAge is calculated relative to the timestamp of the latest bucket result.\nIf this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch.\nThe default value is null, which means all results are retained.\nAnnotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results.\nAnnotations added by users are retained forever.', - }) - ), + allow_lazy_open: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node.' + })), + analysis_config: ml_types_analysis_config, + analysis_limits: z.optional(ml_types_analysis_limits), + background_persist_interval: z.optional(types_duration), + custom_settings: z.optional(ml_types_custom_settings), + daily_model_snapshot_retention_after_days: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option, which affects the automatic removal of old model snapshots for this job.\nIt specifies a period of time (in days) after which only the first snapshot per day is retained.\nThis period is relative to the timestamp of the most recent snapshot for this job.' + })), + data_description: ml_types_data_description, + datafeed_config: z.optional(ml_types_datafeed_config), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the job.' + })), + groups: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A list of job groups. A job can belong to no groups or many.' + })), + job_id: z.optional(types_id), + model_plot_config: z.optional(ml_types_model_plot_config), + model_snapshot_retention_days: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option, which affects the automatic removal of old model snapshots for this job.\nIt specifies the maximum period of time (in days) that snapshots are retained.\nThis period is relative to the timestamp of the most recent snapshot for this job.\nThe default value is `10`, which means snapshots ten days older than the newest snapshot are deleted.' + })), + renormalization_window_days: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option.\nThe period over which adjustments to the score are applied, as new data is seen.\nThe default value is the longer of 30 days or 100 `bucket_spans`.' + })), + results_index_name: z.optional(types_index_name), + results_retention_days: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option.\nThe period of time (in days) that results are retained.\nAge is calculated relative to the timestamp of the latest bucket result.\nIf this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch.\nThe default value is null, which means all results are retained.\nAnnotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results.\nAnnotations added by users are retained forever.' + })) }); export const ml_types_analysis_config_read = z.object({ - bucket_span: types_duration, - categorization_analyzer: z.optional(ml_types_categorization_analyzer), - categorization_field_name: z.optional(types_field), - categorization_filters: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'If `categorization_field_name` is specified, you can also define optional filters.\nThis property expects an array of regular expressions.\nThe expressions are used to filter out matching sequences from the categorization field values.', - }) - ), - detectors: z.array(ml_types_detector_read).register(z.globalRegistry, { - description: - 'An array of detector configuration objects.\nDetector configuration objects specify which data fields a job analyzes.\nThey also specify which analytical functions are used.\nYou can specify multiple detectors for a job.', - }), - influencers: z.array(types_field).register(z.globalRegistry, { - description: - 'A comma separated list of influencer field names.\nTypically these can be the by, over, or partition fields that are used in the detector configuration.\nYou might also want to use a field name that is not specifically named in a detector, but is available as part of the input data.\nWhen you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity.', - }), - model_prune_window: z.optional(types_duration), - latency: z.optional(types_duration), - multivariate_by_fields: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'This functionality is reserved for internal use.\nIt is not supported for use in customer environments and is not subject to the support SLA of official GA features.\nIf set to `true`, the analysis will automatically find correlations between metrics for a given by field value and report anomalies when those correlations cease to hold.', - }) - ), - per_partition_categorization: z.optional(ml_types_per_partition_categorization), - summary_count_field_name: z.optional(types_field), + bucket_span: types_duration, + categorization_analyzer: z.optional(ml_types_categorization_analyzer), + categorization_field_name: z.optional(types_field), + categorization_filters: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'If `categorization_field_name` is specified, you can also define optional filters.\nThis property expects an array of regular expressions.\nThe expressions are used to filter out matching sequences from the categorization field values.' + })), + detectors: z.array(ml_types_detector_read).register(z.globalRegistry, { + description: 'An array of detector configuration objects.\nDetector configuration objects specify which data fields a job analyzes.\nThey also specify which analytical functions are used.\nYou can specify multiple detectors for a job.' + }), + influencers: z.array(types_field).register(z.globalRegistry, { + description: 'A comma separated list of influencer field names.\nTypically these can be the by, over, or partition fields that are used in the detector configuration.\nYou might also want to use a field name that is not specifically named in a detector, but is available as part of the input data.\nWhen you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity.' + }), + model_prune_window: z.optional(types_duration), + latency: z.optional(types_duration), + multivariate_by_fields: z.optional(z.boolean().register(z.globalRegistry, { + description: 'This functionality is reserved for internal use.\nIt is not supported for use in customer environments and is not subject to the support SLA of official GA features.\nIf set to `true`, the analysis will automatically find correlations between metrics for a given by field value and report anomalies when those correlations cease to hold.' + })), + per_partition_categorization: z.optional(ml_types_per_partition_categorization), + summary_count_field_name: z.optional(types_field) }); export const ml_put_trained_model_definition = z.object({ - preprocessors: z.optional( - z.array(ml_put_trained_model_preprocessor).register(z.globalRegistry, { - description: 'Collection of preprocessors', - }) - ), - get trained_model() { - return z.lazy((): any => ml_put_trained_model_trained_model); - }, + preprocessors: z.optional(z.array(ml_put_trained_model_preprocessor).register(z.globalRegistry, { + description: 'Collection of preprocessors' + })), + get trained_model() { + return z.lazy((): any => ml_put_trained_model_trained_model); + } }); export const ml_put_trained_model_trained_model = z.object({ - tree: z.optional(ml_put_trained_model_trained_model_tree), - tree_node: z.optional(ml_put_trained_model_trained_model_tree_node), - get ensemble() { - return z.optional(z.lazy((): any => ml_put_trained_model_ensemble)); - }, + tree: z.optional(ml_put_trained_model_trained_model_tree), + tree_node: z.optional(ml_put_trained_model_trained_model_tree_node), + get ensemble() { + return z.optional(z.lazy((): any => ml_put_trained_model_ensemble)); + } }); export const ml_put_trained_model_ensemble = z.object({ - aggregate_output: z.optional(ml_put_trained_model_aggregate_output), - classification_labels: z.optional(z.array(z.string())), - feature_names: z.optional(z.array(z.string())), - target_type: z.optional(z.string()), - trained_models: z.array(ml_put_trained_model_trained_model), + aggregate_output: z.optional(ml_put_trained_model_aggregate_output), + classification_labels: z.optional(z.array(z.string())), + feature_names: z.optional(z.array(z.string())), + target_type: z.optional(z.string()), + trained_models: z.array(ml_put_trained_model_trained_model) }); export const global_msearch_multi_search_result = z.object({ - took: z.number(), - responses: z.array(global_msearch_response_item), + took: z.number(), + responses: z.array(global_msearch_response_item) }); export const global_msearch_template_request_item = z.union([ - global_msearch_multisearch_header, - z.lazy((): any => global_msearch_template_template_config), + global_msearch_multisearch_header, + z.lazy((): any => global_msearch_template_template_config) ]); export const global_msearch_template_template_config = z.object({ - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, returns detailed information about score calculation as part of each hit.', - }) - ), - id: z.optional(types_id), - params: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'Key-value pairs used to replace Mustache variables in the template.\nThe key is the variable name.\nThe value is the variable value.', - }) - ), - profile: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the query execution is profiled.', - }) - ), - source: z.optional(types_script_source), -}); - -export const nodes_stats_response_base = nodes_types_nodes_response_base.and( - z.lazy(() => - z.object({ - cluster_name: z.optional(types_name), - get nodes() { - return z.record( - z.string(), - z.lazy((): any => nodes_types_stats) - ); - }, - }) - ) -); + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns detailed information about score calculation as part of each hit.' + })), + id: z.optional(types_id), + params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Key-value pairs used to replace Mustache variables in the template.\nThe key is the variable name.\nThe value is the variable value.' + })), + profile: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the query execution is profiled.' + })), + source: z.optional(types_script_source) +}); + +export const nodes_stats_response_base = nodes_types_nodes_response_base.and(z.lazy(() => z.object({ + cluster_name: z.optional(types_name), + get nodes() { + return z.record(z.string(), z.lazy((): any => nodes_types_stats)); + } +}))); export const nodes_types_stats = z.object({ - adaptive_selection: z.optional( - z.record(z.string(), nodes_types_adaptive_selection).register(z.globalRegistry, { - description: 'Statistics about adaptive replica selection.', - }) - ), - breakers: z.optional( - z.record(z.string(), nodes_types_breaker).register(z.globalRegistry, { - description: 'Statistics about the field data circuit breaker.', - }) - ), - fs: z.optional(nodes_types_file_system), - host: z.optional(types_host), - http: z.optional(nodes_types_http), - ingest: z.optional(nodes_types_ingest), - ip: z.optional(z.union([types_ip, z.array(types_ip)])), - jvm: z.optional(nodes_types_jvm), - name: z.optional(types_name), - os: z.optional(nodes_types_operating_system), - process: z.optional(nodes_types_process), - roles: z.optional(types_node_roles), - script: z.optional(nodes_types_scripting), - script_cache: z.optional( - z.record(z.string(), z.union([nodes_types_script_cache, z.array(nodes_types_script_cache)])) - ), - thread_pool: z.optional( - z.record(z.string(), nodes_types_thread_count).register(z.globalRegistry, { - description: - 'Statistics about each thread pool, including current size, queue and rejected tasks.', - }) - ), - timestamp: z.optional(z.number()), - transport: z.optional(nodes_types_transport), - transport_address: z.optional(types_transport_address), - attributes: z.optional( - z.record(z.string(), z.string()).register(z.globalRegistry, { - description: 'Contains a list of attributes for the node.', - }) - ), - discovery: z.optional(nodes_types_discovery), - indexing_pressure: z.optional(nodes_types_indexing_pressure), - indices: z.optional(indices_stats_shard_stats), + adaptive_selection: z.optional(z.record(z.string(), nodes_types_adaptive_selection).register(z.globalRegistry, { + description: 'Statistics about adaptive replica selection.' + })), + breakers: z.optional(z.record(z.string(), nodes_types_breaker).register(z.globalRegistry, { + description: 'Statistics about the field data circuit breaker.' + })), + fs: z.optional(nodes_types_file_system), + host: z.optional(types_host), + http: z.optional(nodes_types_http), + ingest: z.optional(nodes_types_ingest), + ip: z.optional(z.union([ + types_ip, + z.array(types_ip) + ])), + jvm: z.optional(nodes_types_jvm), + name: z.optional(types_name), + os: z.optional(nodes_types_operating_system), + process: z.optional(nodes_types_process), + roles: z.optional(types_node_roles), + script: z.optional(nodes_types_scripting), + script_cache: z.optional(z.record(z.string(), z.union([ + nodes_types_script_cache, + z.array(nodes_types_script_cache) + ]))), + thread_pool: z.optional(z.record(z.string(), nodes_types_thread_count).register(z.globalRegistry, { + description: 'Statistics about each thread pool, including current size, queue and rejected tasks.' + })), + timestamp: z.optional(z.number()), + transport: z.optional(nodes_types_transport), + transport_address: z.optional(types_transport_address), + attributes: z.optional(z.record(z.string(), z.string()).register(z.globalRegistry, { + description: 'Contains a list of attributes for the node.' + })), + discovery: z.optional(nodes_types_discovery), + indexing_pressure: z.optional(nodes_types_indexing_pressure), + indices: z.optional(indices_stats_shard_stats) }); export const global_rank_eval_rank_eval_request_item = z.object({ - id: types_id, - get request() { - return z.optional(z.lazy((): any => global_rank_eval_rank_eval_query)); - }, - ratings: z.array(global_rank_eval_document_rating).register(z.globalRegistry, { - description: 'List of document ratings', - }), - template_id: z.optional(types_id), - params: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'The search template parameters.', - }) - ), + id: types_id, + get request() { + return z.optional(z.lazy((): any => global_rank_eval_rank_eval_query)); + }, + ratings: z.array(global_rank_eval_document_rating).register(z.globalRegistry, { + description: 'List of document ratings' + }), + template_id: z.optional(types_id), + params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'The search template parameters.' + })) }); export const global_rank_eval_rank_eval_query = z.object({ - query: types_query_dsl_query_container, - size: z.optional(z.number()), + query: types_query_dsl_query_container, + size: z.optional(z.number()) }); export const global_reindex_source = z.object({ - index: types_indices, - query: z.optional(types_query_dsl_query_container), - remote: z.optional(global_reindex_remote_source), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of documents to index per batch.\nUse it when you are indexing from remote to ensure that the batches fit within the on-heap buffer, which defaults to a maximum size of 100 MB.', - }) - ), - slice: z.optional(types_sliced_scroll), - sort: z.optional(types_sort), - _source: z.optional(global_search_types_source_config), - runtime_mappings: z.optional(types_mapping_runtime_fields), + index: types_indices, + query: z.optional(types_query_dsl_query_container), + remote: z.optional(global_reindex_remote_source), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of documents to index per batch.\nUse it when you are indexing from remote to ensure that the batches fit within the on-heap buffer, which defaults to a maximum size of 100 MB.' + })), + slice: z.optional(types_sliced_scroll), + sort: z.optional(types_sort), + _source: z.optional(global_search_types_source_config), + runtime_mappings: z.optional(types_mapping_runtime_fields) }); export const global_scripts_painless_execute_painless_context_setup = z.object({ - document: z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: "Document that's temporarily indexed in-memory and accessible from the script.", - }), - index: types_index_name, - query: z.optional(types_query_dsl_query_container), + document: z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'Document that\'s temporarily indexed in-memory and accessible from the script.' + }), + index: types_index_name, + query: z.optional(types_query_dsl_query_container) }); -export const search_application_types_search_application = z - .lazy((): any => search_application_types_search_application_parameters) - .and( - z.object({ - name: types_name, - updated_at_millis: types_epoch_time_unit_millis, - }) - ); +export const search_application_types_search_application = z.lazy((): any => search_application_types_search_application_parameters).and(z.object({ + name: types_name, + updated_at_millis: types_epoch_time_unit_millis +})); export const search_application_types_search_application_parameters = z.object({ - indices: z.array(types_index_name).register(z.globalRegistry, { - description: 'Indices that are part of the Search Application.', - }), - analytics_collection_name: z.optional(types_name), - get template() { - return z.optional(z.lazy((): any => search_application_types_search_application_template)); - }, + indices: z.array(types_index_name).register(z.globalRegistry, { + description: 'Indices that are part of the Search Application.' + }), + analytics_collection_name: z.optional(types_name), + get template() { + return z.optional(z.lazy((): any => search_application_types_search_application_template)); + } }); export const search_application_types_search_application_template = z.object({ - script: types_script, + script: types_script }); export const global_search_shards_shard_store_index = z.object({ - aliases: z.optional(z.array(types_name)), - filter: z.optional(types_query_dsl_query_container), + aliases: z.optional(z.array(types_name)), + filter: z.optional(types_query_dsl_query_container) }); export const security_types_role_descriptor = z.object({ - cluster: z.optional( - z.array(security_types_cluster_privilege).register(z.globalRegistry, { - description: - 'A list of cluster privileges. These privileges define the cluster level actions that API keys are able to execute.', - }) - ), - get indices() { - return z.optional( - z.array(z.lazy((): any => security_types_indices_privileges)).register(z.globalRegistry, { - description: 'A list of indices permissions entries.', - }) - ); - }, - get remote_indices() { - return z.optional( - z - .array(z.lazy((): any => security_types_remote_indices_privileges)) - .register(z.globalRegistry, { - description: 'A list of indices permissions for remote clusters.', - }) - ); - }, - remote_cluster: z.optional( - z.array(security_types_remote_cluster_privileges).register(z.globalRegistry, { - description: - 'A list of cluster permissions for remote clusters.\nNOTE: This is limited a subset of the cluster permissions.', - }) - ), - global: z.optional( - z.union([z.array(security_types_global_privilege), security_types_global_privilege]) - ), - applications: z.optional( - z.array(security_types_application_privileges).register(z.globalRegistry, { - description: 'A list of application privilege entries', - }) - ), - metadata: z.optional(types_metadata), - run_as: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'A list of users that the API keys can impersonate.\nNOTE: In Elastic Cloud Serverless, the run-as feature is disabled.\nFor API compatibility, you can still specify an empty `run_as` field, but a non-empty list will be rejected.', - }) - ), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'Optional description of the role descriptor', - }) - ), - restriction: z.optional(security_types_restriction), - transient_metadata: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + cluster: z.optional(z.array(security_types_cluster_privilege).register(z.globalRegistry, { + description: 'A list of cluster privileges. These privileges define the cluster level actions that API keys are able to execute.' + })), + get indices() { + return z.optional(z.array(z.lazy((): any => security_types_indices_privileges)).register(z.globalRegistry, { + description: 'A list of indices permissions entries.' + })); + }, + get remote_indices() { + return z.optional(z.array(z.lazy((): any => security_types_remote_indices_privileges)).register(z.globalRegistry, { + description: 'A list of indices permissions for remote clusters.' + })); + }, + remote_cluster: z.optional(z.array(security_types_remote_cluster_privileges).register(z.globalRegistry, { + description: 'A list of cluster permissions for remote clusters.\nNOTE: This is limited a subset of the cluster permissions.' + })), + global: z.optional(z.union([ + z.array(security_types_global_privilege), + security_types_global_privilege + ])), + applications: z.optional(z.array(security_types_application_privileges).register(z.globalRegistry, { + description: 'A list of application privilege entries' + })), + metadata: z.optional(types_metadata), + run_as: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A list of users that the API keys can impersonate.\nNOTE: In Elastic Cloud Serverless, the run-as feature is disabled.\nFor API compatibility, you can still specify an empty `run_as` field, but a non-empty list will be rejected.' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Optional description of the role descriptor' + })), + restriction: z.optional(security_types_restriction), + transient_metadata: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))) }); export const security_types_indices_privileges = z.object({ - field_security: z.optional(security_types_field_security), - names: z.union([types_index_name, z.array(types_index_name)]), - privileges: z.array(security_types_index_privilege).register(z.globalRegistry, { - description: - 'The index level privileges that owners of the role have on the specified indices.', - }), - get query() { - return z.optional(z.lazy((): any => security_types_indices_privileges_query)); - }, - allow_restricted_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`.', - }) - ), + field_security: z.optional(security_types_field_security), + names: z.union([ + types_index_name, + z.array(types_index_name) + ]), + privileges: z.array(security_types_index_privilege).register(z.globalRegistry, { + description: 'The index level privileges that owners of the role have on the specified indices.' + }), + get query() { + return z.optional(z.lazy((): any => security_types_indices_privileges_query)); + }, + allow_restricted_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`.' + })) }); /** @@ -32051,473 +26075,361 @@ export const security_types_indices_privileges = z.object({ * Since this is embedded in `IndicesPrivileges`, the same structure is used for clarity in both contexts. */ export const security_types_indices_privileges_query = z.union([ - z.string(), - types_query_dsl_query_container, - z.lazy((): any => security_types_role_template_query), + z.string(), + types_query_dsl_query_container, + z.lazy((): any => security_types_role_template_query) ]); export const security_types_role_template_query = z.object({ - get template() { - return z.optional(z.lazy((): any => security_types_role_template_script)); - }, + get template() { + return z.optional(z.lazy((): any => security_types_role_template_script)); + } }); export const security_types_role_template_script = z.object({ - get source() { - return z.optional(z.lazy((): any => security_types_role_template_inline_query)); - }, - id: z.optional(types_id), - params: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'Specifies any named parameters that are passed into the script as variables.\nUse parameters instead of hard-coded values to decrease compile time.', - }) - ), - lang: z.optional(types_script_language), - options: z.optional(z.record(z.string(), z.string())), + get source() { + return z.optional(z.lazy((): any => security_types_role_template_inline_query)); + }, + id: z.optional(types_id), + params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Specifies any named parameters that are passed into the script as variables.\nUse parameters instead of hard-coded values to decrease compile time.' + })), + lang: z.optional(types_script_language), + options: z.optional(z.record(z.string(), z.string())) }); export const security_types_role_template_inline_query = z.union([ - z.string(), - types_query_dsl_query_container, + z.string(), + types_query_dsl_query_container ]); /** * The subset of index level privileges that can be defined for remote clusters. */ -export const security_types_remote_indices_privileges = z - .object({ +export const security_types_remote_indices_privileges = z.object({ clusters: types_names, field_security: z.optional(security_types_field_security), - names: z.union([types_index_name, z.array(types_index_name)]), + names: z.union([ + types_index_name, + z.array(types_index_name) + ]), privileges: z.array(security_types_index_privilege).register(z.globalRegistry, { - description: - 'The index level privileges that owners of the role have on the specified indices.', + description: 'The index level privileges that owners of the role have on the specified indices.' }), query: z.optional(security_types_indices_privileges_query), - allow_restricted_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`.', - }) - ), - }) - .register(z.globalRegistry, { - description: 'The subset of index level privileges that can be defined for remote clusters.', - }); + allow_restricted_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`.' + })) +}).register(z.globalRegistry, { + description: 'The subset of index level privileges that can be defined for remote clusters.' +}); export const security_types_access = z.object({ - replication: z.optional( - z.array(security_types_replication_access).register(z.globalRegistry, { - description: 'A list of indices permission entries for cross-cluster replication.', - }) - ), - get search() { - return z.optional( - z.array(z.lazy((): any => security_types_search_access)).register(z.globalRegistry, { - description: 'A list of indices permission entries for cross-cluster search.', - }) - ); - }, + replication: z.optional(z.array(security_types_replication_access).register(z.globalRegistry, { + description: 'A list of indices permission entries for cross-cluster replication.' + })), + get search() { + return z.optional(z.array(z.lazy((): any => security_types_search_access)).register(z.globalRegistry, { + description: 'A list of indices permission entries for cross-cluster search.' + })); + } }); export const security_types_search_access = z.object({ - field_security: z.optional(security_types_field_security), - names: z.union([types_index_name, z.array(types_index_name)]), - query: z.optional(security_types_indices_privileges_query), - allow_restricted_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`.', - }) - ), + field_security: z.optional(security_types_field_security), + names: z.union([ + types_index_name, + z.array(types_index_name) + ]), + query: z.optional(security_types_indices_privileges_query), + allow_restricted_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`.' + })) }); export const security_types_api_key = z.object({ - id: types_id, - name: types_name, - type: security_types_api_key_type, - creation: types_epoch_time_unit_millis, - expiration: z.optional(types_epoch_time_unit_millis), - invalidated: z.boolean().register(z.globalRegistry, { - description: - 'Invalidation status for the API key.\nIf the key has been invalidated, it has a value of `true`. Otherwise, it is `false`.', - }), - invalidation: z.optional(types_epoch_time_unit_millis), - username: types_username, - realm: z.string().register(z.globalRegistry, { - description: 'Realm name of the principal for which this API key was created.', - }), - realm_type: z.optional( - z.string().register(z.globalRegistry, { - description: 'Realm type of the principal for which this API key was created', - }) - ), - metadata: types_metadata, - role_descriptors: z.optional( - z.record(z.string(), security_types_role_descriptor).register(z.globalRegistry, { - description: - 'The role descriptors assigned to this API key when it was created or last updated.\nAn empty role descriptor means the API key inherits the owner user’s permissions.', - }) - ), - limited_by: z.optional( - z.array(z.record(z.string(), security_types_role_descriptor)).register(z.globalRegistry, { - description: - 'The owner user’s permissions associated with the API key.\nIt is a point-in-time snapshot captured at creation and subsequent updates.\nAn API key’s effective permissions are an intersection of its assigned privileges and the owner user’s permissions.', - }) - ), - access: z.optional(security_types_access), - certificate_identity: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The certificate identity associated with a cross-cluster API key.\nRestricts the API key to connections authenticated by a specific TLS certificate.\nOnly applicable to cross-cluster API keys.', - }) - ), - profile_uid: z.optional( - z.string().register(z.globalRegistry, { - description: 'The profile uid for the API key owner principal, if requested and if it exists', - }) - ), - _sort: z.optional(types_sort_results), + id: types_id, + name: types_name, + type: security_types_api_key_type, + creation: types_epoch_time_unit_millis, + expiration: z.optional(types_epoch_time_unit_millis), + invalidated: z.boolean().register(z.globalRegistry, { + description: 'Invalidation status for the API key.\nIf the key has been invalidated, it has a value of `true`. Otherwise, it is `false`.' + }), + invalidation: z.optional(types_epoch_time_unit_millis), + username: types_username, + realm: z.string().register(z.globalRegistry, { + description: 'Realm name of the principal for which this API key was created.' + }), + realm_type: z.optional(z.string().register(z.globalRegistry, { + description: 'Realm type of the principal for which this API key was created' + })), + metadata: types_metadata, + role_descriptors: z.optional(z.record(z.string(), security_types_role_descriptor).register(z.globalRegistry, { + description: 'The role descriptors assigned to this API key when it was created or last updated.\nAn empty role descriptor means the API key inherits the owner user’s permissions.' + })), + limited_by: z.optional(z.array(z.record(z.string(), security_types_role_descriptor)).register(z.globalRegistry, { + description: 'The owner user’s permissions associated with the API key.\nIt is a point-in-time snapshot captured at creation and subsequent updates.\nAn API key’s effective permissions are an intersection of its assigned privileges and the owner user’s permissions.' + })), + access: z.optional(security_types_access), + certificate_identity: z.optional(z.string().register(z.globalRegistry, { + description: 'The certificate identity associated with a cross-cluster API key.\nRestricts the API key to connections authenticated by a specific TLS certificate.\nOnly applicable to cross-cluster API keys.' + })), + profile_uid: z.optional(z.string().register(z.globalRegistry, { + description: 'The profile uid for the API key owner principal, if requested and if it exists' + })), + _sort: z.optional(types_sort_results) }); export const security_get_role_role = z.object({ - cluster: z.array(security_types_cluster_privilege), - indices: z.array(security_types_indices_privileges), - remote_indices: z.optional(z.array(security_types_remote_indices_privileges)), - remote_cluster: z.optional(z.array(security_types_remote_cluster_privileges)), - metadata: types_metadata, - description: z.optional(z.string()), - run_as: z.optional(z.array(z.string())), - transient_metadata: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - applications: z.array(security_types_application_privileges), - get role_templates() { - return z.optional(z.array(z.lazy((): any => security_types_role_template))); - }, - global: z.optional( - z.record(z.string(), z.record(z.string(), z.record(z.string(), z.array(z.string())))) - ), + cluster: z.array(security_types_cluster_privilege), + indices: z.array(security_types_indices_privileges), + remote_indices: z.optional(z.array(security_types_remote_indices_privileges)), + remote_cluster: z.optional(z.array(security_types_remote_cluster_privileges)), + metadata: types_metadata, + description: z.optional(z.string()), + run_as: z.optional(z.array(z.string())), + transient_metadata: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + applications: z.array(security_types_application_privileges), + get role_templates() { + return z.optional(z.array(z.lazy((): any => security_types_role_template))); + }, + global: z.optional(z.record(z.string(), z.record(z.string(), z.record(z.string(), z.array(z.string()))))) }); export const security_types_role_template = z.object({ - format: z.optional(security_types_template_format), - template: types_script, + format: z.optional(security_types_template_format), + template: types_script }); export const security_types_role_mapping = z.object({ - enabled: z.boolean(), - metadata: types_metadata, - roles: z.optional(z.array(z.string())), - role_templates: z.optional(z.array(security_types_role_template)), - rules: security_types_role_mapping_rule, + enabled: z.boolean(), + metadata: types_metadata, + roles: z.optional(z.array(z.string())), + role_templates: z.optional(z.array(security_types_role_template)), + rules: security_types_role_mapping_rule }); export const security_get_service_accounts_role_descriptor_wrapper = z.object({ - get role_descriptor() { - return z.lazy((): any => security_types_role_descriptor_read); - }, + get role_descriptor() { + return z.lazy((): any => security_types_role_descriptor_read); + } }); export const security_types_role_descriptor_read = z.object({ - cluster: z.array(security_types_cluster_privilege).register(z.globalRegistry, { - description: - 'A list of cluster privileges. These privileges define the cluster level actions that API keys are able to execute.', - }), - indices: z.array(security_types_indices_privileges).register(z.globalRegistry, { - description: 'A list of indices permissions entries.', - }), - remote_indices: z.optional( - z.array(security_types_remote_indices_privileges).register(z.globalRegistry, { - description: 'A list of indices permissions for remote clusters.', - }) - ), - remote_cluster: z.optional( - z.array(security_types_remote_cluster_privileges).register(z.globalRegistry, { - description: - 'A list of cluster permissions for remote clusters.\nNOTE: This is limited a subset of the cluster permissions.', - }) - ), - global: z.optional( - z.union([z.array(security_types_global_privilege), security_types_global_privilege]) - ), - applications: z.optional( - z.array(security_types_application_privileges).register(z.globalRegistry, { - description: 'A list of application privilege entries', - }) - ), - metadata: z.optional(types_metadata), - run_as: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'A list of users that the API keys can impersonate.', - }) - ), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'An optional description of the role descriptor.', - }) - ), - restriction: z.optional(security_types_restriction), - transient_metadata: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + cluster: z.array(security_types_cluster_privilege).register(z.globalRegistry, { + description: 'A list of cluster privileges. These privileges define the cluster level actions that API keys are able to execute.' + }), + indices: z.array(security_types_indices_privileges).register(z.globalRegistry, { + description: 'A list of indices permissions entries.' + }), + remote_indices: z.optional(z.array(security_types_remote_indices_privileges).register(z.globalRegistry, { + description: 'A list of indices permissions for remote clusters.' + })), + remote_cluster: z.optional(z.array(security_types_remote_cluster_privileges).register(z.globalRegistry, { + description: 'A list of cluster permissions for remote clusters.\nNOTE: This is limited a subset of the cluster permissions.' + })), + global: z.optional(z.union([ + z.array(security_types_global_privilege), + security_types_global_privilege + ])), + applications: z.optional(z.array(security_types_application_privileges).register(z.globalRegistry, { + description: 'A list of application privilege entries' + })), + metadata: z.optional(types_metadata), + run_as: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A list of users that the API keys can impersonate.' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'An optional description of the role descriptor.' + })), + restriction: z.optional(security_types_restriction), + transient_metadata: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))) }); export const security_types_security_settings = z.object({ - index: z.optional(indices_types_index_settings), + index: z.optional(indices_types_index_settings) }); export const security_types_user_indices_privileges = z.object({ - field_security: z.optional( - z.array(security_types_field_security).register(z.globalRegistry, { - description: 'The document fields that the owners of the role have read access to.', - }) - ), - names: z.union([types_index_name, z.array(types_index_name)]), - privileges: z.array(security_types_index_privilege).register(z.globalRegistry, { - description: - 'The index level privileges that owners of the role have on the specified indices.', - }), - query: z.optional( - z.array(security_types_indices_privileges_query).register(z.globalRegistry, { - description: - 'Search queries that define the documents the user has access to. A document within the specified indices must match these queries for it to be accessible by the owners of the role.', + field_security: z.optional(z.array(security_types_field_security).register(z.globalRegistry, { + description: 'The document fields that the owners of the role have read access to.' + })), + names: z.union([ + types_index_name, + z.array(types_index_name) + ]), + privileges: z.array(security_types_index_privilege).register(z.globalRegistry, { + description: 'The index level privileges that owners of the role have on the specified indices.' + }), + query: z.optional(z.array(security_types_indices_privileges_query).register(z.globalRegistry, { + description: 'Search queries that define the documents the user has access to. A document within the specified indices must match these queries for it to be accessible by the owners of the role.' + })), + allow_restricted_indices: z.boolean().register(z.globalRegistry, { + description: 'Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`.' }) - ), - allow_restricted_indices: z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`.', - }), }); export const security_types_remote_user_indices_privileges = z.object({ - field_security: z.optional( - z.array(security_types_field_security).register(z.globalRegistry, { - description: 'The document fields that the owners of the role have read access to.', - }) - ), - names: z.union([types_index_name, z.array(types_index_name)]), - privileges: z.array(security_types_index_privilege).register(z.globalRegistry, { - description: - 'The index level privileges that owners of the role have on the specified indices.', - }), - query: z.optional( - z.array(security_types_indices_privileges_query).register(z.globalRegistry, { - description: - 'Search queries that define the documents the user has access to. A document within the specified indices must match these queries for it to be accessible by the owners of the role.', - }) - ), - allow_restricted_indices: z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`.', - }), - clusters: z.array(z.string()), + field_security: z.optional(z.array(security_types_field_security).register(z.globalRegistry, { + description: 'The document fields that the owners of the role have read access to.' + })), + names: z.union([ + types_index_name, + z.array(types_index_name) + ]), + privileges: z.array(security_types_index_privilege).register(z.globalRegistry, { + description: 'The index level privileges that owners of the role have on the specified indices.' + }), + query: z.optional(z.array(security_types_indices_privileges_query).register(z.globalRegistry, { + description: 'Search queries that define the documents the user has access to. A document within the specified indices must match these queries for it to be accessible by the owners of the role.' + })), + allow_restricted_indices: z.boolean().register(z.globalRegistry, { + description: 'Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`.' + }), + clusters: z.array(z.string()) }); export const security_grant_api_key_grant_api_key = z.object({ - name: types_name, - expiration: z.optional(types_duration_large), - role_descriptors: z.optional( - z.union([ - z.record(z.string(), security_types_role_descriptor), - z.array(z.record(z.string(), security_types_role_descriptor)), - ]) - ), - metadata: z.optional(types_metadata), + name: types_name, + expiration: z.optional(types_duration_large), + role_descriptors: z.optional(z.union([ + z.record(z.string(), security_types_role_descriptor), + z.array(z.record(z.string(), security_types_role_descriptor)) + ])), + metadata: z.optional(types_metadata) }); -export const security_query_api_keys_api_key_aggregation_container = z - .object({ +export const security_query_api_keys_api_key_aggregation_container = z.object({ get aggregations() { - return z.optional( - z - .record( - z.string(), - z.lazy((): any => security_query_api_keys_api_key_aggregation_container) - ) - .register(z.globalRegistry, { - description: - 'Sub-aggregations for this aggregation.\nOnly applies to bucket aggregations.', - }) - ); + return z.optional(z.record(z.string(), z.lazy((): any => security_query_api_keys_api_key_aggregation_container)).register(z.globalRegistry, { + description: 'Sub-aggregations for this aggregation.\nOnly applies to bucket aggregations.' + })); }, - meta: z.optional(types_metadata), - }) - .and( - z.lazy(() => - z.object({ - cardinality: z.optional(types_aggregations_cardinality_aggregation), - composite: z.optional(types_aggregations_composite_aggregation), - date_range: z.optional(types_aggregations_date_range_aggregation), - get filter() { - return z.optional(z.lazy((): any => security_query_api_keys_api_key_query_container)); - }, - get filters() { - return z.optional(z.lazy((): any => security_query_api_keys_api_key_filters_aggregation)); - }, - missing: z.optional(types_aggregations_missing_aggregation), - range: z.optional(types_aggregations_range_aggregation), - terms: z.optional(types_aggregations_terms_aggregation), - value_count: z.optional(types_aggregations_value_count_aggregation), - }) - ) - ); + meta: z.optional(types_metadata) +}).and(z.lazy(() => z.object({ + cardinality: z.optional(types_aggregations_cardinality_aggregation), + composite: z.optional(types_aggregations_composite_aggregation), + date_range: z.optional(types_aggregations_date_range_aggregation), + get filter() { + return z.optional(z.lazy((): any => security_query_api_keys_api_key_query_container)); + }, + get filters() { + return z.optional(z.lazy((): any => security_query_api_keys_api_key_filters_aggregation)); + }, + missing: z.optional(types_aggregations_missing_aggregation), + range: z.optional(types_aggregations_range_aggregation), + terms: z.optional(types_aggregations_terms_aggregation), + value_count: z.optional(types_aggregations_value_count_aggregation) +}))); export const security_query_api_keys_api_key_query_container = z.object({ - bool: z.optional(types_query_dsl_bool_query), - exists: z.optional(types_query_dsl_exists_query), - ids: z.optional(types_query_dsl_ids_query), - match: z.optional( - z.record(z.string(), types_query_dsl_match_query).register(z.globalRegistry, { - description: - 'Returns documents that match a provided text, number, date or boolean value.\nThe provided text is analyzed before matching.', - }) - ), - match_all: z.optional(types_query_dsl_match_all_query), - prefix: z.optional( - z.record(z.string(), types_query_dsl_prefix_query).register(z.globalRegistry, { - description: 'Returns documents that contain a specific prefix in a provided field.', - }) - ), - range: z.optional( - z.record(z.string(), types_query_dsl_range_query).register(z.globalRegistry, { - description: 'Returns documents that contain terms within a provided range.', - }) - ), - simple_query_string: z.optional(types_query_dsl_simple_query_string_query), - term: z.optional( - z.record(z.string(), types_query_dsl_term_query).register(z.globalRegistry, { - description: - "Returns documents that contain an exact term in a provided field.\nTo return a document, the query term must exactly match the queried field's value, including whitespace and capitalization.", - }) - ), - terms: z.optional(types_query_dsl_terms_query), - wildcard: z.optional( - z.record(z.string(), types_query_dsl_wildcard_query).register(z.globalRegistry, { - description: 'Returns documents that contain terms matching a wildcard pattern.', - }) - ), -}); - -export const security_query_api_keys_api_key_filters_aggregation = - types_aggregations_bucket_aggregation_base.and( - z.lazy(() => - z.object({ - get filters() { - return z.optional(z.lazy((): any => types_aggregations_buckets_api_key_query_container)); - }, - other_bucket: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` to add a bucket to the response which will contain all documents that do not match any of the given filters.', - }) - ), - other_bucket_key: z.optional( - z.string().register(z.globalRegistry, { - description: 'The key with which the other bucket is returned.', - }) - ), - keyed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'By default, the named filters aggregation returns the buckets as an object.\nSet to `false` to return the buckets as an array of objects.', - }) - ), - }) - ) - ); + bool: z.optional(types_query_dsl_bool_query), + exists: z.optional(types_query_dsl_exists_query), + ids: z.optional(types_query_dsl_ids_query), + match: z.optional(z.record(z.string(), types_query_dsl_match_query).register(z.globalRegistry, { + description: 'Returns documents that match a provided text, number, date or boolean value.\nThe provided text is analyzed before matching.' + })), + match_all: z.optional(types_query_dsl_match_all_query), + prefix: z.optional(z.record(z.string(), types_query_dsl_prefix_query).register(z.globalRegistry, { + description: 'Returns documents that contain a specific prefix in a provided field.' + })), + range: z.optional(z.record(z.string(), types_query_dsl_range_query).register(z.globalRegistry, { + description: 'Returns documents that contain terms within a provided range.' + })), + simple_query_string: z.optional(types_query_dsl_simple_query_string_query), + term: z.optional(z.record(z.string(), types_query_dsl_term_query).register(z.globalRegistry, { + description: 'Returns documents that contain an exact term in a provided field.\nTo return a document, the query term must exactly match the queried field\'s value, including whitespace and capitalization.' + })), + terms: z.optional(types_query_dsl_terms_query), + wildcard: z.optional(z.record(z.string(), types_query_dsl_wildcard_query).register(z.globalRegistry, { + description: 'Returns documents that contain terms matching a wildcard pattern.' + })) +}); + +export const security_query_api_keys_api_key_filters_aggregation = types_aggregations_bucket_aggregation_base.and(z.lazy(() => z.object({ + get filters() { + return z.optional(z.lazy((): any => types_aggregations_buckets_api_key_query_container)); + }, + other_bucket: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` to add a bucket to the response which will contain all documents that do not match any of the given filters.' + })), + other_bucket_key: z.optional(z.string().register(z.globalRegistry, { + description: 'The key with which the other bucket is returned.' + })), + keyed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'By default, the named filters aggregation returns the buckets as an object.\nSet to `false` to return the buckets as an array of objects.' + })) +}))); /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. */ export const types_aggregations_buckets_api_key_query_container = z.union([ - z.record(z.string(), security_query_api_keys_api_key_query_container), - z.array(security_query_api_keys_api_key_query_container), + z.record(z.string(), security_query_api_keys_api_key_query_container), + z.array(security_query_api_keys_api_key_query_container) ]); export const security_query_role_role_query_container = z.object({ - bool: z.optional(types_query_dsl_bool_query), - exists: z.optional(types_query_dsl_exists_query), - ids: z.optional(types_query_dsl_ids_query), - match: z.optional( - z.record(z.string(), types_query_dsl_match_query).register(z.globalRegistry, { - description: - 'Returns roles that match a provided text, number, date or boolean value.\nThe provided text is analyzed before matching.', - }) - ), - match_all: z.optional(types_query_dsl_match_all_query), - prefix: z.optional( - z.record(z.string(), types_query_dsl_prefix_query).register(z.globalRegistry, { - description: 'Returns roles that contain a specific prefix in a provided field.', - }) - ), - range: z.optional( - z.record(z.string(), types_query_dsl_range_query).register(z.globalRegistry, { - description: 'Returns roles that contain terms within a provided range.', - }) - ), - simple_query_string: z.optional(types_query_dsl_simple_query_string_query), - term: z.optional( - z.record(z.string(), types_query_dsl_term_query).register(z.globalRegistry, { - description: - "Returns roles that contain an exact term in a provided field.\nTo return a document, the query term must exactly match the queried field's value, including whitespace and capitalization.", - }) - ), - terms: z.optional(types_query_dsl_terms_query), - wildcard: z.optional( - z.record(z.string(), types_query_dsl_wildcard_query).register(z.globalRegistry, { - description: 'Returns roles that contain terms matching a wildcard pattern.', - }) - ), + bool: z.optional(types_query_dsl_bool_query), + exists: z.optional(types_query_dsl_exists_query), + ids: z.optional(types_query_dsl_ids_query), + match: z.optional(z.record(z.string(), types_query_dsl_match_query).register(z.globalRegistry, { + description: 'Returns roles that match a provided text, number, date or boolean value.\nThe provided text is analyzed before matching.' + })), + match_all: z.optional(types_query_dsl_match_all_query), + prefix: z.optional(z.record(z.string(), types_query_dsl_prefix_query).register(z.globalRegistry, { + description: 'Returns roles that contain a specific prefix in a provided field.' + })), + range: z.optional(z.record(z.string(), types_query_dsl_range_query).register(z.globalRegistry, { + description: 'Returns roles that contain terms within a provided range.' + })), + simple_query_string: z.optional(types_query_dsl_simple_query_string_query), + term: z.optional(z.record(z.string(), types_query_dsl_term_query).register(z.globalRegistry, { + description: 'Returns roles that contain an exact term in a provided field.\nTo return a document, the query term must exactly match the queried field\'s value, including whitespace and capitalization.' + })), + terms: z.optional(types_query_dsl_terms_query), + wildcard: z.optional(z.record(z.string(), types_query_dsl_wildcard_query).register(z.globalRegistry, { + description: 'Returns roles that contain terms matching a wildcard pattern.' + })) }); -export const security_query_role_query_role = security_types_role_descriptor.and( - z.object({ +export const security_query_role_query_role = security_types_role_descriptor.and(z.object({ _sort: z.optional(types_sort_results), name: z.string().register(z.globalRegistry, { - description: 'Name of the role.', - }), - }) -); + description: 'Name of the role.' + }) +})); export const security_query_user_user_query_container = z.object({ - ids: z.optional(types_query_dsl_ids_query), - bool: z.optional(types_query_dsl_bool_query), - exists: z.optional(types_query_dsl_exists_query), - match: z.optional( - z.record(z.string(), types_query_dsl_match_query).register(z.globalRegistry, { - description: - 'Returns users that match a provided text, number, date or boolean value.\nThe provided text is analyzed before matching.', - }) - ), - match_all: z.optional(types_query_dsl_match_all_query), - prefix: z.optional( - z.record(z.string(), types_query_dsl_prefix_query).register(z.globalRegistry, { - description: 'Returns users that contain a specific prefix in a provided field.', - }) - ), - range: z.optional( - z.record(z.string(), types_query_dsl_range_query).register(z.globalRegistry, { - description: 'Returns users that contain terms within a provided range.', - }) - ), - simple_query_string: z.optional(types_query_dsl_simple_query_string_query), - term: z.optional( - z.record(z.string(), types_query_dsl_term_query).register(z.globalRegistry, { - description: - "Returns users that contain an exact term in a provided field.\nTo return a document, the query term must exactly match the queried field's value, including whitespace and capitalization.", - }) - ), - terms: z.optional(types_query_dsl_terms_query), - wildcard: z.optional( - z.record(z.string(), types_query_dsl_wildcard_query).register(z.globalRegistry, { - description: 'Returns users that contain terms matching a wildcard pattern.', - }) - ), + ids: z.optional(types_query_dsl_ids_query), + bool: z.optional(types_query_dsl_bool_query), + exists: z.optional(types_query_dsl_exists_query), + match: z.optional(z.record(z.string(), types_query_dsl_match_query).register(z.globalRegistry, { + description: 'Returns users that match a provided text, number, date or boolean value.\nThe provided text is analyzed before matching.' + })), + match_all: z.optional(types_query_dsl_match_all_query), + prefix: z.optional(z.record(z.string(), types_query_dsl_prefix_query).register(z.globalRegistry, { + description: 'Returns users that contain a specific prefix in a provided field.' + })), + range: z.optional(z.record(z.string(), types_query_dsl_range_query).register(z.globalRegistry, { + description: 'Returns users that contain terms within a provided range.' + })), + simple_query_string: z.optional(types_query_dsl_simple_query_string_query), + term: z.optional(z.record(z.string(), types_query_dsl_term_query).register(z.globalRegistry, { + description: 'Returns users that contain an exact term in a provided field.\nTo return a document, the query term must exactly match the queried field\'s value, including whitespace and capitalization.' + })), + terms: z.optional(types_query_dsl_terms_query), + wildcard: z.optional(z.record(z.string(), types_query_dsl_wildcard_query).register(z.globalRegistry, { + description: 'Returns users that contain terms matching a wildcard pattern.' + })) }); export const simulate_ingest_simulate_ingest_document_result = z.object({ - get doc() { - return z.optional(z.lazy((): any => simulate_ingest_ingest_document_simulation)); - }, + get doc() { + return z.optional(z.lazy((): any => simulate_ingest_ingest_document_simulation)); + } }); /** @@ -32526,248 +26438,223 @@ export const simulate_ingest_simulate_ingest_document_result = z.object({ * list of executed pipelines is derived from the pipelines that would be executed if this * document had been ingested into _index. */ -export const simulate_ingest_ingest_document_simulation = z - .object({ +export const simulate_ingest_ingest_document_simulation = z.object({ _id: types_id, _index: types_index_name, _source: z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'JSON body for the document.', + description: 'JSON body for the document.' }), _version: spec_utils_stringified_version_number, executed_pipelines: z.array(z.string()).register(z.globalRegistry, { - description: 'A list of the names of the pipelines executed on this document.', - }), - ignored_fields: z.optional( - z.array(z.record(z.string(), z.string())).register(z.globalRegistry, { - description: - 'A list of the fields that would be ignored at the indexing step. For example, a field whose\nvalue is larger than the allowed limit would make it through all of the pipelines, but\nwould not be indexed into Elasticsearch.', - }) - ), + description: 'A list of the names of the pipelines executed on this document.' + }), + ignored_fields: z.optional(z.array(z.record(z.string(), z.string())).register(z.globalRegistry, { + description: 'A list of the fields that would be ignored at the indexing step. For example, a field whose\nvalue is larger than the allowed limit would make it through all of the pipelines, but\nwould not be indexed into Elasticsearch.' + })), error: z.optional(types_error_cause), - effective_mapping: z.optional(types_mapping_type_mapping), - }) - .register(z.globalRegistry, { - description: - 'The results of ingest simulation on a single document. The _source of the document contains\nthe results after running all pipelines listed in executed_pipelines on the document. The\nlist of executed pipelines is derived from the pipelines that would be executed if this\ndocument had been ingested into _index.', - }); + effective_mapping: z.optional(types_mapping_type_mapping) +}).register(z.globalRegistry, { + description: 'The results of ingest simulation on a single document. The _source of the document contains\nthe results after running all pipelines listed in executed_pipelines on the document. The\nlist of executed pipelines is derived from the pipelines that would be executed if this\ndocument had been ingested into _index.' +}); export const ingest_types_pipeline_config = z.object({ - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'Description of the ingest pipeline.', + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Description of the ingest pipeline.' + })), + version: z.optional(types_version_number), + processors: z.array(ingest_types_processor_container).register(z.globalRegistry, { + description: 'Processors used to perform transformations on documents before indexing.\nProcessors run sequentially in the order specified.' }) - ), - version: z.optional(types_version_number), - processors: z.array(ingest_types_processor_container).register(z.globalRegistry, { - description: - 'Processors used to perform transformations on documents before indexing.\nProcessors run sequentially in the order specified.', - }), }); export const transform_get_transform_transform_summary = z.object({ - authorization: z.optional(ml_types_transform_authorization), - create_time: z.optional(types_epoch_time_unit_millis), - create_time_string: z.optional(types_date_time), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'Free text description of the transform.', - }) - ), - dest: global_reindex_destination, - frequency: z.optional(types_duration), - id: types_id, - latest: z.optional(transform_types_latest), - get pivot() { - return z.optional(z.lazy((): any => transform_types_pivot)); - }, - retention_policy: z.optional(transform_types_retention_policy_container), - settings: z.optional(transform_types_settings), - get source() { - return z.lazy((): any => transform_types_source); - }, - sync: z.optional(transform_types_sync_container), - version: z.optional(types_version_string), - _meta: z.optional(types_metadata), + authorization: z.optional(ml_types_transform_authorization), + create_time: z.optional(types_epoch_time_unit_millis), + create_time_string: z.optional(types_date_time), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Free text description of the transform.' + })), + dest: global_reindex_destination, + frequency: z.optional(types_duration), + id: types_id, + latest: z.optional(transform_types_latest), + get pivot() { + return z.optional(z.lazy((): any => transform_types_pivot)); + }, + retention_policy: z.optional(transform_types_retention_policy_container), + settings: z.optional(transform_types_settings), + get source() { + return z.lazy((): any => transform_types_source); + }, + sync: z.optional(transform_types_sync_container), + version: z.optional(types_version_string), + _meta: z.optional(types_metadata) }); export const transform_types_pivot = z.object({ - aggregations: z.optional( - z.record(z.string(), types_aggregations_aggregation_container).register(z.globalRegistry, { - description: - 'Defines how to aggregate the grouped data. The following aggregations are currently supported: average, bucket\nscript, bucket selector, cardinality, filter, geo bounds, geo centroid, geo line, max, median absolute deviation,\nmin, missing, percentiles, rare terms, scripted metric, stats, sum, terms, top metrics, value count, weighted\naverage.', - }) - ), - get group_by() { - return z.optional( - z - .record( - z.string(), - z.lazy((): any => transform_types_pivot_group_by_container) - ) - .register(z.globalRegistry, { - description: - 'Defines how to group the data. More than one grouping can be defined per pivot. The following groupings are\ncurrently supported: date histogram, geotile grid, histogram, terms.', - }) - ); - }, + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container).register(z.globalRegistry, { + description: 'Defines how to aggregate the grouped data. The following aggregations are currently supported: average, bucket\nscript, bucket selector, cardinality, filter, geo bounds, geo centroid, geo line, max, median absolute deviation,\nmin, missing, percentiles, rare terms, scripted metric, stats, sum, terms, top metrics, value count, weighted\naverage.' + })), + get group_by() { + return z.optional(z.record(z.string(), z.lazy((): any => transform_types_pivot_group_by_container)).register(z.globalRegistry, { + description: 'Defines how to group the data. More than one grouping can be defined per pivot. The following groupings are\ncurrently supported: date histogram, geotile grid, histogram, terms.' + })); + } }); export const transform_types_pivot_group_by_container = z.object({ - date_histogram: z.optional(types_aggregations_date_histogram_aggregation), - geotile_grid: z.optional(types_aggregations_geo_tile_grid_aggregation), - histogram: z.optional(types_aggregations_histogram_aggregation), - terms: z.optional(types_aggregations_terms_aggregation), + date_histogram: z.optional(types_aggregations_date_histogram_aggregation), + geotile_grid: z.optional(types_aggregations_geo_tile_grid_aggregation), + histogram: z.optional(types_aggregations_histogram_aggregation), + terms: z.optional(types_aggregations_terms_aggregation) }); export const transform_types_source = z.object({ - index: types_indices, - query: z.optional(types_query_dsl_query_container), - runtime_mappings: z.optional(types_mapping_runtime_fields), + index: types_indices, + query: z.optional(types_query_dsl_query_container), + runtime_mappings: z.optional(types_mapping_runtime_fields) }); export const watcher_types_watch = z.object({ - get actions() { - return z.record( - z.string(), - z.lazy((): any => watcher_types_action) - ); - }, - get condition() { - return z.lazy((): any => watcher_types_condition_container); - }, - get input() { - return z.lazy((): any => watcher_types_input_container); - }, - metadata: z.optional(types_metadata), - status: z.optional(watcher_types_watch_status), - throttle_period: z.optional(types_duration), - throttle_period_in_millis: z.optional(types_duration_value_unit_millis), - get transform() { - return z.optional(z.lazy((): any => types_transform_container)); - }, - trigger: watcher_types_trigger_container, + get actions() { + return z.record(z.string(), z.lazy((): any => watcher_types_action)); + }, + get condition() { + return z.lazy((): any => watcher_types_condition_container); + }, + get input() { + return z.lazy((): any => watcher_types_input_container); + }, + metadata: z.optional(types_metadata), + status: z.optional(watcher_types_watch_status), + throttle_period: z.optional(types_duration), + throttle_period_in_millis: z.optional(types_duration_value_unit_millis), + get transform() { + return z.optional(z.lazy((): any => types_transform_container)); + }, + trigger: watcher_types_trigger_container }); export const watcher_types_action = z.object({ - action_type: z.optional(watcher_types_action_type), - get condition() { - return z.optional(z.lazy((): any => watcher_types_condition_container)); - }, - foreach: z.optional(z.string()), - max_iterations: z.optional(z.number()), - name: z.optional(types_name), - throttle_period: z.optional(types_duration), - throttle_period_in_millis: z.optional(types_duration_value_unit_millis), - get transform() { - return z.optional(z.lazy((): any => types_transform_container)); - }, - index: z.optional(watcher_types_index_action), - logging: z.optional(watcher_types_logging_action), - email: z.optional(watcher_types_email_action), - pagerduty: z.optional(watcher_types_pager_duty_action), - slack: z.optional(watcher_types_slack_action), - webhook: z.optional(watcher_types_webhook_action), + action_type: z.optional(watcher_types_action_type), + get condition() { + return z.optional(z.lazy((): any => watcher_types_condition_container)); + }, + foreach: z.optional(z.string()), + max_iterations: z.optional(z.number()), + name: z.optional(types_name), + throttle_period: z.optional(types_duration), + throttle_period_in_millis: z.optional(types_duration_value_unit_millis), + get transform() { + return z.optional(z.lazy((): any => types_transform_container)); + }, + index: z.optional(watcher_types_index_action), + logging: z.optional(watcher_types_logging_action), + email: z.optional(watcher_types_email_action), + pagerduty: z.optional(watcher_types_pager_duty_action), + slack: z.optional(watcher_types_slack_action), + webhook: z.optional(watcher_types_webhook_action) }); export const watcher_types_condition_container = z.object({ - always: z.optional(watcher_types_always_condition), - array_compare: z.optional(z.record(z.string(), watcher_types_array_compare_condition)), - compare: z.optional(z.record(z.string(), z.record(z.string(), types_field_value))), - never: z.optional(watcher_types_never_condition), - get script() { - return z.optional(z.lazy((): any => watcher_types_script_condition)); - }, + always: z.optional(watcher_types_always_condition), + array_compare: z.optional(z.record(z.string(), watcher_types_array_compare_condition)), + compare: z.optional(z.record(z.string(), z.record(z.string(), types_field_value))), + never: z.optional(watcher_types_never_condition), + get script() { + return z.optional(z.lazy((): any => watcher_types_script_condition)); + } }); export const watcher_types_script_condition = z.object({ - lang: z.optional(types_script_language), - params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - source: z.optional(types_script_source), - id: z.optional(z.string()), + lang: z.optional(types_script_language), + params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + source: z.optional(types_script_source), + id: z.optional(z.string()) }); export const types_transform_container = z.object({ - get chain() { - return z.optional(z.array(z.lazy((): any => types_transform_container))); - }, - get script() { - return z.optional(z.lazy((): any => types_script_transform)); - }, - get search() { - return z.optional(z.lazy((): any => types_search_transform)); - }, + get chain() { + return z.optional(z.array(z.lazy((): any => types_transform_container))); + }, + get script() { + return z.optional(z.lazy((): any => types_script_transform)); + }, + get search() { + return z.optional(z.lazy((): any => types_search_transform)); + } }); export const types_script_transform = z.object({ - lang: z.optional(z.string()), - params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - source: z.optional(types_script_source), - id: z.optional(z.string()), + lang: z.optional(z.string()), + params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + source: z.optional(types_script_source), + id: z.optional(z.string()) }); export const types_search_transform = z.object({ - get request() { - return z.lazy((): any => watcher_types_search_input_request_definition); - }, - timeout: types_duration, + get request() { + return z.lazy((): any => watcher_types_search_input_request_definition); + }, + timeout: types_duration }); export const watcher_types_search_input_request_definition = z.object({ - get body() { - return z.optional(z.lazy((): any => watcher_types_search_input_request_body)); - }, - indices: z.optional(z.array(types_index_name)), - indices_options: z.optional(types_indices_options), - search_type: z.optional(types_search_type), - template: z.optional(watcher_types_search_template_request_body), - rest_total_hits_as_int: z.optional(z.boolean()), + get body() { + return z.optional(z.lazy((): any => watcher_types_search_input_request_body)); + }, + indices: z.optional(z.array(types_index_name)), + indices_options: z.optional(types_indices_options), + search_type: z.optional(types_search_type), + template: z.optional(watcher_types_search_template_request_body), + rest_total_hits_as_int: z.optional(z.boolean()) }); export const watcher_types_search_input_request_body = z.object({ - query: types_query_dsl_query_container, + query: types_query_dsl_query_container }); export const watcher_types_input_container = z.object({ - get chain() { - return z.optional(z.lazy((): any => watcher_types_chain_input)); - }, - http: z.optional(watcher_types_http_input), - get search() { - return z.optional(z.lazy((): any => watcher_types_search_input)); - }, - simple: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + get chain() { + return z.optional(z.lazy((): any => watcher_types_chain_input)); + }, + http: z.optional(watcher_types_http_input), + get search() { + return z.optional(z.lazy((): any => watcher_types_search_input)); + }, + simple: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))) }); export const watcher_types_chain_input = z.object({ - inputs: z.array(z.record(z.string(), watcher_types_input_container)), + inputs: z.array(z.record(z.string(), watcher_types_input_container)) }); export const watcher_types_search_input = z.object({ - extract: z.optional(z.array(z.string())), - request: watcher_types_search_input_request_definition, - timeout: z.optional(types_duration), + extract: z.optional(z.array(z.string())), + request: watcher_types_search_input_request_definition, + timeout: z.optional(types_duration) }); export const watcher_execute_watch_watch_record = z.object({ - condition: watcher_types_condition_container, - input: watcher_types_input_container, - messages: z.array(z.string()), - metadata: z.optional(types_metadata), - node: z.string(), - result: watcher_types_execution_result, - state: watcher_types_execution_status, - trigger_event: watcher_types_trigger_event_result, - user: types_username, - watch_id: types_id, - status: z.optional(watcher_types_watch_status), + condition: watcher_types_condition_container, + input: watcher_types_input_container, + messages: z.array(z.string()), + metadata: z.optional(types_metadata), + node: z.string(), + result: watcher_types_execution_result, + state: watcher_types_execution_status, + trigger_event: watcher_types_trigger_event_result, + user: types_username, + watch_id: types_id, + status: z.optional(watcher_types_watch_status) }); export const watcher_types_query_watch = z.object({ - _id: types_id, - status: z.optional(watcher_types_watch_status), - watch: z.optional(watcher_types_watch), - _primary_term: z.optional(z.number()), - _seq_no: z.optional(types_sequence_number), + _id: types_id, + status: z.optional(watcher_types_watch_status), + watch: z.optional(watcher_types_watch), + _primary_term: z.optional(z.number()), + _seq_no: z.optional(types_sequence_number) }); /** @@ -32791,40 +26678,36 @@ export const async_search_submit_keep_alive = types_duration; * If `true`, results are stored for later retrieval when the search completes within the `wait_for_completion_timeout`. */ export const async_search_submit_keep_on_completion = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, results are stored for later retrieval when the search completes within the `wait_for_completion_timeout`.', + description: 'If `true`, results are stored for later retrieval when the search completes within the `wait_for_completion_timeout`.' }); /** - * Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * Whether to ignore if a wildcard indices expression resolves into no concrete indices. + * (This includes `_all` string or when no indices have been specified) */ export const async_search_submit_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' }); /** * Indicate if an error should be returned if there is a partial search failure or timeout */ -export const async_search_submit_allow_partial_search_results = z - .boolean() - .register(z.globalRegistry, { - description: - 'Indicate if an error should be returned if there is a partial search failure or timeout', - }); +export const async_search_submit_allow_partial_search_results = z.boolean().register(z.globalRegistry, { + description: 'Indicate if an error should be returned if there is a partial search failure or timeout' +}); /** * The analyzer to use for the query string */ export const async_search_submit_analyzer = z.string().register(z.globalRegistry, { - description: 'The analyzer to use for the query string', + description: 'The analyzer to use for the query string' }); /** - * Specify whether wildcard and prefix queries should be analyzed (default: false) + * Specify whether wildcard and prefix queries should be analyzed */ export const async_search_submit_analyze_wildcard = z.boolean().register(z.globalRegistry, { - description: 'Specify whether wildcard and prefix queries should be analyzed (default: false)', + description: 'Specify whether wildcard and prefix queries should be analyzed' }); /** @@ -32832,15 +26715,14 @@ export const async_search_submit_analyze_wildcard = z.boolean().register(z.globa * A partial reduction is performed every time the coordinating node has received a certain number of new shard responses (5 by default). */ export const async_search_submit_batched_reduce_size = z.number().register(z.globalRegistry, { - description: - 'Affects how often partial results become available, which happens whenever shard results are reduced.\nA partial reduction is performed every time the coordinating node has received a certain number of new shard responses (5 by default).', + description: 'Affects how often partial results become available, which happens whenever shard results are reduced.\nA partial reduction is performed every time the coordinating node has received a certain number of new shard responses (5 by default).' }); /** * The default value is the only supported value. */ export const async_search_submit_ccs_minimize_roundtrips = z.boolean().register(z.globalRegistry, { - description: 'The default value is the only supported value.', + description: 'The default value is the only supported value.' }); /** @@ -32852,7 +26734,7 @@ export const async_search_submit_default_operator = types_query_dsl_operator; * The field to use as default where no field prefix is given in the query string */ export const async_search_submit_df = z.string().register(z.globalRegistry, { - description: 'The field to use as default where no field prefix is given in the query string', + description: 'The field to use as default where no field prefix is given in the query string' }); /** @@ -32861,7 +26743,7 @@ export const async_search_submit_df = z.string().register(z.globalRegistry, { export const async_search_submit_docvalue_fields = types_fields; /** - * Whether to expand wildcard expression to concrete indices that are open, closed or both. + * Whether to expand wildcard expression to concrete indices that are open, closed or both */ export const async_search_submit_expand_wildcards = types_expand_wildcards; @@ -32869,56 +26751,50 @@ export const async_search_submit_expand_wildcards = types_expand_wildcards; * Specify whether to return detailed information about score computation as part of a hit */ export const async_search_submit_explain = z.boolean().register(z.globalRegistry, { - description: - 'Specify whether to return detailed information about score computation as part of a hit', + description: 'Specify whether to return detailed information about score computation as part of a hit' }); /** * Whether specified concrete, expanded or aliased indices should be ignored when throttled */ export const async_search_submit_ignore_throttled = z.boolean().register(z.globalRegistry, { - description: - 'Whether specified concrete, expanded or aliased indices should be ignored when throttled', + description: 'Whether specified concrete, expanded or aliased indices should be ignored when throttled' }); /** * Whether specified concrete indices should be ignored when unavailable (missing or closed) */ export const async_search_submit_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: - 'Whether specified concrete indices should be ignored when unavailable (missing or closed)', + description: 'Whether specified concrete indices should be ignored when unavailable (missing or closed)' }); /** * Specify whether format-based query failures (such as providing text to a numeric field) should be ignored */ export const async_search_submit_lenient = z.boolean().register(z.globalRegistry, { - description: - 'Specify whether format-based query failures (such as providing text to a numeric field) should be ignored', + description: 'Specify whether format-based query failures (such as providing text to a numeric field) should be ignored' }); /** - * The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests + * The number of concurrent shard requests per node this search executes concurrently. + * This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests */ -export const async_search_submit_max_concurrent_shard_requests = z - .number() - .register(z.globalRegistry, { - description: - 'The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests', - }); +export const async_search_submit_max_concurrent_shard_requests = z.number().register(z.globalRegistry, { + description: 'The number of concurrent shard requests per node this search executes concurrently.\nThis value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests' +}); /** - * Specify the node or shard the operation should be performed on (default: random) + * Specify the node or shard the operation should be performed on */ export const async_search_submit_preference = z.string().register(z.globalRegistry, { - description: 'Specify the node or shard the operation should be performed on (default: random)', + description: 'Specify the node or shard the operation should be performed on' }); /** * Specify if request cache should be used for this request or not, defaults to true */ export const async_search_submit_request_cache = z.boolean().register(z.globalRegistry, { - description: 'Specify if request cache should be used for this request or not, defaults to true', + description: 'Specify if request cache should be used for this request or not, defaults to true' }); /** @@ -32935,7 +26811,7 @@ export const async_search_submit_search_type = types_search_type; * Specific 'tag' of the request for logging and statistical purposes */ export const async_search_submit_stats = z.array(z.string()).register(z.globalRegistry, { - description: "Specific 'tag' of the request for logging and statistical purposes", + description: 'Specific \'tag\' of the request for logging and statistical purposes' }); /** @@ -32957,22 +26833,21 @@ export const async_search_submit_suggest_mode = types_suggest_mode; * How many suggestions to return in response */ export const async_search_submit_suggest_size = z.number().register(z.globalRegistry, { - description: 'How many suggestions to return in response', + description: 'How many suggestions to return in response' }); /** * The source text for which the suggestions should be returned. */ export const async_search_submit_suggest_text = z.string().register(z.globalRegistry, { - description: 'The source text for which the suggestions should be returned.', + description: 'The source text for which the suggestions should be returned.' }); /** - * The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + * The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early */ export const async_search_submit_terminate_after = z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.', + description: 'The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early' }); /** @@ -32981,7 +26856,8 @@ export const async_search_submit_terminate_after = z.number().register(z.globalR export const async_search_submit_timeout = types_duration; /** - * Indicate if the number of documents that match the query should be tracked. A number can also be specified, to accurately track the total hit count up to the number. + * Indicate if the number of documents that match the query should be tracked. + * A number can also be specified, to accurately track the total hit count up to the number. */ export const async_search_submit_track_total_hits = global_search_types_track_hits; @@ -32989,30 +26865,28 @@ export const async_search_submit_track_total_hits = global_search_types_track_hi * Whether to calculate and return scores even if they are not used for sorting */ export const async_search_submit_track_scores = z.boolean().register(z.globalRegistry, { - description: 'Whether to calculate and return scores even if they are not used for sorting', + description: 'Whether to calculate and return scores even if they are not used for sorting' }); /** * Specify whether aggregation and suggester names should be prefixed by their respective types in the response */ export const async_search_submit_typed_keys = z.boolean().register(z.globalRegistry, { - description: - 'Specify whether aggregation and suggester names should be prefixed by their respective types in the response', + description: 'Specify whether aggregation and suggester names should be prefixed by their respective types in the response' }); /** * Indicates whether hits.total should be rendered as an integer or an object in the rest search response */ export const async_search_submit_rest_total_hits_as_int = z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether hits.total should be rendered as an integer or an object in the rest search response', + description: 'Indicates whether hits.total should be rendered as an integer or an object in the rest search response' }); /** * Specify whether to return document version as part of a hit */ export const async_search_submit_version = z.boolean().register(z.globalRegistry, { - description: 'Specify whether to return document version as part of a hit', + description: 'Specify whether to return document version as part of a hit' }); /** @@ -33034,35 +26908,37 @@ export const async_search_submit_source_includes = types_fields; * Specify whether to return sequence number and primary term of the last modification of each hit */ export const async_search_submit_seq_no_primary_term = z.boolean().register(z.globalRegistry, { - description: - 'Specify whether to return sequence number and primary term of the last modification of each hit', + description: 'Specify whether to return sequence number and primary term of the last modification of each hit' }); /** * Query in the Lucene query string syntax */ export const async_search_submit_q = z.string().register(z.globalRegistry, { - description: 'Query in the Lucene query string syntax', + description: 'Query in the Lucene query string syntax' }); /** - * Number of hits to return (default: 10) + * Number of hits to return */ export const async_search_submit_size = z.number().register(z.globalRegistry, { - description: 'Number of hits to return (default: 10)', + description: 'Number of hits to return' }); /** - * Starting offset (default: 0) + * Starting offset */ export const async_search_submit_from = z.number().register(z.globalRegistry, { - description: 'Starting offset (default: 0)', + description: 'Starting offset' }); /** * A comma-separated list of : pairs */ -export const async_search_submit_sort = z.union([z.string(), z.array(z.string())]); +export const async_search_submit_sort = z.union([ + z.string(), + z.array(z.string()) +]); /** * The name of the data stream, index, or index alias to perform bulk actions on. @@ -33073,16 +26949,14 @@ export const bulk_index = types_index_name; * True or false if to include the document source in the error message in case of parsing errors. */ export const bulk_include_source_on_error = z.boolean().register(z.globalRegistry, { - description: - 'True or false if to include the document source in the error message in case of parsing errors.', + description: 'True or false if to include the document source in the error message in case of parsing errors.' }); /** * If `true`, the response will include the ingest pipelines that were run for each index or create. */ export const bulk_list_executed_pipelines = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response will include the ingest pipelines that were run for each index or create.', + description: 'If `true`, the response will include the ingest pipelines that were run for each index or create.' }); /** @@ -33091,8 +26965,7 @@ export const bulk_list_executed_pipelines = z.boolean().register(z.globalRegistr * If a final pipeline is configured, it will always run regardless of the value of this parameter. */ export const bulk_pipeline = z.string().register(z.globalRegistry, { - description: - 'The pipeline identifier to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.', + description: 'The pipeline identifier to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.' }); /** @@ -33146,15 +27019,14 @@ export const bulk_wait_for_active_shards = types_wait_for_active_shards; * If `true`, the request's actions must target an index alias. */ export const bulk_require_alias = z.boolean().register(z.globalRegistry, { - description: "If `true`, the request's actions must target an index alias.", + description: 'If `true`, the request\'s actions must target an index alias.' }); /** * If `true`, the request's actions must target a data stream (existing or to be created). */ export const bulk_require_data_stream = z.boolean().register(z.globalRegistry, { - description: - "If `true`, the request's actions must target a data stream (existing or to be created).", + description: 'If `true`, the request\'s actions must target a data stream (existing or to be created).' }); /** @@ -33212,8 +27084,7 @@ export const cat_allocation_s = types_names; * node will send requests for further information to each selected node. */ export const cat_allocation_local = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' }); /** @@ -33225,8 +27096,8 @@ export const cat_allocation_master_timeout = types_duration; * A comma-separated list of regular-expressions to filter the circuit breakers in the output */ export const cat_circuit_breaker_circuit_breaker_patterns = z.union([ - z.string(), - z.array(z.string()), + z.string(), + z.array(z.string()) ]); /** @@ -33248,8 +27119,7 @@ export const cat_circuit_breaker_s = types_names; * node will send requests for further information to each selected node. */ export const cat_circuit_breaker_local = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' }); /** @@ -33263,8 +27133,7 @@ export const cat_circuit_breaker_master_timeout = types_duration; * If it is omitted, all component templates are returned. */ export const cat_component_templates_name = z.string().register(z.globalRegistry, { - description: - 'The name of the component template.\nIt accepts wildcard expressions.\nIf it is omitted, all component templates are returned.', + description: 'The name of the component template.\nIt accepts wildcard expressions.\nIf it is omitted, all component templates are returned.' }); /** @@ -33286,8 +27155,7 @@ export const cat_component_templates_s = types_names; * node will send requests for further information to each selected node. */ export const cat_component_templates_local = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' }); /** @@ -33357,15 +27225,14 @@ export const cat_indices_health = types_health_status; * If true, the response includes information from segments that are not loaded into memory. */ export const cat_indices_include_unloaded_segments = z.boolean().register(z.globalRegistry, { - description: - 'If true, the response includes information from segments that are not loaded into memory.', + description: 'If true, the response includes information from segments that are not loaded into memory.' }); /** * If true, the response only includes information from primary shards. */ export const cat_indices_pri = z.boolean().register(z.globalRegistry, { - description: 'If true, the response only includes information from primary shards.', + description: 'If true, the response only includes information from primary shards.' }); /** @@ -33395,8 +27262,7 @@ export const cat_ml_data_frame_analytics_id = types_id; * (This includes `_all` string or when no configs have been specified.) */ export const cat_ml_data_frame_analytics_allow_no_match = z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard expression matches no configs.\n(This includes `_all` string or when no configs have been specified.)', + description: 'Whether to ignore if a wildcard expression matches no configs.\n(This includes `_all` string or when no configs have been specified.)' }); /** @@ -33427,8 +27293,7 @@ export const cat_ml_datafeeds_datafeed_id = types_id; * partial matches. */ export const cat_ml_datafeeds_allow_no_match = z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n* Contains wildcard expressions and there are no datafeeds that match.\n* Contains the `_all` string or no identifiers and there are no matches.\n* Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty datafeeds array when there are no matches and the subset of results when\nthere are partial matches. If `false`, the API returns a 404 status code when there are no matches or only\npartial matches.', + description: 'Specifies what to do when the request:\n\n* Contains wildcard expressions and there are no datafeeds that match.\n* Contains the `_all` string or no identifiers and there are no matches.\n* Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty datafeeds array when there are no matches and the subset of results when\nthere are partial matches. If `false`, the API returns a 404 status code when there are no matches or only\npartial matches.' }); /** @@ -33458,8 +27323,7 @@ export const cat_ml_jobs_job_id = types_id; * matches. */ export const cat_ml_jobs_allow_no_match = z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n* Contains wildcard expressions and there are no jobs that match.\n* Contains the `_all` string or no identifiers and there are no matches.\n* Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty jobs array when there are no matches and the subset of results when there\nare partial matches. If `false`, the API returns a 404 status code when there are no matches or only partial\nmatches.', + description: 'Specifies what to do when the request:\n\n* Contains wildcard expressions and there are no jobs that match.\n* Contains the `_all` string or no identifiers and there are no matches.\n* Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty jobs array when there are no matches and the subset of results when there\nare partial matches. If `false`, the API returns a 404 status code when there are no matches or only partial\nmatches.' }); /** @@ -33483,8 +27347,7 @@ export const cat_ml_trained_models_model_id = types_id; * If `false`, the API returns a 404 status code when there are no matches or only partial matches. */ export const cat_ml_trained_models_allow_no_match = z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request: contains wildcard expressions and there are no models that match; contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches.\nIf `true`, the API returns an empty array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the API returns a 404 status code when there are no matches or only partial matches.', + description: 'Specifies what to do when the request: contains wildcard expressions and there are no models that match; contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches.\nIf `true`, the API returns an empty array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the API returns a 404 status code when there are no matches or only partial matches.' }); /** @@ -33501,14 +27364,14 @@ export const cat_ml_trained_models_s = cat_types_cat_trained_models_columns; * Skips the specified number of transforms. */ export const cat_ml_trained_models_from = z.number().register(z.globalRegistry, { - description: 'Skips the specified number of transforms.', + description: 'Skips the specified number of transforms.' }); /** * The maximum number of transforms to display. */ export const cat_ml_trained_models_size = z.number().register(z.globalRegistry, { - description: 'The maximum number of transforms to display.', + description: 'The maximum number of transforms to display.' }); /** @@ -33521,14 +27384,14 @@ export const cat_recovery_index = types_indices; * If `true`, the response only includes ongoing shard recoveries. */ export const cat_recovery_active_only = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response only includes ongoing shard recoveries.', + description: 'If `true`, the response only includes ongoing shard recoveries.' }); /** * If `true`, the response includes detailed information about shard recoveries. */ export const cat_recovery_detailed = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes detailed information about shard recoveries.', + description: 'If `true`, the response includes detailed information about shard recoveries.' }); /** @@ -33576,8 +27439,7 @@ export const cat_segments_s = types_names; * node will send requests for further information to each selected node. */ export const cat_segments_local = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' }); /** @@ -33598,22 +27460,21 @@ export const cat_segments_expand_wildcards = types_expand_wildcards; * a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. */ export const cat_segments_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only\nmissing or closed indices. This behavior applies even if the request targets other open indices. For example,\na request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.', + description: 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only\nmissing or closed indices. This behavior applies even if the request targets other open indices. For example,\na request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.' }); /** * If true, concrete, expanded or aliased indices are ignored when frozen. */ export const cat_segments_ignore_throttled = z.boolean().register(z.globalRegistry, { - description: 'If true, concrete, expanded or aliased indices are ignored when frozen.', + description: 'If true, concrete, expanded or aliased indices are ignored when frozen.' }); /** * If true, missing or closed indices are not included in the response. */ export const cat_segments_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', + description: 'If true, missing or closed indices are not included in the response.' }); /** @@ -33621,8 +27482,7 @@ export const cat_segments_ignore_unavailable = z.boolean().register(z.globalRegi * of throwing an exception if index pattern matches closed indices */ export const cat_segments_allow_closed = z.boolean().register(z.globalRegistry, { - description: - 'If true, allow closed indices to be returned in the response otherwise if false, keep the legacy behaviour\nof throwing an exception if index pattern matches closed indices', + description: 'If true, allow closed indices to be returned in the response otherwise if false, keep the legacy behaviour\nof throwing an exception if index pattern matches closed indices' }); /** @@ -33661,7 +27521,7 @@ export const cat_snapshots_repository = types_names; * If `true`, the response does not include information from unavailable snapshots. */ export const cat_snapshots_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response does not include information from unavailable snapshots.', + description: 'If `true`, the response does not include information from unavailable snapshots.' }); /** @@ -33707,8 +27567,7 @@ export const cat_templates_s = types_names; * node will send requests for further information to each selected node. */ export const cat_templates_local = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' }); /** @@ -33741,8 +27600,7 @@ export const cat_thread_pool_s = types_names; * node will send requests for further information to each selected node. */ export const cat_thread_pool_local = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' }); /** @@ -33762,15 +27620,14 @@ export const cat_transforms_transform_id = types_id; * If `false`, the request returns a 404 status code when there are no matches or only partial matches. */ export const cat_transforms_allow_no_match = z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request: contains wildcard expressions and there are no transforms that match; contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches.\nIf `true`, it returns an empty transforms array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the request returns a 404 status code when there are no matches or only partial matches.', + description: 'Specifies what to do when the request: contains wildcard expressions and there are no transforms that match; contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches.\nIf `true`, it returns an empty transforms array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the request returns a 404 status code when there are no matches or only partial matches.' }); /** * Skips the specified number of transforms. */ export const cat_transforms_from = z.number().register(z.globalRegistry, { - description: 'Skips the specified number of transforms.', + description: 'Skips the specified number of transforms.' }); /** @@ -33787,7 +27644,7 @@ export const cat_transforms_s = cat_types_cat_transform_columns; * The maximum number of transforms to obtain. */ export const cat_transforms_size = z.number().register(z.globalRegistry, { - description: 'The maximum number of transforms to obtain.', + description: 'The maximum number of transforms to obtain.' }); /** @@ -33821,14 +27678,14 @@ export const cluster_allocation_explain_index = types_index_name; * An identifier for the shard that you would like an explanation for. */ export const cluster_allocation_explain_shard = z.number().register(z.globalRegistry, { - description: 'An identifier for the shard that you would like an explanation for.', + description: 'An identifier for the shard that you would like an explanation for.' }); /** * If true, returns an explanation for the primary shard for the specified shard ID. */ export const cluster_allocation_explain_primary = z.boolean().register(z.globalRegistry, { - description: 'If true, returns an explanation for the primary shard for the specified shard ID.', + description: 'If true, returns an explanation for the primary shard for the specified shard ID.' }); /** @@ -33840,17 +27697,15 @@ export const cluster_allocation_explain_current_node2 = types_node_id; * If true, returns information about disk usage and shard sizes. */ export const cluster_allocation_explain_include_disk_info = z.boolean().register(z.globalRegistry, { - description: 'If true, returns information about disk usage and shard sizes.', + description: 'If true, returns information about disk usage and shard sizes.' }); /** * If true, returns YES decisions in explanation. */ -export const cluster_allocation_explain_include_yes_decisions = z - .boolean() - .register(z.globalRegistry, { - description: 'If true, returns YES decisions in explanation.', - }); +export const cluster_allocation_explain_include_yes_decisions = z.boolean().register(z.globalRegistry, { + description: 'If true, returns YES decisions in explanation.' +}); /** * Period to wait for a connection to the master node. @@ -33867,25 +27722,23 @@ export const cluster_get_component_template_name = types_name; * If `true`, returns settings in flat format. */ export const cluster_get_component_template_flat_settings = z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', + description: 'If `true`, returns settings in flat format.' }); /** * Filter out results, for example to filter out sensitive information. Supports wildcards or full settings keys */ export const cluster_get_component_template_settings_filter = z.union([ - z.string(), - z.array(z.string()), + z.string(), + z.array(z.string()) ]); /** - * Return all default configurations for the component template (default: false) + * Return all default configurations for the component template */ -export const cluster_get_component_template_include_defaults = z - .boolean() - .register(z.globalRegistry, { - description: 'Return all default configurations for the component template (default: false)', - }); +export const cluster_get_component_template_include_defaults = z.boolean().register(z.globalRegistry, { + description: 'Return all default configurations for the component template' +}); /** * If `true`, the request retrieves information from the local node only. @@ -33894,8 +27747,7 @@ export const cluster_get_component_template_include_defaults = z * @deprecated */ export const cluster_get_component_template_local = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request retrieves information from the local node only.\nIf `false`, information is retrieved from the master node.', + description: 'If `true`, the request retrieves information from the local node only.\nIf `false`, information is retrieved from the master node.' }); /** @@ -33923,8 +27775,7 @@ export const cluster_health_level = types_level; * If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. */ export const cluster_health_local = z.boolean().register(z.globalRegistry, { - description: - 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.', + description: 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.' }); /** @@ -33955,19 +27806,15 @@ export const cluster_health_wait_for_nodes2 = cluster_health_wait_for_nodes; /** * A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards. */ -export const cluster_health_wait_for_no_initializing_shards = z - .boolean() - .register(z.globalRegistry, { - description: - 'A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards.', - }); +export const cluster_health_wait_for_no_initializing_shards = z.boolean().register(z.globalRegistry, { + description: 'A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards.' +}); /** * A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards. */ export const cluster_health_wait_for_no_relocating_shards = z.boolean().register(z.globalRegistry, { - description: - 'A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards.', + description: 'A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards.' }); /** @@ -33988,14 +27835,14 @@ export const cluster_put_component_template_name = types_name; * If `true`, this request cannot replace or update existing component templates. */ export const cluster_put_component_template_create = z.boolean().register(z.globalRegistry, { - description: 'If `true`, this request cannot replace or update existing component templates.', + description: 'If `true`, this request cannot replace or update existing component templates.' }); /** * User defined reason for create the component template. */ export const cluster_put_component_template_cause = z.string().register(z.globalRegistry, { - description: 'User defined reason for create the component template.', + description: 'User defined reason for create the component template.' }); /** @@ -34005,7 +27852,7 @@ export const cluster_put_component_template_cause = z.string().register(z.global export const cluster_put_component_template_master_timeout = types_duration; /** - * Limit the information returned to the specified metrics + * Limit the information returned to the specified metrics. */ export const cluster_state_metric = cluster_state_cluster_state_metrics; @@ -34015,41 +27862,39 @@ export const cluster_state_metric = cluster_state_cluster_state_metrics; export const cluster_state_index = types_indices; /** - * Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * Whether to ignore if a wildcard indices expression resolves into no concrete indices. + * (This includes `_all` string or when no indices have been specified) */ export const cluster_state_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' }); /** - * Whether to expand wildcard expression to concrete indices that are open, closed or both. + * Whether to expand wildcard expression to concrete indices that are open, closed or both */ export const cluster_state_expand_wildcards = types_expand_wildcards; /** - * Return settings in flat format (default: false) + * Return settings in flat format */ export const cluster_state_flat_settings = z.boolean().register(z.globalRegistry, { - description: 'Return settings in flat format (default: false)', + description: 'Return settings in flat format' }); /** * Whether specified concrete indices should be ignored when unavailable (missing or closed) */ export const cluster_state_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: - 'Whether specified concrete indices should be ignored when unavailable (missing or closed)', + description: 'Whether specified concrete indices should be ignored when unavailable (missing or closed)' }); /** - * Return local information, do not retrieve the state from master node (default: false) + * Return local information, do not retrieve the state from master node * * @deprecated */ export const cluster_state_local = z.boolean().register(z.globalRegistry, { - description: - 'Return local information, do not retrieve the state from master node (default: false)', + description: 'Return local information, do not retrieve the state from master node' }); /** @@ -34076,7 +27921,7 @@ export const cluster_stats_node_id = types_node_ids; * Include remote cluster data into the response */ export const cluster_stats_include_remotes = z.boolean().register(z.globalRegistry, { - description: 'Include remote cluster data into the response', + description: 'Include remote cluster data into the response' }); /** @@ -34104,8 +27949,7 @@ export const count_index = types_indices; * For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. */ export const count_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' }); /** @@ -34113,8 +27957,7 @@ export const count_allow_no_indices = z.boolean().register(z.globalRegistry, { * This parameter can be used only when the `q` query string parameter is specified. */ export const count_analyzer = z.string().register(z.globalRegistry, { - description: - 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', + description: 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' }); /** @@ -34122,8 +27965,7 @@ export const count_analyzer = z.string().register(z.globalRegistry, { * This parameter can be used only when the `q` query string parameter is specified. */ export const count_analyze_wildcard = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.', + description: 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.' }); /** @@ -34137,8 +27979,7 @@ export const count_default_operator = types_query_dsl_operator; * This parameter can be used only when the `q` query string parameter is specified. */ export const count_df = z.string().register(z.globalRegistry, { - description: - 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', + description: 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' }); /** @@ -34154,14 +27995,14 @@ export const count_expand_wildcards = types_expand_wildcards; * @deprecated */ export const count_ignore_throttled = z.boolean().register(z.globalRegistry, { - description: 'If `true`, concrete, expanded, or aliased indices are ignored when frozen.', + description: 'If `true`, concrete, expanded, or aliased indices are ignored when frozen.' }); /** * If `false`, the request returns an error if it targets a missing or closed index. */ export const count_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `false`, the request returns an error if it targets a missing or closed index.', + description: 'If `false`, the request returns an error if it targets a missing or closed index.' }); /** @@ -34169,15 +28010,14 @@ export const count_ignore_unavailable = z.boolean().register(z.globalRegistry, { * This parameter can be used only when the `q` query string parameter is specified. */ export const count_lenient = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.', + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.' }); /** * The minimum `_score` value that documents must have to be included in the result. */ export const count_min_score = z.number().register(z.globalRegistry, { - description: 'The minimum `_score` value that documents must have to be included in the result.', + description: 'The minimum `_score` value that documents must have to be included in the result.' }); /** @@ -34185,7 +28025,7 @@ export const count_min_score = z.number().register(z.globalRegistry, { * By default, it is random. */ export const count_preference = z.string().register(z.globalRegistry, { - description: 'The node or shard the operation should be performed on.\nBy default, it is random.', + description: 'The node or shard the operation should be performed on.\nBy default, it is random.' }); /** @@ -34204,16 +28044,14 @@ export const count_routing = types_routing; * Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. */ export const count_terminate_after = z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.', + description: 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.' }); /** * The query in Lucene query string syntax. This parameter cannot be used with a request body. */ export const count_q = z.string().register(z.globalRegistry, { - description: - 'The query in Lucene query string syntax. This parameter cannot be used with a request body.', + description: 'The query in Lucene query string syntax. This parameter cannot be used with a request body.' }); /** @@ -34233,8 +28071,7 @@ export const create_index = types_index_name; * True or false if to include the document source in the error message in case of parsing errors. */ export const create_include_source_on_error = z.boolean().register(z.globalRegistry, { - description: - 'True or false if to include the document source in the error message in case of parsing errors.', + description: 'True or false if to include the document source in the error message in case of parsing errors.' }); /** @@ -34243,8 +28080,7 @@ export const create_include_source_on_error = z.boolean().register(z.globalRegis * If a final pipeline is configured, it will always run regardless of the value of this parameter. */ export const create_pipeline = z.string().register(z.globalRegistry, { - description: - 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.', + description: 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.' }); /** @@ -34258,15 +28094,14 @@ export const create_refresh = types_refresh; * If `true`, the destination must be an index alias. */ export const create_require_alias = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the destination must be an index alias.', + description: 'If `true`, the destination must be an index alias.' }); /** * If `true`, the request's actions must target a data stream (existing or to be created). */ export const create_require_data_stream = z.boolean().register(z.globalRegistry, { - description: - "If `true`, the request's actions must target a data stream (existing or to be created).", + description: 'If `true`, the request\'s actions must target a data stream (existing or to be created).' }); /** @@ -34321,19 +28156,18 @@ export const enrich_get_policy_master_timeout = types_duration; export const eql_search_index = types_indices; /** - * Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * Whether to ignore if a wildcard indices expression resolves into no concrete indices. + * (This includes `_all` string or when no indices have been specified) */ export const eql_search_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' }); /** * If true, returns partial results if there are shard failures. If false, returns an error with no partial results. */ export const eql_search_allow_partial_search_results = z.boolean().register(z.globalRegistry, { - description: - 'If true, returns partial results if there are shard failures. If false, returns an error with no partial results.', + description: 'If true, returns partial results if there are shard failures. If false, returns an error with no partial results.' }); /** @@ -34341,8 +28175,7 @@ export const eql_search_allow_partial_search_results = z.boolean().register(z.gl * This flag has effect only if allow_partial_search_results is true. */ export const eql_search_allow_partial_sequence_results = z.boolean().register(z.globalRegistry, { - description: - 'If true, sequence queries will return partial results in case of shard failures. If false, they will return no results at all.\nThis flag has effect only if allow_partial_search_results is true.', + description: 'If true, sequence queries will return partial results in case of shard failures. If false, they will return no results at all.\nThis flag has effect only if allow_partial_search_results is true.' }); /** @@ -34354,15 +28187,14 @@ export const eql_search_expand_wildcards = types_expand_wildcards; * Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution */ export const eql_search_ccs_minimize_roundtrips = z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution', + description: 'Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution' }); /** * If true, missing or closed indices are not included in the response. */ export const eql_search_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', + description: 'If true, missing or closed indices are not included in the response.' }); /** @@ -34374,7 +28206,7 @@ export const eql_search_keep_alive = types_duration; * If true, the search and its results are stored on the cluster. */ export const eql_search_keep_on_completion = z.boolean().register(z.globalRegistry, { - description: 'If true, the search and its results are stored on the cluster.', + description: 'If true, the search and its results are stored on the cluster.' }); /** @@ -34398,8 +28230,7 @@ export const explain_index = types_index_name; * This parameter can be used only when the `q` query string parameter is specified. */ export const explain_analyzer = z.string().register(z.globalRegistry, { - description: - 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', + description: 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' }); /** @@ -34407,8 +28238,7 @@ export const explain_analyzer = z.string().register(z.globalRegistry, { * This parameter can be used only when the `q` query string parameter is specified. */ export const explain_analyze_wildcard = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.', + description: 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.' }); /** @@ -34422,8 +28252,7 @@ export const explain_default_operator = types_query_dsl_operator; * This parameter can be used only when the `q` query string parameter is specified. */ export const explain_df = z.string().register(z.globalRegistry, { - description: - 'The field to use as default where no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', + description: 'The field to use as default where no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' }); /** @@ -34431,8 +28260,7 @@ export const explain_df = z.string().register(z.globalRegistry, { * This parameter can be used only when the `q` query string parameter is specified. */ export const explain_lenient = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.', + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.' }); /** @@ -34440,7 +28268,7 @@ export const explain_lenient = z.boolean().register(z.globalRegistry, { * It is random by default. */ export const explain_preference = z.string().register(z.globalRegistry, { - description: 'The node or shard the operation should be performed on.\nIt is random by default.', + description: 'The node or shard the operation should be performed on.\nIt is random by default.' }); /** @@ -34477,7 +28305,7 @@ export const explain_stored_fields = types_fields; * The query in the Lucene query string syntax. */ export const explain_q = z.string().register(z.globalRegistry, { - description: 'The query in the Lucene query string syntax.', + description: 'The query in the Lucene query string syntax.' }); /** @@ -34491,8 +28319,7 @@ export const field_caps_index = types_indices; * targeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar. */ export const field_caps_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias,\nor `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request\ntargeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar.', + description: 'If false, the request returns an error if any wildcard expression, index alias,\nor `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request\ntargeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar.' }); /** @@ -34509,20 +28336,23 @@ export const field_caps_fields = types_fields; * If `true`, missing or closed indices are not included in the response. */ export const field_caps_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `true`, missing or closed indices are not included in the response.', + description: 'If `true`, missing or closed indices are not included in the response.' }); /** * If true, unmapped fields are included in the response. */ export const field_caps_include_unmapped = z.boolean().register(z.globalRegistry, { - description: 'If true, unmapped fields are included in the response.', + description: 'If true, unmapped fields are included in the response.' }); /** * A comma-separated list of filters to apply to the response. */ -export const field_caps_filters = z.union([z.string(), z.array(z.string())]); +export const field_caps_filters = z.union([ + z.string(), + z.array(z.string()) +]); /** * A comma-separated list of field types to include. @@ -34530,36 +28360,36 @@ export const field_caps_filters = z.union([z.string(), z.array(z.string())]); * It defaults to empty, meaning that all field types are returned. */ export const field_caps_types = z.array(z.string()).register(z.globalRegistry, { - description: - 'A comma-separated list of field types to include.\nAny fields that do not match one of these types will be excluded from the results.\nIt defaults to empty, meaning that all field types are returned.', + description: 'A comma-separated list of field types to include.\nAny fields that do not match one of these types will be excluded from the results.\nIt defaults to empty, meaning that all field types are returned.' }); /** * If false, empty fields are not included in the response. */ export const field_caps_include_empty_fields = z.boolean().register(z.globalRegistry, { - description: 'If false, empty fields are not included in the response.', + description: 'If false, empty fields are not included in the response.' }); /** * A single target to search. If the target is an index alias, it must resolve to a single index. */ -export const fleet_msearch_index = z.union([types_index_name, types_index_alias]); +export const fleet_msearch_index = z.union([ + types_index_name, + types_index_alias +]); /** * If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. */ export const fleet_msearch_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.', + description: 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.' }); /** * If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests. */ export const fleet_msearch_ccs_minimize_roundtrips = z.boolean().register(z.globalRegistry, { - description: - 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.', + description: 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.' }); /** @@ -34571,37 +28401,35 @@ export const fleet_msearch_expand_wildcards = types_expand_wildcards; * If true, concrete, expanded or aliased indices are ignored when frozen. */ export const fleet_msearch_ignore_throttled = z.boolean().register(z.globalRegistry, { - description: 'If true, concrete, expanded or aliased indices are ignored when frozen.', + description: 'If true, concrete, expanded or aliased indices are ignored when frozen.' }); /** * If true, missing or closed indices are not included in the response. */ export const fleet_msearch_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', + description: 'If true, missing or closed indices are not included in the response.' }); /** * Maximum number of concurrent searches the multi search API can execute. */ export const fleet_msearch_max_concurrent_searches = z.number().register(z.globalRegistry, { - description: 'Maximum number of concurrent searches the multi search API can execute.', + description: 'Maximum number of concurrent searches the multi search API can execute.' }); /** * Maximum number of concurrent shard requests that each sub-search request executes per node. */ export const fleet_msearch_max_concurrent_shard_requests = z.number().register(z.globalRegistry, { - description: - 'Maximum number of concurrent shard requests that each sub-search request executes per node.', + description: 'Maximum number of concurrent shard requests that each sub-search request executes per node.' }); /** * Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint. */ export const fleet_msearch_pre_filter_shard_size = z.number().register(z.globalRegistry, { - description: - 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.', + description: 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.' }); /** @@ -34613,16 +28441,14 @@ export const fleet_msearch_search_type = types_search_type; * If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object. */ export const fleet_msearch_rest_total_hits_as_int = z.boolean().register(z.globalRegistry, { - description: - 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.', + description: 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.' }); /** * Specifies whether aggregation and suggester names should be prefixed by their respective types in the response. */ export const fleet_msearch_typed_keys = z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.', + description: 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.' }); /** @@ -34630,12 +28456,9 @@ export const fleet_msearch_typed_keys = z.boolean().register(z.globalRegistry, { * after the relevant checkpoint has become visible for search. Defaults to an empty list which will cause * Elasticsearch to immediately execute the search. */ -export const fleet_msearch_wait_for_checkpoints = z - .array(fleet_types_checkpoint) - .register(z.globalRegistry, { - description: - 'A comma separated list of checkpoints. When configured, the search API will only be executed on a shard\nafter the relevant checkpoint has become visible for search. Defaults to an empty list which will cause\nElasticsearch to immediately execute the search.', - }); +export const fleet_msearch_wait_for_checkpoints = z.array(fleet_types_checkpoint).register(z.globalRegistry, { + description: 'A comma separated list of checkpoints. When configured, the search API will only be executed on a shard\nafter the relevant checkpoint has become visible for search. Defaults to an empty list which will cause\nElasticsearch to immediately execute the search.' +}); /** * If true, returns partial results if there are shard request timeouts or shard failures. @@ -34643,14 +28466,16 @@ export const fleet_msearch_wait_for_checkpoints = z * Defaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default. */ export const fleet_msearch_allow_partial_search_results = z.boolean().register(z.globalRegistry, { - description: - 'If true, returns partial results if there are shard request timeouts or shard failures.\nIf false, returns an error with no partial results.\nDefaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default.', + description: 'If true, returns partial results if there are shard request timeouts or shard failures.\nIf false, returns an error with no partial results.\nDefaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default.' }); /** * A single target to search. If the target is an index alias, it must resolve to a single index. */ -export const fleet_search_index = z.union([types_index_name, types_index_alias]); +export const fleet_search_index = z.union([ + types_index_name, + types_index_alias +]); export const fleet_search_allow_no_indices = z.boolean(); @@ -34709,7 +28534,7 @@ export const fleet_search_suggest_size = z.number(); * The source text for which the suggestions should be returned. */ export const fleet_search_suggest_text = z.string().register(z.globalRegistry, { - description: 'The source text for which the suggestions should be returned.', + description: 'The source text for which the suggestions should be returned.' }); export const fleet_search_terminate_after = z.number(); @@ -34740,19 +28565,19 @@ export const fleet_search_size = z.number(); export const fleet_search_from = z.number(); -export const fleet_search_sort = z.union([z.string(), z.array(z.string())]); +export const fleet_search_sort = z.union([ + z.string(), + z.array(z.string()) +]); /** * A comma separated list of checkpoints. When configured, the search API will only be executed on a shard * after the relevant checkpoint has become visible for search. Defaults to an empty list which will cause * Elasticsearch to immediately execute the search. */ -export const fleet_search_wait_for_checkpoints = z - .array(fleet_types_checkpoint) - .register(z.globalRegistry, { - description: - 'A comma separated list of checkpoints. When configured, the search API will only be executed on a shard\nafter the relevant checkpoint has become visible for search. Defaults to an empty list which will cause\nElasticsearch to immediately execute the search.', - }); +export const fleet_search_wait_for_checkpoints = z.array(fleet_types_checkpoint).register(z.globalRegistry, { + description: 'A comma separated list of checkpoints. When configured, the search API will only be executed on a shard\nafter the relevant checkpoint has become visible for search. Defaults to an empty list which will cause\nElasticsearch to immediately execute the search.' +}); /** * If true, returns partial results if there are shard request timeouts or shard failures. @@ -34760,8 +28585,7 @@ export const fleet_search_wait_for_checkpoints = z * Defaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default. */ export const fleet_search_allow_partial_search_results = z.boolean().register(z.globalRegistry, { - description: - 'If true, returns partial results if there are shard request timeouts or shard failures.\nIf false, returns an error with no partial results.\nDefaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default.', + description: 'If true, returns partial results if there are shard request timeouts or shard failures.\nIf false, returns an error with no partial results.\nDefaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default.' }); /** @@ -34784,7 +28608,10 @@ export const graph_explore_timeout = types_duration; /** * A feature of the cluster, as returned by the top-level health report API. */ -export const health_report_feature = z.union([z.string(), z.array(z.string())]); +export const health_report_feature = z.union([ + z.string(), + z.array(z.string()) +]); /** * Explicit operation timeout. @@ -34795,14 +28622,14 @@ export const health_report_timeout = types_duration; * Opt-in for more information about the health of the system. */ export const health_report_verbose = z.boolean().register(z.globalRegistry, { - description: 'Opt-in for more information about the health of the system.', + description: 'Opt-in for more information about the health of the system.' }); /** * Limit the number of affected resources the health report API returns. */ export const health_report_size = z.number().register(z.globalRegistry, { - description: 'Limit the number of affected resources the health report API returns.', + description: 'Limit the number of affected resources the health report API returns.' }); /** @@ -34838,7 +28665,7 @@ export const index_index = types_index_name; * Only perform the operation if the document has this primary term. */ export const index_if_primary_term = z.number().register(z.globalRegistry, { - description: 'Only perform the operation if the document has this primary term.', + description: 'Only perform the operation if the document has this primary term.' }); /** @@ -34850,8 +28677,7 @@ export const index_if_seq_no = types_sequence_number; * True or false if to include the document source in the error message in case of parsing errors. */ export const index_include_source_on_error = z.boolean().register(z.globalRegistry, { - description: - 'True or false if to include the document source in the error message in case of parsing errors.', + description: 'True or false if to include the document source in the error message in case of parsing errors.' }); /** @@ -34870,8 +28696,7 @@ export const index_op_type = types_op_type; * If a final pipeline is configured it will always run, regardless of the value of this parameter. */ export const index_pipeline = z.string().register(z.globalRegistry, { - description: - 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.\nIf a final pipeline is configured it will always run, regardless of the value of this parameter.', + description: 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.\nIf a final pipeline is configured it will always run, regardless of the value of this parameter.' }); /** @@ -34918,15 +28743,14 @@ export const index_wait_for_active_shards = types_wait_for_active_shards; * If `true`, the destination must be an index alias. */ export const index_require_alias = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the destination must be an index alias.', + description: 'If `true`, the destination must be an index alias.' }); /** * If `true`, the request's actions must target a data stream (existing or to be created). */ export const index_require_data_stream = z.boolean().register(z.globalRegistry, { - description: - "If `true`, the request's actions must target a data stream (existing or to be created).", + description: 'If `true`, the request\'s actions must target a data stream (existing or to be created).' }); /** @@ -34962,8 +28786,7 @@ export const indices_clear_cache_index2 = types_indices; * This behavior applies even if the request targets other open indices. */ export const indices_clear_cache_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' }); /** @@ -34978,8 +28801,7 @@ export const indices_clear_cache_expand_wildcards = types_expand_wildcards; * Use the `fields` parameter to clear the cache of specific fields only. */ export const indices_clear_cache_fielddata = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, clears the fields cache.\nUse the `fields` parameter to clear the cache of specific fields only.', + description: 'If `true`, clears the fields cache.\nUse the `fields` parameter to clear the cache of specific fields only.' }); /** @@ -34991,21 +28813,21 @@ export const indices_clear_cache_fields = types_fields; * If `false`, the request returns an error if it targets a missing or closed index. */ export const indices_clear_cache_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `false`, the request returns an error if it targets a missing or closed index.', + description: 'If `false`, the request returns an error if it targets a missing or closed index.' }); /** * If `true`, clears the query cache. */ export const indices_clear_cache_query = z.boolean().register(z.globalRegistry, { - description: 'If `true`, clears the query cache.', + description: 'If `true`, clears the query cache.' }); /** * If `true`, clears the request cache. */ export const indices_clear_cache_request = z.boolean().register(z.globalRegistry, { - description: 'If `true`, clears the request cache.', + description: 'If `true`, clears the request cache.' }); /** @@ -35099,8 +28921,7 @@ export const indices_exists_alias_index = types_indices; * This behavior applies even if the request targets other open indices. */ export const indices_exists_alias_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' }); /** @@ -35114,8 +28935,7 @@ export const indices_exists_alias_expand_wildcards = types_expand_wildcards; * If `false`, requests that include a missing data stream or index in the target indices or data streams return an error. */ export const indices_exists_alias_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, requests that include a missing data stream or index in the target indices or data streams return an error.', + description: 'If `false`, requests that include a missing data stream or index in the target indices or data streams return an error.' }); /** @@ -35136,8 +28956,7 @@ export const indices_flush_index = types_indices; * This behavior applies even if the request targets other open indices. */ export const indices_flush_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' }); /** @@ -35151,15 +28970,14 @@ export const indices_flush_expand_wildcards = types_expand_wildcards; * If `true`, the request forces a flush even if there are no changes to commit to the index. */ export const indices_flush_force = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request forces a flush even if there are no changes to commit to the index.', + description: 'If `true`, the request forces a flush even if there are no changes to commit to the index.' }); /** * If `false`, the request returns an error if it targets a missing or closed index. */ export const indices_flush_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `false`, the request returns an error if it targets a missing or closed index.', + description: 'If `false`, the request returns an error if it targets a missing or closed index.' }); /** @@ -35167,8 +28985,7 @@ export const indices_flush_ignore_unavailable = z.boolean().register(z.globalReg * If `false`, Elasticsearch returns an error if you request a flush when another flush operation is running. */ export const indices_flush_wait_if_ongoing = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the flush operation blocks until execution when another flush operation is running.\nIf `false`, Elasticsearch returns an error if you request a flush when another flush operation is running.', + description: 'If `true`, the flush operation blocks until execution when another flush operation is running.\nIf `false`, Elasticsearch returns an error if you request a flush when another flush operation is running.' }); /** @@ -35177,11 +28994,11 @@ export const indices_flush_wait_if_ongoing = z.boolean().register(z.globalRegist export const indices_forcemerge_index = types_indices; /** - * Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * Whether to ignore if a wildcard indices expression resolves into no concrete indices. + * (This includes `_all` string or when no indices have been specified) */ export const indices_forcemerge_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' }); /** @@ -35190,40 +29007,38 @@ export const indices_forcemerge_allow_no_indices = z.boolean().register(z.global export const indices_forcemerge_expand_wildcards = types_expand_wildcards; /** - * Specify whether the index should be flushed after performing the operation (default: true) + * Specify whether the index should be flushed after performing the operation */ export const indices_forcemerge_flush = z.boolean().register(z.globalRegistry, { - description: - 'Specify whether the index should be flushed after performing the operation (default: true)', + description: 'Specify whether the index should be flushed after performing the operation' }); /** * Whether specified concrete indices should be ignored when unavailable (missing or closed) */ export const indices_forcemerge_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: - 'Whether specified concrete indices should be ignored when unavailable (missing or closed)', + description: 'Whether specified concrete indices should be ignored when unavailable (missing or closed)' }); /** - * The number of segments the index should be merged into (default: dynamic) + * The number of segments the index should be merged into (defayult: dynamic) */ export const indices_forcemerge_max_num_segments = z.number().register(z.globalRegistry, { - description: 'The number of segments the index should be merged into (default: dynamic)', + description: 'The number of segments the index should be merged into (defayult: dynamic)' }); /** * Specify whether the operation should only expunge deleted documents */ export const indices_forcemerge_only_expunge_deletes = z.boolean().register(z.globalRegistry, { - description: 'Specify whether the operation should only expunge deleted documents', + description: 'Specify whether the operation should only expunge deleted documents' }); /** - * Should the request wait until the force merge is completed. + * Should the request wait until the force merge is completed */ export const indices_forcemerge_wait_for_completion = z.boolean().register(z.globalRegistry, { - description: 'Should the request wait until the force merge is completed.', + description: 'Should the request wait until the force merge is completed' }); /** @@ -35245,8 +29060,7 @@ export const indices_get_alias_index = types_indices; * This behavior applies even if the request targets other open indices. */ export const indices_get_alias_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' }); /** @@ -35260,7 +29074,7 @@ export const indices_get_alias_expand_wildcards = types_expand_wildcards; * If `false`, the request returns an error if it targets a missing or closed index. */ export const indices_get_alias_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `false`, the request returns an error if it targets a missing or closed index.', + description: 'If `false`, the request returns an error if it targets a missing or closed index.' }); /** @@ -35285,7 +29099,7 @@ export const indices_get_data_stream_expand_wildcards = types_expand_wildcards; * If true, returns all relevant default configurations for the index template. */ export const indices_get_data_stream_include_defaults = z.boolean().register(z.globalRegistry, { - description: 'If true, returns all relevant default configurations for the index template.', + description: 'If true, returns all relevant default configurations for the index template.' }); /** @@ -35297,8 +29111,7 @@ export const indices_get_data_stream_master_timeout = types_duration; * Whether the maximum timestamp for each data stream should be calculated and returned. */ export const indices_get_data_stream_verbose = z.boolean().register(z.globalRegistry, { - description: - 'Whether the maximum timestamp for each data stream should be calculated and returned.', + description: 'Whether the maximum timestamp for each data stream should be calculated and returned.' }); /** @@ -35319,8 +29132,7 @@ export const indices_get_field_mapping_index = types_indices; * This behavior applies even if the request targets other open indices. */ export const indices_get_field_mapping_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' }); /** @@ -35334,14 +29146,14 @@ export const indices_get_field_mapping_expand_wildcards = types_expand_wildcards * If `false`, the request returns an error if it targets a missing or closed index. */ export const indices_get_field_mapping_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `false`, the request returns an error if it targets a missing or closed index.', + description: 'If `false`, the request returns an error if it targets a missing or closed index.' }); /** * If `true`, return all default settings in the response. */ export const indices_get_field_mapping_include_defaults = z.boolean().register(z.globalRegistry, { - description: 'If `true`, return all default settings in the response.', + description: 'If `true`, return all default settings in the response.' }); /** @@ -35355,15 +29167,14 @@ export const indices_get_index_template_name = types_name; * @deprecated */ export const indices_get_index_template_local = z.boolean().register(z.globalRegistry, { - description: - 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.', + description: 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.' }); /** * If true, returns settings in flat format. */ export const indices_get_index_template_flat_settings = z.boolean().register(z.globalRegistry, { - description: 'If true, returns settings in flat format.', + description: 'If true, returns settings in flat format.' }); /** @@ -35375,7 +29186,7 @@ export const indices_get_index_template_master_timeout = types_duration; * If true, returns all relevant default configurations for the index template. */ export const indices_get_index_template_include_defaults = z.boolean().register(z.globalRegistry, { - description: 'If true, returns all relevant default configurations for the index template.', + description: 'If true, returns all relevant default configurations for the index template.' }); /** @@ -35390,8 +29201,7 @@ export const indices_get_mapping_index = types_indices; * This behavior applies even if the request targets other open indices. */ export const indices_get_mapping_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' }); /** @@ -35405,7 +29215,7 @@ export const indices_get_mapping_expand_wildcards = types_expand_wildcards; * If `false`, the request returns an error if it targets a missing or closed index. */ export const indices_get_mapping_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `false`, the request returns an error if it targets a missing or closed index.', + description: 'If `false`, the request returns an error if it targets a missing or closed index.' }); /** @@ -35414,7 +29224,7 @@ export const indices_get_mapping_ignore_unavailable = z.boolean().register(z.glo * @deprecated */ export const indices_get_mapping_local = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request retrieves information from the local node only.', + description: 'If `true`, the request retrieves information from the local node only.' }); /** @@ -35443,8 +29253,7 @@ export const indices_get_settings_name = types_names; * starts with foo but no index starts with `bar`. */ export const indices_get_settings_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index\nalias, or `_all` value targets only missing or closed indices. This\nbehavior applies even if the request targets other open indices. For\nexample, a request targeting `foo*,bar*` returns an error if an index\nstarts with foo but no index starts with `bar`.', + description: 'If `false`, the request returns an error if any wildcard expression, index\nalias, or `_all` value targets only missing or closed indices. This\nbehavior applies even if the request targets other open indices. For\nexample, a request targeting `foo*,bar*` returns an error if an index\nstarts with foo but no index starts with `bar`.' }); /** @@ -35458,21 +29267,21 @@ export const indices_get_settings_expand_wildcards = types_expand_wildcards; * If `true`, returns settings in flat format. */ export const indices_get_settings_flat_settings = z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', + description: 'If `true`, returns settings in flat format.' }); /** * If `false`, the request returns an error if it targets a missing or closed index. */ export const indices_get_settings_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `false`, the request returns an error if it targets a missing or closed index.', + description: 'If `false`, the request returns an error if it targets a missing or closed index.' }); /** * If `true`, return all default settings in the response. */ export const indices_get_settings_include_defaults = z.boolean().register(z.globalRegistry, { - description: 'If `true`, return all default settings in the response.', + description: 'If `true`, return all default settings in the response.' }); /** @@ -35482,8 +29291,7 @@ export const indices_get_settings_include_defaults = z.boolean().register(z.glob * @deprecated */ export const indices_get_settings_local = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request retrieves information from the local node only. If\n`false`, information is retrieved from the master node.', + description: 'If `true`, the request retrieves information from the local node only. If\n`false`, information is retrieved from the master node.' }); /** @@ -35504,7 +29312,7 @@ export const indices_get_template_name = types_names; * If `true`, returns settings in flat format. */ export const indices_get_template_flat_settings = z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', + description: 'If `true`, returns settings in flat format.' }); /** @@ -35513,7 +29321,7 @@ export const indices_get_template_flat_settings = z.boolean().register(z.globalR * @deprecated */ export const indices_get_template_local = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request retrieves information from the local node only.', + description: 'If `true`, the request retrieves information from the local node only.' }); /** @@ -35557,7 +29365,7 @@ export const indices_put_index_template_name = types_name; * If `true`, this request cannot replace or update existing index templates. */ export const indices_put_index_template_create = z.boolean().register(z.globalRegistry, { - description: 'If `true`, this request cannot replace or update existing index templates.', + description: 'If `true`, this request cannot replace or update existing index templates.' }); /** @@ -35567,14 +29375,15 @@ export const indices_put_index_template_create = z.boolean().register(z.globalRe export const indices_put_index_template_master_timeout = types_duration; /** - * User defined reason for creating/updating the index template + * User defined reason for creating or updating the index template */ export const indices_put_index_template_cause = z.string().register(z.globalRegistry, { - description: 'User defined reason for creating/updating the index template', + description: 'User defined reason for creating or updating the index template' }); /** - * A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. + * A comma-separated list of index names the mapping should be added to (supports wildcards). + * Use `_all` or omit to add the mapping on all indices. */ export const indices_put_mapping_index = types_indices; @@ -35583,8 +29392,7 @@ export const indices_put_mapping_index = types_indices; * This behavior applies even if the request targets other open indices. */ export const indices_put_mapping_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' }); /** @@ -35598,7 +29406,7 @@ export const indices_put_mapping_expand_wildcards = types_expand_wildcards; * If `false`, the request returns an error if it targets a missing or closed index. */ export const indices_put_mapping_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `false`, the request returns an error if it targets a missing or closed index.', + description: 'If `false`, the request returns an error if it targets a missing or closed index.' }); /** @@ -35617,8 +29425,7 @@ export const indices_put_mapping_timeout = types_duration; * If `true`, the mappings are applied only to the current write index for the target. */ export const indices_put_mapping_write_index_only = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the mappings are applied only to the current write index for the target.', + description: 'If `true`, the mappings are applied only to the current write index for the target.' }); /** @@ -35636,8 +29443,7 @@ export const indices_put_settings_index = types_indices; * starts with `foo` but no index starts with `bar`. */ export const indices_put_settings_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index\nalias, or `_all` value targets only missing or closed indices. This\nbehavior applies even if the request targets other open indices. For\nexample, a request targeting `foo*,bar*` returns an error if an index\nstarts with `foo` but no index starts with `bar`.', + description: 'If `false`, the request returns an error if any wildcard expression, index\nalias, or `_all` value targets only missing or closed indices. This\nbehavior applies even if the request targets other open indices. For\nexample, a request targeting `foo*,bar*` returns an error if an index\nstarts with `foo` but no index starts with `bar`.' }); /** @@ -35652,14 +29458,14 @@ export const indices_put_settings_expand_wildcards = types_expand_wildcards; * If `true`, returns settings in flat format. */ export const indices_put_settings_flat_settings = z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', + description: 'If `true`, returns settings in flat format.' }); /** * If `true`, returns settings in flat format. */ export const indices_put_settings_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', + description: 'If `true`, returns settings in flat format.' }); /** @@ -35673,7 +29479,7 @@ export const indices_put_settings_master_timeout = types_duration; * If `true`, existing index settings remain unchanged. */ export const indices_put_settings_preserve_existing = z.boolean().register(z.globalRegistry, { - description: 'If `true`, existing index settings remain unchanged.', + description: 'If `true`, existing index settings remain unchanged.' }); /** @@ -35682,8 +29488,7 @@ export const indices_put_settings_preserve_existing = z.boolean().register(z.glo * will be closed temporarily and then reopened in order to apply the changes. */ export const indices_put_settings_reopen = z.boolean().register(z.globalRegistry, { - description: - 'Whether to close and reopen the index to apply non-dynamic settings.\nIf set to `true` the indices to which the settings are being applied\nwill be closed temporarily and then reopened in order to apply the changes.', + description: 'Whether to close and reopen the index to apply non-dynamic settings.\nIf set to `true` the indices to which the settings are being applied\nwill be closed temporarily and then reopened in order to apply the changes.' }); /** @@ -35701,7 +29506,7 @@ export const indices_put_template_name = types_name; * If true, this request cannot replace or update existing index templates. */ export const indices_put_template_create = z.boolean().register(z.globalRegistry, { - description: 'If true, this request cannot replace or update existing index templates.', + description: 'If true, this request cannot replace or update existing index templates.' }); /** @@ -35718,15 +29523,14 @@ export const indices_put_template_master_timeout = types_duration; * 'order' values are merged later, overriding templates with lower values. */ export const indices_put_template_order = z.number().register(z.globalRegistry, { - description: - "Order in which Elasticsearch applies this template if index\nmatches multiple templates.\n\nTemplates with lower 'order' values are merged first. Templates with higher\n'order' values are merged later, overriding templates with lower values.", + description: 'Order in which Elasticsearch applies this template if index\nmatches multiple templates.\n\nTemplates with lower \'order\' values are merged first. Templates with higher\n\'order\' values are merged later, overriding templates with lower values.' }); /** - * User defined reason for creating/updating the index template + * User defined reason for creating or updating the index template */ export const indices_put_template_cause = z.string().register(z.globalRegistry, { - description: 'User defined reason for creating/updating the index template', + description: 'User defined reason for creating or updating the index template' }); /** @@ -35740,14 +29544,14 @@ export const indices_recovery_index = types_indices; * If `true`, the response only includes ongoing shard recoveries. */ export const indices_recovery_active_only = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response only includes ongoing shard recoveries.', + description: 'If `true`, the response only includes ongoing shard recoveries.' }); /** * If `true`, the response includes detailed information about shard recoveries. */ export const indices_recovery_detailed = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes detailed information about shard recoveries.', + description: 'If `true`, the response includes detailed information about shard recoveries.' }); /** @@ -35755,8 +29559,7 @@ export const indices_recovery_detailed = z.boolean().register(z.globalRegistry, * This behavior applies even if the request targets other open indices. */ export const indices_recovery_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' }); /** @@ -35770,7 +29573,7 @@ export const indices_recovery_expand_wildcards = types_expand_wildcards; * If `false`, the request returns an error if it targets a missing or closed index. */ export const indices_recovery_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `false`, the request returns an error if it targets a missing or closed index.', + description: 'If `false`, the request returns an error if it targets a missing or closed index.' }); /** @@ -35785,8 +29588,7 @@ export const indices_refresh_index = types_indices; * This behavior applies even if the request targets other open indices. */ export const indices_refresh_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' }); /** @@ -35800,7 +29602,7 @@ export const indices_refresh_expand_wildcards = types_expand_wildcards; * If `false`, the request returns an error if it targets a missing or closed index. */ export const indices_refresh_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `false`, the request returns an error if it targets a missing or closed index.', + description: 'If `false`, the request returns an error if it targets a missing or closed index.' }); /** @@ -35809,14 +29611,12 @@ export const indices_refresh_ignore_unavailable = z.boolean().register(z.globalR export const indices_reload_search_analyzers_index = types_indices; /** - * Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * Whether to ignore if a wildcard indices expression resolves into no concrete indices. + * (This includes `_all` string or when no indices have been specified) */ -export const indices_reload_search_analyzers_allow_no_indices = z - .boolean() - .register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', - }); +export const indices_reload_search_analyzers_allow_no_indices = z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' +}); /** * Whether to expand wildcard expression to concrete indices that are open, closed or both. @@ -35826,18 +29626,15 @@ export const indices_reload_search_analyzers_expand_wildcards = types_expand_wil /** * Whether specified concrete indices should be ignored when unavailable (missing or closed) */ -export const indices_reload_search_analyzers_ignore_unavailable = z - .boolean() - .register(z.globalRegistry, { - description: - 'Whether specified concrete indices should be ignored when unavailable (missing or closed)', - }); +export const indices_reload_search_analyzers_ignore_unavailable = z.boolean().register(z.globalRegistry, { + description: 'Whether specified concrete indices should be ignored when unavailable (missing or closed)' +}); /** * Changed resource to reload analyzers from if applicable */ export const indices_reload_search_analyzers_resource = z.string().register(z.globalRegistry, { - description: 'Changed resource to reload analyzers from if applicable', + description: 'Changed resource to reload analyzers from if applicable' }); /** @@ -35857,8 +29654,7 @@ export const indices_resolve_cluster_name = types_names; * options to the `_resolve/cluster` API endpoint that takes no index expression. */ export const indices_resolve_cluster_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing\nor closed indices. This behavior applies even if the request targets other open indices. For example, a request\ntargeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.', + description: 'If false, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing\nor closed indices. This behavior applies even if the request targets other open indices. For example, a request\ntargeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.' }); /** @@ -35878,8 +29674,7 @@ export const indices_resolve_cluster_expand_wildcards = types_expand_wildcards; * @deprecated */ export const indices_resolve_cluster_ignore_throttled = z.boolean().register(z.globalRegistry, { - description: - 'If true, concrete, expanded, or aliased indices are ignored when frozen.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.', + description: 'If true, concrete, expanded, or aliased indices are ignored when frozen.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.' }); /** @@ -35888,8 +29683,7 @@ export const indices_resolve_cluster_ignore_throttled = z.boolean().register(z.g * options to the `_resolve/cluster` API endpoint that takes no index expression. */ export const indices_resolve_cluster_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if it targets a missing or closed index.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.', + description: 'If false, the request returns an error if it targets a missing or closed index.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.' }); /** @@ -35920,8 +29714,7 @@ export const indices_rollover_new_index = types_index_name; * If `true`, checks whether the current index satisfies the specified conditions but does not perform a rollover. */ export const indices_rollover_dry_run = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, checks whether the current index satisfies the specified conditions but does not perform a rollover.', + description: 'If `true`, checks whether the current index satisfies the specified conditions but does not perform a rollover.' }); /** @@ -35947,8 +29740,7 @@ export const indices_rollover_wait_for_active_shards = types_wait_for_active_sha * Only allowed on data streams. */ export const indices_rollover_lazy = z.boolean().register(z.globalRegistry, { - description: - 'If set to true, the rollover action will only mark a data stream to signal that it needs to be rolled over at the next write.\nOnly allowed on data streams.', + description: 'If set to true, the rollover action will only mark a data stream to signal that it needs to be rolled over at the next write.\nOnly allowed on data streams.' }); /** @@ -35963,8 +29755,7 @@ export const indices_segments_index = types_indices; * This behavior applies even if the request targets other open indices. */ export const indices_segments_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' }); /** @@ -35978,7 +29769,7 @@ export const indices_segments_expand_wildcards = types_expand_wildcards; * If `false`, the request returns an error if it targets a missing or closed index. */ export const indices_segments_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `false`, the request returns an error if it targets a missing or closed index.', + description: 'If `false`, the request returns an error if it targets a missing or closed index.' }); /** @@ -35992,8 +29783,7 @@ export const indices_shard_stores_index = types_indices; * targets other open indices. */ export const indices_shard_stores_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or _all\nvalue targets only missing or closed indices. This behavior applies even if the request\ntargets other open indices.', + description: 'If false, the request returns an error if any wildcard expression, index alias, or _all\nvalue targets only missing or closed indices. This behavior applies even if the request\ntargets other open indices.' }); /** @@ -36006,15 +29796,15 @@ export const indices_shard_stores_expand_wildcards = types_expand_wildcards; * If true, missing or closed indices are not included in the response. */ export const indices_shard_stores_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', + description: 'If true, missing or closed indices are not included in the response.' }); /** * List of shard health statuses used to limit the request. */ export const indices_shard_stores_status = z.union([ - indices_shard_stores_shard_store_status, - z.array(indices_shard_stores_shard_store_status), + indices_shard_stores_shard_store_status, + z.array(indices_shard_stores_shard_store_status) ]); /** @@ -36055,15 +29845,14 @@ export const indices_simulate_template_name = types_name; * If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. */ export const indices_simulate_template_create = z.boolean().register(z.globalRegistry, { - description: - 'If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation.', + description: 'If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation.' }); /** * User defined reason for dry-run creating the new template for simulation purposes */ export const indices_simulate_template_cause = z.string().register(z.globalRegistry, { - description: 'User defined reason for dry-run creating the new template for simulation purposes', + description: 'User defined reason for dry-run creating the new template for simulation purposes' }); /** @@ -36075,7 +29864,7 @@ export const indices_simulate_template_master_timeout = types_duration; * If true, returns all relevant default configurations for the index template. */ export const indices_simulate_template_include_defaults = z.boolean().register(z.globalRegistry, { - description: 'If true, returns all relevant default configurations for the index template.', + description: 'If true, returns all relevant default configurations for the index template.' }); /** @@ -36107,7 +29896,7 @@ export const indices_split_timeout = types_duration; export const indices_split_wait_for_active_shards = types_wait_for_active_shards; /** - * Limit the information returned the specific metrics. + * Limit the information returned the specific metrics */ export const indices_stats_metric = types_common_stats_flags; @@ -36142,28 +29931,29 @@ export const indices_stats_fields = types_fields; * If true, statistics are not collected from closed indices. */ export const indices_stats_forbid_closed_indices = z.boolean().register(z.globalRegistry, { - description: 'If true, statistics are not collected from closed indices.', + description: 'If true, statistics are not collected from closed indices.' }); /** * Comma-separated list of search groups to include in the search statistics. */ -export const indices_stats_groups = z.union([z.string(), z.array(z.string())]); +export const indices_stats_groups = z.union([ + z.string(), + z.array(z.string()) +]); /** * If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). */ export const indices_stats_include_segment_file_sizes = z.boolean().register(z.globalRegistry, { - description: - 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).', + description: 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).' }); /** * If true, the response includes information from segments that are not loaded into memory. */ export const indices_stats_include_unloaded_segments = z.boolean().register(z.globalRegistry, { - description: - 'If true, the response includes information from segments that are not loaded into memory.', + description: 'If true, the response includes information from segments that are not loaded into memory.' }); /** @@ -36183,16 +29973,14 @@ export const indices_validate_query_index = types_indices; * This behavior applies even if the request targets other open indices. */ export const indices_validate_query_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' }); /** * If `true`, the validation is executed on all shards instead of one random shard per index. */ export const indices_validate_query_all_shards = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the validation is executed on all shards instead of one random shard per index.', + description: 'If `true`, the validation is executed on all shards instead of one random shard per index.' }); /** @@ -36200,15 +29988,14 @@ export const indices_validate_query_all_shards = z.boolean().register(z.globalRe * This parameter can only be used when the `q` query string parameter is specified. */ export const indices_validate_query_analyzer = z.string().register(z.globalRegistry, { - description: - 'Analyzer to use for the query string.\nThis parameter can only be used when the `q` query string parameter is specified.', + description: 'Analyzer to use for the query string.\nThis parameter can only be used when the `q` query string parameter is specified.' }); /** * If `true`, wildcard and prefix queries are analyzed. */ export const indices_validate_query_analyze_wildcard = z.boolean().register(z.globalRegistry, { - description: 'If `true`, wildcard and prefix queries are analyzed.', + description: 'If `true`, wildcard and prefix queries are analyzed.' }); /** @@ -36221,8 +30008,7 @@ export const indices_validate_query_default_operator = types_query_dsl_operator; * This parameter can only be used when the `q` query string parameter is specified. */ export const indices_validate_query_df = z.string().register(z.globalRegistry, { - description: - 'Field to use as default where no field prefix is given in the query string.\nThis parameter can only be used when the `q` query string parameter is specified.', + description: 'Field to use as default where no field prefix is given in the query string.\nThis parameter can only be used when the `q` query string parameter is specified.' }); /** @@ -36236,37 +30022,35 @@ export const indices_validate_query_expand_wildcards = types_expand_wildcards; * If `true`, the response returns detailed information if an error has occurred. */ export const indices_validate_query_explain = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response returns detailed information if an error has occurred.', + description: 'If `true`, the response returns detailed information if an error has occurred.' }); /** * If `false`, the request returns an error if it targets a missing or closed index. */ export const indices_validate_query_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `false`, the request returns an error if it targets a missing or closed index.', + description: 'If `false`, the request returns an error if it targets a missing or closed index.' }); /** * If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. */ export const indices_validate_query_lenient = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.', + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.' }); /** * If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed. */ export const indices_validate_query_rewrite = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed.', + description: 'If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed.' }); /** * Query in the Lucene query string syntax. */ export const indices_validate_query_q = z.string().register(z.globalRegistry, { - description: 'Query in the Lucene query string syntax.', + description: 'Query in the Lucene query string syntax.' }); /** @@ -36283,16 +30067,14 @@ export const inference_delete_inference_id = types_id; * When true, checks the semantic_text fields and inference processors that reference the endpoint and returns them in a list, but does not delete the endpoint. */ export const inference_delete_dry_run = z.boolean().register(z.globalRegistry, { - description: - 'When true, checks the semantic_text fields and inference processors that reference the endpoint and returns them in a list, but does not delete the endpoint.', + description: 'When true, checks the semantic_text fields and inference processors that reference the endpoint and returns them in a list, but does not delete the endpoint.' }); /** * When true, the inference endpoint is forcefully deleted even if it is still being used by ingest processors or semantic text fields. */ export const inference_delete_force = z.boolean().register(z.globalRegistry, { - description: - 'When true, the inference endpoint is forcefully deleted even if it is still being used by ingest processors or semantic text fields.', + description: 'When true, the inference endpoint is forcefully deleted even if it is still being used by ingest processors or semantic text fields.' }); /** @@ -36373,10 +30155,10 @@ export const ingest_get_pipeline_id = types_id; export const ingest_get_pipeline_master_timeout = types_duration; /** - * Return pipelines without their definitions (default: false) + * Return pipelines without their definitions */ export const ingest_get_pipeline_summary = z.boolean().register(z.globalRegistry, { - description: 'Return pipelines without their definitions (default: false)', + description: 'Return pipelines without their definitions' }); /** @@ -36389,15 +30171,14 @@ export const ingest_simulate_id = types_id; * If `true`, the response includes output data for each processor in the executed pipeline. */ export const ingest_simulate_verbose = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes output data for each processor in the executed pipeline.', + description: 'If `true`, the response includes output data for each processor in the executed pipeline.' }); /** * Specifies whether you acknowledge the license changes. */ export const license_post_acknowledge = z.boolean().register(z.globalRegistry, { - description: 'Specifies whether you acknowledge the license changes.', + description: 'Specifies whether you acknowledge the license changes.' }); /** @@ -36424,22 +30205,21 @@ export const mget_index = types_index_name; * Specifies the node or shard the operation should be performed on. Random by default. */ export const mget_preference = z.string().register(z.globalRegistry, { - description: - 'Specifies the node or shard the operation should be performed on. Random by default.', + description: 'Specifies the node or shard the operation should be performed on. Random by default.' }); /** * If `true`, the request is real-time as opposed to near-real-time. */ export const mget_realtime = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request is real-time as opposed to near-real-time.', + description: 'If `true`, the request is real-time as opposed to near-real-time.' }); /** * If `true`, the request refreshes relevant shards before retrieving documents. */ export const mget_refresh = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request refreshes relevant shards before retrieving documents.', + description: 'If `true`, the request refreshes relevant shards before retrieving documents.' }); /** @@ -36486,8 +30266,7 @@ export const ml_delete_expired_data_job_id = types_id; * behavior is no throttling. */ export const ml_delete_expired_data_requests_per_second = z.number().register(z.globalRegistry, { - description: - 'The desired requests per second for the deletion processes. The default\nbehavior is no throttling.', + description: 'The desired requests per second for the deletion processes. The default\nbehavior is no throttling.' }); /** @@ -36514,8 +30293,7 @@ export const ml_delete_forecast_forecast_id = types_id; * return an error. */ export const ml_delete_forecast_allow_no_forecasts = z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether an error occurs when there are no forecasts. In\nparticular, if this parameter is set to `false` and there are no\nforecasts associated with the job, attempts to delete all forecasts\nreturn an error.', + description: 'Specifies whether an error occurs when there are no forecasts. In\nparticular, if this parameter is set to `false` and there are no\nforecasts associated with the job, attempts to delete all forecasts\nreturn an error.' }); /** @@ -36547,14 +30325,14 @@ export const ml_get_buckets_timestamp = types_date_time; * Returns buckets with anomaly scores greater or equal than this value. */ export const ml_get_buckets_anomaly_score = z.number().register(z.globalRegistry, { - description: 'Returns buckets with anomaly scores greater or equal than this value.', + description: 'Returns buckets with anomaly scores greater or equal than this value.' }); /** * If `true`, the buckets are sorted in descending order. */ export const ml_get_buckets_desc = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the buckets are sorted in descending order.', + description: 'If `true`, the buckets are sorted in descending order.' }); /** @@ -36567,28 +30345,28 @@ export const ml_get_buckets_end = types_date_time; * If `true`, the output excludes interim results. */ export const ml_get_buckets_exclude_interim = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the output excludes interim results.', + description: 'If `true`, the output excludes interim results.' }); /** * If true, the output includes anomaly records. */ export const ml_get_buckets_expand = z.boolean().register(z.globalRegistry, { - description: 'If true, the output includes anomaly records.', + description: 'If true, the output includes anomaly records.' }); /** * Skips the specified number of buckets. */ export const ml_get_buckets_from = z.number().register(z.globalRegistry, { - description: 'Skips the specified number of buckets.', + description: 'Skips the specified number of buckets.' }); /** * Specifies the maximum number of buckets to obtain. */ export const ml_get_buckets_size = z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of buckets to obtain.', + description: 'Specifies the maximum number of buckets to obtain.' }); /** @@ -36611,16 +30389,14 @@ export const ml_get_calendars_calendar_id = types_id; * Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier. */ export const ml_get_calendars_from = z.number().register(z.globalRegistry, { - description: - 'Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier.', + description: 'Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier.' }); /** * Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier. */ export const ml_get_calendars_size = z.number().register(z.globalRegistry, { - description: - 'Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier.', + description: 'Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier.' }); /** @@ -36641,21 +30417,21 @@ export const ml_get_categories_category_id = types_category_id; * Skips the specified number of categories. */ export const ml_get_categories_from = z.number().register(z.globalRegistry, { - description: 'Skips the specified number of categories.', + description: 'Skips the specified number of categories.' }); /** * Only return categories for the specified partition. */ export const ml_get_categories_partition_field_value = z.string().register(z.globalRegistry, { - description: 'Only return categories for the specified partition.', + description: 'Only return categories for the specified partition.' }); /** * Specifies the maximum number of categories to obtain. */ export const ml_get_categories_size = z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of categories to obtain.', + description: 'Specifies the maximum number of categories to obtain.' }); /** @@ -36679,22 +30455,21 @@ export const ml_get_data_frame_analytics_id = types_id; * there are no matches or only partial matches. */ export const ml_get_data_frame_analytics_allow_no_match = z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value returns an empty data_frame_analytics array when there\nare no matches and the subset of results when there are partial matches.\nIf this parameter is `false`, the request returns a 404 status code when\nthere are no matches or only partial matches.', + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value returns an empty data_frame_analytics array when there\nare no matches and the subset of results when there are partial matches.\nIf this parameter is `false`, the request returns a 404 status code when\nthere are no matches or only partial matches.' }); /** * Skips the specified number of data frame analytics jobs. */ export const ml_get_data_frame_analytics_from = z.number().register(z.globalRegistry, { - description: 'Skips the specified number of data frame analytics jobs.', + description: 'Skips the specified number of data frame analytics jobs.' }); /** * Specifies the maximum number of data frame analytics jobs to obtain. */ export const ml_get_data_frame_analytics_size = z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of data frame analytics jobs to obtain.', + description: 'Specifies the maximum number of data frame analytics jobs to obtain.' }); /** @@ -36702,12 +30477,9 @@ export const ml_get_data_frame_analytics_size = z.number().register(z.globalRegi * retrieval. This allows the configuration to be in an acceptable format to * be retrieved and then added to another cluster. */ -export const ml_get_data_frame_analytics_exclude_generated = z - .boolean() - .register(z.globalRegistry, { - description: - 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.', - }); +export const ml_get_data_frame_analytics_exclude_generated = z.boolean().register(z.globalRegistry, { + description: 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.' +}); /** * Identifier for the data frame analytics job. If you do not specify this @@ -36729,32 +30501,29 @@ export const ml_get_data_frame_analytics_stats_id = types_id; * If this parameter is `false`, the request returns a 404 status code when * there are no matches or only partial matches. */ -export const ml_get_data_frame_analytics_stats_allow_no_match = z - .boolean() - .register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value returns an empty data_frame_analytics array when there\nare no matches and the subset of results when there are partial matches.\nIf this parameter is `false`, the request returns a 404 status code when\nthere are no matches or only partial matches.', - }); +export const ml_get_data_frame_analytics_stats_allow_no_match = z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value returns an empty data_frame_analytics array when there\nare no matches and the subset of results when there are partial matches.\nIf this parameter is `false`, the request returns a 404 status code when\nthere are no matches or only partial matches.' +}); /** * Skips the specified number of data frame analytics jobs. */ export const ml_get_data_frame_analytics_stats_from = z.number().register(z.globalRegistry, { - description: 'Skips the specified number of data frame analytics jobs.', + description: 'Skips the specified number of data frame analytics jobs.' }); /** * Specifies the maximum number of data frame analytics jobs to obtain. */ export const ml_get_data_frame_analytics_stats_size = z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of data frame analytics jobs to obtain.', + description: 'Specifies the maximum number of data frame analytics jobs to obtain.' }); /** * Defines whether the stats response should be verbose. */ export const ml_get_data_frame_analytics_stats_verbose = z.boolean().register(z.globalRegistry, { - description: 'Defines whether the stats response should be verbose.', + description: 'Defines whether the stats response should be verbose.' }); /** @@ -36777,8 +30546,7 @@ export const ml_get_datafeed_stats_datafeed_id = types_ids; * `404` status code when there are no matches or only partial matches. */ export const ml_get_datafeed_stats_allow_no_match = z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no datafeeds that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `datafeeds` array\nwhen there are no matches and the subset of results when there are\npartial matches. If this parameter is `false`, the request returns a\n`404` status code when there are no matches or only partial matches.', + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no datafeeds that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `datafeeds` array\nwhen there are no matches and the subset of results when there are\npartial matches. If this parameter is `false`, the request returns a\n`404` status code when there are no matches or only partial matches.' }); /** @@ -36801,8 +30569,7 @@ export const ml_get_datafeeds_datafeed_id = types_ids; * `404` status code when there are no matches or only partial matches. */ export const ml_get_datafeeds_allow_no_match = z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no datafeeds that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `datafeeds` array\nwhen there are no matches and the subset of results when there are\npartial matches. If this parameter is `false`, the request returns a\n`404` status code when there are no matches or only partial matches.', + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no datafeeds that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `datafeeds` array\nwhen there are no matches and the subset of results when there are\npartial matches. If this parameter is `false`, the request returns a\n`404` status code when there are no matches or only partial matches.' }); /** @@ -36811,8 +30578,7 @@ export const ml_get_datafeeds_allow_no_match = z.boolean().register(z.globalRegi * be retrieved and then added to another cluster. */ export const ml_get_datafeeds_exclude_generated = z.boolean().register(z.globalRegistry, { - description: - 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.', + description: 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.' }); /** @@ -36824,14 +30590,14 @@ export const ml_get_filters_filter_id = types_ids; * Skips the specified number of filters. */ export const ml_get_filters_from = z.number().register(z.globalRegistry, { - description: 'Skips the specified number of filters.', + description: 'Skips the specified number of filters.' }); /** * Specifies the maximum number of filters to obtain. */ export const ml_get_filters_size = z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of filters to obtain.', + description: 'Specifies the maximum number of filters to obtain.' }); /** @@ -36843,7 +30609,7 @@ export const ml_get_influencers_job_id = types_id; * If true, the results are sorted in descending order. */ export const ml_get_influencers_desc = z.boolean().register(z.globalRegistry, { - description: 'If true, the results are sorted in descending order.', + description: 'If true, the results are sorted in descending order.' }); /** @@ -36858,8 +30624,7 @@ export const ml_get_influencers_end = types_date_time; * are included. */ export const ml_get_influencers_exclude_interim = z.boolean().register(z.globalRegistry, { - description: - 'If true, the output excludes interim results. By default, interim results\nare included.', + description: 'If true, the output excludes interim results. By default, interim results\nare included.' }); /** @@ -36867,21 +30632,21 @@ export const ml_get_influencers_exclude_interim = z.boolean().register(z.globalR * value. */ export const ml_get_influencers_influencer_score = z.number().register(z.globalRegistry, { - description: 'Returns influencers with anomaly scores greater than or equal to this\nvalue.', + description: 'Returns influencers with anomaly scores greater than or equal to this\nvalue.' }); /** * Skips the specified number of influencers. */ export const ml_get_influencers_from = z.number().register(z.globalRegistry, { - description: 'Skips the specified number of influencers.', + description: 'Skips the specified number of influencers.' }); /** * Specifies the maximum number of influencers to obtain. */ export const ml_get_influencers_size = z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of influencers to obtain.', + description: 'Specifies the maximum number of influencers to obtain.' }); /** @@ -36917,8 +30682,7 @@ export const ml_get_job_stats_job_id = types_id; * code when there are no matches or only partial matches. */ export const ml_get_job_stats_allow_no_match = z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty `jobs` array when\nthere are no matches and the subset of results when there are partial\nmatches. If `false`, the API returns a `404` status\ncode when there are no matches or only partial matches.', + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty `jobs` array when\nthere are no matches and the subset of results when there are partial\nmatches. If `false`, the API returns a `404` status\ncode when there are no matches or only partial matches.' }); /** @@ -36941,8 +30705,7 @@ export const ml_get_jobs_job_id = types_ids; * code when there are no matches or only partial matches. */ export const ml_get_jobs_allow_no_match = z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `jobs` array when\nthere are no matches and the subset of results when there are partial\nmatches. If this parameter is `false`, the request returns a `404` status\ncode when there are no matches or only partial matches.', + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `jobs` array when\nthere are no matches and the subset of results when there are partial\nmatches. If this parameter is `false`, the request returns a `404` status\ncode when there are no matches or only partial matches.' }); /** @@ -36951,8 +30714,7 @@ export const ml_get_jobs_allow_no_match = z.boolean().register(z.globalRegistry, * be retrieved and then added to another cluster. */ export const ml_get_jobs_exclude_generated = z.boolean().register(z.globalRegistry, { - description: - 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.', + description: 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.' }); /** @@ -36989,7 +30751,7 @@ export const ml_get_model_snapshots_snapshot_id = types_id; * If true, the results are sorted in descending order. */ export const ml_get_model_snapshots_desc = z.boolean().register(z.globalRegistry, { - description: 'If true, the results are sorted in descending order.', + description: 'If true, the results are sorted in descending order.' }); /** @@ -37001,14 +30763,14 @@ export const ml_get_model_snapshots_end = types_date_time; * Skips the specified number of snapshots. */ export const ml_get_model_snapshots_from = z.number().register(z.globalRegistry, { - description: 'Skips the specified number of snapshots.', + description: 'Skips the specified number of snapshots.' }); /** * Specifies the maximum number of snapshots to obtain. */ export const ml_get_model_snapshots_size = z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of snapshots to obtain.', + description: 'Specifies the maximum number of snapshots to obtain.' }); /** @@ -37045,8 +30807,7 @@ export const ml_get_overall_buckets_job_id = types_id; * are no matches or only partial matches. */ export const ml_get_overall_buckets_allow_no_match = z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the request returns an empty `jobs` array when there are no\nmatches and the subset of results when there are partial matches. If this\nparameter is `false`, the request returns a `404` status code when there\nare no matches or only partial matches.', + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the request returns an empty `jobs` array when there are no\nmatches and the subset of results when there are partial matches. If this\nparameter is `false`, the request returns a `404` status code when there\nare no matches or only partial matches.' }); /** @@ -37069,7 +30830,7 @@ export const ml_get_overall_buckets_end = types_date_time; * If `true`, the output excludes interim results. */ export const ml_get_overall_buckets_exclude_interim = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the output excludes interim results.', + description: 'If `true`, the output excludes interim results.' }); /** @@ -37077,7 +30838,7 @@ export const ml_get_overall_buckets_exclude_interim = z.boolean().register(z.glo * value. */ export const ml_get_overall_buckets_overall_score = z.number().register(z.globalRegistry, { - description: 'Returns overall buckets with overall scores greater than or equal to this\nvalue.', + description: 'Returns overall buckets with overall scores greater than or equal to this\nvalue.' }); /** @@ -37090,8 +30851,7 @@ export const ml_get_overall_buckets_start = types_date_time; * `overall_score` calculation. */ export const ml_get_overall_buckets_top_n = z.number().register(z.globalRegistry, { - description: - 'The number of top anomaly detection job bucket scores to be used in the\n`overall_score` calculation.', + description: 'The number of top anomaly detection job bucket scores to be used in the\n`overall_score` calculation.' }); /** @@ -37103,7 +30863,7 @@ export const ml_get_records_job_id = types_id; * If true, the results are sorted in descending order. */ export const ml_get_records_desc = z.boolean().register(z.globalRegistry, { - description: 'If true, the results are sorted in descending order.', + description: 'If true, the results are sorted in descending order.' }); /** @@ -37116,28 +30876,28 @@ export const ml_get_records_end = types_date_time; * If `true`, the output excludes interim results. */ export const ml_get_records_exclude_interim = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the output excludes interim results.', + description: 'If `true`, the output excludes interim results.' }); /** * Skips the specified number of records. */ export const ml_get_records_from = z.number().register(z.globalRegistry, { - description: 'Skips the specified number of records.', + description: 'Skips the specified number of records.' }); /** * Returns records with anomaly scores greater or equal than this value. */ export const ml_get_records_record_score = z.number().register(z.globalRegistry, { - description: 'Returns records with anomaly scores greater or equal than this value.', + description: 'Returns records with anomaly scores greater or equal than this value.' }); /** * Specifies the maximum number of records to obtain. */ export const ml_get_records_size = z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of records to obtain.', + description: 'Specifies the maximum number of records to obtain.' }); /** @@ -37171,8 +30931,7 @@ export const ml_get_trained_models_model_id = types_ids; * subset of results when there are partial matches. */ export const ml_get_trained_models_allow_no_match = z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n- Contains wildcard expressions and there are no models that match.\n- Contains the _all string or no identifiers and there are no matches.\n- Contains wildcard expressions and there are only partial matches.\n\nIf true, it returns an empty array when there are no matches and the\nsubset of results when there are partial matches.', + description: 'Specifies what to do when the request:\n\n- Contains wildcard expressions and there are no models that match.\n- Contains the _all string or no identifiers and there are no matches.\n- Contains wildcard expressions and there are only partial matches.\n\nIf true, it returns an empty array when there are no matches and the\nsubset of results when there are partial matches.' }); /** @@ -37180,8 +30939,7 @@ export const ml_get_trained_models_allow_no_match = z.boolean().register(z.globa * JSON map (true) or in a custom compressed format (false). */ export const ml_get_trained_models_decompress_definition = z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether the included model definition should be returned as a\nJSON map (true) or in a custom compressed format (false).', + description: 'Specifies whether the included model definition should be returned as a\nJSON map (true) or in a custom compressed format (false).' }); /** @@ -37190,15 +30948,14 @@ export const ml_get_trained_models_decompress_definition = z.boolean().register( * be retrieved and then added to another cluster. */ export const ml_get_trained_models_exclude_generated = z.boolean().register(z.globalRegistry, { - description: - 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.', + description: 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.' }); /** * Skips the specified number of models. */ export const ml_get_trained_models_from = z.number().register(z.globalRegistry, { - description: 'Skips the specified number of models.', + description: 'Skips the specified number of models.' }); /** @@ -37211,7 +30968,7 @@ export const ml_get_trained_models_include = ml_types_include; * Specifies the maximum number of models to obtain. */ export const ml_get_trained_models_size = z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of models to obtain.', + description: 'Specifies the maximum number of models to obtain.' }); /** @@ -37219,7 +30976,10 @@ export const ml_get_trained_models_size = z.number().register(z.globalRegistry, * none. When supplied, only trained models that contain all the supplied * tags are returned. */ -export const ml_get_trained_models_tags = z.union([z.string(), z.array(z.string())]); +export const ml_get_trained_models_tags = z.union([ + z.string(), + z.array(z.string()) +]); /** * The unique identifier of the trained model or a model alias. It can be a @@ -37238,22 +30998,21 @@ export const ml_get_trained_models_stats_model_id = types_ids; * subset of results when there are partial matches. */ export const ml_get_trained_models_stats_allow_no_match = z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n- Contains wildcard expressions and there are no models that match.\n- Contains the _all string or no identifiers and there are no matches.\n- Contains wildcard expressions and there are only partial matches.\n\nIf true, it returns an empty array when there are no matches and the\nsubset of results when there are partial matches.', + description: 'Specifies what to do when the request:\n\n- Contains wildcard expressions and there are no models that match.\n- Contains the _all string or no identifiers and there are no matches.\n- Contains wildcard expressions and there are only partial matches.\n\nIf true, it returns an empty array when there are no matches and the\nsubset of results when there are partial matches.' }); /** * Skips the specified number of models. */ export const ml_get_trained_models_stats_from = z.number().register(z.globalRegistry, { - description: 'Skips the specified number of models.', + description: 'Skips the specified number of models.' }); /** * Specifies the maximum number of models to obtain. */ export const ml_get_trained_models_stats_size = z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of models to obtain.', + description: 'Specifies the maximum number of models to obtain.' }); /** @@ -37288,16 +31047,14 @@ export const msearch_index = types_indices; * If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. */ export const msearch_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.', + description: 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.' }); /** * If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests. */ export const msearch_ccs_minimize_roundtrips = z.boolean().register(z.globalRegistry, { - description: - 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.', + description: 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.' }); /** @@ -37311,14 +31068,14 @@ export const msearch_expand_wildcards = types_expand_wildcards; * @deprecated */ export const msearch_ignore_throttled = z.boolean().register(z.globalRegistry, { - description: 'If true, concrete, expanded or aliased indices are ignored when frozen.', + description: 'If true, concrete, expanded or aliased indices are ignored when frozen.' }); /** * If true, missing or closed indices are not included in the response. */ export const msearch_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', + description: 'If true, missing or closed indices are not included in the response.' }); /** @@ -37330,8 +31087,7 @@ export const msearch_ignore_unavailable = z.boolean().register(z.globalRegistry, * However, using computationally expensive named queries on a large number of hits may add significant overhead. */ export const msearch_include_named_queries_score = z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.', + description: 'Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.' }); /** @@ -37344,32 +31100,28 @@ export const msearch_index2 = types_indices; * Defaults to `max(1, (# of data nodes * min(search thread pool size, 10)))`. */ export const msearch_max_concurrent_searches = z.number().register(z.globalRegistry, { - description: - 'Maximum number of concurrent searches the multi search API can execute.\nDefaults to `max(1, (# of data nodes * min(search thread pool size, 10)))`.', + description: 'Maximum number of concurrent searches the multi search API can execute.\nDefaults to `max(1, (# of data nodes * min(search thread pool size, 10)))`.' }); /** * Maximum number of concurrent shard requests that each sub-search request executes per node. */ export const msearch_max_concurrent_shard_requests = z.number().register(z.globalRegistry, { - description: - 'Maximum number of concurrent shard requests that each sub-search request executes per node.', + description: 'Maximum number of concurrent shard requests that each sub-search request executes per node.' }); /** * Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint. */ export const msearch_pre_filter_shard_size = z.number().register(z.globalRegistry, { - description: - 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.', + description: 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.' }); /** * If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object. */ export const msearch_rest_total_hits_as_int = z.boolean().register(z.globalRegistry, { - description: - 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.', + description: 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.' }); /** @@ -37386,8 +31138,7 @@ export const msearch_search_type = types_search_type; * Specifies whether aggregation and suggester names should be prefixed by their respective types in the response. */ export const msearch_typed_keys = z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.', + description: 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.' }); /** @@ -37401,14 +31152,14 @@ export const msearch_template_index = types_indices; * If `true`, network round-trips are minimized for cross-cluster search requests. */ export const msearch_template_ccs_minimize_roundtrips = z.boolean().register(z.globalRegistry, { - description: 'If `true`, network round-trips are minimized for cross-cluster search requests.', + description: 'If `true`, network round-trips are minimized for cross-cluster search requests.' }); /** * The maximum number of concurrent searches the API can run. */ export const msearch_template_max_concurrent_searches = z.number().register(z.globalRegistry, { - description: 'The maximum number of concurrent searches the API can run.', + description: 'The maximum number of concurrent searches the API can run.' }); /** @@ -37421,16 +31172,14 @@ export const msearch_template_search_type = types_search_type; * If `false`, it returns `hits.total` as an object. */ export const msearch_template_rest_total_hits_as_int = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response returns `hits.total` as an integer.\nIf `false`, it returns `hits.total` as an object.', + description: 'If `true`, the response returns `hits.total` as an integer.\nIf `false`, it returns `hits.total` as an object.' }); /** * If `true`, the response prefixes aggregation and suggester names with their respective types. */ export const msearch_template_typed_keys = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response prefixes aggregation and suggester names with their respective types.', + description: 'If `true`, the response prefixes aggregation and suggester names with their respective types.' }); /** @@ -37442,8 +31191,7 @@ export const mtermvectors_index = types_index_name; * A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body */ export const mtermvectors_ids = z.array(types_id).register(z.globalRegistry, { - description: - 'A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body', + description: 'A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body' }); /** @@ -37456,29 +31204,28 @@ export const mtermvectors_fields = types_fields; * If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. */ export const mtermvectors_field_statistics = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies.', + description: 'If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies.' }); /** * If `true`, the response includes term offsets. */ export const mtermvectors_offsets = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term offsets.', + description: 'If `true`, the response includes term offsets.' }); /** * If `true`, the response includes term payloads. */ export const mtermvectors_payloads = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term payloads.', + description: 'If `true`, the response includes term payloads.' }); /** * If `true`, the response includes term positions. */ export const mtermvectors_positions = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term positions.', + description: 'If `true`, the response includes term positions.' }); /** @@ -37486,14 +31233,14 @@ export const mtermvectors_positions = z.boolean().register(z.globalRegistry, { * It is random by default. */ export const mtermvectors_preference = z.string().register(z.globalRegistry, { - description: 'The node or shard the operation should be performed on.\nIt is random by default.', + description: 'The node or shard the operation should be performed on.\nIt is random by default.' }); /** * If true, the request is real-time as opposed to near-real-time. */ export const mtermvectors_realtime = z.boolean().register(z.globalRegistry, { - description: 'If true, the request is real-time as opposed to near-real-time.', + description: 'If true, the request is real-time as opposed to near-real-time.' }); /** @@ -37505,7 +31252,7 @@ export const mtermvectors_routing = types_routing; * If true, the response includes term frequency and document frequency. */ export const mtermvectors_term_statistics = z.boolean().register(z.globalRegistry, { - description: 'If true, the response includes term frequency and document frequency.', + description: 'If true, the response includes term frequency and document frequency.' }); /** @@ -37528,8 +31275,7 @@ export const nodes_hot_threads_node_id = types_node_ids; * a task from an empty queue) are filtered out. */ export const nodes_hot_threads_ignore_idle_threads = z.boolean().register(z.globalRegistry, { - description: - 'If true, known idle threads (e.g. waiting in a socket select, or to get\na task from an empty queue) are filtered out.', + description: 'If true, known idle threads (e.g. waiting in a socket select, or to get\na task from an empty queue) are filtered out.' }); /** @@ -37541,14 +31287,14 @@ export const nodes_hot_threads_interval = types_duration; * Number of samples of thread stacktrace. */ export const nodes_hot_threads_snapshots = z.number().register(z.globalRegistry, { - description: 'Number of samples of thread stacktrace.', + description: 'Number of samples of thread stacktrace.' }); /** * Specifies the number of hot threads to provide information for. */ export const nodes_hot_threads_threads = z.number().register(z.globalRegistry, { - description: 'Specifies the number of hot threads to provide information for.', + description: 'Specifies the number of hot threads to provide information for.' }); /** @@ -37563,7 +31309,7 @@ export const nodes_hot_threads_timeout = types_duration; export const nodes_hot_threads_type = types_thread_type; /** - * The sort order for 'cpu' type (default: total) + * The sort order for 'cpu' type */ export const nodes_hot_threads_sort = types_thread_type; @@ -37581,7 +31327,7 @@ export const nodes_info_metric = nodes_info_nodes_info_metrics; * If true, returns settings in flat format. */ export const nodes_info_flat_settings = z.boolean().register(z.globalRegistry, { - description: 'If true, returns settings in flat format.', + description: 'If true, returns settings in flat format.' }); /** @@ -37606,7 +31352,7 @@ export const nodes_reload_secure_settings_timeout = types_duration; export const nodes_stats_node_id = types_node_ids; /** - * Limit the information returned to the specified metrics + * Limits the information returned to the specific metrics. */ export const nodes_stats_metric = nodes_stats_node_stats_metrics; @@ -37634,15 +31380,14 @@ export const nodes_stats_fields = types_fields; * Comma-separated list of search groups to include in the search statistics. */ export const nodes_stats_groups = z.boolean().register(z.globalRegistry, { - description: 'Comma-separated list of search groups to include in the search statistics.', + description: 'Comma-separated list of search groups to include in the search statistics.' }); /** * If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). */ export const nodes_stats_include_segment_file_sizes = z.boolean().register(z.globalRegistry, { - description: - 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).', + description: 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).' }); /** @@ -37659,19 +31404,19 @@ export const nodes_stats_timeout = types_duration; * A comma-separated list of document types for the indexing index metric. */ export const nodes_stats_types = z.array(z.string()).register(z.globalRegistry, { - description: 'A comma-separated list of document types for the indexing index metric.', + description: 'A comma-separated list of document types for the indexing index metric.' }); /** * If `true`, the response includes information from segments that are not loaded into memory. */ export const nodes_stats_include_unloaded_segments = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes information from segments that are not loaded into memory.', + description: 'If `true`, the response includes information from segments that are not loaded into memory.' }); /** - * A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + * A comma-separated list of node IDs or names to limit the returned information. + * Use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. */ export const nodes_usage_node_id = types_node_ids; @@ -37731,8 +31476,7 @@ export const rank_eval_index = types_indices; * If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. */ export const rank_eval_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' }); /** @@ -37744,7 +31488,7 @@ export const rank_eval_expand_wildcards = types_expand_wildcards; * If `true`, missing or closed indices are not included in the response. */ export const rank_eval_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `true`, missing or closed indices are not included in the response.', + description: 'If `true`, missing or closed indices are not included in the response.' }); /** @@ -37785,16 +31529,14 @@ export const rollup_rollup_search_index = types_indices; * Indicates whether hits.total should be rendered as an integer or an object in the rest search response */ export const rollup_rollup_search_rest_total_hits_as_int = z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether hits.total should be rendered as an integer or an object in the rest search response', + description: 'Indicates whether hits.total should be rendered as an integer or an object in the rest search response' }); /** * Specify whether aggregation and suggester names should be prefixed by their respective types in the response */ export const rollup_rollup_search_typed_keys = z.boolean().register(z.globalRegistry, { - description: - 'Specify whether aggregation and suggester names should be prefixed by their respective types in the response', + description: 'Specify whether aggregation and suggester names should be prefixed by their respective types in the response' }); /** @@ -37810,7 +31552,7 @@ export const scroll_scroll_id = types_scroll_id; export const scroll_scroll = types_duration; /** - * The scroll ID for scrolled search + * The scroll ID * * @deprecated */ @@ -37820,8 +31562,7 @@ export const scroll_scroll_id2 = types_scroll_id; * If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object. */ export const scroll_rest_total_hits_as_int = z.boolean().register(z.globalRegistry, { - description: - 'If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object.', + description: 'If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object.' }); /** @@ -37837,8 +31578,7 @@ export const search_index = types_indices; * For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. */ export const search_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' }); /** @@ -37848,8 +31588,7 @@ export const search_allow_no_indices = z.boolean().register(z.globalRegistry, { * To override the default behavior, you can set the `search.default_allow_partial_results` cluster setting to `false`. */ export const search_allow_partial_search_results = z.boolean().register(z.globalRegistry, { - description: - 'If `true` and there are shard request timeouts or shard failures, the request returns partial results.\nIf `false`, it returns an error with no partial results.\n\nTo override the default behavior, you can set the `search.default_allow_partial_results` cluster setting to `false`.', + description: 'If `true` and there are shard request timeouts or shard failures, the request returns partial results.\nIf `false`, it returns an error with no partial results.\n\nTo override the default behavior, you can set the `search.default_allow_partial_results` cluster setting to `false`.' }); /** @@ -37857,8 +31596,7 @@ export const search_allow_partial_search_results = z.boolean().register(z.global * This parameter can be used only when the `q` query string parameter is specified. */ export const search_analyzer = z.string().register(z.globalRegistry, { - description: - 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', + description: 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' }); /** @@ -37866,8 +31604,7 @@ export const search_analyzer = z.string().register(z.globalRegistry, { * This parameter can be used only when the `q` query string parameter is specified. */ export const search_analyze_wildcard = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.', + description: 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.' }); /** @@ -37875,16 +31612,14 @@ export const search_analyze_wildcard = z.boolean().register(z.globalRegistry, { * If the potential number of shards in the request can be large, this value should be used as a protection mechanism to reduce the memory overhead per search request. */ export const search_batched_reduce_size = z.number().register(z.globalRegistry, { - description: - 'The number of shard results that should be reduced at once on the coordinating node.\nIf the potential number of shards in the request can be large, this value should be used as a protection mechanism to reduce the memory overhead per search request.', + description: 'The number of shard results that should be reduced at once on the coordinating node.\nIf the potential number of shards in the request can be large, this value should be used as a protection mechanism to reduce the memory overhead per search request.' }); /** * If `true`, network round-trips between the coordinating node and the remote clusters are minimized when running cross-cluster search (CCS) requests. */ export const search_ccs_minimize_roundtrips = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, network round-trips between the coordinating node and the remote clusters are minimized when running cross-cluster search (CCS) requests.', + description: 'If `true`, network round-trips between the coordinating node and the remote clusters are minimized when running cross-cluster search (CCS) requests.' }); /** @@ -37898,8 +31633,7 @@ export const search_default_operator = types_query_dsl_operator; * This parameter can be used only when the `q` query string parameter is specified. */ export const search_df = z.string().register(z.globalRegistry, { - description: - 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', + description: 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' }); /** @@ -37918,8 +31652,7 @@ export const search_expand_wildcards = types_expand_wildcards; * If `true`, the request returns detailed information about score computation as part of a hit. */ export const search_explain = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns detailed information about score computation as part of a hit.', + description: 'If `true`, the request returns detailed information about score computation as part of a hit.' }); /** @@ -37928,14 +31661,14 @@ export const search_explain = z.boolean().register(z.globalRegistry, { * @deprecated */ export const search_ignore_throttled = z.boolean().register(z.globalRegistry, { - description: 'If `true`, concrete, expanded or aliased indices will be ignored when frozen.', + description: 'If `true`, concrete, expanded or aliased indices will be ignored when frozen.' }); /** * If `false`, the request returns an error if it targets a missing or closed index. */ export const search_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `false`, the request returns an error if it targets a missing or closed index.', + description: 'If `false`, the request returns an error if it targets a missing or closed index.' }); /** @@ -37946,8 +31679,7 @@ export const search_ignore_unavailable = z.boolean().register(z.globalRegistry, * However, using computationally expensive named queries on a large number of hits may add significant overhead. */ export const search_include_named_queries_score = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes the score contribution from any named queries.\n\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.', + description: 'If `true`, the response includes the score contribution from any named queries.\n\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.' }); /** @@ -37955,8 +31687,7 @@ export const search_include_named_queries_score = z.boolean().register(z.globalR * This parameter can be used only when the `q` query string parameter is specified. */ export const search_lenient = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.', + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.' }); /** @@ -37964,8 +31695,7 @@ export const search_lenient = z.boolean().register(z.globalRegistry, { * This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests. */ export const search_max_concurrent_shard_requests = z.number().register(z.globalRegistry, { - description: - 'The number of concurrent shard requests per node that the search runs concurrently.\nThis value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests.', + description: 'The number of concurrent shard requests per node that the search runs concurrently.\nThis value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests.' }); /** @@ -37981,8 +31711,7 @@ export const search_max_concurrent_shard_requests = z.number().register(z.global * * `` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order. */ export const search_preference = z.string().register(z.globalRegistry, { - description: - 'The nodes and shards used for the search.\nBy default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness.\nValid values are:\n\n* `_only_local` to run the search only on shards on the local node.\n* `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method.\n* `_only_nodes:,` to run the search on only the specified nodes IDs. If suitable shards exist on more than one selected node, use shards on those nodes using the default method. If none of the specified nodes are available, select shards from any available node using the default method.\n* `_prefer_nodes:,` to if possible, run the search on the specified nodes IDs. If not, select shards using the default method.\n* `_shards:,` to run the search only on the specified shards. You can combine this value with other `preference` values. However, the `_shards` value must come first. For example: `_shards:2,3|_local`.\n* `` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order.', + description: 'The nodes and shards used for the search.\nBy default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness.\nValid values are:\n\n* `_only_local` to run the search only on shards on the local node.\n* `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method.\n* `_only_nodes:,` to run the search on only the specified nodes IDs. If suitable shards exist on more than one selected node, use shards on those nodes using the default method. If none of the specified nodes are available, select shards from any available node using the default method.\n* `_prefer_nodes:,` to if possible, run the search on the specified nodes IDs. If not, select shards using the default method.\n* `_shards:,` to run the search only on the specified shards. You can combine this value with other `preference` values. However, the `_shards` value must come first. For example: `_shards:2,3|_local`.\n* `` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order.' }); /** @@ -37995,8 +31724,7 @@ export const search_preference = z.string().register(z.globalRegistry, { * * The primary sort of the query targets an indexed field. */ export const search_pre_filter_shard_size = z.number().register(z.globalRegistry, { - description: - 'A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold.\nThis filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint).\nWhen unspecified, the pre-filter phase is executed if any of these conditions is met:\n\n* The request targets more than 128 shards.\n* The request targets one or more read-only index.\n* The primary sort of the query targets an indexed field.', + description: 'A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold.\nThis filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint).\nWhen unspecified, the pre-filter phase is executed if any of these conditions is met:\n\n* The request targets more than 128 shards.\n* The request targets one or more read-only index.\n* The primary sort of the query targets an indexed field.' }); /** @@ -38004,8 +31732,7 @@ export const search_pre_filter_shard_size = z.number().register(z.globalRegistry * It defaults to index level settings. */ export const search_request_cache = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the caching of search results is enabled for requests where `size` is `0`.\nIt defaults to index level settings.', + description: 'If `true`, the caching of search results is enabled for requests where `size` is `0`.\nIt defaults to index level settings.' }); /** @@ -38029,7 +31756,7 @@ export const search_search_type = types_search_type; * Specific `tag` of the request for logging and statistical purposes. */ export const search_stats = z.array(z.string()).register(z.globalRegistry, { - description: 'Specific `tag` of the request for logging and statistical purposes.', + description: 'Specific `tag` of the request for logging and statistical purposes.' }); /** @@ -38056,8 +31783,7 @@ export const search_suggest_mode = types_suggest_mode; * This parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified. */ export const search_suggest_size = z.number().register(z.globalRegistry, { - description: - 'The number of suggestions to return.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.', + description: 'The number of suggestions to return.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.' }); /** @@ -38065,8 +31791,7 @@ export const search_suggest_size = z.number().register(z.globalRegistry, { * This parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified. */ export const search_suggest_text = z.string().register(z.globalRegistry, { - description: - 'The source text for which the suggestions should be returned.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.', + description: 'The source text for which the suggestions should be returned.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.' }); /** @@ -38081,8 +31806,7 @@ export const search_suggest_text = z.string().register(z.globalRegistry, { * If set to `0` (default), the query does not terminate early. */ export const search_terminate_after = z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.\nIf set to `0` (default), the query does not terminate early.', + description: 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.\nIf set to `0` (default), the query does not terminate early.' }); /** @@ -38103,31 +31827,28 @@ export const search_track_total_hits = global_search_types_track_hits; * If `true`, the request calculates and returns document scores, even if the scores are not used for sorting. */ export const search_track_scores = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request calculates and returns document scores, even if the scores are not used for sorting.', + description: 'If `true`, the request calculates and returns document scores, even if the scores are not used for sorting.' }); /** * If `true`, aggregation and suggester names are be prefixed by their respective types in the response. */ export const search_typed_keys = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, aggregation and suggester names are be prefixed by their respective types in the response.', + description: 'If `true`, aggregation and suggester names are be prefixed by their respective types in the response.' }); /** * Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response. */ export const search_rest_total_hits_as_int = z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response.', + description: 'Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response.' }); /** * If `true`, the request returns the document version as part of a hit. */ export const search_version = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request returns the document version as part of a hit.', + description: 'If `true`, the request returns the document version as part of a hit.' }); /** @@ -38152,7 +31873,7 @@ export const search_source_excludes = types_fields; * Whether vectors should be excluded from _source */ export const search_source_exclude_vectors = z.boolean().register(z.globalRegistry, { - description: 'Whether vectors should be excluded from _source', + description: 'Whether vectors should be excluded from _source' }); /** @@ -38167,8 +31888,7 @@ export const search_source_includes = types_fields; * If `true`, the request returns the sequence number and primary term of the last modification of each hit. */ export const search_seq_no_primary_term = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns the sequence number and primary term of the last modification of each hit.', + description: 'If `true`, the request returns the sequence number and primary term of the last modification of each hit.' }); /** @@ -38179,8 +31899,7 @@ export const search_seq_no_primary_term = z.boolean().register(z.globalRegistry, * If both parameters are specified, documents matching the query request body parameter are not returned. */ export const search_q = z.string().register(z.globalRegistry, { - description: - 'A query in the Lucene query string syntax.\nQuery parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.\n\nIMPORTANT: This parameter overrides the query parameter in the request body.\nIf both parameters are specified, documents matching the query request body parameter are not returned.', + description: 'A query in the Lucene query string syntax.\nQuery parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.\n\nIMPORTANT: This parameter overrides the query parameter in the request body.\nIf both parameters are specified, documents matching the query request body parameter are not returned.' }); /** @@ -38189,8 +31908,7 @@ export const search_q = z.string().register(z.globalRegistry, { * To page through more hits, use the `search_after` parameter. */ export const search_size = z.number().register(z.globalRegistry, { - description: - 'The number of hits to return.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', + description: 'The number of hits to return.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' }); /** @@ -38199,23 +31917,23 @@ export const search_size = z.number().register(z.globalRegistry, { * To page through more hits, use the `search_after` parameter. */ export const search_from = z.number().register(z.globalRegistry, { - description: - 'The starting document offset, which must be non-negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', + description: 'The starting document offset, which must be non-negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' }); /** * A comma-separated list of `:` pairs. */ -export const search_sort = z.union([z.string(), z.array(z.string())]); +export const search_sort = z.union([ + z.string(), + z.array(z.string()) +]); /** * A list of analytics collections to limit the returned information */ -export const search_application_get_behavioral_analytics_name = z - .array(types_name) - .register(z.globalRegistry, { - description: 'A list of analytics collections to limit the returned information', - }); +export const search_application_get_behavioral_analytics_name = z.array(types_name).register(z.globalRegistry, { + description: 'A list of analytics collections to limit the returned information' +}); /** * The name of the search application to be searched. @@ -38226,32 +31944,40 @@ export const search_application_search_name = types_name; * Determines whether aggregation names are prefixed by their respective types in the response. */ export const search_application_search_typed_keys = z.boolean().register(z.globalRegistry, { - description: - 'Determines whether aggregation names are prefixed by their respective types in the response.', + description: 'Determines whether aggregation names are prefixed by their respective types in the response.' }); /** - * Comma-separated list of data streams, indices, or aliases to search + * A list of indices, data streams, or aliases to search. + * It supports wildcards (`*`). + * To search all data streams and indices, omit this parameter or use `*` or `_all`. + * To search a remote cluster, use the `:` syntax. */ export const search_mvt_index = types_indices; /** - * Field containing geospatial data to return + * A field that contains the geospatial data to return. + * It must be a `geo_point` or `geo_shape` field. + * The field must have doc values enabled. It cannot be a nested field. + * + * NOTE: Vector tiles do not natively support geometry collections. + * For `geometrycollection` values in a `geo_shape` field, the API returns a hits layer feature for each element of the collection. + * This behavior may change in a future release. */ export const search_mvt_field = types_field; /** - * Zoom level for the vector tile to search + * The zoom level of the vector tile to search. It accepts `0` to `29`. */ export const search_mvt_zoom = global_search_mvt_types_zoom_level; /** - * X coordinate for the vector tile to search + * The X coordinate for the vector tile to search. */ export const search_mvt_x = global_search_mvt_types_coordinate; /** - * Y coordinate for the vector tile to search + * The Y coordinate for the vector tile to search. */ export const search_mvt_y = global_search_mvt_types_coordinate; @@ -38263,16 +31989,14 @@ export const search_mvt_y = global_search_mvt_types_coordinate; * bounding box may be larger than the vector tile. */ export const search_mvt_exact_bounds = z.boolean().register(z.globalRegistry, { - description: - "If `false`, the meta layer's feature is the bounding box of the tile.\nIf true, the meta layer's feature is a bounding box resulting from a\ngeo_bounds aggregation. The aggregation runs on values that intersect\nthe // tile with wrap_longitude set to false. The resulting\nbounding box may be larger than the vector tile.", + description: 'If `false`, the meta layer\'s feature is the bounding box of the tile.\nIf true, the meta layer\'s feature is a bounding box resulting from a\ngeo_bounds aggregation. The aggregation runs on values that intersect\nthe // tile with wrap_longitude set to false. The resulting\nbounding box may be larger than the vector tile.' }); /** * The size, in pixels, of a side of the tile. Vector tiles are square with equal sides. */ export const search_mvt_extent = z.number().register(z.globalRegistry, { - description: - 'The size, in pixels, of a side of the tile. Vector tiles are square with equal sides.', + description: 'The size, in pixels, of a side of the tile. Vector tiles are square with equal sides.' }); /** @@ -38286,8 +32010,7 @@ export const search_mvt_grid_agg = global_search_mvt_types_grid_aggregation_type * don't include the aggs layer. */ export const search_mvt_grid_precision = z.number().register(z.globalRegistry, { - description: - "Additional zoom levels available through the aggs layer. For example, if is 7\nand grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results\ndon't include the aggs layer.", + description: 'Additional zoom levels available through the aggs layer. For example, if is 7\nand grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results\ndon\'t include the aggs layer.' }); /** @@ -38303,8 +32026,7 @@ export const search_mvt_grid_type = global_search_mvt_types_grid_type; * If 0, results don't include the hits layer. */ export const search_mvt_size = z.number().register(z.globalRegistry, { - description: - "Maximum number of features to return in the hits layer. Accepts 0-10000.\nIf 0, results don't include the hits layer.", + description: 'Maximum number of features to return in the hits layer. Accepts 0-10000.\nIf 0, results don\'t include the hits layer.' }); /** @@ -38327,8 +32049,7 @@ export const search_mvt_track_total_hits = global_search_types_track_hits; * In addition, the new features will be distinguishable using the tag `_mvt_label_position`. */ export const search_mvt_with_labels = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the hits and aggs layers will contain additional point features representing\nsuggested label positions for the original features.\n\n* `Point` and `MultiPoint` features will have one of the points selected.\n* `Polygon` and `MultiPolygon` features will have a single point generated, either the centroid, if it is within the polygon, or another point within the polygon selected from the sorted triangle-tree.\n* `LineString` features will likewise provide a roughly central point selected from the triangle-tree.\n* The aggregation results will provide one central point for each aggregation bucket.\n\nAll attributes from the original features will also be copied to the new label features.\nIn addition, the new features will be distinguishable using the tag `_mvt_label_position`.', + description: 'If `true`, the hits and aggs layers will contain additional point features representing\nsuggested label positions for the original features.\n\n* `Point` and `MultiPoint` features will have one of the points selected.\n* `Polygon` and `MultiPolygon` features will have a single point generated, either the centroid, if it is within the polygon, or another point within the polygon selected from the sorted triangle-tree.\n* `LineString` features will likewise provide a roughly central point selected from the triangle-tree.\n* The aggregation results will provide one central point for each aggregation bucket.\n\nAll attributes from the original features will also be copied to the new label features.\nIn addition, the new features will be distinguishable using the tag `_mvt_label_position`.' }); /** @@ -38344,8 +32065,7 @@ export const search_shards_index = types_indices; * For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. */ export const search_shards_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' }); /** @@ -38359,14 +32079,14 @@ export const search_shards_expand_wildcards = types_expand_wildcards; * If `false`, the request returns an error if it targets a missing or closed index. */ export const search_shards_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `false`, the request returns an error if it targets a missing or closed index.', + description: 'If `false`, the request returns an error if it targets a missing or closed index.' }); /** * If `true`, the request retrieves information from the local node only. */ export const search_shards_local = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request retrieves information from the local node only.', + description: 'If `true`, the request retrieves information from the local node only.' }); /** @@ -38381,7 +32101,7 @@ export const search_shards_master_timeout = types_duration; * It is random by default. */ export const search_shards_preference = z.string().register(z.globalRegistry, { - description: 'The node or shard the operation should be performed on.\nIt is random by default.', + description: 'The node or shard the operation should be performed on.\nIt is random by default.' }); /** @@ -38401,15 +32121,14 @@ export const search_template_index = types_indices; * For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. */ export const search_template_allow_no_indices = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' }); /** * If `true`, network round-trips are minimized for cross-cluster search requests. */ export const search_template_ccs_minimize_roundtrips = z.boolean().register(z.globalRegistry, { - description: 'If `true`, network round-trips are minimized for cross-cluster search requests.', + description: 'If `true`, network round-trips are minimized for cross-cluster search requests.' }); /** @@ -38423,8 +32142,7 @@ export const search_template_expand_wildcards = types_expand_wildcards; * If `true`, the response includes additional details about score computation as part of a hit. */ export const search_template_explain = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes additional details about score computation as part of a hit.', + description: 'If `true`, the response includes additional details about score computation as part of a hit.' }); /** @@ -38433,15 +32151,14 @@ export const search_template_explain = z.boolean().register(z.globalRegistry, { * @deprecated */ export const search_template_ignore_throttled = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled.', + description: 'If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled.' }); /** * If `false`, the request returns an error if it targets a missing or closed index. */ export const search_template_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: 'If `false`, the request returns an error if it targets a missing or closed index.', + description: 'If `false`, the request returns an error if it targets a missing or closed index.' }); /** @@ -38449,14 +32166,14 @@ export const search_template_ignore_unavailable = z.boolean().register(z.globalR * It is random by default. */ export const search_template_preference = z.string().register(z.globalRegistry, { - description: 'The node or shard the operation should be performed on.\nIt is random by default.', + description: 'The node or shard the operation should be performed on.\nIt is random by default.' }); /** * If `true`, the query execution is profiled. */ export const search_template_profile = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the query execution is profiled.', + description: 'If `true`, the query execution is profiled.' }); /** @@ -38480,16 +32197,14 @@ export const search_template_search_type = types_search_type; * If `false`, it is rendered as an object. */ export const search_template_rest_total_hits_as_int = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, `hits.total` is rendered as an integer in the response.\nIf `false`, it is rendered as an object.', + description: 'If `true`, `hits.total` is rendered as an integer in the response.\nIf `false`, it is rendered as an object.' }); /** * If `true`, the response prefixes aggregation and suggester names with their respective types. */ export const search_template_typed_keys = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response prefixes aggregation and suggester names with their respective types.', + description: 'If `true`, the response prefixes aggregation and suggester names with their respective types.' }); /** @@ -38506,29 +32221,24 @@ export const searchable_snapshots_cache_stats_master_timeout = types_duration; export const searchable_snapshots_clear_cache_index = types_indices; /** - * Whether to expand wildcard expression to concrete indices that are open, closed or both. + * Whether to expand wildcard expression to concrete indices that are open, closed or both */ export const searchable_snapshots_clear_cache_expand_wildcards = types_expand_wildcards; /** - * Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * Whether to ignore if a wildcard indices expression resolves into no concrete indices. + * (This includes `_all` string or when no indices have been specified) */ -export const searchable_snapshots_clear_cache_allow_no_indices = z - .boolean() - .register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', - }); +export const searchable_snapshots_clear_cache_allow_no_indices = z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' +}); /** * Whether specified concrete indices should be ignored when unavailable (missing or closed) */ -export const searchable_snapshots_clear_cache_ignore_unavailable = z - .boolean() - .register(z.globalRegistry, { - description: - 'Whether specified concrete indices should be ignored when unavailable (missing or closed)', - }); +export const searchable_snapshots_clear_cache_ignore_unavailable = z.boolean().register(z.globalRegistry, { + description: 'Whether specified concrete indices should be ignored when unavailable (missing or closed)' +}); /** * A comma-separated list of data streams and indices to retrieve statistics for. @@ -38579,7 +32289,7 @@ export const security_create_service_token_service = types_service; export const security_create_service_token_name = types_name; /** - * If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. + * If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. */ export const security_create_service_token_refresh = types_refresh; @@ -38669,13 +32379,16 @@ export const security_get_service_accounts_service = types_service; /** * An identifier for the user. You can specify multiple usernames as a comma-separated list. If you omit this parameter, the API retrieves information about all users. */ -export const security_get_user_username = z.union([types_username, z.array(types_username)]); +export const security_get_user_username = z.union([ + types_username, + z.array(types_username) +]); /** * Determines whether to retrieve the user profile UID, if it exists, for the users. */ export const security_get_user_with_profile_uid = z.boolean().register(z.globalRegistry, { - description: 'Determines whether to retrieve the user profile UID, if it exists, for the users.', + description: 'Determines whether to retrieve the user profile UID, if it exists, for the users.' }); /** @@ -38730,8 +32443,7 @@ export const security_put_user_refresh = types_refresh; * An API key cannot retrieve any API key’s limited-by role descriptors (including itself) unless it has `manage_api_key` or higher privileges. */ export const security_query_api_keys_with_limited_by = z.boolean().register(z.globalRegistry, { - description: - "Return the snapshot of the owner user's role descriptors associated with the API key.\nAn API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors (effectively limited by it).\nAn API key cannot retrieve any API key’s limited-by role descriptors (including itself) unless it has `manage_api_key` or higher privileges.", + description: 'Return the snapshot of the owner user\'s role descriptors associated with the API key.\nAn API key\'s actual permission is the intersection of its assigned role descriptors and the owner user\'s role descriptors (effectively limited by it).\nAn API key cannot retrieve any API key’s limited-by role descriptors (including itself) unless it has `manage_api_key` or higher privileges.' }); /** @@ -38739,23 +32451,21 @@ export const security_query_api_keys_with_limited_by = z.boolean().register(z.gl * If it exists, the profile UID is returned under the `profile_uid` response field for each API key. */ export const security_query_api_keys_with_profile_uid = z.boolean().register(z.globalRegistry, { - description: - 'Determines whether to also retrieve the profile UID for the API key owner principal.\nIf it exists, the profile UID is returned under the `profile_uid` response field for each API key.', + description: 'Determines whether to also retrieve the profile UID for the API key owner principal.\nIf it exists, the profile UID is returned under the `profile_uid` response field for each API key.' }); /** * Determines whether aggregation names are prefixed by their respective types in the response. */ export const security_query_api_keys_typed_keys = z.boolean().register(z.globalRegistry, { - description: - 'Determines whether aggregation names are prefixed by their respective types in the response.', + description: 'Determines whether aggregation names are prefixed by their respective types in the response.' }); /** * Determines whether to retrieve the user profile UID, if it exists, for the users. */ export const security_query_user_with_profile_uid = z.boolean().register(z.globalRegistry, { - description: 'Determines whether to retrieve the user profile UID, if it exists, for the users.', + description: 'Determines whether to retrieve the user profile UID, if it exists, for the users.' }); /** @@ -38765,7 +32475,10 @@ export const security_query_user_with_profile_uid = z.boolean().register(z.globa * By default, the API returns no `data` content. * It is an error to specify `data` as both the query parameter and the request body field. */ -export const security_suggest_user_profiles_data = z.union([z.string(), z.array(z.string())]); +export const security_suggest_user_profiles_data = z.union([ + z.string(), + z.array(z.string()) +]); /** * A unique identifier for the user profile. @@ -38780,11 +32493,9 @@ export const security_update_user_profile_data_if_seq_no = types_sequence_number /** * Only perform the operation if the document has this primary term. */ -export const security_update_user_profile_data_if_primary_term = z - .number() - .register(z.globalRegistry, { - description: 'Only perform the operation if the document has this primary term.', - }); +export const security_update_user_profile_data_if_primary_term = z.number().register(z.globalRegistry, { + description: 'Only perform the operation if the document has this primary term.' +}); /** * If 'true', Elasticsearch refreshes the affected shards to make this operation @@ -38816,7 +32527,7 @@ export const simulate_ingest_pipeline = types_pipeline_name; export const simulate_ingest_merge_type2 = simulate_ingest_merge_type; /** - * Comma-separated list of snapshot lifecycle policies to retrieve + * A comma-separated list of snapshot lifecycle policy identifiers. */ export const slm_get_lifecycle_policy_id = types_names; @@ -38855,8 +32566,7 @@ export const snapshot_create_master_timeout = types_duration; * If `false`, the request returns a response when the snapshot initializes. */ export const snapshot_create_wait_for_completion = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns a response when the snapshot is complete.\nIf `false`, the request returns a response when the snapshot initializes.', + description: 'If `true`, the request returns a response when the snapshot is complete.\nIf `false`, the request returns a response when the snapshot initializes.' }); /** @@ -38884,8 +32594,7 @@ export const snapshot_create_repository_timeout = types_duration; * You can also perform this verification with the verify snapshot repository API. */ export const snapshot_create_repository_verify = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request verifies the repository is functional on all master and data nodes in the cluster.\nIf `false`, this verification is skipped.\nYou can also perform this verification with the verify snapshot repository API.', + description: 'If `true`, the request verifies the repository is functional on all master and data nodes in the cluster.\nIf `false`, this verification is skipped.\nYou can also perform this verification with the verify snapshot repository API.' }); /** @@ -38901,8 +32610,7 @@ export const snapshot_get_repository_repository = types_names; * If `false`, the request gets information from the master node. */ export const snapshot_get_repository_local = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request gets information from the local node only.\nIf `false`, the request gets information from the master node.', + description: 'If `true`, the request gets information from the local node only.\nIf `false`, the request gets information from the master node.' }); /** @@ -38930,8 +32638,7 @@ export const snapshot_status_snapshot = types_names; * If `true`, the request ignores snapshots that are unavailable, such as those that are corrupted or temporarily cannot be returned. */ export const snapshot_status_ignore_unavailable = z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error for any snapshots that are unavailable.\nIf `true`, the request ignores snapshots that are unavailable, such as those that are corrupted or temporarily cannot be returned.', + description: 'If `false`, the request returns an error for any snapshots that are unavailable.\nIf `true`, the request ignores snapshots that are unavailable, such as those that are corrupted or temporarily cannot be returned.' }); /** @@ -38956,27 +32663,30 @@ export const tasks_cancel_task_id = types_task_id; /** * A comma-separated list or wildcard expression of actions that is used to limit the request. */ -export const tasks_cancel_actions = z.union([z.string(), z.array(z.string())]); +export const tasks_cancel_actions = z.union([ + z.string(), + z.array(z.string()) +]); /** * A comma-separated list of node IDs or names that is used to limit the request. */ export const tasks_cancel_nodes = z.array(z.string()).register(z.globalRegistry, { - description: 'A comma-separated list of node IDs or names that is used to limit the request.', + description: 'A comma-separated list of node IDs or names that is used to limit the request.' }); /** * A parent task ID that is used to limit the tasks. */ export const tasks_cancel_parent_task_id = z.string().register(z.globalRegistry, { - description: 'A parent task ID that is used to limit the tasks.', + description: 'A parent task ID that is used to limit the tasks.' }); /** * If true, the request blocks until all found tasks are complete. */ export const tasks_cancel_wait_for_completion = z.boolean().register(z.globalRegistry, { - description: 'If true, the request blocks until all found tasks are complete.', + description: 'If true, the request blocks until all found tasks are complete.' }); /** @@ -39010,29 +32720,28 @@ export const termvectors_fields = types_fields; * * The sum of total term frequencies (the sum of total term frequencies of each term in this field). */ export const termvectors_field_statistics = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes:\n\n* The document count (how many documents contain this field).\n* The sum of document frequencies (the sum of document frequencies for all terms in this field).\n* The sum of total term frequencies (the sum of total term frequencies of each term in this field).', + description: 'If `true`, the response includes:\n\n* The document count (how many documents contain this field).\n* The sum of document frequencies (the sum of document frequencies for all terms in this field).\n* The sum of total term frequencies (the sum of total term frequencies of each term in this field).' }); /** * If `true`, the response includes term offsets. */ export const termvectors_offsets = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term offsets.', + description: 'If `true`, the response includes term offsets.' }); /** * If `true`, the response includes term payloads. */ export const termvectors_payloads = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term payloads.', + description: 'If `true`, the response includes term payloads.' }); /** * If `true`, the response includes term positions. */ export const termvectors_positions = z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term positions.', + description: 'If `true`, the response includes term positions.' }); /** @@ -39040,14 +32749,14 @@ export const termvectors_positions = z.boolean().register(z.globalRegistry, { * It is random by default. */ export const termvectors_preference = z.string().register(z.globalRegistry, { - description: 'The node or shard the operation should be performed on.\nIt is random by default.', + description: 'The node or shard the operation should be performed on.\nIt is random by default.' }); /** * If true, the request is real-time as opposed to near-real-time. */ export const termvectors_realtime = z.boolean().register(z.globalRegistry, { - description: 'If true, the request is real-time as opposed to near-real-time.', + description: 'If true, the request is real-time as opposed to near-real-time.' }); /** @@ -39064,8 +32773,7 @@ export const termvectors_routing = types_routing; * By default these values are not returned since term statistics can have a serious performance impact. */ export const termvectors_term_statistics = z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes:\n\n* The total term frequency (how often a term occurs in all documents).\n* The document frequency (the number of documents containing the current term).\n\nBy default these values are not returned since term statistics can have a serious performance impact.', + description: 'If `true`, the response includes:\n\n* The total term frequency (how often a term occurs in all documents).\n* The document frequency (the number of documents containing the current term).\n\nBy default these values are not returned since term statistics can have a serious performance impact.' }); /** @@ -39084,8 +32792,8 @@ export const termvectors_version_type = types_version_type; * If the text does not have a header role, columns are named "column1", "column2", "column3", for example. */ export const text_structure_find_message_structure_column_names = z.union([ - z.string(), - z.array(z.string()), + z.string(), + z.array(z.string()) ]); /** @@ -39095,12 +32803,9 @@ export const text_structure_find_message_structure_column_names = z.union([ * In this default scenario, all rows must have the same number of fields for the delimited format to be detected. * If you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row. */ -export const text_structure_find_message_structure_delimiter = z - .string() - .register(z.globalRegistry, { - description: - 'If you the format is `delimited`, you can specify the character used to delimit the values in each row.\nOnly a single character is supported; the delimiter cannot have multiple characters.\nBy default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`).\nIn this default scenario, all rows must have the same number of fields for the delimited format to be detected.\nIf you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row.', - }); +export const text_structure_find_message_structure_delimiter = z.string().register(z.globalRegistry, { + description: 'If you the format is `delimited`, you can specify the character used to delimit the values in each row.\nOnly a single character is supported; the delimiter cannot have multiple characters.\nBy default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`).\nIn this default scenario, all rows must have the same number of fields for the delimited format to be detected.\nIf you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row.' +}); /** * The mode of compatibility with ECS compliant Grok patterns. @@ -39108,18 +32813,14 @@ export const text_structure_find_message_structure_delimiter = z * This setting primarily has an impact when a whole message Grok pattern such as `%{CATALINALOG}` matches the input. * If the structure finder identifies a common structure but has no idea of meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output, with the intention that a user who knows the meanings rename these fields before using it. */ -export const text_structure_find_message_structure_ecs_compatibility = - text_structure_types_ecs_compatibility_type; +export const text_structure_find_message_structure_ecs_compatibility = text_structure_types_ecs_compatibility_type; /** * If this parameter is set to true, the response includes a field named `explanation`, which is an array of strings that indicate how the structure finder produced its result. */ -export const text_structure_find_message_structure_explain = z - .boolean() - .register(z.globalRegistry, { - description: - 'If this parameter is set to true, the response includes a field named `explanation`, which is an array of strings that indicate how the structure finder produced its result.', - }); +export const text_structure_find_message_structure_explain = z.boolean().register(z.globalRegistry, { + description: 'If this parameter is set to true, the response includes a field named `explanation`, which is an array of strings that indicate how the structure finder produced its result.' +}); /** * The high level structure of the text. @@ -39144,8 +32845,7 @@ export const text_structure_find_message_structure_grok_pattern = types_grok_pat * If your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample. */ export const text_structure_find_message_structure_quote = z.string().register(z.globalRegistry, { - description: - 'If the format is `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character.\nOnly a single character is supported.\nIf this parameter is not specified, the default value is a double quote (`"`).\nIf your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample.', + description: 'If the format is `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character.\nOnly a single character is supported.\nIf this parameter is not specified, the default value is a double quote (`"`).\nIf your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample.' }); /** @@ -39153,12 +32853,9 @@ export const text_structure_find_message_structure_quote = z.string().register(z * If this parameter is not specified and the delimiter is pipe (`|`), the default value is true. * Otherwise, the default value is `false`. */ -export const text_structure_find_message_structure_should_trim_fields = z - .boolean() - .register(z.globalRegistry, { - description: - 'If the format is `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them.\nIf this parameter is not specified and the delimiter is pipe (`|`), the default value is true.\nOtherwise, the default value is `false`.', - }); +export const text_structure_find_message_structure_should_trim_fields = z.boolean().register(z.globalRegistry, { + description: 'If the format is `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them.\nIf this parameter is not specified and the delimiter is pipe (`|`), the default value is true.\nOtherwise, the default value is `false`.' +}); /** * The maximum amount of time that the structure analysis can take. @@ -39216,24 +32913,18 @@ export const text_structure_find_message_structure_timestamp_field = types_field * If the special value `null` is specified, the structure finder will not look for a primary timestamp in the text. * When the format is semi-structured text, this will result in the structure finder treating the text as single-line messages. */ -export const text_structure_find_message_structure_timestamp_format = z - .string() - .register(z.globalRegistry, { - description: - "The Java time format of the timestamp field in the text.\nOnly a subset of Java time format letter groups are supported:\n\n* `a`\n* `d`\n* `dd`\n* `EEE`\n* `EEEE`\n* `H`\n* `HH`\n* `h`\n* `M`\n* `MM`\n* `MMM`\n* `MMMM`\n* `mm`\n* `ss`\n* `XX`\n* `XXX`\n* `yy`\n* `yyyy`\n* `zzz`\n\nAdditionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and are separated from the `ss` by a period (`.`), comma (`,`), or colon (`:`).\nSpacing and punctuation is also permitted with the exception a question mark (`?`), newline, and carriage return, together with literal text enclosed in single quotes.\nFor example, `MM/dd HH.mm.ss,SSSSSS 'in' yyyy` is a valid override format.\n\nOne valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`.\nAnother is when the timestamp format is one that the structure finder does not consider by default.\n\nIf this parameter is not specified, the structure finder chooses the best format from a built-in set.\n\nIf the special value `null` is specified, the structure finder will not look for a primary timestamp in the text.\nWhen the format is semi-structured text, this will result in the structure finder treating the text as single-line messages.", - }); +export const text_structure_find_message_structure_timestamp_format = z.string().register(z.globalRegistry, { + description: 'The Java time format of the timestamp field in the text.\nOnly a subset of Java time format letter groups are supported:\n\n* `a`\n* `d`\n* `dd`\n* `EEE`\n* `EEEE`\n* `H`\n* `HH`\n* `h`\n* `M`\n* `MM`\n* `MMM`\n* `MMMM`\n* `mm`\n* `ss`\n* `XX`\n* `XXX`\n* `yy`\n* `yyyy`\n* `zzz`\n\nAdditionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and are separated from the `ss` by a period (`.`), comma (`,`), or colon (`:`).\nSpacing and punctuation is also permitted with the exception a question mark (`?`), newline, and carriage return, together with literal text enclosed in single quotes.\nFor example, `MM/dd HH.mm.ss,SSSSSS \'in\' yyyy` is a valid override format.\n\nOne valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`.\nAnother is when the timestamp format is one that the structure finder does not consider by default.\n\nIf this parameter is not specified, the structure finder chooses the best format from a built-in set.\n\nIf the special value `null` is specified, the structure finder will not look for a primary timestamp in the text.\nWhen the format is semi-structured text, this will result in the structure finder treating the text as single-line messages.' +}); /** * The mode of compatibility with ECS compliant Grok patterns. * Use this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern. * Valid values are `disabled` and `v1`. */ -export const text_structure_test_grok_pattern_ecs_compatibility = z - .string() - .register(z.globalRegistry, { - description: - 'The mode of compatibility with ECS compliant Grok patterns.\nUse this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.\nValid values are `disabled` and `v1`.', - }); +export const text_structure_test_grok_pattern_ecs_compatibility = z.string().register(z.globalRegistry, { + description: 'The mode of compatibility with ECS compliant Grok patterns.\nUse this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.\nValid values are `disabled` and `v1`.' +}); /** * Identifier for the transform. It can be a transform identifier or a @@ -39254,22 +32945,21 @@ export const transform_get_transform_transform_id = types_names; * there are no matches or only partial matches. */ export const transform_get_transform_allow_no_match = z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no transforms that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf this parameter is false, the request returns a 404 status code when\nthere are no matches or only partial matches.', + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no transforms that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf this parameter is false, the request returns a 404 status code when\nthere are no matches or only partial matches.' }); /** * Skips the specified number of transforms. */ export const transform_get_transform_from = z.number().register(z.globalRegistry, { - description: 'Skips the specified number of transforms.', + description: 'Skips the specified number of transforms.' }); /** * Specifies the maximum number of transforms to obtain. */ export const transform_get_transform_size = z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of transforms to obtain.', + description: 'Specifies the maximum number of transforms to obtain.' }); /** @@ -39278,8 +32968,7 @@ export const transform_get_transform_size = z.number().register(z.globalRegistry * be retrieved and then added to another cluster. */ export const transform_get_transform_exclude_generated = z.boolean().register(z.globalRegistry, { - description: - 'Excludes fields that were automatically added when creating the\ntransform. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.', + description: 'Excludes fields that were automatically added when creating the\ntransform. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.' }); /** @@ -39324,7 +33013,7 @@ export const watcher_execute_watch_id = types_id; * Defines whether the watch runs in debug mode. */ export const watcher_execute_watch_debug = z.boolean().register(z.globalRegistry, { - description: 'Defines whether the watch runs in debug mode.', + description: 'Defines whether the watch runs in debug mode.' }); /** @@ -39337,20 +33026,18 @@ export const watcher_put_watch_id = types_id; * The default value is `true`, which means the watch is active by default. */ export const watcher_put_watch_active = z.boolean().register(z.globalRegistry, { - description: - 'The initial state of the watch.\nThe default value is `true`, which means the watch is active by default.', + description: 'The initial state of the watch.\nThe default value is `true`, which means the watch is active by default.' }); /** - * only update the watch if the last operation that has changed the watch has the specified primary term + * Only update the watch if the last operation that has changed the watch has the specified primary term */ export const watcher_put_watch_if_primary_term = z.number().register(z.globalRegistry, { - description: - 'only update the watch if the last operation that has changed the watch has the specified primary term', + description: 'Only update the watch if the last operation that has changed the watch has the specified primary term' }); /** - * only update the watch if the last operation that has changed the watch has the specified sequence number + * Only update the watch if the last operation that has changed the watch has the specified sequence number */ export const watcher_put_watch_if_seq_no = types_sequence_number; @@ -39363,52 +33050,47 @@ export const watcher_put_watch_version = types_version_number; * Defines which additional metrics are included in the response. */ export const watcher_stats_metric = z.union([ - watcher_stats_watcher_metric, - z.array(watcher_stats_watcher_metric), + watcher_stats_watcher_metric, + z.array(watcher_stats_watcher_metric) ]); /** * Defines whether stack traces are generated for each watch that is running. */ export const watcher_stats_emit_stacktraces = z.boolean().register(z.globalRegistry, { - description: 'Defines whether stack traces are generated for each watch that is running.', + description: 'Defines whether stack traces are generated for each watch that is running.' }); /** * Defines which additional metrics are included in the response. */ export const watcher_stats_metric2 = z.union([ - watcher_stats_watcher_metric, - z.array(watcher_stats_watcher_metric), + watcher_stats_watcher_metric, + z.array(watcher_stats_watcher_metric) ]); export const clear_scroll = z.object({ - scroll_id: z.optional(types_scroll_ids), + scroll_id: z.optional(types_scroll_ids) }); export const cluster_allocation_explain = z.object({ - index: z.optional(types_index_name), - shard: z.optional( - z.number().register(z.globalRegistry, { - description: 'An identifier for the shard that you would like an explanation for.', - }) - ), - primary: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns an explanation for the primary shard for the specified shard ID.', - }) - ), - current_node: z.optional(types_node_id), + index: z.optional(types_index_name), + shard: z.optional(z.number().register(z.globalRegistry, { + description: 'An identifier for the shard that you would like an explanation for.' + })), + primary: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns an explanation for the primary shard for the specified shard ID.' + })), + current_node: z.optional(types_node_id) }); export const connector_put = z.object({ - description: z.optional(z.string()), - index_name: z.optional(types_index_name), - is_native: z.optional(z.boolean()), - language: z.optional(z.string()), - name: z.optional(z.string()), - service_type: z.optional(z.string()), + description: z.optional(z.string()), + index_name: z.optional(types_index_name), + is_native: z.optional(z.boolean()), + language: z.optional(z.string()), + name: z.optional(z.string()), + service_type: z.optional(z.string()) }); export const create = z.record(z.string(), z.unknown()); @@ -39416,20 +33098,17 @@ export const create = z.record(z.string(), z.unknown()); export const index = z.record(z.string(), z.unknown()); export const inference_inference = z.object({ - query: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The query input, which is required only for the `rerank` task.\nIt is not required for other tasks.', - }) - ), - input: z.union([z.string(), z.array(z.string())]), - input_type: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Specifies the input data type for the text embedding model. The `input_type` parameter only applies to Inference Endpoints with the `text_embedding` task type. Possible values include:\n* `SEARCH`\n* `INGEST`\n* `CLASSIFICATION`\n* `CLUSTERING`\nNot all services support all values. Unsupported values will trigger a validation exception.\nAccepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info.\n\n> info\n> The `input_type` parameter specified on the root level of the request body will take precedence over the `input_type` parameter specified in `task_settings`.', - }) - ), - task_settings: z.optional(inference_types_task_settings), + query: z.optional(z.string().register(z.globalRegistry, { + description: 'The query input, which is required only for the `rerank` task.\nIt is not required for other tasks.' + })), + input: z.union([ + z.string(), + z.array(z.string()) + ]), + input_type: z.optional(z.string().register(z.globalRegistry, { + description: 'Specifies the input data type for the text embedding model. The `input_type` parameter only applies to Inference Endpoints with the `text_embedding` task type. Possible values include:\n* `SEARCH`\n* `INGEST`\n* `CLASSIFICATION`\n* `CLUSTERING`\nNot all services support all values. Unsupported values will trigger a validation exception.\nAccepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info.\n\n> info\n> The `input_type` parameter specified on the root level of the request body will take precedence over the `input_type` parameter specified in `task_settings`.' + })), + task_settings: z.optional(inference_types_task_settings) }); export const inference_put = inference_types_inference_endpoint; @@ -39437,939 +33116,670 @@ export const inference_put = inference_types_inference_endpoint; export const inference_update = inference_types_inference_endpoint; export const license_post = z.object({ - license: z.optional(license_types_license), - licenses: z.optional( - z.array(license_types_license).register(z.globalRegistry, { - description: 'A sequence of one or more JSON documents containing the license information.', - }) - ), + license: z.optional(license_types_license), + licenses: z.optional(z.array(license_types_license).register(z.globalRegistry, { + description: 'A sequence of one or more JSON documents containing the license information.' + })) }); export const mget = z.object({ - docs: z.optional( - z.array(global_mget_operation).register(z.globalRegistry, { - description: - 'The documents you want to retrieve. Required if no index is specified in the request URI.', - }) - ), - ids: z.optional(types_ids), + docs: z.optional(z.array(global_mget_operation).register(z.globalRegistry, { + description: 'The documents you want to retrieve. Required if no index is specified in the request URI.' + })), + ids: z.optional(types_ids) }); export const ml_delete_expired_data = z.object({ - requests_per_second: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The desired requests per second for the deletion processes. The default\nbehavior is no throttling.', - }) - ), - timeout: z.optional(types_duration), + requests_per_second: z.optional(z.number().register(z.globalRegistry, { + description: 'The desired requests per second for the deletion processes. The default\nbehavior is no throttling.' + })), + timeout: z.optional(types_duration) }); export const ml_get_buckets = z.object({ - anomaly_score: z.optional( - z.number().register(z.globalRegistry, { - description: 'Refer to the description for the `anomaly_score` query parameter.', - }) - ), - desc: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Refer to the description for the `desc` query parameter.', - }) - ), - end: z.optional(types_date_time), - exclude_interim: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Refer to the description for the `exclude_interim` query parameter.', - }) - ), - expand: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Refer to the description for the `expand` query parameter.', - }) - ), - page: z.optional(ml_types_page), - sort: z.optional(types_field), - start: z.optional(types_date_time), + anomaly_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Refer to the description for the `anomaly_score` query parameter.' + })), + desc: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Refer to the description for the `desc` query parameter.' + })), + end: z.optional(types_date_time), + exclude_interim: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Refer to the description for the `exclude_interim` query parameter.' + })), + expand: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Refer to the description for the `expand` query parameter.' + })), + page: z.optional(ml_types_page), + sort: z.optional(types_field), + start: z.optional(types_date_time) }); export const ml_get_calendars = z.object({ - page: z.optional(ml_types_page), + page: z.optional(ml_types_page) }); export const ml_get_categories = z.object({ - page: z.optional(ml_types_page), + page: z.optional(ml_types_page) }); export const ml_get_influencers = z.object({ - page: z.optional(ml_types_page), + page: z.optional(ml_types_page) }); export const ml_get_model_snapshots = z.object({ - desc: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Refer to the description for the `desc` query parameter.', - }) - ), - end: z.optional(types_date_time), - page: z.optional(ml_types_page), - sort: z.optional(types_field), - start: z.optional(types_date_time), + desc: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Refer to the description for the `desc` query parameter.' + })), + end: z.optional(types_date_time), + page: z.optional(ml_types_page), + sort: z.optional(types_field), + start: z.optional(types_date_time) }); export const ml_get_overall_buckets = z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Refer to the description for the `allow_no_match` query parameter.', - }) - ), - bucket_span: z.optional(types_duration), - end: z.optional(types_date_time), - exclude_interim: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Refer to the description for the `exclude_interim` query parameter.', - }) - ), - overall_score: z.optional( - z.number().register(z.globalRegistry, { - description: 'Refer to the description for the `overall_score` query parameter.', - }) - ), - start: z.optional(types_date_time), - top_n: z.optional( - z.number().register(z.globalRegistry, { - description: 'Refer to the description for the `top_n` query parameter.', - }) - ), + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Refer to the description for the `allow_no_match` query parameter.' + })), + bucket_span: z.optional(types_duration), + end: z.optional(types_date_time), + exclude_interim: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Refer to the description for the `exclude_interim` query parameter.' + })), + overall_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Refer to the description for the `overall_score` query parameter.' + })), + start: z.optional(types_date_time), + top_n: z.optional(z.number().register(z.globalRegistry, { + description: 'Refer to the description for the `top_n` query parameter.' + })) }); export const ml_get_records = z.object({ - desc: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Refer to the description for the `desc` query parameter.', - }) - ), - end: z.optional(types_date_time), - exclude_interim: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Refer to the description for the `exclude_interim` query parameter.', - }) - ), - page: z.optional(ml_types_page), - record_score: z.optional( - z.number().register(z.globalRegistry, { - description: 'Refer to the description for the `record_score` query parameter.', - }) - ), - sort: z.optional(types_field), - start: z.optional(types_date_time), + desc: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Refer to the description for the `desc` query parameter.' + })), + end: z.optional(types_date_time), + exclude_interim: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Refer to the description for the `exclude_interim` query parameter.' + })), + page: z.optional(ml_types_page), + record_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Refer to the description for the `record_score` query parameter.' + })), + sort: z.optional(types_field), + start: z.optional(types_date_time) }); export const mtermvectors = z.object({ - docs: z.optional( - z.array(global_mtermvectors_operation).register(z.globalRegistry, { - description: 'An array of existing or artificial documents.', - }) - ), - ids: z.optional( - z.array(types_id).register(z.globalRegistry, { - description: - "A simplified syntax to specify documents by their ID if they're in the same index.", - }) - ), + docs: z.optional(z.array(global_mtermvectors_operation).register(z.globalRegistry, { + description: 'An array of existing or artificial documents.' + })), + ids: z.optional(z.array(types_id).register(z.globalRegistry, { + description: 'A simplified syntax to specify documents by their ID if they\'re in the same index.' + })) }); export const nodes_reload_secure_settings = z.object({ - secure_settings_password: z.optional(types_password), + secure_settings_password: z.optional(types_password) }); export const scroll = z.object({ - scroll: z.optional(types_duration), - scroll_id: types_scroll_id, + scroll: z.optional(types_duration), + scroll_id: types_scroll_id }); export const search_application_search = z.object({ - params: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'Query parameters specific to this request, which will override any defaults specified in the template.', - }) - ), + params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Query parameters specific to this request, which will override any defaults specified in the template.' + })) }); export const security_change_password = z.object({ - password: z.optional(types_password), - password_hash: z.optional( - z.string().register(z.globalRegistry, { - description: - 'A hash of the new password value. This must be produced using the same\nhashing algorithm as has been configured for password storage. For more details,\nsee the explanation of the `xpack.security.authc.password_hashing.algorithm`\nsetting.', - }) - ), + password: z.optional(types_password), + password_hash: z.optional(z.string().register(z.globalRegistry, { + description: 'A hash of the new password value. This must be produced using the same\nhashing algorithm as has been configured for password storage. For more details,\nsee the explanation of the `xpack.security.authc.password_hashing.algorithm`\nsetting.' + })) }); export const security_has_privileges = z.object({ - application: z.optional(z.array(security_has_privileges_application_privileges_check)), - cluster: z.optional( - z.array(security_types_cluster_privilege).register(z.globalRegistry, { - description: 'A list of the cluster privileges that you want to check.', - }) - ), - index: z.optional(z.array(security_has_privileges_index_privileges_check)), + application: z.optional(z.array(security_has_privileges_application_privileges_check)), + cluster: z.optional(z.array(security_types_cluster_privilege).register(z.globalRegistry, { + description: 'A list of the cluster privileges that you want to check.' + })), + index: z.optional(z.array(security_has_privileges_index_privileges_check)) }); export const security_has_privileges_user_profile = z.object({ - uids: z.array(security_types_user_profile_id).register(z.globalRegistry, { - description: - 'A list of profile IDs. The privileges are checked for associated users of the profiles.', - }), - privileges: security_has_privileges_user_profile_privileges_check, + uids: z.array(security_types_user_profile_id).register(z.globalRegistry, { + description: 'A list of profile IDs. The privileges are checked for associated users of the profiles.' + }), + privileges: security_has_privileges_user_profile_privileges_check }); -export const security_put_privileges = z.record( - z.string(), - z.record(z.string(), security_put_privileges_actions) -); +export const security_put_privileges = z.record(z.string(), z.record(z.string(), security_put_privileges_actions)); export const security_put_user = z.object({ - username: z.optional(types_username), - email: z.optional(z.union([z.string(), z.null()])), - full_name: z.optional(z.union([z.string(), z.null()])), - metadata: z.optional(types_metadata), - password: z.optional(types_password), - password_hash: z.optional( - z.string().register(z.globalRegistry, { - description: - "A hash of the user's password.\nThis must be produced using the same hashing algorithm as has been configured for password storage.\nFor more details, see the explanation of the `xpack.security.authc.password_hashing.algorithm` setting in the user cache and password hash algorithm documentation.\nUsing this parameter allows the client to pre-hash the password for performance and/or confidentiality reasons.\nThe `password` parameter and the `password_hash` parameter cannot be used in the same request.", - }) - ), - roles: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - "A set of roles the user has.\nThe roles determine the user's access permissions.\nTo create a user without any roles, specify an empty list (`[]`).", - }) - ), - enabled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Specifies whether the user is enabled.', - }) - ), + username: z.optional(types_username), + email: z.optional(z.union([ + z.string(), + z.null() + ])), + full_name: z.optional(z.union([ + z.string(), + z.null() + ])), + metadata: z.optional(types_metadata), + password: z.optional(types_password), + password_hash: z.optional(z.string().register(z.globalRegistry, { + description: 'A hash of the user\'s password.\nThis must be produced using the same hashing algorithm as has been configured for password storage.\nFor more details, see the explanation of the `xpack.security.authc.password_hashing.algorithm` setting in the user cache and password hash algorithm documentation.\nUsing this parameter allows the client to pre-hash the password for performance and/or confidentiality reasons.\nThe `password` parameter and the `password_hash` parameter cannot be used in the same request.' + })), + roles: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A set of roles the user has.\nThe roles determine the user\'s access permissions.\nTo create a user without any roles, specify an empty list (`[]`).' + })), + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether the user is enabled.' + })) }); export const security_suggest_user_profiles = z.object({ - name: z.optional( - z.string().register(z.globalRegistry, { - description: - "A query string used to match name-related fields in user profile documents.\nName-related fields are the user's `username`, `full_name`, and `email`.", - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of profiles to return.', - }) - ), - data: z.optional(z.union([z.string(), z.array(z.string())])), - hint: z.optional(security_suggest_user_profiles_hint), + name: z.optional(z.string().register(z.globalRegistry, { + description: 'A query string used to match name-related fields in user profile documents.\nName-related fields are the user\'s `username`, `full_name`, and `email`.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of profiles to return.' + })), + data: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + hint: z.optional(security_suggest_user_profiles_hint) }); export const security_update_user_profile_data = z.object({ - labels: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'Searchable data that you want to associate with the user profile.\nThis field supports a nested data structure.\nWithin the labels object, top-level keys cannot begin with an underscore (`_`) or contain a period (`.`).', - }) - ), - data: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'Non-searchable data that you want to associate with the user profile.\nThis field supports a nested data structure.\nWithin the `data` object, top-level keys cannot begin with an underscore (`_`) or contain a period (`.`).\nThe data object is not searchable, but can be retrieved with the get user profile API.', - }) - ), + labels: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Searchable data that you want to associate with the user profile.\nThis field supports a nested data structure.\nWithin the labels object, top-level keys cannot begin with an underscore (`_`) or contain a period (`.`).' + })), + data: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Non-searchable data that you want to associate with the user profile.\nThis field supports a nested data structure.\nWithin the `data` object, top-level keys cannot begin with an underscore (`_`) or contain a period (`.`).\nThe data object is not searchable, but can be retrieved with the get user profile API.' + })) }); export const snapshot_create = z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - feature_states: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'The feature states to include in the snapshot.\nEach feature state includes one or more system indices containing related data.\nYou can view a list of eligible features using the get features API.\n\nIf `include_global_state` is `true`, all current feature states are included by default.\nIf `include_global_state` is `false`, no feature states are included by default.\n\nNote that specifying an empty array will result in the default behavior.\nTo exclude all feature states, regardless of the `include_global_state` value, specify an array with only the value `none` (`["none"]`).', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request ignores data streams and indices in `indices` that are missing or closed.\nIf `false`, the request returns an error for any data stream or index that is missing or closed.', - }) - ), - include_global_state: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the current cluster state is included in the snapshot.\nThe cluster state includes persistent cluster settings, composable index templates, legacy index templates, ingest pipelines, and ILM policies.\nIt also includes data stored in system indices, such as Watches and task records (configurable via `feature_states`).', - }) - ), - indices: z.optional(types_indices), - metadata: z.optional(types_metadata), - partial: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, it enables you to restore a partial snapshot of indices with unavailable shards.\nOnly shards that were successfully included in the snapshot will be restored.\nAll missing shards will be recreated as empty.\n\nIf `false`, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available.', - }) - ), + expand_wildcards: z.optional(types_expand_wildcards), + feature_states: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The feature states to include in the snapshot.\nEach feature state includes one or more system indices containing related data.\nYou can view a list of eligible features using the get features API.\n\nIf `include_global_state` is `true`, all current feature states are included by default.\nIf `include_global_state` is `false`, no feature states are included by default.\n\nNote that specifying an empty array will result in the default behavior.\nTo exclude all feature states, regardless of the `include_global_state` value, specify an array with only the value `none` (`["none"]`).' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request ignores data streams and indices in `indices` that are missing or closed.\nIf `false`, the request returns an error for any data stream or index that is missing or closed.' + })), + include_global_state: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the current cluster state is included in the snapshot.\nThe cluster state includes persistent cluster settings, composable index templates, legacy index templates, ingest pipelines, and ILM policies.\nIt also includes data stored in system indices, such as Watches and task records (configurable via `feature_states`).' + })), + indices: z.optional(types_indices), + metadata: z.optional(types_metadata), + partial: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, it enables you to restore a partial snapshot of indices with unavailable shards.\nOnly shards that were successfully included in the snapshot will be restored.\nAll missing shards will be recreated as empty.\n\nIf `false`, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available.' + })) }); export const snapshot_create_repository2 = snapshot_types_repository; export const termvectors = z.object({ - doc: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'An artificial document (a document not present in the index) for which you want to retrieve term vectors.', - }) - ), - filter: z.optional(global_termvectors_filter), - per_field_analyzer: z.optional( - z.record(z.string(), z.string()).register(z.globalRegistry, { - description: - 'Override the default per-field analyzer.\nThis is useful in order to generate term vectors in any fashion, especially when using artificial documents.\nWhen providing an analyzer for a field that already stores term vectors, the term vectors will be regenerated.', - }) - ), - fields: z.optional( - z.array(types_field).register(z.globalRegistry, { - description: - 'A list of fields to include in the statistics.\nIt is used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters.', - }) - ), - field_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes:\n\n* The document count (how many documents contain this field).\n* The sum of document frequencies (the sum of document frequencies for all terms in this field).\n* The sum of total term frequencies (the sum of total term frequencies of each term in this field).', - }) - ), - offsets: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term offsets.', - }) - ), - payloads: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term payloads.', - }) - ), - positions: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term positions.', - }) - ), - term_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes:\n\n* The total term frequency (how often a term occurs in all documents).\n* The document frequency (the number of documents containing the current term).\n\nBy default these values are not returned since term statistics can have a serious performance impact.', - }) - ), - routing: z.optional(types_routing), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), + doc: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'An artificial document (a document not present in the index) for which you want to retrieve term vectors.' + })), + filter: z.optional(global_termvectors_filter), + per_field_analyzer: z.optional(z.record(z.string(), z.string()).register(z.globalRegistry, { + description: 'Override the default per-field analyzer.\nThis is useful in order to generate term vectors in any fashion, especially when using artificial documents.\nWhen providing an analyzer for a field that already stores term vectors, the term vectors will be regenerated.' + })), + fields: z.optional(z.array(types_field).register(z.globalRegistry, { + description: 'A list of fields to include in the statistics.\nIt is used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters.' + })), + field_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes:\n\n* The document count (how many documents contain this field).\n* The sum of document frequencies (the sum of document frequencies for all terms in this field).\n* The sum of total term frequencies (the sum of total term frequencies of each term in this field).' + })), + offsets: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term offsets.' + })), + payloads: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term payloads.' + })), + positions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term positions.' + })), + term_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes:\n\n* The total term frequency (how often a term occurs in all documents).\n* The document frequency (the number of documents containing the current term).\n\nBy default these values are not returned since term statistics can have a serious performance impact.' + })), + routing: z.optional(types_routing), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type) }); export const text_structure_find_message_structure = z.object({ - messages: z.array(z.string()).register(z.globalRegistry, { - description: 'The list of messages you want to analyze.', - }), + messages: z.array(z.string()).register(z.globalRegistry, { + description: 'The list of messages you want to analyze.' + }) }); export const text_structure_test_grok_pattern = z.object({ - grok_pattern: types_grok_pattern, - text: z.array(z.string()).register(z.globalRegistry, { - description: 'The lines of text to run the Grok pattern on.', - }), + grok_pattern: types_grok_pattern, + text: z.array(z.string()).register(z.globalRegistry, { + description: 'The lines of text to run the Grok pattern on.' + }) }); export const async_search_submit = z.object({ - aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container)), - collapse: z.optional(global_search_types_field_collapse), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns detailed information about score computation as part of a hit.', - }) - ), - ext: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'Configuration of search extensions defined by Elasticsearch plugins.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Starting document offset. By default, you cannot page through more than 10,000\nhits using the from and size parameters. To page through more hits, use the\nsearch_after parameter.', - }) - ), - highlight: z.optional(global_search_types_highlight), - track_total_hits: z.optional(global_search_types_track_hits), - indices_boost: z.optional( - z.array(z.record(z.string(), z.number())).register(z.globalRegistry, { - description: 'Boosts the _score of documents from specified indices.', - }) - ), - docvalue_fields: z.optional( - z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { - description: - 'Array of wildcard (*) patterns. The request returns doc values for field\nnames matching these patterns in the hits.fields property of the response.', - }) - ), - knn: z.optional(z.union([types_knn_search, z.array(types_knn_search)])), - min_score: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Minimum _score for matching documents. Documents with a lower _score are\nnot included in search results and results collected by aggregations.', - }) - ), - post_filter: z.optional(types_query_dsl_query_container), - profile: z.optional(z.boolean()), - query: z.optional(types_query_dsl_query_container), - rescore: z.optional(z.union([global_search_types_rescore, z.array(global_search_types_rescore)])), - script_fields: z.optional( - z.record(z.string(), types_script_field).register(z.globalRegistry, { - description: 'Retrieve a script evaluation (based on different fields) for each hit.', - }) - ), - search_after: z.optional(types_sort_results), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of hits to return. By default, you cannot page through more\nthan 10,000 hits using the from and size parameters. To page through more\nhits, use the search_after parameter.', - }) - ), - slice: z.optional(types_sliced_scroll), - sort: z.optional(types_sort), - _source: z.optional(global_search_types_source_config), - fields: z.optional( - z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { - description: - 'Array of wildcard (*) patterns. The request returns values for field names\nmatching these patterns in the hits.fields property of the response.', - }) - ), - suggest: z.optional(global_search_types_suggester), - terminate_after: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of documents to collect for each shard. If a query reaches this\nlimit, Elasticsearch terminates the query early. Elasticsearch collects documents\nbefore sorting. Defaults to 0, which does not terminate query execution early.', - }) - ), - timeout: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Specifies the period of time to wait for a response from each shard. If no response\nis received before the timeout expires, the request fails and returns an error.\nDefaults to no timeout.', - }) - ), - track_scores: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, calculate and return document scores, even if the scores are not used for sorting.', - }) - ), - version: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, returns document version as part of a hit.', - }) - ), - seq_no_primary_term: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns sequence number and primary term of the last modification\nof each hit. See Optimistic concurrency control.', - }) - ), - stored_fields: z.optional(types_fields), - pit: z.optional(global_search_types_point_in_time_reference), - runtime_mappings: z.optional(types_mapping_runtime_fields), - stats: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'Stats groups to associate with the search. Each group maintains a statistics\naggregation for its associated searches. You can retrieve these stats using\nthe indices stats API.', - }) - ), + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container)), + collapse: z.optional(global_search_types_field_collapse), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns detailed information about score computation as part of a hit.' + })), + ext: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Configuration of search extensions defined by Elasticsearch plugins.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Starting document offset. By default, you cannot page through more than 10,000\nhits using the from and size parameters. To page through more hits, use the\nsearch_after parameter.' + })), + highlight: z.optional(global_search_types_highlight), + track_total_hits: z.optional(global_search_types_track_hits), + indices_boost: z.optional(z.array(z.record(z.string(), z.number())).register(z.globalRegistry, { + description: 'Boosts the _score of documents from specified indices.' + })), + docvalue_fields: z.optional(z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { + description: 'Array of wildcard (*) patterns. The request returns doc values for field\nnames matching these patterns in the hits.fields property of the response.' + })), + knn: z.optional(z.union([ + types_knn_search, + z.array(types_knn_search) + ])), + min_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Minimum _score for matching documents. Documents with a lower _score are\nnot included in search results and results collected by aggregations.' + })), + post_filter: z.optional(types_query_dsl_query_container), + profile: z.optional(z.boolean()), + query: z.optional(types_query_dsl_query_container), + rescore: z.optional(z.union([ + global_search_types_rescore, + z.array(global_search_types_rescore) + ])), + script_fields: z.optional(z.record(z.string(), types_script_field).register(z.globalRegistry, { + description: 'Retrieve a script evaluation (based on different fields) for each hit.' + })), + search_after: z.optional(types_sort_results), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of hits to return. By default, you cannot page through more\nthan 10,000 hits using the from and size parameters. To page through more\nhits, use the search_after parameter.' + })), + slice: z.optional(types_sliced_scroll), + sort: z.optional(types_sort), + _source: z.optional(global_search_types_source_config), + fields: z.optional(z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { + description: 'Array of wildcard (*) patterns. The request returns values for field names\nmatching these patterns in the hits.fields property of the response.' + })), + suggest: z.optional(global_search_types_suggester), + terminate_after: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of documents to collect for each shard. If a query reaches this\nlimit, Elasticsearch terminates the query early. Elasticsearch collects documents\nbefore sorting. Defaults to 0, which does not terminate query execution early.' + })), + timeout: z.optional(z.string().register(z.globalRegistry, { + description: 'Specifies the period of time to wait for a response from each shard. If no response\nis received before the timeout expires, the request fails and returns an error.\nDefaults to no timeout.' + })), + track_scores: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, calculate and return document scores, even if the scores are not used for sorting.' + })), + version: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns document version as part of a hit.' + })), + seq_no_primary_term: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns sequence number and primary term of the last modification\nof each hit. See Optimistic concurrency control.' + })), + stored_fields: z.optional(types_fields), + pit: z.optional(global_search_types_point_in_time_reference), + runtime_mappings: z.optional(types_mapping_runtime_fields), + stats: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Stats groups to associate with the search. Each group maintains a statistics\naggregation for its associated searches. You can retrieve these stats using\nthe indices stats API.' + })) }); -export const bulk = z.array( - z.union([ +export const bulk = z.array(z.union([ global_bulk_operation_container, global_bulk_update_action, - z.record(z.string(), z.unknown()), - ]) -); + z.record(z.string(), z.unknown()) +])); export const cluster_put_component_template = z.object({ - template: indices_types_index_state, - version: z.optional(types_version_number), - _meta: z.optional(types_metadata), - deprecated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Marks this index template as deprecated. When creating or updating a non-deprecated index template\nthat uses deprecated components, Elasticsearch will emit a deprecation warning.', - }) - ), + template: indices_types_index_state, + version: z.optional(types_version_number), + _meta: z.optional(types_metadata), + deprecated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Marks this index template as deprecated. When creating or updating a non-deprecated index template\nthat uses deprecated components, Elasticsearch will emit a deprecation warning.' + })) }); export const count = z.object({ - query: z.optional(types_query_dsl_query_container), + query: z.optional(types_query_dsl_query_container) }); export const eql_search = z.object({ - query: z.string().register(z.globalRegistry, { - description: 'EQL query you wish to run.', - }), - case_sensitive: z.optional(z.boolean()), - event_category_field: z.optional(types_field), - tiebreaker_field: z.optional(types_field), - timestamp_field: z.optional(types_field), - fetch_size: z.optional(types_uint), - filter: z.optional( - z.union([types_query_dsl_query_container, z.array(types_query_dsl_query_container)]) - ), - keep_alive: z.optional(types_duration), - keep_on_completion: z.optional(z.boolean()), - wait_for_completion_timeout: z.optional(types_duration), - allow_partial_search_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Allow query execution also in case of shard failures.\nIf true, the query will keep running and will return results based on the available shards.\nFor sequences, the behavior can be further refined using allow_partial_sequence_results', - }) - ), - allow_partial_sequence_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'This flag applies only to sequences and has effect only if allow_partial_search_results=true.\nIf true, the sequence query will return results based on the available shards, ignoring the others.\nIf false, the sequence query will return successfully, but will always have empty results.', - }) - ), - size: z.optional(types_uint), - fields: z.optional( - z.union([types_query_dsl_field_and_format, z.array(types_query_dsl_field_and_format)]) - ), - result_position: z.optional(eql_search_result_position), - runtime_mappings: z.optional(types_mapping_runtime_fields), - max_samples_per_key: z.optional( - z.number().register(z.globalRegistry, { - description: - 'By default, the response of a sample query contains up to `10` samples, with one sample per unique set of join keys. Use the `size`\nparameter to get a smaller or larger set of samples. To retrieve more than one sample per set of join keys, use the\n`max_samples_per_key` parameter. Pipes are not supported for sample queries.', - }) - ), + query: z.string().register(z.globalRegistry, { + description: 'EQL query you wish to run.' + }), + case_sensitive: z.optional(z.boolean()), + event_category_field: z.optional(types_field), + tiebreaker_field: z.optional(types_field), + timestamp_field: z.optional(types_field), + fetch_size: z.optional(types_uint), + filter: z.optional(z.union([ + types_query_dsl_query_container, + z.array(types_query_dsl_query_container) + ])), + keep_alive: z.optional(types_duration), + keep_on_completion: z.optional(z.boolean()), + wait_for_completion_timeout: z.optional(types_duration), + allow_partial_search_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Allow query execution also in case of shard failures.\nIf true, the query will keep running and will return results based on the available shards.\nFor sequences, the behavior can be further refined using allow_partial_sequence_results' + })), + allow_partial_sequence_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'This flag applies only to sequences and has effect only if allow_partial_search_results=true.\nIf true, the sequence query will return results based on the available shards, ignoring the others.\nIf false, the sequence query will return successfully, but will always have empty results.' + })), + size: z.optional(types_uint), + fields: z.optional(z.union([ + types_query_dsl_field_and_format, + z.array(types_query_dsl_field_and_format) + ])), + result_position: z.optional(eql_search_result_position), + runtime_mappings: z.optional(types_mapping_runtime_fields), + max_samples_per_key: z.optional(z.number().register(z.globalRegistry, { + description: 'By default, the response of a sample query contains up to `10` samples, with one sample per unique set of join keys. Use the `size`\nparameter to get a smaller or larger set of samples. To retrieve more than one sample per set of join keys, use the\n`max_samples_per_key` parameter. Pipes are not supported for sample queries.' + })) }); export const explain = z.object({ - query: z.optional(types_query_dsl_query_container), + query: z.optional(types_query_dsl_query_container) }); export const field_caps = z.object({ - fields: z.optional(types_fields), - index_filter: z.optional(types_query_dsl_query_container), - runtime_mappings: z.optional(types_mapping_runtime_fields), + fields: z.optional(types_fields), + index_filter: z.optional(types_query_dsl_query_container), + runtime_mappings: z.optional(types_mapping_runtime_fields) }); export const fleet_msearch = z.array(global_msearch_request_item); export const fleet_search = z.object({ - aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container)), - collapse: z.optional(global_search_types_field_collapse), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns detailed information about score computation as part of a hit.', - }) - ), - ext: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'Configuration of search extensions defined by Elasticsearch plugins.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Starting document offset. By default, you cannot page through more than 10,000\nhits using the from and size parameters. To page through more hits, use the\nsearch_after parameter.', - }) - ), - highlight: z.optional(global_search_types_highlight), - track_total_hits: z.optional(global_search_types_track_hits), - indices_boost: z.optional( - z.array(z.record(z.string(), z.number())).register(z.globalRegistry, { - description: 'Boosts the _score of documents from specified indices.', - }) - ), - docvalue_fields: z.optional( - z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { - description: - 'Array of wildcard (*) patterns. The request returns doc values for field\nnames matching these patterns in the hits.fields property of the response.', - }) - ), - min_score: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Minimum _score for matching documents. Documents with a lower _score are\nnot included in search results and results collected by aggregations.', - }) - ), - post_filter: z.optional(types_query_dsl_query_container), - profile: z.optional(z.boolean()), - query: z.optional(types_query_dsl_query_container), - rescore: z.optional(z.union([global_search_types_rescore, z.array(global_search_types_rescore)])), - script_fields: z.optional( - z.record(z.string(), types_script_field).register(z.globalRegistry, { - description: 'Retrieve a script evaluation (based on different fields) for each hit.', - }) - ), - search_after: z.optional(types_sort_results), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of hits to return. By default, you cannot page through more\nthan 10,000 hits using the from and size parameters. To page through more\nhits, use the search_after parameter.', - }) - ), - slice: z.optional(types_sliced_scroll), - sort: z.optional(types_sort), - _source: z.optional(global_search_types_source_config), - fields: z.optional( - z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { - description: - 'Array of wildcard (*) patterns. The request returns values for field names\nmatching these patterns in the hits.fields property of the response.', - }) - ), - suggest: z.optional(global_search_types_suggester), - terminate_after: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of documents to collect for each shard. If a query reaches this\nlimit, Elasticsearch terminates the query early. Elasticsearch collects documents\nbefore sorting. Defaults to 0, which does not terminate query execution early.', - }) - ), - timeout: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Specifies the period of time to wait for a response from each shard. If no response\nis received before the timeout expires, the request fails and returns an error.\nDefaults to no timeout.', - }) - ), - track_scores: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, calculate and return document scores, even if the scores are not used for sorting.', - }) - ), - version: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, returns document version as part of a hit.', - }) - ), - seq_no_primary_term: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns sequence number and primary term of the last modification\nof each hit. See Optimistic concurrency control.', - }) - ), - stored_fields: z.optional(types_fields), - pit: z.optional(global_search_types_point_in_time_reference), - runtime_mappings: z.optional(types_mapping_runtime_fields), - stats: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'Stats groups to associate with the search. Each group maintains a statistics\naggregation for its associated searches. You can retrieve these stats using\nthe indices stats API.', - }) - ), + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container)), + collapse: z.optional(global_search_types_field_collapse), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns detailed information about score computation as part of a hit.' + })), + ext: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Configuration of search extensions defined by Elasticsearch plugins.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Starting document offset. By default, you cannot page through more than 10,000\nhits using the from and size parameters. To page through more hits, use the\nsearch_after parameter.' + })), + highlight: z.optional(global_search_types_highlight), + track_total_hits: z.optional(global_search_types_track_hits), + indices_boost: z.optional(z.array(z.record(z.string(), z.number())).register(z.globalRegistry, { + description: 'Boosts the _score of documents from specified indices.' + })), + docvalue_fields: z.optional(z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { + description: 'Array of wildcard (*) patterns. The request returns doc values for field\nnames matching these patterns in the hits.fields property of the response.' + })), + min_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Minimum _score for matching documents. Documents with a lower _score are\nnot included in search results and results collected by aggregations.' + })), + post_filter: z.optional(types_query_dsl_query_container), + profile: z.optional(z.boolean()), + query: z.optional(types_query_dsl_query_container), + rescore: z.optional(z.union([ + global_search_types_rescore, + z.array(global_search_types_rescore) + ])), + script_fields: z.optional(z.record(z.string(), types_script_field).register(z.globalRegistry, { + description: 'Retrieve a script evaluation (based on different fields) for each hit.' + })), + search_after: z.optional(types_sort_results), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of hits to return. By default, you cannot page through more\nthan 10,000 hits using the from and size parameters. To page through more\nhits, use the search_after parameter.' + })), + slice: z.optional(types_sliced_scroll), + sort: z.optional(types_sort), + _source: z.optional(global_search_types_source_config), + fields: z.optional(z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { + description: 'Array of wildcard (*) patterns. The request returns values for field names\nmatching these patterns in the hits.fields property of the response.' + })), + suggest: z.optional(global_search_types_suggester), + terminate_after: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of documents to collect for each shard. If a query reaches this\nlimit, Elasticsearch terminates the query early. Elasticsearch collects documents\nbefore sorting. Defaults to 0, which does not terminate query execution early.' + })), + timeout: z.optional(z.string().register(z.globalRegistry, { + description: 'Specifies the period of time to wait for a response from each shard. If no response\nis received before the timeout expires, the request fails and returns an error.\nDefaults to no timeout.' + })), + track_scores: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, calculate and return document scores, even if the scores are not used for sorting.' + })), + version: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns document version as part of a hit.' + })), + seq_no_primary_term: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns sequence number and primary term of the last modification\nof each hit. See Optimistic concurrency control.' + })), + stored_fields: z.optional(types_fields), + pit: z.optional(global_search_types_point_in_time_reference), + runtime_mappings: z.optional(types_mapping_runtime_fields), + stats: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Stats groups to associate with the search. Each group maintains a statistics\naggregation for its associated searches. You can retrieve these stats using\nthe indices stats API.' + })) }); export const graph_explore = z.object({ - connections: z.optional(graph_types_hop), - controls: z.optional(graph_types_explore_controls), - query: z.optional(types_query_dsl_query_container), - vertices: z.optional( - z.array(graph_types_vertex_definition).register(z.globalRegistry, { - description: - 'Specifies one or more fields that contain the terms you want to include in the graph as vertices.', - }) - ), + connections: z.optional(graph_types_hop), + controls: z.optional(graph_types_explore_controls), + query: z.optional(types_query_dsl_query_container), + vertices: z.optional(z.array(graph_types_vertex_definition).register(z.globalRegistry, { + description: 'Specifies one or more fields that contain the terms you want to include in the graph as vertices.' + })) }); export const indices_analyze = z.object({ - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The name of the analyzer that should be applied to the provided `text`.\nThis could be a built-in analyzer, or an analyzer that’s been configured in the index.', - }) - ), - attributes: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'Array of token attributes used to filter the output of the `explain` parameter.', - }) - ), - char_filter: z.optional( - z.array(types_analysis_char_filter).register(z.globalRegistry, { - description: 'Array of character filters used to preprocess characters before the tokenizer.', - }) - ), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes token attributes and additional details.', - }) - ), - field: z.optional(types_field), - filter: z.optional( - z.array(types_analysis_token_filter).register(z.globalRegistry, { - description: 'Array of token filters used to apply after the tokenizer.', - }) - ), - normalizer: z.optional( - z.string().register(z.globalRegistry, { - description: 'Normalizer to use to convert text into a single token.', - }) - ), - text: z.optional(indices_analyze_text_to_analyze), - tokenizer: z.optional(types_analysis_tokenizer), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the analyzer that should be applied to the provided `text`.\nThis could be a built-in analyzer, or an analyzer that’s been configured in the index.' + })), + attributes: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Array of token attributes used to filter the output of the `explain` parameter.' + })), + char_filter: z.optional(z.array(types_analysis_char_filter).register(z.globalRegistry, { + description: 'Array of character filters used to preprocess characters before the tokenizer.' + })), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes token attributes and additional details.' + })), + field: z.optional(types_field), + filter: z.optional(z.array(types_analysis_token_filter).register(z.globalRegistry, { + description: 'Array of token filters used to apply after the tokenizer.' + })), + normalizer: z.optional(z.string().register(z.globalRegistry, { + description: 'Normalizer to use to convert text into a single token.' + })), + text: z.optional(indices_analyze_text_to_analyze), + tokenizer: z.optional(types_analysis_tokenizer) }); export const indices_clone = z.object({ - aliases: z.optional( - z.record(z.string(), indices_types_alias).register(z.globalRegistry, { - description: 'Aliases for the resulting index.', - }) - ), - settings: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'Configuration options for the target index.', - }) - ), + aliases: z.optional(z.record(z.string(), indices_types_alias).register(z.globalRegistry, { + description: 'Aliases for the resulting index.' + })), + settings: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Configuration options for the target index.' + })) }); export const indices_create_from = indices_create_from_create_from; export const indices_put_alias = z.object({ - filter: z.optional(types_query_dsl_query_container), - index_routing: z.optional(types_routing), - is_write_index: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, sets the write index or data stream for the alias.\nIf an alias points to multiple indices or data streams and `is_write_index` isn’t set, the alias rejects write requests.\nIf an index alias points to one index and `is_write_index` isn’t set, the index automatically acts as the write index.\nData stream aliases don’t automatically set a write data stream, even if the alias points to one data stream.', - }) - ), - routing: z.optional(types_routing), - search_routing: z.optional(types_routing), + filter: z.optional(types_query_dsl_query_container), + index_routing: z.optional(types_routing), + is_write_index: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, sets the write index or data stream for the alias.\nIf an alias points to multiple indices or data streams and `is_write_index` isn’t set, the alias rejects write requests.\nIf an index alias points to one index and `is_write_index` isn’t set, the index automatically acts as the write index.\nData stream aliases don’t automatically set a write data stream, even if the alias points to one data stream.' + })), + routing: z.optional(types_routing), + search_routing: z.optional(types_routing) }); export const indices_put_index_template = z.object({ - index_patterns: z.optional(types_indices), - composed_of: z.optional( - z.array(types_name).register(z.globalRegistry, { - description: - 'An ordered list of component template names.\nComponent templates are merged in the order specified, meaning that the last component template specified has the highest precedence.', - }) - ), - template: z.optional(indices_put_index_template_index_template_mapping), - data_stream: z.optional(indices_types_data_stream_visibility), - priority: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Priority to determine index template precedence when a new data stream or index is created.\nThe index template with the highest priority is chosen.\nIf no priority is specified the template is treated as though it is of priority 0 (lowest priority).\nThis number is not automatically generated by Elasticsearch.', - }) - ), - version: z.optional(types_version_number), - _meta: z.optional(types_metadata), - allow_auto_create: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'This setting overrides the value of the `action.auto_create_index` cluster setting.\nIf set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`.\nIf set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created.', - }) - ), - ignore_missing_component_templates: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'The configuration option ignore_missing_component_templates can be used when an index template\nreferences a component template that might not exist', - }) - ), - deprecated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Marks this index template as deprecated. When creating or updating a non-deprecated index template\nthat uses deprecated components, Elasticsearch will emit a deprecation warning.', - }) - ), + index_patterns: z.optional(types_indices), + composed_of: z.optional(z.array(types_name).register(z.globalRegistry, { + description: 'An ordered list of component template names.\nComponent templates are merged in the order specified, meaning that the last component template specified has the highest precedence.' + })), + template: z.optional(indices_put_index_template_index_template_mapping), + data_stream: z.optional(indices_types_data_stream_visibility), + priority: z.optional(z.number().register(z.globalRegistry, { + description: 'Priority to determine index template precedence when a new data stream or index is created.\nThe index template with the highest priority is chosen.\nIf no priority is specified the template is treated as though it is of priority 0 (lowest priority).\nThis number is not automatically generated by Elasticsearch.' + })), + version: z.optional(types_version_number), + _meta: z.optional(types_metadata), + allow_auto_create: z.optional(z.boolean().register(z.globalRegistry, { + description: 'This setting overrides the value of the `action.auto_create_index` cluster setting.\nIf set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`.\nIf set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created.' + })), + ignore_missing_component_templates: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The configuration option ignore_missing_component_templates can be used when an index template\nreferences a component template that might not exist' + })), + deprecated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Marks this index template as deprecated. When creating or updating a non-deprecated index template\nthat uses deprecated components, Elasticsearch will emit a deprecation warning.' + })) }); export const indices_put_mapping = z.object({ - date_detection: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Controls whether dynamic date detection is enabled.', - }) - ), - dynamic: z.optional(types_mapping_dynamic_mapping), - dynamic_date_formats: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - "If date detection is enabled then new string fields are checked\nagainst 'dynamic_date_formats' and if the value matches then\na new date field is added instead of string.", - }) - ), - dynamic_templates: z.optional( - z.array(z.record(z.string(), types_mapping_dynamic_template)).register(z.globalRegistry, { - description: 'Specify dynamic templates for the mapping.', - }) - ), - _field_names: z.optional(types_mapping_field_names_field), - _meta: z.optional(types_metadata), - numeric_detection: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Automatically map strings into numeric data types for all fields.', - }) - ), - properties: z.optional( - z.record(z.string(), types_mapping_property).register(z.globalRegistry, { - description: - 'Mapping for a field. For new fields, this mapping can include:\n\n- Field name\n- Field data type\n- Mapping parameters', - }) - ), - _routing: z.optional(types_mapping_routing_field), - _source: z.optional(types_mapping_source_field), - runtime: z.optional(types_mapping_runtime_fields), + date_detection: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Controls whether dynamic date detection is enabled.' + })), + dynamic: z.optional(types_mapping_dynamic_mapping), + dynamic_date_formats: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'If date detection is enabled then new string fields are checked\nagainst \'dynamic_date_formats\' and if the value matches then\na new date field is added instead of string.' + })), + dynamic_templates: z.optional(z.array(z.record(z.string(), types_mapping_dynamic_template)).register(z.globalRegistry, { + description: 'Specify dynamic templates for the mapping.' + })), + _field_names: z.optional(types_mapping_field_names_field), + _meta: z.optional(types_metadata), + numeric_detection: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Automatically map strings into numeric data types for all fields.' + })), + properties: z.optional(z.record(z.string(), types_mapping_property).register(z.globalRegistry, { + description: 'Mapping for a field. For new fields, this mapping can include:\n\n- Field name\n- Field data type\n- Mapping parameters' + })), + _routing: z.optional(types_mapping_routing_field), + _source: z.optional(types_mapping_source_field), + runtime: z.optional(types_mapping_runtime_fields) }); export const indices_put_settings = indices_types_index_settings; export const indices_put_template = z.object({ - aliases: z.optional( - z.record(z.string(), indices_types_alias).register(z.globalRegistry, { - description: 'Aliases for the index.', - }) - ), - index_patterns: z.optional(z.union([z.string(), z.array(z.string())])), - mappings: z.optional(types_mapping_type_mapping), - order: z.optional( - z.number().register(z.globalRegistry, { - description: - "Order in which Elasticsearch applies this template if index\nmatches multiple templates.\n\nTemplates with lower 'order' values are merged first. Templates with higher\n'order' values are merged later, overriding templates with lower values.", - }) - ), - settings: z.optional(indices_types_index_settings), - version: z.optional(types_version_number), + aliases: z.optional(z.record(z.string(), indices_types_alias).register(z.globalRegistry, { + description: 'Aliases for the index.' + })), + index_patterns: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + mappings: z.optional(types_mapping_type_mapping), + order: z.optional(z.number().register(z.globalRegistry, { + description: 'Order in which Elasticsearch applies this template if index\nmatches multiple templates.\n\nTemplates with lower \'order\' values are merged first. Templates with higher\n\'order\' values are merged later, overriding templates with lower values.' + })), + settings: z.optional(indices_types_index_settings), + version: z.optional(types_version_number) }); export const indices_rollover = z.object({ - aliases: z.optional( - z.record(z.string(), indices_types_alias).register(z.globalRegistry, { - description: 'Aliases for the target index.\nData streams do not support this parameter.', - }) - ), - conditions: z.optional(indices_rollover_rollover_conditions), - mappings: z.optional(types_mapping_type_mapping), - settings: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'Configuration options for the index.\nData streams do not support this parameter.', - }) - ), + aliases: z.optional(z.record(z.string(), indices_types_alias).register(z.globalRegistry, { + description: 'Aliases for the target index.\nData streams do not support this parameter.' + })), + conditions: z.optional(indices_rollover_rollover_conditions), + mappings: z.optional(types_mapping_type_mapping), + settings: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Configuration options for the index.\nData streams do not support this parameter.' + })) }); export const indices_shrink = z.object({ - aliases: z.optional( - z.record(z.string(), indices_types_alias).register(z.globalRegistry, { - description: 'The key is the alias name.\nIndex alias names support date math.', - }) - ), - settings: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'Configuration options for the target index.', - }) - ), + aliases: z.optional(z.record(z.string(), indices_types_alias).register(z.globalRegistry, { + description: 'The key is the alias name.\nIndex alias names support date math.' + })), + settings: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Configuration options for the target index.' + })) }); export const indices_simulate_template = z.object({ - allow_auto_create: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'This setting overrides the value of the `action.auto_create_index` cluster setting.\nIf set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`.\nIf set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created.', - }) - ), - index_patterns: z.optional(types_indices), - composed_of: z.optional( - z.array(types_name).register(z.globalRegistry, { - description: - 'An ordered list of component template names.\nComponent templates are merged in the order specified, meaning that the last component template specified has the highest precedence.', - }) - ), - template: z.optional(indices_put_index_template_index_template_mapping), - data_stream: z.optional(indices_types_data_stream_visibility), - priority: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Priority to determine index template precedence when a new data stream or index is created.\nThe index template with the highest priority is chosen.\nIf no priority is specified the template is treated as though it is of priority 0 (lowest priority).\nThis number is not automatically generated by Elasticsearch.', - }) - ), - version: z.optional(types_version_number), - _meta: z.optional(types_metadata), - ignore_missing_component_templates: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'The configuration option ignore_missing_component_templates can be used when an index template\nreferences a component template that might not exist', - }) - ), - deprecated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Marks this index template as deprecated. When creating or updating a non-deprecated index template\nthat uses deprecated components, Elasticsearch will emit a deprecation warning.', - }) - ), + allow_auto_create: z.optional(z.boolean().register(z.globalRegistry, { + description: 'This setting overrides the value of the `action.auto_create_index` cluster setting.\nIf set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`.\nIf set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created.' + })), + index_patterns: z.optional(types_indices), + composed_of: z.optional(z.array(types_name).register(z.globalRegistry, { + description: 'An ordered list of component template names.\nComponent templates are merged in the order specified, meaning that the last component template specified has the highest precedence.' + })), + template: z.optional(indices_put_index_template_index_template_mapping), + data_stream: z.optional(indices_types_data_stream_visibility), + priority: z.optional(z.number().register(z.globalRegistry, { + description: 'Priority to determine index template precedence when a new data stream or index is created.\nThe index template with the highest priority is chosen.\nIf no priority is specified the template is treated as though it is of priority 0 (lowest priority).\nThis number is not automatically generated by Elasticsearch.' + })), + version: z.optional(types_version_number), + _meta: z.optional(types_metadata), + ignore_missing_component_templates: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The configuration option ignore_missing_component_templates can be used when an index template\nreferences a component template that might not exist' + })), + deprecated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Marks this index template as deprecated. When creating or updating a non-deprecated index template\nthat uses deprecated components, Elasticsearch will emit a deprecation warning.' + })) }); export const indices_split = z.object({ - aliases: z.optional( - z.record(z.string(), indices_types_alias).register(z.globalRegistry, { - description: 'Aliases for the resulting index.', - }) - ), - settings: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'Configuration options for the target index.', - }) - ), + aliases: z.optional(z.record(z.string(), indices_types_alias).register(z.globalRegistry, { + description: 'Aliases for the resulting index.' + })), + settings: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Configuration options for the target index.' + })) }); export const indices_validate_query = z.object({ - query: z.optional(types_query_dsl_query_container), + query: z.optional(types_query_dsl_query_container) }); export const ingest_simulate = z.object({ - docs: z.array(ingest_types_document).register(z.globalRegistry, { - description: 'Sample documents to test in the pipeline.', - }), - pipeline: z.optional(ingest_types_pipeline), + docs: z.array(ingest_types_document).register(z.globalRegistry, { + description: 'Sample documents to test in the pipeline.' + }), + pipeline: z.optional(ingest_types_pipeline) }); export const ml_explain_data_frame_analytics = z.object({ - source: z.optional(ml_types_dataframe_analytics_source), - dest: z.optional(ml_types_dataframe_analytics_destination), - analysis: z.optional(ml_types_dataframe_analysis_container), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the job.', - }) - ), - model_memory_limit: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The approximate maximum amount of memory resources that are permitted for\nanalytical processing. If your `elasticsearch.yml` file contains an\n`xpack.ml.max_model_memory_limit` setting, an error occurs when you try to\ncreate data frame analytics jobs that have `model_memory_limit` values\ngreater than that setting.', - }) - ), - max_num_threads: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of threads to be used by the analysis. Using more\nthreads may decrease the time necessary to complete the analysis at the\ncost of using more CPU. Note that the process may use additional threads\nfor operational functionality other than the analysis itself.', - }) - ), - analyzed_fields: z.optional(ml_types_dataframe_analysis_analyzed_fields), - allow_lazy_start: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether this job can start when there is insufficient machine\nlearning node capacity for it to be immediately assigned to a node.', - }) - ), + source: z.optional(ml_types_dataframe_analytics_source), + dest: z.optional(ml_types_dataframe_analytics_destination), + analysis: z.optional(ml_types_dataframe_analysis_container), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the job.' + })), + model_memory_limit: z.optional(z.string().register(z.globalRegistry, { + description: 'The approximate maximum amount of memory resources that are permitted for\nanalytical processing. If your `elasticsearch.yml` file contains an\n`xpack.ml.max_model_memory_limit` setting, an error occurs when you try to\ncreate data frame analytics jobs that have `model_memory_limit` values\ngreater than that setting.' + })), + max_num_threads: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of threads to be used by the analysis. Using more\nthreads may decrease the time necessary to complete the analysis at the\ncost of using more CPU. Note that the process may use additional threads\nfor operational functionality other than the analysis itself.' + })), + analyzed_fields: z.optional(ml_types_dataframe_analysis_analyzed_fields), + allow_lazy_start: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether this job can start when there is insufficient machine\nlearning node capacity for it to be immediately assigned to a node.' + })) }); export const ml_preview_data_frame_analytics = z.object({ - config: z.optional(ml_preview_data_frame_analytics_dataframe_preview_config), + config: z.optional(ml_preview_data_frame_analytics_dataframe_preview_config) }); export const ml_preview_datafeed = z.object({ - datafeed_config: z.optional(ml_types_datafeed_config), - job_config: z.optional(ml_types_job_config), + datafeed_config: z.optional(ml_types_datafeed_config), + job_config: z.optional(ml_types_job_config) }); export const msearch = z.array(global_msearch_request_item); @@ -40377,23747 +33787,17847 @@ export const msearch = z.array(global_msearch_request_item); export const msearch_template = z.array(global_msearch_template_request_item); export const put_script = z.object({ - script: types_stored_script, + script: types_stored_script }); export const rank_eval = z.object({ - requests: z.array(global_rank_eval_rank_eval_request_item).register(z.globalRegistry, { - description: 'A set of typical search requests, together with their provided ratings.', - }), - metric: z.optional(global_rank_eval_rank_eval_metric), + requests: z.array(global_rank_eval_rank_eval_request_item).register(z.globalRegistry, { + description: 'A set of typical search requests, together with their provided ratings.' + }), + metric: z.optional(global_rank_eval_rank_eval_metric) }); export const render_search_template = z.object({ - id: z.optional(types_id), - file: z.optional(z.string()), - params: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'Key-value pairs used to replace Mustache variables in the template.\nThe key is the variable name.\nThe value is the variable value.', - }) - ), - source: z.optional(types_script_source), + id: z.optional(types_id), + file: z.optional(z.string()), + params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Key-value pairs used to replace Mustache variables in the template.\nThe key is the variable name.\nThe value is the variable value.' + })), + source: z.optional(types_script_source) }); export const rollup_rollup_search = z.object({ - aggregations: z.optional( - z.record(z.string(), types_aggregations_aggregation_container).register(z.globalRegistry, { - description: 'Specifies aggregations.', - }) - ), - query: z.optional(types_query_dsl_query_container), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Must be zero if set, as rollups work on pre-aggregated data.', - }) - ), + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container).register(z.globalRegistry, { + description: 'Specifies aggregations.' + })), + query: z.optional(types_query_dsl_query_container), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Must be zero if set, as rollups work on pre-aggregated data.' + })) }); export const scripts_painless_execute = z.object({ - context: z.optional(global_scripts_painless_execute_painless_context), - context_setup: z.optional(global_scripts_painless_execute_painless_context_setup), - script: z.optional(types_script), + context: z.optional(global_scripts_painless_execute_painless_context), + context_setup: z.optional(global_scripts_painless_execute_painless_context_setup), + script: z.optional(types_script) }); export const search = z.object({ - aggregations: z.optional( - z.record(z.string(), types_aggregations_aggregation_container).register(z.globalRegistry, { - description: 'Defines the aggregations that are run as part of the search request.', - }) - ), - collapse: z.optional(global_search_types_field_collapse), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns detailed information about score computation as part of a hit.', - }) - ), - ext: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'Configuration of search extensions defined by Elasticsearch plugins.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The starting document offset, which must be non-negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', - }) - ), - highlight: z.optional(global_search_types_highlight), - track_total_hits: z.optional(global_search_types_track_hits), - indices_boost: z.optional( - z.array(z.record(z.string(), z.number())).register(z.globalRegistry, { - description: - 'Boost the `_score` of documents from specified indices.\nThe boost value is the factor by which scores are multiplied.\nA boost value greater than `1.0` increases the score.\nA boost value between `0` and `1.0` decreases the score.', - }) - ), - docvalue_fields: z.optional( - z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { - description: - 'An array of wildcard (`*`) field patterns.\nThe request returns doc values for field names matching these patterns in the `hits.fields` property of the response.', - }) - ), - knn: z.optional(z.union([types_knn_search, z.array(types_knn_search)])), - rank: z.optional(types_rank_container), - min_score: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The minimum `_score` for matching documents.\nDocuments with a lower `_score` are not included in search results and results collected by aggregations.', - }) - ), - post_filter: z.optional(types_query_dsl_query_container), - profile: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Set to `true` to return detailed timing information about the execution of individual components in a search request.\nNOTE: This is a debugging tool and adds significant overhead to search execution.', - }) - ), - query: z.optional(types_query_dsl_query_container), - rescore: z.optional(z.union([global_search_types_rescore, z.array(global_search_types_rescore)])), - retriever: z.optional(types_retriever_container), - script_fields: z.optional( - z.record(z.string(), types_script_field).register(z.globalRegistry, { - description: 'Retrieve a script evaluation (based on different fields) for each hit.', - }) - ), - search_after: z.optional(types_sort_results), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of hits to return, which must not be negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` property.', - }) - ), - slice: z.optional(types_sliced_scroll), - sort: z.optional(types_sort), - _source: z.optional(global_search_types_source_config), - fields: z.optional( - z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { - description: - 'An array of wildcard (`*`) field patterns.\nThe request returns values for field names matching these patterns in the `hits.fields` property of the response.', - }) - ), - suggest: z.optional(global_search_types_suggester), - terminate_after: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this property to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this property for requests that target data streams with backing indices across multiple data tiers.\n\nIf set to `0` (default), the query does not terminate early.', - }) - ), - timeout: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The period of time to wait for a response from each shard.\nIf no response is received before the timeout expires, the request fails and returns an error.\nDefaults to no timeout.', - }) - ), - track_scores: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, calculate and return document scores, even if the scores are not used for sorting.', - }) - ), - version: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request returns the document version as part of a hit.', - }) - ), - seq_no_primary_term: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns sequence number and primary term of the last modification of each hit.', - }) - ), - stored_fields: z.optional(types_fields), - pit: z.optional(global_search_types_point_in_time_reference), - runtime_mappings: z.optional(types_mapping_runtime_fields), - stats: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'The stats groups to associate with the search.\nEach group maintains a statistics aggregation for its associated searches.\nYou can retrieve these stats using the indices stats API.', - }) - ), + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container).register(z.globalRegistry, { + description: 'Defines the aggregations that are run as part of the search request.' + })), + collapse: z.optional(global_search_types_field_collapse), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns detailed information about score computation as part of a hit.' + })), + ext: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Configuration of search extensions defined by Elasticsearch plugins.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'The starting document offset, which must be non-negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' + })), + highlight: z.optional(global_search_types_highlight), + track_total_hits: z.optional(global_search_types_track_hits), + indices_boost: z.optional(z.array(z.record(z.string(), z.number())).register(z.globalRegistry, { + description: 'Boost the `_score` of documents from specified indices.\nThe boost value is the factor by which scores are multiplied.\nA boost value greater than `1.0` increases the score.\nA boost value between `0` and `1.0` decreases the score.' + })), + docvalue_fields: z.optional(z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { + description: 'An array of wildcard (`*`) field patterns.\nThe request returns doc values for field names matching these patterns in the `hits.fields` property of the response.' + })), + knn: z.optional(z.union([ + types_knn_search, + z.array(types_knn_search) + ])), + rank: z.optional(types_rank_container), + min_score: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum `_score` for matching documents.\nDocuments with a lower `_score` are not included in search results and results collected by aggregations.' + })), + post_filter: z.optional(types_query_dsl_query_container), + profile: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Set to `true` to return detailed timing information about the execution of individual components in a search request.\nNOTE: This is a debugging tool and adds significant overhead to search execution.' + })), + query: z.optional(types_query_dsl_query_container), + rescore: z.optional(z.union([ + global_search_types_rescore, + z.array(global_search_types_rescore) + ])), + retriever: z.optional(types_retriever_container), + script_fields: z.optional(z.record(z.string(), types_script_field).register(z.globalRegistry, { + description: 'Retrieve a script evaluation (based on different fields) for each hit.' + })), + search_after: z.optional(types_sort_results), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of hits to return, which must not be negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` property.' + })), + slice: z.optional(types_sliced_scroll), + sort: z.optional(types_sort), + _source: z.optional(global_search_types_source_config), + fields: z.optional(z.array(types_query_dsl_field_and_format).register(z.globalRegistry, { + description: 'An array of wildcard (`*`) field patterns.\nThe request returns values for field names matching these patterns in the `hits.fields` property of the response.' + })), + suggest: z.optional(global_search_types_suggester), + terminate_after: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this property to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this property for requests that target data streams with backing indices across multiple data tiers.\n\nIf set to `0` (default), the query does not terminate early.' + })), + timeout: z.optional(z.string().register(z.globalRegistry, { + description: 'The period of time to wait for a response from each shard.\nIf no response is received before the timeout expires, the request fails and returns an error.\nDefaults to no timeout.' + })), + track_scores: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, calculate and return document scores, even if the scores are not used for sorting.' + })), + version: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns the document version as part of a hit.' + })), + seq_no_primary_term: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns sequence number and primary term of the last modification of each hit.' + })), + stored_fields: z.optional(types_fields), + pit: z.optional(global_search_types_point_in_time_reference), + runtime_mappings: z.optional(types_mapping_runtime_fields), + stats: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The stats groups to associate with the search.\nEach group maintains a statistics aggregation for its associated searches.\nYou can retrieve these stats using the indices stats API.' + })) }); export const search_mvt = z.object({ - aggs: z.optional( - z.record(z.string(), types_aggregations_aggregation_container).register(z.globalRegistry, { - description: - "Sub-aggregations for the geotile_grid.\n\nIt supports the following aggregation types:\n\n- `avg`\n- `boxplot`\n- `cardinality`\n- `extended stats`\n- `max`\n- `median absolute deviation`\n- `min`\n- `percentile`\n- `percentile-rank`\n- `stats`\n- `sum`\n- `value count`\n\nThe aggregation names can't start with `_mvt_`. The `_mvt_` prefix is reserved for internal aggregations.", - }) - ), - buffer: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The size, in pixels, of a clipping buffer outside the tile. This allows renderers\nto avoid outline artifacts from geometries that extend past the extent of the tile.', - }) - ), - exact_bounds: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `false`, the meta layer's feature is the bounding box of the tile.\nIf `true`, the meta layer's feature is a bounding box resulting from a\n`geo_bounds` aggregation. The aggregation runs on values that intersect\nthe `//` tile with `wrap_longitude` set to `false`. The resulting\nbounding box may be larger than the vector tile.", - }) - ), - extent: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The size, in pixels, of a side of the tile. Vector tiles are square with equal sides.', - }) - ), - fields: z.optional(types_fields), - grid_agg: z.optional(global_search_mvt_types_grid_aggregation_type), - grid_precision: z.optional( - z.number().register(z.globalRegistry, { - description: - "Additional zoom levels available through the aggs layer. For example, if `` is `7`\nand `grid_precision` is `8`, you can zoom in up to level 15. Accepts 0-8. If 0, results\ndon't include the aggs layer.", - }) - ), - grid_type: z.optional(global_search_mvt_types_grid_type), - query: z.optional(types_query_dsl_query_container), - runtime_mappings: z.optional(types_mapping_runtime_fields), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - "The maximum number of features to return in the hits layer. Accepts 0-10000.\nIf 0, results don't include the hits layer.", - }) - ), - sort: z.optional(types_sort), - track_total_hits: z.optional(global_search_types_track_hits), - with_labels: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the hits and aggs layers will contain additional point features representing\nsuggested label positions for the original features.\n\n* `Point` and `MultiPoint` features will have one of the points selected.\n* `Polygon` and `MultiPolygon` features will have a single point generated, either the centroid, if it is within the polygon, or another point within the polygon selected from the sorted triangle-tree.\n* `LineString` features will likewise provide a roughly central point selected from the triangle-tree.\n* The aggregation results will provide one central point for each aggregation bucket.\n\nAll attributes from the original features will also be copied to the new label features.\nIn addition, the new features will be distinguishable using the tag `_mvt_label_position`.', - }) - ), + aggs: z.optional(z.record(z.string(), types_aggregations_aggregation_container).register(z.globalRegistry, { + description: 'Sub-aggregations for the geotile_grid.\n\nIt supports the following aggregation types:\n\n- `avg`\n- `boxplot`\n- `cardinality`\n- `extended stats`\n- `max`\n- `median absolute deviation`\n- `min`\n- `percentile`\n- `percentile-rank`\n- `stats`\n- `sum`\n- `value count`\n\nThe aggregation names can\'t start with `_mvt_`. The `_mvt_` prefix is reserved for internal aggregations.' + })), + buffer: z.optional(z.number().register(z.globalRegistry, { + description: 'The size, in pixels, of a clipping buffer outside the tile. This allows renderers\nto avoid outline artifacts from geometries that extend past the extent of the tile.' + })), + exact_bounds: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the meta layer\'s feature is the bounding box of the tile.\nIf `true`, the meta layer\'s feature is a bounding box resulting from a\n`geo_bounds` aggregation. The aggregation runs on values that intersect\nthe `//` tile with `wrap_longitude` set to `false`. The resulting\nbounding box may be larger than the vector tile.' + })), + extent: z.optional(z.number().register(z.globalRegistry, { + description: 'The size, in pixels, of a side of the tile. Vector tiles are square with equal sides.' + })), + fields: z.optional(types_fields), + grid_agg: z.optional(global_search_mvt_types_grid_aggregation_type), + grid_precision: z.optional(z.number().register(z.globalRegistry, { + description: 'Additional zoom levels available through the aggs layer. For example, if `` is `7`\nand `grid_precision` is `8`, you can zoom in up to level 15. Accepts 0-8. If 0, results\ndon\'t include the aggs layer.' + })), + grid_type: z.optional(global_search_mvt_types_grid_type), + query: z.optional(types_query_dsl_query_container), + runtime_mappings: z.optional(types_mapping_runtime_fields), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of features to return in the hits layer. Accepts 0-10000.\nIf 0, results don\'t include the hits layer.' + })), + sort: z.optional(types_sort), + track_total_hits: z.optional(global_search_types_track_hits), + with_labels: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the hits and aggs layers will contain additional point features representing\nsuggested label positions for the original features.\n\n* `Point` and `MultiPoint` features will have one of the points selected.\n* `Polygon` and `MultiPolygon` features will have a single point generated, either the centroid, if it is within the polygon, or another point within the polygon selected from the sorted triangle-tree.\n* `LineString` features will likewise provide a roughly central point selected from the triangle-tree.\n* The aggregation results will provide one central point for each aggregation bucket.\n\nAll attributes from the original features will also be copied to the new label features.\nIn addition, the new features will be distinguishable using the tag `_mvt_label_position`.' + })) }); export const search_template = z.object({ - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, returns detailed information about score calculation as part of each hit.\nIf you specify both this and the `explain` query parameter, the API uses only the query parameter.', - }) - ), - id: z.optional(types_id), - params: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'Key-value pairs used to replace Mustache variables in the template.\nThe key is the variable name.\nThe value is the variable value.', - }) - ), - profile: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the query execution is profiled.', - }) - ), - source: z.optional(types_script_source), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns detailed information about score calculation as part of each hit.\nIf you specify both this and the `explain` query parameter, the API uses only the query parameter.' + })), + id: z.optional(types_id), + params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Key-value pairs used to replace Mustache variables in the template.\nThe key is the variable name.\nThe value is the variable value.' + })), + profile: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the query execution is profiled.' + })), + source: z.optional(types_script_source) }); export const security_create_api_key = z.object({ - expiration: z.optional(types_duration), - name: z.optional(types_name), - role_descriptors: z.optional( - z.record(z.string(), security_types_role_descriptor).register(z.globalRegistry, { - description: - "An array of role descriptors for this API key.\nWhen it is not specified or it is an empty array, the API key will have a point in time snapshot of permissions of the authenticated user.\nIf you supply role descriptors, the resultant permissions are an intersection of API keys permissions and the authenticated user's permissions thereby limiting the access scope for API keys.\nThe structure of role descriptor is the same as the request for the create role API.\nFor more details, refer to the create or update roles API.\n\nNOTE: Due to the way in which this permission intersection is calculated, it is not possible to create an API key that is a child of another API key, unless the derived key is created without any privileges.\nIn this case, you must explicitly specify a role descriptor with no privileges.\nThe derived API key can be used for authentication; it will not have authority to call Elasticsearch APIs.", - }) - ), - metadata: z.optional(types_metadata), + expiration: z.optional(types_duration), + name: z.optional(types_name), + role_descriptors: z.optional(z.record(z.string(), security_types_role_descriptor).register(z.globalRegistry, { + description: 'An array of role descriptors for this API key.\nWhen it is not specified or it is an empty array, the API key will have a point in time snapshot of permissions of the authenticated user.\nIf you supply role descriptors, the resultant permissions are an intersection of API keys permissions and the authenticated user\'s permissions thereby limiting the access scope for API keys.\nThe structure of role descriptor is the same as the request for the create role API.\nFor more details, refer to the create or update roles API.\n\nNOTE: Due to the way in which this permission intersection is calculated, it is not possible to create an API key that is a child of another API key, unless the derived key is created without any privileges.\nIn this case, you must explicitly specify a role descriptor with no privileges.\nThe derived API key can be used for authentication; it will not have authority to call Elasticsearch APIs.' + })), + metadata: z.optional(types_metadata) }); export const security_put_role = z.object({ - applications: z.optional( - z.array(security_types_application_privileges).register(z.globalRegistry, { - description: 'A list of application privilege entries.', - }) - ), - cluster: z.optional( - z.array(security_types_cluster_privilege).register(z.globalRegistry, { - description: - 'A list of cluster privileges. These privileges define the cluster-level actions for users with this role.', - }) - ), - global: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'An object defining global privileges. A global privilege is a form of cluster privilege that is request-aware. Support for global privileges is currently limited to the management of application privileges.', - }) - ), - indices: z.optional( - z.array(security_types_indices_privileges).register(z.globalRegistry, { - description: 'A list of indices permissions entries.', - }) - ), - remote_indices: z.optional( - z.array(security_types_remote_indices_privileges).register(z.globalRegistry, { - description: - 'A list of remote indices permissions entries.\n\nNOTE: Remote indices are effective for remote clusters configured with the API key based model.\nThey have no effect for remote clusters configured with the certificate based model.', - }) - ), - remote_cluster: z.optional( - z.array(security_types_remote_cluster_privileges).register(z.globalRegistry, { - description: 'A list of remote cluster permissions entries.', - }) - ), - metadata: z.optional(types_metadata), - run_as: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'A list of users that the owners of this role can impersonate. *Note*: in Serverless, the run-as feature is disabled. For API compatibility, you can still specify an empty `run_as` field, but a non-empty list will be rejected.', - }) - ), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'Optional description of the role descriptor', - }) - ), - transient_metadata: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'Indicates roles that might be incompatible with the current cluster license, specifically roles with document and field level security. When the cluster license doesn’t allow certain features for a given role, this parameter is updated dynamically to list the incompatible features. If `enabled` is `false`, the role is ignored, but is still listed in the response from the authenticate API.', - }) - ), + applications: z.optional(z.array(security_types_application_privileges).register(z.globalRegistry, { + description: 'A list of application privilege entries.' + })), + cluster: z.optional(z.array(security_types_cluster_privilege).register(z.globalRegistry, { + description: 'A list of cluster privileges. These privileges define the cluster-level actions for users with this role.' + })), + global: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'An object defining global privileges. A global privilege is a form of cluster privilege that is request-aware. Support for global privileges is currently limited to the management of application privileges.' + })), + indices: z.optional(z.array(security_types_indices_privileges).register(z.globalRegistry, { + description: 'A list of indices permissions entries.' + })), + remote_indices: z.optional(z.array(security_types_remote_indices_privileges).register(z.globalRegistry, { + description: 'A list of remote indices permissions entries.\n\nNOTE: Remote indices are effective for remote clusters configured with the API key based model.\nThey have no effect for remote clusters configured with the certificate based model.' + })), + remote_cluster: z.optional(z.array(security_types_remote_cluster_privileges).register(z.globalRegistry, { + description: 'A list of remote cluster permissions entries.' + })), + metadata: z.optional(types_metadata), + run_as: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A list of users that the owners of this role can impersonate. *Note*: in Serverless, the run-as feature is disabled. For API compatibility, you can still specify an empty `run_as` field, but a non-empty list will be rejected.' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Optional description of the role descriptor' + })), + transient_metadata: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Indicates roles that might be incompatible with the current cluster license, specifically roles with document and field level security. When the cluster license doesn’t allow certain features for a given role, this parameter is updated dynamically to list the incompatible features. If `enabled` is `false`, the role is ignored, but is still listed in the response from the authenticate API.' + })) }); export const security_put_role_mapping = z.object({ - enabled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Mappings that have `enabled` set to `false` are ignored when role mapping is performed.', - }) - ), - metadata: z.optional(types_metadata), - roles: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'A list of role names that are granted to the users that match the role mapping rules.\nExactly one of `roles` or `role_templates` must be specified.', - }) - ), - role_templates: z.optional( - z.array(security_types_role_template).register(z.globalRegistry, { - description: - 'A list of Mustache templates that will be evaluated to determine the roles names that should granted to the users that match the role mapping rules.\nExactly one of `roles` or `role_templates` must be specified.', - }) - ), - rules: z.optional(security_types_role_mapping_rule), - run_as: z.optional(z.array(z.string())), + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Mappings that have `enabled` set to `false` are ignored when role mapping is performed.' + })), + metadata: z.optional(types_metadata), + roles: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A list of role names that are granted to the users that match the role mapping rules.\nExactly one of `roles` or `role_templates` must be specified.' + })), + role_templates: z.optional(z.array(security_types_role_template).register(z.globalRegistry, { + description: 'A list of Mustache templates that will be evaluated to determine the roles names that should granted to the users that match the role mapping rules.\nExactly one of `roles` or `role_templates` must be specified.' + })), + rules: z.optional(security_types_role_mapping_rule), + run_as: z.optional(z.array(z.string())) }); export const security_query_api_keys = z.object({ - aggregations: z.optional( - z - .record(z.string(), security_query_api_keys_api_key_aggregation_container) - .register(z.globalRegistry, { - description: - 'Any aggregations to run over the corpus of returned API keys.\nAggregations and queries work together. Aggregations are computed only on the API keys that match the query.\nThis supports only a subset of aggregation types, namely: `terms`, `range`, `date_range`, `missing`,\n`cardinality`, `value_count`, `composite`, `filter`, and `filters`.\nAdditionally, aggregations only run over the same subset of fields that query works with.', - }) - ), - query: z.optional(security_query_api_keys_api_key_query_container), - from: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The starting document offset.\nIt must not be negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', - }) - ), - sort: z.optional(types_sort), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of hits to return.\nIt must not be negative.\nThe `size` parameter can be set to `0`, in which case no API key matches are returned, only the aggregation results.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', - }) - ), - search_after: z.optional(types_sort_results), + aggregations: z.optional(z.record(z.string(), security_query_api_keys_api_key_aggregation_container).register(z.globalRegistry, { + description: 'Any aggregations to run over the corpus of returned API keys.\nAggregations and queries work together. Aggregations are computed only on the API keys that match the query.\nThis supports only a subset of aggregation types, namely: `terms`, `range`, `date_range`, `missing`,\n`cardinality`, `value_count`, `composite`, `filter`, and `filters`.\nAdditionally, aggregations only run over the same subset of fields that query works with.' + })), + query: z.optional(security_query_api_keys_api_key_query_container), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'The starting document offset.\nIt must not be negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' + })), + sort: z.optional(types_sort), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of hits to return.\nIt must not be negative.\nThe `size` parameter can be set to `0`, in which case no API key matches are returned, only the aggregation results.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' + })), + search_after: z.optional(types_sort_results) }); export const security_query_role = z.object({ - query: z.optional(security_query_role_role_query_container), - from: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The starting document offset.\nIt must not be negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', - }) - ), - sort: z.optional(types_sort), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of hits to return.\nIt must not be negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', - }) - ), - search_after: z.optional(types_sort_results), + query: z.optional(security_query_role_role_query_container), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'The starting document offset.\nIt must not be negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' + })), + sort: z.optional(types_sort), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of hits to return.\nIt must not be negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' + })), + search_after: z.optional(types_sort_results) }); export const security_query_user = z.object({ - query: z.optional(security_query_user_user_query_container), - from: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The starting document offset.\nIt must not be negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', - }) - ), - sort: z.optional(types_sort), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of hits to return.\nIt must not be negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', - }) - ), - search_after: z.optional(types_sort_results), + query: z.optional(security_query_user_user_query_container), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'The starting document offset.\nIt must not be negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' + })), + sort: z.optional(types_sort), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of hits to return.\nIt must not be negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' + })), + search_after: z.optional(types_sort_results) }); export const simulate_ingest = z.object({ - docs: z.array(ingest_types_document).register(z.globalRegistry, { - description: 'Sample documents to test in the pipeline.', - }), - component_template_substitutions: z.optional( - z.record(z.string(), cluster_types_component_template_node).register(z.globalRegistry, { - description: - 'A map of component template names to substitute component template definition objects.', - }) - ), - index_template_substitutions: z.optional( - z.record(z.string(), indices_types_index_template).register(z.globalRegistry, { - description: 'A map of index template names to substitute index template definition objects.', - }) - ), - mapping_addition: z.optional(types_mapping_type_mapping), - pipeline_substitutions: z.optional( - z.record(z.string(), ingest_types_pipeline).register(z.globalRegistry, { - description: - 'Pipelines to test.\nIf you don’t specify the `pipeline` request path parameter, this parameter is required.\nIf you specify both this and the request path parameter, the API only uses the request path parameter.', - }) - ), + docs: z.array(ingest_types_document).register(z.globalRegistry, { + description: 'Sample documents to test in the pipeline.' + }), + component_template_substitutions: z.optional(z.record(z.string(), cluster_types_component_template_node).register(z.globalRegistry, { + description: 'A map of component template names to substitute component template definition objects.' + })), + index_template_substitutions: z.optional(z.record(z.string(), indices_types_index_template).register(z.globalRegistry, { + description: 'A map of index template names to substitute index template definition objects.' + })), + mapping_addition: z.optional(types_mapping_type_mapping), + pipeline_substitutions: z.optional(z.record(z.string(), ingest_types_pipeline).register(z.globalRegistry, { + description: 'Pipelines to test.\nIf you don’t specify the `pipeline` request path parameter, this parameter is required.\nIf you specify both this and the request path parameter, the API only uses the request path parameter.' + })) }); export const sql_query = z.object({ - allow_partial_search_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response has partial results when there are shard request timeouts or shard failures.\nIf `false`, the API returns an error with no partial results.', - }) - ), - catalog: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The default catalog (cluster) for queries.\nIf unspecified, the queries execute on the data in the local cluster only.', - }) - ), - columnar: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the results are in a columnar fashion: one row represents all the values of a certain column from the current page of results.\nThe API supports this parameter only for CBOR, JSON, SMILE, and YAML responses.', - }) - ), - cursor: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The cursor used to retrieve a set of paginated results.\nIf you specify a cursor, the API only uses the `columnar` and `time_zone` request body parameters.\nIt ignores other request body parameters.', - }) - ), - fetch_size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of rows (or entries) to return in one response.', - }) - ), - field_multi_value_leniency: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the API returns an exception when encountering multiple values for a field.\nIf `true`, the API is lenient and returns the first value from the array with no guarantee of consistent results.', - }) - ), - filter: z.optional(types_query_dsl_query_container), - index_using_frozen: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the search can run on frozen indices.', - }) - ), - keep_alive: z.optional(types_duration), - keep_on_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `true`, Elasticsearch stores synchronous searches if you also specify the `wait_for_completion_timeout` parameter.\nIf `false`, Elasticsearch only stores async searches that don't finish before the `wait_for_completion_timeout`.", - }) - ), - page_timeout: z.optional(types_duration), - params: z.optional( - z.array(z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'The values for parameters in the query.', - }) - ), - query: z.optional( - z.string().register(z.globalRegistry, { - description: 'The SQL query to run.', - }) - ), - request_timeout: z.optional(types_duration), - runtime_mappings: z.optional(types_mapping_runtime_fields), - time_zone: z.optional(types_time_zone), - wait_for_completion_timeout: z.optional(types_duration), + allow_partial_search_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response has partial results when there are shard request timeouts or shard failures.\nIf `false`, the API returns an error with no partial results.' + })), + catalog: z.optional(z.string().register(z.globalRegistry, { + description: 'The default catalog (cluster) for queries.\nIf unspecified, the queries execute on the data in the local cluster only.' + })), + columnar: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the results are in a columnar fashion: one row represents all the values of a certain column from the current page of results.\nThe API supports this parameter only for CBOR, JSON, SMILE, and YAML responses.' + })), + cursor: z.optional(z.string().register(z.globalRegistry, { + description: 'The cursor used to retrieve a set of paginated results.\nIf you specify a cursor, the API only uses the `columnar` and `time_zone` request body parameters.\nIt ignores other request body parameters.' + })), + fetch_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of rows (or entries) to return in one response.' + })), + field_multi_value_leniency: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the API returns an exception when encountering multiple values for a field.\nIf `true`, the API is lenient and returns the first value from the array with no guarantee of consistent results.' + })), + filter: z.optional(types_query_dsl_query_container), + index_using_frozen: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the search can run on frozen indices.' + })), + keep_alive: z.optional(types_duration), + keep_on_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, Elasticsearch stores synchronous searches if you also specify the `wait_for_completion_timeout` parameter.\nIf `false`, Elasticsearch only stores async searches that don\'t finish before the `wait_for_completion_timeout`.' + })), + page_timeout: z.optional(types_duration), + params: z.optional(z.array(z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'The values for parameters in the query.' + })), + query: z.optional(z.string().register(z.globalRegistry, { + description: 'The SQL query to run.' + })), + request_timeout: z.optional(types_duration), + runtime_mappings: z.optional(types_mapping_runtime_fields), + time_zone: z.optional(types_time_zone), + wait_for_completion_timeout: z.optional(types_duration) }); export const sql_translate = z.object({ - fetch_size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of rows (or entries) to return in one response.', - }) - ), - filter: z.optional(types_query_dsl_query_container), - query: z.string().register(z.globalRegistry, { - description: 'The SQL query to run.', - }), - time_zone: z.optional(types_time_zone), + fetch_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of rows (or entries) to return in one response.' + })), + filter: z.optional(types_query_dsl_query_container), + query: z.string().register(z.globalRegistry, { + description: 'The SQL query to run.' + }), + time_zone: z.optional(types_time_zone) }); export const terms_enum = z.object({ - field: types_field, - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of matching terms to return.', - }) - ), - timeout: z.optional(types_duration), - case_insensitive: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When `true`, the provided search string is matched against index terms without case sensitivity.', - }) - ), - index_filter: z.optional(types_query_dsl_query_container), - string: z.optional( - z.string().register(z.globalRegistry, { - description: - "The string to match at the start of indexed terms.\nIf it is not provided, all terms in the field are considered.\n\n> info\n> The prefix string cannot be larger than the largest possible keyword value, which is Lucene's term byte-length limit of 32766.", - }) - ), - search_after: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The string after which terms in the index should be returned.\nIt allows for a form of pagination if the last result from one request is passed as the `search_after` parameter for a subsequent request.', - }) - ), + field: types_field, + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of matching terms to return.' + })), + timeout: z.optional(types_duration), + case_insensitive: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When `true`, the provided search string is matched against index terms without case sensitivity.' + })), + index_filter: z.optional(types_query_dsl_query_container), + string: z.optional(z.string().register(z.globalRegistry, { + description: 'The string to match at the start of indexed terms.\nIf it is not provided, all terms in the field are considered.\n\n> info\n> The prefix string cannot be larger than the largest possible keyword value, which is Lucene\'s term byte-length limit of 32766.' + })), + search_after: z.optional(z.string().register(z.globalRegistry, { + description: 'The string after which terms in the index should be returned.\nIt allows for a form of pagination if the last result from one request is passed as the `search_after` parameter for a subsequent request.' + })) }); export const transform_preview_transform = z.object({ - dest: z.optional(transform_types_destination), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'Free text description of the transform.', - }) - ), - frequency: z.optional(types_duration), - pivot: z.optional(transform_types_pivot), - source: z.optional(transform_types_source), - settings: z.optional(transform_types_settings), - sync: z.optional(transform_types_sync_container), - retention_policy: z.optional(transform_types_retention_policy_container), - latest: z.optional(transform_types_latest), + dest: z.optional(transform_types_destination), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Free text description of the transform.' + })), + frequency: z.optional(types_duration), + pivot: z.optional(transform_types_pivot), + source: z.optional(transform_types_source), + settings: z.optional(transform_types_settings), + sync: z.optional(transform_types_sync_container), + retention_policy: z.optional(transform_types_retention_policy_container), + latest: z.optional(transform_types_latest) }); export const watcher_execute_watch = z.object({ - action_modes: z.optional( - z.record(z.string(), watcher_types_action_execution_mode).register(z.globalRegistry, { - description: 'Determines how to handle the watch actions as part of the watch execution.', - }) - ), - alternative_input: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'When present, the watch uses this object as a payload instead of executing its own input.', - }) - ), - ignore_condition: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When set to `true`, the watch execution uses the always condition. This can also be specified as an HTTP parameter.', - }) - ), - record_execution: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When set to `true`, the watch record representing the watch execution result is persisted to the `.watcher-history` index for the current time.\nIn addition, the status of the watch is updated, possibly throttling subsequent runs.\nThis can also be specified as an HTTP parameter.', - }) - ), - simulated_actions: z.optional(watcher_types_simulated_actions), - trigger_data: z.optional(watcher_types_schedule_trigger_event), - watch: z.optional(watcher_types_watch), + action_modes: z.optional(z.record(z.string(), watcher_types_action_execution_mode).register(z.globalRegistry, { + description: 'Determines how to handle the watch actions as part of the watch execution.' + })), + alternative_input: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'When present, the watch uses this object as a payload instead of executing its own input.' + })), + ignore_condition: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When set to `true`, the watch execution uses the always condition. This can also be specified as an HTTP parameter.' + })), + record_execution: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When set to `true`, the watch record representing the watch execution result is persisted to the `.watcher-history` index for the current time.\nIn addition, the status of the watch is updated, possibly throttling subsequent runs.\nThis can also be specified as an HTTP parameter.' + })), + simulated_actions: z.optional(watcher_types_simulated_actions), + trigger_data: z.optional(watcher_types_schedule_trigger_event), + watch: z.optional(watcher_types_watch) }); export const watcher_put_watch = z.object({ - actions: z.optional( - z.record(z.string(), watcher_types_action).register(z.globalRegistry, { - description: 'The list of actions that will be run if the condition matches.', - }) - ), - condition: z.optional(watcher_types_condition_container), - input: z.optional(watcher_types_input_container), - metadata: z.optional(types_metadata), - throttle_period: z.optional(types_duration), - throttle_period_in_millis: z.optional(types_duration_value_unit_millis), - transform: z.optional(types_transform_container), - trigger: z.optional(watcher_types_trigger_container), + actions: z.optional(z.record(z.string(), watcher_types_action).register(z.globalRegistry, { + description: 'The list of actions that will be run if the condition matches.' + })), + condition: z.optional(watcher_types_condition_container), + input: z.optional(watcher_types_input_container), + metadata: z.optional(types_metadata), + throttle_period: z.optional(types_duration), + throttle_period_in_millis: z.optional(types_duration_value_unit_millis), + transform: z.optional(types_transform_container), + trigger: z.optional(watcher_types_trigger_container) }); export const watcher_query_watches = z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'The offset from the first result to fetch.\nIt must be non-negative.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of hits to return.\nIt must be non-negative.', - }) - ), - query: z.optional(types_query_dsl_query_container), - sort: z.optional(types_sort), - search_after: z.optional(types_sort_results), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'The offset from the first result to fetch.\nIt must be non-negative.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of hits to return.\nIt must be non-negative.' + })), + query: z.optional(types_query_dsl_query_container), + sort: z.optional(types_sort), + search_after: z.optional(types_sort_results) }); export const async_search_delete_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const async_search_delete_response = types_acknowledged_response_base; export const async_search_status_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - keep_alive: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + keep_alive: z.optional(types_duration) + })) }); export const async_search_status_response = async_search_status_status_response_base; export const cat_aliases_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_aliases_columns), - s: z.optional(types_names), - expand_wildcards: z.optional(types_expand_wildcards), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_aliases_columns), + s: z.optional(types_names), + expand_wildcards: z.optional(types_expand_wildcards), + master_timeout: z.optional(types_duration) + })) }); export const cat_aliases_response = z.array(cat_aliases_aliases_record); export const cat_aliases1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_names, - }), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_aliases_columns), - s: z.optional(types_names), - expand_wildcards: z.optional(types_expand_wildcards), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_names + }), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_aliases_columns), + s: z.optional(types_names), + expand_wildcards: z.optional(types_expand_wildcards), + master_timeout: z.optional(types_duration) + })) }); export const cat_aliases1_response = z.array(cat_aliases_aliases_record); export const cat_allocation_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_allocation_columns), - s: z.optional(types_names), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_allocation_columns), + s: z.optional(types_names), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cat_allocation_response = z.array(cat_allocation_allocation_record); export const cat_allocation1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - node_id: types_node_ids, - }), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_allocation_columns), - s: z.optional(types_names), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + node_id: types_node_ids + }), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_allocation_columns), + s: z.optional(types_names), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cat_allocation1_response = z.array(cat_allocation_allocation_record); export const cat_circuit_breaker_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_circuit_breaker_columns), - s: z.optional(types_names), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_circuit_breaker_columns), + s: z.optional(types_names), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cat_circuit_breaker_response = z.array(cat_circuit_breaker_circuit_breaker_record); export const cat_circuit_breaker1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - circuit_breaker_patterns: z.union([z.string(), z.array(z.string())]), - }), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_circuit_breaker_columns), - s: z.optional(types_names), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + circuit_breaker_patterns: z.union([ + z.string(), + z.array(z.string()) + ]) + }), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_circuit_breaker_columns), + s: z.optional(types_names), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cat_circuit_breaker1_response = z.array(cat_circuit_breaker_circuit_breaker_record); export const cat_component_templates_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_component_columns), - s: z.optional(types_names), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_component_columns), + s: z.optional(types_names), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cat_component_templates_response = z.array(cat_component_templates_component_template); export const cat_component_templates1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: z.string().register(z.globalRegistry, { - description: - 'The name of the component template.\nIt accepts wildcard expressions.\nIf it is omitted, all component templates are returned.', - }), - }), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_component_columns), - s: z.optional(types_names), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', + body: z.optional(z.never()), + path: z.object({ + name: z.string().register(z.globalRegistry, { + description: 'The name of the component template.\nIt accepts wildcard expressions.\nIf it is omitted, all component templates are returned.' }) - ), - master_timeout: z.optional(types_duration), - }) - ), + }), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_component_columns), + s: z.optional(types_names), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' + })), + master_timeout: z.optional(types_duration) + })) }); -export const cat_component_templates1_response = z.array( - cat_component_templates_component_template -); +export const cat_component_templates1_response = z.array(cat_component_templates_component_template); export const cat_count_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_count_columns), - s: z.optional(types_names), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_count_columns), + s: z.optional(types_names) + })) }); export const cat_count_response = z.array(cat_count_count_record); export const cat_count1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_count_columns), - s: z.optional(types_names), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_count_columns), + s: z.optional(types_names) + })) }); export const cat_count1_response = z.array(cat_count_count_record); export const cat_fielddata_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - fields: z.optional(types_fields), - h: z.optional(cat_types_cat_field_data_columns), - s: z.optional(types_names), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + fields: z.optional(types_fields), + h: z.optional(cat_types_cat_field_data_columns), + s: z.optional(types_names) + })) }); export const cat_fielddata_response = z.array(cat_fielddata_fielddata_record); export const cat_fielddata1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - fields: types_fields, - }), - query: z.optional( - z.object({ - fields: z.optional(types_fields), - h: z.optional(cat_types_cat_field_data_columns), - s: z.optional(types_names), - }) - ), + body: z.optional(z.never()), + path: z.object({ + fields: types_fields + }), + query: z.optional(z.object({ + fields: z.optional(types_fields), + h: z.optional(cat_types_cat_field_data_columns), + s: z.optional(types_names) + })) }); export const cat_fielddata1_response = z.array(cat_fielddata_fielddata_record); export const cat_health_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - ts: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, returns `HH:MM:SS` and Unix epoch timestamps.', - }) - ), - h: z.optional(cat_types_cat_health_columns), - s: z.optional(types_names), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + ts: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns `HH:MM:SS` and Unix epoch timestamps.' + })), + h: z.optional(cat_types_cat_health_columns), + s: z.optional(types_names) + })) }); export const cat_health_response = z.array(cat_health_health_record); export const cat_help_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const cat_help_response = z.record(z.string(), z.unknown()); export const cat_indices_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - health: z.optional(types_health_status), - include_unloaded_segments: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the response includes information from segments that are not loaded into memory.', - }) - ), - pri: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the response only includes information from primary shards.', - }) - ), - master_timeout: z.optional(types_duration), - h: z.optional(cat_types_cat_indices_columns), - s: z.optional(types_names), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + expand_wildcards: z.optional(types_expand_wildcards), + health: z.optional(types_health_status), + include_unloaded_segments: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the response includes information from segments that are not loaded into memory.' + })), + pri: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the response only includes information from primary shards.' + })), + master_timeout: z.optional(types_duration), + h: z.optional(cat_types_cat_indices_columns), + s: z.optional(types_names) + })) }); export const cat_indices_response = z.array(cat_indices_indices_record); export const cat_indices1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - health: z.optional(types_health_status), - include_unloaded_segments: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the response includes information from segments that are not loaded into memory.', - }) - ), - pri: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the response only includes information from primary shards.', - }) - ), - master_timeout: z.optional(types_duration), - h: z.optional(cat_types_cat_indices_columns), - s: z.optional(types_names), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + expand_wildcards: z.optional(types_expand_wildcards), + health: z.optional(types_health_status), + include_unloaded_segments: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the response includes information from segments that are not loaded into memory.' + })), + pri: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the response only includes information from primary shards.' + })), + master_timeout: z.optional(types_duration), + h: z.optional(cat_types_cat_indices_columns), + s: z.optional(types_names) + })) }); export const cat_indices1_response = z.array(cat_indices_indices_record); export const cat_master_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_master_columns), - s: z.optional(types_names), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_master_columns), + s: z.optional(types_names), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cat_master_response = z.array(cat_master_master_record); export const cat_ml_data_frame_analytics_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard expression matches no configs.\n(This includes `_all` string or when no configs have been specified.)', - }) - ), - h: z.optional(cat_types_cat_dfa_columns), - s: z.optional(cat_types_cat_dfa_columns), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore if a wildcard expression matches no configs.\n(This includes `_all` string or when no configs have been specified.)' + })), + h: z.optional(cat_types_cat_dfa_columns), + s: z.optional(cat_types_cat_dfa_columns) + })) }); -export const cat_ml_data_frame_analytics_response = z.array( - cat_ml_data_frame_analytics_data_frame_analytics_record -); +export const cat_ml_data_frame_analytics_response = z.array(cat_ml_data_frame_analytics_data_frame_analytics_record); export const cat_ml_data_frame_analytics1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard expression matches no configs.\n(This includes `_all` string or when no configs have been specified.)', - }) - ), - h: z.optional(cat_types_cat_dfa_columns), - s: z.optional(cat_types_cat_dfa_columns), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore if a wildcard expression matches no configs.\n(This includes `_all` string or when no configs have been specified.)' + })), + h: z.optional(cat_types_cat_dfa_columns), + s: z.optional(cat_types_cat_dfa_columns) + })) }); -export const cat_ml_data_frame_analytics1_response = z.array( - cat_ml_data_frame_analytics_data_frame_analytics_record -); +export const cat_ml_data_frame_analytics1_response = z.array(cat_ml_data_frame_analytics_data_frame_analytics_record); export const cat_ml_datafeeds_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n* Contains wildcard expressions and there are no datafeeds that match.\n* Contains the `_all` string or no identifiers and there are no matches.\n* Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty datafeeds array when there are no matches and the subset of results when\nthere are partial matches. If `false`, the API returns a 404 status code when there are no matches or only\npartial matches.', - }) - ), - h: z.optional(cat_types_cat_datafeed_columns), - s: z.optional(cat_types_cat_datafeed_columns), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n* Contains wildcard expressions and there are no datafeeds that match.\n* Contains the `_all` string or no identifiers and there are no matches.\n* Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty datafeeds array when there are no matches and the subset of results when\nthere are partial matches. If `false`, the API returns a 404 status code when there are no matches or only\npartial matches.' + })), + h: z.optional(cat_types_cat_datafeed_columns), + s: z.optional(cat_types_cat_datafeed_columns) + })) }); export const cat_ml_datafeeds_response = z.array(cat_ml_datafeeds_datafeeds_record); export const cat_ml_datafeeds1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - datafeed_id: types_id, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n* Contains wildcard expressions and there are no datafeeds that match.\n* Contains the `_all` string or no identifiers and there are no matches.\n* Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty datafeeds array when there are no matches and the subset of results when\nthere are partial matches. If `false`, the API returns a 404 status code when there are no matches or only\npartial matches.', - }) - ), - h: z.optional(cat_types_cat_datafeed_columns), - s: z.optional(cat_types_cat_datafeed_columns), - }) - ), + body: z.optional(z.never()), + path: z.object({ + datafeed_id: types_id + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n* Contains wildcard expressions and there are no datafeeds that match.\n* Contains the `_all` string or no identifiers and there are no matches.\n* Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty datafeeds array when there are no matches and the subset of results when\nthere are partial matches. If `false`, the API returns a 404 status code when there are no matches or only\npartial matches.' + })), + h: z.optional(cat_types_cat_datafeed_columns), + s: z.optional(cat_types_cat_datafeed_columns) + })) }); export const cat_ml_datafeeds1_response = z.array(cat_ml_datafeeds_datafeeds_record); export const cat_ml_jobs_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n* Contains wildcard expressions and there are no jobs that match.\n* Contains the `_all` string or no identifiers and there are no matches.\n* Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty jobs array when there are no matches and the subset of results when there\nare partial matches. If `false`, the API returns a 404 status code when there are no matches or only partial\nmatches.', - }) - ), - h: z.optional(cat_types_cat_anomaly_detector_columns), - s: z.optional(cat_types_cat_anomaly_detector_columns), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n* Contains wildcard expressions and there are no jobs that match.\n* Contains the `_all` string or no identifiers and there are no matches.\n* Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty jobs array when there are no matches and the subset of results when there\nare partial matches. If `false`, the API returns a 404 status code when there are no matches or only partial\nmatches.' + })), + h: z.optional(cat_types_cat_anomaly_detector_columns), + s: z.optional(cat_types_cat_anomaly_detector_columns) + })) }); export const cat_ml_jobs_response = z.array(cat_ml_jobs_jobs_record); export const cat_ml_jobs1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n* Contains wildcard expressions and there are no jobs that match.\n* Contains the `_all` string or no identifiers and there are no matches.\n* Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty jobs array when there are no matches and the subset of results when there\nare partial matches. If `false`, the API returns a 404 status code when there are no matches or only partial\nmatches.', - }) - ), - h: z.optional(cat_types_cat_anomaly_detector_columns), - s: z.optional(cat_types_cat_anomaly_detector_columns), - }) - ), + body: z.optional(z.never()), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n* Contains wildcard expressions and there are no jobs that match.\n* Contains the `_all` string or no identifiers and there are no matches.\n* Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty jobs array when there are no matches and the subset of results when there\nare partial matches. If `false`, the API returns a 404 status code when there are no matches or only partial\nmatches.' + })), + h: z.optional(cat_types_cat_anomaly_detector_columns), + s: z.optional(cat_types_cat_anomaly_detector_columns) + })) }); export const cat_ml_jobs1_response = z.array(cat_ml_jobs_jobs_record); export const cat_ml_trained_models_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request: contains wildcard expressions and there are no models that match; contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches.\nIf `true`, the API returns an empty array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the API returns a 404 status code when there are no matches or only partial matches.', - }) - ), - h: z.optional(cat_types_cat_trained_models_columns), - s: z.optional(cat_types_cat_trained_models_columns), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of transforms.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of transforms to display.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request: contains wildcard expressions and there are no models that match; contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches.\nIf `true`, the API returns an empty array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the API returns a 404 status code when there are no matches or only partial matches.' + })), + h: z.optional(cat_types_cat_trained_models_columns), + s: z.optional(cat_types_cat_trained_models_columns), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of transforms.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of transforms to display.' + })) + })) }); export const cat_ml_trained_models_response = z.array(cat_ml_trained_models_trained_models_record); export const cat_ml_trained_models1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - model_id: types_id, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request: contains wildcard expressions and there are no models that match; contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches.\nIf `true`, the API returns an empty array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the API returns a 404 status code when there are no matches or only partial matches.', - }) - ), - h: z.optional(cat_types_cat_trained_models_columns), - s: z.optional(cat_types_cat_trained_models_columns), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of transforms.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of transforms to display.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + model_id: types_id + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request: contains wildcard expressions and there are no models that match; contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches.\nIf `true`, the API returns an empty array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the API returns a 404 status code when there are no matches or only partial matches.' + })), + h: z.optional(cat_types_cat_trained_models_columns), + s: z.optional(cat_types_cat_trained_models_columns), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of transforms.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of transforms to display.' + })) + })) }); export const cat_ml_trained_models1_response = z.array(cat_ml_trained_models_trained_models_record); export const cat_nodeattrs_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_nodeattrs_columns), - s: z.optional(types_names), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_nodeattrs_columns), + s: z.optional(types_names), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cat_nodeattrs_response = z.array(cat_nodeattrs_node_attributes_record); export const cat_nodes_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - full_id: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, return the full node ID. If `false`, return the shortened node ID.', - }) - ), - include_unloaded_segments: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the response includes information from segments that are not loaded into memory.', - }) - ), - h: z.optional(cat_types_cat_node_columns), - s: z.optional(types_names), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + full_id: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, return the full node ID. If `false`, return the shortened node ID.' + })), + include_unloaded_segments: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the response includes information from segments that are not loaded into memory.' + })), + h: z.optional(cat_types_cat_node_columns), + s: z.optional(types_names), + master_timeout: z.optional(types_duration) + })) }); export const cat_nodes_response = z.array(cat_nodes_nodes_record); export const cat_pending_tasks_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_pending_tasks_columns), - s: z.optional(types_names), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_pending_tasks_columns), + s: z.optional(types_names), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cat_pending_tasks_response = z.array(cat_pending_tasks_pending_tasks_record); export const cat_plugins_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_plugins_columns), - s: z.optional(types_names), - include_bootstrap: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Include bootstrap plugins in the response', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_plugins_columns), + s: z.optional(types_names), + include_bootstrap: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Include bootstrap plugins in the response' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cat_plugins_response = z.array(cat_plugins_plugins_record); export const cat_recovery_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - active_only: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response only includes ongoing shard recoveries.', - }) - ), - detailed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes detailed information about shard recoveries.', - }) - ), - index: z.optional(types_indices), - h: z.optional(cat_types_cat_recovery_columns), - s: z.optional(types_names), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + active_only: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response only includes ongoing shard recoveries.' + })), + detailed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes detailed information about shard recoveries.' + })), + index: z.optional(types_indices), + h: z.optional(cat_types_cat_recovery_columns), + s: z.optional(types_names) + })) }); export const cat_recovery_response = z.array(cat_recovery_recovery_record); export const cat_recovery1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - active_only: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response only includes ongoing shard recoveries.', - }) - ), - detailed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes detailed information about shard recoveries.', - }) - ), - index: z.optional(types_indices), - h: z.optional(cat_types_cat_recovery_columns), - s: z.optional(types_names), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + active_only: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response only includes ongoing shard recoveries.' + })), + detailed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes detailed information about shard recoveries.' + })), + index: z.optional(types_indices), + h: z.optional(cat_types_cat_recovery_columns), + s: z.optional(types_names) + })) }); export const cat_recovery1_response = z.array(cat_recovery_recovery_record); export const cat_repositories_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - h: z.optional(types_names), - s: z.optional(types_names), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), -}); - -export const cat_repositories_response = z.array(cat_repositories_repositories_record); - -export const cat_segments_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_segments_columns), - s: z.optional(types_names), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', - }) - ), - master_timeout: z.optional(types_duration), - expand_wildcards: z.optional(types_expand_wildcards), - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only\nmissing or closed indices. This behavior applies even if the request targets other open indices. For example,\na request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.', - }) - ), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, concrete, expanded or aliased indices are ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', - }) - ), - allow_closed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, allow closed indices to be returned in the response otherwise if false, keep the legacy behaviour\nof throwing an exception if index pattern matches closed indices', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + h: z.optional(types_names), + s: z.optional(types_names), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' + })), + master_timeout: z.optional(types_duration) + })) +}); + +export const cat_repositories_response = z.array(cat_repositories_repositories_record); + +export const cat_segments_request = z.object({ + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_segments_columns), + s: z.optional(types_names), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' + })), + master_timeout: z.optional(types_duration), + expand_wildcards: z.optional(types_expand_wildcards), + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only\nmissing or closed indices. This behavior applies even if the request targets other open indices. For example,\na request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.' + })), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, concrete, expanded or aliased indices are ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, missing or closed indices are not included in the response.' + })), + allow_closed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, allow closed indices to be returned in the response otherwise if false, keep the legacy behaviour\nof throwing an exception if index pattern matches closed indices' + })) + })) }); export const cat_segments_response = z.array(cat_segments_segments_record); export const cat_segments1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_segments_columns), - s: z.optional(types_names), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', - }) - ), - master_timeout: z.optional(types_duration), - expand_wildcards: z.optional(types_expand_wildcards), - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only\nmissing or closed indices. This behavior applies even if the request targets other open indices. For example,\na request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.', - }) - ), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, concrete, expanded or aliased indices are ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', - }) - ), - allow_closed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, allow closed indices to be returned in the response otherwise if false, keep the legacy behaviour\nof throwing an exception if index pattern matches closed indices', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_segments_columns), + s: z.optional(types_names), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' + })), + master_timeout: z.optional(types_duration), + expand_wildcards: z.optional(types_expand_wildcards), + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only\nmissing or closed indices. This behavior applies even if the request targets other open indices. For example,\na request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.' + })), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, concrete, expanded or aliased indices are ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, missing or closed indices are not included in the response.' + })), + allow_closed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, allow closed indices to be returned in the response otherwise if false, keep the legacy behaviour\nof throwing an exception if index pattern matches closed indices' + })) + })) }); export const cat_segments1_response = z.array(cat_segments_segments_record); export const cat_shards_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_shard_columns), - s: z.optional(types_names), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_shard_columns), + s: z.optional(types_names), + master_timeout: z.optional(types_duration) + })) }); export const cat_shards_response = z.array(cat_shards_shards_record); export const cat_shards1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_shard_columns), - s: z.optional(types_names), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_shard_columns), + s: z.optional(types_names), + master_timeout: z.optional(types_duration) + })) }); export const cat_shards1_response = z.array(cat_shards_shards_record); export const cat_snapshots_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response does not include information from unavailable snapshots.', - }) - ), - h: z.optional(cat_types_cat_snapshots_columns), - s: z.optional(types_names), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response does not include information from unavailable snapshots.' + })), + h: z.optional(cat_types_cat_snapshots_columns), + s: z.optional(types_names), + master_timeout: z.optional(types_duration) + })) }); export const cat_snapshots_response = z.array(cat_snapshots_snapshots_record); export const cat_snapshots1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - repository: types_names, - }), - query: z.optional( - z.object({ - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response does not include information from unavailable snapshots.', - }) - ), - h: z.optional(cat_types_cat_snapshots_columns), - s: z.optional(types_names), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + repository: types_names + }), + query: z.optional(z.object({ + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response does not include information from unavailable snapshots.' + })), + h: z.optional(cat_types_cat_snapshots_columns), + s: z.optional(types_names), + master_timeout: z.optional(types_duration) + })) }); export const cat_snapshots1_response = z.array(cat_snapshots_snapshots_record); export const cat_tasks_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - actions: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'The task action names, which are used to limit the response.', - }) - ), - detailed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes detailed information about shard recoveries.', - }) - ), - nodes: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'Unique node identifiers, which are used to limit the response.', - }) - ), - parent_task_id: z.optional( - z.string().register(z.globalRegistry, { - description: 'The parent task identifier, which is used to limit the response.', - }) - ), - h: z.optional(cat_types_cat_tasks_columns), - s: z.optional(types_names), - timeout: z.optional(types_duration), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request blocks until the task has completed.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + actions: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The task action names, which are used to limit the response.' + })), + detailed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes detailed information about shard recoveries.' + })), + nodes: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Unique node identifiers, which are used to limit the response.' + })), + parent_task_id: z.optional(z.string().register(z.globalRegistry, { + description: 'The parent task identifier, which is used to limit the response.' + })), + h: z.optional(cat_types_cat_tasks_columns), + s: z.optional(types_names), + timeout: z.optional(types_duration), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request blocks until the task has completed.' + })) + })) }); export const cat_tasks_response = z.array(cat_tasks_tasks_record); export const cat_templates_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_templates_columns), - s: z.optional(types_names), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_templates_columns), + s: z.optional(types_names), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cat_templates_response = z.array(cat_templates_templates_record); export const cat_templates1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_templates_columns), - s: z.optional(types_names), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_templates_columns), + s: z.optional(types_names), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cat_templates1_response = z.array(cat_templates_templates_record); export const cat_thread_pool_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_thread_pool_columns), - s: z.optional(types_names), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_thread_pool_columns), + s: z.optional(types_names), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cat_thread_pool_response = z.array(cat_thread_pool_thread_pool_record); export const cat_thread_pool1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - thread_pool_patterns: types_names, - }), - query: z.optional( - z.object({ - h: z.optional(cat_types_cat_thread_pool_columns), - s: z.optional(types_names), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + thread_pool_patterns: types_names + }), + query: z.optional(z.object({ + h: z.optional(cat_types_cat_thread_pool_columns), + s: z.optional(types_names), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cat_thread_pool1_response = z.array(cat_thread_pool_thread_pool_record); export const cat_transforms_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request: contains wildcard expressions and there are no transforms that match; contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches.\nIf `true`, it returns an empty transforms array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the request returns a 404 status code when there are no matches or only partial matches.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of transforms.', - }) - ), - h: z.optional(cat_types_cat_transform_columns), - s: z.optional(cat_types_cat_transform_columns), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of transforms to obtain.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request: contains wildcard expressions and there are no transforms that match; contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches.\nIf `true`, it returns an empty transforms array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the request returns a 404 status code when there are no matches or only partial matches.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of transforms.' + })), + h: z.optional(cat_types_cat_transform_columns), + s: z.optional(cat_types_cat_transform_columns), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of transforms to obtain.' + })) + })) }); export const cat_transforms_response = z.array(cat_transforms_transforms_record); export const cat_transforms1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - transform_id: types_id, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request: contains wildcard expressions and there are no transforms that match; contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches.\nIf `true`, it returns an empty transforms array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the request returns a 404 status code when there are no matches or only partial matches.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of transforms.', - }) - ), - h: z.optional(cat_types_cat_transform_columns), - s: z.optional(cat_types_cat_transform_columns), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of transforms to obtain.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + transform_id: types_id + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request: contains wildcard expressions and there are no transforms that match; contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches.\nIf `true`, it returns an empty transforms array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the request returns a 404 status code when there are no matches or only partial matches.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of transforms.' + })), + h: z.optional(cat_types_cat_transform_columns), + s: z.optional(cat_types_cat_transform_columns), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of transforms to obtain.' + })) + })) }); export const cat_transforms1_response = z.array(cat_transforms_transforms_record); export const ccr_delete_auto_follow_pattern_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const ccr_delete_auto_follow_pattern_response = types_acknowledged_response_base; export const ccr_get_auto_follow_pattern1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const ccr_get_auto_follow_pattern1_response = z.object({ - patterns: z.array(ccr_get_auto_follow_pattern_auto_follow_pattern), + patterns: z.array(ccr_get_auto_follow_pattern_auto_follow_pattern) }); export const ccr_put_auto_follow_pattern_request = z.object({ - body: z.object({ - remote_cluster: z.string().register(z.globalRegistry, { - description: 'The remote cluster containing the leader indices to match against.', + body: z.object({ + remote_cluster: z.string().register(z.globalRegistry, { + description: 'The remote cluster containing the leader indices to match against.' + }), + follow_index_pattern: z.optional(types_index_pattern), + leader_index_patterns: z.optional(types_index_patterns), + leader_index_exclusion_patterns: z.optional(types_index_patterns), + max_outstanding_read_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of outstanding reads requests from the remote cluster.' + })), + settings: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Settings to override from the leader index. Note that certain settings can not be overrode (e.g., index.number_of_shards).' + })), + max_outstanding_write_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of outstanding reads requests from the remote cluster.' + })), + read_poll_timeout: z.optional(types_duration), + max_read_request_operation_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of operations to pull per read from the remote cluster.' + })), + max_read_request_size: z.optional(types_byte_size), + max_retry_delay: z.optional(types_duration), + max_write_buffer_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be deferred until the number of queued operations goes below the limit.' + })), + max_write_buffer_size: z.optional(types_byte_size), + max_write_request_operation_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of operations per bulk write request executed on the follower.' + })), + max_write_request_size: z.optional(types_byte_size) }), - follow_index_pattern: z.optional(types_index_pattern), - leader_index_patterns: z.optional(types_index_patterns), - leader_index_exclusion_patterns: z.optional(types_index_patterns), - max_outstanding_read_requests: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of outstanding reads requests from the remote cluster.', - }) - ), - settings: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'Settings to override from the leader index. Note that certain settings can not be overrode (e.g., index.number_of_shards).', - }) - ), - max_outstanding_write_requests: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of outstanding reads requests from the remote cluster.', - }) - ), - read_poll_timeout: z.optional(types_duration), - max_read_request_operation_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of operations to pull per read from the remote cluster.', - }) - ), - max_read_request_size: z.optional(types_byte_size), - max_retry_delay: z.optional(types_duration), - max_write_buffer_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be deferred until the number of queued operations goes below the limit.', - }) - ), - max_write_buffer_size: z.optional(types_byte_size), - max_write_request_operation_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of operations per bulk write request executed on the follower.', - }) - ), - max_write_request_size: z.optional(types_byte_size), - }), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const ccr_put_auto_follow_pattern_response = types_acknowledged_response_base; export const ccr_follow_info_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const ccr_follow_info_response = z.object({ - follower_indices: z.array(ccr_follow_info_follower_index), + follower_indices: z.array(ccr_follow_info_follower_index) }); export const ccr_follow_stats_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const ccr_follow_stats_response = z.object({ - indices: z.array(ccr_types_follow_index_stats).register(z.globalRegistry, { - description: 'An array of follower index statistics.', - }), + indices: z.array(ccr_types_follow_index_stats).register(z.globalRegistry, { + description: 'An array of follower index statistics.' + }) }); export const ccr_forget_follower_request = z.object({ - body: z.object({ - follower_cluster: z.optional(z.string()), - follower_index: z.optional(types_index_name), - follower_index_uuid: z.optional(types_uuid), - leader_remote_cluster: z.optional(z.string()), - }), - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + follower_cluster: z.optional(z.string()), + follower_index: z.optional(types_index_name), + follower_index_uuid: z.optional(types_uuid), + leader_remote_cluster: z.optional(z.string()) + }), + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const ccr_forget_follower_response = z.object({ - _shards: types_shard_statistics, + _shards: types_shard_statistics }); export const ccr_get_auto_follow_pattern_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const ccr_get_auto_follow_pattern_response = z.object({ - patterns: z.array(ccr_get_auto_follow_pattern_auto_follow_pattern), + patterns: z.array(ccr_get_auto_follow_pattern_auto_follow_pattern) }); export const ccr_pause_auto_follow_pattern_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const ccr_pause_auto_follow_pattern_response = types_acknowledged_response_base; export const ccr_pause_follow_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const ccr_pause_follow_response = types_acknowledged_response_base; export const ccr_resume_auto_follow_pattern_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const ccr_resume_auto_follow_pattern_response = types_acknowledged_response_base; export const ccr_resume_follow_request = z.object({ - body: z.optional( - z.object({ - max_outstanding_read_requests: z.optional(z.number()), - max_outstanding_write_requests: z.optional(z.number()), - max_read_request_operation_count: z.optional(z.number()), - max_read_request_size: z.optional(z.string()), - max_retry_delay: z.optional(types_duration), - max_write_buffer_count: z.optional(z.number()), - max_write_buffer_size: z.optional(z.string()), - max_write_request_operation_count: z.optional(z.number()), - max_write_request_size: z.optional(z.string()), - read_poll_timeout: z.optional(types_duration), - }) - ), - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.object({ + max_outstanding_read_requests: z.optional(z.number()), + max_outstanding_write_requests: z.optional(z.number()), + max_read_request_operation_count: z.optional(z.number()), + max_read_request_size: z.optional(z.string()), + max_retry_delay: z.optional(types_duration), + max_write_buffer_count: z.optional(z.number()), + max_write_buffer_size: z.optional(z.string()), + max_write_request_operation_count: z.optional(z.number()), + max_write_request_size: z.optional(z.string()), + read_poll_timeout: z.optional(types_duration) + })), + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const ccr_resume_follow_response = types_acknowledged_response_base; export const ccr_stats_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const ccr_stats_response = z.object({ - auto_follow_stats: ccr_stats_auto_follow_stats, - follow_stats: ccr_stats_follow_stats, + auto_follow_stats: ccr_stats_auto_follow_stats, + follow_stats: ccr_stats_follow_stats }); export const ccr_unfollow_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const ccr_unfollow_response = types_acknowledged_response_base; export const clear_scroll_request = z.object({ - body: z.optional(clear_scroll), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(clear_scroll), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const clear_scroll_response = z.object({ - succeeded: z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request succeeded.\nThis does not indicate whether any scrolling search requests were cleared.', - }), - num_freed: z.number().register(z.globalRegistry, { - description: 'The number of scrolling search requests cleared.', - }), + succeeded: z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request succeeded.\nThis does not indicate whether any scrolling search requests were cleared.' + }), + num_freed: z.number().register(z.globalRegistry, { + description: 'The number of scrolling search requests cleared.' + }) }); export const clear_scroll1_request = z.object({ - body: z.optional(clear_scroll), - path: z.object({ - scroll_id: types_scroll_ids, - }), - query: z.optional(z.never()), + body: z.optional(clear_scroll), + path: z.object({ + scroll_id: types_scroll_ids + }), + query: z.optional(z.never()) }); export const clear_scroll1_response = z.object({ - succeeded: z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request succeeded.\nThis does not indicate whether any scrolling search requests were cleared.', - }), - num_freed: z.number().register(z.globalRegistry, { - description: 'The number of scrolling search requests cleared.', - }), + succeeded: z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request succeeded.\nThis does not indicate whether any scrolling search requests were cleared.' + }), + num_freed: z.number().register(z.globalRegistry, { + description: 'The number of scrolling search requests cleared.' + }) }); export const close_point_in_time_request = z.object({ - body: z.object({ - id: types_id, - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.object({ + id: types_id + }), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const close_point_in_time_response = z.object({ - succeeded: z.boolean().register(z.globalRegistry, { - description: - 'If `true`, all search contexts associated with the point-in-time ID were successfully closed.', - }), - num_freed: z.number().register(z.globalRegistry, { - description: 'The number of search contexts that were successfully closed.', - }), + succeeded: z.boolean().register(z.globalRegistry, { + description: 'If `true`, all search contexts associated with the point-in-time ID were successfully closed.' + }), + num_freed: z.number().register(z.globalRegistry, { + description: 'The number of search contexts that were successfully closed.' + }) }); export const cluster_allocation_explain_request = z.object({ - body: z.optional(cluster_allocation_explain), - path: z.optional(z.never()), - query: z.optional( - z.object({ - index: z.optional(types_index_name), - shard: z.optional( - z.number().register(z.globalRegistry, { - description: 'An identifier for the shard that you would like an explanation for.', - }) - ), - primary: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns an explanation for the primary shard for the specified shard ID.', - }) - ), - current_node: z.optional(types_node_id), - include_disk_info: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, returns information about disk usage and shard sizes.', - }) - ), - include_yes_decisions: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, returns YES decisions in explanation.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(cluster_allocation_explain), + path: z.optional(z.never()), + query: z.optional(z.object({ + index: z.optional(types_index_name), + shard: z.optional(z.number().register(z.globalRegistry, { + description: 'An identifier for the shard that you would like an explanation for.' + })), + primary: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns an explanation for the primary shard for the specified shard ID.' + })), + current_node: z.optional(types_node_id), + include_disk_info: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns information about disk usage and shard sizes.' + })), + include_yes_decisions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns YES decisions in explanation.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cluster_allocation_explain_response = z.object({ - allocate_explanation: z.optional(z.string()), - allocation_delay: z.optional(types_duration), - allocation_delay_in_millis: z.optional(types_duration_value_unit_millis), - can_allocate: z.optional(cluster_allocation_explain_decision), - can_move_to_other_node: z.optional(cluster_allocation_explain_decision), - can_rebalance_cluster: z.optional(cluster_allocation_explain_decision), - can_rebalance_cluster_decisions: z.optional( - z.array(cluster_allocation_explain_allocation_decision) - ), - can_rebalance_to_other_node: z.optional(cluster_allocation_explain_decision), - can_remain_decisions: z.optional(z.array(cluster_allocation_explain_allocation_decision)), - can_remain_on_current_node: z.optional(cluster_allocation_explain_decision), - cluster_info: z.optional(cluster_allocation_explain_cluster_info), - configured_delay: z.optional(types_duration), - configured_delay_in_millis: z.optional(types_duration_value_unit_millis), - current_node: z.optional(cluster_allocation_explain_current_node), - current_state: z.string(), - index: types_index_name, - move_explanation: z.optional(z.string()), - node_allocation_decisions: z.optional( - z.array(cluster_allocation_explain_node_allocation_explanation) - ), - primary: z.boolean(), - rebalance_explanation: z.optional(z.string()), - remaining_delay: z.optional(types_duration), - remaining_delay_in_millis: z.optional(types_duration_value_unit_millis), - shard: z.number(), - unassigned_info: z.optional(cluster_allocation_explain_unassigned_information), - note: z.optional(z.string()), + allocate_explanation: z.optional(z.string()), + allocation_delay: z.optional(types_duration), + allocation_delay_in_millis: z.optional(types_duration_value_unit_millis), + can_allocate: z.optional(cluster_allocation_explain_decision), + can_move_to_other_node: z.optional(cluster_allocation_explain_decision), + can_rebalance_cluster: z.optional(cluster_allocation_explain_decision), + can_rebalance_cluster_decisions: z.optional(z.array(cluster_allocation_explain_allocation_decision)), + can_rebalance_to_other_node: z.optional(cluster_allocation_explain_decision), + can_remain_decisions: z.optional(z.array(cluster_allocation_explain_allocation_decision)), + can_remain_on_current_node: z.optional(cluster_allocation_explain_decision), + cluster_info: z.optional(cluster_allocation_explain_cluster_info), + configured_delay: z.optional(types_duration), + configured_delay_in_millis: z.optional(types_duration_value_unit_millis), + current_node: z.optional(cluster_allocation_explain_current_node), + current_state: z.string(), + index: types_index_name, + move_explanation: z.optional(z.string()), + node_allocation_decisions: z.optional(z.array(cluster_allocation_explain_node_allocation_explanation)), + primary: z.boolean(), + rebalance_explanation: z.optional(z.string()), + remaining_delay: z.optional(types_duration), + remaining_delay_in_millis: z.optional(types_duration_value_unit_millis), + shard: z.number(), + unassigned_info: z.optional(cluster_allocation_explain_unassigned_information), + note: z.optional(z.string()) }); export const cluster_allocation_explain1_request = z.object({ - body: z.optional(cluster_allocation_explain), - path: z.optional(z.never()), - query: z.optional( - z.object({ - index: z.optional(types_index_name), - shard: z.optional( - z.number().register(z.globalRegistry, { - description: 'An identifier for the shard that you would like an explanation for.', - }) - ), - primary: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns an explanation for the primary shard for the specified shard ID.', - }) - ), - current_node: z.optional(types_node_id), - include_disk_info: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, returns information about disk usage and shard sizes.', - }) - ), - include_yes_decisions: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, returns YES decisions in explanation.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(cluster_allocation_explain), + path: z.optional(z.never()), + query: z.optional(z.object({ + index: z.optional(types_index_name), + shard: z.optional(z.number().register(z.globalRegistry, { + description: 'An identifier for the shard that you would like an explanation for.' + })), + primary: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns an explanation for the primary shard for the specified shard ID.' + })), + current_node: z.optional(types_node_id), + include_disk_info: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns information about disk usage and shard sizes.' + })), + include_yes_decisions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns YES decisions in explanation.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cluster_allocation_explain1_response = z.object({ - allocate_explanation: z.optional(z.string()), - allocation_delay: z.optional(types_duration), - allocation_delay_in_millis: z.optional(types_duration_value_unit_millis), - can_allocate: z.optional(cluster_allocation_explain_decision), - can_move_to_other_node: z.optional(cluster_allocation_explain_decision), - can_rebalance_cluster: z.optional(cluster_allocation_explain_decision), - can_rebalance_cluster_decisions: z.optional( - z.array(cluster_allocation_explain_allocation_decision) - ), - can_rebalance_to_other_node: z.optional(cluster_allocation_explain_decision), - can_remain_decisions: z.optional(z.array(cluster_allocation_explain_allocation_decision)), - can_remain_on_current_node: z.optional(cluster_allocation_explain_decision), - cluster_info: z.optional(cluster_allocation_explain_cluster_info), - configured_delay: z.optional(types_duration), - configured_delay_in_millis: z.optional(types_duration_value_unit_millis), - current_node: z.optional(cluster_allocation_explain_current_node), - current_state: z.string(), - index: types_index_name, - move_explanation: z.optional(z.string()), - node_allocation_decisions: z.optional( - z.array(cluster_allocation_explain_node_allocation_explanation) - ), - primary: z.boolean(), - rebalance_explanation: z.optional(z.string()), - remaining_delay: z.optional(types_duration), - remaining_delay_in_millis: z.optional(types_duration_value_unit_millis), - shard: z.number(), - unassigned_info: z.optional(cluster_allocation_explain_unassigned_information), - note: z.optional(z.string()), + allocate_explanation: z.optional(z.string()), + allocation_delay: z.optional(types_duration), + allocation_delay_in_millis: z.optional(types_duration_value_unit_millis), + can_allocate: z.optional(cluster_allocation_explain_decision), + can_move_to_other_node: z.optional(cluster_allocation_explain_decision), + can_rebalance_cluster: z.optional(cluster_allocation_explain_decision), + can_rebalance_cluster_decisions: z.optional(z.array(cluster_allocation_explain_allocation_decision)), + can_rebalance_to_other_node: z.optional(cluster_allocation_explain_decision), + can_remain_decisions: z.optional(z.array(cluster_allocation_explain_allocation_decision)), + can_remain_on_current_node: z.optional(cluster_allocation_explain_decision), + cluster_info: z.optional(cluster_allocation_explain_cluster_info), + configured_delay: z.optional(types_duration), + configured_delay_in_millis: z.optional(types_duration_value_unit_millis), + current_node: z.optional(cluster_allocation_explain_current_node), + current_state: z.string(), + index: types_index_name, + move_explanation: z.optional(z.string()), + node_allocation_decisions: z.optional(z.array(cluster_allocation_explain_node_allocation_explanation)), + primary: z.boolean(), + rebalance_explanation: z.optional(z.string()), + remaining_delay: z.optional(types_duration), + remaining_delay_in_millis: z.optional(types_duration_value_unit_millis), + shard: z.number(), + unassigned_info: z.optional(cluster_allocation_explain_unassigned_information), + note: z.optional(z.string()) }); export const cluster_delete_component_template_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_names, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_names + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const cluster_delete_component_template_response = types_acknowledged_response_base; export const cluster_exists_component_template_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_names, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the request retrieves information from the local node only.\nDefaults to false, which means information is retrieved from the master node.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_names + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request retrieves information from the local node only.\nDefaults to false, which means information is retrieved from the master node.' + })) + })) }); export const cluster_delete_voting_config_exclusions_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - wait_for_removal: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether to wait for all excluded nodes to be removed from the\ncluster before clearing the voting configuration exclusions list.\nDefaults to true, meaning that all excluded nodes must be removed from\nthe cluster before this API takes any action. If set to false then the\nvoting configuration exclusions list is cleared even if some excluded\nnodes are still in the cluster.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + wait_for_removal: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether to wait for all excluded nodes to be removed from the\ncluster before clearing the voting configuration exclusions list.\nDefaults to true, meaning that all excluded nodes must be removed from\nthe cluster before this API takes any action. If set to false then the\nvoting configuration exclusions list is cleared even if some excluded\nnodes are still in the cluster.' + })) + })) }); export const cluster_post_voting_config_exclusions_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - node_names: z.optional(types_names), - node_ids: z.optional(types_ids), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + node_names: z.optional(types_names), + node_ids: z.optional(types_ids), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const cluster_get_settings_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', - }) - ), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, also returns default values for all other cluster settings, reflecting the values\nin the `elasticsearch.yml` file of one of the nodes in the cluster. If the nodes in your\ncluster do not all have the same values in their `elasticsearch.yml` config files then the\nvalues returned by this API may vary from invocation to invocation and may not reflect the\nvalues that Elasticsearch uses in all situations. Use the `GET _nodes/settings` API to\nfetch the settings for each individual node in your cluster.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns settings in flat format.' + })), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, also returns default values for all other cluster settings, reflecting the values\nin the `elasticsearch.yml` file of one of the nodes in the cluster. If the nodes in your\ncluster do not all have the same values in their `elasticsearch.yml` config files then the\nvalues returned by this API may vary from invocation to invocation and may not reflect the\nvalues that Elasticsearch uses in all situations. Use the `GET _nodes/settings` API to\nfetch the settings for each individual node in your cluster.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const cluster_get_settings_response = z.object({ - persistent: z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'The settings that persist after the cluster restarts.', - }), - transient: z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'The settings that do not persist after the cluster restarts.', - }), - defaults: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'The default setting values.', - }) - ), + persistent: z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'The settings that persist after the cluster restarts.' + }), + transient: z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'The settings that do not persist after the cluster restarts.' + }), + defaults: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'The default setting values.' + })) }); export const cluster_put_settings_request = z.object({ - body: z.object({ - persistent: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'The settings that persist after the cluster restarts.', - }) - ), - transient: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'The settings that do not persist after the cluster restarts.', - }) - ), - }), - path: z.optional(z.never()), - query: z.optional( - z.object({ - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Return settings in flat format (default: false)', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + persistent: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'The settings that persist after the cluster restarts.' + })), + transient: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'The settings that do not persist after the cluster restarts.' + })) + }), + path: z.optional(z.never()), + query: z.optional(z.object({ + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Return settings in flat format' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const cluster_put_settings_response = z.object({ - acknowledged: z.boolean(), - persistent: z.record(z.string(), z.record(z.string(), z.unknown())), - transient: z.record(z.string(), z.record(z.string(), z.unknown())), + acknowledged: z.boolean(), + persistent: z.record(z.string(), z.record(z.string(), z.unknown())), + transient: z.record(z.string(), z.record(z.string(), z.unknown())) }); export const cluster_health_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - level: z.optional(types_level), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - wait_for_events: z.optional(types_wait_for_events), - wait_for_nodes: z.optional(cluster_health_wait_for_nodes), - wait_for_no_initializing_shards: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards.', - }) - ), - wait_for_no_relocating_shards: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards.', - }) - ), - wait_for_status: z.optional(types_health_status), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + expand_wildcards: z.optional(types_expand_wildcards), + level: z.optional(types_level), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards), + wait_for_events: z.optional(types_wait_for_events), + wait_for_nodes: z.optional(cluster_health_wait_for_nodes), + wait_for_no_initializing_shards: z.optional(z.boolean().register(z.globalRegistry, { + description: 'A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards.' + })), + wait_for_no_relocating_shards: z.optional(z.boolean().register(z.globalRegistry, { + description: 'A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards.' + })), + wait_for_status: z.optional(types_health_status) + })) }); export const cluster_health_response = cluster_health_health_response_body; export const cluster_health1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - level: z.optional(types_level), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - wait_for_events: z.optional(types_wait_for_events), - wait_for_nodes: z.optional(cluster_health_wait_for_nodes), - wait_for_no_initializing_shards: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards.', - }) - ), - wait_for_no_relocating_shards: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards.', - }) - ), - wait_for_status: z.optional(types_health_status), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + expand_wildcards: z.optional(types_expand_wildcards), + level: z.optional(types_level), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards), + wait_for_events: z.optional(types_wait_for_events), + wait_for_nodes: z.optional(cluster_health_wait_for_nodes), + wait_for_no_initializing_shards: z.optional(z.boolean().register(z.globalRegistry, { + description: 'A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards.' + })), + wait_for_no_relocating_shards: z.optional(z.boolean().register(z.globalRegistry, { + description: 'A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards.' + })), + wait_for_status: z.optional(types_health_status) + })) }); export const cluster_health1_response = cluster_health_health_response_body; export const cluster_info_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - target: types_cluster_info_targets, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + target: types_cluster_info_targets + }), + query: z.optional(z.never()) }); export const cluster_info_response = z.object({ - cluster_name: types_name, - http: z.optional(nodes_types_http), - ingest: z.optional(nodes_types_ingest), - thread_pool: z.optional(z.record(z.string(), nodes_types_thread_count)), - script: z.optional(nodes_types_scripting), + cluster_name: types_name, + http: z.optional(nodes_types_http), + ingest: z.optional(nodes_types_ingest), + thread_pool: z.optional(z.record(z.string(), nodes_types_thread_count)), + script: z.optional(nodes_types_scripting) }); export const cluster_pending_tasks_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request retrieves information from the local node only.\nIf `false`, information is retrieved from the master node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request retrieves information from the local node only.\nIf `false`, information is retrieved from the master node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cluster_pending_tasks_response = z.object({ - tasks: z.array(cluster_pending_tasks_pending_task), + tasks: z.array(cluster_pending_tasks_pending_task) }); export const cluster_remote_info_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); -export const cluster_remote_info_response = z.record( - z.string(), - cluster_remote_info_cluster_remote_info -); +export const cluster_remote_info_response = z.record(z.string(), cluster_remote_info_cluster_remote_info); export const cluster_reroute_request = z.object({ - body: z.optional( - z.object({ - commands: z.optional( - z.array(cluster_reroute_command).register(z.globalRegistry, { - description: 'Defines the commands to perform.', - }) - ), - }) - ), - path: z.optional(z.never()), - query: z.optional( - z.object({ - dry_run: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, then the request simulates the operation.\nIt will calculate the result of applying the commands to the current cluster state and return the resulting cluster state after the commands (and rebalancing) have been applied; it will not actually perform the requested changes.', - }) - ), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, then the response contains an explanation of why the commands can or cannot run.', - }) - ), - metric: z.optional(z.union([z.string(), z.array(z.string())])), - retry_failed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, then retries allocation of shards that are blocked due to too many subsequent allocation failures.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.object({ + commands: z.optional(z.array(cluster_reroute_command).register(z.globalRegistry, { + description: 'Defines the commands to perform.' + })) + })), + path: z.optional(z.never()), + query: z.optional(z.object({ + dry_run: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, then the request simulates the operation.\nIt will calculate the result of applying the commands to the current cluster state and return the resulting cluster state after the commands (and rebalancing) have been applied; it will not actually perform the requested changes.' + })), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, then the response contains an explanation of why the commands can or cannot run.' + })), + metric: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + retry_failed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, then retries allocation of shards that are blocked due to too many subsequent allocation failures.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const cluster_reroute_response = z.object({ - acknowledged: z.boolean(), - explanations: z.optional(z.array(cluster_reroute_reroute_explanation)), - state: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - "There aren't any guarantees on the output/structure of the raw cluster state.\nHere you will find the internal representation of the cluster, which can\ndiffer from the external representation.", - }) - ), + acknowledged: z.boolean(), + explanations: z.optional(z.array(cluster_reroute_reroute_explanation)), + state: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'There aren\'t any guarantees on the output/structure of the raw cluster state.\nHere you will find the internal representation of the cluster, which can\ndiffer from the external representation.' + })) }); export const cluster_state_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Return settings in flat format (default: false)', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether specified concrete indices should be ignored when unavailable (missing or closed)', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Return local information, do not retrieve the state from master node (default: false)', - }) - ), - master_timeout: z.optional(types_duration), - wait_for_metadata_version: z.optional(types_version_number), - wait_for_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' + })), + expand_wildcards: z.optional(types_expand_wildcards), + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Return settings in flat format' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether specified concrete indices should be ignored when unavailable (missing or closed)' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Return local information, do not retrieve the state from master node' + })), + master_timeout: z.optional(types_duration), + wait_for_metadata_version: z.optional(types_version_number), + wait_for_timeout: z.optional(types_duration) + })) }); export const cluster_state_response = z.record(z.string(), z.unknown()); export const cluster_state1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - metric: cluster_state_cluster_state_metrics, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Return settings in flat format (default: false)', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether specified concrete indices should be ignored when unavailable (missing or closed)', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Return local information, do not retrieve the state from master node (default: false)', - }) - ), - master_timeout: z.optional(types_duration), - wait_for_metadata_version: z.optional(types_version_number), - wait_for_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + metric: cluster_state_cluster_state_metrics + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' + })), + expand_wildcards: z.optional(types_expand_wildcards), + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Return settings in flat format' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether specified concrete indices should be ignored when unavailable (missing or closed)' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Return local information, do not retrieve the state from master node' + })), + master_timeout: z.optional(types_duration), + wait_for_metadata_version: z.optional(types_version_number), + wait_for_timeout: z.optional(types_duration) + })) }); export const cluster_state1_response = z.record(z.string(), z.unknown()); export const cluster_state2_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - metric: cluster_state_cluster_state_metrics, - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Return settings in flat format (default: false)', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether specified concrete indices should be ignored when unavailable (missing or closed)', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Return local information, do not retrieve the state from master node (default: false)', - }) - ), - master_timeout: z.optional(types_duration), - wait_for_metadata_version: z.optional(types_version_number), - wait_for_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + metric: cluster_state_cluster_state_metrics, + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' + })), + expand_wildcards: z.optional(types_expand_wildcards), + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Return settings in flat format' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether specified concrete indices should be ignored when unavailable (missing or closed)' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Return local information, do not retrieve the state from master node' + })), + master_timeout: z.optional(types_duration), + wait_for_metadata_version: z.optional(types_version_number), + wait_for_timeout: z.optional(types_duration) + })) }); export const cluster_state2_response = z.record(z.string(), z.unknown()); export const cluster_stats_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - include_remotes: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Include remote cluster data into the response', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + include_remotes: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Include remote cluster data into the response' + })), + timeout: z.optional(types_duration) + })) }); export const cluster_stats_response = cluster_stats_stats_response_base; export const cluster_stats1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - node_id: types_node_ids, - }), - query: z.optional( - z.object({ - include_remotes: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Include remote cluster data into the response', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + node_id: types_node_ids + }), + query: z.optional(z.object({ + include_remotes: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Include remote cluster data into the response' + })), + timeout: z.optional(types_duration) + })) }); export const cluster_stats1_response = cluster_stats_stats_response_base; export const connector_check_in_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - connector_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.never()) }); export const connector_check_in_response = z.object({ - result: types_result, + result: types_result }); export const connector_delete_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - connector_id: types_id, - }), - query: z.optional( - z.object({ - delete_sync_jobs: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'A flag indicating if associated sync jobs should be also removed.', - }) - ), - hard: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'A flag indicating if the connector should be hard deleted.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.object({ + delete_sync_jobs: z.optional(z.boolean().register(z.globalRegistry, { + description: 'A flag indicating if associated sync jobs should be also removed.' + })), + hard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'A flag indicating if the connector should be hard deleted.' + })) + })) }); export const connector_delete_response = types_acknowledged_response_base; export const connector_get_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - connector_id: types_id, - }), - query: z.optional( - z.object({ - include_deleted: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'A flag to indicate if the desired connector should be fetched, even if it was soft-deleted.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.object({ + include_deleted: z.optional(z.boolean().register(z.globalRegistry, { + description: 'A flag to indicate if the desired connector should be fetched, even if it was soft-deleted.' + })) + })) }); export const connector_get_response = connector_types_connector; export const connector_put_request = z.object({ - body: z.optional(connector_put), - path: z.object({ - connector_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(connector_put), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.never()) }); export const connector_put_response = z.object({ - result: types_result, - id: types_id, + result: types_result, + id: types_id }); export const connector_list_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Starting offset', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies a max number of results to get', - }) - ), - index_name: z.optional(types_indices), - connector_name: z.optional(types_names), - service_type: z.optional(types_names), - include_deleted: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'A flag to indicate if the desired connector should be fetched, even if it was soft-deleted.', - }) - ), - query: z.optional( - z.string().register(z.globalRegistry, { - description: - 'A wildcard query string that filters connectors with matching name, description or index name', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Starting offset' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies a max number of results to get' + })), + index_name: z.optional(types_indices), + connector_name: z.optional(types_names), + service_type: z.optional(types_names), + include_deleted: z.optional(z.boolean().register(z.globalRegistry, { + description: 'A flag to indicate if the desired connector should be fetched, even if it was soft-deleted.' + })), + query: z.optional(z.string().register(z.globalRegistry, { + description: 'A wildcard query string that filters connectors with matching name, description or index name' + })) + })) }); export const connector_list_response = z.object({ - count: z.number(), - results: z.array(connector_types_connector), + count: z.number(), + results: z.array(connector_types_connector) }); export const connector_post_request = z.object({ - body: z.optional( - z.object({ - description: z.optional(z.string()), - index_name: z.optional(types_index_name), - is_native: z.optional(z.boolean()), - language: z.optional(z.string()), - name: z.optional(z.string()), - service_type: z.optional(z.string()), - }) - ), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.object({ + description: z.optional(z.string()), + index_name: z.optional(types_index_name), + is_native: z.optional(z.boolean()), + language: z.optional(z.string()), + name: z.optional(z.string()), + service_type: z.optional(z.string()) + })), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const connector_post_response = z.object({ - result: types_result, - id: types_id, + result: types_result, + id: types_id }); export const connector_put1_request = z.object({ - body: z.optional(connector_put), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(connector_put), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const connector_put1_response = z.object({ - result: types_result, - id: types_id, + result: types_result, + id: types_id }); export const connector_sync_job_cancel_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - connector_sync_job_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + connector_sync_job_id: types_id + }), + query: z.optional(z.never()) }); export const connector_sync_job_cancel_response = z.object({ - result: types_result, + result: types_result }); export const connector_sync_job_check_in_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - connector_sync_job_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + connector_sync_job_id: types_id + }), + query: z.optional(z.never()) }); export const connector_sync_job_check_in_response = z.record(z.string(), z.unknown()); export const connector_sync_job_claim_request = z.object({ - body: z.object({ - sync_cursor: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'The cursor object from the last incremental sync job.\nThis should reference the `sync_cursor` field in the connector state for which the job runs.', - }) - ), - worker_hostname: z.string().register(z.globalRegistry, { - description: 'The host name of the current system that will run the job.', - }), - }), - path: z.object({ - connector_sync_job_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + sync_cursor: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'The cursor object from the last incremental sync job.\nThis should reference the `sync_cursor` field in the connector state for which the job runs.' + })), + worker_hostname: z.string().register(z.globalRegistry, { + description: 'The host name of the current system that will run the job.' + }) + }), + path: z.object({ + connector_sync_job_id: types_id + }), + query: z.optional(z.never()) }); export const connector_sync_job_claim_response = z.record(z.string(), z.unknown()); export const connector_sync_job_delete_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - connector_sync_job_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + connector_sync_job_id: types_id + }), + query: z.optional(z.never()) }); export const connector_sync_job_delete_response = types_acknowledged_response_base; export const connector_sync_job_get_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - connector_sync_job_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + connector_sync_job_id: types_id + }), + query: z.optional(z.never()) }); export const connector_sync_job_get_response = connector_types_connector_sync_job; export const connector_sync_job_error_request = z.object({ - body: z.object({ - error: z.string().register(z.globalRegistry, { - description: 'The error for the connector sync job error field.', + body: z.object({ + error: z.string().register(z.globalRegistry, { + description: 'The error for the connector sync job error field.' + }) + }), + path: z.object({ + connector_sync_job_id: types_id }), - }), - path: z.object({ - connector_sync_job_id: types_id, - }), - query: z.optional(z.never()), + query: z.optional(z.never()) }); export const connector_sync_job_error_response = z.record(z.string(), z.unknown()); export const connector_sync_job_list_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Starting offset', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies a max number of results to get', - }) - ), - status: z.optional(connector_types_sync_status), - connector_id: z.optional(types_id), - job_type: z.optional( - z.union([connector_types_sync_job_type, z.array(connector_types_sync_job_type)]) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Starting offset' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies a max number of results to get' + })), + status: z.optional(connector_types_sync_status), + connector_id: z.optional(types_id), + job_type: z.optional(z.union([ + connector_types_sync_job_type, + z.array(connector_types_sync_job_type) + ])) + })) }); export const connector_sync_job_list_response = z.object({ - count: z.number(), - results: z.array(connector_types_connector_sync_job), + count: z.number(), + results: z.array(connector_types_connector_sync_job) }); export const connector_sync_job_post_request = z.object({ - body: z.object({ - id: types_id, - job_type: z.optional(connector_types_sync_job_type), - trigger_method: z.optional(connector_types_sync_job_trigger_method), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.object({ + id: types_id, + job_type: z.optional(connector_types_sync_job_type), + trigger_method: z.optional(connector_types_sync_job_trigger_method) + }), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const connector_sync_job_post_response = z.object({ - id: types_id, + id: types_id }); export const connector_sync_job_update_stats_request = z.object({ - body: z.object({ - deleted_document_count: z.number().register(z.globalRegistry, { - description: 'The number of documents the sync job deleted.', - }), - indexed_document_count: z.number().register(z.globalRegistry, { - description: 'The number of documents the sync job indexed.', + body: z.object({ + deleted_document_count: z.number().register(z.globalRegistry, { + description: 'The number of documents the sync job deleted.' + }), + indexed_document_count: z.number().register(z.globalRegistry, { + description: 'The number of documents the sync job indexed.' + }), + indexed_document_volume: z.number().register(z.globalRegistry, { + description: 'The total size of the data (in MiB) the sync job indexed.' + }), + last_seen: z.optional(types_duration), + metadata: z.optional(types_metadata), + total_document_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The total number of documents in the target index after the sync job finished.' + })) }), - indexed_document_volume: z.number().register(z.globalRegistry, { - description: 'The total size of the data (in MiB) the sync job indexed.', + path: z.object({ + connector_sync_job_id: types_id }), - last_seen: z.optional(types_duration), - metadata: z.optional(types_metadata), - total_document_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The total number of documents in the target index after the sync job finished.', - }) - ), - }), - path: z.object({ - connector_sync_job_id: types_id, - }), - query: z.optional(z.never()), + query: z.optional(z.never()) }); export const connector_sync_job_update_stats_response = z.record(z.string(), z.unknown()); export const connector_update_active_filtering_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - connector_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.never()) }); export const connector_update_active_filtering_response = z.object({ - result: types_result, + result: types_result }); export const connector_update_api_key_id_request = z.object({ - body: z.object({ - api_key_id: z.optional(z.string()), - api_key_secret_id: z.optional(z.string()), - }), - path: z.object({ - connector_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + api_key_id: z.optional(z.string()), + api_key_secret_id: z.optional(z.string()) + }), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.never()) }); export const connector_update_api_key_id_response = z.object({ - result: types_result, + result: types_result }); export const connector_update_configuration_request = z.object({ - body: z.object({ - configuration: z.optional(connector_types_connector_configuration), - values: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - }), - path: z.object({ - connector_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + configuration: z.optional(connector_types_connector_configuration), + values: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))) + }), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.never()) }); export const connector_update_configuration_response = z.object({ - result: types_result, + result: types_result }); export const connector_update_error_request = z.object({ - body: z.object({ - error: z.union([z.string(), spec_utils_null_value]), - }), - path: z.object({ - connector_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + error: z.union([ + z.string(), + spec_utils_null_value + ]) + }), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.never()) }); export const connector_update_error_response = z.object({ - result: types_result, + result: types_result }); export const connector_update_features_request = z.object({ - body: z.object({ - features: connector_types_connector_features, - }), - path: z.object({ - connector_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + features: connector_types_connector_features + }), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.never()) }); export const connector_update_features_response = z.object({ - result: types_result, + result: types_result }); export const connector_update_filtering_request = z.object({ - body: z.object({ - filtering: z.optional(z.array(connector_types_filtering_config)), - rules: z.optional(z.array(connector_types_filtering_rule)), - advanced_snippet: z.optional(connector_types_filtering_advanced_snippet), - }), - path: z.object({ - connector_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + filtering: z.optional(z.array(connector_types_filtering_config)), + rules: z.optional(z.array(connector_types_filtering_rule)), + advanced_snippet: z.optional(connector_types_filtering_advanced_snippet) + }), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.never()) }); export const connector_update_filtering_response = z.object({ - result: types_result, + result: types_result }); export const connector_update_filtering_validation_request = z.object({ - body: z.object({ - validation: connector_types_filtering_rules_validation, - }), - path: z.object({ - connector_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + validation: connector_types_filtering_rules_validation + }), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.never()) }); export const connector_update_filtering_validation_response = z.object({ - result: types_result, + result: types_result }); export const connector_update_index_name_request = z.object({ - body: z.object({ - index_name: z.union([types_index_name, spec_utils_null_value]), - }), - path: z.object({ - connector_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + index_name: z.union([ + types_index_name, + spec_utils_null_value + ]) + }), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.never()) }); export const connector_update_index_name_response = z.object({ - result: types_result, + result: types_result }); export const connector_update_name_request = z.object({ - body: z.object({ - name: z.optional(z.string()), - description: z.optional(z.string()), - }), - path: z.object({ - connector_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + name: z.optional(z.string()), + description: z.optional(z.string()) + }), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.never()) }); export const connector_update_name_response = z.object({ - result: types_result, + result: types_result }); export const connector_update_native_request = z.object({ - body: z.object({ - is_native: z.boolean(), - }), - path: z.object({ - connector_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + is_native: z.boolean() + }), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.never()) }); export const connector_update_native_response = z.object({ - result: types_result, + result: types_result }); export const connector_update_pipeline_request = z.object({ - body: z.object({ - pipeline: connector_types_ingest_pipeline_params, - }), - path: z.object({ - connector_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + pipeline: connector_types_ingest_pipeline_params + }), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.never()) }); export const connector_update_pipeline_response = z.object({ - result: types_result, + result: types_result }); export const connector_update_scheduling_request = z.object({ - body: z.object({ - scheduling: connector_types_scheduling_configuration, - }), - path: z.object({ - connector_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + scheduling: connector_types_scheduling_configuration + }), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.never()) }); export const connector_update_scheduling_response = z.object({ - result: types_result, + result: types_result }); export const connector_update_service_type_request = z.object({ - body: z.object({ - service_type: z.string(), - }), - path: z.object({ - connector_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + service_type: z.string() + }), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.never()) }); export const connector_update_service_type_response = z.object({ - result: types_result, + result: types_result }); export const connector_update_status_request = z.object({ - body: z.object({ - status: connector_types_connector_status, - }), - path: z.object({ - connector_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + status: connector_types_connector_status + }), + path: z.object({ + connector_id: types_id + }), + query: z.optional(z.never()) }); export const connector_update_status_response = z.object({ - result: types_result, + result: types_result }); export const create1_request = z.object({ - body: create, - path: z.object({ - index: types_index_name, - id: types_id, - }), - query: z.optional( - z.object({ - include_source_on_error: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'True or false if to include the document source in the error message in case of parsing errors.', - }) - ), - pipeline: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.', - }) - ), - refresh: z.optional(types_refresh), - require_alias: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the destination must be an index alias.', - }) - ), - require_data_stream: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `true`, the request's actions must target a data stream (existing or to be created).", - }) - ), - routing: z.optional(types_routing), - timeout: z.optional(types_duration), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - }) - ), + body: create, + path: z.object({ + index: types_index_name, + id: types_id + }), + query: z.optional(z.object({ + include_source_on_error: z.optional(z.boolean().register(z.globalRegistry, { + description: 'True or false if to include the document source in the error message in case of parsing errors.' + })), + pipeline: z.optional(z.string().register(z.globalRegistry, { + description: 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.' + })), + refresh: z.optional(types_refresh), + require_alias: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the destination must be an index alias.' + })), + require_data_stream: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request\'s actions must target a data stream (existing or to be created).' + })), + routing: z.optional(types_routing), + timeout: z.optional(types_duration), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type), + wait_for_active_shards: z.optional(types_wait_for_active_shards) + })) }); export const create1_response = types_write_response_base; export const create_request = z.object({ - body: create, - path: z.object({ - index: types_index_name, - id: types_id, - }), - query: z.optional( - z.object({ - include_source_on_error: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'True or false if to include the document source in the error message in case of parsing errors.', - }) - ), - pipeline: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.', - }) - ), - refresh: z.optional(types_refresh), - require_alias: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the destination must be an index alias.', - }) - ), - require_data_stream: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `true`, the request's actions must target a data stream (existing or to be created).", - }) - ), - routing: z.optional(types_routing), - timeout: z.optional(types_duration), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - }) - ), + body: create, + path: z.object({ + index: types_index_name, + id: types_id + }), + query: z.optional(z.object({ + include_source_on_error: z.optional(z.boolean().register(z.globalRegistry, { + description: 'True or false if to include the document source in the error message in case of parsing errors.' + })), + pipeline: z.optional(z.string().register(z.globalRegistry, { + description: 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.' + })), + refresh: z.optional(types_refresh), + require_alias: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the destination must be an index alias.' + })), + require_data_stream: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request\'s actions must target a data stream (existing or to be created).' + })), + routing: z.optional(types_routing), + timeout: z.optional(types_duration), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type), + wait_for_active_shards: z.optional(types_wait_for_active_shards) + })) }); export const create_response = types_write_response_base; export const dangling_indices_delete_dangling_index_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index_uuid: types_uuid, - }), - query: z.optional( - z.object({ - accept_data_loss: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'This parameter must be set to true to acknowledge that it will no longer be possible to recove data from the dangling index.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index_uuid: types_uuid + }), + query: z.optional(z.object({ + accept_data_loss: z.optional(z.boolean().register(z.globalRegistry, { + description: 'This parameter must be set to true to acknowledge that it will no longer be possible to recove data from the dangling index.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const dangling_indices_delete_dangling_index_response = types_acknowledged_response_base; export const dangling_indices_import_dangling_index_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index_uuid: types_uuid, - }), - query: z.optional( - z.object({ - accept_data_loss: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'This parameter must be set to true to import a dangling index.\nBecause Elasticsearch cannot know where the dangling index data came from or determine which shard copies are fresh and which are stale, it cannot guarantee that the imported data represents the latest state of the index when it was last in the cluster.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index_uuid: types_uuid + }), + query: z.optional(z.object({ + accept_data_loss: z.optional(z.boolean().register(z.globalRegistry, { + description: 'This parameter must be set to true to import a dangling index.\nBecause Elasticsearch cannot know where the dangling index data came from or determine which shard copies are fresh and which are stale, it cannot guarantee that the imported data represents the latest state of the index when it was last in the cluster.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const dangling_indices_import_dangling_index_response = types_acknowledged_response_base; export const dangling_indices_list_dangling_indices_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const dangling_indices_list_dangling_indices_response = z.object({ - dangling_indices: z.array(dangling_indices_list_dangling_indices_dangling_index), + dangling_indices: z.array(dangling_indices_list_dangling_indices_dangling_index) }); export const delete_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_index_name, - id: types_id, - }), - query: z.optional( - z.object({ - if_primary_term: z.optional( - z.number().register(z.globalRegistry, { - description: 'Only perform the operation if the document has this primary term.', - }) - ), - if_seq_no: z.optional(types_sequence_number), - refresh: z.optional(types_refresh), - routing: z.optional(types_routing), - timeout: z.optional(types_duration), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_index_name, + id: types_id + }), + query: z.optional(z.object({ + if_primary_term: z.optional(z.number().register(z.globalRegistry, { + description: 'Only perform the operation if the document has this primary term.' + })), + if_seq_no: z.optional(types_sequence_number), + refresh: z.optional(types_refresh), + routing: z.optional(types_routing), + timeout: z.optional(types_duration), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type), + wait_for_active_shards: z.optional(types_wait_for_active_shards) + })) }); export const delete_response = types_write_response_base; export const get_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_index_name, - id: types_id, - }), - query: z.optional( - z.object({ - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nBy default, the operation is randomized between the shard replicas.\n\nIf it is set to `_local`, the operation will prefer to be run on a local allocated shard when possible.\nIf it is set to a custom value, the value is used to guarantee that the same shards will be used for the same custom value.\nThis can help with "jumping values" when hitting different shards in different refresh states.\nA sample value can be something like the web session ID or the user name.', - }) - ), - realtime: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request is real-time as opposed to near-real-time.', - }) - ), - refresh: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request refreshes the relevant shards before retrieving the document.\nSetting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).', - }) - ), - routing: z.optional(types_routing), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_exclude_vectors: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Whether vectors should be excluded from _source', - }) - ), - _source_includes: z.optional(types_fields), - stored_fields: z.optional(types_fields), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_index_name, + id: types_id + }), + query: z.optional(z.object({ + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nBy default, the operation is randomized between the shard replicas.\n\nIf it is set to `_local`, the operation will prefer to be run on a local allocated shard when possible.\nIf it is set to a custom value, the value is used to guarantee that the same shards will be used for the same custom value.\nThis can help with "jumping values" when hitting different shards in different refresh states.\nA sample value can be something like the web session ID or the user name.' + })), + realtime: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request is real-time as opposed to near-real-time.' + })), + refresh: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request refreshes the relevant shards before retrieving the document.\nSetting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).' + })), + routing: z.optional(types_routing), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_exclude_vectors: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether vectors should be excluded from _source' + })), + _source_includes: z.optional(types_fields), + stored_fields: z.optional(types_fields), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type) + })) }); export const get_response = global_get_get_result; export const exists_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_index_name, - id: types_id, - }), - query: z.optional( - z.object({ - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nBy default, the operation is randomized between the shard replicas.\n\nIf it is set to `_local`, the operation will prefer to be run on a local allocated shard when possible.\nIf it is set to a custom value, the value is used to guarantee that the same shards will be used for the same custom value.\nThis can help with "jumping values" when hitting different shards in different refresh states.\nA sample value can be something like the web session ID or the user name.', - }) - ), - realtime: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request is real-time as opposed to near-real-time.', - }) - ), - refresh: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request refreshes the relevant shards before retrieving the document.\nSetting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).', - }) - ), - routing: z.optional(types_routing), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - stored_fields: z.optional(types_fields), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_index_name, + id: types_id + }), + query: z.optional(z.object({ + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nBy default, the operation is randomized between the shard replicas.\n\nIf it is set to `_local`, the operation will prefer to be run on a local allocated shard when possible.\nIf it is set to a custom value, the value is used to guarantee that the same shards will be used for the same custom value.\nThis can help with "jumping values" when hitting different shards in different refresh states.\nA sample value can be something like the web session ID or the user name.' + })), + realtime: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request is real-time as opposed to near-real-time.' + })), + refresh: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request refreshes the relevant shards before retrieving the document.\nSetting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).' + })), + routing: z.optional(types_routing), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields), + stored_fields: z.optional(types_fields), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type) + })) }); export const index1_request = z.object({ - body: index, - path: z.object({ - index: types_index_name, - id: types_id, - }), - query: z.optional( - z.object({ - if_primary_term: z.optional( - z.number().register(z.globalRegistry, { - description: 'Only perform the operation if the document has this primary term.', - }) - ), - if_seq_no: z.optional(types_sequence_number), - include_source_on_error: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'True or false if to include the document source in the error message in case of parsing errors.', - }) - ), - op_type: z.optional(types_op_type), - pipeline: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.\nIf a final pipeline is configured it will always run, regardless of the value of this parameter.', - }) - ), - refresh: z.optional(types_refresh), - routing: z.optional(types_routing), - timeout: z.optional(types_duration), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - require_alias: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the destination must be an index alias.', - }) - ), - require_data_stream: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `true`, the request's actions must target a data stream (existing or to be created).", - }) - ), - }) - ), + body: index, + path: z.object({ + index: types_index_name, + id: types_id + }), + query: z.optional(z.object({ + if_primary_term: z.optional(z.number().register(z.globalRegistry, { + description: 'Only perform the operation if the document has this primary term.' + })), + if_seq_no: z.optional(types_sequence_number), + include_source_on_error: z.optional(z.boolean().register(z.globalRegistry, { + description: 'True or false if to include the document source in the error message in case of parsing errors.' + })), + op_type: z.optional(types_op_type), + pipeline: z.optional(z.string().register(z.globalRegistry, { + description: 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.\nIf a final pipeline is configured it will always run, regardless of the value of this parameter.' + })), + refresh: z.optional(types_refresh), + routing: z.optional(types_routing), + timeout: z.optional(types_duration), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type), + wait_for_active_shards: z.optional(types_wait_for_active_shards), + require_alias: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the destination must be an index alias.' + })), + require_data_stream: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request\'s actions must target a data stream (existing or to be created).' + })) + })) }); export const index1_response = types_write_response_base; export const index_request = z.object({ - body: index, - path: z.object({ - index: types_index_name, - id: types_id, - }), - query: z.optional( - z.object({ - if_primary_term: z.optional( - z.number().register(z.globalRegistry, { - description: 'Only perform the operation if the document has this primary term.', - }) - ), - if_seq_no: z.optional(types_sequence_number), - include_source_on_error: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'True or false if to include the document source in the error message in case of parsing errors.', - }) - ), - op_type: z.optional(types_op_type), - pipeline: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.\nIf a final pipeline is configured it will always run, regardless of the value of this parameter.', - }) - ), - refresh: z.optional(types_refresh), - routing: z.optional(types_routing), - timeout: z.optional(types_duration), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - require_alias: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the destination must be an index alias.', - }) - ), - require_data_stream: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `true`, the request's actions must target a data stream (existing or to be created).", - }) - ), - }) - ), + body: index, + path: z.object({ + index: types_index_name, + id: types_id + }), + query: z.optional(z.object({ + if_primary_term: z.optional(z.number().register(z.globalRegistry, { + description: 'Only perform the operation if the document has this primary term.' + })), + if_seq_no: z.optional(types_sequence_number), + include_source_on_error: z.optional(z.boolean().register(z.globalRegistry, { + description: 'True or false if to include the document source in the error message in case of parsing errors.' + })), + op_type: z.optional(types_op_type), + pipeline: z.optional(z.string().register(z.globalRegistry, { + description: 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.\nIf a final pipeline is configured it will always run, regardless of the value of this parameter.' + })), + refresh: z.optional(types_refresh), + routing: z.optional(types_routing), + timeout: z.optional(types_duration), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type), + wait_for_active_shards: z.optional(types_wait_for_active_shards), + require_alias: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the destination must be an index alias.' + })), + require_data_stream: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request\'s actions must target a data stream (existing or to be created).' + })) + })) }); export const index_response = types_write_response_base; export const delete_by_query_rethrottle_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - task_id: types_task_id, - }), - query: z.object({ - requests_per_second: z.number().register(z.globalRegistry, { - description: - 'The throttle for this request in sub-requests per second.\nTo disable throttling, set it to `-1`.', + body: z.optional(z.never()), + path: z.object({ + task_id: types_task_id }), - }), + query: z.object({ + requests_per_second: z.number().register(z.globalRegistry, { + description: 'The throttle for this request in sub-requests per second.\nTo disable throttling, set it to `-1`.' + }) + }) }); export const delete_by_query_rethrottle_response = tasks_types_task_list_response_base; export const delete_script_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const delete_script_response = types_acknowledged_response_base; export const enrich_delete_policy_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const enrich_delete_policy_response = types_acknowledged_response_base; export const enrich_execute_policy_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request blocks other enrich policy execution requests until complete.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request blocks other enrich policy execution requests until complete.' + })) + })) }); export const enrich_execute_policy_response = z.object({ - status: z.optional(enrich_execute_policy_execute_enrich_policy_status), - task: z.optional(types_task_id), + status: z.optional(enrich_execute_policy_execute_enrich_policy_status), + task: z.optional(types_task_id) }); export const enrich_stats_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const enrich_stats_response = z.object({ - coordinator_stats: z.array(enrich_stats_coordinator_stats).register(z.globalRegistry, { - description: - 'Objects containing information about each coordinating ingest node for configured enrich processors.', - }), - executing_policies: z.array(enrich_stats_executing_policy).register(z.globalRegistry, { - description: - 'Objects containing information about each enrich policy that is currently executing.', - }), - cache_stats: z.optional( - z.array(enrich_stats_cache_stats).register(z.globalRegistry, { - description: - 'Objects containing information about the enrich cache stats on each ingest node.', - }) - ), + coordinator_stats: z.array(enrich_stats_coordinator_stats).register(z.globalRegistry, { + description: 'Objects containing information about each coordinating ingest node for configured enrich processors.' + }), + executing_policies: z.array(enrich_stats_executing_policy).register(z.globalRegistry, { + description: 'Objects containing information about each enrich policy that is currently executing.' + }), + cache_stats: z.optional(z.array(enrich_stats_cache_stats).register(z.globalRegistry, { + description: 'Objects containing information about the enrich cache stats on each ingest node.' + })) }); export const eql_delete_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const eql_delete_response = types_acknowledged_response_base; export const eql_get_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - keep_alive: z.optional(types_duration), - wait_for_completion_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + keep_alive: z.optional(types_duration), + wait_for_completion_timeout: z.optional(types_duration) + })) }); export const eql_get_response = eql_types_eql_search_response_base; export const eql_get_status_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const eql_get_status_response = z.object({ - id: types_id, - is_partial: z.boolean().register(z.globalRegistry, { - description: - 'If true, the search request is still executing. If false, the search is completed.', - }), - is_running: z.boolean().register(z.globalRegistry, { - description: - 'If true, the response does not contain complete search results. This could be because either the search is still running (is_running status is false), or because it is already completed (is_running status is true) and results are partial due to failures or timeouts.', - }), - start_time_in_millis: z.optional(types_epoch_time_unit_millis), - expiration_time_in_millis: z.optional(types_epoch_time_unit_millis), - completion_status: z.optional( - z.number().register(z.globalRegistry, { - description: 'For a completed search shows the http status code of the completed search.', - }) - ), + id: types_id, + is_partial: z.boolean().register(z.globalRegistry, { + description: 'If true, the search request is still executing. If false, the search is completed.' + }), + is_running: z.boolean().register(z.globalRegistry, { + description: 'If true, the response does not contain complete search results. This could be because either the search is still running (is_running status is false), or because it is already completed (is_running status is true) and results are partial due to failures or timeouts.' + }), + start_time_in_millis: z.optional(types_epoch_time_unit_millis), + expiration_time_in_millis: z.optional(types_epoch_time_unit_millis), + completion_status: z.optional(z.number().register(z.globalRegistry, { + description: 'For a completed search shows the http status code of the completed search.' + })) }); export const esql_async_query_delete_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const esql_async_query_delete_response = types_acknowledged_response_base; export const esql_async_query_get_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - drop_null_columns: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether columns that are entirely `null` will be removed from the `columns` and `values` portion of the results.\nIf `true`, the response will include an extra section under the name `all_columns` which has the name of all the columns.', - }) - ), - format: z.optional(esql_types_esql_format), - keep_alive: z.optional(types_duration), - wait_for_completion_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + drop_null_columns: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether columns that are entirely `null` will be removed from the `columns` and `values` portion of the results.\nIf `true`, the response will include an extra section under the name `all_columns` which has the name of all the columns.' + })), + format: z.optional(esql_types_esql_format), + keep_alive: z.optional(types_duration), + wait_for_completion_timeout: z.optional(types_duration) + })) }); export const esql_async_query_get_response = esql_types_async_esql_result; export const esql_async_query_stop_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - drop_null_columns: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether columns that are entirely `null` will be removed from the `columns` and `values` portion of the results.\nIf `true`, the response will include an extra section under the name `all_columns` which has the name of all the columns.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + drop_null_columns: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether columns that are entirely `null` will be removed from the `columns` and `values` portion of the results.\nIf `true`, the response will include an extra section under the name `all_columns` which has the name of all the columns.' + })) + })) }); export const esql_async_query_stop_response = esql_types_esql_result; export const esql_get_query_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const esql_get_query_response = z.object({ - id: z.number(), - node: types_node_id, - start_time_millis: z.number(), - running_time_nanos: z.number(), - query: z.string(), - coordinating_node: types_node_id, - data_nodes: z.array(types_node_id), + id: z.number(), + node: types_node_id, + start_time_millis: z.number(), + running_time_nanos: z.number(), + query: z.string(), + coordinating_node: types_node_id, + data_nodes: z.array(types_node_id) }); export const esql_list_queries_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const esql_list_queries_response = z.object({ - queries: z.record(z.string(), esql_list_queries_body), + queries: z.record(z.string(), esql_list_queries_body) }); export const get_source_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_index_name, - id: types_id, - }), - query: z.optional( - z.object({ - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nBy default, the operation is randomized between the shard replicas.', - }) - ), - realtime: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request is real-time as opposed to near-real-time.', - }) - ), - refresh: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request refreshes the relevant shards before retrieving the document.\nSetting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).', - }) - ), - routing: z.optional(types_routing), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_index_name, + id: types_id + }), + query: z.optional(z.object({ + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nBy default, the operation is randomized between the shard replicas.' + })), + realtime: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request is real-time as opposed to near-real-time.' + })), + refresh: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request refreshes the relevant shards before retrieving the document.\nSetting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).' + })), + routing: z.optional(types_routing), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type) + })) }); export const get_source_response = z.record(z.string(), z.unknown()); export const exists_source_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_index_name, - id: types_id, - }), - query: z.optional( - z.object({ - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nBy default, the operation is randomized between the shard replicas.', - }) - ), - realtime: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request is real-time as opposed to near-real-time.', - }) - ), - refresh: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request refreshes the relevant shards before retrieving the document.\nSetting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).', - }) - ), - routing: z.optional(types_routing), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_index_name, + id: types_id + }), + query: z.optional(z.object({ + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nBy default, the operation is randomized between the shard replicas.' + })), + realtime: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request is real-time as opposed to near-real-time.' + })), + refresh: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request refreshes the relevant shards before retrieving the document.\nSetting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).' + })), + routing: z.optional(types_routing), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type) + })) }); export const features_get_features_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const features_get_features_response = z.object({ - features: z.array(features_types_feature), + features: z.array(features_types_feature) }); export const features_reset_features_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const features_reset_features_response = z.object({ - features: z.array(features_types_feature), + features: z.array(features_types_feature) }); export const fleet_global_checkpoints_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: z.union([types_index_name, types_index_alias]), - }), - query: z.optional( - z.object({ - wait_for_advance: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'A boolean value which controls whether to wait (until the timeout) for the global checkpoints\nto advance past the provided `checkpoints`.', - }) - ), - wait_for_index: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'A boolean value which controls whether to wait (until the timeout) for the target index to exist\nand all primary shards be active. Can only be true when `wait_for_advance` is true.', - }) - ), - checkpoints: z.optional( - z.array(fleet_types_checkpoint).register(z.globalRegistry, { - description: - 'A comma separated list of previous global checkpoints. When used in combination with `wait_for_advance`,\nthe API will only return once the global checkpoints advances past the checkpoints. Providing an empty list\nwill cause Elasticsearch to immediately return the current global checkpoints.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: z.union([ + types_index_name, + types_index_alias + ]) + }), + query: z.optional(z.object({ + wait_for_advance: z.optional(z.boolean().register(z.globalRegistry, { + description: 'A boolean value which controls whether to wait (until the timeout) for the global checkpoints\nto advance past the provided `checkpoints`.' + })), + wait_for_index: z.optional(z.boolean().register(z.globalRegistry, { + description: 'A boolean value which controls whether to wait (until the timeout) for the target index to exist\nand all primary shards be active. Can only be true when `wait_for_advance` is true.' + })), + checkpoints: z.optional(z.array(fleet_types_checkpoint).register(z.globalRegistry, { + description: 'A comma separated list of previous global checkpoints. When used in combination with `wait_for_advance`,\nthe API will only return once the global checkpoints advances past the checkpoints. Providing an empty list\nwill cause Elasticsearch to immediately return the current global checkpoints.' + })), + timeout: z.optional(types_duration) + })) }); export const fleet_global_checkpoints_response = z.object({ - global_checkpoints: z.array(fleet_types_checkpoint), - timed_out: z.boolean(), + global_checkpoints: z.array(fleet_types_checkpoint), + timed_out: z.boolean() }); export const get_script_context_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const get_script_context_response = z.object({ - contexts: z.array(global_get_script_context_context), + contexts: z.array(global_get_script_context_context) }); export const get_script_languages_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const get_script_languages_response = z.object({ - language_contexts: z.array(global_get_script_languages_language_context), - types_allowed: z.array(z.string()), + language_contexts: z.array(global_get_script_languages_language_context), + types_allowed: z.array(z.string()) }); export const health_report_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - verbose: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Opt-in for more information about the health of the system.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Limit the number of affected resources the health report API returns.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + timeout: z.optional(types_duration), + verbose: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Opt-in for more information about the health of the system.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Limit the number of affected resources the health report API returns.' + })) + })) }); export const health_report_response = z.object({ - cluster_name: z.string(), - indicators: global_health_report_indicators, - status: z.optional(global_health_report_indicator_health_status), + cluster_name: z.string(), + indicators: global_health_report_indicators, + status: z.optional(global_health_report_indicator_health_status) }); export const health_report1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - feature: z.union([z.string(), z.array(z.string())]), - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - verbose: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Opt-in for more information about the health of the system.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Limit the number of affected resources the health report API returns.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + feature: z.union([ + z.string(), + z.array(z.string()) + ]) + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration), + verbose: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Opt-in for more information about the health of the system.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Limit the number of affected resources the health report API returns.' + })) + })) }); export const health_report1_response = z.object({ - cluster_name: z.string(), - indicators: global_health_report_indicators, - status: z.optional(global_health_report_indicator_health_status), + cluster_name: z.string(), + indicators: global_health_report_indicators, + status: z.optional(global_health_report_indicator_health_status) }); export const ilm_delete_lifecycle_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - policy: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + policy: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const ilm_delete_lifecycle_response = types_acknowledged_response_base; export const ilm_get_lifecycle_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - policy: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + policy: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const ilm_get_lifecycle_response = z.record(z.string(), ilm_get_lifecycle_lifecycle); export const ilm_put_lifecycle_request = z.object({ - body: z.object({ - policy: z.optional(ilm_types_policy), - }), - path: z.object({ - policy: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + policy: z.optional(ilm_types_policy) + }), + path: z.object({ + policy: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const ilm_put_lifecycle_response = types_acknowledged_response_base; export const ilm_explain_lifecycle_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - only_errors: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Filters the returned indices to only indices that are managed by ILM and are in an error state, either due to an encountering an error while executing the policy, or attempting to use a policy that does not exist.', - }) - ), - only_managed: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Filters the returned indices to only indices that are managed by ILM.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + only_errors: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Filters the returned indices to only indices that are managed by ILM and are in an error state, either due to an encountering an error while executing the policy, or attempting to use a policy that does not exist.' + })), + only_managed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Filters the returned indices to only indices that are managed by ILM.' + })), + master_timeout: z.optional(types_duration) + })) }); export const ilm_explain_lifecycle_response = z.object({ - indices: z.record(z.string(), ilm_explain_lifecycle_lifecycle_explain), + indices: z.record(z.string(), ilm_explain_lifecycle_lifecycle_explain) }); export const ilm_get_lifecycle1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const ilm_get_lifecycle1_response = z.record(z.string(), ilm_get_lifecycle_lifecycle); export const ilm_get_status_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const ilm_get_status_response = z.object({ - operation_mode: types_lifecycle_operation_mode, + operation_mode: types_lifecycle_operation_mode }); export const ilm_migrate_to_data_tiers_request = z.object({ - body: z.optional( - z.object({ - legacy_template_to_delete: z.optional(z.string()), - node_attribute: z.optional(z.string()), - }) - ), - path: z.optional(z.never()), - query: z.optional( - z.object({ - dry_run: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, simulates the migration from node attributes based allocation filters to data tiers, but does not perform the migration.\nThis provides a way to retrieve the indices and ILM policies that need to be migrated.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.object({ + legacy_template_to_delete: z.optional(z.string()), + node_attribute: z.optional(z.string()) + })), + path: z.optional(z.never()), + query: z.optional(z.object({ + dry_run: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, simulates the migration from node attributes based allocation filters to data tiers, but does not perform the migration.\nThis provides a way to retrieve the indices and ILM policies that need to be migrated.' + })), + master_timeout: z.optional(types_duration) + })) }); export const ilm_migrate_to_data_tiers_response = z.object({ - dry_run: z.boolean(), - removed_legacy_template: z.string().register(z.globalRegistry, { - description: - 'The name of the legacy index template that was deleted.\nThis information is missing if no legacy index templates were deleted.', - }), - migrated_ilm_policies: z.array(z.string()).register(z.globalRegistry, { - description: 'The ILM policies that were updated.', - }), - migrated_indices: types_indices, - migrated_legacy_templates: z.array(z.string()).register(z.globalRegistry, { - description: - 'The legacy index templates that were updated to not contain custom routing settings for the provided data attribute.', - }), - migrated_composable_templates: z.array(z.string()).register(z.globalRegistry, { - description: - 'The composable index templates that were updated to not contain custom routing settings for the provided data attribute.', - }), - migrated_component_templates: z.array(z.string()).register(z.globalRegistry, { - description: - 'The component templates that were updated to not contain custom routing settings for the provided data attribute.', - }), + dry_run: z.boolean(), + removed_legacy_template: z.string().register(z.globalRegistry, { + description: 'The name of the legacy index template that was deleted.\nThis information is missing if no legacy index templates were deleted.' + }), + migrated_ilm_policies: z.array(z.string()).register(z.globalRegistry, { + description: 'The ILM policies that were updated.' + }), + migrated_indices: types_indices, + migrated_legacy_templates: z.array(z.string()).register(z.globalRegistry, { + description: 'The legacy index templates that were updated to not contain custom routing settings for the provided data attribute.' + }), + migrated_composable_templates: z.array(z.string()).register(z.globalRegistry, { + description: 'The composable index templates that were updated to not contain custom routing settings for the provided data attribute.' + }), + migrated_component_templates: z.array(z.string()).register(z.globalRegistry, { + description: 'The component templates that were updated to not contain custom routing settings for the provided data attribute.' + }) }); export const ilm_move_to_step_request = z.object({ - body: z.object({ - current_step: ilm_move_to_step_step_key, - next_step: ilm_move_to_step_step_key, - }), - path: z.object({ - index: types_index_name, - }), - query: z.optional(z.never()), + body: z.object({ + current_step: ilm_move_to_step_step_key, + next_step: ilm_move_to_step_step_key + }), + path: z.object({ + index: types_index_name + }), + query: z.optional(z.never()) }); export const ilm_move_to_step_response = types_acknowledged_response_base; export const ilm_remove_policy_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_index_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + index: types_index_name + }), + query: z.optional(z.never()) }); export const ilm_remove_policy_response = z.object({ - failed_indexes: z.array(types_index_name), - has_failures: z.boolean(), + failed_indexes: z.array(types_index_name), + has_failures: z.boolean() }); export const ilm_retry_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_index_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + index: types_index_name + }), + query: z.optional(z.never()) }); export const ilm_retry_response = types_acknowledged_response_base; export const ilm_start_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const ilm_start_response = types_acknowledged_response_base; export const ilm_stop_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); - -export const ilm_stop_response = types_acknowledged_response_base; - -export const index2_request = z.object({ - body: index, - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - if_primary_term: z.optional( - z.number().register(z.globalRegistry, { - description: 'Only perform the operation if the document has this primary term.', - }) - ), - if_seq_no: z.optional(types_sequence_number), - include_source_on_error: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'True or false if to include the document source in the error message in case of parsing errors.', - }) - ), - op_type: z.optional(types_op_type), - pipeline: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.\nIf a final pipeline is configured it will always run, regardless of the value of this parameter.', - }) - ), - refresh: z.optional(types_refresh), - routing: z.optional(types_routing), - timeout: z.optional(types_duration), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - require_alias: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the destination must be an index alias.', - }) - ), - require_data_stream: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `true`, the request's actions must target a data stream (existing or to be created).", - }) - ), - }) - ), + +export const ilm_stop_response = types_acknowledged_response_base; + +export const index2_request = z.object({ + body: index, + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + if_primary_term: z.optional(z.number().register(z.globalRegistry, { + description: 'Only perform the operation if the document has this primary term.' + })), + if_seq_no: z.optional(types_sequence_number), + include_source_on_error: z.optional(z.boolean().register(z.globalRegistry, { + description: 'True or false if to include the document source in the error message in case of parsing errors.' + })), + op_type: z.optional(types_op_type), + pipeline: z.optional(z.string().register(z.globalRegistry, { + description: 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.\nIf a final pipeline is configured it will always run, regardless of the value of this parameter.' + })), + refresh: z.optional(types_refresh), + routing: z.optional(types_routing), + timeout: z.optional(types_duration), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type), + wait_for_active_shards: z.optional(types_wait_for_active_shards), + require_alias: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the destination must be an index alias.' + })), + require_data_stream: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request\'s actions must target a data stream (existing or to be created).' + })) + })) }); export const index2_response = types_write_response_base; export const indices_remove_block_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - block: indices_types_indices_block_options, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices, + block: indices_types_indices_block_options + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_remove_block_response = z.object({ - acknowledged: z.boolean(), - indices: z.array(indices_remove_block_remove_indices_block_status), + acknowledged: z.boolean(), + indices: z.array(indices_remove_block_remove_indices_block_status) }); export const indices_add_block_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - block: indices_types_indices_block_options, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices, + block: indices_types_indices_block_options + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_add_block_response = z.object({ - acknowledged: z.boolean(), - shards_acknowledged: z.boolean(), - indices: z.array(indices_add_block_add_indices_block_status), + acknowledged: z.boolean(), + shards_acknowledged: z.boolean(), + indices: z.array(indices_add_block_add_indices_block_status) }); export const indices_cancel_migrate_reindex_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.never()) }); export const indices_cancel_migrate_reindex_response = types_acknowledged_response_base; export const indices_clear_cache_request2 = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - index: z.optional(types_indices), - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - fielddata: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, clears the fields cache.\nUse the `fields` parameter to clear the cache of specific fields only.', - }) - ), - fields: z.optional(types_fields), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - query: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, clears the query cache.', - }) - ), - request: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, clears the request cache.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + index: z.optional(types_indices), + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + fielddata: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, clears the fields cache.\nUse the `fields` parameter to clear the cache of specific fields only.' + })), + fields: z.optional(types_fields), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + query: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, clears the query cache.' + })), + request: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, clears the request cache.' + })) + })) }); export const indices_clear_cache_response = types_shards_operation_response_base; export const indices_clear_cache1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - index: z.optional(types_indices), - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - fielddata: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, clears the fields cache.\nUse the `fields` parameter to clear the cache of specific fields only.', - }) - ), - fields: z.optional(types_fields), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - query: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, clears the query cache.', - }) - ), - request: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, clears the request cache.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + index: z.optional(types_indices), + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + fielddata: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, clears the fields cache.\nUse the `fields` parameter to clear the cache of specific fields only.' + })), + fields: z.optional(types_fields), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + query: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, clears the query cache.' + })), + request: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, clears the request cache.' + })) + })) }); export const indices_clear_cache1_response = types_shards_operation_response_base; export const indices_close_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards) + })) }); export const indices_close_response = z.object({ - acknowledged: z.boolean(), - indices: z.record(z.string(), indices_close_close_index_result), - shards_acknowledged: z.boolean(), + acknowledged: z.boolean(), + indices: z.record(z.string(), indices_close_close_index_result), + shards_acknowledged: z.boolean() }); export const indices_delete_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_delete_response = types_indices_response_base; export const indices_exists_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, return all default settings in the response.', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request retrieves information from the local node only.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns settings in flat format.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, return all default settings in the response.' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request retrieves information from the local node only.' + })) + })) }); export const indices_delete_data_stream_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_data_stream_names, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - expand_wildcards: z.optional(types_expand_wildcards), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_data_stream_names + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + expand_wildcards: z.optional(types_expand_wildcards) + })) }); export const indices_delete_data_stream_response = types_acknowledged_response_base; export const indices_create_data_stream_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_data_stream_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_data_stream_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_create_data_stream_response = types_acknowledged_response_base; export const indices_data_streams_stats_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + expand_wildcards: z.optional(types_expand_wildcards) + })) }); export const indices_data_streams_stats_response = z.object({ - _shards: types_shard_statistics, - backing_indices: z.number().register(z.globalRegistry, { - description: 'Total number of backing indices for the selected data streams.', - }), - data_stream_count: z.number().register(z.globalRegistry, { - description: 'Total number of selected data streams.', - }), - data_streams: z - .array(indices_data_streams_stats_data_streams_stats_item) - .register(z.globalRegistry, { - description: 'Contains statistics for the selected data streams.', - }), - total_store_sizes: z.optional(types_byte_size), - total_store_size_bytes: z.number().register(z.globalRegistry, { - description: 'Total size, in bytes, of all shards for the selected data streams.', - }), + _shards: types_shard_statistics, + backing_indices: z.number().register(z.globalRegistry, { + description: 'Total number of backing indices for the selected data streams.' + }), + data_stream_count: z.number().register(z.globalRegistry, { + description: 'Total number of selected data streams.' + }), + data_streams: z.array(indices_data_streams_stats_data_streams_stats_item).register(z.globalRegistry, { + description: 'Contains statistics for the selected data streams.' + }), + total_store_sizes: z.optional(types_byte_size), + total_store_size_bytes: z.number().register(z.globalRegistry, { + description: 'Total size, in bytes, of all shards for the selected data streams.' + }) }); export const indices_data_streams_stats1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_indices, - }), - query: z.optional( - z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_indices + }), + query: z.optional(z.object({ + expand_wildcards: z.optional(types_expand_wildcards) + })) }); export const indices_data_streams_stats1_response = z.object({ - _shards: types_shard_statistics, - backing_indices: z.number().register(z.globalRegistry, { - description: 'Total number of backing indices for the selected data streams.', - }), - data_stream_count: z.number().register(z.globalRegistry, { - description: 'Total number of selected data streams.', - }), - data_streams: z - .array(indices_data_streams_stats_data_streams_stats_item) - .register(z.globalRegistry, { - description: 'Contains statistics for the selected data streams.', - }), - total_store_sizes: z.optional(types_byte_size), - total_store_size_bytes: z.number().register(z.globalRegistry, { - description: 'Total size, in bytes, of all shards for the selected data streams.', - }), + _shards: types_shard_statistics, + backing_indices: z.number().register(z.globalRegistry, { + description: 'Total number of backing indices for the selected data streams.' + }), + data_stream_count: z.number().register(z.globalRegistry, { + description: 'Total number of selected data streams.' + }), + data_streams: z.array(indices_data_streams_stats_data_streams_stats_item).register(z.globalRegistry, { + description: 'Contains statistics for the selected data streams.' + }), + total_store_sizes: z.optional(types_byte_size), + total_store_size_bytes: z.number().register(z.globalRegistry, { + description: 'Total size, in bytes, of all shards for the selected data streams.' + }) }); export const indices_delete_alias_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - name: types_names, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices, + name: types_names + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_delete_alias_response = indices_delete_alias_indices_aliases_response_body; export const indices_exists_alias1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - name: types_names, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, requests that include a missing data stream or index in the target indices or data streams return an error.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices, + name: types_names + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, requests that include a missing data stream or index in the target indices or data streams return an error.' + })), + master_timeout: z.optional(types_duration) + })) }); export const indices_delete_alias1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - name: types_names, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices, + name: types_names + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_delete_alias1_response = indices_delete_alias_indices_aliases_response_body; export const indices_delete_data_lifecycle_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_data_stream_names, - }), - query: z.optional( - z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_data_stream_names + }), + query: z.optional(z.object({ + expand_wildcards: z.optional(types_expand_wildcards), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_delete_data_lifecycle_response = types_acknowledged_response_base; export const indices_get_data_lifecycle_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_data_stream_names, - }), - query: z.optional( - z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, return all default settings in the response.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_data_stream_names + }), + query: z.optional(z.object({ + expand_wildcards: z.optional(types_expand_wildcards), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, return all default settings in the response.' + })), + master_timeout: z.optional(types_duration) + })) }); export const indices_get_data_lifecycle_response = z.object({ - data_streams: z.array(indices_get_data_lifecycle_data_stream_with_lifecycle), + data_streams: z.array(indices_get_data_lifecycle_data_stream_with_lifecycle) }); export const indices_put_data_lifecycle_request = z.object({ - body: z.object({ - data_retention: z.optional(types_duration), - downsampling: z.optional( - z.array(indices_types_downsampling_round).register(z.globalRegistry, { - description: - 'The downsampling configuration to execute for the managed backing index after rollover.', - }) - ), - enabled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle\nthat's disabled (enabled: `false`) will have no effect on the data stream.", - }) - ), - }), - path: z.object({ - name: types_data_stream_names, - }), - query: z.optional( - z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + data_retention: z.optional(types_duration), + downsampling: z.optional(z.array(indices_types_downsampling_round).register(z.globalRegistry, { + description: 'The downsampling configuration to execute for the managed backing index after rollover.' + })), + downsampling_method: z.optional(indices_types_sampling_method), + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle\nthat\'s disabled (enabled: `false`) will have no effect on the data stream.' + })) + }), + path: z.object({ + name: types_data_stream_names + }), + query: z.optional(z.object({ + expand_wildcards: z.optional(types_expand_wildcards), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_put_data_lifecycle_response = types_acknowledged_response_base; export const indices_delete_data_stream_options_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_data_stream_names, - }), - query: z.optional( - z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_data_stream_names + }), + query: z.optional(z.object({ + expand_wildcards: z.optional(types_expand_wildcards), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_delete_data_stream_options_response = types_acknowledged_response_base; export const indices_get_data_stream_options_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_data_stream_names, - }), - query: z.optional( - z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_data_stream_names + }), + query: z.optional(z.object({ + expand_wildcards: z.optional(types_expand_wildcards), + master_timeout: z.optional(types_duration) + })) }); export const indices_get_data_stream_options_response = z.object({ - data_streams: z.array(indices_get_data_stream_options_data_stream_with_options), + data_streams: z.array(indices_get_data_stream_options_data_stream_with_options) }); export const indices_put_data_stream_options_request = z.object({ - body: z.object({ - failure_store: z.optional(indices_types_data_stream_failure_store), - }), - path: z.object({ - name: types_data_stream_names, - }), - query: z.optional( - z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + failure_store: z.optional(indices_types_data_stream_failure_store) + }), + path: z.object({ + name: types_data_stream_names + }), + query: z.optional(z.object({ + expand_wildcards: z.optional(types_expand_wildcards), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_put_data_stream_options_response = types_acknowledged_response_base; export const indices_delete_index_template_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_names, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_names + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_delete_index_template_response = types_acknowledged_response_base; export const indices_exists_index_template_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.', - }) - ), - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, returns settings in flat format.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.' + })), + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns settings in flat format.' + })), + master_timeout: z.optional(types_duration) + })) }); export const indices_delete_template_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_delete_template_response = types_acknowledged_response_base; export const indices_exists_template_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_names, - }), - query: z.optional( - z.object({ - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Indicates whether to use a flat format for the response.', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Indicates whether to get information from the local node only.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_names + }), + query: z.optional(z.object({ + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether to use a flat format for the response.' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether to get information from the local node only.' + })), + master_timeout: z.optional(types_duration) + })) }); export const indices_disk_usage_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - flush: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the API performs a flush before analysis.\nIf `false`, the response may not include uncommitted data.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, missing or closed indices are not included in the response.', - }) - ), - run_expensive_tasks: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Analyzing field disk usage is resource-intensive.\nTo use the API, this parameter must be set to `true`.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + flush: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the API performs a flush before analysis.\nIf `false`, the response may not include uncommitted data.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, missing or closed indices are not included in the response.' + })), + run_expensive_tasks: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Analyzing field disk usage is resource-intensive.\nTo use the API, this parameter must be set to `true`.' + })) + })) }); export const indices_disk_usage_response = z.record(z.string(), z.unknown()); export const indices_downsample_request = z.object({ - body: indices_types_downsample_config, - path: z.object({ - index: types_index_name, - target_index: types_index_name, - }), - query: z.optional(z.never()), + body: indices_types_downsample_config, + path: z.object({ + index: types_index_name, + target_index: types_index_name + }), + query: z.optional(z.never()) }); export const indices_downsample_response = z.record(z.string(), z.unknown()); export const indices_exists_alias_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_names, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, requests that include a missing data stream or index in the target indices or data streams return an error.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_names + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, requests that include a missing data stream or index in the target indices or data streams return an error.' + })), + master_timeout: z.optional(types_duration) + })) }); export const indices_explain_data_lifecycle_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "indicates if the API should return the default values the system uses for the index's lifecycle", - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates if the API should return the default values the system uses for the index\'s lifecycle' + })), + master_timeout: z.optional(types_duration) + })) }); export const indices_explain_data_lifecycle_response = z.object({ - indices: z.record(z.string(), indices_explain_data_lifecycle_data_stream_lifecycle_explain), + indices: z.record(z.string(), indices_explain_data_lifecycle_data_stream_lifecycle_explain) }); export const indices_field_usage_stats_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, missing or closed indices are not included in the response.', - }) - ), - fields: z.optional(types_fields), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, missing or closed indices are not included in the response.' + })), + fields: z.optional(types_fields) + })) }); export const indices_field_usage_stats_response = indices_field_usage_stats_fields_usage_body; export const indices_flush1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request forces a flush even if there are no changes to commit to the index.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - wait_if_ongoing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the flush operation blocks until execution when another flush operation is running.\nIf `false`, Elasticsearch returns an error if you request a flush when another flush operation is running.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request forces a flush even if there are no changes to commit to the index.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + wait_if_ongoing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the flush operation blocks until execution when another flush operation is running.\nIf `false`, Elasticsearch returns an error if you request a flush when another flush operation is running.' + })) + })) }); export const indices_flush1_response = types_shards_operation_response_base; export const indices_flush_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request forces a flush even if there are no changes to commit to the index.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - wait_if_ongoing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the flush operation blocks until execution when another flush operation is running.\nIf `false`, Elasticsearch returns an error if you request a flush when another flush operation is running.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request forces a flush even if there are no changes to commit to the index.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + wait_if_ongoing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the flush operation blocks until execution when another flush operation is running.\nIf `false`, Elasticsearch returns an error if you request a flush when another flush operation is running.' + })) + })) }); export const indices_flush_response = types_shards_operation_response_base; export const indices_flush3_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request forces a flush even if there are no changes to commit to the index.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - wait_if_ongoing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the flush operation blocks until execution when another flush operation is running.\nIf `false`, Elasticsearch returns an error if you request a flush when another flush operation is running.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request forces a flush even if there are no changes to commit to the index.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + wait_if_ongoing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the flush operation blocks until execution when another flush operation is running.\nIf `false`, Elasticsearch returns an error if you request a flush when another flush operation is running.' + })) + })) }); export const indices_flush3_response = types_shards_operation_response_base; export const indices_flush2_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request forces a flush even if there are no changes to commit to the index.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - wait_if_ongoing: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the flush operation blocks until execution when another flush operation is running.\nIf `false`, Elasticsearch returns an error if you request a flush when another flush operation is running.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request forces a flush even if there are no changes to commit to the index.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + wait_if_ongoing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the flush operation blocks until execution when another flush operation is running.\nIf `false`, Elasticsearch returns an error if you request a flush when another flush operation is running.' + })) + })) }); export const indices_flush2_response = types_shards_operation_response_base; export const indices_forcemerge_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - flush: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specify whether the index should be flushed after performing the operation (default: true)', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether specified concrete indices should be ignored when unavailable (missing or closed)', - }) - ), - max_num_segments: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of segments the index should be merged into (default: dynamic)', - }) - ), - only_expunge_deletes: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Specify whether the operation should only expunge deleted documents', - }) - ), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Should the request wait until the force merge is completed.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' + })), + expand_wildcards: z.optional(types_expand_wildcards), + flush: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether the index should be flushed after performing the operation' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether specified concrete indices should be ignored when unavailable (missing or closed)' + })), + max_num_segments: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of segments the index should be merged into (defayult: dynamic)' + })), + only_expunge_deletes: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether the operation should only expunge deleted documents' + })), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Should the request wait until the force merge is completed' + })) + })) }); export const indices_forcemerge_response = indices_forcemerge_types_force_merge_response_body; export const indices_forcemerge1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - flush: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specify whether the index should be flushed after performing the operation (default: true)', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether specified concrete indices should be ignored when unavailable (missing or closed)', - }) - ), - max_num_segments: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of segments the index should be merged into (default: dynamic)', - }) - ), - only_expunge_deletes: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Specify whether the operation should only expunge deleted documents', - }) - ), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Should the request wait until the force merge is completed.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' + })), + expand_wildcards: z.optional(types_expand_wildcards), + flush: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether the index should be flushed after performing the operation' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether specified concrete indices should be ignored when unavailable (missing or closed)' + })), + max_num_segments: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of segments the index should be merged into (defayult: dynamic)' + })), + only_expunge_deletes: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether the operation should only expunge deleted documents' + })), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Should the request wait until the force merge is completed' + })) + })) }); export const indices_forcemerge1_response = indices_forcemerge_types_force_merge_response_body; export const indices_get_data_lifecycle_stats_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const indices_get_data_lifecycle_stats_response = z.object({ - data_stream_count: z.number().register(z.globalRegistry, { - description: 'The count of data streams currently being managed by the data stream lifecycle.', - }), - data_streams: z - .array(indices_get_data_lifecycle_stats_data_stream_stats) - .register(z.globalRegistry, { - description: - 'Information about the data streams that are managed by the data stream lifecycle.', + data_stream_count: z.number().register(z.globalRegistry, { + description: 'The count of data streams currently being managed by the data stream lifecycle.' }), - last_run_duration_in_millis: z.optional(types_duration_value_unit_millis), - time_between_starts_in_millis: z.optional(types_duration_value_unit_millis), + data_streams: z.array(indices_get_data_lifecycle_stats_data_stream_stats).register(z.globalRegistry, { + description: 'Information about the data streams that are managed by the data stream lifecycle.' + }), + last_run_duration_in_millis: z.optional(types_duration_value_unit_millis), + time_between_starts_in_millis: z.optional(types_duration_value_unit_millis) }); export const indices_get_migrate_reindex_status_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.never()) }); export const indices_get_migrate_reindex_status_response = z.object({ - start_time: z.optional(types_date_time), - start_time_millis: types_epoch_time_unit_millis, - complete: z.boolean(), - total_indices_in_data_stream: z.number(), - total_indices_requiring_upgrade: z.number(), - successes: z.number(), - in_progress: z.array(indices_get_migrate_reindex_status_status_in_progress), - pending: z.number(), - errors: z.array(indices_get_migrate_reindex_status_status_error), - exception: z.optional(z.string()), + start_time: z.optional(types_date_time), + start_time_millis: types_epoch_time_unit_millis, + complete: z.boolean(), + total_indices_in_data_stream: z.number(), + total_indices_requiring_upgrade: z.number(), + successes: z.number(), + in_progress: z.array(indices_get_migrate_reindex_status_status_in_progress), + pending: z.number(), + errors: z.array(indices_get_migrate_reindex_status_status_error), + exception: z.optional(z.string()) }); export const indices_migrate_reindex_request = z.object({ - body: indices_migrate_reindex_migrate_reindex, - path: z.optional(z.never()), - query: z.optional(z.never()), + body: indices_migrate_reindex_migrate_reindex, + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const indices_migrate_reindex_response = types_acknowledged_response_base; export const indices_migrate_to_data_stream_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_index_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_index_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_migrate_to_data_stream_response = types_acknowledged_response_base; export const indices_modify_data_stream_request = z.object({ - body: z.object({ - actions: z.array(indices_modify_data_stream_action).register(z.globalRegistry, { - description: 'Actions to perform.', + body: z.object({ + actions: z.array(indices_modify_data_stream_action).register(z.globalRegistry, { + description: 'Actions to perform.' + }) }), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const indices_modify_data_stream_response = types_acknowledged_response_base; export const indices_open_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards) + })) }); export const indices_open_response = z.object({ - acknowledged: z.boolean(), - shards_acknowledged: z.boolean(), + acknowledged: z.boolean(), + shards_acknowledged: z.boolean() }); export const indices_promote_data_stream_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_index_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_index_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const indices_promote_data_stream_response = z.record(z.string(), z.unknown()); export const indices_recovery_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - active_only: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response only includes ongoing shard recoveries.', - }) - ), - detailed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes detailed information about shard recoveries.', - }) - ), - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + active_only: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response only includes ongoing shard recoveries.' + })), + detailed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes detailed information about shard recoveries.' + })), + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })) + })) }); export const indices_recovery_response = z.record(z.string(), indices_recovery_recovery_status); export const indices_recovery1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - active_only: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response only includes ongoing shard recoveries.', - }) - ), - detailed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes detailed information about shard recoveries.', - }) - ), - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + active_only: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response only includes ongoing shard recoveries.' + })), + detailed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes detailed information about shard recoveries.' + })), + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })) + })) }); export const indices_recovery1_response = z.record(z.string(), indices_recovery_recovery_status); export const indices_refresh1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })) + })) }); export const indices_refresh1_response = types_shards_operation_response_base; export const indices_refresh_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })) + })) }); export const indices_refresh_response = types_shards_operation_response_base; export const indices_refresh3_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })) + })) }); -export const indices_refresh3_response = types_shards_operation_response_base; - -export const indices_refresh2_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - }) - ), +export const indices_refresh3_response = types_shards_operation_response_base; + +export const indices_refresh2_request = z.object({ + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })) + })) }); export const indices_refresh2_response = types_shards_operation_response_base; export const indices_reload_search_analyzers_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether specified concrete indices should be ignored when unavailable (missing or closed)', - }) - ), - resource: z.optional( - z.string().register(z.globalRegistry, { - description: 'Changed resource to reload analyzers from if applicable', - }) - ), - }) - ), -}); - -export const indices_reload_search_analyzers_response = - indices_reload_search_analyzers_reload_result; + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether specified concrete indices should be ignored when unavailable (missing or closed)' + })), + resource: z.optional(z.string().register(z.globalRegistry, { + description: 'Changed resource to reload analyzers from if applicable' + })) + })) +}); + +export const indices_reload_search_analyzers_response = indices_reload_search_analyzers_reload_result; export const indices_reload_search_analyzers1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether specified concrete indices should be ignored when unavailable (missing or closed)', - }) - ), - resource: z.optional( - z.string().register(z.globalRegistry, { - description: 'Changed resource to reload analyzers from if applicable', - }) - ), - }) - ), -}); - -export const indices_reload_search_analyzers1_response = - indices_reload_search_analyzers_reload_result; + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether specified concrete indices should be ignored when unavailable (missing or closed)' + })), + resource: z.optional(z.string().register(z.globalRegistry, { + description: 'Changed resource to reload analyzers from if applicable' + })) + })) +}); + +export const indices_reload_search_analyzers1_response = indices_reload_search_analyzers_reload_result; export const indices_resolve_cluster_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing\nor closed indices. This behavior applies even if the request targets other open indices. For example, a request\ntargeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, concrete, expanded, or aliased indices are ignored when frozen.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if it targets a missing or closed index.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.', - }) - ), - timeout: z.optional(types_duration), - }) - ), -}); - -export const indices_resolve_cluster_response = z.record( - z.string(), - indices_resolve_cluster_resolve_cluster_info -); + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing\nor closed indices. This behavior applies even if the request targets other open indices. For example, a request\ntargeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, concrete, expanded, or aliased indices are ignored when frozen.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if it targets a missing or closed index.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.' + })), + timeout: z.optional(types_duration) + })) +}); + +export const indices_resolve_cluster_response = z.record(z.string(), indices_resolve_cluster_resolve_cluster_info); export const indices_resolve_cluster1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_names, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing\nor closed indices. This behavior applies even if the request targets other open indices. For example, a request\ntargeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, concrete, expanded, or aliased indices are ignored when frozen.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if it targets a missing or closed index.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.', - }) - ), - timeout: z.optional(types_duration), - }) - ), -}); - -export const indices_resolve_cluster1_response = z.record( - z.string(), - indices_resolve_cluster_resolve_cluster_info -); + body: z.optional(z.never()), + path: z.object({ + name: types_names + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing\nor closed indices. This behavior applies even if the request targets other open indices. For example, a request\ntargeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, concrete, expanded, or aliased indices are ignored when frozen.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if it targets a missing or closed index.\nNOTE: This option is only supported when specifying an index expression. You will get an error if you specify index\noptions to the `_resolve/cluster` API endpoint that takes no index expression.' + })), + timeout: z.optional(types_duration) + })) +}); + +export const indices_resolve_cluster1_response = z.record(z.string(), indices_resolve_cluster_resolve_cluster_info); export const indices_resolve_index_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_names, - }), - query: z.optional( - z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - mode: z.optional(z.union([indices_types_index_mode, z.array(indices_types_index_mode)])), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_names + }), + query: z.optional(z.object({ + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + mode: z.optional(z.union([ + indices_types_index_mode, + z.array(indices_types_index_mode) + ])) + })) }); export const indices_resolve_index_response = z.object({ - indices: z.array(indices_resolve_index_resolve_index_item), - aliases: z.array(indices_resolve_index_resolve_index_alias_item), - data_streams: z.array(indices_resolve_index_resolve_index_data_streams_item), + indices: z.array(indices_resolve_index_resolve_index_item), + aliases: z.array(indices_resolve_index_resolve_index_alias_item), + data_streams: z.array(indices_resolve_index_resolve_index_data_streams_item) }); export const indices_segments_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })) + })) }); export const indices_segments_response = z.object({ - indices: z.record(z.string(), indices_segments_index_segment), - _shards: types_shard_statistics, + indices: z.record(z.string(), indices_segments_index_segment), + _shards: types_shard_statistics }); export const indices_segments1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })) + })) }); export const indices_segments1_response = z.object({ - indices: z.record(z.string(), indices_segments_index_segment), - _shards: types_shard_statistics, + indices: z.record(z.string(), indices_segments_index_segment), + _shards: types_shard_statistics }); export const indices_shard_stores_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or _all\nvalue targets only missing or closed indices. This behavior applies even if the request\ntargets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', - }) - ), - status: z.optional( - z.union([ - indices_shard_stores_shard_store_status, - z.array(indices_shard_stores_shard_store_status), - ]) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias, or _all\nvalue targets only missing or closed indices. This behavior applies even if the request\ntargets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, missing or closed indices are not included in the response.' + })), + status: z.optional(z.union([ + indices_shard_stores_shard_store_status, + z.array(indices_shard_stores_shard_store_status) + ])) + })) }); export const indices_shard_stores_response = z.object({ - indices: z.record(z.string(), indices_shard_stores_indices_shard_stores), + indices: z.record(z.string(), indices_shard_stores_indices_shard_stores) }); export const indices_shard_stores1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or _all\nvalue targets only missing or closed indices. This behavior applies even if the request\ntargets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', - }) - ), - status: z.optional( - z.union([ - indices_shard_stores_shard_store_status, - z.array(indices_shard_stores_shard_store_status), - ]) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias, or _all\nvalue targets only missing or closed indices. This behavior applies even if the request\ntargets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, missing or closed indices are not included in the response.' + })), + status: z.optional(z.union([ + indices_shard_stores_shard_store_status, + z.array(indices_shard_stores_shard_store_status) + ])) + })) }); export const indices_shard_stores1_response = z.object({ - indices: z.record(z.string(), indices_shard_stores_indices_shard_stores), + indices: z.record(z.string(), indices_shard_stores_indices_shard_stores) }); export const inference_chat_completion_unified_request = z.object({ - body: inference_types_request_chat_completion, - path: z.object({ - inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: inference_types_request_chat_completion, + path: z.object({ + inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_chat_completion_unified_response = types_stream_result; export const inference_completion_request = z.object({ - body: z.object({ - input: z.union([z.string(), z.array(z.string())]), - task_settings: z.optional(inference_types_task_settings), - }), - path: z.object({ - inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + input: z.union([ + z.string(), + z.array(z.string()) + ]), + task_settings: z.optional(inference_types_task_settings) + }), + path: z.object({ + inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_completion_response = inference_types_completion_inference_result; export const inference_delete_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - inference_id: types_id, - }), - query: z.optional( - z.object({ - dry_run: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When true, checks the semantic_text fields and inference processors that reference the endpoint and returns them in a list, but does not delete the endpoint.', - }) - ), - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When true, the inference endpoint is forcefully deleted even if it is still being used by ingest processors or semantic text fields.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + inference_id: types_id + }), + query: z.optional(z.object({ + dry_run: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When true, checks the semantic_text fields and inference processors that reference the endpoint and returns them in a list, but does not delete the endpoint.' + })), + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When true, the inference endpoint is forcefully deleted even if it is still being used by ingest processors or semantic text fields.' + })) + })) }); export const inference_delete_response = inference_types_delete_inference_endpoint_result; export const inference_get1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - inference_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + inference_id: types_id + }), + query: z.optional(z.never()) }); export const inference_get1_response = z.object({ - endpoints: z.array(inference_types_inference_endpoint_info), + endpoints: z.array(inference_types_inference_endpoint_info) }); export const inference_inference_request = z.object({ - body: inference_inference, - path: z.object({ - inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: inference_inference, + path: z.object({ + inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_inference_response = inference_types_inference_result; export const inference_put_request = z.object({ - body: inference_put, - path: z.object({ - inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: inference_put, + path: z.object({ + inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_put_response = inference_types_inference_endpoint_info; export const inference_delete1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - task_type: inference_types_task_type, - inference_id: types_id, - }), - query: z.optional( - z.object({ - dry_run: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When true, checks the semantic_text fields and inference processors that reference the endpoint and returns them in a list, but does not delete the endpoint.', - }) - ), - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When true, the inference endpoint is forcefully deleted even if it is still being used by ingest processors or semantic text fields.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + task_type: inference_types_task_type, + inference_id: types_id + }), + query: z.optional(z.object({ + dry_run: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When true, checks the semantic_text fields and inference processors that reference the endpoint and returns them in a list, but does not delete the endpoint.' + })), + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When true, the inference endpoint is forcefully deleted even if it is still being used by ingest processors or semantic text fields.' + })) + })) }); export const inference_delete1_response = inference_types_delete_inference_endpoint_result; export const inference_get2_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - task_type: inference_types_task_type, - inference_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + task_type: inference_types_task_type, + inference_id: types_id + }), + query: z.optional(z.never()) }); export const inference_get2_response = z.object({ - endpoints: z.array(inference_types_inference_endpoint_info), + endpoints: z.array(inference_types_inference_endpoint_info) }); export const inference_inference1_request = z.object({ - body: inference_inference, - path: z.object({ - task_type: inference_types_task_type, - inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: inference_inference, + path: z.object({ + task_type: inference_types_task_type, + inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_inference1_response = inference_types_inference_result; export const inference_put1_request = z.object({ - body: inference_put, - path: z.object({ - task_type: inference_types_task_type, - inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: inference_put, + path: z.object({ + task_type: inference_types_task_type, + inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_put1_response = inference_types_inference_endpoint_info; export const inference_get_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const inference_get_response = z.object({ - endpoints: z.array(inference_types_inference_endpoint_info), + endpoints: z.array(inference_types_inference_endpoint_info) }); export const inference_put_ai21_request = z.object({ - body: z.object({ - service: inference_types_ai21_service_type, - service_settings: inference_types_ai21_service_settings, - }), - path: z.object({ - task_type: inference_types_ai21_task_type, - ai21_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + service: inference_types_ai21_service_type, + service_settings: inference_types_ai21_service_settings + }), + path: z.object({ + task_type: inference_types_ai21_task_type, + ai21_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_put_ai21_response = inference_types_inference_endpoint_info_ai21; export const inference_put_alibabacloud_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_alibaba_cloud_service_type, - service_settings: inference_types_alibaba_cloud_service_settings, - task_settings: z.optional(inference_types_alibaba_cloud_task_settings), - }), - path: z.object({ - task_type: inference_types_alibaba_cloud_task_type, - alibabacloud_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_alibaba_cloud_service_type, + service_settings: inference_types_alibaba_cloud_service_settings, + task_settings: z.optional(inference_types_alibaba_cloud_task_settings) + }), + path: z.object({ + task_type: inference_types_alibaba_cloud_task_type, + alibabacloud_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); -export const inference_put_alibabacloud_response = - inference_types_inference_endpoint_info_alibaba_cloud_ai; +export const inference_put_alibabacloud_response = inference_types_inference_endpoint_info_alibaba_cloud_ai; export const inference_put_amazonbedrock_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_amazon_bedrock_service_type, - service_settings: inference_types_amazon_bedrock_service_settings, - task_settings: z.optional(inference_types_amazon_bedrock_task_settings), - }), - path: z.object({ - task_type: inference_types_amazon_bedrock_task_type, - amazonbedrock_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_amazon_bedrock_service_type, + service_settings: inference_types_amazon_bedrock_service_settings, + task_settings: z.optional(inference_types_amazon_bedrock_task_settings) + }), + path: z.object({ + task_type: inference_types_amazon_bedrock_task_type, + amazonbedrock_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); -export const inference_put_amazonbedrock_response = - inference_types_inference_endpoint_info_amazon_bedrock; +export const inference_put_amazonbedrock_response = inference_types_inference_endpoint_info_amazon_bedrock; export const inference_put_amazonsagemaker_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_amazon_sage_maker_service_type, - service_settings: inference_types_amazon_sage_maker_service_settings, - task_settings: z.optional(inference_types_amazon_sage_maker_task_settings), - }), - path: z.object({ - task_type: inference_types_task_type_amazon_sage_maker, - amazonsagemaker_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_amazon_sage_maker_service_type, + service_settings: inference_types_amazon_sage_maker_service_settings, + task_settings: z.optional(inference_types_amazon_sage_maker_task_settings) + }), + path: z.object({ + task_type: inference_types_task_type_amazon_sage_maker, + amazonsagemaker_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); -export const inference_put_amazonsagemaker_response = - inference_types_inference_endpoint_info_amazon_sage_maker; +export const inference_put_amazonsagemaker_response = inference_types_inference_endpoint_info_amazon_sage_maker; export const inference_put_anthropic_request = z.object({ - body: z.object({ - service: inference_types_anthropic_service_type, - service_settings: inference_types_anthropic_service_settings, - task_settings: z.optional(inference_types_anthropic_task_settings), - }), - path: z.object({ - task_type: inference_types_anthropic_task_type, - anthropic_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + service: inference_types_anthropic_service_type, + service_settings: inference_types_anthropic_service_settings, + task_settings: z.optional(inference_types_anthropic_task_settings) + }), + path: z.object({ + task_type: inference_types_anthropic_task_type, + anthropic_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_put_anthropic_response = inference_types_inference_endpoint_info_anthropic; export const inference_put_azureaistudio_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_azure_ai_studio_service_type, - service_settings: inference_types_azure_ai_studio_service_settings, - task_settings: z.optional(inference_types_azure_ai_studio_task_settings), - }), - path: z.object({ - task_type: inference_types_azure_ai_studio_task_type, - azureaistudio_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_azure_ai_studio_service_type, + service_settings: inference_types_azure_ai_studio_service_settings, + task_settings: z.optional(inference_types_azure_ai_studio_task_settings) + }), + path: z.object({ + task_type: inference_types_azure_ai_studio_task_type, + azureaistudio_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); -export const inference_put_azureaistudio_response = - inference_types_inference_endpoint_info_azure_ai_studio; +export const inference_put_azureaistudio_response = inference_types_inference_endpoint_info_azure_ai_studio; export const inference_put_azureopenai_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_azure_open_ai_service_type, - service_settings: inference_types_azure_open_ai_service_settings, - task_settings: z.optional(inference_types_azure_open_ai_task_settings), - }), - path: z.object({ - task_type: inference_types_azure_open_ai_task_type, - azureopenai_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_azure_open_ai_service_type, + service_settings: inference_types_azure_open_ai_service_settings, + task_settings: z.optional(inference_types_azure_open_ai_task_settings) + }), + path: z.object({ + task_type: inference_types_azure_open_ai_task_type, + azureopenai_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); -export const inference_put_azureopenai_response = - inference_types_inference_endpoint_info_azure_open_ai; +export const inference_put_azureopenai_response = inference_types_inference_endpoint_info_azure_open_ai; export const inference_put_cohere_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_cohere_service_type, - service_settings: inference_types_cohere_service_settings, - task_settings: z.optional(inference_types_cohere_task_settings), - }), - path: z.object({ - task_type: inference_types_cohere_task_type, - cohere_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_cohere_service_type, + service_settings: inference_types_cohere_service_settings, + task_settings: z.optional(inference_types_cohere_task_settings) + }), + path: z.object({ + task_type: inference_types_cohere_task_type, + cohere_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_put_cohere_response = inference_types_inference_endpoint_info_cohere; export const inference_put_contextualai_request = z.object({ - body: z.object({ - service: inference_types_contextual_ai_service_type, - service_settings: inference_types_contextual_ai_service_settings, - task_settings: z.optional(inference_types_contextual_ai_task_settings), - }), - path: z.object({ - task_type: inference_types_task_type_contextual_ai, - contextualai_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + service: inference_types_contextual_ai_service_type, + service_settings: inference_types_contextual_ai_service_settings, + task_settings: z.optional(inference_types_contextual_ai_task_settings) + }), + path: z.object({ + task_type: inference_types_task_type_contextual_ai, + contextualai_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); -export const inference_put_contextualai_response = - inference_types_inference_endpoint_info_contextual_ai; +export const inference_put_contextualai_response = inference_types_inference_endpoint_info_contextual_ai; export const inference_put_custom_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_custom_service_type, - service_settings: inference_types_custom_service_settings, - task_settings: z.optional(inference_types_custom_task_settings), - }), - path: z.object({ - task_type: inference_types_custom_task_type, - custom_inference_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_custom_service_type, + service_settings: inference_types_custom_service_settings, + task_settings: z.optional(inference_types_custom_task_settings) + }), + path: z.object({ + task_type: inference_types_custom_task_type, + custom_inference_id: types_id + }), + query: z.optional(z.never()) }); export const inference_put_custom_response = inference_types_inference_endpoint_info_custom; export const inference_put_deepseek_request = z.object({ - body: z.object({ - service: inference_types_deep_seek_service_type, - service_settings: inference_types_deep_seek_service_settings, - }), - path: z.object({ - task_type: inference_types_task_type_deep_seek, - deepseek_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + service: inference_types_deep_seek_service_type, + service_settings: inference_types_deep_seek_service_settings + }), + path: z.object({ + task_type: inference_types_task_type_deep_seek, + deepseek_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_put_deepseek_response = inference_types_inference_endpoint_info_deep_seek; export const inference_put_elasticsearch_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_elasticsearch_service_type, - service_settings: inference_types_elasticsearch_service_settings, - task_settings: z.optional(inference_types_elasticsearch_task_settings), - }), - path: z.object({ - task_type: inference_types_elasticsearch_task_type, - elasticsearch_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_elasticsearch_service_type, + service_settings: inference_types_elasticsearch_service_settings, + task_settings: z.optional(inference_types_elasticsearch_task_settings) + }), + path: z.object({ + task_type: inference_types_elasticsearch_task_type, + elasticsearch_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); -export const inference_put_elasticsearch_response = - inference_types_inference_endpoint_info_elasticsearch; +export const inference_put_elasticsearch_response = inference_types_inference_endpoint_info_elasticsearch; export const inference_put_elser_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_elser_service_type, - service_settings: inference_types_elser_service_settings, - }), - path: z.object({ - task_type: inference_types_elser_task_type, - elser_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_elser_service_type, + service_settings: inference_types_elser_service_settings + }), + path: z.object({ + task_type: inference_types_elser_task_type, + elser_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_put_elser_response = inference_types_inference_endpoint_info_elser; export const inference_put_googleaistudio_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_google_ai_service_type, - service_settings: inference_types_google_ai_studio_service_settings, - }), - path: z.object({ - task_type: inference_types_google_ai_studio_task_type, - googleaistudio_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_google_ai_service_type, + service_settings: inference_types_google_ai_studio_service_settings + }), + path: z.object({ + task_type: inference_types_google_ai_studio_task_type, + googleaistudio_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); -export const inference_put_googleaistudio_response = - inference_types_inference_endpoint_info_google_ai_studio; +export const inference_put_googleaistudio_response = inference_types_inference_endpoint_info_google_ai_studio; export const inference_put_googlevertexai_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_google_vertex_ai_service_type, - service_settings: inference_types_google_vertex_ai_service_settings, - task_settings: z.optional(inference_types_google_vertex_ai_task_settings), - }), - path: z.object({ - task_type: inference_types_google_vertex_ai_task_type, - googlevertexai_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_google_vertex_ai_service_type, + service_settings: inference_types_google_vertex_ai_service_settings, + task_settings: z.optional(inference_types_google_vertex_ai_task_settings) + }), + path: z.object({ + task_type: inference_types_google_vertex_ai_task_type, + googlevertexai_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); -export const inference_put_googlevertexai_response = - inference_types_inference_endpoint_info_google_vertex_ai; +export const inference_put_googlevertexai_response = inference_types_inference_endpoint_info_google_vertex_ai; export const inference_put_hugging_face_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_hugging_face_service_type, - service_settings: inference_types_hugging_face_service_settings, - task_settings: z.optional(inference_types_hugging_face_task_settings), - }), - path: z.object({ - task_type: inference_types_hugging_face_task_type, - huggingface_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_hugging_face_service_type, + service_settings: inference_types_hugging_face_service_settings, + task_settings: z.optional(inference_types_hugging_face_task_settings) + }), + path: z.object({ + task_type: inference_types_hugging_face_task_type, + huggingface_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); -export const inference_put_hugging_face_response = - inference_types_inference_endpoint_info_hugging_face; +export const inference_put_hugging_face_response = inference_types_inference_endpoint_info_hugging_face; export const inference_put_jinaai_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_jina_ai_service_type, - service_settings: inference_types_jina_ai_service_settings, - task_settings: z.optional(inference_types_jina_ai_task_settings), - }), - path: z.object({ - task_type: inference_types_jina_ai_task_type, - jinaai_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_jina_ai_service_type, + service_settings: inference_types_jina_ai_service_settings, + task_settings: z.optional(inference_types_jina_ai_task_settings) + }), + path: z.object({ + task_type: inference_types_jina_ai_task_type, + jinaai_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_put_jinaai_response = inference_types_inference_endpoint_info_jina_ai; export const inference_put_llama_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_llama_service_type, - service_settings: inference_types_llama_service_settings, - }), - path: z.object({ - task_type: inference_types_llama_task_type, - llama_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_llama_service_type, + service_settings: inference_types_llama_service_settings + }), + path: z.object({ + task_type: inference_types_llama_task_type, + llama_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_put_llama_response = inference_types_inference_endpoint_info_llama; export const inference_put_mistral_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_mistral_service_type, - service_settings: inference_types_mistral_service_settings, - }), - path: z.object({ - task_type: inference_types_mistral_task_type, - mistral_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_mistral_service_type, + service_settings: inference_types_mistral_service_settings + }), + path: z.object({ + task_type: inference_types_mistral_task_type, + mistral_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_put_mistral_response = inference_types_inference_endpoint_info_mistral; export const inference_put_openai_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_open_ai_service_type, - service_settings: inference_types_open_ai_service_settings, - task_settings: z.optional(inference_types_open_ai_task_settings), - }), - path: z.object({ - task_type: inference_types_open_ai_task_type, - openai_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_open_ai_service_type, + service_settings: inference_types_open_ai_service_settings, + task_settings: z.optional(inference_types_open_ai_task_settings) + }), + path: z.object({ + task_type: inference_types_open_ai_task_type, + openai_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_put_openai_response = inference_types_inference_endpoint_info_open_ai; export const inference_put_openshift_ai_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_open_shift_ai_service_type, - service_settings: inference_types_open_shift_ai_service_settings, - task_settings: z.optional(inference_types_open_shift_ai_task_settings), - }), - path: z.object({ - task_type: inference_types_open_shift_ai_task_type, - openshiftai_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_open_shift_ai_service_type, + service_settings: inference_types_open_shift_ai_service_settings, + task_settings: z.optional(inference_types_open_shift_ai_task_settings) + }), + path: z.object({ + task_type: inference_types_open_shift_ai_task_type, + openshiftai_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); -export const inference_put_openshift_ai_response = - inference_types_inference_endpoint_info_open_shift_ai; +export const inference_put_openshift_ai_response = inference_types_inference_endpoint_info_open_shift_ai; export const inference_put_voyageai_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_voyage_ai_service_type, - service_settings: inference_types_voyage_ai_service_settings, - task_settings: z.optional(inference_types_voyage_ai_task_settings), - }), - path: z.object({ - task_type: inference_types_voyage_ai_task_type, - voyageai_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_voyage_ai_service_type, + service_settings: inference_types_voyage_ai_service_settings, + task_settings: z.optional(inference_types_voyage_ai_task_settings) + }), + path: z.object({ + task_type: inference_types_voyage_ai_task_type, + voyageai_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_put_voyageai_response = inference_types_inference_endpoint_info_voyage_ai; export const inference_put_watsonx_request = z.object({ - body: z.object({ - chunking_settings: z.optional(inference_types_inference_chunking_settings), - service: inference_types_watsonx_service_type, - service_settings: inference_types_watsonx_service_settings, - }), - path: z.object({ - task_type: inference_types_watsonx_task_type, - watsonx_inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + chunking_settings: z.optional(inference_types_inference_chunking_settings), + service: inference_types_watsonx_service_type, + service_settings: inference_types_watsonx_service_settings + }), + path: z.object({ + task_type: inference_types_watsonx_task_type, + watsonx_inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_put_watsonx_response = inference_types_inference_endpoint_info_watsonx; export const inference_rerank_request = z.object({ - body: z.object({ - query: z.string().register(z.globalRegistry, { - description: 'Query input.', - }), - input: z.array(z.string()).register(z.globalRegistry, { - description: 'The documents to rank.', - }), - return_documents: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Include the document text in the response.', - }) - ), - top_n: z.optional( - z.number().register(z.globalRegistry, { - description: 'Limit the response to the top N documents.', - }) - ), - task_settings: z.optional(inference_types_task_settings), - }), - path: z.object({ - inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + query: z.string().register(z.globalRegistry, { + description: 'Query input.' + }), + input: z.array(z.string()).register(z.globalRegistry, { + description: 'The documents to rank.' + }), + return_documents: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Include the document text in the response.' + })), + top_n: z.optional(z.number().register(z.globalRegistry, { + description: 'Limit the response to the top N documents.' + })), + task_settings: z.optional(inference_types_task_settings) + }), + path: z.object({ + inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_rerank_response = inference_types_reranked_inference_result; export const inference_sparse_embedding_request = z.object({ - body: z.object({ - input: z.union([z.string(), z.array(z.string())]), - task_settings: z.optional(inference_types_task_settings), - }), - path: z.object({ - inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + input: z.union([ + z.string(), + z.array(z.string()) + ]), + task_settings: z.optional(inference_types_task_settings) + }), + path: z.object({ + inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); -export const inference_sparse_embedding_response = - inference_types_sparse_embedding_inference_result; +export const inference_sparse_embedding_response = inference_types_sparse_embedding_inference_result; export const inference_stream_completion_request = z.object({ - body: z.object({ - input: z.union([z.string(), z.array(z.string())]), - task_settings: z.optional(inference_types_task_settings), - }), - path: z.object({ - inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + input: z.union([ + z.string(), + z.array(z.string()) + ]), + task_settings: z.optional(inference_types_task_settings) + }), + path: z.object({ + inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_stream_completion_response = types_stream_result; export const inference_text_embedding_request = z.object({ - body: z.object({ - input: z.union([z.string(), z.array(z.string())]), - input_type: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The input data type for the text embedding model. Possible values include:\n* `SEARCH`\n* `INGEST`\n* `CLASSIFICATION`\n* `CLUSTERING`\nNot all services support all values. Unsupported values will trigger a validation exception.\nAccepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info.\n\n> info\n> The `input_type` parameter specified on the root level of the request body will take precedence over the `input_type` parameter specified in `task_settings`.', - }) - ), - task_settings: z.optional(inference_types_task_settings), - }), - path: z.object({ - inference_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + input: z.union([ + z.string(), + z.array(z.string()) + ]), + input_type: z.optional(z.string().register(z.globalRegistry, { + description: 'The input data type for the text embedding model. Possible values include:\n* `SEARCH`\n* `INGEST`\n* `CLASSIFICATION`\n* `CLUSTERING`\nNot all services support all values. Unsupported values will trigger a validation exception.\nAccepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info.\n\n> info\n> The `input_type` parameter specified on the root level of the request body will take precedence over the `input_type` parameter specified in `task_settings`.' + })), + task_settings: z.optional(inference_types_task_settings) + }), + path: z.object({ + inference_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const inference_text_embedding_response = inference_types_text_embedding_inference_result; export const inference_update_request = z.object({ - body: inference_update, - path: z.object({ - inference_id: types_id, - }), - query: z.optional(z.never()), + body: inference_update, + path: z.object({ + inference_id: types_id + }), + query: z.optional(z.never()) }); export const inference_update_response = inference_types_inference_endpoint_info; export const inference_update1_request = z.object({ - body: inference_update, - path: z.object({ - task_type: inference_types_task_type, - inference_id: types_id, - }), - query: z.optional(z.never()), + body: inference_update, + path: z.object({ + task_type: inference_types_task_type, + inference_id: types_id + }), + query: z.optional(z.never()) }); export const inference_update1_response = inference_types_inference_endpoint_info; export const info_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const info_response = z.object({ - cluster_name: types_name, - cluster_uuid: types_uuid, - name: types_name, - tagline: z.string(), - version: types_elasticsearch_version_info, + cluster_name: types_name, + cluster_uuid: types_uuid, + name: types_name, + tagline: z.string(), + version: types_elasticsearch_version_info }); export const ping_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const ingest_delete_geoip_database_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_ids, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_ids + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const ingest_delete_geoip_database_response = types_acknowledged_response_base; export const ingest_get_geoip_database1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_ids, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_ids + }), + query: z.optional(z.never()) }); export const ingest_get_geoip_database1_response = z.object({ - databases: z.array(ingest_get_geoip_database_database_configuration_metadata), + databases: z.array(ingest_get_geoip_database_database_configuration_metadata) }); export const ingest_put_geoip_database_request = z.object({ - body: z.object({ - name: types_name, - maxmind: ingest_types_maxmind, - }), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + name: types_name, + maxmind: ingest_types_maxmind + }), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const ingest_put_geoip_database_response = types_acknowledged_response_base; export const ingest_delete_ip_location_database_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_ids, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_ids + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const ingest_delete_ip_location_database_response = types_acknowledged_response_base; export const ingest_get_ip_location_database1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_ids, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_ids + }), + query: z.optional(z.never()) }); export const ingest_get_ip_location_database1_response = z.object({ - databases: z.array(ingest_get_ip_location_database_database_configuration_metadata), + databases: z.array(ingest_get_ip_location_database_database_configuration_metadata) }); export const ingest_put_ip_location_database_request = z.object({ - body: ingest_types_database_configuration, - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: ingest_types_database_configuration, + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const ingest_put_ip_location_database_response = types_acknowledged_response_base; export const ingest_delete_pipeline_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const ingest_delete_pipeline_response = types_acknowledged_response_base; export const ingest_geo_ip_stats_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const ingest_geo_ip_stats_response = z.object({ - stats: ingest_geo_ip_stats_geo_ip_download_statistics, - nodes: z - .record(z.string(), ingest_geo_ip_stats_geo_ip_node_databases) - .register(z.globalRegistry, { - description: 'Downloaded GeoIP2 databases for each node.', - }), + stats: ingest_geo_ip_stats_geo_ip_download_statistics, + nodes: z.record(z.string(), ingest_geo_ip_stats_geo_ip_node_databases).register(z.globalRegistry, { + description: 'Downloaded GeoIP2 databases for each node.' + }) }); export const ingest_get_geoip_database_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const ingest_get_geoip_database_response = z.object({ - databases: z.array(ingest_get_geoip_database_database_configuration_metadata), + databases: z.array(ingest_get_geoip_database_database_configuration_metadata) }); export const ingest_get_ip_location_database_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const ingest_get_ip_location_database_response = z.object({ - databases: z.array(ingest_get_ip_location_database_database_configuration_metadata), + databases: z.array(ingest_get_ip_location_database_database_configuration_metadata) }); export const ingest_processor_grok_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const ingest_processor_grok_response = z.object({ - patterns: z.record(z.string(), z.string()), + patterns: z.record(z.string(), z.string()) }); export const license_delete_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const license_delete_response = types_acknowledged_response_base; export const license_get_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - accept_enterprise: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, this parameter returns enterprise for Enterprise license types. If `false`, this parameter returns platinum for both platinum and enterprise license types. This behavior is maintained for backwards compatibility.\nThis parameter is deprecated and will always be set to true in 8.x.', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether to retrieve local information.\nFrom 9.2 onwards the default value is `true`, which means the information is retrieved from the responding node.\nIn earlier versions the default is `false`, which means the information is retrieved from the elected master node.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + accept_enterprise: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, this parameter returns enterprise for Enterprise license types. If `false`, this parameter returns platinum for both platinum and enterprise license types. This behavior is maintained for backwards compatibility.\nThis parameter is deprecated and will always be set to true in 8.x.' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether to retrieve local information.\nFrom 9.2 onwards the default value is `true`, which means the information is retrieved from the responding node.\nIn earlier versions the default is `false`, which means the information is retrieved from the elected master node.' + })) + })) }); export const license_get_response = z.object({ - license: license_get_license_information, + license: license_get_license_information }); export const license_post1_request = z.object({ - body: z.optional(license_post), - path: z.optional(z.never()), - query: z.optional( - z.object({ - acknowledge: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Specifies whether you acknowledge the license changes.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(license_post), + path: z.optional(z.never()), + query: z.optional(z.object({ + acknowledge: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether you acknowledge the license changes.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const license_post1_response = z.object({ - acknowledge: z.optional(license_post_acknowledgement), - acknowledged: z.boolean(), - license_status: license_types_license_status, + acknowledge: z.optional(license_post_acknowledgement), + acknowledged: z.boolean(), + license_status: license_types_license_status }); export const license_post_request = z.object({ - body: z.optional(license_post), - path: z.optional(z.never()), - query: z.optional( - z.object({ - acknowledge: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Specifies whether you acknowledge the license changes.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(license_post), + path: z.optional(z.never()), + query: z.optional(z.object({ + acknowledge: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether you acknowledge the license changes.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const license_post_response = z.object({ - acknowledge: z.optional(license_post_acknowledgement), - acknowledged: z.boolean(), - license_status: license_types_license_status, + acknowledge: z.optional(license_post_acknowledgement), + acknowledged: z.boolean(), + license_status: license_types_license_status }); export const license_get_basic_status_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const license_get_basic_status_response = z.object({ - eligible_to_start_basic: z.boolean(), + eligible_to_start_basic: z.boolean() }); export const license_get_trial_status_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const license_get_trial_status_response = z.object({ - eligible_to_start_trial: z.boolean(), + eligible_to_start_trial: z.boolean() }); export const license_post_start_basic_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - acknowledge: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'whether the user has acknowledged acknowledge messages (default: false)', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + acknowledge: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether the user has acknowledged acknowledge messages' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const license_post_start_basic_response = z.object({ - acknowledged: z.boolean(), - basic_was_started: z.boolean(), - error_message: z.optional(z.string()), - type: z.optional(license_types_license_type), - acknowledge: z.optional(z.record(z.string(), z.union([z.string(), z.array(z.string())]))), + acknowledged: z.boolean(), + basic_was_started: z.boolean(), + error_message: z.optional(z.string()), + type: z.optional(license_types_license_type), + acknowledge: z.optional(z.record(z.string(), z.union([ + z.string(), + z.array(z.string()) + ]))) }); export const license_post_start_trial_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - acknowledge: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'whether the user has acknowledged acknowledge messages (default: false)', - }) - ), - type: z.optional( - z.string().register(z.globalRegistry, { - description: 'The type of trial license to generate (default: "trial")', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + acknowledge: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether the user has acknowledged acknowledge messages' + })), + type: z.optional(z.string().register(z.globalRegistry, { + description: 'The type of trial license to generate' + })), + master_timeout: z.optional(types_duration) + })) }); export const license_post_start_trial_response = z.object({ - acknowledged: z.boolean(), - error_message: z.optional(z.string()), - trial_was_started: z.boolean(), - type: z.optional(license_types_license_type), + acknowledged: z.boolean(), + error_message: z.optional(z.string()), + trial_was_started: z.boolean(), + type: z.optional(license_types_license_type) }); export const logstash_delete_pipeline_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const logstash_get_pipeline1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_ids, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_ids + }), + query: z.optional(z.never()) }); export const logstash_get_pipeline1_response = z.record(z.string(), logstash_types_pipeline); export const logstash_put_pipeline_request = z.object({ - body: logstash_types_pipeline, - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: logstash_types_pipeline, + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const logstash_get_pipeline_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const logstash_get_pipeline_response = z.record(z.string(), logstash_types_pipeline); export const mget_request = z.object({ - body: mget, - path: z.optional(z.never()), - query: z.optional( - z.object({ - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Specifies the node or shard the operation should be performed on. Random by default.', - }) - ), - realtime: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request is real-time as opposed to near-real-time.', - }) - ), - refresh: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request refreshes relevant shards before retrieving documents.', - }) - ), - routing: z.optional(types_routing), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - stored_fields: z.optional(types_fields), - }) - ), + body: mget, + path: z.optional(z.never()), + query: z.optional(z.object({ + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'Specifies the node or shard the operation should be performed on. Random by default.' + })), + realtime: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request is real-time as opposed to near-real-time.' + })), + refresh: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request refreshes relevant shards before retrieving documents.' + })), + routing: z.optional(types_routing), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields), + stored_fields: z.optional(types_fields) + })) }); export const mget_response = z.object({ - docs: z.array(global_mget_response_item).register(z.globalRegistry, { - description: - 'The response includes a docs array that contains the documents in the order specified in the request.\nThe structure of the returned documents is similar to that returned by the get API.\nIf there is a failure getting a particular document, the error is included in place of the document.', - }), + docs: z.array(global_mget_response_item).register(z.globalRegistry, { + description: 'The response includes a docs array that contains the documents in the order specified in the request.\nThe structure of the returned documents is similar to that returned by the get API.\nIf there is a failure getting a particular document, the error is included in place of the document.' + }) }); export const mget1_request = z.object({ - body: mget, - path: z.optional(z.never()), - query: z.optional( - z.object({ - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Specifies the node or shard the operation should be performed on. Random by default.', - }) - ), - realtime: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request is real-time as opposed to near-real-time.', - }) - ), - refresh: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request refreshes relevant shards before retrieving documents.', - }) - ), - routing: z.optional(types_routing), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - stored_fields: z.optional(types_fields), - }) - ), + body: mget, + path: z.optional(z.never()), + query: z.optional(z.object({ + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'Specifies the node or shard the operation should be performed on. Random by default.' + })), + realtime: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request is real-time as opposed to near-real-time.' + })), + refresh: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request refreshes relevant shards before retrieving documents.' + })), + routing: z.optional(types_routing), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields), + stored_fields: z.optional(types_fields) + })) }); export const mget1_response = z.object({ - docs: z.array(global_mget_response_item).register(z.globalRegistry, { - description: - 'The response includes a docs array that contains the documents in the order specified in the request.\nThe structure of the returned documents is similar to that returned by the get API.\nIf there is a failure getting a particular document, the error is included in place of the document.', - }), + docs: z.array(global_mget_response_item).register(z.globalRegistry, { + description: 'The response includes a docs array that contains the documents in the order specified in the request.\nThe structure of the returned documents is similar to that returned by the get API.\nIf there is a failure getting a particular document, the error is included in place of the document.' + }) }); export const mget2_request = z.object({ - body: mget, - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Specifies the node or shard the operation should be performed on. Random by default.', - }) - ), - realtime: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request is real-time as opposed to near-real-time.', - }) - ), - refresh: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request refreshes relevant shards before retrieving documents.', - }) - ), - routing: z.optional(types_routing), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - stored_fields: z.optional(types_fields), - }) - ), + body: mget, + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'Specifies the node or shard the operation should be performed on. Random by default.' + })), + realtime: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request is real-time as opposed to near-real-time.' + })), + refresh: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request refreshes relevant shards before retrieving documents.' + })), + routing: z.optional(types_routing), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields), + stored_fields: z.optional(types_fields) + })) }); export const mget2_response = z.object({ - docs: z.array(global_mget_response_item).register(z.globalRegistry, { - description: - 'The response includes a docs array that contains the documents in the order specified in the request.\nThe structure of the returned documents is similar to that returned by the get API.\nIf there is a failure getting a particular document, the error is included in place of the document.', - }), + docs: z.array(global_mget_response_item).register(z.globalRegistry, { + description: 'The response includes a docs array that contains the documents in the order specified in the request.\nThe structure of the returned documents is similar to that returned by the get API.\nIf there is a failure getting a particular document, the error is included in place of the document.' + }) }); export const mget3_request = z.object({ - body: mget, - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Specifies the node or shard the operation should be performed on. Random by default.', - }) - ), - realtime: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request is real-time as opposed to near-real-time.', - }) - ), - refresh: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request refreshes relevant shards before retrieving documents.', - }) - ), - routing: z.optional(types_routing), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - stored_fields: z.optional(types_fields), - }) - ), + body: mget, + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'Specifies the node or shard the operation should be performed on. Random by default.' + })), + realtime: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request is real-time as opposed to near-real-time.' + })), + refresh: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request refreshes relevant shards before retrieving documents.' + })), + routing: z.optional(types_routing), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields), + stored_fields: z.optional(types_fields) + })) }); export const mget3_response = z.object({ - docs: z.array(global_mget_response_item).register(z.globalRegistry, { - description: - 'The response includes a docs array that contains the documents in the order specified in the request.\nThe structure of the returned documents is similar to that returned by the get API.\nIf there is a failure getting a particular document, the error is included in place of the document.', - }), + docs: z.array(global_mget_response_item).register(z.globalRegistry, { + description: 'The response includes a docs array that contains the documents in the order specified in the request.\nThe structure of the returned documents is similar to that returned by the get API.\nIf there is a failure getting a particular document, the error is included in place of the document.' + }) }); export const migration_deprecations_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const migration_deprecations_response = z.object({ - cluster_settings: z.array(migration_deprecations_deprecation).register(z.globalRegistry, { - description: 'Cluster-level deprecation warnings.', - }), - index_settings: z - .record(z.string(), z.array(migration_deprecations_deprecation)) - .register(z.globalRegistry, { - description: - 'Index warnings are sectioned off per index and can be filtered using an index-pattern in the query.\nThis section includes warnings for the backing indices of data streams specified in the request path.', - }), - data_streams: z.record(z.string(), z.array(migration_deprecations_deprecation)), - node_settings: z.array(migration_deprecations_deprecation).register(z.globalRegistry, { - description: - 'Node-level deprecation warnings.\nSince only a subset of your nodes might incorporate these settings, it is important to read the details section for more information about which nodes are affected.', - }), - ml_settings: z.array(migration_deprecations_deprecation).register(z.globalRegistry, { - description: 'Machine learning-related deprecation warnings.', - }), - templates: z - .record(z.string(), z.array(migration_deprecations_deprecation)) - .register(z.globalRegistry, { - description: - 'Template warnings are sectioned off per template and include deprecations for both component templates and\nindex templates.', - }), - ilm_policies: z - .record(z.string(), z.array(migration_deprecations_deprecation)) - .register(z.globalRegistry, { - description: 'ILM policy warnings are sectioned off per policy.', + cluster_settings: z.array(migration_deprecations_deprecation).register(z.globalRegistry, { + description: 'Cluster-level deprecation warnings.' + }), + index_settings: z.record(z.string(), z.array(migration_deprecations_deprecation)).register(z.globalRegistry, { + description: 'Index warnings are sectioned off per index and can be filtered using an index-pattern in the query.\nThis section includes warnings for the backing indices of data streams specified in the request path.' + }), + data_streams: z.record(z.string(), z.array(migration_deprecations_deprecation)), + node_settings: z.array(migration_deprecations_deprecation).register(z.globalRegistry, { + description: 'Node-level deprecation warnings.\nSince only a subset of your nodes might incorporate these settings, it is important to read the details section for more information about which nodes are affected.' + }), + ml_settings: z.array(migration_deprecations_deprecation).register(z.globalRegistry, { + description: 'Machine learning-related deprecation warnings.' }), + templates: z.record(z.string(), z.array(migration_deprecations_deprecation)).register(z.globalRegistry, { + description: 'Template warnings are sectioned off per template and include deprecations for both component templates and\nindex templates.' + }), + ilm_policies: z.record(z.string(), z.array(migration_deprecations_deprecation)).register(z.globalRegistry, { + description: 'ILM policy warnings are sectioned off per policy.' + }) }); export const migration_deprecations1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_index_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + index: types_index_name + }), + query: z.optional(z.never()) }); export const migration_deprecations1_response = z.object({ - cluster_settings: z.array(migration_deprecations_deprecation).register(z.globalRegistry, { - description: 'Cluster-level deprecation warnings.', - }), - index_settings: z - .record(z.string(), z.array(migration_deprecations_deprecation)) - .register(z.globalRegistry, { - description: - 'Index warnings are sectioned off per index and can be filtered using an index-pattern in the query.\nThis section includes warnings for the backing indices of data streams specified in the request path.', - }), - data_streams: z.record(z.string(), z.array(migration_deprecations_deprecation)), - node_settings: z.array(migration_deprecations_deprecation).register(z.globalRegistry, { - description: - 'Node-level deprecation warnings.\nSince only a subset of your nodes might incorporate these settings, it is important to read the details section for more information about which nodes are affected.', - }), - ml_settings: z.array(migration_deprecations_deprecation).register(z.globalRegistry, { - description: 'Machine learning-related deprecation warnings.', - }), - templates: z - .record(z.string(), z.array(migration_deprecations_deprecation)) - .register(z.globalRegistry, { - description: - 'Template warnings are sectioned off per template and include deprecations for both component templates and\nindex templates.', - }), - ilm_policies: z - .record(z.string(), z.array(migration_deprecations_deprecation)) - .register(z.globalRegistry, { - description: 'ILM policy warnings are sectioned off per policy.', + cluster_settings: z.array(migration_deprecations_deprecation).register(z.globalRegistry, { + description: 'Cluster-level deprecation warnings.' + }), + index_settings: z.record(z.string(), z.array(migration_deprecations_deprecation)).register(z.globalRegistry, { + description: 'Index warnings are sectioned off per index and can be filtered using an index-pattern in the query.\nThis section includes warnings for the backing indices of data streams specified in the request path.' + }), + data_streams: z.record(z.string(), z.array(migration_deprecations_deprecation)), + node_settings: z.array(migration_deprecations_deprecation).register(z.globalRegistry, { + description: 'Node-level deprecation warnings.\nSince only a subset of your nodes might incorporate these settings, it is important to read the details section for more information about which nodes are affected.' + }), + ml_settings: z.array(migration_deprecations_deprecation).register(z.globalRegistry, { + description: 'Machine learning-related deprecation warnings.' + }), + templates: z.record(z.string(), z.array(migration_deprecations_deprecation)).register(z.globalRegistry, { + description: 'Template warnings are sectioned off per template and include deprecations for both component templates and\nindex templates.' }), + ilm_policies: z.record(z.string(), z.array(migration_deprecations_deprecation)).register(z.globalRegistry, { + description: 'ILM policy warnings are sectioned off per policy.' + }) }); export const migration_get_feature_upgrade_status_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const migration_get_feature_upgrade_status_response = z.object({ - features: z.array(migration_get_feature_upgrade_status_migration_feature), - migration_status: migration_get_feature_upgrade_status_migration_status, + features: z.array(migration_get_feature_upgrade_status_migration_feature), + migration_status: migration_get_feature_upgrade_status_migration_status }); export const migration_post_feature_upgrade_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const migration_post_feature_upgrade_response = z.object({ - accepted: z.boolean(), - features: z.optional(z.array(migration_post_feature_upgrade_migration_feature)), - reason: z.optional(z.string()), + accepted: z.boolean(), + features: z.optional(z.array(migration_post_feature_upgrade_migration_feature)), + reason: z.optional(z.string()) }); export const ml_clear_trained_model_deployment_cache_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - model_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + model_id: types_id + }), + query: z.optional(z.never()) }); export const ml_clear_trained_model_deployment_cache_response = z.object({ - cleared: z.boolean(), + cleared: z.boolean() }); export const ml_close_job_request = z.object({ - body: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Refer to the description for the `allow_no_match` query parameter.', - }) - ), - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Refer to the descriptiion for the `force` query parameter.', - }) - ), - timeout: z.optional(types_duration), - }) - ), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request: contains wildcard expressions and there are no jobs that match; contains the `_all` string or no identifiers and there are no matches; or contains wildcard expressions and there are only partial matches. By default, it returns an empty jobs array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the request returns a 404 status code when there are no matches or only partial matches.', - }) - ), - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Use to close a failed job, or to forcefully close a job which has not responded to its initial close request; the request returns without performing the associated actions such as flushing buffers and persisting the model snapshots.\nIf you want the job to be in a consistent state after the close job API returns, do not set to `true`. This parameter should be used only in situations where the job has already failed or where you are not interested in results the job might have recently produced or might produce in the future.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Refer to the description for the `allow_no_match` query parameter.' + })), + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Refer to the descriptiion for the `force` query parameter.' + })), + timeout: z.optional(types_duration) + })), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request: contains wildcard expressions and there are no jobs that match; contains the `_all` string or no identifiers and there are no matches; or contains wildcard expressions and there are only partial matches. By default, it returns an empty jobs array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the request returns a 404 status code when there are no matches or only partial matches.' + })), + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Use to close a failed job, or to forcefully close a job which has not responded to its initial close request; the request returns without performing the associated actions such as flushing buffers and persisting the model snapshots.\nIf you want the job to be in a consistent state after the close job API returns, do not set to `true`. This parameter should be used only in situations where the job has already failed or where you are not interested in results the job might have recently produced or might produce in the future.' + })), + timeout: z.optional(types_duration) + })) }); export const ml_close_job_response = z.object({ - closed: z.boolean(), + closed: z.boolean() }); export const ml_delete_calendar_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - calendar_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + calendar_id: types_id + }), + query: z.optional(z.never()) }); export const ml_delete_calendar_response = types_acknowledged_response_base; export const ml_get_calendars2_request = z.object({ - body: z.optional(ml_get_calendars), - path: z.object({ - calendar_id: types_id, - }), - query: z.optional( - z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier.', - }) - ), - }) - ), + body: z.optional(ml_get_calendars), + path: z.object({ + calendar_id: types_id + }), + query: z.optional(z.object({ + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier.' + })) + })) }); export const ml_get_calendars2_response = z.object({ - calendars: z.array(ml_get_calendars_calendar), - count: z.number(), + calendars: z.array(ml_get_calendars_calendar), + count: z.number() }); export const ml_get_calendars3_request = z.object({ - body: z.optional(ml_get_calendars), - path: z.object({ - calendar_id: types_id, - }), - query: z.optional( - z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier.', - }) - ), - }) - ), + body: z.optional(ml_get_calendars), + path: z.object({ + calendar_id: types_id + }), + query: z.optional(z.object({ + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier.' + })) + })) }); export const ml_get_calendars3_response = z.object({ - calendars: z.array(ml_get_calendars_calendar), - count: z.number(), + calendars: z.array(ml_get_calendars_calendar), + count: z.number() }); export const ml_put_calendar_request = z.object({ - body: z.optional( - z.object({ - job_ids: z.optional( - z.array(types_id).register(z.globalRegistry, { - description: 'An array of anomaly detection job identifiers.', - }) - ), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the calendar.', - }) - ), - }) - ), - path: z.object({ - calendar_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.object({ + job_ids: z.optional(z.array(types_id).register(z.globalRegistry, { + description: 'An array of anomaly detection job identifiers.' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the calendar.' + })) + })), + path: z.object({ + calendar_id: types_id + }), + query: z.optional(z.never()) }); export const ml_put_calendar_response = z.object({ - calendar_id: types_id, - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the calendar.', - }) - ), - job_ids: types_ids, + calendar_id: types_id, + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the calendar.' + })), + job_ids: types_ids }); export const ml_delete_calendar_event_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - calendar_id: types_id, - event_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + calendar_id: types_id, + event_id: types_id + }), + query: z.optional(z.never()) }); export const ml_delete_calendar_event_response = types_acknowledged_response_base; export const ml_delete_calendar_job_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - calendar_id: types_id, - job_id: types_ids, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + calendar_id: types_id, + job_id: types_ids + }), + query: z.optional(z.never()) }); export const ml_delete_calendar_job_response = z.object({ - calendar_id: types_id, - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the calendar.', - }) - ), - job_ids: types_ids, + calendar_id: types_id, + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the calendar.' + })), + job_ids: types_ids }); export const ml_put_calendar_job_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - calendar_id: types_id, - job_id: types_ids, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + calendar_id: types_id, + job_id: types_ids + }), + query: z.optional(z.never()) }); export const ml_put_calendar_job_response = z.object({ - calendar_id: types_id, - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the calendar.', - }) - ), - job_ids: types_ids, + calendar_id: types_id, + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the calendar.' + })), + job_ids: types_ids }); export const ml_delete_data_frame_analytics_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, it deletes a job that is not stopped; this method is quicker than stopping and deleting the job.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, it deletes a job that is not stopped; this method is quicker than stopping and deleting the job.' + })), + timeout: z.optional(types_duration) + })) }); export const ml_delete_data_frame_analytics_response = types_acknowledged_response_base; export const ml_delete_datafeed_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - datafeed_id: types_id, - }), - query: z.optional( - z.object({ - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Use to forcefully delete a started datafeed; this method is quicker than\nstopping and deleting the datafeed.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + datafeed_id: types_id + }), + query: z.optional(z.object({ + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Use to forcefully delete a started datafeed; this method is quicker than\nstopping and deleting the datafeed.' + })) + })) }); export const ml_delete_datafeed_response = types_acknowledged_response_base; export const ml_delete_expired_data_request = z.object({ - body: z.optional(ml_delete_expired_data), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - requests_per_second: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The desired requests per second for the deletion processes. The default\nbehavior is no throttling.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(ml_delete_expired_data), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + requests_per_second: z.optional(z.number().register(z.globalRegistry, { + description: 'The desired requests per second for the deletion processes. The default\nbehavior is no throttling.' + })), + timeout: z.optional(types_duration) + })) }); export const ml_delete_expired_data_response = z.object({ - deleted: z.boolean(), + deleted: z.boolean() }); export const ml_delete_expired_data1_request = z.object({ - body: z.optional(ml_delete_expired_data), - path: z.optional(z.never()), - query: z.optional( - z.object({ - requests_per_second: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The desired requests per second for the deletion processes. The default\nbehavior is no throttling.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(ml_delete_expired_data), + path: z.optional(z.never()), + query: z.optional(z.object({ + requests_per_second: z.optional(z.number().register(z.globalRegistry, { + description: 'The desired requests per second for the deletion processes. The default\nbehavior is no throttling.' + })), + timeout: z.optional(types_duration) + })) }); export const ml_delete_expired_data1_response = z.object({ - deleted: z.boolean(), + deleted: z.boolean() }); export const ml_delete_filter_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - filter_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + filter_id: types_id + }), + query: z.optional(z.never()) }); export const ml_delete_filter_response = types_acknowledged_response_base; export const ml_get_filters1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - filter_id: types_ids, - }), - query: z.optional( - z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of filters.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of filters to obtain.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + filter_id: types_ids + }), + query: z.optional(z.object({ + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of filters.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of filters to obtain.' + })) + })) }); export const ml_get_filters1_response = z.object({ - count: z.number(), - filters: z.array(ml_types_filter), + count: z.number(), + filters: z.array(ml_types_filter) }); export const ml_put_filter_request = z.object({ - body: z.object({ - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the filter.', - }) - ), - items: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'The items of the filter. A wildcard `*` can be used at the beginning or the end of an item.\nUp to 10000 items are allowed in each filter.', - }) - ), - }), - path: z.object({ - filter_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the filter.' + })), + items: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The items of the filter. A wildcard `*` can be used at the beginning or the end of an item.\nUp to 10000 items are allowed in each filter.' + })) + }), + path: z.object({ + filter_id: types_id + }), + query: z.optional(z.never()) }); export const ml_put_filter_response = z.object({ - description: z.string(), - filter_id: types_id, - items: z.array(z.string()), + description: z.string(), + filter_id: types_id, + items: z.array(z.string()) }); export const ml_delete_forecast_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - allow_no_forecasts: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether an error occurs when there are no forecasts. In\nparticular, if this parameter is set to `false` and there are no\nforecasts associated with the job, attempts to delete all forecasts\nreturn an error.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + allow_no_forecasts: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether an error occurs when there are no forecasts. In\nparticular, if this parameter is set to `false` and there are no\nforecasts associated with the job, attempts to delete all forecasts\nreturn an error.' + })), + timeout: z.optional(types_duration) + })) }); export const ml_delete_forecast_response = types_acknowledged_response_base; export const ml_forecast_request = z.object({ - body: z.optional( - z.object({ - duration: z.optional(types_duration), - expires_in: z.optional(types_duration), - max_model_memory: z.optional( - z.string().register(z.globalRegistry, { - description: 'Refer to the description for the `max_model_memory` query parameter.', - }) - ), - }) - ), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - duration: z.optional(types_duration), - expires_in: z.optional(types_duration), - max_model_memory: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The maximum memory the forecast can use. If the forecast needs to use\nmore than the provided amount, it will spool to disk. Default is 20mb,\nmaximum is 500mb and minimum is 1mb. If set to 40% or more of the job’s\nconfigured memory limit, it is automatically reduced to below that\namount.', - }) - ), - }) - ), + body: z.optional(z.object({ + duration: z.optional(types_duration), + expires_in: z.optional(types_duration), + max_model_memory: z.optional(z.string().register(z.globalRegistry, { + description: 'Refer to the description for the `max_model_memory` query parameter.' + })) + })), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + duration: z.optional(types_duration), + expires_in: z.optional(types_duration), + max_model_memory: z.optional(z.string().register(z.globalRegistry, { + description: 'The maximum memory the forecast can use. If the forecast needs to use\nmore than the provided amount, it will spool to disk. Default is 20mb,\nmaximum is 500mb and minimum is 1mb. If set to 40% or more of the job’s\nconfigured memory limit, it is automatically reduced to below that\namount.' + })) + })) }); export const ml_forecast_response = z.object({ - acknowledged: z.boolean(), - forecast_id: types_id, + acknowledged: z.boolean(), + forecast_id: types_id }); export const ml_delete_forecast1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - job_id: types_id, - forecast_id: types_id, - }), - query: z.optional( - z.object({ - allow_no_forecasts: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether an error occurs when there are no forecasts. In\nparticular, if this parameter is set to `false` and there are no\nforecasts associated with the job, attempts to delete all forecasts\nreturn an error.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + job_id: types_id, + forecast_id: types_id + }), + query: z.optional(z.object({ + allow_no_forecasts: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether an error occurs when there are no forecasts. In\nparticular, if this parameter is set to `false` and there are no\nforecasts associated with the job, attempts to delete all forecasts\nreturn an error.' + })), + timeout: z.optional(types_duration) + })) }); export const ml_delete_forecast1_response = types_acknowledged_response_base; export const ml_delete_job_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Use to forcefully delete an opened job; this method is quicker than\nclosing and deleting the job.', - }) - ), - delete_user_annotations: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether annotations that have been added by the\nuser should be deleted along with any auto-generated annotations when the job is\nreset.', - }) - ), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether the request should return immediately or wait until the\njob deletion completes.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Use to forcefully delete an opened job; this method is quicker than\nclosing and deleting the job.' + })), + delete_user_annotations: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether annotations that have been added by the\nuser should be deleted along with any auto-generated annotations when the job is\nreset.' + })), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether the request should return immediately or wait until the\njob deletion completes.' + })) + })) }); export const ml_delete_job_response = types_acknowledged_response_base; export const ml_delete_model_snapshot_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - job_id: types_id, - snapshot_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + job_id: types_id, + snapshot_id: types_id + }), + query: z.optional(z.never()) }); export const ml_delete_model_snapshot_response = types_acknowledged_response_base; export const ml_get_model_snapshots_request = z.object({ - body: z.optional(ml_get_model_snapshots), - path: z.object({ - job_id: types_id, - snapshot_id: types_id, - }), - query: z.optional( - z.object({ - desc: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the results are sorted in descending order.', - }) - ), - end: z.optional(types_date_time), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of snapshots.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of snapshots to obtain.', - }) - ), - sort: z.optional(types_field), - start: z.optional(types_date_time), - }) - ), + body: z.optional(ml_get_model_snapshots), + path: z.object({ + job_id: types_id, + snapshot_id: types_id + }), + query: z.optional(z.object({ + desc: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the results are sorted in descending order.' + })), + end: z.optional(types_date_time), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of snapshots.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of snapshots to obtain.' + })), + sort: z.optional(types_field), + start: z.optional(types_date_time) + })) }); export const ml_get_model_snapshots_response = z.object({ - count: z.number(), - model_snapshots: z.array(ml_types_model_snapshot), + count: z.number(), + model_snapshots: z.array(ml_types_model_snapshot) }); export const ml_get_model_snapshots1_request = z.object({ - body: z.optional(ml_get_model_snapshots), - path: z.object({ - job_id: types_id, - snapshot_id: types_id, - }), - query: z.optional( - z.object({ - desc: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the results are sorted in descending order.', - }) - ), - end: z.optional(types_date_time), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of snapshots.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of snapshots to obtain.', - }) - ), - sort: z.optional(types_field), - start: z.optional(types_date_time), - }) - ), + body: z.optional(ml_get_model_snapshots), + path: z.object({ + job_id: types_id, + snapshot_id: types_id + }), + query: z.optional(z.object({ + desc: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the results are sorted in descending order.' + })), + end: z.optional(types_date_time), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of snapshots.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of snapshots to obtain.' + })), + sort: z.optional(types_field), + start: z.optional(types_date_time) + })) }); export const ml_get_model_snapshots1_response = z.object({ - count: z.number(), - model_snapshots: z.array(ml_types_model_snapshot), + count: z.number(), + model_snapshots: z.array(ml_types_model_snapshot) }); export const ml_delete_trained_model_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - model_id: types_id, - }), - query: z.optional( - z.object({ - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Forcefully deletes a trained model that is referenced by ingest pipelines or has a started deployment.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + model_id: types_id + }), + query: z.optional(z.object({ + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Forcefully deletes a trained model that is referenced by ingest pipelines or has a started deployment.' + })), + timeout: z.optional(types_duration) + })) }); export const ml_delete_trained_model_response = types_acknowledged_response_base; export const ml_delete_trained_model_alias_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - model_id: types_id, - model_alias: types_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + model_id: types_id, + model_alias: types_name + }), + query: z.optional(z.never()) }); export const ml_delete_trained_model_alias_response = types_acknowledged_response_base; export const ml_put_trained_model_alias_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - model_id: types_id, - model_alias: types_name, - }), - query: z.optional( - z.object({ - reassign: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether the alias gets reassigned to the specified trained\nmodel if it is already assigned to a different model. If the alias is\nalready assigned and this parameter is false, the API returns an error.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + model_id: types_id, + model_alias: types_name + }), + query: z.optional(z.object({ + reassign: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether the alias gets reassigned to the specified trained\nmodel if it is already assigned to a different model. If the alias is\nalready assigned and this parameter is false, the API returns an error.' + })) + })) }); export const ml_put_trained_model_alias_response = types_acknowledged_response_base; export const ml_flush_job_request = z.object({ - body: z.optional( - z.object({ - advance_time: z.optional(types_date_time), - calc_interim: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Refer to the description for the `calc_interim` query parameter.', - }) - ), - end: z.optional(types_date_time), - skip_time: z.optional(types_date_time), - start: z.optional(types_date_time), - }) - ), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - advance_time: z.optional(types_date_time), - calc_interim: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, calculates the interim results for the most recent bucket or all\nbuckets within the latency period.', - }) - ), - end: z.optional(types_date_time), - skip_time: z.optional(types_date_time), - start: z.optional(types_date_time), - }) - ), + body: z.optional(z.object({ + advance_time: z.optional(types_date_time), + calc_interim: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Refer to the description for the `calc_interim` query parameter.' + })), + end: z.optional(types_date_time), + skip_time: z.optional(types_date_time), + start: z.optional(types_date_time) + })), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + advance_time: z.optional(types_date_time), + calc_interim: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, calculates the interim results for the most recent bucket or all\nbuckets within the latency period.' + })), + end: z.optional(types_date_time), + skip_time: z.optional(types_date_time), + start: z.optional(types_date_time) + })) }); export const ml_flush_job_response = z.object({ - flushed: z.boolean(), - last_finalized_bucket_end: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Provides the timestamp (in milliseconds since the epoch) of the end of\nthe last bucket that was processed.', - }) - ), + flushed: z.boolean(), + last_finalized_bucket_end: z.optional(z.number().register(z.globalRegistry, { + description: 'Provides the timestamp (in milliseconds since the epoch) of the end of\nthe last bucket that was processed.' + })) }); export const ml_get_buckets_request = z.object({ - body: z.optional(ml_get_buckets), - path: z.object({ - job_id: types_id, - timestamp: types_date_time, - }), - query: z.optional( - z.object({ - anomaly_score: z.optional( - z.number().register(z.globalRegistry, { - description: 'Returns buckets with anomaly scores greater or equal than this value.', - }) - ), - desc: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the buckets are sorted in descending order.', - }) - ), - end: z.optional(types_date_time), - exclude_interim: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the output excludes interim results.', - }) - ), - expand: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the output includes anomaly records.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of buckets.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of buckets to obtain.', - }) - ), - sort: z.optional(types_field), - start: z.optional(types_date_time), - }) - ), + body: z.optional(ml_get_buckets), + path: z.object({ + job_id: types_id, + timestamp: types_date_time + }), + query: z.optional(z.object({ + anomaly_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Returns buckets with anomaly scores greater or equal than this value.' + })), + desc: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the buckets are sorted in descending order.' + })), + end: z.optional(types_date_time), + exclude_interim: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the output excludes interim results.' + })), + expand: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the output includes anomaly records.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of buckets.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of buckets to obtain.' + })), + sort: z.optional(types_field), + start: z.optional(types_date_time) + })) }); export const ml_get_buckets_response = z.object({ - buckets: z.array(ml_types_bucket_summary), - count: z.number(), + buckets: z.array(ml_types_bucket_summary), + count: z.number() }); export const ml_get_buckets1_request = z.object({ - body: z.optional(ml_get_buckets), - path: z.object({ - job_id: types_id, - timestamp: types_date_time, - }), - query: z.optional( - z.object({ - anomaly_score: z.optional( - z.number().register(z.globalRegistry, { - description: 'Returns buckets with anomaly scores greater or equal than this value.', - }) - ), - desc: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the buckets are sorted in descending order.', - }) - ), - end: z.optional(types_date_time), - exclude_interim: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the output excludes interim results.', - }) - ), - expand: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the output includes anomaly records.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of buckets.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of buckets to obtain.', - }) - ), - sort: z.optional(types_field), - start: z.optional(types_date_time), - }) - ), + body: z.optional(ml_get_buckets), + path: z.object({ + job_id: types_id, + timestamp: types_date_time + }), + query: z.optional(z.object({ + anomaly_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Returns buckets with anomaly scores greater or equal than this value.' + })), + desc: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the buckets are sorted in descending order.' + })), + end: z.optional(types_date_time), + exclude_interim: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the output excludes interim results.' + })), + expand: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the output includes anomaly records.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of buckets.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of buckets to obtain.' + })), + sort: z.optional(types_field), + start: z.optional(types_date_time) + })) }); export const ml_get_buckets1_response = z.object({ - buckets: z.array(ml_types_bucket_summary), - count: z.number(), -}); - -export const ml_get_buckets2_request = z.object({ - body: z.optional(ml_get_buckets), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - anomaly_score: z.optional( - z.number().register(z.globalRegistry, { - description: 'Returns buckets with anomaly scores greater or equal than this value.', - }) - ), - desc: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the buckets are sorted in descending order.', - }) - ), - end: z.optional(types_date_time), - exclude_interim: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the output excludes interim results.', - }) - ), - expand: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the output includes anomaly records.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of buckets.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of buckets to obtain.', - }) - ), - sort: z.optional(types_field), - start: z.optional(types_date_time), - }) - ), -}); - -export const ml_get_buckets2_response = z.object({ - buckets: z.array(ml_types_bucket_summary), - count: z.number(), + buckets: z.array(ml_types_bucket_summary), + count: z.number() }); -export const ml_get_buckets3_request = z.object({ - body: z.optional(ml_get_buckets), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - anomaly_score: z.optional( - z.number().register(z.globalRegistry, { - description: 'Returns buckets with anomaly scores greater or equal than this value.', - }) - ), - desc: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the buckets are sorted in descending order.', - }) - ), - end: z.optional(types_date_time), - exclude_interim: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the output excludes interim results.', - }) - ), - expand: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the output includes anomaly records.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of buckets.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of buckets to obtain.', - }) - ), - sort: z.optional(types_field), - start: z.optional(types_date_time), - }) - ), +export const ml_get_buckets2_request = z.object({ + body: z.optional(ml_get_buckets), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + anomaly_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Returns buckets with anomaly scores greater or equal than this value.' + })), + desc: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the buckets are sorted in descending order.' + })), + end: z.optional(types_date_time), + exclude_interim: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the output excludes interim results.' + })), + expand: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the output includes anomaly records.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of buckets.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of buckets to obtain.' + })), + sort: z.optional(types_field), + start: z.optional(types_date_time) + })) +}); + +export const ml_get_buckets2_response = z.object({ + buckets: z.array(ml_types_bucket_summary), + count: z.number() +}); + +export const ml_get_buckets3_request = z.object({ + body: z.optional(ml_get_buckets), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + anomaly_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Returns buckets with anomaly scores greater or equal than this value.' + })), + desc: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the buckets are sorted in descending order.' + })), + end: z.optional(types_date_time), + exclude_interim: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the output excludes interim results.' + })), + expand: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the output includes anomaly records.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of buckets.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of buckets to obtain.' + })), + sort: z.optional(types_field), + start: z.optional(types_date_time) + })) }); export const ml_get_buckets3_response = z.object({ - buckets: z.array(ml_types_bucket_summary), - count: z.number(), + buckets: z.array(ml_types_bucket_summary), + count: z.number() }); export const ml_get_calendar_events_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - calendar_id: types_id, - }), - query: z.optional( - z.object({ - end: z.optional(types_date_time), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of events.', - }) - ), - job_id: z.optional(types_id), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of events to obtain.', - }) - ), - start: z.optional(types_date_time), - }) - ), + body: z.optional(z.never()), + path: z.object({ + calendar_id: types_id + }), + query: z.optional(z.object({ + end: z.optional(types_date_time), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of events.' + })), + job_id: z.optional(types_id), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of events to obtain.' + })), + start: z.optional(types_date_time) + })) }); export const ml_get_calendar_events_response = z.object({ - count: z.number(), - events: z.array(ml_types_calendar_event), + count: z.number(), + events: z.array(ml_types_calendar_event) }); export const ml_post_calendar_events_request = z.object({ - body: z.object({ - events: z.array(ml_types_calendar_event).register(z.globalRegistry, { - description: - 'A list of one of more scheduled events. The event’s start and end times can be specified as integer milliseconds since the epoch or as a string in ISO 8601 format.', + body: z.object({ + events: z.array(ml_types_calendar_event).register(z.globalRegistry, { + description: 'A list of one of more scheduled events. The event’s start and end times can be specified as integer milliseconds since the epoch or as a string in ISO 8601 format.' + }) }), - }), - path: z.object({ - calendar_id: types_id, - }), - query: z.optional(z.never()), + path: z.object({ + calendar_id: types_id + }), + query: z.optional(z.never()) }); export const ml_post_calendar_events_response = z.object({ - events: z.array(ml_types_calendar_event), + events: z.array(ml_types_calendar_event) }); export const ml_get_calendars_request = z.object({ - body: z.optional(ml_get_calendars), - path: z.optional(z.never()), - query: z.optional( - z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier.', - }) - ), - }) - ), + body: z.optional(ml_get_calendars), + path: z.optional(z.never()), + query: z.optional(z.object({ + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier.' + })) + })) }); export const ml_get_calendars_response = z.object({ - calendars: z.array(ml_get_calendars_calendar), - count: z.number(), + calendars: z.array(ml_get_calendars_calendar), + count: z.number() }); export const ml_get_calendars1_request = z.object({ - body: z.optional(ml_get_calendars), - path: z.optional(z.never()), - query: z.optional( - z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier.', - }) - ), - }) - ), + body: z.optional(ml_get_calendars), + path: z.optional(z.never()), + query: z.optional(z.object({ + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier.' + })) + })) }); export const ml_get_calendars1_response = z.object({ - calendars: z.array(ml_get_calendars_calendar), - count: z.number(), + calendars: z.array(ml_get_calendars_calendar), + count: z.number() }); export const ml_get_categories_request = z.object({ - body: z.optional(ml_get_categories), - path: z.object({ - job_id: types_id, - category_id: types_category_id, - }), - query: z.optional( - z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of categories.', - }) - ), - partition_field_value: z.optional( - z.string().register(z.globalRegistry, { - description: 'Only return categories for the specified partition.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of categories to obtain.', - }) - ), - }) - ), + body: z.optional(ml_get_categories), + path: z.object({ + job_id: types_id, + category_id: types_category_id + }), + query: z.optional(z.object({ + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of categories.' + })), + partition_field_value: z.optional(z.string().register(z.globalRegistry, { + description: 'Only return categories for the specified partition.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of categories to obtain.' + })) + })) }); export const ml_get_categories_response = z.object({ - categories: z.array(ml_types_category), - count: z.number(), + categories: z.array(ml_types_category), + count: z.number() }); export const ml_get_categories1_request = z.object({ - body: z.optional(ml_get_categories), - path: z.object({ - job_id: types_id, - category_id: types_category_id, - }), - query: z.optional( - z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of categories.', - }) - ), - partition_field_value: z.optional( - z.string().register(z.globalRegistry, { - description: 'Only return categories for the specified partition.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of categories to obtain.', - }) - ), - }) - ), + body: z.optional(ml_get_categories), + path: z.object({ + job_id: types_id, + category_id: types_category_id + }), + query: z.optional(z.object({ + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of categories.' + })), + partition_field_value: z.optional(z.string().register(z.globalRegistry, { + description: 'Only return categories for the specified partition.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of categories to obtain.' + })) + })) }); export const ml_get_categories1_response = z.object({ - categories: z.array(ml_types_category), - count: z.number(), + categories: z.array(ml_types_category), + count: z.number() }); export const ml_get_categories2_request = z.object({ - body: z.optional(ml_get_categories), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of categories.', - }) - ), - partition_field_value: z.optional( - z.string().register(z.globalRegistry, { - description: 'Only return categories for the specified partition.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of categories to obtain.', - }) - ), - }) - ), + body: z.optional(ml_get_categories), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of categories.' + })), + partition_field_value: z.optional(z.string().register(z.globalRegistry, { + description: 'Only return categories for the specified partition.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of categories to obtain.' + })) + })) }); export const ml_get_categories2_response = z.object({ - categories: z.array(ml_types_category), - count: z.number(), + categories: z.array(ml_types_category), + count: z.number() }); export const ml_get_categories3_request = z.object({ - body: z.optional(ml_get_categories), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of categories.', - }) - ), - partition_field_value: z.optional( - z.string().register(z.globalRegistry, { - description: 'Only return categories for the specified partition.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of categories to obtain.', - }) - ), - }) - ), + body: z.optional(ml_get_categories), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of categories.' + })), + partition_field_value: z.optional(z.string().register(z.globalRegistry, { + description: 'Only return categories for the specified partition.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of categories to obtain.' + })) + })) }); export const ml_get_categories3_response = z.object({ - categories: z.array(ml_types_category), - count: z.number(), + categories: z.array(ml_types_category), + count: z.number() }); export const ml_get_data_frame_analytics_stats_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value returns an empty data_frame_analytics array when there\nare no matches and the subset of results when there are partial matches.\nIf this parameter is `false`, the request returns a 404 status code when\nthere are no matches or only partial matches.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of data frame analytics jobs.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of data frame analytics jobs to obtain.', - }) - ), - verbose: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Defines whether the stats response should be verbose.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value returns an empty data_frame_analytics array when there\nare no matches and the subset of results when there are partial matches.\nIf this parameter is `false`, the request returns a 404 status code when\nthere are no matches or only partial matches.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of data frame analytics jobs.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of data frame analytics jobs to obtain.' + })), + verbose: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Defines whether the stats response should be verbose.' + })) + })) }); export const ml_get_data_frame_analytics_stats_response = z.object({ - count: z.number(), - data_frame_analytics: z.array(ml_types_dataframe_analytics).register(z.globalRegistry, { - description: - 'An array of objects that contain usage information for data frame analytics jobs, which are sorted by the id value in ascending order.', - }), + count: z.number(), + data_frame_analytics: z.array(ml_types_dataframe_analytics).register(z.globalRegistry, { + description: 'An array of objects that contain usage information for data frame analytics jobs, which are sorted by the id value in ascending order.' + }) }); export const ml_get_data_frame_analytics_stats1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value returns an empty data_frame_analytics array when there\nare no matches and the subset of results when there are partial matches.\nIf this parameter is `false`, the request returns a 404 status code when\nthere are no matches or only partial matches.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of data frame analytics jobs.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of data frame analytics jobs to obtain.', - }) - ), - verbose: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Defines whether the stats response should be verbose.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value returns an empty data_frame_analytics array when there\nare no matches and the subset of results when there are partial matches.\nIf this parameter is `false`, the request returns a 404 status code when\nthere are no matches or only partial matches.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of data frame analytics jobs.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of data frame analytics jobs to obtain.' + })), + verbose: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Defines whether the stats response should be verbose.' + })) + })) }); export const ml_get_data_frame_analytics_stats1_response = z.object({ - count: z.number(), - data_frame_analytics: z.array(ml_types_dataframe_analytics).register(z.globalRegistry, { - description: - 'An array of objects that contain usage information for data frame analytics jobs, which are sorted by the id value in ascending order.', - }), + count: z.number(), + data_frame_analytics: z.array(ml_types_dataframe_analytics).register(z.globalRegistry, { + description: 'An array of objects that contain usage information for data frame analytics jobs, which are sorted by the id value in ascending order.' + }) }); export const ml_get_datafeed_stats_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - datafeed_id: types_ids, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no datafeeds that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `datafeeds` array\nwhen there are no matches and the subset of results when there are\npartial matches. If this parameter is `false`, the request returns a\n`404` status code when there are no matches or only partial matches.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + datafeed_id: types_ids + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no datafeeds that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `datafeeds` array\nwhen there are no matches and the subset of results when there are\npartial matches. If this parameter is `false`, the request returns a\n`404` status code when there are no matches or only partial matches.' + })) + })) }); export const ml_get_datafeed_stats_response = z.object({ - count: z.number(), - datafeeds: z.array(ml_types_datafeed_stats), + count: z.number(), + datafeeds: z.array(ml_types_datafeed_stats) }); export const ml_get_datafeed_stats1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no datafeeds that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `datafeeds` array\nwhen there are no matches and the subset of results when there are\npartial matches. If this parameter is `false`, the request returns a\n`404` status code when there are no matches or only partial matches.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no datafeeds that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `datafeeds` array\nwhen there are no matches and the subset of results when there are\npartial matches. If this parameter is `false`, the request returns a\n`404` status code when there are no matches or only partial matches.' + })) + })) }); export const ml_get_datafeed_stats1_response = z.object({ - count: z.number(), - datafeeds: z.array(ml_types_datafeed_stats), + count: z.number(), + datafeeds: z.array(ml_types_datafeed_stats) }); export const ml_get_filters_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of filters.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of filters to obtain.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of filters.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of filters to obtain.' + })) + })) }); export const ml_get_filters_response = z.object({ - count: z.number(), - filters: z.array(ml_types_filter), + count: z.number(), + filters: z.array(ml_types_filter) }); export const ml_get_influencers_request = z.object({ - body: z.optional(ml_get_influencers), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - desc: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the results are sorted in descending order.', - }) - ), - end: z.optional(types_date_time), - exclude_interim: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the output excludes interim results. By default, interim results\nare included.', - }) - ), - influencer_score: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Returns influencers with anomaly scores greater than or equal to this\nvalue.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of influencers.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of influencers to obtain.', - }) - ), - sort: z.optional(types_field), - start: z.optional(types_date_time), - }) - ), + body: z.optional(ml_get_influencers), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + desc: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the results are sorted in descending order.' + })), + end: z.optional(types_date_time), + exclude_interim: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the output excludes interim results. By default, interim results\nare included.' + })), + influencer_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Returns influencers with anomaly scores greater than or equal to this\nvalue.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of influencers.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of influencers to obtain.' + })), + sort: z.optional(types_field), + start: z.optional(types_date_time) + })) }); export const ml_get_influencers_response = z.object({ - count: z.number(), - influencers: z.array(ml_types_influencer).register(z.globalRegistry, { - description: 'Array of influencer objects', - }), + count: z.number(), + influencers: z.array(ml_types_influencer).register(z.globalRegistry, { + description: 'Array of influencer objects' + }) }); export const ml_get_influencers1_request = z.object({ - body: z.optional(ml_get_influencers), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - desc: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the results are sorted in descending order.', - }) - ), - end: z.optional(types_date_time), - exclude_interim: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the output excludes interim results. By default, interim results\nare included.', - }) - ), - influencer_score: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Returns influencers with anomaly scores greater than or equal to this\nvalue.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of influencers.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of influencers to obtain.', - }) - ), - sort: z.optional(types_field), - start: z.optional(types_date_time), - }) - ), + body: z.optional(ml_get_influencers), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + desc: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the results are sorted in descending order.' + })), + end: z.optional(types_date_time), + exclude_interim: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the output excludes interim results. By default, interim results\nare included.' + })), + influencer_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Returns influencers with anomaly scores greater than or equal to this\nvalue.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of influencers.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of influencers to obtain.' + })), + sort: z.optional(types_field), + start: z.optional(types_date_time) + })) }); export const ml_get_influencers1_response = z.object({ - count: z.number(), - influencers: z.array(ml_types_influencer).register(z.globalRegistry, { - description: 'Array of influencer objects', - }), + count: z.number(), + influencers: z.array(ml_types_influencer).register(z.globalRegistry, { + description: 'Array of influencer objects' + }) }); export const ml_get_job_stats_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty `jobs` array when\nthere are no matches and the subset of results when there are partial\nmatches. If `false`, the API returns a `404` status\ncode when there are no matches or only partial matches.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty `jobs` array when\nthere are no matches and the subset of results when there are partial\nmatches. If `false`, the API returns a `404` status\ncode when there are no matches or only partial matches.' + })) + })) }); export const ml_get_job_stats_response = z.object({ - count: z.number(), - jobs: z.array(ml_types_job_stats), + count: z.number(), + jobs: z.array(ml_types_job_stats) }); export const ml_get_job_stats1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty `jobs` array when\nthere are no matches and the subset of results when there are partial\nmatches. If `false`, the API returns a `404` status\ncode when there are no matches or only partial matches.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty `jobs` array when\nthere are no matches and the subset of results when there are partial\nmatches. If `false`, the API returns a `404` status\ncode when there are no matches or only partial matches.' + })) + })) }); export const ml_get_job_stats1_response = z.object({ - count: z.number(), - jobs: z.array(ml_types_job_stats), + count: z.number(), + jobs: z.array(ml_types_job_stats) }); export const ml_get_memory_stats_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const ml_get_memory_stats_response = z.object({ - _nodes: types_node_statistics, - cluster_name: types_name, - nodes: z.record(z.string(), ml_get_memory_stats_memory), + _nodes: types_node_statistics, + cluster_name: types_name, + nodes: z.record(z.string(), ml_get_memory_stats_memory) }); export const ml_get_memory_stats1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - node_id: types_id, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + node_id: types_id + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const ml_get_memory_stats1_response = z.object({ - _nodes: types_node_statistics, - cluster_name: types_name, - nodes: z.record(z.string(), ml_get_memory_stats_memory), + _nodes: types_node_statistics, + cluster_name: types_name, + nodes: z.record(z.string(), ml_get_memory_stats_memory) }); export const ml_get_model_snapshot_upgrade_stats_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - job_id: types_id, - snapshot_id: types_id, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n - Contains wildcard expressions and there are no jobs that match.\n - Contains the _all string or no identifiers and there are no matches.\n - Contains wildcard expressions and there are only partial matches.\n\nThe default value is true, which returns an empty jobs array when there are no matches and the subset of results\nwhen there are partial matches. If this parameter is false, the request returns a 404 status code when there are\nno matches or only partial matches.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + job_id: types_id, + snapshot_id: types_id + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n - Contains wildcard expressions and there are no jobs that match.\n - Contains the _all string or no identifiers and there are no matches.\n - Contains wildcard expressions and there are only partial matches.\n\nThe default value is true, which returns an empty jobs array when there are no matches and the subset of results\nwhen there are partial matches. If this parameter is false, the request returns a 404 status code when there are\nno matches or only partial matches.' + })) + })) }); export const ml_get_model_snapshot_upgrade_stats_response = z.object({ - count: z.number(), - model_snapshot_upgrades: z.array(ml_types_model_snapshot_upgrade), + count: z.number(), + model_snapshot_upgrades: z.array(ml_types_model_snapshot_upgrade) }); export const ml_get_model_snapshots2_request = z.object({ - body: z.optional(ml_get_model_snapshots), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - desc: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the results are sorted in descending order.', - }) - ), - end: z.optional(types_date_time), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of snapshots.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of snapshots to obtain.', - }) - ), - sort: z.optional(types_field), - start: z.optional(types_date_time), - }) - ), + body: z.optional(ml_get_model_snapshots), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + desc: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the results are sorted in descending order.' + })), + end: z.optional(types_date_time), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of snapshots.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of snapshots to obtain.' + })), + sort: z.optional(types_field), + start: z.optional(types_date_time) + })) }); export const ml_get_model_snapshots2_response = z.object({ - count: z.number(), - model_snapshots: z.array(ml_types_model_snapshot), + count: z.number(), + model_snapshots: z.array(ml_types_model_snapshot) }); export const ml_get_model_snapshots3_request = z.object({ - body: z.optional(ml_get_model_snapshots), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - desc: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the results are sorted in descending order.', - }) - ), - end: z.optional(types_date_time), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of snapshots.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of snapshots to obtain.', - }) - ), - sort: z.optional(types_field), - start: z.optional(types_date_time), - }) - ), + body: z.optional(ml_get_model_snapshots), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + desc: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the results are sorted in descending order.' + })), + end: z.optional(types_date_time), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of snapshots.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of snapshots to obtain.' + })), + sort: z.optional(types_field), + start: z.optional(types_date_time) + })) }); export const ml_get_model_snapshots3_response = z.object({ - count: z.number(), - model_snapshots: z.array(ml_types_model_snapshot), + count: z.number(), + model_snapshots: z.array(ml_types_model_snapshot) }); export const ml_get_overall_buckets_request = z.object({ - body: z.optional(ml_get_overall_buckets), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the request returns an empty `jobs` array when there are no\nmatches and the subset of results when there are partial matches. If this\nparameter is `false`, the request returns a `404` status code when there\nare no matches or only partial matches.', - }) - ), - bucket_span: z.optional(types_duration), - end: z.optional(types_date_time), - exclude_interim: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the output excludes interim results.', - }) - ), - overall_score: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Returns overall buckets with overall scores greater than or equal to this\nvalue.', - }) - ), - start: z.optional(types_date_time), - top_n: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of top anomaly detection job bucket scores to be used in the\n`overall_score` calculation.', - }) - ), - }) - ), + body: z.optional(ml_get_overall_buckets), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the request returns an empty `jobs` array when there are no\nmatches and the subset of results when there are partial matches. If this\nparameter is `false`, the request returns a `404` status code when there\nare no matches or only partial matches.' + })), + bucket_span: z.optional(types_duration), + end: z.optional(types_date_time), + exclude_interim: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the output excludes interim results.' + })), + overall_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Returns overall buckets with overall scores greater than or equal to this\nvalue.' + })), + start: z.optional(types_date_time), + top_n: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of top anomaly detection job bucket scores to be used in the\n`overall_score` calculation.' + })) + })) }); export const ml_get_overall_buckets_response = z.object({ - count: z.number(), - overall_buckets: z.array(ml_types_overall_bucket).register(z.globalRegistry, { - description: 'Array of overall bucket objects', - }), + count: z.number(), + overall_buckets: z.array(ml_types_overall_bucket).register(z.globalRegistry, { + description: 'Array of overall bucket objects' + }) }); export const ml_get_overall_buckets1_request = z.object({ - body: z.optional(ml_get_overall_buckets), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the request returns an empty `jobs` array when there are no\nmatches and the subset of results when there are partial matches. If this\nparameter is `false`, the request returns a `404` status code when there\nare no matches or only partial matches.', - }) - ), - bucket_span: z.optional(types_duration), - end: z.optional(types_date_time), - exclude_interim: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the output excludes interim results.', - }) - ), - overall_score: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Returns overall buckets with overall scores greater than or equal to this\nvalue.', - }) - ), - start: z.optional(types_date_time), - top_n: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of top anomaly detection job bucket scores to be used in the\n`overall_score` calculation.', - }) - ), - }) - ), + body: z.optional(ml_get_overall_buckets), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the request returns an empty `jobs` array when there are no\nmatches and the subset of results when there are partial matches. If this\nparameter is `false`, the request returns a `404` status code when there\nare no matches or only partial matches.' + })), + bucket_span: z.optional(types_duration), + end: z.optional(types_date_time), + exclude_interim: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the output excludes interim results.' + })), + overall_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Returns overall buckets with overall scores greater than or equal to this\nvalue.' + })), + start: z.optional(types_date_time), + top_n: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of top anomaly detection job bucket scores to be used in the\n`overall_score` calculation.' + })) + })) }); export const ml_get_overall_buckets1_response = z.object({ - count: z.number(), - overall_buckets: z.array(ml_types_overall_bucket).register(z.globalRegistry, { - description: 'Array of overall bucket objects', - }), + count: z.number(), + overall_buckets: z.array(ml_types_overall_bucket).register(z.globalRegistry, { + description: 'Array of overall bucket objects' + }) }); export const ml_get_records_request = z.object({ - body: z.optional(ml_get_records), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - desc: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the results are sorted in descending order.', - }) - ), - end: z.optional(types_date_time), - exclude_interim: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the output excludes interim results.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of records.', - }) - ), - record_score: z.optional( - z.number().register(z.globalRegistry, { - description: 'Returns records with anomaly scores greater or equal than this value.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of records to obtain.', - }) - ), - sort: z.optional(types_field), - start: z.optional(types_date_time), - }) - ), + body: z.optional(ml_get_records), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + desc: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the results are sorted in descending order.' + })), + end: z.optional(types_date_time), + exclude_interim: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the output excludes interim results.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of records.' + })), + record_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Returns records with anomaly scores greater or equal than this value.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of records to obtain.' + })), + sort: z.optional(types_field), + start: z.optional(types_date_time) + })) }); export const ml_get_records_response = z.object({ - count: z.number(), - records: z.array(ml_types_anomaly), + count: z.number(), + records: z.array(ml_types_anomaly) }); export const ml_get_records1_request = z.object({ - body: z.optional(ml_get_records), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - desc: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the results are sorted in descending order.', - }) - ), - end: z.optional(types_date_time), - exclude_interim: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the output excludes interim results.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of records.', - }) - ), - record_score: z.optional( - z.number().register(z.globalRegistry, { - description: 'Returns records with anomaly scores greater or equal than this value.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of records to obtain.', - }) - ), - sort: z.optional(types_field), - start: z.optional(types_date_time), - }) - ), + body: z.optional(ml_get_records), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + desc: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the results are sorted in descending order.' + })), + end: z.optional(types_date_time), + exclude_interim: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the output excludes interim results.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of records.' + })), + record_score: z.optional(z.number().register(z.globalRegistry, { + description: 'Returns records with anomaly scores greater or equal than this value.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of records to obtain.' + })), + sort: z.optional(types_field), + start: z.optional(types_date_time) + })) }); export const ml_get_records1_response = z.object({ - count: z.number(), - records: z.array(ml_types_anomaly), + count: z.number(), + records: z.array(ml_types_anomaly) }); export const ml_get_trained_models_stats_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - model_id: types_ids, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n- Contains wildcard expressions and there are no models that match.\n- Contains the _all string or no identifiers and there are no matches.\n- Contains wildcard expressions and there are only partial matches.\n\nIf true, it returns an empty array when there are no matches and the\nsubset of results when there are partial matches.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of models.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of models to obtain.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + model_id: types_ids + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n- Contains wildcard expressions and there are no models that match.\n- Contains the _all string or no identifiers and there are no matches.\n- Contains wildcard expressions and there are only partial matches.\n\nIf true, it returns an empty array when there are no matches and the\nsubset of results when there are partial matches.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of models.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of models to obtain.' + })) + })) }); export const ml_get_trained_models_stats_response = z.object({ - count: z.number().register(z.globalRegistry, { - description: - 'The total number of trained model statistics that matched the requested ID patterns. Could be higher than the number of items in the trained_model_stats array as the size of the array is restricted by the supplied size parameter.', - }), - trained_model_stats: z.array(ml_types_trained_model_stats).register(z.globalRegistry, { - description: - 'An array of trained model statistics, which are sorted by the model_id value in ascending order.', - }), + count: z.number().register(z.globalRegistry, { + description: 'The total number of trained model statistics that matched the requested ID patterns. Could be higher than the number of items in the trained_model_stats array as the size of the array is restricted by the supplied size parameter.' + }), + trained_model_stats: z.array(ml_types_trained_model_stats).register(z.globalRegistry, { + description: 'An array of trained model statistics, which are sorted by the model_id value in ascending order.' + }) }); export const ml_get_trained_models_stats1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n- Contains wildcard expressions and there are no models that match.\n- Contains the _all string or no identifiers and there are no matches.\n- Contains wildcard expressions and there are only partial matches.\n\nIf true, it returns an empty array when there are no matches and the\nsubset of results when there are partial matches.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of models.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of models to obtain.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n- Contains wildcard expressions and there are no models that match.\n- Contains the _all string or no identifiers and there are no matches.\n- Contains wildcard expressions and there are only partial matches.\n\nIf true, it returns an empty array when there are no matches and the\nsubset of results when there are partial matches.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of models.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of models to obtain.' + })) + })) }); export const ml_get_trained_models_stats1_response = z.object({ - count: z.number().register(z.globalRegistry, { - description: - 'The total number of trained model statistics that matched the requested ID patterns. Could be higher than the number of items in the trained_model_stats array as the size of the array is restricted by the supplied size parameter.', - }), - trained_model_stats: z.array(ml_types_trained_model_stats).register(z.globalRegistry, { - description: - 'An array of trained model statistics, which are sorted by the model_id value in ascending order.', - }), + count: z.number().register(z.globalRegistry, { + description: 'The total number of trained model statistics that matched the requested ID patterns. Could be higher than the number of items in the trained_model_stats array as the size of the array is restricted by the supplied size parameter.' + }), + trained_model_stats: z.array(ml_types_trained_model_stats).register(z.globalRegistry, { + description: 'An array of trained model statistics, which are sorted by the model_id value in ascending order.' + }) }); export const ml_infer_trained_model_request = z.object({ - body: z.object({ - docs: z - .array(z.record(z.string(), z.record(z.string(), z.unknown()))) - .register(z.globalRegistry, { - description: - 'An array of objects to pass to the model for inference. The objects should contain a fields matching your\nconfigured trained model input. Typically, for NLP models, the field name is `text_field`.\nCurrently, for NLP models, only a single value is allowed.', - }), - inference_config: z.optional(ml_types_inference_config_update_container), - }), - path: z.object({ - model_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + docs: z.array(z.record(z.string(), z.record(z.string(), z.unknown()))).register(z.globalRegistry, { + description: 'An array of objects to pass to the model for inference. The objects should contain a fields matching your\nconfigured trained model input. Typically, for NLP models, the field name is `text_field`.\nCurrently, for NLP models, only a single value is allowed.' + }), + inference_config: z.optional(ml_types_inference_config_update_container) + }), + path: z.object({ + model_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const ml_infer_trained_model_response = z.object({ - inference_results: z.array(ml_types_inference_response_result), + inference_results: z.array(ml_types_inference_response_result) }); export const ml_open_job_request = z.object({ - body: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.object({ + timeout: z.optional(types_duration) + })), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const ml_open_job_response = z.object({ - opened: z.boolean(), - node: types_node_id, + opened: z.boolean(), + node: types_node_id }); export const ml_post_data_request = z.object({ - body: z.array(z.record(z.string(), z.unknown())), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - reset_end: z.optional(types_date_time), - reset_start: z.optional(types_date_time), - }) - ), + body: z.array(z.record(z.string(), z.unknown())), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + reset_end: z.optional(types_date_time), + reset_start: z.optional(types_date_time) + })) }); export const ml_post_data_response = z.object({ - job_id: types_id, - processed_record_count: z.number(), - processed_field_count: z.number(), - input_bytes: z.number(), - input_field_count: z.number(), - invalid_date_count: z.number(), - missing_field_count: z.number(), - out_of_order_timestamp_count: z.number(), - empty_bucket_count: z.number(), - sparse_bucket_count: z.number(), - bucket_count: z.number(), - earliest_record_timestamp: z.optional(types_epoch_time_unit_millis), - latest_record_timestamp: z.optional(types_epoch_time_unit_millis), - last_data_time: z.optional(types_epoch_time_unit_millis), - latest_empty_bucket_timestamp: z.optional(types_epoch_time_unit_millis), - latest_sparse_bucket_timestamp: z.optional(types_epoch_time_unit_millis), - input_record_count: z.number(), - log_time: z.optional(types_epoch_time_unit_millis), + job_id: types_id, + processed_record_count: z.number(), + processed_field_count: z.number(), + input_bytes: z.number(), + input_field_count: z.number(), + invalid_date_count: z.number(), + missing_field_count: z.number(), + out_of_order_timestamp_count: z.number(), + empty_bucket_count: z.number(), + sparse_bucket_count: z.number(), + bucket_count: z.number(), + earliest_record_timestamp: z.optional(types_epoch_time_unit_millis), + latest_record_timestamp: z.optional(types_epoch_time_unit_millis), + last_data_time: z.optional(types_epoch_time_unit_millis), + latest_empty_bucket_timestamp: z.optional(types_epoch_time_unit_millis), + latest_sparse_bucket_timestamp: z.optional(types_epoch_time_unit_millis), + input_record_count: z.number(), + log_time: z.optional(types_epoch_time_unit_millis) }); export const ml_put_trained_model_definition_part_request = z.object({ - body: z.object({ - definition: z.string().register(z.globalRegistry, { - description: 'The definition part for the model. Must be a base64 encoded string.', - }), - total_definition_length: z.number().register(z.globalRegistry, { - description: 'The total uncompressed definition length in bytes. Not base64 encoded.', - }), - total_parts: z.number().register(z.globalRegistry, { - description: 'The total number of parts that will be uploaded. Must be greater than 0.', + body: z.object({ + definition: z.string().register(z.globalRegistry, { + description: 'The definition part for the model. Must be a base64 encoded string.' + }), + total_definition_length: z.number().register(z.globalRegistry, { + description: 'The total uncompressed definition length in bytes. Not base64 encoded.' + }), + total_parts: z.number().register(z.globalRegistry, { + description: 'The total number of parts that will be uploaded. Must be greater than 0.' + }) }), - }), - path: z.object({ - model_id: types_id, - part: z.number().register(z.globalRegistry, { - description: - 'The definition part number. When the definition is loaded for inference the definition parts are streamed in the\norder of their part number. The first part must be `0` and the final part must be `total_parts - 1`.', + path: z.object({ + model_id: types_id, + part: z.number().register(z.globalRegistry, { + description: 'The definition part number. When the definition is loaded for inference the definition parts are streamed in the\norder of their part number. The first part must be `0` and the final part must be `total_parts - 1`.' + }) }), - }), - query: z.optional(z.never()), + query: z.optional(z.never()) }); export const ml_put_trained_model_definition_part_response = types_acknowledged_response_base; export const ml_put_trained_model_vocabulary_request = z.object({ - body: z.object({ - vocabulary: z.array(z.string()).register(z.globalRegistry, { - description: 'The model vocabulary, which must not be empty.', - }), - merges: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'The optional model merges if required by the tokenizer.', - }) - ), - scores: z.optional( - z.array(z.number()).register(z.globalRegistry, { - description: 'The optional vocabulary value scores if required by the tokenizer.', - }) - ), - }), - path: z.object({ - model_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + vocabulary: z.array(z.string()).register(z.globalRegistry, { + description: 'The model vocabulary, which must not be empty.' + }), + merges: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The optional model merges if required by the tokenizer.' + })), + scores: z.optional(z.array(z.number()).register(z.globalRegistry, { + description: 'The optional vocabulary value scores if required by the tokenizer.' + })) + }), + path: z.object({ + model_id: types_id + }), + query: z.optional(z.never()) }); export const ml_put_trained_model_vocabulary_response = types_acknowledged_response_base; export const ml_reset_job_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - job_id: types_id, - }), - query: z.optional( - z.object({ - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Should this request wait until the operation has completed before\nreturning.', - }) - ), - delete_user_annotations: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether annotations that have been added by the\nuser should be deleted along with any auto-generated annotations when the job is\nreset.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Should this request wait until the operation has completed before\nreturning.' + })), + delete_user_annotations: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether annotations that have been added by the\nuser should be deleted along with any auto-generated annotations when the job is\nreset.' + })) + })) }); export const ml_reset_job_response = types_acknowledged_response_base; export const ml_revert_model_snapshot_request = z.object({ - body: z.optional( - z.object({ - delete_intervening_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Refer to the description for the `delete_intervening_results` query parameter.', - }) - ), - }) - ), - path: z.object({ - job_id: types_id, - snapshot_id: types_id, - }), - query: z.optional( - z.object({ - delete_intervening_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, deletes the results in the time period between the latest\nresults and the time of the reverted snapshot. It also resets the model\nto accept records for this time period. If you choose not to delete\nintervening results when reverting a snapshot, the job will not accept\ninput data that is older than the current time. If you want to resend\ndata, then delete the intervening results.', - }) - ), - }) - ), + body: z.optional(z.object({ + delete_intervening_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Refer to the description for the `delete_intervening_results` query parameter.' + })) + })), + path: z.object({ + job_id: types_id, + snapshot_id: types_id + }), + query: z.optional(z.object({ + delete_intervening_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, deletes the results in the time period between the latest\nresults and the time of the reverted snapshot. It also resets the model\nto accept records for this time period. If you choose not to delete\nintervening results when reverting a snapshot, the job will not accept\ninput data that is older than the current time. If you want to resend\ndata, then delete the intervening results.' + })) + })) }); export const ml_revert_model_snapshot_response = z.object({ - model: ml_types_model_snapshot, + model: ml_types_model_snapshot }); export const ml_set_upgrade_mode_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - enabled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When `true`, it enables `upgrade_mode` which temporarily halts all job\nand datafeed tasks and prohibits new job and datafeed tasks from\nstarting.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When `true`, it enables `upgrade_mode` which temporarily halts all job\nand datafeed tasks and prohibits new job and datafeed tasks from\nstarting.' + })), + timeout: z.optional(types_duration) + })) }); export const ml_set_upgrade_mode_response = types_acknowledged_response_base; export const ml_start_data_frame_analytics_request = z.object({ - body: z.optional( - z.object({ - id: z.optional(types_id), - timeout: z.optional(types_duration), - }) - ), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.object({ + id: z.optional(types_id), + timeout: z.optional(types_duration) + })), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const ml_start_data_frame_analytics_response = z.object({ - acknowledged: z.boolean(), - node: types_node_id, + acknowledged: z.boolean(), + node: types_node_id }); export const ml_start_datafeed_request = z.object({ - body: z.optional( - z.object({ - end: z.optional(types_date_time), - start: z.optional(types_date_time), - timeout: z.optional(types_duration), - }) - ), - path: z.object({ - datafeed_id: types_id, - }), - query: z.optional( - z.object({ - end: z.optional(types_date_time), - start: z.optional(types_date_time), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.object({ + end: z.optional(types_date_time), + start: z.optional(types_date_time), + timeout: z.optional(types_duration) + })), + path: z.object({ + datafeed_id: types_id + }), + query: z.optional(z.object({ + end: z.optional(types_date_time), + start: z.optional(types_date_time), + timeout: z.optional(types_duration) + })) }); export const ml_start_datafeed_response = z.object({ - node: types_node_ids, - started: z.boolean().register(z.globalRegistry, { - description: - 'For a successful response, this value is always `true`. On failure, an exception is returned instead.', - }), + node: types_node_ids, + started: z.boolean().register(z.globalRegistry, { + description: 'For a successful response, this value is always `true`. On failure, an exception is returned instead.' + }) }); export const ml_start_trained_model_deployment_request = z.object({ - body: z.optional( - z.object({ - adaptive_allocations: z.optional(ml_types_adaptive_allocations_settings), - }) - ), - path: z.object({ - model_id: types_id, - }), - query: z.optional( - z.object({ - cache_size: z.optional(types_byte_size), - deployment_id: z.optional( - z.string().register(z.globalRegistry, { - description: 'A unique identifier for the deployment of the model.', - }) - ), - number_of_allocations: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of model allocations on each node where the model is deployed.\nAll allocations on a node share the same copy of the model in memory but use\na separate set of threads to evaluate the model.\nIncreasing this value generally increases the throughput.\nIf this setting is greater than the number of hardware threads\nit will automatically be changed to a value less than the number of hardware threads.\nIf adaptive_allocations is enabled, do not set this value, because it’s automatically set.', - }) - ), - priority: z.optional(ml_types_training_priority), - queue_capacity: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Specifies the number of inference requests that are allowed in the queue. After the number of requests exceeds\nthis value, new requests are rejected with a 429 error.', - }) - ), - threads_per_allocation: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Sets the number of threads used by each model allocation during inference. This generally increases\nthe inference speed. The inference process is a compute-bound process; any number\ngreater than the number of available hardware threads on the machine does not increase the\ninference speed. If this setting is greater than the number of hardware threads\nit will automatically be changed to a value less than the number of hardware threads.', - }) - ), - timeout: z.optional(types_duration), - wait_for: z.optional(ml_types_deployment_allocation_state), - }) - ), + body: z.optional(z.object({ + adaptive_allocations: z.optional(ml_types_adaptive_allocations_settings) + })), + path: z.object({ + model_id: types_id + }), + query: z.optional(z.object({ + cache_size: z.optional(types_byte_size), + deployment_id: z.optional(z.string().register(z.globalRegistry, { + description: 'A unique identifier for the deployment of the model.' + })), + number_of_allocations: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of model allocations on each node where the model is deployed.\nAll allocations on a node share the same copy of the model in memory but use\na separate set of threads to evaluate the model.\nIncreasing this value generally increases the throughput.\nIf this setting is greater than the number of hardware threads\nit will automatically be changed to a value less than the number of hardware threads.\nIf adaptive_allocations is enabled, do not set this value, because it’s automatically set.' + })), + priority: z.optional(ml_types_training_priority), + queue_capacity: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the number of inference requests that are allowed in the queue. After the number of requests exceeds\nthis value, new requests are rejected with a 429 error.' + })), + threads_per_allocation: z.optional(z.number().register(z.globalRegistry, { + description: 'Sets the number of threads used by each model allocation during inference. This generally increases\nthe inference speed. The inference process is a compute-bound process; any number\ngreater than the number of available hardware threads on the machine does not increase the\ninference speed. If this setting is greater than the number of hardware threads\nit will automatically be changed to a value less than the number of hardware threads.' + })), + timeout: z.optional(types_duration), + wait_for: z.optional(ml_types_deployment_allocation_state) + })) }); export const ml_start_trained_model_deployment_response = z.object({ - assignment: ml_types_trained_model_assignment, + assignment: ml_types_trained_model_assignment }); export const ml_stop_data_frame_analytics_request = z.object({ - body: z.optional( - z.object({ - id: z.optional(types_id), - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is true, which returns an empty data_frame_analytics\narray when there are no matches and the subset of results when there are\npartial matches. If this parameter is false, the request returns a 404\nstatus code when there are no matches or only partial matches.', - }) - ), - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the data frame analytics job is stopped forcefully.', - }) - ), - timeout: z.optional(types_duration), - }) - ), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is true, which returns an empty data_frame_analytics\narray when there are no matches and the subset of results when there are\npartial matches. If this parameter is false, the request returns a 404\nstatus code when there are no matches or only partial matches.', - }) - ), - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the data frame analytics job is stopped forcefully.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.object({ + id: z.optional(types_id), + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is true, which returns an empty data_frame_analytics\narray when there are no matches and the subset of results when there are\npartial matches. If this parameter is false, the request returns a 404\nstatus code when there are no matches or only partial matches.' + })), + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the data frame analytics job is stopped forcefully.' + })), + timeout: z.optional(types_duration) + })), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is true, which returns an empty data_frame_analytics\narray when there are no matches and the subset of results when there are\npartial matches. If this parameter is false, the request returns a 404\nstatus code when there are no matches or only partial matches.' + })), + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the data frame analytics job is stopped forcefully.' + })), + timeout: z.optional(types_duration) + })) }); export const ml_stop_data_frame_analytics_response = z.object({ - stopped: z.boolean(), + stopped: z.boolean() }); export const ml_stop_datafeed_request = z.object({ - body: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Refer to the description for the `allow_no_match` query parameter.', - }) - ), - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Refer to the description for the `force` query parameter.', - }) - ), - timeout: z.optional(types_duration), - }) - ), - path: z.object({ - datafeed_id: types_id, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n* Contains wildcard expressions and there are no datafeeds that match.\n* Contains the `_all` string or no identifiers and there are no matches.\n* Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty datafeeds array when there are no matches and the subset of results when\nthere are partial matches. If `false`, the API returns a 404 status code when there are no matches or only\npartial matches.', - }) - ), - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the datafeed is stopped forcefully.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Refer to the description for the `allow_no_match` query parameter.' + })), + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Refer to the description for the `force` query parameter.' + })), + timeout: z.optional(types_duration) + })), + path: z.object({ + datafeed_id: types_id + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n* Contains wildcard expressions and there are no datafeeds that match.\n* Contains the `_all` string or no identifiers and there are no matches.\n* Contains wildcard expressions and there are only partial matches.\n\nIf `true`, the API returns an empty datafeeds array when there are no matches and the subset of results when\nthere are partial matches. If `false`, the API returns a 404 status code when there are no matches or only\npartial matches.' + })), + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the datafeed is stopped forcefully.' + })), + timeout: z.optional(types_duration) + })) }); export const ml_stop_datafeed_response = z.object({ - stopped: z.boolean(), + stopped: z.boolean() }); export const ml_stop_trained_model_deployment_request = z.object({ - body: z.optional( - z.object({ - id: z.optional(types_id), - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request: contains wildcard expressions and there are no deployments that match;\ncontains the `_all` string or no identifiers and there are no matches; or contains wildcard expressions and\nthere are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the request returns a 404 status code when there are no matches or only partial matches.', - }) - ), - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "Forcefully stops the deployment, even if it is used by ingest pipelines. You can't use these pipelines until you\nrestart the model deployment.", - }) - ), - }) - ), - path: z.object({ - model_id: types_id, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request: contains wildcard expressions and there are no deployments that match;\ncontains the `_all` string or no identifiers and there are no matches; or contains wildcard expressions and\nthere are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the request returns a 404 status code when there are no matches or only partial matches.', - }) - ), - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "Forcefully stops the deployment, even if it is used by ingest pipelines. You can't use these pipelines until you\nrestart the model deployment.", - }) - ), - }) - ), + body: z.optional(z.object({ + id: z.optional(types_id), + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request: contains wildcard expressions and there are no deployments that match;\ncontains the `_all` string or no identifiers and there are no matches; or contains wildcard expressions and\nthere are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the request returns a 404 status code when there are no matches or only partial matches.' + })), + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Forcefully stops the deployment, even if it is used by ingest pipelines. You can\'t use these pipelines until you\nrestart the model deployment.' + })) + })), + path: z.object({ + model_id: types_id + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request: contains wildcard expressions and there are no deployments that match;\ncontains the `_all` string or no identifiers and there are no matches; or contains wildcard expressions and\nthere are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches.\nIf `false`, the request returns a 404 status code when there are no matches or only partial matches.' + })), + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Forcefully stops the deployment, even if it is used by ingest pipelines. You can\'t use these pipelines until you\nrestart the model deployment.' + })) + })) }); export const ml_stop_trained_model_deployment_response = z.object({ - stopped: z.boolean(), + stopped: z.boolean() }); export const ml_update_filter_request = z.object({ - body: z.object({ - add_items: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'The items to add to the filter.', - }) - ), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description for the filter.', - }) - ), - remove_items: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'The items to remove from the filter.', - }) - ), - }), - path: z.object({ - filter_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + add_items: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The items to add to the filter.' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description for the filter.' + })), + remove_items: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The items to remove from the filter.' + })) + }), + path: z.object({ + filter_id: types_id + }), + query: z.optional(z.never()) }); export const ml_update_filter_response = z.object({ - description: z.string(), - filter_id: types_id, - items: z.array(z.string()), + description: z.string(), + filter_id: types_id, + items: z.array(z.string()) }); export const ml_update_model_snapshot_request = z.object({ - body: z.object({ - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the model snapshot.', - }) - ), - retain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, this snapshot will not be deleted during automatic cleanup of\nsnapshots older than `model_snapshot_retention_days`. However, this\nsnapshot will be deleted when the job is deleted.', - }) - ), - }), - path: z.object({ - job_id: types_id, - snapshot_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the model snapshot.' + })), + retain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, this snapshot will not be deleted during automatic cleanup of\nsnapshots older than `model_snapshot_retention_days`. However, this\nsnapshot will be deleted when the job is deleted.' + })) + }), + path: z.object({ + job_id: types_id, + snapshot_id: types_id + }), + query: z.optional(z.never()) }); export const ml_update_model_snapshot_response = z.object({ - acknowledged: z.boolean(), - model: ml_types_model_snapshot, + acknowledged: z.boolean(), + model: ml_types_model_snapshot }); export const ml_update_trained_model_deployment_request = z.object({ - body: z.optional( - z.object({ - number_of_allocations: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of model allocations on each node where the model is deployed.\nAll allocations on a node share the same copy of the model in memory but use\na separate set of threads to evaluate the model.\nIncreasing this value generally increases the throughput.\nIf this setting is greater than the number of hardware threads\nit will automatically be changed to a value less than the number of hardware threads.\nIf adaptive_allocations is enabled, do not set this value, because it’s automatically set.', - }) - ), - adaptive_allocations: z.optional(ml_types_adaptive_allocations_settings), - }) - ), - path: z.object({ - model_id: types_id, - }), - query: z.optional( - z.object({ - number_of_allocations: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of model allocations on each node where the model is deployed.\nAll allocations on a node share the same copy of the model in memory but use\na separate set of threads to evaluate the model.\nIncreasing this value generally increases the throughput.\nIf this setting is greater than the number of hardware threads\nit will automatically be changed to a value less than the number of hardware threads.', - }) - ), - }) - ), + body: z.optional(z.object({ + number_of_allocations: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of model allocations on each node where the model is deployed.\nAll allocations on a node share the same copy of the model in memory but use\na separate set of threads to evaluate the model.\nIncreasing this value generally increases the throughput.\nIf this setting is greater than the number of hardware threads\nit will automatically be changed to a value less than the number of hardware threads.\nIf adaptive_allocations is enabled, do not set this value, because it’s automatically set.' + })), + adaptive_allocations: z.optional(ml_types_adaptive_allocations_settings) + })), + path: z.object({ + model_id: types_id + }), + query: z.optional(z.object({ + number_of_allocations: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of model allocations on each node where the model is deployed.\nAll allocations on a node share the same copy of the model in memory but use\na separate set of threads to evaluate the model.\nIncreasing this value generally increases the throughput.\nIf this setting is greater than the number of hardware threads\nit will automatically be changed to a value less than the number of hardware threads.' + })) + })) }); export const ml_update_trained_model_deployment_response = z.object({ - assignment: ml_types_trained_model_assignment, + assignment: ml_types_trained_model_assignment }); export const ml_upgrade_job_snapshot_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - job_id: types_id, - snapshot_id: types_id, - }), - query: z.optional( - z.object({ - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When true, the API won’t respond until the upgrade is complete.\nOtherwise, it responds as soon as the upgrade task is assigned to a node.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + job_id: types_id, + snapshot_id: types_id + }), + query: z.optional(z.object({ + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When true, the API won’t respond until the upgrade is complete.\nOtherwise, it responds as soon as the upgrade task is assigned to a node.' + })), + timeout: z.optional(types_duration) + })) }); export const ml_upgrade_job_snapshot_response = z.object({ - node: types_node_id, - completed: z.boolean().register(z.globalRegistry, { - description: 'When true, this means the task is complete. When false, it is still running.', - }), + node: types_node_id, + completed: z.boolean().register(z.globalRegistry, { + description: 'When true, this means the task is complete. When false, it is still running.' + }) }); export const mtermvectors_request = z.object({ - body: z.optional(mtermvectors), - path: z.optional(z.never()), - query: z.optional( - z.object({ - ids: z.optional( - z.array(types_id).register(z.globalRegistry, { - description: - 'A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body', - }) - ), - fields: z.optional(types_fields), - field_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies.', - }) - ), - offsets: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term offsets.', - }) - ), - payloads: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term payloads.', - }) - ), - positions: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term positions.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - realtime: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the request is real-time as opposed to near-real-time.', - }) - ), - routing: z.optional(types_routing), - term_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the response includes term frequency and document frequency.', - }) - ), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - }) - ), + body: z.optional(mtermvectors), + path: z.optional(z.never()), + query: z.optional(z.object({ + ids: z.optional(z.array(types_id).register(z.globalRegistry, { + description: 'A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body' + })), + fields: z.optional(types_fields), + field_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies.' + })), + offsets: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term offsets.' + })), + payloads: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term payloads.' + })), + positions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term positions.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + realtime: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request is real-time as opposed to near-real-time.' + })), + routing: z.optional(types_routing), + term_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the response includes term frequency and document frequency.' + })), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type) + })) }); export const mtermvectors_response = z.object({ - docs: z.array(global_mtermvectors_term_vectors_result), + docs: z.array(global_mtermvectors_term_vectors_result) }); export const mtermvectors1_request = z.object({ - body: z.optional(mtermvectors), - path: z.optional(z.never()), - query: z.optional( - z.object({ - ids: z.optional( - z.array(types_id).register(z.globalRegistry, { - description: - 'A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body', - }) - ), - fields: z.optional(types_fields), - field_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies.', - }) - ), - offsets: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term offsets.', - }) - ), - payloads: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term payloads.', - }) - ), - positions: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term positions.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - realtime: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the request is real-time as opposed to near-real-time.', - }) - ), - routing: z.optional(types_routing), - term_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the response includes term frequency and document frequency.', - }) - ), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - }) - ), + body: z.optional(mtermvectors), + path: z.optional(z.never()), + query: z.optional(z.object({ + ids: z.optional(z.array(types_id).register(z.globalRegistry, { + description: 'A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body' + })), + fields: z.optional(types_fields), + field_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies.' + })), + offsets: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term offsets.' + })), + payloads: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term payloads.' + })), + positions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term positions.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + realtime: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request is real-time as opposed to near-real-time.' + })), + routing: z.optional(types_routing), + term_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the response includes term frequency and document frequency.' + })), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type) + })) }); export const mtermvectors1_response = z.object({ - docs: z.array(global_mtermvectors_term_vectors_result), + docs: z.array(global_mtermvectors_term_vectors_result) }); export const mtermvectors2_request = z.object({ - body: z.optional(mtermvectors), - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - ids: z.optional( - z.array(types_id).register(z.globalRegistry, { - description: - 'A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body', - }) - ), - fields: z.optional(types_fields), - field_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies.', - }) - ), - offsets: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term offsets.', - }) - ), - payloads: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term payloads.', - }) - ), - positions: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term positions.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - realtime: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the request is real-time as opposed to near-real-time.', - }) - ), - routing: z.optional(types_routing), - term_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the response includes term frequency and document frequency.', - }) - ), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - }) - ), + body: z.optional(mtermvectors), + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + ids: z.optional(z.array(types_id).register(z.globalRegistry, { + description: 'A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body' + })), + fields: z.optional(types_fields), + field_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies.' + })), + offsets: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term offsets.' + })), + payloads: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term payloads.' + })), + positions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term positions.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + realtime: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request is real-time as opposed to near-real-time.' + })), + routing: z.optional(types_routing), + term_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the response includes term frequency and document frequency.' + })), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type) + })) }); export const mtermvectors2_response = z.object({ - docs: z.array(global_mtermvectors_term_vectors_result), + docs: z.array(global_mtermvectors_term_vectors_result) }); export const mtermvectors3_request = z.object({ - body: z.optional(mtermvectors), - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - ids: z.optional( - z.array(types_id).register(z.globalRegistry, { - description: - 'A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body', - }) - ), - fields: z.optional(types_fields), - field_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies.', - }) - ), - offsets: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term offsets.', - }) - ), - payloads: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term payloads.', - }) - ), - positions: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term positions.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - realtime: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the request is real-time as opposed to near-real-time.', - }) - ), - routing: z.optional(types_routing), - term_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the response includes term frequency and document frequency.', - }) - ), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - }) - ), + body: z.optional(mtermvectors), + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + ids: z.optional(z.array(types_id).register(z.globalRegistry, { + description: 'A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body' + })), + fields: z.optional(types_fields), + field_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies.' + })), + offsets: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term offsets.' + })), + payloads: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term payloads.' + })), + positions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term positions.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + realtime: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request is real-time as opposed to near-real-time.' + })), + routing: z.optional(types_routing), + term_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the response includes term frequency and document frequency.' + })), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type) + })) }); export const mtermvectors3_response = z.object({ - docs: z.array(global_mtermvectors_term_vectors_result), + docs: z.array(global_mtermvectors_term_vectors_result) }); export const nodes_clear_repositories_metering_archive_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - node_id: types_node_ids, - max_archive_version: z.number().register(z.globalRegistry, { - description: 'Specifies the maximum `archive_version` to be cleared from the archive.', + body: z.optional(z.never()), + path: z.object({ + node_id: types_node_ids, + max_archive_version: z.number().register(z.globalRegistry, { + description: 'Specifies the maximum `archive_version` to be cleared from the archive.' + }) }), - }), - query: z.optional(z.never()), + query: z.optional(z.never()) }); -export const nodes_clear_repositories_metering_archive_response = - nodes_clear_repositories_metering_archive_response_base; +export const nodes_clear_repositories_metering_archive_response = nodes_clear_repositories_metering_archive_response_base; export const nodes_get_repositories_metering_info_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - node_id: types_node_ids, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + node_id: types_node_ids + }), + query: z.optional(z.never()) }); -export const nodes_get_repositories_metering_info_response = - nodes_get_repositories_metering_info_response_base; +export const nodes_get_repositories_metering_info_response = nodes_get_repositories_metering_info_response_base; export const nodes_hot_threads_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - ignore_idle_threads: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, known idle threads (e.g. waiting in a socket select, or to get\na task from an empty queue) are filtered out.', - }) - ), - interval: z.optional(types_duration), - snapshots: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of samples of thread stacktrace.', - }) - ), - threads: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the number of hot threads to provide information for.', - }) - ), - timeout: z.optional(types_duration), - type: z.optional(types_thread_type), - sort: z.optional(types_thread_type), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + ignore_idle_threads: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, known idle threads (e.g. waiting in a socket select, or to get\na task from an empty queue) are filtered out.' + })), + interval: z.optional(types_duration), + snapshots: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of samples of thread stacktrace.' + })), + threads: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the number of hot threads to provide information for.' + })), + timeout: z.optional(types_duration), + type: z.optional(types_thread_type), + sort: z.optional(types_thread_type) + })) }); export const nodes_hot_threads_response = z.record(z.string(), z.unknown()); export const nodes_hot_threads1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - node_id: types_node_ids, - }), - query: z.optional( - z.object({ - ignore_idle_threads: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, known idle threads (e.g. waiting in a socket select, or to get\na task from an empty queue) are filtered out.', - }) - ), - interval: z.optional(types_duration), - snapshots: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of samples of thread stacktrace.', - }) - ), - threads: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the number of hot threads to provide information for.', - }) - ), - timeout: z.optional(types_duration), - type: z.optional(types_thread_type), - sort: z.optional(types_thread_type), - }) - ), + body: z.optional(z.never()), + path: z.object({ + node_id: types_node_ids + }), + query: z.optional(z.object({ + ignore_idle_threads: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, known idle threads (e.g. waiting in a socket select, or to get\na task from an empty queue) are filtered out.' + })), + interval: z.optional(types_duration), + snapshots: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of samples of thread stacktrace.' + })), + threads: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the number of hot threads to provide information for.' + })), + timeout: z.optional(types_duration), + type: z.optional(types_thread_type), + sort: z.optional(types_thread_type) + })) }); export const nodes_hot_threads1_response = z.record(z.string(), z.unknown()); export const nodes_info_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, returns settings in flat format.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns settings in flat format.' + })), + timeout: z.optional(types_duration) + })) }); export const nodes_info_response = nodes_info_response_base; export const nodes_info1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - node_id: types_node_ids, - }), - query: z.optional( - z.object({ - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, returns settings in flat format.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + node_id: types_node_ids + }), + query: z.optional(z.object({ + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns settings in flat format.' + })), + timeout: z.optional(types_duration) + })) }); export const nodes_info1_response = nodes_info_response_base; export const nodes_info2_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - metric: nodes_info_nodes_info_metrics, - }), - query: z.optional( - z.object({ - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, returns settings in flat format.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + metric: nodes_info_nodes_info_metrics + }), + query: z.optional(z.object({ + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns settings in flat format.' + })), + timeout: z.optional(types_duration) + })) }); export const nodes_info2_response = nodes_info_response_base; export const nodes_info3_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - node_id: types_node_ids, - metric: nodes_info_nodes_info_metrics, - }), - query: z.optional( - z.object({ - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, returns settings in flat format.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + node_id: types_node_ids, + metric: nodes_info_nodes_info_metrics + }), + query: z.optional(z.object({ + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns settings in flat format.' + })), + timeout: z.optional(types_duration) + })) }); export const nodes_info3_response = nodes_info_response_base; export const nodes_reload_secure_settings_request = z.object({ - body: z.optional(nodes_reload_secure_settings), - path: z.optional(z.never()), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.optional(nodes_reload_secure_settings), + path: z.optional(z.never()), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const nodes_reload_secure_settings_response = nodes_reload_secure_settings_response_base; export const nodes_reload_secure_settings1_request = z.object({ - body: z.optional(nodes_reload_secure_settings), - path: z.object({ - node_id: types_node_ids, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.optional(nodes_reload_secure_settings), + path: z.object({ + node_id: types_node_ids + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const nodes_reload_secure_settings1_response = nodes_reload_secure_settings_response_base; export const nodes_usage_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const nodes_usage_response = nodes_usage_response_base; export const nodes_usage1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - node_id: types_node_ids, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + node_id: types_node_ids + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const nodes_usage1_response = nodes_usage_response_base; export const nodes_usage2_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - metric: nodes_usage_nodes_usage_metrics, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + metric: nodes_usage_nodes_usage_metrics + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const nodes_usage2_response = nodes_usage_response_base; export const nodes_usage3_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - node_id: types_node_ids, - metric: nodes_usage_nodes_usage_metrics, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + node_id: types_node_ids, + metric: nodes_usage_nodes_usage_metrics + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const nodes_usage3_response = nodes_usage_response_base; export const query_rules_delete_rule_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - ruleset_id: types_id, - rule_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + ruleset_id: types_id, + rule_id: types_id + }), + query: z.optional(z.never()) }); export const query_rules_delete_rule_response = types_acknowledged_response_base; export const query_rules_get_rule_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - ruleset_id: types_id, - rule_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + ruleset_id: types_id, + rule_id: types_id + }), + query: z.optional(z.never()) }); export const query_rules_get_rule_response = query_rules_types_query_rule; export const query_rules_put_rule_request = z.object({ - body: z.object({ - type: query_rules_types_query_rule_type, - criteria: z.union([ - query_rules_types_query_rule_criteria, - z.array(query_rules_types_query_rule_criteria), - ]), - actions: query_rules_types_query_rule_actions, - priority: z.optional(z.number()), - }), - path: z.object({ - ruleset_id: types_id, - rule_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + type: query_rules_types_query_rule_type, + criteria: z.union([ + query_rules_types_query_rule_criteria, + z.array(query_rules_types_query_rule_criteria) + ]), + actions: query_rules_types_query_rule_actions, + priority: z.optional(z.number()) + }), + path: z.object({ + ruleset_id: types_id, + rule_id: types_id + }), + query: z.optional(z.never()) }); export const query_rules_put_rule_response = z.object({ - result: types_result, + result: types_result }); export const query_rules_delete_ruleset_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - ruleset_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + ruleset_id: types_id + }), + query: z.optional(z.never()) }); export const query_rules_delete_ruleset_response = types_acknowledged_response_base; export const query_rules_get_ruleset_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - ruleset_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + ruleset_id: types_id + }), + query: z.optional(z.never()) }); export const query_rules_get_ruleset_response = query_rules_types_query_ruleset; export const query_rules_put_ruleset_request = z.object({ - body: z.object({ - rules: z.union([query_rules_types_query_rule, z.array(query_rules_types_query_rule)]), - }), - path: z.object({ - ruleset_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + rules: z.union([ + query_rules_types_query_rule, + z.array(query_rules_types_query_rule) + ]) + }), + path: z.object({ + ruleset_id: types_id + }), + query: z.optional(z.never()) }); export const query_rules_put_ruleset_response = z.object({ - result: types_result, + result: types_result }); export const query_rules_list_rulesets_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'The offset from the first result to fetch.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of results to retrieve.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + from: z.optional(z.number().register(z.globalRegistry, { + description: 'The offset from the first result to fetch.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of results to retrieve.' + })) + })) }); export const query_rules_list_rulesets_response = z.object({ - count: z.number(), - results: z.array(query_rules_list_rulesets_query_ruleset_list_item), + count: z.number(), + results: z.array(query_rules_list_rulesets_query_ruleset_list_item) }); export const query_rules_test_request = z.object({ - body: z.object({ - match_criteria: z - .record(z.string(), z.record(z.string(), z.unknown())) - .register(z.globalRegistry, { - description: - 'The match criteria to apply to rules in the given query ruleset.\nMatch criteria should match the keys defined in the `criteria.metadata` field of the rule.', - }), - }), - path: z.object({ - ruleset_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + match_criteria: z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'The match criteria to apply to rules in the given query ruleset.\nMatch criteria should match the keys defined in the `criteria.metadata` field of the rule.' + }) + }), + path: z.object({ + ruleset_id: types_id + }), + query: z.optional(z.never()) }); export const query_rules_test_response = z.object({ - total_matched_rules: z.number(), - matched_rules: z.array(query_rules_test_query_ruleset_matched_rule), + total_matched_rules: z.number(), + matched_rules: z.array(query_rules_test_query_ruleset_matched_rule) }); export const reindex_rethrottle_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - task_id: types_id, - }), - query: z.object({ - requests_per_second: z.number().register(z.globalRegistry, { - description: - 'The throttle for this request in sub-requests per second.\nIt can be either `-1` to turn off throttling or any decimal number like `1.7` or `12` to throttle to that level.', + body: z.optional(z.never()), + path: z.object({ + task_id: types_id }), - }), + query: z.object({ + requests_per_second: z.number().register(z.globalRegistry, { + description: 'The throttle for this request in sub-requests per second.\nIt can be either `-1` to turn off throttling or any decimal number like `1.7` or `12` to throttle to that level.' + }) + }) }); export const reindex_rethrottle_response = z.object({ - nodes: z.record(z.string(), global_reindex_rethrottle_reindex_node), + nodes: z.record(z.string(), global_reindex_rethrottle_reindex_node) }); export const rollup_delete_job_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const rollup_delete_job_response = z.object({ - acknowledged: z.boolean(), - task_failures: z.optional(z.array(types_task_failure)), + acknowledged: z.boolean(), + task_failures: z.optional(z.array(types_task_failure)) }); export const rollup_get_jobs_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const rollup_get_jobs_response = z.object({ - jobs: z.array(rollup_get_jobs_rollup_job), + jobs: z.array(rollup_get_jobs_rollup_job) }); export const rollup_put_job_request = z.object({ - body: z.object({ - cron: z.string().register(z.globalRegistry, { - description: - 'A cron string which defines the intervals when the rollup job should be executed. When the interval\ntriggers, the indexer attempts to rollup the data in the index pattern. The cron pattern is unrelated\nto the time interval of the data being rolled up. For example, you may wish to create hourly rollups\nof your document but to only run the indexer on a daily basis at midnight, as defined by the cron. The\ncron pattern is defined just like a Watcher cron schedule.', + body: z.object({ + cron: z.string().register(z.globalRegistry, { + description: 'A cron string which defines the intervals when the rollup job should be executed. When the interval\ntriggers, the indexer attempts to rollup the data in the index pattern. The cron pattern is unrelated\nto the time interval of the data being rolled up. For example, you may wish to create hourly rollups\nof your document but to only run the indexer on a daily basis at midnight, as defined by the cron. The\ncron pattern is defined just like a Watcher cron schedule.' + }), + groups: rollup_types_groupings, + index_pattern: z.string().register(z.globalRegistry, { + description: 'The index or index pattern to roll up. Supports wildcard-style patterns (`logstash-*`). The job attempts to\nrollup the entire index or index-pattern.' + }), + metrics: z.optional(z.array(rollup_types_field_metric).register(z.globalRegistry, { + description: 'Defines the metrics to collect for each grouping tuple. By default, only the doc_counts are collected for each\ngroup. To make rollup useful, you will often add metrics like averages, mins, maxes, etc. Metrics are defined\non a per-field basis and for each field you configure which metric should be collected.' + })), + page_size: z.number().register(z.globalRegistry, { + description: 'The number of bucket results that are processed on each iteration of the rollup indexer. A larger value tends\nto execute faster, but requires more memory during processing. This value has no effect on how the data is\nrolled up; it is merely used for tweaking the speed or memory cost of the indexer.' + }), + rollup_index: types_index_name, + timeout: z.optional(types_duration), + headers: z.optional(types_http_headers) }), - groups: rollup_types_groupings, - index_pattern: z.string().register(z.globalRegistry, { - description: - 'The index or index pattern to roll up. Supports wildcard-style patterns (`logstash-*`). The job attempts to\nrollup the entire index or index-pattern.', - }), - metrics: z.optional( - z.array(rollup_types_field_metric).register(z.globalRegistry, { - description: - 'Defines the metrics to collect for each grouping tuple. By default, only the doc_counts are collected for each\ngroup. To make rollup useful, you will often add metrics like averages, mins, maxes, etc. Metrics are defined\non a per-field basis and for each field you configure which metric should be collected.', - }) - ), - page_size: z.number().register(z.globalRegistry, { - description: - 'The number of bucket results that are processed on each iteration of the rollup indexer. A larger value tends\nto execute faster, but requires more memory during processing. This value has no effect on how the data is\nrolled up; it is merely used for tweaking the speed or memory cost of the indexer.', + path: z.object({ + id: types_id }), - rollup_index: types_index_name, - timeout: z.optional(types_duration), - headers: z.optional(types_http_headers), - }), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + query: z.optional(z.never()) }); export const rollup_put_job_response = types_acknowledged_response_base; export const rollup_get_jobs1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const rollup_get_jobs1_response = z.object({ - jobs: z.array(rollup_get_jobs_rollup_job), + jobs: z.array(rollup_get_jobs_rollup_job) }); export const rollup_get_rollup_caps_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); -export const rollup_get_rollup_caps_response = z.record( - z.string(), - rollup_get_rollup_caps_rollup_capabilities -); +export const rollup_get_rollup_caps_response = z.record(z.string(), rollup_get_rollup_caps_rollup_capabilities); export const rollup_get_rollup_caps1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); -export const rollup_get_rollup_caps1_response = z.record( - z.string(), - rollup_get_rollup_caps_rollup_capabilities -); +export const rollup_get_rollup_caps1_response = z.record(z.string(), rollup_get_rollup_caps_rollup_capabilities); export const rollup_get_rollup_index_caps_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_ids, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + index: types_ids + }), + query: z.optional(z.never()) }); -export const rollup_get_rollup_index_caps_response = z.record( - z.string(), - rollup_get_rollup_index_caps_index_capabilities -); +export const rollup_get_rollup_index_caps_response = z.record(z.string(), rollup_get_rollup_index_caps_index_capabilities); export const rollup_start_job_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const rollup_start_job_response = z.object({ - started: z.boolean(), + started: z.boolean() }); export const rollup_stop_job_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If set to `true`, causes the API to block until the indexer state completely stops.\nIf set to `false`, the API returns immediately and the indexer is stopped asynchronously in the background.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If set to `true`, causes the API to block until the indexer state completely stops.\nIf set to `false`, the API returns immediately and the indexer is stopped asynchronously in the background.' + })) + })) }); export const rollup_stop_job_response = z.object({ - stopped: z.boolean(), + stopped: z.boolean() }); export const search_application_delete_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + name: types_name + }), + query: z.optional(z.never()) }); export const search_application_delete_response = types_acknowledged_response_base; export const search_application_delete_behavioral_analytics_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + name: types_name + }), + query: z.optional(z.never()) }); -export const search_application_delete_behavioral_analytics_response = - types_acknowledged_response_base; +export const search_application_delete_behavioral_analytics_response = types_acknowledged_response_base; export const search_application_get_behavioral_analytics1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: z.array(types_name).register(z.globalRegistry, { - description: 'A list of analytics collections to limit the returned information', + body: z.optional(z.never()), + path: z.object({ + name: z.array(types_name).register(z.globalRegistry, { + description: 'A list of analytics collections to limit the returned information' + }) }), - }), - query: z.optional(z.never()), + query: z.optional(z.never()) }); -export const search_application_get_behavioral_analytics1_response = z.record( - z.string(), - search_application_types_analytics_collection -); +export const search_application_get_behavioral_analytics1_response = z.record(z.string(), search_application_types_analytics_collection); export const search_application_put_behavioral_analytics_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + name: types_name + }), + query: z.optional(z.never()) }); -export const search_application_put_behavioral_analytics_response = - search_application_put_behavioral_analytics_analytics_acknowledge_response_base; +export const search_application_put_behavioral_analytics_response = search_application_put_behavioral_analytics_analytics_acknowledge_response_base; export const search_application_get_behavioral_analytics_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); -export const search_application_get_behavioral_analytics_response = z.record( - z.string(), - search_application_types_analytics_collection -); +export const search_application_get_behavioral_analytics_response = z.record(z.string(), search_application_types_analytics_collection); export const search_application_post_behavioral_analytics_event_request = z.object({ - body: z.record(z.string(), z.unknown()), - path: z.object({ - collection_name: types_name, - event_type: search_application_types_event_type, - }), - query: z.optional( - z.object({ - debug: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Whether the response type has to include more details', - }) - ), - }) - ), + body: z.record(z.string(), z.unknown()), + path: z.object({ + collection_name: types_name, + event_type: search_application_types_event_type + }), + query: z.optional(z.object({ + debug: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether the response type has to include more details' + })) + })) }); export const search_application_post_behavioral_analytics_event_response = z.object({ - accepted: z.boolean(), - event: z.optional(z.record(z.string(), z.unknown())), + accepted: z.boolean(), + event: z.optional(z.record(z.string(), z.unknown())) }); export const search_application_render_query_request = z.object({ - body: z.optional( - z.object({ - params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - }) - ), - path: z.object({ - name: types_name, - }), - query: z.optional(z.never()), + body: z.optional(z.object({ + params: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))) + })), + path: z.object({ + name: types_name + }), + query: z.optional(z.never()) }); export const search_application_render_query_response = z.record(z.string(), z.unknown()); export const searchable_snapshots_cache_stats_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const searchable_snapshots_cache_stats_response = z.object({ - nodes: z.record(z.string(), searchable_snapshots_cache_stats_node), + nodes: z.record(z.string(), searchable_snapshots_cache_stats_node) }); export const searchable_snapshots_cache_stats1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - node_id: types_node_ids, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + node_id: types_node_ids + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const searchable_snapshots_cache_stats1_response = z.object({ - nodes: z.record(z.string(), searchable_snapshots_cache_stats_node), + nodes: z.record(z.string(), searchable_snapshots_cache_stats_node) }); export const searchable_snapshots_clear_cache_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether specified concrete indices should be ignored when unavailable (missing or closed)', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + expand_wildcards: z.optional(types_expand_wildcards), + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether specified concrete indices should be ignored when unavailable (missing or closed)' + })) + })) }); export const searchable_snapshots_clear_cache_response = z.record(z.string(), z.unknown()); export const searchable_snapshots_clear_cache1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether specified concrete indices should be ignored when unavailable (missing or closed)', - }) - ), - }) - ), -}); - -export const searchable_snapshots_clear_cache1_response = z.record(z.string(), z.unknown()); - -export const searchable_snapshots_mount_request = z.object({ - body: z.object({ - index: types_index_name, - renamed_index: z.optional(types_index_name), - index_settings: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: 'The settings that should be added to the index when it is mounted.', - }) - ), - ignore_index_settings: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'The names of settings that should be removed from the index when it is mounted.', - }) - ), - }), - path: z.object({ - repository: types_name, - snapshot: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the request blocks until the operation is complete.', - }) - ), - storage: z.optional( - z.string().register(z.globalRegistry, { - description: 'The mount option for the searchable snapshot index.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + expand_wildcards: z.optional(types_expand_wildcards), + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether specified concrete indices should be ignored when unavailable (missing or closed)' + })) + })) +}); + +export const searchable_snapshots_clear_cache1_response = z.record(z.string(), z.unknown()); + +export const searchable_snapshots_mount_request = z.object({ + body: z.object({ + index: types_index_name, + renamed_index: z.optional(types_index_name), + index_settings: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'The settings that should be added to the index when it is mounted.' + })), + ignore_index_settings: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The names of settings that should be removed from the index when it is mounted.' + })) + }), + path: z.object({ + repository: types_name, + snapshot: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request blocks until the operation is complete.' + })), + storage: z.optional(z.string().register(z.globalRegistry, { + description: 'The mount option for the searchable snapshot index.' + })) + })) }); export const searchable_snapshots_mount_response = z.object({ - snapshot: searchable_snapshots_mount_mounted_snapshot, + snapshot: searchable_snapshots_mount_mounted_snapshot }); export const searchable_snapshots_stats_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - level: z.optional(searchable_snapshots_types_stats_level), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + level: z.optional(searchable_snapshots_types_stats_level) + })) }); export const searchable_snapshots_stats_response = z.object({ - stats: z.record(z.string(), z.unknown()), - total: z.record(z.string(), z.unknown()), + stats: z.record(z.string(), z.unknown()), + total: z.record(z.string(), z.unknown()) }); export const searchable_snapshots_stats1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - level: z.optional(searchable_snapshots_types_stats_level), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + level: z.optional(searchable_snapshots_types_stats_level) + })) }); export const searchable_snapshots_stats1_response = z.object({ - stats: z.record(z.string(), z.unknown()), - total: z.record(z.string(), z.unknown()), + stats: z.record(z.string(), z.unknown()), + total: z.record(z.string(), z.unknown()) }); export const security_activate_user_profile_request = z.object({ - body: z.object({ - access_token: z.optional( - z.string().register(z.globalRegistry, { - description: - "The user's Elasticsearch access token or JWT.\nBoth `access` and `id` JWT token types are supported and they depend on the underlying JWT realm configuration.\nIf you specify the `access_token` grant type, this parameter is required.\nIt is not valid with other grant types.", - }) - ), - grant_type: security_types_grant_type, - password: z.optional( - z.string().register(z.globalRegistry, { - description: - "The user's password.\nIf you specify the `password` grant type, this parameter is required.\nIt is not valid with other grant types.", - }) - ), - username: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The username that identifies the user.\nIf you specify the `password` grant type, this parameter is required.\nIt is not valid with other grant types.', - }) - ), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.object({ + access_token: z.optional(z.string().register(z.globalRegistry, { + description: 'The user\'s Elasticsearch access token or JWT.\nBoth `access` and `id` JWT token types are supported and they depend on the underlying JWT realm configuration.\nIf you specify the `access_token` grant type, this parameter is required.\nIt is not valid with other grant types.' + })), + grant_type: security_types_grant_type, + password: z.optional(z.string().register(z.globalRegistry, { + description: 'The user\'s password.\nIf you specify the `password` grant type, this parameter is required.\nIt is not valid with other grant types.' + })), + username: z.optional(z.string().register(z.globalRegistry, { + description: 'The username that identifies the user.\nIf you specify the `password` grant type, this parameter is required.\nIt is not valid with other grant types.' + })) + }), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_activate_user_profile_response = security_types_user_profile_with_metadata; export const security_authenticate_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_authenticate_response = z.object({ - api_key: z.optional(security_authenticate_authenticate_api_key), - authentication_realm: security_types_realm_info, - email: z.optional(z.union([z.string(), z.null()])), - full_name: z.optional(z.union([types_name, z.string(), z.null()])), - lookup_realm: security_types_realm_info, - metadata: types_metadata, - roles: z.array(z.string()), - username: types_username, - enabled: z.boolean(), - authentication_type: z.string(), - token: z.optional(security_authenticate_token), + api_key: z.optional(security_authenticate_authenticate_api_key), + authentication_realm: security_types_realm_info, + email: z.optional(z.union([ + z.string(), + z.null() + ])), + full_name: z.optional(z.union([ + types_name, + z.string(), + z.null() + ])), + lookup_realm: security_types_realm_info, + metadata: types_metadata, + roles: z.array(z.string()), + username: types_username, + enabled: z.boolean(), + authentication_type: z.string(), + token: z.optional(security_authenticate_token) }); export const security_bulk_delete_role_request = z.object({ - body: z.object({ - names: z.array(z.string()).register(z.globalRegistry, { - description: 'An array of role names to delete', + body: z.object({ + names: z.array(z.string()).register(z.globalRegistry, { + description: 'An array of role names to delete' + }) }), - }), - path: z.optional(z.never()), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + path: z.optional(z.never()), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_bulk_delete_role_response = z.object({ - deleted: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'Array of deleted roles', - }) - ), - not_found: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'Array of roles that could not be found', - }) - ), - errors: z.optional(security_types_bulk_error), + deleted: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Array of deleted roles' + })), + not_found: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Array of roles that could not be found' + })), + errors: z.optional(security_types_bulk_error) }); export const security_change_password1_request = z.object({ - body: security_change_password, - path: z.object({ - username: types_username, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: security_change_password, + path: z.object({ + username: types_username + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_change_password1_response = z.record(z.string(), z.unknown()); export const security_change_password_request = z.object({ - body: security_change_password, - path: z.object({ - username: types_username, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: security_change_password, + path: z.object({ + username: types_username + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_change_password_response = z.record(z.string(), z.unknown()); export const security_change_password3_request = z.object({ - body: security_change_password, - path: z.optional(z.never()), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: security_change_password, + path: z.optional(z.never()), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_change_password3_response = z.record(z.string(), z.unknown()); export const security_change_password2_request = z.object({ - body: security_change_password, - path: z.optional(z.never()), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: security_change_password, + path: z.optional(z.never()), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_change_password2_response = z.record(z.string(), z.unknown()); export const security_clear_api_key_cache_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - ids: types_ids, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + ids: types_ids + }), + query: z.optional(z.never()) }); export const security_clear_api_key_cache_response = z.object({ - _nodes: types_node_statistics, - cluster_name: types_name, - nodes: z.record(z.string(), security_types_cluster_node), + _nodes: types_node_statistics, + cluster_name: types_name, + nodes: z.record(z.string(), security_types_cluster_node) }); export const security_clear_cached_privileges_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - application: types_names, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + application: types_names + }), + query: z.optional(z.never()) }); export const security_clear_cached_privileges_response = z.object({ - _nodes: types_node_statistics, - cluster_name: types_name, - nodes: z.record(z.string(), security_types_cluster_node), + _nodes: types_node_statistics, + cluster_name: types_name, + nodes: z.record(z.string(), security_types_cluster_node) }); export const security_clear_cached_realms_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - realms: types_names, - }), - query: z.optional( - z.object({ - usernames: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'A comma-separated list of the users to clear from the cache.\nIf you do not specify this parameter, the API evicts all users from the user cache.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + realms: types_names + }), + query: z.optional(z.object({ + usernames: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A comma-separated list of the users to clear from the cache.\nIf you do not specify this parameter, the API evicts all users from the user cache.' + })) + })) }); export const security_clear_cached_realms_response = z.object({ - _nodes: types_node_statistics, - cluster_name: types_name, - nodes: z.record(z.string(), security_types_cluster_node), + _nodes: types_node_statistics, + cluster_name: types_name, + nodes: z.record(z.string(), security_types_cluster_node) }); export const security_clear_cached_roles_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_names, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + name: types_names + }), + query: z.optional(z.never()) }); export const security_clear_cached_roles_response = z.object({ - _nodes: types_node_statistics, - cluster_name: types_name, - nodes: z.record(z.string(), security_types_cluster_node), + _nodes: types_node_statistics, + cluster_name: types_name, + nodes: z.record(z.string(), security_types_cluster_node) }); export const security_clear_cached_service_tokens_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - namespace: types_namespace, - service: types_service, - name: types_names, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + namespace: types_namespace, + service: types_service, + name: types_names + }), + query: z.optional(z.never()) }); export const security_clear_cached_service_tokens_response = z.object({ - _nodes: types_node_statistics, - cluster_name: types_name, - nodes: z.record(z.string(), security_types_cluster_node), + _nodes: types_node_statistics, + cluster_name: types_name, + nodes: z.record(z.string(), security_types_cluster_node) }); export const security_invalidate_api_key_request = z.object({ - body: z.object({ - id: z.optional(types_id), - ids: z.optional( - z.array(types_id).register(z.globalRegistry, { - description: - 'A list of API key ids.\nThis parameter cannot be used with any of `name`, `realm_name`, or `username`.', - }) - ), - name: z.optional(types_name), - owner: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Query API keys owned by the currently authenticated user.\nThe `realm_name` or `username` parameters cannot be specified when this parameter is set to `true` as they are assumed to be the currently authenticated ones.\n\nNOTE: At least one of `ids`, `name`, `username`, and `realm_name` must be specified if `owner` is `false`.', - }) - ), - realm_name: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The name of an authentication realm.\nThis parameter cannot be used with either `ids` or `name`, or when `owner` flag is set to `true`.', - }) - ), - username: z.optional(types_username), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.object({ + id: z.optional(types_id), + ids: z.optional(z.array(types_id).register(z.globalRegistry, { + description: 'A list of API key ids.\nThis parameter cannot be used with any of `name`, `realm_name`, or `username`.' + })), + name: z.optional(types_name), + owner: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Query API keys owned by the currently authenticated user.\nThe `realm_name` or `username` parameters cannot be specified when this parameter is set to `true` as they are assumed to be the currently authenticated ones.\n\nNOTE: At least one of `ids`, `name`, `username`, and `realm_name` must be specified if `owner` is `false`.' + })), + realm_name: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of an authentication realm.\nThis parameter cannot be used with either `ids` or `name`, or when `owner` flag is set to `true`.' + })), + username: z.optional(types_username) + }), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_invalidate_api_key_response = z.object({ - error_count: z.number().register(z.globalRegistry, { - description: 'The number of errors that were encountered when invalidating the API keys.', - }), - error_details: z.optional( - z.array(types_error_cause).register(z.globalRegistry, { - description: - 'Details about the errors.\nThis field is not present in the response when `error_count` is `0`.', + error_count: z.number().register(z.globalRegistry, { + description: 'The number of errors that were encountered when invalidating the API keys.' + }), + error_details: z.optional(z.array(types_error_cause).register(z.globalRegistry, { + description: 'Details about the errors.\nThis field is not present in the response when `error_count` is `0`.' + })), + invalidated_api_keys: z.array(z.string()).register(z.globalRegistry, { + description: 'The IDs of the API keys that were invalidated as part of this request.' + }), + previously_invalidated_api_keys: z.array(z.string()).register(z.globalRegistry, { + description: 'The IDs of the API keys that were already invalidated.' }) - ), - invalidated_api_keys: z.array(z.string()).register(z.globalRegistry, { - description: 'The IDs of the API keys that were invalidated as part of this request.', - }), - previously_invalidated_api_keys: z.array(z.string()).register(z.globalRegistry, { - description: 'The IDs of the API keys that were already invalidated.', - }), }); export const security_delete_service_token_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - namespace: types_namespace, - service: types_service, - name: types_name, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: z.optional(z.never()), + path: z.object({ + namespace: types_namespace, + service: types_service, + name: types_name + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_delete_service_token_response = z.object({ - found: z.boolean().register(z.globalRegistry, { - description: - 'If the service account token is successfully deleted, the request returns `{"found": true}`.\nOtherwise, the response will have status code 404 and `found` is set to `false`.', - }), + found: z.boolean().register(z.globalRegistry, { + description: 'If the service account token is successfully deleted, the request returns `{"found": true}`.\nOtherwise, the response will have status code 404 and `found` is set to `false`.' + }) }); export const security_create_service_token1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - namespace: types_namespace, - service: types_service, - name: types_name, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: z.optional(z.never()), + path: z.object({ + namespace: types_namespace, + service: types_service, + name: types_name + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_create_service_token1_response = z.object({ - created: z.boolean(), - token: security_create_service_token_token, + created: z.boolean(), + token: security_create_service_token_token }); export const security_create_service_token_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - namespace: types_namespace, - service: types_service, - name: types_name, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: z.optional(z.never()), + path: z.object({ + namespace: types_namespace, + service: types_service, + name: types_name + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_create_service_token_response = z.object({ - created: z.boolean(), - token: security_create_service_token_token, + created: z.boolean(), + token: security_create_service_token_token }); export const security_create_service_token2_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - namespace: types_namespace, - service: types_service, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: z.optional(z.never()), + path: z.object({ + namespace: types_namespace, + service: types_service + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_create_service_token2_response = z.object({ - created: z.boolean(), - token: security_create_service_token_token, + created: z.boolean(), + token: security_create_service_token_token }); export const security_delegate_pki_request = z.object({ - body: z.object({ - x509_certificate_chain: z.array(z.string()).register(z.globalRegistry, { - description: - "The X509Certificate chain, which is represented as an ordered string array.\nEach string in the array is a base64-encoded (Section 4 of RFC4648 - not base64url-encoded) of the certificate's DER encoding.\n\nThe first element is the target certificate that contains the subject distinguished name that is requesting access.\nThis may be followed by additional certificates; each subsequent certificate is used to certify the previous one.", + body: z.object({ + x509_certificate_chain: z.array(z.string()).register(z.globalRegistry, { + description: 'The X509Certificate chain, which is represented as an ordered string array.\nEach string in the array is a base64-encoded (Section 4 of RFC4648 - not base64url-encoded) of the certificate\'s DER encoding.\n\nThe first element is the target certificate that contains the subject distinguished name that is requesting access.\nThis may be followed by additional certificates; each subsequent certificate is used to certify the previous one.' + }) }), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_delegate_pki_response = z.object({ - access_token: z.string().register(z.globalRegistry, { - description: - "An access token associated with the subject distinguished name of the client's certificate.", - }), - expires_in: z.number().register(z.globalRegistry, { - description: 'The amount of time (in seconds) before the token expires.', - }), - type: z.string().register(z.globalRegistry, { - description: 'The type of token.', - }), - authentication: z.optional(security_delegate_pki_authentication), + access_token: z.string().register(z.globalRegistry, { + description: 'An access token associated with the subject distinguished name of the client\'s certificate.' + }), + expires_in: z.number().register(z.globalRegistry, { + description: 'The amount of time (in seconds) before the token expires.' + }), + type: z.string().register(z.globalRegistry, { + description: 'The type of token.' + }), + authentication: z.optional(security_delegate_pki_authentication) }); export const security_delete_privileges_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - application: types_name, - name: types_names, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: z.optional(z.never()), + path: z.object({ + application: types_name, + name: types_names + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); -export const security_delete_privileges_response = z.record( - z.string(), - z.record(z.string(), security_delete_privileges_found_status) -); +export const security_delete_privileges_response = z.record(z.string(), z.record(z.string(), security_delete_privileges_found_status)); export const security_get_privileges2_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - application: types_name, - name: types_names, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + application: types_name, + name: types_names + }), + query: z.optional(z.never()) }); -export const security_get_privileges2_response = z.record( - z.string(), - z.record(z.string(), security_put_privileges_actions) -); +export const security_get_privileges2_response = z.record(z.string(), z.record(z.string(), security_put_privileges_actions)); export const security_delete_role_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_delete_role_response = z.object({ - found: z.boolean().register(z.globalRegistry, { - description: - 'If the role is successfully deleted, `found` is `true`.\nOtherwise, `found` is `false`.', - }), + found: z.boolean().register(z.globalRegistry, { + description: 'If the role is successfully deleted, `found` is `true`.\nOtherwise, `found` is `false`.' + }) }); export const security_delete_role_mapping_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_delete_role_mapping_response = z.object({ - found: z.boolean().register(z.globalRegistry, { - description: - 'If the mapping is successfully deleted, `found` is `true`.\nOtherwise, `found` is `false`.', - }), + found: z.boolean().register(z.globalRegistry, { + description: 'If the mapping is successfully deleted, `found` is `true`.\nOtherwise, `found` is `false`.' + }) }); export const security_delete_user_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - username: types_username, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: z.optional(z.never()), + path: z.object({ + username: types_username + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_delete_user_response = z.object({ - found: z.boolean().register(z.globalRegistry, { - description: - 'If the user is successfully deleted, the request returns `{"found": true}`.\nOtherwise, `found` is set to `false`.', - }), + found: z.boolean().register(z.globalRegistry, { + description: 'If the user is successfully deleted, the request returns `{"found": true}`.\nOtherwise, `found` is set to `false`.' + }) }); export const security_get_user_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - username: z.union([types_username, z.array(types_username)]), - }), - query: z.optional( - z.object({ - with_profile_uid: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Determines whether to retrieve the user profile UID, if it exists, for the users.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + username: z.union([ + types_username, + z.array(types_username) + ]) + }), + query: z.optional(z.object({ + with_profile_uid: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Determines whether to retrieve the user profile UID, if it exists, for the users.' + })) + })) }); export const security_get_user_response = z.record(z.string(), security_types_user); export const security_put_user1_request = z.object({ - body: security_put_user, - path: z.object({ - username: types_username, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: security_put_user, + path: z.object({ + username: types_username + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_put_user1_response = z.object({ - created: z.boolean().register(z.globalRegistry, { - description: - 'A successful call returns a JSON structure that shows whether the user has been created or updated.\nWhen an existing user is updated, `created` is set to `false`.', - }), + created: z.boolean().register(z.globalRegistry, { + description: 'A successful call returns a JSON structure that shows whether the user has been created or updated.\nWhen an existing user is updated, `created` is set to `false`.' + }) }); export const security_put_user_request = z.object({ - body: security_put_user, - path: z.object({ - username: types_username, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: security_put_user, + path: z.object({ + username: types_username + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_put_user_response = z.object({ - created: z.boolean().register(z.globalRegistry, { - description: - 'A successful call returns a JSON structure that shows whether the user has been created or updated.\nWhen an existing user is updated, `created` is set to `false`.', - }), + created: z.boolean().register(z.globalRegistry, { + description: 'A successful call returns a JSON structure that shows whether the user has been created or updated.\nWhen an existing user is updated, `created` is set to `false`.' + }) }); export const security_disable_user1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - username: types_username, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: z.optional(z.never()), + path: z.object({ + username: types_username + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_disable_user1_response = z.record(z.string(), z.unknown()); export const security_disable_user_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - username: types_username, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: z.optional(z.never()), + path: z.object({ + username: types_username + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_disable_user_response = z.record(z.string(), z.unknown()); export const security_disable_user_profile1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - uid: security_types_user_profile_id, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: z.optional(z.never()), + path: z.object({ + uid: security_types_user_profile_id + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_disable_user_profile1_response = types_acknowledged_response_base; export const security_disable_user_profile_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - uid: security_types_user_profile_id, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: z.optional(z.never()), + path: z.object({ + uid: security_types_user_profile_id + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_disable_user_profile_response = types_acknowledged_response_base; export const security_enable_user1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - username: types_username, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: z.optional(z.never()), + path: z.object({ + username: types_username + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_enable_user1_response = z.record(z.string(), z.unknown()); export const security_enable_user_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - username: types_username, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: z.optional(z.never()), + path: z.object({ + username: types_username + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_enable_user_response = z.record(z.string(), z.unknown()); export const security_enable_user_profile1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - uid: security_types_user_profile_id, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: z.optional(z.never()), + path: z.object({ + uid: security_types_user_profile_id + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_enable_user_profile1_response = types_acknowledged_response_base; export const security_enable_user_profile_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - uid: security_types_user_profile_id, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: z.optional(z.never()), + path: z.object({ + uid: security_types_user_profile_id + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_enable_user_profile_response = types_acknowledged_response_base; export const security_enroll_kibana_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_enroll_kibana_response = z.object({ - token: security_enroll_kibana_token, - http_ca: z.string().register(z.globalRegistry, { - description: - 'The CA certificate used to sign the node certificates that Elasticsearch uses for TLS on the HTTP layer.\nThe certificate is returned as a Base64 encoded string of the ASN.1 DER encoding of the certificate.', - }), + token: security_enroll_kibana_token, + http_ca: z.string().register(z.globalRegistry, { + description: 'The CA certificate used to sign the node certificates that Elasticsearch uses for TLS on the HTTP layer.\nThe certificate is returned as a Base64 encoded string of the ASN.1 DER encoding of the certificate.' + }) }); export const security_enroll_node_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_enroll_node_response = z.object({ - http_ca_key: z.string().register(z.globalRegistry, { - description: - 'The CA private key that can be used by the new node in order to sign its certificate for the HTTP layer, as a Base64 encoded string of the ASN.1 DER encoding of the key.', - }), - http_ca_cert: z.string().register(z.globalRegistry, { - description: - 'The CA certificate that can be used by the new node in order to sign its certificate for the HTTP layer, as a Base64 encoded string of the ASN.1 DER encoding of the certificate.', - }), - transport_ca_cert: z.string().register(z.globalRegistry, { - description: - 'The CA certificate that is used to sign the TLS certificate for the transport layer, as a Base64 encoded string of the ASN.1 DER encoding of the certificate.', - }), - transport_key: z.string().register(z.globalRegistry, { - description: - 'The private key that the node can use for TLS for its transport layer, as a Base64 encoded string of the ASN.1 DER encoding of the key.', - }), - transport_cert: z.string().register(z.globalRegistry, { - description: - 'The certificate that the node can use for TLS for its transport layer, as a Base64 encoded string of the ASN.1 DER encoding of the certificate.', - }), - nodes_addresses: z.array(z.string()).register(z.globalRegistry, { - description: - 'A list of transport addresses in the form of `host:port` for the nodes that are already members of the cluster.', - }), + http_ca_key: z.string().register(z.globalRegistry, { + description: 'The CA private key that can be used by the new node in order to sign its certificate for the HTTP layer, as a Base64 encoded string of the ASN.1 DER encoding of the key.' + }), + http_ca_cert: z.string().register(z.globalRegistry, { + description: 'The CA certificate that can be used by the new node in order to sign its certificate for the HTTP layer, as a Base64 encoded string of the ASN.1 DER encoding of the certificate.' + }), + transport_ca_cert: z.string().register(z.globalRegistry, { + description: 'The CA certificate that is used to sign the TLS certificate for the transport layer, as a Base64 encoded string of the ASN.1 DER encoding of the certificate.' + }), + transport_key: z.string().register(z.globalRegistry, { + description: 'The private key that the node can use for TLS for its transport layer, as a Base64 encoded string of the ASN.1 DER encoding of the key.' + }), + transport_cert: z.string().register(z.globalRegistry, { + description: 'The certificate that the node can use for TLS for its transport layer, as a Base64 encoded string of the ASN.1 DER encoding of the certificate.' + }), + nodes_addresses: z.array(z.string()).register(z.globalRegistry, { + description: 'A list of transport addresses in the form of `host:port` for the nodes that are already members of the cluster.' + }) }); export const security_get_builtin_privileges_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_get_builtin_privileges_response = z.object({ - cluster: z.array(security_types_cluster_privilege).register(z.globalRegistry, { - description: - 'The list of cluster privileges that are understood by this version of Elasticsearch.', - }), - index: z.array(types_index_name).register(z.globalRegistry, { - description: - 'The list of index privileges that are understood by this version of Elasticsearch.', - }), - remote_cluster: z.array(security_types_remote_cluster_privilege).register(z.globalRegistry, { - description: - 'The list of remote_cluster privileges that are understood by this version of Elasticsearch.', - }), + cluster: z.array(security_types_cluster_privilege).register(z.globalRegistry, { + description: 'The list of cluster privileges that are understood by this version of Elasticsearch.' + }), + index: z.array(types_index_name).register(z.globalRegistry, { + description: 'The list of index privileges that are understood by this version of Elasticsearch.' + }), + remote_cluster: z.array(security_types_remote_cluster_privilege).register(z.globalRegistry, { + description: 'The list of remote_cluster privileges that are understood by this version of Elasticsearch.' + }) }); export const security_get_privileges_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); -export const security_get_privileges_response = z.record( - z.string(), - z.record(z.string(), security_put_privileges_actions) -); +export const security_get_privileges_response = z.record(z.string(), z.record(z.string(), security_put_privileges_actions)); export const security_put_privileges1_request = z.object({ - body: security_put_privileges, - path: z.optional(z.never()), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: security_put_privileges, + path: z.optional(z.never()), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); -export const security_put_privileges1_response = z.record( - z.string(), - z.record(z.string(), security_types_created_status) -); +export const security_put_privileges1_response = z.record(z.string(), z.record(z.string(), security_types_created_status)); export const security_put_privileges_request = z.object({ - body: security_put_privileges, - path: z.optional(z.never()), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: security_put_privileges, + path: z.optional(z.never()), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); -export const security_put_privileges_response = z.record( - z.string(), - z.record(z.string(), security_types_created_status) -); +export const security_put_privileges_response = z.record(z.string(), z.record(z.string(), security_types_created_status)); export const security_get_privileges1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - application: types_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + application: types_name + }), + query: z.optional(z.never()) }); -export const security_get_privileges1_response = z.record( - z.string(), - z.record(z.string(), security_put_privileges_actions) -); +export const security_get_privileges1_response = z.record(z.string(), z.record(z.string(), security_put_privileges_actions)); export const security_get_service_credentials_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - namespace: types_namespace, - service: types_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + namespace: types_namespace, + service: types_name + }), + query: z.optional(z.never()) }); export const security_get_service_credentials_response = z.object({ - service_account: z.string(), - count: z.number(), - tokens: z.record(z.string(), types_metadata), - nodes_credentials: security_get_service_credentials_nodes_credentials, + service_account: z.string(), + count: z.number(), + tokens: z.record(z.string(), types_metadata), + nodes_credentials: security_get_service_credentials_nodes_credentials }); export const security_get_stats_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_get_stats_response = z.object({ - nodes: z.record(z.string(), security_types_node_security_stats).register(z.globalRegistry, { - description: 'A map of node IDs to security statistics for that node.', - }), + nodes: z.record(z.string(), security_types_node_security_stats).register(z.globalRegistry, { + description: 'A map of node IDs to security statistics for that node.' + }) }); export const security_invalidate_token_request = z.object({ - body: z.object({ - token: z.optional( - z.string().register(z.globalRegistry, { - description: - 'An access token.\nThis parameter cannot be used if any of `refresh_token`, `realm_name`, or `username` are used.', - }) - ), - refresh_token: z.optional( - z.string().register(z.globalRegistry, { - description: - 'A refresh token.\nThis parameter cannot be used if any of `refresh_token`, `realm_name`, or `username` are used.', - }) - ), - realm_name: z.optional(types_name), - username: z.optional(types_username), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.object({ + token: z.optional(z.string().register(z.globalRegistry, { + description: 'An access token.\nThis parameter cannot be used if any of `refresh_token`, `realm_name`, or `username` are used.' + })), + refresh_token: z.optional(z.string().register(z.globalRegistry, { + description: 'A refresh token.\nThis parameter cannot be used if any of `refresh_token`, `realm_name`, or `username` are used.' + })), + realm_name: z.optional(types_name), + username: z.optional(types_username) + }), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_invalidate_token_response = z.object({ - error_count: z.number().register(z.globalRegistry, { - description: 'The number of errors that were encountered when invalidating the tokens.', - }), - error_details: z.optional( - z.array(types_error_cause).register(z.globalRegistry, { - description: - 'Details about the errors.\nThis field is not present in the response when `error_count` is `0`.', + error_count: z.number().register(z.globalRegistry, { + description: 'The number of errors that were encountered when invalidating the tokens.' + }), + error_details: z.optional(z.array(types_error_cause).register(z.globalRegistry, { + description: 'Details about the errors.\nThis field is not present in the response when `error_count` is `0`.' + })), + invalidated_tokens: z.number().register(z.globalRegistry, { + description: 'The number of the tokens that were invalidated as part of this request.' + }), + previously_invalidated_tokens: z.number().register(z.globalRegistry, { + description: 'The number of tokens that were already invalidated.' }) - ), - invalidated_tokens: z.number().register(z.globalRegistry, { - description: 'The number of the tokens that were invalidated as part of this request.', - }), - previously_invalidated_tokens: z.number().register(z.globalRegistry, { - description: 'The number of tokens that were already invalidated.', - }), }); export const security_get_token_request = z.object({ - body: z.object({ - grant_type: z.optional(security_get_token_access_token_grant_type), - scope: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The scope of the token.\nCurrently tokens are only issued for a scope of FULL regardless of the value sent with the request.', - }) - ), - password: z.optional(types_password), - kerberos_ticket: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The base64 encoded kerberos ticket.\nIf you specify the `_kerberos` grant type, this parameter is required.\nThis parameter is not valid with any other supported grant type.', - }) - ), - refresh_token: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The string that was returned when you created the token, which enables you to extend its life.\nIf you specify the `refresh_token` grant type, this parameter is required.\nThis parameter is not valid with any other supported grant type.', - }) - ), - username: z.optional(types_username), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.object({ + grant_type: z.optional(security_get_token_access_token_grant_type), + scope: z.optional(z.string().register(z.globalRegistry, { + description: 'The scope of the token.\nCurrently tokens are only issued for a scope of FULL regardless of the value sent with the request.' + })), + password: z.optional(types_password), + kerberos_ticket: z.optional(z.string().register(z.globalRegistry, { + description: 'The base64 encoded kerberos ticket.\nIf you specify the `_kerberos` grant type, this parameter is required.\nThis parameter is not valid with any other supported grant type.' + })), + refresh_token: z.optional(z.string().register(z.globalRegistry, { + description: 'The string that was returned when you created the token, which enables you to extend its life.\nIf you specify the `refresh_token` grant type, this parameter is required.\nThis parameter is not valid with any other supported grant type.' + })), + username: z.optional(types_username) + }), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_get_token_response = z.object({ - access_token: z.string(), - expires_in: z.number(), - scope: z.optional(z.string()), - type: z.string(), - refresh_token: z.optional(z.string()), - kerberos_authentication_response_token: z.optional(z.string()), - authentication: security_get_token_authenticated_user, + access_token: z.string(), + expires_in: z.number(), + scope: z.optional(z.string()), + type: z.string(), + refresh_token: z.optional(z.string()), + kerberos_authentication_response_token: z.optional(z.string()), + authentication: security_get_token_authenticated_user }); export const security_get_user1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - with_profile_uid: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Determines whether to retrieve the user profile UID, if it exists, for the users.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + with_profile_uid: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Determines whether to retrieve the user profile UID, if it exists, for the users.' + })) + })) }); export const security_get_user1_response = z.record(z.string(), security_types_user); export const security_get_user_profile_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - uid: z.union([security_types_user_profile_id, z.array(security_types_user_profile_id)]), - }), - query: z.optional( - z.object({ - data: z.optional(z.union([z.string(), z.array(z.string())])), - }) - ), + body: z.optional(z.never()), + path: z.object({ + uid: z.union([ + security_types_user_profile_id, + z.array(security_types_user_profile_id) + ]) + }), + query: z.optional(z.object({ + data: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])) + })) }); export const security_get_user_profile_response = z.object({ - profiles: z.array(security_types_user_profile_with_metadata).register(z.globalRegistry, { - description: - 'A successful call returns the JSON representation of the user profile and its internal versioning numbers.\nThe API returns an empty object if no profile document is found for the provided `uid`.\nThe content of the data field is not returned by default to avoid deserializing a potential large payload.', - }), - errors: z.optional(security_get_user_profile_get_user_profile_errors), + profiles: z.array(security_types_user_profile_with_metadata).register(z.globalRegistry, { + description: 'A successful call returns the JSON representation of the user profile and its internal versioning numbers.\nThe API returns an empty object if no profile document is found for the provided `uid`.\nThe content of the data field is not returned by default to avoid deserializing a potential large payload.' + }), + errors: z.optional(security_get_user_profile_get_user_profile_errors) }); export const security_has_privileges_request = z.object({ - body: security_has_privileges, - path: z.optional(z.never()), - query: z.optional(z.never()), + body: security_has_privileges, + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_has_privileges_response = z.object({ - application: security_has_privileges_applications_privileges, - cluster: z.record(z.string(), z.boolean()), - has_all_requested: z.boolean(), - index: z.record(z.string(), security_has_privileges_privileges), - username: types_username, + application: security_has_privileges_applications_privileges, + cluster: z.record(z.string(), z.boolean()), + has_all_requested: z.boolean(), + index: z.record(z.string(), security_has_privileges_privileges), + username: types_username }); export const security_has_privileges1_request = z.object({ - body: security_has_privileges, - path: z.optional(z.never()), - query: z.optional(z.never()), + body: security_has_privileges, + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_has_privileges1_response = z.object({ - application: security_has_privileges_applications_privileges, - cluster: z.record(z.string(), z.boolean()), - has_all_requested: z.boolean(), - index: z.record(z.string(), security_has_privileges_privileges), - username: types_username, + application: security_has_privileges_applications_privileges, + cluster: z.record(z.string(), z.boolean()), + has_all_requested: z.boolean(), + index: z.record(z.string(), security_has_privileges_privileges), + username: types_username }); export const security_has_privileges2_request = z.object({ - body: security_has_privileges, - path: z.object({ - user: types_name, - }), - query: z.optional(z.never()), + body: security_has_privileges, + path: z.object({ + user: types_name + }), + query: z.optional(z.never()) }); export const security_has_privileges2_response = z.object({ - application: security_has_privileges_applications_privileges, - cluster: z.record(z.string(), z.boolean()), - has_all_requested: z.boolean(), - index: z.record(z.string(), security_has_privileges_privileges), - username: types_username, + application: security_has_privileges_applications_privileges, + cluster: z.record(z.string(), z.boolean()), + has_all_requested: z.boolean(), + index: z.record(z.string(), security_has_privileges_privileges), + username: types_username }); export const security_has_privileges3_request = z.object({ - body: security_has_privileges, - path: z.object({ - user: types_name, - }), - query: z.optional(z.never()), + body: security_has_privileges, + path: z.object({ + user: types_name + }), + query: z.optional(z.never()) }); export const security_has_privileges3_response = z.object({ - application: security_has_privileges_applications_privileges, - cluster: z.record(z.string(), z.boolean()), - has_all_requested: z.boolean(), - index: z.record(z.string(), security_has_privileges_privileges), - username: types_username, + application: security_has_privileges_applications_privileges, + cluster: z.record(z.string(), z.boolean()), + has_all_requested: z.boolean(), + index: z.record(z.string(), security_has_privileges_privileges), + username: types_username }); export const security_has_privileges_user_profile_request = z.object({ - body: security_has_privileges_user_profile, - path: z.optional(z.never()), - query: z.optional(z.never()), + body: security_has_privileges_user_profile, + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_has_privileges_user_profile_response = z.object({ - has_privilege_uids: z.array(security_types_user_profile_id).register(z.globalRegistry, { - description: - 'The subset of the requested profile IDs of the users that\nhave all the requested privileges.', - }), - errors: z.optional(security_has_privileges_user_profile_has_privileges_user_profile_errors), + has_privilege_uids: z.array(security_types_user_profile_id).register(z.globalRegistry, { + description: 'The subset of the requested profile IDs of the users that\nhave all the requested privileges.' + }), + errors: z.optional(security_has_privileges_user_profile_has_privileges_user_profile_errors) }); export const security_has_privileges_user_profile1_request = z.object({ - body: security_has_privileges_user_profile, - path: z.optional(z.never()), - query: z.optional(z.never()), + body: security_has_privileges_user_profile, + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_has_privileges_user_profile1_response = z.object({ - has_privilege_uids: z.array(security_types_user_profile_id).register(z.globalRegistry, { - description: - 'The subset of the requested profile IDs of the users that\nhave all the requested privileges.', - }), - errors: z.optional(security_has_privileges_user_profile_has_privileges_user_profile_errors), + has_privilege_uids: z.array(security_types_user_profile_id).register(z.globalRegistry, { + description: 'The subset of the requested profile IDs of the users that\nhave all the requested privileges.' + }), + errors: z.optional(security_has_privileges_user_profile_has_privileges_user_profile_errors) }); export const security_oidc_authenticate_request = z.object({ - body: z.object({ - nonce: z.string().register(z.globalRegistry, { - description: - 'Associate a client session with an ID token and mitigate replay attacks.\nThis value needs to be the same as the one that was provided to the `/_security/oidc/prepare` API or the one that was generated by Elasticsearch and included in the response to that call.', - }), - realm: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The name of the OpenID Connect realm.\nThis property is useful in cases where multiple realms are defined.', - }) - ), - redirect_uri: z.string().register(z.globalRegistry, { - description: - 'The URL to which the OpenID Connect Provider redirected the User Agent in response to an authentication request after a successful authentication.\nThis URL must be provided as-is (URL encoded), taken from the body of the response or as the value of a location header in the response from the OpenID Connect Provider.', - }), - state: z.string().register(z.globalRegistry, { - description: - 'Maintain state between the authentication request and the response.\nThis value needs to be the same as the one that was provided to the `/_security/oidc/prepare` API or the one that was generated by Elasticsearch and included in the response to that call.', + body: z.object({ + nonce: z.string().register(z.globalRegistry, { + description: 'Associate a client session with an ID token and mitigate replay attacks.\nThis value needs to be the same as the one that was provided to the `/_security/oidc/prepare` API or the one that was generated by Elasticsearch and included in the response to that call.' + }), + realm: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the OpenID Connect realm.\nThis property is useful in cases where multiple realms are defined.' + })), + redirect_uri: z.string().register(z.globalRegistry, { + description: 'The URL to which the OpenID Connect Provider redirected the User Agent in response to an authentication request after a successful authentication.\nThis URL must be provided as-is (URL encoded), taken from the body of the response or as the value of a location header in the response from the OpenID Connect Provider.' + }), + state: z.string().register(z.globalRegistry, { + description: 'Maintain state between the authentication request and the response.\nThis value needs to be the same as the one that was provided to the `/_security/oidc/prepare` API or the one that was generated by Elasticsearch and included in the response to that call.' + }) }), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_oidc_authenticate_response = z.object({ - access_token: z.string().register(z.globalRegistry, { - description: 'The Elasticsearch access token.', - }), - expires_in: z.number().register(z.globalRegistry, { - description: 'The duration (in seconds) of the tokens.', - }), - refresh_token: z.string().register(z.globalRegistry, { - description: 'The Elasticsearch refresh token.', - }), - type: z.string().register(z.globalRegistry, { - description: 'The type of token.', - }), + access_token: z.string().register(z.globalRegistry, { + description: 'The Elasticsearch access token.' + }), + expires_in: z.number().register(z.globalRegistry, { + description: 'The duration (in seconds) of the tokens.' + }), + refresh_token: z.string().register(z.globalRegistry, { + description: 'The Elasticsearch refresh token.' + }), + type: z.string().register(z.globalRegistry, { + description: 'The type of token.' + }) }); export const security_oidc_logout_request = z.object({ - body: z.object({ - token: z.string().register(z.globalRegistry, { - description: 'The access token to be invalidated.', + body: z.object({ + token: z.string().register(z.globalRegistry, { + description: 'The access token to be invalidated.' + }), + refresh_token: z.optional(z.string().register(z.globalRegistry, { + description: 'The refresh token to be invalidated.' + })) }), - refresh_token: z.optional( - z.string().register(z.globalRegistry, { - description: 'The refresh token to be invalidated.', - }) - ), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_oidc_logout_response = z.object({ - redirect: z.string().register(z.globalRegistry, { - description: - 'A URI that points to the end session endpoint of the OpenID Connect Provider with all the parameters of the logout request as HTTP GET parameters.', - }), + redirect: z.string().register(z.globalRegistry, { + description: 'A URI that points to the end session endpoint of the OpenID Connect Provider with all the parameters of the logout request as HTTP GET parameters.' + }) }); export const security_oidc_prepare_authentication_request = z.object({ - body: z.object({ - iss: z.optional( - z.string().register(z.globalRegistry, { - description: - 'In the case of a third party initiated single sign on, this is the issuer identifier for the OP that the RP is to send the authentication request to.\nIt cannot be specified when *realm* is specified.\nOne of *realm* or *iss* is required.', - }) - ), - login_hint: z.optional( - z.string().register(z.globalRegistry, { - description: - 'In the case of a third party initiated single sign on, it is a string value that is included in the authentication request as the *login_hint* parameter.\nThis parameter is not valid when *realm* is specified.', - }) - ), - nonce: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The value used to associate a client session with an ID token and to mitigate replay attacks.\nIf the caller of the API does not provide a value, Elasticsearch will generate one with sufficient entropy and return it in the response.', - }) - ), - realm: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The name of the OpenID Connect realm in Elasticsearch the configuration of which should be used in order to generate the authentication request.\nIt cannot be specified when *iss* is specified.\nOne of *realm* or *iss* is required.', - }) - ), - state: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The value used to maintain state between the authentication request and the response, typically used as a Cross-Site Request Forgery mitigation.\nIf the caller of the API does not provide a value, Elasticsearch will generate one with sufficient entropy and return it in the response.', - }) - ), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.object({ + iss: z.optional(z.string().register(z.globalRegistry, { + description: 'In the case of a third party initiated single sign on, this is the issuer identifier for the OP that the RP is to send the authentication request to.\nIt cannot be specified when *realm* is specified.\nOne of *realm* or *iss* is required.' + })), + login_hint: z.optional(z.string().register(z.globalRegistry, { + description: 'In the case of a third party initiated single sign on, it is a string value that is included in the authentication request as the *login_hint* parameter.\nThis parameter is not valid when *realm* is specified.' + })), + nonce: z.optional(z.string().register(z.globalRegistry, { + description: 'The value used to associate a client session with an ID token and to mitigate replay attacks.\nIf the caller of the API does not provide a value, Elasticsearch will generate one with sufficient entropy and return it in the response.' + })), + realm: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the OpenID Connect realm in Elasticsearch the configuration of which should be used in order to generate the authentication request.\nIt cannot be specified when *iss* is specified.\nOne of *realm* or *iss* is required.' + })), + state: z.optional(z.string().register(z.globalRegistry, { + description: 'The value used to maintain state between the authentication request and the response, typically used as a Cross-Site Request Forgery mitigation.\nIf the caller of the API does not provide a value, Elasticsearch will generate one with sufficient entropy and return it in the response.' + })) + }), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_oidc_prepare_authentication_response = z.object({ - nonce: z.string(), - realm: z.string(), - redirect: z.string().register(z.globalRegistry, { - description: - 'A URI that points to the authorization endpoint of the OpenID Connect Provider with all the parameters of the authentication request as HTTP GET parameters.', - }), - state: z.string(), + nonce: z.string(), + realm: z.string(), + redirect: z.string().register(z.globalRegistry, { + description: 'A URI that points to the authorization endpoint of the OpenID Connect Provider with all the parameters of the authentication request as HTTP GET parameters.' + }), + state: z.string() }); export const security_saml_authenticate_request = z.object({ - body: z.object({ - content: z.string().register(z.globalRegistry, { - description: - "The SAML response as it was sent by the user's browser, usually a Base64 encoded XML document.", + body: z.object({ + content: z.string().register(z.globalRegistry, { + description: 'The SAML response as it was sent by the user\'s browser, usually a Base64 encoded XML document.' + }), + ids: types_ids, + realm: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the realm that should authenticate the SAML response. Useful in cases where many SAML realms are defined.' + })) }), - ids: types_ids, - realm: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The name of the realm that should authenticate the SAML response. Useful in cases where many SAML realms are defined.', - }) - ), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_saml_authenticate_response = z.object({ - access_token: z.string().register(z.globalRegistry, { - description: 'The access token that was generated by Elasticsearch.', - }), - username: z.string().register(z.globalRegistry, { - description: "The authenticated user's name.", - }), - expires_in: z.number().register(z.globalRegistry, { - description: 'The amount of time (in seconds) left until the token expires.', - }), - refresh_token: z.string().register(z.globalRegistry, { - description: 'The refresh token that was generated by Elasticsearch.', - }), - realm: z.string().register(z.globalRegistry, { - description: 'The name of the realm where the user was authenticated.', - }), + access_token: z.string().register(z.globalRegistry, { + description: 'The access token that was generated by Elasticsearch.' + }), + username: z.string().register(z.globalRegistry, { + description: 'The authenticated user\'s name.' + }), + expires_in: z.number().register(z.globalRegistry, { + description: 'The amount of time (in seconds) left until the token expires.' + }), + refresh_token: z.string().register(z.globalRegistry, { + description: 'The refresh token that was generated by Elasticsearch.' + }), + realm: z.string().register(z.globalRegistry, { + description: 'The name of the realm where the user was authenticated.' + }) }); export const security_saml_complete_logout_request = z.object({ - body: z.object({ - realm: z.string().register(z.globalRegistry, { - description: - 'The name of the SAML realm in Elasticsearch for which the configuration is used to verify the logout response.', - }), - ids: types_ids, - query_string: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If the SAML IdP sends the logout response with the HTTP-Redirect binding, this field must be set to the query string of the redirect URI.', - }) - ), - content: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If the SAML IdP sends the logout response with the HTTP-Post binding, this field must be set to the value of the SAMLResponse form parameter from the logout response.', - }) - ), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.object({ + realm: z.string().register(z.globalRegistry, { + description: 'The name of the SAML realm in Elasticsearch for which the configuration is used to verify the logout response.' + }), + ids: types_ids, + query_string: z.optional(z.string().register(z.globalRegistry, { + description: 'If the SAML IdP sends the logout response with the HTTP-Redirect binding, this field must be set to the query string of the redirect URI.' + })), + content: z.optional(z.string().register(z.globalRegistry, { + description: 'If the SAML IdP sends the logout response with the HTTP-Post binding, this field must be set to the value of the SAMLResponse form parameter from the logout response.' + })) + }), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_saml_invalidate_request = z.object({ - body: z.object({ - acs: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The Assertion Consumer Service URL that matches the one of the SAML realm in Elasticsearch that should be used. You must specify either this parameter or the `realm` parameter.', - }) - ), - query_string: z.string().register(z.globalRegistry, { - description: - "The query part of the URL that the user was redirected to by the SAML IdP to initiate the Single Logout.\nThis query should include a single parameter named `SAMLRequest` that contains a SAML logout request that is deflated and Base64 encoded.\nIf the SAML IdP has signed the logout request, the URL should include two extra parameters named `SigAlg` and `Signature` that contain the algorithm used for the signature and the signature value itself.\nIn order for Elasticsearch to be able to verify the IdP's signature, the value of the `query_string` field must be an exact match to the string provided by the browser.\nThe client application must not attempt to parse or process the string in any way.", - }), - realm: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The name of the SAML realm in Elasticsearch the configuration. You must specify either this parameter or the `acs` parameter.', - }) - ), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.object({ + acs: z.optional(z.string().register(z.globalRegistry, { + description: 'The Assertion Consumer Service URL that matches the one of the SAML realm in Elasticsearch that should be used. You must specify either this parameter or the `realm` parameter.' + })), + query_string: z.string().register(z.globalRegistry, { + description: 'The query part of the URL that the user was redirected to by the SAML IdP to initiate the Single Logout.\nThis query should include a single parameter named `SAMLRequest` that contains a SAML logout request that is deflated and Base64 encoded.\nIf the SAML IdP has signed the logout request, the URL should include two extra parameters named `SigAlg` and `Signature` that contain the algorithm used for the signature and the signature value itself.\nIn order for Elasticsearch to be able to verify the IdP\'s signature, the value of the `query_string` field must be an exact match to the string provided by the browser.\nThe client application must not attempt to parse or process the string in any way.' + }), + realm: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the SAML realm in Elasticsearch the configuration. You must specify either this parameter or the `acs` parameter.' + })) + }), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_saml_invalidate_response = z.object({ - invalidated: z.number().register(z.globalRegistry, { - description: 'The number of tokens that were invalidated as part of this logout.', - }), - realm: z.string().register(z.globalRegistry, { - description: 'The realm name of the SAML realm in Elasticsearch that authenticated the user.', - }), - redirect: z.string().register(z.globalRegistry, { - description: - 'A SAML logout response as a parameter so that the user can be redirected back to the SAML IdP.', - }), + invalidated: z.number().register(z.globalRegistry, { + description: 'The number of tokens that were invalidated as part of this logout.' + }), + realm: z.string().register(z.globalRegistry, { + description: 'The realm name of the SAML realm in Elasticsearch that authenticated the user.' + }), + redirect: z.string().register(z.globalRegistry, { + description: 'A SAML logout response as a parameter so that the user can be redirected back to the SAML IdP.' + }) }); export const security_saml_logout_request = z.object({ - body: z.object({ - token: z.string().register(z.globalRegistry, { - description: - 'The access token that was returned as a response to calling the SAML authenticate API.\nAlternatively, the most recent token that was received after refreshing the original one by using a `refresh_token`.', - }), - refresh_token: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The refresh token that was returned as a response to calling the SAML authenticate API.\nAlternatively, the most recent refresh token that was received after refreshing the original access token.', - }) - ), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.object({ + token: z.string().register(z.globalRegistry, { + description: 'The access token that was returned as a response to calling the SAML authenticate API.\nAlternatively, the most recent token that was received after refreshing the original one by using a `refresh_token`.' + }), + refresh_token: z.optional(z.string().register(z.globalRegistry, { + description: 'The refresh token that was returned as a response to calling the SAML authenticate API.\nAlternatively, the most recent refresh token that was received after refreshing the original access token.' + })) + }), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_saml_logout_response = z.object({ - redirect: z.string().register(z.globalRegistry, { - description: - 'A URL that contains a SAML logout request as a parameter.\nYou can use this URL to be redirected back to the SAML IdP and to initiate Single Logout.', - }), + redirect: z.string().register(z.globalRegistry, { + description: 'A URL that contains a SAML logout request as a parameter.\nYou can use this URL to be redirected back to the SAML IdP and to initiate Single Logout.' + }) }); export const security_saml_prepare_authentication_request = z.object({ - body: z.object({ - acs: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The Assertion Consumer Service URL that matches the one of the SAML realms in Elasticsearch.\nThe realm is used to generate the authentication request. You must specify either this parameter or the `realm` parameter.', - }) - ), - realm: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The name of the SAML realm in Elasticsearch for which the configuration is used to generate the authentication request.\nYou must specify either this parameter or the `acs` parameter.', - }) - ), - relay_state: z.optional( - z.string().register(z.globalRegistry, { - description: - 'A string that will be included in the redirect URL that this API returns as the `RelayState` query parameter.\nIf the Authentication Request is signed, this value is used as part of the signature computation.', - }) - ), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.object({ + acs: z.optional(z.string().register(z.globalRegistry, { + description: 'The Assertion Consumer Service URL that matches the one of the SAML realms in Elasticsearch.\nThe realm is used to generate the authentication request. You must specify either this parameter or the `realm` parameter.' + })), + realm: z.optional(z.string().register(z.globalRegistry, { + description: 'The name of the SAML realm in Elasticsearch for which the configuration is used to generate the authentication request.\nYou must specify either this parameter or the `acs` parameter.' + })), + relay_state: z.optional(z.string().register(z.globalRegistry, { + description: 'A string that will be included in the redirect URL that this API returns as the `RelayState` query parameter.\nIf the Authentication Request is signed, this value is used as part of the signature computation.' + })) + }), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_saml_prepare_authentication_response = z.object({ - id: types_id, - realm: z.string().register(z.globalRegistry, { - description: - 'The name of the Elasticsearch realm that was used to construct the authentication request.', - }), - redirect: z.string().register(z.globalRegistry, { - description: 'The URL to redirect the user to.', - }), + id: types_id, + realm: z.string().register(z.globalRegistry, { + description: 'The name of the Elasticsearch realm that was used to construct the authentication request.' + }), + redirect: z.string().register(z.globalRegistry, { + description: 'The URL to redirect the user to.' + }) }); export const security_saml_service_provider_metadata_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - realm_name: types_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + realm_name: types_name + }), + query: z.optional(z.never()) }); export const security_saml_service_provider_metadata_response = z.object({ - metadata: z.string().register(z.globalRegistry, { - description: "An XML string that contains a SAML Service Provider's metadata for the realm.", - }), + metadata: z.string().register(z.globalRegistry, { + description: 'An XML string that contains a SAML Service Provider\'s metadata for the realm.' + }) }); export const security_suggest_user_profiles_request = z.object({ - body: z.optional(security_suggest_user_profiles), - path: z.optional(z.never()), - query: z.optional( - z.object({ - data: z.optional(z.union([z.string(), z.array(z.string())])), - }) - ), + body: z.optional(security_suggest_user_profiles), + path: z.optional(z.never()), + query: z.optional(z.object({ + data: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])) + })) }); export const security_suggest_user_profiles_response = z.object({ - total: security_suggest_user_profiles_total_user_profiles, - took: z.number().register(z.globalRegistry, { - description: 'The number of milliseconds it took Elasticsearch to run the request.', - }), - profiles: z.array(security_types_user_profile).register(z.globalRegistry, { - description: - 'A list of profile documents, ordered by relevance, that match the search criteria.', - }), + total: security_suggest_user_profiles_total_user_profiles, + took: z.number().register(z.globalRegistry, { + description: 'The number of milliseconds it took Elasticsearch to run the request.' + }), + profiles: z.array(security_types_user_profile).register(z.globalRegistry, { + description: 'A list of profile documents, ordered by relevance, that match the search criteria.' + }) }); export const security_suggest_user_profiles1_request = z.object({ - body: z.optional(security_suggest_user_profiles), - path: z.optional(z.never()), - query: z.optional( - z.object({ - data: z.optional(z.union([z.string(), z.array(z.string())])), - }) - ), + body: z.optional(security_suggest_user_profiles), + path: z.optional(z.never()), + query: z.optional(z.object({ + data: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])) + })) }); export const security_suggest_user_profiles1_response = z.object({ - total: security_suggest_user_profiles_total_user_profiles, - took: z.number().register(z.globalRegistry, { - description: 'The number of milliseconds it took Elasticsearch to run the request.', - }), - profiles: z.array(security_types_user_profile).register(z.globalRegistry, { - description: - 'A list of profile documents, ordered by relevance, that match the search criteria.', - }), + total: security_suggest_user_profiles_total_user_profiles, + took: z.number().register(z.globalRegistry, { + description: 'The number of milliseconds it took Elasticsearch to run the request.' + }), + profiles: z.array(security_types_user_profile).register(z.globalRegistry, { + description: 'A list of profile documents, ordered by relevance, that match the search criteria.' + }) }); export const security_update_user_profile_data1_request = z.object({ - body: security_update_user_profile_data, - path: z.object({ - uid: security_types_user_profile_id, - }), - query: z.optional( - z.object({ - if_seq_no: z.optional(types_sequence_number), - if_primary_term: z.optional( - z.number().register(z.globalRegistry, { - description: 'Only perform the operation if the document has this primary term.', - }) - ), - refresh: z.optional(types_refresh), - }) - ), + body: security_update_user_profile_data, + path: z.object({ + uid: security_types_user_profile_id + }), + query: z.optional(z.object({ + if_seq_no: z.optional(types_sequence_number), + if_primary_term: z.optional(z.number().register(z.globalRegistry, { + description: 'Only perform the operation if the document has this primary term.' + })), + refresh: z.optional(types_refresh) + })) }); export const security_update_user_profile_data1_response = types_acknowledged_response_base; export const security_update_user_profile_data_request = z.object({ - body: security_update_user_profile_data, - path: z.object({ - uid: security_types_user_profile_id, - }), - query: z.optional( - z.object({ - if_seq_no: z.optional(types_sequence_number), - if_primary_term: z.optional( - z.number().register(z.globalRegistry, { - description: 'Only perform the operation if the document has this primary term.', - }) - ), - refresh: z.optional(types_refresh), - }) - ), + body: security_update_user_profile_data, + path: z.object({ + uid: security_types_user_profile_id + }), + query: z.optional(z.object({ + if_seq_no: z.optional(types_sequence_number), + if_primary_term: z.optional(z.number().register(z.globalRegistry, { + description: 'Only perform the operation if the document has this primary term.' + })), + refresh: z.optional(types_refresh) + })) }); export const security_update_user_profile_data_response = types_acknowledged_response_base; export const slm_delete_lifecycle_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - policy_id: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + policy_id: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const slm_delete_lifecycle_response = types_acknowledged_response_base; export const slm_get_lifecycle_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - policy_id: types_names, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + policy_id: types_names + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const slm_get_lifecycle_response = z.record(z.string(), slm_types_snapshot_lifecycle); export const slm_put_lifecycle_request = z.object({ - body: z.object({ - config: z.optional(slm_types_configuration), - name: z.optional(types_name), - repository: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Repository used to store snapshots created by this policy. This repository must exist prior to the policy’s creation. You can create a repository using the snapshot repository API.', - }) - ), - retention: z.optional(slm_types_retention), - schedule: z.optional(watcher_types_cron_expression), - }), - path: z.object({ - policy_id: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + config: z.optional(slm_types_configuration), + name: z.optional(types_name), + repository: z.optional(z.string().register(z.globalRegistry, { + description: 'Repository used to store snapshots created by this policy. This repository must exist prior to the policy’s creation. You can create a repository using the snapshot repository API.' + })), + retention: z.optional(slm_types_retention), + schedule: z.optional(watcher_types_cron_expression) + }), + path: z.object({ + policy_id: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const slm_put_lifecycle_response = types_acknowledged_response_base; export const slm_execute_lifecycle_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - policy_id: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + policy_id: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const slm_execute_lifecycle_response = z.object({ - snapshot_name: types_name, + snapshot_name: types_name }); export const slm_execute_retention_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const slm_execute_retention_response = types_acknowledged_response_base; export const slm_get_lifecycle1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const slm_get_lifecycle1_response = z.record(z.string(), slm_types_snapshot_lifecycle); export const slm_get_stats_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const slm_get_stats_response = z.object({ - retention_deletion_time: types_duration, - retention_deletion_time_millis: types_duration_value_unit_millis, - retention_failed: z.number(), - retention_runs: z.number(), - retention_timed_out: z.number(), - total_snapshots_deleted: z.number(), - total_snapshot_deletion_failures: z.number(), - total_snapshots_failed: z.number(), - total_snapshots_taken: z.number(), - policy_stats: z.array(slm_types_snapshot_policy_stats), + retention_deletion_time: types_duration, + retention_deletion_time_millis: types_duration_value_unit_millis, + retention_failed: z.number(), + retention_runs: z.number(), + retention_timed_out: z.number(), + total_snapshots_deleted: z.number(), + total_snapshot_deletion_failures: z.number(), + total_snapshots_failed: z.number(), + total_snapshots_taken: z.number(), + policy_stats: z.array(slm_types_snapshot_policy_stats) }); export const slm_get_status_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const slm_get_status_response = z.object({ - operation_mode: types_lifecycle_operation_mode, + operation_mode: types_lifecycle_operation_mode }); export const slm_start_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const slm_start_response = types_acknowledged_response_base; export const slm_stop_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const slm_stop_response = types_acknowledged_response_base; export const snapshot_cleanup_repository_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - repository: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + repository: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const snapshot_cleanup_repository_response = z.object({ - results: snapshot_cleanup_repository_cleanup_repository_results, + results: snapshot_cleanup_repository_cleanup_repository_results }); export const snapshot_clone_request = z.object({ - body: z.object({ - indices: z.string().register(z.globalRegistry, { - description: - 'A comma-separated list of indices to include in the snapshot.\nMulti-target syntax is supported.', + body: z.object({ + indices: z.string().register(z.globalRegistry, { + description: 'A comma-separated list of indices to include in the snapshot.\nMulti-target syntax is supported.' + }) }), - }), - path: z.object({ - repository: types_name, - snapshot: types_name, - target_snapshot: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + path: z.object({ + repository: types_name, + snapshot: types_name, + target_snapshot: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const snapshot_clone_response = types_acknowledged_response_base; export const snapshot_delete_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - repository: types_name, - snapshot: types_names, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns a response when the matching snapshots are all deleted.\nIf `false`, the request returns a response as soon as the deletes are scheduled.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + repository: types_name, + snapshot: types_names + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns a response when the matching snapshots are all deleted.\nIf `false`, the request returns a response as soon as the deletes are scheduled.' + })) + })) }); export const snapshot_delete_response = types_acknowledged_response_base; export const snapshot_get_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - repository: types_name, - snapshot: types_names, - }), - query: z.optional( - z.object({ - after: z.optional( - z.string().register(z.globalRegistry, { - description: - 'An offset identifier to start pagination from as returned by the next field in the response body.', - }) - ), - from_sort_value: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The value of the current sort column at which to start retrieval.\nIt can be a string `snapshot-` or a repository name when sorting by snapshot or repository name.\nIt can be a millisecond time value or a number when sorting by `index-` or shard count.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error for any snapshots that are unavailable.', - }) - ), - index_details: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes additional information about each index in the snapshot comprising the number of shards in the index, the total size of the index in bytes, and the maximum number of segments per shard in the index.\nThe default is `false`, meaning that this information is omitted.', - }) - ), - index_names: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes the name of each index in each snapshot.', - }) - ), - include_repository: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes the repository name in each snapshot.', - }) - ), - master_timeout: z.optional(types_duration), - order: z.optional(types_sort_order), - offset: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Numeric offset to start pagination from based on the snapshots matching this request. Using a non-zero value for this parameter is mutually exclusive with using the after parameter. Defaults to 0.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of snapshots to return.\nThe default is 0, which means to return all that match the request without limit.', - }) - ), - slm_policy_filter: z.optional(types_name), - sort: z.optional(snapshot_types_snapshot_sort), - state: z.optional( - z.union([snapshot_types_snapshot_state, z.array(snapshot_types_snapshot_state)]) - ), - verbose: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, returns additional information about each snapshot such as the version of Elasticsearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted.\n\nNOTE: The parameters `size`, `order`, `after`, `from_sort_value`, `offset`, `slm_policy_filter`, and `sort` are not supported when you set `verbose=false` and the sort order for requests with `verbose=false` is undefined.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + repository: types_name, + snapshot: types_names + }), + query: z.optional(z.object({ + after: z.optional(z.string().register(z.globalRegistry, { + description: 'An offset identifier to start pagination from as returned by the next field in the response body.' + })), + from_sort_value: z.optional(z.string().register(z.globalRegistry, { + description: 'The value of the current sort column at which to start retrieval.\nIt can be a string `snapshot-` or a repository name when sorting by snapshot or repository name.\nIt can be a millisecond time value or a number when sorting by `index-` or shard count.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error for any snapshots that are unavailable.' + })), + index_details: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes additional information about each index in the snapshot comprising the number of shards in the index, the total size of the index in bytes, and the maximum number of segments per shard in the index.\nThe default is `false`, meaning that this information is omitted.' + })), + index_names: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes the name of each index in each snapshot.' + })), + include_repository: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes the repository name in each snapshot.' + })), + master_timeout: z.optional(types_duration), + order: z.optional(types_sort_order), + offset: z.optional(z.number().register(z.globalRegistry, { + description: 'Numeric offset to start pagination from based on the snapshots matching this request. Using a non-zero value for this parameter is mutually exclusive with using the after parameter. Defaults to 0.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of snapshots to return.\nThe default is 0, which means to return all that match the request without limit.' + })), + slm_policy_filter: z.optional(types_name), + sort: z.optional(snapshot_types_snapshot_sort), + state: z.optional(z.union([ + snapshot_types_snapshot_state, + z.array(snapshot_types_snapshot_state) + ])), + verbose: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns additional information about each snapshot such as the version of Elasticsearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted.\n\nNOTE: The parameters `size`, `order`, `after`, `from_sort_value`, `offset`, `slm_policy_filter`, and `sort` are not supported when you set `verbose=false` and the sort order for requests with `verbose=false` is undefined.' + })) + })) }); export const snapshot_get_response = z.object({ - remaining: z.number().register(z.globalRegistry, { - description: - 'The number of remaining snapshots that were not returned due to size limits and that can be fetched by additional requests using the `next` field value.', - }), - total: z.number().register(z.globalRegistry, { - description: - 'The total number of snapshots that match the request when ignoring the size limit or `after` query parameter.', - }), - next: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If the request contained a size limit and there might be more results, a `next` field will be added to the response.\nIt can be used as the `after` query parameter to fetch additional results.', - }) - ), - responses: z.optional(z.array(snapshot_get_snapshot_response_item)), - snapshots: z.optional(z.array(snapshot_types_snapshot_info)), + remaining: z.number().register(z.globalRegistry, { + description: 'The number of remaining snapshots that were not returned due to size limits and that can be fetched by additional requests using the `next` field value.' + }), + total: z.number().register(z.globalRegistry, { + description: 'The total number of snapshots that match the request when ignoring the size limit or `after` query parameter.' + }), + next: z.optional(z.string().register(z.globalRegistry, { + description: 'If the request contained a size limit and there might be more results, a `next` field will be added to the response.\nIt can be used as the `after` query parameter to fetch additional results.' + })), + responses: z.optional(z.array(snapshot_get_snapshot_response_item)), + snapshots: z.optional(z.array(snapshot_types_snapshot_info)) }); export const snapshot_create1_request = z.object({ - body: z.optional(snapshot_create), - path: z.object({ - repository: types_name, - snapshot: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns a response when the snapshot is complete.\nIf `false`, the request returns a response when the snapshot initializes.', - }) - ), - }) - ), + body: z.optional(snapshot_create), + path: z.object({ + repository: types_name, + snapshot: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns a response when the snapshot is complete.\nIf `false`, the request returns a response when the snapshot initializes.' + })) + })) }); export const snapshot_create1_response = z.object({ - accepted: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Equals `true` if the snapshot was accepted. Present when the request had `wait_for_completion` set to `false`', - }) - ), - snapshot: z.optional(snapshot_types_snapshot_info), + accepted: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Equals `true` if the snapshot was accepted. Present when the request had `wait_for_completion` set to `false`' + })), + snapshot: z.optional(snapshot_types_snapshot_info) }); export const snapshot_create_request = z.object({ - body: z.optional(snapshot_create), - path: z.object({ - repository: types_name, - snapshot: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns a response when the snapshot is complete.\nIf `false`, the request returns a response when the snapshot initializes.', - }) - ), - }) - ), + body: z.optional(snapshot_create), + path: z.object({ + repository: types_name, + snapshot: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns a response when the snapshot is complete.\nIf `false`, the request returns a response when the snapshot initializes.' + })) + })) }); export const snapshot_create_response = z.object({ - accepted: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Equals `true` if the snapshot was accepted. Present when the request had `wait_for_completion` set to `false`', - }) - ), - snapshot: z.optional(snapshot_types_snapshot_info), + accepted: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Equals `true` if the snapshot was accepted. Present when the request had `wait_for_completion` set to `false`' + })), + snapshot: z.optional(snapshot_types_snapshot_info) }); export const snapshot_delete_repository_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - repository: types_names, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + repository: types_names + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const snapshot_delete_repository_response = types_acknowledged_response_base; export const snapshot_get_repository1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - repository: types_names, - }), - query: z.optional( - z.object({ - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request gets information from the local node only.\nIf `false`, the request gets information from the master node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + repository: types_names + }), + query: z.optional(z.object({ + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request gets information from the local node only.\nIf `false`, the request gets information from the master node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const snapshot_get_repository1_response = z.record(z.string(), snapshot_types_repository); export const snapshot_create_repository1_request = z.object({ - body: snapshot_create_repository2, - path: z.object({ - repository: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - verify: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request verifies the repository is functional on all master and data nodes in the cluster.\nIf `false`, this verification is skipped.\nYou can also perform this verification with the verify snapshot repository API.', - }) - ), - }) - ), + body: snapshot_create_repository2, + path: z.object({ + repository: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + verify: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request verifies the repository is functional on all master and data nodes in the cluster.\nIf `false`, this verification is skipped.\nYou can also perform this verification with the verify snapshot repository API.' + })) + })) }); export const snapshot_create_repository1_response = types_acknowledged_response_base; export const snapshot_create_repository_request = z.object({ - body: snapshot_create_repository2, - path: z.object({ - repository: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - verify: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request verifies the repository is functional on all master and data nodes in the cluster.\nIf `false`, this verification is skipped.\nYou can also perform this verification with the verify snapshot repository API.', - }) - ), - }) - ), + body: snapshot_create_repository2, + path: z.object({ + repository: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + verify: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request verifies the repository is functional on all master and data nodes in the cluster.\nIf `false`, this verification is skipped.\nYou can also perform this verification with the verify snapshot repository API.' + })) + })) }); export const snapshot_create_repository_response = types_acknowledged_response_base; export const snapshot_get_repository_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request gets information from the local node only.\nIf `false`, the request gets information from the master node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request gets information from the local node only.\nIf `false`, the request gets information from the master node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const snapshot_get_repository_response = z.record(z.string(), snapshot_types_repository); export const snapshot_repository_analyze_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - repository: types_name, - }), - query: z.optional( - z.object({ - blob_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The total number of blobs to write to the repository during the test.\nFor realistic experiments, set this parameter to at least `2000`.', - }) - ), - concurrency: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of operations to run concurrently during the test.\nFor realistic experiments, leave this parameter unset.', - }) - ), - detailed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether to return detailed results, including timing information for every operation performed during the analysis.\nIf false, it returns only a summary of the analysis.', - }) - ), - early_read_node_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of nodes on which to perform an early read operation while writing each blob.\nEarly read operations are only rarely performed.\nFor realistic experiments, leave this parameter unset.', - }) - ), - max_blob_size: z.optional(types_byte_size), - max_total_data_size: z.optional(types_byte_size), - rare_action_probability: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The probability of performing a rare action such as an early read, an overwrite, or an aborted write on each blob.\nFor realistic experiments, leave this parameter unset.', - }) - ), - rarely_abort_writes: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether to rarely cancel writes before they complete.\nFor realistic experiments, leave this parameter unset.', - }) - ), - read_node_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of nodes on which to read a blob after writing.\nFor realistic experiments, leave this parameter unset.', - }) - ), - register_operation_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The minimum number of linearizable register operations to perform in total.\nFor realistic experiments, set this parameter to at least `100`.', - }) - ), - seed: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The seed for the pseudo-random number generator used to generate the list of operations performed during the test.\nTo repeat the same set of operations in multiple experiments, use the same seed in each experiment.\nNote that the operations are performed concurrently so might not always happen in the same order on each run.\nFor realistic experiments, leave this parameter unset.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + repository: types_name + }), + query: z.optional(z.object({ + blob_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The total number of blobs to write to the repository during the test.\nFor realistic experiments, set this parameter to at least `2000`.' + })), + concurrency: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of operations to run concurrently during the test.\nFor realistic experiments, leave this parameter unset.' + })), + detailed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether to return detailed results, including timing information for every operation performed during the analysis.\nIf false, it returns only a summary of the analysis.' + })), + early_read_node_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of nodes on which to perform an early read operation while writing each blob.\nEarly read operations are only rarely performed.\nFor realistic experiments, leave this parameter unset.' + })), + max_blob_size: z.optional(types_byte_size), + max_total_data_size: z.optional(types_byte_size), + rare_action_probability: z.optional(z.number().register(z.globalRegistry, { + description: 'The probability of performing a rare action such as an early read, an overwrite, or an aborted write on each blob.\nFor realistic experiments, leave this parameter unset.' + })), + rarely_abort_writes: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether to rarely cancel writes before they complete.\nFor realistic experiments, leave this parameter unset.' + })), + read_node_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of nodes on which to read a blob after writing.\nFor realistic experiments, leave this parameter unset.' + })), + register_operation_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum number of linearizable register operations to perform in total.\nFor realistic experiments, set this parameter to at least `100`.' + })), + seed: z.optional(z.number().register(z.globalRegistry, { + description: 'The seed for the pseudo-random number generator used to generate the list of operations performed during the test.\nTo repeat the same set of operations in multiple experiments, use the same seed in each experiment.\nNote that the operations are performed concurrently so might not always happen in the same order on each run.\nFor realistic experiments, leave this parameter unset.' + })), + timeout: z.optional(types_duration) + })) }); export const snapshot_repository_analyze_response = z.object({ - blob_count: z.number().register(z.globalRegistry, { - description: 'The number of blobs written to the repository during the test.', - }), - blob_path: z.string().register(z.globalRegistry, { - description: - 'The path in the repository under which all the blobs were written during the test.', - }), - concurrency: z.number().register(z.globalRegistry, { - description: 'The number of write operations performed concurrently during the test.', - }), - coordinating_node: snapshot_repository_analyze_snapshot_node_info, - delete_elapsed: types_duration, - delete_elapsed_nanos: types_duration_value_unit_nanos, - details: snapshot_repository_analyze_details_info, - early_read_node_count: z.number().register(z.globalRegistry, { - description: - 'The limit on the number of nodes on which early read operations were performed after writing each blob.', - }), - issues_detected: z.array(z.string()).register(z.globalRegistry, { - description: - 'A list of correctness issues detected, which is empty if the API succeeded.\nIt is included to emphasize that a successful response does not guarantee correct behaviour in future.', - }), - listing_elapsed: types_duration, - listing_elapsed_nanos: types_duration_value_unit_nanos, - max_blob_size: types_byte_size, - max_blob_size_bytes: z.number().register(z.globalRegistry, { - description: 'The limit, in bytes, on the size of a blob written during the test.', - }), - max_total_data_size: types_byte_size, - max_total_data_size_bytes: z.number().register(z.globalRegistry, { - description: 'The limit, in bytes, on the total size of all blob written during the test.', - }), - rare_action_probability: z.number().register(z.globalRegistry, { - description: 'The probability of performing rare actions during the test.', - }), - read_node_count: z.number().register(z.globalRegistry, { - description: - 'The limit on the number of nodes on which read operations were performed after writing each blob.', - }), - repository: z.string().register(z.globalRegistry, { - description: 'The name of the repository that was the subject of the analysis.', - }), - seed: z.number().register(z.globalRegistry, { - description: - 'The seed for the pseudo-random number generator used to generate the operations used during the test.', - }), - summary: snapshot_repository_analyze_summary_info, + blob_count: z.number().register(z.globalRegistry, { + description: 'The number of blobs written to the repository during the test.' + }), + blob_path: z.string().register(z.globalRegistry, { + description: 'The path in the repository under which all the blobs were written during the test.' + }), + concurrency: z.number().register(z.globalRegistry, { + description: 'The number of write operations performed concurrently during the test.' + }), + coordinating_node: snapshot_repository_analyze_snapshot_node_info, + delete_elapsed: types_duration, + delete_elapsed_nanos: types_duration_value_unit_nanos, + details: snapshot_repository_analyze_details_info, + early_read_node_count: z.number().register(z.globalRegistry, { + description: 'The limit on the number of nodes on which early read operations were performed after writing each blob.' + }), + issues_detected: z.array(z.string()).register(z.globalRegistry, { + description: 'A list of correctness issues detected, which is empty if the API succeeded.\nIt is included to emphasize that a successful response does not guarantee correct behaviour in future.' + }), + listing_elapsed: types_duration, + listing_elapsed_nanos: types_duration_value_unit_nanos, + max_blob_size: types_byte_size, + max_blob_size_bytes: z.number().register(z.globalRegistry, { + description: 'The limit, in bytes, on the size of a blob written during the test.' + }), + max_total_data_size: types_byte_size, + max_total_data_size_bytes: z.number().register(z.globalRegistry, { + description: 'The limit, in bytes, on the total size of all blob written during the test.' + }), + rare_action_probability: z.number().register(z.globalRegistry, { + description: 'The probability of performing rare actions during the test.' + }), + read_node_count: z.number().register(z.globalRegistry, { + description: 'The limit on the number of nodes on which read operations were performed after writing each blob.' + }), + repository: z.string().register(z.globalRegistry, { + description: 'The name of the repository that was the subject of the analysis.' + }), + seed: z.number().register(z.globalRegistry, { + description: 'The seed for the pseudo-random number generator used to generate the operations used during the test.' + }), + summary: snapshot_repository_analyze_summary_info }); export const snapshot_repository_verify_integrity_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - repository: types_names, - }), - query: z.optional( - z.object({ - blob_thread_pool_concurrency: z.optional( - z.number().register(z.globalRegistry, { - description: - 'If `verify_blob_contents` is `true`, this parameter specifies how many blobs to verify at once.', - }) - ), - index_snapshot_verification_concurrency: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of index snapshots to verify concurrently within each index verification.', - }) - ), - index_verification_concurrency: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of indices to verify concurrently.\nThe default behavior is to use the entire `snapshot_meta` thread pool.', - }) - ), - max_bytes_per_sec: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If `verify_blob_contents` is `true`, this parameter specifies the maximum amount of data that Elasticsearch will read from the repository every second.', - }) - ), - max_failed_shard_snapshots: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of shard snapshot failures to track during integrity verification, in order to avoid excessive resource usage.\nIf your repository contains more than this number of shard snapshot failures, the verification will fail.', - }) - ), - meta_thread_pool_concurrency: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of snapshot metadata operations to run concurrently.\nThe default behavior is to use at most half of the `snapshot_meta` thread pool at once.', - }) - ), - snapshot_verification_concurrency: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of snapshots to verify concurrently.\nThe default behavior is to use at most half of the `snapshot_meta` thread pool at once.', - }) - ), - verify_blob_contents: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether to verify the checksum of every data blob in the repository.\nIf this feature is enabled, Elasticsearch will read the entire repository contents, which may be extremely slow and expensive.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + repository: types_names + }), + query: z.optional(z.object({ + blob_thread_pool_concurrency: z.optional(z.number().register(z.globalRegistry, { + description: 'If `verify_blob_contents` is `true`, this parameter specifies how many blobs to verify at once.' + })), + index_snapshot_verification_concurrency: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of index snapshots to verify concurrently within each index verification.' + })), + index_verification_concurrency: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of indices to verify concurrently.\nThe default behavior is to use the entire `snapshot_meta` thread pool.' + })), + max_bytes_per_sec: z.optional(z.string().register(z.globalRegistry, { + description: 'If `verify_blob_contents` is `true`, this parameter specifies the maximum amount of data that Elasticsearch will read from the repository every second.' + })), + max_failed_shard_snapshots: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of shard snapshot failures to track during integrity verification, in order to avoid excessive resource usage.\nIf your repository contains more than this number of shard snapshot failures, the verification will fail.' + })), + meta_thread_pool_concurrency: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of snapshot metadata operations to run concurrently.\nThe default behavior is to use at most half of the `snapshot_meta` thread pool at once.' + })), + snapshot_verification_concurrency: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of snapshots to verify concurrently.\nThe default behavior is to use at most half of the `snapshot_meta` thread pool at once.' + })), + verify_blob_contents: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether to verify the checksum of every data blob in the repository.\nIf this feature is enabled, Elasticsearch will read the entire repository contents, which may be extremely slow and expensive.' + })) + })) }); export const snapshot_repository_verify_integrity_response = z.record(z.string(), z.unknown()); export const snapshot_status_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error for any snapshots that are unavailable.\nIf `true`, the request ignores snapshots that are unavailable, such as those that are corrupted or temporarily cannot be returned.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error for any snapshots that are unavailable.\nIf `true`, the request ignores snapshots that are unavailable, such as those that are corrupted or temporarily cannot be returned.' + })), + master_timeout: z.optional(types_duration) + })) }); export const snapshot_status_response = z.object({ - snapshots: z.array(snapshot_types_status), + snapshots: z.array(snapshot_types_status) }); export const snapshot_status1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - repository: types_name, - }), - query: z.optional( - z.object({ - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error for any snapshots that are unavailable.\nIf `true`, the request ignores snapshots that are unavailable, such as those that are corrupted or temporarily cannot be returned.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + repository: types_name + }), + query: z.optional(z.object({ + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error for any snapshots that are unavailable.\nIf `true`, the request ignores snapshots that are unavailable, such as those that are corrupted or temporarily cannot be returned.' + })), + master_timeout: z.optional(types_duration) + })) }); export const snapshot_status1_response = z.object({ - snapshots: z.array(snapshot_types_status), + snapshots: z.array(snapshot_types_status) }); export const snapshot_status2_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - repository: types_name, - snapshot: types_names, - }), - query: z.optional( - z.object({ - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error for any snapshots that are unavailable.\nIf `true`, the request ignores snapshots that are unavailable, such as those that are corrupted or temporarily cannot be returned.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + repository: types_name, + snapshot: types_names + }), + query: z.optional(z.object({ + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error for any snapshots that are unavailable.\nIf `true`, the request ignores snapshots that are unavailable, such as those that are corrupted or temporarily cannot be returned.' + })), + master_timeout: z.optional(types_duration) + })) }); export const snapshot_status2_response = z.object({ - snapshots: z.array(snapshot_types_status), + snapshots: z.array(snapshot_types_status) }); export const snapshot_verify_repository_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - repository: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + repository: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const snapshot_verify_repository_response = z.object({ - nodes: z - .record(z.string(), snapshot_verify_repository_compact_node_info) - .register(z.globalRegistry, { - description: - 'Information about the nodes connected to the snapshot repository.\nThe key is the ID of the node.', - }), + nodes: z.record(z.string(), snapshot_verify_repository_compact_node_info).register(z.globalRegistry, { + description: 'Information about the nodes connected to the snapshot repository.\nThe key is the ID of the node.' + }) }); export const sql_clear_cursor_request = z.object({ - body: z.object({ - cursor: z.string().register(z.globalRegistry, { - description: 'Cursor to clear.', + body: z.object({ + cursor: z.string().register(z.globalRegistry, { + description: 'Cursor to clear.' + }) }), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const sql_clear_cursor_response = z.object({ - succeeded: z.boolean(), + succeeded: z.boolean() }); export const sql_delete_async_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const sql_delete_async_response = types_acknowledged_response_base; export const sql_get_async_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - delimiter: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The separator for CSV results.\nThe API supports this parameter only for CSV responses.', - }) - ), - format: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The format for the response.\nYou must specify a format using this parameter or the `Accept` HTTP header.\nIf you specify both, the API uses this parameter.', - }) - ), - keep_alive: z.optional(types_duration), - wait_for_completion_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + delimiter: z.optional(z.string().register(z.globalRegistry, { + description: 'The separator for CSV results.\nThe API supports this parameter only for CSV responses.' + })), + format: z.optional(z.string().register(z.globalRegistry, { + description: 'The format for the response.\nYou must specify a format using this parameter or the `Accept` HTTP header.\nIf you specify both, the API uses this parameter.' + })), + keep_alive: z.optional(types_duration), + wait_for_completion_timeout: z.optional(types_duration) + })) }); export const sql_get_async_response = z.object({ - id: types_id, - is_running: z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the search is still running.\nIf `false`, the search has finished.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header.', - }), - is_partial: z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response does not contain complete search results.\nIf `is_partial` is `true` and `is_running` is `true`, the search is still running.\nIf `is_partial` is `true` but `is_running` is `false`, the results are partial due to a failure or timeout.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header.', - }), - columns: z.optional( - z.array(sql_types_column).register(z.globalRegistry, { - description: 'Column headings for the search results. Each object is a column.', - }) - ), - cursor: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The cursor for the next set of paginated results.\nFor CSV, TSV, and TXT responses, this value is returned in the `Cursor` HTTP header.', + id: types_id, + is_running: z.boolean().register(z.globalRegistry, { + description: 'If `true`, the search is still running.\nIf `false`, the search has finished.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header.' + }), + is_partial: z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response does not contain complete search results.\nIf `is_partial` is `true` and `is_running` is `true`, the search is still running.\nIf `is_partial` is `true` but `is_running` is `false`, the results are partial due to a failure or timeout.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header.' + }), + columns: z.optional(z.array(sql_types_column).register(z.globalRegistry, { + description: 'Column headings for the search results. Each object is a column.' + })), + cursor: z.optional(z.string().register(z.globalRegistry, { + description: 'The cursor for the next set of paginated results.\nFor CSV, TSV, and TXT responses, this value is returned in the `Cursor` HTTP header.' + })), + rows: z.array(sql_types_row).register(z.globalRegistry, { + description: 'The values for the search results.' }) - ), - rows: z.array(sql_types_row).register(z.globalRegistry, { - description: 'The values for the search results.', - }), }); export const sql_get_async_status_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const sql_get_async_status_response = z.object({ - expiration_time_in_millis: types_epoch_time_unit_millis, - id: z.string().register(z.globalRegistry, { - description: 'The identifier for the search.', - }), - is_running: z.boolean().register(z.globalRegistry, { - description: 'If `true`, the search is still running.\nIf `false`, the search has finished.', - }), - is_partial: z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response does not contain complete search results.\nIf `is_partial` is `true` and `is_running` is `true`, the search is still running.\nIf `is_partial` is `true` but `is_running` is `false`, the results are partial due to a failure or timeout.', - }), - start_time_in_millis: types_epoch_time_unit_millis, - completion_status: z.optional(types_uint), + expiration_time_in_millis: types_epoch_time_unit_millis, + id: z.string().register(z.globalRegistry, { + description: 'The identifier for the search.' + }), + is_running: z.boolean().register(z.globalRegistry, { + description: 'If `true`, the search is still running.\nIf `false`, the search has finished.' + }), + is_partial: z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response does not contain complete search results.\nIf `is_partial` is `true` and `is_running` is `true`, the search is still running.\nIf `is_partial` is `true` but `is_running` is `false`, the results are partial due to a failure or timeout.' + }), + start_time_in_millis: types_epoch_time_unit_millis, + completion_status: z.optional(types_uint) }); export const ssl_certificates_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const ssl_certificates_response = z.array(ssl_certificates_certificate_information); export const synonyms_delete_synonym_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const synonyms_delete_synonym_response = types_acknowledged_response_base; export const synonyms_get_synonym_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'The starting offset for query rules to retrieve.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The max number of query rules to retrieve.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + from: z.optional(z.number().register(z.globalRegistry, { + description: 'The starting offset for query rules to retrieve.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The max number of query rules to retrieve.' + })) + })) }); export const synonyms_get_synonym_response = z.object({ - count: z.number().register(z.globalRegistry, { - description: 'The total number of synonyms rules that the synonyms set contains.', - }), - synonyms_set: z.array(synonyms_types_synonym_rule_read).register(z.globalRegistry, { - description: 'Synonym rule details.', - }), + count: z.number().register(z.globalRegistry, { + description: 'The total number of synonyms rules that the synonyms set contains.' + }), + synonyms_set: z.array(synonyms_types_synonym_rule_read).register(z.globalRegistry, { + description: 'Synonym rule details.' + }) }); export const synonyms_put_synonym_request = z.object({ - body: z.object({ - synonyms_set: z.union([synonyms_types_synonym_rule, z.array(synonyms_types_synonym_rule)]), - }), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - refresh: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request will refresh the analyzers with the new synonyms set and wait for the new synonyms to be available before returning.\nIf `false`, analyzers will not be reloaded with the new synonym set', - }) - ), - }) - ), + body: z.object({ + synonyms_set: z.union([ + synonyms_types_synonym_rule, + z.array(synonyms_types_synonym_rule) + ]) + }), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + refresh: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request will refresh the analyzers with the new synonyms set and wait for the new synonyms to be available before returning.\nIf `false`, analyzers will not be reloaded with the new synonym set' + })) + })) }); export const synonyms_put_synonym_response = z.object({ - result: types_result, - reload_analyzers_details: z.optional(indices_reload_search_analyzers_reload_result), + result: types_result, + reload_analyzers_details: z.optional(indices_reload_search_analyzers_reload_result) }); export const synonyms_delete_synonym_rule_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - set_id: types_id, - rule_id: types_id, - }), - query: z.optional( - z.object({ - refresh: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request will refresh the analyzers with the deleted synonym rule and wait for the new synonyms to be available before returning.\nIf `false`, analyzers will not be reloaded with the deleted synonym rule', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + set_id: types_id, + rule_id: types_id + }), + query: z.optional(z.object({ + refresh: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request will refresh the analyzers with the deleted synonym rule and wait for the new synonyms to be available before returning.\nIf `false`, analyzers will not be reloaded with the deleted synonym rule' + })) + })) }); export const synonyms_delete_synonym_rule_response = synonyms_types_synonyms_update_result; export const synonyms_get_synonym_rule_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - set_id: types_id, - rule_id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + set_id: types_id, + rule_id: types_id + }), + query: z.optional(z.never()) }); export const synonyms_get_synonym_rule_response = synonyms_types_synonym_rule_read; export const synonyms_put_synonym_rule_request = z.object({ - body: z.object({ - synonyms: synonyms_types_synonym_string, - }), - path: z.object({ - set_id: types_id, - rule_id: types_id, - }), - query: z.optional( - z.object({ - refresh: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request will refresh the analyzers with the new synonym rule and wait for the new synonyms to be available before returning.\nIf `false`, analyzers will not be reloaded with the new synonym rule', - }) - ), - }) - ), + body: z.object({ + synonyms: synonyms_types_synonym_string + }), + path: z.object({ + set_id: types_id, + rule_id: types_id + }), + query: z.optional(z.object({ + refresh: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request will refresh the analyzers with the new synonym rule and wait for the new synonyms to be available before returning.\nIf `false`, analyzers will not be reloaded with the new synonym rule' + })) + })) }); export const synonyms_put_synonym_rule_response = synonyms_types_synonyms_update_result; export const synonyms_get_synonyms_sets_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'The starting offset for synonyms sets to retrieve.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of synonyms sets to retrieve.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + from: z.optional(z.number().register(z.globalRegistry, { + description: 'The starting offset for synonyms sets to retrieve.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of synonyms sets to retrieve.' + })) + })) }); export const synonyms_get_synonyms_sets_response = z.object({ - count: z.number().register(z.globalRegistry, { - description: 'The total number of synonyms sets defined.', - }), - results: z.array(synonyms_get_synonyms_sets_synonyms_set_item).register(z.globalRegistry, { - description: 'The identifier and total number of defined synonym rules for each synonyms set.', - }), + count: z.number().register(z.globalRegistry, { + description: 'The total number of synonyms sets defined.' + }), + results: z.array(synonyms_get_synonyms_sets_synonyms_set_item).register(z.globalRegistry, { + description: 'The identifier and total number of defined synonym rules for each synonyms set.' + }) }); export const tasks_cancel_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - actions: z.optional(z.union([z.string(), z.array(z.string())])), - nodes: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'A comma-separated list of node IDs or names that is used to limit the request.', - }) - ), - parent_task_id: z.optional( - z.string().register(z.globalRegistry, { - description: 'A parent task ID that is used to limit the tasks.', - }) - ), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the request blocks until all found tasks are complete.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + actions: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + nodes: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A comma-separated list of node IDs or names that is used to limit the request.' + })), + parent_task_id: z.optional(z.string().register(z.globalRegistry, { + description: 'A parent task ID that is used to limit the tasks.' + })), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request blocks until all found tasks are complete.' + })) + })) }); export const tasks_cancel_response = tasks_types_task_list_response_base; export const tasks_cancel1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - task_id: types_task_id, - }), - query: z.optional( - z.object({ - actions: z.optional(z.union([z.string(), z.array(z.string())])), - nodes: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'A comma-separated list of node IDs or names that is used to limit the request.', - }) - ), - parent_task_id: z.optional( - z.string().register(z.globalRegistry, { - description: 'A parent task ID that is used to limit the tasks.', - }) - ), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the request blocks until all found tasks are complete.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + task_id: types_task_id + }), + query: z.optional(z.object({ + actions: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + nodes: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A comma-separated list of node IDs or names that is used to limit the request.' + })), + parent_task_id: z.optional(z.string().register(z.globalRegistry, { + description: 'A parent task ID that is used to limit the tasks.' + })), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request blocks until all found tasks are complete.' + })) + })) }); export const tasks_cancel1_response = tasks_types_task_list_response_base; export const tasks_get_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - task_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request blocks until the task has completed.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + task_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request blocks until the task has completed.' + })) + })) }); export const tasks_get_response = z.object({ - completed: z.boolean(), - task: tasks_types_task_info, - response: z.optional(z.record(z.string(), z.unknown())), - error: z.optional(types_error_cause), + completed: z.boolean(), + task: tasks_types_task_info, + response: z.optional(z.record(z.string(), z.unknown())), + error: z.optional(types_error_cause) }); export const tasks_list_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - actions: z.optional(z.union([z.string(), z.array(z.string())])), - detailed: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes detailed information about the running tasks.\nThis information is useful to distinguish tasks from each other but is more costly to run.', - }) - ), - group_by: z.optional(tasks_types_group_by), - nodes: z.optional(types_node_ids), - parent_task_id: z.optional(types_id), - timeout: z.optional(types_duration), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request blocks until the operation is complete.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + actions: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + detailed: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes detailed information about the running tasks.\nThis information is useful to distinguish tasks from each other but is more costly to run.' + })), + group_by: z.optional(tasks_types_group_by), + nodes: z.optional(types_node_ids), + parent_task_id: z.optional(types_id), + timeout: z.optional(types_duration), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request blocks until the operation is complete.' + })) + })) }); export const tasks_list_response = tasks_types_task_list_response_base; export const termvectors_request = z.object({ - body: z.optional(termvectors), - path: z.object({ - index: types_index_name, - id: types_id, - }), - query: z.optional( - z.object({ - fields: z.optional(types_fields), - field_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes:\n\n* The document count (how many documents contain this field).\n* The sum of document frequencies (the sum of document frequencies for all terms in this field).\n* The sum of total term frequencies (the sum of total term frequencies of each term in this field).', - }) - ), - offsets: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term offsets.', - }) - ), - payloads: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term payloads.', - }) - ), - positions: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term positions.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - realtime: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the request is real-time as opposed to near-real-time.', - }) - ), - routing: z.optional(types_routing), - term_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes:\n\n* The total term frequency (how often a term occurs in all documents).\n* The document frequency (the number of documents containing the current term).\n\nBy default these values are not returned since term statistics can have a serious performance impact.', - }) - ), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - }) - ), + body: z.optional(termvectors), + path: z.object({ + index: types_index_name, + id: types_id + }), + query: z.optional(z.object({ + fields: z.optional(types_fields), + field_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes:\n\n* The document count (how many documents contain this field).\n* The sum of document frequencies (the sum of document frequencies for all terms in this field).\n* The sum of total term frequencies (the sum of total term frequencies of each term in this field).' + })), + offsets: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term offsets.' + })), + payloads: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term payloads.' + })), + positions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term positions.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + realtime: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request is real-time as opposed to near-real-time.' + })), + routing: z.optional(types_routing), + term_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes:\n\n* The total term frequency (how often a term occurs in all documents).\n* The document frequency (the number of documents containing the current term).\n\nBy default these values are not returned since term statistics can have a serious performance impact.' + })), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type) + })) }); export const termvectors_response = z.object({ - found: z.boolean(), - _id: z.optional(types_id), - _index: types_index_name, - term_vectors: z.optional(z.record(z.string(), global_termvectors_term_vector)), - took: z.number(), - _version: types_version_number, + found: z.boolean(), + _id: z.optional(types_id), + _index: types_index_name, + term_vectors: z.optional(z.record(z.string(), global_termvectors_term_vector)), + took: z.number(), + _version: types_version_number }); export const termvectors1_request = z.object({ - body: z.optional(termvectors), - path: z.object({ - index: types_index_name, - id: types_id, - }), - query: z.optional( - z.object({ - fields: z.optional(types_fields), - field_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes:\n\n* The document count (how many documents contain this field).\n* The sum of document frequencies (the sum of document frequencies for all terms in this field).\n* The sum of total term frequencies (the sum of total term frequencies of each term in this field).', - }) - ), - offsets: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term offsets.', - }) - ), - payloads: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term payloads.', - }) - ), - positions: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term positions.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - realtime: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the request is real-time as opposed to near-real-time.', - }) - ), - routing: z.optional(types_routing), - term_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes:\n\n* The total term frequency (how often a term occurs in all documents).\n* The document frequency (the number of documents containing the current term).\n\nBy default these values are not returned since term statistics can have a serious performance impact.', - }) - ), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - }) - ), -}); - -export const termvectors1_response = z.object({ - found: z.boolean(), - _id: z.optional(types_id), - _index: types_index_name, - term_vectors: z.optional(z.record(z.string(), global_termvectors_term_vector)), - took: z.number(), - _version: types_version_number, -}); - -export const termvectors2_request = z.object({ - body: z.optional(termvectors), - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - fields: z.optional(types_fields), - field_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes:\n\n* The document count (how many documents contain this field).\n* The sum of document frequencies (the sum of document frequencies for all terms in this field).\n* The sum of total term frequencies (the sum of total term frequencies of each term in this field).', - }) - ), - offsets: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term offsets.', - }) - ), - payloads: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term payloads.', - }) - ), - positions: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term positions.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - realtime: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the request is real-time as opposed to near-real-time.', - }) - ), - routing: z.optional(types_routing), - term_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes:\n\n* The total term frequency (how often a term occurs in all documents).\n* The document frequency (the number of documents containing the current term).\n\nBy default these values are not returned since term statistics can have a serious performance impact.', - }) - ), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - }) - ), + body: z.optional(termvectors), + path: z.object({ + index: types_index_name, + id: types_id + }), + query: z.optional(z.object({ + fields: z.optional(types_fields), + field_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes:\n\n* The document count (how many documents contain this field).\n* The sum of document frequencies (the sum of document frequencies for all terms in this field).\n* The sum of total term frequencies (the sum of total term frequencies of each term in this field).' + })), + offsets: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term offsets.' + })), + payloads: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term payloads.' + })), + positions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term positions.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + realtime: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request is real-time as opposed to near-real-time.' + })), + routing: z.optional(types_routing), + term_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes:\n\n* The total term frequency (how often a term occurs in all documents).\n* The document frequency (the number of documents containing the current term).\n\nBy default these values are not returned since term statistics can have a serious performance impact.' + })), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type) + })) +}); + +export const termvectors1_response = z.object({ + found: z.boolean(), + _id: z.optional(types_id), + _index: types_index_name, + term_vectors: z.optional(z.record(z.string(), global_termvectors_term_vector)), + took: z.number(), + _version: types_version_number +}); + +export const termvectors2_request = z.object({ + body: z.optional(termvectors), + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + fields: z.optional(types_fields), + field_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes:\n\n* The document count (how many documents contain this field).\n* The sum of document frequencies (the sum of document frequencies for all terms in this field).\n* The sum of total term frequencies (the sum of total term frequencies of each term in this field).' + })), + offsets: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term offsets.' + })), + payloads: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term payloads.' + })), + positions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term positions.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + realtime: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request is real-time as opposed to near-real-time.' + })), + routing: z.optional(types_routing), + term_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes:\n\n* The total term frequency (how often a term occurs in all documents).\n* The document frequency (the number of documents containing the current term).\n\nBy default these values are not returned since term statistics can have a serious performance impact.' + })), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type) + })) }); export const termvectors2_response = z.object({ - found: z.boolean(), - _id: z.optional(types_id), - _index: types_index_name, - term_vectors: z.optional(z.record(z.string(), global_termvectors_term_vector)), - took: z.number(), - _version: types_version_number, + found: z.boolean(), + _id: z.optional(types_id), + _index: types_index_name, + term_vectors: z.optional(z.record(z.string(), global_termvectors_term_vector)), + took: z.number(), + _version: types_version_number }); export const termvectors3_request = z.object({ - body: z.optional(termvectors), - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - fields: z.optional(types_fields), - field_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes:\n\n* The document count (how many documents contain this field).\n* The sum of document frequencies (the sum of document frequencies for all terms in this field).\n* The sum of total term frequencies (the sum of total term frequencies of each term in this field).', - }) - ), - offsets: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term offsets.', - }) - ), - payloads: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term payloads.', - }) - ), - positions: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the response includes term positions.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - realtime: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the request is real-time as opposed to near-real-time.', - }) - ), - routing: z.optional(types_routing), - term_statistics: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes:\n\n* The total term frequency (how often a term occurs in all documents).\n* The document frequency (the number of documents containing the current term).\n\nBy default these values are not returned since term statistics can have a serious performance impact.', - }) - ), - version: z.optional(types_version_number), - version_type: z.optional(types_version_type), - }) - ), + body: z.optional(termvectors), + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + fields: z.optional(types_fields), + field_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes:\n\n* The document count (how many documents contain this field).\n* The sum of document frequencies (the sum of document frequencies for all terms in this field).\n* The sum of total term frequencies (the sum of total term frequencies of each term in this field).' + })), + offsets: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term offsets.' + })), + payloads: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term payloads.' + })), + positions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes term positions.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + realtime: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request is real-time as opposed to near-real-time.' + })), + routing: z.optional(types_routing), + term_statistics: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes:\n\n* The total term frequency (how often a term occurs in all documents).\n* The document frequency (the number of documents containing the current term).\n\nBy default these values are not returned since term statistics can have a serious performance impact.' + })), + version: z.optional(types_version_number), + version_type: z.optional(types_version_type) + })) }); export const termvectors3_response = z.object({ - found: z.boolean(), - _id: z.optional(types_id), - _index: types_index_name, - term_vectors: z.optional(z.record(z.string(), global_termvectors_term_vector)), - took: z.number(), - _version: types_version_number, + found: z.boolean(), + _id: z.optional(types_id), + _index: types_index_name, + term_vectors: z.optional(z.record(z.string(), global_termvectors_term_vector)), + took: z.number(), + _version: types_version_number }); export const text_structure_test_grok_pattern_request = z.object({ - body: text_structure_test_grok_pattern, - path: z.optional(z.never()), - query: z.optional( - z.object({ - ecs_compatibility: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The mode of compatibility with ECS compliant Grok patterns.\nUse this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.\nValid values are `disabled` and `v1`.', - }) - ), - }) - ), + body: text_structure_test_grok_pattern, + path: z.optional(z.never()), + query: z.optional(z.object({ + ecs_compatibility: z.optional(z.string().register(z.globalRegistry, { + description: 'The mode of compatibility with ECS compliant Grok patterns.\nUse this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.\nValid values are `disabled` and `v1`.' + })) + })) }); export const text_structure_test_grok_pattern_response = z.object({ - matches: z.array(text_structure_test_grok_pattern_matched_text), + matches: z.array(text_structure_test_grok_pattern_matched_text) }); export const text_structure_test_grok_pattern1_request = z.object({ - body: text_structure_test_grok_pattern, - path: z.optional(z.never()), - query: z.optional( - z.object({ - ecs_compatibility: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The mode of compatibility with ECS compliant Grok patterns.\nUse this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.\nValid values are `disabled` and `v1`.', - }) - ), - }) - ), + body: text_structure_test_grok_pattern, + path: z.optional(z.never()), + query: z.optional(z.object({ + ecs_compatibility: z.optional(z.string().register(z.globalRegistry, { + description: 'The mode of compatibility with ECS compliant Grok patterns.\nUse this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.\nValid values are `disabled` and `v1`.' + })) + })) }); export const text_structure_test_grok_pattern1_response = z.object({ - matches: z.array(text_structure_test_grok_pattern_matched_text), + matches: z.array(text_structure_test_grok_pattern_matched_text) }); export const transform_delete_transform_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - transform_id: types_id, - }), - query: z.optional( - z.object({ - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If this value is false, the transform must be stopped before it can be deleted. If true, the transform is\ndeleted regardless of its current state.', - }) - ), - delete_dest_index: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If this value is true, the destination index is deleted together with the transform. If false, the destination\nindex will not be deleted', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + transform_id: types_id + }), + query: z.optional(z.object({ + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If this value is false, the transform must be stopped before it can be deleted. If true, the transform is\ndeleted regardless of its current state.' + })), + delete_dest_index: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If this value is true, the destination index is deleted together with the transform. If false, the destination\nindex will not be deleted' + })), + timeout: z.optional(types_duration) + })) }); export const transform_delete_transform_response = types_acknowledged_response_base; export const transform_get_node_stats_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); -export const transform_get_node_stats_response = transform_get_node_stats_transform_node_stats; +export const transform_get_node_stats_response = transform_get_node_stats_transform_node_full_stats; export const transform_get_transform_stats_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - transform_id: types_names, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no transforms that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf this parameter is false, the request returns a 404 status code when\nthere are no matches or only partial matches.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of transforms.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of transforms to obtain.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + transform_id: types_names + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no transforms that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf this parameter is false, the request returns a 404 status code when\nthere are no matches or only partial matches.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of transforms.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of transforms to obtain.' + })), + timeout: z.optional(types_duration) + })) }); export const transform_get_transform_stats_response = z.object({ - count: z.number(), - transforms: z.array(transform_get_transform_stats_transform_stats), + count: z.number(), + transforms: z.array(transform_get_transform_stats_transform_stats) }); export const transform_reset_transform_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - transform_id: types_id, - }), - query: z.optional( - z.object({ - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If this value is `true`, the transform is reset regardless of its current state. If it's `false`, the transform\nmust be stopped before it can be reset.", - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + transform_id: types_id + }), + query: z.optional(z.object({ + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If this value is `true`, the transform is reset regardless of its current state. If it\'s `false`, the transform\nmust be stopped before it can be reset.' + })), + timeout: z.optional(types_duration) + })) }); export const transform_reset_transform_response = types_acknowledged_response_base; export const transform_schedule_now_transform_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - transform_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + transform_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const transform_schedule_now_transform_response = types_acknowledged_response_base; export const transform_set_upgrade_mode_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - enabled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When `true`, it enables `upgrade_mode` which temporarily halts all\ntransform tasks and prohibits new transform tasks from\nstarting.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When `true`, it enables `upgrade_mode` which temporarily halts all\ntransform tasks and prohibits new transform tasks from\nstarting.' + })), + timeout: z.optional(types_duration) + })) }); export const transform_set_upgrade_mode_response = types_acknowledged_response_base; export const transform_start_transform_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - transform_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - from: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Restricts the set of transformed entities to those changed after this time. Relative times like now-30d are supported. Only applicable for continuous transforms.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + transform_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration), + from: z.optional(z.string().register(z.globalRegistry, { + description: 'Restricts the set of transformed entities to those changed after this time. Relative times like now-30d are supported. Only applicable for continuous transforms.' + })) + })) }); export const transform_start_transform_response = types_acknowledged_response_base; export const transform_stop_transform_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - transform_id: types_name, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request: contains wildcard expressions and there are no transforms that match;\ncontains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there\nare only partial matches.\n\nIf it is true, the API returns a successful acknowledgement message when there are no matches. When there are\nonly partial matches, the API stops the appropriate transforms.\n\nIf it is false, the request returns a 404 status code when there are no matches or only partial matches.', - }) - ), - force: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If it is true, the API forcefully stops the transforms.', - }) - ), - timeout: z.optional(types_duration), - wait_for_checkpoint: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If it is true, the transform does not completely stop until the current checkpoint is completed. If it is false,\nthe transform stops as soon as possible.', - }) - ), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If it is true, the API blocks until the indexer state completely stops. If it is false, the API returns\nimmediately and the indexer is stopped asynchronously in the background.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + transform_id: types_name + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request: contains wildcard expressions and there are no transforms that match;\ncontains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there\nare only partial matches.\n\nIf it is true, the API returns a successful acknowledgement message when there are no matches. When there are\nonly partial matches, the API stops the appropriate transforms.\n\nIf it is false, the request returns a 404 status code when there are no matches or only partial matches.' + })), + force: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If it is true, the API forcefully stops the transforms.' + })), + timeout: z.optional(types_duration), + wait_for_checkpoint: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If it is true, the transform does not completely stop until the current checkpoint is completed. If it is false,\nthe transform stops as soon as possible.' + })), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If it is true, the API blocks until the indexer state completely stops. If it is false, the API returns\nimmediately and the indexer is stopped asynchronously in the background.' + })) + })) }); export const transform_stop_transform_response = types_acknowledged_response_base; export const transform_upgrade_transforms_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - dry_run: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'When true, the request checks for updates but does not run them.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + dry_run: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When true, the request checks for updates but does not run them.' + })), + timeout: z.optional(types_duration) + })) }); export const transform_upgrade_transforms_response = z.object({ - needs_update: z.number().register(z.globalRegistry, { - description: 'The number of transforms that need to be upgraded.', - }), - no_action: z.number().register(z.globalRegistry, { - description: 'The number of transforms that don’t require upgrading.', - }), - updated: z.number().register(z.globalRegistry, { - description: 'The number of transforms that have been upgraded.', - }), + needs_update: z.number().register(z.globalRegistry, { + description: 'The number of transforms that need to be upgraded.' + }), + no_action: z.number().register(z.globalRegistry, { + description: 'The number of transforms that don’t require upgrading.' + }), + updated: z.number().register(z.globalRegistry, { + description: 'The number of transforms that have been upgraded.' + }) }); export const update_by_query_rethrottle_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - task_id: types_id, - }), - query: z.object({ - requests_per_second: z.number().register(z.globalRegistry, { - description: - 'The throttle for this request in sub-requests per second.\nTo turn off throttling, set it to `-1`.', + body: z.optional(z.never()), + path: z.object({ + task_id: types_id }), - }), + query: z.object({ + requests_per_second: z.number().register(z.globalRegistry, { + description: 'The throttle for this request in sub-requests per second.\nTo turn off throttling, set it to `-1`.' + }) + }) }); export const update_by_query_rethrottle_response = z.object({ - nodes: z.record(z.string(), global_update_by_query_rethrottle_update_by_query_rethrottle_node), + nodes: z.record(z.string(), global_update_by_query_rethrottle_update_by_query_rethrottle_node) }); export const watcher_ack_watch1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - watch_id: types_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + watch_id: types_name + }), + query: z.optional(z.never()) }); export const watcher_ack_watch1_response = z.object({ - status: watcher_types_watch_status, + status: watcher_types_watch_status }); export const watcher_ack_watch_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - watch_id: types_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + watch_id: types_name + }), + query: z.optional(z.never()) }); export const watcher_ack_watch_response = z.object({ - status: watcher_types_watch_status, + status: watcher_types_watch_status }); export const watcher_ack_watch3_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - watch_id: types_name, - action_id: types_names, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + watch_id: types_name, + action_id: types_names + }), + query: z.optional(z.never()) }); export const watcher_ack_watch3_response = z.object({ - status: watcher_types_watch_status, + status: watcher_types_watch_status }); export const watcher_ack_watch2_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - watch_id: types_name, - action_id: types_names, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + watch_id: types_name, + action_id: types_names + }), + query: z.optional(z.never()) }); export const watcher_ack_watch2_response = z.object({ - status: watcher_types_watch_status, + status: watcher_types_watch_status }); export const watcher_activate_watch1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - watch_id: types_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + watch_id: types_name + }), + query: z.optional(z.never()) }); export const watcher_activate_watch1_response = z.object({ - status: watcher_types_activation_status, + status: watcher_types_activation_status }); export const watcher_activate_watch_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - watch_id: types_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + watch_id: types_name + }), + query: z.optional(z.never()) }); export const watcher_activate_watch_response = z.object({ - status: watcher_types_activation_status, + status: watcher_types_activation_status }); export const watcher_deactivate_watch1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - watch_id: types_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + watch_id: types_name + }), + query: z.optional(z.never()) }); export const watcher_deactivate_watch1_response = z.object({ - status: watcher_types_activation_status, + status: watcher_types_activation_status }); export const watcher_deactivate_watch_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - watch_id: types_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + watch_id: types_name + }), + query: z.optional(z.never()) }); export const watcher_deactivate_watch_response = z.object({ - status: watcher_types_activation_status, + status: watcher_types_activation_status }); export const watcher_delete_watch_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_name + }), + query: z.optional(z.never()) }); export const watcher_delete_watch_response = z.object({ - found: z.boolean(), - _id: types_id, - _version: types_version_number, + found: z.boolean(), + _id: types_id, + _version: types_version_number }); export const watcher_update_settings_request = z.object({ - body: z.object({ - 'index.auto_expand_replicas': z.optional(z.string()), - 'index.number_of_replicas': z.optional(z.number()), - }), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + 'index.auto_expand_replicas': z.optional(z.string()), + 'index.number_of_replicas': z.optional(z.number()) + }), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const watcher_update_settings_response = z.object({ - acknowledged: z.boolean(), + acknowledged: z.boolean() }); export const watcher_start_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const watcher_start_response = types_acknowledged_response_base; export const watcher_stats_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - emit_stacktraces: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Defines whether stack traces are generated for each watch that is running.', - }) - ), - metric: z.optional( - z.union([watcher_stats_watcher_metric, z.array(watcher_stats_watcher_metric)]) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + emit_stacktraces: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Defines whether stack traces are generated for each watch that is running.' + })), + metric: z.optional(z.union([ + watcher_stats_watcher_metric, + z.array(watcher_stats_watcher_metric) + ])) + })) }); export const watcher_stats_response = z.object({ - _nodes: types_node_statistics, - cluster_name: types_name, - manually_stopped: z.boolean(), - stats: z.array(watcher_stats_watcher_node_stats), + _nodes: types_node_statistics, + cluster_name: types_name, + manually_stopped: z.boolean(), + stats: z.array(watcher_stats_watcher_node_stats) }); export const watcher_stats1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - metric: z.union([watcher_stats_watcher_metric, z.array(watcher_stats_watcher_metric)]), - }), - query: z.optional( - z.object({ - emit_stacktraces: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Defines whether stack traces are generated for each watch that is running.', - }) - ), - metric: z.optional( - z.union([watcher_stats_watcher_metric, z.array(watcher_stats_watcher_metric)]) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + metric: z.union([ + watcher_stats_watcher_metric, + z.array(watcher_stats_watcher_metric) + ]) + }), + query: z.optional(z.object({ + emit_stacktraces: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Defines whether stack traces are generated for each watch that is running.' + })), + metric: z.optional(z.union([ + watcher_stats_watcher_metric, + z.array(watcher_stats_watcher_metric) + ])) + })) }); export const watcher_stats1_response = z.object({ - _nodes: types_node_statistics, - cluster_name: types_name, - manually_stopped: z.boolean(), - stats: z.array(watcher_stats_watcher_node_stats), + _nodes: types_node_statistics, + cluster_name: types_name, + manually_stopped: z.boolean(), + stats: z.array(watcher_stats_watcher_node_stats) }); export const watcher_stop_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const watcher_stop_response = types_acknowledged_response_base; export const xpack_info_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - categories: z.optional( - z.array(xpack_info_x_pack_category).register(z.globalRegistry, { - description: - 'A comma-separated list of the information categories to include in the response.\nFor example, `build,license,features`.', - }) - ), - accept_enterprise: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If this param is used it must be set to true', - }) - ), - human: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Defines whether additional human-readable information is included in the response.\nIn particular, it adds descriptions and a tag line.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + categories: z.optional(z.array(xpack_info_x_pack_category).register(z.globalRegistry, { + description: 'A comma-separated list of the information categories to include in the response.\nFor example, `build,license,features`.' + })), + accept_enterprise: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If used, this otherwise ignored parameter must be set to true' + })), + human: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Defines whether additional human-readable information is included in the response.\nIn particular, it adds descriptions and a tag line.' + })) + })) }); export const xpack_info_response = z.object({ - build: xpack_info_build_information, - features: xpack_info_features, - license: xpack_info_minimal_license_information, - tagline: z.string(), + build: xpack_info_build_information, + features: xpack_info_features, + license: xpack_info_minimal_license_information, + tagline: z.string() }); export const xpack_usage_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const xpack_usage_response = z.object({ - aggregate_metric: xpack_usage_base, - analytics: xpack_usage_analytics, - archive: xpack_usage_archive, - watcher: xpack_usage_watcher, - ccr: xpack_usage_ccr, - data_frame: z.optional(xpack_usage_base), - data_science: z.optional(xpack_usage_base), - data_streams: z.optional(xpack_usage_data_streams), - data_tiers: xpack_usage_data_tiers, - enrich: z.optional(xpack_usage_base), - eql: xpack_usage_eql, - flattened: z.optional(xpack_usage_flattened), - graph: xpack_usage_base, - health_api: z.optional(xpack_usage_health_statistics), - ilm: xpack_usage_ilm, - logstash: xpack_usage_base, - ml: xpack_usage_machine_learning, - monitoring: xpack_usage_monitoring, - rollup: xpack_usage_base, - runtime_fields: z.optional(xpack_usage_runtime_field_types), - spatial: xpack_usage_base, - searchable_snapshots: xpack_usage_searchable_snapshots, - security: xpack_usage_security, - slm: xpack_usage_slm, - sql: xpack_usage_sql, - transform: xpack_usage_base, - vectors: z.optional(xpack_usage_vector), - voting_only: xpack_usage_base, + aggregate_metric: xpack_usage_base, + analytics: xpack_usage_analytics, + archive: xpack_usage_archive, + watcher: xpack_usage_watcher, + ccr: xpack_usage_ccr, + data_frame: z.optional(xpack_usage_base), + data_science: z.optional(xpack_usage_base), + data_streams: z.optional(xpack_usage_data_streams), + data_tiers: xpack_usage_data_tiers, + enrich: z.optional(xpack_usage_base), + eql: xpack_usage_eql, + flattened: z.optional(xpack_usage_flattened), + graph: xpack_usage_base, + health_api: z.optional(xpack_usage_health_statistics), + ilm: xpack_usage_ilm, + logstash: xpack_usage_base, + ml: xpack_usage_machine_learning, + monitoring: xpack_usage_monitoring, + rollup: xpack_usage_base, + runtime_fields: z.optional(xpack_usage_runtime_field_types), + spatial: xpack_usage_base, + searchable_snapshots: xpack_usage_searchable_snapshots, + security: xpack_usage_security, + slm: xpack_usage_slm, + sql: xpack_usage_sql, + transform: xpack_usage_base, + vectors: z.optional(xpack_usage_vector), + voting_only: xpack_usage_base }); export const async_search_get_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - keep_alive: z.optional(types_duration), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specify whether aggregation and suggester names should be prefixed by their respective types in the response', - }) - ), - wait_for_completion_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + keep_alive: z.optional(types_duration), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether aggregation and suggester names should be prefixed by their respective types in the response' + })), + wait_for_completion_timeout: z.optional(types_duration) + })) }); export const async_search_get_response = async_search_types_async_search_document_response_base; export const async_search_submit_request = z.object({ - body: z.optional(async_search_submit), - path: z.optional(z.never()), - query: z.optional( - z.object({ - wait_for_completion_timeout: z.optional(types_duration), - keep_alive: z.optional(types_duration), - keep_on_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, results are stored for later retrieval when the search completes within the `wait_for_completion_timeout`.', - }) - ), - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', - }) - ), - allow_partial_search_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicate if an error should be returned if there is a partial search failure or timeout', - }) - ), - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: 'The analyzer to use for the query string', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specify whether wildcard and prefix queries should be analyzed (default: false)', - }) - ), - batched_reduce_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Affects how often partial results become available, which happens whenever shard results are reduced.\nA partial reduction is performed every time the coordinating node has received a certain number of new shard responses (5 by default).', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'The default value is the only supported value.', - }) - ), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field to use as default where no field prefix is given in the query string', - }) - ), - docvalue_fields: z.optional(types_fields), - expand_wildcards: z.optional(types_expand_wildcards), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specify whether to return detailed information about score computation as part of a hit', - }) - ), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether specified concrete, expanded or aliased indices should be ignored when throttled', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether specified concrete indices should be ignored when unavailable (missing or closed)', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specify whether format-based query failures (such as providing text to a numeric field) should be ignored', - }) - ), - max_concurrent_shard_requests: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Specify the node or shard the operation should be performed on (default: random)', - }) - ), - request_cache: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specify if request cache should be used for this request or not, defaults to true', - }) - ), - routing: z.optional(types_routing), - search_type: z.optional(types_search_type), - stats: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: "Specific 'tag' of the request for logging and statistical purposes", - }) - ), - stored_fields: z.optional(types_fields), - suggest_field: z.optional(types_field), - suggest_mode: z.optional(types_suggest_mode), - suggest_size: z.optional( - z.number().register(z.globalRegistry, { - description: 'How many suggestions to return in response', - }) - ), - suggest_text: z.optional( - z.string().register(z.globalRegistry, { - description: 'The source text for which the suggestions should be returned.', - }) - ), - terminate_after: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.', - }) - ), - timeout: z.optional(types_duration), - track_total_hits: z.optional(global_search_types_track_hits), - track_scores: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to calculate and return scores even if they are not used for sorting', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specify whether aggregation and suggester names should be prefixed by their respective types in the response', - }) - ), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether hits.total should be rendered as an integer or an object in the rest search response', - }) - ), - version: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Specify whether to return document version as part of a hit', - }) - ), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - seq_no_primary_term: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specify whether to return sequence number and primary term of the last modification of each hit', - }) - ), - q: z.optional( - z.string().register(z.globalRegistry, { - description: 'Query in the Lucene query string syntax', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of hits to return (default: 10)', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Starting offset (default: 0)', - }) - ), - sort: z.optional(z.union([z.string(), z.array(z.string())])), - }) - ), + body: z.optional(async_search_submit), + path: z.optional(z.never()), + query: z.optional(z.object({ + wait_for_completion_timeout: z.optional(types_duration), + keep_alive: z.optional(types_duration), + keep_on_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, results are stored for later retrieval when the search completes within the `wait_for_completion_timeout`.' + })), + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' + })), + allow_partial_search_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicate if an error should be returned if there is a partial search failure or timeout' + })), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'The analyzer to use for the query string' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether wildcard and prefix queries should be analyzed' + })), + batched_reduce_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Affects how often partial results become available, which happens whenever shard results are reduced.\nA partial reduction is performed every time the coordinating node has received a certain number of new shard responses (5 by default).' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'The default value is the only supported value.' + })), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'The field to use as default where no field prefix is given in the query string' + })), + docvalue_fields: z.optional(types_fields), + expand_wildcards: z.optional(types_expand_wildcards), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether to return detailed information about score computation as part of a hit' + })), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether specified concrete, expanded or aliased indices should be ignored when throttled' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether specified concrete indices should be ignored when unavailable (missing or closed)' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether format-based query failures (such as providing text to a numeric field) should be ignored' + })), + max_concurrent_shard_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of concurrent shard requests per node this search executes concurrently.\nThis value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'Specify the node or shard the operation should be performed on' + })), + request_cache: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify if request cache should be used for this request or not, defaults to true' + })), + routing: z.optional(types_routing), + search_type: z.optional(types_search_type), + stats: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Specific \'tag\' of the request for logging and statistical purposes' + })), + stored_fields: z.optional(types_fields), + suggest_field: z.optional(types_field), + suggest_mode: z.optional(types_suggest_mode), + suggest_size: z.optional(z.number().register(z.globalRegistry, { + description: 'How many suggestions to return in response' + })), + suggest_text: z.optional(z.string().register(z.globalRegistry, { + description: 'The source text for which the suggestions should be returned.' + })), + terminate_after: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early' + })), + timeout: z.optional(types_duration), + track_total_hits: z.optional(global_search_types_track_hits), + track_scores: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to calculate and return scores even if they are not used for sorting' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether aggregation and suggester names should be prefixed by their respective types in the response' + })), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether hits.total should be rendered as an integer or an object in the rest search response' + })), + version: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether to return document version as part of a hit' + })), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields), + seq_no_primary_term: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether to return sequence number and primary term of the last modification of each hit' + })), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'Query in the Lucene query string syntax' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of hits to return' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Starting offset' + })), + sort: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])) + })) }); export const async_search_submit_response = async_search_types_async_search_document_response_base; export const async_search_submit1_request = z.object({ - body: z.optional(async_search_submit), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - wait_for_completion_timeout: z.optional(types_duration), - keep_alive: z.optional(types_duration), - keep_on_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, results are stored for later retrieval when the search completes within the `wait_for_completion_timeout`.', - }) - ), - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', - }) - ), - allow_partial_search_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicate if an error should be returned if there is a partial search failure or timeout', - }) - ), - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: 'The analyzer to use for the query string', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specify whether wildcard and prefix queries should be analyzed (default: false)', - }) - ), - batched_reduce_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Affects how often partial results become available, which happens whenever shard results are reduced.\nA partial reduction is performed every time the coordinating node has received a certain number of new shard responses (5 by default).', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'The default value is the only supported value.', - }) - ), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field to use as default where no field prefix is given in the query string', - }) - ), - docvalue_fields: z.optional(types_fields), - expand_wildcards: z.optional(types_expand_wildcards), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specify whether to return detailed information about score computation as part of a hit', - }) - ), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether specified concrete, expanded or aliased indices should be ignored when throttled', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether specified concrete indices should be ignored when unavailable (missing or closed)', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specify whether format-based query failures (such as providing text to a numeric field) should be ignored', - }) - ), - max_concurrent_shard_requests: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Specify the node or shard the operation should be performed on (default: random)', - }) - ), - request_cache: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specify if request cache should be used for this request or not, defaults to true', - }) - ), - routing: z.optional(types_routing), - search_type: z.optional(types_search_type), - stats: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: "Specific 'tag' of the request for logging and statistical purposes", - }) - ), - stored_fields: z.optional(types_fields), - suggest_field: z.optional(types_field), - suggest_mode: z.optional(types_suggest_mode), - suggest_size: z.optional( - z.number().register(z.globalRegistry, { - description: 'How many suggestions to return in response', - }) - ), - suggest_text: z.optional( - z.string().register(z.globalRegistry, { - description: 'The source text for which the suggestions should be returned.', - }) - ), - terminate_after: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.', - }) - ), - timeout: z.optional(types_duration), - track_total_hits: z.optional(global_search_types_track_hits), - track_scores: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to calculate and return scores even if they are not used for sorting', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specify whether aggregation and suggester names should be prefixed by their respective types in the response', - }) - ), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether hits.total should be rendered as an integer or an object in the rest search response', - }) - ), - version: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Specify whether to return document version as part of a hit', - }) - ), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - seq_no_primary_term: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specify whether to return sequence number and primary term of the last modification of each hit', - }) - ), - q: z.optional( - z.string().register(z.globalRegistry, { - description: 'Query in the Lucene query string syntax', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Number of hits to return (default: 10)', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Starting offset (default: 0)', - }) - ), - sort: z.optional(z.union([z.string(), z.array(z.string())])), - }) - ), + body: z.optional(async_search_submit), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + wait_for_completion_timeout: z.optional(types_duration), + keep_alive: z.optional(types_duration), + keep_on_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, results are stored for later retrieval when the search completes within the `wait_for_completion_timeout`.' + })), + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' + })), + allow_partial_search_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicate if an error should be returned if there is a partial search failure or timeout' + })), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'The analyzer to use for the query string' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether wildcard and prefix queries should be analyzed' + })), + batched_reduce_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Affects how often partial results become available, which happens whenever shard results are reduced.\nA partial reduction is performed every time the coordinating node has received a certain number of new shard responses (5 by default).' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'The default value is the only supported value.' + })), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'The field to use as default where no field prefix is given in the query string' + })), + docvalue_fields: z.optional(types_fields), + expand_wildcards: z.optional(types_expand_wildcards), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether to return detailed information about score computation as part of a hit' + })), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether specified concrete, expanded or aliased indices should be ignored when throttled' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether specified concrete indices should be ignored when unavailable (missing or closed)' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether format-based query failures (such as providing text to a numeric field) should be ignored' + })), + max_concurrent_shard_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of concurrent shard requests per node this search executes concurrently.\nThis value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'Specify the node or shard the operation should be performed on' + })), + request_cache: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify if request cache should be used for this request or not, defaults to true' + })), + routing: z.optional(types_routing), + search_type: z.optional(types_search_type), + stats: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Specific \'tag\' of the request for logging and statistical purposes' + })), + stored_fields: z.optional(types_fields), + suggest_field: z.optional(types_field), + suggest_mode: z.optional(types_suggest_mode), + suggest_size: z.optional(z.number().register(z.globalRegistry, { + description: 'How many suggestions to return in response' + })), + suggest_text: z.optional(z.string().register(z.globalRegistry, { + description: 'The source text for which the suggestions should be returned.' + })), + terminate_after: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early' + })), + timeout: z.optional(types_duration), + track_total_hits: z.optional(global_search_types_track_hits), + track_scores: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to calculate and return scores even if they are not used for sorting' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether aggregation and suggester names should be prefixed by their respective types in the response' + })), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether hits.total should be rendered as an integer or an object in the rest search response' + })), + version: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether to return document version as part of a hit' + })), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields), + seq_no_primary_term: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether to return sequence number and primary term of the last modification of each hit' + })), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'Query in the Lucene query string syntax' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Number of hits to return' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Starting offset' + })), + sort: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])) + })) }); export const async_search_submit1_response = async_search_types_async_search_document_response_base; export const bulk_request = z.object({ - body: bulk, - path: z.optional(z.never()), - query: z.optional( - z.object({ - include_source_on_error: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'True or false if to include the document source in the error message in case of parsing errors.', - }) - ), - list_executed_pipelines: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response will include the ingest pipelines that were run for each index or create.', - }) - ), - pipeline: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The pipeline identifier to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.', - }) - ), - refresh: z.optional(types_refresh), - routing: z.optional(types_routing), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - require_alias: z.optional( - z.boolean().register(z.globalRegistry, { - description: "If `true`, the request's actions must target an index alias.", - }) - ), - require_data_stream: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `true`, the request's actions must target a data stream (existing or to be created).", - }) - ), - }) - ), + body: bulk, + path: z.optional(z.never()), + query: z.optional(z.object({ + include_source_on_error: z.optional(z.boolean().register(z.globalRegistry, { + description: 'True or false if to include the document source in the error message in case of parsing errors.' + })), + list_executed_pipelines: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response will include the ingest pipelines that were run for each index or create.' + })), + pipeline: z.optional(z.string().register(z.globalRegistry, { + description: 'The pipeline identifier to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.' + })), + refresh: z.optional(types_refresh), + routing: z.optional(types_routing), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards), + require_alias: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request\'s actions must target an index alias.' + })), + require_data_stream: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request\'s actions must target a data stream (existing or to be created).' + })) + })) }); export const bulk_response = z.object({ - errors: z.boolean().register(z.globalRegistry, { - description: - 'If `true`, one or more of the operations in the bulk request did not complete successfully.', - }), - items: z.array(z.record(z.string(), global_bulk_response_item)).register(z.globalRegistry, { - description: - 'The result of each operation in the bulk request, in the order they were submitted.', - }), - took: z.number().register(z.globalRegistry, { - description: 'The length of time, in milliseconds, it took to process the bulk request.', - }), - ingest_took: z.optional(z.number()), + errors: z.boolean().register(z.globalRegistry, { + description: 'If `true`, one or more of the operations in the bulk request did not complete successfully.' + }), + items: z.array(z.record(z.string(), global_bulk_response_item)).register(z.globalRegistry, { + description: 'The result of each operation in the bulk request, in the order they were submitted.' + }), + took: z.number().register(z.globalRegistry, { + description: 'The length of time, in milliseconds, it took to process the bulk request.' + }), + ingest_took: z.optional(z.number()) }); export const bulk1_request = z.object({ - body: bulk, - path: z.optional(z.never()), - query: z.optional( - z.object({ - include_source_on_error: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'True or false if to include the document source in the error message in case of parsing errors.', - }) - ), - list_executed_pipelines: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response will include the ingest pipelines that were run for each index or create.', - }) - ), - pipeline: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The pipeline identifier to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.', - }) - ), - refresh: z.optional(types_refresh), - routing: z.optional(types_routing), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - require_alias: z.optional( - z.boolean().register(z.globalRegistry, { - description: "If `true`, the request's actions must target an index alias.", - }) - ), - require_data_stream: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `true`, the request's actions must target a data stream (existing or to be created).", - }) - ), - }) - ), + body: bulk, + path: z.optional(z.never()), + query: z.optional(z.object({ + include_source_on_error: z.optional(z.boolean().register(z.globalRegistry, { + description: 'True or false if to include the document source in the error message in case of parsing errors.' + })), + list_executed_pipelines: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response will include the ingest pipelines that were run for each index or create.' + })), + pipeline: z.optional(z.string().register(z.globalRegistry, { + description: 'The pipeline identifier to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.' + })), + refresh: z.optional(types_refresh), + routing: z.optional(types_routing), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards), + require_alias: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request\'s actions must target an index alias.' + })), + require_data_stream: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request\'s actions must target a data stream (existing or to be created).' + })) + })) }); export const bulk1_response = z.object({ - errors: z.boolean().register(z.globalRegistry, { - description: - 'If `true`, one or more of the operations in the bulk request did not complete successfully.', - }), - items: z.array(z.record(z.string(), global_bulk_response_item)).register(z.globalRegistry, { - description: - 'The result of each operation in the bulk request, in the order they were submitted.', - }), - took: z.number().register(z.globalRegistry, { - description: 'The length of time, in milliseconds, it took to process the bulk request.', - }), - ingest_took: z.optional(z.number()), + errors: z.boolean().register(z.globalRegistry, { + description: 'If `true`, one or more of the operations in the bulk request did not complete successfully.' + }), + items: z.array(z.record(z.string(), global_bulk_response_item)).register(z.globalRegistry, { + description: 'The result of each operation in the bulk request, in the order they were submitted.' + }), + took: z.number().register(z.globalRegistry, { + description: 'The length of time, in milliseconds, it took to process the bulk request.' + }), + ingest_took: z.optional(z.number()) }); export const bulk2_request = z.object({ - body: bulk, - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - include_source_on_error: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'True or false if to include the document source in the error message in case of parsing errors.', - }) - ), - list_executed_pipelines: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response will include the ingest pipelines that were run for each index or create.', - }) - ), - pipeline: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The pipeline identifier to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.', - }) - ), - refresh: z.optional(types_refresh), - routing: z.optional(types_routing), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - require_alias: z.optional( - z.boolean().register(z.globalRegistry, { - description: "If `true`, the request's actions must target an index alias.", - }) - ), - require_data_stream: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `true`, the request's actions must target a data stream (existing or to be created).", - }) - ), - }) - ), + body: bulk, + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + include_source_on_error: z.optional(z.boolean().register(z.globalRegistry, { + description: 'True or false if to include the document source in the error message in case of parsing errors.' + })), + list_executed_pipelines: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response will include the ingest pipelines that were run for each index or create.' + })), + pipeline: z.optional(z.string().register(z.globalRegistry, { + description: 'The pipeline identifier to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.' + })), + refresh: z.optional(types_refresh), + routing: z.optional(types_routing), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards), + require_alias: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request\'s actions must target an index alias.' + })), + require_data_stream: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request\'s actions must target a data stream (existing or to be created).' + })) + })) }); export const bulk2_response = z.object({ - errors: z.boolean().register(z.globalRegistry, { - description: - 'If `true`, one or more of the operations in the bulk request did not complete successfully.', - }), - items: z.array(z.record(z.string(), global_bulk_response_item)).register(z.globalRegistry, { - description: - 'The result of each operation in the bulk request, in the order they were submitted.', - }), - took: z.number().register(z.globalRegistry, { - description: 'The length of time, in milliseconds, it took to process the bulk request.', - }), - ingest_took: z.optional(z.number()), + errors: z.boolean().register(z.globalRegistry, { + description: 'If `true`, one or more of the operations in the bulk request did not complete successfully.' + }), + items: z.array(z.record(z.string(), global_bulk_response_item)).register(z.globalRegistry, { + description: 'The result of each operation in the bulk request, in the order they were submitted.' + }), + took: z.number().register(z.globalRegistry, { + description: 'The length of time, in milliseconds, it took to process the bulk request.' + }), + ingest_took: z.optional(z.number()) }); export const bulk3_request = z.object({ - body: bulk, - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - include_source_on_error: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'True or false if to include the document source in the error message in case of parsing errors.', - }) - ), - list_executed_pipelines: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response will include the ingest pipelines that were run for each index or create.', - }) - ), - pipeline: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The pipeline identifier to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.', - }) - ), - refresh: z.optional(types_refresh), - routing: z.optional(types_routing), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - require_alias: z.optional( - z.boolean().register(z.globalRegistry, { - description: "If `true`, the request's actions must target an index alias.", - }) - ), - require_data_stream: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `true`, the request's actions must target a data stream (existing or to be created).", - }) - ), - }) - ), + body: bulk, + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + include_source_on_error: z.optional(z.boolean().register(z.globalRegistry, { + description: 'True or false if to include the document source in the error message in case of parsing errors.' + })), + list_executed_pipelines: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response will include the ingest pipelines that were run for each index or create.' + })), + pipeline: z.optional(z.string().register(z.globalRegistry, { + description: 'The pipeline identifier to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, setting the value to `_none` turns off the default ingest pipeline for this request.\nIf a final pipeline is configured, it will always run regardless of the value of this parameter.' + })), + refresh: z.optional(types_refresh), + routing: z.optional(types_routing), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards), + require_alias: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request\'s actions must target an index alias.' + })), + require_data_stream: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request\'s actions must target a data stream (existing or to be created).' + })) + })) }); export const bulk3_response = z.object({ - errors: z.boolean().register(z.globalRegistry, { - description: - 'If `true`, one or more of the operations in the bulk request did not complete successfully.', - }), - items: z.array(z.record(z.string(), global_bulk_response_item)).register(z.globalRegistry, { - description: - 'The result of each operation in the bulk request, in the order they were submitted.', - }), - took: z.number().register(z.globalRegistry, { - description: 'The length of time, in milliseconds, it took to process the bulk request.', - }), - ingest_took: z.optional(z.number()), + errors: z.boolean().register(z.globalRegistry, { + description: 'If `true`, one or more of the operations in the bulk request did not complete successfully.' + }), + items: z.array(z.record(z.string(), global_bulk_response_item)).register(z.globalRegistry, { + description: 'The result of each operation in the bulk request, in the order they were submitted.' + }), + took: z.number().register(z.globalRegistry, { + description: 'The length of time, in milliseconds, it took to process the bulk request.' + }), + ingest_took: z.optional(z.number()) }); export const ccr_follow_request = z.object({ - body: z.object({ - data_stream_name: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If the leader index is part of a data stream, the name to which the local data stream for the followed index should be renamed.', - }) - ), - leader_index: types_index_name, - max_outstanding_read_requests: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of outstanding reads requests from the remote cluster.', - }) - ), - max_outstanding_write_requests: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of outstanding write requests on the follower.', - }) - ), - max_read_request_operation_count: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of operations to pull per read from the remote cluster.', - }) - ), - max_read_request_size: z.optional(types_byte_size), - max_retry_delay: z.optional(types_duration), - max_write_buffer_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be\ndeferred until the number of queued operations goes below the limit.', - }) - ), - max_write_buffer_size: z.optional(types_byte_size), - max_write_request_operation_count: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of operations per bulk write request executed on the follower.', - }) - ), - max_write_request_size: z.optional(types_byte_size), - read_poll_timeout: z.optional(types_duration), - remote_cluster: z.string().register(z.globalRegistry, { - description: 'The remote cluster containing the leader index.', + body: z.object({ + data_stream_name: z.optional(z.string().register(z.globalRegistry, { + description: 'If the leader index is part of a data stream, the name to which the local data stream for the followed index should be renamed.' + })), + leader_index: types_index_name, + max_outstanding_read_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of outstanding reads requests from the remote cluster.' + })), + max_outstanding_write_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of outstanding write requests on the follower.' + })), + max_read_request_operation_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of operations to pull per read from the remote cluster.' + })), + max_read_request_size: z.optional(types_byte_size), + max_retry_delay: z.optional(types_duration), + max_write_buffer_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be\ndeferred until the number of queued operations goes below the limit.' + })), + max_write_buffer_size: z.optional(types_byte_size), + max_write_request_operation_count: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of operations per bulk write request executed on the follower.' + })), + max_write_request_size: z.optional(types_byte_size), + read_poll_timeout: z.optional(types_duration), + remote_cluster: z.string().register(z.globalRegistry, { + description: 'The remote cluster containing the leader index.' + }), + settings: z.optional(indices_types_index_settings) }), - settings: z.optional(indices_types_index_settings), - }), - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - }) - ), + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards) + })) }); export const ccr_follow_response = z.object({ - follow_index_created: z.boolean(), - follow_index_shards_acked: z.boolean(), - index_following_started: z.boolean(), + follow_index_created: z.boolean(), + follow_index_shards_acked: z.boolean(), + index_following_started: z.boolean() }); export const scroll_request = z.object({ - body: z.optional(scroll), - path: z.optional(z.never()), - query: z.optional( - z.object({ - scroll: z.optional(types_duration), - scroll_id: z.optional(types_scroll_id), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object.', - }) - ), - }) - ), + body: z.optional(scroll), + path: z.optional(z.never()), + query: z.optional(z.object({ + scroll: z.optional(types_duration), + scroll_id: z.optional(types_scroll_id), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object.' + })) + })) }); export const scroll_response = global_search_response_body; export const scroll1_request = z.object({ - body: z.optional(scroll), - path: z.optional(z.never()), - query: z.optional( - z.object({ - scroll: z.optional(types_duration), - scroll_id: z.optional(types_scroll_id), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object.', - }) - ), - }) - ), + body: z.optional(scroll), + path: z.optional(z.never()), + query: z.optional(z.object({ + scroll: z.optional(types_duration), + scroll_id: z.optional(types_scroll_id), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object.' + })) + })) }); export const scroll1_response = global_search_response_body; export const scroll2_request = z.object({ - body: z.optional(scroll), - path: z.object({ - scroll_id: types_scroll_id, - }), - query: z.optional( - z.object({ - scroll: z.optional(types_duration), - scroll_id: z.optional(types_scroll_id), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object.', - }) - ), - }) - ), + body: z.optional(scroll), + path: z.object({ + scroll_id: types_scroll_id + }), + query: z.optional(z.object({ + scroll: z.optional(types_duration), + scroll_id: z.optional(types_scroll_id), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object.' + })) + })) }); export const scroll2_response = global_search_response_body; export const scroll3_request = z.object({ - body: z.optional(scroll), - path: z.object({ - scroll_id: types_scroll_id, - }), - query: z.optional( - z.object({ - scroll: z.optional(types_duration), - scroll_id: z.optional(types_scroll_id), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object.', - }) - ), - }) - ), + body: z.optional(scroll), + path: z.object({ + scroll_id: types_scroll_id + }), + query: z.optional(z.object({ + scroll: z.optional(types_duration), + scroll_id: z.optional(types_scroll_id), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object.' + })) + })) }); export const scroll3_response = global_search_response_body; export const cluster_get_component_template1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', - }) - ), - settings_filter: z.optional(z.union([z.string(), z.array(z.string())])), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Return all default configurations for the component template (default: false)', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request retrieves information from the local node only.\nIf `false`, information is retrieved from the master node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns settings in flat format.' + })), + settings_filter: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Return all default configurations for the component template' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request retrieves information from the local node only.\nIf `false`, information is retrieved from the master node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cluster_get_component_template1_response = z.object({ - component_templates: z.array(cluster_types_component_template), -}); - -export const cluster_put_component_template1_request = z.object({ - body: cluster_put_component_template, - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - create: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, this request cannot replace or update existing component templates.', - }) - ), - cause: z.optional( - z.string().register(z.globalRegistry, { - description: 'User defined reason for create the component template.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + component_templates: z.array(cluster_types_component_template) +}); + +export const cluster_put_component_template1_request = z.object({ + body: cluster_put_component_template, + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + create: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, this request cannot replace or update existing component templates.' + })), + cause: z.optional(z.string().register(z.globalRegistry, { + description: 'User defined reason for create the component template.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cluster_put_component_template1_response = types_acknowledged_response_base; export const cluster_put_component_template_request = z.object({ - body: cluster_put_component_template, - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - create: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, this request cannot replace or update existing component templates.', - }) - ), - cause: z.optional( - z.string().register(z.globalRegistry, { - description: 'User defined reason for create the component template.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: cluster_put_component_template, + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + create: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, this request cannot replace or update existing component templates.' + })), + cause: z.optional(z.string().register(z.globalRegistry, { + description: 'User defined reason for create the component template.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cluster_put_component_template_response = types_acknowledged_response_base; export const cluster_get_component_template_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', - }) - ), - settings_filter: z.optional(z.union([z.string(), z.array(z.string())])), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Return all default configurations for the component template (default: false)', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request retrieves information from the local node only.\nIf `false`, information is retrieved from the master node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns settings in flat format.' + })), + settings_filter: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Return all default configurations for the component template' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request retrieves information from the local node only.\nIf `false`, information is retrieved from the master node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const cluster_get_component_template_response = z.object({ - component_templates: z.array(cluster_types_component_template), + component_templates: z.array(cluster_types_component_template) }); export const count1_request = z.object({ - body: z.optional(count), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, concrete, expanded, or aliased indices are ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - min_score: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The minimum `_score` value that documents must have to be included in the result.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nBy default, it is random.', - }) - ), - routing: z.optional(types_routing), - terminate_after: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.', - }) - ), - q: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The query in Lucene query string syntax. This parameter cannot be used with a request body.', - }) - ), - }) - ), + body: z.optional(count), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, concrete, expanded, or aliased indices are ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + min_score: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum `_score` value that documents must have to be included in the result.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nBy default, it is random.' + })), + routing: z.optional(types_routing), + terminate_after: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.' + })), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'The query in Lucene query string syntax. This parameter cannot be used with a request body.' + })) + })) }); export const count1_response = z.object({ - count: z.number(), - _shards: types_shard_statistics, + count: z.number(), + _shards: types_shard_statistics }); export const count_request = z.object({ - body: z.optional(count), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, concrete, expanded, or aliased indices are ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - min_score: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The minimum `_score` value that documents must have to be included in the result.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nBy default, it is random.', - }) - ), - routing: z.optional(types_routing), - terminate_after: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.', - }) - ), - q: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The query in Lucene query string syntax. This parameter cannot be used with a request body.', - }) - ), - }) - ), + body: z.optional(count), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, concrete, expanded, or aliased indices are ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + min_score: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum `_score` value that documents must have to be included in the result.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nBy default, it is random.' + })), + routing: z.optional(types_routing), + terminate_after: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.' + })), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'The query in Lucene query string syntax. This parameter cannot be used with a request body.' + })) + })) }); export const count_response = z.object({ - count: z.number(), - _shards: types_shard_statistics, + count: z.number(), + _shards: types_shard_statistics }); export const count3_request = z.object({ - body: z.optional(count), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, concrete, expanded, or aliased indices are ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - min_score: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The minimum `_score` value that documents must have to be included in the result.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nBy default, it is random.', - }) - ), - routing: z.optional(types_routing), - terminate_after: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.', - }) - ), - q: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The query in Lucene query string syntax. This parameter cannot be used with a request body.', - }) - ), - }) - ), + body: z.optional(count), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, concrete, expanded, or aliased indices are ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + min_score: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum `_score` value that documents must have to be included in the result.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nBy default, it is random.' + })), + routing: z.optional(types_routing), + terminate_after: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.' + })), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'The query in Lucene query string syntax. This parameter cannot be used with a request body.' + })) + })) }); export const count3_response = z.object({ - count: z.number(), - _shards: types_shard_statistics, + count: z.number(), + _shards: types_shard_statistics }); export const count2_request = z.object({ - body: z.optional(count), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, concrete, expanded, or aliased indices are ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - min_score: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The minimum `_score` value that documents must have to be included in the result.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nBy default, it is random.', - }) - ), - routing: z.optional(types_routing), - terminate_after: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.', - }) - ), - q: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The query in Lucene query string syntax. This parameter cannot be used with a request body.', - }) - ), - }) - ), + body: z.optional(count), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, concrete, expanded, or aliased indices are ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + min_score: z.optional(z.number().register(z.globalRegistry, { + description: 'The minimum `_score` value that documents must have to be included in the result.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nBy default, it is random.' + })), + routing: z.optional(types_routing), + terminate_after: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.' + })), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'The query in Lucene query string syntax. This parameter cannot be used with a request body.' + })) + })) }); export const count2_response = z.object({ - count: z.number(), - _shards: types_shard_statistics, + count: z.number(), + _shards: types_shard_statistics }); export const delete_by_query_request = z.object({ - body: z.object({ - max_docs: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of documents to delete.', - }) - ), - query: z.optional(types_query_dsl_query_container), - slice: z.optional(types_sliced_scroll), - sort: z.optional(types_sort), - }), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - conflicts: z.optional(types_conflicts), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field to use as default where no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of documents.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - max_docs: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to process.\nDefaults to all documents.\nWhen set to a value less then or equal to `scroll_size`, a scroll will not be used to retrieve the results for the operation.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - refresh: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `true`, Elasticsearch refreshes all shards involved in the delete by query after the request completes.\nThis is different than the delete API's `refresh` parameter, which causes just the shard that received the delete request to be refreshed.\nUnlike the delete API, it does not support `wait_for`.", - }) - ), - request_cache: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request cache is used for this request.\nDefaults to the index-level setting.', - }) - ), - requests_per_second: z.optional( - z.number().register(z.globalRegistry, { - description: 'The throttle for this request in sub-requests per second.', - }) - ), - routing: z.optional(types_routing), - q: z.optional( - z.string().register(z.globalRegistry, { - description: 'A query in the Lucene query string syntax.', - }) - ), - scroll: z.optional(types_duration), - scroll_size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The size of the scroll request that powers the operation.', - }) - ), - search_timeout: z.optional(types_duration), - search_type: z.optional(types_search_type), - slices: z.optional(types_slices), - sort: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'A comma-separated list of `:` pairs.', - }) - ), - stats: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'The specific `tag` of the request for logging and statistical purposes.', - }) - ), - terminate_after: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nUse with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.', - }) - ), - timeout: z.optional(types_duration), - version: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns the document version as part of a hit.', - }) - ), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request blocks until the operation is complete.\nIf `false`, Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to cancel or get the status of the task. Elasticsearch creates a record of this task as a document at `.tasks/task/${taskId}`. When you are done with a task, you should delete the task document so Elasticsearch can reclaim the space.', - }) - ), - }) - ), + body: z.object({ + max_docs: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to delete.' + })), + query: z.optional(types_query_dsl_query_container), + slice: z.optional(types_sliced_scroll), + sort: z.optional(types_sort) + }), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + conflicts: z.optional(types_conflicts), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'The field to use as default where no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of documents.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + max_docs: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to process.\nDefaults to all documents.\nWhen set to a value less then or equal to `scroll_size`, a scroll will not be used to retrieve the results for the operation.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + refresh: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, Elasticsearch refreshes all shards involved in the delete by query after the request completes.\nThis is different than the delete API\'s `refresh` parameter, which causes just the shard that received the delete request to be refreshed.\nUnlike the delete API, it does not support `wait_for`.' + })), + request_cache: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request cache is used for this request.\nDefaults to the index-level setting.' + })), + requests_per_second: z.optional(z.number().register(z.globalRegistry, { + description: 'The throttle for this request in sub-requests per second.' + })), + routing: z.optional(types_routing), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'A query in the Lucene query string syntax.' + })), + scroll: z.optional(types_duration), + scroll_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The size of the scroll request that powers the operation.' + })), + search_timeout: z.optional(types_duration), + search_type: z.optional(types_search_type), + slices: z.optional(types_slices), + sort: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A comma-separated list of `:` pairs.' + })), + stats: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The specific `tag` of the request for logging and statistical purposes.' + })), + terminate_after: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nUse with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.' + })), + timeout: z.optional(types_duration), + version: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns the document version as part of a hit.' + })), + wait_for_active_shards: z.optional(types_wait_for_active_shards), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request blocks until the operation is complete.\nIf `false`, Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to cancel or get the status of the task. Elasticsearch creates a record of this task as a document at `.tasks/task/${taskId}`. When you are done with a task, you should delete the task document so Elasticsearch can reclaim the space.' + })) + })) }); export const delete_by_query_response = z.object({ - batches: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of scroll responses pulled back by the delete by query.', - }) - ), - deleted: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of documents that were successfully deleted.', - }) - ), - failures: z.optional( - z.array(types_bulk_index_by_scroll_failure).register(z.globalRegistry, { - description: - 'An array of failures if there were any unrecoverable errors during the process.\nIf this array is not empty, the request ended abnormally because of those failures.\nDelete by query is implemented using batches and any failures cause the entire process to end but all failures in the current batch are collected into the array.\nYou can use the `conflicts` option to prevent reindex from ending on version conflicts.', - }) - ), - noops: z.optional( - z.number().register(z.globalRegistry, { - description: - 'This field is always equal to zero for delete by query.\nIt exists only so that delete by query, update by query, and reindex APIs return responses with the same structure.', - }) - ), - requests_per_second: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of requests per second effectively run during the delete by query.', - }) - ), - retries: z.optional(types_retries), - slice_id: z.optional(z.number()), - task: z.optional(types_task_id), - throttled: z.optional(types_duration), - throttled_millis: z.optional(types_duration_value_unit_millis), - throttled_until: z.optional(types_duration), - throttled_until_millis: z.optional(types_duration_value_unit_millis), - timed_out: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, some requests run during the delete by query operation timed out.', - }) - ), - took: z.optional(types_duration_value_unit_millis), - total: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of documents that were successfully processed.', - }) - ), - version_conflicts: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of version conflicts that the delete by query hit.', - }) - ), + batches: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of scroll responses pulled back by the delete by query.' + })), + deleted: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of documents that were successfully deleted.' + })), + failures: z.optional(z.array(types_bulk_index_by_scroll_failure).register(z.globalRegistry, { + description: 'An array of failures if there were any unrecoverable errors during the process.\nIf this array is not empty, the request ended abnormally because of those failures.\nDelete by query is implemented using batches and any failures cause the entire process to end but all failures in the current batch are collected into the array.\nYou can use the `conflicts` option to prevent reindex from ending on version conflicts.' + })), + noops: z.optional(z.number().register(z.globalRegistry, { + description: 'This field is always equal to zero for delete by query.\nIt exists only so that delete by query, update by query, and reindex APIs return responses with the same structure.' + })), + requests_per_second: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of requests per second effectively run during the delete by query.' + })), + retries: z.optional(types_retries), + slice_id: z.optional(z.number()), + task: z.optional(types_task_id), + throttled: z.optional(types_duration), + throttled_millis: z.optional(types_duration_value_unit_millis), + throttled_until: z.optional(types_duration), + throttled_until_millis: z.optional(types_duration_value_unit_millis), + timed_out: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, some requests run during the delete by query operation timed out.' + })), + took: z.optional(types_duration_value_unit_millis), + total: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of documents that were successfully processed.' + })), + version_conflicts: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of version conflicts that the delete by query hit.' + })) }); export const get_script_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const get_script_response = z.object({ - _id: types_id, - found: z.boolean(), - script: z.optional(types_stored_script), + _id: types_id, + found: z.boolean(), + script: z.optional(types_stored_script) }); export const put_script1_request = z.object({ - body: put_script, - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - context: z.optional(types_name), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: put_script, + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + context: z.optional(types_name), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const put_script1_response = types_acknowledged_response_base; export const put_script_request = z.object({ - body: put_script, - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - context: z.optional(types_name), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: put_script, + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + context: z.optional(types_name), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const put_script_response = types_acknowledged_response_base; export const enrich_get_policy_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_names, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_names + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const enrich_get_policy_response = z.object({ - policies: z.array(enrich_types_summary), + policies: z.array(enrich_types_summary) }); export const enrich_put_policy_request = z.object({ - body: z.object({ - geo_match: z.optional(enrich_types_policy), - match: z.optional(enrich_types_policy), - range: z.optional(enrich_types_policy), - }), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.object({ + geo_match: z.optional(enrich_types_policy), + match: z.optional(enrich_types_policy), + range: z.optional(enrich_types_policy) + }), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const enrich_put_policy_response = types_acknowledged_response_base; export const enrich_get_policy1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const enrich_get_policy1_response = z.object({ - policies: z.array(enrich_types_summary), + policies: z.array(enrich_types_summary) }); export const eql_search_request = z.object({ - body: eql_search, - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', - }) - ), - allow_partial_search_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns partial results if there are shard failures. If false, returns an error with no partial results.', - }) - ), - allow_partial_sequence_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, sequence queries will return partial results in case of shard failures. If false, they will return no results at all.\nThis flag has effect only if allow_partial_search_results is true.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', - }) - ), - keep_alive: z.optional(types_duration), - keep_on_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the search and its results are stored on the cluster.', - }) - ), - wait_for_completion_timeout: z.optional(types_duration), - }) - ), + body: eql_search, + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' + })), + allow_partial_search_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns partial results if there are shard failures. If false, returns an error with no partial results.' + })), + allow_partial_sequence_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, sequence queries will return partial results in case of shard failures. If false, they will return no results at all.\nThis flag has effect only if allow_partial_search_results is true.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, missing or closed indices are not included in the response.' + })), + keep_alive: z.optional(types_duration), + keep_on_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the search and its results are stored on the cluster.' + })), + wait_for_completion_timeout: z.optional(types_duration) + })) }); export const eql_search_response = eql_types_eql_search_response_base; export const eql_search1_request = z.object({ - body: eql_search, - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)', - }) - ), - allow_partial_search_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns partial results if there are shard failures. If false, returns an error with no partial results.', - }) - ), - allow_partial_sequence_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, sequence queries will return partial results in case of shard failures. If false, they will return no results at all.\nThis flag has effect only if allow_partial_search_results is true.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', - }) - ), - keep_alive: z.optional(types_duration), - keep_on_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, the search and its results are stored on the cluster.', - }) - ), - wait_for_completion_timeout: z.optional(types_duration), - }) - ), + body: eql_search, + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to ignore if a wildcard indices expression resolves into no concrete indices.\n(This includes `_all` string or when no indices have been specified)' + })), + allow_partial_search_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns partial results if there are shard failures. If false, returns an error with no partial results.' + })), + allow_partial_sequence_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, sequence queries will return partial results in case of shard failures. If false, they will return no results at all.\nThis flag has effect only if allow_partial_search_results is true.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, missing or closed indices are not included in the response.' + })), + keep_alive: z.optional(types_duration), + keep_on_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the search and its results are stored on the cluster.' + })), + wait_for_completion_timeout: z.optional(types_duration) + })) }); export const eql_search1_response = eql_types_eql_search_response_base; export const esql_async_query_request = z.object({ - body: z.object({ - columnar: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'By default, ES|QL returns results as rows. For example, FROM returns each individual document as one row. For the JSON, YAML, CBOR and smile formats, ES|QL can return the results in a columnar fashion where one row represents all the values of a certain column in the results.', - }) - ), - filter: z.optional(types_query_dsl_query_container), - locale: z.optional(z.string()), - params: z.optional( - z.array(types_field_value).register(z.globalRegistry, { - description: - 'To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters.', - }) - ), - profile: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If provided and `true` the response will include an extra `profile` object\nwith information on how the query was executed. This information is for human debugging\nand its format can change at any time but it can give some insight into the performance\nof each part of the query.', - }) - ), - query: z.string().register(z.globalRegistry, { - description: - 'The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results.', - }), - tables: z.optional( - z - .record(z.string(), z.record(z.string(), esql_types_table_values_container)) - .register(z.globalRegistry, { - description: - 'Tables to use with the LOOKUP operation. The top level key is the table\nname and the next level key is the column name.', - }) - ), - include_ccs_metadata: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When set to `true` and performing a cross-cluster/cross-project query, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount.', - }) - ), - include_execution_metadata: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When set to `true`, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount.\nThis is similar to `include_ccs_metadata`, but it also returns metadata when the query is not CCS/CPS', - }) - ), - wait_for_completion_timeout: z.optional(types_duration), - keep_alive: z.optional(types_duration), - keep_on_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether the query and its results are stored in the cluster.\nIf false, the query and its results are stored in the cluster only if the request does not complete during the period set by the `wait_for_completion_timeout` parameter.', - }) - ), - }), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_partial_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards.\nIf `false`, the query will fail if there are any failures.\n\nTo override the default behavior, you can set the `esql.query.allow_partial_results` cluster setting to `false`.', - }) - ), - delimiter: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The character to use between values within a CSV row.\nIt is valid only for the CSV format.', - }) - ), - drop_null_columns: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether columns that are entirely `null` will be removed from the `columns` and `values` portion of the results.\nIf `true`, the response will include an extra section under the name `all_columns` which has the name of all the columns.', - }) - ), - format: z.optional(esql_types_esql_format), - }) - ), + body: z.object({ + columnar: z.optional(z.boolean().register(z.globalRegistry, { + description: 'By default, ES|QL returns results as rows. For example, FROM returns each individual document as one row. For the JSON, YAML, CBOR and smile formats, ES|QL can return the results in a columnar fashion where one row represents all the values of a certain column in the results.' + })), + filter: z.optional(types_query_dsl_query_container), + locale: z.optional(z.string()), + params: z.optional(z.array(types_field_value).register(z.globalRegistry, { + description: 'To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters.' + })), + profile: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If provided and `true` the response will include an extra `profile` object\nwith information on how the query was executed. This information is for human debugging\nand its format can change at any time but it can give some insight into the performance\nof each part of the query.' + })), + query: z.string().register(z.globalRegistry, { + description: 'The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results.' + }), + tables: z.optional(z.record(z.string(), z.record(z.string(), esql_types_table_values_container)).register(z.globalRegistry, { + description: 'Tables to use with the LOOKUP operation. The top level key is the table\nname and the next level key is the column name.' + })), + include_ccs_metadata: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When set to `true` and performing a cross-cluster/cross-project query, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount.' + })), + include_execution_metadata: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When set to `true`, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount.\nThis is similar to `include_ccs_metadata`, but it also returns metadata when the query is not CCS/CPS' + })), + wait_for_completion_timeout: z.optional(types_duration), + keep_alive: z.optional(types_duration), + keep_on_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the query and its results are stored in the cluster.\nIf false, the query and its results are stored in the cluster only if the request does not complete during the period set by the `wait_for_completion_timeout` parameter.' + })) + }), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_partial_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards.\nIf `false`, the query will fail if there are any failures.\n\nTo override the default behavior, you can set the `esql.query.allow_partial_results` cluster setting to `false`.' + })), + delimiter: z.optional(z.string().register(z.globalRegistry, { + description: 'The character to use between values within a CSV row.\nIt is valid only for the CSV format.' + })), + drop_null_columns: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether columns that are entirely `null` will be removed from the `columns` and `values` portion of the results.\nIf `true`, the response will include an extra section under the name `all_columns` which has the name of all the columns.' + })), + format: z.optional(esql_types_esql_format) + })) }); export const esql_async_query_response = esql_types_async_esql_result; export const esql_query_request = z.object({ - body: z.object({ - columnar: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'By default, ES|QL returns results as rows. For example, FROM returns each individual document as one row. For the JSON, YAML, CBOR and smile formats, ES|QL can return the results in a columnar fashion where one row represents all the values of a certain column in the results.', - }) - ), - filter: z.optional(types_query_dsl_query_container), - locale: z.optional(z.string()), - params: z.optional( - z.array(esql_types_esql_param).register(z.globalRegistry, { - description: - 'To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters.', - }) - ), - profile: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If provided and `true` the response will include an extra `profile` object\nwith information on how the query was executed. This information is for human debugging\nand its format can change at any time but it can give some insight into the performance\nof each part of the query.', - }) - ), - query: z.string().register(z.globalRegistry, { - description: - 'The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results.', - }), - tables: z.optional( - z - .record(z.string(), z.record(z.string(), esql_types_table_values_container)) - .register(z.globalRegistry, { - description: - 'Tables to use with the LOOKUP operation. The top level key is the table\nname and the next level key is the column name.', - }) - ), - include_ccs_metadata: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When set to `true` and performing a cross-cluster/cross-project query, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount.', - }) - ), - include_execution_metadata: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When set to `true`, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount.\nThis is similar to `include_ccs_metadata`, but it also returns metadata when the query is not CCS/CPS', - }) - ), - }), - path: z.optional(z.never()), - query: z.optional( - z.object({ - format: z.optional(esql_types_esql_format), - delimiter: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The character to use between values within a CSV row. Only valid for the CSV format.', - }) - ), - drop_null_columns: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Should columns that are entirely `null` be removed from the `columns` and `values` portion of the results?\nDefaults to `false`. If `true` then the response will include an extra section under the name `all_columns` which has the name of all columns.', - }) - ), - allow_partial_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards.\nIf `false`, the query will fail if there are any failures.\n\nTo override the default behavior, you can set the `esql.query.allow_partial_results` cluster setting to `false`.', - }) - ), - }) - ), + body: z.object({ + columnar: z.optional(z.boolean().register(z.globalRegistry, { + description: 'By default, ES|QL returns results as rows. For example, FROM returns each individual document as one row. For the JSON, YAML, CBOR and smile formats, ES|QL can return the results in a columnar fashion where one row represents all the values of a certain column in the results.' + })), + filter: z.optional(types_query_dsl_query_container), + locale: z.optional(z.string()), + params: z.optional(z.array(esql_types_esql_param).register(z.globalRegistry, { + description: 'To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters.' + })), + profile: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If provided and `true` the response will include an extra `profile` object\nwith information on how the query was executed. This information is for human debugging\nand its format can change at any time but it can give some insight into the performance\nof each part of the query.' + })), + query: z.string().register(z.globalRegistry, { + description: 'The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results.' + }), + tables: z.optional(z.record(z.string(), z.record(z.string(), esql_types_table_values_container)).register(z.globalRegistry, { + description: 'Tables to use with the LOOKUP operation. The top level key is the table\nname and the next level key is the column name.' + })), + include_ccs_metadata: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When set to `true` and performing a cross-cluster/cross-project query, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount.' + })), + include_execution_metadata: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When set to `true`, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount.\nThis is similar to `include_ccs_metadata`, but it also returns metadata when the query is not CCS/CPS' + })) + }), + path: z.optional(z.never()), + query: z.optional(z.object({ + format: z.optional(esql_types_esql_format), + delimiter: z.optional(z.string().register(z.globalRegistry, { + description: 'The character to use between values within a CSV row. Only valid for the CSV format.' + })), + drop_null_columns: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Should columns that are entirely `null` be removed from the `columns` and `values` portion of the results?\nDefaults to `false`. If `true` then the response will include an extra section under the name `all_columns` which has the name of all columns.' + })), + allow_partial_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards.\nIf `false`, the query will fail if there are any failures.\n\nTo override the default behavior, you can set the `esql.query.allow_partial_results` cluster setting to `false`.' + })) + })) }); export const esql_query_response = esql_types_esql_result; export const explain_request = z.object({ - body: z.optional(explain), - path: z.object({ - index: types_index_name, - id: types_id, - }), - query: z.optional( - z.object({ - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field to use as default where no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - routing: z.optional(types_routing), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - stored_fields: z.optional(types_fields), - q: z.optional( - z.string().register(z.globalRegistry, { - description: 'The query in the Lucene query string syntax.', - }) - ), - }) - ), + body: z.optional(explain), + path: z.object({ + index: types_index_name, + id: types_id + }), + query: z.optional(z.object({ + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'The field to use as default where no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + routing: z.optional(types_routing), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields), + stored_fields: z.optional(types_fields), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'The query in the Lucene query string syntax.' + })) + })) }); export const explain_response = z.object({ - _index: types_index_name, - _id: types_id, - matched: z.boolean(), - explanation: z.optional(global_explain_explanation_detail), - get: z.optional(types_inline_get), + _index: types_index_name, + _id: types_id, + matched: z.boolean(), + explanation: z.optional(global_explain_explanation_detail), + get: z.optional(types_inline_get) }); export const explain1_request = z.object({ - body: z.optional(explain), - path: z.object({ - index: types_index_name, - id: types_id, - }), - query: z.optional( - z.object({ - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field to use as default where no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - routing: z.optional(types_routing), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - stored_fields: z.optional(types_fields), - q: z.optional( - z.string().register(z.globalRegistry, { - description: 'The query in the Lucene query string syntax.', - }) - ), - }) - ), + body: z.optional(explain), + path: z.object({ + index: types_index_name, + id: types_id + }), + query: z.optional(z.object({ + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'The field to use as default where no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + routing: z.optional(types_routing), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields), + stored_fields: z.optional(types_fields), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'The query in the Lucene query string syntax.' + })) + })) }); export const explain1_response = z.object({ - _index: types_index_name, - _id: types_id, - matched: z.boolean(), - explanation: z.optional(global_explain_explanation_detail), - get: z.optional(types_inline_get), + _index: types_index_name, + _id: types_id, + matched: z.boolean(), + explanation: z.optional(global_explain_explanation_detail), + get: z.optional(types_inline_get) }); export const field_caps_request = z.object({ - body: z.optional(field_caps), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias,\nor `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request\ntargeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - fields: z.optional(types_fields), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, missing or closed indices are not included in the response.', - }) - ), - include_unmapped: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, unmapped fields are included in the response.', - }) - ), - filters: z.optional(z.union([z.string(), z.array(z.string())])), - types: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'A comma-separated list of field types to include.\nAny fields that do not match one of these types will be excluded from the results.\nIt defaults to empty, meaning that all field types are returned.', - }) - ), - include_empty_fields: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If false, empty fields are not included in the response.', - }) - ), - }) - ), + body: z.optional(field_caps), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias,\nor `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request\ntargeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + fields: z.optional(types_fields), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, missing or closed indices are not included in the response.' + })), + include_unmapped: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, unmapped fields are included in the response.' + })), + filters: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + types: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A comma-separated list of field types to include.\nAny fields that do not match one of these types will be excluded from the results.\nIt defaults to empty, meaning that all field types are returned.' + })), + include_empty_fields: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, empty fields are not included in the response.' + })) + })) }); export const field_caps_response = z.object({ - indices: types_indices, - fields: z.record(z.string(), z.record(z.string(), global_field_caps_field_capability)), + indices: types_indices, + fields: z.record(z.string(), z.record(z.string(), global_field_caps_field_capability)) }); export const field_caps1_request = z.object({ - body: z.optional(field_caps), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias,\nor `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request\ntargeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - fields: z.optional(types_fields), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, missing or closed indices are not included in the response.', - }) - ), - include_unmapped: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, unmapped fields are included in the response.', - }) - ), - filters: z.optional(z.union([z.string(), z.array(z.string())])), - types: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'A comma-separated list of field types to include.\nAny fields that do not match one of these types will be excluded from the results.\nIt defaults to empty, meaning that all field types are returned.', - }) - ), - include_empty_fields: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If false, empty fields are not included in the response.', - }) - ), - }) - ), + body: z.optional(field_caps), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias,\nor `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request\ntargeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + fields: z.optional(types_fields), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, missing or closed indices are not included in the response.' + })), + include_unmapped: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, unmapped fields are included in the response.' + })), + filters: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + types: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A comma-separated list of field types to include.\nAny fields that do not match one of these types will be excluded from the results.\nIt defaults to empty, meaning that all field types are returned.' + })), + include_empty_fields: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, empty fields are not included in the response.' + })) + })) }); export const field_caps1_response = z.object({ - indices: types_indices, - fields: z.record(z.string(), z.record(z.string(), global_field_caps_field_capability)), + indices: types_indices, + fields: z.record(z.string(), z.record(z.string(), global_field_caps_field_capability)) }); export const field_caps2_request = z.object({ - body: z.optional(field_caps), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias,\nor `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request\ntargeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - fields: z.optional(types_fields), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, missing or closed indices are not included in the response.', - }) - ), - include_unmapped: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, unmapped fields are included in the response.', - }) - ), - filters: z.optional(z.union([z.string(), z.array(z.string())])), - types: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'A comma-separated list of field types to include.\nAny fields that do not match one of these types will be excluded from the results.\nIt defaults to empty, meaning that all field types are returned.', - }) - ), - include_empty_fields: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If false, empty fields are not included in the response.', - }) - ), - }) - ), + body: z.optional(field_caps), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias,\nor `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request\ntargeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + fields: z.optional(types_fields), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, missing or closed indices are not included in the response.' + })), + include_unmapped: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, unmapped fields are included in the response.' + })), + filters: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + types: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A comma-separated list of field types to include.\nAny fields that do not match one of these types will be excluded from the results.\nIt defaults to empty, meaning that all field types are returned.' + })), + include_empty_fields: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, empty fields are not included in the response.' + })) + })) }); export const field_caps2_response = z.object({ - indices: types_indices, - fields: z.record(z.string(), z.record(z.string(), global_field_caps_field_capability)), + indices: types_indices, + fields: z.record(z.string(), z.record(z.string(), global_field_caps_field_capability)) }); export const field_caps3_request = z.object({ - body: z.optional(field_caps), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias,\nor `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request\ntargeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - fields: z.optional(types_fields), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, missing or closed indices are not included in the response.', - }) - ), - include_unmapped: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, unmapped fields are included in the response.', - }) - ), - filters: z.optional(z.union([z.string(), z.array(z.string())])), - types: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'A comma-separated list of field types to include.\nAny fields that do not match one of these types will be excluded from the results.\nIt defaults to empty, meaning that all field types are returned.', - }) - ), - include_empty_fields: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If false, empty fields are not included in the response.', - }) - ), - }) - ), + body: z.optional(field_caps), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias,\nor `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request\ntargeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + fields: z.optional(types_fields), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, missing or closed indices are not included in the response.' + })), + include_unmapped: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, unmapped fields are included in the response.' + })), + filters: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + types: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A comma-separated list of field types to include.\nAny fields that do not match one of these types will be excluded from the results.\nIt defaults to empty, meaning that all field types are returned.' + })), + include_empty_fields: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, empty fields are not included in the response.' + })) + })) }); export const field_caps3_response = z.object({ - indices: types_indices, - fields: z.record(z.string(), z.record(z.string(), global_field_caps_field_capability)), -}); - -export const fleet_msearch_request = z.object({ - body: fleet_msearch, - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, concrete, expanded or aliased indices are ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', - }) - ), - max_concurrent_searches: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum number of concurrent searches the multi search API can execute.', - }) - ), - max_concurrent_shard_requests: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of concurrent shard requests that each sub-search request executes per node.', - }) - ), - pre_filter_shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.', - }) - ), - search_type: z.optional(types_search_type), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.', - }) - ), - wait_for_checkpoints: z.optional( - z.array(fleet_types_checkpoint).register(z.globalRegistry, { - description: - 'A comma separated list of checkpoints. When configured, the search API will only be executed on a shard\nafter the relevant checkpoint has become visible for search. Defaults to an empty list which will cause\nElasticsearch to immediately execute the search.', - }) - ), - allow_partial_search_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns partial results if there are shard request timeouts or shard failures.\nIf false, returns an error with no partial results.\nDefaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default.', - }) - ), - }) - ), + indices: types_indices, + fields: z.record(z.string(), z.record(z.string(), global_field_caps_field_capability)) +}); + +export const fleet_msearch_request = z.object({ + body: fleet_msearch, + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, concrete, expanded or aliased indices are ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, missing or closed indices are not included in the response.' + })), + max_concurrent_searches: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrent searches the multi search API can execute.' + })), + max_concurrent_shard_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrent shard requests that each sub-search request executes per node.' + })), + pre_filter_shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.' + })), + search_type: z.optional(types_search_type), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.' + })), + wait_for_checkpoints: z.optional(z.array(fleet_types_checkpoint).register(z.globalRegistry, { + description: 'A comma separated list of checkpoints. When configured, the search API will only be executed on a shard\nafter the relevant checkpoint has become visible for search. Defaults to an empty list which will cause\nElasticsearch to immediately execute the search.' + })), + allow_partial_search_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns partial results if there are shard request timeouts or shard failures.\nIf false, returns an error with no partial results.\nDefaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default.' + })) + })) }); export const fleet_msearch_response = z.object({ - docs: z.array(global_msearch_response_item), + docs: z.array(global_msearch_response_item) }); export const fleet_msearch1_request = z.object({ - body: fleet_msearch, - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, concrete, expanded or aliased indices are ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', - }) - ), - max_concurrent_searches: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum number of concurrent searches the multi search API can execute.', - }) - ), - max_concurrent_shard_requests: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of concurrent shard requests that each sub-search request executes per node.', - }) - ), - pre_filter_shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.', - }) - ), - search_type: z.optional(types_search_type), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.', - }) - ), - wait_for_checkpoints: z.optional( - z.array(fleet_types_checkpoint).register(z.globalRegistry, { - description: - 'A comma separated list of checkpoints. When configured, the search API will only be executed on a shard\nafter the relevant checkpoint has become visible for search. Defaults to an empty list which will cause\nElasticsearch to immediately execute the search.', - }) - ), - allow_partial_search_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns partial results if there are shard request timeouts or shard failures.\nIf false, returns an error with no partial results.\nDefaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default.', - }) - ), - }) - ), + body: fleet_msearch, + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, concrete, expanded or aliased indices are ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, missing or closed indices are not included in the response.' + })), + max_concurrent_searches: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrent searches the multi search API can execute.' + })), + max_concurrent_shard_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrent shard requests that each sub-search request executes per node.' + })), + pre_filter_shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.' + })), + search_type: z.optional(types_search_type), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.' + })), + wait_for_checkpoints: z.optional(z.array(fleet_types_checkpoint).register(z.globalRegistry, { + description: 'A comma separated list of checkpoints. When configured, the search API will only be executed on a shard\nafter the relevant checkpoint has become visible for search. Defaults to an empty list which will cause\nElasticsearch to immediately execute the search.' + })), + allow_partial_search_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns partial results if there are shard request timeouts or shard failures.\nIf false, returns an error with no partial results.\nDefaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default.' + })) + })) }); export const fleet_msearch1_response = z.object({ - docs: z.array(global_msearch_response_item), + docs: z.array(global_msearch_response_item) }); export const fleet_msearch2_request = z.object({ - body: fleet_msearch, - path: z.object({ - index: z.union([types_index_name, types_index_alias]), - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, concrete, expanded or aliased indices are ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', - }) - ), - max_concurrent_searches: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum number of concurrent searches the multi search API can execute.', - }) - ), - max_concurrent_shard_requests: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of concurrent shard requests that each sub-search request executes per node.', - }) - ), - pre_filter_shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.', - }) - ), - search_type: z.optional(types_search_type), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.', - }) - ), - wait_for_checkpoints: z.optional( - z.array(fleet_types_checkpoint).register(z.globalRegistry, { - description: - 'A comma separated list of checkpoints. When configured, the search API will only be executed on a shard\nafter the relevant checkpoint has become visible for search. Defaults to an empty list which will cause\nElasticsearch to immediately execute the search.', - }) - ), - allow_partial_search_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns partial results if there are shard request timeouts or shard failures.\nIf false, returns an error with no partial results.\nDefaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default.', - }) - ), - }) - ), + body: fleet_msearch, + path: z.object({ + index: z.union([ + types_index_name, + types_index_alias + ]) + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, concrete, expanded or aliased indices are ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, missing or closed indices are not included in the response.' + })), + max_concurrent_searches: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrent searches the multi search API can execute.' + })), + max_concurrent_shard_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrent shard requests that each sub-search request executes per node.' + })), + pre_filter_shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.' + })), + search_type: z.optional(types_search_type), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.' + })), + wait_for_checkpoints: z.optional(z.array(fleet_types_checkpoint).register(z.globalRegistry, { + description: 'A comma separated list of checkpoints. When configured, the search API will only be executed on a shard\nafter the relevant checkpoint has become visible for search. Defaults to an empty list which will cause\nElasticsearch to immediately execute the search.' + })), + allow_partial_search_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns partial results if there are shard request timeouts or shard failures.\nIf false, returns an error with no partial results.\nDefaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default.' + })) + })) }); export const fleet_msearch2_response = z.object({ - docs: z.array(global_msearch_response_item), + docs: z.array(global_msearch_response_item) }); export const fleet_msearch3_request = z.object({ - body: fleet_msearch, - path: z.object({ - index: z.union([types_index_name, types_index_alias]), - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, concrete, expanded or aliased indices are ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', - }) - ), - max_concurrent_searches: z.optional( - z.number().register(z.globalRegistry, { - description: 'Maximum number of concurrent searches the multi search API can execute.', - }) - ), - max_concurrent_shard_requests: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of concurrent shard requests that each sub-search request executes per node.', - }) - ), - pre_filter_shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.', - }) - ), - search_type: z.optional(types_search_type), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.', - }) - ), - wait_for_checkpoints: z.optional( - z.array(fleet_types_checkpoint).register(z.globalRegistry, { - description: - 'A comma separated list of checkpoints. When configured, the search API will only be executed on a shard\nafter the relevant checkpoint has become visible for search. Defaults to an empty list which will cause\nElasticsearch to immediately execute the search.', - }) - ), - allow_partial_search_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns partial results if there are shard request timeouts or shard failures.\nIf false, returns an error with no partial results.\nDefaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default.', - }) - ), - }) - ), + body: fleet_msearch, + path: z.object({ + index: z.union([ + types_index_name, + types_index_alias + ]) + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, concrete, expanded or aliased indices are ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, missing or closed indices are not included in the response.' + })), + max_concurrent_searches: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrent searches the multi search API can execute.' + })), + max_concurrent_shard_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrent shard requests that each sub-search request executes per node.' + })), + pre_filter_shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.' + })), + search_type: z.optional(types_search_type), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.' + })), + wait_for_checkpoints: z.optional(z.array(fleet_types_checkpoint).register(z.globalRegistry, { + description: 'A comma separated list of checkpoints. When configured, the search API will only be executed on a shard\nafter the relevant checkpoint has become visible for search. Defaults to an empty list which will cause\nElasticsearch to immediately execute the search.' + })), + allow_partial_search_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns partial results if there are shard request timeouts or shard failures.\nIf false, returns an error with no partial results.\nDefaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default.' + })) + })) }); export const fleet_msearch3_response = z.object({ - docs: z.array(global_msearch_response_item), + docs: z.array(global_msearch_response_item) }); export const fleet_search_request = z.object({ - body: fleet_search, - path: z.object({ - index: z.union([types_index_name, types_index_alias]), - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional(z.boolean()), - analyzer: z.optional(z.string()), - analyze_wildcard: z.optional(z.boolean()), - batched_reduce_size: z.optional(z.number()), - ccs_minimize_roundtrips: z.optional(z.boolean()), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional(z.string()), - docvalue_fields: z.optional(types_fields), - expand_wildcards: z.optional(types_expand_wildcards), - explain: z.optional(z.boolean()), - ignore_throttled: z.optional(z.boolean()), - ignore_unavailable: z.optional(z.boolean()), - lenient: z.optional(z.boolean()), - max_concurrent_shard_requests: z.optional(z.number()), - preference: z.optional(z.string()), - pre_filter_shard_size: z.optional(z.number()), - request_cache: z.optional(z.boolean()), - routing: z.optional(types_routing), - scroll: z.optional(types_duration), - search_type: z.optional(types_search_type), - stats: z.optional(z.array(z.string())), - stored_fields: z.optional(types_fields), - suggest_field: z.optional(types_field), - suggest_mode: z.optional(types_suggest_mode), - suggest_size: z.optional(z.number()), - suggest_text: z.optional( - z.string().register(z.globalRegistry, { - description: 'The source text for which the suggestions should be returned.', - }) - ), - terminate_after: z.optional(z.number()), - timeout: z.optional(types_duration), - track_total_hits: z.optional(global_search_types_track_hits), - track_scores: z.optional(z.boolean()), - typed_keys: z.optional(z.boolean()), - rest_total_hits_as_int: z.optional(z.boolean()), - version: z.optional(z.boolean()), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - seq_no_primary_term: z.optional(z.boolean()), - q: z.optional(z.string()), - size: z.optional(z.number()), - from: z.optional(z.number()), - sort: z.optional(z.union([z.string(), z.array(z.string())])), - wait_for_checkpoints: z.optional( - z.array(fleet_types_checkpoint).register(z.globalRegistry, { - description: - 'A comma separated list of checkpoints. When configured, the search API will only be executed on a shard\nafter the relevant checkpoint has become visible for search. Defaults to an empty list which will cause\nElasticsearch to immediately execute the search.', - }) - ), - allow_partial_search_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns partial results if there are shard request timeouts or shard failures.\nIf false, returns an error with no partial results.\nDefaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default.', - }) - ), - }) - ), + body: fleet_search, + path: z.object({ + index: z.union([ + types_index_name, + types_index_alias + ]) + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean()), + analyzer: z.optional(z.string()), + analyze_wildcard: z.optional(z.boolean()), + batched_reduce_size: z.optional(z.number()), + ccs_minimize_roundtrips: z.optional(z.boolean()), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string()), + docvalue_fields: z.optional(types_fields), + expand_wildcards: z.optional(types_expand_wildcards), + explain: z.optional(z.boolean()), + ignore_throttled: z.optional(z.boolean()), + ignore_unavailable: z.optional(z.boolean()), + lenient: z.optional(z.boolean()), + max_concurrent_shard_requests: z.optional(z.number()), + preference: z.optional(z.string()), + pre_filter_shard_size: z.optional(z.number()), + request_cache: z.optional(z.boolean()), + routing: z.optional(types_routing), + scroll: z.optional(types_duration), + search_type: z.optional(types_search_type), + stats: z.optional(z.array(z.string())), + stored_fields: z.optional(types_fields), + suggest_field: z.optional(types_field), + suggest_mode: z.optional(types_suggest_mode), + suggest_size: z.optional(z.number()), + suggest_text: z.optional(z.string().register(z.globalRegistry, { + description: 'The source text for which the suggestions should be returned.' + })), + terminate_after: z.optional(z.number()), + timeout: z.optional(types_duration), + track_total_hits: z.optional(global_search_types_track_hits), + track_scores: z.optional(z.boolean()), + typed_keys: z.optional(z.boolean()), + rest_total_hits_as_int: z.optional(z.boolean()), + version: z.optional(z.boolean()), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields), + seq_no_primary_term: z.optional(z.boolean()), + q: z.optional(z.string()), + size: z.optional(z.number()), + from: z.optional(z.number()), + sort: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + wait_for_checkpoints: z.optional(z.array(fleet_types_checkpoint).register(z.globalRegistry, { + description: 'A comma separated list of checkpoints. When configured, the search API will only be executed on a shard\nafter the relevant checkpoint has become visible for search. Defaults to an empty list which will cause\nElasticsearch to immediately execute the search.' + })), + allow_partial_search_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns partial results if there are shard request timeouts or shard failures.\nIf false, returns an error with no partial results.\nDefaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default.' + })) + })) }); export const fleet_search_response = z.object({ - took: z.number(), - timed_out: z.boolean(), - _shards: types_shard_statistics, - hits: global_search_types_hits_metadata, - aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)), - _clusters: z.optional(types_cluster_statistics), - fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - max_score: z.optional(z.number()), - num_reduce_phases: z.optional(z.number()), - profile: z.optional(global_search_types_profile), - pit_id: z.optional(types_id), - _scroll_id: z.optional(types_scroll_id), - suggest: z.optional(z.record(z.string(), z.array(global_search_types_suggest))), - terminated_early: z.optional(z.boolean()), + took: z.number(), + timed_out: z.boolean(), + _shards: types_shard_statistics, + hits: global_search_types_hits_metadata, + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)), + _clusters: z.optional(types_cluster_statistics), + fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + max_score: z.optional(z.number()), + num_reduce_phases: z.optional(z.number()), + profile: z.optional(global_search_types_profile), + pit_id: z.optional(types_id), + _scroll_id: z.optional(types_scroll_id), + suggest: z.optional(z.record(z.string(), z.array(global_search_types_suggest))), + terminated_early: z.optional(z.boolean()) }); export const fleet_search1_request = z.object({ - body: fleet_search, - path: z.object({ - index: z.union([types_index_name, types_index_alias]), - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional(z.boolean()), - analyzer: z.optional(z.string()), - analyze_wildcard: z.optional(z.boolean()), - batched_reduce_size: z.optional(z.number()), - ccs_minimize_roundtrips: z.optional(z.boolean()), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional(z.string()), - docvalue_fields: z.optional(types_fields), - expand_wildcards: z.optional(types_expand_wildcards), - explain: z.optional(z.boolean()), - ignore_throttled: z.optional(z.boolean()), - ignore_unavailable: z.optional(z.boolean()), - lenient: z.optional(z.boolean()), - max_concurrent_shard_requests: z.optional(z.number()), - preference: z.optional(z.string()), - pre_filter_shard_size: z.optional(z.number()), - request_cache: z.optional(z.boolean()), - routing: z.optional(types_routing), - scroll: z.optional(types_duration), - search_type: z.optional(types_search_type), - stats: z.optional(z.array(z.string())), - stored_fields: z.optional(types_fields), - suggest_field: z.optional(types_field), - suggest_mode: z.optional(types_suggest_mode), - suggest_size: z.optional(z.number()), - suggest_text: z.optional( - z.string().register(z.globalRegistry, { - description: 'The source text for which the suggestions should be returned.', - }) - ), - terminate_after: z.optional(z.number()), - timeout: z.optional(types_duration), - track_total_hits: z.optional(global_search_types_track_hits), - track_scores: z.optional(z.boolean()), - typed_keys: z.optional(z.boolean()), - rest_total_hits_as_int: z.optional(z.boolean()), - version: z.optional(z.boolean()), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - seq_no_primary_term: z.optional(z.boolean()), - q: z.optional(z.string()), - size: z.optional(z.number()), - from: z.optional(z.number()), - sort: z.optional(z.union([z.string(), z.array(z.string())])), - wait_for_checkpoints: z.optional( - z.array(fleet_types_checkpoint).register(z.globalRegistry, { - description: - 'A comma separated list of checkpoints. When configured, the search API will only be executed on a shard\nafter the relevant checkpoint has become visible for search. Defaults to an empty list which will cause\nElasticsearch to immediately execute the search.', - }) - ), - allow_partial_search_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns partial results if there are shard request timeouts or shard failures.\nIf false, returns an error with no partial results.\nDefaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default.', - }) - ), - }) - ), + body: fleet_search, + path: z.object({ + index: z.union([ + types_index_name, + types_index_alias + ]) + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean()), + analyzer: z.optional(z.string()), + analyze_wildcard: z.optional(z.boolean()), + batched_reduce_size: z.optional(z.number()), + ccs_minimize_roundtrips: z.optional(z.boolean()), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string()), + docvalue_fields: z.optional(types_fields), + expand_wildcards: z.optional(types_expand_wildcards), + explain: z.optional(z.boolean()), + ignore_throttled: z.optional(z.boolean()), + ignore_unavailable: z.optional(z.boolean()), + lenient: z.optional(z.boolean()), + max_concurrent_shard_requests: z.optional(z.number()), + preference: z.optional(z.string()), + pre_filter_shard_size: z.optional(z.number()), + request_cache: z.optional(z.boolean()), + routing: z.optional(types_routing), + scroll: z.optional(types_duration), + search_type: z.optional(types_search_type), + stats: z.optional(z.array(z.string())), + stored_fields: z.optional(types_fields), + suggest_field: z.optional(types_field), + suggest_mode: z.optional(types_suggest_mode), + suggest_size: z.optional(z.number()), + suggest_text: z.optional(z.string().register(z.globalRegistry, { + description: 'The source text for which the suggestions should be returned.' + })), + terminate_after: z.optional(z.number()), + timeout: z.optional(types_duration), + track_total_hits: z.optional(global_search_types_track_hits), + track_scores: z.optional(z.boolean()), + typed_keys: z.optional(z.boolean()), + rest_total_hits_as_int: z.optional(z.boolean()), + version: z.optional(z.boolean()), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields), + seq_no_primary_term: z.optional(z.boolean()), + q: z.optional(z.string()), + size: z.optional(z.number()), + from: z.optional(z.number()), + sort: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + wait_for_checkpoints: z.optional(z.array(fleet_types_checkpoint).register(z.globalRegistry, { + description: 'A comma separated list of checkpoints. When configured, the search API will only be executed on a shard\nafter the relevant checkpoint has become visible for search. Defaults to an empty list which will cause\nElasticsearch to immediately execute the search.' + })), + allow_partial_search_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns partial results if there are shard request timeouts or shard failures.\nIf false, returns an error with no partial results.\nDefaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default.' + })) + })) }); export const fleet_search1_response = z.object({ - took: z.number(), - timed_out: z.boolean(), - _shards: types_shard_statistics, - hits: global_search_types_hits_metadata, - aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)), - _clusters: z.optional(types_cluster_statistics), - fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - max_score: z.optional(z.number()), - num_reduce_phases: z.optional(z.number()), - profile: z.optional(global_search_types_profile), - pit_id: z.optional(types_id), - _scroll_id: z.optional(types_scroll_id), - suggest: z.optional(z.record(z.string(), z.array(global_search_types_suggest))), - terminated_early: z.optional(z.boolean()), + took: z.number(), + timed_out: z.boolean(), + _shards: types_shard_statistics, + hits: global_search_types_hits_metadata, + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)), + _clusters: z.optional(types_cluster_statistics), + fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + max_score: z.optional(z.number()), + num_reduce_phases: z.optional(z.number()), + profile: z.optional(global_search_types_profile), + pit_id: z.optional(types_id), + _scroll_id: z.optional(types_scroll_id), + suggest: z.optional(z.record(z.string(), z.array(global_search_types_suggest))), + terminated_early: z.optional(z.boolean()) }); export const graph_explore_request = z.object({ - body: graph_explore, - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - routing: z.optional(types_routing), - timeout: z.optional(types_duration), - }) - ), + body: graph_explore, + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + routing: z.optional(types_routing), + timeout: z.optional(types_duration) + })) }); export const graph_explore_response = z.object({ - connections: z.array(graph_types_connection), - failures: z.array(types_shard_failure), - timed_out: z.boolean(), - took: z.number(), - vertices: z.array(graph_types_vertex), + connections: z.array(graph_types_connection), + failures: z.array(types_shard_failure), + timed_out: z.boolean(), + took: z.number(), + vertices: z.array(graph_types_vertex) }); export const graph_explore1_request = z.object({ - body: graph_explore, - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - routing: z.optional(types_routing), - timeout: z.optional(types_duration), - }) - ), + body: graph_explore, + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + routing: z.optional(types_routing), + timeout: z.optional(types_duration) + })) }); export const graph_explore1_response = z.object({ - connections: z.array(graph_types_connection), - failures: z.array(types_shard_failure), - timed_out: z.boolean(), - took: z.number(), - vertices: z.array(graph_types_vertex), + connections: z.array(graph_types_connection), + failures: z.array(types_shard_failure), + timed_out: z.boolean(), + took: z.number(), + vertices: z.array(graph_types_vertex) }); export const indices_analyze_request = z.object({ - body: indices_analyze, - path: z.optional(z.never()), - query: z.optional( - z.object({ - index: z.optional(types_index_name), - }) - ), + body: indices_analyze, + path: z.optional(z.never()), + query: z.optional(z.object({ + index: z.optional(types_index_name) + })) }); export const indices_analyze_response = z.object({ - detail: z.optional(indices_analyze_analyze_detail), - tokens: z.optional(z.array(indices_analyze_analyze_token)), + detail: z.optional(indices_analyze_analyze_detail), + tokens: z.optional(z.array(indices_analyze_analyze_token)) }); export const indices_analyze1_request = z.object({ - body: indices_analyze, - path: z.optional(z.never()), - query: z.optional( - z.object({ - index: z.optional(types_index_name), - }) - ), + body: indices_analyze, + path: z.optional(z.never()), + query: z.optional(z.object({ + index: z.optional(types_index_name) + })) }); export const indices_analyze1_response = z.object({ - detail: z.optional(indices_analyze_analyze_detail), - tokens: z.optional(z.array(indices_analyze_analyze_token)), + detail: z.optional(indices_analyze_analyze_detail), + tokens: z.optional(z.array(indices_analyze_analyze_token)) }); export const indices_analyze2_request = z.object({ - body: indices_analyze, - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - index: z.optional(types_index_name), - }) - ), + body: indices_analyze, + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + index: z.optional(types_index_name) + })) }); export const indices_analyze2_response = z.object({ - detail: z.optional(indices_analyze_analyze_detail), - tokens: z.optional(z.array(indices_analyze_analyze_token)), + detail: z.optional(indices_analyze_analyze_detail), + tokens: z.optional(z.array(indices_analyze_analyze_token)) }); export const indices_analyze3_request = z.object({ - body: indices_analyze, - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - index: z.optional(types_index_name), - }) - ), + body: indices_analyze, + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + index: z.optional(types_index_name) + })) }); export const indices_analyze3_response = z.object({ - detail: z.optional(indices_analyze_analyze_detail), - tokens: z.optional(z.array(indices_analyze_analyze_token)), + detail: z.optional(indices_analyze_analyze_detail), + tokens: z.optional(z.array(indices_analyze_analyze_token)) }); export const indices_clone1_request = z.object({ - body: z.optional(indices_clone), - path: z.object({ - index: types_index_name, - target: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - }) - ), + body: z.optional(indices_clone), + path: z.object({ + index: types_index_name, + target: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards) + })) }); export const indices_clone1_response = z.object({ - acknowledged: z.boolean(), - index: types_index_name, - shards_acknowledged: z.boolean(), + acknowledged: z.boolean(), + index: types_index_name, + shards_acknowledged: z.boolean() }); export const indices_clone_request = z.object({ - body: z.optional(indices_clone), - path: z.object({ - index: types_index_name, - target: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - }) - ), + body: z.optional(indices_clone), + path: z.object({ + index: types_index_name, + target: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards) + })) }); export const indices_clone_response = z.object({ - acknowledged: z.boolean(), - index: types_index_name, - shards_acknowledged: z.boolean(), + acknowledged: z.boolean(), + index: types_index_name, + shards_acknowledged: z.boolean() }); export const indices_get_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only\nmissing or closed indices. This behavior applies even if the request targets other open indices. For example,\na request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, returns settings in flat format.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If false, requests that target a missing index return an error.', - }) - ), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, return all default settings in the response.', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.', - }) - ), - master_timeout: z.optional(types_duration), - features: z.optional(indices_get_features), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only\nmissing or closed indices. This behavior applies even if the request targets other open indices. For example,\na request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns settings in flat format.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, requests that target a missing index return an error.' + })), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, return all default settings in the response.' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.' + })), + master_timeout: z.optional(types_duration), + features: z.optional(indices_get_features) + })) }); export const indices_get_response = z.record(z.string(), indices_types_index_state); export const indices_create_request = z.object({ - body: z.optional( - z.object({ - aliases: z.optional( - z.record(z.string(), indices_types_alias).register(z.globalRegistry, { - description: 'Aliases for the index.', - }) - ), - mappings: z.optional(types_mapping_type_mapping), - settings: z.optional(indices_types_index_settings), - }) - ), - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - }) - ), + body: z.optional(z.object({ + aliases: z.optional(z.record(z.string(), indices_types_alias).register(z.globalRegistry, { + description: 'Aliases for the index.' + })), + mappings: z.optional(types_mapping_type_mapping), + settings: z.optional(indices_types_index_settings) + })), + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards) + })) }); export const indices_create_response = z.object({ - index: types_index_name, - shards_acknowledged: z.boolean(), - acknowledged: z.boolean(), + index: types_index_name, + shards_acknowledged: z.boolean(), + acknowledged: z.boolean() }); export const indices_get_data_stream1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_data_stream_names, - }), - query: z.optional( - z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns all relevant default configurations for the index template.', - }) - ), - master_timeout: z.optional(types_duration), - verbose: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether the maximum timestamp for each data stream should be calculated and returned.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_data_stream_names + }), + query: z.optional(z.object({ + expand_wildcards: z.optional(types_expand_wildcards), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns all relevant default configurations for the index template.' + })), + master_timeout: z.optional(types_duration), + verbose: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether the maximum timestamp for each data stream should be calculated and returned.' + })) + })) }); export const indices_get_data_stream1_response = z.object({ - data_streams: z.array(indices_types_data_stream), + data_streams: z.array(indices_types_data_stream) }); export const indices_create_from1_request = z.object({ - body: z.optional(indices_create_from), - path: z.object({ - source: types_index_name, - dest: types_index_name, - }), - query: z.optional(z.never()), + body: z.optional(indices_create_from), + path: z.object({ + source: types_index_name, + dest: types_index_name + }), + query: z.optional(z.never()) }); export const indices_create_from1_response = z.object({ - acknowledged: z.boolean(), - index: types_index_name, - shards_acknowledged: z.boolean(), + acknowledged: z.boolean(), + index: types_index_name, + shards_acknowledged: z.boolean() }); export const indices_create_from_request = z.object({ - body: z.optional(indices_create_from), - path: z.object({ - source: types_index_name, - dest: types_index_name, - }), - query: z.optional(z.never()), + body: z.optional(indices_create_from), + path: z.object({ + source: types_index_name, + dest: types_index_name + }), + query: z.optional(z.never()) }); export const indices_create_from_response = z.object({ - acknowledged: z.boolean(), - index: types_index_name, - shards_acknowledged: z.boolean(), + acknowledged: z.boolean(), + index: types_index_name, + shards_acknowledged: z.boolean() }); export const indices_get_alias2_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - name: types_names, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices, + name: types_names + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + master_timeout: z.optional(types_duration) + })) }); -export const indices_get_alias2_response = z.record( - z.string(), - indices_get_alias_types_index_aliases -); +export const indices_get_alias2_response = z.record(z.string(), indices_get_alias_types_index_aliases); export const indices_put_alias1_request = z.object({ - body: z.optional(indices_put_alias), - path: z.object({ - index: types_indices, - name: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(indices_put_alias), + path: z.object({ + index: types_indices, + name: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_put_alias1_response = types_acknowledged_response_base; export const indices_put_alias_request = z.object({ - body: z.optional(indices_put_alias), - path: z.object({ - index: types_indices, - name: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(indices_put_alias), + path: z.object({ + index: types_indices, + name: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_put_alias_response = types_acknowledged_response_base; export const indices_put_alias3_request = z.object({ - body: z.optional(indices_put_alias), - path: z.object({ - index: types_indices, - name: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(indices_put_alias), + path: z.object({ + index: types_indices, + name: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_put_alias3_response = types_acknowledged_response_base; export const indices_put_alias2_request = z.object({ - body: z.optional(indices_put_alias), - path: z.object({ - index: types_indices, - name: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.optional(indices_put_alias), + path: z.object({ + index: types_indices, + name: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_put_alias2_response = types_acknowledged_response_base; export const indices_get_index_template1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.', - }) - ), - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, returns settings in flat format.', - }) - ), - master_timeout: z.optional(types_duration), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns all relevant default configurations for the index template.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.' + })), + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns settings in flat format.' + })), + master_timeout: z.optional(types_duration), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns all relevant default configurations for the index template.' + })) + })) }); export const indices_get_index_template1_response = z.object({ - index_templates: z.array(indices_get_index_template_index_template_item), + index_templates: z.array(indices_get_index_template_index_template_item) }); export const indices_put_index_template1_request = z.object({ - body: indices_put_index_template, - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - create: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, this request cannot replace or update existing index templates.', - }) - ), - master_timeout: z.optional(types_duration), - cause: z.optional( - z.string().register(z.globalRegistry, { - description: 'User defined reason for creating/updating the index template', - }) - ), - }) - ), + body: indices_put_index_template, + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + create: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, this request cannot replace or update existing index templates.' + })), + master_timeout: z.optional(types_duration), + cause: z.optional(z.string().register(z.globalRegistry, { + description: 'User defined reason for creating or updating the index template' + })) + })) }); export const indices_put_index_template1_response = types_acknowledged_response_base; export const indices_put_index_template_request = z.object({ - body: indices_put_index_template, - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - create: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, this request cannot replace or update existing index templates.', - }) - ), - master_timeout: z.optional(types_duration), - cause: z.optional( - z.string().register(z.globalRegistry, { - description: 'User defined reason for creating/updating the index template', - }) - ), - }) - ), + body: indices_put_index_template, + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + create: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, this request cannot replace or update existing index templates.' + })), + master_timeout: z.optional(types_duration), + cause: z.optional(z.string().register(z.globalRegistry, { + description: 'User defined reason for creating or updating the index template' + })) + })) }); export const indices_put_index_template_response = types_acknowledged_response_base; export const indices_get_template1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_names, - }), - query: z.optional( - z.object({ - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request retrieves information from the local node only.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_names + }), + query: z.optional(z.object({ + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns settings in flat format.' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request retrieves information from the local node only.' + })), + master_timeout: z.optional(types_duration) + })) }); export const indices_get_template1_response = z.record(z.string(), indices_types_template_mapping); export const indices_put_template1_request = z.object({ - body: indices_put_template, - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - create: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, this request cannot replace or update existing index templates.', - }) - ), - master_timeout: z.optional(types_duration), - order: z.optional( - z.number().register(z.globalRegistry, { - description: - "Order in which Elasticsearch applies this template if index\nmatches multiple templates.\n\nTemplates with lower 'order' values are merged first. Templates with higher\n'order' values are merged later, overriding templates with lower values.", - }) - ), - cause: z.optional( - z.string().register(z.globalRegistry, { - description: 'User defined reason for creating/updating the index template', - }) - ), - }) - ), + body: indices_put_template, + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + create: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, this request cannot replace or update existing index templates.' + })), + master_timeout: z.optional(types_duration), + order: z.optional(z.number().register(z.globalRegistry, { + description: 'Order in which Elasticsearch applies this template if index\nmatches multiple templates.\n\nTemplates with lower \'order\' values are merged first. Templates with higher\n\'order\' values are merged later, overriding templates with lower values.' + })), + cause: z.optional(z.string().register(z.globalRegistry, { + description: 'User defined reason for creating or updating the index template' + })) + })) }); export const indices_put_template1_response = types_acknowledged_response_base; export const indices_put_template_request = z.object({ - body: indices_put_template, - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - create: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, this request cannot replace or update existing index templates.', - }) - ), - master_timeout: z.optional(types_duration), - order: z.optional( - z.number().register(z.globalRegistry, { - description: - "Order in which Elasticsearch applies this template if index\nmatches multiple templates.\n\nTemplates with lower 'order' values are merged first. Templates with higher\n'order' values are merged later, overriding templates with lower values.", - }) - ), - cause: z.optional( - z.string().register(z.globalRegistry, { - description: 'User defined reason for creating/updating the index template', - }) - ), - }) - ), + body: indices_put_template, + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + create: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, this request cannot replace or update existing index templates.' + })), + master_timeout: z.optional(types_duration), + order: z.optional(z.number().register(z.globalRegistry, { + description: 'Order in which Elasticsearch applies this template if index\nmatches multiple templates.\n\nTemplates with lower \'order\' values are merged first. Templates with higher\n\'order\' values are merged later, overriding templates with lower values.' + })), + cause: z.optional(z.string().register(z.globalRegistry, { + description: 'User defined reason for creating or updating the index template' + })) + })) }); export const indices_put_template_response = types_acknowledged_response_base; export const indices_get_alias1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_names, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_names + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + master_timeout: z.optional(types_duration) + })) }); -export const indices_get_alias1_response = z.record( - z.string(), - indices_get_alias_types_index_aliases -); +export const indices_get_alias1_response = z.record(z.string(), indices_get_alias_types_index_aliases); export const indices_get_alias_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), -}); - -export const indices_get_alias_response = z.record( - z.string(), - indices_get_alias_types_index_aliases -); + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + master_timeout: z.optional(types_duration) + })) +}); + +export const indices_get_alias_response = z.record(z.string(), indices_get_alias_types_index_aliases); export const indices_get_alias3_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + master_timeout: z.optional(types_duration) + })) }); -export const indices_get_alias3_response = z.record( - z.string(), - indices_get_alias_types_index_aliases -); +export const indices_get_alias3_response = z.record(z.string(), indices_get_alias_types_index_aliases); export const indices_get_data_stream_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - expand_wildcards: z.optional(types_expand_wildcards), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns all relevant default configurations for the index template.', - }) - ), - master_timeout: z.optional(types_duration), - verbose: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether the maximum timestamp for each data stream should be calculated and returned.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + expand_wildcards: z.optional(types_expand_wildcards), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns all relevant default configurations for the index template.' + })), + master_timeout: z.optional(types_duration), + verbose: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether the maximum timestamp for each data stream should be calculated and returned.' + })) + })) }); export const indices_get_data_stream_response = z.object({ - data_streams: z.array(indices_types_data_stream), + data_streams: z.array(indices_types_data_stream) }); export const indices_get_data_stream_mappings_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_indices, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_indices + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const indices_get_data_stream_mappings_response = z.object({ - data_streams: z.array(indices_get_data_stream_mappings_data_stream_mappings), + data_streams: z.array(indices_get_data_stream_mappings_data_stream_mappings) }); export const indices_put_data_stream_mappings_request = z.object({ - body: types_mapping_type_mapping, - path: z.object({ - name: types_indices, - }), - query: z.optional( - z.object({ - dry_run: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request does not actually change the mappings on any data streams. Instead, it\nsimulates changing the settings and reports back to the user what would have happened had these settings\nactually been applied.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: types_mapping_type_mapping, + path: z.object({ + name: types_indices + }), + query: z.optional(z.object({ + dry_run: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request does not actually change the mappings on any data streams. Instead, it\nsimulates changing the settings and reports back to the user what would have happened had these settings\nactually been applied.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_put_data_stream_mappings_response = z.object({ - data_streams: z.array(indices_put_data_stream_mappings_updated_data_stream_mappings), + data_streams: z.array(indices_put_data_stream_mappings_updated_data_stream_mappings) }); export const indices_get_data_stream_settings_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_indices, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_indices + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const indices_get_data_stream_settings_response = z.object({ - data_streams: z.array(indices_get_data_stream_settings_data_stream_settings), + data_streams: z.array(indices_get_data_stream_settings_data_stream_settings) }); export const indices_put_data_stream_settings_request = z.object({ - body: indices_types_index_settings, - path: z.object({ - name: types_indices, - }), - query: z.optional( - z.object({ - dry_run: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request does not actually change the settings on any data streams or indices. Instead, it\nsimulates changing the settings and reports back to the user what would have happened had these settings\nactually been applied.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: indices_types_index_settings, + path: z.object({ + name: types_indices + }), + query: z.optional(z.object({ + dry_run: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request does not actually change the settings on any data streams or indices. Instead, it\nsimulates changing the settings and reports back to the user what would have happened had these settings\nactually been applied.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_put_data_stream_settings_response = z.object({ - data_streams: z.array(indices_put_data_stream_settings_updated_data_stream_settings), + data_streams: z.array(indices_put_data_stream_settings_updated_data_stream_settings) }); export const indices_get_field_mapping_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - fields: types_fields, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, return all default settings in the response.', - }) - ), - }) - ), -}); - -export const indices_get_field_mapping_response = z.record( - z.string(), - indices_get_field_mapping_type_field_mappings -); + body: z.optional(z.never()), + path: z.object({ + fields: types_fields + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, return all default settings in the response.' + })) + })) +}); + +export const indices_get_field_mapping_response = z.record(z.string(), indices_get_field_mapping_type_field_mappings); export const indices_get_field_mapping1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - fields: types_fields, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, return all default settings in the response.', - }) - ), - }) - ), -}); - -export const indices_get_field_mapping1_response = z.record( - z.string(), - indices_get_field_mapping_type_field_mappings -); + body: z.optional(z.never()), + path: z.object({ + index: types_indices, + fields: types_fields + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, return all default settings in the response.' + })) + })) +}); + +export const indices_get_field_mapping1_response = z.record(z.string(), indices_get_field_mapping_type_field_mappings); export const indices_get_index_template_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.', - }) - ), - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, returns settings in flat format.', - }) - ), - master_timeout: z.optional(types_duration), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns all relevant default configurations for the index template.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.' + })), + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns settings in flat format.' + })), + master_timeout: z.optional(types_duration), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns all relevant default configurations for the index template.' + })) + })) }); export const indices_get_index_template_response = z.object({ - index_templates: z.array(indices_get_index_template_index_template_item), + index_templates: z.array(indices_get_index_template_index_template_item) }); export const indices_get_mapping_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request retrieves information from the local node only.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), -}); - -export const indices_get_mapping_response = z.record( - z.string(), - indices_get_mapping_index_mapping_record -); + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request retrieves information from the local node only.' + })), + master_timeout: z.optional(types_duration) + })) +}); + +export const indices_get_mapping_response = z.record(z.string(), indices_get_mapping_index_mapping_record); export const indices_get_mapping1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request retrieves information from the local node only.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), -}); - -export const indices_get_mapping1_response = z.record( - z.string(), - indices_get_mapping_index_mapping_record -); + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request retrieves information from the local node only.' + })), + master_timeout: z.optional(types_duration) + })) +}); + +export const indices_get_mapping1_response = z.record(z.string(), indices_get_mapping_index_mapping_record); export const indices_put_mapping1_request = z.object({ - body: indices_put_mapping, - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - write_index_only: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the mappings are applied only to the current write index for the target.', - }) - ), - }) - ), + body: indices_put_mapping, + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + write_index_only: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the mappings are applied only to the current write index for the target.' + })) + })) }); export const indices_put_mapping1_response = types_indices_response_base; export const indices_put_mapping_request = z.object({ - body: indices_put_mapping, - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - write_index_only: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the mappings are applied only to the current write index for the target.', - }) - ), - }) - ), + body: indices_put_mapping, + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + write_index_only: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the mappings are applied only to the current write index for the target.' + })) + })) }); export const indices_put_mapping_response = types_indices_response_base; export const indices_get_settings_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index\nalias, or `_all` value targets only missing or closed indices. This\nbehavior applies even if the request targets other open indices. For\nexample, a request targeting `foo*,bar*` returns an error if an index\nstarts with foo but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, return all default settings in the response.', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request retrieves information from the local node only. If\n`false`, information is retrieved from the master node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index\nalias, or `_all` value targets only missing or closed indices. This\nbehavior applies even if the request targets other open indices. For\nexample, a request targeting `foo*,bar*` returns an error if an index\nstarts with foo but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns settings in flat format.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, return all default settings in the response.' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request retrieves information from the local node only. If\n`false`, information is retrieved from the master node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const indices_get_settings_response = z.record(z.string(), indices_types_index_state); export const indices_put_settings_request = z.object({ - body: indices_put_settings, - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index\nalias, or `_all` value targets only missing or closed indices. This\nbehavior applies even if the request targets other open indices. For\nexample, a request targeting `foo*,bar*` returns an error if an index\nstarts with `foo` but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', - }) - ), - master_timeout: z.optional(types_duration), - preserve_existing: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, existing index settings remain unchanged.', - }) - ), - reopen: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to close and reopen the index to apply non-dynamic settings.\nIf set to `true` the indices to which the settings are being applied\nwill be closed temporarily and then reopened in order to apply the changes.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: indices_put_settings, + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index\nalias, or `_all` value targets only missing or closed indices. This\nbehavior applies even if the request targets other open indices. For\nexample, a request targeting `foo*,bar*` returns an error if an index\nstarts with `foo` but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns settings in flat format.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns settings in flat format.' + })), + master_timeout: z.optional(types_duration), + preserve_existing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, existing index settings remain unchanged.' + })), + reopen: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to close and reopen the index to apply non-dynamic settings.\nIf set to `true` the indices to which the settings are being applied\nwill be closed temporarily and then reopened in order to apply the changes.' + })), + timeout: z.optional(types_duration) + })) }); export const indices_put_settings_response = types_acknowledged_response_base; export const indices_get_settings1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index\nalias, or `_all` value targets only missing or closed indices. This\nbehavior applies even if the request targets other open indices. For\nexample, a request targeting `foo*,bar*` returns an error if an index\nstarts with foo but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, return all default settings in the response.', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request retrieves information from the local node only. If\n`false`, information is retrieved from the master node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index\nalias, or `_all` value targets only missing or closed indices. This\nbehavior applies even if the request targets other open indices. For\nexample, a request targeting `foo*,bar*` returns an error if an index\nstarts with foo but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns settings in flat format.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, return all default settings in the response.' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request retrieves information from the local node only. If\n`false`, information is retrieved from the master node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const indices_get_settings1_response = z.record(z.string(), indices_types_index_state); export const indices_put_settings1_request = z.object({ - body: indices_put_settings, - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index\nalias, or `_all` value targets only missing or closed indices. This\nbehavior applies even if the request targets other open indices. For\nexample, a request targeting `foo*,bar*` returns an error if an index\nstarts with `foo` but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', - }) - ), - master_timeout: z.optional(types_duration), - preserve_existing: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, existing index settings remain unchanged.', - }) - ), - reopen: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to close and reopen the index to apply non-dynamic settings.\nIf set to `true` the indices to which the settings are being applied\nwill be closed temporarily and then reopened in order to apply the changes.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: indices_put_settings, + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index\nalias, or `_all` value targets only missing or closed indices. This\nbehavior applies even if the request targets other open indices. For\nexample, a request targeting `foo*,bar*` returns an error if an index\nstarts with `foo` but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns settings in flat format.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns settings in flat format.' + })), + master_timeout: z.optional(types_duration), + preserve_existing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, existing index settings remain unchanged.' + })), + reopen: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to close and reopen the index to apply non-dynamic settings.\nIf set to `true` the indices to which the settings are being applied\nwill be closed temporarily and then reopened in order to apply the changes.' + })), + timeout: z.optional(types_duration) + })) }); export const indices_put_settings1_response = types_acknowledged_response_base; export const indices_get_settings2_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - name: types_names, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index\nalias, or `_all` value targets only missing or closed indices. This\nbehavior applies even if the request targets other open indices. For\nexample, a request targeting `foo*,bar*` returns an error if an index\nstarts with foo but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, return all default settings in the response.', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request retrieves information from the local node only. If\n`false`, information is retrieved from the master node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices, + name: types_names + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index\nalias, or `_all` value targets only missing or closed indices. This\nbehavior applies even if the request targets other open indices. For\nexample, a request targeting `foo*,bar*` returns an error if an index\nstarts with foo but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns settings in flat format.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, return all default settings in the response.' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request retrieves information from the local node only. If\n`false`, information is retrieved from the master node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const indices_get_settings2_response = z.record(z.string(), indices_types_index_state); export const indices_get_settings3_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_names, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index\nalias, or `_all` value targets only missing or closed indices. This\nbehavior applies even if the request targets other open indices. For\nexample, a request targeting `foo*,bar*` returns an error if an index\nstarts with foo but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, return all default settings in the response.', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request retrieves information from the local node only. If\n`false`, information is retrieved from the master node.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.object({ + name: types_names + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index\nalias, or `_all` value targets only missing or closed indices. This\nbehavior applies even if the request targets other open indices. For\nexample, a request targeting `foo*,bar*` returns an error if an index\nstarts with foo but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns settings in flat format.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, return all default settings in the response.' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request retrieves information from the local node only. If\n`false`, information is retrieved from the master node.' + })), + master_timeout: z.optional(types_duration) + })) }); export const indices_get_settings3_response = z.record(z.string(), indices_types_index_state); export const indices_get_template_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - flat_settings: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns settings in flat format.', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request retrieves information from the local node only.', - }) - ), - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + flat_settings: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns settings in flat format.' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request retrieves information from the local node only.' + })), + master_timeout: z.optional(types_duration) + })) }); export const indices_get_template_response = z.record(z.string(), indices_types_template_mapping); export const indices_rollover_request = z.object({ - body: z.optional(indices_rollover), - path: z.object({ - alias: types_index_alias, - }), - query: z.optional( - z.object({ - dry_run: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, checks whether the current index satisfies the specified conditions but does not perform a rollover.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - lazy: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If set to true, the rollover action will only mark a data stream to signal that it needs to be rolled over at the next write.\nOnly allowed on data streams.', - }) - ), - }) - ), + body: z.optional(indices_rollover), + path: z.object({ + alias: types_index_alias + }), + query: z.optional(z.object({ + dry_run: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, checks whether the current index satisfies the specified conditions but does not perform a rollover.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards), + lazy: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If set to true, the rollover action will only mark a data stream to signal that it needs to be rolled over at the next write.\nOnly allowed on data streams.' + })) + })) }); export const indices_rollover_response = z.object({ - acknowledged: z.boolean(), - conditions: z.record(z.string(), z.boolean()), - dry_run: z.boolean(), - new_index: z.string(), - old_index: z.string(), - rolled_over: z.boolean(), - shards_acknowledged: z.boolean(), + acknowledged: z.boolean(), + conditions: z.record(z.string(), z.boolean()), + dry_run: z.boolean(), + new_index: z.string(), + old_index: z.string(), + rolled_over: z.boolean(), + shards_acknowledged: z.boolean() }); export const indices_rollover1_request = z.object({ - body: z.optional(indices_rollover), - path: z.object({ - alias: types_index_alias, - new_index: types_index_name, - }), - query: z.optional( - z.object({ - dry_run: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, checks whether the current index satisfies the specified conditions but does not perform a rollover.', - }) - ), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - lazy: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If set to true, the rollover action will only mark a data stream to signal that it needs to be rolled over at the next write.\nOnly allowed on data streams.', - }) - ), - }) - ), + body: z.optional(indices_rollover), + path: z.object({ + alias: types_index_alias, + new_index: types_index_name + }), + query: z.optional(z.object({ + dry_run: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, checks whether the current index satisfies the specified conditions but does not perform a rollover.' + })), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards), + lazy: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If set to true, the rollover action will only mark a data stream to signal that it needs to be rolled over at the next write.\nOnly allowed on data streams.' + })) + })) }); export const indices_rollover1_response = z.object({ - acknowledged: z.boolean(), - conditions: z.record(z.string(), z.boolean()), - dry_run: z.boolean(), - new_index: z.string(), - old_index: z.string(), - rolled_over: z.boolean(), - shards_acknowledged: z.boolean(), + acknowledged: z.boolean(), + conditions: z.record(z.string(), z.boolean()), + dry_run: z.boolean(), + new_index: z.string(), + old_index: z.string(), + rolled_over: z.boolean(), + shards_acknowledged: z.boolean() }); export const indices_shrink1_request = z.object({ - body: indices_shrink, - path: z.object({ - index: types_index_name, - target: types_index_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - }) - ), + body: indices_shrink, + path: z.object({ + index: types_index_name, + target: types_index_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards) + })) }); export const indices_shrink1_response = z.object({ - acknowledged: z.boolean(), - shards_acknowledged: z.boolean(), - index: types_index_name, + acknowledged: z.boolean(), + shards_acknowledged: z.boolean(), + index: types_index_name }); export const indices_shrink_request = z.object({ - body: indices_shrink, - path: z.object({ - index: types_index_name, - target: types_index_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - }) - ), + body: indices_shrink, + path: z.object({ + index: types_index_name, + target: types_index_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards) + })) }); export const indices_shrink_response = z.object({ - acknowledged: z.boolean(), - shards_acknowledged: z.boolean(), - index: types_index_name, + acknowledged: z.boolean(), + shards_acknowledged: z.boolean(), + index: types_index_name }); export const indices_simulate_index_template_request = z.object({ - body: z.optional(indices_types_index_template), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - create: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one', - }) - ), - cause: z.optional( - z.string().register(z.globalRegistry, { - description: - 'User defined reason for dry-run creating the new template for simulation purposes', - }) - ), - master_timeout: z.optional(types_duration), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns all relevant default configurations for the index template.', - }) - ), - }) - ), + body: z.optional(indices_types_index_template), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + create: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one' + })), + cause: z.optional(z.string().register(z.globalRegistry, { + description: 'User defined reason for dry-run creating the new template for simulation purposes' + })), + master_timeout: z.optional(types_duration), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns all relevant default configurations for the index template.' + })) + })) }); export const indices_simulate_index_template_response = z.object({ - overlapping: z.optional(z.array(indices_simulate_template_overlapping)), - template: indices_simulate_template_template, + overlapping: z.optional(z.array(indices_simulate_template_overlapping)), + template: indices_simulate_template_template }); export const indices_simulate_template_request = z.object({ - body: z.optional(indices_simulate_template), - path: z.optional(z.never()), - query: z.optional( - z.object({ - create: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation.', - }) - ), - cause: z.optional( - z.string().register(z.globalRegistry, { - description: - 'User defined reason for dry-run creating the new template for simulation purposes', - }) - ), - master_timeout: z.optional(types_duration), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns all relevant default configurations for the index template.', - }) - ), - }) - ), + body: z.optional(indices_simulate_template), + path: z.optional(z.never()), + query: z.optional(z.object({ + create: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation.' + })), + cause: z.optional(z.string().register(z.globalRegistry, { + description: 'User defined reason for dry-run creating the new template for simulation purposes' + })), + master_timeout: z.optional(types_duration), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns all relevant default configurations for the index template.' + })) + })) }); export const indices_simulate_template_response = z.object({ - overlapping: z.optional(z.array(indices_simulate_template_overlapping)), - template: indices_simulate_template_template, + overlapping: z.optional(z.array(indices_simulate_template_overlapping)), + template: indices_simulate_template_template }); export const indices_simulate_template1_request = z.object({ - body: z.optional(indices_simulate_template), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - create: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation.', - }) - ), - cause: z.optional( - z.string().register(z.globalRegistry, { - description: - 'User defined reason for dry-run creating the new template for simulation purposes', - }) - ), - master_timeout: z.optional(types_duration), - include_defaults: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, returns all relevant default configurations for the index template.', - }) - ), - }) - ), + body: z.optional(indices_simulate_template), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + create: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation.' + })), + cause: z.optional(z.string().register(z.globalRegistry, { + description: 'User defined reason for dry-run creating the new template for simulation purposes' + })), + master_timeout: z.optional(types_duration), + include_defaults: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, returns all relevant default configurations for the index template.' + })) + })) }); export const indices_simulate_template1_response = z.object({ - overlapping: z.optional(z.array(indices_simulate_template_overlapping)), - template: indices_simulate_template_template, + overlapping: z.optional(z.array(indices_simulate_template_overlapping)), + template: indices_simulate_template_template }); export const indices_split1_request = z.object({ - body: indices_split, - path: z.object({ - index: types_index_name, - target: types_index_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - }) - ), + body: indices_split, + path: z.object({ + index: types_index_name, + target: types_index_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards) + })) }); export const indices_split1_response = z.object({ - acknowledged: z.boolean(), - shards_acknowledged: z.boolean(), - index: types_index_name, + acknowledged: z.boolean(), + shards_acknowledged: z.boolean(), + index: types_index_name }); export const indices_split_request = z.object({ - body: indices_split, - path: z.object({ - index: types_index_name, - target: types_index_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - }) - ), + body: indices_split, + path: z.object({ + index: types_index_name, + target: types_index_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards) + })) }); export const indices_split_response = z.object({ - acknowledged: z.boolean(), - shards_acknowledged: z.boolean(), - index: types_index_name, + acknowledged: z.boolean(), + shards_acknowledged: z.boolean(), + index: types_index_name }); export const indices_stats_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - completion_fields: z.optional(types_fields), - expand_wildcards: z.optional(types_expand_wildcards), - fielddata_fields: z.optional(types_fields), - fields: z.optional(types_fields), - forbid_closed_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, statistics are not collected from closed indices.', - }) - ), - groups: z.optional(z.union([z.string(), z.array(z.string())])), - include_segment_file_sizes: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).', - }) - ), - include_unloaded_segments: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the response includes information from segments that are not loaded into memory.', - }) - ), - level: z.optional(types_level), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + completion_fields: z.optional(types_fields), + expand_wildcards: z.optional(types_expand_wildcards), + fielddata_fields: z.optional(types_fields), + fields: z.optional(types_fields), + forbid_closed_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, statistics are not collected from closed indices.' + })), + groups: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + include_segment_file_sizes: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).' + })), + include_unloaded_segments: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the response includes information from segments that are not loaded into memory.' + })), + level: z.optional(types_level) + })) }); export const indices_stats_response = z.object({ - indices: z.optional(z.record(z.string(), indices_stats_indices_stats)), - _shards: types_shard_statistics, - _all: indices_stats_indices_stats, + indices: z.optional(z.record(z.string(), indices_stats_indices_stats)), + _shards: types_shard_statistics, + _all: indices_stats_indices_stats }); export const indices_stats1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - metric: types_common_stats_flags, - }), - query: z.optional( - z.object({ - completion_fields: z.optional(types_fields), - expand_wildcards: z.optional(types_expand_wildcards), - fielddata_fields: z.optional(types_fields), - fields: z.optional(types_fields), - forbid_closed_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, statistics are not collected from closed indices.', - }) - ), - groups: z.optional(z.union([z.string(), z.array(z.string())])), - include_segment_file_sizes: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).', - }) - ), - include_unloaded_segments: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the response includes information from segments that are not loaded into memory.', - }) - ), - level: z.optional(types_level), - }) - ), + body: z.optional(z.never()), + path: z.object({ + metric: types_common_stats_flags + }), + query: z.optional(z.object({ + completion_fields: z.optional(types_fields), + expand_wildcards: z.optional(types_expand_wildcards), + fielddata_fields: z.optional(types_fields), + fields: z.optional(types_fields), + forbid_closed_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, statistics are not collected from closed indices.' + })), + groups: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + include_segment_file_sizes: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).' + })), + include_unloaded_segments: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the response includes information from segments that are not loaded into memory.' + })), + level: z.optional(types_level) + })) }); export const indices_stats1_response = z.object({ - indices: z.optional(z.record(z.string(), indices_stats_indices_stats)), - _shards: types_shard_statistics, - _all: indices_stats_indices_stats, + indices: z.optional(z.record(z.string(), indices_stats_indices_stats)), + _shards: types_shard_statistics, + _all: indices_stats_indices_stats }); export const indices_stats2_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - completion_fields: z.optional(types_fields), - expand_wildcards: z.optional(types_expand_wildcards), - fielddata_fields: z.optional(types_fields), - fields: z.optional(types_fields), - forbid_closed_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, statistics are not collected from closed indices.', - }) - ), - groups: z.optional(z.union([z.string(), z.array(z.string())])), - include_segment_file_sizes: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).', - }) - ), - include_unloaded_segments: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the response includes information from segments that are not loaded into memory.', - }) - ), - level: z.optional(types_level), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + completion_fields: z.optional(types_fields), + expand_wildcards: z.optional(types_expand_wildcards), + fielddata_fields: z.optional(types_fields), + fields: z.optional(types_fields), + forbid_closed_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, statistics are not collected from closed indices.' + })), + groups: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + include_segment_file_sizes: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).' + })), + include_unloaded_segments: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the response includes information from segments that are not loaded into memory.' + })), + level: z.optional(types_level) + })) }); export const indices_stats2_response = z.object({ - indices: z.optional(z.record(z.string(), indices_stats_indices_stats)), - _shards: types_shard_statistics, - _all: indices_stats_indices_stats, + indices: z.optional(z.record(z.string(), indices_stats_indices_stats)), + _shards: types_shard_statistics, + _all: indices_stats_indices_stats }); export const indices_stats3_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - metric: types_common_stats_flags, - }), - query: z.optional( - z.object({ - completion_fields: z.optional(types_fields), - expand_wildcards: z.optional(types_expand_wildcards), - fielddata_fields: z.optional(types_fields), - fields: z.optional(types_fields), - forbid_closed_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, statistics are not collected from closed indices.', - }) - ), - groups: z.optional(z.union([z.string(), z.array(z.string())])), - include_segment_file_sizes: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).', - }) - ), - include_unloaded_segments: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the response includes information from segments that are not loaded into memory.', - }) - ), - level: z.optional(types_level), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices, + metric: types_common_stats_flags + }), + query: z.optional(z.object({ + completion_fields: z.optional(types_fields), + expand_wildcards: z.optional(types_expand_wildcards), + fielddata_fields: z.optional(types_fields), + fields: z.optional(types_fields), + forbid_closed_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, statistics are not collected from closed indices.' + })), + groups: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + include_segment_file_sizes: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).' + })), + include_unloaded_segments: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the response includes information from segments that are not loaded into memory.' + })), + level: z.optional(types_level) + })) }); export const indices_stats3_response = z.object({ - indices: z.optional(z.record(z.string(), indices_stats_indices_stats)), - _shards: types_shard_statistics, - _all: indices_stats_indices_stats, + indices: z.optional(z.record(z.string(), indices_stats_indices_stats)), + _shards: types_shard_statistics, + _all: indices_stats_indices_stats }); export const indices_update_aliases_request = z.object({ - body: z.object({ - actions: z.optional( - z.array(indices_update_aliases_action).register(z.globalRegistry, { - description: 'Actions to perform.', - }) - ), - }), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + actions: z.optional(z.array(indices_update_aliases_action).register(z.globalRegistry, { + description: 'Actions to perform.' + })) + }), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const indices_update_aliases_response = types_acknowledged_response_base; export const indices_validate_query_request = z.object({ - body: z.optional(indices_validate_query), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - all_shards: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the validation is executed on all shards instead of one random shard per index.', - }) - ), - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Analyzer to use for the query string.\nThis parameter can only be used when the `q` query string parameter is specified.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, wildcard and prefix queries are analyzed.', - }) - ), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Field to use as default where no field prefix is given in the query string.\nThis parameter can only be used when the `q` query string parameter is specified.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response returns detailed information if an error has occurred.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.', - }) - ), - rewrite: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed.', - }) - ), - q: z.optional( - z.string().register(z.globalRegistry, { - description: 'Query in the Lucene query string syntax.', - }) - ), - }) - ), + body: z.optional(indices_validate_query), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + all_shards: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the validation is executed on all shards instead of one random shard per index.' + })), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer to use for the query string.\nThis parameter can only be used when the `q` query string parameter is specified.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard and prefix queries are analyzed.' + })), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'Field to use as default where no field prefix is given in the query string.\nThis parameter can only be used when the `q` query string parameter is specified.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response returns detailed information if an error has occurred.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.' + })), + rewrite: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed.' + })), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'Query in the Lucene query string syntax.' + })) + })) }); export const indices_validate_query_response = z.object({ - explanations: z.optional(z.array(indices_validate_query_indices_validation_explanation)), - _shards: z.optional(types_shard_statistics), - valid: z.boolean(), - error: z.optional(z.string()), + explanations: z.optional(z.array(indices_validate_query_indices_validation_explanation)), + _shards: z.optional(types_shard_statistics), + valid: z.boolean(), + error: z.optional(z.string()) }); export const indices_validate_query1_request = z.object({ - body: z.optional(indices_validate_query), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - all_shards: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the validation is executed on all shards instead of one random shard per index.', - }) - ), - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Analyzer to use for the query string.\nThis parameter can only be used when the `q` query string parameter is specified.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, wildcard and prefix queries are analyzed.', - }) - ), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Field to use as default where no field prefix is given in the query string.\nThis parameter can only be used when the `q` query string parameter is specified.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response returns detailed information if an error has occurred.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.', - }) - ), - rewrite: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed.', - }) - ), - q: z.optional( - z.string().register(z.globalRegistry, { - description: 'Query in the Lucene query string syntax.', - }) - ), - }) - ), + body: z.optional(indices_validate_query), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + all_shards: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the validation is executed on all shards instead of one random shard per index.' + })), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer to use for the query string.\nThis parameter can only be used when the `q` query string parameter is specified.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard and prefix queries are analyzed.' + })), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'Field to use as default where no field prefix is given in the query string.\nThis parameter can only be used when the `q` query string parameter is specified.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response returns detailed information if an error has occurred.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.' + })), + rewrite: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed.' + })), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'Query in the Lucene query string syntax.' + })) + })) }); export const indices_validate_query1_response = z.object({ - explanations: z.optional(z.array(indices_validate_query_indices_validation_explanation)), - _shards: z.optional(types_shard_statistics), - valid: z.boolean(), - error: z.optional(z.string()), + explanations: z.optional(z.array(indices_validate_query_indices_validation_explanation)), + _shards: z.optional(types_shard_statistics), + valid: z.boolean(), + error: z.optional(z.string()) }); export const indices_validate_query2_request = z.object({ - body: z.optional(indices_validate_query), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - all_shards: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the validation is executed on all shards instead of one random shard per index.', - }) - ), - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Analyzer to use for the query string.\nThis parameter can only be used when the `q` query string parameter is specified.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, wildcard and prefix queries are analyzed.', - }) - ), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Field to use as default where no field prefix is given in the query string.\nThis parameter can only be used when the `q` query string parameter is specified.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response returns detailed information if an error has occurred.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.', - }) - ), - rewrite: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed.', - }) - ), - q: z.optional( - z.string().register(z.globalRegistry, { - description: 'Query in the Lucene query string syntax.', - }) - ), - }) - ), + body: z.optional(indices_validate_query), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + all_shards: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the validation is executed on all shards instead of one random shard per index.' + })), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer to use for the query string.\nThis parameter can only be used when the `q` query string parameter is specified.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard and prefix queries are analyzed.' + })), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'Field to use as default where no field prefix is given in the query string.\nThis parameter can only be used when the `q` query string parameter is specified.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response returns detailed information if an error has occurred.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.' + })), + rewrite: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed.' + })), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'Query in the Lucene query string syntax.' + })) + })) }); export const indices_validate_query2_response = z.object({ - explanations: z.optional(z.array(indices_validate_query_indices_validation_explanation)), - _shards: z.optional(types_shard_statistics), - valid: z.boolean(), - error: z.optional(z.string()), + explanations: z.optional(z.array(indices_validate_query_indices_validation_explanation)), + _shards: z.optional(types_shard_statistics), + valid: z.boolean(), + error: z.optional(z.string()) }); export const indices_validate_query3_request = z.object({ - body: z.optional(indices_validate_query), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.', - }) - ), - all_shards: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the validation is executed on all shards instead of one random shard per index.', - }) - ), - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Analyzer to use for the query string.\nThis parameter can only be used when the `q` query string parameter is specified.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, wildcard and prefix queries are analyzed.', - }) - ), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'Field to use as default where no field prefix is given in the query string.\nThis parameter can only be used when the `q` query string parameter is specified.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response returns detailed information if an error has occurred.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.', - }) - ), - rewrite: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed.', - }) - ), - q: z.optional( - z.string().register(z.globalRegistry, { - description: 'Query in the Lucene query string syntax.', - }) - ), - }) - ), + body: z.optional(indices_validate_query), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.' + })), + all_shards: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the validation is executed on all shards instead of one random shard per index.' + })), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'Analyzer to use for the query string.\nThis parameter can only be used when the `q` query string parameter is specified.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard and prefix queries are analyzed.' + })), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'Field to use as default where no field prefix is given in the query string.\nThis parameter can only be used when the `q` query string parameter is specified.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response returns detailed information if an error has occurred.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.' + })), + rewrite: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed.' + })), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'Query in the Lucene query string syntax.' + })) + })) }); export const indices_validate_query3_response = z.object({ - explanations: z.optional(z.array(indices_validate_query_indices_validation_explanation)), - _shards: z.optional(types_shard_statistics), - valid: z.boolean(), - error: z.optional(z.string()), + explanations: z.optional(z.array(indices_validate_query_indices_validation_explanation)), + _shards: z.optional(types_shard_statistics), + valid: z.boolean(), + error: z.optional(z.string()) }); export const ingest_get_pipeline1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - summary: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Return pipelines without their definitions (default: false)', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + summary: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Return pipelines without their definitions' + })) + })) }); export const ingest_get_pipeline1_response = z.record(z.string(), ingest_types_pipeline); export const ingest_put_pipeline_request = z.object({ - body: z.object({ - _meta: z.optional(types_metadata), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'Description of the ingest pipeline.', - }) - ), - on_failure: z.optional( - z.array(ingest_types_processor_container).register(z.globalRegistry, { - description: - "Processors to run immediately after a processor failure. Each processor supports a processor-level `on_failure` value. If a processor without an `on_failure` value fails, Elasticsearch uses this pipeline-level parameter as a fallback. The processors in this parameter run sequentially in the order specified. Elasticsearch will not attempt to run the pipeline's remaining processors.", - }) - ), - processors: z.optional( - z.array(ingest_types_processor_container).register(z.globalRegistry, { - description: - 'Processors used to perform transformations on documents before indexing. Processors run sequentially in the order specified.', - }) - ), - version: z.optional(types_version_number), - deprecated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Marks this ingest pipeline as deprecated.\nWhen a deprecated ingest pipeline is referenced as the default or final pipeline when creating or updating a non-deprecated index template, Elasticsearch will emit a deprecation warning.', - }) - ), - field_access_pattern: z.optional(ingest_types_field_access_pattern), - }), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - if_version: z.optional( - z.number().register(z.globalRegistry, { - description: 'Required version for optimistic concurrency control for pipeline updates', - }) - ), - }) - ), + body: z.object({ + _meta: z.optional(types_metadata), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Description of the ingest pipeline.' + })), + on_failure: z.optional(z.array(ingest_types_processor_container).register(z.globalRegistry, { + description: 'Processors to run immediately after a processor failure. Each processor supports a processor-level `on_failure` value. If a processor without an `on_failure` value fails, Elasticsearch uses this pipeline-level parameter as a fallback. The processors in this parameter run sequentially in the order specified. Elasticsearch will not attempt to run the pipeline\'s remaining processors.' + })), + processors: z.optional(z.array(ingest_types_processor_container).register(z.globalRegistry, { + description: 'Processors used to perform transformations on documents before indexing. Processors run sequentially in the order specified.' + })), + version: z.optional(types_version_number), + deprecated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Marks this ingest pipeline as deprecated.\nWhen a deprecated ingest pipeline is referenced as the default or final pipeline when creating or updating a non-deprecated index template, Elasticsearch will emit a deprecation warning.' + })), + field_access_pattern: z.optional(ingest_types_field_access_pattern) + }), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration), + if_version: z.optional(z.number().register(z.globalRegistry, { + description: 'Required version for optimistic concurrency control for pipeline updates' + })) + })) }); export const ingest_put_pipeline_response = types_acknowledged_response_base; export const ingest_get_pipeline_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - summary: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Return pipelines without their definitions (default: false)', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + summary: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Return pipelines without their definitions' + })) + })) }); export const ingest_get_pipeline_response = z.record(z.string(), ingest_types_pipeline); export const ingest_simulate_request = z.object({ - body: ingest_simulate, - path: z.optional(z.never()), - query: z.optional( - z.object({ - verbose: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes output data for each processor in the executed pipeline.', - }) - ), - }) - ), + body: ingest_simulate, + path: z.optional(z.never()), + query: z.optional(z.object({ + verbose: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes output data for each processor in the executed pipeline.' + })) + })) }); export const ingest_simulate_response = z.object({ - docs: z.array(ingest_types_simulate_document_result), + docs: z.array(ingest_types_simulate_document_result) }); export const ingest_simulate1_request = z.object({ - body: ingest_simulate, - path: z.optional(z.never()), - query: z.optional( - z.object({ - verbose: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes output data for each processor in the executed pipeline.', - }) - ), - }) - ), + body: ingest_simulate, + path: z.optional(z.never()), + query: z.optional(z.object({ + verbose: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes output data for each processor in the executed pipeline.' + })) + })) }); export const ingest_simulate1_response = z.object({ - docs: z.array(ingest_types_simulate_document_result), + docs: z.array(ingest_types_simulate_document_result) }); export const ingest_simulate2_request = z.object({ - body: ingest_simulate, - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - verbose: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes output data for each processor in the executed pipeline.', - }) - ), - }) - ), + body: ingest_simulate, + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + verbose: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes output data for each processor in the executed pipeline.' + })) + })) }); export const ingest_simulate2_response = z.object({ - docs: z.array(ingest_types_simulate_document_result), + docs: z.array(ingest_types_simulate_document_result) }); export const ingest_simulate3_request = z.object({ - body: ingest_simulate, - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - verbose: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes output data for each processor in the executed pipeline.', - }) - ), - }) - ), + body: ingest_simulate, + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + verbose: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes output data for each processor in the executed pipeline.' + })) + })) }); export const ingest_simulate3_response = z.object({ - docs: z.array(ingest_types_simulate_document_result), + docs: z.array(ingest_types_simulate_document_result) }); export const ml_get_data_frame_analytics_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value returns an empty data_frame_analytics array when there\nare no matches and the subset of results when there are partial matches.\nIf this parameter is `false`, the request returns a 404 status code when\nthere are no matches or only partial matches.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of data frame analytics jobs.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of data frame analytics jobs to obtain.', - }) - ), - exclude_generated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value returns an empty data_frame_analytics array when there\nare no matches and the subset of results when there are partial matches.\nIf this parameter is `false`, the request returns a 404 status code when\nthere are no matches or only partial matches.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of data frame analytics jobs.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of data frame analytics jobs to obtain.' + })), + exclude_generated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.' + })) + })) }); export const ml_get_data_frame_analytics_response = z.object({ - count: z.number(), - data_frame_analytics: z.array(ml_types_dataframe_analytics_summary).register(z.globalRegistry, { - description: - 'An array of data frame analytics job resources, which are sorted by the id value in ascending order.', - }), + count: z.number(), + data_frame_analytics: z.array(ml_types_dataframe_analytics_summary).register(z.globalRegistry, { + description: 'An array of data frame analytics job resources, which are sorted by the id value in ascending order.' + }) }); export const ml_put_data_frame_analytics_request = z.object({ - body: z.object({ - allow_lazy_start: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether this job can start when there is insufficient machine\nlearning node capacity for it to be immediately assigned to a node. If\nset to `false` and a machine learning node with capacity to run the job\ncannot be immediately found, the API returns an error. If set to `true`,\nthe API does not return an error; the job waits in the `starting` state\nuntil sufficient machine learning node capacity is available. This\nbehavior is also affected by the cluster-wide\n`xpack.ml.max_lazy_ml_nodes` setting.', - }) - ), + body: z.object({ + allow_lazy_start: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether this job can start when there is insufficient machine\nlearning node capacity for it to be immediately assigned to a node. If\nset to `false` and a machine learning node with capacity to run the job\ncannot be immediately found, the API returns an error. If set to `true`,\nthe API does not return an error; the job waits in the `starting` state\nuntil sufficient machine learning node capacity is available. This\nbehavior is also affected by the cluster-wide\n`xpack.ml.max_lazy_ml_nodes` setting.' + })), + analysis: ml_types_dataframe_analysis_container, + analyzed_fields: z.optional(ml_types_dataframe_analysis_analyzed_fields), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the job.' + })), + dest: ml_types_dataframe_analytics_destination, + max_num_threads: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of threads to be used by the analysis. Using more\nthreads may decrease the time necessary to complete the analysis at the\ncost of using more CPU. Note that the process may use additional threads\nfor operational functionality other than the analysis itself.' + })), + _meta: z.optional(types_metadata), + model_memory_limit: z.optional(z.string().register(z.globalRegistry, { + description: 'The approximate maximum amount of memory resources that are permitted for\nanalytical processing. If your `elasticsearch.yml` file contains an\n`xpack.ml.max_model_memory_limit` setting, an error occurs when you try\nto create data frame analytics jobs that have `model_memory_limit` values\ngreater than that setting.' + })), + source: ml_types_dataframe_analytics_source, + headers: z.optional(types_http_headers), + version: z.optional(types_version_string) + }), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) +}); + +export const ml_put_data_frame_analytics_response = z.object({ + authorization: z.optional(ml_types_dataframe_analytics_authorization), + allow_lazy_start: z.boolean(), analysis: ml_types_dataframe_analysis_container, analyzed_fields: z.optional(ml_types_dataframe_analysis_analyzed_fields), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the job.', - }) - ), + create_time: types_epoch_time_unit_millis, + description: z.optional(z.string()), dest: ml_types_dataframe_analytics_destination, - max_num_threads: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of threads to be used by the analysis. Using more\nthreads may decrease the time necessary to complete the analysis at the\ncost of using more CPU. Note that the process may use additional threads\nfor operational functionality other than the analysis itself.', - }) - ), - _meta: z.optional(types_metadata), - model_memory_limit: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The approximate maximum amount of memory resources that are permitted for\nanalytical processing. If your `elasticsearch.yml` file contains an\n`xpack.ml.max_model_memory_limit` setting, an error occurs when you try\nto create data frame analytics jobs that have `model_memory_limit` values\ngreater than that setting.', - }) - ), - source: ml_types_dataframe_analytics_source, - headers: z.optional(types_http_headers), - version: z.optional(types_version_string), - }), - path: z.object({ id: types_id, - }), - query: z.optional(z.never()), -}); - -export const ml_put_data_frame_analytics_response = z.object({ - authorization: z.optional(ml_types_dataframe_analytics_authorization), - allow_lazy_start: z.boolean(), - analysis: ml_types_dataframe_analysis_container, - analyzed_fields: z.optional(ml_types_dataframe_analysis_analyzed_fields), - create_time: types_epoch_time_unit_millis, - description: z.optional(z.string()), - dest: ml_types_dataframe_analytics_destination, - id: types_id, - max_num_threads: z.number(), - _meta: z.optional(types_metadata), - model_memory_limit: z.string(), - source: ml_types_dataframe_analytics_source, - version: types_version_string, + max_num_threads: z.number(), + _meta: z.optional(types_metadata), + model_memory_limit: z.string(), + source: ml_types_dataframe_analytics_source, + version: types_version_string }); export const ml_get_datafeeds_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - datafeed_id: types_ids, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no datafeeds that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `datafeeds` array\nwhen there are no matches and the subset of results when there are\npartial matches. If this parameter is `false`, the request returns a\n`404` status code when there are no matches or only partial matches.', - }) - ), - exclude_generated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + datafeed_id: types_ids + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no datafeeds that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `datafeeds` array\nwhen there are no matches and the subset of results when there are\npartial matches. If this parameter is `false`, the request returns a\n`404` status code when there are no matches or only partial matches.' + })), + exclude_generated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.' + })) + })) }); export const ml_get_datafeeds_response = z.object({ - count: z.number(), - datafeeds: z.array(ml_types_datafeed), + count: z.number(), + datafeeds: z.array(ml_types_datafeed) }); export const ml_put_datafeed_request = z.object({ - body: z.object({ - aggregations: z.optional( - z.record(z.string(), types_aggregations_aggregation_container).register(z.globalRegistry, { - description: - 'If set, the datafeed performs aggregation searches.\nSupport for aggregations is limited and should be used only with low cardinality data.', - }) - ), - chunking_config: z.optional(ml_types_chunking_config), + body: z.object({ + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container).register(z.globalRegistry, { + description: 'If set, the datafeed performs aggregation searches.\nSupport for aggregations is limited and should be used only with low cardinality data.' + })), + chunking_config: z.optional(ml_types_chunking_config), + delayed_data_check_config: z.optional(ml_types_delayed_data_check_config), + frequency: z.optional(types_duration), + indices: z.optional(types_indices), + indices_options: z.optional(types_indices_options), + job_id: z.optional(types_id), + max_empty_searches: z.optional(z.number().register(z.globalRegistry, { + description: 'If a real-time datafeed has never seen any data (including during any initial training period), it automatically\nstops and closes the associated job after this many real-time searches return no documents. In other words,\nit stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no\nend time that sees no data remains started until it is explicitly stopped. By default, it is not set.' + })), + query: z.optional(types_query_dsl_query_container), + query_delay: z.optional(types_duration), + runtime_mappings: z.optional(types_mapping_runtime_fields), + script_fields: z.optional(z.record(z.string(), types_script_field).register(z.globalRegistry, { + description: 'Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.\nThe detector configuration objects in a job can contain functions that use these script fields.' + })), + scroll_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.\nThe maximum value is the value of `index.max_result_window`, which is 10,000 by default.' + })), + headers: z.optional(types_http_headers) + }), + path: z.object({ + datafeed_id: types_id + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the `_all`\nstring or when no indices are specified.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, concrete, expanded, or aliased indices are ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, unavailable indices (missing or closed) are ignored.' + })) + })) +}); + +export const ml_put_datafeed_response = z.object({ + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container)), + authorization: z.optional(ml_types_datafeed_authorization), + chunking_config: ml_types_chunking_config, delayed_data_check_config: z.optional(ml_types_delayed_data_check_config), + datafeed_id: types_id, frequency: z.optional(types_duration), - indices: z.optional(types_indices), + indices: z.array(z.string()), + job_id: types_id, indices_options: z.optional(types_indices_options), - job_id: z.optional(types_id), - max_empty_searches: z.optional( - z.number().register(z.globalRegistry, { - description: - 'If a real-time datafeed has never seen any data (including during any initial training period), it automatically\nstops and closes the associated job after this many real-time searches return no documents. In other words,\nit stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no\nend time that sees no data remains started until it is explicitly stopped. By default, it is not set.', - }) - ), - query: z.optional(types_query_dsl_query_container), - query_delay: z.optional(types_duration), + max_empty_searches: z.optional(z.number()), + query: types_query_dsl_query_container, + query_delay: types_duration, runtime_mappings: z.optional(types_mapping_runtime_fields), - script_fields: z.optional( - z.record(z.string(), types_script_field).register(z.globalRegistry, { - description: - 'Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.\nThe detector configuration objects in a job can contain functions that use these script fields.', - }) - ), - scroll_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.\nThe maximum value is the value of `index.max_result_window`, which is 10,000 by default.', - }) - ), - headers: z.optional(types_http_headers), - }), - path: z.object({ - datafeed_id: types_id, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the `_all`\nstring or when no indices are specified.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, concrete, expanded, or aliased indices are ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, unavailable indices (missing or closed) are ignored.', - }) - ), - }) - ), -}); - -export const ml_put_datafeed_response = z.object({ - aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container)), - authorization: z.optional(ml_types_datafeed_authorization), - chunking_config: ml_types_chunking_config, - delayed_data_check_config: z.optional(ml_types_delayed_data_check_config), - datafeed_id: types_id, - frequency: z.optional(types_duration), - indices: z.array(z.string()), - job_id: types_id, - indices_options: z.optional(types_indices_options), - max_empty_searches: z.optional(z.number()), - query: types_query_dsl_query_container, - query_delay: types_duration, - runtime_mappings: z.optional(types_mapping_runtime_fields), - script_fields: z.optional(z.record(z.string(), types_script_field)), - scroll_size: z.number(), + script_fields: z.optional(z.record(z.string(), types_script_field)), + scroll_size: z.number() }); export const ml_get_jobs_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - job_id: types_ids, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `jobs` array when\nthere are no matches and the subset of results when there are partial\nmatches. If this parameter is `false`, the request returns a `404` status\ncode when there are no matches or only partial matches.', - }) - ), - exclude_generated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + job_id: types_ids + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `jobs` array when\nthere are no matches and the subset of results when there are partial\nmatches. If this parameter is `false`, the request returns a `404` status\ncode when there are no matches or only partial matches.' + })), + exclude_generated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.' + })) + })) }); export const ml_get_jobs_response = z.object({ - count: z.number(), - jobs: z.array(ml_types_job), + count: z.number(), + jobs: z.array(ml_types_job) }); export const ml_put_job_request = z.object({ - body: z.object({ - allow_lazy_open: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node. By default, if a machine learning node with capacity to run the job cannot immediately be found, the open anomaly detection jobs API returns an error. However, this is also subject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this option is set to true, the open anomaly detection jobs API does not return an error and the job waits in the opening state until sufficient machine learning node capacity is available.', - }) - ), - analysis_config: ml_types_analysis_config, - analysis_limits: z.optional(ml_types_analysis_limits), + body: z.object({ + allow_lazy_open: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node. By default, if a machine learning node with capacity to run the job cannot immediately be found, the open anomaly detection jobs API returns an error. However, this is also subject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this option is set to true, the open anomaly detection jobs API does not return an error and the job waits in the opening state until sufficient machine learning node capacity is available.' + })), + analysis_config: ml_types_analysis_config, + analysis_limits: z.optional(ml_types_analysis_limits), + background_persist_interval: z.optional(types_duration), + custom_settings: z.optional(ml_types_custom_settings), + daily_model_snapshot_retention_after_days: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies a period of time (in days) after which only the first snapshot per day is retained. This period is relative to the timestamp of the most recent snapshot for this job. Valid values range from 0 to `model_snapshot_retention_days`.' + })), + data_description: ml_types_data_description, + datafeed_config: z.optional(ml_types_datafeed_config), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the job.' + })), + job_id: z.optional(types_id), + groups: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A list of job groups. A job can belong to no groups or many.' + })), + model_plot_config: z.optional(ml_types_model_plot_config), + model_snapshot_retention_days: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies the maximum period of time (in days) that snapshots are retained. This period is relative to the timestamp of the most recent snapshot for this job. By default, snapshots ten days older than the newest snapshot are deleted.' + })), + renormalization_window_days: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option. The period over which adjustments to the score are applied, as new data is seen. The default value is the longer of 30 days or 100 bucket spans.' + })), + results_index_name: z.optional(types_index_name), + results_retention_days: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option. The period of time (in days) that results are retained. Age is calculated relative to the timestamp of the latest bucket result. If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch. The default value is null, which means all results are retained. Annotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results. Annotations added by users are retained forever.' + })) + }), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the\n`_all` string or when no indices are specified.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, concrete, expanded or aliased indices are ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, unavailable indices (missing or closed) are ignored.' + })) + })) +}); + +export const ml_put_job_response = z.object({ + allow_lazy_open: z.boolean(), + analysis_config: ml_types_analysis_config_read, + analysis_limits: ml_types_analysis_limits, background_persist_interval: z.optional(types_duration), + create_time: types_date_time, custom_settings: z.optional(ml_types_custom_settings), - daily_model_snapshot_retention_after_days: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies a period of time (in days) after which only the first snapshot per day is retained. This period is relative to the timestamp of the most recent snapshot for this job. Valid values range from 0 to `model_snapshot_retention_days`.', - }) - ), + daily_model_snapshot_retention_after_days: z.number(), data_description: ml_types_data_description, - datafeed_config: z.optional(ml_types_datafeed_config), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the job.', - }) - ), - job_id: z.optional(types_id), - groups: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'A list of job groups. A job can belong to no groups or many.', - }) - ), - model_plot_config: z.optional(ml_types_model_plot_config), - model_snapshot_retention_days: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies the maximum period of time (in days) that snapshots are retained. This period is relative to the timestamp of the most recent snapshot for this job. By default, snapshots ten days older than the newest snapshot are deleted.', - }) - ), - renormalization_window_days: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option. The period over which adjustments to the score are applied, as new data is seen. The default value is the longer of 30 days or 100 bucket spans.', - }) - ), - results_index_name: z.optional(types_index_name), - results_retention_days: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option. The period of time (in days) that results are retained. Age is calculated relative to the timestamp of the latest bucket result. If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch. The default value is null, which means all results are retained. Annotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results. Annotations added by users are retained forever.', - }) - ), - }), - path: z.object({ + datafeed_config: z.optional(ml_types_datafeed), + description: z.optional(z.string()), + groups: z.optional(z.array(z.string())), job_id: types_id, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the\n`_all` string or when no indices are specified.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, concrete, expanded or aliased indices are ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, unavailable indices (missing or closed) are ignored.', - }) - ), - }) - ), -}); - -export const ml_put_job_response = z.object({ - allow_lazy_open: z.boolean(), - analysis_config: ml_types_analysis_config_read, - analysis_limits: ml_types_analysis_limits, - background_persist_interval: z.optional(types_duration), - create_time: types_date_time, - custom_settings: z.optional(ml_types_custom_settings), - daily_model_snapshot_retention_after_days: z.number(), - data_description: ml_types_data_description, - datafeed_config: z.optional(ml_types_datafeed), - description: z.optional(z.string()), - groups: z.optional(z.array(z.string())), - job_id: types_id, - job_type: z.string(), - job_version: z.string(), - model_plot_config: z.optional(ml_types_model_plot_config), - model_snapshot_id: z.optional(types_id), - model_snapshot_retention_days: z.number(), - renormalization_window_days: z.optional(z.number()), - results_index_name: z.string(), - results_retention_days: z.optional(z.number()), + job_type: z.string(), + job_version: z.string(), + model_plot_config: z.optional(ml_types_model_plot_config), + model_snapshot_id: z.optional(types_id), + model_snapshot_retention_days: z.number(), + renormalization_window_days: z.optional(z.number()), + results_index_name: z.string(), + results_retention_days: z.optional(z.number()) }); export const ml_get_trained_models_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - model_id: types_ids, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n- Contains wildcard expressions and there are no models that match.\n- Contains the _all string or no identifiers and there are no matches.\n- Contains wildcard expressions and there are only partial matches.\n\nIf true, it returns an empty array when there are no matches and the\nsubset of results when there are partial matches.', - }) - ), - decompress_definition: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether the included model definition should be returned as a\nJSON map (true) or in a custom compressed format (false).', - }) - ), - exclude_generated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of models.', - }) - ), - include: z.optional(ml_types_include), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of models to obtain.', - }) - ), - tags: z.optional(z.union([z.string(), z.array(z.string())])), - }) - ), + body: z.optional(z.never()), + path: z.object({ + model_id: types_ids + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n- Contains wildcard expressions and there are no models that match.\n- Contains the _all string or no identifiers and there are no matches.\n- Contains wildcard expressions and there are only partial matches.\n\nIf true, it returns an empty array when there are no matches and the\nsubset of results when there are partial matches.' + })), + decompress_definition: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether the included model definition should be returned as a\nJSON map (true) or in a custom compressed format (false).' + })), + exclude_generated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of models.' + })), + include: z.optional(ml_types_include), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of models to obtain.' + })), + tags: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])) + })) }); export const ml_get_trained_models_response = z.object({ - count: z.number(), - trained_model_configs: z.array(ml_types_trained_model_config).register(z.globalRegistry, { - description: - 'An array of trained model resources, which are sorted by the model_id value in ascending order.', - }), + count: z.number(), + trained_model_configs: z.array(ml_types_trained_model_config).register(z.globalRegistry, { + description: 'An array of trained model resources, which are sorted by the model_id value in ascending order.' + }) }); export const ml_put_trained_model_request = z.object({ - body: z.object({ - compressed_definition: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The compressed (GZipped and Base64 encoded) inference definition of the\nmodel. If compressed_definition is specified, then definition cannot be\nspecified.', - }) - ), - definition: z.optional(ml_put_trained_model_definition), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A human-readable description of the inference trained model.', - }) - ), - inference_config: z.optional(ml_types_inference_config_create_container), - input: z.optional(ml_put_trained_model_input), - metadata: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: 'An object map that contains metadata about the model.', - }) - ), - model_type: z.optional(ml_types_trained_model_type), - model_size_bytes: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The estimated memory usage in bytes to keep the trained model in memory.\nThis property is supported only if defer_definition_decompression is true\nor the model definition is not supplied.', - }) - ), - platform_architecture: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The platform architecture (if applicable) of the trained mode. If the model\nonly works on one platform, because it is heavily optimized for a particular\nprocessor architecture and OS combination, then this field specifies which.\nThe format of the string must match the platform identifiers used by Elasticsearch,\nso one of, `linux-x86_64`, `linux-aarch64`, `darwin-x86_64`, `darwin-aarch64`,\nor `windows-x86_64`. For portable models (those that work independent of processor\narchitecture or OS features), leave this field unset.', - }) - ), - tags: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'An array of tags to organize the model.', - }) - ), - prefix_strings: z.optional(ml_types_trained_model_prefix_strings), - }), - path: z.object({ - model_id: types_id, - }), - query: z.optional( - z.object({ - defer_definition_decompression: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If set to `true` and a `compressed_definition` is provided,\nthe request defers definition decompression and skips relevant\nvalidations.', - }) - ), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Whether to wait for all child operations (e.g. model download)\nto complete.', - }) - ), - }) - ), + body: z.object({ + compressed_definition: z.optional(z.string().register(z.globalRegistry, { + description: 'The compressed (GZipped and Base64 encoded) inference definition of the\nmodel. If compressed_definition is specified, then definition cannot be\nspecified.' + })), + definition: z.optional(ml_put_trained_model_definition), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A human-readable description of the inference trained model.' + })), + inference_config: z.optional(ml_types_inference_config_create_container), + input: z.optional(ml_put_trained_model_input), + metadata: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'An object map that contains metadata about the model.' + })), + model_type: z.optional(ml_types_trained_model_type), + model_size_bytes: z.optional(z.number().register(z.globalRegistry, { + description: 'The estimated memory usage in bytes to keep the trained model in memory.\nThis property is supported only if defer_definition_decompression is true\nor the model definition is not supplied.' + })), + platform_architecture: z.optional(z.string().register(z.globalRegistry, { + description: 'The platform architecture (if applicable) of the trained mode. If the model\nonly works on one platform, because it is heavily optimized for a particular\nprocessor architecture and OS combination, then this field specifies which.\nThe format of the string must match the platform identifiers used by Elasticsearch,\nso one of, `linux-x86_64`, `linux-aarch64`, `darwin-x86_64`, `darwin-aarch64`,\nor `windows-x86_64`. For portable models (those that work independent of processor\narchitecture or OS features), leave this field unset.' + })), + tags: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'An array of tags to organize the model.' + })), + prefix_strings: z.optional(ml_types_trained_model_prefix_strings) + }), + path: z.object({ + model_id: types_id + }), + query: z.optional(z.object({ + defer_definition_decompression: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If set to `true` and a `compressed_definition` is provided,\nthe request defers definition decompression and skips relevant\nvalidations.' + })), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether to wait for all child operations (e.g. model download)\nto complete.' + })) + })) }); export const ml_put_trained_model_response = ml_types_trained_model_config; export const ml_estimate_model_memory_request = z.object({ - body: z.object({ - analysis_config: z.optional(ml_types_analysis_config), - max_bucket_cardinality: z.optional( - z.record(z.string(), z.number()).register(z.globalRegistry, { - description: - 'Estimates of the highest cardinality in a single bucket that is observed\nfor influencer fields over the time period that the job analyzes data.\nTo produce a good answer, values must be provided for all influencer\nfields. Providing values for fields that are not listed as `influencers`\nhas no effect on the estimation.', - }) - ), - overall_cardinality: z.optional( - z.record(z.string(), z.number()).register(z.globalRegistry, { - description: - 'Estimates of the cardinality that is observed for fields over the whole\ntime period that the job analyzes data. To produce a good answer, values\nmust be provided for fields referenced in the `by_field_name`,\n`over_field_name` and `partition_field_name` of any detectors. Providing\nvalues for other fields has no effect on the estimation. It can be\nomitted from the request if no detectors have a `by_field_name`,\n`over_field_name` or `partition_field_name`.', - }) - ), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.object({ + analysis_config: z.optional(ml_types_analysis_config), + max_bucket_cardinality: z.optional(z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'Estimates of the highest cardinality in a single bucket that is observed\nfor influencer fields over the time period that the job analyzes data.\nTo produce a good answer, values must be provided for all influencer\nfields. Providing values for fields that are not listed as `influencers`\nhas no effect on the estimation.' + })), + overall_cardinality: z.optional(z.record(z.string(), z.number()).register(z.globalRegistry, { + description: 'Estimates of the cardinality that is observed for fields over the whole\ntime period that the job analyzes data. To produce a good answer, values\nmust be provided for fields referenced in the `by_field_name`,\n`over_field_name` and `partition_field_name` of any detectors. Providing\nvalues for other fields has no effect on the estimation. It can be\nomitted from the request if no detectors have a `by_field_name`,\n`over_field_name` or `partition_field_name`.' + })) + }), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const ml_estimate_model_memory_response = z.object({ - model_memory_estimate: z.string(), + model_memory_estimate: z.string() }); export const ml_evaluate_data_frame_request = z.object({ - body: z.object({ - evaluation: ml_types_dataframe_evaluation_container, - index: types_index_name, - query: z.optional(types_query_dsl_query_container), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.object({ + evaluation: ml_types_dataframe_evaluation_container, + index: types_index_name, + query: z.optional(types_query_dsl_query_container) + }), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const ml_evaluate_data_frame_response = z.object({ - classification: z.optional(ml_evaluate_data_frame_dataframe_classification_summary), - outlier_detection: z.optional(ml_evaluate_data_frame_dataframe_outlier_detection_summary), - regression: z.optional(ml_evaluate_data_frame_dataframe_regression_summary), + classification: z.optional(ml_evaluate_data_frame_dataframe_classification_summary), + outlier_detection: z.optional(ml_evaluate_data_frame_dataframe_outlier_detection_summary), + regression: z.optional(ml_evaluate_data_frame_dataframe_regression_summary) }); export const ml_explain_data_frame_analytics_request = z.object({ - body: z.optional(ml_explain_data_frame_analytics), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(ml_explain_data_frame_analytics), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const ml_explain_data_frame_analytics_response = z.object({ - field_selection: z - .array(ml_types_dataframe_analytics_field_selection) - .register(z.globalRegistry, { - description: - 'An array of objects that explain selection for each field, sorted by the field names.', + field_selection: z.array(ml_types_dataframe_analytics_field_selection).register(z.globalRegistry, { + description: 'An array of objects that explain selection for each field, sorted by the field names.' }), - memory_estimation: ml_types_dataframe_analytics_memory_estimation, + memory_estimation: ml_types_dataframe_analytics_memory_estimation }); export const ml_explain_data_frame_analytics1_request = z.object({ - body: z.optional(ml_explain_data_frame_analytics), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(ml_explain_data_frame_analytics), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const ml_explain_data_frame_analytics1_response = z.object({ - field_selection: z - .array(ml_types_dataframe_analytics_field_selection) - .register(z.globalRegistry, { - description: - 'An array of objects that explain selection for each field, sorted by the field names.', + field_selection: z.array(ml_types_dataframe_analytics_field_selection).register(z.globalRegistry, { + description: 'An array of objects that explain selection for each field, sorted by the field names.' }), - memory_estimation: ml_types_dataframe_analytics_memory_estimation, + memory_estimation: ml_types_dataframe_analytics_memory_estimation }); export const ml_explain_data_frame_analytics2_request = z.object({ - body: z.optional(ml_explain_data_frame_analytics), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(ml_explain_data_frame_analytics), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const ml_explain_data_frame_analytics2_response = z.object({ - field_selection: z - .array(ml_types_dataframe_analytics_field_selection) - .register(z.globalRegistry, { - description: - 'An array of objects that explain selection for each field, sorted by the field names.', + field_selection: z.array(ml_types_dataframe_analytics_field_selection).register(z.globalRegistry, { + description: 'An array of objects that explain selection for each field, sorted by the field names.' }), - memory_estimation: ml_types_dataframe_analytics_memory_estimation, + memory_estimation: ml_types_dataframe_analytics_memory_estimation }); export const ml_explain_data_frame_analytics3_request = z.object({ - body: z.optional(ml_explain_data_frame_analytics), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(ml_explain_data_frame_analytics), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const ml_explain_data_frame_analytics3_response = z.object({ - field_selection: z - .array(ml_types_dataframe_analytics_field_selection) - .register(z.globalRegistry, { - description: - 'An array of objects that explain selection for each field, sorted by the field names.', + field_selection: z.array(ml_types_dataframe_analytics_field_selection).register(z.globalRegistry, { + description: 'An array of objects that explain selection for each field, sorted by the field names.' }), - memory_estimation: ml_types_dataframe_analytics_memory_estimation, + memory_estimation: ml_types_dataframe_analytics_memory_estimation }); export const ml_get_data_frame_analytics1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value returns an empty data_frame_analytics array when there\nare no matches and the subset of results when there are partial matches.\nIf this parameter is `false`, the request returns a 404 status code when\nthere are no matches or only partial matches.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of data frame analytics jobs.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of data frame analytics jobs to obtain.', - }) - ), - exclude_generated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no data frame analytics\njobs that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value returns an empty data_frame_analytics array when there\nare no matches and the subset of results when there are partial matches.\nIf this parameter is `false`, the request returns a 404 status code when\nthere are no matches or only partial matches.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of data frame analytics jobs.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of data frame analytics jobs to obtain.' + })), + exclude_generated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.' + })) + })) }); export const ml_get_data_frame_analytics1_response = z.object({ - count: z.number(), - data_frame_analytics: z.array(ml_types_dataframe_analytics_summary).register(z.globalRegistry, { - description: - 'An array of data frame analytics job resources, which are sorted by the id value in ascending order.', - }), + count: z.number(), + data_frame_analytics: z.array(ml_types_dataframe_analytics_summary).register(z.globalRegistry, { + description: 'An array of data frame analytics job resources, which are sorted by the id value in ascending order.' + }) }); export const ml_get_datafeeds1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no datafeeds that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `datafeeds` array\nwhen there are no matches and the subset of results when there are\npartial matches. If this parameter is `false`, the request returns a\n`404` status code when there are no matches or only partial matches.', - }) - ), - exclude_generated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no datafeeds that match.\n2. Contains the `_all` string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `datafeeds` array\nwhen there are no matches and the subset of results when there are\npartial matches. If this parameter is `false`, the request returns a\n`404` status code when there are no matches or only partial matches.' + })), + exclude_generated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.' + })) + })) }); export const ml_get_datafeeds1_response = z.object({ - count: z.number(), - datafeeds: z.array(ml_types_datafeed), + count: z.number(), + datafeeds: z.array(ml_types_datafeed) }); export const ml_get_jobs1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `jobs` array when\nthere are no matches and the subset of results when there are partial\nmatches. If this parameter is `false`, the request returns a `404` status\ncode when there are no matches or only partial matches.', - }) - ), - exclude_generated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no jobs that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nThe default value is `true`, which returns an empty `jobs` array when\nthere are no matches and the subset of results when there are partial\nmatches. If this parameter is `false`, the request returns a `404` status\ncode when there are no matches or only partial matches.' + })), + exclude_generated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.' + })) + })) }); export const ml_get_jobs1_response = z.object({ - count: z.number(), - jobs: z.array(ml_types_job), + count: z.number(), + jobs: z.array(ml_types_job) }); export const ml_get_trained_models1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n- Contains wildcard expressions and there are no models that match.\n- Contains the _all string or no identifiers and there are no matches.\n- Contains wildcard expressions and there are only partial matches.\n\nIf true, it returns an empty array when there are no matches and the\nsubset of results when there are partial matches.', - }) - ), - decompress_definition: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether the included model definition should be returned as a\nJSON map (true) or in a custom compressed format (false).', - }) - ), - exclude_generated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of models.', - }) - ), - include: z.optional(ml_types_include), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of models to obtain.', - }) - ), - tags: z.optional(z.union([z.string(), z.array(z.string())])), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n- Contains wildcard expressions and there are no models that match.\n- Contains the _all string or no identifiers and there are no matches.\n- Contains wildcard expressions and there are only partial matches.\n\nIf true, it returns an empty array when there are no matches and the\nsubset of results when there are partial matches.' + })), + decompress_definition: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether the included model definition should be returned as a\nJSON map (true) or in a custom compressed format (false).' + })), + exclude_generated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates if certain fields should be removed from the configuration on\nretrieval. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of models.' + })), + include: z.optional(ml_types_include), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of models to obtain.' + })), + tags: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])) + })) }); export const ml_get_trained_models1_response = z.object({ - count: z.number(), - trained_model_configs: z.array(ml_types_trained_model_config).register(z.globalRegistry, { - description: - 'An array of trained model resources, which are sorted by the model_id value in ascending order.', - }), + count: z.number(), + trained_model_configs: z.array(ml_types_trained_model_config).register(z.globalRegistry, { + description: 'An array of trained model resources, which are sorted by the model_id value in ascending order.' + }) }); export const ml_info_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const ml_info_response = z.object({ - defaults: ml_info_defaults, - limits: ml_info_limits, - upgrade_mode: z.boolean(), - native_code: ml_info_native_code, + defaults: ml_info_defaults, + limits: ml_info_limits, + upgrade_mode: z.boolean(), + native_code: ml_info_native_code }); export const ml_preview_data_frame_analytics_request = z.object({ - body: z.optional(ml_preview_data_frame_analytics), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(ml_preview_data_frame_analytics), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const ml_preview_data_frame_analytics_response = z.object({ - feature_values: z.array(z.record(z.string(), z.string())).register(z.globalRegistry, { - description: - 'An array of objects that contain feature name and value pairs. The features have been processed and indicate what will be sent to the model for training.', - }), + feature_values: z.array(z.record(z.string(), z.string())).register(z.globalRegistry, { + description: 'An array of objects that contain feature name and value pairs. The features have been processed and indicate what will be sent to the model for training.' + }) }); export const ml_preview_data_frame_analytics1_request = z.object({ - body: z.optional(ml_preview_data_frame_analytics), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(ml_preview_data_frame_analytics), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const ml_preview_data_frame_analytics1_response = z.object({ - feature_values: z.array(z.record(z.string(), z.string())).register(z.globalRegistry, { - description: - 'An array of objects that contain feature name and value pairs. The features have been processed and indicate what will be sent to the model for training.', - }), + feature_values: z.array(z.record(z.string(), z.string())).register(z.globalRegistry, { + description: 'An array of objects that contain feature name and value pairs. The features have been processed and indicate what will be sent to the model for training.' + }) }); export const ml_preview_data_frame_analytics2_request = z.object({ - body: z.optional(ml_preview_data_frame_analytics), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(ml_preview_data_frame_analytics), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const ml_preview_data_frame_analytics2_response = z.object({ - feature_values: z.array(z.record(z.string(), z.string())).register(z.globalRegistry, { - description: - 'An array of objects that contain feature name and value pairs. The features have been processed and indicate what will be sent to the model for training.', - }), + feature_values: z.array(z.record(z.string(), z.string())).register(z.globalRegistry, { + description: 'An array of objects that contain feature name and value pairs. The features have been processed and indicate what will be sent to the model for training.' + }) }); export const ml_preview_data_frame_analytics3_request = z.object({ - body: z.optional(ml_preview_data_frame_analytics), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(ml_preview_data_frame_analytics), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const ml_preview_data_frame_analytics3_response = z.object({ - feature_values: z.array(z.record(z.string(), z.string())).register(z.globalRegistry, { - description: - 'An array of objects that contain feature name and value pairs. The features have been processed and indicate what will be sent to the model for training.', - }), + feature_values: z.array(z.record(z.string(), z.string())).register(z.globalRegistry, { + description: 'An array of objects that contain feature name and value pairs. The features have been processed and indicate what will be sent to the model for training.' + }) }); export const ml_preview_datafeed_request = z.object({ - body: z.optional(ml_preview_datafeed), - path: z.object({ - datafeed_id: types_id, - }), - query: z.optional( - z.object({ - start: z.optional(types_date_time), - end: z.optional(types_date_time), - }) - ), + body: z.optional(ml_preview_datafeed), + path: z.object({ + datafeed_id: types_id + }), + query: z.optional(z.object({ + start: z.optional(types_date_time), + end: z.optional(types_date_time) + })) }); export const ml_preview_datafeed_response = z.array(z.record(z.string(), z.unknown())); export const ml_preview_datafeed1_request = z.object({ - body: z.optional(ml_preview_datafeed), - path: z.object({ - datafeed_id: types_id, - }), - query: z.optional( - z.object({ - start: z.optional(types_date_time), - end: z.optional(types_date_time), - }) - ), + body: z.optional(ml_preview_datafeed), + path: z.object({ + datafeed_id: types_id + }), + query: z.optional(z.object({ + start: z.optional(types_date_time), + end: z.optional(types_date_time) + })) }); export const ml_preview_datafeed1_response = z.array(z.record(z.string(), z.unknown())); export const ml_preview_datafeed2_request = z.object({ - body: z.optional(ml_preview_datafeed), - path: z.optional(z.never()), - query: z.optional( - z.object({ - start: z.optional(types_date_time), - end: z.optional(types_date_time), - }) - ), + body: z.optional(ml_preview_datafeed), + path: z.optional(z.never()), + query: z.optional(z.object({ + start: z.optional(types_date_time), + end: z.optional(types_date_time) + })) }); export const ml_preview_datafeed2_response = z.array(z.record(z.string(), z.unknown())); export const ml_preview_datafeed3_request = z.object({ - body: z.optional(ml_preview_datafeed), - path: z.optional(z.never()), - query: z.optional( - z.object({ - start: z.optional(types_date_time), - end: z.optional(types_date_time), - }) - ), + body: z.optional(ml_preview_datafeed), + path: z.optional(z.never()), + query: z.optional(z.object({ + start: z.optional(types_date_time), + end: z.optional(types_date_time) + })) }); export const ml_preview_datafeed3_response = z.array(z.record(z.string(), z.unknown())); export const ml_update_data_frame_analytics_request = z.object({ - body: z.object({ - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the job.', - }) - ), - model_memory_limit: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The approximate maximum amount of memory resources that are permitted for\nanalytical processing. If your `elasticsearch.yml` file contains an\n`xpack.ml.max_model_memory_limit` setting, an error occurs when you try\nto create data frame analytics jobs that have `model_memory_limit` values\ngreater than that setting.', - }) - ), - max_num_threads: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of threads to be used by the analysis. Using more\nthreads may decrease the time necessary to complete the analysis at the\ncost of using more CPU. Note that the process may use additional threads\nfor operational functionality other than the analysis itself.', - }) - ), - allow_lazy_start: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether this job can start when there is insufficient machine\nlearning node capacity for it to be immediately assigned to a node.', - }) - ), - }), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the job.' + })), + model_memory_limit: z.optional(z.string().register(z.globalRegistry, { + description: 'The approximate maximum amount of memory resources that are permitted for\nanalytical processing. If your `elasticsearch.yml` file contains an\n`xpack.ml.max_model_memory_limit` setting, an error occurs when you try\nto create data frame analytics jobs that have `model_memory_limit` values\ngreater than that setting.' + })), + max_num_threads: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of threads to be used by the analysis. Using more\nthreads may decrease the time necessary to complete the analysis at the\ncost of using more CPU. Note that the process may use additional threads\nfor operational functionality other than the analysis itself.' + })), + allow_lazy_start: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether this job can start when there is insufficient machine\nlearning node capacity for it to be immediately assigned to a node.' + })) + }), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const ml_update_data_frame_analytics_response = z.object({ - authorization: z.optional(ml_types_dataframe_analytics_authorization), - allow_lazy_start: z.boolean(), - analysis: ml_types_dataframe_analysis_container, - analyzed_fields: z.optional(ml_types_dataframe_analysis_analyzed_fields), - create_time: z.number(), - description: z.optional(z.string()), - dest: ml_types_dataframe_analytics_destination, - id: types_id, - max_num_threads: z.number(), - model_memory_limit: z.string(), - source: ml_types_dataframe_analytics_source, - version: types_version_string, + authorization: z.optional(ml_types_dataframe_analytics_authorization), + allow_lazy_start: z.boolean(), + analysis: ml_types_dataframe_analysis_container, + analyzed_fields: z.optional(ml_types_dataframe_analysis_analyzed_fields), + create_time: z.number(), + description: z.optional(z.string()), + dest: ml_types_dataframe_analytics_destination, + id: types_id, + max_num_threads: z.number(), + model_memory_limit: z.string(), + source: ml_types_dataframe_analytics_source, + version: types_version_string }); export const ml_update_datafeed_request = z.object({ - body: z.object({ - aggregations: z.optional( - z.record(z.string(), types_aggregations_aggregation_container).register(z.globalRegistry, { - description: - 'If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only\nwith low cardinality data.', - }) - ), - chunking_config: z.optional(ml_types_chunking_config), + body: z.object({ + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container).register(z.globalRegistry, { + description: 'If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only\nwith low cardinality data.' + })), + chunking_config: z.optional(ml_types_chunking_config), + delayed_data_check_config: z.optional(ml_types_delayed_data_check_config), + frequency: z.optional(types_duration), + indices: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine\nlearning nodes must have the `remote_cluster_client` role.' + })), + indices_options: z.optional(types_indices_options), + job_id: z.optional(types_id), + max_empty_searches: z.optional(z.number().register(z.globalRegistry, { + description: 'If a real-time datafeed has never seen any data (including during any initial training period), it automatically\nstops and closes the associated job after this many real-time searches return no documents. In other words,\nit stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no\nend time that sees no data remains started until it is explicitly stopped. By default, it is not set.' + })), + query: z.optional(types_query_dsl_query_container), + query_delay: z.optional(types_duration), + runtime_mappings: z.optional(types_mapping_runtime_fields), + script_fields: z.optional(z.record(z.string(), types_script_field).register(z.globalRegistry, { + description: 'Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.\nThe detector configuration objects in a job can contain functions that use these script fields.' + })), + scroll_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.\nThe maximum value is the value of `index.max_result_window`.' + })) + }), + path: z.object({ + datafeed_id: types_id + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the\n`_all` string or when no indices are specified.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, concrete, expanded or aliased indices are ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, unavailable indices (missing or closed) are ignored.' + })) + })) +}); + +export const ml_update_datafeed_response = z.object({ + authorization: z.optional(ml_types_datafeed_authorization), + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container)), + chunking_config: ml_types_chunking_config, delayed_data_check_config: z.optional(ml_types_delayed_data_check_config), + datafeed_id: types_id, frequency: z.optional(types_duration), - indices: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine\nlearning nodes must have the `remote_cluster_client` role.', - }) - ), + indices: z.array(z.string()), indices_options: z.optional(types_indices_options), - job_id: z.optional(types_id), - max_empty_searches: z.optional( - z.number().register(z.globalRegistry, { - description: - 'If a real-time datafeed has never seen any data (including during any initial training period), it automatically\nstops and closes the associated job after this many real-time searches return no documents. In other words,\nit stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no\nend time that sees no data remains started until it is explicitly stopped. By default, it is not set.', - }) - ), - query: z.optional(types_query_dsl_query_container), - query_delay: z.optional(types_duration), + job_id: types_id, + max_empty_searches: z.optional(z.number()), + query: types_query_dsl_query_container, + query_delay: types_duration, runtime_mappings: z.optional(types_mapping_runtime_fields), - script_fields: z.optional( - z.record(z.string(), types_script_field).register(z.globalRegistry, { - description: - 'Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.\nThe detector configuration objects in a job can contain functions that use these script fields.', - }) - ), - scroll_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.\nThe maximum value is the value of `index.max_result_window`.', - }) - ), - }), - path: z.object({ - datafeed_id: types_id, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the\n`_all` string or when no indices are specified.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, concrete, expanded or aliased indices are ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, unavailable indices (missing or closed) are ignored.', - }) - ), - }) - ), -}); - -export const ml_update_datafeed_response = z.object({ - authorization: z.optional(ml_types_datafeed_authorization), - aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container)), - chunking_config: ml_types_chunking_config, - delayed_data_check_config: z.optional(ml_types_delayed_data_check_config), - datafeed_id: types_id, - frequency: z.optional(types_duration), - indices: z.array(z.string()), - indices_options: z.optional(types_indices_options), - job_id: types_id, - max_empty_searches: z.optional(z.number()), - query: types_query_dsl_query_container, - query_delay: types_duration, - runtime_mappings: z.optional(types_mapping_runtime_fields), - script_fields: z.optional(z.record(z.string(), types_script_field)), - scroll_size: z.number(), + script_fields: z.optional(z.record(z.string(), types_script_field)), + scroll_size: z.number() }); export const ml_update_job_request = z.object({ - body: z.object({ - allow_lazy_open: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Advanced configuration option. Specifies whether this job can open when\nthere is insufficient machine learning node capacity for it to be\nimmediately assigned to a node. If `false` and a machine learning node\nwith capacity to run the job cannot immediately be found, the open\nanomaly detection jobs API returns an error. However, this is also\nsubject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this\noption is set to `true`, the open anomaly detection jobs API does not\nreturn an error and the job waits in the opening state until sufficient\nmachine learning node capacity is available.', - }) - ), - analysis_limits: z.optional(ml_types_analysis_memory_limit), - background_persist_interval: z.optional(types_duration), - custom_settings: z.optional( - z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { - description: - 'Advanced configuration option. Contains custom meta data about the job.\nFor example, it can contain custom URL information as shown in Adding\ncustom URLs to machine learning results.', - }) - ), - categorization_filters: z.optional(z.array(z.string())), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'A description of the job.', - }) - ), - model_plot_config: z.optional(ml_types_model_plot_config), - model_prune_window: z.optional(types_duration), - daily_model_snapshot_retention_after_days: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option, which affects the automatic removal of old\nmodel snapshots for this job. It specifies a period of time (in days)\nafter which only the first snapshot per day is retained. This period is\nrelative to the timestamp of the most recent snapshot for this job. Valid\nvalues range from 0 to `model_snapshot_retention_days`. For jobs created\nbefore version 7.8.0, the default value matches\n`model_snapshot_retention_days`.', - }) - ), - model_snapshot_retention_days: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option, which affects the automatic removal of old\nmodel snapshots for this job. It specifies the maximum period of time (in\ndays) that snapshots are retained. This period is relative to the\ntimestamp of the most recent snapshot for this job.', - }) - ), - renormalization_window_days: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option. The period over which adjustments to the\nscore are applied, as new data is seen.', - }) - ), - results_retention_days: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Advanced configuration option. The period of time (in days) that results\nare retained. Age is calculated relative to the timestamp of the latest\nbucket result. If this property has a non-null value, once per day at\n00:30 (server time), results that are the specified number of days older\nthan the latest bucket result are deleted from Elasticsearch. The default\nvalue is null, which means all results are retained.', - }) - ), - groups: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'A list of job groups. A job can belong to no groups or many.', - }) - ), - detectors: z.optional( - z.array(ml_types_detector_update).register(z.globalRegistry, { - description: 'An array of detector update objects.', - }) - ), - per_partition_categorization: z.optional(ml_types_per_partition_categorization), - }), - path: z.object({ - job_id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + allow_lazy_open: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Advanced configuration option. Specifies whether this job can open when\nthere is insufficient machine learning node capacity for it to be\nimmediately assigned to a node. If `false` and a machine learning node\nwith capacity to run the job cannot immediately be found, the open\nanomaly detection jobs API returns an error. However, this is also\nsubject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this\noption is set to `true`, the open anomaly detection jobs API does not\nreturn an error and the job waits in the opening state until sufficient\nmachine learning node capacity is available.' + })), + analysis_limits: z.optional(ml_types_analysis_memory_limit), + background_persist_interval: z.optional(types_duration), + custom_settings: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Advanced configuration option. Contains custom meta data about the job.\nFor example, it can contain custom URL information as shown in Adding\ncustom URLs to machine learning results.' + })), + categorization_filters: z.optional(z.array(z.string())), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'A description of the job.' + })), + model_plot_config: z.optional(ml_types_model_plot_config), + model_prune_window: z.optional(types_duration), + daily_model_snapshot_retention_after_days: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option, which affects the automatic removal of old\nmodel snapshots for this job. It specifies a period of time (in days)\nafter which only the first snapshot per day is retained. This period is\nrelative to the timestamp of the most recent snapshot for this job. Valid\nvalues range from 0 to `model_snapshot_retention_days`. For jobs created\nbefore version 7.8.0, the default value matches\n`model_snapshot_retention_days`.' + })), + model_snapshot_retention_days: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option, which affects the automatic removal of old\nmodel snapshots for this job. It specifies the maximum period of time (in\ndays) that snapshots are retained. This period is relative to the\ntimestamp of the most recent snapshot for this job.' + })), + renormalization_window_days: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option. The period over which adjustments to the\nscore are applied, as new data is seen.' + })), + results_retention_days: z.optional(z.number().register(z.globalRegistry, { + description: 'Advanced configuration option. The period of time (in days) that results\nare retained. Age is calculated relative to the timestamp of the latest\nbucket result. If this property has a non-null value, once per day at\n00:30 (server time), results that are the specified number of days older\nthan the latest bucket result are deleted from Elasticsearch. The default\nvalue is null, which means all results are retained.' + })), + groups: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A list of job groups. A job can belong to no groups or many.' + })), + detectors: z.optional(z.array(ml_types_detector_update).register(z.globalRegistry, { + description: 'An array of detector update objects.' + })), + per_partition_categorization: z.optional(ml_types_per_partition_categorization) + }), + path: z.object({ + job_id: types_id + }), + query: z.optional(z.never()) }); export const ml_update_job_response = z.object({ - allow_lazy_open: z.boolean(), - analysis_config: ml_types_analysis_config_read, - analysis_limits: ml_types_analysis_limits, - background_persist_interval: z.optional(types_duration), - create_time: types_epoch_time_unit_millis, - finished_time: z.optional(types_epoch_time_unit_millis), - custom_settings: z.optional(z.record(z.string(), z.string())), - daily_model_snapshot_retention_after_days: z.number(), - data_description: ml_types_data_description, - datafeed_config: z.optional(ml_types_datafeed), - description: z.optional(z.string()), - groups: z.optional(z.array(z.string())), - job_id: types_id, - job_type: z.string(), - job_version: types_version_string, - model_plot_config: z.optional(ml_types_model_plot_config), - model_snapshot_id: z.optional(types_id), - model_snapshot_retention_days: z.number(), - renormalization_window_days: z.optional(z.number()), - results_index_name: types_index_name, - results_retention_days: z.optional(z.number()), + allow_lazy_open: z.boolean(), + analysis_config: ml_types_analysis_config_read, + analysis_limits: ml_types_analysis_limits, + background_persist_interval: z.optional(types_duration), + create_time: types_epoch_time_unit_millis, + finished_time: z.optional(types_epoch_time_unit_millis), + custom_settings: z.optional(z.record(z.string(), z.string())), + daily_model_snapshot_retention_after_days: z.number(), + data_description: ml_types_data_description, + datafeed_config: z.optional(ml_types_datafeed), + description: z.optional(z.string()), + groups: z.optional(z.array(z.string())), + job_id: types_id, + job_type: z.string(), + job_version: types_version_string, + model_plot_config: z.optional(ml_types_model_plot_config), + model_snapshot_id: z.optional(types_id), + model_snapshot_retention_days: z.number(), + renormalization_window_days: z.optional(z.number()), + results_index_name: types_index_name, + results_retention_days: z.optional(z.number()) }); export const msearch_request = z.object({ - body: msearch, - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, concrete, expanded or aliased indices are ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', - }) - ), - include_named_queries_score: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.', - }) - ), - index: z.optional(types_indices), - max_concurrent_searches: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of concurrent searches the multi search API can execute.\nDefaults to `max(1, (# of data nodes * min(search thread pool size, 10)))`.', - }) - ), - max_concurrent_shard_requests: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of concurrent shard requests that each sub-search request executes per node.', - }) - ), - pre_filter_shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.', - }) - ), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.', - }) - ), - routing: z.optional(types_routing), - search_type: z.optional(types_search_type), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.', - }) - ), - }) - ), + body: msearch, + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, concrete, expanded or aliased indices are ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, missing or closed indices are not included in the response.' + })), + include_named_queries_score: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.' + })), + index: z.optional(types_indices), + max_concurrent_searches: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrent searches the multi search API can execute.\nDefaults to `max(1, (# of data nodes * min(search thread pool size, 10)))`.' + })), + max_concurrent_shard_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrent shard requests that each sub-search request executes per node.' + })), + pre_filter_shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.' + })), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.' + })), + routing: z.optional(types_routing), + search_type: z.optional(types_search_type), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.' + })) + })) }); export const msearch_response = global_msearch_multi_search_result; export const msearch1_request = z.object({ - body: msearch, - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, concrete, expanded or aliased indices are ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', - }) - ), - include_named_queries_score: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.', - }) - ), - index: z.optional(types_indices), - max_concurrent_searches: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of concurrent searches the multi search API can execute.\nDefaults to `max(1, (# of data nodes * min(search thread pool size, 10)))`.', - }) - ), - max_concurrent_shard_requests: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of concurrent shard requests that each sub-search request executes per node.', - }) - ), - pre_filter_shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.', - }) - ), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.', - }) - ), - routing: z.optional(types_routing), - search_type: z.optional(types_search_type), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.', - }) - ), - }) - ), + body: msearch, + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, concrete, expanded or aliased indices are ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, missing or closed indices are not included in the response.' + })), + include_named_queries_score: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.' + })), + index: z.optional(types_indices), + max_concurrent_searches: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrent searches the multi search API can execute.\nDefaults to `max(1, (# of data nodes * min(search thread pool size, 10)))`.' + })), + max_concurrent_shard_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrent shard requests that each sub-search request executes per node.' + })), + pre_filter_shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.' + })), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.' + })), + routing: z.optional(types_routing), + search_type: z.optional(types_search_type), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.' + })) + })) }); export const msearch1_response = global_msearch_multi_search_result; export const msearch2_request = z.object({ - body: msearch, - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, concrete, expanded or aliased indices are ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', - }) - ), - include_named_queries_score: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.', - }) - ), - index: z.optional(types_indices), - max_concurrent_searches: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of concurrent searches the multi search API can execute.\nDefaults to `max(1, (# of data nodes * min(search thread pool size, 10)))`.', - }) - ), - max_concurrent_shard_requests: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of concurrent shard requests that each sub-search request executes per node.', - }) - ), - pre_filter_shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.', - }) - ), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.', - }) - ), - routing: z.optional(types_routing), - search_type: z.optional(types_search_type), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.', - }) - ), - }) - ), + body: msearch, + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, concrete, expanded or aliased indices are ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, missing or closed indices are not included in the response.' + })), + include_named_queries_score: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.' + })), + index: z.optional(types_indices), + max_concurrent_searches: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrent searches the multi search API can execute.\nDefaults to `max(1, (# of data nodes * min(search thread pool size, 10)))`.' + })), + max_concurrent_shard_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrent shard requests that each sub-search request executes per node.' + })), + pre_filter_shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.' + })), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.' + })), + routing: z.optional(types_routing), + search_type: z.optional(types_search_type), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.' + })) + })) }); export const msearch2_response = global_msearch_multi_search_result; export const msearch3_request = z.object({ - body: msearch, - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, concrete, expanded or aliased indices are ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, missing or closed indices are not included in the response.', - }) - ), - include_named_queries_score: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.', - }) - ), - index: z.optional(types_indices), - max_concurrent_searches: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of concurrent searches the multi search API can execute.\nDefaults to `max(1, (# of data nodes * min(search thread pool size, 10)))`.', - }) - ), - max_concurrent_shard_requests: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of concurrent shard requests that each sub-search request executes per node.', - }) - ), - pre_filter_shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.', - }) - ), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.', - }) - ), - routing: z.optional(types_routing), - search_type: z.optional(types_search_type), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.', - }) - ), - }) - ), + body: msearch, + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, concrete, expanded or aliased indices are ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, missing or closed indices are not included in the response.' + })), + include_named_queries_score: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.' + })), + index: z.optional(types_indices), + max_concurrent_searches: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrent searches the multi search API can execute.\nDefaults to `max(1, (# of data nodes * min(search thread pool size, 10)))`.' + })), + max_concurrent_shard_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrent shard requests that each sub-search request executes per node.' + })), + pre_filter_shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.' + })), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.' + })), + routing: z.optional(types_routing), + search_type: z.optional(types_search_type), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.' + })) + })) }); export const msearch3_response = global_msearch_multi_search_result; export const msearch_template_request = z.object({ - body: msearch_template, - path: z.optional(z.never()), - query: z.optional( - z.object({ - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, network round-trips are minimized for cross-cluster search requests.', - }) - ), - max_concurrent_searches: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of concurrent searches the API can run.', - }) - ), - search_type: z.optional(types_search_type), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response returns `hits.total` as an integer.\nIf `false`, it returns `hits.total` as an object.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response prefixes aggregation and suggester names with their respective types.', - }) - ), - }) - ), + body: msearch_template, + path: z.optional(z.never()), + query: z.optional(z.object({ + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, network round-trips are minimized for cross-cluster search requests.' + })), + max_concurrent_searches: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of concurrent searches the API can run.' + })), + search_type: z.optional(types_search_type), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response returns `hits.total` as an integer.\nIf `false`, it returns `hits.total` as an object.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response prefixes aggregation and suggester names with their respective types.' + })) + })) }); export const msearch_template_response = global_msearch_multi_search_result; export const msearch_template1_request = z.object({ - body: msearch_template, - path: z.optional(z.never()), - query: z.optional( - z.object({ - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, network round-trips are minimized for cross-cluster search requests.', - }) - ), - max_concurrent_searches: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of concurrent searches the API can run.', - }) - ), - search_type: z.optional(types_search_type), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response returns `hits.total` as an integer.\nIf `false`, it returns `hits.total` as an object.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response prefixes aggregation and suggester names with their respective types.', - }) - ), - }) - ), + body: msearch_template, + path: z.optional(z.never()), + query: z.optional(z.object({ + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, network round-trips are minimized for cross-cluster search requests.' + })), + max_concurrent_searches: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of concurrent searches the API can run.' + })), + search_type: z.optional(types_search_type), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response returns `hits.total` as an integer.\nIf `false`, it returns `hits.total` as an object.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response prefixes aggregation and suggester names with their respective types.' + })) + })) }); export const msearch_template1_response = global_msearch_multi_search_result; export const msearch_template2_request = z.object({ - body: msearch_template, - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, network round-trips are minimized for cross-cluster search requests.', - }) - ), - max_concurrent_searches: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of concurrent searches the API can run.', - }) - ), - search_type: z.optional(types_search_type), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response returns `hits.total` as an integer.\nIf `false`, it returns `hits.total` as an object.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response prefixes aggregation and suggester names with their respective types.', - }) - ), - }) - ), + body: msearch_template, + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, network round-trips are minimized for cross-cluster search requests.' + })), + max_concurrent_searches: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of concurrent searches the API can run.' + })), + search_type: z.optional(types_search_type), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response returns `hits.total` as an integer.\nIf `false`, it returns `hits.total` as an object.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response prefixes aggregation and suggester names with their respective types.' + })) + })) }); -export const msearch_template2_response = global_msearch_multi_search_result; - -export const msearch_template3_request = z.object({ - body: msearch_template, - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, network round-trips are minimized for cross-cluster search requests.', - }) - ), - max_concurrent_searches: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of concurrent searches the API can run.', - }) - ), - search_type: z.optional(types_search_type), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response returns `hits.total` as an integer.\nIf `false`, it returns `hits.total` as an object.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response prefixes aggregation and suggester names with their respective types.', - }) - ), - }) - ), +export const msearch_template2_response = global_msearch_multi_search_result; + +export const msearch_template3_request = z.object({ + body: msearch_template, + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, network round-trips are minimized for cross-cluster search requests.' + })), + max_concurrent_searches: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of concurrent searches the API can run.' + })), + search_type: z.optional(types_search_type), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response returns `hits.total` as an integer.\nIf `false`, it returns `hits.total` as an object.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response prefixes aggregation and suggester names with their respective types.' + })) + })) }); export const msearch_template3_response = global_msearch_multi_search_result; export const nodes_stats_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - completion_fields: z.optional(types_fields), - fielddata_fields: z.optional(types_fields), - fields: z.optional(types_fields), - groups: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Comma-separated list of search groups to include in the search statistics.', - }) - ), - include_segment_file_sizes: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).', - }) - ), - level: z.optional(types_node_stats_level), - timeout: z.optional(types_duration), - types: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'A comma-separated list of document types for the indexing index metric.', - }) - ), - include_unloaded_segments: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes information from segments that are not loaded into memory.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + completion_fields: z.optional(types_fields), + fielddata_fields: z.optional(types_fields), + fields: z.optional(types_fields), + groups: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Comma-separated list of search groups to include in the search statistics.' + })), + include_segment_file_sizes: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).' + })), + level: z.optional(types_node_stats_level), + timeout: z.optional(types_duration), + types: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A comma-separated list of document types for the indexing index metric.' + })), + include_unloaded_segments: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes information from segments that are not loaded into memory.' + })) + })) }); export const nodes_stats_response = nodes_stats_response_base; export const nodes_stats1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - node_id: types_node_ids, - }), - query: z.optional( - z.object({ - completion_fields: z.optional(types_fields), - fielddata_fields: z.optional(types_fields), - fields: z.optional(types_fields), - groups: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Comma-separated list of search groups to include in the search statistics.', - }) - ), - include_segment_file_sizes: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).', - }) - ), - level: z.optional(types_node_stats_level), - timeout: z.optional(types_duration), - types: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'A comma-separated list of document types for the indexing index metric.', - }) - ), - include_unloaded_segments: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes information from segments that are not loaded into memory.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + node_id: types_node_ids + }), + query: z.optional(z.object({ + completion_fields: z.optional(types_fields), + fielddata_fields: z.optional(types_fields), + fields: z.optional(types_fields), + groups: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Comma-separated list of search groups to include in the search statistics.' + })), + include_segment_file_sizes: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).' + })), + level: z.optional(types_node_stats_level), + timeout: z.optional(types_duration), + types: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A comma-separated list of document types for the indexing index metric.' + })), + include_unloaded_segments: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes information from segments that are not loaded into memory.' + })) + })) }); export const nodes_stats1_response = nodes_stats_response_base; export const nodes_stats2_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - metric: nodes_stats_node_stats_metrics, - }), - query: z.optional( - z.object({ - completion_fields: z.optional(types_fields), - fielddata_fields: z.optional(types_fields), - fields: z.optional(types_fields), - groups: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Comma-separated list of search groups to include in the search statistics.', - }) - ), - include_segment_file_sizes: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).', - }) - ), - level: z.optional(types_node_stats_level), - timeout: z.optional(types_duration), - types: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'A comma-separated list of document types for the indexing index metric.', - }) - ), - include_unloaded_segments: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes information from segments that are not loaded into memory.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + metric: nodes_stats_node_stats_metrics + }), + query: z.optional(z.object({ + completion_fields: z.optional(types_fields), + fielddata_fields: z.optional(types_fields), + fields: z.optional(types_fields), + groups: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Comma-separated list of search groups to include in the search statistics.' + })), + include_segment_file_sizes: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).' + })), + level: z.optional(types_node_stats_level), + timeout: z.optional(types_duration), + types: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A comma-separated list of document types for the indexing index metric.' + })), + include_unloaded_segments: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes information from segments that are not loaded into memory.' + })) + })) }); export const nodes_stats2_response = nodes_stats_response_base; export const nodes_stats3_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - node_id: types_node_ids, - metric: nodes_stats_node_stats_metrics, - }), - query: z.optional( - z.object({ - completion_fields: z.optional(types_fields), - fielddata_fields: z.optional(types_fields), - fields: z.optional(types_fields), - groups: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Comma-separated list of search groups to include in the search statistics.', - }) - ), - include_segment_file_sizes: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).', - }) - ), - level: z.optional(types_node_stats_level), - timeout: z.optional(types_duration), - types: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'A comma-separated list of document types for the indexing index metric.', - }) - ), - include_unloaded_segments: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes information from segments that are not loaded into memory.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + node_id: types_node_ids, + metric: nodes_stats_node_stats_metrics + }), + query: z.optional(z.object({ + completion_fields: z.optional(types_fields), + fielddata_fields: z.optional(types_fields), + fields: z.optional(types_fields), + groups: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Comma-separated list of search groups to include in the search statistics.' + })), + include_segment_file_sizes: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).' + })), + level: z.optional(types_node_stats_level), + timeout: z.optional(types_duration), + types: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A comma-separated list of document types for the indexing index metric.' + })), + include_unloaded_segments: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes information from segments that are not loaded into memory.' + })) + })) }); export const nodes_stats3_response = nodes_stats_response_base; export const nodes_stats4_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - metric: nodes_stats_node_stats_metrics, - index_metric: types_common_stats_flags, - }), - query: z.optional( - z.object({ - completion_fields: z.optional(types_fields), - fielddata_fields: z.optional(types_fields), - fields: z.optional(types_fields), - groups: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Comma-separated list of search groups to include in the search statistics.', - }) - ), - include_segment_file_sizes: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).', - }) - ), - level: z.optional(types_node_stats_level), - timeout: z.optional(types_duration), - types: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'A comma-separated list of document types for the indexing index metric.', - }) - ), - include_unloaded_segments: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes information from segments that are not loaded into memory.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + metric: nodes_stats_node_stats_metrics, + index_metric: types_common_stats_flags + }), + query: z.optional(z.object({ + completion_fields: z.optional(types_fields), + fielddata_fields: z.optional(types_fields), + fields: z.optional(types_fields), + groups: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Comma-separated list of search groups to include in the search statistics.' + })), + include_segment_file_sizes: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).' + })), + level: z.optional(types_node_stats_level), + timeout: z.optional(types_duration), + types: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A comma-separated list of document types for the indexing index metric.' + })), + include_unloaded_segments: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes information from segments that are not loaded into memory.' + })) + })) }); export const nodes_stats4_response = nodes_stats_response_base; export const nodes_stats5_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - node_id: types_node_ids, - metric: nodes_stats_node_stats_metrics, - index_metric: types_common_stats_flags, - }), - query: z.optional( - z.object({ - completion_fields: z.optional(types_fields), - fielddata_fields: z.optional(types_fields), - fields: z.optional(types_fields), - groups: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Comma-separated list of search groups to include in the search statistics.', - }) - ), - include_segment_file_sizes: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).', - }) - ), - level: z.optional(types_node_stats_level), - timeout: z.optional(types_duration), - types: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'A comma-separated list of document types for the indexing index metric.', - }) - ), - include_unloaded_segments: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes information from segments that are not loaded into memory.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + node_id: types_node_ids, + metric: nodes_stats_node_stats_metrics, + index_metric: types_common_stats_flags + }), + query: z.optional(z.object({ + completion_fields: z.optional(types_fields), + fielddata_fields: z.optional(types_fields), + fields: z.optional(types_fields), + groups: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Comma-separated list of search groups to include in the search statistics.' + })), + include_segment_file_sizes: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).' + })), + level: z.optional(types_node_stats_level), + timeout: z.optional(types_duration), + types: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A comma-separated list of document types for the indexing index metric.' + })), + include_unloaded_segments: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes information from segments that are not loaded into memory.' + })) + })) }); export const nodes_stats5_response = nodes_stats_response_base; export const open_point_in_time_request = z.object({ - body: z.optional( - z.object({ - index_filter: z.optional(types_query_dsl_query_container), + body: z.optional(z.object({ + index_filter: z.optional(types_query_dsl_query_container) + })), + path: z.object({ + index: types_indices + }), + query: z.object({ + keep_alive: types_duration, + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nBy default, it is random.' + })), + routing: z.optional(types_routing), + expand_wildcards: z.optional(types_expand_wildcards), + allow_partial_search_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the point in time tolerates unavailable shards or shard failures when initially creating the PIT.\nIf `false`, creating a point in time request when a shard is missing or unavailable will throw an exception.\nIf `true`, the point in time will contain all the shards that are available at the time of the request.' + })), + max_concurrent_shard_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of concurrent shard requests that each sub-search request executes per node.' + })) }) - ), - path: z.object({ - index: types_indices, - }), - query: z.object({ - keep_alive: types_duration, - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nBy default, it is random.', - }) - ), - routing: z.optional(types_routing), - expand_wildcards: z.optional(types_expand_wildcards), - allow_partial_search_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether the point in time tolerates unavailable shards or shard failures when initially creating the PIT.\nIf `false`, creating a point in time request when a shard is missing or unavailable will throw an exception.\nIf `true`, the point in time will contain all the shards that are available at the time of the request.', - }) - ), - max_concurrent_shard_requests: z.optional( - z.number().register(z.globalRegistry, { - description: - 'Maximum number of concurrent shard requests that each sub-search request executes per node.', - }) - ), - }), }); export const open_point_in_time_response = z.object({ - _shards: types_shard_statistics, - id: types_id, + _shards: types_shard_statistics, + id: types_id }); export const put_script3_request = z.object({ - body: put_script, - path: z.object({ - id: types_id, - context: types_name, - }), - query: z.optional( - z.object({ - context: z.optional(types_name), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: put_script, + path: z.object({ + id: types_id, + context: types_name + }), + query: z.optional(z.object({ + context: z.optional(types_name), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const put_script3_response = types_acknowledged_response_base; export const put_script2_request = z.object({ - body: put_script, - path: z.object({ - id: types_id, - context: types_name, - }), - query: z.optional( - z.object({ - context: z.optional(types_name), - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: put_script, + path: z.object({ + id: types_id, + context: types_name + }), + query: z.optional(z.object({ + context: z.optional(types_name), + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const put_script2_response = types_acknowledged_response_base; export const rank_eval_request = z.object({ - body: rank_eval, - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, missing or closed indices are not included in the response.', - }) - ), - search_type: z.optional(types_search_type), - }) - ), + body: rank_eval, + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, missing or closed indices are not included in the response.' + })), + search_type: z.optional(types_search_type) + })) }); export const rank_eval_response = z.object({ - metric_score: z.number().register(z.globalRegistry, { - description: 'The overall evaluation quality calculated by the defined metric', - }), - details: z - .record(z.string(), global_rank_eval_rank_eval_metric_detail) - .register(z.globalRegistry, { - description: - 'The details section contains one entry for every query in the original requests section, keyed by the search request id', + metric_score: z.number().register(z.globalRegistry, { + description: 'The overall evaluation quality calculated by the defined metric' }), - failures: z.record(z.string(), z.record(z.string(), z.unknown())), + details: z.record(z.string(), global_rank_eval_rank_eval_metric_detail).register(z.globalRegistry, { + description: 'The details section contains one entry for every query in the original requests section, keyed by the search request id' + }), + failures: z.record(z.string(), z.record(z.string(), z.unknown())) }); export const rank_eval1_request = z.object({ - body: rank_eval, - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, missing or closed indices are not included in the response.', - }) - ), - search_type: z.optional(types_search_type), - }) - ), + body: rank_eval, + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, missing or closed indices are not included in the response.' + })), + search_type: z.optional(types_search_type) + })) }); export const rank_eval1_response = z.object({ - metric_score: z.number().register(z.globalRegistry, { - description: 'The overall evaluation quality calculated by the defined metric', - }), - details: z - .record(z.string(), global_rank_eval_rank_eval_metric_detail) - .register(z.globalRegistry, { - description: - 'The details section contains one entry for every query in the original requests section, keyed by the search request id', + metric_score: z.number().register(z.globalRegistry, { + description: 'The overall evaluation quality calculated by the defined metric' + }), + details: z.record(z.string(), global_rank_eval_rank_eval_metric_detail).register(z.globalRegistry, { + description: 'The details section contains one entry for every query in the original requests section, keyed by the search request id' }), - failures: z.record(z.string(), z.record(z.string(), z.unknown())), + failures: z.record(z.string(), z.record(z.string(), z.unknown())) }); export const rank_eval2_request = z.object({ - body: rank_eval, - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, missing or closed indices are not included in the response.', - }) - ), - search_type: z.optional(types_search_type), - }) - ), + body: rank_eval, + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, missing or closed indices are not included in the response.' + })), + search_type: z.optional(types_search_type) + })) }); export const rank_eval2_response = z.object({ - metric_score: z.number().register(z.globalRegistry, { - description: 'The overall evaluation quality calculated by the defined metric', - }), - details: z - .record(z.string(), global_rank_eval_rank_eval_metric_detail) - .register(z.globalRegistry, { - description: - 'The details section contains one entry for every query in the original requests section, keyed by the search request id', + metric_score: z.number().register(z.globalRegistry, { + description: 'The overall evaluation quality calculated by the defined metric' }), - failures: z.record(z.string(), z.record(z.string(), z.unknown())), + details: z.record(z.string(), global_rank_eval_rank_eval_metric_detail).register(z.globalRegistry, { + description: 'The details section contains one entry for every query in the original requests section, keyed by the search request id' + }), + failures: z.record(z.string(), z.record(z.string(), z.unknown())) }); export const rank_eval3_request = z.object({ - body: rank_eval, - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, missing or closed indices are not included in the response.', - }) - ), - search_type: z.optional(types_search_type), - }) - ), + body: rank_eval, + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, missing or closed indices are not included in the response.' + })), + search_type: z.optional(types_search_type) + })) }); export const rank_eval3_response = z.object({ - metric_score: z.number().register(z.globalRegistry, { - description: 'The overall evaluation quality calculated by the defined metric', - }), - details: z - .record(z.string(), global_rank_eval_rank_eval_metric_detail) - .register(z.globalRegistry, { - description: - 'The details section contains one entry for every query in the original requests section, keyed by the search request id', + metric_score: z.number().register(z.globalRegistry, { + description: 'The overall evaluation quality calculated by the defined metric' + }), + details: z.record(z.string(), global_rank_eval_rank_eval_metric_detail).register(z.globalRegistry, { + description: 'The details section contains one entry for every query in the original requests section, keyed by the search request id' }), - failures: z.record(z.string(), z.record(z.string(), z.unknown())), + failures: z.record(z.string(), z.record(z.string(), z.unknown())) }); export const reindex_request = z.object({ - body: z.object({ - conflicts: z.optional(types_conflicts), - dest: global_reindex_destination, - max_docs: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to reindex.\nBy default, all documents are reindexed.\nIf it is a value less then or equal to `scroll_size`, a scroll will not be used to retrieve the results for the operation.\n\nIf `conflicts` is set to `proceed`, the reindex operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query.', - }) - ), - script: z.optional(types_script), - source: global_reindex_source, - }), - path: z.optional(z.never()), - query: z.optional( - z.object({ - refresh: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request refreshes affected shards to make this operation visible to search.', - }) - ), - requests_per_second: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The throttle for this request in sub-requests per second.\nBy default, there is no throttle.', - }) - ), - scroll: z.optional(types_duration), - slices: z.optional(types_slices), - max_docs: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to reindex.\nBy default, all documents are reindexed.\nIf it is a value less then or equal to `scroll_size`, a scroll will not be used to retrieve the results for the operation.\n\nIf `conflicts` is set to `proceed`, the reindex operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query.', - }) - ), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request blocks until the operation is complete.', - }) - ), - require_alias: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the destination must be an index alias.', - }) - ), - }) - ), + body: z.object({ + conflicts: z.optional(types_conflicts), + dest: global_reindex_destination, + max_docs: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to reindex.\nBy default, all documents are reindexed.\nIf it is a value less then or equal to `scroll_size`, a scroll will not be used to retrieve the results for the operation.\n\nIf `conflicts` is set to `proceed`, the reindex operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query.' + })), + script: z.optional(types_script), + source: global_reindex_source + }), + path: z.optional(z.never()), + query: z.optional(z.object({ + refresh: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request refreshes affected shards to make this operation visible to search.' + })), + requests_per_second: z.optional(z.number().register(z.globalRegistry, { + description: 'The throttle for this request in sub-requests per second.\nBy default, there is no throttle.' + })), + scroll: z.optional(types_duration), + slices: z.optional(types_slices), + max_docs: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to reindex.\nBy default, all documents are reindexed.\nIf it is a value less then or equal to `scroll_size`, a scroll will not be used to retrieve the results for the operation.\n\nIf `conflicts` is set to `proceed`, the reindex operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query.' + })), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request blocks until the operation is complete.' + })), + require_alias: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the destination must be an index alias.' + })) + })) }); export const reindex_response = z.object({ - batches: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of scroll responses that were pulled back by the reindex.', - }) - ), - created: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of documents that were successfully created.', - }) - ), - deleted: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of documents that were successfully deleted.', - }) - ), - failures: z.optional( - z.array(types_bulk_index_by_scroll_failure).register(z.globalRegistry, { - description: - 'If there were any unrecoverable errors during the process, it is an array of those failures.\nIf this array is not empty, the request ended because of those failures.\nReindex is implemented using batches and any failure causes the entire process to end but all failures in the current batch are collected into the array.\nYou can use the `conflicts` option to prevent the reindex from ending on version conflicts.', - }) - ), - noops: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of documents that were ignored because the script used for the reindex returned a `noop` value for `ctx.op`.', - }) - ), - retries: z.optional(types_retries), - requests_per_second: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of requests per second effectively run during the reindex.', - }) - ), - slice_id: z.optional(z.number()), - task: z.optional(types_task_id), - throttled_millis: z.optional(types_epoch_time_unit_millis), - throttled_until_millis: z.optional(types_epoch_time_unit_millis), - timed_out: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If any of the requests that ran during the reindex timed out, it is `true`.', - }) - ), - took: z.optional(types_duration_value_unit_millis), - total: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of documents that were successfully processed.', - }) - ), - updated: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of documents that were successfully updated.\nThat is to say, a document with the same ID already existed before the reindex updated it.', - }) - ), - version_conflicts: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of version conflicts that occurred.', - }) - ), + batches: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of scroll responses that were pulled back by the reindex.' + })), + created: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of documents that were successfully created.' + })), + deleted: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of documents that were successfully deleted.' + })), + failures: z.optional(z.array(types_bulk_index_by_scroll_failure).register(z.globalRegistry, { + description: 'If there were any unrecoverable errors during the process, it is an array of those failures.\nIf this array is not empty, the request ended because of those failures.\nReindex is implemented using batches and any failure causes the entire process to end but all failures in the current batch are collected into the array.\nYou can use the `conflicts` option to prevent the reindex from ending on version conflicts.' + })), + noops: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of documents that were ignored because the script used for the reindex returned a `noop` value for `ctx.op`.' + })), + retries: z.optional(types_retries), + requests_per_second: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of requests per second effectively run during the reindex.' + })), + slice_id: z.optional(z.number()), + task: z.optional(types_task_id), + throttled_millis: z.optional(types_epoch_time_unit_millis), + throttled_until_millis: z.optional(types_epoch_time_unit_millis), + timed_out: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If any of the requests that ran during the reindex timed out, it is `true`.' + })), + took: z.optional(types_duration_value_unit_millis), + total: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of documents that were successfully processed.' + })), + updated: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of documents that were successfully updated.\nThat is to say, a document with the same ID already existed before the reindex updated it.' + })), + version_conflicts: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of version conflicts that occurred.' + })) }); export const render_search_template_request = z.object({ - body: render_search_template, - path: z.optional(z.never()), - query: z.optional(z.never()), + body: render_search_template, + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const render_search_template_response = z.object({ - template_output: z.record(z.string(), z.record(z.string(), z.unknown())), + template_output: z.record(z.string(), z.record(z.string(), z.unknown())) }); export const render_search_template1_request = z.object({ - body: render_search_template, - path: z.optional(z.never()), - query: z.optional(z.never()), + body: render_search_template, + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const render_search_template1_response = z.object({ - template_output: z.record(z.string(), z.record(z.string(), z.unknown())), + template_output: z.record(z.string(), z.record(z.string(), z.unknown())) }); export const render_search_template2_request = z.object({ - body: render_search_template, - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: render_search_template, + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const render_search_template2_response = z.object({ - template_output: z.record(z.string(), z.record(z.string(), z.unknown())), + template_output: z.record(z.string(), z.record(z.string(), z.unknown())) }); export const render_search_template3_request = z.object({ - body: render_search_template, - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: render_search_template, + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const render_search_template3_response = z.object({ - template_output: z.record(z.string(), z.record(z.string(), z.unknown())), + template_output: z.record(z.string(), z.record(z.string(), z.unknown())) }); export const rollup_rollup_search_request = z.object({ - body: rollup_rollup_search, - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether hits.total should be rendered as an integer or an object in the rest search response', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specify whether aggregation and suggester names should be prefixed by their respective types in the response', - }) - ), - }) - ), + body: rollup_rollup_search, + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether hits.total should be rendered as an integer or an object in the rest search response' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether aggregation and suggester names should be prefixed by their respective types in the response' + })) + })) }); export const rollup_rollup_search_response = z.object({ - took: z.number(), - timed_out: z.boolean(), - terminated_early: z.optional(z.boolean()), - _shards: types_shard_statistics, - hits: global_search_types_hits_metadata, - aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)), + took: z.number(), + timed_out: z.boolean(), + terminated_early: z.optional(z.boolean()), + _shards: types_shard_statistics, + hits: global_search_types_hits_metadata, + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)) }); export const rollup_rollup_search1_request = z.object({ - body: rollup_rollup_search, - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether hits.total should be rendered as an integer or an object in the rest search response', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specify whether aggregation and suggester names should be prefixed by their respective types in the response', - }) - ), - }) - ), + body: rollup_rollup_search, + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether hits.total should be rendered as an integer or an object in the rest search response' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specify whether aggregation and suggester names should be prefixed by their respective types in the response' + })) + })) }); export const rollup_rollup_search1_response = z.object({ - took: z.number(), - timed_out: z.boolean(), - terminated_early: z.optional(z.boolean()), - _shards: types_shard_statistics, - hits: global_search_types_hits_metadata, - aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)), + took: z.number(), + timed_out: z.boolean(), + terminated_early: z.optional(z.boolean()), + _shards: types_shard_statistics, + hits: global_search_types_hits_metadata, + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)) }); export const scripts_painless_execute_request = z.object({ - body: scripts_painless_execute, - path: z.optional(z.never()), - query: z.optional(z.never()), + body: scripts_painless_execute, + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const scripts_painless_execute_response = z.object({ - result: z.record(z.string(), z.unknown()), + result: z.record(z.string(), z.unknown()) }); export const scripts_painless_execute1_request = z.object({ - body: scripts_painless_execute, - path: z.optional(z.never()), - query: z.optional(z.never()), + body: scripts_painless_execute, + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const scripts_painless_execute1_response = z.object({ - result: z.record(z.string(), z.unknown()), + result: z.record(z.string(), z.unknown()) }); export const search_request = z.object({ - body: z.optional(search), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - allow_partial_search_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and there are shard request timeouts or shard failures, the request returns partial results.\nIf `false`, it returns an error with no partial results.\n\nTo override the default behavior, you can set the `search.default_allow_partial_results` cluster setting to `false`.', - }) - ), - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - batched_reduce_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of shard results that should be reduced at once on the coordinating node.\nIf the potential number of shards in the request can be large, this value should be used as a protection mechanism to reduce the memory overhead per search request.', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, network round-trips between the coordinating node and the remote clusters are minimized when running cross-cluster search (CCS) requests.', - }) - ), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - docvalue_fields: z.optional(types_fields), - expand_wildcards: z.optional(types_expand_wildcards), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns detailed information about score computation as part of a hit.', - }) - ), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, concrete, expanded or aliased indices will be ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - include_named_queries_score: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes the score contribution from any named queries.\n\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - max_concurrent_shard_requests: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of concurrent shard requests per node that the search runs concurrently.\nThis value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The nodes and shards used for the search.\nBy default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness.\nValid values are:\n\n* `_only_local` to run the search only on shards on the local node.\n* `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method.\n* `_only_nodes:,` to run the search on only the specified nodes IDs. If suitable shards exist on more than one selected node, use shards on those nodes using the default method. If none of the specified nodes are available, select shards from any available node using the default method.\n* `_prefer_nodes:,` to if possible, run the search on the specified nodes IDs. If not, select shards using the default method.\n* `_shards:,` to run the search only on the specified shards. You can combine this value with other `preference` values. However, the `_shards` value must come first. For example: `_shards:2,3|_local`.\n* `` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order.', - }) - ), - pre_filter_shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold.\nThis filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint).\nWhen unspecified, the pre-filter phase is executed if any of these conditions is met:\n\n* The request targets more than 128 shards.\n* The request targets one or more read-only index.\n* The primary sort of the query targets an indexed field.', - }) - ), - request_cache: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the caching of search results is enabled for requests where `size` is `0`.\nIt defaults to index level settings.', - }) - ), - routing: z.optional(types_routing), - scroll: z.optional(types_duration), - search_type: z.optional(types_search_type), - stats: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'Specific `tag` of the request for logging and statistical purposes.', - }) - ), - stored_fields: z.optional(types_fields), - suggest_field: z.optional(types_field), - suggest_mode: z.optional(types_suggest_mode), - suggest_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of suggestions to return.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.', - }) - ), - suggest_text: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The source text for which the suggestions should be returned.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.', - }) - ), - terminate_after: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.\nIf set to `0` (default), the query does not terminate early.', - }) - ), - timeout: z.optional(types_duration), - track_total_hits: z.optional(global_search_types_track_hits), - track_scores: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request calculates and returns document scores, even if the scores are not used for sorting.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, aggregation and suggester names are be prefixed by their respective types in the response.', - }) - ), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response.', - }) - ), - version: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request returns the document version as part of a hit.', - }) - ), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_exclude_vectors: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Whether vectors should be excluded from _source', - }) - ), - _source_includes: z.optional(types_fields), - seq_no_primary_term: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns the sequence number and primary term of the last modification of each hit.', - }) - ), - q: z.optional( - z.string().register(z.globalRegistry, { - description: - 'A query in the Lucene query string syntax.\nQuery parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.\n\nIMPORTANT: This parameter overrides the query parameter in the request body.\nIf both parameters are specified, documents matching the query request body parameter are not returned.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of hits to return.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The starting document offset, which must be non-negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', - }) - ), - sort: z.optional(z.union([z.string(), z.array(z.string())])), - }) - ), + body: z.optional(search), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + allow_partial_search_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and there are shard request timeouts or shard failures, the request returns partial results.\nIf `false`, it returns an error with no partial results.\n\nTo override the default behavior, you can set the `search.default_allow_partial_results` cluster setting to `false`.' + })), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + batched_reduce_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of shard results that should be reduced at once on the coordinating node.\nIf the potential number of shards in the request can be large, this value should be used as a protection mechanism to reduce the memory overhead per search request.' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, network round-trips between the coordinating node and the remote clusters are minimized when running cross-cluster search (CCS) requests.' + })), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + docvalue_fields: z.optional(types_fields), + expand_wildcards: z.optional(types_expand_wildcards), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns detailed information about score computation as part of a hit.' + })), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, concrete, expanded or aliased indices will be ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + include_named_queries_score: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes the score contribution from any named queries.\n\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + max_concurrent_shard_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of concurrent shard requests per node that the search runs concurrently.\nThis value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The nodes and shards used for the search.\nBy default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness.\nValid values are:\n\n* `_only_local` to run the search only on shards on the local node.\n* `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method.\n* `_only_nodes:,` to run the search on only the specified nodes IDs. If suitable shards exist on more than one selected node, use shards on those nodes using the default method. If none of the specified nodes are available, select shards from any available node using the default method.\n* `_prefer_nodes:,` to if possible, run the search on the specified nodes IDs. If not, select shards using the default method.\n* `_shards:,` to run the search only on the specified shards. You can combine this value with other `preference` values. However, the `_shards` value must come first. For example: `_shards:2,3|_local`.\n* `` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order.' + })), + pre_filter_shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold.\nThis filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint).\nWhen unspecified, the pre-filter phase is executed if any of these conditions is met:\n\n* The request targets more than 128 shards.\n* The request targets one or more read-only index.\n* The primary sort of the query targets an indexed field.' + })), + request_cache: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the caching of search results is enabled for requests where `size` is `0`.\nIt defaults to index level settings.' + })), + routing: z.optional(types_routing), + scroll: z.optional(types_duration), + search_type: z.optional(types_search_type), + stats: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Specific `tag` of the request for logging and statistical purposes.' + })), + stored_fields: z.optional(types_fields), + suggest_field: z.optional(types_field), + suggest_mode: z.optional(types_suggest_mode), + suggest_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of suggestions to return.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.' + })), + suggest_text: z.optional(z.string().register(z.globalRegistry, { + description: 'The source text for which the suggestions should be returned.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.' + })), + terminate_after: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.\nIf set to `0` (default), the query does not terminate early.' + })), + timeout: z.optional(types_duration), + track_total_hits: z.optional(global_search_types_track_hits), + track_scores: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request calculates and returns document scores, even if the scores are not used for sorting.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, aggregation and suggester names are be prefixed by their respective types in the response.' + })), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response.' + })), + version: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns the document version as part of a hit.' + })), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_exclude_vectors: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether vectors should be excluded from _source' + })), + _source_includes: z.optional(types_fields), + seq_no_primary_term: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns the sequence number and primary term of the last modification of each hit.' + })), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'A query in the Lucene query string syntax.\nQuery parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.\n\nIMPORTANT: This parameter overrides the query parameter in the request body.\nIf both parameters are specified, documents matching the query request body parameter are not returned.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of hits to return.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'The starting document offset, which must be non-negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' + })), + sort: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])) + })) }); export const search_response = global_search_response_body; export const search1_request = z.object({ - body: z.optional(search), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - allow_partial_search_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and there are shard request timeouts or shard failures, the request returns partial results.\nIf `false`, it returns an error with no partial results.\n\nTo override the default behavior, you can set the `search.default_allow_partial_results` cluster setting to `false`.', - }) - ), - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - batched_reduce_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of shard results that should be reduced at once on the coordinating node.\nIf the potential number of shards in the request can be large, this value should be used as a protection mechanism to reduce the memory overhead per search request.', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, network round-trips between the coordinating node and the remote clusters are minimized when running cross-cluster search (CCS) requests.', - }) - ), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - docvalue_fields: z.optional(types_fields), - expand_wildcards: z.optional(types_expand_wildcards), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns detailed information about score computation as part of a hit.', - }) - ), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, concrete, expanded or aliased indices will be ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - include_named_queries_score: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes the score contribution from any named queries.\n\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - max_concurrent_shard_requests: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of concurrent shard requests per node that the search runs concurrently.\nThis value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The nodes and shards used for the search.\nBy default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness.\nValid values are:\n\n* `_only_local` to run the search only on shards on the local node.\n* `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method.\n* `_only_nodes:,` to run the search on only the specified nodes IDs. If suitable shards exist on more than one selected node, use shards on those nodes using the default method. If none of the specified nodes are available, select shards from any available node using the default method.\n* `_prefer_nodes:,` to if possible, run the search on the specified nodes IDs. If not, select shards using the default method.\n* `_shards:,` to run the search only on the specified shards. You can combine this value with other `preference` values. However, the `_shards` value must come first. For example: `_shards:2,3|_local`.\n* `` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order.', - }) - ), - pre_filter_shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold.\nThis filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint).\nWhen unspecified, the pre-filter phase is executed if any of these conditions is met:\n\n* The request targets more than 128 shards.\n* The request targets one or more read-only index.\n* The primary sort of the query targets an indexed field.', - }) - ), - request_cache: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the caching of search results is enabled for requests where `size` is `0`.\nIt defaults to index level settings.', - }) - ), - routing: z.optional(types_routing), - scroll: z.optional(types_duration), - search_type: z.optional(types_search_type), - stats: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'Specific `tag` of the request for logging and statistical purposes.', - }) - ), - stored_fields: z.optional(types_fields), - suggest_field: z.optional(types_field), - suggest_mode: z.optional(types_suggest_mode), - suggest_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of suggestions to return.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.', - }) - ), - suggest_text: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The source text for which the suggestions should be returned.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.', - }) - ), - terminate_after: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.\nIf set to `0` (default), the query does not terminate early.', - }) - ), - timeout: z.optional(types_duration), - track_total_hits: z.optional(global_search_types_track_hits), - track_scores: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request calculates and returns document scores, even if the scores are not used for sorting.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, aggregation and suggester names are be prefixed by their respective types in the response.', - }) - ), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response.', - }) - ), - version: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request returns the document version as part of a hit.', - }) - ), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_exclude_vectors: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Whether vectors should be excluded from _source', - }) - ), - _source_includes: z.optional(types_fields), - seq_no_primary_term: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns the sequence number and primary term of the last modification of each hit.', - }) - ), - q: z.optional( - z.string().register(z.globalRegistry, { - description: - 'A query in the Lucene query string syntax.\nQuery parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.\n\nIMPORTANT: This parameter overrides the query parameter in the request body.\nIf both parameters are specified, documents matching the query request body parameter are not returned.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of hits to return.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The starting document offset, which must be non-negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', - }) - ), - sort: z.optional(z.union([z.string(), z.array(z.string())])), - }) - ), -}); - -export const search1_response = global_search_response_body; - -export const search2_request = z.object({ - body: z.optional(search), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - allow_partial_search_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and there are shard request timeouts or shard failures, the request returns partial results.\nIf `false`, it returns an error with no partial results.\n\nTo override the default behavior, you can set the `search.default_allow_partial_results` cluster setting to `false`.', - }) - ), - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - batched_reduce_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of shard results that should be reduced at once on the coordinating node.\nIf the potential number of shards in the request can be large, this value should be used as a protection mechanism to reduce the memory overhead per search request.', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, network round-trips between the coordinating node and the remote clusters are minimized when running cross-cluster search (CCS) requests.', - }) - ), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - docvalue_fields: z.optional(types_fields), - expand_wildcards: z.optional(types_expand_wildcards), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns detailed information about score computation as part of a hit.', - }) - ), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, concrete, expanded or aliased indices will be ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - include_named_queries_score: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes the score contribution from any named queries.\n\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - max_concurrent_shard_requests: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of concurrent shard requests per node that the search runs concurrently.\nThis value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The nodes and shards used for the search.\nBy default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness.\nValid values are:\n\n* `_only_local` to run the search only on shards on the local node.\n* `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method.\n* `_only_nodes:,` to run the search on only the specified nodes IDs. If suitable shards exist on more than one selected node, use shards on those nodes using the default method. If none of the specified nodes are available, select shards from any available node using the default method.\n* `_prefer_nodes:,` to if possible, run the search on the specified nodes IDs. If not, select shards using the default method.\n* `_shards:,` to run the search only on the specified shards. You can combine this value with other `preference` values. However, the `_shards` value must come first. For example: `_shards:2,3|_local`.\n* `` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order.', - }) - ), - pre_filter_shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold.\nThis filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint).\nWhen unspecified, the pre-filter phase is executed if any of these conditions is met:\n\n* The request targets more than 128 shards.\n* The request targets one or more read-only index.\n* The primary sort of the query targets an indexed field.', - }) - ), - request_cache: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the caching of search results is enabled for requests where `size` is `0`.\nIt defaults to index level settings.', - }) - ), - routing: z.optional(types_routing), - scroll: z.optional(types_duration), - search_type: z.optional(types_search_type), - stats: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'Specific `tag` of the request for logging and statistical purposes.', - }) - ), - stored_fields: z.optional(types_fields), - suggest_field: z.optional(types_field), - suggest_mode: z.optional(types_suggest_mode), - suggest_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of suggestions to return.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.', - }) - ), - suggest_text: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The source text for which the suggestions should be returned.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.', - }) - ), - terminate_after: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.\nIf set to `0` (default), the query does not terminate early.', - }) - ), - timeout: z.optional(types_duration), - track_total_hits: z.optional(global_search_types_track_hits), - track_scores: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request calculates and returns document scores, even if the scores are not used for sorting.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, aggregation and suggester names are be prefixed by their respective types in the response.', - }) - ), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response.', - }) - ), - version: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request returns the document version as part of a hit.', - }) - ), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_exclude_vectors: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Whether vectors should be excluded from _source', - }) - ), - _source_includes: z.optional(types_fields), - seq_no_primary_term: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns the sequence number and primary term of the last modification of each hit.', - }) - ), - q: z.optional( - z.string().register(z.globalRegistry, { - description: - 'A query in the Lucene query string syntax.\nQuery parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.\n\nIMPORTANT: This parameter overrides the query parameter in the request body.\nIf both parameters are specified, documents matching the query request body parameter are not returned.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of hits to return.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The starting document offset, which must be non-negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', - }) - ), - sort: z.optional(z.union([z.string(), z.array(z.string())])), - }) - ), -}); - -export const search2_response = global_search_response_body; - -export const search3_request = z.object({ - body: z.optional(search), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - allow_partial_search_results: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true` and there are shard request timeouts or shard failures, the request returns partial results.\nIf `false`, it returns an error with no partial results.\n\nTo override the default behavior, you can set the `search.default_allow_partial_results` cluster setting to `false`.', - }) - ), - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - batched_reduce_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of shard results that should be reduced at once on the coordinating node.\nIf the potential number of shards in the request can be large, this value should be used as a protection mechanism to reduce the memory overhead per search request.', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, network round-trips between the coordinating node and the remote clusters are minimized when running cross-cluster search (CCS) requests.', - }) - ), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - docvalue_fields: z.optional(types_fields), - expand_wildcards: z.optional(types_expand_wildcards), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns detailed information about score computation as part of a hit.', - }) - ), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, concrete, expanded or aliased indices will be ignored when frozen.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - include_named_queries_score: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes the score contribution from any named queries.\n\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - max_concurrent_shard_requests: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of concurrent shard requests per node that the search runs concurrently.\nThis value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The nodes and shards used for the search.\nBy default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness.\nValid values are:\n\n* `_only_local` to run the search only on shards on the local node.\n* `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method.\n* `_only_nodes:,` to run the search on only the specified nodes IDs. If suitable shards exist on more than one selected node, use shards on those nodes using the default method. If none of the specified nodes are available, select shards from any available node using the default method.\n* `_prefer_nodes:,` to if possible, run the search on the specified nodes IDs. If not, select shards using the default method.\n* `_shards:,` to run the search only on the specified shards. You can combine this value with other `preference` values. However, the `_shards` value must come first. For example: `_shards:2,3|_local`.\n* `` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order.', - }) - ), - pre_filter_shard_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold.\nThis filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint).\nWhen unspecified, the pre-filter phase is executed if any of these conditions is met:\n\n* The request targets more than 128 shards.\n* The request targets one or more read-only index.\n* The primary sort of the query targets an indexed field.', - }) - ), - request_cache: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the caching of search results is enabled for requests where `size` is `0`.\nIt defaults to index level settings.', - }) - ), - routing: z.optional(types_routing), - scroll: z.optional(types_duration), - search_type: z.optional(types_search_type), - stats: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'Specific `tag` of the request for logging and statistical purposes.', - }) - ), - stored_fields: z.optional(types_fields), - suggest_field: z.optional(types_field), - suggest_mode: z.optional(types_suggest_mode), - suggest_size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of suggestions to return.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.', - }) - ), - suggest_text: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The source text for which the suggestions should be returned.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.', - }) - ), - terminate_after: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.\nIf set to `0` (default), the query does not terminate early.', - }) - ), - timeout: z.optional(types_duration), - track_total_hits: z.optional(global_search_types_track_hits), - track_scores: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request calculates and returns document scores, even if the scores are not used for sorting.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, aggregation and suggester names are be prefixed by their respective types in the response.', - }) - ), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response.', - }) - ), - version: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request returns the document version as part of a hit.', - }) - ), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_exclude_vectors: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Whether vectors should be excluded from _source', - }) - ), - _source_includes: z.optional(types_fields), - seq_no_primary_term: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns the sequence number and primary term of the last modification of each hit.', - }) - ), - q: z.optional( - z.string().register(z.globalRegistry, { - description: - 'A query in the Lucene query string syntax.\nQuery parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.\n\nIMPORTANT: This parameter overrides the query parameter in the request body.\nIf both parameters are specified, documents matching the query request body parameter are not returned.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of hits to return.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The starting document offset, which must be non-negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.', - }) - ), - sort: z.optional(z.union([z.string(), z.array(z.string())])), - }) - ), + body: z.optional(search), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + allow_partial_search_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and there are shard request timeouts or shard failures, the request returns partial results.\nIf `false`, it returns an error with no partial results.\n\nTo override the default behavior, you can set the `search.default_allow_partial_results` cluster setting to `false`.' + })), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + batched_reduce_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of shard results that should be reduced at once on the coordinating node.\nIf the potential number of shards in the request can be large, this value should be used as a protection mechanism to reduce the memory overhead per search request.' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, network round-trips between the coordinating node and the remote clusters are minimized when running cross-cluster search (CCS) requests.' + })), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + docvalue_fields: z.optional(types_fields), + expand_wildcards: z.optional(types_expand_wildcards), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns detailed information about score computation as part of a hit.' + })), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, concrete, expanded or aliased indices will be ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + include_named_queries_score: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes the score contribution from any named queries.\n\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + max_concurrent_shard_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of concurrent shard requests per node that the search runs concurrently.\nThis value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The nodes and shards used for the search.\nBy default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness.\nValid values are:\n\n* `_only_local` to run the search only on shards on the local node.\n* `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method.\n* `_only_nodes:,` to run the search on only the specified nodes IDs. If suitable shards exist on more than one selected node, use shards on those nodes using the default method. If none of the specified nodes are available, select shards from any available node using the default method.\n* `_prefer_nodes:,` to if possible, run the search on the specified nodes IDs. If not, select shards using the default method.\n* `_shards:,` to run the search only on the specified shards. You can combine this value with other `preference` values. However, the `_shards` value must come first. For example: `_shards:2,3|_local`.\n* `` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order.' + })), + pre_filter_shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold.\nThis filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint).\nWhen unspecified, the pre-filter phase is executed if any of these conditions is met:\n\n* The request targets more than 128 shards.\n* The request targets one or more read-only index.\n* The primary sort of the query targets an indexed field.' + })), + request_cache: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the caching of search results is enabled for requests where `size` is `0`.\nIt defaults to index level settings.' + })), + routing: z.optional(types_routing), + scroll: z.optional(types_duration), + search_type: z.optional(types_search_type), + stats: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Specific `tag` of the request for logging and statistical purposes.' + })), + stored_fields: z.optional(types_fields), + suggest_field: z.optional(types_field), + suggest_mode: z.optional(types_suggest_mode), + suggest_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of suggestions to return.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.' + })), + suggest_text: z.optional(z.string().register(z.globalRegistry, { + description: 'The source text for which the suggestions should be returned.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.' + })), + terminate_after: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.\nIf set to `0` (default), the query does not terminate early.' + })), + timeout: z.optional(types_duration), + track_total_hits: z.optional(global_search_types_track_hits), + track_scores: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request calculates and returns document scores, even if the scores are not used for sorting.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, aggregation and suggester names are be prefixed by their respective types in the response.' + })), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response.' + })), + version: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns the document version as part of a hit.' + })), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_exclude_vectors: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether vectors should be excluded from _source' + })), + _source_includes: z.optional(types_fields), + seq_no_primary_term: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns the sequence number and primary term of the last modification of each hit.' + })), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'A query in the Lucene query string syntax.\nQuery parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.\n\nIMPORTANT: This parameter overrides the query parameter in the request body.\nIf both parameters are specified, documents matching the query request body parameter are not returned.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of hits to return.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'The starting document offset, which must be non-negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' + })), + sort: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])) + })) +}); + +export const search1_response = global_search_response_body; + +export const search2_request = z.object({ + body: z.optional(search), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + allow_partial_search_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and there are shard request timeouts or shard failures, the request returns partial results.\nIf `false`, it returns an error with no partial results.\n\nTo override the default behavior, you can set the `search.default_allow_partial_results` cluster setting to `false`.' + })), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + batched_reduce_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of shard results that should be reduced at once on the coordinating node.\nIf the potential number of shards in the request can be large, this value should be used as a protection mechanism to reduce the memory overhead per search request.' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, network round-trips between the coordinating node and the remote clusters are minimized when running cross-cluster search (CCS) requests.' + })), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + docvalue_fields: z.optional(types_fields), + expand_wildcards: z.optional(types_expand_wildcards), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns detailed information about score computation as part of a hit.' + })), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, concrete, expanded or aliased indices will be ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + include_named_queries_score: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes the score contribution from any named queries.\n\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + max_concurrent_shard_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of concurrent shard requests per node that the search runs concurrently.\nThis value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The nodes and shards used for the search.\nBy default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness.\nValid values are:\n\n* `_only_local` to run the search only on shards on the local node.\n* `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method.\n* `_only_nodes:,` to run the search on only the specified nodes IDs. If suitable shards exist on more than one selected node, use shards on those nodes using the default method. If none of the specified nodes are available, select shards from any available node using the default method.\n* `_prefer_nodes:,` to if possible, run the search on the specified nodes IDs. If not, select shards using the default method.\n* `_shards:,` to run the search only on the specified shards. You can combine this value with other `preference` values. However, the `_shards` value must come first. For example: `_shards:2,3|_local`.\n* `` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order.' + })), + pre_filter_shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold.\nThis filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint).\nWhen unspecified, the pre-filter phase is executed if any of these conditions is met:\n\n* The request targets more than 128 shards.\n* The request targets one or more read-only index.\n* The primary sort of the query targets an indexed field.' + })), + request_cache: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the caching of search results is enabled for requests where `size` is `0`.\nIt defaults to index level settings.' + })), + routing: z.optional(types_routing), + scroll: z.optional(types_duration), + search_type: z.optional(types_search_type), + stats: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Specific `tag` of the request for logging and statistical purposes.' + })), + stored_fields: z.optional(types_fields), + suggest_field: z.optional(types_field), + suggest_mode: z.optional(types_suggest_mode), + suggest_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of suggestions to return.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.' + })), + suggest_text: z.optional(z.string().register(z.globalRegistry, { + description: 'The source text for which the suggestions should be returned.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.' + })), + terminate_after: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.\nIf set to `0` (default), the query does not terminate early.' + })), + timeout: z.optional(types_duration), + track_total_hits: z.optional(global_search_types_track_hits), + track_scores: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request calculates and returns document scores, even if the scores are not used for sorting.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, aggregation and suggester names are be prefixed by their respective types in the response.' + })), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response.' + })), + version: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns the document version as part of a hit.' + })), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_exclude_vectors: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether vectors should be excluded from _source' + })), + _source_includes: z.optional(types_fields), + seq_no_primary_term: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns the sequence number and primary term of the last modification of each hit.' + })), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'A query in the Lucene query string syntax.\nQuery parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.\n\nIMPORTANT: This parameter overrides the query parameter in the request body.\nIf both parameters are specified, documents matching the query request body parameter are not returned.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of hits to return.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'The starting document offset, which must be non-negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' + })), + sort: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])) + })) +}); + +export const search2_response = global_search_response_body; + +export const search3_request = z.object({ + body: z.optional(search), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + allow_partial_search_results: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true` and there are shard request timeouts or shard failures, the request returns partial results.\nIf `false`, it returns an error with no partial results.\n\nTo override the default behavior, you can set the `search.default_allow_partial_results` cluster setting to `false`.' + })), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + batched_reduce_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of shard results that should be reduced at once on the coordinating node.\nIf the potential number of shards in the request can be large, this value should be used as a protection mechanism to reduce the memory overhead per search request.' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, network round-trips between the coordinating node and the remote clusters are minimized when running cross-cluster search (CCS) requests.' + })), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'The field to use as a default when no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + docvalue_fields: z.optional(types_fields), + expand_wildcards: z.optional(types_expand_wildcards), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns detailed information about score computation as part of a hit.' + })), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, concrete, expanded or aliased indices will be ignored when frozen.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + include_named_queries_score: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes the score contribution from any named queries.\n\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + max_concurrent_shard_requests: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of concurrent shard requests per node that the search runs concurrently.\nThis value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The nodes and shards used for the search.\nBy default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness.\nValid values are:\n\n* `_only_local` to run the search only on shards on the local node.\n* `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method.\n* `_only_nodes:,` to run the search on only the specified nodes IDs. If suitable shards exist on more than one selected node, use shards on those nodes using the default method. If none of the specified nodes are available, select shards from any available node using the default method.\n* `_prefer_nodes:,` to if possible, run the search on the specified nodes IDs. If not, select shards using the default method.\n* `_shards:,` to run the search only on the specified shards. You can combine this value with other `preference` values. However, the `_shards` value must come first. For example: `_shards:2,3|_local`.\n* `` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order.' + })), + pre_filter_shard_size: z.optional(z.number().register(z.globalRegistry, { + description: 'A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold.\nThis filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint).\nWhen unspecified, the pre-filter phase is executed if any of these conditions is met:\n\n* The request targets more than 128 shards.\n* The request targets one or more read-only index.\n* The primary sort of the query targets an indexed field.' + })), + request_cache: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the caching of search results is enabled for requests where `size` is `0`.\nIt defaults to index level settings.' + })), + routing: z.optional(types_routing), + scroll: z.optional(types_duration), + search_type: z.optional(types_search_type), + stats: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Specific `tag` of the request for logging and statistical purposes.' + })), + stored_fields: z.optional(types_fields), + suggest_field: z.optional(types_field), + suggest_mode: z.optional(types_suggest_mode), + suggest_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of suggestions to return.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.' + })), + suggest_text: z.optional(z.string().register(z.globalRegistry, { + description: 'The source text for which the suggestions should be returned.\nThis parameter can be used only when the `suggest_field` and `suggest_text` query string parameters are specified.' + })), + terminate_after: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.\nIf set to `0` (default), the query does not terminate early.' + })), + timeout: z.optional(types_duration), + track_total_hits: z.optional(global_search_types_track_hits), + track_scores: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request calculates and returns document scores, even if the scores are not used for sorting.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, aggregation and suggester names are be prefixed by their respective types in the response.' + })), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response.' + })), + version: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns the document version as part of a hit.' + })), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_exclude_vectors: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Whether vectors should be excluded from _source' + })), + _source_includes: z.optional(types_fields), + seq_no_primary_term: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns the sequence number and primary term of the last modification of each hit.' + })), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'A query in the Lucene query string syntax.\nQuery parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.\n\nIMPORTANT: This parameter overrides the query parameter in the request body.\nIf both parameters are specified, documents matching the query request body parameter are not returned.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of hits to return.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'The starting document offset, which must be non-negative.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.' + })), + sort: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])) + })) }); export const search3_response = global_search_response_body; export const search_application_get_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + name: types_name + }), + query: z.optional(z.never()) }); export const search_application_get_response = search_application_types_search_application; export const search_application_put_request = z.object({ - body: search_application_types_search_application_parameters, - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - create: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, this request cannot replace or update existing Search Applications.', - }) - ), - }) - ), + body: search_application_types_search_application_parameters, + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + create: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, this request cannot replace or update existing Search Applications.' + })) + })) }); export const search_application_put_response = z.object({ - result: types_result, + result: types_result }); export const search_application_list_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - q: z.optional( - z.string().register(z.globalRegistry, { - description: 'Query in the Lucene query string syntax.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Starting offset.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies a max number of results to get.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + q: z.optional(z.string().register(z.globalRegistry, { + description: 'Query in the Lucene query string syntax.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Starting offset.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies a max number of results to get.' + })) + })) }); export const search_application_list_response = z.object({ - count: z.number(), - results: z.array(search_application_types_search_application), + count: z.number(), + results: z.array(search_application_types_search_application) }); export const search_application_search_request = z.object({ - body: z.optional(search_application_search), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Determines whether aggregation names are prefixed by their respective types in the response.', - }) - ), - }) - ), + body: z.optional(search_application_search), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Determines whether aggregation names are prefixed by their respective types in the response.' + })) + })) }); export const search_application_search_response = global_search_response_body; export const search_application_search1_request = z.object({ - body: z.optional(search_application_search), - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Determines whether aggregation names are prefixed by their respective types in the response.', - }) - ), - }) - ), + body: z.optional(search_application_search), + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Determines whether aggregation names are prefixed by their respective types in the response.' + })) + })) }); export const search_application_search1_response = global_search_response_body; export const search_mvt1_request = z.object({ - body: z.optional(search_mvt), - path: z.object({ - index: types_indices, - field: types_field, - zoom: global_search_mvt_types_zoom_level, - x: global_search_mvt_types_coordinate, - y: global_search_mvt_types_coordinate, - }), - query: z.optional( - z.object({ - exact_bounds: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `false`, the meta layer's feature is the bounding box of the tile.\nIf true, the meta layer's feature is a bounding box resulting from a\ngeo_bounds aggregation. The aggregation runs on values that intersect\nthe // tile with wrap_longitude set to false. The resulting\nbounding box may be larger than the vector tile.", - }) - ), - extent: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The size, in pixels, of a side of the tile. Vector tiles are square with equal sides.', - }) - ), - grid_agg: z.optional(global_search_mvt_types_grid_aggregation_type), - grid_precision: z.optional( - z.number().register(z.globalRegistry, { - description: - "Additional zoom levels available through the aggs layer. For example, if is 7\nand grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results\ndon't include the aggs layer.", - }) - ), - grid_type: z.optional(global_search_mvt_types_grid_type), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - "Maximum number of features to return in the hits layer. Accepts 0-10000.\nIf 0, results don't include the hits layer.", - }) - ), - track_total_hits: z.optional(global_search_types_track_hits), - with_labels: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the hits and aggs layers will contain additional point features representing\nsuggested label positions for the original features.\n\n* `Point` and `MultiPoint` features will have one of the points selected.\n* `Polygon` and `MultiPolygon` features will have a single point generated, either the centroid, if it is within the polygon, or another point within the polygon selected from the sorted triangle-tree.\n* `LineString` features will likewise provide a roughly central point selected from the triangle-tree.\n* The aggregation results will provide one central point for each aggregation bucket.\n\nAll attributes from the original features will also be copied to the new label features.\nIn addition, the new features will be distinguishable using the tag `_mvt_label_position`.', - }) - ), - }) - ), + body: z.optional(search_mvt), + path: z.object({ + index: types_indices, + field: types_field, + zoom: global_search_mvt_types_zoom_level, + x: global_search_mvt_types_coordinate, + y: global_search_mvt_types_coordinate + }), + query: z.optional(z.object({ + exact_bounds: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the meta layer\'s feature is the bounding box of the tile.\nIf true, the meta layer\'s feature is a bounding box resulting from a\ngeo_bounds aggregation. The aggregation runs on values that intersect\nthe // tile with wrap_longitude set to false. The resulting\nbounding box may be larger than the vector tile.' + })), + extent: z.optional(z.number().register(z.globalRegistry, { + description: 'The size, in pixels, of a side of the tile. Vector tiles are square with equal sides.' + })), + grid_agg: z.optional(global_search_mvt_types_grid_aggregation_type), + grid_precision: z.optional(z.number().register(z.globalRegistry, { + description: 'Additional zoom levels available through the aggs layer. For example, if is 7\nand grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results\ndon\'t include the aggs layer.' + })), + grid_type: z.optional(global_search_mvt_types_grid_type), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of features to return in the hits layer. Accepts 0-10000.\nIf 0, results don\'t include the hits layer.' + })), + track_total_hits: z.optional(global_search_types_track_hits), + with_labels: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the hits and aggs layers will contain additional point features representing\nsuggested label positions for the original features.\n\n* `Point` and `MultiPoint` features will have one of the points selected.\n* `Polygon` and `MultiPolygon` features will have a single point generated, either the centroid, if it is within the polygon, or another point within the polygon selected from the sorted triangle-tree.\n* `LineString` features will likewise provide a roughly central point selected from the triangle-tree.\n* The aggregation results will provide one central point for each aggregation bucket.\n\nAll attributes from the original features will also be copied to the new label features.\nIn addition, the new features will be distinguishable using the tag `_mvt_label_position`.' + })) + })) }); export const search_mvt1_response = types_mapbox_vector_tiles; export const search_mvt_request = z.object({ - body: z.optional(search_mvt), - path: z.object({ - index: types_indices, - field: types_field, - zoom: global_search_mvt_types_zoom_level, - x: global_search_mvt_types_coordinate, - y: global_search_mvt_types_coordinate, - }), - query: z.optional( - z.object({ - exact_bounds: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `false`, the meta layer's feature is the bounding box of the tile.\nIf true, the meta layer's feature is a bounding box resulting from a\ngeo_bounds aggregation. The aggregation runs on values that intersect\nthe // tile with wrap_longitude set to false. The resulting\nbounding box may be larger than the vector tile.", - }) - ), - extent: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The size, in pixels, of a side of the tile. Vector tiles are square with equal sides.', - }) - ), - grid_agg: z.optional(global_search_mvt_types_grid_aggregation_type), - grid_precision: z.optional( - z.number().register(z.globalRegistry, { - description: - "Additional zoom levels available through the aggs layer. For example, if is 7\nand grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results\ndon't include the aggs layer.", - }) - ), - grid_type: z.optional(global_search_mvt_types_grid_type), - size: z.optional( - z.number().register(z.globalRegistry, { - description: - "Maximum number of features to return in the hits layer. Accepts 0-10000.\nIf 0, results don't include the hits layer.", - }) - ), - track_total_hits: z.optional(global_search_types_track_hits), - with_labels: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the hits and aggs layers will contain additional point features representing\nsuggested label positions for the original features.\n\n* `Point` and `MultiPoint` features will have one of the points selected.\n* `Polygon` and `MultiPolygon` features will have a single point generated, either the centroid, if it is within the polygon, or another point within the polygon selected from the sorted triangle-tree.\n* `LineString` features will likewise provide a roughly central point selected from the triangle-tree.\n* The aggregation results will provide one central point for each aggregation bucket.\n\nAll attributes from the original features will also be copied to the new label features.\nIn addition, the new features will be distinguishable using the tag `_mvt_label_position`.', - }) - ), - }) - ), + body: z.optional(search_mvt), + path: z.object({ + index: types_indices, + field: types_field, + zoom: global_search_mvt_types_zoom_level, + x: global_search_mvt_types_coordinate, + y: global_search_mvt_types_coordinate + }), + query: z.optional(z.object({ + exact_bounds: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the meta layer\'s feature is the bounding box of the tile.\nIf true, the meta layer\'s feature is a bounding box resulting from a\ngeo_bounds aggregation. The aggregation runs on values that intersect\nthe // tile with wrap_longitude set to false. The resulting\nbounding box may be larger than the vector tile.' + })), + extent: z.optional(z.number().register(z.globalRegistry, { + description: 'The size, in pixels, of a side of the tile. Vector tiles are square with equal sides.' + })), + grid_agg: z.optional(global_search_mvt_types_grid_aggregation_type), + grid_precision: z.optional(z.number().register(z.globalRegistry, { + description: 'Additional zoom levels available through the aggs layer. For example, if is 7\nand grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results\ndon\'t include the aggs layer.' + })), + grid_type: z.optional(global_search_mvt_types_grid_type), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Maximum number of features to return in the hits layer. Accepts 0-10000.\nIf 0, results don\'t include the hits layer.' + })), + track_total_hits: z.optional(global_search_types_track_hits), + with_labels: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the hits and aggs layers will contain additional point features representing\nsuggested label positions for the original features.\n\n* `Point` and `MultiPoint` features will have one of the points selected.\n* `Polygon` and `MultiPolygon` features will have a single point generated, either the centroid, if it is within the polygon, or another point within the polygon selected from the sorted triangle-tree.\n* `LineString` features will likewise provide a roughly central point selected from the triangle-tree.\n* The aggregation results will provide one central point for each aggregation bucket.\n\nAll attributes from the original features will also be copied to the new label features.\nIn addition, the new features will be distinguishable using the tag `_mvt_label_position`.' + })) + })) }); export const search_mvt_response = types_mapbox_vector_tiles; export const search_shards_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request retrieves information from the local node only.', - }) - ), - master_timeout: z.optional(types_duration), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - routing: z.optional(types_routing), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request retrieves information from the local node only.' + })), + master_timeout: z.optional(types_duration), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + routing: z.optional(types_routing) + })) }); export const search_shards_response = z.object({ - nodes: z.record(z.string(), global_search_shards_search_shards_node_attributes), - shards: z.array(z.array(types_node_shard)), - indices: z.record(z.string(), global_search_shards_shard_store_index), + nodes: z.record(z.string(), global_search_shards_search_shards_node_attributes), + shards: z.array(z.array(types_node_shard)), + indices: z.record(z.string(), global_search_shards_shard_store_index) }); export const search_shards1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request retrieves information from the local node only.', - }) - ), - master_timeout: z.optional(types_duration), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - routing: z.optional(types_routing), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request retrieves information from the local node only.' + })), + master_timeout: z.optional(types_duration), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + routing: z.optional(types_routing) + })) }); export const search_shards1_response = z.object({ - nodes: z.record(z.string(), global_search_shards_search_shards_node_attributes), - shards: z.array(z.array(types_node_shard)), - indices: z.record(z.string(), global_search_shards_shard_store_index), + nodes: z.record(z.string(), global_search_shards_search_shards_node_attributes), + shards: z.array(z.array(types_node_shard)), + indices: z.record(z.string(), global_search_shards_shard_store_index) }); export const search_shards2_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request retrieves information from the local node only.', - }) - ), - master_timeout: z.optional(types_duration), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - routing: z.optional(types_routing), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request retrieves information from the local node only.' + })), + master_timeout: z.optional(types_duration), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + routing: z.optional(types_routing) + })) }); export const search_shards2_response = z.object({ - nodes: z.record(z.string(), global_search_shards_search_shards_node_attributes), - shards: z.array(z.array(types_node_shard)), - indices: z.record(z.string(), global_search_shards_shard_store_index), + nodes: z.record(z.string(), global_search_shards_search_shards_node_attributes), + shards: z.array(z.array(types_node_shard)), + indices: z.record(z.string(), global_search_shards_shard_store_index) }); export const search_shards3_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - local: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the request retrieves information from the local node only.', - }) - ), - master_timeout: z.optional(types_duration), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - routing: z.optional(types_routing), - }) - ), + body: z.optional(z.never()), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + local: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request retrieves information from the local node only.' + })), + master_timeout: z.optional(types_duration), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + routing: z.optional(types_routing) + })) }); export const search_shards3_response = z.object({ - nodes: z.record(z.string(), global_search_shards_search_shards_node_attributes), - shards: z.array(z.array(types_node_shard)), - indices: z.record(z.string(), global_search_shards_shard_store_index), + nodes: z.record(z.string(), global_search_shards_search_shards_node_attributes), + shards: z.array(z.array(types_node_shard)), + indices: z.record(z.string(), global_search_shards_shard_store_index) }); export const search_template_request = z.object({ - body: search_template, - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, network round-trips are minimized for cross-cluster search requests.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes additional details about score computation as part of a hit.', - }) - ), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - profile: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the query execution is profiled.', - }) - ), - routing: z.optional(types_routing), - scroll: z.optional(types_duration), - search_type: z.optional(types_search_type), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, `hits.total` is rendered as an integer in the response.\nIf `false`, it is rendered as an object.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response prefixes aggregation and suggester names with their respective types.', - }) - ), - }) - ), + body: search_template, + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, network round-trips are minimized for cross-cluster search requests.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes additional details about score computation as part of a hit.' + })), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + profile: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the query execution is profiled.' + })), + routing: z.optional(types_routing), + scroll: z.optional(types_duration), + search_type: z.optional(types_search_type), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, `hits.total` is rendered as an integer in the response.\nIf `false`, it is rendered as an object.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response prefixes aggregation and suggester names with their respective types.' + })) + })) }); export const search_template_response = z.object({ - took: z.number(), - timed_out: z.boolean(), - _shards: types_shard_statistics, - hits: global_search_types_hits_metadata, - aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)), - _clusters: z.optional(types_cluster_statistics), - fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - max_score: z.optional(z.number()), - num_reduce_phases: z.optional(z.number()), - profile: z.optional(global_search_types_profile), - pit_id: z.optional(types_id), - _scroll_id: z.optional(types_scroll_id), - suggest: z.optional(z.record(z.string(), z.array(global_search_types_suggest))), - terminated_early: z.optional(z.boolean()), + took: z.number(), + timed_out: z.boolean(), + _shards: types_shard_statistics, + hits: global_search_types_hits_metadata, + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)), + _clusters: z.optional(types_cluster_statistics), + fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + max_score: z.optional(z.number()), + num_reduce_phases: z.optional(z.number()), + profile: z.optional(global_search_types_profile), + pit_id: z.optional(types_id), + _scroll_id: z.optional(types_scroll_id), + suggest: z.optional(z.record(z.string(), z.array(global_search_types_suggest))), + terminated_early: z.optional(z.boolean()) }); export const search_template1_request = z.object({ - body: search_template, - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, network round-trips are minimized for cross-cluster search requests.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes additional details about score computation as part of a hit.', - }) - ), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - profile: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the query execution is profiled.', - }) - ), - routing: z.optional(types_routing), - scroll: z.optional(types_duration), - search_type: z.optional(types_search_type), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, `hits.total` is rendered as an integer in the response.\nIf `false`, it is rendered as an object.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response prefixes aggregation and suggester names with their respective types.', - }) - ), - }) - ), + body: search_template, + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, network round-trips are minimized for cross-cluster search requests.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes additional details about score computation as part of a hit.' + })), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + profile: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the query execution is profiled.' + })), + routing: z.optional(types_routing), + scroll: z.optional(types_duration), + search_type: z.optional(types_search_type), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, `hits.total` is rendered as an integer in the response.\nIf `false`, it is rendered as an object.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response prefixes aggregation and suggester names with their respective types.' + })) + })) }); export const search_template1_response = z.object({ - took: z.number(), - timed_out: z.boolean(), - _shards: types_shard_statistics, - hits: global_search_types_hits_metadata, - aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)), - _clusters: z.optional(types_cluster_statistics), - fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - max_score: z.optional(z.number()), - num_reduce_phases: z.optional(z.number()), - profile: z.optional(global_search_types_profile), - pit_id: z.optional(types_id), - _scroll_id: z.optional(types_scroll_id), - suggest: z.optional(z.record(z.string(), z.array(global_search_types_suggest))), - terminated_early: z.optional(z.boolean()), + took: z.number(), + timed_out: z.boolean(), + _shards: types_shard_statistics, + hits: global_search_types_hits_metadata, + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)), + _clusters: z.optional(types_cluster_statistics), + fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + max_score: z.optional(z.number()), + num_reduce_phases: z.optional(z.number()), + profile: z.optional(global_search_types_profile), + pit_id: z.optional(types_id), + _scroll_id: z.optional(types_scroll_id), + suggest: z.optional(z.record(z.string(), z.array(global_search_types_suggest))), + terminated_early: z.optional(z.boolean()) }); export const search_template2_request = z.object({ - body: search_template, - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, network round-trips are minimized for cross-cluster search requests.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes additional details about score computation as part of a hit.', - }) - ), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - profile: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the query execution is profiled.', - }) - ), - routing: z.optional(types_routing), - scroll: z.optional(types_duration), - search_type: z.optional(types_search_type), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, `hits.total` is rendered as an integer in the response.\nIf `false`, it is rendered as an object.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response prefixes aggregation and suggester names with their respective types.', - }) - ), - }) - ), + body: search_template, + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, network round-trips are minimized for cross-cluster search requests.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes additional details about score computation as part of a hit.' + })), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + profile: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the query execution is profiled.' + })), + routing: z.optional(types_routing), + scroll: z.optional(types_duration), + search_type: z.optional(types_search_type), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, `hits.total` is rendered as an integer in the response.\nIf `false`, it is rendered as an object.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response prefixes aggregation and suggester names with their respective types.' + })) + })) }); export const search_template2_response = z.object({ - took: z.number(), - timed_out: z.boolean(), - _shards: types_shard_statistics, - hits: global_search_types_hits_metadata, - aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)), - _clusters: z.optional(types_cluster_statistics), - fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - max_score: z.optional(z.number()), - num_reduce_phases: z.optional(z.number()), - profile: z.optional(global_search_types_profile), - pit_id: z.optional(types_id), - _scroll_id: z.optional(types_scroll_id), - suggest: z.optional(z.record(z.string(), z.array(global_search_types_suggest))), - terminated_early: z.optional(z.boolean()), + took: z.number(), + timed_out: z.boolean(), + _shards: types_shard_statistics, + hits: global_search_types_hits_metadata, + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)), + _clusters: z.optional(types_cluster_statistics), + fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + max_score: z.optional(z.number()), + num_reduce_phases: z.optional(z.number()), + profile: z.optional(global_search_types_profile), + pit_id: z.optional(types_id), + _scroll_id: z.optional(types_scroll_id), + suggest: z.optional(z.record(z.string(), z.array(global_search_types_suggest))), + terminated_early: z.optional(z.boolean()) }); export const search_template3_request = z.object({ - body: search_template, - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - ccs_minimize_roundtrips: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, network round-trips are minimized for cross-cluster search requests.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes additional details about score computation as part of a hit.', - }) - ), - ignore_throttled: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - profile: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the query execution is profiled.', - }) - ), - routing: z.optional(types_routing), - scroll: z.optional(types_duration), - search_type: z.optional(types_search_type), - rest_total_hits_as_int: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, `hits.total` is rendered as an integer in the response.\nIf `false`, it is rendered as an object.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response prefixes aggregation and suggester names with their respective types.', - }) - ), - }) - ), + body: search_template, + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + ccs_minimize_roundtrips: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, network round-trips are minimized for cross-cluster search requests.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes additional details about score computation as part of a hit.' + })), + ignore_throttled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + profile: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the query execution is profiled.' + })), + routing: z.optional(types_routing), + scroll: z.optional(types_duration), + search_type: z.optional(types_search_type), + rest_total_hits_as_int: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, `hits.total` is rendered as an integer in the response.\nIf `false`, it is rendered as an object.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response prefixes aggregation and suggester names with their respective types.' + })) + })) }); export const search_template3_response = z.object({ - took: z.number(), - timed_out: z.boolean(), - _shards: types_shard_statistics, - hits: global_search_types_hits_metadata, - aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)), - _clusters: z.optional(types_cluster_statistics), - fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), - max_score: z.optional(z.number()), - num_reduce_phases: z.optional(z.number()), - profile: z.optional(global_search_types_profile), - pit_id: z.optional(types_id), - _scroll_id: z.optional(types_scroll_id), - suggest: z.optional(z.record(z.string(), z.array(global_search_types_suggest))), - terminated_early: z.optional(z.boolean()), + took: z.number(), + timed_out: z.boolean(), + _shards: types_shard_statistics, + hits: global_search_types_hits_metadata, + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregate)), + _clusters: z.optional(types_cluster_statistics), + fields: z.optional(z.record(z.string(), z.record(z.string(), z.unknown()))), + max_score: z.optional(z.number()), + num_reduce_phases: z.optional(z.number()), + profile: z.optional(global_search_types_profile), + pit_id: z.optional(types_id), + _scroll_id: z.optional(types_scroll_id), + suggest: z.optional(z.record(z.string(), z.array(global_search_types_suggest))), + terminated_early: z.optional(z.boolean()) }); export const security_get_role1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_get_role1_response = z.record(z.string(), security_get_role_role); export const security_bulk_put_role_request = z.object({ - body: z.object({ - roles: z.record(z.string(), security_types_role_descriptor).register(z.globalRegistry, { - description: 'A dictionary of role name to RoleDescriptor objects to add or update', + body: z.object({ + roles: z.record(z.string(), security_types_role_descriptor).register(z.globalRegistry, { + description: 'A dictionary of role name to RoleDescriptor objects to add or update' + }) }), - }), - path: z.optional(z.never()), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + path: z.optional(z.never()), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_bulk_put_role_response = z.object({ - created: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'Array of created roles', - }) - ), - updated: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'Array of updated roles', - }) - ), - noop: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'Array of role names without any changes', - }) - ), - errors: z.optional(security_types_bulk_error), + created: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Array of created roles' + })), + updated: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Array of updated roles' + })), + noop: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Array of role names without any changes' + })), + errors: z.optional(security_types_bulk_error) }); export const security_bulk_update_api_keys_request = z.object({ - body: z.object({ - expiration: z.optional(types_duration), - ids: z.union([z.string(), z.array(z.string())]), - metadata: z.optional(types_metadata), - role_descriptors: z.optional( - z.record(z.string(), security_types_role_descriptor).register(z.globalRegistry, { - description: - "The role descriptors to assign to the API keys.\nAn API key's effective permissions are an intersection of its assigned privileges and the point-in-time snapshot of permissions of the owner user.\nYou can assign new privileges by specifying them in this parameter.\nTo remove assigned privileges, supply the `role_descriptors` parameter as an empty object `{}`.\nIf an API key has no assigned privileges, it inherits the owner user's full permissions.\nThe snapshot of the owner's permissions is always updated, whether you supply the `role_descriptors` parameter.\nThe structure of a role descriptor is the same as the request for the create API keys API.", - }) - ), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.object({ + expiration: z.optional(types_duration), + ids: z.union([ + z.string(), + z.array(z.string()) + ]), + metadata: z.optional(types_metadata), + role_descriptors: z.optional(z.record(z.string(), security_types_role_descriptor).register(z.globalRegistry, { + description: 'The role descriptors to assign to the API keys.\nAn API key\'s effective permissions are an intersection of its assigned privileges and the point-in-time snapshot of permissions of the owner user.\nYou can assign new privileges by specifying them in this parameter.\nTo remove assigned privileges, supply the `role_descriptors` parameter as an empty object `{}`.\nIf an API key has no assigned privileges, it inherits the owner user\'s full permissions.\nThe snapshot of the owner\'s permissions is always updated, whether you supply the `role_descriptors` parameter.\nThe structure of a role descriptor is the same as the request for the create API keys API.' + })) + }), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_bulk_update_api_keys_response = z.object({ - errors: z.optional(security_types_bulk_error), - noops: z.array(z.string()), - updated: z.array(z.string()), + errors: z.optional(security_types_bulk_error), + noops: z.array(z.string()), + updated: z.array(z.string()) }); export const security_get_api_key_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - id: z.optional(types_id), - name: z.optional(types_name), - owner: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'A boolean flag that can be used to query API keys owned by the currently authenticated user.\nThe `realm_name` or `username` parameters cannot be specified when this parameter is set to `true` as they are assumed to be the currently authenticated ones.', - }) - ), - realm_name: z.optional(types_name), - username: z.optional(types_username), - with_limited_by: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "Return the snapshot of the owner user's role descriptors\nassociated with the API key. An API key's actual\npermission is the intersection of its assigned role\ndescriptors and the owner user's role descriptors.", - }) - ), - active_only: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'A boolean flag that can be used to query API keys that are currently active. An API key is considered active if it is neither invalidated, nor expired at query time. You can specify this together with other parameters such as `owner` or `name`. If `active_only` is false, the response will include both active and inactive (expired or invalidated) keys.', - }) - ), - with_profile_uid: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Determines whether to also retrieve the profile uid, for the API key owner principal, if it exists.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + id: z.optional(types_id), + name: z.optional(types_name), + owner: z.optional(z.boolean().register(z.globalRegistry, { + description: 'A boolean flag that can be used to query API keys owned by the currently authenticated user.\nThe `realm_name` or `username` parameters cannot be specified when this parameter is set to `true` as they are assumed to be the currently authenticated ones.' + })), + realm_name: z.optional(types_name), + username: z.optional(types_username), + with_limited_by: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Return the snapshot of the owner user\'s role descriptors\nassociated with the API key. An API key\'s actual\npermission is the intersection of its assigned role\ndescriptors and the owner user\'s role descriptors.' + })), + active_only: z.optional(z.boolean().register(z.globalRegistry, { + description: 'A boolean flag that can be used to query API keys that are currently active. An API key is considered active if it is neither invalidated, nor expired at query time. You can specify this together with other parameters such as `owner` or `name`. If `active_only` is false, the response will include both active and inactive (expired or invalidated) keys.' + })), + with_profile_uid: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Determines whether to also retrieve the profile uid, for the API key owner principal, if it exists.' + })) + })) }); export const security_get_api_key_response = z.object({ - api_keys: z.array(security_types_api_key), + api_keys: z.array(security_types_api_key) }); export const security_create_api_key1_request = z.object({ - body: security_create_api_key, - path: z.optional(z.never()), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: security_create_api_key, + path: z.optional(z.never()), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_create_api_key1_response = z.object({ - api_key: z.string().register(z.globalRegistry, { - description: 'Generated API key.', - }), - expiration: z.optional( - z.number().register(z.globalRegistry, { - description: 'Expiration in milliseconds for the API key.', + api_key: z.string().register(z.globalRegistry, { + description: 'Generated API key.' + }), + expiration: z.optional(z.number().register(z.globalRegistry, { + description: 'Expiration in milliseconds for the API key.' + })), + id: types_id, + name: types_name, + encoded: z.string().register(z.globalRegistry, { + description: 'API key credentials which is the base64-encoding of\nthe UTF-8 representation of `id` and `api_key` joined\nby a colon (`:`).' }) - ), - id: types_id, - name: types_name, - encoded: z.string().register(z.globalRegistry, { - description: - 'API key credentials which is the base64-encoding of\nthe UTF-8 representation of `id` and `api_key` joined\nby a colon (`:`).', - }), }); export const security_create_api_key_request = z.object({ - body: security_create_api_key, - path: z.optional(z.never()), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: security_create_api_key, + path: z.optional(z.never()), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_create_api_key_response = z.object({ - api_key: z.string().register(z.globalRegistry, { - description: 'Generated API key.', - }), - expiration: z.optional( - z.number().register(z.globalRegistry, { - description: 'Expiration in milliseconds for the API key.', + api_key: z.string().register(z.globalRegistry, { + description: 'Generated API key.' + }), + expiration: z.optional(z.number().register(z.globalRegistry, { + description: 'Expiration in milliseconds for the API key.' + })), + id: types_id, + name: types_name, + encoded: z.string().register(z.globalRegistry, { + description: 'API key credentials which is the base64-encoding of\nthe UTF-8 representation of `id` and `api_key` joined\nby a colon (`:`).' }) - ), - id: types_id, - name: types_name, - encoded: z.string().register(z.globalRegistry, { - description: - 'API key credentials which is the base64-encoding of\nthe UTF-8 representation of `id` and `api_key` joined\nby a colon (`:`).', - }), }); export const security_create_cross_cluster_api_key_request = z.object({ - body: z.object({ - access: security_types_access, - expiration: z.optional(types_duration), - metadata: z.optional(types_metadata), - name: types_name, - certificate_identity: z.optional( - z.string().register(z.globalRegistry, { - description: - "The certificate identity to associate with this API key.\nThis field is used to restrict the API key to connections authenticated by a specific TLS certificate.\nThe value should match the certificate's distinguished name (DN) pattern.", - }) - ), - }), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.object({ + access: security_types_access, + expiration: z.optional(types_duration), + metadata: z.optional(types_metadata), + name: types_name, + certificate_identity: z.optional(z.string().register(z.globalRegistry, { + description: 'The certificate identity to associate with this API key.\nThis field is used to restrict the API key to connections authenticated by a specific TLS certificate.\nThe value should match the certificate\'s distinguished name (DN) pattern.' + })) + }), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_create_cross_cluster_api_key_response = z.object({ - api_key: z.string().register(z.globalRegistry, { - description: 'Generated API key.', - }), - expiration: z.optional(types_duration_value_unit_millis), - id: types_id, - name: types_name, - encoded: z.string().register(z.globalRegistry, { - description: - 'API key credentials which is the base64-encoding of\nthe UTF-8 representation of `id` and `api_key` joined\nby a colon (`:`).', - }), + api_key: z.string().register(z.globalRegistry, { + description: 'Generated API key.' + }), + expiration: z.optional(types_duration_value_unit_millis), + id: types_id, + name: types_name, + encoded: z.string().register(z.globalRegistry, { + description: 'API key credentials which is the base64-encoding of\nthe UTF-8 representation of `id` and `api_key` joined\nby a colon (`:`).' + }) }); export const security_get_role_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_names, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + name: types_names + }), + query: z.optional(z.never()) }); export const security_get_role_response = z.record(z.string(), security_get_role_role); export const security_put_role1_request = z.object({ - body: security_put_role, - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: security_put_role, + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_put_role1_response = z.object({ - role: security_types_created_status, + role: security_types_created_status }); export const security_put_role_request = z.object({ - body: security_put_role, - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: security_put_role, + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_put_role_response = z.object({ - role: security_types_created_status, + role: security_types_created_status }); export const security_get_role_mapping_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - name: types_names, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + name: types_names + }), + query: z.optional(z.never()) }); export const security_get_role_mapping_response = z.record(z.string(), security_types_role_mapping); export const security_put_role_mapping1_request = z.object({ - body: security_put_role_mapping, - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: security_put_role_mapping, + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_put_role_mapping1_response = z.object({ - created: z.optional(z.boolean()), - role_mapping: security_types_created_status, + created: z.optional(z.boolean()), + role_mapping: security_types_created_status }); export const security_put_role_mapping_request = z.object({ - body: security_put_role_mapping, - path: z.object({ - name: types_name, - }), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: security_put_role_mapping, + path: z.object({ + name: types_name + }), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_put_role_mapping_response = z.object({ - created: z.optional(z.boolean()), - role_mapping: security_types_created_status, + created: z.optional(z.boolean()), + role_mapping: security_types_created_status }); export const security_get_role_mapping1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); -export const security_get_role_mapping1_response = z.record( - z.string(), - security_types_role_mapping -); +export const security_get_role_mapping1_response = z.record(z.string(), security_types_role_mapping); export const security_get_service_accounts_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - namespace: types_namespace, - service: types_service, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + namespace: types_namespace, + service: types_service + }), + query: z.optional(z.never()) }); -export const security_get_service_accounts_response = z.record( - z.string(), - security_get_service_accounts_role_descriptor_wrapper -); +export const security_get_service_accounts_response = z.record(z.string(), security_get_service_accounts_role_descriptor_wrapper); export const security_get_service_accounts1_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - namespace: types_namespace, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + namespace: types_namespace + }), + query: z.optional(z.never()) }); -export const security_get_service_accounts1_response = z.record( - z.string(), - security_get_service_accounts_role_descriptor_wrapper -); +export const security_get_service_accounts1_response = z.record(z.string(), security_get_service_accounts_role_descriptor_wrapper); export const security_get_service_accounts2_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); -export const security_get_service_accounts2_response = z.record( - z.string(), - security_get_service_accounts_role_descriptor_wrapper -); +export const security_get_service_accounts2_response = z.record(z.string(), security_get_service_accounts_role_descriptor_wrapper); export const security_get_settings_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const security_get_settings_response = z.object({ - security: security_types_security_settings, - 'security-profile': security_types_security_settings, - 'security-tokens': security_types_security_settings, + security: security_types_security_settings, + 'security-profile': security_types_security_settings, + 'security-tokens': security_types_security_settings }); export const security_update_settings_request = z.object({ - body: z.object({ - security: z.optional(security_types_security_settings), - 'security-profile': z.optional(security_types_security_settings), - 'security-tokens': z.optional(security_types_security_settings), - }), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + security: z.optional(security_types_security_settings), + 'security-profile': z.optional(security_types_security_settings), + 'security-tokens': z.optional(security_types_security_settings) + }), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + timeout: z.optional(types_duration) + })) }); export const security_update_settings_response = z.object({ - acknowledged: z.boolean(), + acknowledged: z.boolean() }); export const security_get_user_privileges_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_get_user_privileges_response = z.object({ - applications: z.array(security_types_application_privileges), - cluster: z.array(z.string()), - remote_cluster: z.optional(z.array(security_types_remote_cluster_privileges)), - global: z.array(security_types_global_privilege), - indices: z.array(security_types_user_indices_privileges), - remote_indices: z.optional(z.array(security_types_remote_user_indices_privileges)), - run_as: z.array(z.string()), + applications: z.array(security_types_application_privileges), + cluster: z.array(z.string()), + remote_cluster: z.optional(z.array(security_types_remote_cluster_privileges)), + global: z.array(security_types_global_privilege), + indices: z.array(security_types_user_indices_privileges), + remote_indices: z.optional(z.array(security_types_remote_user_indices_privileges)), + run_as: z.array(z.string()) }); export const security_grant_api_key_request = z.object({ - body: z.object({ - api_key: security_grant_api_key_grant_api_key, - grant_type: security_grant_api_key_api_key_grant_type, - access_token: z.optional( - z.string().register(z.globalRegistry, { - description: - "The user's access token.\nIf you specify the `access_token` grant type, this parameter is required.\nIt is not valid with other grant types.", - }) - ), - username: z.optional(types_username), - password: z.optional(types_password), - run_as: z.optional(types_username), - }), - path: z.optional(z.never()), - query: z.optional( - z.object({ - refresh: z.optional(types_refresh), - }) - ), + body: z.object({ + api_key: security_grant_api_key_grant_api_key, + grant_type: security_grant_api_key_api_key_grant_type, + access_token: z.optional(z.string().register(z.globalRegistry, { + description: 'The user\'s access token.\nIf you specify the `access_token` grant type, this parameter is required.\nIt is not valid with other grant types.' + })), + username: z.optional(types_username), + password: z.optional(types_password), + run_as: z.optional(types_username) + }), + path: z.optional(z.never()), + query: z.optional(z.object({ + refresh: z.optional(types_refresh) + })) }); export const security_grant_api_key_response = z.object({ - api_key: z.string(), - id: types_id, - name: types_name, - expiration: z.optional(types_epoch_time_unit_millis), - encoded: z.string(), + api_key: z.string(), + id: types_id, + name: types_name, + expiration: z.optional(types_epoch_time_unit_millis), + encoded: z.string() }); export const security_query_api_keys_request = z.object({ - body: z.optional(security_query_api_keys), - path: z.optional(z.never()), - query: z.optional( - z.object({ - with_limited_by: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "Return the snapshot of the owner user's role descriptors associated with the API key.\nAn API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors (effectively limited by it).\nAn API key cannot retrieve any API key’s limited-by role descriptors (including itself) unless it has `manage_api_key` or higher privileges.", - }) - ), - with_profile_uid: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Determines whether to also retrieve the profile UID for the API key owner principal.\nIf it exists, the profile UID is returned under the `profile_uid` response field for each API key.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Determines whether aggregation names are prefixed by their respective types in the response.', - }) - ), - }) - ), + body: z.optional(security_query_api_keys), + path: z.optional(z.never()), + query: z.optional(z.object({ + with_limited_by: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Return the snapshot of the owner user\'s role descriptors associated with the API key.\nAn API key\'s actual permission is the intersection of its assigned role descriptors and the owner user\'s role descriptors (effectively limited by it).\nAn API key cannot retrieve any API key’s limited-by role descriptors (including itself) unless it has `manage_api_key` or higher privileges.' + })), + with_profile_uid: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Determines whether to also retrieve the profile UID for the API key owner principal.\nIf it exists, the profile UID is returned under the `profile_uid` response field for each API key.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Determines whether aggregation names are prefixed by their respective types in the response.' + })) + })) }); export const security_query_api_keys_response = z.object({ - total: z.number().register(z.globalRegistry, { - description: 'The total number of API keys found.', - }), - count: z.number().register(z.globalRegistry, { - description: 'The number of API keys returned in the response.', - }), - api_keys: z.array(security_types_api_key).register(z.globalRegistry, { - description: 'A list of API key information.', - }), - aggregations: z.optional( - z.record(z.string(), security_query_api_keys_api_key_aggregate).register(z.globalRegistry, { - description: 'The aggregations result, if requested.', - }) - ), + total: z.number().register(z.globalRegistry, { + description: 'The total number of API keys found.' + }), + count: z.number().register(z.globalRegistry, { + description: 'The number of API keys returned in the response.' + }), + api_keys: z.array(security_types_api_key).register(z.globalRegistry, { + description: 'A list of API key information.' + }), + aggregations: z.optional(z.record(z.string(), security_query_api_keys_api_key_aggregate).register(z.globalRegistry, { + description: 'The aggregations result, if requested.' + })) }); export const security_query_api_keys1_request = z.object({ - body: z.optional(security_query_api_keys), - path: z.optional(z.never()), - query: z.optional( - z.object({ - with_limited_by: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "Return the snapshot of the owner user's role descriptors associated with the API key.\nAn API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors (effectively limited by it).\nAn API key cannot retrieve any API key’s limited-by role descriptors (including itself) unless it has `manage_api_key` or higher privileges.", - }) - ), - with_profile_uid: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Determines whether to also retrieve the profile UID for the API key owner principal.\nIf it exists, the profile UID is returned under the `profile_uid` response field for each API key.', - }) - ), - typed_keys: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Determines whether aggregation names are prefixed by their respective types in the response.', - }) - ), - }) - ), + body: z.optional(security_query_api_keys), + path: z.optional(z.never()), + query: z.optional(z.object({ + with_limited_by: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Return the snapshot of the owner user\'s role descriptors associated with the API key.\nAn API key\'s actual permission is the intersection of its assigned role descriptors and the owner user\'s role descriptors (effectively limited by it).\nAn API key cannot retrieve any API key’s limited-by role descriptors (including itself) unless it has `manage_api_key` or higher privileges.' + })), + with_profile_uid: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Determines whether to also retrieve the profile UID for the API key owner principal.\nIf it exists, the profile UID is returned under the `profile_uid` response field for each API key.' + })), + typed_keys: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Determines whether aggregation names are prefixed by their respective types in the response.' + })) + })) }); export const security_query_api_keys1_response = z.object({ - total: z.number().register(z.globalRegistry, { - description: 'The total number of API keys found.', - }), - count: z.number().register(z.globalRegistry, { - description: 'The number of API keys returned in the response.', - }), - api_keys: z.array(security_types_api_key).register(z.globalRegistry, { - description: 'A list of API key information.', - }), - aggregations: z.optional( - z.record(z.string(), security_query_api_keys_api_key_aggregate).register(z.globalRegistry, { - description: 'The aggregations result, if requested.', - }) - ), + total: z.number().register(z.globalRegistry, { + description: 'The total number of API keys found.' + }), + count: z.number().register(z.globalRegistry, { + description: 'The number of API keys returned in the response.' + }), + api_keys: z.array(security_types_api_key).register(z.globalRegistry, { + description: 'A list of API key information.' + }), + aggregations: z.optional(z.record(z.string(), security_query_api_keys_api_key_aggregate).register(z.globalRegistry, { + description: 'The aggregations result, if requested.' + })) }); export const security_query_role_request = z.object({ - body: z.optional(security_query_role), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(security_query_role), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_query_role_response = z.object({ - total: z.number().register(z.globalRegistry, { - description: 'The total number of roles found.', - }), - count: z.number().register(z.globalRegistry, { - description: 'The number of roles returned in the response.', - }), - roles: z.array(security_query_role_query_role).register(z.globalRegistry, { - description: - 'A list of roles that match the query.\nThe returned role format is an extension of the role definition format.\nIt adds the `transient_metadata.enabled` and the `_sort` fields.\n`transient_metadata.enabled` is set to `false` in case the role is automatically disabled, for example when the role grants privileges that are not allowed by the installed license.\n`_sort` is present when the search query sorts on some field.\nIt contains the array of values that have been used for sorting.', - }), + total: z.number().register(z.globalRegistry, { + description: 'The total number of roles found.' + }), + count: z.number().register(z.globalRegistry, { + description: 'The number of roles returned in the response.' + }), + roles: z.array(security_query_role_query_role).register(z.globalRegistry, { + description: 'A list of roles that match the query.\nThe returned role format is an extension of the role definition format.\nIt adds the `transient_metadata.enabled` and the `_sort` fields.\n`transient_metadata.enabled` is set to `false` in case the role is automatically disabled, for example when the role grants privileges that are not allowed by the installed license.\n`_sort` is present when the search query sorts on some field.\nIt contains the array of values that have been used for sorting.' + }) }); export const security_query_role1_request = z.object({ - body: z.optional(security_query_role), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(security_query_role), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const security_query_role1_response = z.object({ - total: z.number().register(z.globalRegistry, { - description: 'The total number of roles found.', - }), - count: z.number().register(z.globalRegistry, { - description: 'The number of roles returned in the response.', - }), - roles: z.array(security_query_role_query_role).register(z.globalRegistry, { - description: - 'A list of roles that match the query.\nThe returned role format is an extension of the role definition format.\nIt adds the `transient_metadata.enabled` and the `_sort` fields.\n`transient_metadata.enabled` is set to `false` in case the role is automatically disabled, for example when the role grants privileges that are not allowed by the installed license.\n`_sort` is present when the search query sorts on some field.\nIt contains the array of values that have been used for sorting.', - }), + total: z.number().register(z.globalRegistry, { + description: 'The total number of roles found.' + }), + count: z.number().register(z.globalRegistry, { + description: 'The number of roles returned in the response.' + }), + roles: z.array(security_query_role_query_role).register(z.globalRegistry, { + description: 'A list of roles that match the query.\nThe returned role format is an extension of the role definition format.\nIt adds the `transient_metadata.enabled` and the `_sort` fields.\n`transient_metadata.enabled` is set to `false` in case the role is automatically disabled, for example when the role grants privileges that are not allowed by the installed license.\n`_sort` is present when the search query sorts on some field.\nIt contains the array of values that have been used for sorting.' + }) }); export const security_query_user_request = z.object({ - body: z.optional(security_query_user), - path: z.optional(z.never()), - query: z.optional( - z.object({ - with_profile_uid: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Determines whether to retrieve the user profile UID, if it exists, for the users.', - }) - ), - }) - ), + body: z.optional(security_query_user), + path: z.optional(z.never()), + query: z.optional(z.object({ + with_profile_uid: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Determines whether to retrieve the user profile UID, if it exists, for the users.' + })) + })) }); export const security_query_user_response = z.object({ - total: z.number().register(z.globalRegistry, { - description: 'The total number of users found.', - }), - count: z.number().register(z.globalRegistry, { - description: 'The number of users returned in the response.', - }), - users: z.array(security_query_user_query_user).register(z.globalRegistry, { - description: 'A list of users that match the query.', - }), + total: z.number().register(z.globalRegistry, { + description: 'The total number of users found.' + }), + count: z.number().register(z.globalRegistry, { + description: 'The number of users returned in the response.' + }), + users: z.array(security_query_user_query_user).register(z.globalRegistry, { + description: 'A list of users that match the query.' + }) }); export const security_query_user1_request = z.object({ - body: z.optional(security_query_user), - path: z.optional(z.never()), - query: z.optional( - z.object({ - with_profile_uid: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Determines whether to retrieve the user profile UID, if it exists, for the users.', - }) - ), - }) - ), + body: z.optional(security_query_user), + path: z.optional(z.never()), + query: z.optional(z.object({ + with_profile_uid: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Determines whether to retrieve the user profile UID, if it exists, for the users.' + })) + })) }); export const security_query_user1_response = z.object({ - total: z.number().register(z.globalRegistry, { - description: 'The total number of users found.', - }), - count: z.number().register(z.globalRegistry, { - description: 'The number of users returned in the response.', - }), - users: z.array(security_query_user_query_user).register(z.globalRegistry, { - description: 'A list of users that match the query.', - }), + total: z.number().register(z.globalRegistry, { + description: 'The total number of users found.' + }), + count: z.number().register(z.globalRegistry, { + description: 'The number of users returned in the response.' + }), + users: z.array(security_query_user_query_user).register(z.globalRegistry, { + description: 'A list of users that match the query.' + }) }); export const security_update_api_key_request = z.object({ - body: z.optional( - z.object({ - role_descriptors: z.optional( - z.record(z.string(), security_types_role_descriptor).register(z.globalRegistry, { - description: - "The role descriptors to assign to this API key.\nThe API key's effective permissions are an intersection of its assigned privileges and the point in time snapshot of permissions of the owner user.\nYou can assign new privileges by specifying them in this parameter.\nTo remove assigned privileges, you can supply an empty `role_descriptors` parameter, that is to say, an empty object `{}`.\nIf an API key has no assigned privileges, it inherits the owner user's full permissions.\nThe snapshot of the owner's permissions is always updated, whether you supply the `role_descriptors` parameter or not.\nThe structure of a role descriptor is the same as the request for the create API keys API.", - }) - ), - metadata: z.optional(types_metadata), - expiration: z.optional(types_duration), - }) - ), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.optional(z.object({ + role_descriptors: z.optional(z.record(z.string(), security_types_role_descriptor).register(z.globalRegistry, { + description: 'The role descriptors to assign to this API key.\nThe API key\'s effective permissions are an intersection of its assigned privileges and the point in time snapshot of permissions of the owner user.\nYou can assign new privileges by specifying them in this parameter.\nTo remove assigned privileges, you can supply an empty `role_descriptors` parameter, that is to say, an empty object `{}`.\nIf an API key has no assigned privileges, it inherits the owner user\'s full permissions.\nThe snapshot of the owner\'s permissions is always updated, whether you supply the `role_descriptors` parameter or not.\nThe structure of a role descriptor is the same as the request for the create API keys API.' + })), + metadata: z.optional(types_metadata), + expiration: z.optional(types_duration) + })), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const security_update_api_key_response = z.object({ - updated: z.boolean().register(z.globalRegistry, { - description: - "If `true`, the API key was updated.\nIf `false`, the API key didn't change because no change was detected.", - }), + updated: z.boolean().register(z.globalRegistry, { + description: 'If `true`, the API key was updated.\nIf `false`, the API key didn\'t change because no change was detected.' + }) }); export const security_update_cross_cluster_api_key_request = z.object({ - body: z.object({ - access: security_types_access, - expiration: z.optional(types_duration), - metadata: z.optional(types_metadata), - certificate_identity: z.optional( - z.string().register(z.globalRegistry, { - description: - "The certificate identity to associate with this API key.\nThis field is used to restrict the API key to connections authenticated by a specific TLS certificate.\nThe value should match the certificate's distinguished name (DN) pattern.\nWhen specified, this fully replaces any previously assigned certificate identity.\nTo clear an existing certificate identity, explicitly set this field to `null`.\nWhen omitted, the existing certificate identity remains unchanged.", - }) - ), - }), - path: z.object({ - id: types_id, - }), - query: z.optional(z.never()), + body: z.object({ + access: security_types_access, + expiration: z.optional(types_duration), + metadata: z.optional(types_metadata), + certificate_identity: z.optional(z.string().register(z.globalRegistry, { + description: 'The certificate identity to associate with this API key.\nThis field is used to restrict the API key to connections authenticated by a specific TLS certificate.\nThe value should match the certificate\'s distinguished name (DN) pattern.\nWhen specified, this fully replaces any previously assigned certificate identity.\nTo clear an existing certificate identity, explicitly set this field to `null`.\nWhen omitted, the existing certificate identity remains unchanged.' + })) + }), + path: z.object({ + id: types_id + }), + query: z.optional(z.never()) }); export const security_update_cross_cluster_api_key_response = z.object({ - updated: z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the API key was updated.\nIf `false`, the API key didn’t change because no change was detected.', - }), + updated: z.boolean().register(z.globalRegistry, { + description: 'If `true`, the API key was updated.\nIf `false`, the API key didn’t change because no change was detected.' + }) }); export const simulate_ingest_request = z.object({ - body: simulate_ingest, - path: z.optional(z.never()), - query: z.optional( - z.object({ - pipeline: z.optional(types_pipeline_name), - merge_type: z.optional(simulate_ingest_merge_type), - }) - ), + body: simulate_ingest, + path: z.optional(z.never()), + query: z.optional(z.object({ + pipeline: z.optional(types_pipeline_name), + merge_type: z.optional(simulate_ingest_merge_type) + })) }); export const simulate_ingest_response = z.object({ - docs: z.array(simulate_ingest_simulate_ingest_document_result), + docs: z.array(simulate_ingest_simulate_ingest_document_result) }); export const simulate_ingest1_request = z.object({ - body: simulate_ingest, - path: z.optional(z.never()), - query: z.optional( - z.object({ - pipeline: z.optional(types_pipeline_name), - merge_type: z.optional(simulate_ingest_merge_type), - }) - ), + body: simulate_ingest, + path: z.optional(z.never()), + query: z.optional(z.object({ + pipeline: z.optional(types_pipeline_name), + merge_type: z.optional(simulate_ingest_merge_type) + })) }); export const simulate_ingest1_response = z.object({ - docs: z.array(simulate_ingest_simulate_ingest_document_result), + docs: z.array(simulate_ingest_simulate_ingest_document_result) }); export const simulate_ingest2_request = z.object({ - body: simulate_ingest, - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - pipeline: z.optional(types_pipeline_name), - merge_type: z.optional(simulate_ingest_merge_type), - }) - ), + body: simulate_ingest, + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + pipeline: z.optional(types_pipeline_name), + merge_type: z.optional(simulate_ingest_merge_type) + })) }); export const simulate_ingest2_response = z.object({ - docs: z.array(simulate_ingest_simulate_ingest_document_result), + docs: z.array(simulate_ingest_simulate_ingest_document_result) }); export const simulate_ingest3_request = z.object({ - body: simulate_ingest, - path: z.object({ - index: types_index_name, - }), - query: z.optional( - z.object({ - pipeline: z.optional(types_pipeline_name), - merge_type: z.optional(simulate_ingest_merge_type), - }) - ), + body: simulate_ingest, + path: z.object({ + index: types_index_name + }), + query: z.optional(z.object({ + pipeline: z.optional(types_pipeline_name), + merge_type: z.optional(simulate_ingest_merge_type) + })) }); export const simulate_ingest3_response = z.object({ - docs: z.array(simulate_ingest_simulate_ingest_document_result), + docs: z.array(simulate_ingest_simulate_ingest_document_result) }); export const snapshot_restore_request = z.object({ - body: z.optional( - z.object({ - feature_states: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'The feature states to restore.\nIf `include_global_state` is `true`, the request restores all feature states in the snapshot by default.\nIf `include_global_state` is `false`, the request restores no feature states by default.\nNote that specifying an empty array will result in the default behavior.\nTo restore no feature states, regardless of the `include_global_state` value, specify an array containing only the value `none` (`["none"]`).', - }) - ), - ignore_index_settings: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - "The index settings to not restore from the snapshot.\nYou can't use this option to ignore `index.number_of_shards`.\n\nFor data streams, this option applies only to restored backing indices.\nNew backing indices are configured using the data stream's matching index template.", - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `true`, the request ignores any index or data stream in indices that's missing from the snapshot.\nIf `false`, the request returns an error for any missing index or data stream.", - }) - ), - include_aliases: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request restores aliases for any restored data streams and indices.\nIf `false`, the request doesn’t restore aliases.', - }) - ), - include_global_state: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, restore the cluster state. The cluster state includes:\n\n* Persistent cluster settings\n* Index templates\n* Legacy index templates\n* Ingest pipelines\n* Index lifecycle management (ILM) policies\n* Stored scripts\n* For snapshots taken after 7.12.0, feature states\n\nIf `include_global_state` is `true`, the restore operation merges the legacy index templates in your cluster with the templates contained in the snapshot, replacing any existing ones whose name matches one in the snapshot.\nIt completely removes all persistent settings, non-legacy index templates, ingest pipelines, and ILM lifecycle policies that exist in your cluster and replaces them with the corresponding items from the snapshot.\n\nUse the `feature_states` parameter to configure how feature states are restored.\n\nIf `include_global_state` is `true` and a snapshot was created without a global state then the restore request will fail.', - }) - ), - index_settings: z.optional(indices_types_index_settings), - indices: z.optional(types_indices), - partial: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available.\n\nIf true, it allows restoring a partial snapshot of indices with unavailable shards.\nOnly shards that were successfully included in the snapshot will be restored.\nAll missing shards will be recreated as empty.', - }) - ), - rename_pattern: z.optional( - z.string().register(z.globalRegistry, { - description: - 'A rename pattern to apply to restored data streams and indices.\nData streams and indices matching the rename pattern will be renamed according to `rename_replacement`.\n\nThe rename pattern is applied as defined by the regular expression that supports referencing the original text, according to the `appendReplacement` logic.', - }) - ), - rename_replacement: z.optional( - z.string().register(z.globalRegistry, { - description: 'The rename replacement string that is used with the `rename_pattern`.', - }) - ), - }) - ), - path: z.object({ - repository: types_name, - snapshot: types_name, - }), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request returns a response when the restore operation completes.\nThe operation is complete when it finishes all attempts to recover primary shards for restored indices.\nThis applies even if one or more of the recovery attempts fail.\n\nIf `false`, the request returns a response when the restore operation initializes.', - }) - ), - }) - ), + body: z.optional(z.object({ + feature_states: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The feature states to restore.\nIf `include_global_state` is `true`, the request restores all feature states in the snapshot by default.\nIf `include_global_state` is `false`, the request restores no feature states by default.\nNote that specifying an empty array will result in the default behavior.\nTo restore no feature states, regardless of the `include_global_state` value, specify an array containing only the value `none` (`["none"]`).' + })), + ignore_index_settings: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The index settings to not restore from the snapshot.\nYou can\'t use this option to ignore `index.number_of_shards`.\n\nFor data streams, this option applies only to restored backing indices.\nNew backing indices are configured using the data stream\'s matching index template.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request ignores any index or data stream in indices that\'s missing from the snapshot.\nIf `false`, the request returns an error for any missing index or data stream.' + })), + include_aliases: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request restores aliases for any restored data streams and indices.\nIf `false`, the request doesn’t restore aliases.' + })), + include_global_state: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, restore the cluster state. The cluster state includes:\n\n* Persistent cluster settings\n* Index templates\n* Legacy index templates\n* Ingest pipelines\n* Index lifecycle management (ILM) policies\n* Stored scripts\n* For snapshots taken after 7.12.0, feature states\n\nIf `include_global_state` is `true`, the restore operation merges the legacy index templates in your cluster with the templates contained in the snapshot, replacing any existing ones whose name matches one in the snapshot.\nIt completely removes all persistent settings, non-legacy index templates, ingest pipelines, and ILM lifecycle policies that exist in your cluster and replaces them with the corresponding items from the snapshot.\n\nUse the `feature_states` parameter to configure how feature states are restored.\n\nIf `include_global_state` is `true` and a snapshot was created without a global state then the restore request will fail.' + })), + index_settings: z.optional(indices_types_index_settings), + indices: z.optional(types_indices), + partial: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available.\n\nIf true, it allows restoring a partial snapshot of indices with unavailable shards.\nOnly shards that were successfully included in the snapshot will be restored.\nAll missing shards will be recreated as empty.' + })), + rename_pattern: z.optional(z.string().register(z.globalRegistry, { + description: 'A rename pattern to apply to restored data streams and indices.\nData streams and indices matching the rename pattern will be renamed according to `rename_replacement`.\n\nThe rename pattern is applied as defined by the regular expression that supports referencing the original text, according to the `appendReplacement` logic.' + })), + rename_replacement: z.optional(z.string().register(z.globalRegistry, { + description: 'The rename replacement string that is used with the `rename_pattern`.' + })) + })), + path: z.object({ + repository: types_name, + snapshot: types_name + }), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request returns a response when the restore operation completes.\nThe operation is complete when it finishes all attempts to recover primary shards for restored indices.\nThis applies even if one or more of the recovery attempts fail.\n\nIf `false`, the request returns a response when the restore operation initializes.' + })) + })) }); export const snapshot_restore_response = z.object({ - accepted: z.optional(z.boolean()), - snapshot: z.optional(snapshot_restore_snapshot_restore), + accepted: z.optional(z.boolean()), + snapshot: z.optional(snapshot_restore_snapshot_restore) }); export const sql_query1_request = z.object({ - body: sql_query, - path: z.optional(z.never()), - query: z.optional( - z.object({ - format: z.optional(sql_query_sql_format), - }) - ), + body: sql_query, + path: z.optional(z.never()), + query: z.optional(z.object({ + format: z.optional(sql_query_sql_format) + })) }); export const sql_query1_response = z.object({ - columns: z.optional( - z.array(sql_types_column).register(z.globalRegistry, { - description: 'Column headings for the search results. Each object is a column.', - }) - ), - cursor: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The cursor for the next set of paginated results.\nFor CSV, TSV, and TXT responses, this value is returned in the `Cursor` HTTP header.', - }) - ), - id: z.optional(types_id), - is_running: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the search is still running.\nIf `false`, the search has finished.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header.', - }) - ), - is_partial: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response does not contain complete search results.\nIf `is_partial` is `true` and `is_running` is `true`, the search is still running.\nIf `is_partial` is `true` but `is_running` is `false`, the results are partial due to a failure or timeout.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header.', + columns: z.optional(z.array(sql_types_column).register(z.globalRegistry, { + description: 'Column headings for the search results. Each object is a column.' + })), + cursor: z.optional(z.string().register(z.globalRegistry, { + description: 'The cursor for the next set of paginated results.\nFor CSV, TSV, and TXT responses, this value is returned in the `Cursor` HTTP header.' + })), + id: z.optional(types_id), + is_running: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the search is still running.\nIf `false`, the search has finished.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header.' + })), + is_partial: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response does not contain complete search results.\nIf `is_partial` is `true` and `is_running` is `true`, the search is still running.\nIf `is_partial` is `true` but `is_running` is `false`, the results are partial due to a failure or timeout.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header.' + })), + rows: z.array(sql_types_row).register(z.globalRegistry, { + description: 'The values for the search results.' }) - ), - rows: z.array(sql_types_row).register(z.globalRegistry, { - description: 'The values for the search results.', - }), }); export const sql_query_request = z.object({ - body: sql_query, - path: z.optional(z.never()), - query: z.optional( - z.object({ - format: z.optional(sql_query_sql_format), - }) - ), + body: sql_query, + path: z.optional(z.never()), + query: z.optional(z.object({ + format: z.optional(sql_query_sql_format) + })) }); export const sql_query_response = z.object({ - columns: z.optional( - z.array(sql_types_column).register(z.globalRegistry, { - description: 'Column headings for the search results. Each object is a column.', - }) - ), - cursor: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The cursor for the next set of paginated results.\nFor CSV, TSV, and TXT responses, this value is returned in the `Cursor` HTTP header.', - }) - ), - id: z.optional(types_id), - is_running: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the search is still running.\nIf `false`, the search has finished.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header.', - }) - ), - is_partial: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response does not contain complete search results.\nIf `is_partial` is `true` and `is_running` is `true`, the search is still running.\nIf `is_partial` is `true` but `is_running` is `false`, the results are partial due to a failure or timeout.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header.', + columns: z.optional(z.array(sql_types_column).register(z.globalRegistry, { + description: 'Column headings for the search results. Each object is a column.' + })), + cursor: z.optional(z.string().register(z.globalRegistry, { + description: 'The cursor for the next set of paginated results.\nFor CSV, TSV, and TXT responses, this value is returned in the `Cursor` HTTP header.' + })), + id: z.optional(types_id), + is_running: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the search is still running.\nIf `false`, the search has finished.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header.' + })), + is_partial: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response does not contain complete search results.\nIf `is_partial` is `true` and `is_running` is `true`, the search is still running.\nIf `is_partial` is `true` but `is_running` is `false`, the results are partial due to a failure or timeout.\nThis value is returned only for async and saved synchronous searches.\nFor CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header.' + })), + rows: z.array(sql_types_row).register(z.globalRegistry, { + description: 'The values for the search results.' }) - ), - rows: z.array(sql_types_row).register(z.globalRegistry, { - description: 'The values for the search results.', - }), }); export const sql_translate1_request = z.object({ - body: sql_translate, - path: z.optional(z.never()), - query: z.optional(z.never()), + body: sql_translate, + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const sql_translate1_response = z.object({ - aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container)), - size: z.optional(z.number()), - _source: z.optional(global_search_types_source_config), - fields: z.optional(z.array(types_query_dsl_field_and_format)), - query: z.optional(types_query_dsl_query_container), - sort: z.optional(types_sort), - track_total_hits: z.optional(global_search_types_track_hits), + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container)), + size: z.optional(z.number()), + _source: z.optional(global_search_types_source_config), + fields: z.optional(z.array(types_query_dsl_field_and_format)), + query: z.optional(types_query_dsl_query_container), + sort: z.optional(types_sort), + track_total_hits: z.optional(global_search_types_track_hits) }); export const sql_translate_request = z.object({ - body: sql_translate, - path: z.optional(z.never()), - query: z.optional(z.never()), + body: sql_translate, + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const sql_translate_response = z.object({ - aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container)), - size: z.optional(z.number()), - _source: z.optional(global_search_types_source_config), - fields: z.optional(z.array(types_query_dsl_field_and_format)), - query: z.optional(types_query_dsl_query_container), - sort: z.optional(types_sort), - track_total_hits: z.optional(global_search_types_track_hits), + aggregations: z.optional(z.record(z.string(), types_aggregations_aggregation_container)), + size: z.optional(z.number()), + _source: z.optional(global_search_types_source_config), + fields: z.optional(z.array(types_query_dsl_field_and_format)), + query: z.optional(types_query_dsl_query_container), + sort: z.optional(types_sort), + track_total_hits: z.optional(global_search_types_track_hits) }); export const terms_enum_request = z.object({ - body: terms_enum, - path: z.object({ - index: types_indices, - }), - query: z.optional(z.never()), + body: terms_enum, + path: z.object({ + index: types_indices + }), + query: z.optional(z.never()) }); export const terms_enum_response = z.object({ - _shards: types_shard_statistics, - terms: z.array(z.string()), - complete: z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the returned terms set may be incomplete and should be treated as approximate.\nThis can occur due to a few reasons, such as a request timeout or a node error.', - }), + _shards: types_shard_statistics, + terms: z.array(z.string()), + complete: z.boolean().register(z.globalRegistry, { + description: 'If `false`, the returned terms set may be incomplete and should be treated as approximate.\nThis can occur due to a few reasons, such as a request timeout or a node error.' + }) }); export const terms_enum1_request = z.object({ - body: terms_enum, - path: z.object({ - index: types_indices, - }), - query: z.optional(z.never()), + body: terms_enum, + path: z.object({ + index: types_indices + }), + query: z.optional(z.never()) }); export const terms_enum1_response = z.object({ - _shards: types_shard_statistics, - terms: z.array(z.string()), - complete: z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the returned terms set may be incomplete and should be treated as approximate.\nThis can occur due to a few reasons, such as a request timeout or a node error.', - }), + _shards: types_shard_statistics, + terms: z.array(z.string()), + complete: z.boolean().register(z.globalRegistry, { + description: 'If `false`, the returned terms set may be incomplete and should be treated as approximate.\nThis can occur due to a few reasons, such as a request timeout or a node error.' + }) }); export const text_structure_find_field_structure_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.object({ - column_names: z.optional(z.union([z.string(), z.array(z.string())])), - delimiter: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If you have set `format` to `delimited`, you can specify the character used to delimit the values in each row.\nOnly a single character is supported; the delimiter cannot have multiple characters.\nBy default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`).\nIn this default scenario, all rows must have the same number of fields for the delimited format to be detected.\nIf you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row.', - }) - ), - documents_to_sample: z.optional(types_uint), - ecs_compatibility: z.optional(text_structure_types_ecs_compatibility_type), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the response includes a field named `explanation`, which is an array of strings that indicate how the structure finder produced its result.', - }) - ), - field: types_field, - format: z.optional(text_structure_types_format_type), - grok_pattern: z.optional(types_grok_pattern), - index: types_index_name, - quote: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If the format is `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character.\nOnly a single character is supported.\nIf this parameter is not specified, the default value is a double quote (`"`).\nIf your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample.', - }) - ), - should_trim_fields: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If the format is `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them.\nIf this parameter is not specified and the delimiter is pipe (`|`), the default value is true.\nOtherwise, the default value is `false`.', - }) - ), - timeout: z.optional(types_duration), - timestamp_field: z.optional(types_field), - timestamp_format: z.optional( - z.string().register(z.globalRegistry, { - description: - "The Java time format of the timestamp field in the text.\nOnly a subset of Java time format letter groups are supported:\n\n* `a`\n* `d`\n* `dd`\n* `EEE`\n* `EEEE`\n* `H`\n* `HH`\n* `h`\n* `M`\n* `MM`\n* `MMM`\n* `MMMM`\n* `mm`\n* `ss`\n* `XX`\n* `XXX`\n* `yy`\n* `yyyy`\n* `zzz`\n\nAdditionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and are separated from the `ss` by a period (`.`), comma (`,`), or colon (`:`).\nSpacing and punctuation is also permitted with the exception a question mark (`?`), newline, and carriage return, together with literal text enclosed in single quotes.\nFor example, `MM/dd HH.mm.ss,SSSSSS 'in' yyyy` is a valid override format.\n\nOne valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`.\nAnother is when the timestamp format is one that the structure finder does not consider by default.\n\nIf this parameter is not specified, the structure finder chooses the best format from a built-in set.\n\nIf the special value `null` is specified, the structure finder will not look for a primary timestamp in the text.\nWhen the format is semi-structured text, this will result in the structure finder treating the text as single-line messages.", - }) - ), - }), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.object({ + column_names: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + delimiter: z.optional(z.string().register(z.globalRegistry, { + description: 'If you have set `format` to `delimited`, you can specify the character used to delimit the values in each row.\nOnly a single character is supported; the delimiter cannot have multiple characters.\nBy default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`).\nIn this default scenario, all rows must have the same number of fields for the delimited format to be detected.\nIf you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row.' + })), + documents_to_sample: z.optional(types_uint), + ecs_compatibility: z.optional(text_structure_types_ecs_compatibility_type), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the response includes a field named `explanation`, which is an array of strings that indicate how the structure finder produced its result.' + })), + field: types_field, + format: z.optional(text_structure_types_format_type), + grok_pattern: z.optional(types_grok_pattern), + index: types_index_name, + quote: z.optional(z.string().register(z.globalRegistry, { + description: 'If the format is `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character.\nOnly a single character is supported.\nIf this parameter is not specified, the default value is a double quote (`"`).\nIf your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample.' + })), + should_trim_fields: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If the format is `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them.\nIf this parameter is not specified and the delimiter is pipe (`|`), the default value is true.\nOtherwise, the default value is `false`.' + })), + timeout: z.optional(types_duration), + timestamp_field: z.optional(types_field), + timestamp_format: z.optional(z.string().register(z.globalRegistry, { + description: 'The Java time format of the timestamp field in the text.\nOnly a subset of Java time format letter groups are supported:\n\n* `a`\n* `d`\n* `dd`\n* `EEE`\n* `EEEE`\n* `H`\n* `HH`\n* `h`\n* `M`\n* `MM`\n* `MMM`\n* `MMMM`\n* `mm`\n* `ss`\n* `XX`\n* `XXX`\n* `yy`\n* `yyyy`\n* `zzz`\n\nAdditionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and are separated from the `ss` by a period (`.`), comma (`,`), or colon (`:`).\nSpacing and punctuation is also permitted with the exception a question mark (`?`), newline, and carriage return, together with literal text enclosed in single quotes.\nFor example, `MM/dd HH.mm.ss,SSSSSS \'in\' yyyy` is a valid override format.\n\nOne valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`.\nAnother is when the timestamp format is one that the structure finder does not consider by default.\n\nIf this parameter is not specified, the structure finder chooses the best format from a built-in set.\n\nIf the special value `null` is specified, the structure finder will not look for a primary timestamp in the text.\nWhen the format is semi-structured text, this will result in the structure finder treating the text as single-line messages.' + })) + }) }); export const text_structure_find_field_structure_response = z.object({ - charset: z.string(), - ecs_compatibility: z.optional(text_structure_types_ecs_compatibility_type), - field_stats: z.record(z.string(), text_structure_types_field_stat), - format: text_structure_types_format_type, - grok_pattern: z.optional(types_grok_pattern), - java_timestamp_formats: z.optional(z.array(z.string())), - joda_timestamp_formats: z.optional(z.array(z.string())), - ingest_pipeline: ingest_types_pipeline_config, - mappings: types_mapping_type_mapping, - multiline_start_pattern: z.optional(z.string()), - need_client_timezone: z.boolean(), - num_lines_analyzed: z.number(), - num_messages_analyzed: z.number(), - sample_start: z.string(), - timestamp_field: z.optional(types_field), + charset: z.string(), + ecs_compatibility: z.optional(text_structure_types_ecs_compatibility_type), + field_stats: z.record(z.string(), text_structure_types_field_stat), + format: text_structure_types_format_type, + grok_pattern: z.optional(types_grok_pattern), + java_timestamp_formats: z.optional(z.array(z.string())), + joda_timestamp_formats: z.optional(z.array(z.string())), + ingest_pipeline: ingest_types_pipeline_config, + mappings: types_mapping_type_mapping, + multiline_start_pattern: z.optional(z.string()), + need_client_timezone: z.boolean(), + num_lines_analyzed: z.number(), + num_messages_analyzed: z.number(), + sample_start: z.string(), + timestamp_field: z.optional(types_field) }); export const text_structure_find_message_structure_request = z.object({ - body: text_structure_find_message_structure, - path: z.optional(z.never()), - query: z.optional( - z.object({ - column_names: z.optional(z.union([z.string(), z.array(z.string())])), - delimiter: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If you the format is `delimited`, you can specify the character used to delimit the values in each row.\nOnly a single character is supported; the delimiter cannot have multiple characters.\nBy default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`).\nIn this default scenario, all rows must have the same number of fields for the delimited format to be detected.\nIf you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row.', - }) - ), - ecs_compatibility: z.optional(text_structure_types_ecs_compatibility_type), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If this parameter is set to true, the response includes a field named `explanation`, which is an array of strings that indicate how the structure finder produced its result.', - }) - ), - format: z.optional(text_structure_types_format_type), - grok_pattern: z.optional(types_grok_pattern), - quote: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If the format is `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character.\nOnly a single character is supported.\nIf this parameter is not specified, the default value is a double quote (`"`).\nIf your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample.', - }) - ), - should_trim_fields: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If the format is `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them.\nIf this parameter is not specified and the delimiter is pipe (`|`), the default value is true.\nOtherwise, the default value is `false`.', - }) - ), - timeout: z.optional(types_duration), - timestamp_field: z.optional(types_field), - timestamp_format: z.optional( - z.string().register(z.globalRegistry, { - description: - "The Java time format of the timestamp field in the text.\nOnly a subset of Java time format letter groups are supported:\n\n* `a`\n* `d`\n* `dd`\n* `EEE`\n* `EEEE`\n* `H`\n* `HH`\n* `h`\n* `M`\n* `MM`\n* `MMM`\n* `MMMM`\n* `mm`\n* `ss`\n* `XX`\n* `XXX`\n* `yy`\n* `yyyy`\n* `zzz`\n\nAdditionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and are separated from the `ss` by a period (`.`), comma (`,`), or colon (`:`).\nSpacing and punctuation is also permitted with the exception a question mark (`?`), newline, and carriage return, together with literal text enclosed in single quotes.\nFor example, `MM/dd HH.mm.ss,SSSSSS 'in' yyyy` is a valid override format.\n\nOne valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`.\nAnother is when the timestamp format is one that the structure finder does not consider by default.\n\nIf this parameter is not specified, the structure finder chooses the best format from a built-in set.\n\nIf the special value `null` is specified, the structure finder will not look for a primary timestamp in the text.\nWhen the format is semi-structured text, this will result in the structure finder treating the text as single-line messages.", - }) - ), - }) - ), + body: text_structure_find_message_structure, + path: z.optional(z.never()), + query: z.optional(z.object({ + column_names: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + delimiter: z.optional(z.string().register(z.globalRegistry, { + description: 'If you the format is `delimited`, you can specify the character used to delimit the values in each row.\nOnly a single character is supported; the delimiter cannot have multiple characters.\nBy default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`).\nIn this default scenario, all rows must have the same number of fields for the delimited format to be detected.\nIf you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row.' + })), + ecs_compatibility: z.optional(text_structure_types_ecs_compatibility_type), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If this parameter is set to true, the response includes a field named `explanation`, which is an array of strings that indicate how the structure finder produced its result.' + })), + format: z.optional(text_structure_types_format_type), + grok_pattern: z.optional(types_grok_pattern), + quote: z.optional(z.string().register(z.globalRegistry, { + description: 'If the format is `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character.\nOnly a single character is supported.\nIf this parameter is not specified, the default value is a double quote (`"`).\nIf your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample.' + })), + should_trim_fields: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If the format is `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them.\nIf this parameter is not specified and the delimiter is pipe (`|`), the default value is true.\nOtherwise, the default value is `false`.' + })), + timeout: z.optional(types_duration), + timestamp_field: z.optional(types_field), + timestamp_format: z.optional(z.string().register(z.globalRegistry, { + description: 'The Java time format of the timestamp field in the text.\nOnly a subset of Java time format letter groups are supported:\n\n* `a`\n* `d`\n* `dd`\n* `EEE`\n* `EEEE`\n* `H`\n* `HH`\n* `h`\n* `M`\n* `MM`\n* `MMM`\n* `MMMM`\n* `mm`\n* `ss`\n* `XX`\n* `XXX`\n* `yy`\n* `yyyy`\n* `zzz`\n\nAdditionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and are separated from the `ss` by a period (`.`), comma (`,`), or colon (`:`).\nSpacing and punctuation is also permitted with the exception a question mark (`?`), newline, and carriage return, together with literal text enclosed in single quotes.\nFor example, `MM/dd HH.mm.ss,SSSSSS \'in\' yyyy` is a valid override format.\n\nOne valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`.\nAnother is when the timestamp format is one that the structure finder does not consider by default.\n\nIf this parameter is not specified, the structure finder chooses the best format from a built-in set.\n\nIf the special value `null` is specified, the structure finder will not look for a primary timestamp in the text.\nWhen the format is semi-structured text, this will result in the structure finder treating the text as single-line messages.' + })) + })) }); export const text_structure_find_message_structure_response = z.object({ - charset: z.string(), - ecs_compatibility: z.optional(text_structure_types_ecs_compatibility_type), - field_stats: z.record(z.string(), text_structure_types_field_stat), - format: text_structure_types_format_type, - grok_pattern: z.optional(types_grok_pattern), - java_timestamp_formats: z.optional(z.array(z.string())), - joda_timestamp_formats: z.optional(z.array(z.string())), - ingest_pipeline: ingest_types_pipeline_config, - mappings: types_mapping_type_mapping, - multiline_start_pattern: z.optional(z.string()), - need_client_timezone: z.boolean(), - num_lines_analyzed: z.number(), - num_messages_analyzed: z.number(), - sample_start: z.string(), - timestamp_field: z.optional(types_field), + charset: z.string(), + ecs_compatibility: z.optional(text_structure_types_ecs_compatibility_type), + field_stats: z.record(z.string(), text_structure_types_field_stat), + format: text_structure_types_format_type, + grok_pattern: z.optional(types_grok_pattern), + java_timestamp_formats: z.optional(z.array(z.string())), + joda_timestamp_formats: z.optional(z.array(z.string())), + ingest_pipeline: ingest_types_pipeline_config, + mappings: types_mapping_type_mapping, + multiline_start_pattern: z.optional(z.string()), + need_client_timezone: z.boolean(), + num_lines_analyzed: z.number(), + num_messages_analyzed: z.number(), + sample_start: z.string(), + timestamp_field: z.optional(types_field) }); export const text_structure_find_message_structure1_request = z.object({ - body: text_structure_find_message_structure, - path: z.optional(z.never()), - query: z.optional( - z.object({ - column_names: z.optional(z.union([z.string(), z.array(z.string())])), - delimiter: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If you the format is `delimited`, you can specify the character used to delimit the values in each row.\nOnly a single character is supported; the delimiter cannot have multiple characters.\nBy default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`).\nIn this default scenario, all rows must have the same number of fields for the delimited format to be detected.\nIf you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row.', - }) - ), - ecs_compatibility: z.optional(text_structure_types_ecs_compatibility_type), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If this parameter is set to true, the response includes a field named `explanation`, which is an array of strings that indicate how the structure finder produced its result.', - }) - ), - format: z.optional(text_structure_types_format_type), - grok_pattern: z.optional(types_grok_pattern), - quote: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If the format is `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character.\nOnly a single character is supported.\nIf this parameter is not specified, the default value is a double quote (`"`).\nIf your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample.', - }) - ), - should_trim_fields: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If the format is `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them.\nIf this parameter is not specified and the delimiter is pipe (`|`), the default value is true.\nOtherwise, the default value is `false`.', - }) - ), - timeout: z.optional(types_duration), - timestamp_field: z.optional(types_field), - timestamp_format: z.optional( - z.string().register(z.globalRegistry, { - description: - "The Java time format of the timestamp field in the text.\nOnly a subset of Java time format letter groups are supported:\n\n* `a`\n* `d`\n* `dd`\n* `EEE`\n* `EEEE`\n* `H`\n* `HH`\n* `h`\n* `M`\n* `MM`\n* `MMM`\n* `MMMM`\n* `mm`\n* `ss`\n* `XX`\n* `XXX`\n* `yy`\n* `yyyy`\n* `zzz`\n\nAdditionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and are separated from the `ss` by a period (`.`), comma (`,`), or colon (`:`).\nSpacing and punctuation is also permitted with the exception a question mark (`?`), newline, and carriage return, together with literal text enclosed in single quotes.\nFor example, `MM/dd HH.mm.ss,SSSSSS 'in' yyyy` is a valid override format.\n\nOne valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`.\nAnother is when the timestamp format is one that the structure finder does not consider by default.\n\nIf this parameter is not specified, the structure finder chooses the best format from a built-in set.\n\nIf the special value `null` is specified, the structure finder will not look for a primary timestamp in the text.\nWhen the format is semi-structured text, this will result in the structure finder treating the text as single-line messages.", - }) - ), - }) - ), + body: text_structure_find_message_structure, + path: z.optional(z.never()), + query: z.optional(z.object({ + column_names: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + delimiter: z.optional(z.string().register(z.globalRegistry, { + description: 'If you the format is `delimited`, you can specify the character used to delimit the values in each row.\nOnly a single character is supported; the delimiter cannot have multiple characters.\nBy default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`).\nIn this default scenario, all rows must have the same number of fields for the delimited format to be detected.\nIf you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row.' + })), + ecs_compatibility: z.optional(text_structure_types_ecs_compatibility_type), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If this parameter is set to true, the response includes a field named `explanation`, which is an array of strings that indicate how the structure finder produced its result.' + })), + format: z.optional(text_structure_types_format_type), + grok_pattern: z.optional(types_grok_pattern), + quote: z.optional(z.string().register(z.globalRegistry, { + description: 'If the format is `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character.\nOnly a single character is supported.\nIf this parameter is not specified, the default value is a double quote (`"`).\nIf your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample.' + })), + should_trim_fields: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If the format is `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them.\nIf this parameter is not specified and the delimiter is pipe (`|`), the default value is true.\nOtherwise, the default value is `false`.' + })), + timeout: z.optional(types_duration), + timestamp_field: z.optional(types_field), + timestamp_format: z.optional(z.string().register(z.globalRegistry, { + description: 'The Java time format of the timestamp field in the text.\nOnly a subset of Java time format letter groups are supported:\n\n* `a`\n* `d`\n* `dd`\n* `EEE`\n* `EEEE`\n* `H`\n* `HH`\n* `h`\n* `M`\n* `MM`\n* `MMM`\n* `MMMM`\n* `mm`\n* `ss`\n* `XX`\n* `XXX`\n* `yy`\n* `yyyy`\n* `zzz`\n\nAdditionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and are separated from the `ss` by a period (`.`), comma (`,`), or colon (`:`).\nSpacing and punctuation is also permitted with the exception a question mark (`?`), newline, and carriage return, together with literal text enclosed in single quotes.\nFor example, `MM/dd HH.mm.ss,SSSSSS \'in\' yyyy` is a valid override format.\n\nOne valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`.\nAnother is when the timestamp format is one that the structure finder does not consider by default.\n\nIf this parameter is not specified, the structure finder chooses the best format from a built-in set.\n\nIf the special value `null` is specified, the structure finder will not look for a primary timestamp in the text.\nWhen the format is semi-structured text, this will result in the structure finder treating the text as single-line messages.' + })) + })) }); export const text_structure_find_message_structure1_response = z.object({ - charset: z.string(), - ecs_compatibility: z.optional(text_structure_types_ecs_compatibility_type), - field_stats: z.record(z.string(), text_structure_types_field_stat), - format: text_structure_types_format_type, - grok_pattern: z.optional(types_grok_pattern), - java_timestamp_formats: z.optional(z.array(z.string())), - joda_timestamp_formats: z.optional(z.array(z.string())), - ingest_pipeline: ingest_types_pipeline_config, - mappings: types_mapping_type_mapping, - multiline_start_pattern: z.optional(z.string()), - need_client_timezone: z.boolean(), - num_lines_analyzed: z.number(), - num_messages_analyzed: z.number(), - sample_start: z.string(), - timestamp_field: z.optional(types_field), + charset: z.string(), + ecs_compatibility: z.optional(text_structure_types_ecs_compatibility_type), + field_stats: z.record(z.string(), text_structure_types_field_stat), + format: text_structure_types_format_type, + grok_pattern: z.optional(types_grok_pattern), + java_timestamp_formats: z.optional(z.array(z.string())), + joda_timestamp_formats: z.optional(z.array(z.string())), + ingest_pipeline: ingest_types_pipeline_config, + mappings: types_mapping_type_mapping, + multiline_start_pattern: z.optional(z.string()), + need_client_timezone: z.boolean(), + num_lines_analyzed: z.number(), + num_messages_analyzed: z.number(), + sample_start: z.string(), + timestamp_field: z.optional(types_field) }); export const text_structure_find_structure_request = z.object({ - body: z.array(z.record(z.string(), z.unknown())), - path: z.optional(z.never()), - query: z.optional( - z.object({ - charset: z.optional( - z.string().register(z.globalRegistry, { - description: - "The text's character set.\nIt must be a character set that is supported by the JVM that Elasticsearch uses.\nFor example, `UTF-8`, `UTF-16LE`, `windows-1252`, or `EUC-JP`.\nIf this parameter is not specified, the structure finder chooses an appropriate character set.", - }) - ), - column_names: z.optional(z.union([z.string(), z.array(z.string())])), - delimiter: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If you have set `format` to `delimited`, you can specify the character used to delimit the values in each row.\nOnly a single character is supported; the delimiter cannot have multiple characters.\nBy default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`).\nIn this default scenario, all rows must have the same number of fields for the delimited format to be detected.\nIf you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row.', - }) - ), - ecs_compatibility: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The mode of compatibility with ECS compliant Grok patterns.\nUse this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.\nValid values are `disabled` and `v1`.\nThis setting primarily has an impact when a whole message Grok pattern such as `%{CATALINALOG}` matches the input.\nIf the structure finder identifies a common structure but has no idea of meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output, with the intention that a user who knows the meanings rename these fields before using it.', - }) - ), - explain: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If this parameter is set to `true`, the response includes a field named explanation, which is an array of strings that indicate how the structure finder produced its result.\nIf the structure finder produces unexpected results for some text, use this query parameter to help you determine why the returned structure was chosen.', - }) - ), - format: z.optional(text_structure_find_structure_find_structure_format), - grok_pattern: z.optional(types_grok_pattern), - has_header_row: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If you have set `format` to `delimited`, you can use this parameter to indicate whether the column names are in the first row of the text.\nIf this parameter is not specified, the structure finder guesses based on the similarity of the first row of the text to other rows.', - }) - ), - line_merge_size_limit: z.optional(types_uint), - lines_to_sample: z.optional(types_uint), - quote: z.optional( - z.string().register(z.globalRegistry, { - description: - 'If you have set `format` to `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character.\nOnly a single character is supported.\nIf this parameter is not specified, the default value is a double quote (`"`).\nIf your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample.', - }) - ), - should_trim_fields: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If you have set `format` to `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them.\nIf this parameter is not specified and the delimiter is pipe (`|`), the default value is `true`.\nOtherwise, the default value is `false`.', - }) - ), - timeout: z.optional(types_duration), - timestamp_field: z.optional(types_field), - timestamp_format: z.optional( - z.string().register(z.globalRegistry, { - description: - "The Java time format of the timestamp field in the text.\n\nOnly a subset of Java time format letter groups are supported:\n\n* `a`\n* `d`\n* `dd`\n* `EEE`\n* `EEEE`\n* `H`\n* `HH`\n* `h`\n* `M`\n* `MM`\n* `MMM`\n* `MMMM`\n* `mm`\n* `ss`\n* `XX`\n* `XXX`\n* `yy`\n* `yyyy`\n* `zzz`\n\nAdditionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and separated from the `ss` by a `.`, `,` or `:`.\nSpacing and punctuation is also permitted with the exception of `?`, newline and carriage return, together with literal text enclosed in single quotes.\nFor example, `MM/dd HH.mm.ss,SSSSSS 'in' yyyy` is a valid override format.\n\nOne valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`.\nAnother is when the timestamp format is one that the structure finder does not consider by default.\n\nIf this parameter is not specified, the structure finder chooses the best format from a built-in set.\n\nIf the special value `null` is specified the structure finder will not look for a primary timestamp in the text.\nWhen the format is semi-structured text this will result in the structure finder treating the text as single-line messages.", - }) - ), - }) - ), + body: z.array(z.record(z.string(), z.unknown())), + path: z.optional(z.never()), + query: z.optional(z.object({ + charset: z.optional(z.string().register(z.globalRegistry, { + description: 'The text\'s character set.\nIt must be a character set that is supported by the JVM that Elasticsearch uses.\nFor example, `UTF-8`, `UTF-16LE`, `windows-1252`, or `EUC-JP`.\nIf this parameter is not specified, the structure finder chooses an appropriate character set.' + })), + column_names: z.optional(z.union([ + z.string(), + z.array(z.string()) + ])), + delimiter: z.optional(z.string().register(z.globalRegistry, { + description: 'If you have set `format` to `delimited`, you can specify the character used to delimit the values in each row.\nOnly a single character is supported; the delimiter cannot have multiple characters.\nBy default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`).\nIn this default scenario, all rows must have the same number of fields for the delimited format to be detected.\nIf you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row.' + })), + ecs_compatibility: z.optional(z.string().register(z.globalRegistry, { + description: 'The mode of compatibility with ECS compliant Grok patterns.\nUse this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.\nValid values are `disabled` and `v1`.\nThis setting primarily has an impact when a whole message Grok pattern such as `%{CATALINALOG}` matches the input.\nIf the structure finder identifies a common structure but has no idea of meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output, with the intention that a user who knows the meanings rename these fields before using it.' + })), + explain: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If this parameter is set to `true`, the response includes a field named explanation, which is an array of strings that indicate how the structure finder produced its result.\nIf the structure finder produces unexpected results for some text, use this query parameter to help you determine why the returned structure was chosen.' + })), + format: z.optional(text_structure_find_structure_find_structure_format), + grok_pattern: z.optional(types_grok_pattern), + has_header_row: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If you have set `format` to `delimited`, you can use this parameter to indicate whether the column names are in the first row of the text.\nIf this parameter is not specified, the structure finder guesses based on the similarity of the first row of the text to other rows.' + })), + line_merge_size_limit: z.optional(types_uint), + lines_to_sample: z.optional(types_uint), + quote: z.optional(z.string().register(z.globalRegistry, { + description: 'If you have set `format` to `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character.\nOnly a single character is supported.\nIf this parameter is not specified, the default value is a double quote (`"`).\nIf your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample.' + })), + should_trim_fields: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If you have set `format` to `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them.\nIf this parameter is not specified and the delimiter is pipe (`|`), the default value is `true`.\nOtherwise, the default value is `false`.' + })), + timeout: z.optional(types_duration), + timestamp_field: z.optional(types_field), + timestamp_format: z.optional(z.string().register(z.globalRegistry, { + description: 'The Java time format of the timestamp field in the text.\n\nOnly a subset of Java time format letter groups are supported:\n\n* `a`\n* `d`\n* `dd`\n* `EEE`\n* `EEEE`\n* `H`\n* `HH`\n* `h`\n* `M`\n* `MM`\n* `MMM`\n* `MMMM`\n* `mm`\n* `ss`\n* `XX`\n* `XXX`\n* `yy`\n* `yyyy`\n* `zzz`\n\nAdditionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and separated from the `ss` by a `.`, `,` or `:`.\nSpacing and punctuation is also permitted with the exception of `?`, newline and carriage return, together with literal text enclosed in single quotes.\nFor example, `MM/dd HH.mm.ss,SSSSSS \'in\' yyyy` is a valid override format.\n\nOne valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`.\nAnother is when the timestamp format is one that the structure finder does not consider by default.\n\nIf this parameter is not specified, the structure finder chooses the best format from a built-in set.\n\nIf the special value `null` is specified the structure finder will not look for a primary timestamp in the text.\nWhen the format is semi-structured text this will result in the structure finder treating the text as single-line messages.' + })) + })) }); export const text_structure_find_structure_response = z.object({ - charset: z.string().register(z.globalRegistry, { - description: 'The character encoding used to parse the text.', - }), - has_header_row: z.optional(z.boolean()), - has_byte_order_marker: z.boolean().register(z.globalRegistry, { - description: - 'For UTF character encodings, it indicates whether the text begins with a byte order marker.', - }), - format: z.string().register(z.globalRegistry, { - description: 'Valid values include `ndjson`, `xml`, `delimited`, and `semi_structured_text`.', - }), - field_stats: z.record(z.string(), text_structure_types_field_stat).register(z.globalRegistry, { - description: - 'The most common values of each field, plus basic numeric statistics for the numeric `page_count` field.\nThis information may provide clues that the data needs to be cleaned or transformed prior to use by other Elastic Stack functionality.', - }), - sample_start: z.string().register(z.globalRegistry, { - description: - 'The first two messages in the text verbatim.\nThis may help diagnose parse errors or accidental uploads of the wrong text.', - }), - num_messages_analyzed: z.number().register(z.globalRegistry, { - description: - 'The number of distinct messages the lines contained.\nFor NDJSON, this value is the same as `num_lines_analyzed`.\nFor other text formats, messages can span several lines.', - }), - mappings: types_mapping_type_mapping, - quote: z.optional(z.string()), - delimiter: z.optional(z.string()), - need_client_timezone: z.boolean().register(z.globalRegistry, { - description: - 'If a timestamp format is detected that does not include a timezone, `need_client_timezone` is `true`.\nThe server that parses the text must therefore be told the correct timezone by the client.', - }), - num_lines_analyzed: z.number().register(z.globalRegistry, { - description: 'The number of lines of the text that were analyzed.', - }), - column_names: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'If `format` is `delimited`, the `column_names` field lists the column names in the order they appear in the sample.', - }) - ), - explanation: z.optional(z.array(z.string())), - grok_pattern: z.optional(types_grok_pattern), - multiline_start_pattern: z.optional(z.string()), - exclude_lines_pattern: z.optional(z.string()), - java_timestamp_formats: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: - 'The Java time formats recognized in the time fields.\nElasticsearch mappings and ingest pipelines use this format.', - }) - ), - joda_timestamp_formats: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'Information that is used to tell Logstash how to parse timestamps.', - }) - ), - timestamp_field: z.optional(types_field), - should_trim_fields: z.optional(z.boolean()), - ingest_pipeline: ingest_types_pipeline_config, + charset: z.string().register(z.globalRegistry, { + description: 'The character encoding used to parse the text.' + }), + has_header_row: z.optional(z.boolean()), + has_byte_order_marker: z.boolean().register(z.globalRegistry, { + description: 'For UTF character encodings, it indicates whether the text begins with a byte order marker.' + }), + format: z.string().register(z.globalRegistry, { + description: 'Valid values include `ndjson`, `xml`, `delimited`, and `semi_structured_text`.' + }), + field_stats: z.record(z.string(), text_structure_types_field_stat).register(z.globalRegistry, { + description: 'The most common values of each field, plus basic numeric statistics for the numeric `page_count` field.\nThis information may provide clues that the data needs to be cleaned or transformed prior to use by other Elastic Stack functionality.' + }), + sample_start: z.string().register(z.globalRegistry, { + description: 'The first two messages in the text verbatim.\nThis may help diagnose parse errors or accidental uploads of the wrong text.' + }), + num_messages_analyzed: z.number().register(z.globalRegistry, { + description: 'The number of distinct messages the lines contained.\nFor NDJSON, this value is the same as `num_lines_analyzed`.\nFor other text formats, messages can span several lines.' + }), + mappings: types_mapping_type_mapping, + quote: z.optional(z.string()), + delimiter: z.optional(z.string()), + need_client_timezone: z.boolean().register(z.globalRegistry, { + description: 'If a timestamp format is detected that does not include a timezone, `need_client_timezone` is `true`.\nThe server that parses the text must therefore be told the correct timezone by the client.' + }), + num_lines_analyzed: z.number().register(z.globalRegistry, { + description: 'The number of lines of the text that were analyzed.' + }), + column_names: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'If `format` is `delimited`, the `column_names` field lists the column names in the order they appear in the sample.' + })), + explanation: z.optional(z.array(z.string())), + grok_pattern: z.optional(types_grok_pattern), + multiline_start_pattern: z.optional(z.string()), + exclude_lines_pattern: z.optional(z.string()), + java_timestamp_formats: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The Java time formats recognized in the time fields.\nElasticsearch mappings and ingest pipelines use this format.' + })), + joda_timestamp_formats: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'Information that is used to tell Logstash how to parse timestamps.' + })), + timestamp_field: z.optional(types_field), + should_trim_fields: z.optional(z.boolean()), + ingest_pipeline: ingest_types_pipeline_config }); export const transform_get_transform_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - transform_id: types_names, - }), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no transforms that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf this parameter is false, the request returns a 404 status code when\nthere are no matches or only partial matches.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of transforms.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of transforms to obtain.', - }) - ), - exclude_generated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Excludes fields that were automatically added when creating the\ntransform. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.object({ + transform_id: types_names + }), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no transforms that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf this parameter is false, the request returns a 404 status code when\nthere are no matches or only partial matches.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of transforms.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of transforms to obtain.' + })), + exclude_generated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Excludes fields that were automatically added when creating the\ntransform. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.' + })) + })) }); export const transform_get_transform_response = z.object({ - count: z.number(), - transforms: z.array(transform_get_transform_transform_summary), + count: z.number(), + transforms: z.array(transform_get_transform_transform_summary) }); export const transform_put_transform_request = z.object({ - body: z.object({ - dest: transform_types_destination, - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'Free text description of the transform.', - }) - ), - frequency: z.optional(types_duration), - latest: z.optional(transform_types_latest), - _meta: z.optional(types_metadata), - pivot: z.optional(transform_types_pivot), - retention_policy: z.optional(transform_types_retention_policy_container), - settings: z.optional(transform_types_settings), - source: transform_types_source, - sync: z.optional(transform_types_sync_container), - }), - path: z.object({ - transform_id: types_id, - }), - query: z.optional( - z.object({ - defer_validation: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When the transform is created, a series of validations occur to ensure its success. For example, there is a\ncheck for the existence of the source indices and a check that the destination index is not part of the source\nindex pattern. You can use this parameter to skip the checks, for example when the source index does not exist\nuntil after the transform is created. The validations are always run when you start the transform, however, with\nthe exception of privilege checks.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + dest: transform_types_destination, + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Free text description of the transform.' + })), + frequency: z.optional(types_duration), + latest: z.optional(transform_types_latest), + _meta: z.optional(types_metadata), + pivot: z.optional(transform_types_pivot), + retention_policy: z.optional(transform_types_retention_policy_container), + settings: z.optional(transform_types_settings), + source: transform_types_source, + sync: z.optional(transform_types_sync_container) + }), + path: z.object({ + transform_id: types_id + }), + query: z.optional(z.object({ + defer_validation: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When the transform is created, a series of validations occur to ensure its success. For example, there is a\ncheck for the existence of the source indices and a check that the destination index is not part of the source\nindex pattern. You can use this parameter to skip the checks, for example when the source index does not exist\nuntil after the transform is created. The validations are always run when you start the transform, however, with\nthe exception of privilege checks.' + })), + timeout: z.optional(types_duration) + })) }); export const transform_put_transform_response = types_acknowledged_response_base; export const transform_get_transform1_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - allow_no_match: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no transforms that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf this parameter is false, the request returns a 404 status code when\nthere are no matches or only partial matches.', - }) - ), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of transforms.', - }) - ), - size: z.optional( - z.number().register(z.globalRegistry, { - description: 'Specifies the maximum number of transforms to obtain.', - }) - ), - exclude_generated: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Excludes fields that were automatically added when creating the\ntransform. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.', - }) - ), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + allow_no_match: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Specifies what to do when the request:\n\n1. Contains wildcard expressions and there are no transforms that match.\n2. Contains the _all string or no identifiers and there are no matches.\n3. Contains wildcard expressions and there are only partial matches.\n\nIf this parameter is false, the request returns a 404 status code when\nthere are no matches or only partial matches.' + })), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of transforms.' + })), + size: z.optional(z.number().register(z.globalRegistry, { + description: 'Specifies the maximum number of transforms to obtain.' + })), + exclude_generated: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Excludes fields that were automatically added when creating the\ntransform. This allows the configuration to be in an acceptable format to\nbe retrieved and then added to another cluster.' + })) + })) }); export const transform_get_transform1_response = z.object({ - count: z.number(), - transforms: z.array(transform_get_transform_transform_summary), + count: z.number(), + transforms: z.array(transform_get_transform_transform_summary) }); export const transform_preview_transform_request = z.object({ - body: z.optional(transform_preview_transform), - path: z.object({ - transform_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.optional(transform_preview_transform), + path: z.object({ + transform_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const transform_preview_transform_response = z.object({ - generated_dest_index: indices_types_index_state, - preview: z.array(z.record(z.string(), z.unknown())), + generated_dest_index: indices_types_index_state, + preview: z.array(z.record(z.string(), z.unknown())) }); export const transform_preview_transform1_request = z.object({ - body: z.optional(transform_preview_transform), - path: z.object({ - transform_id: types_id, - }), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.optional(transform_preview_transform), + path: z.object({ + transform_id: types_id + }), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const transform_preview_transform1_response = z.object({ - generated_dest_index: indices_types_index_state, - preview: z.array(z.record(z.string(), z.unknown())), + generated_dest_index: indices_types_index_state, + preview: z.array(z.record(z.string(), z.unknown())) }); export const transform_preview_transform2_request = z.object({ - body: z.optional(transform_preview_transform), - path: z.optional(z.never()), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.optional(transform_preview_transform), + path: z.optional(z.never()), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const transform_preview_transform2_response = z.object({ - generated_dest_index: indices_types_index_state, - preview: z.array(z.record(z.string(), z.unknown())), + generated_dest_index: indices_types_index_state, + preview: z.array(z.record(z.string(), z.unknown())) }); export const transform_preview_transform3_request = z.object({ - body: z.optional(transform_preview_transform), - path: z.optional(z.never()), - query: z.optional( - z.object({ - timeout: z.optional(types_duration), - }) - ), + body: z.optional(transform_preview_transform), + path: z.optional(z.never()), + query: z.optional(z.object({ + timeout: z.optional(types_duration) + })) }); export const transform_preview_transform3_response = z.object({ - generated_dest_index: indices_types_index_state, - preview: z.array(z.record(z.string(), z.unknown())), + generated_dest_index: indices_types_index_state, + preview: z.array(z.record(z.string(), z.unknown())) }); export const transform_update_transform_request = z.object({ - body: z.object({ - dest: z.optional(transform_types_destination), - description: z.optional( - z.string().register(z.globalRegistry, { - description: 'Free text description of the transform.', - }) - ), - frequency: z.optional(types_duration), - _meta: z.optional(types_metadata), - source: z.optional(transform_types_source), - settings: z.optional(transform_types_settings), - sync: z.optional(transform_types_sync_container), - retention_policy: z.optional( - z.union([transform_types_retention_policy_container, z.string(), z.null()]) - ), - }), - path: z.object({ - transform_id: types_id, - }), - query: z.optional( - z.object({ - defer_validation: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'When true, deferrable validations are not run. This behavior may be\ndesired if the source index does not exist until after the transform is\ncreated.', - }) - ), - timeout: z.optional(types_duration), - }) - ), + body: z.object({ + dest: z.optional(transform_types_destination), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Free text description of the transform.' + })), + frequency: z.optional(types_duration), + _meta: z.optional(types_metadata), + source: z.optional(transform_types_source), + settings: z.optional(transform_types_settings), + sync: z.optional(transform_types_sync_container), + retention_policy: z.optional(z.union([ + transform_types_retention_policy_container, + z.string(), + z.null() + ])) + }), + path: z.object({ + transform_id: types_id + }), + query: z.optional(z.object({ + defer_validation: z.optional(z.boolean().register(z.globalRegistry, { + description: 'When true, deferrable validations are not run. This behavior may be\ndesired if the source index does not exist until after the transform is\ncreated.' + })), + timeout: z.optional(types_duration) + })) }); export const transform_update_transform_response = z.object({ - authorization: z.optional(ml_types_transform_authorization), - create_time: z.number(), - description: z.string(), - dest: global_reindex_destination, - frequency: z.optional(types_duration), - id: types_id, - latest: z.optional(transform_types_latest), - pivot: z.optional(transform_types_pivot), - retention_policy: z.optional(transform_types_retention_policy_container), - settings: transform_types_settings, - source: global_reindex_source, - sync: z.optional(transform_types_sync_container), - version: types_version_string, - _meta: z.optional(types_metadata), + authorization: z.optional(ml_types_transform_authorization), + create_time: z.number(), + description: z.string(), + dest: global_reindex_destination, + frequency: z.optional(types_duration), + id: types_id, + latest: z.optional(transform_types_latest), + pivot: z.optional(transform_types_pivot), + retention_policy: z.optional(transform_types_retention_policy_container), + settings: transform_types_settings, + source: global_reindex_source, + sync: z.optional(transform_types_sync_container), + version: types_version_string, + _meta: z.optional(types_metadata) }); export const update_request = z.object({ - body: z.object({ - detect_noop: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the `result` in the response is set to `noop` (no operation) when there are no changes to the document.', - }) - ), - doc: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - 'A partial update to an existing document.\nIf both `doc` and `script` are specified, `doc` is ignored.', - }) - ), - doc_as_upsert: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `true`, use the contents of 'doc' as the value of 'upsert'.\nNOTE: Using ingest pipelines with `doc_as_upsert` is not supported.", - }) - ), - script: z.optional(types_script), - scripted_upsert: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, run the script whether or not the document exists.', - }) - ), - _source: z.optional(global_search_types_source_config), - upsert: z.optional( - z.record(z.string(), z.unknown()).register(z.globalRegistry, { - description: - "If the document does not already exist, the contents of 'upsert' are inserted as a new document.\nIf the document exists, the 'script' is run.", - }) - ), - }), - path: z.object({ - index: types_index_name, - id: types_id, - }), - query: z.optional( - z.object({ - if_primary_term: z.optional( - z.number().register(z.globalRegistry, { - description: 'Only perform the operation if the document has this primary term.', - }) - ), - if_seq_no: z.optional(types_sequence_number), - include_source_on_error: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'True or false if to include the document source in the error message in case of parsing errors.', - }) - ), - lang: z.optional( - z.string().register(z.globalRegistry, { - description: 'The script language.', - }) - ), - refresh: z.optional(types_refresh), - require_alias: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, the destination must be an index alias.', - }) - ), - retry_on_conflict: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of times the operation should be retried when a conflict occurs.', - }) - ), - routing: z.optional(types_routing), - timeout: z.optional(types_duration), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - _source: z.optional(global_search_types_source_config_param), - _source_excludes: z.optional(types_fields), - _source_includes: z.optional(types_fields), - }) - ), + body: z.object({ + detect_noop: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the `result` in the response is set to `noop` (no operation) when there are no changes to the document.' + })), + doc: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'A partial update to an existing document.\nIf both `doc` and `script` are specified, `doc` is ignored.' + })), + doc_as_upsert: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, use the contents of \'doc\' as the value of \'upsert\'.\nNOTE: Using ingest pipelines with `doc_as_upsert` is not supported.' + })), + script: z.optional(types_script), + scripted_upsert: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, run the script whether or not the document exists.' + })), + _source: z.optional(global_search_types_source_config), + upsert: z.optional(z.record(z.string(), z.unknown()).register(z.globalRegistry, { + description: 'If the document does not already exist, the contents of \'upsert\' are inserted as a new document.\nIf the document exists, the \'script\' is run.' + })) + }), + path: z.object({ + index: types_index_name, + id: types_id + }), + query: z.optional(z.object({ + if_primary_term: z.optional(z.number().register(z.globalRegistry, { + description: 'Only perform the operation if the document has this primary term.' + })), + if_seq_no: z.optional(types_sequence_number), + include_source_on_error: z.optional(z.boolean().register(z.globalRegistry, { + description: 'True or false if to include the document source in the error message in case of parsing errors.' + })), + lang: z.optional(z.string().register(z.globalRegistry, { + description: 'The script language.' + })), + refresh: z.optional(types_refresh), + require_alias: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the destination must be an index alias.' + })), + retry_on_conflict: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of times the operation should be retried when a conflict occurs.' + })), + routing: z.optional(types_routing), + timeout: z.optional(types_duration), + wait_for_active_shards: z.optional(types_wait_for_active_shards), + _source: z.optional(global_search_types_source_config_param), + _source_excludes: z.optional(types_fields), + _source_includes: z.optional(types_fields) + })) }); export const update_response = global_update_update_write_response_base; export const update_by_query_request = z.object({ - body: z.optional( - z.object({ - max_docs: z.optional( - z.number().register(z.globalRegistry, { - description: 'The maximum number of documents to update.', - }) - ), - query: z.optional(types_query_dsl_query_container), - script: z.optional(types_script), - slice: z.optional(types_sliced_scroll), - conflicts: z.optional(types_conflicts), - }) - ), - path: z.object({ - index: types_indices, - }), - query: z.optional( - z.object({ - allow_no_indices: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.', - }) - ), - analyzer: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - analyze_wildcard: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - conflicts: z.optional(types_conflicts), - default_operator: z.optional(types_query_dsl_operator), - df: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The field to use as default where no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - expand_wildcards: z.optional(types_expand_wildcards), - from: z.optional( - z.number().register(z.globalRegistry, { - description: 'Skips the specified number of documents.', - }) - ), - ignore_unavailable: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `false`, the request returns an error if it targets a missing or closed index.', - }) - ), - lenient: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.', - }) - ), - max_docs: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to process.\nIt defaults to all documents.\nWhen set to a value less then or equal to `scroll_size` then a scroll will not be used to retrieve the results for the operation.', - }) - ), - pipeline: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.\nIf a final pipeline is configured it will always run, regardless of the value of this parameter.', - }) - ), - preference: z.optional( - z.string().register(z.globalRegistry, { - description: - 'The node or shard the operation should be performed on.\nIt is random by default.', - }) - ), - q: z.optional( - z.string().register(z.globalRegistry, { - description: 'A query in the Lucene query string syntax.', - }) - ), - refresh: z.optional( - z.boolean().register(z.globalRegistry, { - description: - "If `true`, Elasticsearch refreshes affected shards to make the operation visible to search after the request completes.\nThis is different than the update API's `refresh` parameter, which causes just the shard that received the request to be refreshed.", - }) - ), - request_cache: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request cache is used for this request.\nIt defaults to the index-level setting.', - }) - ), - requests_per_second: z.optional( - z.number().register(z.globalRegistry, { - description: 'The throttle for this request in sub-requests per second.', - }) - ), - routing: z.optional(types_routing), - scroll: z.optional(types_duration), - scroll_size: z.optional( - z.number().register(z.globalRegistry, { - description: 'The size of the scroll request that powers the operation.', - }) - ), - search_timeout: z.optional(types_duration), - search_type: z.optional(types_search_type), - slices: z.optional(types_slices), - sort: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'A comma-separated list of : pairs.', - }) - ), - stats: z.optional( - z.array(z.string()).register(z.globalRegistry, { - description: 'The specific `tag` of the request for logging and statistical purposes.', - }) - ), - terminate_after: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.', - }) - ), - timeout: z.optional(types_duration), - version: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If `true`, returns the document version as part of a hit.', - }) - ), - version_type: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'Should the document increment the version number (internal) on hit or not (reindex)', - }) - ), - wait_for_active_shards: z.optional(types_wait_for_active_shards), - wait_for_completion: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'If `true`, the request blocks until the operation is complete.\nIf `false`, Elasticsearch performs some preflight checks, launches the request, and returns a task ID that you can use to cancel or get the status of the task.\nElasticsearch creates a record of this task as a document at `.tasks/task/${taskId}`.', - }) - ), - }) - ), + body: z.optional(z.object({ + max_docs: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to update.' + })), + query: z.optional(types_query_dsl_query_container), + script: z.optional(types_script), + slice: z.optional(types_sliced_scroll), + conflicts: z.optional(types_conflicts) + })), + path: z.object({ + index: types_indices + }), + query: z.optional(z.object({ + allow_no_indices: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.' + })), + analyzer: z.optional(z.string().register(z.globalRegistry, { + description: 'The analyzer to use for the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + analyze_wildcard: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, wildcard and prefix queries are analyzed.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + conflicts: z.optional(types_conflicts), + default_operator: z.optional(types_query_dsl_operator), + df: z.optional(z.string().register(z.globalRegistry, { + description: 'The field to use as default where no field prefix is given in the query string.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + expand_wildcards: z.optional(types_expand_wildcards), + from: z.optional(z.number().register(z.globalRegistry, { + description: 'Skips the specified number of documents.' + })), + ignore_unavailable: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `false`, the request returns an error if it targets a missing or closed index.' + })), + lenient: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can be used only when the `q` query string parameter is specified.' + })), + max_docs: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to process.\nIt defaults to all documents.\nWhen set to a value less then or equal to `scroll_size` then a scroll will not be used to retrieve the results for the operation.' + })), + pipeline: z.optional(z.string().register(z.globalRegistry, { + description: 'The ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.\nIf a final pipeline is configured it will always run, regardless of the value of this parameter.' + })), + preference: z.optional(z.string().register(z.globalRegistry, { + description: 'The node or shard the operation should be performed on.\nIt is random by default.' + })), + q: z.optional(z.string().register(z.globalRegistry, { + description: 'A query in the Lucene query string syntax.' + })), + refresh: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, Elasticsearch refreshes affected shards to make the operation visible to search after the request completes.\nThis is different than the update API\'s `refresh` parameter, which causes just the shard that received the request to be refreshed.' + })), + request_cache: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request cache is used for this request.\nIt defaults to the index-level setting.' + })), + requests_per_second: z.optional(z.number().register(z.globalRegistry, { + description: 'The throttle for this request in sub-requests per second.' + })), + routing: z.optional(types_routing), + scroll: z.optional(types_duration), + scroll_size: z.optional(z.number().register(z.globalRegistry, { + description: 'The size of the scroll request that powers the operation.' + })), + search_timeout: z.optional(types_duration), + search_type: z.optional(types_search_type), + slices: z.optional(types_slices), + sort: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'A comma-separated list of : pairs.' + })), + stats: z.optional(z.array(z.string()).register(z.globalRegistry, { + description: 'The specific `tag` of the request for logging and statistical purposes.' + })), + terminate_after: z.optional(z.number().register(z.globalRegistry, { + description: 'The maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\n\nIMPORTANT: Use with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.' + })), + timeout: z.optional(types_duration), + version: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, returns the document version as part of a hit.' + })), + version_type: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Should the document increment the version number (internal) on hit or not (reindex)' + })), + wait_for_active_shards: z.optional(types_wait_for_active_shards), + wait_for_completion: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If `true`, the request blocks until the operation is complete.\nIf `false`, Elasticsearch performs some preflight checks, launches the request, and returns a task ID that you can use to cancel or get the status of the task.\nElasticsearch creates a record of this task as a document at `.tasks/task/${taskId}`.' + })) + })) }); export const update_by_query_response = z.object({ - batches: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of scroll responses pulled back by the update by query.', - }) - ), - failures: z.optional( - z.array(types_bulk_index_by_scroll_failure).register(z.globalRegistry, { - description: - 'Array of failures if there were any unrecoverable errors during the process.\nIf this is non-empty then the request ended because of those failures.\nUpdate by query is implemented using batches.\nAny failure causes the entire process to end, but all failures in the current batch are collected into the array.\nYou can use the `conflicts` option to prevent reindex from ending when version conflicts occur.', - }) - ), - noops: z.optional( - z.number().register(z.globalRegistry, { - description: - 'The number of documents that were ignored because the script used for the update by query returned a noop value for `ctx.op`.', - }) - ), - deleted: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of documents that were successfully deleted.', - }) - ), - requests_per_second: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of requests per second effectively run during the update by query.', - }) - ), - retries: z.optional(types_retries), - task: z.optional(types_task_id), - timed_out: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'If true, some requests timed out during the update by query.', - }) - ), - took: z.optional(types_duration_value_unit_millis), - total: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of documents that were successfully processed.', - }) - ), - updated: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of documents that were successfully updated.', - }) - ), - version_conflicts: z.optional( - z.number().register(z.globalRegistry, { - description: 'The number of version conflicts that the update by query hit.', - }) - ), - throttled: z.optional(types_duration), - throttled_millis: z.optional(types_duration_value_unit_millis), - throttled_until: z.optional(types_duration), - throttled_until_millis: z.optional(types_duration_value_unit_millis), + batches: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of scroll responses pulled back by the update by query.' + })), + failures: z.optional(z.array(types_bulk_index_by_scroll_failure).register(z.globalRegistry, { + description: 'Array of failures if there were any unrecoverable errors during the process.\nIf this is non-empty then the request ended because of those failures.\nUpdate by query is implemented using batches.\nAny failure causes the entire process to end, but all failures in the current batch are collected into the array.\nYou can use the `conflicts` option to prevent reindex from ending when version conflicts occur.' + })), + noops: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of documents that were ignored because the script used for the update by query returned a noop value for `ctx.op`.' + })), + deleted: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of documents that were successfully deleted.' + })), + requests_per_second: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of requests per second effectively run during the update by query.' + })), + retries: z.optional(types_retries), + task: z.optional(types_task_id), + timed_out: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, some requests timed out during the update by query.' + })), + took: z.optional(types_duration_value_unit_millis), + total: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of documents that were successfully processed.' + })), + updated: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of documents that were successfully updated.' + })), + version_conflicts: z.optional(z.number().register(z.globalRegistry, { + description: 'The number of version conflicts that the update by query hit.' + })), + throttled: z.optional(types_duration), + throttled_millis: z.optional(types_duration_value_unit_millis), + throttled_until: z.optional(types_duration), + throttled_until_millis: z.optional(types_duration_value_unit_millis) }); export const watcher_get_watch_request = z.object({ - body: z.optional(z.never()), - path: z.object({ - id: types_name, - }), - query: z.optional(z.never()), + body: z.optional(z.never()), + path: z.object({ + id: types_name + }), + query: z.optional(z.never()) }); export const watcher_get_watch_response = z.object({ - found: z.boolean(), - _id: types_id, - status: z.optional(watcher_types_watch_status), - watch: z.optional(watcher_types_watch), - _primary_term: z.optional(z.number()), - _seq_no: z.optional(types_sequence_number), - _version: z.optional(types_version_number), + found: z.boolean(), + _id: types_id, + status: z.optional(watcher_types_watch_status), + watch: z.optional(watcher_types_watch), + _primary_term: z.optional(z.number()), + _seq_no: z.optional(types_sequence_number), + _version: z.optional(types_version_number) }); export const watcher_put_watch1_request = z.object({ - body: watcher_put_watch, - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - active: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'The initial state of the watch.\nThe default value is `true`, which means the watch is active by default.', - }) - ), - if_primary_term: z.optional( - z.number().register(z.globalRegistry, { - description: - 'only update the watch if the last operation that has changed the watch has the specified primary term', - }) - ), - if_seq_no: z.optional(types_sequence_number), - version: z.optional(types_version_number), - }) - ), + body: watcher_put_watch, + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + active: z.optional(z.boolean().register(z.globalRegistry, { + description: 'The initial state of the watch.\nThe default value is `true`, which means the watch is active by default.' + })), + if_primary_term: z.optional(z.number().register(z.globalRegistry, { + description: 'Only update the watch if the last operation that has changed the watch has the specified primary term' + })), + if_seq_no: z.optional(types_sequence_number), + version: z.optional(types_version_number) + })) }); export const watcher_put_watch1_response = z.object({ - created: z.boolean(), - _id: types_id, - _primary_term: z.number(), - _seq_no: types_sequence_number, - _version: types_version_number, + created: z.boolean(), + _id: types_id, + _primary_term: z.number(), + _seq_no: types_sequence_number, + _version: types_version_number }); export const watcher_put_watch_request = z.object({ - body: watcher_put_watch, - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - active: z.optional( - z.boolean().register(z.globalRegistry, { - description: - 'The initial state of the watch.\nThe default value is `true`, which means the watch is active by default.', - }) - ), - if_primary_term: z.optional( - z.number().register(z.globalRegistry, { - description: - 'only update the watch if the last operation that has changed the watch has the specified primary term', - }) - ), - if_seq_no: z.optional(types_sequence_number), - version: z.optional(types_version_number), - }) - ), + body: watcher_put_watch, + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + active: z.optional(z.boolean().register(z.globalRegistry, { + description: 'The initial state of the watch.\nThe default value is `true`, which means the watch is active by default.' + })), + if_primary_term: z.optional(z.number().register(z.globalRegistry, { + description: 'Only update the watch if the last operation that has changed the watch has the specified primary term' + })), + if_seq_no: z.optional(types_sequence_number), + version: z.optional(types_version_number) + })) }); export const watcher_put_watch_response = z.object({ - created: z.boolean(), - _id: types_id, - _primary_term: z.number(), - _seq_no: types_sequence_number, - _version: types_version_number, + created: z.boolean(), + _id: types_id, + _primary_term: z.number(), + _seq_no: types_sequence_number, + _version: types_version_number }); export const watcher_execute_watch1_request = z.object({ - body: z.optional(watcher_execute_watch), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - debug: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Defines whether the watch runs in debug mode.', - }) - ), - }) - ), + body: z.optional(watcher_execute_watch), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + debug: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Defines whether the watch runs in debug mode.' + })) + })) }); export const watcher_execute_watch1_response = z.object({ - _id: types_id, - watch_record: watcher_execute_watch_watch_record, + _id: types_id, + watch_record: watcher_execute_watch_watch_record }); export const watcher_execute_watch_request = z.object({ - body: z.optional(watcher_execute_watch), - path: z.object({ - id: types_id, - }), - query: z.optional( - z.object({ - debug: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Defines whether the watch runs in debug mode.', - }) - ), - }) - ), + body: z.optional(watcher_execute_watch), + path: z.object({ + id: types_id + }), + query: z.optional(z.object({ + debug: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Defines whether the watch runs in debug mode.' + })) + })) }); export const watcher_execute_watch_response = z.object({ - _id: types_id, - watch_record: watcher_execute_watch_watch_record, + _id: types_id, + watch_record: watcher_execute_watch_watch_record }); export const watcher_execute_watch3_request = z.object({ - body: z.optional(watcher_execute_watch), - path: z.optional(z.never()), - query: z.optional( - z.object({ - debug: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Defines whether the watch runs in debug mode.', - }) - ), - }) - ), + body: z.optional(watcher_execute_watch), + path: z.optional(z.never()), + query: z.optional(z.object({ + debug: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Defines whether the watch runs in debug mode.' + })) + })) }); export const watcher_execute_watch3_response = z.object({ - _id: types_id, - watch_record: watcher_execute_watch_watch_record, + _id: types_id, + watch_record: watcher_execute_watch_watch_record }); export const watcher_execute_watch2_request = z.object({ - body: z.optional(watcher_execute_watch), - path: z.optional(z.never()), - query: z.optional( - z.object({ - debug: z.optional( - z.boolean().register(z.globalRegistry, { - description: 'Defines whether the watch runs in debug mode.', - }) - ), - }) - ), + body: z.optional(watcher_execute_watch), + path: z.optional(z.never()), + query: z.optional(z.object({ + debug: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Defines whether the watch runs in debug mode.' + })) + })) }); export const watcher_execute_watch2_response = z.object({ - _id: types_id, - watch_record: watcher_execute_watch_watch_record, + _id: types_id, + watch_record: watcher_execute_watch_watch_record }); export const watcher_get_settings_request = z.object({ - body: z.optional(z.never()), - path: z.optional(z.never()), - query: z.optional( - z.object({ - master_timeout: z.optional(types_duration), - }) - ), + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + master_timeout: z.optional(types_duration) + })) }); export const watcher_get_settings_response = z.object({ - index: indices_types_index_settings, + index: indices_types_index_settings }); export const watcher_query_watches_request = z.object({ - body: z.optional(watcher_query_watches), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(watcher_query_watches), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const watcher_query_watches_response = z.object({ - count: z.number().register(z.globalRegistry, { - description: 'The total number of watches found.', - }), - watches: z.array(watcher_types_query_watch).register(z.globalRegistry, { - description: - 'A list of watches based on the `from`, `size`, or `search_after` request body parameters.', - }), + count: z.number().register(z.globalRegistry, { + description: 'The total number of watches found.' + }), + watches: z.array(watcher_types_query_watch).register(z.globalRegistry, { + description: 'A list of watches based on the `from`, `size`, or `search_after` request body parameters.' + }) }); export const watcher_query_watches1_request = z.object({ - body: z.optional(watcher_query_watches), - path: z.optional(z.never()), - query: z.optional(z.never()), + body: z.optional(watcher_query_watches), + path: z.optional(z.never()), + query: z.optional(z.never()) }); export const watcher_query_watches1_response = z.object({ - count: z.number().register(z.globalRegistry, { - description: 'The total number of watches found.', - }), - watches: z.array(watcher_types_query_watch).register(z.globalRegistry, { - description: - 'A list of watches based on the `from`, `size`, or `search_after` request body parameters.', - }), + count: z.number().register(z.globalRegistry, { + description: 'The total number of watches found.' + }), + watches: z.array(watcher_types_query_watch).register(z.globalRegistry, { + description: 'A list of watches based on the `from`, `size`, or `search_after` request body parameters.' + }) }); diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/index.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/index.ts index 4ea23c39e2cd1..0c4fef0455e63 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/index.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/index.ts @@ -11,8 +11,8 @@ * AUTO-GENERATED FILE - DO NOT EDIT * * This file contains Kibana connector definitions generated from Kibana OpenAPI specification. - * Generated at: 2025-12-02T17:55:14.379Z - * Source: /oas_docs/output/kibana.yaml (521 APIs) + * Generated at: 2025-12-08T09:00:02.630Z + * Source: /oas_docs/output/kibana.yaml (523 APIs) * * To regenerate: node scripts/generate_workflow_kibana_contracts.js */ @@ -187,6 +187,7 @@ import { GET_ENDPOINT_METADATA_CONTRACT } from './kibana.get_endpoint_metadata.g import { GET_POLICY_RESPONSE_CONTRACT } from './kibana.get_policy_response.gen'; import { GET_PROTECTION_UPDATES_NOTE_CONTRACT } from './kibana.get_protection_updates_note.gen'; import { CREATE_UPDATE_PROTECTION_UPDATES_NOTE_CONTRACT } from './kibana.create_update_protection_updates_note.gen'; +import { ENDPOINT_SCRIPT_LIBRARY_LIST_SCRIPTS_CONTRACT } from './kibana.endpoint_script_library_list_scripts.gen'; import { DELETE_MONITORING_ENGINE_CONTRACT } from './kibana.delete_monitoring_engine.gen'; import { DISABLE_MONITORING_ENGINE_CONTRACT } from './kibana.disable_monitoring_engine.gen'; import { INIT_MONITORING_ENGINE_CONTRACT } from './kibana.init_monitoring_engine.gen'; @@ -283,6 +284,7 @@ import { POST_FLEET_CLOUD_CONNECTORS_CONTRACT } from './kibana.post_fleet_cloud_ import { DELETE_FLEET_CLOUD_CONNECTORS_CLOUDCONNECTORID_CONTRACT } from './kibana.delete_fleet_cloud_connectors_cloudconnectorid.gen'; import { GET_FLEET_CLOUD_CONNECTORS_CLOUDCONNECTORID_CONTRACT } from './kibana.get_fleet_cloud_connectors_cloudconnectorid.gen'; import { PUT_FLEET_CLOUD_CONNECTORS_CLOUDCONNECTORID_CONTRACT } from './kibana.put_fleet_cloud_connectors_cloudconnectorid.gen'; +import { GET_FLEET_CLOUD_CONNECTORS_CLOUDCONNECTORID_USAGE_CONTRACT } from './kibana.get_fleet_cloud_connectors_cloudconnectorid_usage.gen'; import { GET_FLEET_DATA_STREAMS_CONTRACT } from './kibana.get_fleet_data_streams.gen'; import { GET_FLEET_ENROLLMENT_API_KEYS_CONTRACT } from './kibana.get_fleet_enrollment_api_keys.gen'; import { POST_FLEET_ENROLLMENT_API_KEYS_CONTRACT } from './kibana.post_fleet_enrollment_api_keys.gen'; @@ -711,6 +713,7 @@ export const GENERATED_KIBANA_CONNECTORS: InternalConnectorContract[] = [ GET_POLICY_RESPONSE_CONTRACT, GET_PROTECTION_UPDATES_NOTE_CONTRACT, CREATE_UPDATE_PROTECTION_UPDATES_NOTE_CONTRACT, + ENDPOINT_SCRIPT_LIBRARY_LIST_SCRIPTS_CONTRACT, DELETE_MONITORING_ENGINE_CONTRACT, DISABLE_MONITORING_ENGINE_CONTRACT, INIT_MONITORING_ENGINE_CONTRACT, @@ -807,6 +810,7 @@ export const GENERATED_KIBANA_CONNECTORS: InternalConnectorContract[] = [ DELETE_FLEET_CLOUD_CONNECTORS_CLOUDCONNECTORID_CONTRACT, GET_FLEET_CLOUD_CONNECTORS_CLOUDCONNECTORID_CONTRACT, PUT_FLEET_CLOUD_CONNECTORS_CLOUDCONNECTORID_CONTRACT, + GET_FLEET_CLOUD_CONNECTORS_CLOUDCONNECTORID_USAGE_CONTRACT, GET_FLEET_DATA_STREAMS_CONTRACT, GET_FLEET_ENROLLMENT_API_KEYS_CONTRACT, POST_FLEET_ENROLLMENT_API_KEYS_CONTRACT, diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.add_case_comment_default_space.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.add_case_comment_default_space.gen.ts index 67ba6bd55f0fb..8980e5bad5d5a 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.add_case_comment_default_space.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.add_case_comment_default_space.gen.ts @@ -48,7 +48,7 @@ You must have \`all\` privileges for the **Cases** feature in the **Management** headerParams: ['kbn-xsrf'], pathParams: ['caseId'], urlParams: [], - bodyParams: [], + bodyParams: ['alertId', 'index', 'owner', 'rule', 'type', 'comment'], }, paramsSchema: z.object({ ...getShapeAt(add_case_comment_default_space_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.cancel_action.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.cancel_action.gen.ts index 3a9ae31ee36ab..f45586f62a482 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.cancel_action.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.cancel_action.gen.ts @@ -43,7 +43,7 @@ Cancel a running or pending response action (Applies only to some agent types).` headerParams: [], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: ['agent_type', 'alert_ids', 'case_ids', 'comment', 'endpoint_ids', 'parameters'], }, paramsSchema: z.object({ ...getShapeAt(cancel_action_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.create_alerts_migration.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.create_alerts_migration.gen.ts index 7d9fe58d74ea9..ba0cb865c4523 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.create_alerts_migration.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.create_alerts_migration.gen.ts @@ -49,7 +49,7 @@ Migrations are initiated per index. While the process is neither destructive nor headerParams: [], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: ['index', 'requests_per_second', 'size', 'slices'], }, paramsSchema: z.object({ ...getShapeAt(create_alerts_migration_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.create_asset_criticality_record.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.create_asset_criticality_record.gen.ts index b8ef5d85d2c71..db7c49d5afdd6 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.create_asset_criticality_record.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.create_asset_criticality_record.gen.ts @@ -50,7 +50,7 @@ If a record already exists for the specified entity, that record is overwritten headerParams: [], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: ['id_field', 'id_value', 'criticality_level', 'refresh'], }, paramsSchema: z.object({ ...getShapeAt(create_asset_criticality_record_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.create_knowledge_base_entry.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.create_knowledge_base_entry.gen.ts index 8c7f24c1e95b8..5f827912e139d 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.create_knowledge_base_entry.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.create_knowledge_base_entry.gen.ts @@ -47,7 +47,24 @@ Create a Knowledge Base Entry`, headerParams: [], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: [ + 'global', + 'name', + 'namespace', + 'users', + 'kbResource', + 'source', + 'text', + 'type', + 'required', + 'vector', + 'description', + 'field', + 'index', + 'queryDescription', + 'inputSchema', + 'outputFields', + ], }, paramsSchema: z.object({ ...getShapeAt(create_knowledge_base_entry_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.create_rule.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.create_rule.gen.ts index dc19d588216a6..0d3b36a194002 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.create_rule.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.create_rule.gen.ts @@ -97,7 +97,72 @@ For detailed information on Kibana actions and alerting, and additional API call headerParams: [], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: [ + 'actions', + 'alias_purpose', + 'alias_target_id', + 'author', + 'building_block_type', + 'description', + 'enabled', + 'exceptions_list', + 'false_positives', + 'from', + 'interval', + 'investigation_fields', + 'license', + 'max_signals', + 'meta', + 'name', + 'namespace', + 'note', + 'outcome', + 'output_index', + 'references', + 'related_integrations', + 'required_fields', + 'response_actions', + 'risk_score', + 'risk_score_mapping', + 'rule_id', + 'rule_name_override', + 'setup', + 'severity', + 'severity_mapping', + 'tags', + 'threat', + 'throttle', + 'timeline_id', + 'timeline_title', + 'timestamp_override', + 'timestamp_override_fallback_disabled', + 'to', + 'version', + 'language', + 'query', + 'type', + 'alert_suppression', + 'data_view_id', + 'event_category_override', + 'filters', + 'index', + 'tiebreaker_field', + 'timestamp_field', + 'saved_id', + 'threshold', + 'threat_index', + 'threat_mapping', + 'threat_query', + 'concurrent_searches', + 'items_per_search', + 'threat_filters', + 'threat_indicator_path', + 'threat_language', + 'anomaly_threshold', + 'machine_learning_job_id', + 'history_window_start', + 'new_terms_fields', + ], }, paramsSchema: z.object({ ...getShapeAt(create_rule_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.delete_note.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.delete_note.gen.ts index 0e6aeb0f11a60..86b65edc88d76 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.delete_note.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.delete_note.gen.ts @@ -43,7 +43,7 @@ Delete a note from a Timeline using the note ID.`, headerParams: [], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: ['noteId', 'noteIds'], }, paramsSchema: z.object({ ...getShapeAt(delete_note_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.delete_parameters.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.delete_parameters.gen.ts index df770d4dc2e08..0614d54cec368 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.delete_parameters.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.delete_parameters.gen.ts @@ -34,14 +34,14 @@ export const DELETE_PARAMETERS_CONTRACT: InternalConnectorContract = { summary: `Delete parameters`, description: `**Spaces method and path for this operation:** -
delete /s/{space_id}/api/synthetics/params/_bulk_delete
+
post /s/{space_id}/api/synthetics/params/_bulk_delete
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information. Delete parameters from the Synthetics app. You must have \`all\` privileges for the Synthetics feature in the Observability section of the Kibana feature privileges. `, - methods: ['DELETE'], + methods: ['POST'], patterns: ['/api/synthetics/params/_bulk_delete'], documentation: 'https://www.elastic.co/docs/api/doc/kibana/operation/operation-delete-parameters', parameterTypes: { diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_execute_action.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_execute_action.gen.ts index 5c6a07a16c025..c8eb4745ed2de 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_execute_action.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_execute_action.gen.ts @@ -47,7 +47,7 @@ Run a shell command on an endpoint.`, headerParams: [], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: ['agent_type', 'alert_ids', 'case_ids', 'comment', 'endpoint_ids', 'parameters'], }, paramsSchema: z.object({ ...getShapeAt(endpoint_execute_action_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_get_file_action.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_get_file_action.gen.ts index eb21cc82fc5f7..4abfb53430b16 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_get_file_action.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_get_file_action.gen.ts @@ -47,7 +47,7 @@ Get a file from an endpoint.`, headerParams: [], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: ['agent_type', 'alert_ids', 'case_ids', 'comment', 'endpoint_ids', 'parameters'], }, paramsSchema: z.object({ ...getShapeAt(endpoint_get_file_action_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_kill_process_action.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_kill_process_action.gen.ts index 6dc99dbf4effd..861b2172ee14d 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_kill_process_action.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_kill_process_action.gen.ts @@ -47,7 +47,7 @@ Terminate a running process on an endpoint.`, headerParams: [], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: ['agent_type', 'alert_ids', 'case_ids', 'comment', 'endpoint_ids', 'parameters'], }, paramsSchema: z.object({ ...getShapeAt(endpoint_kill_process_action_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_scan_action.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_scan_action.gen.ts index b58f74bdc2ab7..005678e0848d0 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_scan_action.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_scan_action.gen.ts @@ -47,7 +47,7 @@ Scan a specific file or directory on an endpoint for malware.`, headerParams: [], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: ['agent_type', 'alert_ids', 'case_ids', 'comment', 'endpoint_ids', 'parameters'], }, paramsSchema: z.object({ ...getShapeAt(endpoint_scan_action_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_script_library_list_scripts.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_script_library_list_scripts.gen.ts new file mode 100644 index 0000000000000..39a42ef59a2f6 --- /dev/null +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_script_library_list_scripts.gen.ts @@ -0,0 +1,59 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +/* + * AUTO-GENERATED FILE - DO NOT EDIT + * + * Source: /oas_docs/output/kibana.yaml, operations: EndpointScriptLibraryListScripts + * + * To regenerate: node scripts/generate_workflow_kibana_contracts.js + */ + +import { z } from '@kbn/zod/v4'; + +import { + endpoint_script_library_list_scripts_request, + endpoint_script_library_list_scripts_response, +} from './schemas/kibana_openapi_zod.gen'; +import { getShapeAt } from '../../../common/utils/zod'; + +// import all needed request and response schemas generated from the OpenAPI spec +import type { InternalConnectorContract } from '../../../types/latest'; + +import { FetcherConfigSchema } from '../../schema'; + +// export contract +export const ENDPOINT_SCRIPT_LIBRARY_LIST_SCRIPTS_CONTRACT: InternalConnectorContract = { + type: 'kibana.EndpointScriptLibraryListScripts', + summary: `Get a list of scripts`, + description: `**Spaces method and path for this operation:** + +
get /s/{space_id}/api/endpoint/scripts_library
+ +Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information. + +Retrieve a list of scripts`, + methods: ['GET'], + patterns: ['/api/endpoint/scripts_library'], + documentation: + 'https://www.elastic.co/docs/api/doc/kibana/operation/operation-endpointscriptlibrarylistscripts', + parameterTypes: { + headerParams: [], + pathParams: [], + urlParams: ['page', 'pageSize', 'sortField', 'sortDirection', 'kuery'], + bodyParams: [], + }, + paramsSchema: z.object({ + ...getShapeAt(endpoint_script_library_list_scripts_request, 'body'), + ...getShapeAt(endpoint_script_library_list_scripts_request, 'path'), + ...getShapeAt(endpoint_script_library_list_scripts_request, 'query'), + fetcher: FetcherConfigSchema, + }), + outputSchema: endpoint_script_library_list_scripts_response, +}; diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_suspend_process_action.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_suspend_process_action.gen.ts index 38ea39d4bed40..e486bd8f608cb 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_suspend_process_action.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.endpoint_suspend_process_action.gen.ts @@ -47,7 +47,7 @@ Suspend a running process on an endpoint.`, headerParams: [], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: ['agent_type', 'alert_ids', 'case_ids', 'comment', 'endpoint_ids', 'parameters'], }, paramsSchema: z.object({ ...getShapeAt(endpoint_suspend_process_action_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.get_actions_connector_types.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.get_actions_connector_types.gen.ts index 960ed4bd47d52..af6bd1ca71617 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.get_actions_connector_types.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.get_actions_connector_types.gen.ts @@ -17,7 +17,10 @@ import { z } from '@kbn/zod/v4'; -import { get_actions_connector_types_request } from './schemas/kibana_openapi_zod.gen'; +import { + get_actions_connector_types_request, + get_actions_connector_types_response, +} from './schemas/kibana_openapi_zod.gen'; import { getShapeAt } from '../../../common/utils/zod'; // import all needed request and response schemas generated from the OpenAPI spec @@ -52,5 +55,5 @@ You do not need any Kibana feature privileges to run this API.`, ...getShapeAt(get_actions_connector_types_request, 'query'), fetcher: FetcherConfigSchema, }), - outputSchema: z.optional(z.looseObject({})), + outputSchema: get_actions_connector_types_response, }; diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.get_actions_connectors.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.get_actions_connectors.gen.ts index 1c2691dd242f0..8c77dee981f89 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.get_actions_connectors.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.get_actions_connectors.gen.ts @@ -17,7 +17,10 @@ import { z } from '@kbn/zod/v4'; -import { get_actions_connectors_request } from './schemas/kibana_openapi_zod.gen'; +import { + get_actions_connectors_request, + get_actions_connectors_response, +} from './schemas/kibana_openapi_zod.gen'; import { getShapeAt } from '../../../common/utils/zod'; // import all needed request and response schemas generated from the OpenAPI spec @@ -50,5 +53,5 @@ Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for m ...getShapeAt(get_actions_connectors_request, 'query'), fetcher: FetcherConfigSchema, }), - outputSchema: z.optional(z.looseObject({})), + outputSchema: get_actions_connectors_response, }; diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.get_case_default_space.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.get_case_default_space.gen.ts index 0f3965d8f3fb2..d918d02c0e9a6 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.get_case_default_space.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.get_case_default_space.gen.ts @@ -47,7 +47,7 @@ You must have \`read\` privileges for the **Cases** feature in the **Management* parameterTypes: { headerParams: [], pathParams: ['caseId'], - urlParams: [], + urlParams: ['includeComments'], bodyParams: [], }, paramsSchema: z.object({ diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.get_fleet_cloud_connectors_cloudconnectorid_usage.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.get_fleet_cloud_connectors_cloudconnectorid_usage.gen.ts new file mode 100644 index 0000000000000..2242b7af34f10 --- /dev/null +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.get_fleet_cloud_connectors_cloudconnectorid_usage.gen.ts @@ -0,0 +1,60 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +/* + * AUTO-GENERATED FILE - DO NOT EDIT + * + * Source: /oas_docs/output/kibana.yaml, operations: get-fleet-cloud-connectors-cloudconnectorid-usage + * + * To regenerate: node scripts/generate_workflow_kibana_contracts.js + */ + +import { z } from '@kbn/zod/v4'; + +import { + get_fleet_cloud_connectors_cloudconnectorid_usage_request, + get_fleet_cloud_connectors_cloudconnectorid_usage_response, +} from './schemas/kibana_openapi_zod.gen'; +import { getShapeAt } from '../../../common/utils/zod'; + +// import all needed request and response schemas generated from the OpenAPI spec +import type { InternalConnectorContract } from '../../../types/latest'; + +import { FetcherConfigSchema } from '../../schema'; + +// export contract +export const GET_FLEET_CLOUD_CONNECTORS_CLOUDCONNECTORID_USAGE_CONTRACT: InternalConnectorContract = + { + type: 'kibana.get_fleet_cloud_connectors_cloudconnectorid_usage', + summary: `Get cloud connector usage (package policies using the connector)`, + description: `**Spaces method and path for this operation:** + +
get /s/{space_id}/api/fleet/cloud_connectors/{cloudConnectorId}/usage
+ +Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information. + +[Required authorization] Route required privileges: fleet-agent-policies-read OR integrations-read.`, + methods: ['GET'], + patterns: ['/api/fleet/cloud_connectors/{cloudConnectorId}/usage'], + documentation: + 'https://www.elastic.co/docs/api/doc/kibana/operation/operation-get-fleet-cloud-connectors-cloudconnectorid-usage', + parameterTypes: { + headerParams: [], + pathParams: ['cloudConnectorId'], + urlParams: ['page', 'perPage'], + bodyParams: [], + }, + paramsSchema: z.object({ + ...getShapeAt(get_fleet_cloud_connectors_cloudconnectorid_usage_request, 'body'), + ...getShapeAt(get_fleet_cloud_connectors_cloudconnectorid_usage_request, 'path'), + ...getShapeAt(get_fleet_cloud_connectors_cloudconnectorid_usage_request, 'query'), + fetcher: FetcherConfigSchema, + }), + outputSchema: get_fleet_cloud_connectors_cloudconnectorid_usage_response, + }; diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.patch_rule.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.patch_rule.gen.ts index cbe85a769a6e6..77c499c41e6f8 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.patch_rule.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.patch_rule.gen.ts @@ -50,7 +50,73 @@ The difference between the \`id\` and \`rule_id\` is that the \`id\` is a unique headerParams: [], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: [ + 'actions', + 'alias_purpose', + 'alias_target_id', + 'author', + 'building_block_type', + 'description', + 'enabled', + 'exceptions_list', + 'false_positives', + 'from', + 'id', + 'interval', + 'investigation_fields', + 'license', + 'max_signals', + 'meta', + 'name', + 'namespace', + 'note', + 'outcome', + 'output_index', + 'references', + 'related_integrations', + 'required_fields', + 'response_actions', + 'risk_score', + 'risk_score_mapping', + 'rule_id', + 'rule_name_override', + 'setup', + 'severity', + 'severity_mapping', + 'tags', + 'threat', + 'throttle', + 'timeline_id', + 'timeline_title', + 'timestamp_override', + 'timestamp_override_fallback_disabled', + 'to', + 'version', + 'language', + 'query', + 'type', + 'alert_suppression', + 'data_view_id', + 'event_category_override', + 'filters', + 'index', + 'tiebreaker_field', + 'timestamp_field', + 'saved_id', + 'threshold', + 'threat_index', + 'threat_mapping', + 'threat_query', + 'concurrent_searches', + 'items_per_search', + 'threat_filters', + 'threat_indicator_path', + 'threat_language', + 'anomaly_threshold', + 'machine_learning_job_id', + 'history_window_start', + 'new_terms_fields', + ], }, paramsSchema: z.object({ ...getShapeAt(patch_rule_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.perform_rules_bulk_action.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.perform_rules_bulk_action.gen.ts index 0baf232ed5507..0eb05e81d2485 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.perform_rules_bulk_action.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.perform_rules_bulk_action.gen.ts @@ -55,7 +55,17 @@ The edit action is idempotent, meaning that if you add a tag to a rule that alre headerParams: [], pathParams: [], urlParams: ['dry_run'], - bodyParams: [], + bodyParams: [ + 'action', + 'gaps_range_end', + 'gaps_range_start', + 'ids', + 'query', + 'duplicate', + 'run', + 'fill_gaps', + 'edit', + ], }, paramsSchema: z.object({ ...getShapeAt(perform_rules_bulk_action_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.post_fleet_outputs.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.post_fleet_outputs.gen.ts index a1c313c76c4af..99fa5ae72e447 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.post_fleet_outputs.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.post_fleet_outputs.gen.ts @@ -47,7 +47,50 @@ Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for m headerParams: ['kbn-xsrf'], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: [ + 'allow_edit', + 'ca_sha256', + 'ca_trusted_fingerprint', + 'config_yaml', + 'hosts', + 'id', + 'is_default', + 'is_default_monitoring', + 'is_internal', + 'is_preconfigured', + 'name', + 'preset', + 'proxy_id', + 'secrets', + 'shipper', + 'ssl', + 'type', + 'write_to_logs_streams', + 'kibana_api_key', + 'kibana_url', + 'service_token', + 'sync_integrations', + 'sync_uninstalled_integrations', + 'auth_type', + 'broker_timeout', + 'client_id', + 'compression', + 'compression_level', + 'connection_type', + 'hash', + 'headers', + 'key', + 'partition', + 'password', + 'random', + 'required_acks', + 'round_robin', + 'sasl', + 'timeout', + 'topic', + 'username', + 'version', + ], }, paramsSchema: z.object({ ...getShapeAt(post_fleet_outputs_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.post_fleet_package_policies.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.post_fleet_package_policies.gen.ts index c393c1e0005a2..ca6b79d525545 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.post_fleet_package_policies.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.post_fleet_package_policies.gen.ts @@ -45,7 +45,28 @@ Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for m headerParams: ['kbn-xsrf'], pathParams: [], urlParams: ['format'], - bodyParams: [], + bodyParams: [ + 'additional_datastreams_permissions', + 'cloud_connector_id', + 'cloud_connector_name', + 'description', + 'enabled', + 'force', + 'id', + 'inputs', + 'is_managed', + 'name', + 'namespace', + 'output_id', + 'overrides', + 'package', + 'policy_id', + 'policy_ids', + 'spaceIds', + 'supports_agentless', + 'supports_cloud_connector', + 'vars', + ], }, paramsSchema: z.object({ ...getShapeAt(post_fleet_package_policies_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.post_parameters.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.post_parameters.gen.ts index eb7b19c298ece..4b747bd0daf79 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.post_parameters.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.post_parameters.gen.ts @@ -48,7 +48,7 @@ You must have \`all\` privileges for the Synthetics feature in the Observability headerParams: [], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: ['description', 'key', 'share_across_spaces', 'tags', 'value'], }, paramsSchema: z.object({ ...getShapeAt(post_parameters_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.post_synthetic_monitors.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.post_synthetic_monitors.gen.ts index 9b7a448952149..8a0144e96feb5 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.post_synthetic_monitors.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.post_synthetic_monitors.gen.ts @@ -46,7 +46,42 @@ You must have \`all\` privileges for the Synthetics feature in the Observability headerParams: [], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: [ + 'alert', + 'enabled', + 'labels', + 'locations', + 'name', + 'namespace', + 'params', + 'private_locations', + 'retest_on_failure', + 'schedule', + 'service.name', + 'tags', + 'timeout', + 'ignore_https_errors', + 'inline_script', + 'playwright_options', + 'screenshots', + 'synthetics_args', + 'type', + 'check', + 'ipv4', + 'ipv6', + 'max_redirects', + 'mode', + 'password', + 'proxy_headers', + 'proxy_url', + 'response', + 'ssl', + 'url', + 'username', + 'host', + 'wait', + 'proxy_use_local_resolver', + ], }, paramsSchema: z.object({ ...getShapeAt(post_synthetic_monitors_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.put_fleet_outputs_outputid.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.put_fleet_outputs_outputid.gen.ts index b1be2b62fe730..2b2b90bd9d256 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.put_fleet_outputs_outputid.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.put_fleet_outputs_outputid.gen.ts @@ -47,7 +47,50 @@ Update output by ID.

[Required authorization] Route required privileges headerParams: ['kbn-xsrf'], pathParams: ['outputId'], urlParams: [], - bodyParams: [], + bodyParams: [ + 'allow_edit', + 'ca_sha256', + 'ca_trusted_fingerprint', + 'config_yaml', + 'hosts', + 'id', + 'is_default', + 'is_default_monitoring', + 'is_internal', + 'is_preconfigured', + 'name', + 'preset', + 'proxy_id', + 'secrets', + 'shipper', + 'ssl', + 'type', + 'write_to_logs_streams', + 'kibana_api_key', + 'kibana_url', + 'service_token', + 'sync_integrations', + 'sync_uninstalled_integrations', + 'auth_type', + 'broker_timeout', + 'client_id', + 'compression', + 'compression_level', + 'connection_type', + 'hash', + 'headers', + 'key', + 'partition', + 'password', + 'random', + 'required_acks', + 'round_robin', + 'sasl', + 'timeout', + 'topic', + 'username', + 'version', + ], }, paramsSchema: z.object({ ...getShapeAt(put_fleet_outputs_outputid_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.put_fleet_package_policies_packagepolicyid.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.put_fleet_package_policies_packagepolicyid.gen.ts index ebc01f9a27e7b..fc025c56344df 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.put_fleet_package_policies_packagepolicyid.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.put_fleet_package_policies_packagepolicyid.gen.ts @@ -47,7 +47,29 @@ Update a package policy by ID.`, headerParams: ['kbn-xsrf'], pathParams: ['packagePolicyId'], urlParams: ['format'], - bodyParams: [], + bodyParams: [ + 'additional_datastreams_permissions', + 'cloud_connector_id', + 'cloud_connector_name', + 'description', + 'enabled', + 'force', + 'inputs', + 'is_managed', + 'name', + 'namespace', + 'output_id', + 'overrides', + 'package', + 'policy_id', + 'policy_ids', + 'spaceIds', + 'supports_agentless', + 'supports_cloud_connector', + 'vars', + 'version', + 'id', + ], }, paramsSchema: z.object({ ...getShapeAt(put_fleet_package_policies_packagepolicyid_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.put_streams_name.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.put_streams_name.gen.ts index f403ab66c7d25..dc6e40fdcb656 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.put_streams_name.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.put_streams_name.gen.ts @@ -43,7 +43,7 @@ Creates or updates a stream definition. Classic streams can not be created throu headerParams: ['kbn-xsrf'], pathParams: ['name'], urlParams: [], - bodyParams: [], + bodyParams: ['stream', 'dashboards', 'queries', 'rules'], }, paramsSchema: z.object({ ...getShapeAt(put_streams_name_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.put_synthetic_monitor.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.put_synthetic_monitor.gen.ts index ee2e8ccef7538..fc1f82e187bdb 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.put_synthetic_monitor.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.put_synthetic_monitor.gen.ts @@ -47,7 +47,42 @@ You can also partially update a monitor. This will only update the fields that a headerParams: [], pathParams: ['id'], urlParams: [], - bodyParams: [], + bodyParams: [ + 'alert', + 'enabled', + 'labels', + 'locations', + 'name', + 'namespace', + 'params', + 'private_locations', + 'retest_on_failure', + 'schedule', + 'service.name', + 'tags', + 'timeout', + 'ignore_https_errors', + 'inline_script', + 'playwright_options', + 'screenshots', + 'synthetics_args', + 'type', + 'check', + 'ipv4', + 'ipv6', + 'max_redirects', + 'mode', + 'password', + 'proxy_headers', + 'proxy_url', + 'response', + 'ssl', + 'url', + 'username', + 'host', + 'wait', + 'proxy_use_local_resolver', + ], }, paramsSchema: z.object({ ...getShapeAt(put_synthetic_monitor_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.rule_preview.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.rule_preview.gen.ts index 79d8525f091ea..4c2b00df2c553 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.rule_preview.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.rule_preview.gen.ts @@ -41,7 +41,74 @@ Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for m headerParams: [], pathParams: [], urlParams: ['enable_logged_requests'], - bodyParams: [], + bodyParams: [ + 'actions', + 'alias_purpose', + 'alias_target_id', + 'author', + 'building_block_type', + 'description', + 'enabled', + 'exceptions_list', + 'false_positives', + 'from', + 'interval', + 'investigation_fields', + 'license', + 'max_signals', + 'meta', + 'name', + 'namespace', + 'note', + 'outcome', + 'output_index', + 'references', + 'related_integrations', + 'required_fields', + 'response_actions', + 'risk_score', + 'risk_score_mapping', + 'rule_id', + 'rule_name_override', + 'setup', + 'severity', + 'severity_mapping', + 'tags', + 'threat', + 'throttle', + 'timeline_id', + 'timeline_title', + 'timestamp_override', + 'timestamp_override_fallback_disabled', + 'to', + 'version', + 'language', + 'query', + 'type', + 'alert_suppression', + 'data_view_id', + 'event_category_override', + 'filters', + 'index', + 'tiebreaker_field', + 'timestamp_field', + 'invocationCount', + 'timeframeEnd', + 'saved_id', + 'threshold', + 'threat_index', + 'threat_mapping', + 'threat_query', + 'concurrent_searches', + 'items_per_search', + 'threat_filters', + 'threat_indicator_path', + 'threat_language', + 'anomaly_threshold', + 'machine_learning_job_id', + 'history_window_start', + 'new_terms_fields', + ], }, paramsSchema: z.object({ ...getShapeAt(rule_preview_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.run_script_action.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.run_script_action.gen.ts index a07ba4696d8e4..78b2178640cd4 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.run_script_action.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.run_script_action.gen.ts @@ -46,7 +46,7 @@ Run a script on a host. Currently supported only for some agent types.`, headerParams: [], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: ['agent_type', 'alert_ids', 'case_ids', 'comment', 'endpoint_ids', 'parameters'], }, paramsSchema: z.object({ ...getShapeAt(run_script_action_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.set_alerts_status.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.set_alerts_status.gen.ts index 3595aec5232f2..d7e28392b2e59 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.set_alerts_status.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.set_alerts_status.gen.ts @@ -46,7 +46,7 @@ Set the status of one or more detection alerts.`, headerParams: [], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: ['reason', 'signal_ids', 'status', 'conflicts', 'query'], }, paramsSchema: z.object({ ...getShapeAt(set_alerts_status_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.update_case_comment_default_space.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.update_case_comment_default_space.gen.ts index 66fadc67857b9..91b250ed02acb 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.update_case_comment_default_space.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.update_case_comment_default_space.gen.ts @@ -48,7 +48,7 @@ You must have \`all\` privileges for the **Cases** feature in the **Management** headerParams: ['kbn-xsrf'], pathParams: ['caseId'], urlParams: [], - bodyParams: [], + bodyParams: ['alertId', 'id', 'index', 'owner', 'rule', 'type', 'version', 'comment'], }, paramsSchema: z.object({ ...getShapeAt(update_case_comment_default_space_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.update_knowledge_base_entry.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.update_knowledge_base_entry.gen.ts index d8552120eca53..1e2d2128d1eab 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.update_knowledge_base_entry.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.update_knowledge_base_entry.gen.ts @@ -47,7 +47,24 @@ Update an existing Knowledge Base Entry by its unique \`id\`.`, headerParams: [], pathParams: ['id'], urlParams: [], - bodyParams: [], + bodyParams: [ + 'global', + 'name', + 'namespace', + 'users', + 'kbResource', + 'source', + 'text', + 'type', + 'required', + 'vector', + 'description', + 'field', + 'index', + 'queryDescription', + 'inputSchema', + 'outputFields', + ], }, paramsSchema: z.object({ ...getShapeAt(update_knowledge_base_entry_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.update_rule.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.update_rule.gen.ts index df09e2662c5a6..4b591245bac63 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.update_rule.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.update_rule.gen.ts @@ -50,7 +50,73 @@ The difference between the \`id\` and \`rule_id\` is that the \`id\` is a unique headerParams: [], pathParams: [], urlParams: [], - bodyParams: [], + bodyParams: [ + 'actions', + 'alias_purpose', + 'alias_target_id', + 'author', + 'building_block_type', + 'description', + 'enabled', + 'exceptions_list', + 'false_positives', + 'from', + 'id', + 'interval', + 'investigation_fields', + 'license', + 'max_signals', + 'meta', + 'name', + 'namespace', + 'note', + 'outcome', + 'output_index', + 'references', + 'related_integrations', + 'required_fields', + 'response_actions', + 'risk_score', + 'risk_score_mapping', + 'rule_id', + 'rule_name_override', + 'setup', + 'severity', + 'severity_mapping', + 'tags', + 'threat', + 'throttle', + 'timeline_id', + 'timeline_title', + 'timestamp_override', + 'timestamp_override_fallback_disabled', + 'to', + 'version', + 'language', + 'query', + 'type', + 'alert_suppression', + 'data_view_id', + 'event_category_override', + 'filters', + 'index', + 'tiebreaker_field', + 'timestamp_field', + 'saved_id', + 'threshold', + 'threat_index', + 'threat_mapping', + 'threat_query', + 'concurrent_searches', + 'items_per_search', + 'threat_filters', + 'threat_indicator_path', + 'threat_language', + 'anomaly_threshold', + 'machine_learning_job_id', + 'history_window_start', + 'new_terms_fields', + ], }, paramsSchema: z.object({ ...getShapeAt(update_rule_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.upsert_entity.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.upsert_entity.gen.ts index a259f38e0b7ea..3f15773d8de56 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.upsert_entity.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/kibana.upsert_entity.gen.ts @@ -47,7 +47,7 @@ If the specified entity already exists, it is updated with the provided values. headerParams: [], pathParams: ['entityType'], urlParams: ['force'], - bodyParams: [], + bodyParams: ['@timestamp', 'asset', 'entity', 'event', 'user', 'host', 'service'], }, paramsSchema: z.object({ ...getShapeAt(upsert_entity_request, 'body'), diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/schemas/kibana_openapi_zod.gen.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/schemas/kibana_openapi_zod.gen.ts index 87767dfa466e2..52254fc247227 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/schemas/kibana_openapi_zod.gen.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/generated/schemas/kibana_openapi_zod.gen.ts @@ -3599,21 +3599,13 @@ export const security_ai_assistant_api_document_entry_update_fields = z.object({ }).and(security_ai_assistant_api_document_entry_create_fields); export const security_ai_assistant_api_knowledge_base_entry_create_props = z.union([ - z.object({ - type: z.optional(z.literal('Security_AI_Assistant_API_DocumentEntryCreateFields')) - }).and(security_ai_assistant_api_document_entry_create_fields), - z.object({ - type: z.optional(z.literal('Security_AI_Assistant_API_IndexEntryCreateFields')) - }).and(security_ai_assistant_api_index_entry_create_fields) + security_ai_assistant_api_document_entry_create_fields, + security_ai_assistant_api_index_entry_create_fields ]); export const security_ai_assistant_api_knowledge_base_entry_response = z.union([ - z.object({ - type: z.optional(z.literal('Security_AI_Assistant_API_DocumentEntry')) - }).and(security_ai_assistant_api_document_entry), - z.object({ - type: z.optional(z.literal('Security_AI_Assistant_API_IndexEntry')) - }).and(security_ai_assistant_api_index_entry) + security_ai_assistant_api_document_entry, + security_ai_assistant_api_index_entry ]); export const security_ai_assistant_api_knowledge_base_entry_bulk_crud_action_results = z.object({ @@ -3654,21 +3646,13 @@ export const security_ai_assistant_api_knowledge_base_entry_bulk_crud_action_res }); export const security_ai_assistant_api_knowledge_base_entry_update_props = z.union([ - z.object({ - type: z.optional(z.literal('Security_AI_Assistant_API_DocumentEntryUpdateFields')) - }).and(security_ai_assistant_api_document_entry_update_fields), - z.object({ - type: z.optional(z.literal('Security_AI_Assistant_API_IndexEntryUpdateFields')) - }).and(security_ai_assistant_api_index_entry_update_fields) + security_ai_assistant_api_document_entry_update_fields, + security_ai_assistant_api_index_entry_update_fields ]); export const security_ai_assistant_api_knowledge_base_entry_update_route_props = z.union([ - z.object({ - type: z.optional(z.literal('Security_AI_Assistant_API_DocumentEntryCreateFields')) - }).and(security_ai_assistant_api_document_entry_create_fields), - z.object({ - type: z.optional(z.literal('Security_AI_Assistant_API_IndexEntryCreateFields')) - }).and(security_ai_assistant_api_index_entry_create_fields) + security_ai_assistant_api_document_entry_create_fields, + security_ai_assistant_api_index_entry_create_fields ]); export const security_attack_discovery_api_attack_discovery_api_schedule_action_alerts_filter = z.record(z.string(), z.unknown()); @@ -5508,12 +5492,8 @@ export const security_detections_api_error_schema = z.object({ * Discriminated union that determines whether the rule is internally sourced (created within the Kibana app) or has an external source, such as the Elastic Prebuilt rules repo. */ export const security_detections_api_rule_source = z.union([ - z.object({ - type: z.literal('Security_Detections_API_ExternalRuleSource') - }).and(security_detections_api_external_rule_source), - z.object({ - type: z.literal('Security_Detections_API_InternalRuleSource') - }).and(security_detections_api_internal_rule_source) + security_detections_api_external_rule_source, + security_detections_api_internal_rule_source ]); /** @@ -5633,12 +5613,8 @@ export const security_detections_api_set_alerts_status_by_ids_base = z.object({ }); export const security_detections_api_set_alerts_status_by_ids = z.union([ - z.object({ - status: z.literal('closed') - }).and(security_detections_api_close_alerts_by_ids), - z.object({ - status: z.literal('Security_Detections_API_SetAlertsStatusByIdsBase') - }).and(security_detections_api_set_alerts_status_by_ids_base) + security_detections_api_close_alerts_by_ids, + security_detections_api_set_alerts_status_by_ids_base ]); export const security_detections_api_set_alerts_status_by_query_base = z.object({ @@ -5648,12 +5624,8 @@ export const security_detections_api_set_alerts_status_by_query_base = z.object( }); export const security_detections_api_set_alerts_status_by_query = z.union([ - z.object({ - status: z.literal('closed') - }).and(security_detections_api_close_alerts_by_query), - z.object({ - status: z.literal('Security_Detections_API_SetAlertsStatusByQueryBase') - }).and(security_detections_api_set_alerts_status_by_query_base) + security_detections_api_close_alerts_by_query, + security_detections_api_set_alerts_status_by_query_base ]); /** @@ -6478,30 +6450,14 @@ export const security_detections_api_threshold_rule_create_props = z.object({ }).and(security_detections_api_threshold_rule_create_fields); export const security_detections_api_rule_create_props = z.union([ - z.object({ - type: z.optional(z.literal('Security_Detections_API_EqlRuleCreateProps')) - }).and(security_detections_api_eql_rule_create_props), - z.object({ - type: z.optional(z.literal('Security_Detections_API_QueryRuleCreateProps')) - }).and(security_detections_api_query_rule_create_props), - z.object({ - type: z.optional(z.literal('Security_Detections_API_SavedQueryRuleCreateProps')) - }).and(security_detections_api_saved_query_rule_create_props), - z.object({ - type: z.optional(z.literal('Security_Detections_API_ThresholdRuleCreateProps')) - }).and(security_detections_api_threshold_rule_create_props), - z.object({ - type: z.optional(z.literal('Security_Detections_API_ThreatMatchRuleCreateProps')) - }).and(security_detections_api_threat_match_rule_create_props), - z.object({ - type: z.optional(z.literal('Security_Detections_API_MachineLearningRuleCreateProps')) - }).and(security_detections_api_machine_learning_rule_create_props), - z.object({ - type: z.optional(z.literal('Security_Detections_API_NewTermsRuleCreateProps')) - }).and(security_detections_api_new_terms_rule_create_props), - z.object({ - type: z.optional(z.literal('Security_Detections_API_EsqlRuleCreateProps')) - }).and(security_detections_api_esql_rule_create_props) + security_detections_api_eql_rule_create_props, + security_detections_api_query_rule_create_props, + security_detections_api_saved_query_rule_create_props, + security_detections_api_threshold_rule_create_props, + security_detections_api_threat_match_rule_create_props, + security_detections_api_machine_learning_rule_create_props, + security_detections_api_new_terms_rule_create_props, + security_detections_api_esql_rule_create_props ]); /** @@ -7573,30 +7529,14 @@ export const security_detections_api_threshold_rule = z.object({ }).and(security_detections_api_response_fields).and(security_detections_api_threshold_rule_response_fields); export const security_detections_api_rule_response = z.union([ - z.object({ - type: z.optional(z.literal('Security_Detections_API_EqlRule')) - }).and(security_detections_api_eql_rule), - z.object({ - type: z.optional(z.literal('Security_Detections_API_QueryRule')) - }).and(security_detections_api_query_rule), - z.object({ - type: z.optional(z.literal('Security_Detections_API_SavedQueryRule')) - }).and(security_detections_api_saved_query_rule), - z.object({ - type: z.optional(z.literal('Security_Detections_API_ThresholdRule')) - }).and(security_detections_api_threshold_rule), - z.object({ - type: z.optional(z.literal('Security_Detections_API_ThreatMatchRule')) - }).and(security_detections_api_threat_match_rule), - z.object({ - type: z.optional(z.literal('Security_Detections_API_MachineLearningRule')) - }).and(security_detections_api_machine_learning_rule), - z.object({ - type: z.optional(z.literal('Security_Detections_API_NewTermsRule')) - }).and(security_detections_api_new_terms_rule), - z.object({ - type: z.optional(z.literal('Security_Detections_API_EsqlRule')) - }).and(security_detections_api_esql_rule) + security_detections_api_eql_rule, + security_detections_api_query_rule, + security_detections_api_saved_query_rule, + security_detections_api_threshold_rule, + security_detections_api_threat_match_rule, + security_detections_api_machine_learning_rule, + security_detections_api_new_terms_rule, + security_detections_api_esql_rule ]); export const security_detections_api_bulk_edit_action_results = z.object({ @@ -7726,30 +7666,14 @@ export const security_detections_api_threshold_rule_update_props = z.object({ }).and(security_detections_api_threshold_rule_create_fields); export const security_detections_api_rule_update_props = z.union([ - z.object({ - type: z.optional(z.literal('Security_Detections_API_EqlRuleUpdateProps')) - }).and(security_detections_api_eql_rule_update_props), - z.object({ - type: z.optional(z.literal('Security_Detections_API_QueryRuleUpdateProps')) - }).and(security_detections_api_query_rule_update_props), - z.object({ - type: z.optional(z.literal('Security_Detections_API_SavedQueryRuleUpdateProps')) - }).and(security_detections_api_saved_query_rule_update_props), - z.object({ - type: z.optional(z.literal('Security_Detections_API_ThresholdRuleUpdateProps')) - }).and(security_detections_api_threshold_rule_update_props), - z.object({ - type: z.optional(z.literal('Security_Detections_API_ThreatMatchRuleUpdateProps')) - }).and(security_detections_api_threat_match_rule_update_props), - z.object({ - type: z.optional(z.literal('Security_Detections_API_MachineLearningRuleUpdateProps')) - }).and(security_detections_api_machine_learning_rule_update_props), - z.object({ - type: z.optional(z.literal('Security_Detections_API_NewTermsRuleUpdateProps')) - }).and(security_detections_api_new_terms_rule_update_props), - z.object({ - type: z.optional(z.literal('Security_Detections_API_EsqlRuleUpdateProps')) - }).and(security_detections_api_esql_rule_update_props) + security_detections_api_eql_rule_update_props, + security_detections_api_query_rule_update_props, + security_detections_api_saved_query_rule_update_props, + security_detections_api_threshold_rule_update_props, + security_detections_api_threat_match_rule_update_props, + security_detections_api_machine_learning_rule_update_props, + security_detections_api_new_terms_rule_update_props, + security_detections_api_esql_rule_update_props ]); export const security_detections_api_warning_schema = z.object({ @@ -8061,24 +7985,12 @@ export const security_endpoint_exceptions_api_exception_list_item_entry_nested = }); export const security_endpoint_exceptions_api_exception_list_item_entry = z.union([ - z.object({ - type: z.optional(z.literal('Security_Endpoint_Exceptions_API_ExceptionListItemEntryMatch')) - }).and(security_endpoint_exceptions_api_exception_list_item_entry_match), - z.object({ - type: z.optional(z.literal('Security_Endpoint_Exceptions_API_ExceptionListItemEntryMatchAny')) - }).and(security_endpoint_exceptions_api_exception_list_item_entry_match_any), - z.object({ - type: z.optional(z.literal('Security_Endpoint_Exceptions_API_ExceptionListItemEntryList')) - }).and(security_endpoint_exceptions_api_exception_list_item_entry_list), - z.object({ - type: z.optional(z.literal('Security_Endpoint_Exceptions_API_ExceptionListItemEntryExists')) - }).and(security_endpoint_exceptions_api_exception_list_item_entry_exists), - z.object({ - type: z.optional(z.literal('Security_Endpoint_Exceptions_API_ExceptionListItemEntryNested')) - }).and(security_endpoint_exceptions_api_exception_list_item_entry_nested), - z.object({ - type: z.optional(z.literal('Security_Endpoint_Exceptions_API_ExceptionListItemEntryMatchWildcard')) - }).and(security_endpoint_exceptions_api_exception_list_item_entry_match_wildcard) + security_endpoint_exceptions_api_exception_list_item_entry_match, + security_endpoint_exceptions_api_exception_list_item_entry_match_any, + security_endpoint_exceptions_api_exception_list_item_entry_list, + security_endpoint_exceptions_api_exception_list_item_entry_exists, + security_endpoint_exceptions_api_exception_list_item_entry_nested, + security_endpoint_exceptions_api_exception_list_item_entry_match_wildcard ]); export const security_endpoint_exceptions_api_exception_list_item_entry_array = z.array(security_endpoint_exceptions_api_exception_list_item_entry); @@ -8167,6 +8079,19 @@ export const security_endpoint_management_api_agent_types = z.enum([ description: 'List of agent types to retrieve. Defaults to `endpoint`.' }); +/** + * Determines which field is used to sort the results. + */ +export const security_endpoint_management_api_api_sort_field = z.enum([ + 'name', + 'createdAt', + 'createdBy', + 'updatedAt', + 'updatedBy' +]).register(z.globalRegistry, { + description: 'Determines which field is used to sort the results.' +}); + export const security_endpoint_management_api_cloud_file_script_parameters = z.object({ cloudFile: z.string().min(1).register(z.globalRegistry, { description: 'Script name in cloud storage.' @@ -8234,6 +8159,37 @@ export const security_endpoint_management_api_endpoint_ids = z.array(z.string(). export const security_endpoint_management_api_endpoint_metadata_response = z.record(z.string(), z.unknown()); +export const security_endpoint_management_api_endpoint_script_platform = z.enum([ + 'linux', + 'macos', + 'windows' +]); + +export const security_endpoint_management_api_endpoint_script = z.object({ + createdAt: z.optional(z.iso.datetime()), + createdBy: z.optional(z.string()), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Description of the script and its purpose/functionality' + })), + downloadUri: z.optional(z.string().register(z.globalRegistry, { + description: 'URI to download the script file. Note that this is the relative path and does not include the space (if applicable)' + })), + example: z.optional(z.string()), + id: z.optional(z.uuid()), + instructions: z.optional(z.string().register(z.globalRegistry, { + description: 'Instructions for using the script, including details around its supported input arguments' + })), + name: z.optional(z.string()), + pathToExecutable: z.optional(z.string().register(z.globalRegistry, { + description: 'The relative path to the file included in the archive that should be executed once its contents are extracted. Applicable only for scripts uploaded as an archive (.zip file for example).\n' + })), + platform: z.optional(z.array(security_endpoint_management_api_endpoint_script_platform)), + requiresInput: z.optional(z.boolean()), + updatedAt: z.optional(z.iso.datetime()), + updatedBy: z.optional(z.string()), + version: z.optional(z.string()) +}); + export const security_endpoint_management_api_execute_route_response = z.record(z.string(), z.unknown()); export const security_endpoint_management_api_get_endpoint_action_list_response = z.record(z.string(), z.unknown()); @@ -8310,6 +8266,8 @@ export const security_endpoint_management_api_page_size = z.int().gte(1).lte(100 description: 'Number of items per page' }).default(10); +export const security_endpoint_management_api_api_page_size = security_endpoint_management_api_page_size.and(z.unknown()); + /** * Optional parameters object */ @@ -9868,24 +9826,12 @@ export const security_exceptions_api_exception_list_item_entry_nested = z.object }); export const security_exceptions_api_exception_list_item_entry = z.union([ - z.object({ - type: z.optional(z.literal('Security_Exceptions_API_ExceptionListItemEntryMatch')) - }).and(security_exceptions_api_exception_list_item_entry_match), - z.object({ - type: z.optional(z.literal('Security_Exceptions_API_ExceptionListItemEntryMatchAny')) - }).and(security_exceptions_api_exception_list_item_entry_match_any), - z.object({ - type: z.optional(z.literal('Security_Exceptions_API_ExceptionListItemEntryList')) - }).and(security_exceptions_api_exception_list_item_entry_list), - z.object({ - type: z.optional(z.literal('Security_Exceptions_API_ExceptionListItemEntryExists')) - }).and(security_exceptions_api_exception_list_item_entry_exists), - z.object({ - type: z.optional(z.literal('Security_Exceptions_API_ExceptionListItemEntryNested')) - }).and(security_exceptions_api_exception_list_item_entry_nested), - z.object({ - type: z.optional(z.literal('Security_Exceptions_API_ExceptionListItemEntryMatchWildcard')) - }).and(security_exceptions_api_exception_list_item_entry_match_wildcard) + security_exceptions_api_exception_list_item_entry_match, + security_exceptions_api_exception_list_item_entry_match_any, + security_exceptions_api_exception_list_item_entry_list, + security_exceptions_api_exception_list_item_entry_exists, + security_exceptions_api_exception_list_item_entry_nested, + security_exceptions_api_exception_list_item_entry_match_wildcard ]); export const security_exceptions_api_exception_list_item_entry_array = z.array(security_exceptions_api_exception_list_item_entry); @@ -12359,7 +12305,7 @@ export const synthetics_browser_monitor_fields = synthetics_common_monitor_field ]).register(z.globalRegistry, { description: 'The screenshot option.' })), - synthetics_args: z.optional(z.array(z.unknown()).register(z.globalRegistry, { + synthetics_args: z.optional(z.array(z.string()).register(z.globalRegistry, { description: 'Synthetics agent CLI arguments.' })), type: z.enum(['browser']).register(z.globalRegistry, { @@ -15389,6 +15335,15 @@ export const cases_ids = z.array(z.string()).register(z.globalRegistry, { description: 'The cases that you want to removed. All non-ASCII characters must be URL encoded.\n' }); +/** + * Deprecated in 8.1.0. This parameter is deprecated and will be removed in a future release. It determines whether case comments are returned. + * + * @deprecated + */ +export const cases_include_comments = z.boolean().register(z.globalRegistry, { + description: 'Deprecated in 8.1.0. This parameter is deprecated and will be removed in a future release. It determines whether case comments are returned.' +}).default(true); + /** * Cross-site request forgery protection */ @@ -15613,6 +15568,54 @@ export const get_actions_connector_types_request = z.object({ })) }); +/** + * Indicates a successful call. + */ +export const get_actions_connector_types_response = z.array(z.object({ + allow_multiple_system_actions: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether multiple instances of the same system action connector can be used in a single rule.' + })), + enabled: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the connector is enabled.' + }), + enabled_in_config: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the connector is enabled in the Kibana configuration.' + }), + enabled_in_license: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the connector is enabled through the license.' + }), + id: z.string().register(z.globalRegistry, { + description: 'The identifier for the connector.' + }), + is_deprecated: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the connector type is deprecated.' + }), + is_system_action_type: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the action is a system action.' + }), + minimum_license_required: z.enum([ + 'basic', + 'standard', + 'gold', + 'platinum', + 'enterprise', + 'trial' + ]).register(z.globalRegistry, { + description: 'The minimum license required to enable the connector.' + }), + name: z.string().register(z.globalRegistry, { + description: 'The name of the connector type.' + }), + sub_feature: z.optional(z.enum(['endpointSecurity']).register(z.globalRegistry, { + description: 'Indicates the sub-feature type the connector is grouped under.' + })), + supported_feature_ids: z.array(z.string()).register(z.globalRegistry, { + description: 'The list of supported features' + }) +})).register(z.globalRegistry, { + description: 'Indicates a successful call.' +}); + export const delete_actions_connector_id_request = z.object({ body: z.optional(z.never()), path: z.object({ @@ -15656,6 +15659,9 @@ export const get_actions_connector_id_response = z.object({ id: z.string().register(z.globalRegistry, { description: 'The identifier for the connector.' }), + is_connector_type_deprecated: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the connector type is deprecated.' + }), is_deprecated: z.boolean().register(z.globalRegistry, { description: 'Indicates whether the connector is deprecated.' }), @@ -15669,7 +15675,7 @@ export const get_actions_connector_id_response = z.object({ description: 'Indicates whether the connector is used for system actions.' }), name: z.string().register(z.globalRegistry, { - description: ' The name of the rule.' + description: ' The name of the connector.' }) }).register(z.globalRegistry, { description: 'Indicates a successful call.' @@ -15758,6 +15764,9 @@ export const post_actions_connector_id_response = z.object({ id: z.string().register(z.globalRegistry, { description: 'The identifier for the connector.' }), + is_connector_type_deprecated: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the connector type is deprecated.' + }), is_deprecated: z.boolean().register(z.globalRegistry, { description: 'Indicates whether the connector is deprecated.' }), @@ -15771,7 +15780,7 @@ export const post_actions_connector_id_response = z.object({ description: 'Indicates whether the connector is used for system actions.' }), name: z.string().register(z.globalRegistry, { - description: ' The name of the rule.' + description: ' The name of the connector.' }) }).register(z.globalRegistry, { description: 'Indicates a successful call.' @@ -15856,6 +15865,9 @@ export const put_actions_connector_id_response = z.object({ id: z.string().register(z.globalRegistry, { description: 'The identifier for the connector.' }), + is_connector_type_deprecated: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the connector type is deprecated.' + }), is_deprecated: z.boolean().register(z.globalRegistry, { description: 'Indicates whether the connector is deprecated.' }), @@ -15869,7 +15881,7 @@ export const put_actions_connector_id_response = z.object({ description: 'Indicates whether the connector is used for system actions.' }), name: z.string().register(z.globalRegistry, { - description: ' The name of the rule.' + description: ' The name of the connector.' }) }).register(z.globalRegistry, { description: 'Indicates a successful call.' @@ -15926,6 +15938,9 @@ export const post_actions_connector_id_execute_response = z.object({ id: z.string().register(z.globalRegistry, { description: 'The identifier for the connector.' }), + is_connector_type_deprecated: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the connector type is deprecated.' + }), is_deprecated: z.boolean().register(z.globalRegistry, { description: 'Indicates whether the connector is deprecated.' }), @@ -15939,7 +15954,7 @@ export const post_actions_connector_id_execute_response = z.object({ description: 'Indicates whether the connector is used for system actions.' }), name: z.string().register(z.globalRegistry, { - description: ' The name of the rule.' + description: ' The name of the connector.' }) }).register(z.globalRegistry, { description: 'Indicates a successful call.' @@ -15951,6 +15966,42 @@ export const get_actions_connectors_request = z.object({ query: z.optional(z.never()) }); +/** + * Indicates a successful call. + */ +export const get_actions_connectors_response = z.array(z.object({ + config: z.optional(z.record(z.string(), z.unknown())), + connector_type_id: z.string().register(z.globalRegistry, { + description: 'The connector type identifier.' + }), + id: z.string().register(z.globalRegistry, { + description: 'The identifier for the connector.' + }), + is_connector_type_deprecated: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the connector type is deprecated.' + }), + is_deprecated: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the connector is deprecated.' + }), + is_missing_secrets: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the connector is missing secrets.' + })), + is_preconfigured: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the connector is preconfigured. If true, the `config` and `is_missing_secrets` properties are omitted from the response. ' + }), + is_system_action: z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the connector is used for system actions.' + }), + name: z.string().register(z.globalRegistry, { + description: ' The name of the connector.' + }), + referenced_by_count: z.number().register(z.globalRegistry, { + description: 'The number of saved objects that reference the connector. If is_preconfigured is true, this value is not calculated.' + }) +})).register(z.globalRegistry, { + description: 'Indicates a successful call.' +}); + export const post_agent_builder_a2a_agentid_request = z.object({ body: z.optional(z.unknown()), path: z.object({ @@ -16804,6 +16855,9 @@ export const get_alerting_rule_id_response = z.object({ }), flapping: z.optional(z.union([ z.object({ + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Determines whether the rule can enter the flapping state. By default, rules can enter the flapping state.' + })), look_back_window: z.number().gte(2).lte(20).register(z.globalRegistry, { description: 'The minimum number of runs in which the threshold must be met.' }), @@ -17231,6 +17285,9 @@ export const post_alerting_rule_id_request = z.object({ })).default(true), flapping: z.optional(z.union([ z.object({ + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Determines whether the rule can enter the flapping state. By default, rules can enter the flapping state.' + })), look_back_window: z.number().gte(2).lte(20).register(z.globalRegistry, { description: 'The minimum number of runs in which the threshold must be met.' }), @@ -17475,6 +17532,9 @@ export const post_alerting_rule_id_response = z.object({ }), flapping: z.optional(z.union([ z.object({ + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Determines whether the rule can enter the flapping state. By default, rules can enter the flapping state.' + })), look_back_window: z.number().gte(2).lte(20).register(z.globalRegistry, { description: 'The minimum number of runs in which the threshold must be met.' }), @@ -17894,6 +17954,9 @@ export const put_alerting_rule_id_request = z.object({ })), flapping: z.optional(z.union([ z.object({ + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Determines whether the rule can enter the flapping state. By default, rules can enter the flapping state.' + })), look_back_window: z.number().gte(2).lte(20).register(z.globalRegistry, { description: 'The minimum number of runs in which the threshold must be met.' }), @@ -18120,6 +18183,9 @@ export const put_alerting_rule_id_response = z.object({ }), flapping: z.optional(z.union([ z.object({ + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Determines whether the rule can enter the flapping state. By default, rules can enter the flapping state.' + })), look_back_window: z.number().gte(2).lte(20).register(z.globalRegistry, { description: 'The minimum number of runs in which the threshold must be met.' }), @@ -18951,6 +19017,9 @@ export const get_alerting_rules_find_response = z.object({ }), flapping: z.optional(z.union([ z.object({ + enabled: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Determines whether the rule can enter the flapping state. By default, rules can enter the flapping state.' + })), look_back_window: z.number().gte(2).lte(20).register(z.globalRegistry, { description: 'The minimum number of runs in which the threshold must be met.' }), @@ -20222,7 +20291,11 @@ export const get_case_default_space_request = z.object({ description: 'The identifier for the case. To retrieve case IDs, use the find cases API. All non-ASCII characters must be URL encoded.' }) }), - query: z.optional(z.never()) + query: z.optional(z.object({ + includeComments: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Deprecated in 8.1.0. This parameter is deprecated and will be removed in a future release. It determines whether case comments are returned.' + })).default(true) + })) }); /** @@ -22245,6 +22318,34 @@ export const create_update_protection_updates_note_request = z.object({ */ export const create_update_protection_updates_note_response = security_endpoint_management_api_protection_updates_note_response; +export const endpoint_script_library_list_scripts_request = z.object({ + body: z.optional(z.never()), + path: z.optional(z.never()), + query: z.optional(z.object({ + page: z.optional(security_endpoint_management_api_page), + pageSize: z.optional(security_endpoint_management_api_api_page_size), + sortField: z.optional(security_endpoint_management_api_api_sort_field), + sortDirection: z.optional(security_endpoint_management_api_sort_direction), + kuery: z.optional(security_endpoint_management_api_kuery.and(z.unknown())) + })) +}); + +/** + * List of scripts response + */ +export const endpoint_script_library_list_scripts_response = z.object({ + data: z.optional(z.array(security_endpoint_management_api_endpoint_script)), + page: z.optional(security_endpoint_management_api_page), + pageSize: z.optional(security_endpoint_management_api_api_page_size), + sortDirection: z.optional(security_endpoint_management_api_sort_direction), + sortField: z.optional(security_endpoint_management_api_api_sort_field), + total: z.optional(z.int().register(z.globalRegistry, { + description: 'The total number of scripts matching the query' + })) +}).register(z.globalRegistry, { + description: 'List of scripts response' +}); + export const delete_monitoring_engine_request = z.object({ body: z.optional(z.never()), path: z.optional(z.never()), @@ -23535,6 +23636,10 @@ export const get_fleet_agent_policies_response = z.object({ z.string(), z.null() ])), + cloud_connector_name: z.optional(z.union([ + z.string().min(1).max(255), + z.null() + ])), created_at: z.string(), created_by: z.string(), description: z.optional(z.string().register(z.globalRegistry, { @@ -24028,6 +24133,10 @@ export const post_fleet_agent_policies_response = z.object({ z.string(), z.null() ])), + cloud_connector_name: z.optional(z.union([ + z.string().min(1).max(255), + z.null() + ])), created_at: z.string(), created_by: z.string(), description: z.optional(z.string().register(z.globalRegistry, { @@ -24407,6 +24516,10 @@ export const post_fleet_agent_policies_bulk_get_response = z.object({ z.string(), z.null() ])), + cloud_connector_name: z.optional(z.union([ + z.string().min(1).max(255), + z.null() + ])), created_at: z.string(), created_by: z.string(), description: z.optional(z.string().register(z.globalRegistry, { @@ -24775,6 +24888,10 @@ export const get_fleet_agent_policies_agentpolicyid_response = z.object({ z.string(), z.null() ])), + cloud_connector_name: z.optional(z.union([ + z.string().min(1).max(255), + z.null() + ])), created_at: z.string(), created_by: z.string(), description: z.optional(z.string().register(z.globalRegistry, { @@ -25268,6 +25385,10 @@ export const put_fleet_agent_policies_agentpolicyid_response = z.object({ z.string(), z.null() ])), + cloud_connector_name: z.optional(z.union([ + z.string().min(1).max(255), + z.null() + ])), created_at: z.string(), created_by: z.string(), description: z.optional(z.string().register(z.globalRegistry, { @@ -25681,6 +25802,10 @@ export const post_fleet_agent_policies_agentpolicyid_copy_response = z.object({ z.string(), z.null() ])), + cloud_connector_name: z.optional(z.union([ + z.string().min(1).max(255), + z.null() + ])), created_at: z.string(), created_by: z.string(), description: z.optional(z.string().register(z.globalRegistry, { @@ -26333,7 +26458,7 @@ export const post_fleet_agentless_policies_request = z.object({ enabled: z.optional(z.boolean().register(z.globalRegistry, { description: 'Whether cloud connectors are enabled for this policy.' })).default(false), - name: z.optional(z.string().register(z.globalRegistry, { + name: z.optional(z.string().min(1).max(255).register(z.globalRegistry, { description: 'Optional name for the cloud connector. If not provided, will be auto-generated from credentials.' })) })), @@ -26456,6 +26581,10 @@ export const post_fleet_agentless_policies_response = z.object({ z.string(), z.null() ])), + cloud_connector_name: z.optional(z.union([ + z.string().min(1).max(255), + z.null() + ])), created_at: z.string(), created_by: z.string(), description: z.optional(z.string().register(z.globalRegistry, { @@ -28228,6 +28357,46 @@ export const put_fleet_cloud_connectors_cloudconnectorid_response = z.object({ description: 'OK: A successful request.' }); +export const get_fleet_cloud_connectors_cloudconnectorid_usage_request = z.object({ + body: z.optional(z.never()), + path: z.object({ + cloudConnectorId: z.string().register(z.globalRegistry, { + description: 'The unique identifier of the cloud connector.' + }) + }), + query: z.optional(z.object({ + page: z.optional(z.number().gte(1).register(z.globalRegistry, { + description: 'The page number for pagination.' + })), + perPage: z.optional(z.number().gte(1).register(z.globalRegistry, { + description: 'The number of items per page.' + })) + })) +}); + +/** + * OK: A successful request. + */ +export const get_fleet_cloud_connectors_cloudconnectorid_usage_response = z.object({ + items: z.array(z.object({ + created_at: z.string(), + id: z.string(), + name: z.string(), + package: z.optional(z.object({ + name: z.string(), + title: z.string(), + version: z.string() + })), + policy_ids: z.array(z.string()), + updated_at: z.string() + })), + page: z.number(), + perPage: z.number(), + total: z.number() +}).register(z.globalRegistry, { + description: 'OK: A successful request.' +}); + export const get_fleet_data_streams_request = z.object({ body: z.optional(z.never()), path: z.optional(z.never()), @@ -33849,6 +34018,10 @@ export const get_fleet_package_policies_response = z.object({ z.string(), z.null() ])), + cloud_connector_name: z.optional(z.union([ + z.string().min(1).max(255), + z.null() + ])), created_at: z.string(), created_by: z.string(), description: z.optional(z.string().register(z.globalRegistry, { @@ -34071,6 +34244,10 @@ export const post_fleet_package_policies_request = z.object({ z.string(), z.null() ])), + cloud_connector_name: z.optional(z.union([ + z.string().min(1).max(255), + z.null() + ])), description: z.optional(z.string().register(z.globalRegistry, { description: 'Package policy description' })), @@ -34337,6 +34514,10 @@ export const post_fleet_package_policies_response = z.object({ z.string(), z.null() ])), + cloud_connector_name: z.optional(z.union([ + z.string().min(1).max(255), + z.null() + ])), created_at: z.string(), created_by: z.string(), description: z.optional(z.string().register(z.globalRegistry, { @@ -34577,6 +34758,10 @@ export const post_fleet_package_policies_bulk_get_response = z.object({ z.string(), z.null() ])), + cloud_connector_name: z.optional(z.union([ + z.string().min(1).max(255), + z.null() + ])), created_at: z.string(), created_by: z.string(), description: z.optional(z.string().register(z.globalRegistry, { @@ -34833,6 +35018,10 @@ export const get_fleet_package_policies_packagepolicyid_response = z.object({ z.string(), z.null() ])), + cloud_connector_name: z.optional(z.union([ + z.string().min(1).max(255), + z.null() + ])), created_at: z.string(), created_by: z.string(), description: z.optional(z.string().register(z.globalRegistry, { @@ -35052,6 +35241,10 @@ export const put_fleet_package_policies_packagepolicyid_request = z.object({ z.string(), z.null() ])), + cloud_connector_name: z.optional(z.union([ + z.string().min(1).max(255), + z.null() + ])), description: z.optional(z.string().register(z.globalRegistry, { description: 'Package policy description' })), @@ -35314,6 +35507,10 @@ export const put_fleet_package_policies_packagepolicyid_response = z.object({ z.string(), z.null() ])), + cloud_connector_name: z.optional(z.union([ + z.string().min(1).max(255), + z.null() + ])), created_at: z.string(), created_by: z.string(), description: z.optional(z.string().register(z.globalRegistry, { @@ -35672,6 +35869,10 @@ export const post_fleet_package_policies_upgrade_dryrun_response = z.array(z.obj z.string(), z.null() ])), + cloud_connector_name: z.optional(z.union([ + z.string().min(1).max(255), + z.null() + ])), created_at: z.string(), created_by: z.string(), description: z.optional(z.string().register(z.globalRegistry, { @@ -35882,6 +36083,10 @@ export const post_fleet_package_policies_upgrade_dryrun_response = z.array(z.obj z.string(), z.null() ])), + cloud_connector_name: z.optional(z.union([ + z.string().min(1).max(255), + z.null() + ])), created_at: z.optional(z.string()), created_by: z.optional(z.string()), description: z.optional(z.string().register(z.globalRegistry, { @@ -39920,16 +40125,27 @@ export const put_streams_name_request = z.object({ z.union([ z.record(z.string(), z.unknown()).and(z.object({ stream: z.object({ - name: z.optional(z.unknown()) + ingest: z.optional(z.object({ + processing: z.object({ + updated_at: z.optional(z.unknown()) + }) + })), + name: z.optional(z.unknown()), + updated_at: z.optional(z.unknown()) }).and(z.object({ description: z.string(), - name: z.string() + name: z.string(), + updated_at: z.iso.datetime() })) })).and(z.object({ dashboards: z.array(z.string()), queries: z.array(z.object({ - id: z.string().min(1), - title: z.string().min(1) + id: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }), + title: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) }).and(z.object({ feature: z.optional(z.object({ filter: z.union([ @@ -39950,7 +40166,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -39997,35 +40215,67 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]), - name: z.string().min(1) + name: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) })), kql: z.object({ query: z.string() @@ -40035,11 +40285,14 @@ export const put_streams_name_request = z.object({ rules: z.array(z.string()) })).and(z.object({ stream: z.object({ - name: z.optional(z.unknown()) - }).and(z.record(z.string(), z.unknown()).and(z.object({ - description: z.string(), - name: z.string() - })).and(z.object({ + ingest: z.optional(z.object({ + processing: z.object({ + updated_at: z.optional(z.unknown()) + }) + })), + name: z.optional(z.unknown()), + updated_at: z.optional(z.unknown()) + }).and(z.object({ ingest: z.object({ failure_store: z.union([ z.object({ @@ -40052,7 +40305,9 @@ export const put_streams_name_request = z.object({ z.object({ lifecycle: z.object({ enabled: z.object({ - data_retention: z.optional(z.string().min(1)) + data_retention: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })) }) }) }), @@ -40066,12 +40321,16 @@ export const put_streams_name_request = z.object({ lifecycle: z.union([ z.object({ dsl: z.object({ - data_retention: z.optional(z.string().min(1)) + data_retention: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })) }) }), z.object({ ilm: z.object({ - policy: z.string().min(1) + policy: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) }) }), z.object({ @@ -40082,13 +40341,27 @@ export const put_streams_name_request = z.object({ steps: z.array(z.union([z.union([ z.object({ action: z.enum(['grok']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to parse with grok patterns' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), pattern_definitions: z.optional(z.record(z.string(), z.string())), - patterns: z.array(z.string().min(1)).min(1), + patterns: z.array(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })).min(1).register(z.globalRegistry, { + description: 'Grok patterns applied in order to extract fields' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -40107,7 +40380,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -40154,44 +40429,90 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Grok processor - Extract fields from text using grok patterns' }), z.object({ action: z.enum(['dissect']), - append_separator: z.optional(z.string().min(1)), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - pattern: z.string().min(1), + append_separator: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Separator inserted when target fields are concatenated' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to parse with dissect pattern' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), + pattern: z.string().min(1).register(z.globalRegistry, { + description: 'Dissect pattern describing field boundaries' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -40210,7 +40531,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -40257,46 +40580,98 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Dissect processor - Extract fields from text using a lightweight, delimiter-based parser' }), z.object({ action: z.enum(['date']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - formats: z.array(z.string().min(1)), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - locale: z.optional(z.string().min(1)), - output_format: z.optional(z.string().min(1)), - timezone: z.optional(z.string().min(1)), - to: z.optional(z.string().min(1)), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + formats: z.array(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })).register(z.globalRegistry, { + description: 'Accepted input date formats, tried in order' + }), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field containing the date/time text' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + locale: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional locale for date parsing' + })), + output_format: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional output format for storing the parsed date as text' + })), + timezone: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional timezone for date parsing' + })), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Target field for the parsed date (defaults to source)' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -40315,7 +40690,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -40362,40 +40739,78 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Date processor - Parse dates from strings using one or more expected formats' }), z.object({ action: z.enum(['drop_document']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -40414,7 +40829,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -40461,44 +40878,90 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Base processor options plus conditional execution' }), z.object({ action: z.enum(['rename']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - override: z.optional(z.boolean()), - to: z.string().min(1), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Existing source field to rename or move' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip when source field is missing' + })), + override: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Allow overwriting the target field if it already exists' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'New field name or destination path' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -40517,7 +40980,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -40564,44 +41029,90 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Rename processor - Change a field name and optionally its location' }), z.object({ action: z.enum(['set']), - copy_from: z.optional(z.string().min(1)), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - override: z.optional(z.boolean()), - to: z.string().min(1), - value: z.optional(z.unknown()), + copy_from: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Copy value from another field instead of providing a literal' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + override: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Allow overwriting an existing target field' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'Target field to set or create' + }), + value: z.optional(z.unknown().register(z.globalRegistry, { + description: 'Literal value to assign to the target field' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -40620,7 +41131,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -40667,43 +41180,87 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Set processor - Assign a literal or copied value to a field (mutually exclusive inputs)' }), z.object({ action: z.enum(['append']), - allow_duplicates: z.optional(z.boolean()), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - to: z.string().min(1), - value: z.array(z.unknown()).min(1), + allow_duplicates: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, do not deduplicate appended values' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'Array field to append values to' + }), + value: z.array(z.unknown()).min(1).register(z.globalRegistry, { + description: 'Values to append (must be literal, no templates)' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -40722,7 +41279,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -40769,49 +41328,101 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Append processor - Append one or more values to an existing or new array field' }), z.object({ action: z.enum(['remove_by_prefix']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()) + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Field to remove along with all its nested fields' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })) + }).register(z.globalRegistry, { + description: 'Remove by prefix processor - Remove a field and all nested fields matching the prefix' }), z.object({ action: z.enum(['remove']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Field to remove from the document' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -40830,7 +41441,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -40877,45 +41490,89 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Remove processor - Delete one or more fields from the document' }), z.object({ action: z.enum(['replace']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), ignore_missing: z.optional(z.boolean()), - pattern: z.string().min(1), + pattern: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string or string with whitespace.' + }), replacement: z.string(), - to: z.optional(z.string().min(1)), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -40934,7 +41591,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -40981,50 +41640,96 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Base processor options plus conditional execution' }), z.object({ action: z.enum(['convert']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - to: z.optional(z.string().min(1)), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to convert to a different data type' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Target field for the converted value (defaults to source)' + })), type: z.enum([ 'integer', 'long', 'double', 'boolean', 'string' - ]), + ]).register(z.globalRegistry, { + description: 'Target data type: integer, long, double, boolean, or string' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -41043,7 +41748,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -41090,41 +41797,83 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Convert processor - Change the data type of a field value (integer, long, double, boolean, or string)' }), z.object({ - action: z.enum(['manual_ingest_pipeline']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - on_failure: z.optional(z.array(z.record(z.string(), z.unknown()))), + action: z.enum(['manual_ingest_pipeline']).register(z.globalRegistry, { + description: 'Manual ingest pipeline - executes raw Elasticsearch ingest processors' + }), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + on_failure: z.optional(z.array(z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Fallback processors to run when a processor fails' + })), processors: z.array(z.object({ append: z.unknown(), attachment: z.unknown(), @@ -41171,8 +41920,12 @@ export const put_streams_name_request = z.object({ uri_parts: z.unknown(), urldecode: z.unknown(), user_agent: z.unknown() + })).register(z.globalRegistry, { + description: 'List of raw Elasticsearch ingest processors to run' + }), + tag: z.optional(z.string().register(z.globalRegistry, { + description: 'Optional ingest processor tag for Elasticsearch' })), - tag: z.optional(z.string()), where: z.optional(z.union([ z.union([ z.object({ @@ -41191,7 +41944,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -41238,34 +41993,66 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Manual ingest pipeline wrapper around native Elasticsearch processors' }) ]), z.object({ customIdentifier: z.optional(z.string()), @@ -41287,7 +42074,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -41334,37 +42123,68 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]), z.object({ steps: z.array(z.unknown()) })) - })])) + })])), + updated_at: z.iso.datetime() }), settings: z.object({ 'index.number_of_replicas': z.optional(z.object({ @@ -41380,9 +42200,7 @@ export const put_streams_name_request = z.object({ ]) })) }) - }) - })).and(z.object({ - ingest: z.object({ + }).and(z.object({ wired: z.object({ fields: z.record(z.string(), z.record(z.string(), z.union([ z.union([ @@ -41403,7 +42221,9 @@ export const put_streams_name_request = z.object({ z.unknown() ])).and(z.union([ z.object({ - format: z.optional(z.string().min(1)), + format: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })), type: z.enum([ 'keyword', 'match_only_text', @@ -41411,7 +42231,8 @@ export const put_streams_name_request = z.object({ 'double', 'date', 'boolean', - 'ip' + 'ip', + 'geo_point' ]) }), z.object({ @@ -41419,7 +42240,9 @@ export const put_streams_name_request = z.object({ }) ]))), routing: z.array(z.object({ - destination: z.string().min(1), + destination: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }), status: z.optional(z.enum(['enabled', 'disabled'])), where: z.union([ z.union([ @@ -41439,7 +42262,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -41486,50 +42311,91 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]) })) }) - }) - }))) + })) + })) })).and(z.record(z.string(), z.unknown())).and(z.object({ stream: z.object({ - name: z.optional(z.unknown()) + ingest: z.optional(z.object({ + processing: z.object({ + updated_at: z.optional(z.unknown()) + }) + })), + name: z.optional(z.unknown()), + updated_at: z.optional(z.unknown()) }).and(z.object({ description: z.string(), - name: z.string() + name: z.string(), + updated_at: z.iso.datetime() })) })).and(z.object({ dashboards: z.array(z.string()), queries: z.array(z.object({ - id: z.string().min(1), - title: z.string().min(1) + id: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }), + title: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) }).and(z.object({ feature: z.optional(z.object({ filter: z.union([ @@ -41550,7 +42416,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -41597,35 +42465,67 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]), - name: z.string().min(1) + name: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) })), kql: z.object({ query: z.string() @@ -41635,7 +42535,13 @@ export const put_streams_name_request = z.object({ rules: z.array(z.string()) })).and(z.object({ stream: z.object({ - name: z.optional(z.unknown()) + ingest: z.optional(z.object({ + processing: z.object({ + updated_at: z.optional(z.unknown()) + }) + })), + name: z.optional(z.unknown()), + updated_at: z.optional(z.unknown()) }).and(z.object({ ingest: z.object({ failure_store: z.union([ @@ -41649,7 +42555,9 @@ export const put_streams_name_request = z.object({ z.object({ lifecycle: z.object({ enabled: z.object({ - data_retention: z.optional(z.string().min(1)) + data_retention: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })) }) }) }), @@ -41663,12 +42571,16 @@ export const put_streams_name_request = z.object({ lifecycle: z.union([ z.object({ dsl: z.object({ - data_retention: z.optional(z.string().min(1)) + data_retention: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })) }) }), z.object({ ilm: z.object({ - policy: z.string().min(1) + policy: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) }) }), z.object({ @@ -41679,13 +42591,27 @@ export const put_streams_name_request = z.object({ steps: z.array(z.union([z.union([ z.object({ action: z.enum(['grok']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to parse with grok patterns' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), pattern_definitions: z.optional(z.record(z.string(), z.string())), - patterns: z.array(z.string().min(1)).min(1), + patterns: z.array(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })).min(1).register(z.globalRegistry, { + description: 'Grok patterns applied in order to extract fields' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -41704,7 +42630,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -41751,44 +42679,90 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Grok processor - Extract fields from text using grok patterns' }), z.object({ action: z.enum(['dissect']), - append_separator: z.optional(z.string().min(1)), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - pattern: z.string().min(1), + append_separator: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Separator inserted when target fields are concatenated' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to parse with dissect pattern' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), + pattern: z.string().min(1).register(z.globalRegistry, { + description: 'Dissect pattern describing field boundaries' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -41807,7 +42781,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -41854,46 +42830,98 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Dissect processor - Extract fields from text using a lightweight, delimiter-based parser' }), z.object({ action: z.enum(['date']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - formats: z.array(z.string().min(1)), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - locale: z.optional(z.string().min(1)), - output_format: z.optional(z.string().min(1)), - timezone: z.optional(z.string().min(1)), - to: z.optional(z.string().min(1)), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + formats: z.array(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })).register(z.globalRegistry, { + description: 'Accepted input date formats, tried in order' + }), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field containing the date/time text' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + locale: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional locale for date parsing' + })), + output_format: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional output format for storing the parsed date as text' + })), + timezone: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional timezone for date parsing' + })), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Target field for the parsed date (defaults to source)' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -41912,7 +42940,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -41959,40 +42989,78 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Date processor - Parse dates from strings using one or more expected formats' }), z.object({ action: z.enum(['drop_document']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -42011,7 +43079,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -42058,44 +43128,90 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Base processor options plus conditional execution' }), z.object({ action: z.enum(['rename']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - override: z.optional(z.boolean()), - to: z.string().min(1), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Existing source field to rename or move' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip when source field is missing' + })), + override: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Allow overwriting the target field if it already exists' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'New field name or destination path' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -42114,7 +43230,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -42161,44 +43279,90 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Rename processor - Change a field name and optionally its location' }), z.object({ action: z.enum(['set']), - copy_from: z.optional(z.string().min(1)), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - override: z.optional(z.boolean()), - to: z.string().min(1), - value: z.optional(z.unknown()), + copy_from: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Copy value from another field instead of providing a literal' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + override: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Allow overwriting an existing target field' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'Target field to set or create' + }), + value: z.optional(z.unknown().register(z.globalRegistry, { + description: 'Literal value to assign to the target field' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -42217,7 +43381,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -42264,43 +43430,87 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Set processor - Assign a literal or copied value to a field (mutually exclusive inputs)' }), z.object({ action: z.enum(['append']), - allow_duplicates: z.optional(z.boolean()), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - to: z.string().min(1), - value: z.array(z.unknown()).min(1), + allow_duplicates: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, do not deduplicate appended values' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'Array field to append values to' + }), + value: z.array(z.unknown()).min(1).register(z.globalRegistry, { + description: 'Values to append (must be literal, no templates)' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -42319,7 +43529,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -42366,49 +43578,101 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Append processor - Append one or more values to an existing or new array field' }), z.object({ action: z.enum(['remove_by_prefix']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()) + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Field to remove along with all its nested fields' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })) + }).register(z.globalRegistry, { + description: 'Remove by prefix processor - Remove a field and all nested fields matching the prefix' }), z.object({ action: z.enum(['remove']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Field to remove from the document' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -42427,7 +43691,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -42474,45 +43740,89 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Remove processor - Delete one or more fields from the document' }), z.object({ action: z.enum(['replace']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), ignore_missing: z.optional(z.boolean()), - pattern: z.string().min(1), + pattern: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string or string with whitespace.' + }), replacement: z.string(), - to: z.optional(z.string().min(1)), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -42531,7 +43841,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -42578,50 +43890,96 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Base processor options plus conditional execution' }), z.object({ action: z.enum(['convert']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - to: z.optional(z.string().min(1)), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to convert to a different data type' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Target field for the converted value (defaults to source)' + })), type: z.enum([ 'integer', 'long', 'double', 'boolean', 'string' - ]), + ]).register(z.globalRegistry, { + description: 'Target data type: integer, long, double, boolean, or string' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -42640,7 +43998,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -42687,41 +44047,83 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Convert processor - Change the data type of a field value (integer, long, double, boolean, or string)' }), z.object({ - action: z.enum(['manual_ingest_pipeline']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - on_failure: z.optional(z.array(z.record(z.string(), z.unknown()))), + action: z.enum(['manual_ingest_pipeline']).register(z.globalRegistry, { + description: 'Manual ingest pipeline - executes raw Elasticsearch ingest processors' + }), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + on_failure: z.optional(z.array(z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Fallback processors to run when a processor fails' + })), processors: z.array(z.object({ append: z.unknown(), attachment: z.unknown(), @@ -42768,8 +44170,12 @@ export const put_streams_name_request = z.object({ uri_parts: z.unknown(), urldecode: z.unknown(), user_agent: z.unknown() + })).register(z.globalRegistry, { + description: 'List of raw Elasticsearch ingest processors to run' + }), + tag: z.optional(z.string().register(z.globalRegistry, { + description: 'Optional ingest processor tag for Elasticsearch' })), - tag: z.optional(z.string()), where: z.optional(z.union([ z.union([ z.object({ @@ -42788,7 +44194,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -42835,34 +44243,66 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Manual ingest pipeline wrapper around native Elasticsearch processors' }) ]), z.object({ customIdentifier: z.optional(z.string()), @@ -42884,7 +44324,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -42931,37 +44373,68 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]), z.object({ steps: z.array(z.unknown()) })) - })])) + })])), + updated_at: z.iso.datetime() }), settings: z.object({ 'index.number_of_replicas': z.optional(z.object({ @@ -42982,16 +44455,27 @@ export const put_streams_name_request = z.object({ })).and(z.record(z.string(), z.unknown())).and(z.record(z.string(), z.unknown())), z.record(z.string(), z.unknown()).and(z.object({ stream: z.object({ - name: z.optional(z.unknown()) + ingest: z.optional(z.object({ + processing: z.object({ + updated_at: z.optional(z.unknown()) + }) + })), + name: z.optional(z.unknown()), + updated_at: z.optional(z.unknown()) }).and(z.object({ description: z.string(), - name: z.string() + name: z.string(), + updated_at: z.iso.datetime() })) })).and(z.object({ dashboards: z.array(z.string()), queries: z.array(z.object({ - id: z.string().min(1), - title: z.string().min(1) + id: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }), + title: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) }).and(z.object({ feature: z.optional(z.object({ filter: z.union([ @@ -43012,7 +44496,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -43059,35 +44545,67 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]), - name: z.string().min(1) + name: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) })), kql: z.object({ query: z.string() @@ -43097,11 +44615,14 @@ export const put_streams_name_request = z.object({ rules: z.array(z.string()) })).and(z.object({ stream: z.object({ - name: z.optional(z.unknown()) - }).and(z.record(z.string(), z.unknown()).and(z.object({ - description: z.string(), - name: z.string() - })).and(z.object({ + ingest: z.optional(z.object({ + processing: z.object({ + updated_at: z.optional(z.unknown()) + }) + })), + name: z.optional(z.unknown()), + updated_at: z.optional(z.unknown()) + }).and(z.object({ ingest: z.object({ failure_store: z.union([ z.object({ @@ -43114,7 +44635,9 @@ export const put_streams_name_request = z.object({ z.object({ lifecycle: z.object({ enabled: z.object({ - data_retention: z.optional(z.string().min(1)) + data_retention: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })) }) }) }), @@ -43128,12 +44651,16 @@ export const put_streams_name_request = z.object({ lifecycle: z.union([ z.object({ dsl: z.object({ - data_retention: z.optional(z.string().min(1)) + data_retention: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })) }) }), z.object({ ilm: z.object({ - policy: z.string().min(1) + policy: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) }) }), z.object({ @@ -43144,13 +44671,27 @@ export const put_streams_name_request = z.object({ steps: z.array(z.union([z.union([ z.object({ action: z.enum(['grok']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to parse with grok patterns' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), pattern_definitions: z.optional(z.record(z.string(), z.string())), - patterns: z.array(z.string().min(1)).min(1), + patterns: z.array(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })).min(1).register(z.globalRegistry, { + description: 'Grok patterns applied in order to extract fields' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -43169,7 +44710,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -43216,44 +44759,90 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Grok processor - Extract fields from text using grok patterns' }), z.object({ action: z.enum(['dissect']), - append_separator: z.optional(z.string().min(1)), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - pattern: z.string().min(1), + append_separator: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Separator inserted when target fields are concatenated' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to parse with dissect pattern' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), + pattern: z.string().min(1).register(z.globalRegistry, { + description: 'Dissect pattern describing field boundaries' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -43272,7 +44861,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -43319,46 +44910,98 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Dissect processor - Extract fields from text using a lightweight, delimiter-based parser' }), z.object({ action: z.enum(['date']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - formats: z.array(z.string().min(1)), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - locale: z.optional(z.string().min(1)), - output_format: z.optional(z.string().min(1)), - timezone: z.optional(z.string().min(1)), - to: z.optional(z.string().min(1)), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + formats: z.array(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })).register(z.globalRegistry, { + description: 'Accepted input date formats, tried in order' + }), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field containing the date/time text' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + locale: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional locale for date parsing' + })), + output_format: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional output format for storing the parsed date as text' + })), + timezone: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional timezone for date parsing' + })), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Target field for the parsed date (defaults to source)' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -43377,7 +45020,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -43424,40 +45069,78 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Date processor - Parse dates from strings using one or more expected formats' }), z.object({ action: z.enum(['drop_document']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -43476,7 +45159,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -43523,44 +45208,90 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Base processor options plus conditional execution' }), z.object({ action: z.enum(['rename']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - override: z.optional(z.boolean()), - to: z.string().min(1), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Existing source field to rename or move' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip when source field is missing' + })), + override: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Allow overwriting the target field if it already exists' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'New field name or destination path' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -43579,7 +45310,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -43626,44 +45359,90 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Rename processor - Change a field name and optionally its location' }), z.object({ action: z.enum(['set']), - copy_from: z.optional(z.string().min(1)), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - override: z.optional(z.boolean()), - to: z.string().min(1), - value: z.optional(z.unknown()), + copy_from: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Copy value from another field instead of providing a literal' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + override: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Allow overwriting an existing target field' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'Target field to set or create' + }), + value: z.optional(z.unknown().register(z.globalRegistry, { + description: 'Literal value to assign to the target field' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -43682,7 +45461,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -43729,43 +45510,87 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Set processor - Assign a literal or copied value to a field (mutually exclusive inputs)' }), z.object({ action: z.enum(['append']), - allow_duplicates: z.optional(z.boolean()), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - to: z.string().min(1), - value: z.array(z.unknown()).min(1), + allow_duplicates: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, do not deduplicate appended values' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'Array field to append values to' + }), + value: z.array(z.unknown()).min(1).register(z.globalRegistry, { + description: 'Values to append (must be literal, no templates)' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -43784,7 +45609,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -43831,49 +45658,101 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Append processor - Append one or more values to an existing or new array field' }), z.object({ action: z.enum(['remove_by_prefix']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()) + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Field to remove along with all its nested fields' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })) + }).register(z.globalRegistry, { + description: 'Remove by prefix processor - Remove a field and all nested fields matching the prefix' }), z.object({ action: z.enum(['remove']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Field to remove from the document' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -43892,7 +45771,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -43939,45 +45820,89 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Remove processor - Delete one or more fields from the document' }), z.object({ action: z.enum(['replace']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), ignore_missing: z.optional(z.boolean()), - pattern: z.string().min(1), + pattern: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string or string with whitespace.' + }), replacement: z.string(), - to: z.optional(z.string().min(1)), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -43996,7 +45921,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -44043,50 +45970,96 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Base processor options plus conditional execution' }), z.object({ action: z.enum(['convert']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - to: z.optional(z.string().min(1)), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to convert to a different data type' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Target field for the converted value (defaults to source)' + })), type: z.enum([ 'integer', 'long', 'double', 'boolean', 'string' - ]), + ]).register(z.globalRegistry, { + description: 'Target data type: integer, long, double, boolean, or string' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -44105,7 +46078,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -44152,41 +46127,83 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Convert processor - Change the data type of a field value (integer, long, double, boolean, or string)' }), z.object({ - action: z.enum(['manual_ingest_pipeline']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - on_failure: z.optional(z.array(z.record(z.string(), z.unknown()))), + action: z.enum(['manual_ingest_pipeline']).register(z.globalRegistry, { + description: 'Manual ingest pipeline - executes raw Elasticsearch ingest processors' + }), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + on_failure: z.optional(z.array(z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Fallback processors to run when a processor fails' + })), processors: z.array(z.object({ append: z.unknown(), attachment: z.unknown(), @@ -44233,8 +46250,12 @@ export const put_streams_name_request = z.object({ uri_parts: z.unknown(), urldecode: z.unknown(), user_agent: z.unknown() + })).register(z.globalRegistry, { + description: 'List of raw Elasticsearch ingest processors to run' + }), + tag: z.optional(z.string().register(z.globalRegistry, { + description: 'Optional ingest processor tag for Elasticsearch' })), - tag: z.optional(z.string()), where: z.optional(z.union([ z.union([ z.object({ @@ -44253,7 +46274,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -44300,34 +46323,66 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Manual ingest pipeline wrapper around native Elasticsearch processors' }) ]), z.object({ customIdentifier: z.optional(z.string()), @@ -44349,7 +46404,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -44396,37 +46453,68 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]), z.object({ steps: z.array(z.unknown()) })) - })])) + })])), + updated_at: z.iso.datetime() }), settings: z.object({ 'index.number_of_replicas': z.optional(z.object({ @@ -44442,9 +46530,7 @@ export const put_streams_name_request = z.object({ ]) })) }) - }) - })).and(z.object({ - ingest: z.object({ + }).and(z.object({ classic: z.object({ field_overrides: z.optional(z.record(z.string(), z.record(z.string(), z.union([ z.union([ @@ -44465,7 +46551,9 @@ export const put_streams_name_request = z.object({ z.unknown() ])).and(z.union([ z.object({ - format: z.optional(z.string().min(1)), + format: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })), type: z.enum([ 'keyword', 'match_only_text', @@ -44473,7 +46561,8 @@ export const put_streams_name_request = z.object({ 'double', 'date', 'boolean', - 'ip' + 'ip', + 'geo_point' ]) }), z.object({ @@ -44481,20 +46570,31 @@ export const put_streams_name_request = z.object({ }) ])))) }) - }) - }))) + })) + })) })).and(z.record(z.string(), z.unknown())).and(z.object({ stream: z.object({ - name: z.optional(z.unknown()) + ingest: z.optional(z.object({ + processing: z.object({ + updated_at: z.optional(z.unknown()) + }) + })), + name: z.optional(z.unknown()), + updated_at: z.optional(z.unknown()) }).and(z.object({ description: z.string(), - name: z.string() + name: z.string(), + updated_at: z.iso.datetime() })) })).and(z.object({ dashboards: z.array(z.string()), queries: z.array(z.object({ - id: z.string().min(1), - title: z.string().min(1) + id: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }), + title: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) }).and(z.object({ feature: z.optional(z.object({ filter: z.union([ @@ -44515,7 +46615,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -44562,35 +46664,67 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]), - name: z.string().min(1) + name: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) })), kql: z.object({ query: z.string() @@ -44600,7 +46734,13 @@ export const put_streams_name_request = z.object({ rules: z.array(z.string()) })).and(z.object({ stream: z.object({ - name: z.optional(z.unknown()) + ingest: z.optional(z.object({ + processing: z.object({ + updated_at: z.optional(z.unknown()) + }) + })), + name: z.optional(z.unknown()), + updated_at: z.optional(z.unknown()) }).and(z.object({ ingest: z.object({ failure_store: z.union([ @@ -44614,7 +46754,9 @@ export const put_streams_name_request = z.object({ z.object({ lifecycle: z.object({ enabled: z.object({ - data_retention: z.optional(z.string().min(1)) + data_retention: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })) }) }) }), @@ -44628,12 +46770,16 @@ export const put_streams_name_request = z.object({ lifecycle: z.union([ z.object({ dsl: z.object({ - data_retention: z.optional(z.string().min(1)) + data_retention: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })) }) }), z.object({ ilm: z.object({ - policy: z.string().min(1) + policy: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) }) }), z.object({ @@ -44644,13 +46790,27 @@ export const put_streams_name_request = z.object({ steps: z.array(z.union([z.union([ z.object({ action: z.enum(['grok']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to parse with grok patterns' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), pattern_definitions: z.optional(z.record(z.string(), z.string())), - patterns: z.array(z.string().min(1)).min(1), + patterns: z.array(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })).min(1).register(z.globalRegistry, { + description: 'Grok patterns applied in order to extract fields' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -44669,7 +46829,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -44716,44 +46878,90 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Grok processor - Extract fields from text using grok patterns' }), z.object({ action: z.enum(['dissect']), - append_separator: z.optional(z.string().min(1)), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - pattern: z.string().min(1), + append_separator: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Separator inserted when target fields are concatenated' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to parse with dissect pattern' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), + pattern: z.string().min(1).register(z.globalRegistry, { + description: 'Dissect pattern describing field boundaries' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -44772,7 +46980,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -44819,46 +47029,98 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Dissect processor - Extract fields from text using a lightweight, delimiter-based parser' }), z.object({ action: z.enum(['date']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - formats: z.array(z.string().min(1)), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - locale: z.optional(z.string().min(1)), - output_format: z.optional(z.string().min(1)), - timezone: z.optional(z.string().min(1)), - to: z.optional(z.string().min(1)), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + formats: z.array(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })).register(z.globalRegistry, { + description: 'Accepted input date formats, tried in order' + }), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field containing the date/time text' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + locale: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional locale for date parsing' + })), + output_format: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional output format for storing the parsed date as text' + })), + timezone: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional timezone for date parsing' + })), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Target field for the parsed date (defaults to source)' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -44877,7 +47139,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -44924,40 +47188,78 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Date processor - Parse dates from strings using one or more expected formats' }), z.object({ action: z.enum(['drop_document']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -44976,7 +47278,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -45023,44 +47327,90 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Base processor options plus conditional execution' }), z.object({ action: z.enum(['rename']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - override: z.optional(z.boolean()), - to: z.string().min(1), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Existing source field to rename or move' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip when source field is missing' + })), + override: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Allow overwriting the target field if it already exists' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'New field name or destination path' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -45079,7 +47429,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -45126,44 +47478,90 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Rename processor - Change a field name and optionally its location' }), z.object({ action: z.enum(['set']), - copy_from: z.optional(z.string().min(1)), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - override: z.optional(z.boolean()), - to: z.string().min(1), - value: z.optional(z.unknown()), + copy_from: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Copy value from another field instead of providing a literal' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + override: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Allow overwriting an existing target field' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'Target field to set or create' + }), + value: z.optional(z.unknown().register(z.globalRegistry, { + description: 'Literal value to assign to the target field' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -45182,7 +47580,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -45229,43 +47629,87 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Set processor - Assign a literal or copied value to a field (mutually exclusive inputs)' }), z.object({ action: z.enum(['append']), - allow_duplicates: z.optional(z.boolean()), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - to: z.string().min(1), - value: z.array(z.unknown()).min(1), + allow_duplicates: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, do not deduplicate appended values' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'Array field to append values to' + }), + value: z.array(z.unknown()).min(1).register(z.globalRegistry, { + description: 'Values to append (must be literal, no templates)' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -45284,7 +47728,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -45331,49 +47777,101 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Append processor - Append one or more values to an existing or new array field' }), z.object({ action: z.enum(['remove_by_prefix']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()) + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Field to remove along with all its nested fields' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })) + }).register(z.globalRegistry, { + description: 'Remove by prefix processor - Remove a field and all nested fields matching the prefix' }), z.object({ action: z.enum(['remove']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Field to remove from the document' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -45392,7 +47890,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -45439,45 +47939,89 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Remove processor - Delete one or more fields from the document' }), z.object({ action: z.enum(['replace']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), ignore_missing: z.optional(z.boolean()), - pattern: z.string().min(1), + pattern: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string or string with whitespace.' + }), replacement: z.string(), - to: z.optional(z.string().min(1)), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -45496,7 +48040,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -45543,50 +48089,96 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Base processor options plus conditional execution' }), z.object({ action: z.enum(['convert']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - to: z.optional(z.string().min(1)), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to convert to a different data type' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Target field for the converted value (defaults to source)' + })), type: z.enum([ 'integer', 'long', 'double', 'boolean', 'string' - ]), + ]).register(z.globalRegistry, { + description: 'Target data type: integer, long, double, boolean, or string' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -45605,7 +48197,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -45652,41 +48246,83 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Convert processor - Change the data type of a field value (integer, long, double, boolean, or string)' }), z.object({ - action: z.enum(['manual_ingest_pipeline']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - on_failure: z.optional(z.array(z.record(z.string(), z.unknown()))), + action: z.enum(['manual_ingest_pipeline']).register(z.globalRegistry, { + description: 'Manual ingest pipeline - executes raw Elasticsearch ingest processors' + }), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + on_failure: z.optional(z.array(z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Fallback processors to run when a processor fails' + })), processors: z.array(z.object({ append: z.unknown(), attachment: z.unknown(), @@ -45733,8 +48369,12 @@ export const put_streams_name_request = z.object({ uri_parts: z.unknown(), urldecode: z.unknown(), user_agent: z.unknown() + })).register(z.globalRegistry, { + description: 'List of raw Elasticsearch ingest processors to run' + }), + tag: z.optional(z.string().register(z.globalRegistry, { + description: 'Optional ingest processor tag for Elasticsearch' })), - tag: z.optional(z.string()), where: z.optional(z.union([ z.union([ z.object({ @@ -45753,7 +48393,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -45800,34 +48442,66 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Manual ingest pipeline wrapper around native Elasticsearch processors' }) ]), z.object({ customIdentifier: z.optional(z.string()), @@ -45849,7 +48523,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -45896,37 +48572,68 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]), z.object({ steps: z.array(z.unknown()) })) - })])) + })])), + updated_at: z.iso.datetime() }), settings: z.object({ 'index.number_of_replicas': z.optional(z.object({ @@ -45948,16 +48655,27 @@ export const put_streams_name_request = z.object({ ]), z.record(z.string(), z.unknown()).and(z.object({ stream: z.object({ - name: z.optional(z.unknown()) + ingest: z.optional(z.object({ + processing: z.object({ + updated_at: z.optional(z.unknown()) + }) + })), + name: z.optional(z.unknown()), + updated_at: z.optional(z.unknown()) }).and(z.object({ description: z.string(), - name: z.string() + name: z.string(), + updated_at: z.iso.datetime() })) })).and(z.object({ dashboards: z.array(z.string()), queries: z.array(z.object({ - id: z.string().min(1), - title: z.string().min(1) + id: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }), + title: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) }).and(z.object({ feature: z.optional(z.object({ filter: z.union([ @@ -45978,7 +48696,9 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -46025,35 +48745,67 @@ export const put_streams_name_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]), - name: z.string().min(1) + name: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) })), kql: z.object({ query: z.string() @@ -46063,7 +48815,13 @@ export const put_streams_name_request = z.object({ rules: z.array(z.string()) })).and(z.object({ stream: z.object({ - name: z.optional(z.unknown()) + ingest: z.optional(z.object({ + processing: z.object({ + updated_at: z.optional(z.unknown()) + }) + })), + name: z.optional(z.unknown()), + updated_at: z.optional(z.unknown()) }).and(z.object({ group: z.object({ members: z.array(z.string()), @@ -46108,7 +48866,9 @@ export const post_streams_name_fork_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -46155,32 +48915,62 @@ export const post_streams_name_fork_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.record(z.string(), z.never()) + never: z.record(z.string(), z.never()).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.record(z.string(), z.never()) + always: z.record(z.string(), z.never()).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]) })), @@ -46253,7 +49043,9 @@ export const put_streams_name_ingest_request = z.object({ z.object({ lifecycle: z.object({ enabled: z.object({ - data_retention: z.optional(z.string().min(1)) + data_retention: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })) }) }) }), @@ -46267,12 +49059,16 @@ export const put_streams_name_ingest_request = z.object({ lifecycle: z.union([ z.object({ dsl: z.object({ - data_retention: z.optional(z.string().min(1)) + data_retention: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })) }) }), z.object({ ilm: z.object({ - policy: z.string().min(1) + policy: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) }) }), z.object({ @@ -46283,13 +49079,27 @@ export const put_streams_name_ingest_request = z.object({ steps: z.array(z.union([z.union([ z.object({ action: z.enum(['grok']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to parse with grok patterns' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), pattern_definitions: z.optional(z.record(z.string(), z.string())), - patterns: z.array(z.string().min(1)).min(1), + patterns: z.array(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })).min(1).register(z.globalRegistry, { + description: 'Grok patterns applied in order to extract fields' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -46308,7 +49118,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -46355,44 +49167,90 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Grok processor - Extract fields from text using grok patterns' }), z.object({ action: z.enum(['dissect']), - append_separator: z.optional(z.string().min(1)), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - pattern: z.string().min(1), + append_separator: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Separator inserted when target fields are concatenated' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to parse with dissect pattern' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), + pattern: z.string().min(1).register(z.globalRegistry, { + description: 'Dissect pattern describing field boundaries' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -46411,7 +49269,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -46458,46 +49318,98 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Dissect processor - Extract fields from text using a lightweight, delimiter-based parser' }), z.object({ action: z.enum(['date']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - formats: z.array(z.string().min(1)), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - locale: z.optional(z.string().min(1)), - output_format: z.optional(z.string().min(1)), - timezone: z.optional(z.string().min(1)), - to: z.optional(z.string().min(1)), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + formats: z.array(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })).register(z.globalRegistry, { + description: 'Accepted input date formats, tried in order' + }), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field containing the date/time text' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + locale: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional locale for date parsing' + })), + output_format: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional output format for storing the parsed date as text' + })), + timezone: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional timezone for date parsing' + })), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Target field for the parsed date (defaults to source)' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -46516,7 +49428,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -46563,40 +49477,78 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Date processor - Parse dates from strings using one or more expected formats' }), z.object({ action: z.enum(['drop_document']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -46615,7 +49567,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -46662,44 +49616,90 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Base processor options plus conditional execution' }), z.object({ action: z.enum(['rename']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - override: z.optional(z.boolean()), - to: z.string().min(1), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Existing source field to rename or move' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip when source field is missing' + })), + override: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Allow overwriting the target field if it already exists' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'New field name or destination path' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -46718,7 +49718,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -46765,44 +49767,90 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Rename processor - Change a field name and optionally its location' }), z.object({ action: z.enum(['set']), - copy_from: z.optional(z.string().min(1)), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - override: z.optional(z.boolean()), - to: z.string().min(1), - value: z.optional(z.unknown()), + copy_from: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Copy value from another field instead of providing a literal' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + override: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Allow overwriting an existing target field' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'Target field to set or create' + }), + value: z.optional(z.unknown().register(z.globalRegistry, { + description: 'Literal value to assign to the target field' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -46821,7 +49869,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -46868,43 +49918,87 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Set processor - Assign a literal or copied value to a field (mutually exclusive inputs)' }), z.object({ action: z.enum(['append']), - allow_duplicates: z.optional(z.boolean()), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - to: z.string().min(1), - value: z.array(z.unknown()).min(1), + allow_duplicates: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, do not deduplicate appended values' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'Array field to append values to' + }), + value: z.array(z.unknown()).min(1).register(z.globalRegistry, { + description: 'Values to append (must be literal, no templates)' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -46923,7 +50017,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -46970,49 +50066,101 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Append processor - Append one or more values to an existing or new array field' }), z.object({ action: z.enum(['remove_by_prefix']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()) + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Field to remove along with all its nested fields' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })) + }).register(z.globalRegistry, { + description: 'Remove by prefix processor - Remove a field and all nested fields matching the prefix' }), z.object({ action: z.enum(['remove']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Field to remove from the document' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -47031,7 +50179,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -47078,45 +50228,89 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Remove processor - Delete one or more fields from the document' }), z.object({ action: z.enum(['replace']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), ignore_missing: z.optional(z.boolean()), - pattern: z.string().min(1), + pattern: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string or string with whitespace.' + }), replacement: z.string(), - to: z.optional(z.string().min(1)), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -47135,7 +50329,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -47182,50 +50378,96 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Base processor options plus conditional execution' }), z.object({ action: z.enum(['convert']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - to: z.optional(z.string().min(1)), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to convert to a different data type' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Target field for the converted value (defaults to source)' + })), type: z.enum([ 'integer', 'long', 'double', 'boolean', 'string' - ]), + ]).register(z.globalRegistry, { + description: 'Target data type: integer, long, double, boolean, or string' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -47244,7 +50486,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -47291,41 +50535,83 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Convert processor - Change the data type of a field value (integer, long, double, boolean, or string)' }), z.object({ - action: z.enum(['manual_ingest_pipeline']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - on_failure: z.optional(z.array(z.record(z.string(), z.unknown()))), + action: z.enum(['manual_ingest_pipeline']).register(z.globalRegistry, { + description: 'Manual ingest pipeline - executes raw Elasticsearch ingest processors' + }), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + on_failure: z.optional(z.array(z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Fallback processors to run when a processor fails' + })), processors: z.array(z.object({ append: z.unknown(), attachment: z.unknown(), @@ -47372,8 +50658,12 @@ export const put_streams_name_ingest_request = z.object({ uri_parts: z.unknown(), urldecode: z.unknown(), user_agent: z.unknown() + })).register(z.globalRegistry, { + description: 'List of raw Elasticsearch ingest processors to run' + }), + tag: z.optional(z.string().register(z.globalRegistry, { + description: 'Optional ingest processor tag for Elasticsearch' })), - tag: z.optional(z.string()), where: z.optional(z.union([ z.union([ z.object({ @@ -47392,7 +50682,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -47439,34 +50731,66 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Manual ingest pipeline wrapper around native Elasticsearch processors' }) ]), z.object({ customIdentifier: z.optional(z.string()), @@ -47488,7 +50812,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -47535,37 +50861,68 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]), z.object({ steps: z.array(z.unknown()) })) - })])) + })])), + updated_at: z.optional(z.unknown()) }), settings: z.object({ 'index.number_of_replicas': z.optional(z.object({ @@ -47602,7 +50959,9 @@ export const put_streams_name_ingest_request = z.object({ z.unknown() ])).and(z.union([ z.object({ - format: z.optional(z.string().min(1)), + format: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })), type: z.enum([ 'keyword', 'match_only_text', @@ -47610,7 +50969,8 @@ export const put_streams_name_ingest_request = z.object({ 'double', 'date', 'boolean', - 'ip' + 'ip', + 'geo_point' ]) }), z.object({ @@ -47618,7 +50978,9 @@ export const put_streams_name_ingest_request = z.object({ }) ]))), routing: z.array(z.object({ - destination: z.string().min(1), + destination: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }), status: z.optional(z.enum(['enabled', 'disabled'])), where: z.union([ z.union([ @@ -47638,7 +51000,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -47685,32 +51049,62 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]) })) @@ -47728,7 +51122,9 @@ export const put_streams_name_ingest_request = z.object({ z.object({ lifecycle: z.object({ enabled: z.object({ - data_retention: z.optional(z.string().min(1)) + data_retention: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })) }) }) }), @@ -47742,12 +51138,16 @@ export const put_streams_name_ingest_request = z.object({ lifecycle: z.union([ z.object({ dsl: z.object({ - data_retention: z.optional(z.string().min(1)) + data_retention: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })) }) }), z.object({ ilm: z.object({ - policy: z.string().min(1) + policy: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) }) }), z.object({ @@ -47758,13 +51158,27 @@ export const put_streams_name_ingest_request = z.object({ steps: z.array(z.union([z.union([ z.object({ action: z.enum(['grok']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to parse with grok patterns' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), pattern_definitions: z.optional(z.record(z.string(), z.string())), - patterns: z.array(z.string().min(1)).min(1), + patterns: z.array(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })).min(1).register(z.globalRegistry, { + description: 'Grok patterns applied in order to extract fields' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -47783,7 +51197,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -47830,44 +51246,90 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Grok processor - Extract fields from text using grok patterns' }), z.object({ action: z.enum(['dissect']), - append_separator: z.optional(z.string().min(1)), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - pattern: z.string().min(1), + append_separator: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Separator inserted when target fields are concatenated' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to parse with dissect pattern' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), + pattern: z.string().min(1).register(z.globalRegistry, { + description: 'Dissect pattern describing field boundaries' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -47886,7 +51348,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -47933,46 +51397,98 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Dissect processor - Extract fields from text using a lightweight, delimiter-based parser' }), z.object({ action: z.enum(['date']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - formats: z.array(z.string().min(1)), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - locale: z.optional(z.string().min(1)), - output_format: z.optional(z.string().min(1)), - timezone: z.optional(z.string().min(1)), - to: z.optional(z.string().min(1)), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + formats: z.array(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })).register(z.globalRegistry, { + description: 'Accepted input date formats, tried in order' + }), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field containing the date/time text' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + locale: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional locale for date parsing' + })), + output_format: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional output format for storing the parsed date as text' + })), + timezone: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Optional timezone for date parsing' + })), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Target field for the parsed date (defaults to source)' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -47991,7 +51507,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -48038,40 +51556,78 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Date processor - Parse dates from strings using one or more expected formats' }), z.object({ action: z.enum(['drop_document']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -48090,7 +51646,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -48137,44 +51695,90 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Base processor options plus conditional execution' }), z.object({ action: z.enum(['rename']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - override: z.optional(z.boolean()), - to: z.string().min(1), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Existing source field to rename or move' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip when source field is missing' + })), + override: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Allow overwriting the target field if it already exists' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'New field name or destination path' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -48193,7 +51797,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -48240,44 +51846,90 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Rename processor - Change a field name and optionally its location' }), z.object({ action: z.enum(['set']), - copy_from: z.optional(z.string().min(1)), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - override: z.optional(z.boolean()), - to: z.string().min(1), - value: z.optional(z.unknown()), + copy_from: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Copy value from another field instead of providing a literal' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + override: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Allow overwriting an existing target field' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'Target field to set or create' + }), + value: z.optional(z.unknown().register(z.globalRegistry, { + description: 'Literal value to assign to the target field' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -48296,7 +51948,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -48343,43 +51997,87 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Set processor - Assign a literal or copied value to a field (mutually exclusive inputs)' }), z.object({ action: z.enum(['append']), - allow_duplicates: z.optional(z.boolean()), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - to: z.string().min(1), - value: z.array(z.unknown()).min(1), + allow_duplicates: z.optional(z.boolean().register(z.globalRegistry, { + description: 'If true, do not deduplicate appended values' + })), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + to: z.string().min(1).register(z.globalRegistry, { + description: 'Array field to append values to' + }), + value: z.array(z.unknown()).min(1).register(z.globalRegistry, { + description: 'Values to append (must be literal, no templates)' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -48398,7 +52096,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -48445,49 +52145,101 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Append processor - Append one or more values to an existing or new array field' }), z.object({ action: z.enum(['remove_by_prefix']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()) + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Field to remove along with all its nested fields' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })) + }).register(z.globalRegistry, { + description: 'Remove by prefix processor - Remove a field and all nested fields matching the prefix' }), z.object({ action: z.enum(['remove']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Field to remove from the document' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -48506,7 +52258,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -48553,45 +52307,89 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Remove processor - Delete one or more fields from the document' }), z.object({ action: z.enum(['replace']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), ignore_missing: z.optional(z.boolean()), - pattern: z.string().min(1), + pattern: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string or string with whitespace.' + }), replacement: z.string(), - to: z.optional(z.string().min(1)), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })), where: z.optional(z.union([ z.union([ z.object({ @@ -48610,7 +52408,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -48657,50 +52457,96 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Base processor options plus conditional execution' }), z.object({ action: z.enum(['convert']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - from: z.string().min(1), - ignore_failure: z.optional(z.boolean()), - ignore_missing: z.optional(z.boolean()), - to: z.optional(z.string().min(1)), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + from: z.string().min(1).register(z.globalRegistry, { + description: 'Source field to convert to a different data type' + }), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + ignore_missing: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Skip processing when source field is missing' + })), + to: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Target field for the converted value (defaults to source)' + })), type: z.enum([ 'integer', 'long', 'double', 'boolean', 'string' - ]), + ]).register(z.globalRegistry, { + description: 'Target data type: integer, long, double, boolean, or string' + }), where: z.optional(z.union([ z.union([ z.object({ @@ -48719,7 +52565,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -48766,41 +52614,83 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Convert processor - Change the data type of a field value (integer, long, double, boolean, or string)' }), z.object({ - action: z.enum(['manual_ingest_pipeline']), - customIdentifier: z.optional(z.string().min(1)), - description: z.optional(z.string()), - ignore_failure: z.optional(z.boolean()), - on_failure: z.optional(z.array(z.record(z.string(), z.unknown()))), + action: z.enum(['manual_ingest_pipeline']).register(z.globalRegistry, { + description: 'Manual ingest pipeline - executes raw Elasticsearch ingest processors' + }), + customIdentifier: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'Custom identifier to correlate this processor across outputs' + })), + description: z.optional(z.string().register(z.globalRegistry, { + description: 'Human-readable notes about this processor step' + })), + ignore_failure: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Continue pipeline execution if this processor fails' + })), + on_failure: z.optional(z.array(z.record(z.string(), z.unknown())).register(z.globalRegistry, { + description: 'Fallback processors to run when a processor fails' + })), processors: z.array(z.object({ append: z.unknown(), attachment: z.unknown(), @@ -48847,8 +52737,12 @@ export const put_streams_name_ingest_request = z.object({ uri_parts: z.unknown(), urldecode: z.unknown(), user_agent: z.unknown() + })).register(z.globalRegistry, { + description: 'List of raw Elasticsearch ingest processors to run' + }), + tag: z.optional(z.string().register(z.globalRegistry, { + description: 'Optional ingest processor tag for Elasticsearch' })), - tag: z.optional(z.string()), where: z.optional(z.union([ z.union([ z.object({ @@ -48867,7 +52761,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -48914,34 +52810,66 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ])) + }).register(z.globalRegistry, { + description: 'Manual ingest pipeline wrapper around native Elasticsearch processors' }) ]), z.object({ customIdentifier: z.optional(z.string()), @@ -48963,7 +52891,9 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -49010,37 +52940,68 @@ export const put_streams_name_ingest_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]), z.object({ steps: z.array(z.unknown()) })) - })])) + })])), + updated_at: z.optional(z.unknown()) }), settings: z.object({ 'index.number_of_replicas': z.optional(z.object({ @@ -49077,7 +53038,9 @@ export const put_streams_name_ingest_request = z.object({ z.unknown() ])).and(z.union([ z.object({ - format: z.optional(z.string().min(1)), + format: z.optional(z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + })), type: z.enum([ 'keyword', 'match_only_text', @@ -49085,7 +53048,8 @@ export const put_streams_name_ingest_request = z.object({ 'double', 'date', 'boolean', - 'ip' + 'ip', + 'geo_point' ]) }), z.object({ @@ -49174,8 +53138,12 @@ export const post_streams_name_queries_bulk_request = z.object({ body: z.optional(z.object({ operations: z.array(z.union([z.object({ index: z.object({ - id: z.string().min(1), - title: z.string().min(1) + id: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }), + title: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) }).and(z.object({ feature: z.optional(z.object({ filter: z.union([ @@ -49196,7 +53164,9 @@ export const post_streams_name_queries_bulk_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -49243,35 +53213,67 @@ export const post_streams_name_queries_bulk_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]), - name: z.string().min(1) + name: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) })), kql: z.object({ query: z.string() @@ -49334,7 +53336,9 @@ export const put_streams_name_queries_queryid_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -49381,41 +53385,75 @@ export const put_streams_name_queries_queryid_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.record(z.string(), z.never()) + never: z.record(z.string(), z.never()).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.record(z.string(), z.never()) + always: z.record(z.string(), z.never()).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]), - name: z.string().min(1) + name: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) })), kql: z.object({ query: z.string() }), severity_score: z.optional(z.number()), - title: z.string().min(1) + title: z.string().min(1).register(z.globalRegistry, { + description: 'A non-empty string.' + }) })), path: z.object({ name: z.string(), @@ -49470,7 +53508,9 @@ export const post_streams_name_significant_events_generate_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -49517,32 +53557,62 @@ export const post_streams_name_significant_events_generate_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.object({}) + never: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.object({}) + always: z.object({}).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]) })).and(z.object({ @@ -49587,7 +53657,9 @@ export const post_streams_name_significant_events_preview_request = z.object({ z.number(), z.boolean() ])), - field: z.string().min(1), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to filter on.' + }), gt: z.optional(z.union([ z.string(), z.number(), @@ -49634,32 +53706,62 @@ export const post_streams_name_significant_events_preview_request = z.object({ z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'Range comparison values.' })), startsWith: z.optional(z.union([ z.string(), z.number(), z.boolean() ])) + }).register(z.globalRegistry, { + description: 'A condition that compares a field to a value or range using an operator as the key.' }), z.object({ - exists: z.optional(z.boolean()), - field: z.string().min(1) + exists: z.optional(z.boolean().register(z.globalRegistry, { + description: 'Indicates whether the field exists or not.' + })), + field: z.string().min(1).register(z.globalRegistry, { + description: 'The document field to check.' + }) + }).register(z.globalRegistry, { + description: 'A condition that checks for the existence or non-existence of a field.' }) ]), z.object({ - and: z.array(z.unknown()) + and: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. All sub-conditions must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical AND that groups multiple conditions.' }), z.object({ - or: z.array(z.unknown()) + or: z.array(z.unknown()).register(z.globalRegistry, { + description: 'An array of conditions. At least one sub-condition must be true for this condition to be true.' + }) + }).register(z.globalRegistry, { + description: 'A logical OR that groups multiple conditions.' }), z.object({ - not: z.unknown() + not: z.unknown().register(z.globalRegistry, { + description: 'A condition that negates another condition.' + }) + }).register(z.globalRegistry, { + description: 'A logical NOT that negates a condition.' }), z.object({ - never: z.record(z.string(), z.never()) + never: z.record(z.string(), z.never()).register(z.globalRegistry, { + description: 'An empty object. This condition never matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to false.' }), z.object({ - always: z.record(z.string(), z.never()) + always: z.record(z.string(), z.never()).register(z.globalRegistry, { + description: 'An empty object. This condition always matches.' + }) + }).register(z.globalRegistry, { + description: 'A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.' }) ]), name: z.string() diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/index.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/index.ts index 476d7f7d6289e..2c4d4ba748848 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/kibana/index.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/index.ts @@ -18,5 +18,19 @@ export function getKibanaConnectors(): InternalConnectorContract[] { // eslint-disable-next-line @typescript-eslint/no-var-requires } = require('./generated'); - return GENERATED_KIBANA_CONNECTORS; + const { + KIBANA_OVERRIDES, + // eslint-disable-next-line @typescript-eslint/no-var-requires + } = require('./overrides'); + + const mergedConnectors: InternalConnectorContract[] = []; + for (const connector of GENERATED_KIBANA_CONNECTORS) { + if (KIBANA_OVERRIDES[connector.type]) { + mergedConnectors.push(KIBANA_OVERRIDES[connector.type]); + } else { + mergedConnectors.push(connector); + } + } + + return mergedConnectors; } diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/overrides/index.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/overrides/index.ts new file mode 100644 index 0000000000000..f7b7fb501951f --- /dev/null +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/overrides/index.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { SET_ALERTS_STATUS_CONTRACT } from './kibana.set_alerts_status'; +import type { InternalConnectorContract } from '../../../types/latest'; + +export const KIBANA_OVERRIDES: Record = { + 'kibana.SetAlertsStatus': SET_ALERTS_STATUS_CONTRACT, +}; diff --git a/src/platform/packages/shared/kbn-workflows/spec/kibana/overrides/kibana.set_alerts_status.ts b/src/platform/packages/shared/kbn-workflows/spec/kibana/overrides/kibana.set_alerts_status.ts new file mode 100644 index 0000000000000..d694ce05a620a --- /dev/null +++ b/src/platform/packages/shared/kbn-workflows/spec/kibana/overrides/kibana.set_alerts_status.ts @@ -0,0 +1,47 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +/* + * OVERRIDE FILE + * + * Source: /oas_docs/output/kibana.yaml, operations: SetAlertsStatus + */ + +// import all needed request and response schemas generated from the OpenAPI spec +import type { InternalConnectorContract } from '../../../types/latest'; + +import { insertFetcherToSchemaRecursively } from '../../lib/insert_fetcher_to_schema'; +import { + set_alerts_status_request, + set_alerts_status_response, +} from '../generated/schemas/kibana_openapi_zod.gen'; + +// export contract +export const SET_ALERTS_STATUS_CONTRACT: InternalConnectorContract = { + type: 'kibana.SetAlertsStatus', + summary: `Set a detection alert status`, + description: `**Spaces method and path for this operation:** + +
post /s/{space_id}/api/detection_engine/signals/status
+ +Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information. + +Set the status of one or more detection alerts.`, + methods: ['POST'], + patterns: ['/api/detection_engine/signals/status'], + documentation: 'https://www.elastic.co/docs/api/doc/kibana/operation/operation-setalertsstatus', + parameterTypes: { + headerParams: [], + pathParams: [], + urlParams: [], + bodyParams: ['reason', 'signal_ids', 'status', 'conflicts', 'query'], + }, + paramsSchema: insertFetcherToSchemaRecursively(set_alerts_status_request.shape.body), + outputSchema: set_alerts_status_response, +}; diff --git a/src/platform/packages/shared/kbn-workflows/spec/lib/generate_yaml_schema_from_connectors.kibana.test.ts b/src/platform/packages/shared/kbn-workflows/spec/lib/generate_yaml_schema_from_connectors.kibana.test.ts index a88e02fd9c834..984c8a0eed19e 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/lib/generate_yaml_schema_from_connectors.kibana.test.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/lib/generate_yaml_schema_from_connectors.kibana.test.ts @@ -25,7 +25,7 @@ describe('generateYamlSchemaFromConnectors / kibana connectors', () => { }); KIBANA_SAMPLE_STEPS.forEach((step) => { - it(`${step.type}`, async () => { + it(`${step.type} (${step.name})`, async () => { const result = workflowSchema.safeParse({ name: 'test-workflow', enabled: true, @@ -34,6 +34,7 @@ describe('generateYamlSchemaFromConnectors / kibana connectors', () => { }); expect(result.error).toBeUndefined(); expect(result.success).toBe(true); + expect((result.data as any).steps[0]).toEqual(step); }); }); }); diff --git a/src/platform/packages/shared/kbn-workflows/spec/lib/get_workflow_json_schema.kibana.test.ts b/src/platform/packages/shared/kbn-workflows/spec/lib/get_workflow_json_schema.kibana.test.ts index 33a36bcf5e9af..1ea6f74aabcfd 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/lib/get_workflow_json_schema.kibana.test.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/lib/get_workflow_json_schema.kibana.test.ts @@ -242,7 +242,7 @@ describe('getWorkflowJsonSchema / kibana connectors', () => { }); KIBANA_SAMPLE_STEPS.forEach((step) => { - it(`${step.type}`, async () => { + it(`${step.type} (${step.name})`, async () => { const result = await validateWithYamlLsp( `test-${step.name}.yaml`, yaml.stringify({ diff --git a/src/platform/packages/shared/kbn-workflows/spec/lib/insert_fetcher_to_schema.ts b/src/platform/packages/shared/kbn-workflows/spec/lib/insert_fetcher_to_schema.ts new file mode 100644 index 0000000000000..39b5a18ec3f68 --- /dev/null +++ b/src/platform/packages/shared/kbn-workflows/spec/lib/insert_fetcher_to_schema.ts @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { z } from '@kbn/zod/v4'; +import { FetcherConfigSchema } from '../schema'; + +const MAX_RECURSION_DEPTH = 10; + +export function insertFetcherToSchemaRecursively(schema: z.ZodType, depth: number = 0): z.ZodType { + if (depth > MAX_RECURSION_DEPTH) { + return schema; + } + if (schema instanceof z.ZodObject) { + return schema.extend({ + fetcher: FetcherConfigSchema, + }); + } + if (schema instanceof z.ZodUnion) { + return z.union( + schema.options.map((option) => + insertFetcherToSchemaRecursively(option as z.ZodType, depth + 1) + ) + ); + } + return schema; +} diff --git a/src/platform/packages/shared/kbn-workflows/spec/lib/samples/es_steps.ts b/src/platform/packages/shared/kbn-workflows/spec/lib/samples/es_steps.ts index ae385ff27482e..eca538a416622 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/lib/samples/es_steps.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/lib/samples/es_steps.ts @@ -7,6 +7,10 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ +// es +// Document Operations: Create, read, update, delete documents +// Search and Query: Execute searches and retrieve data +// Index Operations: Create, list, delete indices export const ES_VALID_SAMPLE_STEPS = [ { name: 'create-document', diff --git a/src/platform/packages/shared/kbn-workflows/spec/lib/samples/index.ts b/src/platform/packages/shared/kbn-workflows/spec/lib/samples/index.ts index 0afca9772ad7c..84f9220ff47d0 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/lib/samples/index.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/lib/samples/index.ts @@ -7,13 +7,6 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -// es -// Document Operations: Create, read, update, delete documents -// Search and Query: Execute searches and retrieve data -// Index Operations: Create, list, delete indices export { ES_VALID_SAMPLE_STEPS, ES_INVALID_SAMPLE_STEPS } from './es_steps'; -// kibana -// Alert Triage: Update alert status, assign ownership, apply tags -// Case Management: Create and update cases export { KIBANA_SAMPLE_STEPS } from './kibana_steps'; diff --git a/src/platform/packages/shared/kbn-workflows/spec/lib/samples/kibana_steps.ts b/src/platform/packages/shared/kbn-workflows/spec/lib/samples/kibana_steps.ts index 7a46735836f6c..405e98f777765 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/lib/samples/kibana_steps.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/lib/samples/kibana_steps.ts @@ -7,7 +7,63 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ +// kibana +// Alert Triage: +// * Update alert status (operationId: SetAlertsStatus) +// * Assign ownership (operationId: SetAlertAssignees) +// * Apply tags (operationId: SetAlertTags) +// * Read tags (operationId: ReadTags) +// Case Management: +// * Create case (operationId: createCaseDefaultSpace) +// * Update case (operationId: updateCaseDefaultSpace) export const KIBANA_SAMPLE_STEPS = [ + { + name: 'set_alerts_status_by_ids', + type: 'kibana.SetAlertsStatus', + with: { + status: 'closed', + signal_ids: ['123'], + }, + }, + { + name: 'set_alerts_status_by_query', + type: 'kibana.SetAlertsStatus', + with: { + status: 'closed', + query: { + match: { + 'kibana.alert.uuid': '123', + }, + }, + }, + }, + { + name: 'set_alert_assignees_by_ids', + type: 'kibana.SetAlertAssignees', + with: { + assignees: { + add: ['123'], + remove: [], + }, + ids: ['123'], + }, + }, + { + name: 'set_alert_tags', + type: 'kibana.SetAlertTags', + with: { + tags: { + tags_to_add: ['123'], + tags_to_remove: [], + }, + ids: ['123'], + }, + }, + { + name: 'read_tags', + type: 'kibana.ReadTags', + with: {}, + }, { name: 'create_case', type: 'kibana.createCaseDefaultSpace', @@ -29,4 +85,17 @@ export const KIBANA_SAMPLE_STEPS = [ }, }, }, + { + name: 'update_case', + type: 'kibana.updateCaseDefaultSpace', + with: { + cases: [ + { + id: '123', + version: '123', + description: 'New Description', + }, + ], + }, + }, ]; diff --git a/src/platform/packages/shared/kbn-workflows/spec/schema.ts b/src/platform/packages/shared/kbn-workflows/spec/schema.ts index de971b0dfdb47..e2d6709450007 100644 --- a/src/platform/packages/shared/kbn-workflows/spec/schema.ts +++ b/src/platform/packages/shared/kbn-workflows/spec/schema.ts @@ -174,6 +174,7 @@ export const FetcherConfigSchema = z max_redirects: z.number().optional(), keep_alive: z.boolean().optional(), }) + .meta({ $id: 'fetcher', description: 'Fetcher configuration for HTTP request customization' }) .optional(); export const HttpStepSchema = BaseStepSchema.extend({