[data] Extract @kbn/field-types to a package (#106973) (#107276)

Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
This commit is contained in:
Kibana Machine 2021-07-30 08:58:29 -04:00 committed by GitHub
parent 5802dde127
commit 7772d75514
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 322 additions and 515 deletions

View file

@ -4,10 +4,13 @@
## castEsToKbnFieldTypeName variable
Get the KbnFieldType name for an esType string
> Warning: This API is now obsolete.
>
> import from "<!-- -->@<!-- -->kbn/field-types" instead
>
<b>Signature:</b>
```typescript
castEsToKbnFieldTypeName: (esType: ES_FIELD_TYPES | string) => KBN_FIELD_TYPES
castEsToKbnFieldTypeName: (esType: string) => import("@kbn/field-types").KBN_FIELD_TYPES
```

View file

@ -1,54 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [ES\_FIELD\_TYPES](./kibana-plugin-plugins-data-public.es_field_types.md)
## ES\_FIELD\_TYPES enum
\*
<b>Signature:</b>
```typescript
export declare enum ES_FIELD_TYPES
```
## Enumeration Members
| Member | Value | Description |
| --- | --- | --- |
| \_ID | <code>&quot;_id&quot;</code> | |
| \_INDEX | <code>&quot;_index&quot;</code> | |
| \_SOURCE | <code>&quot;_source&quot;</code> | |
| \_TYPE | <code>&quot;_type&quot;</code> | |
| ATTACHMENT | <code>&quot;attachment&quot;</code> | |
| BOOLEAN | <code>&quot;boolean&quot;</code> | |
| BYTE | <code>&quot;byte&quot;</code> | |
| DATE | <code>&quot;date&quot;</code> | |
| DATE\_NANOS | <code>&quot;date_nanos&quot;</code> | |
| DATE\_RANGE | <code>&quot;date_range&quot;</code> | |
| DOUBLE | <code>&quot;double&quot;</code> | |
| DOUBLE\_RANGE | <code>&quot;double_range&quot;</code> | |
| FLOAT | <code>&quot;float&quot;</code> | |
| FLOAT\_RANGE | <code>&quot;float_range&quot;</code> | |
| GEO\_POINT | <code>&quot;geo_point&quot;</code> | |
| GEO\_SHAPE | <code>&quot;geo_shape&quot;</code> | |
| HALF\_FLOAT | <code>&quot;half_float&quot;</code> | |
| HISTOGRAM | <code>&quot;histogram&quot;</code> | |
| INTEGER | <code>&quot;integer&quot;</code> | |
| INTEGER\_RANGE | <code>&quot;integer_range&quot;</code> | |
| IP | <code>&quot;ip&quot;</code> | |
| IP\_RANGE | <code>&quot;ip_range&quot;</code> | |
| KEYWORD | <code>&quot;keyword&quot;</code> | |
| LONG | <code>&quot;long&quot;</code> | |
| LONG\_RANGE | <code>&quot;long_range&quot;</code> | |
| MURMUR3 | <code>&quot;murmur3&quot;</code> | |
| NESTED | <code>&quot;nested&quot;</code> | |
| OBJECT | <code>&quot;object&quot;</code> | |
| SCALED\_FLOAT | <code>&quot;scaled_float&quot;</code> | |
| SHORT | <code>&quot;short&quot;</code> | |
| STRING | <code>&quot;string&quot;</code> | |
| TEXT | <code>&quot;text&quot;</code> | |
| TOKEN\_COUNT | <code>&quot;token_count&quot;</code> | |
| UNSIGNED\_LONG | <code>&quot;unsigned_long&quot;</code> | |
| VERSION | <code>&quot;version&quot;</code> | |

View file

@ -4,9 +4,10 @@
## getKbnTypeNames variable
Get the esTypes known by all kbnFieldTypes
{<!-- -->Array<string>}
> Warning: This API is now obsolete.
>
> import from "<!-- -->@<!-- -->kbn/field-types" instead
>
<b>Signature:</b>

View file

@ -1,38 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [KBN\_FIELD\_TYPES](./kibana-plugin-plugins-data-public.kbn_field_types.md)
## KBN\_FIELD\_TYPES enum
\*
<b>Signature:</b>
```typescript
export declare enum KBN_FIELD_TYPES
```
## Enumeration Members
| Member | Value | Description |
| --- | --- | --- |
| \_SOURCE | <code>&quot;_source&quot;</code> | |
| ATTACHMENT | <code>&quot;attachment&quot;</code> | |
| BOOLEAN | <code>&quot;boolean&quot;</code> | |
| CONFLICT | <code>&quot;conflict&quot;</code> | |
| DATE | <code>&quot;date&quot;</code> | |
| DATE\_RANGE | <code>&quot;date_range&quot;</code> | |
| GEO\_POINT | <code>&quot;geo_point&quot;</code> | |
| GEO\_SHAPE | <code>&quot;geo_shape&quot;</code> | |
| HISTOGRAM | <code>&quot;histogram&quot;</code> | |
| IP | <code>&quot;ip&quot;</code> | |
| IP\_RANGE | <code>&quot;ip_range&quot;</code> | |
| MISSING | <code>&quot;missing&quot;</code> | |
| MURMUR3 | <code>&quot;murmur3&quot;</code> | |
| NESTED | <code>&quot;nested&quot;</code> | |
| NUMBER | <code>&quot;number&quot;</code> | |
| NUMBER\_RANGE | <code>&quot;number_range&quot;</code> | |
| OBJECT | <code>&quot;object&quot;</code> | |
| STRING | <code>&quot;string&quot;</code> | |
| UNKNOWN | <code>&quot;unknown&quot;</code> | |

View file

@ -4,10 +4,13 @@
## castEsToKbnFieldTypeName variable
Get the KbnFieldType name for an esType string
> Warning: This API is now obsolete.
>
> import from "<!-- -->@<!-- -->kbn/field-types" instead
>
<b>Signature:</b>
```typescript
castEsToKbnFieldTypeName: (esType: ES_FIELD_TYPES | string) => KBN_FIELD_TYPES
castEsToKbnFieldTypeName: (esType: string) => import("@kbn/field-types").KBN_FIELD_TYPES
```

View file

@ -1,54 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) &gt; [ES\_FIELD\_TYPES](./kibana-plugin-plugins-data-server.es_field_types.md)
## ES\_FIELD\_TYPES enum
\*
<b>Signature:</b>
```typescript
export declare enum ES_FIELD_TYPES
```
## Enumeration Members
| Member | Value | Description |
| --- | --- | --- |
| \_ID | <code>&quot;_id&quot;</code> | |
| \_INDEX | <code>&quot;_index&quot;</code> | |
| \_SOURCE | <code>&quot;_source&quot;</code> | |
| \_TYPE | <code>&quot;_type&quot;</code> | |
| ATTACHMENT | <code>&quot;attachment&quot;</code> | |
| BOOLEAN | <code>&quot;boolean&quot;</code> | |
| BYTE | <code>&quot;byte&quot;</code> | |
| DATE | <code>&quot;date&quot;</code> | |
| DATE\_NANOS | <code>&quot;date_nanos&quot;</code> | |
| DATE\_RANGE | <code>&quot;date_range&quot;</code> | |
| DOUBLE | <code>&quot;double&quot;</code> | |
| DOUBLE\_RANGE | <code>&quot;double_range&quot;</code> | |
| FLOAT | <code>&quot;float&quot;</code> | |
| FLOAT\_RANGE | <code>&quot;float_range&quot;</code> | |
| GEO\_POINT | <code>&quot;geo_point&quot;</code> | |
| GEO\_SHAPE | <code>&quot;geo_shape&quot;</code> | |
| HALF\_FLOAT | <code>&quot;half_float&quot;</code> | |
| HISTOGRAM | <code>&quot;histogram&quot;</code> | |
| INTEGER | <code>&quot;integer&quot;</code> | |
| INTEGER\_RANGE | <code>&quot;integer_range&quot;</code> | |
| IP | <code>&quot;ip&quot;</code> | |
| IP\_RANGE | <code>&quot;ip_range&quot;</code> | |
| KEYWORD | <code>&quot;keyword&quot;</code> | |
| LONG | <code>&quot;long&quot;</code> | |
| LONG\_RANGE | <code>&quot;long_range&quot;</code> | |
| MURMUR3 | <code>&quot;murmur3&quot;</code> | |
| NESTED | <code>&quot;nested&quot;</code> | |
| OBJECT | <code>&quot;object&quot;</code> | |
| SCALED\_FLOAT | <code>&quot;scaled_float&quot;</code> | |
| SHORT | <code>&quot;short&quot;</code> | |
| STRING | <code>&quot;string&quot;</code> | |
| TEXT | <code>&quot;text&quot;</code> | |
| TOKEN\_COUNT | <code>&quot;token_count&quot;</code> | |
| UNSIGNED\_LONG | <code>&quot;unsigned_long&quot;</code> | |
| VERSION | <code>&quot;version&quot;</code> | |

