Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
25e26ee
creating package and plugin
ppisljar Sep 25, 2018
6c7c9af
moving files
ppisljar Sep 25, 2018
bb1eee5
updating indexes
ppisljar Sep 25, 2018
20794f0
updating licence headers
ppisljar Sep 25, 2018
2b61d9b
updating imports
ppisljar Sep 25, 2018
0136cc8
linting
ppisljar Sep 25, 2018
e0b1e83
loading core plugin
ppisljar Sep 25, 2018
a28988e
changes to loading canvas
ppisljar Sep 25, 2018
5f2c4c0
updating package.json
ppisljar Sep 25, 2018
4060e37
disabling linting in grammar.js
ppisljar Sep 25, 2018
c05ce1d
socket needs to wait for all plugins to load their functions before s…
ppisljar Sep 25, 2018
6b865b0
using uuid
ppisljar Sep 25, 2018
f55bb77
moving render function to core
Oct 1, 2018
7ce3bc8
reorganizing core_plugins/interpreter files
Oct 1, 2018
e46fb85
adding path registry
Oct 1, 2018
26edd41
moving plugins api and using pathsRegistry
Oct 1, 2018
0940231
reverting some earlier changes
Oct 1, 2018
57b4ea9
changing plugins server route
Oct 1, 2018
1443a87
moving and updating loadBrowserPlugins
Oct 1, 2018
29ddfb0
adding register functions
Oct 1, 2018
85ae978
updating package.json and adding build task
Oct 1, 2018
1bdc96c
cleanup
Oct 1, 2018
68f0a70
adding load_browser_plugins to core/interpreter
Oct 1, 2018
c293644
removing canvas types (all are registered by core)
Oct 1, 2018
40b54bd
yarn.lock files
Oct 1, 2018
e8352ca
adding build:plugins task to core
Oct 2, 2018
6299987
Merge branch 'master' into ref/moveCanvasInterpreterToCore
Oct 2, 2018
d368022
adding @kbn/interpreter to x-pack package.json
Oct 2, 2018
6d46879
temporary ignoring license check in babel-plugin-mock-imports
Oct 2, 2018
cd4e1ae
moving plugin_src from core_plugins to packages/kbn-interpreter
Oct 10, 2018
2ed75ad
moving peg task
Oct 10, 2018
2593830
Merge branch 'master' into ref/moveCanvasInterpreterToCore
Oct 10, 2018
905d5a3
fixing package.json
Oct 10, 2018
561f75f
adding kbn:bootstrap task
Oct 11, 2018
906e1cf
updating paths
ppisljar Oct 12, 2018
ff364f8
adding eslint exception
ppisljar Oct 13, 2018
60b7260
cleaning globals ?
ppisljar Oct 15, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ bower_components
/packages/kbn-ui-framework/dist
/packages/kbn-ui-framework/doc_site/build
/packages/kbn-ui-framework/generator-kui/*/templates/
/packages/kbn-interpreter/plugin
/x-pack/coverage
/x-pack/build
/x-pack/plugins/**/__tests__/fixtures/**
Expand Down
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"@kbn/pm": "link:packages/kbn-pm",
"@kbn/test-subj-selector": "link:packages/kbn-test-subj-selector",
"@kbn/ui-framework": "link:packages/kbn-ui-framework",
"@kbn/interpreter": "link:packages/kbn-interpreter",
"abortcontroller-polyfill": "^1.1.9",
"angular": "1.6.9",
"angular-aria": "1.6.6",
Expand All @@ -81,10 +82,15 @@
"angular-route": "1.4.7",
"angular-sanitize": "1.5.7",
"angular-sortable-view": "0.0.15",
"axios": "^0.18.0",
"autoprefixer": "^9.1.0",
"babel-core": "6.21.0",
"babel-loader": "7.1.2",
"babel-polyfill": "6.20.0",
"babel-plugin-inline-react-svg": "^0.5.4",
"babel-plugin-mock-imports": "^0.0.5",
"babel-plugin-pegjs-inline-precompile": "^0.1.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.14",
"babel-register": "6.18.0",
"bluebird": "2.9.34",
"boom": "5.2.0",
Expand Down Expand Up @@ -177,6 +183,7 @@
"rxjs": "^6.2.1",
"script-loader": "0.7.2",
"semver": "^5.5.0",
"squel": "^5.12.2",
"style-loader": "0.19.0",
"tar": "2.2.0",
"tinygradient": "0.3.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { elasticLogo } from '../../../../lib/elastic_logo';
import { elasticLogo } from '../../elastic_logo';

export const fontStyle = {
type: 'style',
Expand All @@ -18,8 +31,8 @@ export const fontStyle = {
fontSize: '14px',
lineHeight: '21px',
},
css:
'font-family:Chalkboard, serif;font-weight:bolder;font-style:normal;text-decoration:underline;color:pink;text-align:center;font-size:14px;line-height:21px',
css: 'font-family:Chalkboard, serif;font-weight:bolder;font-style:normal;' +
'text-decoration:underline;color:pink;text-align:center;font-size:14px;line-height:21px',
};

export const containerStyle = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

const emptyTable = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { mapValues } from 'lodash';

// It takes a function spec and passes in default args into the spec fn
export const functionWrapper = (fnSpec, mockReduxStore) => {
const spec = fnSpec();
const defaultArgs = mapValues(spec.args, argSpec => {
return argSpec.default;
});

return (context, args, handlers) =>
spec.fn(context, { ...defaultArgs, ...args }, handlers, mockReduxStore);
};
2 changes: 2 additions & 0 deletions packages/kbn-interpreter/common/elastic_logo.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { getType } from '../lib/get_type';
Expand All @@ -19,8 +32,9 @@ export function castProvider(types) {

for (let i = 0; i < toTypeNames.length; i++) {
// First check if the current type can cast to this type
if (fromTypeDef && fromTypeDef.castsTo(toTypeNames[i]))
if (fromTypeDef && fromTypeDef.castsTo(toTypeNames[i])) {
return fromTypeDef.to(node, toTypeNames[i], types);
}

// If that isn't possible, check if this type can cast from the current type
const toTypeDef = types[toTypeNames[i]];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import clone from 'lodash.clone';
Expand Down Expand Up @@ -122,7 +135,7 @@ export function interpretProvider(config) {
const argDef = getByAlias(argDefs, argName);
// TODO: Implement a system to allow for undeclared arguments
if (!argDef)
throw new Error(`Unknown argument '${argName}' passed to function '${fnDef.name}'`);
{throw new Error(`Unknown argument '${argName}' passed to function '${fnDef.name}'`);}

argAsts[argDef.name] = (argAsts[argDef.name] || []).concat(argAst);
return argAsts;
Expand Down Expand Up @@ -152,7 +165,7 @@ export function interpretProvider(config) {
argDefs,
(argAsts, argDef, argName) => {
if (typeof argAsts[argName] === 'undefined' && typeof argDef.default !== 'undefined')
argAsts[argName] = [fromExpression(argDef.default, 'argument')];
{argAsts[argName] = [fromExpression(argDef.default, 'argument')];}

return argAsts;
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import uuid from 'uuid/v4';
Expand Down Expand Up @@ -40,8 +53,9 @@ export function socketInterpreterProvider({
// Get the list of functions that are known elsewhere
return Promise.resolve(referableFunctions).then(referableFunctionMap => {
// Check if the not-found function is in the list of alternatives, if not, throw
if (!getByAlias(referableFunctionMap, functionName))
if (!getByAlias(referableFunctionMap, functionName)) {
throw new Error(`Function not found: ${functionName}`);
}

// set a unique message ID so the code knows what response to process
const id = uuid();
Expand Down
36 changes: 36 additions & 0 deletions packages/kbn-interpreter/common/lib/__tests__/arg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import expect from 'expect.js';
import { Arg } from '../arg';

describe('Arg', () => {
it('sets required to false by default', () => {
const isOptional = new Arg({
name: 'optional_me',
});
expect(isOptional.required).to.equal(false);

const isRequired = new Arg({
name: 'require_me',
required: true,
});
expect(isRequired.required).to.equal(true);
});
});
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import expect from 'expect.js';
import { fromExpression } from '../ast';
import { getType } from '../../lib/get_type';
import { getType } from '../get_type';

describe('ast fromExpression', () => {
describe('invalid expression', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import expect from 'expect.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import expect from 'expect.js';
Expand Down
Loading