diff --git a/common/functions/alterColumn/alterColumn.js b/common/functions/alterColumn.js similarity index 100% rename from common/functions/alterColumn/alterColumn.js rename to common/functions/alterColumn.js diff --git a/common/functions/compare/compare.js b/common/functions/compare.js similarity index 100% rename from common/functions/compare/compare.js rename to common/functions/compare.js diff --git a/common/functions/containerStyle/containerStyle.js b/common/functions/containerStyle.js similarity index 100% rename from common/functions/containerStyle/containerStyle.js rename to common/functions/containerStyle.js diff --git a/common/functions/date/date.js b/common/functions/date.js similarity index 100% rename from common/functions/date/date.js rename to common/functions/date.js diff --git a/common/functions/exactly/exactly.js b/common/functions/exactly.js similarity index 100% rename from common/functions/exactly/exactly.js rename to common/functions/exactly.js diff --git a/common/functions/font/font.js b/common/functions/font.js similarity index 100% rename from common/functions/font/font.js rename to common/functions/font.js diff --git a/common/functions/grid/grid.js b/common/functions/grid.js similarity index 100% rename from common/functions/grid/grid.js rename to common/functions/grid.js diff --git a/common/functions/head/head.js b/common/functions/head.js similarity index 100% rename from common/functions/head/head.js rename to common/functions/head.js diff --git a/common/functions/if/if.js b/common/functions/if.js similarity index 100% rename from common/functions/if/if.js rename to common/functions/if.js diff --git a/common/functions/image/index.js b/common/functions/image/index.js new file mode 100644 index 00000000000000..cc8850ec74ce99 --- /dev/null +++ b/common/functions/image/index.js @@ -0,0 +1 @@ +export { image } from './image'; diff --git a/common/functions/index.js b/common/functions/index.js index a6b9c1695886f2..57a6d27f5b8947 100644 --- a/common/functions/index.js +++ b/common/functions/index.js @@ -1,30 +1,30 @@ -import { alterColumn } from './alterColumn/alterColumn'; -import { compare } from './compare/compare'; -import { containerStyle } from './containerStyle/containerStyle'; -import { date } from './date/date'; -import { exactly } from './exactly/exactly'; -import { font } from './font/font'; -import { grid } from './grid/grid'; -import { head } from './head/head'; -import { ifFn } from './if/if'; -import { image } from './image/image'; -import { jsonquery } from './jsonquery/jsonquery'; -import { mapColumn } from './mapColumn/mapColumn'; -import { markdown } from './markdown/markdown'; -import { math } from './math/math'; -import { palette } from './palette/palette'; -import { pie } from './pie/pie'; -import { plot } from './plot/plot'; -import { render } from './render/render'; -import { replace } from './replace/replace'; -import { rounddate } from './rounddate/rounddate'; -import { seriesStyle } from './seriesStyle/seriesStyle'; -import { sleep } from './sleep/sleep'; -import { sort } from './sort/sort'; -import { table } from './table/table'; -import { tail } from './tail/tail'; -import { timefilter } from './timefilter/timefilter'; -import { timefilterControl } from './timefilterControl/timefilterControl'; +import { alterColumn } from './alterColumn'; +import { compare } from './compare'; +import { containerStyle } from './containerStyle'; +import { date } from './date'; +import { exactly } from './exactly'; +import { font } from './font'; +import { grid } from './grid'; +import { head } from './head'; +import { ifFn } from './if'; +import { image } from './image'; +import { jsonquery } from './jsonquery'; +import { mapColumn } from './mapColumn'; +import { markdown } from './markdown'; +import { math } from './math'; +import { palette } from './palette'; +import { pie } from './pie'; +import { plot } from './plot'; +import { render } from './render'; +import { replace } from './replace'; +import { rounddate } from './rounddate'; +import { seriesStyle } from './seriesStyle'; +import { sleep } from './sleep'; +import { sort } from './sort'; +import { table } from './table'; +import { tail } from './tail'; +import { timefilter } from './timefilter'; +import { timefilterControl } from './timefilterControl'; export const commonFunctions = [ alterColumn, diff --git a/common/functions/jsonquery/jsonquery.js b/common/functions/jsonquery.js similarity index 100% rename from common/functions/jsonquery/jsonquery.js rename to common/functions/jsonquery.js diff --git a/common/functions/mapColumn/mapColumn.js b/common/functions/mapColumn.js similarity index 100% rename from common/functions/mapColumn/mapColumn.js rename to common/functions/mapColumn.js diff --git a/common/functions/markdown/markdown.js b/common/functions/markdown.js similarity index 94% rename from common/functions/markdown/markdown.js rename to common/functions/markdown.js index e61cc478902b4c..1cecaaeb9b0d2e 100644 --- a/common/functions/markdown/markdown.js +++ b/common/functions/markdown.js @@ -1,4 +1,4 @@ -import { Handlebars } from '../../lib/handlebars.js'; +import { Handlebars } from '../lib/handlebars.js'; export const markdown = { name: 'markdown', diff --git a/common/functions/math/math.js b/common/functions/math.js similarity index 88% rename from common/functions/math/math.js rename to common/functions/math.js index c8d974b0dbb39b..76b2df0eb95187 100644 --- a/common/functions/math/math.js +++ b/common/functions/math.js @@ -1,6 +1,6 @@ import { map } from 'lodash'; -import { math as mathjs } from '../../lib/math.js'; -import { pivotObjectArray } from '../../lib/pivot_object_array.js'; +import { math as mathjs } from '../lib/math.js'; +import { pivotObjectArray } from '../lib/pivot_object_array.js'; export const math = { name: 'math', diff --git a/common/functions/palette/palette.js b/common/functions/palette.js similarity index 93% rename from common/functions/palette/palette.js rename to common/functions/palette.js index 1ab7caad645a88..7c959412c1211d 100644 --- a/common/functions/palette/palette.js +++ b/common/functions/palette.js @@ -1,4 +1,4 @@ -import { palettes } from '../../lib/palettes'; +import { palettes } from '../lib/palettes'; export const palette = { name: 'palette', aliases: [], diff --git a/common/functions/pie/pie.js b/common/functions/pie.js similarity index 100% rename from common/functions/pie/pie.js rename to common/functions/pie.js diff --git a/common/functions/plot/plot.js b/common/functions/plot.js similarity index 100% rename from common/functions/plot/plot.js rename to common/functions/plot.js diff --git a/common/functions/render/render.js b/common/functions/render.js similarity index 100% rename from common/functions/render/render.js rename to common/functions/render.js diff --git a/common/functions/replace/replace.js b/common/functions/replace.js similarity index 100% rename from common/functions/replace/replace.js rename to common/functions/replace.js diff --git a/common/functions/rounddate/rounddate.js b/common/functions/rounddate.js similarity index 100% rename from common/functions/rounddate/rounddate.js rename to common/functions/rounddate.js diff --git a/common/functions/seriesStyle/seriesStyle.js b/common/functions/seriesStyle.js similarity index 100% rename from common/functions/seriesStyle/seriesStyle.js rename to common/functions/seriesStyle.js diff --git a/common/functions/sleep/sleep.js b/common/functions/sleep.js similarity index 100% rename from common/functions/sleep/sleep.js rename to common/functions/sleep.js diff --git a/common/functions/sort/sort.js b/common/functions/sort.js similarity index 100% rename from common/functions/sort/sort.js rename to common/functions/sort.js diff --git a/common/functions/table/table.js b/common/functions/table.js similarity index 100% rename from common/functions/table/table.js rename to common/functions/table.js diff --git a/common/functions/tail/tail.js b/common/functions/tail.js similarity index 100% rename from common/functions/tail/tail.js rename to common/functions/tail.js diff --git a/common/functions/timefilter/timefilter.js b/common/functions/timefilter.js similarity index 100% rename from common/functions/timefilter/timefilter.js rename to common/functions/timefilter.js diff --git a/common/functions/timefilterControl/timefilterControl.js b/common/functions/timefilterControl.js similarity index 100% rename from common/functions/timefilterControl/timefilterControl.js rename to common/functions/timefilterControl.js diff --git a/common/functions/to/to.js b/common/functions/to.js similarity index 92% rename from common/functions/to/to.js rename to common/functions/to.js index a5e0c1487cde8e..0eb8f5d38a3341 100644 --- a/common/functions/to/to.js +++ b/common/functions/to.js @@ -3,7 +3,7 @@ it needs access to types and the registry of types is, obviously, different between the environments */ -import { castProvider } from '../../interpreter/cast'; +import { castProvider } from '../interpreter/cast'; export function toProvider(types) { return { diff --git a/common/interpreter/cast.js b/common/interpreter/cast.js index ec4fcb2c0f4076..d6aec10f67201b 100644 --- a/common/interpreter/cast.js +++ b/common/interpreter/cast.js @@ -1,5 +1,5 @@ import _ from 'lodash'; -import { getType } from '../types/get_type'; +import { getType } from '../lib/get_type'; export function castProvider(types) { return function cast(node, toTypeNames) { diff --git a/common/interpreter/interpret.js b/common/interpreter/interpret.js index 8c5491b1e60a77..8c209182ac9263 100644 --- a/common/interpreter/interpret.js +++ b/common/interpreter/interpret.js @@ -1,8 +1,8 @@ import { clone, each, keys, last, map, mapValues, values, zipObject, omitBy } from 'lodash'; import { castProvider } from './cast'; -import { getType } from '../types/get_type'; +import { getType } from '../lib/get_type'; import { fromExpression } from '../lib/ast'; -import { typesRegistry } from '../lib/types'; +import { typesRegistry } from '../lib/types_registry'; export function interpretProvider(config) { const cast = castProvider(config.types); diff --git a/common/lib/__tests__/ast.fromExpression.js b/common/lib/__tests__/ast.fromExpression.js index b1dc7613412df8..f4a45cef9d4056 100644 --- a/common/lib/__tests__/ast.fromExpression.js +++ b/common/lib/__tests__/ast.fromExpression.js @@ -1,6 +1,6 @@ import expect from 'expect.js'; import { fromExpression } from '../ast'; -import { getType } from '../../types/get_type'; +import { getType } from '../../lib/get_type'; describe('ast fromExpression', () => { describe('invalid expression', () => { diff --git a/common/lib/ast.js b/common/lib/ast.js index 08c9c5c9594e22..ee15b2452acf80 100644 --- a/common/lib/ast.js +++ b/common/lib/ast.js @@ -1,5 +1,5 @@ import { parse } from './grammar'; -import { getType } from '../types/get_type'; +import { getType } from '../lib/get_type'; function getArgumentString(arg, argKey) { const type = getType(arg); diff --git a/common/lib/functions.js b/common/lib/functions_registry.js similarity index 100% rename from common/lib/functions.js rename to common/lib/functions_registry.js diff --git a/common/types/get_type.js b/common/lib/get_type.js similarity index 100% rename from common/types/get_type.js rename to common/lib/get_type.js diff --git a/common/lib/types.js b/common/lib/types_registry.js similarity index 100% rename from common/lib/types.js rename to common/lib/types_registry.js diff --git a/common/types/boolean/index.js b/common/types/boolean.js similarity index 100% rename from common/types/boolean/index.js rename to common/types/boolean.js diff --git a/common/types/datatable/index.js b/common/types/datatable.js similarity index 100% rename from common/types/datatable/index.js rename to common/types/datatable.js diff --git a/common/types/dataurl/index.js b/common/types/dataurl.js similarity index 93% rename from common/types/dataurl/index.js rename to common/types/dataurl.js index a2bfe171f165a0..247107b13558df 100644 --- a/common/types/dataurl/index.js +++ b/common/types/dataurl.js @@ -1,4 +1,4 @@ -import { parse } from '../../lib/dataurl'; +import { parse } from '../lib/dataurl'; export const dataurl = { name: 'dataurl', diff --git a/common/types/filter/index.js b/common/types/filter.js similarity index 100% rename from common/types/filter/index.js rename to common/types/filter.js diff --git a/common/types/image/index.js b/common/types/image.js similarity index 100% rename from common/types/image/index.js rename to common/types/image.js diff --git a/common/types/location/index.js b/common/types/location.js similarity index 100% rename from common/types/location/index.js rename to common/types/location.js diff --git a/common/types/number/index.js b/common/types/number.js similarity index 100% rename from common/types/number/index.js rename to common/types/number.js diff --git a/common/types/pointseries/index.js b/common/types/pointseries.js similarity index 90% rename from common/types/pointseries/index.js rename to common/types/pointseries.js index c95979b3a6b07d..46752955ba6c10 100644 --- a/common/types/pointseries/index.js +++ b/common/types/pointseries.js @@ -1,4 +1,4 @@ -import { datatable } from '../datatable'; +import { datatable } from './datatable'; export const pointseries = { name: 'pointseries', diff --git a/common/types/render/index.js b/common/types/render.js similarity index 100% rename from common/types/render/index.js rename to common/types/render.js diff --git a/common/types/string/index.js b/common/types/string.js similarity index 100% rename from common/types/string/index.js rename to common/types/string.js diff --git a/common/types/style/index.js b/common/types/style.js similarity index 100% rename from common/types/style/index.js rename to common/types/style.js diff --git a/common/types/type.js b/common/types/type.js index c7db99bedba5e7..192329744275cd 100644 --- a/common/types/type.js +++ b/common/types/type.js @@ -1,6 +1,6 @@ // All types must be universal and be castable on the client or on the server import { intersection, keys, constant } from 'lodash'; -import { getType } from './get_type'; +import { getType } from '../lib/get_type'; // TODO: Currently all casting functions must be syncronous. diff --git a/index.js b/index.js index 4c3b9c9fb8c75a..61edd66cc076af 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ import init from './init'; -import { functionsRegistry } from './common/lib/functions'; +import { functionsRegistry } from './common/lib/functions_registry'; export default function (kibana) { return new kibana.Plugin({ diff --git a/init.js b/init.js index adb423ae953d7e..ed3c3eea744bc7 100644 --- a/init.js +++ b/init.js @@ -1,13 +1,11 @@ import { routes } from './server/routes'; -import { functionsRegistry } from './common/lib/functions'; +import { functionsRegistry } from './common/lib/functions_registry'; +import { typesRegistry } from './common/lib/types_registry'; import { serverFunctions } from './server/functions'; import { createIndices } from './server/lib/create_indices'; - import { commonFunctions } from './common/functions'; import { typeSpecs } from './common/types'; -import { typesRegistry } from './common/lib/types'; - export default function (server, /*options*/) { server.plugins.canvas = { kibanaType: 'canvas_1', diff --git a/public/components/element_wrapper/element_content.js b/public/components/element_wrapper/element_content.js index 473e9cf7dee850..1d919f18e674c6 100644 --- a/public/components/element_wrapper/element_content.js +++ b/public/components/element_wrapper/element_content.js @@ -14,7 +14,7 @@ import { Loading } from '../loading'; import { pure, compose, branch, renderComponent } from 'recompose'; import { RenderElement } from '../render_element'; import Style from 'style-it'; -import { getType } from '../../../common/types/get_type'; +import { getType } from '../../../common/lib/get_type'; /* Branches diff --git a/public/components/element_wrapper/index.js b/public/components/element_wrapper/index.js index 0b2c582790b2c5..ddc2406d6daeda 100644 --- a/public/components/element_wrapper/index.js +++ b/public/components/element_wrapper/index.js @@ -12,7 +12,7 @@ import { getSelectedPage, } from '../../state/selectors/workpad'; import { getState, getValue, getError } from '../../lib/resolved_arg'; -import { elementsRegistry } from '../../lib/elements'; +import { elementsRegistry } from '../../lib/elements_registry'; import { createHandlers } from './lib/handlers'; const mapStateToProps = (state, { element }) => ({ diff --git a/public/components/toolbar/element_types/index.js b/public/components/toolbar/element_types/index.js index f43310b05e8afa..ed52ee359e6cde 100644 --- a/public/components/toolbar/element_types/index.js +++ b/public/components/toolbar/element_types/index.js @@ -1,5 +1,5 @@ import { pure, compose, withProps, withState } from 'recompose'; -import { elementsRegistry } from '../../../lib/elements'; +import { elementsRegistry } from '../../../lib/elements_registry'; import { ElementTypes as Component } from './element_types'; diff --git a/public/elements/advanced_filter/index.js b/public/elements/advanced_filter/index.js new file mode 100644 index 00000000000000..714d1d353d0ec9 --- /dev/null +++ b/public/elements/advanced_filter/index.js @@ -0,0 +1 @@ +export { advancedFilter } from './advanced_filter'; diff --git a/public/elements/debug/index.js b/public/elements/debug/index.js new file mode 100644 index 00000000000000..dceb6d5ea63165 --- /dev/null +++ b/public/elements/debug/index.js @@ -0,0 +1 @@ +export { debug } from './debug'; diff --git a/public/elements/grid/index.js b/public/elements/grid/index.js new file mode 100644 index 00000000000000..6a5829b9fd8fed --- /dev/null +++ b/public/elements/grid/index.js @@ -0,0 +1 @@ +export { grid } from './grid'; diff --git a/public/elements/image/index.js b/public/elements/image/index.js new file mode 100644 index 00000000000000..cc8850ec74ce99 --- /dev/null +++ b/public/elements/image/index.js @@ -0,0 +1 @@ +export { image } from './image'; diff --git a/public/elements/index.js b/public/elements/index.js index f20e1477521f13..0ba39443f2478e 100644 --- a/public/elements/index.js +++ b/public/elements/index.js @@ -1,12 +1,12 @@ -import { advancedFilter } from './advanced_filter/advanced_filter'; -import { debug } from './debug/debug'; -import { grid } from './grid/grid'; -import { image } from './image/image'; -import { markdown } from './markdown/markdown'; -import { pie } from './pie/pie'; -import { plot } from './plot/plot'; -import { table } from './table/table'; -import { timeFilter } from './time_filter/time_filter'; +import { advancedFilter } from './advanced_filter'; +import { debug } from './debug'; +import { grid } from './grid'; +import { image } from './image'; +import { markdown } from './markdown'; +import { pie } from './pie'; +import { plot } from './plot'; +import { table } from './table'; +import { timeFilter } from './time_filter'; export const elementSpecs = [ advancedFilter, diff --git a/public/elements/markdown/index.js b/public/elements/markdown/index.js new file mode 100644 index 00000000000000..c50541fb64829d --- /dev/null +++ b/public/elements/markdown/index.js @@ -0,0 +1 @@ +export { markdown } from './markdown'; diff --git a/public/elements/pie/index.js b/public/elements/pie/index.js new file mode 100644 index 00000000000000..32f01e06e0c40e --- /dev/null +++ b/public/elements/pie/index.js @@ -0,0 +1 @@ +export { pie } from './pie'; diff --git a/public/elements/plot/index.js b/public/elements/plot/index.js new file mode 100644 index 00000000000000..cc0fc03b34ad3e --- /dev/null +++ b/public/elements/plot/index.js @@ -0,0 +1 @@ +export { plot } from './plot'; diff --git a/public/elements/table/index.js b/public/elements/table/index.js new file mode 100644 index 00000000000000..69e7563992f39f --- /dev/null +++ b/public/elements/table/index.js @@ -0,0 +1 @@ +export { table } from './table'; diff --git a/public/elements/time_filter/index.js b/public/elements/time_filter/index.js new file mode 100644 index 00000000000000..1b4c1725cbcbc2 --- /dev/null +++ b/public/elements/time_filter/index.js @@ -0,0 +1 @@ +export { timeFilter } from './time_filter'; diff --git a/public/expression_types/arg_types/datacolumn/datacolumn.js b/public/expression_types/arg_types/datacolumn/datacolumn.js index 999d9ef92ef300..3f9a719d1a422c 100644 --- a/public/expression_types/arg_types/datacolumn/datacolumn.js +++ b/public/expression_types/arg_types/datacolumn/datacolumn.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import { sortBy } from 'lodash'; import { FormControl } from 'react-bootstrap'; import { SimpleMathFunction } from './simple_math_function'; -import { getType } from '../../../../common/types/get_type'; +import { getType } from '../../../../common/lib/get_type'; import { parse } from 'mathjs'; import './datacolumn.less'; diff --git a/public/expression_types/arg_types/palette.js b/public/expression_types/arg_types/palette.js index d68717615417a9..dac91d509d7ca8 100644 --- a/public/expression_types/arg_types/palette.js +++ b/public/expression_types/arg_types/palette.js @@ -2,7 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { get } from 'lodash'; import { PalettePicker } from '../../components/palette_picker'; -import { getType } from '../../../common/types/get_type'; +import { getType } from '../../../common/lib/get_type'; const template = ({ onValueChange, argValue, renderError }) => { // Why is this neccesary? Does the dialog really need to know what parameter it is setting? diff --git a/public/functions/asset/asset.js b/public/functions/asset.js similarity index 82% rename from public/functions/asset/asset.js rename to public/functions/asset.js index 6073b57ce8ca2c..791f8c908e5455 100644 --- a/public/functions/asset/asset.js +++ b/public/functions/asset.js @@ -1,5 +1,5 @@ -import { getState } from '../../state/store'; -import { getAssetById } from '../../state/selectors/assets'; +import { getState } from '../state/store'; +import { getAssetById } from '../state/selectors/assets'; export const asset = { name: 'asset', diff --git a/public/functions/filters/filters.js b/public/functions/filters.js similarity index 65% rename from public/functions/filters/filters.js rename to public/functions/filters.js index ed3d953ca97fc2..763c2152b8806c 100644 --- a/public/functions/filters/filters.js +++ b/public/functions/filters.js @@ -1,8 +1,8 @@ -import { fromExpression } from '../../../common/lib/ast'; -import { typesRegistry } from '../../../common/lib/types'; -import { getState } from '../../state/store'; -import { getGlobalFilterExpression } from '../../state/selectors/workpad'; -import { interpretAst } from '../../lib/interpreter'; +import { fromExpression } from '../../common/lib/ast'; +import { typesRegistry } from '../../common/lib/types_registry'; +import { getState } from '../state/store'; +import { getGlobalFilterExpression } from '../state/selectors/workpad'; +import { interpretAst } from '../lib/interpreter'; export const filters = { name: 'filters', diff --git a/public/functions/geoip/geoip.js b/public/functions/geoip.js similarity index 100% rename from public/functions/geoip/geoip.js rename to public/functions/geoip.js diff --git a/public/functions/index.js b/public/functions/index.js index b42a9ea3cdf612..181a6929faea35 100644 --- a/public/functions/index.js +++ b/public/functions/index.js @@ -1,9 +1,9 @@ -import { asset } from './asset/asset'; -import { filters } from './filters/filters'; -import { geoip } from './geoip/geoip'; -import { location } from './location/location'; -import { toFn } from './to/to'; -import { urlparam } from './urlparam/urlparam'; +import { asset } from './asset'; +import { filters } from './filters'; +import { geoip } from './geoip'; +import { location } from './location'; +import { toFn } from './to'; +import { urlparam } from './urlparam'; export const clientFunctions = [ geoip, diff --git a/public/functions/location/location.js b/public/functions/location.js similarity index 100% rename from public/functions/location/location.js rename to public/functions/location.js diff --git a/public/functions/to.js b/public/functions/to.js new file mode 100644 index 00000000000000..2cc53222b17549 --- /dev/null +++ b/public/functions/to.js @@ -0,0 +1,4 @@ +import { toProvider } from '../../common/functions/to'; +import { typesRegistry } from '../../common/lib/types_registry'; + +export const toFn = toProvider(typesRegistry); diff --git a/public/functions/to/to.js b/public/functions/to/to.js deleted file mode 100644 index 479fc485f1cc99..00000000000000 --- a/public/functions/to/to.js +++ /dev/null @@ -1,4 +0,0 @@ -import { toProvider } from '../../../common/functions/to/to'; -import { typesRegistry } from '../../../common/lib/types'; - -export const toFn = toProvider(typesRegistry); diff --git a/public/functions/urlparam/urlparam.js b/public/functions/urlparam.js similarity index 100% rename from public/functions/urlparam/urlparam.js rename to public/functions/urlparam.js diff --git a/public/lib/arg_helpers.js b/public/lib/arg_helpers.js index e35a44499ff757..3b92cffc7c7d44 100644 --- a/public/lib/arg_helpers.js +++ b/public/lib/arg_helpers.js @@ -1,5 +1,5 @@ import { isArray, includes } from 'lodash'; -import { getType } from '../../common/types/get_type'; +import { getType } from '../../common/lib/get_type'; /* diff --git a/public/lib/elements.js b/public/lib/elements_registry.js similarity index 100% rename from public/lib/elements.js rename to public/lib/elements_registry.js diff --git a/public/lib/functions.js b/public/lib/functions_registry.js similarity index 51% rename from public/lib/functions.js rename to public/lib/functions_registry.js index 22f34b0c6aca81..b6098e0e57b7d2 100644 --- a/public/lib/functions.js +++ b/public/lib/functions_registry.js @@ -1,2 +1,2 @@ // export the common registry here, so it's available in plugin public code -export { functionsRegistry } from '../../common/lib/functions'; +export { functionsRegistry } from '../../common/lib/functions_registry'; diff --git a/public/lib/interpreter.js b/public/lib/interpreter.js index 9d239dbffe74e2..7994515d12c405 100644 --- a/public/lib/interpreter.js +++ b/public/lib/interpreter.js @@ -1,8 +1,8 @@ import { socketInterpreterProvider } from '../../common/interpreter/socket_interpret'; -import { typesRegistry } from '../../common/lib/types'; import { socket } from '../socket'; -import { functionsRegistry } from './functions'; import { createHandlers } from './create_handlers'; +import { typesRegistry } from '../../common/lib/types_registry'; +import { functionsRegistry } from './functions_registry'; // Create the function list socket.emit('getFunctionList'); diff --git a/public/lib/load_elements.js b/public/lib/load_elements.js index 580dc768e6a859..3a866d89b3027a 100644 --- a/public/lib/load_elements.js +++ b/public/lib/load_elements.js @@ -1,4 +1,4 @@ -import { elementsRegistry } from './elements'; +import { elementsRegistry } from './elements_registry'; import { elementSpecs } from '../elements'; elementSpecs.forEach(elDef => elementsRegistry.register(elDef)); diff --git a/public/lib/load_functions.js b/public/lib/load_functions.js index 934f2015efc331..ca24a5b1641aa1 100644 --- a/public/lib/load_functions.js +++ b/public/lib/load_functions.js @@ -1,4 +1,4 @@ -import { functionsRegistry } from '../../common/lib/functions'; +import { functionsRegistry } from '../../common/lib/functions_registry'; import { commonFunctions } from '../../common/functions'; import { clientFunctions } from '../functions'; diff --git a/public/lib/load_types.js b/public/lib/load_types.js index 0dbfa0bbc70c77..c4fcfbe69c9570 100644 --- a/public/lib/load_types.js +++ b/public/lib/load_types.js @@ -1,4 +1,4 @@ -import { typesRegistry } from '../../common/lib/types'; +import { typesRegistry } from '../../common/lib/types_registry'; import { typeSpecs } from '../../common/types'; typeSpecs.forEach(typeDef => typesRegistry.register(typeDef)); diff --git a/public/socket.js b/public/socket.js index 19a15bfc076566..130fdd39c8b28e 100644 --- a/public/socket.js +++ b/public/socket.js @@ -1,7 +1,7 @@ import { map } from 'lodash'; import io from 'socket.io-client'; import chrome from 'ui/chrome'; -import { functionsRegistry } from '../common/lib/functions'; +import { functionsRegistry } from '../common/lib/functions_registry'; const basePath = chrome.getBasePath(); export const socket = io(undefined, { path: `${basePath}/socket.io` }); diff --git a/public/state/actions/elements.js b/public/state/actions/elements.js index c3a45487d6e86c..e21ddb9827f623 100644 --- a/public/state/actions/elements.js +++ b/public/state/actions/elements.js @@ -6,7 +6,7 @@ import * as args from './resolved_args'; import { getPages, getElementById } from '../selectors/workpad'; import { getValue } from '../selectors/resolved_args'; import { getDefaultElement } from '../defaults'; -import { getType } from '../../../common/types/get_type'; +import { getType } from '../../../common/lib/get_type'; import { fromExpression, toExpression, safeElementFromExpression } from '../../../common/lib/ast'; import { interpretAst } from '../../lib/interpreter'; import { notify } from '../../lib/notify'; diff --git a/public/state/store_service.js b/public/state/store_service.js index 16a8884fe2d79d..3d1ad16d67b114 100644 --- a/public/state/store_service.js +++ b/public/state/store_service.js @@ -1,10 +1,10 @@ +import { uniqBy } from 'lodash'; import { uiModules } from 'ui/modules'; -import { historyProvider } from '../lib/history_provider'; import { onStart } from './on_start'; -import { uniqBy } from 'lodash'; -import { functionsRegistry } from '../../common/lib/functions'; import { getInitialState } from './initial_state'; import { setStore } from './store'; +import { historyProvider } from '../lib/history_provider'; +import { functionsRegistry } from '../../common/lib/functions_registry'; const app = uiModules.get('apps/canvas'); diff --git a/server/functions/demodata/index.js b/server/functions/demodata/index.js new file mode 100644 index 00000000000000..8f21884f27de43 --- /dev/null +++ b/server/functions/demodata/index.js @@ -0,0 +1 @@ +export { demodata } from './demodata'; diff --git a/server/functions/demoprices/index.js b/server/functions/demoprices/index.js new file mode 100644 index 00000000000000..bc2c344ad1247c --- /dev/null +++ b/server/functions/demoprices/index.js @@ -0,0 +1 @@ +export { demoprices } from './demoprices'; diff --git a/server/functions/escount/escount.js b/server/functions/escount.js similarity index 93% rename from server/functions/escount/escount.js rename to server/functions/escount.js index c0afee096f79b6..d1683819b063ba 100644 --- a/server/functions/escount/escount.js +++ b/server/functions/escount.js @@ -1,4 +1,4 @@ -import { buildESRequest } from '../esdocs/lib/build_es_request'; +import { buildESRequest } from './esdocs/lib/build_es_request'; export const escount = { name: 'escount', diff --git a/server/functions/esdocs/index.js b/server/functions/esdocs/index.js new file mode 100644 index 00000000000000..07527fcf01f840 --- /dev/null +++ b/server/functions/esdocs/index.js @@ -0,0 +1 @@ +export { esdocs } from './esdocs'; diff --git a/server/functions/index.js b/server/functions/index.js index a4d7156cfef115..299094f97d9cb0 100644 --- a/server/functions/index.js +++ b/server/functions/index.js @@ -1,10 +1,10 @@ -import { demodata } from './demodata/demodata'; -import { demoprices } from './demoprices/demoprices'; -import { escount } from './escount/escount'; -import { esdocs } from './esdocs/esdocs'; -import { pointseries } from './pointseries/pointseries'; -import { timelion } from './timelion/timelion'; -import { toFn } from './to/to'; +import { demodata } from './demodata'; +import { demoprices } from './demoprices'; +import { escount } from './escount'; +import { esdocs } from './esdocs'; +import { pointseries } from './pointseries'; +import { timelion } from './timelion'; +import { toFn } from './to'; export const serverFunctions = [ esdocs, diff --git a/server/functions/pointseries/pointseries.js b/server/functions/pointseries.js similarity index 96% rename from server/functions/pointseries/pointseries.js rename to server/functions/pointseries.js index aa8fc5d24ba9a6..f5a39a11c8d346 100644 --- a/server/functions/pointseries/pointseries.js +++ b/server/functions/pointseries.js @@ -1,10 +1,10 @@ // TODO: pointseries performs poorly, that's why we run it on the server. -import { math } from '../../../common/lib/math.js'; +import { math } from '../../common/lib/math.js'; import moment from 'moment'; import { groupBy, zipObject, uniqBy, omit, pickBy, find, uniq, map, mapValues } from 'lodash'; -import { findInObject } from '../../../common/lib/find_in_object'; -import { pivotObjectArray } from '../../../common/lib/pivot_object_array.js'; +import { findInObject } from '../../common/lib/find_in_object'; +import { pivotObjectArray } from '../../common/lib/pivot_object_array.js'; function isColumnReference(mathExpression) { const parsedMath = math.parse(mathExpression); diff --git a/server/functions/timelion/timelion.js b/server/functions/timelion.js similarity index 97% rename from server/functions/timelion/timelion.js rename to server/functions/timelion.js index ea1867622100ee..41705dc5f071a1 100644 --- a/server/functions/timelion/timelion.js +++ b/server/functions/timelion.js @@ -1,7 +1,7 @@ //import { buildESRequest } from '../esdocs/lib/build_es_request'; import fetch from 'axios'; import { flatten, find } from 'lodash'; -import { buildBoolArray } from '../esdocs/lib/build_bool_array'; +import { buildBoolArray } from './esdocs/lib/build_bool_array'; export const timelion = { name: 'timelion', diff --git a/server/functions/to.js b/server/functions/to.js new file mode 100644 index 00000000000000..2cc53222b17549 --- /dev/null +++ b/server/functions/to.js @@ -0,0 +1,4 @@ +import { toProvider } from '../../common/functions/to'; +import { typesRegistry } from '../../common/lib/types_registry'; + +export const toFn = toProvider(typesRegistry); diff --git a/server/functions/to/to.js b/server/functions/to/to.js deleted file mode 100644 index 479fc485f1cc99..00000000000000 --- a/server/functions/to/to.js +++ /dev/null @@ -1,4 +0,0 @@ -import { toProvider } from '../../../common/functions/to/to'; -import { typesRegistry } from '../../../common/lib/types'; - -export const toFn = toProvider(typesRegistry); diff --git a/server/routes/socket.js b/server/routes/socket.js index 73fa57bd44ecd3..9320bcf9c7ba3d 100644 --- a/server/routes/socket.js +++ b/server/routes/socket.js @@ -1,9 +1,9 @@ import { map } from 'lodash'; import socket from 'socket.io'; -import { functionsRegistry } from '../../common/lib/functions'; -import { socketInterpreterProvider } from '../../common/interpreter/socket_interpret'; -import { typesRegistry } from '../../common/lib/types'; import { createHandlers } from '../lib/create_handlers'; +import { socketInterpreterProvider } from '../../common/interpreter/socket_interpret'; +import { functionsRegistry } from '../../common/lib/functions_registry'; +import { typesRegistry } from '../../common/lib/types_registry'; export function socketApi(server) { const io = socket(server.listener);