View file

@ -1,38 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) &gt; [KBN\_FIELD\_TYPES](./kibana-plugin-plugins-data-server.kbn_field_types.md)
## KBN\_FIELD\_TYPES enum
\*
<b>Signature:</b>
```typescript
export declare enum KBN_FIELD_TYPES
```
## Enumeration Members
| Member | Value | Description |
| --- | --- | --- |
| \_SOURCE | <code>&quot;_source&quot;</code> | |
| ATTACHMENT | <code>&quot;attachment&quot;</code> | |
| BOOLEAN | <code>&quot;boolean&quot;</code> | |
| CONFLICT | <code>&quot;conflict&quot;</code> | |
| DATE | <code>&quot;date&quot;</code> | |
| DATE\_RANGE | <code>&quot;date_range&quot;</code> | |
| GEO\_POINT | <code>&quot;geo_point&quot;</code> | |
| GEO\_SHAPE | <code>&quot;geo_shape&quot;</code> | |
| HISTOGRAM | <code>&quot;histogram&quot;</code> | |
| IP | <code>&quot;ip&quot;</code> | |
| IP\_RANGE | <code>&quot;ip_range&quot;</code> | |
| MISSING | <code>&quot;missing&quot;</code> | |
| MURMUR3 | <code>&quot;murmur3&quot;</code> | |
| NESTED | <code>&quot;nested&quot;</code> | |
| NUMBER | <code>&quot;number&quot;</code> | |
| NUMBER\_RANGE | <code>&quot;number_range&quot;</code> | |
| OBJECT | <code>&quot;object&quot;</code> | |
| STRING | <code>&quot;string&quot;</code> | |
| UNKNOWN | <code>&quot;unknown&quot;</code> | |

