From e5c8232bd68c2054df0a56b3ad3159f3a34142b0 Mon Sep 17 00:00:00 2001 From: Sylvain Wallez Date: Thu, 10 Aug 2023 18:49:04 +0200 Subject: [PATCH] Additional fixes --- output/schema/schema.json | 166 ++++++++++---------- output/typescript/types.ts | 14 +- specification/_types/aggregations/bucket.ts | 19 ++- 3 files changed, 104 insertions(+), 95 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index fe996312ae..bfd0b78388 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -46820,7 +46820,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L56-L62" + "specLocation": "_types/aggregations/bucket.ts#L57-L63" }, { "attachedBehaviors": [ @@ -47379,7 +47379,7 @@ "name": "AggregateOrder", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L602-L604", + "specLocation": "_types/aggregations/bucket.ts#L607-L609", "type": { "items": [ { @@ -48523,7 +48523,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L497-L501" + "specLocation": "_types/aggregations/bucket.ts#L502-L506" }, { "kind": "interface", @@ -48745,7 +48745,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L64-L99" + "specLocation": "_types/aggregations/bucket.ts#L65-L100" }, { "inherits": { @@ -49006,7 +49006,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/bucket.ts#L49-L54" + "specLocation": "_types/aggregations/bucket.ts#L50-L55" }, { "description": "A sibling pipeline aggregation which executes a correlation function on the configured sibling multi-bucket aggregation.", @@ -49540,7 +49540,7 @@ "name": "CalendarInterval", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L244-L261" + "specLocation": "_types/aggregations/bucket.ts#L249-L266" }, { "inherits": { @@ -49794,7 +49794,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L636-L700" + "specLocation": "_types/aggregations/bucket.ts#L641-L705" }, { "codegenNames": [ @@ -49806,7 +49806,7 @@ "name": "CategorizeTextAnalyzer", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L702-L705", + "specLocation": "_types/aggregations/bucket.ts#L707-L710", "type": { "items": [ { @@ -49857,7 +49857,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L521-L524" + "specLocation": "_types/aggregations/bucket.ts#L526-L529" }, { "attachedBehaviors": [ @@ -49904,7 +49904,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L110-L115" + "specLocation": "_types/aggregations/bucket.ts#L111-L116" }, { "inherits": { @@ -49949,7 +49949,7 @@ "name": "CompositeAggregateKey", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L117-L117", + "specLocation": "_types/aggregations/bucket.ts#L118-L118", "type": { "key": { "kind": "instance_of", @@ -50034,7 +50034,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L119-L135" + "specLocation": "_types/aggregations/bucket.ts#L120-L136" }, { "kind": "interface", @@ -50044,6 +50044,7 @@ }, "properties": [ { + "description": "Either `field` or `script` must be present", "name": "field", "required": false, "type": { @@ -50055,13 +50056,13 @@ } }, { - "name": "missing", + "name": "missing_bucket", "required": false, "type": { "kind": "instance_of", "type": { - "name": "Missing", - "namespace": "_types.aggregations" + "name": "boolean", + "namespace": "_builtins" } } }, @@ -50077,17 +50078,7 @@ } }, { - "name": "missing_bucket", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "_builtins" - } - } - }, - { + "description": "Either `field` or `script` must be present", "name": "script", "required": false, "type": { @@ -50104,14 +50095,14 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "ValueType", + "namespace": "_types.aggregations" } } }, { "name": "order", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -50121,7 +50112,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L156-L164" + "specLocation": "_types/aggregations/bucket.ts#L157-L166" }, { "kind": "interface", @@ -50179,7 +50170,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L137-L154" + "specLocation": "_types/aggregations/bucket.ts#L138-L155" }, { "attachedBehaviors": [ @@ -50226,7 +50217,7 @@ "properties": [ { "name": "format", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -50236,8 +50227,21 @@ } }, { + "description": "Either `calendar_interval` or `fixed_interval` must be present", "name": "calendar_interval", - "required": true, + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "DurationLarge", + "namespace": "_types" + } + } + }, + { + "description": "Either `calendar_interval` or `fixed_interval` must be present", + "name": "fixed_interval", + "required": false, "type": { "kind": "instance_of", "type": { @@ -50269,7 +50273,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L172-L177" + "specLocation": "_types/aggregations/bucket.ts#L174-L182" }, { "inherits": { @@ -50286,7 +50290,7 @@ "properties": [ { "name": "precision", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -50307,7 +50311,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L179-L182" + "specLocation": "_types/aggregations/bucket.ts#L184-L187" }, { "inherits": { @@ -50334,7 +50338,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L168-L170" + "specLocation": "_types/aggregations/bucket.ts#L170-L172" }, { "inherits": { @@ -50349,7 +50353,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/bucket.ts#L166-L166" + "specLocation": "_types/aggregations/bucket.ts#L168-L168" }, { "description": "Result of the `cumulative_cardinality` aggregation", @@ -50468,7 +50472,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L707-L711" + "specLocation": "_types/aggregations/bucket.ts#L712-L716" }, { "inherits": { @@ -50715,7 +50719,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L184-L242" + "specLocation": "_types/aggregations/bucket.ts#L189-L247" }, { "attachedBehaviors": [ @@ -50873,7 +50877,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L263-L289" + "specLocation": "_types/aggregations/bucket.ts#L268-L294" }, { "kind": "interface", @@ -50919,7 +50923,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L300-L313" + "specLocation": "_types/aggregations/bucket.ts#L305-L318" }, { "inherits": { @@ -51051,7 +51055,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L315-L336" + "specLocation": "_types/aggregations/bucket.ts#L320-L341" }, { "description": "Result of a `terms` aggregation when the field is some kind of decimal number like a float, double, or distance.", @@ -51212,7 +51216,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L429-L432" + "specLocation": "_types/aggregations/bucket.ts#L434-L437" }, { "inherits": { @@ -51552,7 +51556,7 @@ "name": "FieldDateMath", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L291-L298", + "specLocation": "_types/aggregations/bucket.ts#L296-L303", "type": { "items": [ { @@ -51690,7 +51694,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L353-L373" + "specLocation": "_types/aggregations/bucket.ts#L358-L378" }, { "attachedBehaviors": [ @@ -51863,7 +51867,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L758-L782" + "specLocation": "_types/aggregations/bucket.ts#L763-L787" }, { "attachedBehaviors": [ @@ -51993,7 +51997,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L744-L756" + "specLocation": "_types/aggregations/bucket.ts#L749-L761" }, { "kind": "enum", @@ -52238,7 +52242,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L375-L381" + "specLocation": "_types/aggregations/bucket.ts#L380-L386" }, { "inherits": { @@ -52334,7 +52338,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L383-L389" + "specLocation": "_types/aggregations/bucket.ts#L388-L394" }, { "attachedBehaviors": [ @@ -52668,7 +52672,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L391-L397" + "specLocation": "_types/aggregations/bucket.ts#L396-L402" }, { "attachedBehaviors": [ @@ -52776,7 +52780,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L399-L425" + "specLocation": "_types/aggregations/bucket.ts#L404-L430" }, { "attachedBehaviors": [ @@ -52810,7 +52814,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/bucket.ts#L427-L427" + "specLocation": "_types/aggregations/bucket.ts#L432-L432" }, { "kind": "interface", @@ -52831,7 +52835,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L526-L528" + "specLocation": "_types/aggregations/bucket.ts#L531-L533" }, { "kind": "interface", @@ -53064,7 +53068,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L434-L446" + "specLocation": "_types/aggregations/bucket.ts#L439-L451" }, { "attachedBehaviors": [ @@ -53703,7 +53707,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L713-L742" + "specLocation": "_types/aggregations/bucket.ts#L718-L747" }, { "attachedBehaviors": [ @@ -53832,7 +53836,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L448-L451" + "specLocation": "_types/aggregations/bucket.ts#L453-L456" }, { "kind": "interface", @@ -53899,7 +53903,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L453-L457" + "specLocation": "_types/aggregations/bucket.ts#L458-L462" }, { "attachedBehaviors": [ @@ -54611,7 +54615,7 @@ "name": "MinimumInterval", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L101-L108" + "specLocation": "_types/aggregations/bucket.ts#L102-L109" }, { "kind": "type_alias", @@ -54709,7 +54713,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L459-L462" + "specLocation": "_types/aggregations/bucket.ts#L464-L467" }, { "kind": "enum", @@ -55050,7 +55054,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L475-L478" + "specLocation": "_types/aggregations/bucket.ts#L480-L483" }, { "inherits": { @@ -55182,7 +55186,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L464-L473" + "specLocation": "_types/aggregations/bucket.ts#L469-L478" }, { "attachedBehaviors": [ @@ -55269,7 +55273,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L530-L533" + "specLocation": "_types/aggregations/bucket.ts#L535-L538" }, { "attachedBehaviors": [ @@ -55315,7 +55319,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L480-L482" + "specLocation": "_types/aggregations/bucket.ts#L485-L487" }, { "inherits": { @@ -55417,7 +55421,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L484-L486" + "specLocation": "_types/aggregations/bucket.ts#L489-L491" }, { "kind": "interface", @@ -55426,7 +55430,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/bucket.ts#L535-L535" + "specLocation": "_types/aggregations/bucket.ts#L540-L540" }, { "inherits": { @@ -55824,7 +55828,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L488-L495" + "specLocation": "_types/aggregations/bucket.ts#L493-L500" }, { "attachedBehaviors": [ @@ -55992,7 +55996,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L503-L511" + "specLocation": "_types/aggregations/bucket.ts#L508-L516" }, { "inherits": { @@ -56131,7 +56135,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L513-L515" + "specLocation": "_types/aggregations/bucket.ts#L518-L520" }, { "attachedBehaviors": [ @@ -56177,7 +56181,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L517-L519" + "specLocation": "_types/aggregations/bucket.ts#L522-L524" }, { "kind": "enum", @@ -56199,7 +56203,7 @@ "name": "SamplerAggregationExecutionHint", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L338-L351" + "specLocation": "_types/aggregations/bucket.ts#L343-L356" }, { "kind": "interface", @@ -56220,7 +56224,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L537-L539" + "specLocation": "_types/aggregations/bucket.ts#L542-L544" }, { "inherits": { @@ -56704,7 +56708,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L541-L557" + "specLocation": "_types/aggregations/bucket.ts#L546-L562" }, { "attachedBehaviors": [ @@ -56963,7 +56967,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L559-L577" + "specLocation": "_types/aggregations/bucket.ts#L564-L582" }, { "inherits": { @@ -58333,7 +58337,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L579-L596" + "specLocation": "_types/aggregations/bucket.ts#L584-L601" }, { "kind": "enum", @@ -58349,7 +58353,7 @@ "name": "TermsAggregationCollectMode", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L606-L609" + "specLocation": "_types/aggregations/bucket.ts#L611-L614" }, { "kind": "enum", @@ -58371,7 +58375,7 @@ "name": "TermsAggregationExecutionHint", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L611-L616" + "specLocation": "_types/aggregations/bucket.ts#L616-L621" }, { "attachedBehaviors": [ @@ -58413,7 +58417,7 @@ "name": "TermsExclude", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L621-L622", + "specLocation": "_types/aggregations/bucket.ts#L626-L627", "type": { "items": [ { @@ -58448,7 +58452,7 @@ "name": "TermsInclude", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L618-L619", + "specLocation": "_types/aggregations/bucket.ts#L623-L624", "type": { "items": [ { @@ -58509,7 +58513,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L624-L627" + "specLocation": "_types/aggregations/bucket.ts#L629-L632" }, { "kind": "interface", @@ -59178,7 +59182,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L629-L634" + "specLocation": "_types/aggregations/bucket.ts#L634-L639" }, { "attachedBehaviors": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 2d54edd718..aedab2612e 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -3071,12 +3071,11 @@ export interface AggregationsCompositeAggregation extends AggregationsBucketAggr export interface AggregationsCompositeAggregationBase { field?: Field - missing?: AggregationsMissing - missing_order?: AggregationsMissingOrder missing_bucket?: boolean + missing_order?: AggregationsMissingOrder script?: Script - value_type?: string - order: SortOrder + value_type?: AggregationsValueType + order?: SortOrder } export interface AggregationsCompositeAggregationSource { @@ -3093,14 +3092,15 @@ export type AggregationsCompositeBucket = AggregationsCompositeBucketKeys & { [property: string]: AggregationsAggregate | AggregationsCompositeAggregateKey | long } export interface AggregationsCompositeDateHistogramAggregation extends AggregationsCompositeAggregationBase { - format: string - calendar_interval: DurationLarge + format?: string + calendar_interval?: DurationLarge + fixed_interval?: DurationLarge offset?: Duration time_zone?: TimeZone } export interface AggregationsCompositeGeoTileGridAggregation extends AggregationsCompositeAggregationBase { - precision: integer + precision?: integer bounds?: GeoBounds } diff --git a/specification/_types/aggregations/bucket.ts b/specification/_types/aggregations/bucket.ts index 5eb34a6970..8cb101cd52 100644 --- a/specification/_types/aggregations/bucket.ts +++ b/specification/_types/aggregations/bucket.ts @@ -45,6 +45,7 @@ import { Aggregation } from './Aggregation' import { Missing, MissingOrder } from './AggregationContainer' import { OverloadOf } from '@spec_utils/behaviors' import { Term } from '@global/termvectors/types' +import { ValueType } from '@_types/aggregations/metric' /** * Base type for bucket aggregations. These aggregations also accept sub-aggregations. @@ -154,13 +155,14 @@ export class CompositeAggregationSource { } export class CompositeAggregationBase { + /** Either `field` or `script` must be present */ field?: Field - missing?: Missing - missing_order?: MissingOrder missing_bucket?: boolean + missing_order?: MissingOrder + /** Either `field` or `script` must be present */ script?: Script - value_type?: string - order: SortOrder + value_type?: ValueType + order?: SortOrder } export class CompositeTermsAggregation extends CompositeAggregationBase {} @@ -170,14 +172,17 @@ export class CompositeHistogramAggregation extends CompositeAggregationBase { } export class CompositeDateHistogramAggregation extends CompositeAggregationBase { - format: string - calendar_interval: DurationLarge + format?: string + /** Either `calendar_interval` or `fixed_interval` must be present */ + calendar_interval?: DurationLarge + /** Either `calendar_interval` or `fixed_interval` must be present */ + fixed_interval?: DurationLarge offset?: Duration time_zone?: TimeZone } export class CompositeGeoTileGridAggregation extends CompositeAggregationBase { - precision: integer + precision?: integer bounds?: GeoBounds }