diff --git a/packages/core/saved-objects/core-saved-objects-server/src/mapping_definition.ts b/packages/core/saved-objects/core-saved-objects-server/src/mapping_definition.ts index 80ba35700953..0dfc9d2ea05e 100644 --- a/packages/core/saved-objects/core-saved-objects-server/src/mapping_definition.ts +++ b/packages/core/saved-objects/core-saved-objects-server/src/mapping_definition.ts @@ -9,6 +9,7 @@ import type { PropertyName as EsPropertyName, MappingProperty as EsMappingProperty, + MappingPropertyBase as EsMappingPropertyBase, } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; /** @@ -64,19 +65,20 @@ export interface SavedObjectsMappingProperties { * * @public */ -export type SavedObjectsFieldMapping = EsMappingProperty & { - /** - * The dynamic property of the mapping, either `false` or `'strict'`. If - * unspecified `dynamic: 'strict'` will be inherited from the top-level - * index mappings. - * - * Note: To limit the number of mapping fields Saved Object types should - * *never* use `dynamic: true`. - */ - dynamic?: false | 'strict'; - /** - * Some mapping types do not accept the `properties` attributes. Explicitly adding it as optional to our type - * to avoid type failures on all code using accessing them via `SavedObjectsFieldMapping.properties`. - */ - properties?: Record; -}; +export type SavedObjectsFieldMapping = EsMappingProperty & + EsMappingPropertyBase & { + /** + * The dynamic property of the mapping, either `false` or `'strict'`. If + * unspecified `dynamic: 'strict'` will be inherited from the top-level + * index mappings. + * + * Note: To limit the number of mapping fields Saved Object types should + * *never* use `dynamic: true`. + */ + dynamic?: false | 'strict'; + /** + * Some mapping types do not accept the `properties` attributes. Explicitly adding it as optional to our type + * to avoid type failures on all code using accessing them via `SavedObjectsFieldMapping.properties`. + */ + properties?: Record; + }; diff --git a/packages/kbn-es-query/src/filters/build_filters/phrase_filter.ts b/packages/kbn-es-query/src/filters/build_filters/phrase_filter.ts index 485a10fddb03..63ff39e467ae 100644 --- a/packages/kbn-es-query/src/filters/build_filters/phrase_filter.ts +++ b/packages/kbn-es-query/src/filters/build_filters/phrase_filter.ts @@ -37,7 +37,7 @@ export type ScriptedPhraseFilter = Filter & { meta: PhraseFilterMeta; query: { script: { - script: estypes.InlineScript; + script: estypes.Script; }; }; }; @@ -134,7 +134,7 @@ export const getPhraseScript = (field: DataViewFieldBase, value: PhraseFilterVal params: { value: convertedValue, }, - } as estypes.InlineScript, + } as estypes.Script, }; }; diff --git a/packages/kbn-es-query/src/filters/build_filters/range_filter.ts b/packages/kbn-es-query/src/filters/build_filters/range_filter.ts index f80fce31cb8a..46a36b5c4999 100644 --- a/packages/kbn-es-query/src/filters/build_filters/range_filter.ts +++ b/packages/kbn-es-query/src/filters/build_filters/range_filter.ts @@ -65,7 +65,7 @@ export type ScriptedRangeFilter = Filter & { meta: RangeFilterMeta; query: { script: { - script: estypes.InlineScript; + script: estypes.Script; }; }; }; @@ -189,7 +189,7 @@ export const buildRangeFilter = ( * @internal */ export const getRangeScript = (field: DataViewFieldBase, params: RangeFilterParams) => { - const knownParams: estypes.InlineScript['params'] = mapValues( + const knownParams: estypes.Script['params'] = mapValues( pickBy(params, (val, key) => key in operators), (value) => (field.type === 'number' && typeof value === 'string' ? parseFloat(value) : value) );