View file

@ -127,6 +127,7 @@
"@kbn/config-schema": "link:bazel-bin/packages/kbn-config-schema",
"@kbn/crypto": "link:bazel-bin/packages/kbn-crypto",
"@kbn/es-query": "link:bazel-bin/packages/kbn-es-query",
"@kbn/field-types": "link:bazel-bin/packages/kbn-field-types",
"@kbn/i18n": "link:bazel-bin/packages/kbn-i18n",
"@kbn/interpreter": "link:bazel-bin/packages/kbn-interpreter",
"@kbn/io-ts-utils": "link:bazel-bin/packages/kbn-io-ts-utils",

View file

@ -25,6 +25,7 @@ filegroup(
"//packages/kbn-eslint-import-resolver-kibana:build",
"//packages/kbn-eslint-plugin-eslint:build",
"//packages/kbn-expect:build",
"//packages/kbn-field-types:build",
"//packages/kbn-i18n:build",
"//packages/kbn-interpreter:build",
"//packages/kbn-io-ts-utils:build",

View file

@ -0,0 +1,3 @@
{
"presets": ["@kbn/babel-preset/node_preset"]
}

View file

@ -0,0 +1,96 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")
PKG_BASE_NAME = "kbn-field-types"
PKG_REQUIRE_NAME = "@kbn/field-types"
SOURCE_FILES = glob(
[
"src/**/*.ts",
],
exclude = [
"**/*.test.*",
],
)
SRCS = SOURCE_FILES
filegroup(
name = "srcs",
srcs = SRCS,
)
NPM_MODULE_EXTRA_FILES = [
"package.json",
"README.md"
]
RUNTIME_DEPS = [
"@npm//jest-styled-components",
"@npm//node-forge",
]
TYPES_DEPS = [
"@npm//@types/flot",
"@npm//@types/jest",
"@npm//@types/node",
"@npm//@types/node-forge",
"@npm//@types/testing-library__jest-dom",
"@npm//resize-observer-polyfill",
"@npm//@emotion/react",
"@npm//jest-styled-components",
]
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)
ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
],
)
ts_project(
name = "tsc_types",
args = ['--pretty'],
srcs = SRCS,
deps = TYPES_DEPS,
declaration = True,
declaration_map = True,
emit_declaration_only = True,
incremental = False,
out_dir = "target_types",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
)
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":tsc_types"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
pkg_npm(
name = "npm_module",
deps = [
":%s" % PKG_BASE_NAME,
]
)
filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)

View file

@ -0,0 +1,3 @@
# @kbn/field-types
Types and utilities for kbn and es field types

View file

@ -0,0 +1,13 @@
/*
* 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 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 or the Server
* Side Public License, v 1.
*/
module.exports = {
preset: '@kbn/test',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-field-types'],
};

View file

@ -0,0 +1,8 @@
{
"name": "@kbn/field-types",
"version": "1.0.0",
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target_node/index.js",
"types": "./target_types/index.d.ts"
}

View file

