diff --git a/packages/plugins/operators/operators-mql/README.md b/packages/plugins/operators/operators-mql/README.md new file mode 100644 index 000000000..957fcbe3e --- /dev/null +++ b/packages/plugins/operators/operators-mql/README.md @@ -0,0 +1,3 @@ +# Lowdefy Operators Mql + +Mql Lowdefy operators diff --git a/packages/plugins/operators/operators-mql/jest.config.cjs b/packages/plugins/operators/operators-mql/jest.config.cjs new file mode 100644 index 000000000..67c7bbf70 --- /dev/null +++ b/packages/plugins/operators/operators-mql/jest.config.cjs @@ -0,0 +1,14 @@ +module.exports = { + clearMocks: true, + collectCoverage: true, + collectCoverageFrom: ['src/**/*.js'], + coverageDirectory: 'coverage', + coveragePathIgnorePatterns: ['/dist/', '/src/test', '/src/index.js'], + coverageReporters: [['lcov', { projectRoot: '../../../..' }], 'text', 'clover'], + errorOnDeprecated: true, + testEnvironment: 'jsdom', + testPathIgnorePatterns: ['/dist/', '/src/test'], + transform: { + '^.+\\.(t|j)sx?$': ['@swc/jest', { configFile: '../../../../.swcrc.test' }], + }, +}; diff --git a/packages/plugins/operators/operators-mql/package.json b/packages/plugins/operators/operators-mql/package.json new file mode 100644 index 000000000..318624e12 --- /dev/null +++ b/packages/plugins/operators/operators-mql/package.json @@ -0,0 +1,58 @@ +{ + "name": "@lowdefy/operators-mql", + "version": "4.0.0-alpha.4", + "licence": "Apache-2.0", + "description": "", + "homepage": "https://lowdefy.com", + "keywords": [ + "lowdefy", + "lowdefy operator" + ], + "bugs": { + "url": "https://github.com/lowdefy/lowdefy/issues" + }, + "contributors": [ + { + "name": "Sam Tolmay", + "url": "https://github.com/SamTolmay" + }, + { + "name": "Gerrie van Wyk", + "url": "https://github.com/Gervwyk" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/lowdefy/lowdefy.git" + }, + "type": "module", + "exports": { + "./operators/client": "./dist/operatorsClient.js", + "./operators/server": "./dist/operatorsServer.js", + "./types": "./dist/types.js" + }, + "files": [ + "dist/*" + ], + "scripts": { + "build": "yarn swc", + "clean": "rm -rf dist", + "prepare": "yarn build", + "swc": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start --copy-files", + "test": "jest --coverage" + }, + "dependencies": { + "@lowdefy/helpers": "4.0.0-alpha.4", + "@lowdefy/operators": "4.0.0-alpha.4", + "mingo": "4.4.1" + }, + "devDependencies": { + "@swc/cli": "0.1.51", + "@swc/core": "1.2.107", + "@swc/jest": "0.2.5", + "jest": "27.3.1" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/packages/plugins/operators/operators-mql/src/operators/operatorsClient.js b/packages/plugins/operators/operators-mql/src/operators/operatorsClient.js new file mode 100644 index 000000000..321240ec5 --- /dev/null +++ b/packages/plugins/operators/operators-mql/src/operators/operatorsClient.js @@ -0,0 +1,17 @@ +/* + Copyright 2020-2021 Lowdefy, Inc + + Licensed 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. +*/ + +export { default as _mql } from './operators/shared/mql.js'; diff --git a/packages/plugins/operators/operators-mql/src/operators/operatorsServer.js b/packages/plugins/operators/operators-mql/src/operators/operatorsServer.js new file mode 100644 index 000000000..d31725722 --- /dev/null +++ b/packages/plugins/operators/operators-mql/src/operators/operatorsServer.js @@ -0,0 +1,17 @@ +/* + Copyright 2020-2021 Lowdefy, Inc + + Licensed 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. +*/ + +export { default as _mql } from './operators/shared/mql.js.js'; diff --git a/packages/operators/src/common/mql.js b/packages/plugins/operators/operators-mql/src/operators/shared/mql.js similarity index 97% rename from packages/operators/src/common/mql.js rename to packages/plugins/operators/operators-mql/src/operators/shared/mql.js index 013c49b1e..d205ab827 100644 --- a/packages/operators/src/common/mql.js +++ b/packages/plugins/operators/operators-mql/src/operators/shared/mql.js @@ -16,7 +16,7 @@ import mingo from 'mingo'; import { get, type } from '@lowdefy/helpers'; -import runClass from '../runClass.js'; +import { runClass } from '@lowdefy/operators'; import 'mingo/init/system'; diff --git a/packages/operators/test/common/mql.test.js b/packages/plugins/operators/operators-mql/src/operators/shared/mql.test.js similarity index 99% rename from packages/operators/test/common/mql.test.js rename to packages/plugins/operators/operators-mql/src/operators/shared/mql.test.js index 3e93aef1b..5afddf709 100644 --- a/packages/operators/test/common/mql.test.js +++ b/packages/plugins/operators/operators-mql/src/operators/shared/mql.test.js @@ -14,7 +14,7 @@ limitations under the License. */ -import mql from '../../src/common/mql.js'; +import mql from './mql.js'; test('_mql.aggregate on: null', () => { expect( diff --git a/packages/plugins/operators/operators-mql/src/operators/types.js b/packages/plugins/operators/operators-mql/src/operators/types.js new file mode 100644 index 000000000..4a55b5f9d --- /dev/null +++ b/packages/plugins/operators/operators-mql/src/operators/types.js @@ -0,0 +1,24 @@ +/* + Copyright 2020-2021 Lowdefy, Inc + + Licensed 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 * as client from './operatorsClient.js'; +import * as server from './operatorsServer.js'; + +export default { + operators: { + client: Object.keys(client), + server: Object.keys(server), + }, +};