diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 828dd408ef..aad833fad0 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -24625,13 +24625,23 @@ "$ref": "#/components/schemas/query_rules._types:QueryRuleType" }, "criteria": { - "type": "array", - "items": { - "$ref": "#/components/schemas/query_rules._types:QueryRuleCriteria" - } + "oneOf": [ + { + "$ref": "#/components/schemas/query_rules._types:QueryRuleCriteria" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/query_rules._types:QueryRuleCriteria" + } + } + ] }, "actions": { "$ref": "#/components/schemas/query_rules._types:QueryRuleActions" + }, + "priority": { + "type": "number" } }, "required": [ @@ -24777,10 +24787,17 @@ "type": "object", "properties": { "rules": { - "type": "array", - "items": { - "$ref": "#/components/schemas/query_rules._types:QueryRule" - } + "oneOf": [ + { + "$ref": "#/components/schemas/query_rules._types:QueryRule" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/query_rules._types:QueryRule" + } + } + ] } }, "required": [ @@ -93163,13 +93180,23 @@ "$ref": "#/components/schemas/query_rules._types:QueryRuleType" }, "criteria": { - "type": "array", - "items": { - "$ref": "#/components/schemas/query_rules._types:QueryRuleCriteria" - } + "oneOf": [ + { + "$ref": "#/components/schemas/query_rules._types:QueryRuleCriteria" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/query_rules._types:QueryRuleCriteria" + } + } + ] }, "actions": { "$ref": "#/components/schemas/query_rules._types:QueryRuleActions" + }, + "priority": { + "type": "number" } }, "required": [ @@ -93211,6 +93238,7 @@ "global", "exact", "exact_fuzzy", + "fuzzy", "prefix", "suffix", "contains", @@ -93271,7 +93299,7 @@ "description": "A map of criteria type to the number of rules of that type", "type": "object", "additionalProperties": { - "type": "string" + "type": "number" } } }, diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index fd03a9aa9e..e9a4ef9557 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -15307,13 +15307,23 @@ "$ref": "#/components/schemas/query_rules._types:QueryRuleType" }, "criteria": { - "type": "array", - "items": { - "$ref": "#/components/schemas/query_rules._types:QueryRuleCriteria" - } + "oneOf": [ + { + "$ref": "#/components/schemas/query_rules._types:QueryRuleCriteria" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/query_rules._types:QueryRuleCriteria" + } + } + ] }, "actions": { "$ref": "#/components/schemas/query_rules._types:QueryRuleActions" + }, + "priority": { + "type": "number" } }, "required": [ @@ -15459,10 +15469,17 @@ "type": "object", "properties": { "rules": { - "type": "array", - "items": { - "$ref": "#/components/schemas/query_rules._types:QueryRule" - } + "oneOf": [ + { + "$ref": "#/components/schemas/query_rules._types:QueryRule" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/query_rules._types:QueryRule" + } + } + ] } }, "required": [ @@ -59938,13 +59955,23 @@ "$ref": "#/components/schemas/query_rules._types:QueryRuleType" }, "criteria": { - "type": "array", - "items": { - "$ref": "#/components/schemas/query_rules._types:QueryRuleCriteria" - } + "oneOf": [ + { + "$ref": "#/components/schemas/query_rules._types:QueryRuleCriteria" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/query_rules._types:QueryRuleCriteria" + } + } + ] }, "actions": { "$ref": "#/components/schemas/query_rules._types:QueryRuleActions" + }, + "priority": { + "type": "number" } }, "required": [ @@ -59986,6 +60013,7 @@ "global", "exact", "exact_fuzzy", + "fuzzy", "prefix", "suffix", "contains", @@ -60046,7 +60074,7 @@ "description": "A map of criteria type to the number of rules of that type", "type": "object", "additionalProperties": { - "type": "string" + "type": "number" } } }, diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 6886a16ef3..9e6771c854 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -35825,14 +35825,26 @@ "name": "criteria", "required": true, "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "QueryRuleCriteria", - "namespace": "query_rules._types" + "items": [ + { + "kind": "instance_of", + "type": { + "name": "QueryRuleCriteria", + "namespace": "query_rules._types" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "QueryRuleCriteria", + "namespace": "query_rules._types" + } + } } - } + ], + "kind": "union_of" } }, { @@ -35845,6 +35857,17 @@ "namespace": "query_rules._types" } } + }, + { + "name": "priority", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } } ] }, @@ -35887,7 +35910,7 @@ } ], "query": [], - "specLocation": "query_rules/put_rule/QueryRulePutRequest.ts#L27-L54" + "specLocation": "query_rules/put_rule/QueryRulePutRequest.ts#L28-L56" }, { "body": { @@ -35924,14 +35947,26 @@ "name": "rules", "required": true, "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "QueryRule", - "namespace": "query_rules._types" + "items": [ + { + "kind": "instance_of", + "type": { + "name": "QueryRule", + "namespace": "query_rules._types" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "QueryRule", + "namespace": "query_rules._types" + } + } } - } + ], + "kind": "union_of" } } ] @@ -99339,6 +99374,9 @@ { "name": "exact_fuzzy" }, + { + "name": "fuzzy" + }, { "name": "prefix" }, @@ -99368,7 +99406,7 @@ "name": "QueryRuleCriteriaType", "namespace": "query_rules._types" }, - "specLocation": "query_rules/_types/QueryRuleset.ts#L54-L66" + "specLocation": "query_rules/_types/QueryRuleset.ts#L56-L69" }, { "kind": "enum", @@ -99381,7 +99419,7 @@ "name": "QueryRuleType", "namespace": "query_rules._types" }, - "specLocation": "query_rules/_types/QueryRuleset.ts#L44-L46" + "specLocation": "query_rules/_types/QueryRuleset.ts#L46-L48" }, { "kind": "enum", @@ -132762,14 +132800,26 @@ "name": "criteria", "required": true, "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "QueryRuleCriteria", - "namespace": "query_rules._types" + "items": [ + { + "kind": "instance_of", + "type": { + "name": "QueryRuleCriteria", + "namespace": "query_rules._types" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "QueryRuleCriteria", + "namespace": "query_rules._types" + } + } } - } + ], + "kind": "union_of" } }, { @@ -132782,9 +132832,20 @@ "namespace": "query_rules._types" } } + }, + { + "name": "priority", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } } ], - "specLocation": "query_rules/_types/QueryRuleset.ts#L37-L42" + "specLocation": "query_rules/_types/QueryRuleset.ts#L38-L44" }, { "kind": "interface", @@ -132826,7 +132887,7 @@ } } ], - "specLocation": "query_rules/_types/QueryRuleset.ts#L48-L52" + "specLocation": "query_rules/_types/QueryRuleset.ts#L50-L54" }, { "kind": "interface", @@ -132864,7 +132925,7 @@ } } ], - "specLocation": "query_rules/_types/QueryRuleset.ts#L68-L71" + "specLocation": "query_rules/_types/QueryRuleset.ts#L71-L74" }, { "kind": "interface", @@ -132901,7 +132962,7 @@ } } ], - "specLocation": "query_rules/_types/QueryRuleset.ts#L26-L35" + "specLocation": "query_rules/_types/QueryRuleset.ts#L27-L36" }, { "kind": "interface", @@ -132951,8 +133012,8 @@ "value": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "integer", + "namespace": "_types" } } } diff --git a/output/schema/schema.json b/output/schema/schema.json index f9b9c53d15..ef71115784 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -176026,14 +176026,26 @@ "name": "criteria", "required": true, "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "QueryRuleCriteria", - "namespace": "query_rules._types" + "items": [ + { + "kind": "instance_of", + "type": { + "name": "QueryRuleCriteria", + "namespace": "query_rules._types" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "QueryRuleCriteria", + "namespace": "query_rules._types" + } + } } - } + ], + "kind": "union_of" } }, { @@ -176046,9 +176058,20 @@ "namespace": "query_rules._types" } } + }, + { + "name": "priority", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } } ], - "specLocation": "query_rules/_types/QueryRuleset.ts#L37-L42" + "specLocation": "query_rules/_types/QueryRuleset.ts#L38-L44" }, { "kind": "interface", @@ -176086,7 +176109,7 @@ } } ], - "specLocation": "query_rules/_types/QueryRuleset.ts#L68-L71" + "specLocation": "query_rules/_types/QueryRuleset.ts#L71-L74" }, { "kind": "interface", @@ -176128,7 +176151,7 @@ } } ], - "specLocation": "query_rules/_types/QueryRuleset.ts#L48-L52" + "specLocation": "query_rules/_types/QueryRuleset.ts#L50-L54" }, { "kind": "enum", @@ -176142,6 +176165,9 @@ { "name": "exact_fuzzy" }, + { + "name": "fuzzy" + }, { "name": "prefix" }, @@ -176171,7 +176197,7 @@ "name": "QueryRuleCriteriaType", "namespace": "query_rules._types" }, - "specLocation": "query_rules/_types/QueryRuleset.ts#L54-L66" + "specLocation": "query_rules/_types/QueryRuleset.ts#L56-L69" }, { "kind": "enum", @@ -176184,7 +176210,7 @@ "name": "QueryRuleType", "namespace": "query_rules._types" }, - "specLocation": "query_rules/_types/QueryRuleset.ts#L44-L46" + "specLocation": "query_rules/_types/QueryRuleset.ts#L46-L48" }, { "kind": "interface", @@ -176221,7 +176247,7 @@ } } ], - "specLocation": "query_rules/_types/QueryRuleset.ts#L26-L35" + "specLocation": "query_rules/_types/QueryRuleset.ts#L27-L36" }, { "attachedBehaviors": [ @@ -176511,8 +176537,8 @@ "value": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "integer", + "namespace": "_types" } } } @@ -176628,14 +176654,26 @@ "name": "criteria", "required": true, "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "QueryRuleCriteria", - "namespace": "query_rules._types" + "items": [ + { + "kind": "instance_of", + "type": { + "name": "QueryRuleCriteria", + "namespace": "query_rules._types" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "QueryRuleCriteria", + "namespace": "query_rules._types" + } + } } - } + ], + "kind": "union_of" } }, { @@ -176648,6 +176686,17 @@ "namespace": "query_rules._types" } } + }, + { + "name": "priority", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } } ] }, @@ -176690,7 +176739,7 @@ } ], "query": [], - "specLocation": "query_rules/put_rule/QueryRulePutRequest.ts#L27-L54" + "specLocation": "query_rules/put_rule/QueryRulePutRequest.ts#L28-L56" }, { "body": { @@ -176727,14 +176776,26 @@ "name": "rules", "required": true, "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "QueryRule", - "namespace": "query_rules._types" + "items": [ + { + "kind": "instance_of", + "type": { + "name": "QueryRule", + "namespace": "query_rules._types" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "QueryRule", + "namespace": "query_rules._types" + } + } } - } + ], + "kind": "union_of" } } ] diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 50cfb46222..83268925fc 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -16366,8 +16366,9 @@ export interface NodesUsageResponseBase extends NodesNodesResponseBase { export interface QueryRulesQueryRule { rule_id: Id type: QueryRulesQueryRuleType - criteria: QueryRulesQueryRuleCriteria[] + criteria: QueryRulesQueryRuleCriteria | QueryRulesQueryRuleCriteria[] actions: QueryRulesQueryRuleActions + priority?: integer } export interface QueryRulesQueryRuleActions { @@ -16381,7 +16382,7 @@ export interface QueryRulesQueryRuleCriteria { values?: any[] } -export type QueryRulesQueryRuleCriteriaType = 'global' | 'exact' | 'exact_fuzzy' | 'prefix' | 'suffix' | 'contains' | 'lt' | 'lte' | 'gt' | 'gte' | 'always' +export type QueryRulesQueryRuleCriteriaType = 'global' | 'exact' | 'exact_fuzzy' | 'fuzzy' | 'prefix' | 'suffix' | 'contains' | 'lt' | 'lte' | 'gt' | 'gte' | 'always' export type QueryRulesQueryRuleType = 'pinned' @@ -16419,7 +16420,7 @@ export type QueryRulesGetRulesetResponse = QueryRulesQueryRuleset export interface QueryRulesListRulesetsQueryRulesetListItem { ruleset_id: Id rule_total_count: integer - rule_criteria_types_counts: Record + rule_criteria_types_counts: Record } export interface QueryRulesListRulesetsRequest extends RequestBase { @@ -16437,8 +16438,9 @@ export interface QueryRulesPutRuleRequest extends RequestBase { rule_id: Id body?: { type: QueryRulesQueryRuleType - criteria: QueryRulesQueryRuleCriteria[] + criteria: QueryRulesQueryRuleCriteria | QueryRulesQueryRuleCriteria[] actions: QueryRulesQueryRuleActions + priority?: integer } } @@ -16449,7 +16451,7 @@ export interface QueryRulesPutRuleResponse { export interface QueryRulesPutRulesetRequest extends RequestBase { ruleset_id: Id body?: { - rules: QueryRulesQueryRule[] + rules: QueryRulesQueryRule | QueryRulesQueryRule[] } } diff --git a/specification/query_rules/_types/QueryRuleset.ts b/specification/query_rules/_types/QueryRuleset.ts index de33443501..f8d31dc132 100644 --- a/specification/query_rules/_types/QueryRuleset.ts +++ b/specification/query_rules/_types/QueryRuleset.ts @@ -18,6 +18,7 @@ */ import { Id, IndexName, Name } from '@_types/common' +import { integer } from '@_types/Numeric' import { EpochTime, UnitMillis } from '@_types/Time' import { InlineScript } from '@_types/Scripting' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' @@ -37,8 +38,9 @@ export class QueryRuleset { export class QueryRule { rule_id: Id type: QueryRuleType - criteria: QueryRuleCriteria[] + criteria: QueryRuleCriteria | QueryRuleCriteria[] actions: QueryRuleActions + priority?: integer } export enum QueryRuleType { @@ -55,6 +57,7 @@ export enum QueryRuleCriteriaType { global, exact, exact_fuzzy, + fuzzy, prefix, suffix, contains, diff --git a/specification/query_rules/list_rulesets/types.ts b/specification/query_rules/list_rulesets/types.ts index 918bd1d0f9..6aa550bc75 100644 --- a/specification/query_rules/list_rulesets/types.ts +++ b/specification/query_rules/list_rulesets/types.ts @@ -33,5 +33,5 @@ export class QueryRulesetListItem { /** * A map of criteria type to the number of rules of that type */ - rule_criteria_types_counts: Dictionary + rule_criteria_types_counts: Dictionary } diff --git a/specification/query_rules/put_rule/QueryRulePutRequest.ts b/specification/query_rules/put_rule/QueryRulePutRequest.ts index 9094b4f5a6..bafdd311ff 100644 --- a/specification/query_rules/put_rule/QueryRulePutRequest.ts +++ b/specification/query_rules/put_rule/QueryRulePutRequest.ts @@ -18,6 +18,7 @@ */ import { RequestBase } from '@_types/Base' import { Id } from '@_types/common' +import { integer } from '@_types/Numeric' import { QueryRuleType, QueryRuleCriteria, @@ -48,7 +49,8 @@ export interface Request extends RequestBase { /** @codegen_name query_rule */ body: { type: QueryRuleType - criteria: QueryRuleCriteria[] + criteria: QueryRuleCriteria | QueryRuleCriteria[] actions: QueryRuleActions + priority?: integer } } diff --git a/specification/query_rules/put_ruleset/QueryRulesetPutRequest.ts b/specification/query_rules/put_ruleset/QueryRulesetPutRequest.ts index 9bfe726fe9..1b9f22f27e 100644 --- a/specification/query_rules/put_ruleset/QueryRulesetPutRequest.ts +++ b/specification/query_rules/put_ruleset/QueryRulesetPutRequest.ts @@ -38,6 +38,6 @@ export interface Request extends RequestBase { */ /** @codegen_name query_ruleset */ body: { - rules: QueryRule[] + rules: QueryRule | QueryRule[] } }