@ -0,0 +1,18 @@
/*
* 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 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 or the Server
* Side Public License, v 1.
*/
export { KbnFieldType } from './kbn_field_type';
export {
castEsToKbnFieldTypeName,
getKbnFieldType,
getKbnTypeNames,
getFilterableKbnTypeNames,
} from './kbn_field_types';
export { KBN_FIELD_TYPES, ES_FIELD_TYPES, KbnFieldTypeOptions } from './types';

View file

@ -0,0 +1,85 @@
/*
* 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 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 or the Server
* Side Public License, v 1.
*/
/** @public **/
export interface KbnFieldTypeOptions {
sortable: boolean;
filterable: boolean;
name: string;
esTypes: ES_FIELD_TYPES[];
}
/** @public **/
export enum ES_FIELD_TYPES {
_ID = '_id',
_INDEX = '_index',
_SOURCE = '_source',
_TYPE = '_type',
STRING = 'string',
TEXT = 'text',
KEYWORD = 'keyword',
VERSION = 'version',
BOOLEAN = 'boolean',
OBJECT = 'object',
DATE = 'date',
DATE_NANOS = 'date_nanos',
DATE_RANGE = 'date_range',
GEO_POINT = 'geo_point',
GEO_SHAPE = 'geo_shape',
FLOAT = 'float',
HALF_FLOAT = 'half_float',
SCALED_FLOAT = 'scaled_float',
DOUBLE = 'double',
INTEGER = 'integer',
LONG = 'long',
SHORT = 'short',
UNSIGNED_LONG = 'unsigned_long',
FLOAT_RANGE = 'float_range',
DOUBLE_RANGE = 'double_range',
INTEGER_RANGE = 'integer_range',
LONG_RANGE = 'long_range',
NESTED = 'nested',
BYTE = 'byte',
IP = 'ip',
IP_RANGE = 'ip_range',
ATTACHMENT = 'attachment',
TOKEN_COUNT = 'token_count',
MURMUR3 = 'murmur3',
HISTOGRAM = 'histogram',
}
/** @public **/
export enum KBN_FIELD_TYPES {
_SOURCE = '_source',
ATTACHMENT = 'attachment',
BOOLEAN = 'boolean',
DATE = 'date',
DATE_RANGE = 'date_range',
GEO_POINT = 'geo_point',
GEO_SHAPE = 'geo_shape',
IP = 'ip',
IP_RANGE = 'ip_range',
MURMUR3 = 'murmur3',
NUMBER = 'number',
NUMBER_RANGE = 'number_range',
STRING = 'string',
UNKNOWN = 'unknown',
CONFLICT = 'conflict',
OBJECT = 'object',
NESTED = 'nested',
HISTOGRAM = 'histogram',
MISSING = 'missing',
}

View file

@ -0,0 +1,14 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"outDir": "./target_types",
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"rootDir": "src",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-field-types/src"
},
"include": ["src/**/*"]
}

View file

@ -7,7 +7,7 @@
*/
import { i18n } from '@kbn/i18n';
import { KBN_FIELD_TYPES } from '../../kbn_field_types/types';
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import { FieldFormat } from '../field_format';
import { TextContextTypeConvert, FIELD_FORMAT_IDS } from '../types';
import { asPrettyString } from '../utils';

View file

@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n';
import React from 'react';
import ReactDOM from 'react-dom/server';
import { findLast, cloneDeep, escape } from 'lodash';
import { KBN_FIELD_TYPES } from '../../kbn_field_types/types';
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import { FieldFormat } from '../field_format';
import { HtmlContextTypeConvert, FIELD_FORMAT_IDS } from '../types';
import { asPrettyString } from '../utils';

View file

@ -8,7 +8,7 @@
import { i18n } from '@kbn/i18n';
import moment, { unitOfTime, Duration } from 'moment';
import { KBN_FIELD_TYPES } from '../../kbn_field_types/types';
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import { FieldFormat } from '../field_format';
import { TextContextTypeConvert, FIELD_FORMAT_IDS } from '../types';

View file

@ -7,8 +7,8 @@
*/
import { i18n } from '@kbn/i18n';
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import { FieldFormat } from '../field_format';
import { KBN_FIELD_TYPES } from '../../kbn_field_types/types';
import { TextContextTypeConvert, FIELD_FORMAT_IDS } from '../types';
import { BytesFormat } from './bytes';
import { NumberFormat } from './number';

View file

@ -7,7 +7,7 @@
*/
import { i18n } from '@kbn/i18n';
import { KBN_FIELD_TYPES } from '../../kbn_field_types/types';
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import { FieldFormat } from '../field_format';
import { TextContextTypeConvert, FIELD_FORMAT_IDS } from '../types';

View file

@ -10,7 +10,7 @@
import numeral from '@elastic/numeral';
// @ts-ignore
import numeralLanguages from '@elastic/numeral/languages';
import { KBN_FIELD_TYPES } from '../../kbn_field_types/types';
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import { FieldFormat } from '../field_format';
import { TextContextTypeConvert } from '../types';
import { UI_SETTINGS } from '../../constants';

View file

@ -8,7 +8,7 @@
import { i18n } from '@kbn/i18n';
import moment from 'moment';
import { KBN_FIELD_TYPES } from '../../kbn_field_types/types';
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import { FieldFormat } from '../field_format';
import { TextContextTypeConvert, FIELD_FORMAT_IDS } from '../types';

View file

@ -9,8 +9,8 @@
import React, { Fragment } from 'react';
import ReactDOM from 'react-dom/server';
import { escape, keys } from 'lodash';
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import { shortenDottedString } from '../../utils';
import { KBN_FIELD_TYPES } from '../../kbn_field_types/types';
import { FieldFormat } from '../field_format';
import { TextContextTypeConvert, HtmlContextTypeConvert, FIELD_FORMAT_IDS } from '../types';
import { UI_SETTINGS } from '../../constants';

View file

@ -7,7 +7,7 @@
*/
import { i18n } from '@kbn/i18n';
import { KBN_FIELD_TYPES } from '../../kbn_field_types/types';
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import { FieldFormat } from '../field_format';
import { TextContextTypeConvert, FIELD_FORMAT_IDS } from '../types';

View file

@ -8,8 +8,8 @@
import escape from 'lodash/escape';
import { i18n } from '@kbn/i18n';
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import { asPrettyString, getHighlightHtml } from '../utils';
import { KBN_FIELD_TYPES } from '../../kbn_field_types/types';
import { FieldFormat } from '../field_format';
import { TextContextTypeConvert, FIELD_FORMAT_IDS, HtmlContextTypeConvert } from '../types';
import { shortenDottedString } from '../../utils';

View file

@ -8,7 +8,7 @@
import { i18n } from '@kbn/i18n';
import { truncate } from 'lodash';
import { KBN_FIELD_TYPES } from '../../kbn_field_types/types';
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import { FieldFormat } from '../field_format';
import { TextContextTypeConvert, FIELD_FORMAT_IDS } from '../types';

View file

@ -8,8 +8,8 @@
import { i18n } from '@kbn/i18n';
import { escape, memoize } from 'lodash';
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import { getHighlightHtml } from '../utils';
import { KBN_FIELD_TYPES } from '../../kbn_field_types/types';
import { FieldFormat } from '../field_format';
import {
TextContextTypeConvert,

View file

@ -8,6 +8,7 @@
// eslint-disable-next-line max-classes-per-file
import { forOwn, isFunction, memoize, identity } from 'lodash';
import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '@kbn/field-types';
import {
FieldFormatsGetConfigFn,
@ -20,7 +21,6 @@ import {
import { baseFormatters } from './constants/base_formatters';
import { FieldFormat } from './field_format';
import { FormatFactory } from './utils';
import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '../kbn_field_types/types';
import { UI_SETTINGS } from '../constants';
import { FieldFormatNotFoundError } from '../field_formats';
import { SerializedFieldFormat } from '../../../expressions/common/types';

View file

@ -6,11 +6,43 @@
* Side Public License, v 1.
*/
export { KbnFieldType } from './kbn_field_type';
// NOTE: trick to mark exports as deprecated (only for constants and types, but not for interfaces, classes or enums)
import {
castEsToKbnFieldTypeName as oldCastEsToKbnFieldTypeName,
getFilterableKbnTypeNames as oldGetFilterableKbnTypeNames,
getKbnFieldType as oldGetKbnFieldType,
getKbnTypeNames as oldGetKbnTypeNames,
KbnFieldType,
} from '@kbn/field-types';
/**
* @deprecated Import from the "@kbn/field-types" package directly instead.
* @removeBy 8.0
*/
const castEsToKbnFieldTypeName = oldCastEsToKbnFieldTypeName;
/**
* @deprecated Import from the "@kbn/field-types" package directly instead.
* @removeBy 8.0
*/
const getFilterableKbnTypeNames = oldGetFilterableKbnTypeNames;
/**
* @deprecated Import from the "@kbn/field-types" package directly instead.
* @removeBy 8.0
*/
const getKbnFieldType = oldGetKbnFieldType;
/**
* @deprecated Import from the "@kbn/field-types" package directly instead.
* @removeBy 8.0
*/
const getKbnTypeNames = oldGetKbnTypeNames;
export {
castEsToKbnFieldTypeName,
getKbnFieldType,
getKbnTypeNames,
getFilterableKbnTypeNames,
} from './kbn_field_types';
KbnFieldType,
};

View file

@ -6,80 +6,6 @@
* Side Public License, v 1.
*/
/** @public **/
export interface KbnFieldTypeOptions {
sortable: boolean;
filterable: boolean;
name: string;
esTypes: ES_FIELD_TYPES[];
}
import { KbnFieldTypeOptions, ES_FIELD_TYPES, KBN_FIELD_TYPES } from '@kbn/field-types';
/** @public **/
export enum ES_FIELD_TYPES {
_ID = '_id',
_INDEX = '_index',
_SOURCE = '_source',
_TYPE = '_type',
STRING = 'string',
TEXT = 'text',
KEYWORD = 'keyword',
VERSION = 'version',
BOOLEAN = 'boolean',
OBJECT = 'object',
DATE = 'date',
DATE_NANOS = 'date_nanos',
DATE_RANGE = 'date_range',
GEO_POINT = 'geo_point',
GEO_SHAPE = 'geo_shape',
FLOAT = 'float',
HALF_FLOAT = 'half_float',
SCALED_FLOAT = 'scaled_float',
DOUBLE = 'double',
INTEGER = 'integer',
LONG = 'long',
SHORT = 'short',
UNSIGNED_LONG = 'unsigned_long',
FLOAT_RANGE = 'float_range',
DOUBLE_RANGE = 'double_range',
INTEGER_RANGE = 'integer_range',
LONG_RANGE = 'long_range',
NESTED = 'nested',
BYTE = 'byte',
IP = 'ip',
IP_RANGE = 'ip_range',
ATTACHMENT = 'attachment',
TOKEN_COUNT = 'token_count',
MURMUR3 = 'murmur3',
HISTOGRAM = 'histogram',
}
/** @public **/
export enum KBN_FIELD_TYPES {
_SOURCE = '_source',
ATTACHMENT = 'attachment',
BOOLEAN = 'boolean',
DATE = 'date',
DATE_RANGE = 'date_range',
GEO_POINT = 'geo_point',
GEO_SHAPE = 'geo_shape',
IP = 'ip',
IP_RANGE = 'ip_range',
MURMUR3 = 'murmur3',
NUMBER = 'number',
NUMBER_RANGE = 'number_range',
STRING = 'string',
UNKNOWN = 'unknown',
CONFLICT = 'conflict',
OBJECT = 'object',
NESTED = 'nested',
HISTOGRAM = 'histogram',
MISSING = 'missing',
}
export { KbnFieldTypeOptions, ES_FIELD_TYPES, KBN_FIELD_TYPES };

View file

@ -26,6 +26,7 @@ import { DetailedPeerCertificate } from 'tls';
import { Ensure } from '@kbn/utility-types';
import { EnvironmentMode } from '@kbn/config';
import { ErrorToastOptions } from 'src/core/public/notifications';
import { ES_FIELD_TYPES } from '@kbn/field-types';
import { EsQueryConfig as EsQueryConfig_2 } from '@kbn/es-query';
import { estypes } from '@elastic/elasticsearch';
import { EuiBreadcrumb } from '@elastic/eui';
@ -60,6 +61,7 @@ import { ISearchOptions as ISearchOptions_2 } from 'src/plugins/data/public';
import { ISearchSource as ISearchSource_2 } from 'src/plugins/data/public';
import { IStorageWrapper } from 'src/plugins/kibana_utils/public';
import { IUiSettingsClient } from 'src/core/public';
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import { KibanaClient } from '@elastic/elasticsearch/api/kibana';
import { KibanaExecutionContext } from 'src/core/public';
import { KueryNode as KueryNode_3 } from '@kbn/es-query';
@ -608,8 +610,8 @@ export enum BUCKET_TYPES {
// Warning: (ae-missing-release-tag) "castEsToKbnFieldTypeName" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export const castEsToKbnFieldTypeName: (esType: ES_FIELD_TYPES | string) => KBN_FIELD_TYPES;
// @public @deprecated (undocumented)
export const castEsToKbnFieldTypeName: (esType: string) => import("@kbn/field-types").KBN_FIELD_TYPES;
// Warning: (ae-forgotten-export) The symbol "QuerySetup" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "BaseStateContainer" needs to be exported by the entry point index.d.ts
@ -715,79 +717,7 @@ export class DuplicateIndexPatternError extends Error {
constructor(message: string);
}
// @public (undocumented)
export enum ES_FIELD_TYPES {
// (undocumented)
ATTACHMENT = "attachment",
// (undocumented)
BOOLEAN = "boolean",
// (undocumented)
BYTE = "byte",
// (undocumented)
DATE = "date",
// (undocumented)
DATE_NANOS = "date_nanos",
// (undocumented)
DATE_RANGE = "date_range",
// (undocumented)
DOUBLE = "double",
// (undocumented)
DOUBLE_RANGE = "double_range",
// (undocumented)
FLOAT = "float",
// (undocumented)
FLOAT_RANGE = "float_range",
// (undocumented)
GEO_POINT = "geo_point",
// (undocumented)
GEO_SHAPE = "geo_shape",
// (undocumented)
HALF_FLOAT = "half_float",
// (undocumented)
HISTOGRAM = "histogram",
// (undocumented)
_ID = "_id",
// (undocumented)
_INDEX = "_index",
// (undocumented)
INTEGER = "integer",
// (undocumented)
INTEGER_RANGE = "integer_range",
// (undocumented)
IP = "ip",
// (undocumented)
IP_RANGE = "ip_range",
// (undocumented)
KEYWORD = "keyword",
// (undocumented)
LONG = "long",
// (undocumented)
LONG_RANGE = "long_range",
// (undocumented)
MURMUR3 = "murmur3",
// (undocumented)
NESTED = "nested",
// (undocumented)
OBJECT = "object",
// (undocumented)
SCALED_FLOAT = "scaled_float",
// (undocumented)
SHORT = "short",
// (undocumented)
_SOURCE = "_source",
// (undocumented)
STRING = "string",
// (undocumented)
TEXT = "text",
// (undocumented)
TOKEN_COUNT = "token_count",
// (undocumented)
_TYPE = "_type",
// (undocumented)
UNSIGNED_LONG = "unsigned_long",
// (undocumented)
VERSION = "version"
}
export { ES_FIELD_TYPES }
// Warning: (ae-missing-release-tag) "ES_SEARCH_STRATEGY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@ -1182,7 +1112,7 @@ export function getEsQueryConfig(config: KibanaConfig): EsQueryConfig_2;
// Warning: (ae-missing-release-tag) "getKbnTypeNames" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
// @public @deprecated (undocumented)
export const getKbnTypeNames: () => string[];
// Warning: (ae-forgotten-export) The symbol "ISearchRequestParams" needs to be exported by the entry point index.d.ts
@ -1879,47 +1809,7 @@ export const isQuery: (x: unknown) => x is Query;
// @public (undocumented)
export const isTimeRange: (x: unknown) => x is TimeRange;
// @public (undocumented)
export enum KBN_FIELD_TYPES {
// (undocumented)
ATTACHMENT = "attachment",
// (undocumented)
BOOLEAN = "boolean",
// (undocumented)
CONFLICT = "conflict",
// (undocumented)
DATE = "date",
// (undocumented)
DATE_RANGE = "date_range",
// (undocumented)
GEO_POINT = "geo_point",
// (undocumented)
GEO_SHAPE = "geo_shape",
// (undocumented)
HISTOGRAM = "histogram",
// (undocumented)
IP = "ip",
// (undocumented)
IP_RANGE = "ip_range",
// (undocumented)
MISSING = "missing",
// (undocumented)
MURMUR3 = "murmur3",
// (undocumented)
NESTED = "nested",
// (undocumented)
NUMBER = "number",
// (undocumented)
NUMBER_RANGE = "number_range",
// (undocumented)
OBJECT = "object",
// (undocumented)
_SOURCE = "_source",
// (undocumented)
STRING = "string",
// (undocumented)
UNKNOWN = "unknown"
}
export { KBN_FIELD_TYPES }
// Warning: (ae-missing-release-tag) "KibanaContext" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//

View file

@ -23,6 +23,7 @@ import { ElasticsearchClient as ElasticsearchClient_2 } from 'kibana/server';
import { Ensure } from '@kbn/utility-types';
import { EnvironmentMode } from '@kbn/config';
import { ErrorToastOptions } from 'src/core/public/notifications';
import { ES_FIELD_TYPES } from '@kbn/field-types';
import { EsQueryConfig as EsQueryConfig_2 } from '@kbn/es-query';
import { estypes } from '@elastic/elasticsearch';
import { EventEmitter } from 'events';
@ -43,6 +44,7 @@ import { ISearchOptions as ISearchOptions_2 } from 'src/plugins/data/public';
import { ISearchSource } from 'src/plugins/data/public';
import { IUiSettingsClient } from 'src/core/server';
import { IUiSettingsClient as IUiSettingsClient_3 } from 'kibana/server';
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import { KibanaExecutionContext } from 'src/core/public';
import { KibanaRequest } from 'src/core/server';
import { KibanaRequest as KibanaRequest_2 } from 'kibana/server';
@ -353,8 +355,8 @@ export const buildQueryFromFilters: (filters: Filter_2[] | undefined, indexPatte
// Warning: (ae-missing-release-tag) "castEsToKbnFieldTypeName" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export const castEsToKbnFieldTypeName: (esType: ES_FIELD_TYPES | string) => KBN_FIELD_TYPES;
// @public @deprecated (undocumented)
export const castEsToKbnFieldTypeName: (esType: string) => import("@kbn/field-types").KBN_FIELD_TYPES;
// Warning: (ae-forgotten-export) The symbol "PluginConfigDescriptor" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ConfigSchema" needs to be exported by the entry point index.d.ts
@ -369,79 +371,7 @@ export interface DataRequestHandlerContext extends RequestHandlerContext {
search: SearchRequestHandlerContext;
}
// @public (undocumented)
export enum ES_FIELD_TYPES {
// (undocumented)
ATTACHMENT = "attachment",
// (undocumented)
BOOLEAN = "boolean",
// (undocumented)
BYTE = "byte",
// (undocumented)
DATE = "date",
// (undocumented)
DATE_NANOS = "date_nanos",
// (undocumented)
DATE_RANGE = "date_range",
// (undocumented)
DOUBLE = "double",
// (undocumented)
DOUBLE_RANGE = "double_range",
// (undocumented)
FLOAT = "float",
// (undocumented)
FLOAT_RANGE = "float_range",
// (undocumented)
GEO_POINT = "geo_point",
// (undocumented)
GEO_SHAPE = "geo_shape",
// (undocumented)
HALF_FLOAT = "half_float",
// (undocumented)
HISTOGRAM = "histogram",
// (undocumented)
_ID = "_id",
// (undocumented)
_INDEX = "_index",
// (undocumented)
INTEGER = "integer",
// (undocumented)
INTEGER_RANGE = "integer_range",
// (undocumented)
IP = "ip",
// (undocumented)
IP_RANGE = "ip_range",
// (undocumented)
KEYWORD = "keyword",
// (undocumented)
LONG = "long",
// (undocumented)
LONG_RANGE = "long_range",
// (undocumented)
MURMUR3 = "murmur3",
// (undocumented)
NESTED = "nested",
// (undocumented)
OBJECT = "object",
// (undocumented)
SCALED_FLOAT = "scaled_float",
// (undocumented)
SHORT = "short",
// (undocumented)
_SOURCE = "_source",
// (undocumented)
STRING = "string",
// (undocumented)
TEXT = "text",
// (undocumented)
TOKEN_COUNT = "token_count",
// (undocumented)
_TYPE = "_type",
// (undocumented)
UNSIGNED_LONG = "unsigned_long",
// (undocumented)
VERSION = "version"
}
export { ES_FIELD_TYPES }
// Warning: (ae-missing-release-tag) "ES_SEARCH_STRATEGY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@ -1085,47 +1015,7 @@ export interface ISearchStrategy<SearchStrategyRequest extends IKibanaSearchRequ
search: (request: SearchStrategyRequest, options: ISearchOptions, deps: SearchStrategyDependencies) => Observable<SearchStrategyResponse>;
}
// @public (undocumented)
export enum KBN_FIELD_TYPES {
// (undocumented)
ATTACHMENT = "attachment",
// (undocumented)
BOOLEAN = "boolean",
// (undocumented)
CONFLICT = "conflict",
// (undocumented)
DATE = "date",
// (undocumented)
DATE_RANGE = "date_range",
// (undocumented)
GEO_POINT = "geo_point",
// (undocumented)
GEO_SHAPE = "geo_shape",
// (undocumented)
HISTOGRAM = "histogram",
// (undocumented)
IP = "ip",
// (undocumented)
IP_RANGE = "ip_range",
// (undocumented)
MISSING = "missing",
// (undocumented)
MURMUR3 = "murmur3",
// (undocumented)
NESTED = "nested",
// (undocumented)
NUMBER = "number",
// (undocumented)
NUMBER_RANGE = "number_range",
// (undocumented)
OBJECT = "object",
// (undocumented)
_SOURCE = "_source",
// (undocumented)
STRING = "string",
// (undocumented)
UNKNOWN = "unknown"
}
export { KBN_FIELD_TYPES }
// Warning: (ae-missing-release-tag) "KibanaContext" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//

View file

@ -2798,6 +2798,10 @@
version "0.0.0"
uid ""
"@kbn/field-types@link:bazel-bin/packages/kbn-field-types":
version "0.0.0"
uid ""
"@kbn/i18n@link:bazel-bin/packages/kbn-i18n":
version "0.0.0"
uid ""