From 3745cf6b465ff5e8b30ba370187613dff07a446a Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 10 Aug 2022 12:04:58 +0100 Subject: [PATCH 001/260] Add PoC of using a custom component inside client library --- packages/client/src/components/ClientApp.svelte | 10 ++++++++++ packages/client/src/index.js | 6 ++++++ .../controllers/static/templates/BudibaseApp.svelte | 5 +++++ 3 files changed, 21 insertions(+) diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index 64b1712b89..c883dd4206 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -85,8 +85,18 @@ builderStore.actions.notifyLoaded() } }) + + // TODO: remove. this is a test to render the first custom component + console.log(window["##BUDIBASE_CUSTOM_COMPONENTS##"]?.[0]) + const custom = window["##BUDIBASE_CUSTOM_COMPONENTS##"]?.[0]?.Component +{#if custom} +
+ +
+{/if} + {#if dataLoaded}
+ + + -{#if custom} -
- -
-{/if} - {#if dataLoaded}
import { getContext, setContext, onMount, onDestroy } from "svelte" import { writable, get } from "svelte/store" - import * as AppComponents from "components/app" - import Router from "./Router.svelte" import { enrichProps, propsAreSame, @@ -180,7 +178,7 @@ // Pull definition and constructor const component = instance._component - constructor = getComponentConstructor(component) + constructor = componentStore.actions.getComponentConstructor(component) definition = componentStore.actions.getComponentDefinition(component) if (!definition) { return @@ -237,16 +235,6 @@ }) } - // Gets the component constructor for the specified component - const getComponentConstructor = component => { - const split = component?.split("/") - const name = split?.[split.length - 1] - if (name === "screenslot" && !insideScreenslot) { - return Router - } - return AppComponents[name] - } - const getSettingsDefinitionMap = settingsDefinition => { let map = {} settingsDefinition?.forEach(setting => { diff --git a/packages/client/src/components/Screen.svelte b/packages/client/src/components/Screen.svelte index 3ec8d1ea52..12e6803aea 100644 --- a/packages/client/src/components/Screen.svelte +++ b/packages/client/src/components/Screen.svelte @@ -13,7 +13,22 @@ $: routeStore.actions.setRouteParams(params || {}) // Get the screen definition for the current route - $: screenDefinition = $screenStore.activeScreen?.props + $: screenDefinition = getScreenDefinition($screenStore.activeScreen?.props) + + const getScreenDefinition = definition => { + const test = { + _component: "test", + _id: "asfdasdfefgerdgrfdg", + _styles: { + normal: {}, + }, + text: "This is a text prop!", + } + return { + ...definition, + _children: [...definition._children, test], + } + } onMount(() => { // Mark the router as loaded whenever the screen mounts diff --git a/packages/client/src/index.js b/packages/client/src/index.js index c88afe59ba..32b242bc69 100644 --- a/packages/client/src/index.js +++ b/packages/client/src/index.js @@ -1,5 +1,5 @@ import ClientApp from "./components/ClientApp.svelte" -import { builderStore, appStore, devToolsStore } from "./stores" +import { componentStore, builderStore, appStore, devToolsStore } from "./stores" import loadSpectrumIcons from "@budibase/bbui/spectrum-icons-rollup.js" import { get } from "svelte/store" @@ -38,6 +38,13 @@ const loadBudibase = () => { const enableDevTools = !get(builderStore).inBuilder && get(appStore).isDevApp devToolsStore.actions.setEnabled(enableDevTools) + // Register any custom components + if (window["##BUDIBASE_CUSTOM_COMPONENTS##"]) { + window["##BUDIBASE_CUSTOM_COMPONENTS##"].forEach(component => { + componentStore.actions.registerCustomComponent(component) + }) + } + // Create app if one hasn't been created yet if (!app) { app = new ClientApp({ diff --git a/packages/client/src/stores/components.js b/packages/client/src/stores/components.js index a7426113e2..2500ea2a41 100644 --- a/packages/client/src/stores/components.js +++ b/packages/client/src/stores/components.js @@ -4,6 +4,10 @@ import { findComponentById, findComponentPathById } from "../utils/components" import { devToolsStore } from "./devTools" import { screenStore } from "./screens" import { builderStore } from "./builder" +import Router from "../components/Router.svelte" +import * as AppComponents from "../components/app/index.js" + +const budibasePrefix = "@budibase/standard-components/" const createComponentStore = () => { const store = writable({}) @@ -34,6 +38,7 @@ const createComponentStore = () => { findComponentPathById(asset?.props, selectedComponentId) || [] return { + customComponentManifest: $store.customComponentManifest, selectedComponentInstance: $store[selectedComponentId], selectedComponent: component, selectedComponentDefinition: definition, @@ -68,9 +73,60 @@ const createComponentStore = () => { } const getComponentDefinition = type => { - const prefix = "@budibase/standard-components/" - type = type?.replace(prefix, "") - return type ? Manifest[type] : null + if (!type) { + return null + } + + // Screenslot is an edge case + if (type === "screenslot") { + type = `${budibasePrefix}${type}` + } + + // Handle built-in components + if (type.startsWith(budibasePrefix)) { + type = type.replace(budibasePrefix, "") + return type ? Manifest[type] : null + } + + // Handle custom components + const { customComponentManifest } = get(store) + return customComponentManifest?.[type]?.schema?.schema + } + + const getComponentConstructor = type => { + if (!type) { + return null + } + if (type === "screenslot") { + return Router + } + + // Handle budibase components + if (type.startsWith(budibasePrefix)) { + const split = type.split("/") + const name = split[split.length - 1] + return AppComponents[name] + } + + // Handle custom components + const { customComponentManifest } = get(store) + return customComponentManifest?.[type]?.Component + } + + const registerCustomComponent = ({ Component, schema }) => { + if (!Component || !schema?.schema?.name) { + return + } + store.update(state => { + if (!state.customComponentManifest) { + state.customComponentManifest = {} + } + state.customComponentManifest[schema.schema.name] = { + schema, + Component, + } + return state + }) } return { @@ -81,6 +137,8 @@ const createComponentStore = () => { isComponentRegistered, getComponentById, getComponentDefinition, + getComponentConstructor, + registerCustomComponent, }, } } From 07909c9ae34be61dc45360fb5d041080e6c36ebf Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 10 Aug 2022 15:52:19 +0100 Subject: [PATCH 004/260] Remove forced custom component from client library --- packages/client/src/components/Screen.svelte | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/packages/client/src/components/Screen.svelte b/packages/client/src/components/Screen.svelte index 12e6803aea..3ec8d1ea52 100644 --- a/packages/client/src/components/Screen.svelte +++ b/packages/client/src/components/Screen.svelte @@ -13,22 +13,7 @@ $: routeStore.actions.setRouteParams(params || {}) // Get the screen definition for the current route - $: screenDefinition = getScreenDefinition($screenStore.activeScreen?.props) - - const getScreenDefinition = definition => { - const test = { - _component: "test", - _id: "asfdasdfefgerdgrfdg", - _styles: { - normal: {}, - }, - text: "This is a text prop!", - } - return { - ...definition, - _children: [...definition._children, test], - } - } + $: screenDefinition = $screenStore.activeScreen?.props onMount(() => { // Mark the router as loaded whenever the screen mounts From 7ce8a9e25451d231bf4090ca5fa18bf9c3a6445c Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 10 Aug 2022 16:19:08 +0100 Subject: [PATCH 005/260] Validating datasources fully, initial work towards validating components and including the build in the CLI. --- packages/cli/package.json | 6 +- packages/cli/src/exec.js | 25 ++++++ packages/cli/src/plugins/constants.js | 6 ++ packages/cli/src/plugins/index.js | 54 ++++++++++-- packages/cli/src/plugins/validate.js | 87 +++++++++++++++++++ packages/cli/yarn.lock | 45 ++++++++++ packages/server/src/definitions/datasource.ts | 84 ++++-------------- .../types/src/documents/app/datasource.ts | 69 +++++++++++++++ 8 files changed, 297 insertions(+), 79 deletions(-) create mode 100644 packages/cli/src/exec.js create mode 100644 packages/cli/src/plugins/constants.js create mode 100644 packages/cli/src/plugins/validate.js diff --git a/packages/cli/package.json b/packages/cli/package.json index 5a048fb17d..413703af9b 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -26,8 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "1.1.32-alpha.6", - "@budibase/string-templates": "^1.2.28", + "@budibase/backend-core": "1.2.28-alpha.0", + "@budibase/string-templates": "1.2.28-alpha.0", + "@budibase/types": "1.2.28-alpha.0", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", @@ -36,6 +37,7 @@ "dotenv": "16.0.1", "download": "^8.0.0", "inquirer": "8.0.0", + "joi": "^17.6.0", "lookpath": "1.1.0", "node-fetch": "2", "pkg": "5.7.0", diff --git a/packages/cli/src/exec.js b/packages/cli/src/exec.js new file mode 100644 index 0000000000..07520336c4 --- /dev/null +++ b/packages/cli/src/exec.js @@ -0,0 +1,25 @@ +const util = require("util") +const exec = util.promisify(require("child_process").exec) + +exports.exec = async command => { + const { stdout } = await exec(command) + return stdout +} + +exports.utilityInstalled = async utilName => { + try { + await exports.exec(`${utilName} --version`) + return true + } catch (err) { + return false + } +} + +exports.runPkgCommand = async command => { + const yarn = await exports.utilityInstalled("yarn") + const npm = await exports.utilityInstalled("npm") + if (!yarn && !npm) { + throw new Error("Must have yarn or npm installed to run build.") + } + await exports.exec(yarn ? `yarn ${command}` : `npm run ${command}`) +} diff --git a/packages/cli/src/plugins/constants.js b/packages/cli/src/plugins/constants.js new file mode 100644 index 0000000000..37d0748979 --- /dev/null +++ b/packages/cli/src/plugins/constants.js @@ -0,0 +1,6 @@ +exports.PluginTypes = { + COMPONENT: "component", + DATASOURCE: "datasource", +} + +exports.PLUGIN_TYPES_ARR = Object.values(exports.PluginTypes) diff --git a/packages/cli/src/plugins/index.js b/packages/cli/src/plugins/index.js index c0d4fa2cfe..6ec99ac7fa 100644 --- a/packages/cli/src/plugins/index.js +++ b/packages/cli/src/plugins/index.js @@ -3,21 +3,28 @@ const { CommandWords } = require("../constants") const { getSkeleton, fleshOutSkeleton } = require("./skeleton") const questions = require("../questions") const fs = require("fs") - -const PLUGIN_TYPES = ["component", "datasource"] +const { PLUGIN_TYPES_ARR } = require("./constants") +const { validate } = require("./validate") +const { runPkgCommand } = require("../exec") +const { join } = require("path") +const { success, error, info } = require("../utils") async function init(opts) { const type = opts["init"] || opts - if (!type || !PLUGIN_TYPES.includes(type)) { - console.error( - "Please provide a type to init, either 'component' or 'datasource'." + if (!type || !PLUGIN_TYPES_ARR.includes(type)) { + console.log( + error( + "Please provide a type to init, either 'component' or 'datasource'." + ) ) return } - console.log("Lets get some details about your new plugin:") + console.log(info("Lets get some details about your new plugin:")) const name = await questions.string("Name", `budibase-${type}`) if (fs.existsSync(name)) { - console.error("Directory by plugin name already exists, pick a new name.") + console.log( + error("Directory by plugin name already exists, pick a new name.") + ) return } const desc = await questions.string( @@ -28,10 +35,39 @@ async function init(opts) { // get the skeleton await getSkeleton(type, name) await fleshOutSkeleton(name, desc, version) - console.log(`Plugin created in directory "${name}"`) + console.log(info(`Plugin created in directory "${name}"`)) } -async function build() {} +async function build() { + console.log(info("Verifying plugin...")) + const schema = fs.readFileSync("schema.json", "utf8") + const pkg = fs.readFileSync("package.json", "utf8") + let name, version + try { + const schemaJson = JSON.parse(schema) + const pkgJson = JSON.parse(pkg) + if (!pkgJson.name || !pkgJson.version || !pkgJson.description) { + throw new Error( + "package.json is missing one of 'name', 'version' or 'description'." + ) + } + name = pkgJson.name + version = pkgJson.version + validate(schemaJson) + } catch (err) { + if (err && err.message && err.message.includes("not valid JSON")) { + console.log(error(`schema.json is not valid JSON: ${err.message}`)) + } else { + console.log(error(`Invalid schema/package.json: ${err.message}`)) + } + return + } + console.log(success("Verified!")) + console.log(info("Building plugin...")) + await runPkgCommand("build") + const output = join("dist", `${name}-${version}.tar.gz`) + console.log(success(`Build complete - output in: ${output}`)) +} const command = new Command(`${CommandWords.PLUGIN}`) .addHelp( diff --git a/packages/cli/src/plugins/validate.js b/packages/cli/src/plugins/validate.js new file mode 100644 index 0000000000..b460670c7f --- /dev/null +++ b/packages/cli/src/plugins/validate.js @@ -0,0 +1,87 @@ +const { PluginTypes } = require("./constants") +const { DatasourceFieldTypes, QueryTypes } = require("@budibase/types") +const joi = require("joi") + +const DATASOURCE_TYPES = [ + "Relational", + "Non-relational", + "Spreadsheet", + "Object store", + "Graph", + "API", +] + +function runJoi(validator, schema) { + const { error } = validator.validate(schema) + if (error) { + throw error + } +} + +function validateComponent(schema) { + const validator = joi.object({ + type: joi.string().allow("component").required(), + metadata: joi.object().unknown(true).required(), + schema: joi + .object({ + name: joi.string().required(), + settings: joi.array().items(joi.object().unknown(true)).required(), + }) + .unknown(true), + }) + runJoi(validator, schema) +} + +function validateDatasource(schema) { + const fieldValidator = joi.object({ + type: joi + .string() + .allow(...Object.values(DatasourceFieldTypes)) + .required(), + required: joi.boolean().required(), + default: joi.any(), + display: joi.string(), + }) + + const queryValidator = joi + .object({ + type: joi.string().allow(...Object.values(QueryTypes)), + fields: joi.object().pattern(joi.string(), fieldValidator), + }) + .required() + + const validator = joi.object({ + type: joi.string().allow("datasource").required(), + metadata: joi.object().unknown(true).required(), + schema: joi.object({ + docs: joi.string(), + friendlyName: joi.string().required(), + type: joi.string().allow(...DATASOURCE_TYPES), + description: joi.string().required(), + datasource: joi.object().pattern(joi.string(), fieldValidator).required(), + query: joi + .object({ + create: queryValidator, + read: queryValidator, + update: queryValidator, + delete: queryValidator, + }) + .unknown(true) + .required(), + }), + }) + runJoi(validator, schema) +} + +exports.validate = schema => { + switch (schema.type) { + case PluginTypes.COMPONENT: + validateComponent(schema) + break + case PluginTypes.DATASOURCE: + validateDatasource(schema) + break + default: + throw new Error(`Unknown plugin type - check schema.json: ${schema.type}`) + } +} diff --git a/packages/cli/yarn.lock b/packages/cli/yarn.lock index 95813f60cf..c17b48e8bb 100644 --- a/packages/cli/yarn.lock +++ b/packages/cli/yarn.lock @@ -118,6 +118,11 @@ resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.1.32-alpha.6.tgz#95d8d73c7ed6ebc22ff26a44365127a478e19409" integrity sha512-AKKxrzVqGtcSzZZ2fP6i2Vgv6ICN9NEEE1dmzRk9AImZS+XKQ9VgVpdE+4gHgFK7L0gBYAsiaoEpCbbrI/+NoQ== +"@budibase/types@^1.2.31": + version "1.2.31" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.31.tgz#4715bca331ecd5eac23f95bfdee2eb147ef57814" + integrity sha512-/R03MleZRMtf6JW/nCKBqd/bBIkbFnwr8EV1Y3t6EySh8fnhM2PdhlWlpf/BrE0zMoiuBn4JMFl2vJ2Mzo/aoA== + "@eslint/eslintrc@^0.4.3": version "0.4.3" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" @@ -133,6 +138,18 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@hapi/hoek@^9.0.0": + version "9.3.0" + resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb" + integrity sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ== + +"@hapi/topo@^5.0.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.1.0.tgz#dc448e332c6c6e37a4dc02fd84ba8d44b9afb012" + integrity sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg== + dependencies: + "@hapi/hoek" "^9.0.0" + "@humanwhocodes/config-array@^0.5.0": version "0.5.0" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" @@ -183,6 +200,23 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@sideway/address@^4.1.3": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.4.tgz#03dccebc6ea47fdc226f7d3d1ad512955d4783f0" + integrity sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw== + dependencies: + "@hapi/hoek" "^9.0.0" + +"@sideway/formula@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.0.tgz#fe158aee32e6bd5de85044be615bc08478a0a13c" + integrity sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg== + +"@sideway/pinpoint@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df" + integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ== + "@sindresorhus/is@^0.7.0": version "0.7.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" @@ -2455,6 +2489,17 @@ jmespath@0.15.0: resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.15.0.tgz#a3f222a9aae9f966f5d27c796510e28091764217" integrity sha512-+kHj8HXArPfpPEKGLZ+kB5ONRTCiGQXo8RQYL0hH8t6pWXUBBK5KkkQmTNOwKK4LEsd0yTsgtjJVm4UBSZea4w== +joi@^17.6.0: + version "17.6.0" + resolved "https://registry.yarnpkg.com/joi/-/joi-17.6.0.tgz#0bb54f2f006c09a96e75ce687957bd04290054b2" + integrity sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw== + dependencies: + "@hapi/hoek" "^9.0.0" + "@hapi/topo" "^5.0.0" + "@sideway/address" "^4.1.3" + "@sideway/formula" "^3.0.0" + "@sideway/pinpoint" "^2.0.0" + join-component@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/join-component/-/join-component-1.1.0.tgz#b8417b750661a392bee2c2537c68b2a9d4977cd5" diff --git a/packages/server/src/definitions/datasource.ts b/packages/server/src/definitions/datasource.ts index 9752fc947a..604dae50c3 100644 --- a/packages/server/src/definitions/datasource.ts +++ b/packages/server/src/definitions/datasource.ts @@ -1,73 +1,21 @@ import { Row, Table, Base } from "./common" +import { + Operation, + QueryTypes, + SortDirection, + SourceNames, +} from "@budibase/types" -export enum Operation { - CREATE = "CREATE", - READ = "READ", - UPDATE = "UPDATE", - DELETE = "DELETE", - BULK_CREATE = "BULK_CREATE", - CREATE_TABLE = "CREATE_TABLE", - UPDATE_TABLE = "UPDATE_TABLE", - DELETE_TABLE = "DELETE_TABLE", -} - -export enum SortDirection { - ASCENDING = "ASCENDING", - DESCENDING = "DESCENDING", -} - -export enum QueryTypes { - SQL = "sql", - JSON = "json", - FIELDS = "fields", -} - -export enum DatasourceFieldTypes { - STRING = "string", - LONGFORM = "longForm", - BOOLEAN = "boolean", - NUMBER = "number", - PASSWORD = "password", - LIST = "list", - OBJECT = "object", - JSON = "json", - FILE = "file", -} - -export enum SourceNames { - POSTGRES = "POSTGRES", - DYNAMODB = "DYNAMODB", - MONGODB = "MONGODB", - ELASTICSEARCH = "ELASTICSEARCH", - COUCHDB = "COUCHDB", - SQL_SERVER = "SQL_SERVER", - S3 = "S3", - AIRTABLE = "AIRTABLE", - MYSQL = "MYSQL", - ARANGODB = "ARANGODB", - REST = "REST", - ORACLE = "ORACLE", - GOOGLE_SHEETS = "GOOGLE_SHEETS", - FIRESTORE = "FIRESTORE", - REDIS = "REDIS", - SNOWFLAKE = "SNOWFLAKE", -} - -export enum IncludeRelationships { - INCLUDE = 1, - EXCLUDE = 0, -} - -export enum FilterTypes { - STRING = "string", - FUZZY = "fuzzy", - RANGE = "range", - EQUAL = "equal", - NOT_EQUAL = "notEqual", - EMPTY = "empty", - NOT_EMPTY = "notEmpty", - ONE_OF = "oneOf", -} +// these were previously exported here - moved to types for re-use +export { + Operation, + SortDirection, + QueryTypes, + DatasourceFieldTypes, + SourceNames, + IncludeRelationships, + FilterTypes, +} from "@budibase/types" export interface QueryDefinition { type: QueryTypes diff --git a/packages/types/src/documents/app/datasource.ts b/packages/types/src/documents/app/datasource.ts index 3a8704a0a9..6a5dd054da 100644 --- a/packages/types/src/documents/app/datasource.ts +++ b/packages/types/src/documents/app/datasource.ts @@ -1,5 +1,74 @@ import { Document } from "../document" +export enum Operation { + CREATE = "CREATE", + READ = "READ", + UPDATE = "UPDATE", + DELETE = "DELETE", + BULK_CREATE = "BULK_CREATE", + CREATE_TABLE = "CREATE_TABLE", + UPDATE_TABLE = "UPDATE_TABLE", + DELETE_TABLE = "DELETE_TABLE", +} + +export enum SortDirection { + ASCENDING = "ASCENDING", + DESCENDING = "DESCENDING", +} + +export enum QueryTypes { + SQL = "sql", + JSON = "json", + FIELDS = "fields", +} + +export enum DatasourceFieldTypes { + STRING = "string", + LONGFORM = "longForm", + BOOLEAN = "boolean", + NUMBER = "number", + PASSWORD = "password", + LIST = "list", + OBJECT = "object", + JSON = "json", + FILE = "file", +} + +export enum SourceNames { + POSTGRES = "POSTGRES", + DYNAMODB = "DYNAMODB", + MONGODB = "MONGODB", + ELASTICSEARCH = "ELASTICSEARCH", + COUCHDB = "COUCHDB", + SQL_SERVER = "SQL_SERVER", + S3 = "S3", + AIRTABLE = "AIRTABLE", + MYSQL = "MYSQL", + ARANGODB = "ARANGODB", + REST = "REST", + ORACLE = "ORACLE", + GOOGLE_SHEETS = "GOOGLE_SHEETS", + FIRESTORE = "FIRESTORE", + REDIS = "REDIS", + SNOWFLAKE = "SNOWFLAKE", +} + +export enum IncludeRelationships { + INCLUDE = 1, + EXCLUDE = 0, +} + +export enum FilterTypes { + STRING = "string", + FUZZY = "fuzzy", + RANGE = "range", + EQUAL = "equal", + NOT_EQUAL = "notEqual", + EMPTY = "empty", + NOT_EMPTY = "notEmpty", + ONE_OF = "oneOf", +} + export interface Datasource extends Document { source: string } From 16e42dc5a1bf8b2fd358dd910a0380817387307c Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 10 Aug 2022 16:54:13 +0100 Subject: [PATCH 006/260] Add full PoC of using a custom component inside the builder, with children and bindings --- .../src/builderStore/store/frontend.js | 33 +++++++++++++++++-- .../[screenId]/_components/iframeTemplate.js | 3 ++ .../new/_components/NewComponentPanel.svelte | 21 ++++++++++-- 3 files changed, 51 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 58d803aa03..7903210f53 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -92,11 +92,41 @@ export const getFrontendStore = () => { // Allow errors to propagate. let components = await API.fetchComponentLibDefinitions(application.appId) + // Extend definitions with custom components + components["test"] = { + component: "test", + name: "Super cool component", + icon: "Text", + description: "A custom component", + showSettingsBar: false, + hasChildren: true, + settings: [ + { + type: "text", + key: "text", + label: "Text", + }, + ], + context: { + type: "static", + values: [ + { + label: "Text prop", + key: "text", + }, + ], + }, + } + + // Filter out custom component keys so we can flag them + let customComponents = ["test"] + // Reset store state store.update(state => ({ ...state, libraries: application.componentLibraries, components, + customComponents, clientFeatures: { ...INITIAL_FRONTEND_STATE.clientFeatures, ...components.features, @@ -397,9 +427,6 @@ export const getFrontendStore = () => { if (!componentName) { return null } - if (!componentName.startsWith("@budibase")) { - componentName = `@budibase/standard-components/${componentName}` - } return get(store).components[componentName] }, createInstance: (componentName, presetProps) => { diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/iframeTemplate.js b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/iframeTemplate.js index 1c789d858e..64a05c7246 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/iframeTemplate.js +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/iframeTemplate.js @@ -37,6 +37,9 @@ export default ` } + - + {{ PLUGINS }} @@ -85,9 +86,13 @@ - + {#if usedPlugins?.length} + {#each usedPlugins as plugin} + + {/each} + {/if} - {{ PLUGINS }} {#if $auth.isAdmin} @@ -106,6 +112,7 @@ } }} /> +
diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index 64b1712b89..86fd56feb1 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -87,6 +87,14 @@ }) + + {#if $builderStore.usedPlugins?.length} + {#each $builderStore.usedPlugins as plugin} + + {/each} + {/if} + + {#if dataLoaded}
{ + const initialise = (instance, force = false) => { if (instance == null) { return } // Ensure we're processing a new instance const instanceKey = Helpers.hashString(JSON.stringify(instance)) - if (instanceKey === lastInstanceKey) { + if (instanceKey === lastInstanceKey && !force) { return } else { lastInstanceKey = instanceKey @@ -407,9 +407,11 @@ !componentStore.actions.isComponentRegistered(id) ) { componentStore.actions.registerInstance(id, { + component: instance._component, getSettings: () => cachedSettings, getRawSettings: () => ({ ...staticSettings, ...dynamicSettings }), getDataContext: () => get(context), + reload: () => initialise(instance, true), }) } }) diff --git a/packages/client/src/components/devtools/DevToolsStatsTab.svelte b/packages/client/src/components/devtools/DevToolsStatsTab.svelte index b20b9fafa0..24f587332c 100644 --- a/packages/client/src/components/devtools/DevToolsStatsTab.svelte +++ b/packages/client/src/components/devtools/DevToolsStatsTab.svelte @@ -19,7 +19,10 @@ label="Active screen" value={$screenStore.activeScreen?.routing.route} /> - + diff --git a/packages/client/src/index.js b/packages/client/src/index.js index 32b242bc69..bef3ab9c12 100644 --- a/packages/client/src/index.js +++ b/packages/client/src/index.js @@ -27,6 +27,7 @@ const loadBudibase = () => { previewDevice: window["##BUDIBASE_PREVIEW_DEVICE##"], navigation: window["##BUDIBASE_PREVIEW_NAVIGATION##"], hiddenComponentIds: window["##BUDIBASE_HIDDEN_COMPONENT_IDS##"], + usedPlugins: window["##BUDIBASE_USED_PLUGINS##"], }) // Set app ID - this window flag is set by both the preview and the real @@ -39,6 +40,11 @@ const loadBudibase = () => { devToolsStore.actions.setEnabled(enableDevTools) // Register any custom components + window.registerCustomComponent = plugin => { + componentStore.actions.registerCustomComponent(plugin) + console.log("registered!") + loadBudibase() + } if (window["##BUDIBASE_CUSTOM_COMPONENTS##"]) { window["##BUDIBASE_CUSTOM_COMPONENTS##"].forEach(component => { componentStore.actions.registerCustomComponent(component) diff --git a/packages/client/src/stores/components.js b/packages/client/src/stores/components.js index a07c9da996..94dd16a957 100644 --- a/packages/client/src/stores/components.js +++ b/packages/client/src/stores/components.js @@ -10,7 +10,11 @@ import * as AppComponents from "../components/app/index.js" const budibasePrefix = "@budibase/standard-components/" const createComponentStore = () => { - const store = writable({}) + const store = writable({ + customComponentManifest: {}, + componentsAwaitingConstructors: {}, + mountedComponents: {}, + }) const derivedStore = derived( [store, builderStore, devToolsStore, screenStore], @@ -29,9 +33,7 @@ const createComponentStore = () => { asset = $screenState.activeScreen } const component = findComponentById(asset?.props, selectedComponentId) - const prefix = "@budibase/standard-components/" - const type = component?._component?.replace(prefix, "") - const definition = type ? Manifest[type] : null + const definition = getComponentDefinition(component?._component) // Derive the selected component path const path = @@ -39,32 +41,50 @@ const createComponentStore = () => { return { customComponentManifest: $store.customComponentManifest, - selectedComponentInstance: $store[selectedComponentId], + selectedComponentInstance: + $store.mountedComponents[selectedComponentId], selectedComponent: component, selectedComponentDefinition: definition, selectedComponentPath: path?.map(component => component._id), - mountedComponents: Object.keys($store).length, + mountedComponentCount: Object.keys($store.mountedComponents).length, currentAsset: asset, } } ) const registerInstance = (id, instance) => { - store.update(state => ({ - ...state, - [id]: instance, - })) + store.update(state => { + // If this is a custom component and does not have an implementation yet, + // store so we can reload this component later + const component = instance.component + let cac = state.componentsAwaitingConstructors + if (!getComponentConstructor(component)) { + if (!cac[component]) { + cac[component] = [] + } + cac[component].push(id) + } + + return { + ...state, + componentsAwaitingConstructors: cac, + mountedComponents: { + ...state.mountedComponents, + [id]: instance, + }, + } + }) } const unregisterInstance = id => { store.update(state => { - delete state[id] + delete state.mountedComponents[id] return state }) } const isComponentRegistered = id => { - return get(store)[id] != null + return get(store).mountedComponents[id] != null } const getComponentById = id => { @@ -117,17 +137,32 @@ const createComponentStore = () => { if (!Component || !schema?.schema?.name) { return } + const componentName = `plugin/${schema.schema.name}/1.0.0` store.update(state => { if (!state.customComponentManifest) { state.customComponentManifest = {} } - const componentName = `plugin/${schema.schema.name}/1.0.0` state.customComponentManifest[componentName] = { schema, Component, } return state }) + + // Reload any mounted components which depend on this definition + const state = get(store) + if (state.componentsAwaitingConstructors[componentName]?.length) { + state.componentsAwaitingConstructors[componentName].forEach(id => { + const instance = state.mountedComponents[id] + if (instance) { + instance.reload() + } + }) + store.update(state => { + delete state.componentsAwaitingConstructors[componentName] + return state + }) + } } return { From 1f2f1309075e9ec46192f470411eea44ef03e95f Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 11 Aug 2022 17:29:07 +0100 Subject: [PATCH 023/260] Getting dependency installation working correctly. --- .gitignore | 4 +++- packages/cli/src/exec.js | 9 +++++---- packages/cli/src/plugins/index.js | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index f063e2224f..32c6faf980 100644 --- a/.gitignore +++ b/.gitignore @@ -102,4 +102,6 @@ packages/builder/cypress/reports stats.html # TypeScript cache -*.tsbuildinfo \ No newline at end of file +*.tsbuildinfo +budibase-component +budibase-datasource diff --git a/packages/cli/src/exec.js b/packages/cli/src/exec.js index 8b1134c897..72fd8e00eb 100644 --- a/packages/cli/src/exec.js +++ b/packages/cli/src/exec.js @@ -1,8 +1,8 @@ const util = require("util") const exec = util.promisify(require("child_process").exec) -exports.exec = async command => { - const { stdout } = await exec(command) +exports.exec = async (command, dir = "./") => { + const { stdout } = await exec(command, { cwd: dir }) return stdout } @@ -15,12 +15,13 @@ exports.utilityInstalled = async utilName => { } } -exports.runPkgCommand = async command => { +exports.runPkgCommand = async (command, dir = "./") => { const yarn = await exports.utilityInstalled("yarn") const npm = await exports.utilityInstalled("npm") if (!yarn && !npm) { throw new Error("Must have yarn or npm installed to run build.") } const npmCmd = command === "install" ? `npm ${command}` : `npm run ${command}` - await exports.exec(yarn ? `yarn ${command}` : npmCmd) + const cmd = yarn ? `yarn ${command}` : npmCmd + await exports.exec(cmd, dir) } diff --git a/packages/cli/src/plugins/index.js b/packages/cli/src/plugins/index.js index 6ce2d47e63..e6de624b63 100644 --- a/packages/cli/src/plugins/index.js +++ b/packages/cli/src/plugins/index.js @@ -37,7 +37,7 @@ async function init(opts) { await getSkeleton(type, name) await fleshOutSkeleton(name, desc, version) console.log(info("Installing dependencies...")) - await runPkgCommand("install") + await runPkgCommand("install", join(process.cwd(), name)) console.log(info(`Plugin created in directory "${name}"`)) } From dcce46f61665ed6b01ae34e79fb316e9d4189e15 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 11 Aug 2022 18:29:49 +0100 Subject: [PATCH 024/260] Fixing validation for datasource plugins. --- packages/cli/package.json | 6 +++--- packages/cli/src/plugins/validate.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 4f1cc8d4cd..7ea6111662 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "1.2.28-alpha.0", - "@budibase/string-templates": "1.2.28-alpha.0", - "@budibase/types": "1.2.28-alpha.0", + "@budibase/backend-core": "^1.2.38", + "@budibase/string-templates": "^1.2.38", + "@budibase/types": "^1.2.38", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/cli/src/plugins/validate.js b/packages/cli/src/plugins/validate.js index b460670c7f..4c2fa6ba53 100644 --- a/packages/cli/src/plugins/validate.js +++ b/packages/cli/src/plugins/validate.js @@ -1,5 +1,5 @@ const { PluginTypes } = require("./constants") -const { DatasourceFieldTypes, QueryTypes } = require("@budibase/types") +const { DatasourceFieldType, QueryType } = require("@budibase/types") const joi = require("joi") const DATASOURCE_TYPES = [ @@ -36,7 +36,7 @@ function validateDatasource(schema) { const fieldValidator = joi.object({ type: joi .string() - .allow(...Object.values(DatasourceFieldTypes)) + .allow(...Object.values(DatasourceFieldType)) .required(), required: joi.boolean().required(), default: joi.any(), @@ -45,7 +45,7 @@ function validateDatasource(schema) { const queryValidator = joi .object({ - type: joi.string().allow(...Object.values(QueryTypes)), + type: joi.string().allow(...Object.values(QueryType)), fields: joi.object().pattern(joi.string(), fieldValidator), }) .required() From 6fc70fa0abb1537dd7db73d112a202c7535cc6fc Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 12 Aug 2022 13:18:21 +0100 Subject: [PATCH 025/260] Fixing types. --- packages/cli/yarn.lock | 29 +- packages/server/yarn.lock | 634 +----------------- .../types/src/documents/app/datasource.ts | 69 -- packages/types/src/index.ts | 2 - 4 files changed, 38 insertions(+), 696 deletions(-) diff --git a/packages/cli/yarn.lock b/packages/cli/yarn.lock index 93157892dd..43c219fcd7 100644 --- a/packages/cli/yarn.lock +++ b/packages/cli/yarn.lock @@ -43,19 +43,18 @@ "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" -"@budibase/backend-core@1.2.28-alpha.0": - version "1.2.28-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.28-alpha.0.tgz#f4253825724327e6552000f8c7575134bfaa05cd" - integrity sha512-ueu+NZgkiKrX49E0Zy2rrNE4NLe2HAyl3VolTrZfVxOzu1IvtQ/wJBcGDG84VvSliP+0bOOVO9TiGMY3bvZ/Hw== +"@budibase/backend-core@^1.2.38": + version "1.2.38" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.38.tgz#9451ae72f6af8cff3aa0a57dc61fc8d3505a77a0" + integrity sha512-g7m4fHG1tLqNsSvdSltqRHLASOH5n3QBbN5DD7cmSBIVpUtDCA0EMx/L0vkDDhTmbOQApXAW3cyJs6H3QiWtOw== dependencies: - "@budibase/types" "1.2.28-alpha.0" + "@budibase/types" "^1.2.38" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" dotenv "16.0.1" emitter-listener "1.1.2" ioredis "4.28.0" - joi "17.6.0" jsonwebtoken "8.5.1" koa-passport "4.1.4" lodash "4.17.21" @@ -102,10 +101,10 @@ to-gfm-code-block "^0.1.1" year "^0.2.1" -"@budibase/string-templates@1.2.28-alpha.0": - version "1.2.28-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/string-templates/-/string-templates-1.2.28-alpha.0.tgz#895571c142bcd68852f87e06a395232b3eb5516a" - integrity sha512-nXqa0IlSVW0og8NAJUW+ihUhdW8+rK0tskGWIwF+gEfAKd9NMyxoLswIAb7aYLmwdRRJFwhrpMEuF7ed8AojSQ== +"@budibase/string-templates@^1.2.38": + version "1.2.38" + resolved "https://registry.yarnpkg.com/@budibase/string-templates/-/string-templates-1.2.38.tgz#404804df516fb981b4f073f09bab64c9111cecb0" + integrity sha512-JRIAZVuuBECxDBcbx5FOYRRKi1ZyW7//LwKL5U1r9sIVCIxCW1t5b175oTnR9/bkktNs7X2ziynH/tsT5GVC0g== dependencies: "@budibase/handlebars-helpers" "^0.11.8" dayjs "^1.10.4" @@ -114,10 +113,10 @@ lodash "^4.17.20" vm2 "^3.9.4" -"@budibase/types@1.2.28-alpha.0": - version "1.2.28-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.28-alpha.0.tgz#61668b7d5d9b1f85c09d658deed87ec3dc28e290" - integrity sha512-tYhdUl1+dEtG8h2xoGUl0NXZC5BZYQIhgPK7JkYrqFHuNx+1f6EoHPQ9MMb/WyOxIDZv4gY7QJLg0KeVflofbw== +"@budibase/types@^1.2.38": + version "1.2.38" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.38.tgz#472f4ec891242488561a8cfc175961664bc7ac88" + integrity sha512-pMKh4FKhPoa1pge4FKqPi3gbzZp3HJ1RuhM5naKFqC1yompIn/Es+YNft39VC2bTW5tiGbucMcjWzdpMwTSTVw== "@eslint/eslintrc@^0.4.3": version "0.4.3" @@ -2485,7 +2484,7 @@ jmespath@0.15.0: resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.15.0.tgz#a3f222a9aae9f966f5d27c796510e28091764217" integrity sha512-+kHj8HXArPfpPEKGLZ+kB5ONRTCiGQXo8RQYL0hH8t6pWXUBBK5KkkQmTNOwKK4LEsd0yTsgtjJVm4UBSZea4w== -joi@17.6.0, joi@^17.6.0: +joi@^17.6.0: version "17.6.0" resolved "https://registry.yarnpkg.com/joi/-/joi-17.6.0.tgz#0bb54f2f006c09a96e75ce687957bd04290054b2" integrity sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw== diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 8545343645..a8dea20e95 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.28-alpha.0": - version "1.2.28-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.28-alpha.0.tgz#f4253825724327e6552000f8c7575134bfaa05cd" - integrity sha512-ueu+NZgkiKrX49E0Zy2rrNE4NLe2HAyl3VolTrZfVxOzu1IvtQ/wJBcGDG84VvSliP+0bOOVO9TiGMY3bvZ/Hw== +"@budibase/backend-core@1.2.39-alpha.0": + version "1.2.39-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.39-alpha.0.tgz#52a1d340d28fa714822827aeb843e1f097ad8f60" + integrity sha512-yHvWAUH1j8+UJx8hYl11iAGOpxmkxSbzf7qVCJ8a84Ms46Clmwp+qxtnDzKxMit2KJW72dJM9+PvI+OUG0Bixg== dependencies: - "@budibase/types" "1.2.28-alpha.0" + "@budibase/types" "1.2.39-alpha.0" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1128,59 +1128,6 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/bbui@1.2.28-alpha.0": - version "1.2.28-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/bbui/-/bbui-1.2.28-alpha.0.tgz#579afbccb824a2ade16a6632d82615dfc90fcfc8" - integrity sha512-61xgvHMJM5xWSNo6mva2toywXLM7KuF8Ly4mOgH/coKsS5DQj6v+8NXXbRTVtVy7i6rbeFjCs2fzTeEC6bW/ig== - dependencies: - "@adobe/spectrum-css-workflow-icons" "^1.2.1" - "@budibase/string-templates" "1.2.28-alpha.0" - "@spectrum-css/actionbutton" "^1.0.1" - "@spectrum-css/actiongroup" "^1.0.1" - "@spectrum-css/avatar" "^3.0.2" - "@spectrum-css/button" "^3.0.1" - "@spectrum-css/buttongroup" "^3.0.2" - "@spectrum-css/checkbox" "^3.0.2" - "@spectrum-css/dialog" "^3.0.1" - "@spectrum-css/divider" "^1.0.3" - "@spectrum-css/dropzone" "^3.0.2" - "@spectrum-css/fieldgroup" "^3.0.2" - "@spectrum-css/fieldlabel" "^3.0.1" - "@spectrum-css/icon" "^3.0.1" - "@spectrum-css/illustratedmessage" "^3.0.2" - "@spectrum-css/inlinealert" "^2.0.1" - "@spectrum-css/inputgroup" "^3.0.2" - "@spectrum-css/label" "^2.0.10" - "@spectrum-css/link" "^3.1.1" - "@spectrum-css/menu" "^3.0.1" - "@spectrum-css/modal" "^3.0.1" - "@spectrum-css/pagination" "^3.0.3" - "@spectrum-css/picker" "^1.0.1" - "@spectrum-css/popover" "^3.0.1" - "@spectrum-css/progressbar" "^1.0.2" - "@spectrum-css/progresscircle" "^1.0.2" - "@spectrum-css/radio" "^3.0.2" - "@spectrum-css/search" "^3.0.2" - "@spectrum-css/sidenav" "^3.0.2" - "@spectrum-css/slider" "3.0.1" - "@spectrum-css/statuslight" "^3.0.2" - "@spectrum-css/stepper" "^3.0.3" - "@spectrum-css/switch" "^1.0.2" - "@spectrum-css/table" "^3.0.1" - "@spectrum-css/tabs" "^3.2.12" - "@spectrum-css/tags" "^3.0.2" - "@spectrum-css/textfield" "^3.0.1" - "@spectrum-css/toast" "^3.0.1" - "@spectrum-css/tooltip" "^3.0.3" - "@spectrum-css/treeview" "^3.0.2" - "@spectrum-css/typography" "^3.0.1" - "@spectrum-css/underlay" "^2.0.9" - "@spectrum-css/vars" "^3.0.1" - dayjs "^1.10.4" - easymde "^2.16.1" - svelte-flatpickr "^3.2.3" - svelte-portal "^1.0.0" - "@budibase/bbui@^0.9.139": version "0.9.190" resolved "https://registry.yarnpkg.com/@budibase/bbui/-/bbui-0.9.190.tgz#e1ec400ac90f556bfbc80fc23a04506f1585ea81" @@ -1231,77 +1178,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/client@1.2.28-alpha.0": - version "1.2.28-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/client/-/client-1.2.28-alpha.0.tgz#5f166cfc619848d308f0f7ba90d291220bb38ed8" - integrity sha512-DjMIafaBeDmL/tOmTCFSNOowcP33E+a3e02g7Y1oDzRei9o7zpsxSLXEUVNvLl+XtvR9PNe4krXrsv4MDPoQ6Q== +"@budibase/pro@1.2.39-alpha.0": + version "1.2.39-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.39-alpha.0.tgz#272e3ffd5e2189c787df6b6fbe22b7084832ade7" + integrity sha512-B0XakaUHW2Y1RtkEcrPEBcp8CDFJ8/fC9agLI3WK0ARnTGx9ROd8Liokq3/pW3vmlOgsfijzNHL3LUYcPTMEXw== dependencies: - "@budibase/bbui" "1.2.28-alpha.0" - "@budibase/frontend-core" "1.2.28-alpha.0" - "@budibase/string-templates" "1.2.28-alpha.0" - "@spectrum-css/button" "^3.0.3" - "@spectrum-css/card" "^3.0.3" - "@spectrum-css/divider" "^1.0.3" - "@spectrum-css/link" "^3.1.3" - "@spectrum-css/page" "^3.0.1" - "@spectrum-css/tag" "^3.1.4" - "@spectrum-css/typography" "^3.0.2" - "@spectrum-css/vars" "^3.0.1" - apexcharts "^3.22.1" - dayjs "^1.10.5" - downloadjs "1.4.7" - leaflet "^1.7.1" - regexparam "^1.3.0" - rollup-plugin-polyfill-node "^0.8.0" - sanitize-html "^2.7.0" - screenfull "^6.0.1" - shortid "^2.2.15" - svelte "^3.49.0" - svelte-apexcharts "^1.0.2" - svelte-flatpickr "^3.1.0" - svelte-spa-router "^3.0.5" - -"@budibase/frontend-core@1.2.28-alpha.0": - version "1.2.28-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/frontend-core/-/frontend-core-1.2.28-alpha.0.tgz#dfe135acfce25fcdff4e4c7ed88c4d974c674858" - integrity sha512-uPZuVpJrJr9aX0QdrwkL+m78X46RUpcKg04KtcETvdvyUmPndz5Z7zr9j2Fo02Kt8c4lKRrpQgHL8gnDwwHSeg== - dependencies: - "@budibase/bbui" "1.2.28-alpha.0" - lodash "^4.17.21" - svelte "^3.46.2" - -"@budibase/handlebars-helpers@^0.11.8": - version "0.11.8" - resolved "https://registry.yarnpkg.com/@budibase/handlebars-helpers/-/handlebars-helpers-0.11.8.tgz#6953d29673a8c5c407e096c0a84890465c7ce841" - integrity sha512-ggWJUt0GqsHFAEup5tlWlcrmYML57nKhpNGGLzVsqXVYN8eVmf3xluYmmMe7fDYhQH0leSprrdEXmsdFQF3HAQ== - dependencies: - array-sort "^1.0.0" - define-property "^2.0.2" - extend-shallow "^3.0.2" - for-in "^1.0.2" - get-object "^0.2.0" - get-value "^3.0.1" - handlebars "^4.7.7" - handlebars-utils "^1.0.6" - has-value "^2.0.2" - helper-md "^0.2.2" - html-tag "^2.0.0" - is-even "^1.0.0" - is-glob "^4.0.1" - kind-of "^6.0.3" - micromatch "^3.1.5" - relative "^3.0.2" - striptags "^3.1.1" - to-gfm-code-block "^0.1.1" - year "^0.2.1" - -"@budibase/pro@1.2.28-alpha.0": - version "1.2.28-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.28-alpha.0.tgz#f372dcbac55634a1f0e7ff8125ffb0a0aeea086c" - integrity sha512-YxElWs5gwpe1JmHgpB52YeRkyeWPoBiUIt8EshyW90EFVUXP7FOy3LsjvKMNJXAZs1mI4ttkZfuWva8HjrGaKA== - dependencies: - "@budibase/backend-core" "1.2.28-alpha.0" - "@budibase/types" "1.2.28-alpha.0" + "@budibase/backend-core" "1.2.39-alpha.0" + "@budibase/types" "1.2.39-alpha.0" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1324,22 +1207,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/string-templates@1.2.28-alpha.0": - version "1.2.28-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/string-templates/-/string-templates-1.2.28-alpha.0.tgz#895571c142bcd68852f87e06a395232b3eb5516a" - integrity sha512-nXqa0IlSVW0og8NAJUW+ihUhdW8+rK0tskGWIwF+gEfAKd9NMyxoLswIAb7aYLmwdRRJFwhrpMEuF7ed8AojSQ== - dependencies: - "@budibase/handlebars-helpers" "^0.11.8" - dayjs "^1.10.4" - handlebars "^4.7.6" - handlebars-utils "^1.0.6" - lodash "^4.17.20" - vm2 "^3.9.4" - -"@budibase/types@1.2.28-alpha.0": - version "1.2.28-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.28-alpha.0.tgz#61668b7d5d9b1f85c09d658deed87ec3dc28e290" - integrity sha512-tYhdUl1+dEtG8h2xoGUl0NXZC5BZYQIhgPK7JkYrqFHuNx+1f6EoHPQ9MMb/WyOxIDZv4gY7QJLg0KeVflofbw== +"@budibase/types@1.2.39-alpha.0": + version "1.2.39-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.39-alpha.0.tgz#d0d48e4da36a93a4a9354cc49663f38d0181b6c0" + integrity sha512-i+lQeqlKmFORLuKdwmKnlmCCCEXZH6NdXHrOqNcebJzcNlx3Gx342+cHe4ZGYu0L+wCkWWelD5XHFuNMVMcuHg== "@bull-board/api@3.7.0": version "3.7.0" @@ -2268,24 +2139,6 @@ resolved "https://registry.yarnpkg.com/@redis/time-series/-/time-series-1.0.3.tgz#4cfca8e564228c0bddcdf4418cba60c20b224ac4" integrity sha512-OFp0q4SGrTH0Mruf6oFsHGea58u8vS/iI5+NpYdicaM+7BgqBZH8FFvNZ8rYYLrUO/QRqMq72NpXmxLVNcdmjA== -"@rollup/plugin-inject@^4.0.0": - version "4.0.4" - resolved "https://registry.yarnpkg.com/@rollup/plugin-inject/-/plugin-inject-4.0.4.tgz#fbeee66e9a700782c4f65c8b0edbafe58678fbc2" - integrity sha512-4pbcU4J/nS+zuHk+c+OL3WtmEQhqxlZ9uqfjQMQDOHOPld7PsCd8k5LWs8h5wjwJN7MgnAn768F2sDxEP4eNFQ== - dependencies: - "@rollup/pluginutils" "^3.1.0" - estree-walker "^2.0.1" - magic-string "^0.25.7" - -"@rollup/pluginutils@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" - integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== - dependencies: - "@types/estree" "0.0.39" - estree-walker "^1.0.1" - picomatch "^2.2.2" - "@sendgrid/client@^7.1.1": version "7.7.0" resolved "https://registry.yarnpkg.com/@sendgrid/client/-/client-7.7.0.tgz#f8f67abd604205a0d0b1af091b61517ef465fdbf" @@ -2567,11 +2420,6 @@ resolved "https://registry.yarnpkg.com/@spectrum-css/sidenav/-/sidenav-3.0.23.tgz#c218560d472e13a3e0d1499b762df1206dcffbfd" integrity sha512-4IFw2/HMQJRzM0M2c5na/HeY7y5vJoGpMFBkXNpQyhW4TRo7N1rGwYQ5dRD3s4OVEWV4/rjfGV0d/qhfwKUTog== -"@spectrum-css/slider@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/slider/-/slider-3.0.1.tgz#5281e6f47eb5a4fd3d1816c138bf66d01d7f2e49" - integrity sha512-DI2dtMRnQuDM1miVzl3SGyR1khUEKnwdXfO5EHDFwkC3yav43F5QogkfjmjFmWWobMVovdJlAuiaaJ/IHejD0Q== - "@spectrum-css/statuslight@^3.0.2": version "3.0.8" resolved "https://registry.yarnpkg.com/@spectrum-css/statuslight/-/statuslight-3.0.8.tgz#3b0ea80712573679870a85d469850230e794a0f7" @@ -2597,16 +2445,6 @@ resolved "https://registry.yarnpkg.com/@spectrum-css/tabs/-/tabs-3.2.16.tgz#c3f7800d8d6f7c9930c28cd01354816328bf72b1" integrity sha512-JUcMB/fiDG/KoyrVstlUMacFJUY4OHKqhMRuPtu9ggUXWCRbSkY8he92v6u0HwY3DuhDoOxNTK8d/PLjk/fsbg== -"@spectrum-css/tabs@^3.2.12": - version "3.2.19" - resolved "https://registry.yarnpkg.com/@spectrum-css/tabs/-/tabs-3.2.19.tgz#2eae3a2c4760466882db08281365d502c3f22ebf" - integrity sha512-SNGFf/karBr/GNz5GNWnbppFz6uEOGecv6D8WA1ZLeWkjg4gG5e4M9XmPcB32v350e1PTRG7KwWDce48qWAKCQ== - -"@spectrum-css/tag@^3.1.4": - version "3.3.14" - resolved "https://registry.yarnpkg.com/@spectrum-css/tag/-/tag-3.3.14.tgz#2d1ca0759da6a3a2970d14bcabf33bd4a8f63a5f" - integrity sha512-S4RUaxN/83Pr/SYkQHeZNh2NXmtumUEzhrsrrliI6bAt3bjs+mLresTGd9qkIX2+Ycq1JHWTr0HTga4ti1YYyA== - "@spectrum-css/tags@^3.0.2": version "3.0.3" resolved "https://registry.yarnpkg.com/@spectrum-css/tags/-/tags-3.0.3.tgz#fc76d2735cdc442de91b7eb3bee49a928c0767ac" @@ -2784,13 +2622,6 @@ resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.2.tgz#f65d3d6389e01eeb458bd54dc8f52b95a9463bc8" integrity sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w== -"@types/codemirror@^5.60.4": - version "5.60.5" - resolved "https://registry.yarnpkg.com/@types/codemirror/-/codemirror-5.60.5.tgz#5b989a3b4bbe657458cf372c92b6bfda6061a2b7" - integrity sha512-TiECZmm8St5YxjFUp64LK0c8WU5bxMDt9YaAek1UqUb9swrSCoJhh92fWu1p3mTEqlHjhB5sY7OFBhWroJXZVg== - dependencies: - "@types/tern" "*" - "@types/connect@*": version "3.4.35" resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" @@ -2839,11 +2670,6 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== -"@types/estree@0.0.39": - version "0.0.39" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" - integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== - "@types/express-serve-static-core@^4.17.18": version "4.17.28" resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz#c47def9f34ec81dc6328d0b1b5303d1ec98d86b8" @@ -2987,11 +2813,6 @@ resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== -"@types/marked@^4.0.1": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@types/marked/-/marked-4.0.3.tgz#2098f4a77adaba9ce881c9e0b6baf29116e5acc4" - integrity sha512-HnMWQkLJEf/PnxZIfbm0yGJRRZYYMhb++O9M36UCTA9z53uPvVoSlAwJr3XOpDEryb7Hwl1qAx/MV6YIW1RXxg== - "@types/mime@^1": version "1.3.2" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" @@ -3127,13 +2948,6 @@ "@types/cookiejar" "*" "@types/node" "*" -"@types/tern@*": - version "0.23.4" - resolved "https://registry.yarnpkg.com/@types/tern/-/tern-0.23.4.tgz#03926eb13dbeaf3ae0d390caf706b2643a0127fb" - integrity sha512-JAUw1iXGO1qaWwEOzxTKJZ/5JxVeON9kvGZ/osgZaJImBnyjyn0cjovPsf6FNLmyGY8Vw9DoXZCMlfMkMwHRWg== - dependencies: - "@types/estree" "*" - "@types/tough-cookie@*": version "4.0.2" resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.2.tgz#6286b4c7228d58ab7866d19716f3696e03a09397" @@ -3718,7 +3532,7 @@ arg@^4.1.0: resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== -argparse@^1.0.10, argparse@^1.0.7: +argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== @@ -3765,15 +3579,6 @@ array-equal@^1.0.0: resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" integrity sha512-H3LU5RLiSsGXPhN+Nipar0iR0IofH+8r89G2y1tBKxQ/agagKyAjhkAFDRBfodP2caPrNKHpAWNIM/c9yeL7uA== -array-sort@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-sort/-/array-sort-1.0.0.tgz#e4c05356453f56f53512a7d1d6123f2c54c0a88a" - integrity sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg== - dependencies: - default-compare "^1.0.0" - get-value "^2.0.6" - kind-of "^5.0.2" - array-union@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" @@ -3905,13 +3710,6 @@ atomic-sleep@^1.0.0: resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" integrity sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ== -autolinker@~0.28.0: - version "0.28.1" - resolved "https://registry.yarnpkg.com/autolinker/-/autolinker-0.28.1.tgz#0652b491881879f0775dace0cdca3233942a4e47" - integrity sha512-zQAFO1Dlsn69eXaO6+7YZc+v84aquQKbwpzCE3L0stj56ERn9hutFxPopViLjo9G+rWwjozRhgS5KJ25Xy19cQ== - dependencies: - gulp-header "^1.7.1" - available-typed-arrays@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" @@ -4744,18 +4542,6 @@ co@^4.6.0: resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== -codemirror-spell-checker@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/codemirror-spell-checker/-/codemirror-spell-checker-1.1.2.tgz#1c660f9089483ccb5113b9ba9ca19c3f4993371e" - integrity sha512-2Tl6n0v+GJRsC9K3MLCdLaMOmvWL0uukajNJseorZJsslaxZyZMgENocPU8R0DyoTAiKsyqiemSOZo7kjGV0LQ== - dependencies: - typo-js "*" - -codemirror@^5.63.1: - version "5.65.7" - resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.65.7.tgz#29af41ce5f4c2b8f1c1e16f4e645ff392823716a" - integrity sha512-zb67cXzgugIQmb6tfD4G11ILjYoMfTjwcjn+cWsa4GewlI2adhR/h3kolkoCQTm1msD/1BuqVTKuO09ELsS++A== - collect-v8-coverage@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" @@ -4906,13 +4692,6 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -concat-with-sourcemaps@*: - version "1.1.0" - resolved "https://registry.yarnpkg.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz#d4ea93f05ae25790951b99e7b3b09e3908a4082e" - integrity sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg== - dependencies: - source-map "^0.6.1" - condense-newlines@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/condense-newlines/-/condense-newlines-0.2.1.tgz#3de985553139475d32502c83b02f60684d24c55f" @@ -5319,13 +5098,6 @@ deepmerge@^4.2.2: resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== -default-compare@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/default-compare/-/default-compare-1.0.0.tgz#cb61131844ad84d84788fb68fd01681ca7781a2f" - integrity sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ== - dependencies: - kind-of "^5.0.2" - default-shell@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/default-shell/-/default-shell-1.0.1.tgz#752304bddc6174f49eb29cb988feea0b8813c8bc" @@ -5493,25 +5265,11 @@ doctrine@3.0.0, doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dom-serializer@^1.0.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.4.1.tgz#de5d41b1aea290215dc45a6dae8adcf1d32e2d30" - integrity sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag== - dependencies: - domelementtype "^2.0.1" - domhandler "^4.2.0" - entities "^2.0.0" - dom-walk@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84" integrity sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w== -domelementtype@^2.0.1, domelementtype@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" - integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== - domexception@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" @@ -5526,22 +5284,6 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" -domhandler@^4.0.0, domhandler@^4.2.0: - version "4.3.1" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.1.tgz#8d792033416f59d68bc03a5aa7b018c1ca89279c" - integrity sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ== - dependencies: - domelementtype "^2.2.0" - -domutils@^2.5.2: - version "2.8.0" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" - integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A== - dependencies: - dom-serializer "^1.0.1" - domelementtype "^2.2.0" - domhandler "^4.2.0" - dot-prop@^5.2.0: version "5.3.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" @@ -5586,11 +5328,6 @@ download@8.0.0: p-event "^2.1.0" pify "^4.0.1" -downloadjs@1.4.7: - version "1.4.7" - resolved "https://registry.yarnpkg.com/downloadjs/-/downloadjs-1.4.7.tgz#f69f96f940e0d0553dac291139865a3cd0101e3c" - integrity sha512-LN1gO7+u9xjU5oEScGFKvXhYf7Y/empUIIEAGBs1LzUq/rg5duiDrkuH5A2lQGd5jfMOb9X9usDa2oVXwJ0U/Q== - duplexer3@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" @@ -5606,17 +5343,6 @@ duplexify@^4.0.0: readable-stream "^3.1.1" stream-shift "^1.0.0" -easymde@^2.16.1: - version "2.16.1" - resolved "https://registry.yarnpkg.com/easymde/-/easymde-2.16.1.tgz#f4c2380312615cb33826f1a1fecfaa4022ff551a" - integrity sha512-FihYgjRsKfhGNk89SHSqxKLC4aJ1kfybPWW6iAmtb5GnXu+tnFPSzSaGBmk1RRlCuhFSjhF0SnIMGVPjEzkr6g== - dependencies: - "@types/codemirror" "^5.60.4" - "@types/marked" "^4.0.1" - codemirror "^5.63.1" - codemirror-spell-checker "1.1.2" - marked "^4.0.10" - ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -5728,16 +5454,6 @@ enhanced-resolve@^5.9.3: graceful-fs "^4.2.4" tapable "^2.2.0" -ent@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" - integrity sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA== - -entities@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" - integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== - entities@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" @@ -6171,16 +5887,6 @@ estraverse@^5.1.0, estraverse@^5.2.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== -estree-walker@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" - integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== - -estree-walker@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" - integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== - esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" @@ -6730,11 +6436,6 @@ fs-constants@^1.0.0: resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-exists-sync@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz#982d6893af918e72d08dec9e8673ff2b5a8d6add" - integrity sha512-cR/vflFyPZtrN6b38ZyWxpWdhlXrzZEBawlpBQMq7033xVY7/kg0GDMBK5jg8lDYQckdJ5x/YC88lM3C7VMsLg== - fs-extra@8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" @@ -6883,14 +6584,6 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: has "^1.0.3" has-symbols "^1.0.3" -get-object@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/get-object/-/get-object-0.2.0.tgz#d92ff7d5190c64530cda0543dac63a3d47fe8c0c" - integrity sha512-7P6y6k6EzEFmO/XyUyFlXm1YLJy9xeA1x/grNV8276abX5GuwUtYgKFkRFkLixw4hf4Pz9q2vgv/8Ar42R0HuQ== - dependencies: - is-number "^2.0.2" - isobject "^0.2.0" - get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" @@ -6953,13 +6646,6 @@ get-value@^2.0.3, get-value@^2.0.6: resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" integrity sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA== -get-value@^3.0.0, get-value@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-3.0.1.tgz#5efd2a157f1d6a516d7524e124ac52d0a39ef5a8" - integrity sha512-mKZj9JLQrwMBtj5wxi6MH8Z5eSKaERpAwjg43dPtlGI1ZVEgH/qC7T8/6R2OBSUA+zzHBZgICsVJaEIV2tKTDA== - dependencies: - isobject "^3.0.1" - getopts@2.2.5: version "2.2.5" resolved "https://registry.yarnpkg.com/getopts/-/getopts-2.2.5.tgz#67a0fe471cacb9c687d817cab6450b96dde8313b" @@ -7265,24 +6951,7 @@ gtoken@^5.0.4: google-p12-pem "^3.1.3" jws "^4.0.0" -gulp-header@^1.7.1: - version "1.8.12" - resolved "https://registry.yarnpkg.com/gulp-header/-/gulp-header-1.8.12.tgz#ad306be0066599127281c4f8786660e705080a84" - integrity sha512-lh9HLdb53sC7XIZOYzTXM4lFuXElv3EVkSDhsd7DoJBj7hm+Ni7D3qYbb+Rr8DuM8nRanBvkVO9d7askreXGnQ== - dependencies: - concat-with-sourcemaps "*" - lodash.template "^4.4.0" - through2 "^2.0.0" - -handlebars-utils@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/handlebars-utils/-/handlebars-utils-1.0.6.tgz#cb9db43362479054782d86ffe10f47abc76357f9" - integrity sha512-d5mmoQXdeEqSKMtQQZ9WkiUcO1E3tPbWxluCK9hVgIDPzQa9WsKo3Lbe/sGflTe7TomHEeZaOgwIkyIr1kfzkw== - dependencies: - kind-of "^6.0.0" - typeof-article "^0.1.1" - -handlebars@^4.7.6, handlebars@^4.7.7: +handlebars@^4.7.7: version "4.7.7" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== @@ -7376,14 +7045,6 @@ has-value@^1.0.0: has-values "^1.0.0" isobject "^3.0.0" -has-value@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-2.0.2.tgz#d0f12e8780ba8e90e66ad1a21c707fdb67c25658" - integrity sha512-ybKOlcRsK2MqrM3Hmz/lQxXHZ6ejzSPzpNabKB45jb5qDgJvKPa3SdapTsTLwEb9WltgWpOmNax7i+DzNOk4TA== - dependencies: - get-value "^3.0.0" - has-values "^2.0.1" - has-values@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" @@ -7397,13 +7058,6 @@ has-values@^1.0.0: is-number "^3.0.0" kind-of "^4.0.0" -has-values@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-2.0.1.tgz#3876200ff86d8a8546a9264a952c17d5fc17579d" - integrity sha512-+QdH3jOmq9P8GfdjFg0eJudqx1FqU62NQJ4P16rOEHeRdl7ckgwn6uqQjzYE0ZoHVV/e5E2esuJ5Gl5+HUW19w== - dependencies: - kind-of "^6.0.2" - has-yarn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77" @@ -7416,16 +7070,6 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -helper-md@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/helper-md/-/helper-md-0.2.2.tgz#c1f59d7e55bbae23362fd8a0e971607aec69d41f" - integrity sha512-49TaQzK+Ic7ZVTq4i1UZxRUJEmAilTk8hz7q4I0WNUaTclLR8ArJV5B3A1fe1xF2HtsDTr2gYKLaVTof/Lt84Q== - dependencies: - ent "^2.2.0" - extend-shallow "^2.0.1" - fs-exists-sync "^0.1.0" - remarkable "^1.6.2" - homedir-polyfill@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" @@ -7462,24 +7106,6 @@ html-escaper@^2.0.0: resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -html-tag@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/html-tag/-/html-tag-2.0.0.tgz#36c3bc8d816fd30b570d5764a497a641640c2fed" - integrity sha512-XxzooSo6oBoxBEUazgjdXj7VwTn/iSTSZzTYKzYY6I916tkaYzypHxy+pbVU1h+0UQ9JlVf5XkNQyxOAiiQO1g== - dependencies: - is-self-closing "^1.0.1" - kind-of "^6.0.0" - -htmlparser2@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-6.1.0.tgz#c4d762b6c3371a05dbe65e94ae43a9f845fb8fb7" - integrity sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A== - dependencies: - domelementtype "^2.0.1" - domhandler "^4.0.0" - domutils "^2.5.2" - entities "^2.0.0" - http-assert@^1.3.0: version "1.5.0" resolved "https://registry.yarnpkg.com/http-assert/-/http-assert-1.5.0.tgz#c389ccd87ac16ed2dfa6246fd73b926aa00e6b8f" @@ -7920,13 +7546,6 @@ is-docker@^2.0.0, is-docker@^2.1.1: resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== -is-even@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-even/-/is-even-1.0.0.tgz#76b5055fbad8d294a86b6a949015e1c97b717c06" - integrity sha512-LEhnkAdJqic4Dbqn58A0y52IXoHWlsueqQkKfMfdEnIYG8A1sm/GHidKkS6yvXlMoRrkM34csHnXQtOqcb+Jzg== - dependencies: - is-odd "^0.1.2" - is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -8016,13 +7635,6 @@ is-number-object@^1.0.4: dependencies: has-tostringtag "^1.0.0" -is-number@^2.0.2: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - integrity sha512-QUzH43Gfb9+5yckcrSA0VBDwEtDUchrk4F6tfJZQuNzDJbEDB9cZNzSfXGQ1jqmdDY/kl41lUOWM9syA8z8jlg== - dependencies: - kind-of "^3.0.2" - is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" @@ -8045,13 +7657,6 @@ is-object@^1.0.1: resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf" integrity sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA== -is-odd@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-0.1.2.tgz#bc573b5ce371ef2aad6e6f49799b72bef13978a7" - integrity sha512-Ri7C2K7o5IrUU9UEI8losXJCCD/UtsaIrkR5sxIcFg4xQ9cRJXlWA5DQvTE0yDc0krvSNLsRGXN11UPS6KyfBw== - dependencies: - is-number "^3.0.0" - is-path-inside@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" @@ -8069,11 +7674,6 @@ is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" -is-plain-object@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" - integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== - is-potential-custom-element-name@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" @@ -8102,13 +7702,6 @@ is-retry-allowed@^2.2.0: resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-2.2.0.tgz#88f34cbd236e043e71b6932d09b0c65fb7b4d71d" integrity sha512-XVm7LOeLpTW4jV19QSH38vkswxoLud8sQ57YwJVTPWdiaI9I8keEhGFpBlslyVsgdQy4Opg8QOLb8YRgsyZiQg== -is-self-closing@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-self-closing/-/is-self-closing-1.0.1.tgz#5f406b527c7b12610176320338af0fa3896416e4" - integrity sha512-E+60FomW7Blv5GXTlYee2KDrnG6srxF7Xt1SjrhWUGUEsTFIqY/nq2y3DaftCsgUMdh89V07IVfhY9KIJhLezg== - dependencies: - self-closing-tags "^1.0.1" - is-shared-array-buffer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" @@ -8219,11 +7812,6 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -isobject@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-0.2.0.tgz#a3432192f39b910b5f02cc989487836ec70aa85e" - integrity sha512-VaWq6XYAsbvM0wf4dyBO7WH9D7GosB7ZZlqrawI9BBiTMINBeCyqSKBa35m870MY3O4aM31pYyZi9DfGrYMJrQ== - isobject@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" @@ -9404,7 +8992,7 @@ keyv@^3.0.0: dependencies: json-buffer "3.0.0" -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.1.0, kind-of@^3.2.0: +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ== @@ -9418,12 +9006,12 @@ kind-of@^4.0.0: dependencies: is-buffer "^1.1.5" -kind-of@^5.0.0, kind-of@^5.0.2: +kind-of@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== -kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: +kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== @@ -9683,11 +9271,6 @@ lcid@^2.0.0: dependencies: invert-kv "^2.0.0" -leaflet@^1.7.1: - version "1.8.0" - resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.8.0.tgz#4615db4a22a304e8e692cae9270b983b38a2055e" - integrity sha512-gwhMjFCQiYs3x/Sf+d49f10ERXaEFCPr+nVTryhAW8DWbMGqJqt9G4XuIaHmFW08zYvhgdzqXGr8AlW8v8dQkA== - left-pad@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" @@ -9882,11 +9465,6 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -lodash._reinterpolate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" - integrity sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA== - lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" @@ -9997,21 +9575,6 @@ lodash.sortby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA== -lodash.template@^4.4.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" - integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A== - dependencies: - lodash._reinterpolate "^3.0.0" - lodash.templatesettings "^4.0.0" - -lodash.templatesettings@^4.0.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz#e481310f049d3cf6d47e912ad09313b154f0fb33" - integrity sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ== - dependencies: - lodash._reinterpolate "^3.0.0" - lodash.without@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.without/-/lodash.without-4.4.0.tgz#3cd4574a00b67bae373a94b748772640507b7aac" @@ -10022,7 +9585,7 @@ lodash.xor@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.xor/-/lodash.xor-4.5.0.tgz#4d48ed7e98095b0632582ba714d3ff8ae8fb1db6" integrity sha512-sVN2zimthq7aZ5sPGXnSz32rZPuqcparVW50chJQe+mzTYV+IsxSsl/2gnkWWE2Of7K3myBQBqtLKOUEHJKRsQ== -lodash@4.17.21, lodash@^4.14.0, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.3, lodash@^4.7.0: +lodash@4.17.21, lodash@^4.14.0, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.3, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -10090,13 +9653,6 @@ ltgt@2.2.1, ltgt@^2.1.2, ltgt@~2.2.0: resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" integrity sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA== -magic-string@^0.25.7: - version "0.25.9" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" - integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== - dependencies: - sourcemap-codec "^1.4.8" - make-dir@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" @@ -10161,11 +9717,6 @@ markdown-it@^12.2.0: mdurl "^1.0.1" uc.micro "^1.0.5" -marked@^4.0.10: - version "4.0.18" - resolved "https://registry.yarnpkg.com/marked/-/marked-4.0.18.tgz#cd0ac54b2e5610cfb90e8fd46ccaa8292c9ed569" - integrity sha512-wbLDJ7Zh0sqA0Vdg6aqlbT+yPxqLblpAZh1mK2+AO2twQkPywvvqQNfEPVwSSRjZ7dZcdeVBIAgiO7MMp3Dszw== - matcher@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/matcher/-/matcher-3.0.0.tgz#bd9060f4c5b70aa8041ccc6f80368760994f30ca" @@ -10238,7 +9789,7 @@ methods@^1.0.1, methods@^1.1.1, methods@^1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== -micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.5: +micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== @@ -10496,16 +10047,6 @@ nan@^2.12.1: resolved "https://registry.yarnpkg.com/nan/-/nan-2.16.0.tgz#664f43e45460fb98faf00edca0bb0d7b8dce7916" integrity sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA== -nanoid@^2.1.0: - version "2.1.11" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-2.1.11.tgz#ec24b8a758d591561531b4176a01e3ab4f0f0280" - integrity sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA== - -nanoid@^3.3.4: - version "3.3.4" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" - integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== - nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" @@ -11103,11 +10644,6 @@ parse-passwd@^1.0.0: resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" integrity sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q== -parse-srcset@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/parse-srcset/-/parse-srcset-1.0.2.tgz#f2bd221f6cc970a938d88556abc589caaaa2bde1" - integrity sha512-/2qh0lav6CmI15FzA3i/2Bzk2zCgQhGMkvhOhKNcBVQ1ldgpbfiNTVslmooUmWJcADi1f1kIeynbDRVzNlfR6Q== - parse5@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" @@ -11354,7 +10890,7 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3, picomatch@^2.3.1: +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -11469,15 +11005,6 @@ posix-character-classes@^0.1.0: resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg== -postcss@^8.3.11: - version "8.4.16" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.16.tgz#33a1d675fac39941f5f445db0de4db2b6e01d43c" - integrity sha512-ipHE1XBvKzm5xI7hiHCZJCSugxvsdq2mPnsq5+UF+VHCjiBvtDrlxJfMBToWaP9D5XlgNmcFGqoHmUn0EYEaRQ== - dependencies: - nanoid "^3.3.4" - picocolors "^1.0.0" - source-map-js "^1.0.2" - postgres-array@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/postgres-array/-/postgres-array-2.0.0.tgz#48f8fce054fbc69671999329b8834b772652d82e" @@ -12226,16 +11753,6 @@ regexp.prototype.flags@^1.4.3: define-properties "^1.1.3" functions-have-names "^1.2.2" -regexparam@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/regexparam/-/regexparam-2.0.1.tgz#c912f5dae371e3798100b3c9ce22b7414d0889fa" - integrity sha512-zRgSaYemnNYxUv+/5SeoHI0eJIgTL/A2pUtXUPLHQxUldagouJ9p+K6IbIZ/JiQuCEv2E2B1O11SjVQy3aMCkw== - -regexparam@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/regexparam/-/regexparam-1.3.0.tgz#2fe42c93e32a40eff6235d635e0ffa344b92965f" - integrity sha512-6IQpFBv6e5vz1QAqI+V4k8P2e/3gRrqfCJ9FI+O1FLQTO+Uz6RXZEZOPmTJ6hlGj7gkERzY5BRCv09whKP96/g== - regexpp@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" @@ -12279,21 +11796,6 @@ regjsparser@^0.8.2: dependencies: jsesc "~0.5.0" -relative@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/relative/-/relative-3.0.2.tgz#0dcd8ec54a5d35a3c15e104503d65375b5a5367f" - integrity sha512-Q5W2qeYtY9GbiR8z1yHNZ1DGhyjb4AnLEjt8iE6XfcC1QIu+FAtj3HQaO0wH28H1mX6cqNLvAqWhP402dxJGyA== - dependencies: - isobject "^2.0.0" - -remarkable@^1.6.2: - version "1.7.4" - resolved "https://registry.yarnpkg.com/remarkable/-/remarkable-1.7.4.tgz#19073cb960398c87a7d6546eaa5e50d2022fcd00" - integrity sha512-e6NKUXgX95whv7IgddywbeN/ItCkWbISmc2DiqHJb0wTrqZIexqdco5b8Z3XZoo/48IdNVKM9ZCvTPJ4F5uvhg== - dependencies: - argparse "^1.0.10" - autolinker "~0.28.0" - remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" @@ -12505,13 +12007,6 @@ roarr@^2.15.3: semver-compare "^1.0.0" sprintf-js "^1.1.2" -rollup-plugin-polyfill-node@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-polyfill-node/-/rollup-plugin-polyfill-node-0.8.0.tgz#859c070822f5e38d221e5b4238cb34aa894c2b19" - integrity sha512-C4UeKedOmOBkB3FgR+z/v9kzRwV1Q/H8xWs1u1+CNe4XOV6hINfOrcO+TredKxYvopCmr+WKUSNsFUnD1RLHgQ== - dependencies: - "@rollup/plugin-inject" "^4.0.0" - rsvp@^4.8.4: version "4.8.5" resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" @@ -12578,18 +12073,6 @@ sane@^4.0.3: minimist "^1.1.1" walker "~1.0.5" -sanitize-html@^2.7.0: - version "2.7.1" - resolved "https://registry.yarnpkg.com/sanitize-html/-/sanitize-html-2.7.1.tgz#a6c2c1a88054a79eeacfac9b0a43f1b393476901" - integrity sha512-oOpe8l4J8CaBk++2haoN5yNI5beekjuHv3JRPKUx/7h40Rdr85pemn4NkvUB3TcBP7yjat574sPlcMAyv4UQig== - dependencies: - deepmerge "^4.2.2" - escape-string-regexp "^4.0.0" - htmlparser2 "^6.0.0" - is-plain-object "^5.0.0" - parse-srcset "^1.0.2" - postcss "^8.3.11" - sanitize-s3-objectkey@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/sanitize-s3-objectkey/-/sanitize-s3-objectkey-0.0.1.tgz#efa9887cd45275b40234fb4bb12fc5754fe64e7e" @@ -12628,11 +12111,6 @@ schema-utils@^3.1.0, schema-utils@^3.1.1: ajv "^6.12.5" ajv-keywords "^3.5.2" -screenfull@^6.0.1: - version "6.0.2" - resolved "https://registry.yarnpkg.com/screenfull/-/screenfull-6.0.2.tgz#3dbe4b8c4f8f49fb8e33caa8f69d0bca730ab238" - integrity sha512-AQdy8s4WhNvUZ6P8F6PB21tSPIYKniic+Ogx0AacBMjKP1GUHN2E9URxQHtCusiwxudnCKkdy4GrHXPPJSkCCw== - search-params@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/search-params/-/search-params-3.0.0.tgz#dbc7c243058e5a33ae1e9870be91f5aced4100d8" @@ -12650,11 +12128,6 @@ seek-bzip@^1.0.5: dependencies: commander "^2.8.1" -self-closing-tags@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/self-closing-tags/-/self-closing-tags-1.0.1.tgz#6c5fa497994bb826b484216916371accee490a5d" - integrity sha512-7t6hNbYMxM+VHXTgJmxwgZgLGktuXtVVD5AivWzNTdJBM4DBjnDKDzkf2SrNjihaArpeJYNjxkELBu1evI4lQA== - semver-compare@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" @@ -12790,13 +12263,6 @@ shimmer@^1.2.0: resolved "https://registry.yarnpkg.com/shimmer/-/shimmer-1.2.1.tgz#610859f7de327b587efebf501fb43117f9aff337" integrity sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw== -shortid@^2.2.15: - version "2.2.16" - resolved "https://registry.yarnpkg.com/shortid/-/shortid-2.2.16.tgz#b742b8f0cb96406fd391c76bfc18a67a57fe5608" - integrity sha512-Ugt+GIZqvGXCIItnsL+lvFJOiN7RYqlGy7QE41O3YC1xbNSeDGIRO7xg2JJXIAj1cAGnOeC1r7/T9pgrtQbv4g== - dependencies: - nanoid "^2.1.0" - side-channel@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" @@ -12961,11 +12427,6 @@ source-list-map@^2.0.1: resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== -source-map-js@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" - integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== - source-map-resolve@^0.5.0: version "0.5.3" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" @@ -13019,11 +12480,6 @@ source-map@^0.7.3: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== -sourcemap-codec@^1.4.8: - version "1.4.8" - resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" - integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== - spark-md5@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/spark-md5/-/spark-md5-3.0.1.tgz#83a0e255734f2ab4e5c466e5a2cfc9ba2aa2124d" @@ -13348,11 +12804,6 @@ strip-outer@^1.0.0: dependencies: escape-string-regexp "^1.0.2" -striptags@^3.1.1: - version "3.2.0" - resolved "https://registry.yarnpkg.com/striptags/-/striptags-3.2.0.tgz#cc74a137db2de8b0b9a370006334161f7dd67052" - integrity sha512-g45ZOGzHDMe2bdYMdIvdAfCQkCTDMGBazSw1ypMowwGIee7ZQ5dU0rBJ8Jqgl+jAKIv4dbeE1jscZq9wid1Tkw== - style-loader@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.1.tgz#057dfa6b3d4d7c7064462830f9113ed417d38575" @@ -13452,14 +12903,7 @@ svelte-portal@^1.0.0: resolved "https://registry.yarnpkg.com/svelte-portal/-/svelte-portal-1.0.0.tgz#36a47c5578b1a4d9b4dc60fa32a904640ec4cdd3" integrity sha512-nHf+DS/jZ6jjnZSleBMSaZua9JlG5rZv9lOGKgJuaZStfevtjIlUJrkLc3vbV8QdBvPPVmvcjTlazAzfKu0v3Q== -svelte-spa-router@^3.0.5: - version "3.3.0" - resolved "https://registry.yarnpkg.com/svelte-spa-router/-/svelte-spa-router-3.3.0.tgz#2fc0967a49dc361dfe4d38dddad6e662eed5b42c" - integrity sha512-cwRNe7cxD43sCvSfEeaKiNZg3FCizGxeMcf7CPiWRP3jKXjEma3vxyyuDtPOam6nWbVxl9TNM3hlE/i87ZlqcQ== - dependencies: - regexparam "2.0.1" - -svelte@3.49.0, svelte@^3.46.2, svelte@^3.49.0: +svelte@3.49.0: version "3.49.0" resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.49.0.tgz#5baee3c672306de1070c3b7888fc2204e36a4029" integrity sha512-+lmjic1pApJWDfPCpUUTc1m8azDqYCG1JN9YEngrx/hUyIcFJo6VZhj0A1Ai0wqoHcEIuQy+e9tk+4uDgdtsFA== @@ -13821,11 +13265,6 @@ to-fast-properties@^2.0.0: resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= -to-gfm-code-block@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/to-gfm-code-block/-/to-gfm-code-block-0.1.1.tgz#25d045a5fae553189e9637b590900da732d8aa82" - integrity sha512-LQRZWyn8d5amUKnfR9A9Uu7x9ss7Re8peuWR2gkh1E+ildOfv2aF26JpuDg8JtvCduu5+hOrMIH+XstZtnagqg== - to-json-schema@0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/to-json-schema/-/to-json-schema-0.2.5.tgz#ef3c3f11ad64460dcfbdbafd0fd525d69d62a98f" @@ -14072,13 +13511,6 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typeof-article@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/typeof-article/-/typeof-article-0.1.1.tgz#9f07e733c3fbb646ffa9e61c08debacd460e06af" - integrity sha512-Vn42zdX3FhmUrzEmitX3iYyLb+Umwpmv8fkZRIknYh84lmdrwqZA5xYaoKiIj2Rc5i/5wcDrpUmZcbk1U51vTw== - dependencies: - kind-of "^3.1.0" - typeof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/typeof/-/typeof-1.0.0.tgz#9c84403f2323ae5399167275497638ea1d2f2440" @@ -14089,11 +13521,6 @@ typescript@4.6.2: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.2.tgz#fe12d2727b708f4eef40f51598b3398baa9611d4" integrity sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg== -typo-js@*: - version "1.2.2" - resolved "https://registry.yarnpkg.com/typo-js/-/typo-js-1.2.2.tgz#340484d81fe518e77c81a5a770162b14492f183b" - integrity sha512-C7pYBQK17EjSg8tVNY91KHdUt5Nf6FMJ+c3js076quPmBML57PmNMzAcIq/2kf/hSYtFABNDIYNYlJRl5BJhGw== - uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" @@ -14418,14 +13845,6 @@ vm2@3.9.6: acorn "^8.7.0" acorn-walk "^8.2.0" -vm2@^3.9.4: - version "3.9.10" - resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.10.tgz#c66543096b5c44c8861a6465805c23c7cc996a44" - integrity sha512-AuECTSvwu2OHLAZYhG716YzwodKCIJxB6u1zG7PgSQwIgAlEaoXH52bxdcvT8GkGjnYK7r7yWDW0m0sOsPuBjQ== - dependencies: - acorn "^8.7.0" - acorn-walk "^8.2.0" - vuvuzela@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/vuvuzela/-/vuvuzela-1.0.3.tgz#3be145e58271c73ca55279dd851f12a682114b0b" @@ -14979,11 +14398,6 @@ yauzl@^2.4.2: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0" -year@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/year/-/year-0.2.1.tgz#4083ae520a318b23ec86037f3000cb892bdf9bb0" - integrity sha512-9GnJUZ0QM4OgXuOzsKNzTJ5EOkums1Xc+3YQXp+Q+UxFjf7zLucp9dQ8QMIft0Szs1E1hUiXFim1OYfEKFq97w== - ylru@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/ylru/-/ylru-1.3.2.tgz#0de48017473275a4cbdfc83a1eaf67c01af8a785" diff --git a/packages/types/src/documents/app/datasource.ts b/packages/types/src/documents/app/datasource.ts index 8a8419c7f5..efdc2ca1bd 100644 --- a/packages/types/src/documents/app/datasource.ts +++ b/packages/types/src/documents/app/datasource.ts @@ -2,75 +2,6 @@ import { Document } from "../document" import { SourceName } from "../../sdk" import { Table } from "./table" -export enum Operation { - CREATE = "CREATE", - READ = "READ", - UPDATE = "UPDATE", - DELETE = "DELETE", - BULK_CREATE = "BULK_CREATE", - CREATE_TABLE = "CREATE_TABLE", - UPDATE_TABLE = "UPDATE_TABLE", - DELETE_TABLE = "DELETE_TABLE", -} - -export enum SortDirection { - ASCENDING = "ASCENDING", - DESCENDING = "DESCENDING", -} - -export enum QueryTypes { - SQL = "sql", - JSON = "json", - FIELDS = "fields", -} - -export enum DatasourceFieldTypes { - STRING = "string", - LONGFORM = "longForm", - BOOLEAN = "boolean", - NUMBER = "number", - PASSWORD = "password", - LIST = "list", - OBJECT = "object", - JSON = "json", - FILE = "file", -} - -export enum SourceNames { - POSTGRES = "POSTGRES", - DYNAMODB = "DYNAMODB", - MONGODB = "MONGODB", - ELASTICSEARCH = "ELASTICSEARCH", - COUCHDB = "COUCHDB", - SQL_SERVER = "SQL_SERVER", - S3 = "S3", - AIRTABLE = "AIRTABLE", - MYSQL = "MYSQL", - ARANGODB = "ARANGODB", - REST = "REST", - ORACLE = "ORACLE", - GOOGLE_SHEETS = "GOOGLE_SHEETS", - FIRESTORE = "FIRESTORE", - REDIS = "REDIS", - SNOWFLAKE = "SNOWFLAKE", -} - -export enum IncludeRelationships { - INCLUDE = 1, - EXCLUDE = 0, -} - -export enum FilterTypes { - STRING = "string", - FUZZY = "fuzzy", - RANGE = "range", - EQUAL = "equal", - NOT_EQUAL = "notEqual", - EMPTY = "empty", - NOT_EMPTY = "notEmpty", - ONE_OF = "oneOf", -} - export interface Datasource extends Document { type: string name?: string diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 4a645c5266..4adb2fda97 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -1,5 +1,3 @@ export * from "./documents" -export * from "./sdk/events" -export * from "./sdk/licensing" export * from "./sdk" export * from "./api" From f1d5691fb734185c0fb8cc65986a4c7157feac79 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 12 Aug 2022 14:01:56 +0100 Subject: [PATCH 026/260] Update name of types constant --- packages/server/src/api/controllers/screen.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/controllers/screen.js b/packages/server/src/api/controllers/screen.js index 1d5d876dc4..99d12d064c 100644 --- a/packages/server/src/api/controllers/screen.js +++ b/packages/server/src/api/controllers/screen.js @@ -2,7 +2,7 @@ const { getScreenParams, generateScreenID, getPluginParams, - DocumentTypes, + DocumentType, } = require("../../db/utils") const { AccessController } = require("@budibase/backend-core/roles") const { getAppDB } = require("@budibase/backend-core/context") @@ -60,7 +60,7 @@ exports.save = async ctx => { }) // Update the app metadata - const application = await db.get(DocumentTypes.APP_METADATA) + const application = await db.get(DocumentType.APP_METADATA) let usedPlugins = application.usedPlugins || [] requiredPlugins.forEach(plugin => { From 8c227c0edda79662e73de34da06c60e60570a6da Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 12 Aug 2022 14:02:11 +0100 Subject: [PATCH 027/260] Simply logic around handling runtime reloading of custom components --- packages/client/src/stores/components.js | 66 ++++++++++++------------ 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/packages/client/src/stores/components.js b/packages/client/src/stores/components.js index 94dd16a957..8512a371d8 100644 --- a/packages/client/src/stores/components.js +++ b/packages/client/src/stores/components.js @@ -12,7 +12,7 @@ const budibasePrefix = "@budibase/standard-components/" const createComponentStore = () => { const store = writable({ customComponentManifest: {}, - componentsAwaitingConstructors: {}, + customComponentMap: {}, mountedComponents: {}, }) @@ -54,30 +54,37 @@ const createComponentStore = () => { const registerInstance = (id, instance) => { store.update(state => { - // If this is a custom component and does not have an implementation yet, - // store so we can reload this component later + // If this is a custom component, flag it so we can reload this component + // later if required const component = instance.component - let cac = state.componentsAwaitingConstructors - if (!getComponentConstructor(component)) { - if (!cac[component]) { - cac[component] = [] + if (component?.startsWith("plugin")) { + if (!state.customComponentMap[component]) { + state.customComponentMap[component] = [id] + } else { + state.customComponentMap[component].push(id) } - cac[component].push(id) } - return { - ...state, - componentsAwaitingConstructors: cac, - mountedComponents: { - ...state.mountedComponents, - [id]: instance, - }, - } + // Register to mounted components + state.mountedComponents[id] = instance + return state }) } const unregisterInstance = id => { store.update(state => { + // Remove from custom component map if required + const component = state.mountedComponents[id]?.instance?.component + let customComponentMap = state.customComponentMap + if (component?.startsWith("plugin")) { + customComponentMap[component] = customComponentMap[component].filter( + x => { + return x !== id + } + ) + } + + // Remove from mounted components delete state.mountedComponents[id] return state }) @@ -133,34 +140,25 @@ const createComponentStore = () => { return customComponentManifest?.[type]?.Component } - const registerCustomComponent = ({ Component, schema }) => { + const registerCustomComponent = ({ Component, schema, version }) => { if (!Component || !schema?.schema?.name) { return } - const componentName = `plugin/${schema.schema.name}/1.0.0` + const component = `plugin/${schema.schema.name}/${version}` store.update(state => { - if (!state.customComponentManifest) { - state.customComponentManifest = {} - } - state.customComponentManifest[componentName] = { - schema, + state.customComponentManifest[component] = { Component, + schema, + version, } return state }) - // Reload any mounted components which depend on this definition + // Reload any mounted instances of this custom component const state = get(store) - if (state.componentsAwaitingConstructors[componentName]?.length) { - state.componentsAwaitingConstructors[componentName].forEach(id => { - const instance = state.mountedComponents[id] - if (instance) { - instance.reload() - } - }) - store.update(state => { - delete state.componentsAwaitingConstructors[componentName] - return state + if (state.customComponentMap[component]?.length) { + state.customComponentMap[component].forEach(id => { + state.mountedComponents[id]?.reload() }) } } From 5ae40d8e1560bc933a09fa8a2ff0a28bb5a80f99 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 12 Aug 2022 14:34:02 +0100 Subject: [PATCH 028/260] Use friendly name in new component panel if available --- .../[componentId]/new/_components/NewComponentPanel.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte index a5d77c32ca..b0cd544977 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte @@ -58,7 +58,10 @@ enrichedStructure.push({ name: "Custom components", isCategory: true, - children: customComponents.map(x => definitions[x]), + children: customComponents.map(x => ({ + ...definitions[x], + name: definitions[x].friendlyName || definitions[x].name, + })), }) } From 10440803fe703866dde3e9b5e2f1b6b05b60b299 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 12 Aug 2022 14:34:16 +0100 Subject: [PATCH 029/260] Show success after uploading plugin --- .../src/pages/builder/portal/settings/organisation.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/builder/src/pages/builder/portal/settings/organisation.svelte b/packages/builder/src/pages/builder/portal/settings/organisation.svelte index d34442f886..d52bd66d47 100644 --- a/packages/builder/src/pages/builder/portal/settings/organisation.svelte +++ b/packages/builder/src/pages/builder/portal/settings/organisation.svelte @@ -39,6 +39,7 @@ let data = new FormData() data.append("file", $values.logo) await API.uploadPlugin(data) + notifications.success("Plugin uploaded successfully") } catch (error) { notifications.error("Error uploading logo") } From ceb3eb78e58b25b7e274dc243d1e7b4477c4bbf9 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 12 Aug 2022 14:34:44 +0100 Subject: [PATCH 030/260] Remove uncecessary calls to loadBudibase when registering a plugin at runtime --- packages/client/src/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/client/src/index.js b/packages/client/src/index.js index bef3ab9c12..a795d8d2d9 100644 --- a/packages/client/src/index.js +++ b/packages/client/src/index.js @@ -40,17 +40,17 @@ const loadBudibase = () => { devToolsStore.actions.setEnabled(enableDevTools) // Register any custom components - window.registerCustomComponent = plugin => { - componentStore.actions.registerCustomComponent(plugin) - console.log("registered!") - loadBudibase() - } if (window["##BUDIBASE_CUSTOM_COMPONENTS##"]) { window["##BUDIBASE_CUSTOM_COMPONENTS##"].forEach(component => { componentStore.actions.registerCustomComponent(component) }) } + // Make a callback available for custom component bundles to register + // themselves at runtime + window.registerCustomComponent = + componentStore.actions.registerCustomComponent + // Create app if one hasn't been created yet if (!app) { app = new ClientApp({ From 8eb64002528e0468b252db05c6c0054e0b949bef Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 12 Aug 2022 14:41:37 +0100 Subject: [PATCH 031/260] Overwrite existing plugins of the same name and version --- packages/server/src/api/controllers/plugin.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/server/src/api/controllers/plugin.ts b/packages/server/src/api/controllers/plugin.ts index f76d2871b0..4afa59cd3a 100644 --- a/packages/server/src/api/controllers/plugin.ts +++ b/packages/server/src/api/controllers/plugin.ts @@ -32,19 +32,18 @@ export async function upload(ctx: any) { } const jsFileName = jsFile.name const pluginId = generatePluginID(name, version) - let existing + + // overwrite existing docs entirely if they exist + let rev try { - existing = await db.get(pluginId) + const existing = await db.get(pluginId) + rev = existing._rev } catch (err) { - existing = null - } - if (existing) { - throw new Error( - `Plugin already exists: name: ${name}, version: ${version}` - ) + rev = null } const doc = { _id: pluginId, + _rev: rev, name, version, description, From 6c7a7648d9072fa67497680cffdaad6993bf3668 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 12 Aug 2022 16:19:29 +0100 Subject: [PATCH 032/260] Fix rev when uploading a new plugin --- packages/server/src/api/controllers/plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/plugin.ts b/packages/server/src/api/controllers/plugin.ts index 4afa59cd3a..6b9a2f8803 100644 --- a/packages/server/src/api/controllers/plugin.ts +++ b/packages/server/src/api/controllers/plugin.ts @@ -39,7 +39,7 @@ export async function upload(ctx: any) { const existing = await db.get(pluginId) rev = existing._rev } catch (err) { - rev = null + rev = undefined } const doc = { _id: pluginId, From 970e7ee3e79bb3a1322fad0f530680c24d1b9764 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 12 Aug 2022 17:03:06 +0100 Subject: [PATCH 033/260] Making integrations more like what custom integrations look like (to simplify integration). --- .../server/src/api/controllers/integration.js | 8 +- packages/server/src/api/controllers/plugin.ts | 24 +- packages/server/src/integrations/airtable.ts | 250 +++--- packages/server/src/integrations/arangodb.ts | 182 ++-- packages/server/src/integrations/couchdb.ts | 180 ++-- packages/server/src/integrations/dynamodb.ts | 424 +++++----- .../server/src/integrations/elasticsearch.ts | 266 +++--- packages/server/src/integrations/firebase.ts | 328 ++++---- .../server/src/integrations/googlesheets.ts | 735 ++++++++--------- packages/server/src/integrations/index.ts | 45 +- .../src/integrations/microsoftSqlServer.ts | 548 ++++++------ packages/server/src/integrations/mongodb.ts | 574 +++++++------ packages/server/src/integrations/mysql.ts | 487 ++++++----- packages/server/src/integrations/oracle.ts | 779 +++++++++--------- packages/server/src/integrations/postgres.ts | 574 +++++++------ packages/server/src/integrations/redis.ts | 258 +++--- packages/server/src/integrations/rest.ts | 657 ++++++++------- packages/server/src/integrations/s3.ts | 139 ++-- packages/server/src/integrations/snowflake.ts | 170 ++-- packages/types/src/documents/index.ts | 1 + packages/types/src/documents/plugin/index.ts | 4 + 21 files changed, 3297 insertions(+), 3336 deletions(-) create mode 100644 packages/types/src/documents/plugin/index.ts diff --git a/packages/server/src/api/controllers/integration.js b/packages/server/src/api/controllers/integration.js index cc9efac93a..ae9be7e6fe 100644 --- a/packages/server/src/api/controllers/integration.js +++ b/packages/server/src/api/controllers/integration.js @@ -1,12 +1,11 @@ -const { cloneDeep } = require("lodash") -const { definitions } = require("../../integrations") +const { getDefinitions } = require("../../integrations") const { SourceName } = require("@budibase/types") const googlesheets = require("../../integrations/googlesheets") const { featureFlags } = require("@budibase/backend-core") exports.fetch = async function (ctx) { ctx.status = 200 - const defs = cloneDeep(definitions) + const defs = await getDefinitions() // for google sheets integration google verification if (featureFlags.isEnabled(featureFlags.FeatureFlag.GOOGLE_SHEETS)) { @@ -17,6 +16,7 @@ exports.fetch = async function (ctx) { } exports.find = async function (ctx) { + const defs = await getDefinitions() ctx.status = 200 - ctx.body = definitions[ctx.params.type] + ctx.body = defs[ctx.params.type] } diff --git a/packages/server/src/api/controllers/plugin.ts b/packages/server/src/api/controllers/plugin.ts index f76d2871b0..218d59127c 100644 --- a/packages/server/src/api/controllers/plugin.ts +++ b/packages/server/src/api/controllers/plugin.ts @@ -3,6 +3,22 @@ import { extractPluginTarball } from "../../utilities/fileSystem" import { getGlobalDB } from "@budibase/backend-core/tenancy" import { generatePluginID, getPluginParams } from "../../db/utils" import { uploadDirectory } from "@budibase/backend-core/objectStore" +import { PluginType } from "@budibase/types" + +export async function getPlugins(type?: PluginType) { + const db = getGlobalDB() + const response = await db.allDocs( + getPluginParams(null, { + include_docs: true, + }) + ) + const plugins = response.rows.map((row: any) => row.doc) + if (type) { + return plugins.filter((plugin: any) => plugin.schema?.type === type) + } else { + return plugins + } +} export async function upload(ctx: any) { const plugins = @@ -68,13 +84,7 @@ export async function upload(ctx: any) { } export async function fetch(ctx: any) { - const db = getGlobalDB() - const response = await db.allDocs( - getPluginParams(null, { - include_docs: true, - }) - ) - ctx.body = response.rows.map((row: any) => row.doc) + ctx.body = await getPlugins() } export async function destroy(ctx: any) {} diff --git a/packages/server/src/integrations/airtable.ts b/packages/server/src/integrations/airtable.ts index e4c941b21c..1f56f0619b 100644 --- a/packages/server/src/integrations/airtable.ts +++ b/packages/server/src/integrations/airtable.ts @@ -5,146 +5,144 @@ import { IntegrationBase, } from "@budibase/types" -module AirtableModule { - const Airtable = require("airtable") +const Airtable = require("airtable") - interface AirtableConfig { - apiKey: string - base: string - } +interface AirtableConfig { + apiKey: string + base: string +} - const SCHEMA: Integration = { - docs: "https://airtable.com/api", - description: - "Airtable is a spreadsheet-database hybrid, with the features of a database but applied to a spreadsheet.", - friendlyName: "Airtable", - type: "Spreadsheet", - datasource: { - apiKey: { - type: DatasourceFieldType.PASSWORD, - default: "enter api key", - required: true, - }, - base: { - type: DatasourceFieldType.STRING, - default: "mybase", - required: true, +const SCHEMA: Integration = { + docs: "https://airtable.com/api", + description: + "Airtable is a spreadsheet-database hybrid, with the features of a database but applied to a spreadsheet.", + friendlyName: "Airtable", + type: "Spreadsheet", + datasource: { + apiKey: { + type: DatasourceFieldType.PASSWORD, + default: "enter api key", + required: true, + }, + base: { + type: DatasourceFieldType.STRING, + default: "mybase", + required: true, + }, + }, + query: { + create: { + type: QueryType.FIELDS, + customisable: true, + fields: { + table: { + type: DatasourceFieldType.STRING, + required: true, + }, }, }, - query: { - create: { - type: QueryType.FIELDS, - customisable: true, - fields: { - table: { - type: DatasourceFieldType.STRING, - required: true, - }, + read: { + type: QueryType.FIELDS, + fields: { + table: { + type: DatasourceFieldType.STRING, + required: true, }, - }, - read: { - type: QueryType.FIELDS, - fields: { - table: { - type: DatasourceFieldType.STRING, - required: true, - }, - view: { - type: DatasourceFieldType.STRING, - required: true, - }, - numRecords: { - type: DatasourceFieldType.NUMBER, - default: 10, - }, + view: { + type: DatasourceFieldType.STRING, + required: true, }, - }, - update: { - type: QueryType.FIELDS, - customisable: true, - fields: { - id: { - display: "Record ID", - type: DatasourceFieldType.STRING, - required: true, - }, - table: { - type: DatasourceFieldType.STRING, - required: true, - }, + numRecords: { + type: DatasourceFieldType.NUMBER, + default: 10, }, }, - delete: { - type: QueryType.JSON, - }, }, + update: { + type: QueryType.FIELDS, + customisable: true, + fields: { + id: { + display: "Record ID", + type: DatasourceFieldType.STRING, + required: true, + }, + table: { + type: DatasourceFieldType.STRING, + required: true, + }, + }, + }, + delete: { + type: QueryType.JSON, + }, + }, +} + +class AirtableIntegration implements IntegrationBase { + private config: AirtableConfig + private client: any + + constructor(config: AirtableConfig) { + this.config = config + this.client = new Airtable(config).base(config.base) } - class AirtableIntegration implements IntegrationBase { - private config: AirtableConfig - private client: any + async create(query: { table: any; json: any }) { + const { table, json } = query - constructor(config: AirtableConfig) { - this.config = config - this.client = new Airtable(config).base(config.base) - } - - async create(query: { table: any; json: any }) { - const { table, json } = query - - try { - return await this.client(table).create([ - { - fields: json, - }, - ]) - } catch (err) { - console.error("Error writing to airtable", err) - throw err - } - } - - async read(query: { table: any; numRecords: any; view: any }) { - try { - const records = await this.client(query.table) - .select({ maxRecords: query.numRecords || 10, view: query.view }) - .firstPage() - // @ts-ignore - return records.map(({ fields }) => fields) - } catch (err) { - console.error("Error writing to airtable", err) - return [] - } - } - - async update(query: { table: any; id: any; json: any }) { - const { table, id, json } = query - - try { - return await this.client(table).update([ - { - id, - fields: json, - }, - ]) - } catch (err) { - console.error("Error writing to airtable", err) - throw err - } - } - - async delete(query: { table: any; ids: any }) { - try { - return await this.client(query.table).destroy(query.ids) - } catch (err) { - console.error("Error writing to airtable", err) - throw err - } + try { + return await this.client(table).create([ + { + fields: json, + }, + ]) + } catch (err) { + console.error("Error writing to airtable", err) + throw err } } - module.exports = { - schema: SCHEMA, - integration: AirtableIntegration, + async read(query: { table: any; numRecords: any; view: any }) { + try { + const records = await this.client(query.table) + .select({ maxRecords: query.numRecords || 10, view: query.view }) + .firstPage() + // @ts-ignore + return records.map(({ fields }) => fields) + } catch (err) { + console.error("Error writing to airtable", err) + return [] + } + } + + async update(query: { table: any; id: any; json: any }) { + const { table, id, json } = query + + try { + return await this.client(table).update([ + { + id, + fields: json, + }, + ]) + } catch (err) { + console.error("Error writing to airtable", err) + throw err + } + } + + async delete(query: { table: any; ids: any }) { + try { + return await this.client(query.table).destroy(query.ids) + } catch (err) { + console.error("Error writing to airtable", err) + throw err + } } } + +export default { + schema: SCHEMA, + integration: AirtableIntegration, +} diff --git a/packages/server/src/integrations/arangodb.ts b/packages/server/src/integrations/arangodb.ts index 968197474a..6df96501a4 100644 --- a/packages/server/src/integrations/arangodb.ts +++ b/packages/server/src/integrations/arangodb.ts @@ -5,106 +5,104 @@ import { IntegrationBase, } from "@budibase/types" -module ArangoModule { - const { Database, aql } = require("arangojs") +const { Database, aql } = require("arangojs") - interface ArangodbConfig { - url: string - username: string - password: string - databaseName: string - collection: string - } +interface ArangodbConfig { + url: string + username: string + password: string + databaseName: string + collection: string +} - const SCHEMA: Integration = { - docs: "https://github.com/arangodb/arangojs", - friendlyName: "ArangoDB", - type: "Non-relational", - description: - "ArangoDB is a scalable open-source multi-model database natively supporting graph, document and search. All supported data models & access patterns can be combined in queries allowing for maximal flexibility. ", - datasource: { - url: { - type: DatasourceFieldType.STRING, - default: "http://localhost:8529", - required: true, - }, - username: { - type: DatasourceFieldType.STRING, - default: "root", - required: true, - }, - password: { - type: DatasourceFieldType.PASSWORD, - required: true, - }, - databaseName: { - type: DatasourceFieldType.STRING, - default: "_system", - required: true, - }, - collection: { - type: DatasourceFieldType.STRING, - required: true, - }, +const SCHEMA: Integration = { + docs: "https://github.com/arangodb/arangojs", + friendlyName: "ArangoDB", + type: "Non-relational", + description: + "ArangoDB is a scalable open-source multi-model database natively supporting graph, document and search. All supported data models & access patterns can be combined in queries allowing for maximal flexibility. ", + datasource: { + url: { + type: DatasourceFieldType.STRING, + default: "http://localhost:8529", + required: true, }, - query: { - read: { - type: QueryType.SQL, - }, - create: { - type: QueryType.JSON, - }, + username: { + type: DatasourceFieldType.STRING, + default: "root", + required: true, }, + password: { + type: DatasourceFieldType.PASSWORD, + required: true, + }, + databaseName: { + type: DatasourceFieldType.STRING, + default: "_system", + required: true, + }, + collection: { + type: DatasourceFieldType.STRING, + required: true, + }, + }, + query: { + read: { + type: QueryType.SQL, + }, + create: { + type: QueryType.JSON, + }, + }, +} + +class ArangoDBIntegration implements IntegrationBase { + private config: ArangodbConfig + private client: any + + constructor(config: ArangodbConfig) { + const newConfig = { + auth: { + username: config.username, + password: config.password, + }, + } + + this.config = config + this.client = new Database(newConfig) } - class ArangoDBIntegration implements IntegrationBase { - private config: ArangodbConfig - private client: any - - constructor(config: ArangodbConfig) { - const newConfig = { - auth: { - username: config.username, - password: config.password, - }, - } - - this.config = config - this.client = new Database(newConfig) - } - - async read(query: { sql: any }) { - try { - const result = await this.client.query(query.sql) - return result.all() - } catch (err) { - // @ts-ignore - console.error("Error querying arangodb", err.message) - throw err - } finally { - this.client.close() - } - } - - async create(query: { json: any }) { - const clc = this.client.collection(this.config.collection) - try { - const result = await this.client.query( - aql`INSERT ${query.json} INTO ${clc} RETURN NEW` - ) - return result.all() - } catch (err) { - // @ts-ignore - console.error("Error querying arangodb", err.message) - throw err - } finally { - this.client.close() - } + async read(query: { sql: any }) { + try { + const result = await this.client.query(query.sql) + return result.all() + } catch (err) { + // @ts-ignore + console.error("Error querying arangodb", err.message) + throw err + } finally { + this.client.close() } } - module.exports = { - schema: SCHEMA, - integration: ArangoDBIntegration, + async create(query: { json: any }) { + const clc = this.client.collection(this.config.collection) + try { + const result = await this.client.query( + aql`INSERT ${query.json} INTO ${clc} RETURN NEW` + ) + return result.all() + } catch (err) { + // @ts-ignore + console.error("Error querying arangodb", err.message) + throw err + } finally { + this.client.close() + } } } + +export default { + schema: SCHEMA, + integration: ArangoDBIntegration, +} diff --git a/packages/server/src/integrations/couchdb.ts b/packages/server/src/integrations/couchdb.ts index c23593dbd4..67be21c9d1 100644 --- a/packages/server/src/integrations/couchdb.ts +++ b/packages/server/src/integrations/couchdb.ts @@ -5,109 +5,103 @@ import { IntegrationBase, } from "@budibase/types" -module CouchDBModule { - const PouchDB = require("pouchdb") +const PouchDB = require("pouchdb") - interface CouchDBConfig { - url: string - database: string - } +interface CouchDBConfig { + url: string + database: string +} - const SCHEMA: Integration = { - docs: "https://docs.couchdb.org/en/stable/", - friendlyName: "CouchDB", - type: "Non-relational", - description: - "Apache CouchDB is an open-source document-oriented NoSQL database, implemented in Erlang.", - datasource: { - url: { - type: DatasourceFieldType.STRING, - required: true, - default: "http://localhost:5984", - }, - database: { - type: DatasourceFieldType.STRING, - required: true, - }, +const SCHEMA: Integration = { + docs: "https://docs.couchdb.org/en/stable/", + friendlyName: "CouchDB", + type: "Non-relational", + description: + "Apache CouchDB is an open-source document-oriented NoSQL database, implemented in Erlang.", + datasource: { + url: { + type: DatasourceFieldType.STRING, + required: true, + default: "http://localhost:5984", }, - query: { - create: { - type: QueryType.JSON, - }, - read: { - type: QueryType.JSON, - }, - update: { - type: QueryType.JSON, - }, - delete: { - type: QueryType.FIELDS, - fields: { - id: { - type: DatasourceFieldType.STRING, - required: true, - }, + database: { + type: DatasourceFieldType.STRING, + required: true, + }, + }, + query: { + create: { + type: QueryType.JSON, + }, + read: { + type: QueryType.JSON, + }, + update: { + type: QueryType.JSON, + }, + delete: { + type: QueryType.FIELDS, + fields: { + id: { + type: DatasourceFieldType.STRING, + required: true, }, }, }, + }, +} + +class CouchDBIntegration implements IntegrationBase { + private config: CouchDBConfig + private readonly client: any + + constructor(config: CouchDBConfig) { + this.config = config + this.client = new PouchDB(`${config.url}/${config.database}`) } - class CouchDBIntegration implements IntegrationBase { - private config: CouchDBConfig - private readonly client: any - - constructor(config: CouchDBConfig) { - this.config = config - this.client = new PouchDB(`${config.url}/${config.database}`) - } - - async query( - command: string, - errorMsg: string, - query: { json?: object; id?: string } - ) { - try { - const response = await this.client[command](query.id || query.json) - await this.client.close() - return response - } catch (err) { - console.error(errorMsg, err) - throw err - } - } - - async create(query: { json: object }) { - return this.query("post", "Error writing to couchDB", query) - } - - async read(query: { json: object }) { - const result = await this.query("allDocs", "Error querying couchDB", { - json: { - include_docs: true, - ...query.json, - }, - }) - return result.rows.map((row: { doc: object }) => row.doc) - } - - async update(query: { json: object }) { - return this.query("put", "Error updating couchDB document", query) - } - - async delete(query: { id: string }) { - const doc = await this.query( - "get", - "Cannot find doc to be deleted", - query - ) - return this.query("remove", "Error deleting couchDB document", { - json: doc, - }) + async query( + command: string, + errorMsg: string, + query: { json?: object; id?: string } + ) { + try { + const response = await this.client[command](query.id || query.json) + await this.client.close() + return response + } catch (err) { + console.error(errorMsg, err) + throw err } } - module.exports = { - schema: SCHEMA, - integration: CouchDBIntegration, + async create(query: { json: object }) { + return this.query("post", "Error writing to couchDB", query) + } + + async read(query: { json: object }) { + const result = await this.query("allDocs", "Error querying couchDB", { + json: { + include_docs: true, + ...query.json, + }, + }) + return result.rows.map((row: { doc: object }) => row.doc) + } + + async update(query: { json: object }) { + return this.query("put", "Error updating couchDB document", query) + } + + async delete(query: { id: string }) { + const doc = await this.query("get", "Cannot find doc to be deleted", query) + return this.query("remove", "Error deleting couchDB document", { + json: doc, + }) } } + +export default { + schema: SCHEMA, + integration: CouchDBIntegration, +} diff --git a/packages/server/src/integrations/dynamodb.ts b/packages/server/src/integrations/dynamodb.ts index 5321da4791..8dea6c6213 100644 --- a/packages/server/src/integrations/dynamodb.ts +++ b/packages/server/src/integrations/dynamodb.ts @@ -5,228 +5,226 @@ import { IntegrationBase, } from "@budibase/types" -module DynamoModule { - const AWS = require("aws-sdk") - const { AWS_REGION } = require("../db/dynamoClient") +const AWS = require("aws-sdk") +const { AWS_REGION } = require("../db/dynamoClient") - interface DynamoDBConfig { - region: string - accessKeyId: string - secretAccessKey: string - endpoint: string - } +interface DynamoDBConfig { + region: string + accessKeyId: string + secretAccessKey: string + endpoint: string +} - const SCHEMA: Integration = { - docs: "https://github.com/dabit3/dynamodb-documentclient-cheat-sheet", - description: - "Amazon DynamoDB is a key-value and document database that delivers single-digit millisecond performance at any scale.", - friendlyName: "DynamoDB", - type: "Non-relational", - datasource: { - region: { - type: DatasourceFieldType.STRING, - required: true, - default: "us-east-1", - }, - accessKeyId: { - type: DatasourceFieldType.PASSWORD, - required: true, - }, - secretAccessKey: { - type: DatasourceFieldType.PASSWORD, - required: true, - }, - endpoint: { - type: DatasourceFieldType.STRING, - required: false, - default: "https://dynamodb.us-east-1.amazonaws.com", - }, +const SCHEMA: Integration = { + docs: "https://github.com/dabit3/dynamodb-documentclient-cheat-sheet", + description: + "Amazon DynamoDB is a key-value and document database that delivers single-digit millisecond performance at any scale.", + friendlyName: "DynamoDB", + type: "Non-relational", + datasource: { + region: { + type: DatasourceFieldType.STRING, + required: true, + default: "us-east-1", }, - query: { - create: { - type: QueryType.FIELDS, - customisable: true, - fields: { - table: { - type: DatasourceFieldType.STRING, - required: true, - }, - }, - }, - read: { - type: QueryType.FIELDS, - customisable: true, - readable: true, - fields: { - table: { - type: DatasourceFieldType.STRING, - required: true, - }, - index: { - type: DatasourceFieldType.STRING, - }, - }, - }, - scan: { - type: QueryType.FIELDS, - customisable: true, - readable: true, - fields: { - table: { - type: DatasourceFieldType.STRING, - required: true, - }, - index: { - type: DatasourceFieldType.STRING, - }, - }, - }, - describe: { - type: QueryType.FIELDS, - customisable: true, - readable: true, - fields: { - table: { - type: DatasourceFieldType.STRING, - required: true, - }, - }, - }, - get: { - type: QueryType.FIELDS, - customisable: true, - readable: true, - fields: { - table: { - type: DatasourceFieldType.STRING, - required: true, - }, - }, - }, - update: { - type: QueryType.FIELDS, - customisable: true, - fields: { - table: { - type: DatasourceFieldType.STRING, - required: true, - }, - }, - }, - delete: { - type: QueryType.FIELDS, - customisable: true, - fields: { - table: { - type: DatasourceFieldType.STRING, - required: true, - }, + accessKeyId: { + type: DatasourceFieldType.PASSWORD, + required: true, + }, + secretAccessKey: { + type: DatasourceFieldType.PASSWORD, + required: true, + }, + endpoint: { + type: DatasourceFieldType.STRING, + required: false, + default: "https://dynamodb.us-east-1.amazonaws.com", + }, + }, + query: { + create: { + type: QueryType.FIELDS, + customisable: true, + fields: { + table: { + type: DatasourceFieldType.STRING, + required: true, }, }, }, + read: { + type: QueryType.FIELDS, + customisable: true, + readable: true, + fields: { + table: { + type: DatasourceFieldType.STRING, + required: true, + }, + index: { + type: DatasourceFieldType.STRING, + }, + }, + }, + scan: { + type: QueryType.FIELDS, + customisable: true, + readable: true, + fields: { + table: { + type: DatasourceFieldType.STRING, + required: true, + }, + index: { + type: DatasourceFieldType.STRING, + }, + }, + }, + describe: { + type: QueryType.FIELDS, + customisable: true, + readable: true, + fields: { + table: { + type: DatasourceFieldType.STRING, + required: true, + }, + }, + }, + get: { + type: QueryType.FIELDS, + customisable: true, + readable: true, + fields: { + table: { + type: DatasourceFieldType.STRING, + required: true, + }, + }, + }, + update: { + type: QueryType.FIELDS, + customisable: true, + fields: { + table: { + type: DatasourceFieldType.STRING, + required: true, + }, + }, + }, + delete: { + type: QueryType.FIELDS, + customisable: true, + fields: { + table: { + type: DatasourceFieldType.STRING, + required: true, + }, + }, + }, + }, +} + +class DynamoDBIntegration implements IntegrationBase { + private config: DynamoDBConfig + private client: any + + constructor(config: DynamoDBConfig) { + this.config = config + if (this.config.endpoint && !this.config.endpoint.includes("localhost")) { + this.connect() + } + let options = { + correctClockSkew: true, + region: this.config.region || AWS_REGION, + endpoint: config.endpoint ? config.endpoint : undefined, + } + this.client = new AWS.DynamoDB.DocumentClient(options) } - class DynamoDBIntegration implements IntegrationBase { - private config: DynamoDBConfig - private client: any - - constructor(config: DynamoDBConfig) { - this.config = config - if (this.config.endpoint && !this.config.endpoint.includes("localhost")) { - this.connect() - } - let options = { - correctClockSkew: true, - region: this.config.region || AWS_REGION, - endpoint: config.endpoint ? config.endpoint : undefined, - } - this.client = new AWS.DynamoDB.DocumentClient(options) - } - - end() { - this.disconnect() - } - - connect() { - AWS.config.update(this.config) - } - - disconnect() { - AWS.config.update({ - secretAccessKey: undefined, - accessKeyId: undefined, - region: AWS_REGION, - }) - } - - async create(query: { table: string; json: object }) { - const params = { - TableName: query.table, - ...query.json, - } - return this.client.put(params).promise() - } - - async read(query: { table: string; json: object; index: null | string }) { - const params = { - TableName: query.table, - IndexName: query.index ? query.index : undefined, - ...query.json, - } - const response = await this.client.query(params).promise() - if (response.Items) { - return response.Items - } - return response - } - - async scan(query: { table: string; json: object; index: null | string }) { - const params = { - TableName: query.table, - IndexName: query.index ? query.index : undefined, - ...query.json, - } - const response = await this.client.scan(params).promise() - if (response.Items) { - return response.Items - } - return response - } - - async describe(query: { table: string }) { - const params = { - TableName: query.table, - } - return new AWS.DynamoDB().describeTable(params).promise() - } - - async get(query: { table: string; json: object }) { - const params = { - TableName: query.table, - ...query.json, - } - return this.client.get(params).promise() - } - - async update(query: { table: string; json: object }) { - const params = { - TableName: query.table, - ...query.json, - } - return this.client.update(params).promise() - } - - async delete(query: { table: string; json: object }) { - const params = { - TableName: query.table, - ...query.json, - } - return this.client.delete(params).promise() - } + end() { + this.disconnect() } - module.exports = { - schema: SCHEMA, - integration: DynamoDBIntegration, + connect() { + AWS.config.update(this.config) + } + + disconnect() { + AWS.config.update({ + secretAccessKey: undefined, + accessKeyId: undefined, + region: AWS_REGION, + }) + } + + async create(query: { table: string; json: object }) { + const params = { + TableName: query.table, + ...query.json, + } + return this.client.put(params).promise() + } + + async read(query: { table: string; json: object; index: null | string }) { + const params = { + TableName: query.table, + IndexName: query.index ? query.index : undefined, + ...query.json, + } + const response = await this.client.query(params).promise() + if (response.Items) { + return response.Items + } + return response + } + + async scan(query: { table: string; json: object; index: null | string }) { + const params = { + TableName: query.table, + IndexName: query.index ? query.index : undefined, + ...query.json, + } + const response = await this.client.scan(params).promise() + if (response.Items) { + return response.Items + } + return response + } + + async describe(query: { table: string }) { + const params = { + TableName: query.table, + } + return new AWS.DynamoDB().describeTable(params).promise() + } + + async get(query: { table: string; json: object }) { + const params = { + TableName: query.table, + ...query.json, + } + return this.client.get(params).promise() + } + + async update(query: { table: string; json: object }) { + const params = { + TableName: query.table, + ...query.json, + } + return this.client.update(params).promise() + } + + async delete(query: { table: string; json: object }) { + const params = { + TableName: query.table, + ...query.json, + } + return this.client.delete(params).promise() } } + +export default { + schema: SCHEMA, + integration: DynamoDBIntegration, +} diff --git a/packages/server/src/integrations/elasticsearch.ts b/packages/server/src/integrations/elasticsearch.ts index 5c61545ecd..14887a743d 100644 --- a/packages/server/src/integrations/elasticsearch.ts +++ b/packages/server/src/integrations/elasticsearch.ts @@ -5,151 +5,149 @@ import { IntegrationBase, } from "@budibase/types" -module ElasticsearchModule { - const { Client } = require("@elastic/elasticsearch") +const { Client } = require("@elastic/elasticsearch") - interface ElasticsearchConfig { - url: string - } +interface ElasticsearchConfig { + url: string +} - const SCHEMA: Integration = { - docs: "https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html", - description: - "Elasticsearch is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.", - friendlyName: "ElasticSearch", - type: "Non-relational", - datasource: { - url: { - type: DatasourceFieldType.STRING, - required: true, - default: "http://localhost:9200", - }, +const SCHEMA: Integration = { + docs: "https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html", + description: + "Elasticsearch is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.", + friendlyName: "ElasticSearch", + type: "Non-relational", + datasource: { + url: { + type: DatasourceFieldType.STRING, + required: true, + default: "http://localhost:9200", }, - query: { - create: { - type: QueryType.FIELDS, - customisable: true, - fields: { - index: { - type: DatasourceFieldType.STRING, - required: true, - }, - }, - }, - read: { - type: QueryType.FIELDS, - customisable: true, - fields: { - index: { - type: DatasourceFieldType.STRING, - required: true, - }, - }, - }, - update: { - type: QueryType.FIELDS, - customisable: true, - fields: { - id: { - type: DatasourceFieldType.STRING, - required: true, - }, - index: { - type: DatasourceFieldType.STRING, - required: true, - }, - }, - }, - delete: { - type: QueryType.FIELDS, - fields: { - index: { - type: DatasourceFieldType.STRING, - required: true, - }, - id: { - type: DatasourceFieldType.STRING, - required: true, - }, + }, + query: { + create: { + type: QueryType.FIELDS, + customisable: true, + fields: { + index: { + type: DatasourceFieldType.STRING, + required: true, }, }, }, + read: { + type: QueryType.FIELDS, + customisable: true, + fields: { + index: { + type: DatasourceFieldType.STRING, + required: true, + }, + }, + }, + update: { + type: QueryType.FIELDS, + customisable: true, + fields: { + id: { + type: DatasourceFieldType.STRING, + required: true, + }, + index: { + type: DatasourceFieldType.STRING, + required: true, + }, + }, + }, + delete: { + type: QueryType.FIELDS, + fields: { + index: { + type: DatasourceFieldType.STRING, + required: true, + }, + id: { + type: DatasourceFieldType.STRING, + required: true, + }, + }, + }, + }, +} + +class ElasticSearchIntegration implements IntegrationBase { + private config: ElasticsearchConfig + private client: any + + constructor(config: ElasticsearchConfig) { + this.config = config + this.client = new Client({ node: config.url }) } - class ElasticSearchIntegration implements IntegrationBase { - private config: ElasticsearchConfig - private client: any + async create(query: { index: string; json: object }) { + const { index, json } = query - constructor(config: ElasticsearchConfig) { - this.config = config - this.client = new Client({ node: config.url }) - } - - async create(query: { index: string; json: object }) { - const { index, json } = query - - try { - const result = await this.client.index({ - index, - body: json, - }) - return result.body - } catch (err) { - console.error("Error writing to elasticsearch", err) - throw err - } finally { - await this.client.close() - } - } - - async read(query: { index: string; json: object }) { - const { index, json } = query - try { - const result = await this.client.search({ - index: index, - body: json, - }) - return result.body.hits.hits.map(({ _source }: any) => _source) - } catch (err) { - console.error("Error querying elasticsearch", err) - throw err - } finally { - await this.client.close() - } - } - - async update(query: { id: string; index: string; json: object }) { - const { id, index, json } = query - try { - const result = await this.client.update({ - id, - index, - body: json, - }) - return result.body - } catch (err) { - console.error("Error querying elasticsearch", err) - throw err - } finally { - await this.client.close() - } - } - - async delete(query: object) { - try { - const result = await this.client.delete(query) - return result.body - } catch (err) { - console.error("Error deleting from elasticsearch", err) - throw err - } finally { - await this.client.close() - } + try { + const result = await this.client.index({ + index, + body: json, + }) + return result.body + } catch (err) { + console.error("Error writing to elasticsearch", err) + throw err + } finally { + await this.client.close() } } - module.exports = { - schema: SCHEMA, - integration: ElasticSearchIntegration, + async read(query: { index: string; json: object }) { + const { index, json } = query + try { + const result = await this.client.search({ + index: index, + body: json, + }) + return result.body.hits.hits.map(({ _source }: any) => _source) + } catch (err) { + console.error("Error querying elasticsearch", err) + throw err + } finally { + await this.client.close() + } + } + + async update(query: { id: string; index: string; json: object }) { + const { id, index, json } = query + try { + const result = await this.client.update({ + id, + index, + body: json, + }) + return result.body + } catch (err) { + console.error("Error querying elasticsearch", err) + throw err + } finally { + await this.client.close() + } + } + + async delete(query: object) { + try { + const result = await this.client.delete(query) + return result.body + } catch (err) { + console.error("Error deleting from elasticsearch", err) + throw err + } finally { + await this.client.close() + } } } + +export default { + schema: SCHEMA, + integration: ElasticSearchIntegration, +} diff --git a/packages/server/src/integrations/firebase.ts b/packages/server/src/integrations/firebase.ts index 1f82e9dafe..a82b3be782 100644 --- a/packages/server/src/integrations/firebase.ts +++ b/packages/server/src/integrations/firebase.ts @@ -6,184 +6,182 @@ import { } from "@budibase/types" import { Firestore, WhereFilterOp } from "@google-cloud/firestore" -module Firebase { - interface FirebaseConfig { - email: string - privateKey: string - projectId: string +interface FirebaseConfig { + email: string + privateKey: string + projectId: string +} + +const SCHEMA: Integration = { + docs: "https://firebase.google.com/docs/firestore/quickstart", + friendlyName: "Firestore", + type: "Non-relational", + description: + "Cloud Firestore is a flexible, scalable database for mobile, web, and server development from Firebase and Google Cloud.", + datasource: { + email: { + type: DatasourceFieldType.STRING, + required: true, + }, + privateKey: { + type: DatasourceFieldType.STRING, + required: true, + }, + projectId: { + type: DatasourceFieldType.STRING, + required: true, + }, + }, + query: { + create: { + type: QueryType.JSON, + }, + read: { + type: QueryType.JSON, + }, + update: { + type: QueryType.JSON, + }, + delete: { + type: QueryType.JSON, + }, + }, + extra: { + collection: { + displayName: "Collection", + type: DatasourceFieldType.STRING, + required: true, + }, + filterField: { + displayName: "Filter field", + type: DatasourceFieldType.STRING, + required: false, + }, + filter: { + displayName: "Filter comparison", + type: DatasourceFieldType.LIST, + required: false, + data: { + read: [ + "==", + "<", + "<=", + "!=", + ">=", + ">", + "array-contains", + "in", + "not-in", + "array-contains-any", + ], + }, + }, + filterValue: { + displayName: "Filter value", + type: DatasourceFieldType.STRING, + required: false, + }, + }, +} + +class FirebaseIntegration implements IntegrationBase { + private config: FirebaseConfig + private client: Firestore + + constructor(config: FirebaseConfig) { + this.config = config + this.client = new Firestore({ + projectId: config.projectId, + credentials: { + client_email: config.email, + private_key: config.privateKey?.replace(/\\n/g, "\n"), + }, + }) } - const SCHEMA: Integration = { - docs: "https://firebase.google.com/docs/firestore/quickstart", - friendlyName: "Firestore", - type: "Non-relational", - description: - "Cloud Firestore is a flexible, scalable database for mobile, web, and server development from Firebase and Google Cloud.", - datasource: { - email: { - type: DatasourceFieldType.STRING, - required: true, - }, - privateKey: { - type: DatasourceFieldType.STRING, - required: true, - }, - projectId: { - type: DatasourceFieldType.STRING, - required: true, - }, - }, - query: { - create: { - type: QueryType.JSON, - }, - read: { - type: QueryType.JSON, - }, - update: { - type: QueryType.JSON, - }, - delete: { - type: QueryType.JSON, - }, - }, - extra: { - collection: { - displayName: "Collection", - type: DatasourceFieldType.STRING, - required: true, - }, - filterField: { - displayName: "Filter field", - type: DatasourceFieldType.STRING, - required: false, - }, - filter: { - displayName: "Filter comparison", - type: DatasourceFieldType.LIST, - required: false, - data: { - read: [ - "==", - "<", - "<=", - "!=", - ">=", - ">", - "array-contains", - "in", - "not-in", - "array-contains-any", - ], - }, - }, - filterValue: { - displayName: "Filter value", - type: DatasourceFieldType.STRING, - required: false, - }, - }, + async create(query: { json: object; extra: { [key: string]: string } }) { + try { + const documentReference = this.client + .collection(query.extra.collection) + .doc() + await documentReference.set({ ...query.json, id: documentReference.id }) + const snapshot = await documentReference.get() + return snapshot.data() + } catch (err) { + console.error("Error writing to Firestore", err) + throw err + } } - class FirebaseIntegration implements IntegrationBase { - private config: FirebaseConfig - private client: Firestore - - constructor(config: FirebaseConfig) { - this.config = config - this.client = new Firestore({ - projectId: config.projectId, - credentials: { - client_email: config.email, - private_key: config.privateKey?.replace(/\\n/g, "\n"), - }, - }) - } - - async create(query: { json: object; extra: { [key: string]: string } }) { - try { - const documentReference = this.client - .collection(query.extra.collection) - .doc() - await documentReference.set({ ...query.json, id: documentReference.id }) - const snapshot = await documentReference.get() - return snapshot.data() - } catch (err) { - console.error("Error writing to Firestore", err) - throw err + async read(query: { json: object; extra: { [key: string]: string } }) { + try { + let snapshot + const collectionRef = this.client.collection(query.extra.collection) + if ( + query.extra.filterField && + query.extra.filter && + query.extra.filterValue + ) { + snapshot = await collectionRef + .where( + query.extra.filterField, + query.extra.filter as WhereFilterOp, + query.extra.filterValue + ) + .get() + } else { + snapshot = await collectionRef.get() } + const result: any[] = [] + snapshot.forEach(doc => result.push(doc.data())) + + return result + } catch (err) { + console.error("Error querying Firestore", err) + throw err } + } - async read(query: { json: object; extra: { [key: string]: string } }) { - try { - let snapshot - const collectionRef = this.client.collection(query.extra.collection) - if ( - query.extra.filterField && - query.extra.filter && - query.extra.filterValue - ) { - snapshot = await collectionRef - .where( - query.extra.filterField, - query.extra.filter as WhereFilterOp, - query.extra.filterValue - ) - .get() - } else { - snapshot = await collectionRef.get() - } - const result: any[] = [] - snapshot.forEach(doc => result.push(doc.data())) + async update(query: { + json: Record + extra: { [key: string]: string } + }) { + try { + await this.client + .collection(query.extra.collection) + .doc(query.json.id) + .update(query.json) - return result - } catch (err) { - console.error("Error querying Firestore", err) - throw err - } - } - - async update(query: { - json: Record - extra: { [key: string]: string } - }) { - try { + return ( await this.client .collection(query.extra.collection) .doc(query.json.id) - .update(query.json) - - return ( - await this.client - .collection(query.extra.collection) - .doc(query.json.id) - .get() - ).data() - } catch (err) { - console.error("Error writing to Firestore", err) - throw err - } - } - - async delete(query: { - json: { id: string } - extra: { [key: string]: string } - }) { - try { - await this.client - .collection(query.extra.collection) - .doc(query.json.id) - .delete() - return true - } catch (err) { - console.error("Error deleting from Firestore", err) - throw err - } + .get() + ).data() + } catch (err) { + console.error("Error writing to Firestore", err) + throw err } } - module.exports = { - schema: SCHEMA, - integration: FirebaseIntegration, + async delete(query: { + json: { id: string } + extra: { [key: string]: string } + }) { + try { + await this.client + .collection(query.extra.collection) + .doc(query.json.id) + .delete() + return true + } catch (err) { + console.error("Error deleting from Firestore", err) + throw err + } } } + +export default { + schema: SCHEMA, + integration: FirebaseIntegration, +} diff --git a/packages/server/src/integrations/googlesheets.ts b/packages/server/src/integrations/googlesheets.ts index 129ab485cd..675e28e159 100644 --- a/packages/server/src/integrations/googlesheets.ts +++ b/packages/server/src/integrations/googlesheets.ts @@ -13,409 +13,400 @@ import { DataSourceOperation, FieldTypes } from "../constants" import { GoogleSpreadsheet } from "google-spreadsheet" import env from "../environment" -module GoogleSheetsModule { - const { getGlobalDB } = require("@budibase/backend-core/tenancy") - const { getScopedConfig } = require("@budibase/backend-core/db") - const { Configs } = require("@budibase/backend-core/constants") - const fetch = require("node-fetch") +const { getGlobalDB } = require("@budibase/backend-core/tenancy") +const { getScopedConfig } = require("@budibase/backend-core/db") +const { Configs } = require("@budibase/backend-core/constants") +const fetch = require("node-fetch") - interface GoogleSheetsConfig { - spreadsheetId: string - auth: OAuthClientConfig - } +interface GoogleSheetsConfig { + spreadsheetId: string + auth: OAuthClientConfig +} - interface OAuthClientConfig { - appId: string - accessToken: string - refreshToken: string - } +interface OAuthClientConfig { + appId: string + accessToken: string + refreshToken: string +} - interface AuthTokenRequest { - client_id: string - client_secret: string - refresh_token: string - } +interface AuthTokenRequest { + client_id: string + client_secret: string + refresh_token: string +} - interface AuthTokenResponse { - access_token: string - } +interface AuthTokenResponse { + access_token: string +} - const SCHEMA: Integration = { - plus: true, - auth: { - type: "google", +const SCHEMA: Integration = { + plus: true, + auth: { + type: "google", + }, + relationships: false, + docs: "https://developers.google.com/sheets/api/quickstart/nodejs", + description: + "Create and collaborate on online spreadsheets in real-time and from any device. ", + friendlyName: "Google Sheets", + type: "Spreadsheet", + datasource: { + spreadsheetId: { + display: "Google Sheet URL", + type: DatasourceFieldType.STRING, + required: true, }, - relationships: false, - docs: "https://developers.google.com/sheets/api/quickstart/nodejs", - description: - "Create and collaborate on online spreadsheets in real-time and from any device. ", - friendlyName: "Google Sheets", - type: "Spreadsheet", - datasource: { - spreadsheetId: { - display: "Google Sheet URL", - type: DatasourceFieldType.STRING, - required: true, - }, - }, - query: { - create: { - type: QueryType.FIELDS, - fields: { - sheet: { - type: DatasourceFieldType.STRING, - required: true, - }, - row: { - type: QueryType.JSON, - required: true, - }, + }, + query: { + create: { + type: QueryType.FIELDS, + fields: { + sheet: { + type: DatasourceFieldType.STRING, + required: true, }, - }, - read: { - type: QueryType.FIELDS, - fields: { - sheet: { - type: DatasourceFieldType.STRING, - required: true, - }, - }, - }, - update: { - type: QueryType.FIELDS, - fields: { - sheet: { - type: DatasourceFieldType.STRING, - required: true, - }, - rowIndex: { - type: DatasourceFieldType.STRING, - required: true, - }, - row: { - type: QueryType.JSON, - required: true, - }, - }, - }, - delete: { - type: QueryType.FIELDS, - fields: { - sheet: { - type: DatasourceFieldType.STRING, - required: true, - }, - rowIndex: { - type: DatasourceFieldType.NUMBER, - required: true, - }, + row: { + type: QueryType.JSON, + required: true, }, }, }, + read: { + type: QueryType.FIELDS, + fields: { + sheet: { + type: DatasourceFieldType.STRING, + required: true, + }, + }, + }, + update: { + type: QueryType.FIELDS, + fields: { + sheet: { + type: DatasourceFieldType.STRING, + required: true, + }, + rowIndex: { + type: DatasourceFieldType.STRING, + required: true, + }, + row: { + type: QueryType.JSON, + required: true, + }, + }, + }, + delete: { + type: QueryType.FIELDS, + fields: { + sheet: { + type: DatasourceFieldType.STRING, + required: true, + }, + rowIndex: { + type: DatasourceFieldType.NUMBER, + required: true, + }, + }, + }, + }, +} + +class GoogleSheetsIntegration implements DatasourcePlus { + private readonly config: GoogleSheetsConfig + private client: any + public tables: Record = {} + public schemaErrors: Record = {} + + constructor(config: GoogleSheetsConfig) { + this.config = config + const spreadsheetId = this.cleanSpreadsheetUrl(this.config.spreadsheetId) + this.client = new GoogleSpreadsheet(spreadsheetId) } - class GoogleSheetsIntegration implements DatasourcePlus { - private readonly config: GoogleSheetsConfig - private client: any - public tables: Record = {} - public schemaErrors: Record = {} + getBindingIdentifier() { + return "" + } - constructor(config: GoogleSheetsConfig) { - this.config = config - const spreadsheetId = this.cleanSpreadsheetUrl(this.config.spreadsheetId) - this.client = new GoogleSpreadsheet(spreadsheetId) - } + getStringConcat(parts: string[]) { + return "" + } - getBindingIdentifier() { - return "" - } - - getStringConcat(parts: string[]) { - return "" - } - - /** - * Pull the spreadsheet ID out from a valid google sheets URL - * @param spreadsheetId - the URL or standard spreadsheetId of the google sheet - * @returns spreadsheet Id of the google sheet - */ - cleanSpreadsheetUrl(spreadsheetId: string) { - if (!spreadsheetId) { - throw new Error( - "You must set a spreadsheet ID in your configuration to fetch tables." - ) - } - const parts = spreadsheetId.split("/") - return parts.length > 5 ? parts[5] : spreadsheetId - } - - async fetchAccessToken( - payload: AuthTokenRequest - ): Promise { - const response = await fetch( - "https://www.googleapis.com/oauth2/v4/token", - { - method: "POST", - body: JSON.stringify({ - ...payload, - grant_type: "refresh_token", - }), - headers: { - "Content-Type": "application/json", - }, - } + /** + * Pull the spreadsheet ID out from a valid google sheets URL + * @param spreadsheetId - the URL or standard spreadsheetId of the google sheet + * @returns spreadsheet Id of the google sheet + */ + cleanSpreadsheetUrl(spreadsheetId: string) { + if (!spreadsheetId) { + throw new Error( + "You must set a spreadsheet ID in your configuration to fetch tables." ) + } + const parts = spreadsheetId.split("/") + return parts.length > 5 ? parts[5] : spreadsheetId + } - const json = await response.json() + async fetchAccessToken( + payload: AuthTokenRequest + ): Promise { + const response = await fetch("https://www.googleapis.com/oauth2/v4/token", { + method: "POST", + body: JSON.stringify({ + ...payload, + grant_type: "refresh_token", + }), + headers: { + "Content-Type": "application/json", + }, + }) - if (response.status !== 200) { - throw new Error( - `Error authenticating with google sheets. ${json.error_description}` + const json = await response.json() + + if (response.status !== 200) { + throw new Error( + `Error authenticating with google sheets. ${json.error_description}` + ) + } + + return json + } + + async connect() { + try { + // Initialise oAuth client + const db = getGlobalDB() + let googleConfig = await getScopedConfig(db, { + type: Configs.GOOGLE, + }) + + if (!googleConfig) { + googleConfig = { + clientID: env.GOOGLE_CLIENT_ID, + clientSecret: env.GOOGLE_CLIENT_SECRET, + } + } + + const oauthClient = new OAuth2Client({ + clientId: googleConfig.clientID, + clientSecret: googleConfig.clientSecret, + }) + + const tokenResponse = await this.fetchAccessToken({ + client_id: googleConfig.clientID, + client_secret: googleConfig.clientSecret, + refresh_token: this.config.auth.refreshToken, + }) + + oauthClient.setCredentials({ + refresh_token: this.config.auth.refreshToken, + access_token: tokenResponse.access_token, + }) + + this.client.useOAuth2Client(oauthClient) + await this.client.loadInfo() + } catch (err) { + console.error("Error connecting to google sheets", err) + throw err + } + } + + async buildSchema(datasourceId: string) { + await this.connect() + const sheets = await this.client.sheetsByIndex + const tables: Record = {} + for (let sheet of sheets) { + // must fetch rows to determine schema + await sheet.getRows() + // build schema + const schema: TableSchema = {} + + // build schema from headers + for (let header of sheet.headerValues) { + schema[header] = { + name: header, + type: FieldTypes.STRING, + } + } + + // create tables + tables[sheet.title] = { + _id: buildExternalTableId(datasourceId, sheet.title), + name: sheet.title, + primary: ["rowNumber"], + schema, + } + } + + this.tables = tables + } + + async query(json: QueryJson) { + const sheet = json.endpoint.entityId + + const handlers = { + [DataSourceOperation.CREATE]: () => + this.create({ sheet, row: json.body }), + [DataSourceOperation.READ]: () => this.read({ sheet }), + [DataSourceOperation.UPDATE]: () => + this.update({ + // exclude the header row and zero index + rowIndex: json.extra?.idFilter?.equal?.rowNumber - 2, + sheet, + row: json.body, + }), + [DataSourceOperation.DELETE]: () => + this.delete({ + // exclude the header row and zero index + rowIndex: json.extra?.idFilter?.equal?.rowNumber - 2, + sheet, + }), + [DataSourceOperation.CREATE_TABLE]: () => + this.createTable(json?.table?.name), + [DataSourceOperation.UPDATE_TABLE]: () => this.updateTable(json.table), + [DataSourceOperation.DELETE_TABLE]: () => + this.deleteTable(json?.table?.name), + } + + const internalQueryMethod = handlers[json.endpoint.operation] + + return await internalQueryMethod() + } + + buildRowObject(headers: string[], values: string[], rowNumber: number) { + const rowObject: { rowNumber: number; [key: string]: any } = { rowNumber } + for (let i = 0; i < headers.length; i++) { + rowObject._id = rowNumber + rowObject[headers[i]] = values[i] + } + return rowObject + } + + async createTable(name?: string) { + try { + await this.connect() + const sheet = await this.client.addSheet({ title: name }) + return sheet + } catch (err) { + console.error("Error creating new table in google sheets", err) + throw err + } + } + + async updateTable(table?: any) { + try { + await this.connect() + const sheet = await this.client.sheetsByTitle[table.name] + await sheet.loadHeaderRow() + + if (table._rename) { + const headers = [] + for (let header of sheet.headerValues) { + if (header === table._rename.old) { + headers.push(table._rename.updated) + } else { + headers.push(header) + } + } + await sheet.setHeaderRow(headers) + } else { + let newField = Object.keys(table.schema).find( + key => !sheet.headerValues.includes(key) + ) + await sheet.setHeaderRow([...sheet.headerValues, newField]) + } + } catch (err) { + console.error("Error updating table in google sheets", err) + throw err + } + } + + async deleteTable(sheet: any) { + try { + await this.connect() + const sheetToDelete = await this.client.sheetsByTitle[sheet] + return await sheetToDelete.delete() + } catch (err) { + console.error("Error deleting table in google sheets", err) + throw err + } + } + + async create(query: { sheet: string; row: any }) { + try { + await this.connect() + const sheet = await this.client.sheetsByTitle[query.sheet] + const rowToInsert = + typeof query.row === "string" ? JSON.parse(query.row) : query.row + const row = await sheet.addRow(rowToInsert) + return [ + this.buildRowObject(sheet.headerValues, row._rawData, row._rowNumber), + ] + } catch (err) { + console.error("Error writing to google sheets", err) + throw err + } + } + + async read(query: { sheet: string }) { + try { + await this.connect() + const sheet = await this.client.sheetsByTitle[query.sheet] + const rows = await sheet.getRows() + const headerValues = sheet.headerValues + const response = [] + for (let row of rows) { + response.push( + this.buildRowObject(headerValues, row._rawData, row._rowNumber) ) } - - return json + return response + } catch (err) { + console.error("Error reading from google sheets", err) + throw err } + } - async connect() { - try { - // Initialise oAuth client - const db = getGlobalDB() - let googleConfig = await getScopedConfig(db, { - type: Configs.GOOGLE, - }) - - if (!googleConfig) { - googleConfig = { - clientID: env.GOOGLE_CLIENT_ID, - clientSecret: env.GOOGLE_CLIENT_SECRET, - } - } - - const oauthClient = new OAuth2Client({ - clientId: googleConfig.clientID, - clientSecret: googleConfig.clientSecret, - }) - - const tokenResponse = await this.fetchAccessToken({ - client_id: googleConfig.clientID, - client_secret: googleConfig.clientSecret, - refresh_token: this.config.auth.refreshToken, - }) - - oauthClient.setCredentials({ - refresh_token: this.config.auth.refreshToken, - access_token: tokenResponse.access_token, - }) - - this.client.useOAuth2Client(oauthClient) - await this.client.loadInfo() - } catch (err) { - console.error("Error connecting to google sheets", err) - throw err - } - } - - async buildSchema(datasourceId: string) { - await this.connect() - const sheets = await this.client.sheetsByIndex - const tables: Record = {} - for (let sheet of sheets) { - // must fetch rows to determine schema - await sheet.getRows() - // build schema - const schema: TableSchema = {} - - // build schema from headers - for (let header of sheet.headerValues) { - schema[header] = { - name: header, - type: FieldTypes.STRING, - } - } - - // create tables - tables[sheet.title] = { - _id: buildExternalTableId(datasourceId, sheet.title), - name: sheet.title, - primary: ["rowNumber"], - schema, - } - } - - this.tables = tables - } - - async query(json: QueryJson) { - const sheet = json.endpoint.entityId - - const handlers = { - [DataSourceOperation.CREATE]: () => - this.create({ sheet, row: json.body }), - [DataSourceOperation.READ]: () => this.read({ sheet }), - [DataSourceOperation.UPDATE]: () => - this.update({ - // exclude the header row and zero index - rowIndex: json.extra?.idFilter?.equal?.rowNumber - 2, - sheet, - row: json.body, - }), - [DataSourceOperation.DELETE]: () => - this.delete({ - // exclude the header row and zero index - rowIndex: json.extra?.idFilter?.equal?.rowNumber - 2, - sheet, - }), - [DataSourceOperation.CREATE_TABLE]: () => - this.createTable(json?.table?.name), - [DataSourceOperation.UPDATE_TABLE]: () => this.updateTable(json.table), - [DataSourceOperation.DELETE_TABLE]: () => - this.deleteTable(json?.table?.name), - } - - const internalQueryMethod = handlers[json.endpoint.operation] - - return await internalQueryMethod() - } - - buildRowObject(headers: string[], values: string[], rowNumber: number) { - const rowObject: { rowNumber: number; [key: string]: any } = { rowNumber } - for (let i = 0; i < headers.length; i++) { - rowObject._id = rowNumber - rowObject[headers[i]] = values[i] - } - return rowObject - } - - async createTable(name?: string) { - try { - await this.connect() - const sheet = await this.client.addSheet({ title: name }) - return sheet - } catch (err) { - console.error("Error creating new table in google sheets", err) - throw err - } - } - - async updateTable(table?: any) { - try { - await this.connect() - const sheet = await this.client.sheetsByTitle[table.name] - await sheet.loadHeaderRow() - - if (table._rename) { - const headers = [] - for (let header of sheet.headerValues) { - if (header === table._rename.old) { - headers.push(table._rename.updated) - } else { - headers.push(header) - } - } - await sheet.setHeaderRow(headers) - } else { - let newField = Object.keys(table.schema).find( - key => !sheet.headerValues.includes(key) - ) - await sheet.setHeaderRow([...sheet.headerValues, newField]) - } - } catch (err) { - console.error("Error updating table in google sheets", err) - throw err - } - } - - async deleteTable(sheet: any) { - try { - await this.connect() - const sheetToDelete = await this.client.sheetsByTitle[sheet] - return await sheetToDelete.delete() - } catch (err) { - console.error("Error deleting table in google sheets", err) - throw err - } - } - - async create(query: { sheet: string; row: any }) { - try { - await this.connect() - const sheet = await this.client.sheetsByTitle[query.sheet] - const rowToInsert = - typeof query.row === "string" ? JSON.parse(query.row) : query.row - const row = await sheet.addRow(rowToInsert) - return [ - this.buildRowObject(sheet.headerValues, row._rawData, row._rowNumber), - ] - } catch (err) { - console.error("Error writing to google sheets", err) - throw err - } - } - - async read(query: { sheet: string }) { - try { - await this.connect() - const sheet = await this.client.sheetsByTitle[query.sheet] - const rows = await sheet.getRows() - const headerValues = sheet.headerValues - const response = [] - for (let row of rows) { - response.push( - this.buildRowObject(headerValues, row._rawData, row._rowNumber) - ) - } - return response - } catch (err) { - console.error("Error reading from google sheets", err) - throw err - } - } - - async update(query: { sheet: string; rowIndex: number; row: any }) { - try { - await this.connect() - const sheet = await this.client.sheetsByTitle[query.sheet] - const rows = await sheet.getRows() - const row = rows[query.rowIndex] - if (row) { - const updateValues = query.row - for (let key in updateValues) { - row[key] = updateValues[key] - } - await row.save() - return [ - this.buildRowObject( - sheet.headerValues, - row._rawData, - row._rowNumber - ), - ] - } else { - throw new Error("Row does not exist.") - } - } catch (err) { - console.error("Error reading from google sheets", err) - throw err - } - } - - async delete(query: { sheet: string; rowIndex: number }) { + async update(query: { sheet: string; rowIndex: number; row: any }) { + try { await this.connect() const sheet = await this.client.sheetsByTitle[query.sheet] const rows = await sheet.getRows() const row = rows[query.rowIndex] if (row) { - await row.delete() - return [{ deleted: query.rowIndex }] + const updateValues = query.row + for (let key in updateValues) { + row[key] = updateValues[key] + } + await row.save() + return [ + this.buildRowObject(sheet.headerValues, row._rawData, row._rowNumber), + ] } else { throw new Error("Row does not exist.") } + } catch (err) { + console.error("Error reading from google sheets", err) + throw err } } - module.exports = { - schema: SCHEMA, - integration: GoogleSheetsIntegration, + async delete(query: { sheet: string; rowIndex: number }) { + await this.connect() + const sheet = await this.client.sheetsByTitle[query.sheet] + const rows = await sheet.getRows() + const row = rows[query.rowIndex] + if (row) { + await row.delete() + return [{ deleted: query.rowIndex }] + } else { + throw new Error("Row does not exist.") + } } } + +export default { + schema: SCHEMA, + integration: GoogleSheetsIntegration, +} diff --git a/packages/server/src/integrations/index.ts b/packages/server/src/integrations/index.ts index fd2ce75391..bde7235ac8 100644 --- a/packages/server/src/integrations/index.ts +++ b/packages/server/src/integrations/index.ts @@ -1,22 +1,24 @@ -const postgres = require("./postgres") -const dynamodb = require("./dynamodb") -const mongodb = require("./mongodb") -const elasticsearch = require("./elasticsearch") -const couchdb = require("./couchdb") -const sqlServer = require("./microsoftSqlServer") -const s3 = require("./s3") -const airtable = require("./airtable") -const mysql = require("./mysql") -const arangodb = require("./arangodb") -const rest = require("./rest") -const googlesheets = require("./googlesheets") -const firebase = require("./firebase") -const redis = require("./redis") -const snowflake = require("./snowflake") -const { SourceName } = require("@budibase/types") +import postgres from "./postgres" +import dynamodb from "./dynamodb" +import mongodb from "./mongodb" +import elasticsearch from "./elasticsearch" +import couchdb from "./couchdb" +import sqlServer from "./microsoftSqlServer" +import s3 from "./s3" +import airtable from "./airtable" +import mysql from "./mysql" +import arangodb from "./arangodb" +import rest from "./rest" +import googlesheets from "./googlesheets" +import firebase from "./firebase" +import redis from "./redis" +import snowflake from "./snowflake" +import { getPlugins } from "../api/controllers/plugin" +import { SourceName, Integration, PluginType } from "@budibase/types" const environment = require("../environment") +const { cloneDeep } = require("lodash") -const DEFINITIONS = { +const DEFINITIONS: { [key: string]: Integration } = { [SourceName.POSTGRES]: postgres.schema, [SourceName.DYNAMODB]: dynamodb.schema, [SourceName.MONGODB]: mongodb.schema, @@ -33,7 +35,7 @@ const DEFINITIONS = { [SourceName.SNOWFLAKE]: snowflake.schema, } -const INTEGRATIONS = { +const INTEGRATIONS: { [key: string]: any } = { [SourceName.POSTGRES]: postgres.integration, [SourceName.DYNAMODB]: dynamodb.integration, [SourceName.MONGODB]: mongodb.integration, @@ -48,7 +50,7 @@ const INTEGRATIONS = { [SourceName.FIRESTORE]: firebase.integration, [SourceName.GOOGLE_SHEETS]: googlesheets.integration, [SourceName.REDIS]: redis.integration, - [SourceName.FIREBASE]: firebase.integration, + [SourceName.FIRESTORE]: firebase.integration, [SourceName.SNOWFLAKE]: snowflake.integration, } @@ -64,6 +66,9 @@ if (environment.SELF_HOSTED) { } module.exports = { - definitions: DEFINITIONS, + getDefinitions: async () => { + const custom = await getPlugins(PluginType.DATASOURCE) + return cloneDeep(DEFINITIONS) + }, integrations: INTEGRATIONS, } diff --git a/packages/server/src/integrations/microsoftSqlServer.ts b/packages/server/src/integrations/microsoftSqlServer.ts index 6103fd90ce..0746d0e3bc 100644 --- a/packages/server/src/integrations/microsoftSqlServer.ts +++ b/packages/server/src/integrations/microsoftSqlServer.ts @@ -18,292 +18,290 @@ import { } from "./utils" import Sql from "./base/sql" -module MSSQLModule { - const sqlServer = require("mssql") - const DEFAULT_SCHEMA = "dbo" +const sqlServer = require("mssql") +const DEFAULT_SCHEMA = "dbo" - interface MSSQLConfig { - user: string - password: string - server: string - port: number - database: string - schema: string - encrypt?: boolean - } +interface MSSQLConfig { + user: string + password: string + server: string + port: number + database: string + schema: string + encrypt?: boolean +} - interface TablesResponse { - TABLE_CATALOG: string - TABLE_SCHEMA: string - TABLE_NAME: string - TABLE_TYPE: string - } +interface TablesResponse { + TABLE_CATALOG: string + TABLE_SCHEMA: string + TABLE_NAME: string + TABLE_TYPE: string +} - const SCHEMA: Integration = { - docs: "https://github.com/tediousjs/node-mssql", - plus: true, - description: - "Microsoft SQL Server is a relational database management system developed by Microsoft. ", - friendlyName: "MS SQL Server", - type: "Relational", - datasource: { - user: { - type: DatasourceFieldType.STRING, - required: true, - default: "localhost", - }, - password: { - type: DatasourceFieldType.PASSWORD, - required: true, - }, - server: { - type: DatasourceFieldType.STRING, - default: "localhost", - }, - port: { - type: DatasourceFieldType.NUMBER, - required: false, - default: 1433, - }, - database: { - type: DatasourceFieldType.STRING, - default: "root", - }, - schema: { - type: DatasourceFieldType.STRING, - default: DEFAULT_SCHEMA, - }, - encrypt: { - type: DatasourceFieldType.BOOLEAN, - default: true, - }, +const SCHEMA: Integration = { + docs: "https://github.com/tediousjs/node-mssql", + plus: true, + description: + "Microsoft SQL Server is a relational database management system developed by Microsoft. ", + friendlyName: "MS SQL Server", + type: "Relational", + datasource: { + user: { + type: DatasourceFieldType.STRING, + required: true, + default: "localhost", }, - query: { - create: { - type: QueryType.SQL, - }, - read: { - type: QueryType.SQL, - }, - update: { - type: QueryType.SQL, - }, - delete: { - type: QueryType.SQL, - }, + password: { + type: DatasourceFieldType.PASSWORD, + required: true, }, - } + server: { + type: DatasourceFieldType.STRING, + default: "localhost", + }, + port: { + type: DatasourceFieldType.NUMBER, + required: false, + default: 1433, + }, + database: { + type: DatasourceFieldType.STRING, + default: "root", + }, + schema: { + type: DatasourceFieldType.STRING, + default: DEFAULT_SCHEMA, + }, + encrypt: { + type: DatasourceFieldType.BOOLEAN, + default: true, + }, + }, + query: { + create: { + type: QueryType.SQL, + }, + read: { + type: QueryType.SQL, + }, + update: { + type: QueryType.SQL, + }, + delete: { + type: QueryType.SQL, + }, + }, +} - class SqlServerIntegration extends Sql implements DatasourcePlus { - private readonly config: MSSQLConfig - private index: number = 0 - private readonly pool: any - private client: any - public tables: Record = {} - public schemaErrors: Record = {} +class SqlServerIntegration extends Sql implements DatasourcePlus { + private readonly config: MSSQLConfig + private index: number = 0 + private readonly pool: any + private client: any + public tables: Record = {} + public schemaErrors: Record = {} - MASTER_TABLES = [ - "spt_fallback_db", - "spt_fallback_dev", - "spt_fallback_usg", - "spt_monitor", - "MSreplication_options", - ] - TABLES_SQL = - "SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'" + MASTER_TABLES = [ + "spt_fallback_db", + "spt_fallback_dev", + "spt_fallback_usg", + "spt_monitor", + "MSreplication_options", + ] + TABLES_SQL = + "SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'" - constructor(config: MSSQLConfig) { - super(SqlClient.MS_SQL) - this.config = config - const clientCfg = { - ...this.config, - options: { - encrypt: this.config.encrypt, - enableArithAbort: true, - }, - } - delete clientCfg.encrypt - if (!this.pool) { - this.pool = new sqlServer.ConnectionPool(clientCfg) - } + constructor(config: MSSQLConfig) { + super(SqlClient.MS_SQL) + this.config = config + const clientCfg = { + ...this.config, + options: { + encrypt: this.config.encrypt, + enableArithAbort: true, + }, } - - getBindingIdentifier(): string { - return `@p${this.index++}` - } - - getStringConcat(parts: string[]): string { - return `concat(${parts.join(", ")})` - } - - async connect() { - try { - this.client = await this.pool.connect() - } catch (err) { - // @ts-ignore - throw new Error(err) - } - } - - async internalQuery( - query: SqlQuery, - operation: string | undefined = undefined - ) { - const client = this.client - const request = client.request() - this.index = 0 - try { - if (Array.isArray(query.bindings)) { - let count = 0 - for (let binding of query.bindings) { - request.input(`p${count++}`, binding) - } - } - // this is a hack to get the inserted ID back, - // no way to do this with Knex nicely - const sql = - operation === Operation.CREATE - ? `${query.sql}; SELECT SCOPE_IDENTITY() AS id;` - : query.sql - return await request.query(sql) - } catch (err) { - // @ts-ignore - throw new Error(err) - } - } - - getDefinitionSQL(tableName: string) { - return `select * - from INFORMATION_SCHEMA.COLUMNS - where TABLE_NAME='${tableName}'` - } - - getConstraintsSQL(tableName: string) { - return `SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS TC - INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS KU - ON TC.CONSTRAINT_TYPE = 'PRIMARY KEY' - AND TC.CONSTRAINT_NAME = KU.CONSTRAINT_NAME - AND KU.table_name='${tableName}' - ORDER BY - KU.TABLE_NAME, - KU.ORDINAL_POSITION;` - } - - getAutoColumnsSQL(tableName: string) { - return `SELECT - COLUMNPROPERTY(OBJECT_ID(TABLE_SCHEMA+'.'+TABLE_NAME),COLUMN_NAME,'IsComputed') - AS IS_COMPUTED, - COLUMNPROPERTY(object_id(TABLE_SCHEMA+'.'+TABLE_NAME), COLUMN_NAME, 'IsIdentity') - AS IS_IDENTITY, - * - FROM INFORMATION_SCHEMA.COLUMNS - WHERE TABLE_NAME='${tableName}'` - } - - async runSQL(sql: string) { - return (await this.internalQuery(getSqlQuery(sql))).recordset - } - - /** - * Fetches the tables from the sql server database and assigns them to the datasource. - * @param {*} datasourceId - datasourceId to fetch - * @param entities - the tables that are to be built - */ - async buildSchema(datasourceId: string, entities: Record) { - await this.connect() - let tableInfo: TablesResponse[] = await this.runSQL(this.TABLES_SQL) - if (tableInfo == null || !Array.isArray(tableInfo)) { - throw "Unable to get list of tables in database" - } - - const schema = this.config.schema || DEFAULT_SCHEMA - const tableNames = tableInfo - .filter((record: any) => record.TABLE_SCHEMA === schema) - .map((record: any) => record.TABLE_NAME) - .filter((name: string) => this.MASTER_TABLES.indexOf(name) === -1) - - const tables: Record = {} - for (let tableName of tableNames) { - // get the column definition (type) - const definition = await this.runSQL(this.getDefinitionSQL(tableName)) - // find primary key constraints - const constraints = await this.runSQL(this.getConstraintsSQL(tableName)) - // find the computed and identity columns (auto columns) - const columns = await this.runSQL(this.getAutoColumnsSQL(tableName)) - const primaryKeys = constraints - .filter( - (constraint: any) => constraint.CONSTRAINT_TYPE === "PRIMARY KEY" - ) - .map((constraint: any) => constraint.COLUMN_NAME) - const autoColumns = columns - .filter((col: any) => col.IS_COMPUTED || col.IS_IDENTITY) - .map((col: any) => col.COLUMN_NAME) - - let schema: TableSchema = {} - for (let def of definition) { - const name = def.COLUMN_NAME - if (typeof name !== "string") { - continue - } - schema[name] = { - autocolumn: !!autoColumns.find((col: string) => col === name), - name: name, - ...convertSqlType(def.DATA_TYPE), - externalType: def.DATA_TYPE, - } - } - tables[tableName] = { - _id: buildExternalTableId(datasourceId, tableName), - primary: primaryKeys, - name: tableName, - schema, - } - } - const final = finaliseExternalTables(tables, entities) - this.tables = final.tables - this.schemaErrors = final.errors - } - - async read(query: SqlQuery | string) { - await this.connect() - const response = await this.internalQuery(getSqlQuery(query)) - return response.recordset - } - - async create(query: SqlQuery | string) { - await this.connect() - const response = await this.internalQuery(getSqlQuery(query)) - return response.recordset || [{ created: true }] - } - - async update(query: SqlQuery | string) { - await this.connect() - const response = await this.internalQuery(getSqlQuery(query)) - return response.recordset || [{ updated: true }] - } - - async delete(query: SqlQuery | string) { - await this.connect() - const response = await this.internalQuery(getSqlQuery(query)) - return response.recordset || [{ deleted: true }] - } - - async query(json: QueryJson) { - const schema = this.config.schema - await this.connect() - if (schema && schema !== DEFAULT_SCHEMA && json?.endpoint) { - json.endpoint.schema = schema - } - const operation = this._operation(json) - const queryFn = (query: any, op: string) => this.internalQuery(query, op) - const processFn = (result: any) => - result.recordset ? result.recordset : [{ [operation]: true }] - return this.queryWithReturning(json, queryFn, processFn) + delete clientCfg.encrypt + if (!this.pool) { + this.pool = new sqlServer.ConnectionPool(clientCfg) } } - module.exports = { - schema: SCHEMA, - integration: SqlServerIntegration, + getBindingIdentifier(): string { + return `@p${this.index++}` + } + + getStringConcat(parts: string[]): string { + return `concat(${parts.join(", ")})` + } + + async connect() { + try { + this.client = await this.pool.connect() + } catch (err) { + // @ts-ignore + throw new Error(err) + } + } + + async internalQuery( + query: SqlQuery, + operation: string | undefined = undefined + ) { + const client = this.client + const request = client.request() + this.index = 0 + try { + if (Array.isArray(query.bindings)) { + let count = 0 + for (let binding of query.bindings) { + request.input(`p${count++}`, binding) + } + } + // this is a hack to get the inserted ID back, + // no way to do this with Knex nicely + const sql = + operation === Operation.CREATE + ? `${query.sql}; SELECT SCOPE_IDENTITY() AS id;` + : query.sql + return await request.query(sql) + } catch (err) { + // @ts-ignore + throw new Error(err) + } + } + + getDefinitionSQL(tableName: string) { + return `select * + from INFORMATION_SCHEMA.COLUMNS + where TABLE_NAME='${tableName}'` + } + + getConstraintsSQL(tableName: string) { + return `SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS TC + INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS KU + ON TC.CONSTRAINT_TYPE = 'PRIMARY KEY' + AND TC.CONSTRAINT_NAME = KU.CONSTRAINT_NAME + AND KU.table_name='${tableName}' + ORDER BY + KU.TABLE_NAME, + KU.ORDINAL_POSITION;` + } + + getAutoColumnsSQL(tableName: string) { + return `SELECT + COLUMNPROPERTY(OBJECT_ID(TABLE_SCHEMA+'.'+TABLE_NAME),COLUMN_NAME,'IsComputed') + AS IS_COMPUTED, + COLUMNPROPERTY(object_id(TABLE_SCHEMA+'.'+TABLE_NAME), COLUMN_NAME, 'IsIdentity') + AS IS_IDENTITY, + * + FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_NAME='${tableName}'` + } + + async runSQL(sql: string) { + return (await this.internalQuery(getSqlQuery(sql))).recordset + } + + /** + * Fetches the tables from the sql server database and assigns them to the datasource. + * @param {*} datasourceId - datasourceId to fetch + * @param entities - the tables that are to be built + */ + async buildSchema(datasourceId: string, entities: Record) { + await this.connect() + let tableInfo: TablesResponse[] = await this.runSQL(this.TABLES_SQL) + if (tableInfo == null || !Array.isArray(tableInfo)) { + throw "Unable to get list of tables in database" + } + + const schema = this.config.schema || DEFAULT_SCHEMA + const tableNames = tableInfo + .filter((record: any) => record.TABLE_SCHEMA === schema) + .map((record: any) => record.TABLE_NAME) + .filter((name: string) => this.MASTER_TABLES.indexOf(name) === -1) + + const tables: Record = {} + for (let tableName of tableNames) { + // get the column definition (type) + const definition = await this.runSQL(this.getDefinitionSQL(tableName)) + // find primary key constraints + const constraints = await this.runSQL(this.getConstraintsSQL(tableName)) + // find the computed and identity columns (auto columns) + const columns = await this.runSQL(this.getAutoColumnsSQL(tableName)) + const primaryKeys = constraints + .filter( + (constraint: any) => constraint.CONSTRAINT_TYPE === "PRIMARY KEY" + ) + .map((constraint: any) => constraint.COLUMN_NAME) + const autoColumns = columns + .filter((col: any) => col.IS_COMPUTED || col.IS_IDENTITY) + .map((col: any) => col.COLUMN_NAME) + + let schema: TableSchema = {} + for (let def of definition) { + const name = def.COLUMN_NAME + if (typeof name !== "string") { + continue + } + schema[name] = { + autocolumn: !!autoColumns.find((col: string) => col === name), + name: name, + ...convertSqlType(def.DATA_TYPE), + externalType: def.DATA_TYPE, + } + } + tables[tableName] = { + _id: buildExternalTableId(datasourceId, tableName), + primary: primaryKeys, + name: tableName, + schema, + } + } + const final = finaliseExternalTables(tables, entities) + this.tables = final.tables + this.schemaErrors = final.errors + } + + async read(query: SqlQuery | string) { + await this.connect() + const response = await this.internalQuery(getSqlQuery(query)) + return response.recordset + } + + async create(query: SqlQuery | string) { + await this.connect() + const response = await this.internalQuery(getSqlQuery(query)) + return response.recordset || [{ created: true }] + } + + async update(query: SqlQuery | string) { + await this.connect() + const response = await this.internalQuery(getSqlQuery(query)) + return response.recordset || [{ updated: true }] + } + + async delete(query: SqlQuery | string) { + await this.connect() + const response = await this.internalQuery(getSqlQuery(query)) + return response.recordset || [{ deleted: true }] + } + + async query(json: QueryJson) { + const schema = this.config.schema + await this.connect() + if (schema && schema !== DEFAULT_SCHEMA && json?.endpoint) { + json.endpoint.schema = schema + } + const operation = this._operation(json) + const queryFn = (query: any, op: string) => this.internalQuery(query, op) + const processFn = (result: any) => + result.recordset ? result.recordset : [{ [operation]: true }] + return this.queryWithReturning(json, queryFn, processFn) } } + +export default { + schema: SCHEMA, + integration: SqlServerIntegration, +} diff --git a/packages/server/src/integrations/mongodb.ts b/packages/server/src/integrations/mongodb.ts index 4f2a901259..3b11348368 100644 --- a/packages/server/src/integrations/mongodb.ts +++ b/packages/server/src/integrations/mongodb.ts @@ -15,313 +15,309 @@ import { CommonOptions, } from "mongodb" -module MongoDBModule { - interface MongoDBConfig { - connectionString: string - db: string +interface MongoDBConfig { + connectionString: string + db: string +} + +const SCHEMA: Integration = { + docs: "https://github.com/mongodb/node-mongodb-native", + friendlyName: "MongoDB", + type: "Non-relational", + description: + "MongoDB is a general purpose, document-based, distributed database built for modern application developers and for the cloud era.", + datasource: { + connectionString: { + type: DatasourceFieldType.STRING, + required: true, + default: "mongodb://localhost:27017", + }, + db: { + type: DatasourceFieldType.STRING, + required: true, + }, + }, + query: { + create: { + type: QueryType.JSON, + }, + read: { + type: QueryType.JSON, + }, + update: { + type: QueryType.JSON, + }, + delete: { + type: QueryType.JSON, + }, + }, + extra: { + collection: { + displayName: "Collection", + type: DatasourceFieldType.STRING, + required: true, + }, + actionTypes: { + displayName: "Action Types", + type: DatasourceFieldType.LIST, + required: true, + data: { + read: ["find", "findOne", "findOneAndUpdate", "count", "distinct"], + create: ["insertOne", "insertMany"], + update: ["updateOne", "updateMany"], + delete: ["deleteOne", "deleteMany"], + }, + }, + }, +} + +class MongoIntegration implements IntegrationBase { + private config: MongoDBConfig + private client: any + + constructor(config: MongoDBConfig) { + this.config = config + this.client = new MongoClient(config.connectionString) } - const SCHEMA: Integration = { - docs: "https://github.com/mongodb/node-mongodb-native", - friendlyName: "MongoDB", - type: "Non-relational", - description: - "MongoDB is a general purpose, document-based, distributed database built for modern application developers and for the cloud era.", - datasource: { - connectionString: { - type: DatasourceFieldType.STRING, - required: true, - default: "mongodb://localhost:27017", - }, - db: { - type: DatasourceFieldType.STRING, - required: true, - }, - }, - query: { - create: { - type: QueryType.JSON, - }, - read: { - type: QueryType.JSON, - }, - update: { - type: QueryType.JSON, - }, - delete: { - type: QueryType.JSON, - }, - }, - extra: { - collection: { - displayName: "Collection", - type: DatasourceFieldType.STRING, - required: true, - }, - actionTypes: { - displayName: "Action Types", - type: DatasourceFieldType.LIST, - required: true, - data: { - read: ["find", "findOne", "findOneAndUpdate", "count", "distinct"], - create: ["insertOne", "insertMany"], - update: ["updateOne", "updateMany"], - delete: ["deleteOne", "deleteMany"], - }, - }, - }, + async connect() { + return this.client.connect() } - class MongoIntegration implements IntegrationBase { - private config: MongoDBConfig - private client: any - - constructor(config: MongoDBConfig) { - this.config = config - this.client = new MongoClient(config.connectionString) + createObjectIds(json: any): object { + const self = this + function interpolateObjectIds(json: any) { + for (let field of Object.keys(json)) { + if (json[field] instanceof Object) { + json[field] = self.createObjectIds(json[field]) + } + if ( + (field === "_id" || field?.startsWith("$")) && + typeof json[field] === "string" + ) { + const id = json[field].match(/(?<=objectid\(['"]).*(?=['"]\))/gi)?.[0] + if (id) { + json[field] = ObjectID.createFromHexString(id) + } + } + } + return json } - async connect() { - return this.client.connect() + if (Array.isArray(json)) { + for (let i = 0; i < json.length; i++) { + json[i] = interpolateObjectIds(json[i]) + } + return json } + return interpolateObjectIds(json) + } - createObjectIds(json: any): object { - const self = this - function interpolateObjectIds(json: any) { - for (let field of Object.keys(json)) { - if (json[field] instanceof Object) { - json[field] = self.createObjectIds(json[field]) - } - if ( - (field === "_id" || field?.startsWith("$")) && - typeof json[field] === "string" - ) { - const id = json[field].match( - /(?<=objectid\(['"]).*(?=['"]\))/gi - )?.[0] - if (id) { - json[field] = ObjectID.createFromHexString(id) - } - } - } - return json + parseQueryParams(params: string, mode: string) { + let queryParams = [] + let openCount = 0 + let inQuotes = false + let i = 0 + let startIndex = 0 + for (let c of params) { + if (c === '"' && i > 0 && params[i - 1] !== "\\") { + inQuotes = !inQuotes } - - if (Array.isArray(json)) { - for (let i = 0; i < json.length; i++) { - json[i] = interpolateObjectIds(json[i]) + if (c === "{" && !inQuotes) { + openCount++ + if (openCount === 1) { + startIndex = i } - return json + } else if (c === "}" && !inQuotes) { + if (openCount === 1) { + queryParams.push(JSON.parse(params.substring(startIndex, i + 1))) + } + openCount-- } - return interpolateObjectIds(json) + i++ } - - parseQueryParams(params: string, mode: string) { - let queryParams = [] - let openCount = 0 - let inQuotes = false - let i = 0 - let startIndex = 0 - for (let c of params) { - if (c === '"' && i > 0 && params[i - 1] !== "\\") { - inQuotes = !inQuotes - } - if (c === "{" && !inQuotes) { - openCount++ - if (openCount === 1) { - startIndex = i - } - } else if (c === "}" && !inQuotes) { - if (openCount === 1) { - queryParams.push(JSON.parse(params.substring(startIndex, i + 1))) - } - openCount-- - } - i++ - } - let group1 = queryParams[0] ?? {} - let group2 = queryParams[1] ?? {} - let group3 = queryParams[2] ?? {} - if (mode === "update") { - return { - filter: group1, - update: group2, - options: group3, - } - } + let group1 = queryParams[0] ?? {} + let group2 = queryParams[1] ?? {} + let group3 = queryParams[2] ?? {} + if (mode === "update") { return { filter: group1, - options: group2, + update: group2, + options: group3, } } - - async create(query: { json: object; extra: { [key: string]: string } }) { - try { - await this.connect() - const db = this.client.db(this.config.db) - const collection = db.collection(query.extra.collection) - let json = this.createObjectIds(query.json) - - // For mongodb we add an extra actionType to specify - // which method we want to call on the collection - switch (query.extra.actionTypes) { - case "insertOne": { - return await collection.insertOne(json) - } - case "insertMany": { - return await collection.insertMany(json) - } - default: { - throw new Error( - `actionType ${query.extra.actionTypes} does not exist on DB for create` - ) - } - } - } catch (err) { - console.error("Error writing to mongodb", err) - throw err - } finally { - await this.client.close() - } - } - - async read(query: { json: object; extra: { [key: string]: string } }) { - try { - await this.connect() - const db = this.client.db(this.config.db) - const collection = db.collection(query.extra.collection) - let json = this.createObjectIds(query.json) - - switch (query.extra.actionTypes) { - case "find": { - return await collection.find(json).toArray() - } - case "findOne": { - return await collection.findOne(json) - } - case "findOneAndUpdate": { - if (typeof query.json === "string") { - json = this.parseQueryParams(query.json, "update") - } - let findAndUpdateJson = this.createObjectIds(json) as { - filter: FilterQuery - update: UpdateQuery - options: FindOneAndUpdateOption - } - return await collection.findOneAndUpdate( - findAndUpdateJson.filter, - findAndUpdateJson.update, - findAndUpdateJson.options - ) - } - case "count": { - return await collection.countDocuments(json) - } - case "distinct": { - return await collection.distinct(json) - } - default: { - throw new Error( - `actionType ${query.extra.actionTypes} does not exist on DB for read` - ) - } - } - } catch (err) { - console.error("Error querying mongodb", err) - throw err - } finally { - await this.client.close() - } - } - - async update(query: { json: object; extra: { [key: string]: string } }) { - try { - await this.connect() - const db = this.client.db(this.config.db) - const collection = db.collection(query.extra.collection) - let queryJson = query.json - if (typeof queryJson === "string") { - queryJson = this.parseQueryParams(queryJson, "update") - } - let json = this.createObjectIds(queryJson) as { - filter: FilterQuery - update: UpdateQuery - options: object - } - - switch (query.extra.actionTypes) { - case "updateOne": { - return await collection.updateOne( - json.filter, - json.update, - json.options as UpdateOneOptions - ) - } - case "updateMany": { - return await collection.updateMany( - json.filter, - json.update, - json.options as UpdateManyOptions - ) - } - default: { - throw new Error( - `actionType ${query.extra.actionTypes} does not exist on DB for update` - ) - } - } - } catch (err) { - console.error("Error writing to mongodb", err) - throw err - } finally { - await this.client.close() - } - } - - async delete(query: { json: object; extra: { [key: string]: string } }) { - try { - await this.connect() - const db = this.client.db(this.config.db) - const collection = db.collection(query.extra.collection) - let queryJson = query.json - if (typeof queryJson === "string") { - queryJson = this.parseQueryParams(queryJson, "delete") - } - let json = this.createObjectIds(queryJson) as { - filter: FilterQuery - options: CommonOptions - } - if (!json.options) { - json = { - filter: json, - options: {}, - } - } - - switch (query.extra.actionTypes) { - case "deleteOne": { - return await collection.deleteOne(json.filter, json.options) - } - case "deleteMany": { - return await collection.deleteMany(json.filter, json.options) - } - default: { - throw new Error( - `actionType ${query.extra.actionTypes} does not exist on DB for delete` - ) - } - } - } catch (err) { - console.error("Error writing to mongodb", err) - throw err - } finally { - await this.client.close() - } + return { + filter: group1, + options: group2, } } - module.exports = { - schema: SCHEMA, - integration: MongoIntegration, + async create(query: { json: object; extra: { [key: string]: string } }) { + try { + await this.connect() + const db = this.client.db(this.config.db) + const collection = db.collection(query.extra.collection) + let json = this.createObjectIds(query.json) + + // For mongodb we add an extra actionType to specify + // which method we want to call on the collection + switch (query.extra.actionTypes) { + case "insertOne": { + return await collection.insertOne(json) + } + case "insertMany": { + return await collection.insertMany(json) + } + default: { + throw new Error( + `actionType ${query.extra.actionTypes} does not exist on DB for create` + ) + } + } + } catch (err) { + console.error("Error writing to mongodb", err) + throw err + } finally { + await this.client.close() + } + } + + async read(query: { json: object; extra: { [key: string]: string } }) { + try { + await this.connect() + const db = this.client.db(this.config.db) + const collection = db.collection(query.extra.collection) + let json = this.createObjectIds(query.json) + + switch (query.extra.actionTypes) { + case "find": { + return await collection.find(json).toArray() + } + case "findOne": { + return await collection.findOne(json) + } + case "findOneAndUpdate": { + if (typeof query.json === "string") { + json = this.parseQueryParams(query.json, "update") + } + let findAndUpdateJson = this.createObjectIds(json) as { + filter: FilterQuery + update: UpdateQuery + options: FindOneAndUpdateOption + } + return await collection.findOneAndUpdate( + findAndUpdateJson.filter, + findAndUpdateJson.update, + findAndUpdateJson.options + ) + } + case "count": { + return await collection.countDocuments(json) + } + case "distinct": { + return await collection.distinct(json) + } + default: { + throw new Error( + `actionType ${query.extra.actionTypes} does not exist on DB for read` + ) + } + } + } catch (err) { + console.error("Error querying mongodb", err) + throw err + } finally { + await this.client.close() + } + } + + async update(query: { json: object; extra: { [key: string]: string } }) { + try { + await this.connect() + const db = this.client.db(this.config.db) + const collection = db.collection(query.extra.collection) + let queryJson = query.json + if (typeof queryJson === "string") { + queryJson = this.parseQueryParams(queryJson, "update") + } + let json = this.createObjectIds(queryJson) as { + filter: FilterQuery + update: UpdateQuery + options: object + } + + switch (query.extra.actionTypes) { + case "updateOne": { + return await collection.updateOne( + json.filter, + json.update, + json.options as UpdateOneOptions + ) + } + case "updateMany": { + return await collection.updateMany( + json.filter, + json.update, + json.options as UpdateManyOptions + ) + } + default: { + throw new Error( + `actionType ${query.extra.actionTypes} does not exist on DB for update` + ) + } + } + } catch (err) { + console.error("Error writing to mongodb", err) + throw err + } finally { + await this.client.close() + } + } + + async delete(query: { json: object; extra: { [key: string]: string } }) { + try { + await this.connect() + const db = this.client.db(this.config.db) + const collection = db.collection(query.extra.collection) + let queryJson = query.json + if (typeof queryJson === "string") { + queryJson = this.parseQueryParams(queryJson, "delete") + } + let json = this.createObjectIds(queryJson) as { + filter: FilterQuery + options: CommonOptions + } + if (!json.options) { + json = { + filter: json, + options: {}, + } + } + + switch (query.extra.actionTypes) { + case "deleteOne": { + return await collection.deleteOne(json.filter, json.options) + } + case "deleteMany": { + return await collection.deleteMany(json.filter, json.options) + } + default: { + throw new Error( + `actionType ${query.extra.actionTypes} does not exist on DB for delete` + ) + } + } + } catch (err) { + console.error("Error writing to mongodb", err) + throw err + } finally { + await this.client.close() + } } } + +export default { + schema: SCHEMA, + integration: MongoIntegration, +} diff --git a/packages/server/src/integrations/mysql.ts b/packages/server/src/integrations/mysql.ts index 466f2e6494..0f236935c8 100644 --- a/packages/server/src/integrations/mysql.ts +++ b/packages/server/src/integrations/mysql.ts @@ -19,274 +19,269 @@ import dayjs from "dayjs" const { NUMBER_REGEX } = require("../utilities") import Sql from "./base/sql" -module MySQLModule { - const mysql = require("mysql2/promise") +const mysql = require("mysql2/promise") - interface MySQLConfig { - host: string - port: number - user: string - password: string - database: string - ssl?: { [key: string]: any } - rejectUnauthorized: boolean - typeCast: Function - } +interface MySQLConfig { + host: string + port: number + user: string + password: string + database: string + ssl?: { [key: string]: any } + rejectUnauthorized: boolean + typeCast: Function +} - const SCHEMA: Integration = { - docs: "https://github.com/sidorares/node-mysql2", - plus: true, - friendlyName: "MySQL", - type: "Relational", - description: - "MySQL Database Service is a fully managed database service to deploy cloud-native applications. ", - datasource: { - host: { - type: DatasourceFieldType.STRING, - default: "localhost", - required: true, - }, - port: { - type: DatasourceFieldType.NUMBER, - default: 3306, - required: false, - }, - user: { - type: DatasourceFieldType.STRING, - default: "root", - required: true, - }, - password: { - type: DatasourceFieldType.PASSWORD, - default: "root", - required: true, - }, - database: { - type: DatasourceFieldType.STRING, - required: true, - }, - ssl: { - type: DatasourceFieldType.OBJECT, - required: false, - }, - rejectUnauthorized: { - type: DatasourceFieldType.BOOLEAN, - default: true, - required: false, - }, +const SCHEMA: Integration = { + docs: "https://github.com/sidorares/node-mysql2", + plus: true, + friendlyName: "MySQL", + type: "Relational", + description: + "MySQL Database Service is a fully managed database service to deploy cloud-native applications. ", + datasource: { + host: { + type: DatasourceFieldType.STRING, + default: "localhost", + required: true, }, - query: { - create: { - type: QueryType.SQL, - }, - read: { - type: QueryType.SQL, - }, - update: { - type: QueryType.SQL, - }, - delete: { - type: QueryType.SQL, - }, + port: { + type: DatasourceFieldType.NUMBER, + default: 3306, + required: false, }, + user: { + type: DatasourceFieldType.STRING, + default: "root", + required: true, + }, + password: { + type: DatasourceFieldType.PASSWORD, + default: "root", + required: true, + }, + database: { + type: DatasourceFieldType.STRING, + required: true, + }, + ssl: { + type: DatasourceFieldType.OBJECT, + required: false, + }, + rejectUnauthorized: { + type: DatasourceFieldType.BOOLEAN, + default: true, + required: false, + }, + }, + query: { + create: { + type: QueryType.SQL, + }, + read: { + type: QueryType.SQL, + }, + update: { + type: QueryType.SQL, + }, + delete: { + type: QueryType.SQL, + }, + }, +} + +const TimezoneAwareDateTypes = ["timestamp"] + +function bindingTypeCoerce(bindings: any[]) { + for (let i = 0; i < bindings.length; i++) { + const binding = bindings[i] + if (typeof binding !== "string") { + continue + } + const matches = binding.match(NUMBER_REGEX) + // check if number first + if (matches && matches[0] !== "" && !isNaN(Number(matches[0]))) { + bindings[i] = parseFloat(binding) + } + // if not a number, see if it is a date - important to do in this order as any + // integer will be considered a valid date + else if (/^\d/.test(binding) && dayjs(binding).isValid()) { + bindings[i] = dayjs(binding).toDate() + } + } + return bindings +} + +class MySQLIntegration extends Sql implements DatasourcePlus { + private config: MySQLConfig + private client: any + public tables: Record = {} + public schemaErrors: Record = {} + + constructor(config: MySQLConfig) { + super(SqlClient.MY_SQL) + this.config = config + if (config.ssl && Object.keys(config.ssl).length === 0) { + delete config.ssl + } + // make sure this defaults to true + if ( + config.rejectUnauthorized != null && + !config.rejectUnauthorized && + config.ssl + ) { + config.ssl.rejectUnauthorized = config.rejectUnauthorized + } + // @ts-ignore + delete config.rejectUnauthorized + this.config = { + ...config, + typeCast: function (field: any, next: any) { + if ( + field.type == "DATETIME" || + field.type === "DATE" || + field.type === "TIMESTAMP" + ) { + return field.string() + } + return next() + }, + } } - const TimezoneAwareDateTypes = ["timestamp"] - - function bindingTypeCoerce(bindings: any[]) { - for (let i = 0; i < bindings.length; i++) { - const binding = bindings[i] - if (typeof binding !== "string") { - continue - } - const matches = binding.match(NUMBER_REGEX) - // check if number first - if (matches && matches[0] !== "" && !isNaN(Number(matches[0]))) { - bindings[i] = parseFloat(binding) - } - // if not a number, see if it is a date - important to do in this order as any - // integer will be considered a valid date - else if (/^\d/.test(binding) && dayjs(binding).isValid()) { - bindings[i] = dayjs(binding).toDate() - } - } - return bindings + getBindingIdentifier(): string { + return "?" } - class MySQLIntegration extends Sql implements DatasourcePlus { - private config: MySQLConfig - private client: any - public tables: Record = {} - public schemaErrors: Record = {} + getStringConcat(parts: string[]): string { + return `concat(${parts.join(", ")})` + } - constructor(config: MySQLConfig) { - super(SqlClient.MY_SQL) - this.config = config - if (config.ssl && Object.keys(config.ssl).length === 0) { - delete config.ssl + async connect() { + this.client = await mysql.createConnection(this.config) + } + + async disconnect() { + await this.client.end() + } + + async internalQuery( + query: SqlQuery, + opts: { connect?: boolean; disableCoercion?: boolean } = { + connect: true, + disableCoercion: false, + } + ): Promise { + try { + if (opts?.connect) { + await this.connect() } - // make sure this defaults to true - if ( - config.rejectUnauthorized != null && - !config.rejectUnauthorized && - config.ssl - ) { - config.ssl.rejectUnauthorized = config.rejectUnauthorized - } - // @ts-ignore - delete config.rejectUnauthorized - this.config = { - ...config, - typeCast: function (field: any, next: any) { - if ( - field.type == "DATETIME" || - field.type === "DATE" || - field.type === "TIMESTAMP" - ) { - return field.string() - } - return next() - }, + const baseBindings = query.bindings || [] + const bindings = opts?.disableCoercion + ? baseBindings + : bindingTypeCoerce(baseBindings) + // Node MySQL is callback based, so we must wrap our call in a promise + const response = await this.client.query(query.sql, bindings) + return response[0] + } finally { + if (opts?.connect) { + await this.disconnect() } } + } - getBindingIdentifier(): string { - return "?" - } + async buildSchema(datasourceId: string, entities: Record) { + const tables: { [key: string]: Table } = {} + const database = this.config.database + await this.connect() - getStringConcat(parts: string[]): string { - return `concat(${parts.join(", ")})` - } - - async connect() { - this.client = await mysql.createConnection(this.config) - } - - async disconnect() { - await this.client.end() - } - - async internalQuery( - query: SqlQuery, - opts: { connect?: boolean; disableCoercion?: boolean } = { - connect: true, - disableCoercion: false, - } - ): Promise { - try { - if (opts?.connect) { - await this.connect() - } - const baseBindings = query.bindings || [] - const bindings = opts?.disableCoercion - ? baseBindings - : bindingTypeCoerce(baseBindings) - // Node MySQL is callback based, so we must wrap our call in a promise - const response = await this.client.query(query.sql, bindings) - return response[0] - } finally { - if (opts?.connect) { - await this.disconnect() - } - } - } - - async buildSchema(datasourceId: string, entities: Record) { - const tables: { [key: string]: Table } = {} - const database = this.config.database - await this.connect() - - try { - // get the tables first - const tablesResp = await this.internalQuery( - { sql: "SHOW TABLES;" }, + try { + // get the tables first + const tablesResp = await this.internalQuery( + { sql: "SHOW TABLES;" }, + { connect: false } + ) + const tableNames = tablesResp.map( + (obj: any) => + obj[`Tables_in_${database}`] || + obj[`Tables_in_${database.toLowerCase()}`] + ) + for (let tableName of tableNames) { + const primaryKeys = [] + const schema: TableSchema = {} + const descResp = await this.internalQuery( + { sql: `DESCRIBE \`${tableName}\`;` }, { connect: false } ) - const tableNames = tablesResp.map( - (obj: any) => - obj[`Tables_in_${database}`] || - obj[`Tables_in_${database.toLowerCase()}`] - ) - for (let tableName of tableNames) { - const primaryKeys = [] - const schema: TableSchema = {} - const descResp = await this.internalQuery( - { sql: `DESCRIBE \`${tableName}\`;` }, - { connect: false } - ) - for (let column of descResp) { - const columnName = column.Field - if ( - column.Key === "PRI" && - primaryKeys.indexOf(column.Key) === -1 - ) { - primaryKeys.push(columnName) - } - const constraints = { - presence: column.Null !== "YES", - } - const isAuto: boolean = - typeof column.Extra === "string" && - (column.Extra === "auto_increment" || - column.Extra.toLowerCase().includes("generated")) - schema[columnName] = { - name: columnName, - autocolumn: isAuto, - constraints, - ...convertSqlType(column.Type), - externalType: column.Type, - } + for (let column of descResp) { + const columnName = column.Field + if (column.Key === "PRI" && primaryKeys.indexOf(column.Key) === -1) { + primaryKeys.push(columnName) } - if (!tables[tableName]) { - tables[tableName] = { - _id: buildExternalTableId(datasourceId, tableName), - primary: primaryKeys, - name: tableName, - schema, - } + const constraints = { + presence: column.Null !== "YES", + } + const isAuto: boolean = + typeof column.Extra === "string" && + (column.Extra === "auto_increment" || + column.Extra.toLowerCase().includes("generated")) + schema[columnName] = { + name: columnName, + autocolumn: isAuto, + constraints, + ...convertSqlType(column.Type), + externalType: column.Type, + } + } + if (!tables[tableName]) { + tables[tableName] = { + _id: buildExternalTableId(datasourceId, tableName), + primary: primaryKeys, + name: tableName, + schema, } } - } finally { - await this.disconnect() - } - const final = finaliseExternalTables(tables, entities) - this.tables = final.tables - this.schemaErrors = final.errors - } - - async create(query: SqlQuery | string) { - const results = await this.internalQuery(getSqlQuery(query)) - return results.length ? results : [{ created: true }] - } - - async read(query: SqlQuery | string) { - return this.internalQuery(getSqlQuery(query)) - } - - async update(query: SqlQuery | string) { - const results = await this.internalQuery(getSqlQuery(query)) - return results.length ? results : [{ updated: true }] - } - - async delete(query: SqlQuery | string) { - const results = await this.internalQuery(getSqlQuery(query)) - return results.length ? results : [{ deleted: true }] - } - - async query(json: QueryJson) { - await this.connect() - try { - const queryFn = (query: any) => - this.internalQuery(query, { connect: false, disableCoercion: true }) - return await this.queryWithReturning(json, queryFn) - } finally { - await this.disconnect() } + } finally { + await this.disconnect() } + const final = finaliseExternalTables(tables, entities) + this.tables = final.tables + this.schemaErrors = final.errors } - module.exports = { - schema: SCHEMA, - integration: MySQLIntegration, + async create(query: SqlQuery | string) { + const results = await this.internalQuery(getSqlQuery(query)) + return results.length ? results : [{ created: true }] + } + + async read(query: SqlQuery | string) { + return this.internalQuery(getSqlQuery(query)) + } + + async update(query: SqlQuery | string) { + const results = await this.internalQuery(getSqlQuery(query)) + return results.length ? results : [{ updated: true }] + } + + async delete(query: SqlQuery | string) { + const results = await this.internalQuery(getSqlQuery(query)) + return results.length ? results : [{ deleted: true }] + } + + async query(json: QueryJson) { + await this.connect() + try { + const queryFn = (query: any) => + this.internalQuery(query, { connect: false, disableCoercion: true }) + return await this.queryWithReturning(json, queryFn) + } finally { + await this.disconnect() + } } } + +export default { + schema: SCHEMA, + integration: MySQLIntegration, +} diff --git a/packages/server/src/integrations/oracle.ts b/packages/server/src/integrations/oracle.ts index fa8a3837b2..5f35935e12 100644 --- a/packages/server/src/integrations/oracle.ts +++ b/packages/server/src/integrations/oracle.ts @@ -25,437 +25,430 @@ import oracledb, { import Sql from "./base/sql" import { FieldTypes } from "../constants" -module OracleModule { - oracledb.outFormat = oracledb.OUT_FORMAT_OBJECT +oracledb.outFormat = oracledb.OUT_FORMAT_OBJECT - interface OracleConfig { - host: string - port: number - database: string - user: string - password: string - } +interface OracleConfig { + host: string + port: number + database: string + user: string + password: string +} - const SCHEMA: Integration = { - docs: "https://github.com/oracle/node-oracledb", - plus: true, - friendlyName: "Oracle", - type: "Relational", - description: - "Oracle Database is an object-relational database management system developed by Oracle Corporation", - datasource: { - host: { - type: DatasourceFieldType.STRING, - default: "localhost", - required: true, - }, - port: { - type: DatasourceFieldType.NUMBER, - required: true, - default: 1521, - }, - database: { - type: DatasourceFieldType.STRING, - required: true, - }, - user: { - type: DatasourceFieldType.STRING, - required: true, - }, - password: { - type: DatasourceFieldType.PASSWORD, - required: true, - }, +const SCHEMA: Integration = { + docs: "https://github.com/oracle/node-oracledb", + plus: true, + friendlyName: "Oracle", + type: "Relational", + description: + "Oracle Database is an object-relational database management system developed by Oracle Corporation", + datasource: { + host: { + type: DatasourceFieldType.STRING, + default: "localhost", + required: true, }, - query: { - create: { - type: QueryType.SQL, - }, - read: { - type: QueryType.SQL, - }, - update: { - type: QueryType.SQL, - }, - delete: { - type: QueryType.SQL, - }, + port: { + type: DatasourceFieldType.NUMBER, + required: true, + default: 1521, }, + database: { + type: DatasourceFieldType.STRING, + required: true, + }, + user: { + type: DatasourceFieldType.STRING, + required: true, + }, + password: { + type: DatasourceFieldType.PASSWORD, + required: true, + }, + }, + query: { + create: { + type: QueryType.SQL, + }, + read: { + type: QueryType.SQL, + }, + update: { + type: QueryType.SQL, + }, + delete: { + type: QueryType.SQL, + }, + }, +} + +const UNSUPPORTED_TYPES = ["BLOB", "CLOB", "NCLOB"] + +/** + * Raw query response + */ +interface ColumnsResponse { + TABLE_NAME: string + COLUMN_NAME: string + DATA_TYPE: string + DATA_DEFAULT: string | null + COLUMN_ID: number + CONSTRAINT_NAME: string | null + CONSTRAINT_TYPE: string | null + R_CONSTRAINT_NAME: string | null + SEARCH_CONDITION: string | null +} + +/** + * An oracle constraint + */ +interface OracleConstraint { + name: string + type: string + relatedConstraintName: string | null + searchCondition: string | null +} + +/** + * An oracle column and it's related constraints + */ +interface OracleColumn { + name: string + type: string + default: string | null + id: number + constraints: { [key: string]: OracleConstraint } +} + +/** + * An oracle table and it's related columns + */ +interface OracleTable { + name: string + columns: { [key: string]: OracleColumn } +} + +const OracleContraintTypes = { + PRIMARY: "P", + NOT_NULL_OR_CHECK: "C", + FOREIGN_KEY: "R", + UNIQUE: "U", +} + +class OracleIntegration extends Sql implements DatasourcePlus { + private readonly config: OracleConfig + private index: number = 1 + + public tables: Record = {} + public schemaErrors: Record = {} + + private readonly COLUMNS_SQL = ` + SELECT + tabs.table_name, + cols.column_name, + cols.data_type, + cols.data_default, + cols.column_id, + cons.constraint_name, + cons.constraint_type, + cons.r_constraint_name, + cons.search_condition + FROM + user_tables tabs + JOIN + user_tab_columns cols + ON tabs.table_name = cols.table_name + LEFT JOIN + user_cons_columns col_cons + ON cols.column_name = col_cons.column_name + AND cols.table_name = col_cons.table_name + LEFT JOIN + user_constraints cons + ON col_cons.constraint_name = cons.constraint_name + AND cons.table_name = cols.table_name + WHERE + (cons.status = 'ENABLED' + OR cons.status IS NULL) + ` + constructor(config: OracleConfig) { + super(SqlClient.ORACLE) + this.config = config } - const UNSUPPORTED_TYPES = ["BLOB", "CLOB", "NCLOB"] + getBindingIdentifier(): string { + return `:${this.index++}` + } - /** - * Raw query response - */ - interface ColumnsResponse { - TABLE_NAME: string - COLUMN_NAME: string - DATA_TYPE: string - DATA_DEFAULT: string | null - COLUMN_ID: number - CONSTRAINT_NAME: string | null - CONSTRAINT_TYPE: string | null - R_CONSTRAINT_NAME: string | null - SEARCH_CONDITION: string | null + getStringConcat(parts: string[]): string { + return parts.join(" || ") } /** - * An oracle constraint + * Map the flat tabular columns and constraints data into a nested object */ - interface OracleConstraint { - name: string - type: string - relatedConstraintName: string | null - searchCondition: string | null - } + private mapColumns(result: Result): { + [key: string]: OracleTable + } { + const oracleTables: { [key: string]: OracleTable } = {} - /** - * An oracle column and it's related constraints - */ - interface OracleColumn { - name: string - type: string - default: string | null - id: number - constraints: { [key: string]: OracleConstraint } - } + if (result.rows) { + result.rows.forEach(row => { + const tableName = row.TABLE_NAME + const columnName = row.COLUMN_NAME + const dataType = row.DATA_TYPE + const dataDefault = row.DATA_DEFAULT + const columnId = row.COLUMN_ID + const constraintName = row.CONSTRAINT_NAME + const constraintType = row.CONSTRAINT_TYPE + const relatedConstraintName = row.R_CONSTRAINT_NAME + const searchCondition = row.SEARCH_CONDITION - /** - * An oracle table and it's related columns - */ - interface OracleTable { - name: string - columns: { [key: string]: OracleColumn } - } - - const OracleContraintTypes = { - PRIMARY: "P", - NOT_NULL_OR_CHECK: "C", - FOREIGN_KEY: "R", - UNIQUE: "U", - } - - class OracleIntegration extends Sql implements DatasourcePlus { - private readonly config: OracleConfig - private index: number = 1 - - public tables: Record = {} - public schemaErrors: Record = {} - - private readonly COLUMNS_SQL = ` - SELECT - tabs.table_name, - cols.column_name, - cols.data_type, - cols.data_default, - cols.column_id, - cons.constraint_name, - cons.constraint_type, - cons.r_constraint_name, - cons.search_condition - FROM - user_tables tabs - JOIN - user_tab_columns cols - ON tabs.table_name = cols.table_name - LEFT JOIN - user_cons_columns col_cons - ON cols.column_name = col_cons.column_name - AND cols.table_name = col_cons.table_name - LEFT JOIN - user_constraints cons - ON col_cons.constraint_name = cons.constraint_name - AND cons.table_name = cols.table_name - WHERE - (cons.status = 'ENABLED' - OR cons.status IS NULL) - ` - constructor(config: OracleConfig) { - super(SqlClient.ORACLE) - this.config = config - } - - getBindingIdentifier(): string { - return `:${this.index++}` - } - - getStringConcat(parts: string[]): string { - return parts.join(" || ") - } - - /** - * Map the flat tabular columns and constraints data into a nested object - */ - private mapColumns(result: Result): { - [key: string]: OracleTable - } { - const oracleTables: { [key: string]: OracleTable } = {} - - if (result.rows) { - result.rows.forEach(row => { - const tableName = row.TABLE_NAME - const columnName = row.COLUMN_NAME - const dataType = row.DATA_TYPE - const dataDefault = row.DATA_DEFAULT - const columnId = row.COLUMN_ID - const constraintName = row.CONSTRAINT_NAME - const constraintType = row.CONSTRAINT_TYPE - const relatedConstraintName = row.R_CONSTRAINT_NAME - const searchCondition = row.SEARCH_CONDITION - - let table = oracleTables[tableName] - if (!table) { - table = { - name: tableName, - columns: {}, - } - oracleTables[tableName] = table - } - - let column = table.columns[columnName] - if (!column) { - column = { - name: columnName, - type: dataType, - default: dataDefault, - id: columnId, - constraints: {}, - } - table.columns[columnName] = column - } - - if (constraintName && constraintType) { - let constraint = column.constraints[constraintName] - if (!constraint) { - constraint = { - name: constraintName, - type: constraintType, - relatedConstraintName: relatedConstraintName, - searchCondition: searchCondition, - } - } - column.constraints[constraintName] = constraint - } - }) - } - - return oracleTables - } - - private static isSupportedColumn(column: OracleColumn) { - return !UNSUPPORTED_TYPES.includes(column.type) - } - - private static isAutoColumn(column: OracleColumn) { - return !!( - column.default && column.default.toLowerCase().includes("nextval") - ) - } - - /** - * No native boolean in oracle. Best we can do is to check if a manual 1 or 0 number constraint has been set up - * This matches the default behaviour for generating DDL used in knex. - */ - private isBooleanType(column: OracleColumn): boolean { - return ( - column.type.toLowerCase() === "number" && - Object.values(column.constraints).filter(c => { - if ( - c.type === OracleContraintTypes.NOT_NULL_OR_CHECK && - c.searchCondition - ) { - const condition = c.searchCondition - .replace(/\s/g, "") // remove spaces - .replace(/[']+/g, "") // remove quotes - if ( - condition.includes("in(0,1)") || - condition.includes("in(1,0)") - ) { - return true - } - } - return false - }).length > 0 - ) - } - - private internalConvertType(column: OracleColumn): { type: string } { - if (this.isBooleanType(column)) { - return { type: FieldTypes.BOOLEAN } - } - - return convertSqlType(column.type) - } - - /** - * Fetches the tables from the oracle table and assigns them to the datasource. - * @param {*} datasourceId - datasourceId to fetch - * @param entities - the tables that are to be built - */ - async buildSchema(datasourceId: string, entities: Record) { - const columnsResponse = await this.internalQuery({ - sql: this.COLUMNS_SQL, - }) - const oracleTables = this.mapColumns(columnsResponse) - - const tables: { [key: string]: Table } = {} - - // iterate each table - Object.values(oracleTables).forEach(oracleTable => { - let table = tables[oracleTable.name] + let table = oracleTables[tableName] if (!table) { table = { - _id: buildExternalTableId(datasourceId, oracleTable.name), - primary: [], - name: oracleTable.name, - schema: {}, + name: tableName, + columns: {}, } - tables[oracleTable.name] = table + oracleTables[tableName] = table } - // iterate each column on the table - Object.values(oracleTable.columns) - // remove columns that we can't read / save - .filter(oracleColumn => - OracleIntegration.isSupportedColumn(oracleColumn) - ) - // match the order of the columns in the db - .sort((c1, c2) => c1.id - c2.id) - .forEach(oracleColumn => { - const columnName = oracleColumn.name - let fieldSchema = table.schema[columnName] - if (!fieldSchema) { - fieldSchema = { - autocolumn: OracleIntegration.isAutoColumn(oracleColumn), - name: columnName, - ...this.internalConvertType(oracleColumn), - } - table.schema[columnName] = fieldSchema + let column = table.columns[columnName] + if (!column) { + column = { + name: columnName, + type: dataType, + default: dataDefault, + id: columnId, + constraints: {}, + } + table.columns[columnName] = column + } + + if (constraintName && constraintType) { + let constraint = column.constraints[constraintName] + if (!constraint) { + constraint = { + name: constraintName, + type: constraintType, + relatedConstraintName: relatedConstraintName, + searchCondition: searchCondition, } - - // iterate each constraint on the column - Object.values(oracleColumn.constraints).forEach( - oracleConstraint => { - if (oracleConstraint.type === OracleContraintTypes.PRIMARY) { - table.primary!.push(columnName) - } - } - ) - }) + } + column.constraints[constraintName] = constraint + } }) - - const final = finaliseExternalTables(tables, entities) - this.tables = final.tables - this.schemaErrors = final.errors } - private async internalQuery(query: SqlQuery): Promise> { - let connection - try { - this.index = 1 - connection = await this.getConnection() + return oracleTables + } - const options: ExecuteOptions = { autoCommit: true } - const bindings: BindParameters = query.bindings || [] + private static isSupportedColumn(column: OracleColumn) { + return !UNSUPPORTED_TYPES.includes(column.type) + } - return await connection.execute(query.sql, bindings, options) - } finally { - if (connection) { - try { - await connection.close() - } catch (err) { - console.error(err) + private static isAutoColumn(column: OracleColumn) { + return !!( + column.default && column.default.toLowerCase().includes("nextval") + ) + } + + /** + * No native boolean in oracle. Best we can do is to check if a manual 1 or 0 number constraint has been set up + * This matches the default behaviour for generating DDL used in knex. + */ + private isBooleanType(column: OracleColumn): boolean { + return ( + column.type.toLowerCase() === "number" && + Object.values(column.constraints).filter(c => { + if ( + c.type === OracleContraintTypes.NOT_NULL_OR_CHECK && + c.searchCondition + ) { + const condition = c.searchCondition + .replace(/\s/g, "") // remove spaces + .replace(/[']+/g, "") // remove quotes + if (condition.includes("in(0,1)") || condition.includes("in(1,0)")) { + return true } } - } + return false + }).length > 0 + ) + } + + private internalConvertType(column: OracleColumn): { type: string } { + if (this.isBooleanType(column)) { + return { type: FieldTypes.BOOLEAN } } - private getConnection = async (): Promise => { - //connectString : "(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))(CONNECT_DATA =(SID= ORCL)))" - const connectString = `${this.config.host}:${this.config.port || 1521}/${ - this.config.database - }` - const attributes: ConnectionAttributes = { - user: this.config.user, - password: this.config.password, - connectString, - } - return oracledb.getConnection(attributes) - } + return convertSqlType(column.type) + } - async create(query: SqlQuery | string): Promise { - const response = await this.internalQuery(getSqlQuery(query)) - return response.rows && response.rows.length - ? response.rows - : [{ created: true }] - } + /** + * Fetches the tables from the oracle table and assigns them to the datasource. + * @param {*} datasourceId - datasourceId to fetch + * @param entities - the tables that are to be built + */ + async buildSchema(datasourceId: string, entities: Record) { + const columnsResponse = await this.internalQuery({ + sql: this.COLUMNS_SQL, + }) + const oracleTables = this.mapColumns(columnsResponse) - async read(query: SqlQuery | string): Promise { - const response = await this.internalQuery(getSqlQuery(query)) - return response.rows ? response.rows : [] - } + const tables: { [key: string]: Table } = {} - async update(query: SqlQuery | string): Promise { - const response = await this.internalQuery(getSqlQuery(query)) - return response.rows && response.rows.length - ? response.rows - : [{ updated: true }] - } - - async delete(query: SqlQuery | string): Promise { - const response = await this.internalQuery(getSqlQuery(query)) - return response.rows && response.rows.length - ? response.rows - : [{ deleted: true }] - } - - async query(json: QueryJson) { - const operation = this._operation(json) - const input = this._query(json, { disableReturning: true }) - if (Array.isArray(input)) { - const responses = [] - for (let query of input) { - responses.push(await this.internalQuery(query)) - } - return responses - } else { - // read the row to be deleted up front for the return - let deletedRows - if (operation === Operation.DELETE) { - const queryFn = (query: any) => this.internalQuery(query) - deletedRows = await this.getReturningRow(queryFn, json) + // iterate each table + Object.values(oracleTables).forEach(oracleTable => { + let table = tables[oracleTable.name] + if (!table) { + table = { + _id: buildExternalTableId(datasourceId, oracleTable.name), + primary: [], + name: oracleTable.name, + schema: {}, } + tables[oracleTable.name] = table + } - // run the query - const response = await this.internalQuery(input) - - // get the results or return the created / updated / deleted row - if (deletedRows?.rows?.length) { - return deletedRows.rows - } else if (response.rows?.length) { - return response.rows - } else { - // get the last row that was updated - if ( - response.lastRowid && - json.endpoint?.entityId && - operation !== Operation.DELETE - ) { - const lastRow = await this.internalQuery({ - sql: `SELECT * FROM \"${json.endpoint.entityId}\" WHERE ROWID = '${response.lastRowid}'`, - }) - return lastRow.rows - } else { - return [{ [operation.toLowerCase()]: true }] + // iterate each column on the table + Object.values(oracleTable.columns) + // remove columns that we can't read / save + .filter(oracleColumn => + OracleIntegration.isSupportedColumn(oracleColumn) + ) + // match the order of the columns in the db + .sort((c1, c2) => c1.id - c2.id) + .forEach(oracleColumn => { + const columnName = oracleColumn.name + let fieldSchema = table.schema[columnName] + if (!fieldSchema) { + fieldSchema = { + autocolumn: OracleIntegration.isAutoColumn(oracleColumn), + name: columnName, + ...this.internalConvertType(oracleColumn), + } + table.schema[columnName] = fieldSchema } + + // iterate each constraint on the column + Object.values(oracleColumn.constraints).forEach(oracleConstraint => { + if (oracleConstraint.type === OracleContraintTypes.PRIMARY) { + table.primary!.push(columnName) + } + }) + }) + }) + + const final = finaliseExternalTables(tables, entities) + this.tables = final.tables + this.schemaErrors = final.errors + } + + private async internalQuery(query: SqlQuery): Promise> { + let connection + try { + this.index = 1 + connection = await this.getConnection() + + const options: ExecuteOptions = { autoCommit: true } + const bindings: BindParameters = query.bindings || [] + + return await connection.execute(query.sql, bindings, options) + } finally { + if (connection) { + try { + await connection.close() + } catch (err) { + console.error(err) } } } } - module.exports = { - schema: SCHEMA, - integration: OracleIntegration, + private getConnection = async (): Promise => { + //connectString : "(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))(CONNECT_DATA =(SID= ORCL)))" + const connectString = `${this.config.host}:${this.config.port || 1521}/${ + this.config.database + }` + const attributes: ConnectionAttributes = { + user: this.config.user, + password: this.config.password, + connectString, + } + return oracledb.getConnection(attributes) + } + + async create(query: SqlQuery | string): Promise { + const response = await this.internalQuery(getSqlQuery(query)) + return response.rows && response.rows.length + ? response.rows + : [{ created: true }] + } + + async read(query: SqlQuery | string): Promise { + const response = await this.internalQuery(getSqlQuery(query)) + return response.rows ? response.rows : [] + } + + async update(query: SqlQuery | string): Promise { + const response = await this.internalQuery(getSqlQuery(query)) + return response.rows && response.rows.length + ? response.rows + : [{ updated: true }] + } + + async delete(query: SqlQuery | string): Promise { + const response = await this.internalQuery(getSqlQuery(query)) + return response.rows && response.rows.length + ? response.rows + : [{ deleted: true }] + } + + async query(json: QueryJson) { + const operation = this._operation(json) + const input = this._query(json, { disableReturning: true }) + if (Array.isArray(input)) { + const responses = [] + for (let query of input) { + responses.push(await this.internalQuery(query)) + } + return responses + } else { + // read the row to be deleted up front for the return + let deletedRows + if (operation === Operation.DELETE) { + const queryFn = (query: any) => this.internalQuery(query) + deletedRows = await this.getReturningRow(queryFn, json) + } + + // run the query + const response = await this.internalQuery(input) + + // get the results or return the created / updated / deleted row + if (deletedRows?.rows?.length) { + return deletedRows.rows + } else if (response.rows?.length) { + return response.rows + } else { + // get the last row that was updated + if ( + response.lastRowid && + json.endpoint?.entityId && + operation !== Operation.DELETE + ) { + const lastRow = await this.internalQuery({ + sql: `SELECT * FROM \"${json.endpoint.entityId}\" WHERE ROWID = '${response.lastRowid}'`, + }) + return lastRow.rows + } else { + return [{ [operation.toLowerCase()]: true }] + } + } + } } } + +export default { + schema: SCHEMA, + integration: OracleIntegration, +} diff --git a/packages/server/src/integrations/postgres.ts b/packages/server/src/integrations/postgres.ts index 316311e193..da1124f421 100644 --- a/packages/server/src/integrations/postgres.ts +++ b/packages/server/src/integrations/postgres.ts @@ -16,317 +16,313 @@ import { } from "./utils" import Sql from "./base/sql" -module PostgresModule { - const { Client, types } = require("pg") - const { escapeDangerousCharacters } = require("../utilities") +const { Client, types } = require("pg") +const { escapeDangerousCharacters } = require("../utilities") - // Return "date" and "timestamp" types as plain strings. - // This lets us reference the original stored timezone. - // types is undefined when running in a test env for some reason. - if (types) { - types.setTypeParser(1114, (val: any) => val) // timestamp - types.setTypeParser(1082, (val: any) => val) // date - types.setTypeParser(1184, (val: any) => val) // timestampz - } +// Return "date" and "timestamp" types as plain strings. +// This lets us reference the original stored timezone. +// types is undefined when running in a test env for some reason. +if (types) { + types.setTypeParser(1114, (val: any) => val) // timestamp + types.setTypeParser(1082, (val: any) => val) // date + types.setTypeParser(1184, (val: any) => val) // timestampz +} - const JSON_REGEX = /'{.*}'::json/s +const JSON_REGEX = /'{.*}'::json/s - interface PostgresConfig { - host: string - port: number - database: string - user: string - password: string - schema: string - ssl?: boolean - ca?: string - rejectUnauthorized?: boolean - } +interface PostgresConfig { + host: string + port: number + database: string + user: string + password: string + schema: string + ssl?: boolean + ca?: string + rejectUnauthorized?: boolean +} - const SCHEMA: Integration = { - docs: "https://node-postgres.com", - plus: true, - friendlyName: "PostgreSQL", - type: "Relational", - description: - "PostgreSQL, also known as Postgres, is a free and open-source relational database management system emphasizing extensibility and SQL compliance.", - datasource: { - host: { - type: DatasourceFieldType.STRING, - default: "localhost", - required: true, - }, - port: { - type: DatasourceFieldType.NUMBER, - required: true, - default: 5432, - }, - database: { - type: DatasourceFieldType.STRING, - default: "postgres", - required: true, - }, - user: { - type: DatasourceFieldType.STRING, - default: "root", - required: true, - }, - password: { - type: DatasourceFieldType.PASSWORD, - default: "root", - required: true, - }, - schema: { - type: DatasourceFieldType.STRING, - default: "public", - required: true, - }, - ssl: { - type: DatasourceFieldType.BOOLEAN, - default: false, - required: false, - }, - rejectUnauthorized: { - type: DatasourceFieldType.BOOLEAN, - default: false, - required: false, - }, - ca: { - type: DatasourceFieldType.LONGFORM, - default: false, - required: false, - }, +const SCHEMA: Integration = { + docs: "https://node-postgres.com", + plus: true, + friendlyName: "PostgreSQL", + type: "Relational", + description: + "PostgreSQL, also known as Postgres, is a free and open-source relational database management system emphasizing extensibility and SQL compliance.", + datasource: { + host: { + type: DatasourceFieldType.STRING, + default: "localhost", + required: true, }, - query: { - create: { - type: QueryType.SQL, - }, - read: { - type: QueryType.SQL, - }, - update: { - type: QueryType.SQL, - }, - delete: { - type: QueryType.SQL, - }, + port: { + type: DatasourceFieldType.NUMBER, + required: true, + default: 5432, }, - } + database: { + type: DatasourceFieldType.STRING, + default: "postgres", + required: true, + }, + user: { + type: DatasourceFieldType.STRING, + default: "root", + required: true, + }, + password: { + type: DatasourceFieldType.PASSWORD, + default: "root", + required: true, + }, + schema: { + type: DatasourceFieldType.STRING, + default: "public", + required: true, + }, + ssl: { + type: DatasourceFieldType.BOOLEAN, + default: false, + required: false, + }, + rejectUnauthorized: { + type: DatasourceFieldType.BOOLEAN, + default: false, + required: false, + }, + ca: { + type: DatasourceFieldType.LONGFORM, + default: false, + required: false, + }, + }, + query: { + create: { + type: QueryType.SQL, + }, + read: { + type: QueryType.SQL, + }, + update: { + type: QueryType.SQL, + }, + delete: { + type: QueryType.SQL, + }, + }, +} - class PostgresIntegration extends Sql implements DatasourcePlus { - private readonly client: any - private readonly config: PostgresConfig - private index: number = 1 - private open: boolean - public tables: Record = {} - public schemaErrors: Record = {} +class PostgresIntegration extends Sql implements DatasourcePlus { + private readonly client: any + private readonly config: PostgresConfig + private index: number = 1 + private open: boolean + public tables: Record = {} + public schemaErrors: Record = {} - COLUMNS_SQL!: string + COLUMNS_SQL!: string - PRIMARY_KEYS_SQL = ` - select tc.table_schema, tc.table_name, kc.column_name as primary_key - from information_schema.table_constraints tc - join - information_schema.key_column_usage kc on kc.table_name = tc.table_name - and kc.table_schema = tc.table_schema - and kc.constraint_name = tc.constraint_name - where tc.constraint_type = 'PRIMARY KEY'; - ` + PRIMARY_KEYS_SQL = ` + select tc.table_schema, tc.table_name, kc.column_name as primary_key + from information_schema.table_constraints tc + join + information_schema.key_column_usage kc on kc.table_name = tc.table_name + and kc.table_schema = tc.table_schema + and kc.constraint_name = tc.constraint_name + where tc.constraint_type = 'PRIMARY KEY'; + ` - constructor(config: PostgresConfig) { - super(SqlClient.POSTGRES) - this.config = config + constructor(config: PostgresConfig) { + super(SqlClient.POSTGRES) + this.config = config - let newConfig = { - ...this.config, - ssl: this.config.ssl - ? { - rejectUnauthorized: this.config.rejectUnauthorized, - ca: this.config.ca, - } - : undefined, - } - this.client = new Client(newConfig) - this.open = false - } - - getBindingIdentifier(): string { - return `$${this.index++}` - } - - getStringConcat(parts: string[]): string { - return parts.join(" || ") - } - - async openConnection() { - await this.client.connect() - if (!this.config.schema) { - this.config.schema = "public" - } - this.client.query(`SET search_path TO ${this.config.schema}`) - this.COLUMNS_SQL = `select * from information_schema.columns where table_schema = '${this.config.schema}'` - this.open = true - } - - closeConnection() { - const pg = this - return new Promise((resolve, reject) => { - this.client.end((err: any) => { - pg.open = false - if (err) { - reject(err) - } else { - resolve() + let newConfig = { + ...this.config, + ssl: this.config.ssl + ? { + rejectUnauthorized: this.config.rejectUnauthorized, + ca: this.config.ca, } - }) + : undefined, + } + this.client = new Client(newConfig) + this.open = false + } + + getBindingIdentifier(): string { + return `$${this.index++}` + } + + getStringConcat(parts: string[]): string { + return parts.join(" || ") + } + + async openConnection() { + await this.client.connect() + if (!this.config.schema) { + this.config.schema = "public" + } + this.client.query(`SET search_path TO ${this.config.schema}`) + this.COLUMNS_SQL = `select * from information_schema.columns where table_schema = '${this.config.schema}'` + this.open = true + } + + closeConnection() { + const pg = this + return new Promise((resolve, reject) => { + this.client.end((err: any) => { + pg.open = false + if (err) { + reject(err) + } else { + resolve() + } }) - } + }) + } - async internalQuery(query: SqlQuery, close: boolean = true) { - if (!this.open) { - await this.openConnection() - } - const client = this.client - this.index = 1 - // need to handle a specific issue with json data types in postgres, - // new lines inside the JSON data will break it - if (query && query.sql) { - const matches = query.sql.match(JSON_REGEX) - if (matches && matches.length > 0) { - for (let match of matches) { - const escaped = escapeDangerousCharacters(match) - query.sql = query.sql.replace(match, escaped) - } - } - } - try { - return await client.query(query.sql, query.bindings || []) - } catch (err) { - await this.closeConnection() - // @ts-ignore - throw new Error(err) - } finally { - if (close) { - await this.closeConnection() - } - } - } - - /** - * Fetches the tables from the postgres table and assigns them to the datasource. - * @param {*} datasourceId - datasourceId to fetch - * @param entities - the tables that are to be built - */ - async buildSchema(datasourceId: string, entities: Record) { - let tableKeys: { [key: string]: string[] } = {} + async internalQuery(query: SqlQuery, close: boolean = true) { + if (!this.open) { await this.openConnection() - try { - const primaryKeysResponse = await this.client.query( - this.PRIMARY_KEYS_SQL - ) - for (let table of primaryKeysResponse.rows) { - const tableName = table.table_name - if (!tableKeys[tableName]) { - tableKeys[tableName] = [] - } - const key = table.column_name || table.primary_key - // only add the unique keys - if (key && tableKeys[tableName].indexOf(key) === -1) { - tableKeys[tableName].push(key) - } + } + const client = this.client + this.index = 1 + // need to handle a specific issue with json data types in postgres, + // new lines inside the JSON data will break it + if (query && query.sql) { + const matches = query.sql.match(JSON_REGEX) + if (matches && matches.length > 0) { + for (let match of matches) { + const escaped = escapeDangerousCharacters(match) + query.sql = query.sql.replace(match, escaped) } - } catch (err) { - tableKeys = {} - } - - try { - const columnsResponse = await this.client.query(this.COLUMNS_SQL) - - const tables: { [key: string]: Table } = {} - - for (let column of columnsResponse.rows) { - const tableName: string = column.table_name - const columnName: string = column.column_name - - // table key doesn't exist yet - if (!tables[tableName] || !tables[tableName].schema) { - tables[tableName] = { - _id: buildExternalTableId(datasourceId, tableName), - primary: tableKeys[tableName] || [], - name: tableName, - schema: {}, - } - } - - const identity = !!( - column.identity_generation || - column.identity_start || - column.identity_increment - ) - const hasDefault = - typeof column.column_default === "string" && - column.column_default.startsWith("nextval") - const isGenerated = - column.is_generated && column.is_generated !== "NEVER" - const isAuto: boolean = hasDefault || identity || isGenerated - tables[tableName].schema[columnName] = { - autocolumn: isAuto, - name: columnName, - ...convertSqlType(column.data_type), - externalType: column.data_type, - } - } - - const final = finaliseExternalTables(tables, entities) - this.tables = final.tables - this.schemaErrors = final.errors - } catch (err) { - // @ts-ignore - throw new Error(err) - } finally { - await this.closeConnection() } } - - async create(query: SqlQuery | string) { - const response = await this.internalQuery(getSqlQuery(query)) - return response.rows.length ? response.rows : [{ created: true }] - } - - async read(query: SqlQuery | string) { - const response = await this.internalQuery(getSqlQuery(query)) - return response.rows - } - - async update(query: SqlQuery | string) { - const response = await this.internalQuery(getSqlQuery(query)) - return response.rows.length ? response.rows : [{ updated: true }] - } - - async delete(query: SqlQuery | string) { - const response = await this.internalQuery(getSqlQuery(query)) - return response.rows.length ? response.rows : [{ deleted: true }] - } - - async query(json: QueryJson) { - const operation = this._operation(json).toLowerCase() - const input = this._query(json) - if (Array.isArray(input)) { - const responses = [] - for (let query of input) { - responses.push(await this.internalQuery(query, false)) - } + try { + return await client.query(query.sql, query.bindings || []) + } catch (err) { + await this.closeConnection() + // @ts-ignore + throw new Error(err) + } finally { + if (close) { await this.closeConnection() - return responses - } else { - const response = await this.internalQuery(input) - return response.rows.length ? response.rows : [{ [operation]: true }] } } } - module.exports = { - schema: SCHEMA, - integration: PostgresIntegration, + /** + * Fetches the tables from the postgres table and assigns them to the datasource. + * @param {*} datasourceId - datasourceId to fetch + * @param entities - the tables that are to be built + */ + async buildSchema(datasourceId: string, entities: Record) { + let tableKeys: { [key: string]: string[] } = {} + await this.openConnection() + try { + const primaryKeysResponse = await this.client.query(this.PRIMARY_KEYS_SQL) + for (let table of primaryKeysResponse.rows) { + const tableName = table.table_name + if (!tableKeys[tableName]) { + tableKeys[tableName] = [] + } + const key = table.column_name || table.primary_key + // only add the unique keys + if (key && tableKeys[tableName].indexOf(key) === -1) { + tableKeys[tableName].push(key) + } + } + } catch (err) { + tableKeys = {} + } + + try { + const columnsResponse = await this.client.query(this.COLUMNS_SQL) + + const tables: { [key: string]: Table } = {} + + for (let column of columnsResponse.rows) { + const tableName: string = column.table_name + const columnName: string = column.column_name + + // table key doesn't exist yet + if (!tables[tableName] || !tables[tableName].schema) { + tables[tableName] = { + _id: buildExternalTableId(datasourceId, tableName), + primary: tableKeys[tableName] || [], + name: tableName, + schema: {}, + } + } + + const identity = !!( + column.identity_generation || + column.identity_start || + column.identity_increment + ) + const hasDefault = + typeof column.column_default === "string" && + column.column_default.startsWith("nextval") + const isGenerated = + column.is_generated && column.is_generated !== "NEVER" + const isAuto: boolean = hasDefault || identity || isGenerated + tables[tableName].schema[columnName] = { + autocolumn: isAuto, + name: columnName, + ...convertSqlType(column.data_type), + externalType: column.data_type, + } + } + + const final = finaliseExternalTables(tables, entities) + this.tables = final.tables + this.schemaErrors = final.errors + } catch (err) { + // @ts-ignore + throw new Error(err) + } finally { + await this.closeConnection() + } + } + + async create(query: SqlQuery | string) { + const response = await this.internalQuery(getSqlQuery(query)) + return response.rows.length ? response.rows : [{ created: true }] + } + + async read(query: SqlQuery | string) { + const response = await this.internalQuery(getSqlQuery(query)) + return response.rows + } + + async update(query: SqlQuery | string) { + const response = await this.internalQuery(getSqlQuery(query)) + return response.rows.length ? response.rows : [{ updated: true }] + } + + async delete(query: SqlQuery | string) { + const response = await this.internalQuery(getSqlQuery(query)) + return response.rows.length ? response.rows : [{ deleted: true }] + } + + async query(json: QueryJson) { + const operation = this._operation(json).toLowerCase() + const input = this._query(json) + if (Array.isArray(input)) { + const responses = [] + for (let query of input) { + responses.push(await this.internalQuery(query, false)) + } + await this.closeConnection() + return responses + } else { + const response = await this.internalQuery(input) + return response.rows.length ? response.rows : [{ [operation]: true }] + } } } + +export default { + schema: SCHEMA, + integration: PostgresIntegration, +} diff --git a/packages/server/src/integrations/redis.ts b/packages/server/src/integrations/redis.ts index e8aa13560c..ebf7d2a82a 100644 --- a/packages/server/src/integrations/redis.ts +++ b/packages/server/src/integrations/redis.ts @@ -1,149 +1,147 @@ import { DatasourceFieldType, Integration, QueryType } from "@budibase/types" import Redis from "ioredis" -module RedisModule { - interface RedisConfig { - host: string - port: number - username: string - password?: string - } +interface RedisConfig { + host: string + port: number + username: string + password?: string +} - const SCHEMA: Integration = { - docs: "https://redis.io/docs/", - description: "", - friendlyName: "Redis", - type: "Non-relational", - datasource: { - host: { - type: "string", - required: true, - default: "localhost", - }, - port: { - type: "number", - required: true, - default: 6379, - }, - username: { - type: "string", - required: false, - }, - password: { - type: "password", - required: false, +const SCHEMA: Integration = { + docs: "https://redis.io/docs/", + description: "", + friendlyName: "Redis", + type: "Non-relational", + datasource: { + host: { + type: "string", + required: true, + default: "localhost", + }, + port: { + type: "number", + required: true, + default: 6379, + }, + username: { + type: "string", + required: false, + }, + password: { + type: "password", + required: false, + }, + }, + query: { + create: { + type: QueryType.FIELDS, + fields: { + key: { + type: DatasourceFieldType.STRING, + required: true, + }, + value: { + type: DatasourceFieldType.STRING, + required: true, + }, + ttl: { + type: DatasourceFieldType.NUMBER, + }, }, }, - query: { - create: { - type: QueryType.FIELDS, - fields: { - key: { - type: DatasourceFieldType.STRING, - required: true, - }, - value: { - type: DatasourceFieldType.STRING, - required: true, - }, - ttl: { - type: DatasourceFieldType.NUMBER, - }, + read: { + readable: true, + type: QueryType.FIELDS, + fields: { + key: { + type: DatasourceFieldType.STRING, + required: true, }, }, - read: { - readable: true, - type: QueryType.FIELDS, - fields: { - key: { - type: DatasourceFieldType.STRING, - required: true, - }, - }, - }, - delete: { - type: QueryType.FIELDS, - fields: { - key: { - type: DatasourceFieldType.STRING, - required: true, - }, - }, - }, - command: { - readable: true, - displayName: "Redis Command", - type: QueryType.JSON, - }, }, + delete: { + type: QueryType.FIELDS, + fields: { + key: { + type: DatasourceFieldType.STRING, + required: true, + }, + }, + }, + command: { + readable: true, + displayName: "Redis Command", + type: QueryType.JSON, + }, + }, +} + +class RedisIntegration { + private readonly config: RedisConfig + private client: any + + constructor(config: RedisConfig) { + this.config = config + this.client = new Redis({ + host: this.config.host, + port: this.config.port, + username: this.config.username, + password: this.config.password, + }) } - class RedisIntegration { - private readonly config: RedisConfig - private client: any + async disconnect() { + this.client.disconnect() + } - constructor(config: RedisConfig) { - this.config = config - this.client = new Redis({ - host: this.config.host, - port: this.config.port, - username: this.config.username, - password: this.config.password, - }) + async redisContext(query: Function) { + try { + return await query() + } catch (err) { + throw new Error(`Redis error: ${err}`) + } finally { + this.disconnect() } + } - async disconnect() { - this.client.disconnect() - } - - async redisContext(query: Function) { - try { - return await query() - } catch (err) { - throw new Error(`Redis error: ${err}`) - } finally { - this.disconnect() + async create(query: { key: string; value: string; ttl: number }) { + return this.redisContext(async () => { + const response = await this.client.set(query.key, query.value) + if (query.ttl) { + await this.client.expire(query.key, query.ttl) } - } - - async create(query: { key: string; value: string; ttl: number }) { - return this.redisContext(async () => { - const response = await this.client.set(query.key, query.value) - if (query.ttl) { - await this.client.expire(query.key, query.ttl) - } - return response - }) - } - - async read(query: { key: string }) { - return this.redisContext(async () => { - const response = await this.client.get(query.key) - return response - }) - } - - async delete(query: { key: string }) { - return this.redisContext(async () => { - const response = await this.client.del(query.key) - return response - }) - } - - async command(query: { json: string }) { - return this.redisContext(async () => { - const commands = query.json.trim().split(" ") - const pipeline = this.client.pipeline([commands]) - const result = await pipeline.exec() - return { - response: result[0][1], - } - }) - } + return response + }) } - module.exports = { - schema: SCHEMA, - integration: RedisIntegration, + async read(query: { key: string }) { + return this.redisContext(async () => { + const response = await this.client.get(query.key) + return response + }) + } + + async delete(query: { key: string }) { + return this.redisContext(async () => { + const response = await this.client.del(query.key) + return response + }) + } + + async command(query: { json: string }) { + return this.redisContext(async () => { + const commands = query.json.trim().split(" ") + const pipeline = this.client.pipeline([commands]) + const result = await pipeline.exec() + return { + response: result[0][1], + } + }) } } + +export default { + schema: SCHEMA, + integration: RedisIntegration, +} diff --git a/packages/server/src/integrations/rest.ts b/packages/server/src/integrations/rest.ts index 284d2a921a..5126e0100e 100644 --- a/packages/server/src/integrations/rest.ts +++ b/packages/server/src/integrations/rest.ts @@ -14,6 +14,11 @@ import { BearerAuthConfig, } from "../definitions/datasource" import { get } from "lodash" +const fetch = require("node-fetch") +const { formatBytes } = require("../utilities") +const { performance } = require("perf_hooks") +const FormData = require("form-data") +const { URLSearchParams } = require("url") const BodyTypes = { NONE: "none", @@ -50,363 +55,353 @@ const coreFields = { }, } -module RestModule { - const fetch = require("node-fetch") - const { formatBytes } = require("../utilities") - const { performance } = require("perf_hooks") - const FormData = require("form-data") - const { URLSearchParams } = require("url") - const { - parseStringPromise: xmlParser, - Builder: XmlBuilder, - } = require("xml2js") +const { parseStringPromise: xmlParser, Builder: XmlBuilder } = require("xml2js") - const SCHEMA: Integration = { - docs: "https://github.com/node-fetch/node-fetch", - description: - "With the REST API datasource, you can connect, query and pull data from multiple REST APIs. You can then use the retrieved data to build apps.", - friendlyName: "REST API", - type: "API", - datasource: { - url: { - type: DatasourceFieldType.STRING, - default: "", - required: false, - deprecated: true, - }, - defaultHeaders: { - type: DatasourceFieldType.OBJECT, - required: false, - default: {}, - }, +const SCHEMA: Integration = { + docs: "https://github.com/node-fetch/node-fetch", + description: + "With the REST API datasource, you can connect, query and pull data from multiple REST APIs. You can then use the retrieved data to build apps.", + friendlyName: "REST API", + type: "API", + datasource: { + url: { + type: DatasourceFieldType.STRING, + default: "", + required: false, + deprecated: true, }, - query: { - create: { - readable: true, - displayName: "POST", - type: QueryType.FIELDS, - fields: coreFields, - }, - read: { - displayName: "GET", - readable: true, - type: QueryType.FIELDS, - fields: coreFields, - }, - update: { - displayName: "PUT", - readable: true, - type: QueryType.FIELDS, - fields: coreFields, - }, - patch: { - displayName: "PATCH", - readable: true, - type: QueryType.FIELDS, - fields: coreFields, - }, - delete: { - displayName: "DELETE", - type: QueryType.FIELDS, - fields: coreFields, - }, + defaultHeaders: { + type: DatasourceFieldType.OBJECT, + required: false, + default: {}, }, + }, + query: { + create: { + readable: true, + displayName: "POST", + type: QueryType.FIELDS, + fields: coreFields, + }, + read: { + displayName: "GET", + readable: true, + type: QueryType.FIELDS, + fields: coreFields, + }, + update: { + displayName: "PUT", + readable: true, + type: QueryType.FIELDS, + fields: coreFields, + }, + patch: { + displayName: "PATCH", + readable: true, + type: QueryType.FIELDS, + fields: coreFields, + }, + delete: { + displayName: "DELETE", + type: QueryType.FIELDS, + fields: coreFields, + }, + }, +} + +class RestIntegration implements IntegrationBase { + private config: RestConfig + private headers: { + [key: string]: string + } = {} + private startTimeMs: number = performance.now() + + constructor(config: RestConfig) { + this.config = config } - class RestIntegration implements IntegrationBase { - private config: RestConfig - private headers: { - [key: string]: string - } = {} - private startTimeMs: number = performance.now() - - constructor(config: RestConfig) { - this.config = config + async parseResponse(response: any, pagination: PaginationConfig | null) { + let data, raw, headers + const contentType = response.headers.get("content-type") || "" + try { + if (contentType.includes("application/json")) { + data = await response.json() + raw = JSON.stringify(data) + } else if ( + contentType.includes("text/xml") || + contentType.includes("application/xml") + ) { + const rawXml = await response.text() + data = + (await xmlParser(rawXml, { + explicitArray: false, + trim: true, + explicitRoot: false, + })) || {} + // there is only one structure, its an array, return the array so it appears as rows + const keys = Object.keys(data) + if (keys.length === 1 && Array.isArray(data[keys[0]])) { + data = data[keys[0]] + } + raw = rawXml + } else { + data = await response.text() + raw = data + } + } catch (err) { + throw "Failed to parse response body." + } + const size = formatBytes( + response.headers.get("content-length") || Buffer.byteLength(raw, "utf8") + ) + const time = `${Math.round(performance.now() - this.startTimeMs)}ms` + headers = response.headers.raw() + for (let [key, value] of Object.entries(headers)) { + headers[key] = Array.isArray(value) ? value[0] : value } - async parseResponse(response: any, pagination: PaginationConfig | null) { - let data, raw, headers - const contentType = response.headers.get("content-type") || "" - try { - if (contentType.includes("application/json")) { - data = await response.json() - raw = JSON.stringify(data) - } else if ( - contentType.includes("text/xml") || - contentType.includes("application/xml") - ) { - const rawXml = await response.text() - data = - (await xmlParser(rawXml, { - explicitArray: false, - trim: true, - explicitRoot: false, - })) || {} - // there is only one structure, its an array, return the array so it appears as rows - const keys = Object.keys(data) - if (keys.length === 1 && Array.isArray(data[keys[0]])) { - data = data[keys[0]] - } - raw = rawXml - } else { - data = await response.text() - raw = data - } - } catch (err) { - throw "Failed to parse response body." - } - const size = formatBytes( - response.headers.get("content-length") || Buffer.byteLength(raw, "utf8") - ) - const time = `${Math.round(performance.now() - this.startTimeMs)}ms` - headers = response.headers.raw() - for (let [key, value] of Object.entries(headers)) { - headers[key] = Array.isArray(value) ? value[0] : value + // Check if a pagination cursor exists in the response + let nextCursor = null + if (pagination?.responseParam) { + nextCursor = get(data, pagination.responseParam) + } + + return { + data, + info: { + code: response.status, + size, + time, + }, + extra: { + raw, + headers, + }, + pagination: { + cursor: nextCursor, + }, + } + } + + getUrl( + path: string, + queryString: string, + pagination: PaginationConfig | null, + paginationValues: PaginationValues | null + ): string { + // Add pagination params to query string if required + if (pagination?.location === "query" && paginationValues) { + const { pageParam, sizeParam } = pagination + const params = new URLSearchParams() + + // Append page number or cursor param if configured + if (pageParam && paginationValues.page != null) { + params.append(pageParam, paginationValues.page) } - // Check if a pagination cursor exists in the response - let nextCursor = null - if (pagination?.responseParam) { - nextCursor = get(data, pagination.responseParam) + // Append page size param if configured + if (sizeParam && paginationValues.limit != null) { + params.append(sizeParam, paginationValues.limit) } - return { - data, - info: { - code: response.status, - size, - time, - }, - extra: { - raw, - headers, - }, - pagination: { - cursor: nextCursor, - }, + // Prepend query string with pagination params + let paginationString = params.toString() + if (paginationString) { + queryString = `${paginationString}&${queryString}` } } - getUrl( - path: string, - queryString: string, - pagination: PaginationConfig | null, - paginationValues: PaginationValues | null - ): string { - // Add pagination params to query string if required - if (pagination?.location === "query" && paginationValues) { - const { pageParam, sizeParam } = pagination - const params = new URLSearchParams() - - // Append page number or cursor param if configured - if (pageParam && paginationValues.page != null) { - params.append(pageParam, paginationValues.page) - } - - // Append page size param if configured - if (sizeParam && paginationValues.limit != null) { - params.append(sizeParam, paginationValues.limit) - } - - // Prepend query string with pagination params - let paginationString = params.toString() - if (paginationString) { - queryString = `${paginationString}&${queryString}` - } - } - - const main = `${path}?${queryString}` - let complete = main - if (this.config.url && !main.startsWith("http")) { - complete = !this.config.url ? main : `${this.config.url}/${main}` - } - if (!complete.startsWith("http")) { - complete = `http://${complete}` - } - return complete + const main = `${path}?${queryString}` + let complete = main + if (this.config.url && !main.startsWith("http")) { + complete = !this.config.url ? main : `${this.config.url}/${main}` } + if (!complete.startsWith("http")) { + complete = `http://${complete}` + } + return complete + } - addBody( - bodyType: string, - body: string | any, - input: any, - pagination: PaginationConfig | null, - paginationValues: PaginationValues | null - ) { - if (!input.headers) { - input.headers = {} - } - if (bodyType === BodyTypes.NONE) { - return input - } - let error, - object: any = {}, - string = "" - try { - if (body) { - string = typeof body !== "string" ? JSON.stringify(body) : body - object = typeof body === "object" ? body : JSON.parse(body) - } - } catch (err) { - error = err - } - - // Util to add pagination values to a certain body type - const addPaginationToBody = (insertFn: Function) => { - if (pagination?.location === "body") { - if (pagination?.pageParam && paginationValues?.page != null) { - insertFn(pagination.pageParam, paginationValues.page) - } - if (pagination?.sizeParam && paginationValues?.limit != null) { - insertFn(pagination.sizeParam, paginationValues.limit) - } - } - } - - switch (bodyType) { - case BodyTypes.TEXT: - // content type defaults to plaintext - input.body = string - break - case BodyTypes.ENCODED: - const params = new URLSearchParams() - for (let [key, value] of Object.entries(object)) { - params.append(key, value) - } - addPaginationToBody((key: string, value: any) => { - params.append(key, value) - }) - input.body = params - break - case BodyTypes.FORM_DATA: - const form = new FormData() - for (let [key, value] of Object.entries(object)) { - form.append(key, value) - } - addPaginationToBody((key: string, value: any) => { - form.append(key, value) - }) - input.body = form - break - case BodyTypes.XML: - if (object != null && Object.keys(object).length) { - string = new XmlBuilder().buildObject(object) - } - input.body = string - input.headers["Content-Type"] = "application/xml" - break - case BodyTypes.JSON: - // if JSON error, throw it - if (error) { - throw "Invalid JSON for request body" - } - addPaginationToBody((key: string, value: any) => { - object[key] = value - }) - input.body = JSON.stringify(object) - input.headers["Content-Type"] = "application/json" - break - } + addBody( + bodyType: string, + body: string | any, + input: any, + pagination: PaginationConfig | null, + paginationValues: PaginationValues | null + ) { + if (!input.headers) { + input.headers = {} + } + if (bodyType === BodyTypes.NONE) { return input } + let error, + object: any = {}, + string = "" + try { + if (body) { + string = typeof body !== "string" ? JSON.stringify(body) : body + object = typeof body === "object" ? body : JSON.parse(body) + } + } catch (err) { + error = err + } - getAuthHeaders(authConfigId: string): { [key: string]: any } { - let headers: any = {} - - if (this.config.authConfigs && authConfigId) { - const authConfig = this.config.authConfigs.filter( - c => c._id === authConfigId - )[0] - // check the config still exists before proceeding - // if not - do nothing - if (authConfig) { - let config - switch (authConfig.type) { - case AuthType.BASIC: - config = authConfig.config as BasicAuthConfig - headers.Authorization = `Basic ${Buffer.from( - `${config.username}:${config.password}` - ).toString("base64")}` - break - case AuthType.BEARER: - config = authConfig.config as BearerAuthConfig - headers.Authorization = `Bearer ${config.token}` - break - } + // Util to add pagination values to a certain body type + const addPaginationToBody = (insertFn: Function) => { + if (pagination?.location === "body") { + if (pagination?.pageParam && paginationValues?.page != null) { + insertFn(pagination.pageParam, paginationValues.page) + } + if (pagination?.sizeParam && paginationValues?.limit != null) { + insertFn(pagination.sizeParam, paginationValues.limit) } } - - return headers } - async _req(query: RestQuery) { - const { - path = "", - queryString = "", - headers = {}, - method = "GET", - disabledHeaders, - bodyType, - requestBody, - authConfigId, - pagination, - paginationValues, - } = query - const authHeaders = this.getAuthHeaders(authConfigId) - - this.headers = { - ...this.config.defaultHeaders, - ...headers, - ...authHeaders, - } - - if (disabledHeaders) { - for (let headerKey of Object.keys(this.headers)) { - if (disabledHeaders[headerKey]) { - delete this.headers[headerKey] - } + switch (bodyType) { + case BodyTypes.TEXT: + // content type defaults to plaintext + input.body = string + break + case BodyTypes.ENCODED: + const params = new URLSearchParams() + for (let [key, value] of Object.entries(object)) { + params.append(key, value) } - } - - let input: any = { method, headers: this.headers } - input = this.addBody( - bodyType, - requestBody, - input, - pagination, - paginationValues - ) - - this.startTimeMs = performance.now() - const url = this.getUrl(path, queryString, pagination, paginationValues) - const response = await fetch(url, input) - return await this.parseResponse(response, pagination) - } - - async create(opts: RestQuery) { - return this._req({ ...opts, method: "POST" }) - } - - async read(opts: RestQuery) { - return this._req({ ...opts, method: "GET" }) - } - - async update(opts: RestQuery) { - return this._req({ ...opts, method: "PUT" }) - } - - async patch(opts: RestQuery) { - return this._req({ ...opts, method: "PATCH" }) - } - - async delete(opts: RestQuery) { - return this._req({ ...opts, method: "DELETE" }) + addPaginationToBody((key: string, value: any) => { + params.append(key, value) + }) + input.body = params + break + case BodyTypes.FORM_DATA: + const form = new FormData() + for (let [key, value] of Object.entries(object)) { + form.append(key, value) + } + addPaginationToBody((key: string, value: any) => { + form.append(key, value) + }) + input.body = form + break + case BodyTypes.XML: + if (object != null && Object.keys(object).length) { + string = new XmlBuilder().buildObject(object) + } + input.body = string + input.headers["Content-Type"] = "application/xml" + break + case BodyTypes.JSON: + // if JSON error, throw it + if (error) { + throw "Invalid JSON for request body" + } + addPaginationToBody((key: string, value: any) => { + object[key] = value + }) + input.body = JSON.stringify(object) + input.headers["Content-Type"] = "application/json" + break } + return input } - module.exports = { - schema: SCHEMA, - integration: RestIntegration, - AuthType, + getAuthHeaders(authConfigId: string): { [key: string]: any } { + let headers: any = {} + + if (this.config.authConfigs && authConfigId) { + const authConfig = this.config.authConfigs.filter( + c => c._id === authConfigId + )[0] + // check the config still exists before proceeding + // if not - do nothing + if (authConfig) { + let config + switch (authConfig.type) { + case AuthType.BASIC: + config = authConfig.config as BasicAuthConfig + headers.Authorization = `Basic ${Buffer.from( + `${config.username}:${config.password}` + ).toString("base64")}` + break + case AuthType.BEARER: + config = authConfig.config as BearerAuthConfig + headers.Authorization = `Bearer ${config.token}` + break + } + } + } + + return headers + } + + async _req(query: RestQuery) { + const { + path = "", + queryString = "", + headers = {}, + method = "GET", + disabledHeaders, + bodyType, + requestBody, + authConfigId, + pagination, + paginationValues, + } = query + const authHeaders = this.getAuthHeaders(authConfigId) + + this.headers = { + ...this.config.defaultHeaders, + ...headers, + ...authHeaders, + } + + if (disabledHeaders) { + for (let headerKey of Object.keys(this.headers)) { + if (disabledHeaders[headerKey]) { + delete this.headers[headerKey] + } + } + } + + let input: any = { method, headers: this.headers } + input = this.addBody( + bodyType, + requestBody, + input, + pagination, + paginationValues + ) + + this.startTimeMs = performance.now() + const url = this.getUrl(path, queryString, pagination, paginationValues) + const response = await fetch(url, input) + return await this.parseResponse(response, pagination) + } + + async create(opts: RestQuery) { + return this._req({ ...opts, method: "POST" }) + } + + async read(opts: RestQuery) { + return this._req({ ...opts, method: "GET" }) + } + + async update(opts: RestQuery) { + return this._req({ ...opts, method: "PUT" }) + } + + async patch(opts: RestQuery) { + return this._req({ ...opts, method: "PATCH" }) + } + + async delete(opts: RestQuery) { + return this._req({ ...opts, method: "DELETE" }) } } + +export default { + schema: SCHEMA, + integration: RestIntegration, + AuthType, +} diff --git a/packages/server/src/integrations/s3.ts b/packages/server/src/integrations/s3.ts index e8da696424..f92124082e 100644 --- a/packages/server/src/integrations/s3.ts +++ b/packages/server/src/integrations/s3.ts @@ -1,86 +1,83 @@ import { Integration, QueryType, IntegrationBase } from "@budibase/types" +const AWS = require("aws-sdk") -module S3Module { - const AWS = require("aws-sdk") +interface S3Config { + region: string + accessKeyId: string + secretAccessKey: string + s3ForcePathStyle: boolean + endpoint?: string +} - interface S3Config { - region: string - accessKeyId: string - secretAccessKey: string - s3ForcePathStyle: boolean - endpoint?: string - } - - const SCHEMA: Integration = { - docs: "https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html", - description: - "Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance.", - friendlyName: "Amazon S3", - type: "Object store", - datasource: { - region: { - type: "string", - required: false, - default: "us-east-1", - }, - accessKeyId: { - type: "password", - required: true, - }, - secretAccessKey: { - type: "password", - required: true, - }, - endpoint: { - type: "string", - required: false, - }, - signatureVersion: { - type: "string", - required: false, - default: "v4", - }, +const SCHEMA: Integration = { + docs: "https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html", + description: + "Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance.", + friendlyName: "Amazon S3", + type: "Object store", + datasource: { + region: { + type: "string", + required: false, + default: "us-east-1", }, - query: { - read: { - type: QueryType.FIELDS, - fields: { - bucket: { - type: "string", - required: true, - }, + accessKeyId: { + type: "password", + required: true, + }, + secretAccessKey: { + type: "password", + required: true, + }, + endpoint: { + type: "string", + required: false, + }, + signatureVersion: { + type: "string", + required: false, + default: "v4", + }, + }, + query: { + read: { + type: QueryType.FIELDS, + fields: { + bucket: { + type: "string", + required: true, }, }, }, - } + }, +} - class S3Integration implements IntegrationBase { - private readonly config: S3Config - private client: any +class S3Integration implements IntegrationBase { + private readonly config: S3Config + private client: any - constructor(config: S3Config) { - this.config = config - if (this.config.endpoint) { - this.config.s3ForcePathStyle = true - } else { - delete this.config.endpoint - } - - this.client = new AWS.S3(this.config) + constructor(config: S3Config) { + this.config = config + if (this.config.endpoint) { + this.config.s3ForcePathStyle = true + } else { + delete this.config.endpoint } - async read(query: { bucket: string }) { - const response = await this.client - .listObjects({ - Bucket: query.bucket, - }) - .promise() - return response.Contents - } + this.client = new AWS.S3(this.config) } - module.exports = { - schema: SCHEMA, - integration: S3Integration, + async read(query: { bucket: string }) { + const response = await this.client + .listObjects({ + Bucket: query.bucket, + }) + .promise() + return response.Contents } } + +export default { + schema: SCHEMA, + integration: S3Integration, +} diff --git a/packages/server/src/integrations/snowflake.ts b/packages/server/src/integrations/snowflake.ts index 7155d27b66..db702520f9 100644 --- a/packages/server/src/integrations/snowflake.ts +++ b/packages/server/src/integrations/snowflake.ts @@ -1,99 +1,97 @@ import { Integration, QueryType, SqlQuery } from "@budibase/types" import { Snowflake } from "snowflake-promise" -module SnowflakeModule { - interface SnowflakeConfig { - account: string - username: string - password: string - warehouse: string - database: string - schema: string - } +interface SnowflakeConfig { + account: string + username: string + password: string + warehouse: string + database: string + schema: string +} - const SCHEMA: Integration = { - docs: "https://developers.snowflake.com/", - description: - "Snowflake is a solution for data warehousing, data lakes, data engineering, data science, data application development, and securely sharing and consuming shared data.", - friendlyName: "Snowflake", - type: "Relational", - datasource: { - account: { - type: "string", - required: true, - }, - username: { - type: "string", - required: true, - }, - password: { - type: "password", - required: true, - }, - warehouse: { - type: "string", - required: true, - }, - database: { - type: "string", - required: true, - }, - schema: { - type: "string", - required: true, - }, +const SCHEMA: Integration = { + docs: "https://developers.snowflake.com/", + description: + "Snowflake is a solution for data warehousing, data lakes, data engineering, data science, data application development, and securely sharing and consuming shared data.", + friendlyName: "Snowflake", + type: "Relational", + datasource: { + account: { + type: "string", + required: true, }, - query: { - create: { - type: QueryType.SQL, - }, - read: { - type: QueryType.SQL, - }, - update: { - type: QueryType.SQL, - }, - delete: { - type: QueryType.SQL, - }, + username: { + type: "string", + required: true, }, + password: { + type: "password", + required: true, + }, + warehouse: { + type: "string", + required: true, + }, + database: { + type: "string", + required: true, + }, + schema: { + type: "string", + required: true, + }, + }, + query: { + create: { + type: QueryType.SQL, + }, + read: { + type: QueryType.SQL, + }, + update: { + type: QueryType.SQL, + }, + delete: { + type: QueryType.SQL, + }, + }, +} + +class SnowflakeIntegration { + private client: Snowflake + + constructor(config: SnowflakeConfig) { + this.client = new Snowflake(config) } - class SnowflakeIntegration { - private client: Snowflake - - constructor(config: SnowflakeConfig) { - this.client = new Snowflake(config) - } - - async internalQuery(query: SqlQuery) { - await this.client.connect() - try { - return await this.client.execute(query.sql) - } catch (err: any) { - throw err?.message.split(":")[1] || err?.message - } - } - - async create(query: SqlQuery) { - return this.internalQuery(query) - } - - async read(query: SqlQuery) { - return this.internalQuery(query) - } - - async update(query: SqlQuery) { - return this.internalQuery(query) - } - - async delete(query: SqlQuery) { - return this.internalQuery(query) + async internalQuery(query: SqlQuery) { + await this.client.connect() + try { + return await this.client.execute(query.sql) + } catch (err: any) { + throw err?.message.split(":")[1] || err?.message } } - module.exports = { - schema: SCHEMA, - integration: SnowflakeIntegration, + async create(query: SqlQuery) { + return this.internalQuery(query) + } + + async read(query: SqlQuery) { + return this.internalQuery(query) + } + + async update(query: SqlQuery) { + return this.internalQuery(query) + } + + async delete(query: SqlQuery) { + return this.internalQuery(query) } } + +export default { + schema: SCHEMA, + integration: SnowflakeIntegration, +} diff --git a/packages/types/src/documents/index.ts b/packages/types/src/documents/index.ts index 4f5b278a4b..1afee41599 100644 --- a/packages/types/src/documents/index.ts +++ b/packages/types/src/documents/index.ts @@ -1,5 +1,6 @@ export * from "./account" export * from "./app" export * from "./global" +export * from "./plugin" export * from "./platform" export * from "./document" diff --git a/packages/types/src/documents/plugin/index.ts b/packages/types/src/documents/plugin/index.ts new file mode 100644 index 0000000000..03a239a6c9 --- /dev/null +++ b/packages/types/src/documents/plugin/index.ts @@ -0,0 +1,4 @@ +export enum PluginType { + DATASOURCE = "datasource", + COMPONENT = "component", +} From 244850cc0bbee77c59965820b9dd1984daedb758 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 15 Aug 2022 11:23:27 +0100 Subject: [PATCH 034/260] Rename custom components to plugins in the new component panel --- .../[componentId]/new/_components/NewComponentPanel.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte index b0cd544977..c18df34556 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte @@ -56,7 +56,7 @@ // Add custom components category if (customComponents?.length) { enrichedStructure.push({ - name: "Custom components", + name: "Plugins", isCategory: true, children: customComponents.map(x => ({ ...definitions[x], From 51e06a9c7a314b5cca5dad9538a308cf17ed66c2 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 15 Aug 2022 18:38:09 +0100 Subject: [PATCH 035/260] Adding custom datasources to UI. --- .../DatasourceNavigator/icons/Custom.svelte | 39 +++++++++++++++++++ .../DatasourceNavigator/icons/index.js | 2 + .../modals/CreateDatasourceModal.svelte | 10 ++++- .../server/src/api/controllers/datasource.js | 8 ++-- .../server/src/integrations/base/query.ts | 4 +- packages/server/src/integrations/index.ts | 20 ++++++++-- packages/server/src/threads/query.ts | 4 +- 7 files changed, 75 insertions(+), 12 deletions(-) create mode 100644 packages/builder/src/components/backend/DatasourceNavigator/icons/Custom.svelte diff --git a/packages/builder/src/components/backend/DatasourceNavigator/icons/Custom.svelte b/packages/builder/src/components/backend/DatasourceNavigator/icons/Custom.svelte new file mode 100644 index 0000000000..354b7a3358 --- /dev/null +++ b/packages/builder/src/components/backend/DatasourceNavigator/icons/Custom.svelte @@ -0,0 +1,39 @@ + + + + + + + + + + diff --git a/packages/builder/src/components/backend/DatasourceNavigator/icons/index.js b/packages/builder/src/components/backend/DatasourceNavigator/icons/index.js index 404895f05a..267ed32b6e 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/icons/index.js +++ b/packages/builder/src/components/backend/DatasourceNavigator/icons/index.js @@ -15,6 +15,7 @@ import GoogleSheets from "./GoogleSheets.svelte" import Firebase from "./Firebase.svelte" import Redis from "./Redis.svelte" import Snowflake from "./Snowflake.svelte" +import Custom from "./Custom.svelte" export default { BUDIBASE: Budibase, @@ -34,4 +35,5 @@ export default { FIRESTORE: Firebase, REDIS: Redis, SNOWFLAKE: Snowflake, + CUSTOM: Custom, } diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte index 8d34c292f3..2d5e6976bf 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte @@ -92,6 +92,14 @@ } integrations = newIntegrations } + + function getIcon(integrationType, schema) { + if (schema.custom) { + return ICONS.CUSTOM + } else { + return ICONS[integrationType] + } + } @@ -158,7 +166,7 @@ >
diff --git a/packages/server/src/api/controllers/datasource.js b/packages/server/src/api/controllers/datasource.js index 8b9b765a5f..36d345912e 100644 --- a/packages/server/src/api/controllers/datasource.js +++ b/packages/server/src/api/controllers/datasource.js @@ -7,7 +7,7 @@ const { getTableParams, } = require("../../db/utils") const { BuildSchemaErrors, InvalidColumns } = require("../../constants") -const { integrations } = require("../../integrations") +const { getIntegration } = require("../../integrations") const { getDatasourceAndQuery } = require("./row/utils") const { invalidateDynamicVariables } = require("../../threads/utils") const { getAppDB } = require("@budibase/backend-core/context") @@ -114,7 +114,7 @@ exports.update = async function (ctx) { // Drain connection pools when configuration is changed if (datasource.source) { - const source = integrations[datasource.source] + const source = await getIntegration(datasource.source) if (source && source.pool) { await source.pool.end() } @@ -149,7 +149,7 @@ exports.save = async function (ctx) { // Drain connection pools when configuration is changed if (datasource.source) { - const source = integrations[datasource.source] + const source = await getIntegration(datasource.source) if (source && source.pool) { await source.pool.end() } @@ -218,7 +218,7 @@ function updateError(error, newError, tables) { } const buildSchemaHelper = async datasource => { - const Connector = integrations[datasource.source] + const Connector = await getIntegration(datasource.source) // Connect to the DB and build the schema const connector = new Connector(datasource.config) diff --git a/packages/server/src/integrations/base/query.ts b/packages/server/src/integrations/base/query.ts index 1f3ed3dd74..7435b28141 100644 --- a/packages/server/src/integrations/base/query.ts +++ b/packages/server/src/integrations/base/query.ts @@ -1,11 +1,11 @@ import { QueryJson, Datasource } from "@budibase/types" -const { integrations } = require("../index") +const { getIntegration } = require("../index") export async function makeExternalQuery( datasource: Datasource, json: QueryJson ) { - const Integration = integrations[datasource.source] + const Integration = await getIntegration(datasource.source) // query is the opinionated function if (Integration.prototype.query) { const integration = new Integration(datasource.config) diff --git a/packages/server/src/integrations/index.ts b/packages/server/src/integrations/index.ts index bde7235ac8..bf267e46cc 100644 --- a/packages/server/src/integrations/index.ts +++ b/packages/server/src/integrations/index.ts @@ -67,8 +67,22 @@ if (environment.SELF_HOSTED) { module.exports = { getDefinitions: async () => { - const custom = await getPlugins(PluginType.DATASOURCE) - return cloneDeep(DEFINITIONS) + const plugins = await getPlugins(PluginType.DATASOURCE) + // extract the actual schema from each custom + const pluginSchemas: { [key: string]: Integration } = {} + for (let plugin of plugins) { + const sourceId = plugin.name + pluginSchemas[sourceId] = { + ...plugin.schema["schema"], + custom: true, + } + } + return { + ...cloneDeep(DEFINITIONS), + ...pluginSchemas, + } + }, + getIntegration: async () => { + return INTEGRATIONS }, - integrations: INTEGRATIONS, } diff --git a/packages/server/src/threads/query.ts b/packages/server/src/threads/query.ts index 6b93a00200..86cbf89c87 100644 --- a/packages/server/src/threads/query.ts +++ b/packages/server/src/threads/query.ts @@ -2,7 +2,7 @@ import { default as threadUtils } from "./utils" threadUtils.threadSetup() import { WorkerCallback, QueryEvent, QueryVariable } from "./definitions" const ScriptRunner = require("../utilities/scriptRunner") -const { integrations } = require("../integrations") +const { getIntegration } = require("../integrations") const { processStringSync } = require("@budibase/string-templates") const { doInAppContext, getAppDB } = require("@budibase/backend-core/context") const { @@ -62,7 +62,7 @@ class QueryRunner { let datasourceClone = cloneDeep(datasource) let fieldsClone = cloneDeep(fields) - const Integration = integrations[datasourceClone.source] + const Integration = await getIntegration(datasourceClone.source) if (!Integration) { throw "Integration type does not exist." } From 6093da79d6f555c0003b77a511002baade1aa252 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 15 Aug 2022 22:23:45 +0100 Subject: [PATCH 036/260] Add hot reloading for component plugins via watched plugin directory --- .../templates/app-service-deployment.yaml | 8 +- hosting/.env | 5 +- hosting/hosting.properties | 5 +- packages/server/package.json | 1 + packages/server/scripts/dev/manage.js | 1 + packages/server/src/api/controllers/plugin.ts | 93 +-- packages/server/src/app.ts | 28 + packages/server/src/environment.js | 1 + packages/server/yarn.lock | 645 +++++++++++++++++- packages/types/src/documents/plugin/index.ts | 5 + 10 files changed, 734 insertions(+), 58 deletions(-) diff --git a/charts/budibase/templates/app-service-deployment.yaml b/charts/budibase/templates/app-service-deployment.yaml index fd46e77647..332637d971 100644 --- a/charts/budibase/templates/app-service-deployment.yaml +++ b/charts/budibase/templates/app-service-deployment.yaml @@ -124,11 +124,15 @@ spec: value: {{ .Values.globals.tenantFeatureFlags | quote }} {{ if .Values.globals.bbAdminUserEmail }} - name: BB_ADMIN_USER_EMAIL - value: { { .Values.globals.bbAdminUserEmail | quote } } + value: {{ .Values.globals.bbAdminUserEmail | quote }} {{ end }} {{ if .Values.globals.bbAdminUserPassword }} - name: BB_ADMIN_USER_PASSWORD - value: { { .Values.globals.bbAdminUserPassword | quote } } + value: {{ .Values.globals.bbAdminUserPassword | quote }} + {{ end }} + {{ if .Values.globals.pluginsDir }} + - name: PLUGINS_DIR + value: { { .Values.globals.pluginsDir | quote }} {{ end }} image: budibase/apps:{{ .Values.globals.appVersion }} diff --git a/hosting/.env b/hosting/.env index 11dd661bf1..c5638a266f 100644 --- a/hosting/.env +++ b/hosting/.env @@ -22,4 +22,7 @@ BUDIBASE_ENVIRONMENT=PRODUCTION # An admin user can be automatically created initially if these are set BB_ADMIN_USER_EMAIL= -BB_ADMIN_USER_PASSWORD= \ No newline at end of file +BB_ADMIN_USER_PASSWORD= + +# A path that is watched for plugin bundles. Any bundles found are imported automatically/ +PLUGINS_DIR= \ No newline at end of file diff --git a/hosting/hosting.properties b/hosting/hosting.properties index 11dd661bf1..c5638a266f 100644 --- a/hosting/hosting.properties +++ b/hosting/hosting.properties @@ -22,4 +22,7 @@ BUDIBASE_ENVIRONMENT=PRODUCTION # An admin user can be automatically created initially if these are set BB_ADMIN_USER_EMAIL= -BB_ADMIN_USER_PASSWORD= \ No newline at end of file +BB_ADMIN_USER_PASSWORD= + +# A path that is watched for plugin bundles. Any bundles found are imported automatically/ +PLUGINS_DIR= \ No newline at end of file diff --git a/packages/server/package.json b/packages/server/package.json index 2bea771ad7..0a24f767e0 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -95,6 +95,7 @@ "bcryptjs": "2.4.3", "bull": "3.29.3", "chmodr": "1.2.0", + "chokidar": "^3.5.3", "csvtojson": "2.0.10", "curlconverter": "3.21.0", "dotenv": "8.2.0", diff --git a/packages/server/scripts/dev/manage.js b/packages/server/scripts/dev/manage.js index fc9fde0a02..8a5f8e9477 100644 --- a/packages/server/scripts/dev/manage.js +++ b/packages/server/scripts/dev/manage.js @@ -58,6 +58,7 @@ async function init() { DEPLOYMENT_ENVIRONMENT: "development", BB_ADMIN_USER_EMAIL: "", BB_ADMIN_USER_PASSWORD: "", + PLUGINS_DIR: "", } let envFile = "" Object.keys(envFileJson).forEach(key => { diff --git a/packages/server/src/api/controllers/plugin.ts b/packages/server/src/api/controllers/plugin.ts index 48104f24b9..93e569e0c8 100644 --- a/packages/server/src/api/controllers/plugin.ts +++ b/packages/server/src/api/controllers/plugin.ts @@ -3,7 +3,7 @@ import { extractPluginTarball } from "../../utilities/fileSystem" import { getGlobalDB } from "@budibase/backend-core/tenancy" import { generatePluginID, getPluginParams } from "../../db/utils" import { uploadDirectory } from "@budibase/backend-core/objectStore" -import { PluginType } from "@budibase/types" +import { PluginType, FileType } from "@budibase/types" export async function getPlugins(type?: PluginType) { const db = getGlobalDB() @@ -21,56 +21,16 @@ export async function getPlugins(type?: PluginType) { } export async function upload(ctx: any) { - const plugins = + const plugins: FileType[] = ctx.request.files.file.length > 1 ? Array.from(ctx.request.files.file) : [ctx.request.files.file] - const db = getGlobalDB() try { let docs = [] // can do single or multiple plugins for (let plugin of plugins) { - const { metadata, directory } = await extractPluginTarball(plugin) - const version = metadata.package.version, - name = metadata.package.name, - description = metadata.package.description - - // first open the tarball into tmp directory - const bucketPath = `${name}/${version}/` - const files = await uploadDirectory( - ObjectStoreBuckets.PLUGINS, - directory, - bucketPath - ) - const jsFile = files.find((file: any) => file.name.endsWith(".js")) - if (!jsFile) { - throw new Error(`Plugin missing .js file.`) - } - const jsFileName = jsFile.name - const pluginId = generatePluginID(name, version) - - // overwrite existing docs entirely if they exist - let rev - try { - const existing = await db.get(pluginId) - rev = existing._rev - } catch (err) { - rev = undefined - } - const doc = { - _id: pluginId, - _rev: rev, - name, - version, - description, - ...metadata, - jsUrl: `${bucketPath}${jsFileName}`, - } - const response = await db.put(doc) - docs.push({ - ...doc, - _rev: response.rev, - }) + const doc = await processPlugin(plugin) + docs.push(doc) } ctx.body = { message: "Plugin(s) uploaded successfully", @@ -87,3 +47,48 @@ export async function fetch(ctx: any) { } export async function destroy(ctx: any) {} + +export async function processPlugin(plugin: FileType) { + const db = getGlobalDB() + const { metadata, directory } = await extractPluginTarball(plugin) + const version = metadata.package.version, + name = metadata.package.name, + description = metadata.package.description + + // first open the tarball into tmp directory + const bucketPath = `${name}/${version}/` + const files = await uploadDirectory( + ObjectStoreBuckets.PLUGINS, + directory, + bucketPath + ) + const jsFile = files.find((file: any) => file.name.endsWith(".js")) + if (!jsFile) { + throw new Error(`Plugin missing .js file.`) + } + const jsFileName = jsFile.name + const pluginId = generatePluginID(name, version) + + // overwrite existing docs entirely if they exist + let rev + try { + const existing = await db.get(pluginId) + rev = existing._rev + } catch (err) { + rev = undefined + } + const doc = { + _id: pluginId, + _rev: rev, + name, + version, + description, + ...metadata, + jsUrl: `${bucketPath}${jsFileName}`, + } + const response = await db.put(doc) + return { + ...doc, + _rev: response.rev, + } +} diff --git a/packages/server/src/app.ts b/packages/server/src/app.ts index 62301d57ca..2f8adc879d 100644 --- a/packages/server/src/app.ts +++ b/packages/server/src/app.ts @@ -17,10 +17,15 @@ const bullboard = require("./automations/bullboard") const { logAlert } = require("@budibase/backend-core/logging") const { pinoSettings } = require("@budibase/backend-core") const { Thread } = require("./threads") +const chokidar = require("chokidar") +const fs = require("fs") +const path = require("path") import redis from "./utilities/redis" import * as migrations from "./migrations" import { events, installation, tenancy } from "@budibase/backend-core" import { createAdminUser, getChecklist } from "./utilities/workerRequests" +import { processPlugin } from "./api/controllers/plugin" +import { getGlobalDB } from "@budibase/backend-core/tenancy" const app = new Koa() @@ -132,6 +137,29 @@ module.exports = server.listen(env.PORT || 0, async () => { } } + // monitor plugin directory if required + if (env.SELF_HOSTED && env.PLUGINS_DIR && fs.existsSync(env.PLUGINS_DIR)) { + const watchPath = path.join(env.PLUGINS_DIR, "./**/dist/*.tar.gz") + chokidar + .watch(watchPath, { + ignored: "**/node_modules", + awaitWriteFinish: true, + }) + .on("all", async (event: string, path: string) => { + const tenantId = tenancy.getTenantId() + await tenancy.doInTenant(tenantId, async () => { + try { + const split = path.split("/") + const name = split[split.length - 1] + console.log("Importing plugin:", path) + await processPlugin({ name, path }) + } catch (err) { + console.log("Failed to import plugin:", err) + } + }) + }) + } + // check for version updates await installation.checkInstallVersion() diff --git a/packages/server/src/environment.js b/packages/server/src/environment.js index c2e2815e00..5a7aa61b9d 100644 --- a/packages/server/src/environment.js +++ b/packages/server/src/environment.js @@ -77,6 +77,7 @@ module.exports = { SQL_MAX_ROWS: process.env.SQL_MAX_ROWS, BB_ADMIN_USER_EMAIL: process.env.BB_ADMIN_USER_EMAIL, BB_ADMIN_USER_PASSWORD: process.env.BB_ADMIN_USER_PASSWORD, + PLUGINS_DIR: process.env.PLUGINS_DIR, // flags ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS, DISABLE_THREADING: process.env.DISABLE_THREADING, diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index a8dea20e95..ac01381814 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1128,6 +1128,93 @@ uuid "8.3.2" zlib "1.0.5" +"@budibase/backend-core@1.2.39-alpha.1": + version "1.2.39-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.39-alpha.1.tgz#7e5293670cf39f05e31eaaabbc3d7abc7f9837ca" + integrity sha512-mfHGyLc2FZ63cF8f4VX8GdJe7ciLCX4kZ+NK1yzBG0rRzHSTWJb2CVRq0rXNsZbwAVt9llHH58ysSHd+ggw9hg== + dependencies: + "@budibase/types" "1.2.39-alpha.1" + "@techpass/passport-openidconnect" "0.3.2" + aws-sdk "2.1030.0" + bcrypt "5.0.1" + dotenv "16.0.1" + emitter-listener "1.1.2" + ioredis "4.28.0" + joi "17.6.0" + jsonwebtoken "8.5.1" + koa-passport "4.1.4" + lodash "4.17.21" + lodash.isarguments "3.1.0" + node-fetch "2.6.7" + passport-google-auth "1.0.2" + passport-google-oauth "2.0.0" + passport-jwt "4.0.0" + passport-local "1.0.0" + passport-oauth2-refresh "^2.1.0" + posthog-node "1.3.0" + pouchdb "7.3.0" + pouchdb-find "7.2.2" + pouchdb-replication-stream "1.2.9" + redlock "4.2.0" + sanitize-s3-objectkey "0.0.1" + semver "7.3.7" + tar-fs "2.1.1" + uuid "8.3.2" + zlib "1.0.5" + +"@budibase/bbui@1.2.39-alpha.1": + version "1.2.39-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/bbui/-/bbui-1.2.39-alpha.1.tgz#6c4698e86540ae547b4569b077da1a3d7637809a" + integrity sha512-wZbe/G/jUxQwhpkqdnJyMQObRTT9eY0vowHkLrplAAVfG84tPYsWDMKqLmauJOXv8Fl3G24I2Jj1kzWFKjYieA== + dependencies: + "@adobe/spectrum-css-workflow-icons" "^1.2.1" + "@budibase/string-templates" "1.2.39-alpha.1" + "@spectrum-css/actionbutton" "^1.0.1" + "@spectrum-css/actiongroup" "^1.0.1" + "@spectrum-css/avatar" "^3.0.2" + "@spectrum-css/button" "^3.0.1" + "@spectrum-css/buttongroup" "^3.0.2" + "@spectrum-css/checkbox" "^3.0.2" + "@spectrum-css/dialog" "^3.0.1" + "@spectrum-css/divider" "^1.0.3" + "@spectrum-css/dropzone" "^3.0.2" + "@spectrum-css/fieldgroup" "^3.0.2" + "@spectrum-css/fieldlabel" "^3.0.1" + "@spectrum-css/icon" "^3.0.1" + "@spectrum-css/illustratedmessage" "^3.0.2" + "@spectrum-css/inlinealert" "^2.0.1" + "@spectrum-css/inputgroup" "^3.0.2" + "@spectrum-css/label" "^2.0.10" + "@spectrum-css/link" "^3.1.1" + "@spectrum-css/menu" "^3.0.1" + "@spectrum-css/modal" "^3.0.1" + "@spectrum-css/pagination" "^3.0.3" + "@spectrum-css/picker" "^1.0.1" + "@spectrum-css/popover" "^3.0.1" + "@spectrum-css/progressbar" "^1.0.2" + "@spectrum-css/progresscircle" "^1.0.2" + "@spectrum-css/radio" "^3.0.2" + "@spectrum-css/search" "^3.0.2" + "@spectrum-css/sidenav" "^3.0.2" + "@spectrum-css/slider" "3.0.1" + "@spectrum-css/statuslight" "^3.0.2" + "@spectrum-css/stepper" "^3.0.3" + "@spectrum-css/switch" "^1.0.2" + "@spectrum-css/table" "^3.0.1" + "@spectrum-css/tabs" "^3.2.12" + "@spectrum-css/tags" "^3.0.2" + "@spectrum-css/textfield" "^3.0.1" + "@spectrum-css/toast" "^3.0.1" + "@spectrum-css/tooltip" "^3.0.3" + "@spectrum-css/treeview" "^3.0.2" + "@spectrum-css/typography" "^3.0.1" + "@spectrum-css/underlay" "^2.0.9" + "@spectrum-css/vars" "^3.0.1" + dayjs "^1.10.4" + easymde "^2.16.1" + svelte-flatpickr "^3.2.3" + svelte-portal "^1.0.0" + "@budibase/bbui@^0.9.139": version "0.9.190" resolved "https://registry.yarnpkg.com/@budibase/bbui/-/bbui-0.9.190.tgz#e1ec400ac90f556bfbc80fc23a04506f1585ea81" @@ -1178,6 +1265,70 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" +"@budibase/client@1.2.39-alpha.1": + version "1.2.39-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/client/-/client-1.2.39-alpha.1.tgz#a9a727d0843d7e610d224d2b1b0a15d336c0199c" + integrity sha512-qAzbpIgAoLll56xq6pVmOMI05KdcO/Dp/4aAzYKxKteRq+fcBeNIb9WPlP3NKYhYFE/HJegkiwqTt+B3UKA/gQ== + dependencies: + "@budibase/bbui" "1.2.39-alpha.1" + "@budibase/frontend-core" "1.2.39-alpha.1" + "@budibase/string-templates" "1.2.39-alpha.1" + "@spectrum-css/button" "^3.0.3" + "@spectrum-css/card" "^3.0.3" + "@spectrum-css/divider" "^1.0.3" + "@spectrum-css/link" "^3.1.3" + "@spectrum-css/page" "^3.0.1" + "@spectrum-css/tag" "^3.1.4" + "@spectrum-css/typography" "^3.0.2" + "@spectrum-css/vars" "^3.0.1" + apexcharts "^3.22.1" + dayjs "^1.10.5" + downloadjs "1.4.7" + leaflet "^1.7.1" + regexparam "^1.3.0" + rollup-plugin-polyfill-node "^0.8.0" + sanitize-html "^2.7.0" + screenfull "^6.0.1" + shortid "^2.2.15" + svelte "^3.49.0" + svelte-apexcharts "^1.0.2" + svelte-flatpickr "^3.1.0" + svelte-spa-router "^3.0.5" + +"@budibase/frontend-core@1.2.39-alpha.1": + version "1.2.39-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/frontend-core/-/frontend-core-1.2.39-alpha.1.tgz#8ba142af58fdb5226254001f0360d048a31cc60f" + integrity sha512-WsQCrVGKeWhFTAxjmakkVEcCzxAaRwxoBIze97psupq0a4EUKLOqblFzrlL9Y+1SvVHyUQQz0bqjXfDzAlv7TQ== + dependencies: + "@budibase/bbui" "1.2.39-alpha.1" + lodash "^4.17.21" + svelte "^3.46.2" + +"@budibase/handlebars-helpers@^0.11.8": + version "0.11.8" + resolved "https://registry.yarnpkg.com/@budibase/handlebars-helpers/-/handlebars-helpers-0.11.8.tgz#6953d29673a8c5c407e096c0a84890465c7ce841" + integrity sha512-ggWJUt0GqsHFAEup5tlWlcrmYML57nKhpNGGLzVsqXVYN8eVmf3xluYmmMe7fDYhQH0leSprrdEXmsdFQF3HAQ== + dependencies: + array-sort "^1.0.0" + define-property "^2.0.2" + extend-shallow "^3.0.2" + for-in "^1.0.2" + get-object "^0.2.0" + get-value "^3.0.1" + handlebars "^4.7.7" + handlebars-utils "^1.0.6" + has-value "^2.0.2" + helper-md "^0.2.2" + html-tag "^2.0.0" + is-even "^1.0.0" + is-glob "^4.0.1" + kind-of "^6.0.3" + micromatch "^3.1.5" + relative "^3.0.2" + striptags "^3.1.1" + to-gfm-code-block "^0.1.1" + year "^0.2.1" + "@budibase/pro@1.2.39-alpha.0": version "1.2.39-alpha.0" resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.39-alpha.0.tgz#272e3ffd5e2189c787df6b6fbe22b7084832ade7" @@ -1207,11 +1358,28 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" +"@budibase/string-templates@1.2.39-alpha.1": + version "1.2.39-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/string-templates/-/string-templates-1.2.39-alpha.1.tgz#2cef89a75b85289742588f067e426046039b67a5" + integrity sha512-puWejjG6+Yz8jmKxi7j2rMwuilNXC9cmIH4dNHfAowvq3Cn2w31SjR5Qd79cmJe2wb8B1snXMqti0uzSHWGmhQ== + dependencies: + "@budibase/handlebars-helpers" "^0.11.8" + dayjs "^1.10.4" + handlebars "^4.7.6" + handlebars-utils "^1.0.6" + lodash "^4.17.20" + vm2 "^3.9.4" + "@budibase/types@1.2.39-alpha.0": version "1.2.39-alpha.0" resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.39-alpha.0.tgz#d0d48e4da36a93a4a9354cc49663f38d0181b6c0" integrity sha512-i+lQeqlKmFORLuKdwmKnlmCCCEXZH6NdXHrOqNcebJzcNlx3Gx342+cHe4ZGYu0L+wCkWWelD5XHFuNMVMcuHg== +"@budibase/types@1.2.39-alpha.1": + version "1.2.39-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.39-alpha.1.tgz#1758c5c7b8a1d754b4c391fc2dc699d6e249980b" + integrity sha512-b3YKkNf0+ImO/HvNbDS0biaMY2uu5ClphBLtA34hOd1I8hjjNj1kguuiQvgW7zqTYvMRK0hBNtTCnSa90uI7Fg== + "@bull-board/api@3.7.0": version "3.7.0" resolved "https://registry.yarnpkg.com/@bull-board/api/-/api-3.7.0.tgz#231f687187c0cb34e0b97f463917b6aaeb4ef6af" @@ -2139,6 +2307,24 @@ resolved "https://registry.yarnpkg.com/@redis/time-series/-/time-series-1.0.3.tgz#4cfca8e564228c0bddcdf4418cba60c20b224ac4" integrity sha512-OFp0q4SGrTH0Mruf6oFsHGea58u8vS/iI5+NpYdicaM+7BgqBZH8FFvNZ8rYYLrUO/QRqMq72NpXmxLVNcdmjA== +"@rollup/plugin-inject@^4.0.0": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@rollup/plugin-inject/-/plugin-inject-4.0.4.tgz#fbeee66e9a700782c4f65c8b0edbafe58678fbc2" + integrity sha512-4pbcU4J/nS+zuHk+c+OL3WtmEQhqxlZ9uqfjQMQDOHOPld7PsCd8k5LWs8h5wjwJN7MgnAn768F2sDxEP4eNFQ== + dependencies: + "@rollup/pluginutils" "^3.1.0" + estree-walker "^2.0.1" + magic-string "^0.25.7" + +"@rollup/pluginutils@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" + integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== + dependencies: + "@types/estree" "0.0.39" + estree-walker "^1.0.1" + picomatch "^2.2.2" + "@sendgrid/client@^7.1.1": version "7.7.0" resolved "https://registry.yarnpkg.com/@sendgrid/client/-/client-7.7.0.tgz#f8f67abd604205a0d0b1af091b61517ef465fdbf" @@ -2420,6 +2606,11 @@ resolved "https://registry.yarnpkg.com/@spectrum-css/sidenav/-/sidenav-3.0.23.tgz#c218560d472e13a3e0d1499b762df1206dcffbfd" integrity sha512-4IFw2/HMQJRzM0M2c5na/HeY7y5vJoGpMFBkXNpQyhW4TRo7N1rGwYQ5dRD3s4OVEWV4/rjfGV0d/qhfwKUTog== +"@spectrum-css/slider@3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@spectrum-css/slider/-/slider-3.0.1.tgz#5281e6f47eb5a4fd3d1816c138bf66d01d7f2e49" + integrity sha512-DI2dtMRnQuDM1miVzl3SGyR1khUEKnwdXfO5EHDFwkC3yav43F5QogkfjmjFmWWobMVovdJlAuiaaJ/IHejD0Q== + "@spectrum-css/statuslight@^3.0.2": version "3.0.8" resolved "https://registry.yarnpkg.com/@spectrum-css/statuslight/-/statuslight-3.0.8.tgz#3b0ea80712573679870a85d469850230e794a0f7" @@ -2445,6 +2636,16 @@ resolved "https://registry.yarnpkg.com/@spectrum-css/tabs/-/tabs-3.2.16.tgz#c3f7800d8d6f7c9930c28cd01354816328bf72b1" integrity sha512-JUcMB/fiDG/KoyrVstlUMacFJUY4OHKqhMRuPtu9ggUXWCRbSkY8he92v6u0HwY3DuhDoOxNTK8d/PLjk/fsbg== +"@spectrum-css/tabs@^3.2.12": + version "3.2.19" + resolved "https://registry.yarnpkg.com/@spectrum-css/tabs/-/tabs-3.2.19.tgz#2eae3a2c4760466882db08281365d502c3f22ebf" + integrity sha512-SNGFf/karBr/GNz5GNWnbppFz6uEOGecv6D8WA1ZLeWkjg4gG5e4M9XmPcB32v350e1PTRG7KwWDce48qWAKCQ== + +"@spectrum-css/tag@^3.1.4": + version "3.3.14" + resolved "https://registry.yarnpkg.com/@spectrum-css/tag/-/tag-3.3.14.tgz#2d1ca0759da6a3a2970d14bcabf33bd4a8f63a5f" + integrity sha512-S4RUaxN/83Pr/SYkQHeZNh2NXmtumUEzhrsrrliI6bAt3bjs+mLresTGd9qkIX2+Ycq1JHWTr0HTga4ti1YYyA== + "@spectrum-css/tags@^3.0.2": version "3.0.3" resolved "https://registry.yarnpkg.com/@spectrum-css/tags/-/tags-3.0.3.tgz#fc76d2735cdc442de91b7eb3bee49a928c0767ac" @@ -2622,6 +2823,13 @@ resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.2.tgz#f65d3d6389e01eeb458bd54dc8f52b95a9463bc8" integrity sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w== +"@types/codemirror@^5.60.4": + version "5.60.5" + resolved "https://registry.yarnpkg.com/@types/codemirror/-/codemirror-5.60.5.tgz#5b989a3b4bbe657458cf372c92b6bfda6061a2b7" + integrity sha512-TiECZmm8St5YxjFUp64LK0c8WU5bxMDt9YaAek1UqUb9swrSCoJhh92fWu1p3mTEqlHjhB5sY7OFBhWroJXZVg== + dependencies: + "@types/tern" "*" + "@types/connect@*": version "3.4.35" resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" @@ -2670,6 +2878,11 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== +"@types/estree@0.0.39": + version "0.0.39" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" + integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== + "@types/express-serve-static-core@^4.17.18": version "4.17.28" resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz#c47def9f34ec81dc6328d0b1b5303d1ec98d86b8" @@ -2813,6 +3026,11 @@ resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== +"@types/marked@^4.0.1": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/marked/-/marked-4.0.3.tgz#2098f4a77adaba9ce881c9e0b6baf29116e5acc4" + integrity sha512-HnMWQkLJEf/PnxZIfbm0yGJRRZYYMhb++O9M36UCTA9z53uPvVoSlAwJr3XOpDEryb7Hwl1qAx/MV6YIW1RXxg== + "@types/mime@^1": version "1.3.2" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" @@ -2948,6 +3166,13 @@ "@types/cookiejar" "*" "@types/node" "*" +"@types/tern@*": + version "0.23.4" + resolved "https://registry.yarnpkg.com/@types/tern/-/tern-0.23.4.tgz#03926eb13dbeaf3ae0d390caf706b2643a0127fb" + integrity sha512-JAUw1iXGO1qaWwEOzxTKJZ/5JxVeON9kvGZ/osgZaJImBnyjyn0cjovPsf6FNLmyGY8Vw9DoXZCMlfMkMwHRWg== + dependencies: + "@types/estree" "*" + "@types/tough-cookie@*": version "4.0.2" resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.2.tgz#6286b4c7228d58ab7866d19716f3696e03a09397" @@ -3532,7 +3757,7 @@ arg@^4.1.0: resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== -argparse@^1.0.7: +argparse@^1.0.10, argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== @@ -3579,6 +3804,15 @@ array-equal@^1.0.0: resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" integrity sha512-H3LU5RLiSsGXPhN+Nipar0iR0IofH+8r89G2y1tBKxQ/agagKyAjhkAFDRBfodP2caPrNKHpAWNIM/c9yeL7uA== +array-sort@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-sort/-/array-sort-1.0.0.tgz#e4c05356453f56f53512a7d1d6123f2c54c0a88a" + integrity sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg== + dependencies: + default-compare "^1.0.0" + get-value "^2.0.6" + kind-of "^5.0.2" + array-union@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" @@ -3710,6 +3944,13 @@ atomic-sleep@^1.0.0: resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" integrity sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ== +autolinker@~0.28.0: + version "0.28.1" + resolved "https://registry.yarnpkg.com/autolinker/-/autolinker-0.28.1.tgz#0652b491881879f0775dace0cdca3233942a4e47" + integrity sha512-zQAFO1Dlsn69eXaO6+7YZc+v84aquQKbwpzCE3L0stj56ERn9hutFxPopViLjo9G+rWwjozRhgS5KJ25Xy19cQ== + dependencies: + gulp-header "^1.7.1" + available-typed-arrays@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" @@ -4411,7 +4652,7 @@ chmodr@1.2.0: resolved "https://registry.yarnpkg.com/chmodr/-/chmodr-1.2.0.tgz#720e96caa09b7f1cdbb01529b7d0ab6bc5e118b9" integrity sha512-Y5uI7Iq/Az6HgJEL6pdw7THVd7jbVOTPwsmcPOBjQL8e3N+pz872kzK5QxYGEy21iRys+iHWV0UZQXDFJo1hyA== -chokidar@^3.5.2: +chokidar@^3.5.2, chokidar@^3.5.3: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== @@ -4542,6 +4783,18 @@ co@^4.6.0: resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== +codemirror-spell-checker@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/codemirror-spell-checker/-/codemirror-spell-checker-1.1.2.tgz#1c660f9089483ccb5113b9ba9ca19c3f4993371e" + integrity sha512-2Tl6n0v+GJRsC9K3MLCdLaMOmvWL0uukajNJseorZJsslaxZyZMgENocPU8R0DyoTAiKsyqiemSOZo7kjGV0LQ== + dependencies: + typo-js "*" + +codemirror@^5.63.1: + version "5.65.7" + resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.65.7.tgz#29af41ce5f4c2b8f1c1e16f4e645ff392823716a" + integrity sha512-zb67cXzgugIQmb6tfD4G11ILjYoMfTjwcjn+cWsa4GewlI2adhR/h3kolkoCQTm1msD/1BuqVTKuO09ELsS++A== + collect-v8-coverage@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" @@ -4692,6 +4945,13 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== +concat-with-sourcemaps@*: + version "1.1.0" + resolved "https://registry.yarnpkg.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz#d4ea93f05ae25790951b99e7b3b09e3908a4082e" + integrity sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg== + dependencies: + source-map "^0.6.1" + condense-newlines@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/condense-newlines/-/condense-newlines-0.2.1.tgz#3de985553139475d32502c83b02f60684d24c55f" @@ -5098,6 +5358,13 @@ deepmerge@^4.2.2: resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== +default-compare@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-compare/-/default-compare-1.0.0.tgz#cb61131844ad84d84788fb68fd01681ca7781a2f" + integrity sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ== + dependencies: + kind-of "^5.0.2" + default-shell@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/default-shell/-/default-shell-1.0.1.tgz#752304bddc6174f49eb29cb988feea0b8813c8bc" @@ -5265,11 +5532,25 @@ doctrine@3.0.0, doctrine@^3.0.0: dependencies: esutils "^2.0.2" +dom-serializer@^1.0.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.4.1.tgz#de5d41b1aea290215dc45a6dae8adcf1d32e2d30" + integrity sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag== + dependencies: + domelementtype "^2.0.1" + domhandler "^4.2.0" + entities "^2.0.0" + dom-walk@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84" integrity sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w== +domelementtype@^2.0.1, domelementtype@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" + integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== + domexception@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" @@ -5284,6 +5565,22 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" +domhandler@^4.0.0, domhandler@^4.2.0: + version "4.3.1" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.1.tgz#8d792033416f59d68bc03a5aa7b018c1ca89279c" + integrity sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ== + dependencies: + domelementtype "^2.2.0" + +domutils@^2.5.2: + version "2.8.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" + integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A== + dependencies: + dom-serializer "^1.0.1" + domelementtype "^2.2.0" + domhandler "^4.2.0" + dot-prop@^5.2.0: version "5.3.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" @@ -5328,6 +5625,11 @@ download@8.0.0: p-event "^2.1.0" pify "^4.0.1" +downloadjs@1.4.7: + version "1.4.7" + resolved "https://registry.yarnpkg.com/downloadjs/-/downloadjs-1.4.7.tgz#f69f96f940e0d0553dac291139865a3cd0101e3c" + integrity sha512-LN1gO7+u9xjU5oEScGFKvXhYf7Y/empUIIEAGBs1LzUq/rg5duiDrkuH5A2lQGd5jfMOb9X9usDa2oVXwJ0U/Q== + duplexer3@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" @@ -5343,6 +5645,17 @@ duplexify@^4.0.0: readable-stream "^3.1.1" stream-shift "^1.0.0" +easymde@^2.16.1: + version "2.16.1" + resolved "https://registry.yarnpkg.com/easymde/-/easymde-2.16.1.tgz#f4c2380312615cb33826f1a1fecfaa4022ff551a" + integrity sha512-FihYgjRsKfhGNk89SHSqxKLC4aJ1kfybPWW6iAmtb5GnXu+tnFPSzSaGBmk1RRlCuhFSjhF0SnIMGVPjEzkr6g== + dependencies: + "@types/codemirror" "^5.60.4" + "@types/marked" "^4.0.1" + codemirror "^5.63.1" + codemirror-spell-checker "1.1.2" + marked "^4.0.10" + ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -5454,6 +5767,16 @@ enhanced-resolve@^5.9.3: graceful-fs "^4.2.4" tapable "^2.2.0" +ent@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" + integrity sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA== + +entities@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" + integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== + entities@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" @@ -5887,6 +6210,16 @@ estraverse@^5.1.0, estraverse@^5.2.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== +estree-walker@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" + integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== + +estree-walker@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" + integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== + esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" @@ -6436,6 +6769,11 @@ fs-constants@^1.0.0: resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== +fs-exists-sync@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz#982d6893af918e72d08dec9e8673ff2b5a8d6add" + integrity sha512-cR/vflFyPZtrN6b38ZyWxpWdhlXrzZEBawlpBQMq7033xVY7/kg0GDMBK5jg8lDYQckdJ5x/YC88lM3C7VMsLg== + fs-extra@8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" @@ -6584,6 +6922,14 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: has "^1.0.3" has-symbols "^1.0.3" +get-object@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/get-object/-/get-object-0.2.0.tgz#d92ff7d5190c64530cda0543dac63a3d47fe8c0c" + integrity sha512-7P6y6k6EzEFmO/XyUyFlXm1YLJy9xeA1x/grNV8276abX5GuwUtYgKFkRFkLixw4hf4Pz9q2vgv/8Ar42R0HuQ== + dependencies: + is-number "^2.0.2" + isobject "^0.2.0" + get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" @@ -6646,6 +6992,13 @@ get-value@^2.0.3, get-value@^2.0.6: resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" integrity sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA== +get-value@^3.0.0, get-value@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-3.0.1.tgz#5efd2a157f1d6a516d7524e124ac52d0a39ef5a8" + integrity sha512-mKZj9JLQrwMBtj5wxi6MH8Z5eSKaERpAwjg43dPtlGI1ZVEgH/qC7T8/6R2OBSUA+zzHBZgICsVJaEIV2tKTDA== + dependencies: + isobject "^3.0.1" + getopts@2.2.5: version "2.2.5" resolved "https://registry.yarnpkg.com/getopts/-/getopts-2.2.5.tgz#67a0fe471cacb9c687d817cab6450b96dde8313b" @@ -6951,7 +7304,24 @@ gtoken@^5.0.4: google-p12-pem "^3.1.3" jws "^4.0.0" -handlebars@^4.7.7: +gulp-header@^1.7.1: + version "1.8.12" + resolved "https://registry.yarnpkg.com/gulp-header/-/gulp-header-1.8.12.tgz#ad306be0066599127281c4f8786660e705080a84" + integrity sha512-lh9HLdb53sC7XIZOYzTXM4lFuXElv3EVkSDhsd7DoJBj7hm+Ni7D3qYbb+Rr8DuM8nRanBvkVO9d7askreXGnQ== + dependencies: + concat-with-sourcemaps "*" + lodash.template "^4.4.0" + through2 "^2.0.0" + +handlebars-utils@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/handlebars-utils/-/handlebars-utils-1.0.6.tgz#cb9db43362479054782d86ffe10f47abc76357f9" + integrity sha512-d5mmoQXdeEqSKMtQQZ9WkiUcO1E3tPbWxluCK9hVgIDPzQa9WsKo3Lbe/sGflTe7TomHEeZaOgwIkyIr1kfzkw== + dependencies: + kind-of "^6.0.0" + typeof-article "^0.1.1" + +handlebars@^4.7.6, handlebars@^4.7.7: version "4.7.7" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== @@ -7045,6 +7415,14 @@ has-value@^1.0.0: has-values "^1.0.0" isobject "^3.0.0" +has-value@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-2.0.2.tgz#d0f12e8780ba8e90e66ad1a21c707fdb67c25658" + integrity sha512-ybKOlcRsK2MqrM3Hmz/lQxXHZ6ejzSPzpNabKB45jb5qDgJvKPa3SdapTsTLwEb9WltgWpOmNax7i+DzNOk4TA== + dependencies: + get-value "^3.0.0" + has-values "^2.0.1" + has-values@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" @@ -7058,6 +7436,13 @@ has-values@^1.0.0: is-number "^3.0.0" kind-of "^4.0.0" +has-values@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-2.0.1.tgz#3876200ff86d8a8546a9264a952c17d5fc17579d" + integrity sha512-+QdH3jOmq9P8GfdjFg0eJudqx1FqU62NQJ4P16rOEHeRdl7ckgwn6uqQjzYE0ZoHVV/e5E2esuJ5Gl5+HUW19w== + dependencies: + kind-of "^6.0.2" + has-yarn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77" @@ -7070,6 +7455,16 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" +helper-md@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/helper-md/-/helper-md-0.2.2.tgz#c1f59d7e55bbae23362fd8a0e971607aec69d41f" + integrity sha512-49TaQzK+Ic7ZVTq4i1UZxRUJEmAilTk8hz7q4I0WNUaTclLR8ArJV5B3A1fe1xF2HtsDTr2gYKLaVTof/Lt84Q== + dependencies: + ent "^2.2.0" + extend-shallow "^2.0.1" + fs-exists-sync "^0.1.0" + remarkable "^1.6.2" + homedir-polyfill@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" @@ -7106,6 +7501,24 @@ html-escaper@^2.0.0: resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== +html-tag@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/html-tag/-/html-tag-2.0.0.tgz#36c3bc8d816fd30b570d5764a497a641640c2fed" + integrity sha512-XxzooSo6oBoxBEUazgjdXj7VwTn/iSTSZzTYKzYY6I916tkaYzypHxy+pbVU1h+0UQ9JlVf5XkNQyxOAiiQO1g== + dependencies: + is-self-closing "^1.0.1" + kind-of "^6.0.0" + +htmlparser2@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-6.1.0.tgz#c4d762b6c3371a05dbe65e94ae43a9f845fb8fb7" + integrity sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A== + dependencies: + domelementtype "^2.0.1" + domhandler "^4.0.0" + domutils "^2.5.2" + entities "^2.0.0" + http-assert@^1.3.0: version "1.5.0" resolved "https://registry.yarnpkg.com/http-assert/-/http-assert-1.5.0.tgz#c389ccd87ac16ed2dfa6246fd73b926aa00e6b8f" @@ -7546,6 +7959,13 @@ is-docker@^2.0.0, is-docker@^2.1.1: resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== +is-even@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-even/-/is-even-1.0.0.tgz#76b5055fbad8d294a86b6a949015e1c97b717c06" + integrity sha512-LEhnkAdJqic4Dbqn58A0y52IXoHWlsueqQkKfMfdEnIYG8A1sm/GHidKkS6yvXlMoRrkM34csHnXQtOqcb+Jzg== + dependencies: + is-odd "^0.1.2" + is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -7635,6 +8055,13 @@ is-number-object@^1.0.4: dependencies: has-tostringtag "^1.0.0" +is-number@^2.0.2: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + integrity sha512-QUzH43Gfb9+5yckcrSA0VBDwEtDUchrk4F6tfJZQuNzDJbEDB9cZNzSfXGQ1jqmdDY/kl41lUOWM9syA8z8jlg== + dependencies: + kind-of "^3.0.2" + is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" @@ -7657,6 +8084,13 @@ is-object@^1.0.1: resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf" integrity sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA== +is-odd@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-0.1.2.tgz#bc573b5ce371ef2aad6e6f49799b72bef13978a7" + integrity sha512-Ri7C2K7o5IrUU9UEI8losXJCCD/UtsaIrkR5sxIcFg4xQ9cRJXlWA5DQvTE0yDc0krvSNLsRGXN11UPS6KyfBw== + dependencies: + is-number "^3.0.0" + is-path-inside@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" @@ -7674,6 +8108,11 @@ is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" +is-plain-object@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" + integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== + is-potential-custom-element-name@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" @@ -7702,6 +8141,13 @@ is-retry-allowed@^2.2.0: resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-2.2.0.tgz#88f34cbd236e043e71b6932d09b0c65fb7b4d71d" integrity sha512-XVm7LOeLpTW4jV19QSH38vkswxoLud8sQ57YwJVTPWdiaI9I8keEhGFpBlslyVsgdQy4Opg8QOLb8YRgsyZiQg== +is-self-closing@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-self-closing/-/is-self-closing-1.0.1.tgz#5f406b527c7b12610176320338af0fa3896416e4" + integrity sha512-E+60FomW7Blv5GXTlYee2KDrnG6srxF7Xt1SjrhWUGUEsTFIqY/nq2y3DaftCsgUMdh89V07IVfhY9KIJhLezg== + dependencies: + self-closing-tags "^1.0.1" + is-shared-array-buffer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" @@ -7812,6 +8258,11 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== +isobject@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-0.2.0.tgz#a3432192f39b910b5f02cc989487836ec70aa85e" + integrity sha512-VaWq6XYAsbvM0wf4dyBO7WH9D7GosB7ZZlqrawI9BBiTMINBeCyqSKBa35m870MY3O4aM31pYyZi9DfGrYMJrQ== + isobject@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" @@ -8992,7 +9443,7 @@ keyv@^3.0.0: dependencies: json-buffer "3.0.0" -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.1.0, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ== @@ -9006,12 +9457,12 @@ kind-of@^4.0.0: dependencies: is-buffer "^1.1.5" -kind-of@^5.0.0: +kind-of@^5.0.0, kind-of@^5.0.2: version "5.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== -kind-of@^6.0.0, kind-of@^6.0.2: +kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== @@ -9271,6 +9722,11 @@ lcid@^2.0.0: dependencies: invert-kv "^2.0.0" +leaflet@^1.7.1: + version "1.8.0" + resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.8.0.tgz#4615db4a22a304e8e692cae9270b983b38a2055e" + integrity sha512-gwhMjFCQiYs3x/Sf+d49f10ERXaEFCPr+nVTryhAW8DWbMGqJqt9G4XuIaHmFW08zYvhgdzqXGr8AlW8v8dQkA== + left-pad@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" @@ -9465,6 +9921,11 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +lodash._reinterpolate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" + integrity sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA== + lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" @@ -9575,6 +10036,21 @@ lodash.sortby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA== +lodash.template@^4.4.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" + integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A== + dependencies: + lodash._reinterpolate "^3.0.0" + lodash.templatesettings "^4.0.0" + +lodash.templatesettings@^4.0.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz#e481310f049d3cf6d47e912ad09313b154f0fb33" + integrity sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ== + dependencies: + lodash._reinterpolate "^3.0.0" + lodash.without@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.without/-/lodash.without-4.4.0.tgz#3cd4574a00b67bae373a94b748772640507b7aac" @@ -9585,7 +10061,7 @@ lodash.xor@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.xor/-/lodash.xor-4.5.0.tgz#4d48ed7e98095b0632582ba714d3ff8ae8fb1db6" integrity sha512-sVN2zimthq7aZ5sPGXnSz32rZPuqcparVW50chJQe+mzTYV+IsxSsl/2gnkWWE2Of7K3myBQBqtLKOUEHJKRsQ== -lodash@4.17.21, lodash@^4.14.0, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.3, lodash@^4.7.0: +lodash@4.17.21, lodash@^4.14.0, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.3, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -9653,6 +10129,13 @@ ltgt@2.2.1, ltgt@^2.1.2, ltgt@~2.2.0: resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" integrity sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA== +magic-string@^0.25.7: + version "0.25.9" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" + integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== + dependencies: + sourcemap-codec "^1.4.8" + make-dir@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" @@ -9717,6 +10200,11 @@ markdown-it@^12.2.0: mdurl "^1.0.1" uc.micro "^1.0.5" +marked@^4.0.10: + version "4.0.18" + resolved "https://registry.yarnpkg.com/marked/-/marked-4.0.18.tgz#cd0ac54b2e5610cfb90e8fd46ccaa8292c9ed569" + integrity sha512-wbLDJ7Zh0sqA0Vdg6aqlbT+yPxqLblpAZh1mK2+AO2twQkPywvvqQNfEPVwSSRjZ7dZcdeVBIAgiO7MMp3Dszw== + matcher@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/matcher/-/matcher-3.0.0.tgz#bd9060f4c5b70aa8041ccc6f80368760994f30ca" @@ -9789,7 +10277,7 @@ methods@^1.0.1, methods@^1.1.1, methods@^1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== -micromatch@^3.1.10, micromatch@^3.1.4: +micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.5: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== @@ -10047,6 +10535,16 @@ nan@^2.12.1: resolved "https://registry.yarnpkg.com/nan/-/nan-2.16.0.tgz#664f43e45460fb98faf00edca0bb0d7b8dce7916" integrity sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA== +nanoid@^2.1.0: + version "2.1.11" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-2.1.11.tgz#ec24b8a758d591561531b4176a01e3ab4f0f0280" + integrity sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA== + +nanoid@^3.3.4: + version "3.3.4" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" + integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== + nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" @@ -10644,6 +11142,11 @@ parse-passwd@^1.0.0: resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" integrity sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q== +parse-srcset@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/parse-srcset/-/parse-srcset-1.0.2.tgz#f2bd221f6cc970a938d88556abc589caaaa2bde1" + integrity sha512-/2qh0lav6CmI15FzA3i/2Bzk2zCgQhGMkvhOhKNcBVQ1ldgpbfiNTVslmooUmWJcADi1f1kIeynbDRVzNlfR6Q== + parse5@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" @@ -10890,7 +11393,7 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -11005,6 +11508,15 @@ posix-character-classes@^0.1.0: resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg== +postcss@^8.3.11: + version "8.4.16" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.16.tgz#33a1d675fac39941f5f445db0de4db2b6e01d43c" + integrity sha512-ipHE1XBvKzm5xI7hiHCZJCSugxvsdq2mPnsq5+UF+VHCjiBvtDrlxJfMBToWaP9D5XlgNmcFGqoHmUn0EYEaRQ== + dependencies: + nanoid "^3.3.4" + picocolors "^1.0.0" + source-map-js "^1.0.2" + postgres-array@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/postgres-array/-/postgres-array-2.0.0.tgz#48f8fce054fbc69671999329b8834b772652d82e" @@ -11753,6 +12265,16 @@ regexp.prototype.flags@^1.4.3: define-properties "^1.1.3" functions-have-names "^1.2.2" +regexparam@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexparam/-/regexparam-2.0.1.tgz#c912f5dae371e3798100b3c9ce22b7414d0889fa" + integrity sha512-zRgSaYemnNYxUv+/5SeoHI0eJIgTL/A2pUtXUPLHQxUldagouJ9p+K6IbIZ/JiQuCEv2E2B1O11SjVQy3aMCkw== + +regexparam@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/regexparam/-/regexparam-1.3.0.tgz#2fe42c93e32a40eff6235d635e0ffa344b92965f" + integrity sha512-6IQpFBv6e5vz1QAqI+V4k8P2e/3gRrqfCJ9FI+O1FLQTO+Uz6RXZEZOPmTJ6hlGj7gkERzY5BRCv09whKP96/g== + regexpp@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" @@ -11796,6 +12318,21 @@ regjsparser@^0.8.2: dependencies: jsesc "~0.5.0" +relative@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/relative/-/relative-3.0.2.tgz#0dcd8ec54a5d35a3c15e104503d65375b5a5367f" + integrity sha512-Q5W2qeYtY9GbiR8z1yHNZ1DGhyjb4AnLEjt8iE6XfcC1QIu+FAtj3HQaO0wH28H1mX6cqNLvAqWhP402dxJGyA== + dependencies: + isobject "^2.0.0" + +remarkable@^1.6.2: + version "1.7.4" + resolved "https://registry.yarnpkg.com/remarkable/-/remarkable-1.7.4.tgz#19073cb960398c87a7d6546eaa5e50d2022fcd00" + integrity sha512-e6NKUXgX95whv7IgddywbeN/ItCkWbISmc2DiqHJb0wTrqZIexqdco5b8Z3XZoo/48IdNVKM9ZCvTPJ4F5uvhg== + dependencies: + argparse "^1.0.10" + autolinker "~0.28.0" + remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" @@ -12007,6 +12544,13 @@ roarr@^2.15.3: semver-compare "^1.0.0" sprintf-js "^1.1.2" +rollup-plugin-polyfill-node@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-polyfill-node/-/rollup-plugin-polyfill-node-0.8.0.tgz#859c070822f5e38d221e5b4238cb34aa894c2b19" + integrity sha512-C4UeKedOmOBkB3FgR+z/v9kzRwV1Q/H8xWs1u1+CNe4XOV6hINfOrcO+TredKxYvopCmr+WKUSNsFUnD1RLHgQ== + dependencies: + "@rollup/plugin-inject" "^4.0.0" + rsvp@^4.8.4: version "4.8.5" resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" @@ -12073,6 +12617,18 @@ sane@^4.0.3: minimist "^1.1.1" walker "~1.0.5" +sanitize-html@^2.7.0: + version "2.7.1" + resolved "https://registry.yarnpkg.com/sanitize-html/-/sanitize-html-2.7.1.tgz#a6c2c1a88054a79eeacfac9b0a43f1b393476901" + integrity sha512-oOpe8l4J8CaBk++2haoN5yNI5beekjuHv3JRPKUx/7h40Rdr85pemn4NkvUB3TcBP7yjat574sPlcMAyv4UQig== + dependencies: + deepmerge "^4.2.2" + escape-string-regexp "^4.0.0" + htmlparser2 "^6.0.0" + is-plain-object "^5.0.0" + parse-srcset "^1.0.2" + postcss "^8.3.11" + sanitize-s3-objectkey@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/sanitize-s3-objectkey/-/sanitize-s3-objectkey-0.0.1.tgz#efa9887cd45275b40234fb4bb12fc5754fe64e7e" @@ -12111,6 +12667,11 @@ schema-utils@^3.1.0, schema-utils@^3.1.1: ajv "^6.12.5" ajv-keywords "^3.5.2" +screenfull@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/screenfull/-/screenfull-6.0.2.tgz#3dbe4b8c4f8f49fb8e33caa8f69d0bca730ab238" + integrity sha512-AQdy8s4WhNvUZ6P8F6PB21tSPIYKniic+Ogx0AacBMjKP1GUHN2E9URxQHtCusiwxudnCKkdy4GrHXPPJSkCCw== + search-params@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/search-params/-/search-params-3.0.0.tgz#dbc7c243058e5a33ae1e9870be91f5aced4100d8" @@ -12128,6 +12689,11 @@ seek-bzip@^1.0.5: dependencies: commander "^2.8.1" +self-closing-tags@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/self-closing-tags/-/self-closing-tags-1.0.1.tgz#6c5fa497994bb826b484216916371accee490a5d" + integrity sha512-7t6hNbYMxM+VHXTgJmxwgZgLGktuXtVVD5AivWzNTdJBM4DBjnDKDzkf2SrNjihaArpeJYNjxkELBu1evI4lQA== + semver-compare@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" @@ -12263,6 +12829,13 @@ shimmer@^1.2.0: resolved "https://registry.yarnpkg.com/shimmer/-/shimmer-1.2.1.tgz#610859f7de327b587efebf501fb43117f9aff337" integrity sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw== +shortid@^2.2.15: + version "2.2.16" + resolved "https://registry.yarnpkg.com/shortid/-/shortid-2.2.16.tgz#b742b8f0cb96406fd391c76bfc18a67a57fe5608" + integrity sha512-Ugt+GIZqvGXCIItnsL+lvFJOiN7RYqlGy7QE41O3YC1xbNSeDGIRO7xg2JJXIAj1cAGnOeC1r7/T9pgrtQbv4g== + dependencies: + nanoid "^2.1.0" + side-channel@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" @@ -12427,6 +13000,11 @@ source-list-map@^2.0.1: resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== +source-map-js@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== + source-map-resolve@^0.5.0: version "0.5.3" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" @@ -12480,6 +13058,11 @@ source-map@^0.7.3: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== +sourcemap-codec@^1.4.8: + version "1.4.8" + resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" + integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== + spark-md5@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/spark-md5/-/spark-md5-3.0.1.tgz#83a0e255734f2ab4e5c466e5a2cfc9ba2aa2124d" @@ -12804,6 +13387,11 @@ strip-outer@^1.0.0: dependencies: escape-string-regexp "^1.0.2" +striptags@^3.1.1: + version "3.2.0" + resolved "https://registry.yarnpkg.com/striptags/-/striptags-3.2.0.tgz#cc74a137db2de8b0b9a370006334161f7dd67052" + integrity sha512-g45ZOGzHDMe2bdYMdIvdAfCQkCTDMGBazSw1ypMowwGIee7ZQ5dU0rBJ8Jqgl+jAKIv4dbeE1jscZq9wid1Tkw== + style-loader@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.1.tgz#057dfa6b3d4d7c7064462830f9113ed417d38575" @@ -12903,7 +13491,14 @@ svelte-portal@^1.0.0: resolved "https://registry.yarnpkg.com/svelte-portal/-/svelte-portal-1.0.0.tgz#36a47c5578b1a4d9b4dc60fa32a904640ec4cdd3" integrity sha512-nHf+DS/jZ6jjnZSleBMSaZua9JlG5rZv9lOGKgJuaZStfevtjIlUJrkLc3vbV8QdBvPPVmvcjTlazAzfKu0v3Q== -svelte@3.49.0: +svelte-spa-router@^3.0.5: + version "3.3.0" + resolved "https://registry.yarnpkg.com/svelte-spa-router/-/svelte-spa-router-3.3.0.tgz#2fc0967a49dc361dfe4d38dddad6e662eed5b42c" + integrity sha512-cwRNe7cxD43sCvSfEeaKiNZg3FCizGxeMcf7CPiWRP3jKXjEma3vxyyuDtPOam6nWbVxl9TNM3hlE/i87ZlqcQ== + dependencies: + regexparam "2.0.1" + +svelte@3.49.0, svelte@^3.46.2, svelte@^3.49.0: version "3.49.0" resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.49.0.tgz#5baee3c672306de1070c3b7888fc2204e36a4029" integrity sha512-+lmjic1pApJWDfPCpUUTc1m8azDqYCG1JN9YEngrx/hUyIcFJo6VZhj0A1Ai0wqoHcEIuQy+e9tk+4uDgdtsFA== @@ -13265,6 +13860,11 @@ to-fast-properties@^2.0.0: resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= +to-gfm-code-block@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/to-gfm-code-block/-/to-gfm-code-block-0.1.1.tgz#25d045a5fae553189e9637b590900da732d8aa82" + integrity sha512-LQRZWyn8d5amUKnfR9A9Uu7x9ss7Re8peuWR2gkh1E+ildOfv2aF26JpuDg8JtvCduu5+hOrMIH+XstZtnagqg== + to-json-schema@0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/to-json-schema/-/to-json-schema-0.2.5.tgz#ef3c3f11ad64460dcfbdbafd0fd525d69d62a98f" @@ -13511,6 +14111,13 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" +typeof-article@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/typeof-article/-/typeof-article-0.1.1.tgz#9f07e733c3fbb646ffa9e61c08debacd460e06af" + integrity sha512-Vn42zdX3FhmUrzEmitX3iYyLb+Umwpmv8fkZRIknYh84lmdrwqZA5xYaoKiIj2Rc5i/5wcDrpUmZcbk1U51vTw== + dependencies: + kind-of "^3.1.0" + typeof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/typeof/-/typeof-1.0.0.tgz#9c84403f2323ae5399167275497638ea1d2f2440" @@ -13521,6 +14128,11 @@ typescript@4.6.2: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.2.tgz#fe12d2727b708f4eef40f51598b3398baa9611d4" integrity sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg== +typo-js@*: + version "1.2.2" + resolved "https://registry.yarnpkg.com/typo-js/-/typo-js-1.2.2.tgz#340484d81fe518e77c81a5a770162b14492f183b" + integrity sha512-C7pYBQK17EjSg8tVNY91KHdUt5Nf6FMJ+c3js076quPmBML57PmNMzAcIq/2kf/hSYtFABNDIYNYlJRl5BJhGw== + uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" @@ -13845,6 +14457,14 @@ vm2@3.9.6: acorn "^8.7.0" acorn-walk "^8.2.0" +vm2@^3.9.4: + version "3.9.10" + resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.10.tgz#c66543096b5c44c8861a6465805c23c7cc996a44" + integrity sha512-AuECTSvwu2OHLAZYhG716YzwodKCIJxB6u1zG7PgSQwIgAlEaoXH52bxdcvT8GkGjnYK7r7yWDW0m0sOsPuBjQ== + dependencies: + acorn "^8.7.0" + acorn-walk "^8.2.0" + vuvuzela@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/vuvuzela/-/vuvuzela-1.0.3.tgz#3be145e58271c73ca55279dd851f12a682114b0b" @@ -14398,6 +15018,11 @@ yauzl@^2.4.2: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0" +year@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/year/-/year-0.2.1.tgz#4083ae520a318b23ec86037f3000cb892bdf9bb0" + integrity sha512-9GnJUZ0QM4OgXuOzsKNzTJ5EOkums1Xc+3YQXp+Q+UxFjf7zLucp9dQ8QMIft0Szs1E1hUiXFim1OYfEKFq97w== + ylru@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/ylru/-/ylru-1.3.2.tgz#0de48017473275a4cbdfc83a1eaf67c01af8a785" diff --git a/packages/types/src/documents/plugin/index.ts b/packages/types/src/documents/plugin/index.ts index 03a239a6c9..8133e91523 100644 --- a/packages/types/src/documents/plugin/index.ts +++ b/packages/types/src/documents/plugin/index.ts @@ -2,3 +2,8 @@ export enum PluginType { DATASOURCE = "datasource", COMPONENT = "component", } + +export interface FileType { + path: string + name: string +} From 16d17cefd31b660ce84357cabc40ee0c1df45b88 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 16 Aug 2022 09:58:47 +0100 Subject: [PATCH 037/260] fix password modal length in user onboarding flow --- .../portal/manage/users/_components/PasswordModal.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/pages/builder/portal/manage/users/_components/PasswordModal.svelte b/packages/builder/src/pages/builder/portal/manage/users/_components/PasswordModal.svelte index 02501f2de0..e7ee28411b 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/_components/PasswordModal.svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/_components/PasswordModal.svelte @@ -42,7 +42,7 @@ Date: Tue, 16 Aug 2022 09:25:16 +0000 Subject: [PATCH 038/260] Proxy vite HMR websocket in dev --- hosting/nginx.dev.conf.hbs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hosting/nginx.dev.conf.hbs b/hosting/nginx.dev.conf.hbs index 9398b7e719..91f495cfac 100644 --- a/hosting/nginx.dev.conf.hbs +++ b/hosting/nginx.dev.conf.hbs @@ -77,6 +77,11 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } + location /ws { + proxy_pass http://{{ address }}:3000; + rewrite ^/ws(.*)$ /$1 break; + } + location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; From 4c6b9a03d19b210695207e685a7967881bb643ed Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 16 Aug 2022 09:26:23 +0000 Subject: [PATCH 039/260] Support env variables for vite config --- packages/builder/vite.config.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/builder/vite.config.js b/packages/builder/vite.config.js index 56ffbf20f5..9859e1dbb9 100644 --- a/packages/builder/vite.config.js +++ b/packages/builder/vite.config.js @@ -1,15 +1,22 @@ import { svelte } from "@sveltejs/vite-plugin-svelte" import replace from "@rollup/plugin-replace" +import { defineConfig, loadEnv } from "vite" import path from "path" -export default ({ mode }) => { +export default defineConfig(({ mode }) => { const isProduction = mode === "production" + const env = loadEnv(mode, process.cwd()) return { server: { fs: { strict: false, }, + hmr: { + protocol: "wss", + clientPort: env.VITE_HMR_CLIENT_PORT || 3000, + path: env.VITE_HMR_PATH || "/" + } }, base: "/builder/", build: { @@ -79,4 +86,4 @@ export default ({ mode }) => { ], }, } -} +}) From 468e840a0c771ae90cac6d869d1cc3f5e49858e8 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 16 Aug 2022 14:02:51 +0000 Subject: [PATCH 040/260] Only watch plugins in single tenant envs --- packages/server/src/app.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/server/src/app.ts b/packages/server/src/app.ts index 2f8adc879d..6f63715cfb 100644 --- a/packages/server/src/app.ts +++ b/packages/server/src/app.ts @@ -25,7 +25,7 @@ import * as migrations from "./migrations" import { events, installation, tenancy } from "@budibase/backend-core" import { createAdminUser, getChecklist } from "./utilities/workerRequests" import { processPlugin } from "./api/controllers/plugin" -import { getGlobalDB } from "@budibase/backend-core/tenancy" +import { DEFAULT_TENANT_ID } from "@budibase/backend-core/constants" const app = new Koa() @@ -138,7 +138,7 @@ module.exports = server.listen(env.PORT || 0, async () => { } // monitor plugin directory if required - if (env.SELF_HOSTED && env.PLUGINS_DIR && fs.existsSync(env.PLUGINS_DIR)) { + if (env.SELF_HOSTED && !env.MULTI_TENANCY && env.PLUGINS_DIR && fs.existsSync(env.PLUGINS_DIR)) { const watchPath = path.join(env.PLUGINS_DIR, "./**/dist/*.tar.gz") chokidar .watch(watchPath, { @@ -146,8 +146,7 @@ module.exports = server.listen(env.PORT || 0, async () => { awaitWriteFinish: true, }) .on("all", async (event: string, path: string) => { - const tenantId = tenancy.getTenantId() - await tenancy.doInTenant(tenantId, async () => { + await tenancy.doInTenant(DEFAULT_TENANT_ID, async () => { try { const split = path.split("/") const name = split[split.length - 1] From 3518642b150ac31dd931551d304885805035998a Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 16 Aug 2022 14:42:32 +0000 Subject: [PATCH 041/260] Add missing declaration of objectstore module --- packages/server/src/module.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/server/src/module.d.ts b/packages/server/src/module.d.ts index 4c0e13586a..eb1d1feb48 100644 --- a/packages/server/src/module.d.ts +++ b/packages/server/src/module.d.ts @@ -10,3 +10,4 @@ declare module "@budibase/backend-core/sessions" declare module "@budibase/backend-core/encryption" declare module "@budibase/backend-core/utils" declare module "@budibase/backend-core/redis" +declare module "@budibase/backend-core/objectStore" From 5807488f19d089df7ec3df5f13e454fb5ba0b879 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 16 Aug 2022 15:14:47 +0000 Subject: [PATCH 042/260] Add PLUGINS_DIR env var and show example mount for HMR of plugins --- hosting/docker-compose.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hosting/docker-compose.yaml b/hosting/docker-compose.yaml index 7d3e6960dc..4506467791 100644 --- a/hosting/docker-compose.yaml +++ b/hosting/docker-compose.yaml @@ -25,9 +25,12 @@ services: REDIS_PASSWORD: ${REDIS_PASSWORD} BB_ADMIN_USER_EMAIL: ${BB_ADMIN_USER_EMAIL} BB_ADMIN_USER_PASSWORD: ${BB_ADMIN_USER_PASSWORD} + PLUGINS_DIR: ${PLUGINS_DIR} depends_on: - worker-service - redis-service +# volumes: +# - /some/path/to/plugins:/plugins worker-service: restart: unless-stopped From 50c0e9ca69cb11961bbe1a647957048524df0305 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 16 Aug 2022 15:16:46 +0000 Subject: [PATCH 043/260] Default plugins dir to /plugins --- packages/server/src/app.ts | 7 ++++++- packages/server/src/environment.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/server/src/app.ts b/packages/server/src/app.ts index 6f63715cfb..e9a5661093 100644 --- a/packages/server/src/app.ts +++ b/packages/server/src/app.ts @@ -138,7 +138,12 @@ module.exports = server.listen(env.PORT || 0, async () => { } // monitor plugin directory if required - if (env.SELF_HOSTED && !env.MULTI_TENANCY && env.PLUGINS_DIR && fs.existsSync(env.PLUGINS_DIR)) { + if ( + env.SELF_HOSTED && + !env.MULTI_TENANCY && + env.PLUGINS_DIR && + fs.existsSync(env.PLUGINS_DIR) + ) { const watchPath = path.join(env.PLUGINS_DIR, "./**/dist/*.tar.gz") chokidar .watch(watchPath, { diff --git a/packages/server/src/environment.js b/packages/server/src/environment.js index 5a7aa61b9d..5524159a78 100644 --- a/packages/server/src/environment.js +++ b/packages/server/src/environment.js @@ -77,7 +77,7 @@ module.exports = { SQL_MAX_ROWS: process.env.SQL_MAX_ROWS, BB_ADMIN_USER_EMAIL: process.env.BB_ADMIN_USER_EMAIL, BB_ADMIN_USER_PASSWORD: process.env.BB_ADMIN_USER_PASSWORD, - PLUGINS_DIR: process.env.PLUGINS_DIR, + PLUGINS_DIR: process.env.PLUGINS_DIR || "/plugins", // flags ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS, DISABLE_THREADING: process.env.DISABLE_THREADING, From 63742ec7f0cf440a7eac4816a0256e958b6b06f0 Mon Sep 17 00:00:00 2001 From: Michael Drury Date: Tue, 16 Aug 2022 16:27:03 +0100 Subject: [PATCH 044/260] Adding watch command to CLI. --- packages/builder/vite.config.js | 4 ++-- packages/cli/src/plugins/index.js | 31 +++++++++++++++++++++++++++++-- packages/cli/src/prebuilds.js | 5 ++++- packages/cli/yarn.lock | 26 +++++++++++++------------- packages/server/src/app.ts | 7 ++++++- packages/server/yarn.lock | 31 +++++++++++++++---------------- packages/worker/yarn.lock | 31 +++++++++++++++---------------- 7 files changed, 84 insertions(+), 51 deletions(-) diff --git a/packages/builder/vite.config.js b/packages/builder/vite.config.js index 9859e1dbb9..20ff93831c 100644 --- a/packages/builder/vite.config.js +++ b/packages/builder/vite.config.js @@ -15,8 +15,8 @@ export default defineConfig(({ mode }) => { hmr: { protocol: "wss", clientPort: env.VITE_HMR_CLIENT_PORT || 3000, - path: env.VITE_HMR_PATH || "/" - } + path: env.VITE_HMR_PATH || "/", + }, }, base: "/builder/", build: { diff --git a/packages/cli/src/plugins/index.js b/packages/cli/src/plugins/index.js index e6de624b63..3ee2463a31 100644 --- a/packages/cli/src/plugins/index.js +++ b/packages/cli/src/plugins/index.js @@ -41,7 +41,7 @@ async function init(opts) { console.log(info(`Plugin created in directory "${name}"`)) } -async function build() { +async function verify() { console.log(info("Verifying plugin...")) const schema = fs.readFileSync("schema.json", "utf8") const pkg = fs.readFileSync("package.json", "utf8") @@ -57,21 +57,43 @@ async function build() { name = pkgJson.name version = pkgJson.version validate(schemaJson) + return { name, version } } catch (err) { if (err && err.message && err.message.includes("not valid JSON")) { console.log(error(`schema.json is not valid JSON: ${err.message}`)) } else { console.log(error(`Invalid schema/package.json: ${err.message}`)) } + } +} + +async function build() { + const verified = await verify() + if (!verified.name) { return } console.log(success("Verified!")) console.log(info("Building plugin...")) await runPkgCommand("build") - const output = join("dist", `${name}-${version}.tar.gz`) + const output = join("dist", `${verified.name}-${verified.version}.tar.gz`) console.log(success(`Build complete - output in: ${output}`)) } +async function watch() { + const verified = await verify() + if (!verified.name) { + return + } + const output = join("dist", `${verified.name}-${verified.version}.tar.gz`) + console.log(info(`Watching - build in: ${output}`)) + try { + await runPkgCommand("watch") + } catch (err) { + // always errors when user escapes + console.log(success("Watch exited.")) + } +} + const command = new Command(`${CommandWords.PLUGIN}`) .addHelp( "Custom plugins for Budibase, init, build and verify your components and datasources with this tool." @@ -86,5 +108,10 @@ const command = new Command(`${CommandWords.PLUGIN}`) "Build your plugin, this will verify and produce a final tarball for your project.", build ) + .addSubOption( + "--watch", + "Automatically build any changes to your plugin.", + watch + ) exports.command = command diff --git a/packages/cli/src/prebuilds.js b/packages/cli/src/prebuilds.js index ecc59f964a..b8f380a937 100644 --- a/packages/cli/src/prebuilds.js +++ b/packages/cli/src/prebuilds.js @@ -5,7 +5,10 @@ const PREBUILDS = "prebuilds" const ARCH = `${os.platform()}-${os.arch()}` const PREBUILD_DIR = join(process.execPath, "..", PREBUILDS, ARCH) -checkForBinaries() +// running as built CLI pkg bundle +if (!process.argv[0].includes("node")) { + checkForBinaries() +} function checkForBinaries() { const readDir = join(__filename, "..", "..", PREBUILDS, ARCH) diff --git a/packages/cli/yarn.lock b/packages/cli/yarn.lock index 43c219fcd7..72b4bb328e 100644 --- a/packages/cli/yarn.lock +++ b/packages/cli/yarn.lock @@ -43,12 +43,12 @@ "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" -"@budibase/backend-core@^1.2.38": - version "1.2.38" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.38.tgz#9451ae72f6af8cff3aa0a57dc61fc8d3505a77a0" - integrity sha512-g7m4fHG1tLqNsSvdSltqRHLASOH5n3QBbN5DD7cmSBIVpUtDCA0EMx/L0vkDDhTmbOQApXAW3cyJs6H3QiWtOw== +"@budibase/backend-core@1.2.40": + version "1.2.40" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.40.tgz#692062478f310eaee780adbc55e266fc3b6649b6" + integrity sha512-HUw6IQgKkP345vnQcTok6X+inqYe0WpUL7uFJnm3XERvsAWX4FYWbgDoGJGS0+jZjdPjvARkt4+uZuTAEUFLiQ== dependencies: - "@budibase/types" "^1.2.38" + "@budibase/types" "^1.2.40" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -101,10 +101,10 @@ to-gfm-code-block "^0.1.1" year "^0.2.1" -"@budibase/string-templates@^1.2.38": - version "1.2.38" - resolved "https://registry.yarnpkg.com/@budibase/string-templates/-/string-templates-1.2.38.tgz#404804df516fb981b4f073f09bab64c9111cecb0" - integrity sha512-JRIAZVuuBECxDBcbx5FOYRRKi1ZyW7//LwKL5U1r9sIVCIxCW1t5b175oTnR9/bkktNs7X2ziynH/tsT5GVC0g== +"@budibase/string-templates@1.2.40": + version "1.2.40" + resolved "https://registry.yarnpkg.com/@budibase/string-templates/-/string-templates-1.2.40.tgz#d7012b415a51e0119ac098e77d052f96bc04e742" + integrity sha512-Vc/DrmJ//kpT+QoIGqloVnomBJgHVPNIiCOXc+2XSsN5HyR18S8uO7lc77cpln3dTlvNcd7bQqXO1UIx8oebUQ== dependencies: "@budibase/handlebars-helpers" "^0.11.8" dayjs "^1.10.4" @@ -113,10 +113,10 @@ lodash "^4.17.20" vm2 "^3.9.4" -"@budibase/types@^1.2.38": - version "1.2.38" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.38.tgz#472f4ec891242488561a8cfc175961664bc7ac88" - integrity sha512-pMKh4FKhPoa1pge4FKqPi3gbzZp3HJ1RuhM5naKFqC1yompIn/Es+YNft39VC2bTW5tiGbucMcjWzdpMwTSTVw== +"@budibase/types@1.2.40", "@budibase/types@^1.2.40": + version "1.2.40" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.40.tgz#c1456728b61966cab7fe3689bd044bf415faa138" + integrity sha512-eNZFG0C/GBog87y6StKBjdF/aDJJtUHbAM8NWLUNNqTAiMxO2s3XhDN1dE6t74NBCRFzJo2sAD+34pJHhKFanQ== "@eslint/eslintrc@^0.4.3": version "0.4.3" diff --git a/packages/server/src/app.ts b/packages/server/src/app.ts index 6f63715cfb..e9a5661093 100644 --- a/packages/server/src/app.ts +++ b/packages/server/src/app.ts @@ -138,7 +138,12 @@ module.exports = server.listen(env.PORT || 0, async () => { } // monitor plugin directory if required - if (env.SELF_HOSTED && !env.MULTI_TENANCY && env.PLUGINS_DIR && fs.existsSync(env.PLUGINS_DIR)) { + if ( + env.SELF_HOSTED && + !env.MULTI_TENANCY && + env.PLUGINS_DIR && + fs.existsSync(env.PLUGINS_DIR) + ) { const watchPath = path.join(env.PLUGINS_DIR, "./**/dist/*.tar.gz") chokidar .watch(watchPath, { diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index ebfd49ce8b..e39b0b97c4 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,19 +1094,18 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.39-alpha.8": - version "1.2.39-alpha.8" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.39-alpha.8.tgz#70c4d3de7c68feaa3d7b183e4c9cfb1baf3d3d47" - integrity sha512-vBGPIei1qVPmbrHKGD4Swf7ECOWGXV+2buRIOkr0gRawK8oLOXc2xYV1zsDM7jd7rTMwtyF86fL/lhaSkXWwKA== +"@budibase/backend-core@1.2.40": + version "1.2.40" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.40.tgz#692062478f310eaee780adbc55e266fc3b6649b6" + integrity sha512-HUw6IQgKkP345vnQcTok6X+inqYe0WpUL7uFJnm3XERvsAWX4FYWbgDoGJGS0+jZjdPjvARkt4+uZuTAEUFLiQ== dependencies: - "@budibase/types" "1.2.39-alpha.8" + "@budibase/types" "^1.2.40" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" dotenv "16.0.1" emitter-listener "1.1.2" ioredis "4.28.0" - joi "17.6.0" jsonwebtoken "8.5.1" koa-passport "4.1.4" lodash "4.17.21" @@ -1178,13 +1177,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.2.39-alpha.8": - version "1.2.39-alpha.8" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.39-alpha.8.tgz#11433da0dba0e6c81ad93d6cabc5ce165db94e0f" - integrity sha512-1N3FnVPhUwh2KR0IGiN+EjbY3LpF563Ac2FyT/JgyS9wG6NTP0hV/ugA7TZIvkv2XaYroYMYSPBa/wYtWh4xBQ== +"@budibase/pro@1.2.40": + version "1.2.40" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.40.tgz#007cad4d8341698104498ae7d1578a7e26760dd7" + integrity sha512-lGB0/O8l63FtpP1dOzxowFUjgj7SrRSVsODygPB7oScfUBtbqHyZKC4EafrVpJT4A8hbdh1ijQZ8PLJE/YdRkQ== dependencies: - "@budibase/backend-core" "1.2.39-alpha.8" - "@budibase/types" "1.2.39-alpha.8" + "@budibase/backend-core" "1.2.40" + "@budibase/types" "1.2.40" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1207,10 +1206,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.2.39-alpha.8": - version "1.2.39-alpha.8" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.39-alpha.8.tgz#2999dac33da64b41f222d0fe73cfd387957952d9" - integrity sha512-UbknZ3Pnl8tdCPy5XKkuW3OQb1T/L+n1slY8/orm8KpR/TOEhK4Q20JRxENqQo5f9Za8bX4COesLjwAmae426Q== +"@budibase/types@1.2.40", "@budibase/types@^1.2.40": + version "1.2.40" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.40.tgz#c1456728b61966cab7fe3689bd044bf415faa138" + integrity sha512-eNZFG0C/GBog87y6StKBjdF/aDJJtUHbAM8NWLUNNqTAiMxO2s3XhDN1dE6t74NBCRFzJo2sAD+34pJHhKFanQ== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 9b29ca8dc7..9806952df8 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,19 +291,18 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.39-alpha.8": - version "1.2.39-alpha.8" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.39-alpha.8.tgz#70c4d3de7c68feaa3d7b183e4c9cfb1baf3d3d47" - integrity sha512-vBGPIei1qVPmbrHKGD4Swf7ECOWGXV+2buRIOkr0gRawK8oLOXc2xYV1zsDM7jd7rTMwtyF86fL/lhaSkXWwKA== +"@budibase/backend-core@1.2.40": + version "1.2.40" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.40.tgz#692062478f310eaee780adbc55e266fc3b6649b6" + integrity sha512-HUw6IQgKkP345vnQcTok6X+inqYe0WpUL7uFJnm3XERvsAWX4FYWbgDoGJGS0+jZjdPjvARkt4+uZuTAEUFLiQ== dependencies: - "@budibase/types" "1.2.39-alpha.8" + "@budibase/types" "^1.2.40" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" dotenv "16.0.1" emitter-listener "1.1.2" ioredis "4.28.0" - joi "17.6.0" jsonwebtoken "8.5.1" koa-passport "4.1.4" lodash "4.17.21" @@ -325,21 +324,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.2.39-alpha.8": - version "1.2.39-alpha.8" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.39-alpha.8.tgz#11433da0dba0e6c81ad93d6cabc5ce165db94e0f" - integrity sha512-1N3FnVPhUwh2KR0IGiN+EjbY3LpF563Ac2FyT/JgyS9wG6NTP0hV/ugA7TZIvkv2XaYroYMYSPBa/wYtWh4xBQ== +"@budibase/pro@1.2.40": + version "1.2.40" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.40.tgz#007cad4d8341698104498ae7d1578a7e26760dd7" + integrity sha512-lGB0/O8l63FtpP1dOzxowFUjgj7SrRSVsODygPB7oScfUBtbqHyZKC4EafrVpJT4A8hbdh1ijQZ8PLJE/YdRkQ== dependencies: - "@budibase/backend-core" "1.2.39-alpha.8" - "@budibase/types" "1.2.39-alpha.8" + "@budibase/backend-core" "1.2.40" + "@budibase/types" "1.2.40" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.2.39-alpha.8": - version "1.2.39-alpha.8" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.39-alpha.8.tgz#2999dac33da64b41f222d0fe73cfd387957952d9" - integrity sha512-UbknZ3Pnl8tdCPy5XKkuW3OQb1T/L+n1slY8/orm8KpR/TOEhK4Q20JRxENqQo5f9Za8bX4COesLjwAmae426Q== +"@budibase/types@1.2.40", "@budibase/types@^1.2.40": + version "1.2.40" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.40.tgz#c1456728b61966cab7fe3689bd044bf415faa138" + integrity sha512-eNZFG0C/GBog87y6StKBjdF/aDJJtUHbAM8NWLUNNqTAiMxO2s3XhDN1dE6t74NBCRFzJo2sAD+34pJHhKFanQ== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 9b20e91eb2e45b2e8b366c03ee68020a209db6ed Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 17 Aug 2022 09:21:36 +0100 Subject: [PATCH 045/260] Update vite config to work properly with all defaults --- packages/builder/vite.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/vite.config.js b/packages/builder/vite.config.js index 20ff93831c..ad58b472dd 100644 --- a/packages/builder/vite.config.js +++ b/packages/builder/vite.config.js @@ -13,7 +13,7 @@ export default defineConfig(({ mode }) => { strict: false, }, hmr: { - protocol: "wss", + protocol: env.VITE_HMR_PROTOCOL || "ws", clientPort: env.VITE_HMR_CLIENT_PORT || 3000, path: env.VITE_HMR_PATH || "/", }, From 2aaff7576bcf201ea522fb96054d4ebfb603969a Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 17 Aug 2022 10:05:13 +0100 Subject: [PATCH 046/260] Adding full flow for creating custom datasource. --- .../modals/CreateDatasourceModal.svelte | 3 +++ .../modals/DatasourceConfigModal.svelte | 5 ++++- packages/server/src/integrations/index.ts | 16 ++++++++++++-- .../server/src/utilities/fileSystem/index.js | 22 +++++++++++++++++++ 4 files changed, 43 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte index 2d5e6976bf..33953493f6 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte @@ -49,6 +49,9 @@ schema: selected.datasource, auth: selected.auth, } + if (selected.friendlyName) { + integration.name = selected.friendlyName + } checkShowImport() } diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte index 0aaa2b201d..ecfd838b16 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte @@ -14,6 +14,9 @@ let datasource = cloneDeep(integration) let skipFetch = false + $: name = + IntegrationNames[datasource.type] || datasource.name || datasource.type + async function saveDatasource() { try { const resp = await save(datasource, skipFetch) @@ -32,7 +35,7 @@ saveDatasource()} onCancel={() => modal.show()} confirmText={datasource.plus diff --git a/packages/server/src/integrations/index.ts b/packages/server/src/integrations/index.ts index bf267e46cc..b9523061a4 100644 --- a/packages/server/src/integrations/index.ts +++ b/packages/server/src/integrations/index.ts @@ -15,6 +15,7 @@ import redis from "./redis" import snowflake from "./snowflake" import { getPlugins } from "../api/controllers/plugin" import { SourceName, Integration, PluginType } from "@budibase/types" +import { getDatasourcePlugin } from "../utilities/fileSystem" const environment = require("../environment") const { cloneDeep } = require("lodash") @@ -65,6 +66,8 @@ if (environment.SELF_HOSTED) { DEFINITIONS[SourceName.GOOGLE_SHEETS] = googlesheets.schema } +function isIntegrationAvailable(integration: string) {} + module.exports = { getDefinitions: async () => { const plugins = await getPlugins(PluginType.DATASOURCE) @@ -82,7 +85,16 @@ module.exports = { ...pluginSchemas, } }, - getIntegration: async () => { - return INTEGRATIONS + getIntegration: async (integration: string) => { + if (INTEGRATIONS[integration]) { + return INTEGRATIONS[integration] + } + const plugins = await getPlugins(PluginType.DATASOURCE) + for (let plugin of plugins) { + if (plugin.name === integration) { + // need to use commonJS require due to its dynamic runtime nature + return getDatasourcePlugin(plugin.name, plugin.jsUrl) + } + } }, } diff --git a/packages/server/src/utilities/fileSystem/index.js b/packages/server/src/utilities/fileSystem/index.js index 94c5a92375..9b124d6c29 100644 --- a/packages/server/src/utilities/fileSystem/index.js +++ b/packages/server/src/utilities/fileSystem/index.js @@ -26,9 +26,11 @@ const { const MemoryStream = require("memorystream") const { getAppId } = require("@budibase/backend-core/context") const tar = require("tar") +const fetch = require("node-fetch") const TOP_LEVEL_PATH = join(__dirname, "..", "..", "..") const NODE_MODULES_PATH = join(TOP_LEVEL_PATH, "node_modules") +const DATASOURCE_PATH = join(budibaseTempDir(), "datasource") /** * The single stack system (Cloud and Builder) should not make use of the file system where possible, @@ -348,6 +350,26 @@ exports.extractPluginTarball = async file => { return { metadata, directory: path } } +exports.getDatasourcePlugin = async (name, url) => { + if (!fs.existsSync(DATASOURCE_PATH)) { + fs.mkdirSync(DATASOURCE_PATH) + } + const filename = join(DATASOURCE_PATH, name) + if (fs.existsSync(filename)) { + return require(filename) + } + const response = fetch(url) + if (response.status === 200) { + const content = await response.text() + fs.writeFileSync(filename, content) + require(filename) + } else { + throw new Error( + `Unable to retrieve plugin - reason: ${await response.text()}` + ) + } +} + /** * Full function definition for below can be found in the utilities. */ From ee4f72126ad2f3b96b83af4dea6234040d818b09 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 17 Aug 2022 10:46:17 +0100 Subject: [PATCH 047/260] Updating custom datasource SVG - splitting out in UI. --- .../_components/DatasourceCard.svelte | 73 +++++++++++++++++++ .../DatasourceNavigator/icons/Custom.svelte | 57 ++++++++------- .../modals/CreateDatasourceModal.svelte | 45 +++++------- 3 files changed, 122 insertions(+), 53 deletions(-) create mode 100644 packages/builder/src/components/backend/DatasourceNavigator/_components/DatasourceCard.svelte diff --git a/packages/builder/src/components/backend/DatasourceNavigator/_components/DatasourceCard.svelte b/packages/builder/src/components/backend/DatasourceNavigator/_components/DatasourceCard.svelte new file mode 100644 index 0000000000..2dac2fec79 --- /dev/null +++ b/packages/builder/src/components/backend/DatasourceNavigator/_components/DatasourceCard.svelte @@ -0,0 +1,73 @@ + + +
dispatcher("selected", integrationType)} + class="item hoverable" +> +
+ +
+ {schema.friendlyName} + {#if schema.type} + {schema.type || ""} + {/if} +
+
+
+ + diff --git a/packages/builder/src/components/backend/DatasourceNavigator/icons/Custom.svelte b/packages/builder/src/components/backend/DatasourceNavigator/icons/Custom.svelte index 354b7a3358..0d4b7219aa 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/icons/Custom.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/icons/Custom.svelte @@ -1,8 +1,6 @@ - - - - - - + + + + + diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte index 33953493f6..945cd574d8 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte @@ -18,6 +18,7 @@ import { createRestDatasource } from "builderStore/datasource" import { goto } from "@roxi/routify" import ImportRestQueriesModal from "./ImportRestQueriesModal.svelte" + import DatasourceCard from "../_components/DatasourceCard.svelte" export let modal let integrations = {} @@ -95,14 +96,6 @@ } integrations = newIntegrations } - - function getIcon(integrationType, schema) { - if (schema.custom) { - return ICONS.CUSTOM - } else { - return ICONS[integrationType] - } - } @@ -161,28 +154,24 @@ Connect to an external data source
- {#each Object.entries(integrations).filter(([key]) => key !== IntegrationTypes.INTERNAL) as [integrationType, schema]} -
selectIntegration(integrationType)} - class="item hoverable" - > -
- -
- {schema.friendlyName} - {#if schema.type} - {schema.type || ""} - {/if} -
-
-
+ {#each Object.entries(integrations).filter(([key, val]) => key !== IntegrationTypes.INTERNAL && !val.custom) as [integrationType, schema]} + selectIntegration(evt.detail)} + {schema} + bind:integrationType + {integration} + /> {/each}
+ Custom data source + {#each Object.entries(integrations).filter(entry => entry[1].custom) as [integrationType, schema]} + selectIntegration(evt.detail)} + {schema} + bind:integrationType + {integration} + /> + {/each}
From b6a5ccbf1001b04215400a0e5581b0bd3f6d2cf3 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 17 Aug 2022 11:01:25 +0100 Subject: [PATCH 048/260] Adding some controls around datasource config creation and updating minio fetch. --- .../DatasourceNavigator/modals/DatasourceConfigModal.svelte | 3 +++ packages/server/src/utilities/fileSystem/index.js | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte index ecfd838b16..c8a5bc96eb 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte @@ -19,6 +19,9 @@ async function saveDatasource() { try { + if (!datasource.name) { + datasource.name = name + } const resp = await save(datasource, skipFetch) $goto(`./datasource/${resp._id}`) notifications.success(`Datasource updated successfully.`) diff --git a/packages/server/src/utilities/fileSystem/index.js b/packages/server/src/utilities/fileSystem/index.js index 9b124d6c29..d65ee48f05 100644 --- a/packages/server/src/utilities/fileSystem/index.js +++ b/packages/server/src/utilities/fileSystem/index.js @@ -17,6 +17,7 @@ const { downloadTarball, } = require("./utilities") const { updateClientLibrary } = require("./clientLibrary") +const { checkSlashesInUrl } = require("../") const env = require("../../environment") const { USER_METDATA_PREFIX, @@ -358,7 +359,7 @@ exports.getDatasourcePlugin = async (name, url) => { if (fs.existsSync(filename)) { return require(filename) } - const response = fetch(url) + const response = await fetch(checkSlashesInUrl(`${env.MINIO_URL}/${url}`)) if (response.status === 200) { const content = await response.text() fs.writeFileSync(filename, content) From fb510907523c20d09f8e7b66581899265868d86a Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Wed, 17 Aug 2022 18:16:11 +0100 Subject: [PATCH 049/260] Allow list of named tables to be fetched --- .../PlusConfigForm.svelte | 19 ++++++++++++++++++- .../builder/src/stores/backend/datasources.js | 7 +++++-- packages/frontend-core/src/api/datasources.js | 6 +++++- .../server/src/api/controllers/datasource.js | 17 ++++++++++++++--- 4 files changed, 42 insertions(+), 7 deletions(-) diff --git a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/PlusConfigForm.svelte b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/PlusConfigForm.svelte index cd19523476..b81e818d5f 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/PlusConfigForm.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/PlusConfigForm.svelte @@ -8,6 +8,7 @@ notifications, Modal, Table, + Toggle, } from "@budibase/bbui" import { datasources, integrations, tables } from "stores/backend" import CreateEditRelationship from "components/backend/Datasources/CreateEditRelationship.svelte" @@ -15,6 +16,7 @@ import ArrayRenderer from "components/common/renderers/ArrayRenderer.svelte" import ConfirmDialog from "components/common/ConfirmDialog.svelte" import { goto } from "@roxi/routify" + import ValuesList from "components/common/ValuesList.svelte" export let datasource export let save @@ -31,6 +33,8 @@ let createExternalTableModal let selectedFromRelationship, selectedToRelationship let confirmDialog + let specificTables = null + let requireSpecificTables = false $: integration = datasource && $integrations[datasource.source] $: plusTables = datasource?.plus @@ -87,7 +91,7 @@ async function updateDatasourceSchema() { try { - await datasources.updateSchema(datasource) + await datasources.updateSchema(datasource, specificTables) notifications.success(`Datasource ${name} tables updated successfully.`) await tables.fetch() } catch (error) { @@ -150,6 +154,19 @@ warning={false} title="Confirm table fetch" > + { + requireSpecificTables = e.detail + specificTables = null + }} + thin + text="Fetch listed tables only (one per line)" + /> + {#if requireSpecificTables} + + {/if} +
If you have fetched tables from this database before, this action may overwrite any changes you made after your initial fetch. diff --git a/packages/builder/src/stores/backend/datasources.js b/packages/builder/src/stores/backend/datasources.js index 2423394c6a..07aeab1921 100644 --- a/packages/builder/src/stores/backend/datasources.js +++ b/packages/builder/src/stores/backend/datasources.js @@ -62,8 +62,11 @@ export function createDatasourcesStore() { unselect: () => { update(state => ({ ...state, selected: null })) }, - updateSchema: async datasource => { - const response = await API.buildDatasourceSchema(datasource?._id) + updateSchema: async (datasource, tablesFilter) => { + const response = await API.buildDatasourceSchema({ + datasourceId: datasource?._id, + tablesFilter, + }) return await updateDatasource(response) }, save: async (body, fetchSchema = false) => { diff --git a/packages/frontend-core/src/api/datasources.js b/packages/frontend-core/src/api/datasources.js index ff72fbf25b..eda7b3c860 100644 --- a/packages/frontend-core/src/api/datasources.js +++ b/packages/frontend-core/src/api/datasources.js @@ -11,10 +11,14 @@ export const buildDatasourceEndpoints = API => ({ /** * Prompts the server to build the schema for a datasource. * @param datasourceId the datasource ID to build the schema for + * @param tablesFilter list of specific table names to be build the schema */ - buildDatasourceSchema: async datasourceId => { + buildDatasourceSchema: async ({ datasourceId, tablesFilter }) => { return await API.post({ url: `/api/datasources/${datasourceId}/schema`, + body: { + tablesFilter, + }, }) }, diff --git a/packages/server/src/api/controllers/datasource.js b/packages/server/src/api/controllers/datasource.js index 8b9b765a5f..75fd1db02a 100644 --- a/packages/server/src/api/controllers/datasource.js +++ b/packages/server/src/api/controllers/datasource.js @@ -50,9 +50,21 @@ exports.fetch = async function (ctx) { exports.buildSchemaFromDb = async function (ctx) { const db = getAppDB() const datasource = await db.get(ctx.params.datasourceId) + const tablesFilter = ctx.request.body.tablesFilter - const { tables, error } = await buildSchemaHelper(datasource) - datasource.entities = tables + let { tables, error } = await buildSchemaHelper(datasource) + if (tablesFilter) { + if (!datasource.entities) { + datasource.entities = {} + } + for (let key in tables) { + if (tablesFilter.includes(key)) { + datasource.entities[key] = tables[key] + } + } + } else { + datasource.entities = tables + } const dbResp = await db.put(datasource) datasource._rev = dbResp.rev @@ -223,7 +235,6 @@ const buildSchemaHelper = async datasource => { // Connect to the DB and build the schema const connector = new Connector(datasource.config) await connector.buildSchema(datasource._id, datasource.entities) - datasource.entities = connector.tables // make sure they all have a display name selected for (let entity of Object.values(datasource.entities)) { From 7dfe049ae679e8be98f6717d17d4d396aca0e1d0 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 17 Aug 2022 23:13:51 +0100 Subject: [PATCH 050/260] Adding full builder integration of custom components - splitting into own section properly - fixing some issues with SVG class overlap. --- .../builder/src/builderStore/datasource.js | 2 +- .../DatasourceNavigator.svelte | 4 ++-- .../_components/DatasourceCard.svelte | 10 +--------- .../DatasourceNavigator/icons/Custom.svelte | 18 ++++++++++++------ .../backend/DatasourceNavigator/icons/index.js | 12 +++++++++++- .../app/[application]/data/_layout.svelte | 4 +++- .../server/src/utilities/fileSystem/index.js | 5 ++++- 7 files changed, 34 insertions(+), 21 deletions(-) diff --git a/packages/builder/src/builderStore/datasource.js b/packages/builder/src/builderStore/datasource.js index 804d88bad6..84edcdd6ad 100644 --- a/packages/builder/src/builderStore/datasource.js +++ b/packages/builder/src/builderStore/datasource.js @@ -9,7 +9,7 @@ function prepareData(config) { ds => ds.source === config.type ).length - let baseName = IntegrationNames[config.type] + let baseName = IntegrationNames[config.type] || config.name let name = existingTypeCount === 0 ? baseName : `${baseName}-${existingTypeCount + 1}` diff --git a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte index 9faf00a199..6235e52916 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte @@ -13,7 +13,7 @@ customQueryIconColor, customQueryText, } from "helpers/data/utils" - import ICONS from "./icons" + import { getIcon } from "./icons" import { notifications } from "@budibase/bbui" let openDataSources = [] @@ -124,7 +124,7 @@ >
diff --git a/packages/builder/src/components/backend/DatasourceNavigator/_components/DatasourceCard.svelte b/packages/builder/src/components/backend/DatasourceNavigator/_components/DatasourceCard.svelte index 2dac2fec79..6dffc70a63 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/_components/DatasourceCard.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/_components/DatasourceCard.svelte @@ -1,21 +1,13 @@
- + - + {#if modal} + + {/if}
diff --git a/packages/server/src/utilities/fileSystem/index.js b/packages/server/src/utilities/fileSystem/index.js index d65ee48f05..f937f172b5 100644 --- a/packages/server/src/utilities/fileSystem/index.js +++ b/packages/server/src/utilities/fileSystem/index.js @@ -359,7 +359,10 @@ exports.getDatasourcePlugin = async (name, url) => { if (fs.existsSync(filename)) { return require(filename) } - const response = await fetch(checkSlashesInUrl(`${env.MINIO_URL}/${url}`)) + const fullUrl = checkSlashesInUrl( + `${env.MINIO_URL}/${ObjectStoreBuckets.PLUGINS}/${url}` + ) + const response = await fetch(fullUrl) if (response.status === 200) { const content = await response.text() fs.writeFileSync(filename, content) From 2f23de7b3a7f9b2de1523089e1e534a7914e8676 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 17 Aug 2022 23:17:10 +0100 Subject: [PATCH 051/260] Fixing issue with single custom datasource being full width in creation modal. --- .../modals/CreateDatasourceModal.svelte | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte index 945cd574d8..a500c6a5b3 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte @@ -164,14 +164,16 @@ {/each}
Custom data source - {#each Object.entries(integrations).filter(entry => entry[1].custom) as [integrationType, schema]} - selectIntegration(evt.detail)} - {schema} - bind:integrationType - {integration} - /> - {/each} +
+ {#each Object.entries(integrations).filter(entry => entry[1].custom) as [integrationType, schema]} + selectIntegration(evt.detail)} + {schema} + bind:integrationType + {integration} + /> + {/each} +
@@ -179,7 +181,7 @@ diff --git a/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte b/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte new file mode 100644 index 0000000000..3a92a699e6 --- /dev/null +++ b/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte @@ -0,0 +1,81 @@ + + +
+
+
+
+ +
+
+ + {plugin.name} + + +
{plugin.schema.type}
+
+
+
+
+
{plugin.source || "-"}
+
{plugin.author || "-"}
+
{plugin.version}
+ +
+
+ + + + + plugins.deletePlugin(plugin._id, plugin._rev)} + icon="Delete">Delete + editGroup(plugin)} icon="Edit">Edit + +
+
+
+ + diff --git a/packages/builder/src/pages/builder/portal/manage/plugins/index.svelte b/packages/builder/src/pages/builder/portal/manage/plugins/index.svelte new file mode 100644 index 0000000000..61227786b0 --- /dev/null +++ b/packages/builder/src/pages/builder/portal/manage/plugins/index.svelte @@ -0,0 +1,94 @@ + + + + +
+ Plugins +
+ Add your own custom datasources and components + +
+ +
+
+ +
+
+
+ @@ -61,7 +98,7 @@
- +
{#each authOptions[sourceValue] as option} {#if option === "Upload"} @@ -82,7 +119,7 @@ {:else}
- +
{/if} {/each} diff --git a/packages/builder/src/stores/portal/plugins.js b/packages/builder/src/stores/portal/plugins.js index 6a1d7cc2cb..531ac1c396 100644 --- a/packages/builder/src/stores/portal/plugins.js +++ b/packages/builder/src/stores/portal/plugins.js @@ -17,6 +17,41 @@ export function createPluginsStore() { }) } + async function createPlugin(type, source, name, url, auth) { + let pluginData = { + type, + source, + name, + url, + } + + switch (source) { + case "github": + pluginData.githubToken = auth + break + case "url": + pluginData.header = auth + break + case "npm": + pluginData.npmToken = auth + break + } + + let resp = await API.createPlugin(pluginData) + console.log(resp) + // TODO_RIC + // let newPlugin = resp.plugins[0] + // update(state => { + // const currentIdx = state.findIndex(plugin => plugin._id === newPlugin._id) + // if (currentIdx >= 0) { + // state.splice(currentIdx, 1, newPlugin) + // } else { + // state.push(newPlugin) + // } + // return state + // }) + } + async function uploadPlugin(file, source) { let data = new FormData() data.append("file", file) @@ -35,6 +70,7 @@ export function createPluginsStore() { return { subscribe, load, + createPlugin, deletePlugin, uploadPlugin, } diff --git a/packages/frontend-core/src/api/plugins.js b/packages/frontend-core/src/api/plugins.js index 108e1b50a7..484cf763bb 100644 --- a/packages/frontend-core/src/api/plugins.js +++ b/packages/frontend-core/src/api/plugins.js @@ -11,6 +11,16 @@ export const buildPluginEndpoints = API => ({ }) }, + /** + * Creates a plugin from URL, Github or NPM + */ + createPlugin: async data => { + return await API.post({ + url: `/api/plugin`, + body: data, + }) + }, + /** * Gets a list of all plugins */ diff --git a/packages/server/src/api/controllers/plugin.ts b/packages/server/src/api/controllers/plugin.ts index e8a2dd1746..b6d3d31354 100644 --- a/packages/server/src/api/controllers/plugin.ts +++ b/packages/server/src/api/controllers/plugin.ts @@ -1,5 +1,9 @@ import { ObjectStoreBuckets } from "../../constants" -import { extractPluginTarball } from "../../utilities/fileSystem" +import { + extractPluginTarball, + npmPlugin, + getPluginMetadata, +} from "../../utilities/fileSystem" import { getGlobalDB } from "@budibase/backend-core/tenancy" import { generatePluginID, getPluginParams } from "../../db/utils" import { uploadDirectory } from "@budibase/backend-core/objectStore" @@ -39,10 +43,48 @@ export async function upload(ctx: any) { } } catch (err: any) { const errMsg = err?.message ? err?.message : err + ctx.throw(400, `Failed to import plugin: ${errMsg}`) } } +export async function create(ctx: any) { + const { type, source, name, url, header, githubToken, npmToken } = + ctx.request.body + let metadata + let directory + + switch (source) { + case "npm": + // const { metadata: metadataNpm, directory: directoryNpm } = await npmPlugin(url, name) + // metadata = metadataNpm + // directory = directoryNpm + + console.log(22222, await getPluginMetadata(await npmPlugin(url, name))) + break + case "github": + console.log("github") + break + case "url": + console.log("url") + break + } + + // try { + // const doc = storePlugin(metadata, directory, source) + // + // ctx.body = { + // message: "Plugin uploaded successfully", + // plugins: doc, + // } + // } catch (err: any) { + // const errMsg = err?.message ? err?.message : err + // + // ctx.throw(400, `Failed to import plugin: ${errMsg}`) + // } + ctx.status = 200 +} + export async function fetch(ctx: any) { ctx.body = await getPlugins() } @@ -54,9 +96,12 @@ export async function destroy(ctx: any) { ctx.status = 200 } -export async function processPlugin(plugin: FileType, source?: string) { +export async function storePlugin( + metadata: any, + directory: any, + source?: string +) { const db = getGlobalDB() - const { metadata, directory } = await extractPluginTarball(plugin) const version = metadata.package.version, name = metadata.package.name, description = metadata.package.description @@ -99,3 +144,8 @@ export async function processPlugin(plugin: FileType, source?: string) { _rev: response.rev, } } + +export async function processPlugin(plugin: FileType, source?: string) { + const { metadata, directory } = await extractPluginTarball(plugin) + return await storePlugin(metadata, directory, source) +} diff --git a/packages/server/src/api/routes/plugin.ts b/packages/server/src/api/routes/plugin.ts index 1ca49cf300..2508115a29 100644 --- a/packages/server/src/api/routes/plugin.ts +++ b/packages/server/src/api/routes/plugin.ts @@ -7,6 +7,7 @@ const router = new Router() router .post("/api/plugin/upload/:source", authorized(BUILDER), controller.upload) + .post("/api/plugin", authorized(BUILDER), controller.create) .get("/api/plugin", authorized(BUILDER), controller.fetch) .delete( "/api/plugin/:pluginId/:pluginRev", diff --git a/packages/server/src/utilities/fileSystem/index.js b/packages/server/src/utilities/fileSystem/index.js index 821e905fbc..9c70edf8a6 100644 --- a/packages/server/src/utilities/fileSystem/index.js +++ b/packages/server/src/utilities/fileSystem/index.js @@ -1,6 +1,9 @@ const { budibaseTempDir } = require("../budibaseDir") const fs = require("fs") const { join } = require("path") +// const { promisify } = require("util") +// const exec = promisify(require("child_process").exec) +// const streamPipeline = promisify(require("stream")) const uuid = require("uuid/v4") const { doWithDB, @@ -29,6 +32,7 @@ const MemoryStream = require("memorystream") const { getAppId } = require("@budibase/backend-core/context") const tar = require("tar") const fetch = require("node-fetch") +// const fileType = require("file-type") const TOP_LEVEL_PATH = join(__dirname, "..", "..", "..") const NODE_MODULES_PATH = join(TOP_LEVEL_PATH, "node_modules") @@ -326,11 +330,11 @@ exports.cleanup = appIds => { } } -exports.extractPluginTarball = async file => { - if (!file.name.endsWith(".tar.gz")) { +const extractPluginTarball = async (file, ext = ".tar.gz") => { + if (!file.name.endsWith(ext)) { throw new Error("Plugin must be compressed into a gzipped tarball.") } - const path = join(budibaseTempDir(), file.name.split(".tar.gz")[0]) + const path = join(budibaseTempDir(), file.name.split(ext)[0]) // remove old tmp directories automatically - don't combine if (fs.existsSync(path)) { fs.rmSync(path, { recursive: true, force: true }) @@ -340,6 +344,63 @@ exports.extractPluginTarball = async file => { file: file.path, C: path, }) + + return await getPluginMetadata(path) +} +exports.extractPluginTarball = extractPluginTarball + +exports.npmPlugin = async (url, name = "") => { + let npmTarball = url + let filename = name + let path = join(budibaseTempDir(), name) + + if (!npmTarball.includes(".tgz")) { + const npmPackageURl = url.replace( + "https://www.npmjs.com/package/", + "https://registry.npmjs.org/" + ) + const response = await fetch(npmPackageURl) + if (response.status === 200) { + let npmDetails = await response.json() + filename = npmDetails.name + path = join(budibaseTempDir(), filename) + const npmVersion = npmDetails["dist-tags"].latest + npmTarball = npmDetails.versions[npmVersion].dist.tarball + } else { + throw "Cannot get package details" + } + } + + try { + if (fs.existsSync(path)) { + fs.rmSync(path, { recursive: true, force: true }) + } + fs.mkdirSync(path) + + const response = await fetch(npmTarball) + if (!response.ok) + throw new Error(`Loading NPM plugin failed ${response.statusText}`) + + // const dest = fs.createWriteStream(`${path}/${filename}.tgz`) + await response.body.pipe( + await tar.x({ + strip: 1, + C: path, + }) + ) + + // const readStream = fs.createReadStream(`${path}/${filename}.tgz`) + // readStream.pipe( + + // ) + } catch (e) { + throw `Cannot store package locally: ${e.message}` + } + + return path +} + +const getPluginMetadata = async path => { let metadata = {} try { const pkg = fs.readFileSync(join(path, "package.json"), "utf8") @@ -349,8 +410,10 @@ exports.extractPluginTarball = async file => { } catch (err) { throw new Error("Unable to process schema.json/package.json in plugin.") } + return { metadata, directory: path } } +exports.getPluginMetadata = getPluginMetadata exports.getDatasourcePlugin = async (name, url, hash) => { if (!fs.existsSync(DATASOURCE_PATH)) { From 0e2a86460ce37ea331a3f3e519767a3e0714e788 Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Wed, 31 Aug 2022 16:09:47 +0100 Subject: [PATCH 068/260] uploading npm and url plugins --- .../plugins/_components/AddPluginModal.svelte | 16 ++---- packages/builder/src/stores/portal/plugins.js | 11 ++--- packages/server/src/api/controllers/plugin.ts | 45 ++++++++--------- .../server/src/utilities/fileSystem/index.js | 49 +++++++++++-------- 4 files changed, 60 insertions(+), 61 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte b/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte index e45655d20d..1fce6746ad 100644 --- a/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte +++ b/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte @@ -11,10 +11,10 @@ import { plugins } from "stores/portal" let authOptions = { - NPM: ["NPM Token", "URL"], + NPM: ["URL"], Github: ["Github Token", "URL"], - URL: ["Header", "URL"], - File: ["Path", "Header"], + URL: ["Headers", "URL"], + File: ["Path", "Headers"], Upload: ["Upload"], } let file @@ -50,17 +50,11 @@ source, nameValue, url, - dynamicValues["Header"] + dynamicValues["Headers"] ) break case "npm": - await plugins.createPlugin( - typeValue, - source, - nameValue, - url, - dynamicValues["NPM Token"] - ) + await plugins.createPlugin(typeValue, source, nameValue, url) break } } diff --git a/packages/builder/src/stores/portal/plugins.js b/packages/builder/src/stores/portal/plugins.js index 531ac1c396..4e3d952fe3 100644 --- a/packages/builder/src/stores/portal/plugins.js +++ b/packages/builder/src/stores/portal/plugins.js @@ -17,7 +17,7 @@ export function createPluginsStore() { }) } - async function createPlugin(type, source, name, url, auth) { + async function createPlugin(type, source, name, url, auth = null) { let pluginData = { type, source, @@ -26,19 +26,16 @@ export function createPluginsStore() { } switch (source) { - case "github": - pluginData.githubToken = auth - break case "url": - pluginData.header = auth + pluginData.headers = auth break case "npm": pluginData.npmToken = auth break } - let resp = await API.createPlugin(pluginData) - console.log(resp) + let res = await API.createPlugin(pluginData) + console.log("RESP", res) // TODO_RIC // let newPlugin = resp.plugins[0] // update(state => { diff --git a/packages/server/src/api/controllers/plugin.ts b/packages/server/src/api/controllers/plugin.ts index b6d3d31354..dc70ea8b62 100644 --- a/packages/server/src/api/controllers/plugin.ts +++ b/packages/server/src/api/controllers/plugin.ts @@ -1,8 +1,8 @@ import { ObjectStoreBuckets } from "../../constants" import { extractPluginTarball, - npmPlugin, - getPluginMetadata, + createNpmPlugin, + createUrlPlugin, } from "../../utilities/fileSystem" import { getGlobalDB } from "@budibase/backend-core/tenancy" import { generatePluginID, getPluginParams } from "../../db/utils" @@ -49,39 +49,40 @@ export async function upload(ctx: any) { } export async function create(ctx: any) { - const { type, source, name, url, header, githubToken, npmToken } = - ctx.request.body + const { type, source, name, url, headers, githubToken } = ctx.request.body let metadata let directory switch (source) { case "npm": - // const { metadata: metadataNpm, directory: directoryNpm } = await npmPlugin(url, name) - // metadata = metadataNpm - // directory = directoryNpm - - console.log(22222, await getPluginMetadata(await npmPlugin(url, name))) + const { metadata: metadataNpm, directory: directoryNpm } = + await createNpmPlugin(url, name) + metadata = metadataNpm + directory = directoryNpm break case "github": console.log("github") break case "url": - console.log("url") + const { metadata: metadataUrl, directory: directoryUrl } = + await createUrlPlugin(url, name, headers) + metadata = metadataUrl + directory = directoryUrl break } - // try { - // const doc = storePlugin(metadata, directory, source) - // - // ctx.body = { - // message: "Plugin uploaded successfully", - // plugins: doc, - // } - // } catch (err: any) { - // const errMsg = err?.message ? err?.message : err - // - // ctx.throw(400, `Failed to import plugin: ${errMsg}`) - // } + try { + const doc = storePlugin(metadata, directory, source) + + ctx.body = { + message: "Plugin uploaded successfully", + plugins: doc, + } + } catch (err: any) { + const errMsg = err?.message ? err?.message : err + + ctx.throw(400, `Failed to import plugin: ${errMsg}`) + } ctx.status = 200 } diff --git a/packages/server/src/utilities/fileSystem/index.js b/packages/server/src/utilities/fileSystem/index.js index 9c70edf8a6..710e3c0294 100644 --- a/packages/server/src/utilities/fileSystem/index.js +++ b/packages/server/src/utilities/fileSystem/index.js @@ -1,9 +1,8 @@ const { budibaseTempDir } = require("../budibaseDir") const fs = require("fs") const { join } = require("path") -// const { promisify } = require("util") -// const exec = promisify(require("child_process").exec) -// const streamPipeline = promisify(require("stream")) +const { promisify } = require("util") +const streamPipeline = promisify(require("stream").pipeline) const uuid = require("uuid/v4") const { doWithDB, @@ -32,7 +31,6 @@ const MemoryStream = require("memorystream") const { getAppId } = require("@budibase/backend-core/context") const tar = require("tar") const fetch = require("node-fetch") -// const fileType = require("file-type") const TOP_LEVEL_PATH = join(__dirname, "..", "..", "..") const NODE_MODULES_PATH = join(TOP_LEVEL_PATH, "node_modules") @@ -349,10 +347,9 @@ const extractPluginTarball = async (file, ext = ".tar.gz") => { } exports.extractPluginTarball = extractPluginTarball -exports.npmPlugin = async (url, name = "") => { +exports.createNpmPlugin = async (url, name = "") => { let npmTarball = url - let filename = name - let path = join(budibaseTempDir(), name) + let pluginName = name if (!npmTarball.includes(".tgz")) { const npmPackageURl = url.replace( @@ -362,8 +359,7 @@ exports.npmPlugin = async (url, name = "") => { const response = await fetch(npmPackageURl) if (response.status === 200) { let npmDetails = await response.json() - filename = npmDetails.name - path = join(budibaseTempDir(), filename) + pluginName = npmDetails.name const npmVersion = npmDetails["dist-tags"].latest npmTarball = npmDetails.versions[npmVersion].dist.tarball } else { @@ -371,36 +367,47 @@ exports.npmPlugin = async (url, name = "") => { } } + return await downloadUnzipPlugin(pluginName, npmTarball) +} + +exports.createUrlPlugin = async (url, name = "", headers = {}) => { + if (!url.includes(".tgz") && !url.includes(".tar.gz")) { + throw new Error("Plugin must be compressed into a gzipped tarball.") + } + + return await downloadUnzipPlugin(name, url, headers) +} + +const downloadUnzipPlugin = async (name, url, headers = {}) => { + console.log(name, url, headers) + const path = join(budibaseTempDir(), name) try { + // Remove first if exists if (fs.existsSync(path)) { fs.rmSync(path, { recursive: true, force: true }) } fs.mkdirSync(path) - const response = await fetch(npmTarball) + const response = await fetch(url, { headers }) if (!response.ok) throw new Error(`Loading NPM plugin failed ${response.statusText}`) - // const dest = fs.createWriteStream(`${path}/${filename}.tgz`) - await response.body.pipe( - await tar.x({ + await streamPipeline( + response.body, + tar.x({ strip: 1, C: path, }) ) - - // const readStream = fs.createReadStream(`${path}/${filename}.tgz`) - // readStream.pipe( - - // ) + return await getPluginMetadata(path) } catch (e) { - throw `Cannot store package locally: ${e.message}` + throw `Cannot store plugin locally: ${e.message}` } - - return path } +exports.downloadUnzipPlugin = downloadUnzipPlugin const getPluginMetadata = async path => { + console.log(path) let metadata = {} try { const pkg = fs.readFileSync(join(path, "package.json"), "utf8") From 6daa49927ed4e58bcdefe94bba6b64bd9c0a3335 Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Wed, 31 Aug 2022 17:53:00 +0100 Subject: [PATCH 069/260] plugins npm and url working --- packages/builder/src/stores/portal/plugins.js | 22 +++++++++---------- packages/server/src/api/controllers/plugin.ts | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/builder/src/stores/portal/plugins.js b/packages/builder/src/stores/portal/plugins.js index 4e3d952fe3..a498bf663a 100644 --- a/packages/builder/src/stores/portal/plugins.js +++ b/packages/builder/src/stores/portal/plugins.js @@ -36,17 +36,17 @@ export function createPluginsStore() { let res = await API.createPlugin(pluginData) console.log("RESP", res) - // TODO_RIC - // let newPlugin = resp.plugins[0] - // update(state => { - // const currentIdx = state.findIndex(plugin => plugin._id === newPlugin._id) - // if (currentIdx >= 0) { - // state.splice(currentIdx, 1, newPlugin) - // } else { - // state.push(newPlugin) - // } - // return state - // }) + + let newPlugin = res.plugins[0] + update(state => { + const currentIdx = state.findIndex(plugin => plugin._id === newPlugin._id) + if (currentIdx >= 0) { + state.splice(currentIdx, 1, newPlugin) + } else { + state.push(newPlugin) + } + return state + }) } async function uploadPlugin(file, source) { diff --git a/packages/server/src/api/controllers/plugin.ts b/packages/server/src/api/controllers/plugin.ts index dc70ea8b62..26caf38806 100644 --- a/packages/server/src/api/controllers/plugin.ts +++ b/packages/server/src/api/controllers/plugin.ts @@ -72,11 +72,11 @@ export async function create(ctx: any) { } try { - const doc = storePlugin(metadata, directory, source) + const doc = await storePlugin(metadata, directory, source) ctx.body = { message: "Plugin uploaded successfully", - plugins: doc, + plugins: [doc], } } catch (err: any) { const errMsg = err?.message ? err?.message : err From f49d61bc5cdad85431c2e26ab6274219bb8a366f Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 31 Aug 2022 19:21:45 +0100 Subject: [PATCH 070/260] Updating test cases to TS to get them working properly with the full TS implementations. --- packages/server/__mocks__/mongodb.ts | 2 +- packages/server/src/api/controllers/screen.js | 2 +- .../{airtable.spec.js => airtable.spec.ts} | 39 +- .../{arangodb.spec.js => arangodb.spec.ts} | 21 +- .../{couchdb.spec.js => couchdb.spec.ts} | 60 +-- .../{dynamodb.spec.js => dynamodb.spec.ts} | 86 ++-- ...icsearch.spec.js => elasticsearch.spec.ts} | 43 +- .../{firebase.spec.js => firebase.spec.ts} | 61 +-- ...ver.spec.js => microsoftSqlServer.spec.ts} | 23 +- .../tests/{mongo.spec.js => mongo.spec.ts} | 81 ++-- .../tests/{mysql.spec.js => mysql.spec.ts} | 32 +- .../tests/{oracle.spec.js => oracle.spec.ts} | 36 +- .../{postgres.spec.js => postgres.spec.ts} | 36 +- .../tests/{redis.spec.js => redis.spec.ts} | 33 +- .../tests/{rest.spec.js => rest.spec.ts} | 30 +- .../tests/{s3.spec.js => s3.spec.ts} | 18 +- .../tests/{sql.spec.js => sql.spec.ts} | 405 ++++++++++-------- 17 files changed, 558 insertions(+), 450 deletions(-) rename packages/server/src/integrations/tests/{airtable.spec.js => airtable.spec.ts} (75%) rename packages/server/src/integrations/tests/{arangodb.spec.js => arangodb.spec.ts} (75%) rename packages/server/src/integrations/tests/{couchdb.spec.js => couchdb.spec.ts} (58%) rename packages/server/src/integrations/tests/{dynamodb.spec.js => dynamodb.spec.ts} (68%) rename packages/server/src/integrations/tests/{elasticsearch.spec.js => elasticsearch.spec.ts} (72%) rename packages/server/src/integrations/tests/{firebase.spec.js => firebase.spec.ts} (70%) rename packages/server/src/integrations/tests/{microsoftSqlServer.spec.js => microsoftSqlServer.spec.ts} (75%) rename packages/server/src/integrations/tests/{mongo.spec.js => mongo.spec.ts} (90%) rename packages/server/src/integrations/tests/{mysql.spec.js => mysql.spec.ts} (80%) rename packages/server/src/integrations/tests/{oracle.spec.js => oracle.spec.ts} (83%) rename packages/server/src/integrations/tests/{postgres.spec.js => postgres.spec.ts} (78%) rename packages/server/src/integrations/tests/{redis.spec.js => redis.spec.ts} (71%) rename packages/server/src/integrations/tests/{rest.spec.js => rest.spec.ts} (96%) rename packages/server/src/integrations/tests/{s3.spec.js => s3.spec.ts} (55%) rename packages/server/src/integrations/tests/{sql.spec.js => sql.spec.ts} (60%) diff --git a/packages/server/__mocks__/mongodb.ts b/packages/server/__mocks__/mongodb.ts index 92ec89227f..4a1867f6f9 100644 --- a/packages/server/__mocks__/mongodb.ts +++ b/packages/server/__mocks__/mongodb.ts @@ -33,7 +33,7 @@ module MongoMock { }) } - mongodb.ObjectID = require("mongodb").ObjectID + mongodb.ObjectID = jest.requireActual("mongodb").ObjectID module.exports = mongodb } diff --git a/packages/server/src/api/controllers/screen.js b/packages/server/src/api/controllers/screen.js index 99d12d064c..07b15dd8a1 100644 --- a/packages/server/src/api/controllers/screen.js +++ b/packages/server/src/api/controllers/screen.js @@ -8,7 +8,7 @@ const { AccessController } = require("@budibase/backend-core/roles") const { getAppDB } = require("@budibase/backend-core/context") const { events } = require("@budibase/backend-core") const { getGlobalDB } = require("@budibase/backend-core/tenancy") -import { updateAppPackage } from "./application" +const { updateAppPackage } = require("./application") exports.fetch = async ctx => { const db = getAppDB() diff --git a/packages/server/src/integrations/tests/airtable.spec.js b/packages/server/src/integrations/tests/airtable.spec.ts similarity index 75% rename from packages/server/src/integrations/tests/airtable.spec.js rename to packages/server/src/integrations/tests/airtable.spec.ts index df676a1397..26a389456f 100644 --- a/packages/server/src/integrations/tests/airtable.spec.js +++ b/packages/server/src/integrations/tests/airtable.spec.ts @@ -1,10 +1,12 @@ -const Airtable = require("airtable") -const AirtableIntegration = require("../airtable") +import { default as AirtableIntegration } from "../airtable" jest.mock("airtable") class TestConfiguration { - constructor(config = {}) { - this.integration = new AirtableIntegration.integration(config) + integration: any + client: any + + constructor(config: any = {}) { + this.integration = new AirtableIntegration.integration(config) this.client = { create: jest.fn(), select: jest.fn(() => ({ @@ -13,12 +15,12 @@ class TestConfiguration { update: jest.fn(), destroy: jest.fn(), } - this.integration.client = () => this.client + this.integration.client = () => this.client } } describe("Airtable Integration", () => { - let config + let config: any beforeEach(() => { config = new TestConfiguration() @@ -27,22 +29,23 @@ describe("Airtable Integration", () => { it("calls the create method with the correct params", async () => { const response = await config.integration.create({ table: "test", - json: {} + json: {}, }) expect(config.client.create).toHaveBeenCalledWith([ { - fields: {} - } + fields: {}, + }, ]) }) it("calls the read method with the correct params", async () => { const response = await config.integration.read({ table: "test", - view: "Grid view" + view: "Grid view", }) expect(config.client.select).toHaveBeenCalledWith({ - maxRecords: 10, view: "Grid view" + maxRecords: 10, + view: "Grid view", }) }) @@ -51,22 +54,22 @@ describe("Airtable Integration", () => { table: "table", id: "123", json: { - name: "test" - } + name: "test", + }, }) expect(config.client.update).toHaveBeenCalledWith([ { id: "123", - fields: { name: "test" } - } + fields: { name: "test" }, + }, ]) }) it("calls the delete method with the correct params", async () => { - const ids = [1,2,3,4] + const ids = [1, 2, 3, 4] const response = await config.integration.delete({ - ids + ids, }) expect(config.client.destroy).toHaveBeenCalledWith(ids) }) -}) \ No newline at end of file +}) diff --git a/packages/server/src/integrations/tests/arangodb.spec.js b/packages/server/src/integrations/tests/arangodb.spec.ts similarity index 75% rename from packages/server/src/integrations/tests/arangodb.spec.js rename to packages/server/src/integrations/tests/arangodb.spec.ts index 437a7fd3ec..401b2ec707 100644 --- a/packages/server/src/integrations/tests/arangodb.spec.js +++ b/packages/server/src/integrations/tests/arangodb.spec.ts @@ -1,15 +1,16 @@ -const arangodb = require("arangojs") -const ArangoDBIntegration = require("../arangodb") +import { default as ArangoDBIntegration } from "../arangodb" jest.mock("arangojs") class TestConfiguration { - constructor(config = {}) { - this.integration = new ArangoDBIntegration.integration(config) + integration: any + + constructor(config: any = {}) { + this.integration = new ArangoDBIntegration.integration(config) } } describe("ArangoDB Integration", () => { - let config + let config: any let indexName = "Users" beforeEach(() => { @@ -18,18 +19,20 @@ describe("ArangoDB Integration", () => { it("calls the create method with the correct params", async () => { const body = { - json: "Hello" + json: "Hello", } const response = await config.integration.create(body) - expect(config.integration.client.query).toHaveBeenCalledWith(`INSERT Hello INTO collection RETURN NEW`) + expect(config.integration.client.query).toHaveBeenCalledWith( + `INSERT Hello INTO collection RETURN NEW` + ) }) it("calls the read method with the correct params", async () => { const query = { - json: `test`, + sql: `test`, } const response = await config.integration.read(query) expect(config.integration.client.query).toHaveBeenCalledWith(query.sql) }) -}) \ No newline at end of file +}) diff --git a/packages/server/src/integrations/tests/couchdb.spec.js b/packages/server/src/integrations/tests/couchdb.spec.ts similarity index 58% rename from packages/server/src/integrations/tests/couchdb.spec.js rename to packages/server/src/integrations/tests/couchdb.spec.ts index 65c9c83ad2..e05a2bd247 100644 --- a/packages/server/src/integrations/tests/couchdb.spec.js +++ b/packages/server/src/integrations/tests/couchdb.spec.ts @@ -1,23 +1,29 @@ -jest.mock("pouchdb", () => function CouchDBMock() { - this.post = jest.fn() - this.allDocs = jest.fn(() => ({ rows: [] })) - this.put = jest.fn() - this.get = jest.fn() - this.remove = jest.fn() - this.plugin = jest.fn() - this.close = jest.fn() -}) +jest.mock( + "pouchdb", + () => + function CouchDBMock(this: any) { + this.post = jest.fn() + this.allDocs = jest.fn(() => ({ rows: [] })) + this.put = jest.fn() + this.get = jest.fn() + this.remove = jest.fn() + this.plugin = jest.fn() + this.close = jest.fn() + } +) -const CouchDBIntegration = require("../couchdb") +import { default as CouchDBIntegration } from "../couchdb" class TestConfiguration { - constructor(config = {}) { - this.integration = new CouchDBIntegration.integration(config) + integration: any + + constructor(config: any = {}) { + this.integration = new CouchDBIntegration.integration(config) } } describe("CouchDB Integration", () => { - let config + let config: any beforeEach(() => { config = new TestConfiguration() @@ -25,37 +31,37 @@ describe("CouchDB Integration", () => { it("calls the create method with the correct params", async () => { const doc = { - test: 1 - } - const response = await config.integration.create({ - json: doc + test: 1, + } + const response = await config.integration.create({ + json: doc, }) expect(config.integration.client.post).toHaveBeenCalledWith(doc) }) it("calls the read method with the correct params", async () => { const doc = { - name: "search" - } + name: "search", + } - const response = await config.integration.read({ - json: doc + const response = await config.integration.read({ + json: doc, }) expect(config.integration.client.allDocs).toHaveBeenCalledWith({ include_docs: true, - name: "search" + name: "search", }) }) it("calls the update method with the correct params", async () => { const doc = { _id: "1234", - name: "search" - } + name: "search", + } - const response = await config.integration.update({ - json: doc + const response = await config.integration.update({ + json: doc, }) expect(config.integration.client.put).toHaveBeenCalledWith(doc) @@ -67,4 +73,4 @@ describe("CouchDB Integration", () => { expect(config.integration.client.get).toHaveBeenCalledWith(id) expect(config.integration.client.remove).toHaveBeenCalled() }) -}) \ No newline at end of file +}) diff --git a/packages/server/src/integrations/tests/dynamodb.spec.js b/packages/server/src/integrations/tests/dynamodb.spec.ts similarity index 68% rename from packages/server/src/integrations/tests/dynamodb.spec.js rename to packages/server/src/integrations/tests/dynamodb.spec.ts index 198ed6a4b4..d245875173 100644 --- a/packages/server/src/integrations/tests/dynamodb.spec.js +++ b/packages/server/src/integrations/tests/dynamodb.spec.ts @@ -1,15 +1,16 @@ -const AWS = require("aws-sdk") -const DynamoDBIntegration = require("../dynamodb") +import { default as DynamoDBIntegration } from "../dynamodb" jest.mock("aws-sdk") class TestConfiguration { - constructor(config = {}) { - this.integration = new DynamoDBIntegration.integration(config) + integration: any + + constructor(config: any = {}) { + this.integration = new DynamoDBIntegration.integration(config) } } describe("DynamoDB Integration", () => { - let config + let config: any let tableName = "Users" beforeEach(() => { @@ -17,25 +18,25 @@ describe("DynamoDB Integration", () => { }) it("calls the create method with the correct params", async () => { - const response = await config.integration.create({ + const response = await config.integration.create({ table: tableName, json: { - Name: "John" - } + Name: "John", + }, }) expect(config.integration.client.put).toHaveBeenCalledWith({ TableName: tableName, - Name: "John" + Name: "John", }) }) it("calls the read method with the correct params", async () => { const indexName = "Test" - const response = await config.integration.read({ + const response = await config.integration.read({ table: tableName, - index: indexName, - json: {} + index: indexName, + json: {}, }) expect(config.integration.client.query).toHaveBeenCalledWith({ TableName: tableName, @@ -47,57 +48,59 @@ describe("DynamoDB Integration", () => { it("calls the scan method with the correct params", async () => { const indexName = "Test" - const response = await config.integration.scan({ + const response = await config.integration.scan({ table: tableName, - index: indexName, - json: {} + index: indexName, + json: {}, }) expect(config.integration.client.scan).toHaveBeenCalledWith({ TableName: tableName, IndexName: indexName, }) - expect(response).toEqual([{ - Name: "test" - }]) + expect(response).toEqual([ + { + Name: "test", + }, + ]) }) it("calls the get method with the correct params", async () => { - const response = await config.integration.get({ + const response = await config.integration.get({ table: tableName, json: { - Id: 123 - } + Id: 123, + }, }) expect(config.integration.client.get).toHaveBeenCalledWith({ TableName: tableName, - Id: 123 + Id: 123, }) }) it("calls the update method with the correct params", async () => { - const response = await config.integration.update({ + const response = await config.integration.update({ table: tableName, json: { - Name: "John" - } + Name: "John", + }, }) expect(config.integration.client.update).toHaveBeenCalledWith({ TableName: tableName, - Name: "John" + Name: "John", }) }) it("calls the delete method with the correct params", async () => { - const response = await config.integration.delete({ + const response = await config.integration.delete({ table: tableName, json: { - Name: "John" - } + Name: "John", + }, }) expect(config.integration.client.delete).toHaveBeenCalledWith({ TableName: tableName, - Name: "John" + Name: "John", }) }) @@ -105,14 +108,14 @@ describe("DynamoDB Integration", () => { const config = { region: "us-east-1", accessKeyId: "test", - secretAccessKeyId: "test" + secretAccessKey: "test", } - const integration = new DynamoDBIntegration.integration(config) + const integration: any = new DynamoDBIntegration.integration(config) expect(integration.config).toEqual({ currentClockSkew: true, - ...config + ...config, }) }) @@ -120,16 +123,16 @@ describe("DynamoDB Integration", () => { const config = { region: "us-east-1", accessKeyId: "test", - secretAccessKeyId: "test", - endpoint: "localhost:8080" + secretAccessKey: "test", + endpoint: "localhost:8080", } - const integration = new DynamoDBIntegration.integration(config) + const integration: any = new DynamoDBIntegration.integration(config) expect(integration.config).toEqual({ region: "us-east-1", currentClockSkew: true, - endpoint: "localhost:8080" + endpoint: "localhost:8080", }) }) @@ -137,15 +140,16 @@ describe("DynamoDB Integration", () => { const config = { region: "us-east-1", accessKeyId: "test", - secretAccessKeyId: "test", - endpoint: "dynamodb.aws.foo.net" + secretAccessKey: "test", + endpoint: "dynamodb.aws.foo.net", } const integration = new DynamoDBIntegration.integration(config) + // @ts-ignore expect(integration.config).toEqual({ currentClockSkew: true, - ...config + ...config, }) }) -}) \ No newline at end of file +}) diff --git a/packages/server/src/integrations/tests/elasticsearch.spec.js b/packages/server/src/integrations/tests/elasticsearch.spec.ts similarity index 72% rename from packages/server/src/integrations/tests/elasticsearch.spec.js rename to packages/server/src/integrations/tests/elasticsearch.spec.ts index fc97e04bcc..c839b9b2d4 100644 --- a/packages/server/src/integrations/tests/elasticsearch.spec.js +++ b/packages/server/src/integrations/tests/elasticsearch.spec.ts @@ -1,15 +1,16 @@ -const elasticsearch = require("@elastic/elasticsearch") -const ElasticSearchIntegration = require("../elasticsearch") +import { default as ElasticSearchIntegration } from "../elasticsearch" jest.mock("@elastic/elasticsearch") class TestConfiguration { - constructor(config = {}) { - this.integration = new ElasticSearchIntegration.integration(config) + integration: any + + constructor(config: any = {}) { + this.integration = new ElasticSearchIntegration.integration(config) } } describe("Elasticsearch Integration", () => { - let config + let config: any let indexName = "Users" beforeEach(() => { @@ -18,15 +19,15 @@ describe("Elasticsearch Integration", () => { it("calls the create method with the correct params", async () => { const body = { - name: "Hello" + name: "Hello", } - const response = await config.integration.create({ + const response = await config.integration.create({ index: indexName, - json: body + json: body, }) expect(config.integration.client.index).toHaveBeenCalledWith({ index: indexName, - body + body, }) }) @@ -34,43 +35,43 @@ describe("Elasticsearch Integration", () => { const body = { query: { term: { - name: "kimchy" - } - } + name: "kimchy", + }, + }, } - const response = await config.integration.read({ + const response = await config.integration.read({ index: indexName, - json: body + json: body, }) expect(config.integration.client.search).toHaveBeenCalledWith({ index: indexName, - body + body, }) expect(response).toEqual(expect.any(Array)) }) it("calls the update method with the correct params", async () => { const body = { - name: "updated" + name: "updated", } - const response = await config.integration.update({ + const response = await config.integration.update({ id: "1234", index: indexName, - json: body + json: body, }) expect(config.integration.client.update).toHaveBeenCalledWith({ id: "1234", index: indexName, - body + body, }) expect(response).toEqual(expect.any(Array)) }) it("calls the delete method with the correct params", async () => { const body = { - id: "1234" + id: "1234", } const response = await config.integration.delete(body) @@ -78,4 +79,4 @@ describe("Elasticsearch Integration", () => { expect(config.integration.client.delete).toHaveBeenCalledWith(body) expect(response).toEqual(expect.any(Array)) }) -}) \ No newline at end of file +}) diff --git a/packages/server/src/integrations/tests/firebase.spec.js b/packages/server/src/integrations/tests/firebase.spec.ts similarity index 70% rename from packages/server/src/integrations/tests/firebase.spec.js rename to packages/server/src/integrations/tests/firebase.spec.ts index 97d3b2c0d7..befbb80ccb 100644 --- a/packages/server/src/integrations/tests/firebase.spec.js +++ b/packages/server/src/integrations/tests/firebase.spec.ts @@ -1,92 +1,97 @@ -const firebase = require("@google-cloud/firestore") -const FirebaseIntegration = require("../firebase") +import { default as FirebaseIntegration } from "../firebase" jest.mock("@google-cloud/firestore") class TestConfiguration { - constructor(config = {}) { - this.integration = new FirebaseIntegration.integration(config) + integration: any + + constructor(config: any = {}) { + this.integration = new FirebaseIntegration.integration(config) } } describe("Firebase Integration", () => { - let config + let config: any let tableName = "Users" beforeEach(() => { config = new TestConfiguration({ - serviceAccount: "{}" + serviceAccount: "{}", }) }) it("calls the create method with the correct params", async () => { - await config.integration.create({ + await config.integration.create({ table: tableName, json: { - Name: "Test Name" + Name: "Test Name", }, extra: { - collection: "test" - } + collection: "test", + }, }) expect(config.integration.client.collection).toHaveBeenCalledWith("test") - expect(config.integration.client.set).toHaveBeenCalledWith({ + expect(config.integration.client.set).toHaveBeenCalledWith({ Name: "Test Name", - id: "test_id" + id: "test_id", }) }) it("calls the read method with the correct params", async () => { - const response = await config.integration.read({ + const response = await config.integration.read({ table: tableName, json: { - Name: "Test" + Name: "Test", }, extra: { collection: "test", filterField: "field", filter: "==", filterValue: "value", - } + }, }) expect(config.integration.client.collection).toHaveBeenCalledWith("test") - expect(config.integration.client.where).toHaveBeenCalledWith("field", "==", "value") - expect(response).toEqual([{ result: "test"}]) + expect(config.integration.client.where).toHaveBeenCalledWith( + "field", + "==", + "value" + ) + expect(response).toEqual([{ result: "test" }]) }) it("calls the update method with the correct params", async () => { - const response = await config.integration.update({ + const response = await config.integration.update({ table: tableName, json: { id: "test", - Name: "Test" + Name: "Test", }, extra: { - collection: "test" - } + collection: "test", + }, }) expect(config.integration.client.collection).toHaveBeenCalledWith("test") expect(config.integration.client.update).toHaveBeenCalledWith({ Name: "Test", - id: "test" + id: "test", }) expect(response).toEqual({ - result: "test" + result: "test", }) }) it("calls the delete method with the correct params", async () => { - const response = await config.integration.delete({ + const response = await config.integration.delete({ table: tableName, json: { id: "test", - Name: "Test" + Name: "Test", }, extra: { - collection: "test" - } + collection: "test", + }, }) expect(config.integration.client.collection).toHaveBeenCalledWith("test") expect(config.integration.client.doc).toHaveBeenCalledWith("test") expect(config.integration.client.delete).toHaveBeenCalled() }) -}) \ No newline at end of file +}) diff --git a/packages/server/src/integrations/tests/microsoftSqlServer.spec.js b/packages/server/src/integrations/tests/microsoftSqlServer.spec.ts similarity index 75% rename from packages/server/src/integrations/tests/microsoftSqlServer.spec.js rename to packages/server/src/integrations/tests/microsoftSqlServer.spec.ts index 19a99ad54b..8484e759a9 100644 --- a/packages/server/src/integrations/tests/microsoftSqlServer.spec.js +++ b/packages/server/src/integrations/tests/microsoftSqlServer.spec.ts @@ -1,15 +1,16 @@ -const sqlServer = require("mssql") -const MSSQLIntegration = require("../microsoftSqlServer") +import { default as MSSQLIntegration } from "../microsoftSqlServer" jest.mock("mssql") class TestConfiguration { - constructor(config = {}) { - this.integration = new MSSQLIntegration.integration(config) + integration: any + + constructor(config: any = {}) { + this.integration = new MSSQLIntegration.integration(config) } } describe("MS SQL Server Integration", () => { - let config + let config: any beforeEach(async () => { config = new TestConfiguration() @@ -23,7 +24,7 @@ describe("MS SQL Server Integration", () => { it("calls the create method with the correct params", async () => { const sql = "insert into users (name, age) values ('Joe', 123);" const response = await config.integration.create({ - sql + sql, }) expect(config.integration.client.request).toHaveBeenCalledWith() expect(response[0]).toEqual(sql) @@ -32,7 +33,7 @@ describe("MS SQL Server Integration", () => { it("calls the read method with the correct params", async () => { const sql = "select * from users;" const response = await config.integration.read({ - sql + sql, }) expect(config.integration.client.request).toHaveBeenCalledWith() expect(response[0]).toEqual(sql) @@ -45,11 +46,11 @@ describe("MS SQL Server Integration", () => { }) it("returns the correct response when the create response has no rows", async () => { - const sql = "insert into users (name, age) values ('Joe', 123);" - const response = await config.integration.create({ - sql + const sql = "insert into users (name, age) values ('Joe', 123);" + const response = await config.integration.create({ + sql, }) expect(response[0]).toEqual(sql) }) }) -}) \ No newline at end of file +}) diff --git a/packages/server/src/integrations/tests/mongo.spec.js b/packages/server/src/integrations/tests/mongo.spec.ts similarity index 90% rename from packages/server/src/integrations/tests/mongo.spec.js rename to packages/server/src/integrations/tests/mongo.spec.ts index 40aa6dbb58..a326d3ac2a 100644 --- a/packages/server/src/integrations/tests/mongo.spec.js +++ b/packages/server/src/integrations/tests/mongo.spec.ts @@ -1,22 +1,26 @@ const mongo = require("mongodb") -const MongoDBIntegration = require("../mongodb") +import { default as MongoDBIntegration } from "../mongodb" jest.mock("mongodb") class TestConfiguration { - constructor(config = {}) { + integration: any + + constructor(config: any = {}) { this.integration = new MongoDBIntegration.integration(config) } } function disableConsole() { jest.spyOn(console, "error") + // @ts-ignore console.error.mockImplementation(() => {}) + // @ts-ignore return console.error.mockRestore } describe("MongoDB Integration", () => { - let config + let config: any let indexName = "Users" beforeEach(() => { @@ -54,13 +58,16 @@ describe("MongoDB Integration", () => { id: "test", }, options: { - opt: "option" - } + opt: "option", + }, }, extra: { collection: "testCollection", actionTypes: "deleteOne" }, } await config.integration.delete(query) - expect(config.integration.client.deleteOne).toHaveBeenCalledWith(query.json.filter, query.json.options) + expect(config.integration.client.deleteOne).toHaveBeenCalledWith( + query.json.filter, + query.json.options + ) }) it("calls the update method with the correct params", async () => { @@ -108,7 +115,7 @@ describe("MongoDB Integration", () => { json: { filter: { _id: "ObjectId('ACBD12345678ABCD12345678')", - name: "ObjectId('BBBB12345678ABCD12345678')" + name: "ObjectId('BBBB12345678ABCD12345678')", }, update: { _id: "ObjectId('FFFF12345678ABCD12345678')", @@ -122,7 +129,7 @@ describe("MongoDB Integration", () => { } await config.integration.update(query) expect(config.integration.client.updateOne).toHaveBeenCalled() - + const args = config.integration.client.updateOne.mock.calls[0] expect(args[0]).toEqual({ _id: mongo.ObjectID.createFromHexString("ACBD12345678ABCD12345678"), @@ -133,7 +140,7 @@ describe("MongoDB Integration", () => { name: mongo.ObjectID.createFromHexString("CCCC12345678ABCD12345678"), }) expect(args[2]).toEqual({ - upsert: false + upsert: false, }) }) @@ -143,7 +150,7 @@ describe("MongoDB Integration", () => { filter: { _id: { $eq: "ObjectId('ACBD12345678ABCD12345678')", - } + }, }, update: { $set: { @@ -158,20 +165,20 @@ describe("MongoDB Integration", () => { } await config.integration.update(query) expect(config.integration.client.updateOne).toHaveBeenCalled() - + const args = config.integration.client.updateOne.mock.calls[0] expect(args[0]).toEqual({ _id: { $eq: mongo.ObjectID.createFromHexString("ACBD12345678ABCD12345678"), - } + }, }) expect(args[1]).toEqual({ $set: { _id: mongo.ObjectID.createFromHexString("FFFF12345678ABCD12345678"), - } + }, }) expect(args[2]).toEqual({ - upsert: true + upsert: true, }) }) @@ -181,12 +188,12 @@ describe("MongoDB Integration", () => { filter: { _id: { $eq: "ObjectId('ACBD12345678ABCD12345678')", - } + }, }, update: { $set: { name: "UPDATED", - age: 99 + age: 99, }, }, options: { @@ -197,21 +204,21 @@ describe("MongoDB Integration", () => { } await config.integration.read(query) expect(config.integration.client.findOneAndUpdate).toHaveBeenCalled() - + const args = config.integration.client.findOneAndUpdate.mock.calls[0] expect(args[0]).toEqual({ _id: { $eq: mongo.ObjectID.createFromHexString("ACBD12345678ABCD12345678"), - } + }, }) expect(args[1]).toEqual({ $set: { name: "UPDATED", - age: 99 - } + age: 99, + }, }) expect(args[2]).toEqual({ - upsert: false + upsert: false, }) }) @@ -242,12 +249,12 @@ describe("MongoDB Integration", () => { } await config.integration.update(query) expect(config.integration.client.updateOne).toHaveBeenCalled() - + const args = config.integration.client.updateOne.mock.calls[0] expect(args[0]).toEqual({ _id: { $eq: mongo.ObjectID.createFromHexString("ACBD12345678ABCD12345678"), - } + }, }) expect(args[1]).toEqual({ $set: { @@ -255,15 +262,17 @@ describe("MongoDB Integration", () => { data: [ { cid: 1 }, { cid: 2 }, - { nested: { - name: "test" - }} - ] + { + nested: { + name: "test", + }, + }, + ], }, }, }) expect(args[2]).toEqual({ - upsert: true + upsert: true, }) }) @@ -295,12 +304,12 @@ describe("MongoDB Integration", () => { } await config.integration.update(query) expect(config.integration.client.updateOne).toHaveBeenCalled() - + const args = config.integration.client.updateOne.mock.calls[0] expect(args[0]).toEqual({ _id: { $eq: mongo.ObjectID.createFromHexString("ACBD12345678ABCD12345678"), - } + }, }) expect(args[1]).toEqual({ $set: { @@ -308,16 +317,18 @@ describe("MongoDB Integration", () => { data: [ { cid: 1 }, { cid: 2 }, - { nested: { - name: "te}st" - }} - ] + { + nested: { + name: "te}st", + }, + }, + ], }, }, }) expect(args[2]).toEqual({ upsert: true, - extra: "ad\"{\"d" + extra: 'ad"{"d', }) }) }) diff --git a/packages/server/src/integrations/tests/mysql.spec.js b/packages/server/src/integrations/tests/mysql.spec.ts similarity index 80% rename from packages/server/src/integrations/tests/mysql.spec.js rename to packages/server/src/integrations/tests/mysql.spec.ts index 8304771d5d..a70eb73857 100644 --- a/packages/server/src/integrations/tests/mysql.spec.js +++ b/packages/server/src/integrations/tests/mysql.spec.ts @@ -1,14 +1,16 @@ -const MySQLIntegration = require("../mysql") +import { default as MySQLIntegration } from "../mysql" jest.mock("mysql2") class TestConfiguration { - constructor(config = { ssl: {} }) { + integration: any + + constructor(config: any = { ssl: {} }) { this.integration = new MySQLIntegration.integration(config) } } describe("MySQL Integration", () => { - let config + let config: any beforeEach(() => { config = new TestConfiguration() @@ -17,7 +19,7 @@ describe("MySQL Integration", () => { it("calls the create method with the correct params", async () => { const sql = "insert into users (name, age) values ('Joe', 123);" await config.integration.create({ - sql + sql, }) expect(config.integration.client.query).toHaveBeenCalledWith(sql, []) }) @@ -25,7 +27,7 @@ describe("MySQL Integration", () => { it("calls the read method with the correct params", async () => { const sql = "select * from users;" await config.integration.read({ - sql + sql, }) expect(config.integration.client.query).toHaveBeenCalledWith(sql, []) }) @@ -33,7 +35,7 @@ describe("MySQL Integration", () => { it("calls the update method with the correct params", async () => { const sql = "update table users set name = 'test';" await config.integration.update({ - sql + sql, }) expect(config.integration.client.query).toHaveBeenCalledWith(sql, []) }) @@ -41,34 +43,34 @@ describe("MySQL Integration", () => { it("calls the delete method with the correct params", async () => { const sql = "delete from users where name = 'todelete';" await config.integration.delete({ - sql + sql, }) expect(config.integration.client.query).toHaveBeenCalledWith(sql, []) }) describe("no rows returned", () => { it("returns the correct response when the create response has no rows", async () => { - const sql = "insert into users (name, age) values ('Joe', 123);" - const response = await config.integration.create({ - sql + const sql = "insert into users (name, age) values ('Joe', 123);" + const response = await config.integration.create({ + sql, }) expect(response).toEqual([{ created: true }]) }) it("returns the correct response when the update response has no rows", async () => { const sql = "update table users set name = 'test';" - const response = await config.integration.update({ - sql + const response = await config.integration.update({ + sql, }) expect(response).toEqual([{ updated: true }]) }) it("returns the correct response when the delete response has no rows", async () => { const sql = "delete from users where name = 'todelete';" - const response = await config.integration.delete({ - sql + const response = await config.integration.delete({ + sql, }) expect(response).toEqual([{ deleted: true }]) }) }) -}) \ No newline at end of file +}) diff --git a/packages/server/src/integrations/tests/oracle.spec.js b/packages/server/src/integrations/tests/oracle.spec.ts similarity index 83% rename from packages/server/src/integrations/tests/oracle.spec.js rename to packages/server/src/integrations/tests/oracle.spec.ts index 77f0525090..57dad48820 100644 --- a/packages/server/src/integrations/tests/oracle.spec.js +++ b/packages/server/src/integrations/tests/oracle.spec.ts @@ -1,17 +1,19 @@ const oracledb = require("oracledb") -const OracleIntegration = require("../oracle") +import { default as OracleIntegration } from "../oracle" jest.mock("oracledb") class TestConfiguration { - constructor(config = {}) { - this.integration = new OracleIntegration.integration(config) + integration: any + + constructor(config: any = {}) { + this.integration = new OracleIntegration.integration(config) } } const options = { autoCommit: true } describe("Oracle Integration", () => { - let config + let config: any beforeEach(() => { jest.clearAllMocks() @@ -26,7 +28,7 @@ describe("Oracle Integration", () => { it("calls the create method with the correct params", async () => { const sql = "insert into users (name, age) values ('Joe', 123);" await config.integration.create({ - sql + sql, }) expect(oracledb.executeMock).toHaveBeenCalledWith(sql, [], options) expect(oracledb.executeMock).toHaveBeenCalledTimes(1) @@ -35,7 +37,7 @@ describe("Oracle Integration", () => { it("calls the read method with the correct params", async () => { const sql = "select * from users;" await config.integration.read({ - sql + sql, }) expect(oracledb.executeMock).toHaveBeenCalledWith(sql, [], options) expect(oracledb.executeMock).toHaveBeenCalledTimes(1) @@ -43,8 +45,8 @@ describe("Oracle Integration", () => { it("calls the update method with the correct params", async () => { const sql = "update table users set name = 'test';" - const response = await config.integration.update({ - sql + const response = await config.integration.update({ + sql, }) expect(oracledb.executeMock).toHaveBeenCalledWith(sql, [], options) expect(oracledb.executeMock).toHaveBeenCalledTimes(1) @@ -53,7 +55,7 @@ describe("Oracle Integration", () => { it("calls the delete method with the correct params", async () => { const sql = "delete from users where name = 'todelete';" await config.integration.delete({ - sql + sql, }) expect(oracledb.executeMock).toHaveBeenCalledWith(sql, [], options) expect(oracledb.executeMock).toHaveBeenCalledTimes(1) @@ -65,9 +67,9 @@ describe("Oracle Integration", () => { }) it("returns the correct response when the create response has no rows", async () => { - const sql = "insert into users (name, age) values ('Joe', 123);" - const response = await config.integration.create({ - sql + const sql = "insert into users (name, age) values ('Joe', 123);" + const response = await config.integration.create({ + sql, }) expect(response).toEqual([{ created: true }]) expect(oracledb.executeMock).toHaveBeenCalledTimes(1) @@ -75,8 +77,8 @@ describe("Oracle Integration", () => { it("returns the correct response when the update response has no rows", async () => { const sql = "update table users set name = 'test';" - const response = await config.integration.update({ - sql + const response = await config.integration.update({ + sql, }) expect(response).toEqual([{ updated: true }]) expect(oracledb.executeMock).toHaveBeenCalledTimes(1) @@ -84,11 +86,11 @@ describe("Oracle Integration", () => { it("returns the correct response when the delete response has no rows", async () => { const sql = "delete from users where name = 'todelete';" - const response = await config.integration.delete({ - sql + const response = await config.integration.delete({ + sql, }) expect(response).toEqual([{ deleted: true }]) expect(oracledb.executeMock).toHaveBeenCalledTimes(1) }) }) -}) \ No newline at end of file +}) diff --git a/packages/server/src/integrations/tests/postgres.spec.js b/packages/server/src/integrations/tests/postgres.spec.ts similarity index 78% rename from packages/server/src/integrations/tests/postgres.spec.js rename to packages/server/src/integrations/tests/postgres.spec.ts index 4ce5f12e96..a6be3aa623 100644 --- a/packages/server/src/integrations/tests/postgres.spec.js +++ b/packages/server/src/integrations/tests/postgres.spec.ts @@ -1,15 +1,17 @@ const pg = require("pg") -const PostgresIntegration = require("../postgres") +import { default as PostgresIntegration } from "../postgres" jest.mock("pg") class TestConfiguration { - constructor(config = {}) { - this.integration = new PostgresIntegration.integration(config) + integration: any + + constructor(config: any = {}) { + this.integration = new PostgresIntegration.integration(config) } } describe("Postgres Integration", () => { - let config + let config: any beforeEach(() => { config = new TestConfiguration() @@ -18,7 +20,7 @@ describe("Postgres Integration", () => { it("calls the create method with the correct params", async () => { const sql = "insert into users (name, age) values ('Joe', 123);" await config.integration.create({ - sql + sql, }) expect(pg.queryMock).toHaveBeenCalledWith(sql, []) }) @@ -26,15 +28,15 @@ describe("Postgres Integration", () => { it("calls the read method with the correct params", async () => { const sql = "select * from users;" await config.integration.read({ - sql + sql, }) expect(pg.queryMock).toHaveBeenCalledWith(sql, []) }) it("calls the update method with the correct params", async () => { const sql = "update table users set name = 'test';" - const response = await config.integration.update({ - sql + const response = await config.integration.update({ + sql, }) expect(pg.queryMock).toHaveBeenCalledWith(sql, []) }) @@ -42,7 +44,7 @@ describe("Postgres Integration", () => { it("calls the delete method with the correct params", async () => { const sql = "delete from users where name = 'todelete';" await config.integration.delete({ - sql + sql, }) expect(pg.queryMock).toHaveBeenCalledWith(sql, []) }) @@ -53,27 +55,27 @@ describe("Postgres Integration", () => { }) it("returns the correct response when the create response has no rows", async () => { - const sql = "insert into users (name, age) values ('Joe', 123);" - const response = await config.integration.create({ - sql + const sql = "insert into users (name, age) values ('Joe', 123);" + const response = await config.integration.create({ + sql, }) expect(response).toEqual([{ created: true }]) }) it("returns the correct response when the update response has no rows", async () => { const sql = "update table users set name = 'test';" - const response = await config.integration.update({ - sql + const response = await config.integration.update({ + sql, }) expect(response).toEqual([{ updated: true }]) }) it("returns the correct response when the delete response has no rows", async () => { const sql = "delete from users where name = 'todelete';" - const response = await config.integration.delete({ - sql + const response = await config.integration.delete({ + sql, }) expect(response).toEqual([{ deleted: true }]) }) }) -}) \ No newline at end of file +}) diff --git a/packages/server/src/integrations/tests/redis.spec.js b/packages/server/src/integrations/tests/redis.spec.ts similarity index 71% rename from packages/server/src/integrations/tests/redis.spec.js rename to packages/server/src/integrations/tests/redis.spec.ts index 219584bdb2..d2e5ac819d 100644 --- a/packages/server/src/integrations/tests/redis.spec.js +++ b/packages/server/src/integrations/tests/redis.spec.ts @@ -1,13 +1,16 @@ const Redis = require("ioredis-mock") -const RedisIntegration = require("../redis") +import { default as RedisIntegration } from "../redis" class TestConfiguration { - constructor(config = {}) { - this.integration = new RedisIntegration.integration(config) + integration: any + redis: any + + constructor(config: any = {}) { + this.integration = new RedisIntegration.integration(config) this.redis = new Redis({ data: { - test: 'test', - result: "1" + test: "test", + result: "1", }, }) this.integration.client = this.redis @@ -15,7 +18,7 @@ class TestConfiguration { } describe("Redis Integration", () => { - let config + let config: any beforeEach(() => { config = new TestConfiguration() @@ -24,7 +27,7 @@ describe("Redis Integration", () => { it("calls the create method with the correct params", async () => { const body = { key: "key", - value: "value" + value: "value", } const response = await config.integration.create(body) expect(await config.redis.get("key")).toEqual("value") @@ -32,7 +35,7 @@ describe("Redis Integration", () => { it("calls the read method with the correct params", async () => { const body = { - key: "test" + key: "test", } const response = await config.integration.read(body) expect(response).toEqual("test") @@ -40,7 +43,7 @@ describe("Redis Integration", () => { it("calls the delete method with the correct params", async () => { const body = { - key: "test" + key: "test", } await config.integration.delete(body) expect(await config.redis.get(body.key)).toEqual(null) @@ -48,13 +51,17 @@ describe("Redis Integration", () => { it("calls the command method with the correct params", async () => { const body = { - json: "KEYS *" + json: "KEYS *", } // ioredis-mock doesn't support pipelines - config.integration.client.pipeline = jest.fn(() => ({ exec: jest.fn(() => [[]]) })) + config.integration.client.pipeline = jest.fn(() => ({ + exec: jest.fn(() => [[]]), + })) await config.integration.command(body) - expect(config.integration.client.pipeline).toHaveBeenCalledWith([["KEYS", "*"]]) + expect(config.integration.client.pipeline).toHaveBeenCalledWith([ + ["KEYS", "*"], + ]) }) -}) \ No newline at end of file +}) diff --git a/packages/server/src/integrations/tests/rest.spec.js b/packages/server/src/integrations/tests/rest.spec.ts similarity index 96% rename from packages/server/src/integrations/tests/rest.spec.js rename to packages/server/src/integrations/tests/rest.spec.ts index 0bb1e3a75d..96f87c2355 100644 --- a/packages/server/src/integrations/tests/rest.spec.js +++ b/packages/server/src/integrations/tests/rest.spec.ts @@ -12,9 +12,8 @@ jest.mock("node-fetch", () => text: jest.fn(), })) ) -const fetch = require("node-fetch") -const RestIntegration = require("../rest") -const { AuthType } = require("../rest") +import fetch from "node-fetch" +import { default as RestIntegration } from "../rest" const FormData = require("form-data") const { URLSearchParams } = require("url") @@ -24,14 +23,16 @@ const HEADERS = { } class TestConfiguration { - constructor(config = {}) { + integration: any + + constructor(config: any = {}) { this.integration = new RestIntegration.integration(config) } } describe("REST Integration", () => { const BASE_URL = "https://myapi.com" - let config + let config: any beforeEach(() => { config = new TestConfiguration({ @@ -170,22 +171,25 @@ describe("REST Integration", () => { }) it("should allow a valid json string and parse the contents to xml", () => { - const output = config.integration.addBody("xml", JSON.stringify(input), {}) + const output = config.integration.addBody( + "xml", + JSON.stringify(input), + {} + ) expect(output.body.includes("1")).toEqual(true) expect(output.body.includes("2")).toEqual(true) expect(output.headers["Content-Type"]).toEqual("application/xml") }) - }) describe("response", () => { - function buildInput(json, text, header) { + function buildInput(json: any, text: any, header: any) { return { status: 200, json: json ? async () => json : undefined, text: text ? async () => text : undefined, headers: { - get: key => (key === "content-length" ? 100 : header), + get: (key: any) => (key === "content-length" ? 100 : header), raw: () => ({ "content-type": header }), }, } @@ -224,7 +228,7 @@ describe("REST Integration", () => { const basicAuth = { _id: "c59c14bd1898a43baa08da68959b24686", name: "basic-1", - type: AuthType.BASIC, + type: RestIntegration.AuthType.BASIC, config: { username: "user", password: "password", @@ -234,7 +238,7 @@ describe("REST Integration", () => { const bearerAuth = { _id: "0d91d732f34e4befabeff50b392a8ff3", name: "bearer-1", - type: AuthType.BEARER, + type: RestIntegration.AuthType.BEARER, config: { token: "mytoken", }, @@ -360,6 +364,7 @@ describe("REST Integration", () => { headers: {}, method: "POST", }) + // @ts-ignore const sentData = JSON.stringify(fetch.mock.calls[0][1].body) expect(sentData).toContain(pageParam) expect(sentData).toContain(sizeParam) @@ -390,6 +395,7 @@ describe("REST Integration", () => { headers: {}, method: "POST", }) + // @ts-ignore const sentData = fetch.mock.calls[0][1].body expect(sentData.has(pageParam)) expect(sentData.get(pageParam)).toEqual(pageValue.toString()) @@ -489,6 +495,7 @@ describe("REST Integration", () => { headers: {}, method: "POST", }) + // @ts-ignore const sentData = JSON.stringify(fetch.mock.calls[0][1].body) expect(sentData).toContain(pageParam) expect(sentData).toContain(sizeParam) @@ -521,6 +528,7 @@ describe("REST Integration", () => { headers: {}, method: "POST", }) + // @ts-ignore const sentData = fetch.mock.calls[0][1].body expect(sentData.has(pageParam)) expect(sentData.get(pageParam)).toEqual(pageValue.toString()) diff --git a/packages/server/src/integrations/tests/s3.spec.js b/packages/server/src/integrations/tests/s3.spec.ts similarity index 55% rename from packages/server/src/integrations/tests/s3.spec.js rename to packages/server/src/integrations/tests/s3.spec.ts index 7ac403dbd4..503702c042 100644 --- a/packages/server/src/integrations/tests/s3.spec.js +++ b/packages/server/src/integrations/tests/s3.spec.ts @@ -1,26 +1,28 @@ const AWS = require("aws-sdk") -const S3Integration = require("../s3") +import { default as S3Integration } from "../s3" jest.mock("aws-sdk") class TestConfiguration { - constructor(config = {}) { - this.integration = new S3Integration.integration(config) + integration: any + + constructor(config: any = {}) { + this.integration = new S3Integration.integration(config) } } describe("S3 Integration", () => { - let config + let config: any beforeEach(() => { config = new TestConfiguration() }) it("calls the read method with the correct params", async () => { - const response = await config.integration.read({ - bucket: "test" + const response = await config.integration.read({ + bucket: "test", }) expect(config.integration.client.listObjects).toHaveBeenCalledWith({ - Bucket: "test" + Bucket: "test", }) }) -}) \ No newline at end of file +}) diff --git a/packages/server/src/integrations/tests/sql.spec.js b/packages/server/src/integrations/tests/sql.spec.ts similarity index 60% rename from packages/server/src/integrations/tests/sql.spec.js rename to packages/server/src/integrations/tests/sql.spec.ts index 3cc9f0fb3e..421b8535d4 100644 --- a/packages/server/src/integrations/tests/sql.spec.js +++ b/packages/server/src/integrations/tests/sql.spec.ts @@ -3,7 +3,7 @@ const { SqlClient } = require("../utils") const TABLE_NAME = "test" -function endpoint(table, operation) { +function endpoint(table: any, operation: any) { return { datasourceId: "Postgres", operation: operation, @@ -11,7 +11,13 @@ function endpoint(table, operation) { } } -function generateReadJson({ table, fields, filters, sort, paginate} = {}) { +function generateReadJson({ + table, + fields, + filters, + sort, + paginate, +}: any = {}) { return { endpoint: endpoint(table || TABLE_NAME, "READ"), resource: { @@ -48,7 +54,7 @@ function generateDeleteJson(table = TABLE_NAME, filters = {}) { describe("SQL query builder", () => { const limit = 500 const client = SqlClient.POSTGRES - let sql + let sql: any beforeEach(() => { sql = new Sql(client, limit) @@ -58,118 +64,139 @@ describe("SQL query builder", () => { const query = sql._query(generateReadJson()) expect(query).toEqual({ bindings: [limit], - sql: `select * from (select * from "${TABLE_NAME}" limit $1) as "${TABLE_NAME}"` + sql: `select * from (select * from "${TABLE_NAME}" limit $1) as "${TABLE_NAME}"`, }) }) it("should test a read with specific columns", () => { - const nameProp = `${TABLE_NAME}.name`, ageProp = `${TABLE_NAME}.age` - const query = sql._query(generateReadJson({ - fields: [nameProp, ageProp] - })) + const nameProp = `${TABLE_NAME}.name`, + ageProp = `${TABLE_NAME}.age` + const query = sql._query( + generateReadJson({ + fields: [nameProp, ageProp], + }) + ) expect(query).toEqual({ bindings: [limit], - sql: `select "${TABLE_NAME}"."name" as "${nameProp}", "${TABLE_NAME}"."age" as "${ageProp}" from (select * from "${TABLE_NAME}" limit $1) as "${TABLE_NAME}"` + sql: `select "${TABLE_NAME}"."name" as "${nameProp}", "${TABLE_NAME}"."age" as "${ageProp}" from (select * from "${TABLE_NAME}" limit $1) as "${TABLE_NAME}"`, }) }) it("should test a where string starts with read", () => { - const query = sql._query(generateReadJson({ - filters: { - string: { - name: "John", - } - } - })) + const query = sql._query( + generateReadJson({ + filters: { + string: { + name: "John", + }, + }, + }) + ) expect(query).toEqual({ bindings: ["John%", limit], - sql: `select * from (select * from "${TABLE_NAME}" where "${TABLE_NAME}"."name" ilike $1 limit $2) as "${TABLE_NAME}"` + sql: `select * from (select * from "${TABLE_NAME}" where "${TABLE_NAME}"."name" ilike $1 limit $2) as "${TABLE_NAME}"`, }) }) it("should test a where range read", () => { - const query = sql._query(generateReadJson({ - filters: { - range: { - age: { - low: 2, - high: 10, - } - } - } - })) + const query = sql._query( + generateReadJson({ + filters: { + range: { + age: { + low: 2, + high: 10, + }, + }, + }, + }) + ) expect(query).toEqual({ bindings: [2, 10, limit], - sql: `select * from (select * from "${TABLE_NAME}" where "${TABLE_NAME}"."age" between $1 and $2 limit $3) as "${TABLE_NAME}"` + sql: `select * from (select * from "${TABLE_NAME}" where "${TABLE_NAME}"."age" between $1 and $2 limit $3) as "${TABLE_NAME}"`, }) }) it("should test for multiple IDs with OR", () => { - const query = sql._query(generateReadJson({ - filters: { - equal: { - age: 10, - name: "John", + const query = sql._query( + generateReadJson({ + filters: { + equal: { + age: 10, + name: "John", + }, + allOr: true, }, - allOr: true, - } - })) + }) + ) expect(query).toEqual({ bindings: [10, "John", limit], - sql: `select * from (select * from "${TABLE_NAME}" where ("${TABLE_NAME}"."age" = $1) or ("${TABLE_NAME}"."name" = $2) limit $3) as "${TABLE_NAME}"` + sql: `select * from (select * from "${TABLE_NAME}" where ("${TABLE_NAME}"."age" = $1) or ("${TABLE_NAME}"."name" = $2) limit $3) as "${TABLE_NAME}"`, }) }) it("should allow filtering on a related field", () => { - const query = sql._query(generateReadJson({ - filters: { - equal: { - age: 10, - "task.name": "task 1", + const query = sql._query( + generateReadJson({ + filters: { + equal: { + age: 10, + "task.name": "task 1", + }, }, - }, - })) + }) + ) // order of bindings changes because relationship filters occur outside inner query expect(query).toEqual({ bindings: [10, limit, "task 1"], - sql: `select * from (select * from "${TABLE_NAME}" where "${TABLE_NAME}"."age" = $1 limit $2) as "${TABLE_NAME}" where "task"."name" = $3` + sql: `select * from (select * from "${TABLE_NAME}" where "${TABLE_NAME}"."age" = $1 limit $2) as "${TABLE_NAME}" where "task"."name" = $3`, }) }) it("should test an create statement", () => { - const query = sql._query(generateCreateJson(TABLE_NAME, { - name: "Michael", - age: 45, - })) + const query = sql._query( + generateCreateJson(TABLE_NAME, { + name: "Michael", + age: 45, + }) + ) expect(query).toEqual({ bindings: [45, "Michael"], - sql: `insert into "${TABLE_NAME}" ("age", "name") values ($1, $2) returning *` + sql: `insert into "${TABLE_NAME}" ("age", "name") values ($1, $2) returning *`, }) }) it("should test an update statement", () => { - const query = sql._query(generateUpdateJson(TABLE_NAME, { - name: "John" - }, { - equal: { - id: 1001, - } - })) + const query = sql._query( + generateUpdateJson( + TABLE_NAME, + { + name: "John", + }, + { + equal: { + id: 1001, + }, + } + ) + ) expect(query).toEqual({ bindings: ["John", 1001], - sql: `update "${TABLE_NAME}" set "name" = $1 where "${TABLE_NAME}"."id" = $2 returning *` + sql: `update "${TABLE_NAME}" set "name" = $1 where "${TABLE_NAME}"."id" = $2 returning *`, }) }) it("should test a delete statement", () => { - const query = sql._query(generateDeleteJson(TABLE_NAME, { - equal: { - id: 1001, - } - })) + const query = sql._query( + generateDeleteJson(TABLE_NAME, { + equal: { + id: 1001, + }, + }) + ) expect(query).toEqual({ bindings: [1001], - sql: `delete from "${TABLE_NAME}" where "${TABLE_NAME}"."id" = $1 returning *` + sql: `delete from "${TABLE_NAME}" where "${TABLE_NAME}"."id" = $1 returning *`, }) }) @@ -177,7 +204,7 @@ describe("SQL query builder", () => { const query = new Sql(SqlClient.MS_SQL, 10)._query(generateReadJson()) expect(query).toEqual({ bindings: [10], - sql: `select * from (select top (@p0) * from [${TABLE_NAME}]) as [${TABLE_NAME}]` + sql: `select * from (select top (@p0) * from [${TABLE_NAME}]) as [${TABLE_NAME}]`, }) }) @@ -185,193 +212,217 @@ describe("SQL query builder", () => { const query = new Sql(SqlClient.MY_SQL, 10)._query(generateReadJson()) expect(query).toEqual({ bindings: [10], - sql: `select * from (select * from \`${TABLE_NAME}\` limit ?) as \`${TABLE_NAME}\`` + sql: `select * from (select * from \`${TABLE_NAME}\` limit ?) as \`${TABLE_NAME}\``, }) }) it("should use greater than when only low range specified", () => { const date = new Date() - const query = sql._query(generateReadJson({ - filters: { - range: { - property: { - low: date, - } - } - } - })) + const query = sql._query( + generateReadJson({ + filters: { + range: { + property: { + low: date, + }, + }, + }, + }) + ) expect(query).toEqual({ bindings: [date, limit], - sql: `select * from (select * from "${TABLE_NAME}" where "${TABLE_NAME}"."property" > $1 limit $2) as "${TABLE_NAME}"` + sql: `select * from (select * from "${TABLE_NAME}" where "${TABLE_NAME}"."property" > $1 limit $2) as "${TABLE_NAME}"`, }) }) it("should use less than when only high range specified", () => { const date = new Date() - const query = sql._query(generateReadJson({ - filters: { - range: { - property: { - high: date, - } - } - } - })) + const query = sql._query( + generateReadJson({ + filters: { + range: { + property: { + high: date, + }, + }, + }, + }) + ) expect(query).toEqual({ bindings: [date, limit], - sql: `select * from (select * from "${TABLE_NAME}" where "${TABLE_NAME}"."property" < $1 limit $2) as "${TABLE_NAME}"` + sql: `select * from (select * from "${TABLE_NAME}" where "${TABLE_NAME}"."property" < $1 limit $2) as "${TABLE_NAME}"`, }) }) it("should use greater than when only low range specified", () => { const date = new Date() - const query = sql._query(generateReadJson({ - filters: { - range: { - property: { - low: date, - } - } - } - })) + const query = sql._query( + generateReadJson({ + filters: { + range: { + property: { + low: date, + }, + }, + }, + }) + ) expect(query).toEqual({ bindings: [date, limit], - sql: `select * from (select * from "${TABLE_NAME}" where "${TABLE_NAME}"."property" > $1 limit $2) as "${TABLE_NAME}"` + sql: `select * from (select * from "${TABLE_NAME}" where "${TABLE_NAME}"."property" > $1 limit $2) as "${TABLE_NAME}"`, }) }) it("should use AND like expression for MS-SQL when filter is contains", () => { - const query = new Sql(SqlClient.MS_SQL, 10)._query(generateReadJson({ - filters: { - contains: { - age: [20, 25], - name: ["John", "Mary"] - } - } - })) + const query = new Sql(SqlClient.MS_SQL, 10)._query( + generateReadJson({ + filters: { + contains: { + age: [20, 25], + name: ["John", "Mary"], + }, + }, + }) + ) expect(query).toEqual({ bindings: [10, "%20%", "%25%", `%"John"%`, `%"Mary"%`], - sql: `select * from (select top (@p0) * from [${TABLE_NAME}] where (LOWER(${TABLE_NAME}.age) LIKE @p1 AND LOWER(${TABLE_NAME}.age) LIKE @p2) and (LOWER(${TABLE_NAME}.name) LIKE @p3 AND LOWER(${TABLE_NAME}.name) LIKE @p4)) as [${TABLE_NAME}]` + sql: `select * from (select top (@p0) * from [${TABLE_NAME}] where (LOWER(${TABLE_NAME}.age) LIKE @p1 AND LOWER(${TABLE_NAME}.age) LIKE @p2) and (LOWER(${TABLE_NAME}.name) LIKE @p3 AND LOWER(${TABLE_NAME}.name) LIKE @p4)) as [${TABLE_NAME}]`, }) }) it("should use JSON_CONTAINS expression for MySQL when filter is contains", () => { - const query = new Sql(SqlClient.MY_SQL, 10)._query(generateReadJson({ - filters: { - contains: { - age: [20], - name: ["John"] - } - } - })) + const query = new Sql(SqlClient.MY_SQL, 10)._query( + generateReadJson({ + filters: { + contains: { + age: [20], + name: ["John"], + }, + }, + }) + ) expect(query).toEqual({ bindings: [10], - sql: `select * from (select * from \`${TABLE_NAME}\` where JSON_CONTAINS(${TABLE_NAME}.age, '[20]') and JSON_CONTAINS(${TABLE_NAME}.name, '["John"]') limit ?) as \`${TABLE_NAME}\`` + sql: `select * from (select * from \`${TABLE_NAME}\` where JSON_CONTAINS(${TABLE_NAME}.age, '[20]') and JSON_CONTAINS(${TABLE_NAME}.name, '["John"]') limit ?) as \`${TABLE_NAME}\``, }) }) it("should use jsonb operator expression for PostgreSQL when filter is contains", () => { - const query = new Sql(SqlClient.POSTGRES, 10)._query(generateReadJson({ - filters: { - contains: { - age: [20], - name: ["John"] - } - } - })) + const query = new Sql(SqlClient.POSTGRES, 10)._query( + generateReadJson({ + filters: { + contains: { + age: [20], + name: ["John"], + }, + }, + }) + ) expect(query).toEqual({ bindings: [10], - sql: `select * from (select * from \"${TABLE_NAME}\" where \"${TABLE_NAME}\".\"age\"::jsonb @> '[20]' and \"${TABLE_NAME}\".\"name\"::jsonb @> '["John"]' limit $1) as \"${TABLE_NAME}\"` + sql: `select * from (select * from \"${TABLE_NAME}\" where \"${TABLE_NAME}\".\"age\"::jsonb @> '[20]' and \"${TABLE_NAME}\".\"name\"::jsonb @> '["John"]' limit $1) as \"${TABLE_NAME}\"`, }) }) it("should use NOT like expression for MS-SQL when filter is notContains", () => { - const query = new Sql(SqlClient.MS_SQL, 10)._query(generateReadJson({ - filters: { - notContains: { - age: [20], - name: ["John"] - } - } - })) + const query = new Sql(SqlClient.MS_SQL, 10)._query( + generateReadJson({ + filters: { + notContains: { + age: [20], + name: ["John"], + }, + }, + }) + ) expect(query).toEqual({ bindings: [10, "%20%", `%"John"%`], - sql: `select * from (select top (@p0) * from [${TABLE_NAME}] where NOT (LOWER(${TABLE_NAME}.age) LIKE @p1) and NOT (LOWER(${TABLE_NAME}.name) LIKE @p2)) as [${TABLE_NAME}]` + sql: `select * from (select top (@p0) * from [${TABLE_NAME}] where NOT (LOWER(${TABLE_NAME}.age) LIKE @p1) and NOT (LOWER(${TABLE_NAME}.name) LIKE @p2)) as [${TABLE_NAME}]`, }) }) it("should use NOT JSON_CONTAINS expression for MySQL when filter is notContains", () => { - const query = new Sql(SqlClient.MY_SQL, 10)._query(generateReadJson({ - filters: { - notContains: { - age: [20], - name: ["John"] - } - } - })) + const query = new Sql(SqlClient.MY_SQL, 10)._query( + generateReadJson({ + filters: { + notContains: { + age: [20], + name: ["John"], + }, + }, + }) + ) expect(query).toEqual({ bindings: [10], - sql: `select * from (select * from \`${TABLE_NAME}\` where NOT JSON_CONTAINS(${TABLE_NAME}.age, '[20]') and NOT JSON_CONTAINS(${TABLE_NAME}.name, '["John"]') limit ?) as \`${TABLE_NAME}\`` + sql: `select * from (select * from \`${TABLE_NAME}\` where NOT JSON_CONTAINS(${TABLE_NAME}.age, '[20]') and NOT JSON_CONTAINS(${TABLE_NAME}.name, '["John"]') limit ?) as \`${TABLE_NAME}\``, }) }) it("should use jsonb operator NOT expression for PostgreSQL when filter is notContains", () => { - const query = new Sql(SqlClient.POSTGRES, 10)._query(generateReadJson({ - filters: { - notContains: { - age: [20], - name: ["John"] - } - } - })) + const query = new Sql(SqlClient.POSTGRES, 10)._query( + generateReadJson({ + filters: { + notContains: { + age: [20], + name: ["John"], + }, + }, + }) + ) expect(query).toEqual({ bindings: [10], - sql: `select * from (select * from \"${TABLE_NAME}\" where NOT \"${TABLE_NAME}\".\"age\"::jsonb @> '[20]' and NOT \"${TABLE_NAME}\".\"name\"::jsonb @> '["John"]' limit $1) as \"${TABLE_NAME}\"` + sql: `select * from (select * from \"${TABLE_NAME}\" where NOT \"${TABLE_NAME}\".\"age\"::jsonb @> '[20]' and NOT \"${TABLE_NAME}\".\"name\"::jsonb @> '["John"]' limit $1) as \"${TABLE_NAME}\"`, }) }) it("should use OR like expression for MS-SQL when filter is containsAny", () => { - const query = new Sql(SqlClient.MS_SQL, 10)._query(generateReadJson({ - filters: { - containsAny: { - age: [20, 25], - name: ["John", "Mary"] - } - } - })) + const query = new Sql(SqlClient.MS_SQL, 10)._query( + generateReadJson({ + filters: { + containsAny: { + age: [20, 25], + name: ["John", "Mary"], + }, + }, + }) + ) expect(query).toEqual({ bindings: [10, "%20%", "%25%", `%"John"%`, `%"Mary"%`], - sql: `select * from (select top (@p0) * from [${TABLE_NAME}] where (LOWER(${TABLE_NAME}.age) LIKE @p1 OR LOWER(${TABLE_NAME}.age) LIKE @p2) and (LOWER(${TABLE_NAME}.name) LIKE @p3 OR LOWER(${TABLE_NAME}.name) LIKE @p4)) as [${TABLE_NAME}]` + sql: `select * from (select top (@p0) * from [${TABLE_NAME}] where (LOWER(${TABLE_NAME}.age) LIKE @p1 OR LOWER(${TABLE_NAME}.age) LIKE @p2) and (LOWER(${TABLE_NAME}.name) LIKE @p3 OR LOWER(${TABLE_NAME}.name) LIKE @p4)) as [${TABLE_NAME}]`, }) }) it("should use JSON_OVERLAPS expression for MySQL when filter is containsAny", () => { - const query = new Sql(SqlClient.MY_SQL, 10)._query(generateReadJson({ - filters: { - containsAny: { - age: [20, 25], - name: ["John", "Mary"] - } - } - })) + const query = new Sql(SqlClient.MY_SQL, 10)._query( + generateReadJson({ + filters: { + containsAny: { + age: [20, 25], + name: ["John", "Mary"], + }, + }, + }) + ) expect(query).toEqual({ bindings: [10], - sql: `select * from (select * from \`${TABLE_NAME}\` where JSON_OVERLAPS(${TABLE_NAME}.age, '[20,25]') and JSON_OVERLAPS(${TABLE_NAME}.name, '["John","Mary"]') limit ?) as \`${TABLE_NAME}\`` + sql: `select * from (select * from \`${TABLE_NAME}\` where JSON_OVERLAPS(${TABLE_NAME}.age, '[20,25]') and JSON_OVERLAPS(${TABLE_NAME}.name, '["John","Mary"]') limit ?) as \`${TABLE_NAME}\``, }) }) it("should use ?| operator expression for PostgreSQL when filter is containsAny", () => { - const query = new Sql(SqlClient.POSTGRES, 10)._query(generateReadJson({ - filters: { - containsAny: { - age: [20, 25], - name: ["John", "Mary"] - } - } - })) + const query = new Sql(SqlClient.POSTGRES, 10)._query( + generateReadJson({ + filters: { + containsAny: { + age: [20, 25], + name: ["John", "Mary"], + }, + }, + }) + ) expect(query).toEqual({ bindings: [10], - sql: `select * from (select * from \"${TABLE_NAME}\" where \"${TABLE_NAME}\".\"age\"::jsonb ?| array [20,25] and \"${TABLE_NAME}\".\"name\"::jsonb ?| array ['John','Mary'] limit $1) as \"${TABLE_NAME}\"` + sql: `select * from (select * from \"${TABLE_NAME}\" where \"${TABLE_NAME}\".\"age\"::jsonb ?| array [20,25] and \"${TABLE_NAME}\".\"name\"::jsonb ?| array ['John','Mary'] limit $1) as \"${TABLE_NAME}\"`, }) }) }) From 3336dcdaa160112b45aeefc8047b7f0a0f04fc6f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 1 Sep 2022 12:51:28 +0100 Subject: [PATCH 071/260] Update watch params to use polling and improve speed --- packages/server/src/watch.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/server/src/watch.ts b/packages/server/src/watch.ts index 3d3f4280da..9821d1127b 100644 --- a/packages/server/src/watch.ts +++ b/packages/server/src/watch.ts @@ -11,7 +11,12 @@ export function watch() { chokidar .watch(watchPath, { ignored: "**/node_modules", - awaitWriteFinish: true, + awaitWriteFinish: { + pollInterval: 100, + stabilityThreshold: 250, + }, + usePolling: true, + interval: 250, }) .on("all", async (event: string, path: string) => { // Sanity checks From 72277bd015b57b0a76a9557ff961c91565e62a95 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 1 Sep 2022 14:10:29 +0100 Subject: [PATCH 072/260] Remove extra space --- charts/budibase/templates/app-service-deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/budibase/templates/app-service-deployment.yaml b/charts/budibase/templates/app-service-deployment.yaml index 89bc2e578d..a9bf714c45 100644 --- a/charts/budibase/templates/app-service-deployment.yaml +++ b/charts/budibase/templates/app-service-deployment.yaml @@ -132,7 +132,7 @@ spec: {{ end }} {{ if .Values.globals.pluginsDir }} - name: PLUGINS_DIR - value: { { .Values.globals.pluginsDir | quote }} + value: {{ .Values.globals.pluginsDir | quote }} {{ end }} {{ if .Values.services.apps.nodeDebug }} - name: NODE_DEBUG From b29e9be026dfae116ec1c1fdd4e4cb608f8a8c86 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Thu, 1 Sep 2022 17:21:42 +0100 Subject: [PATCH 073/260] Exclude formula columns from Sql drop column --- packages/server/src/integrations/base/sqlTable.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/server/src/integrations/base/sqlTable.ts b/packages/server/src/integrations/base/sqlTable.ts index 4b715e5f3a..af561e81c5 100644 --- a/packages/server/src/integrations/base/sqlTable.ts +++ b/packages/server/src/integrations/base/sqlTable.ts @@ -96,7 +96,9 @@ function generateSchema( const deletedColumns = Object.entries(oldTable.schema) .filter( ([key, schema]) => - schema.type !== FieldTypes.LINK && table.schema[key] == null + schema.type !== FieldTypes.LINK && + schema.type !== FieldTypes.FORMULA && + table.schema[key] == null ) .map(([key]) => key) deletedColumns.forEach(key => { From 54eed13541f4075547b8fcc7081c8616d8938b4b Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Thu, 1 Sep 2022 20:04:45 +0100 Subject: [PATCH 074/260] create plugin github public and private --- packages/builder/src/stores/portal/plugins.js | 4 +- packages/server/src/api/controllers/plugin.ts | 6 +- .../server/src/utilities/fileSystem/index.js | 65 ++++++++++++++++++- 3 files changed, 71 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/stores/portal/plugins.js b/packages/builder/src/stores/portal/plugins.js index a498bf663a..821934307d 100644 --- a/packages/builder/src/stores/portal/plugins.js +++ b/packages/builder/src/stores/portal/plugins.js @@ -32,10 +32,12 @@ export function createPluginsStore() { case "npm": pluginData.npmToken = auth break + case "github": + pluginData.githubToken = auth + break } let res = await API.createPlugin(pluginData) - console.log("RESP", res) let newPlugin = res.plugins[0] update(state => { diff --git a/packages/server/src/api/controllers/plugin.ts b/packages/server/src/api/controllers/plugin.ts index 26caf38806..1159b08dce 100644 --- a/packages/server/src/api/controllers/plugin.ts +++ b/packages/server/src/api/controllers/plugin.ts @@ -3,6 +3,7 @@ import { extractPluginTarball, createNpmPlugin, createUrlPlugin, + createGithubPlugin, } from "../../utilities/fileSystem" import { getGlobalDB } from "@budibase/backend-core/tenancy" import { generatePluginID, getPluginParams } from "../../db/utils" @@ -61,7 +62,10 @@ export async function create(ctx: any) { directory = directoryNpm break case "github": - console.log("github") + const { metadata: metadataGithub, directory: directoryGithub } = + await createGithubPlugin(ctx, url, name, githubToken) + metadata = metadataGithub + directory = directoryGithub break case "url": const { metadata: metadataUrl, directory: directoryUrl } = diff --git a/packages/server/src/utilities/fileSystem/index.js b/packages/server/src/utilities/fileSystem/index.js index 710e3c0294..d8c201a380 100644 --- a/packages/server/src/utilities/fileSystem/index.js +++ b/packages/server/src/utilities/fileSystem/index.js @@ -31,6 +31,7 @@ const MemoryStream = require("memorystream") const { getAppId } = require("@budibase/backend-core/context") const tar = require("tar") const fetch = require("node-fetch") +const { NodeVM } = require("vm2") const TOP_LEVEL_PATH = join(__dirname, "..", "..", "..") const NODE_MODULES_PATH = join(TOP_LEVEL_PATH, "node_modules") @@ -378,8 +379,69 @@ exports.createUrlPlugin = async (url, name = "", headers = {}) => { return await downloadUnzipPlugin(name, url, headers) } +exports.createGithubPlugin = async (ctx, url, name = "", token = "") => { + let githubRepositoryUrl + let githubUrl + + if (url.includes(".git")) { + githubRepositoryUrl = token + ? url.replace("https://", `https://${token}@`) + : url + githubUrl = url.replace(".git", "") + } else { + githubRepositoryUrl = token + ? `${url}.git`.replace("https://", `https://${token}@`) + : `${url}.git` + githubUrl = url + } + + const githubApiUrl = githubUrl.replace( + "https://github.com/", + "https://api.github.com/repos/" + ) + const headers = token ? { Authorization: `Bearer ${token}` } : {} + try { + const pluginRaw = await fetch(githubApiUrl, { headers }) + if (pluginRaw.status !== 200) { + throw `Repository not found` + } + + let pluginDetails = await pluginRaw.json() + const pluginName = pluginDetails.name || name + + const path = join(budibaseTempDir(), pluginName) + // Remove first if exists + if (fs.existsSync(path)) { + fs.rmSync(path, { recursive: true, force: true }) + } + fs.mkdirSync(path) + + const script = ` +module.exports = async () => { + const child_process = require('child_process') + child_process.execSync(\`git clone ${githubRepositoryUrl} ${join( + budibaseTempDir(), + pluginName + )}\`); +} +` + const scriptRunner = new NodeVM({ + require: { + external: true, + builtin: ["child_process"], + root: "./", + }, + }).run(script) + + await scriptRunner() + + return await getPluginMetadata(path) + } catch (e) { + throw e.message + } +} + const downloadUnzipPlugin = async (name, url, headers = {}) => { - console.log(name, url, headers) const path = join(budibaseTempDir(), name) try { // Remove first if exists @@ -407,7 +469,6 @@ const downloadUnzipPlugin = async (name, url, headers = {}) => { exports.downloadUnzipPlugin = downloadUnzipPlugin const getPluginMetadata = async path => { - console.log(path) let metadata = {} try { const pkg = fs.readFileSync(join(path, "package.json"), "utf8") From e79d414bd4b1550bbb1e3b3772515b0c706405bf Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 2 Sep 2022 09:52:52 +0000 Subject: [PATCH 075/260] v1.2.59 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lerna.json b/lerna.json index 4974a78682..31155ea968 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.2.59-alpha.0", + "version": "1.2.59", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 1b0304cb91..0107eda8e6 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.2.59-alpha.0", + "version": "1.2.59", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "1.2.59-alpha.0", + "@budibase/types": "^1.2.59", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 13c695d015..7176883c08 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.2.59-alpha.0", + "version": "1.2.59", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "1.2.59-alpha.0", + "@budibase/string-templates": "^1.2.59", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 425153a832..b62cb954c5 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.2.59-alpha.0", + "version": "1.2.59", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "1.2.59-alpha.0", - "@budibase/client": "1.2.59-alpha.0", - "@budibase/frontend-core": "1.2.59-alpha.0", - "@budibase/string-templates": "1.2.59-alpha.0", + "@budibase/bbui": "^1.2.59", + "@budibase/client": "^1.2.59", + "@budibase/frontend-core": "^1.2.59", + "@budibase/string-templates": "^1.2.59", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 8213d4e914..ae14ca1ff2 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.2.59-alpha.0", + "version": "1.2.59", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 0c00c1a702..0c3288cba4 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.2.59-alpha.0", + "version": "1.2.59", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "1.2.59-alpha.0", - "@budibase/frontend-core": "1.2.59-alpha.0", - "@budibase/string-templates": "1.2.59-alpha.0", + "@budibase/bbui": "^1.2.59", + "@budibase/frontend-core": "^1.2.59", + "@budibase/string-templates": "^1.2.59", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 8403e5034e..f781844301 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.2.59-alpha.0", + "version": "1.2.59", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "1.2.59-alpha.0", + "@budibase/bbui": "^1.2.59", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 9f1210fb32..f264614b36 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.2.59-alpha.0", + "version": "1.2.59", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "1.2.59-alpha.0", - "@budibase/client": "1.2.59-alpha.0", + "@budibase/backend-core": "^1.2.59", + "@budibase/client": "^1.2.59", "@budibase/pro": "1.2.59-alpha.0", - "@budibase/string-templates": "1.2.59-alpha.0", - "@budibase/types": "1.2.59-alpha.0", + "@budibase/string-templates": "^1.2.59", + "@budibase/types": "^1.2.59", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 6034e76a32..74b3364691 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.2.59-alpha.0", + "version": "1.2.59", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 8e9f4c2391..e6180bdced 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.2.59-alpha.0", + "version": "1.2.59", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index e9708628a1..b91735c15c 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.2.59-alpha.0", + "version": "1.2.59", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "1.2.59-alpha.0", + "@budibase/backend-core": "^1.2.59", "@budibase/pro": "1.2.59-alpha.0", - "@budibase/string-templates": "1.2.59-alpha.0", - "@budibase/types": "1.2.59-alpha.0", + "@budibase/string-templates": "^1.2.59", + "@budibase/types": "^1.2.59", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From f5cda8e455907f0b7baaa520961fa8c9f8e20ddc Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 2 Sep 2022 09:55:58 +0000 Subject: [PATCH 076/260] Update pro version to 1.2.59 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index f264614b36..29ab0a51a2 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^1.2.59", "@budibase/client": "^1.2.59", - "@budibase/pro": "1.2.59-alpha.0", + "@budibase/pro": "1.2.59", "@budibase/string-templates": "^1.2.59", "@budibase/types": "^1.2.59", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 93ba08da8c..82fce94706 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.59-alpha.0": - version "1.2.59-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.59-alpha.0.tgz#34330175c26e31ec4838891e8ed561d5f75f1158" - integrity sha512-dXVX+IKeNMUIQUAH52E/9D73s+PSkXeU5m7dGjGeiWZQ2m3CALX0XhdL64NVEmpwmKwJVEvagi26lQSYwVrSyQ== +"@budibase/backend-core@1.2.59": + version "1.2.59" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.59.tgz#283b4c8bb24c4deacc28b3fb10dfb59d0e63e6ac" + integrity sha512-QC/ftdhdIQPTFbbGG4c5F7BqwPBQpevzj21GuYNbMda3OQPn6nS5SKK0fP99/DRSf9WIRi+5Pg1fzlHg2DIQLA== dependencies: - "@budibase/types" "1.2.59-alpha.0" + "@budibase/types" "^1.2.59" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1178,13 +1178,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.2.59-alpha.0": - version "1.2.59-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.59-alpha.0.tgz#191865bf170832b17566336b047d3461f6036009" - integrity sha512-nP8LL0eZdWpLZ4NViou31dE3uY1dQPJDzvFE9r71OsSLG6KGHS7fkkMA+4hq3gfrsPzAIp729m6RroksqnnKGw== +"@budibase/pro@1.2.59": + version "1.2.59" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.59.tgz#2f266d9ede1f722d879841fdb8da1a98a0628136" + integrity sha512-QwNRb5JT+SZaES3sUFxxQA6Ep2dH/fVqXrnzKPV/CoMa43YWkjOUTX2hjgmOWDsipBK90RK3wRYzcTG0BgEkJw== dependencies: - "@budibase/backend-core" "1.2.59-alpha.0" - "@budibase/types" "1.2.59-alpha.0" + "@budibase/backend-core" "1.2.59" + "@budibase/types" "1.2.59" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1207,10 +1207,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.2.59-alpha.0": - version "1.2.59-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.59-alpha.0.tgz#7d77598607865a0f5b9a7c9063e0f7a774ebd2a1" - integrity sha512-ddoqBxRKYl3biVmg3l3jFE/eB8DvL1VqMA/sIaVYU16Js913pU0jauT9Z/y2uqiGescfoZReCabBjD7qhr6L7w== +"@budibase/types@1.2.59", "@budibase/types@^1.2.59": + version "1.2.59" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.59.tgz#e2a04f7fffcb68bd2cd12043430c0bf0db07ae71" + integrity sha512-2DpKE7NMGh2th/obOjT32uxLpQjyGLVQ925yM164pSvfZUyNA3zkQhOmNoMS9HJVHVavHyHVfSgGDQrF0YfNhA== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index b91735c15c..0ade9a8363 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.2.59", - "@budibase/pro": "1.2.59-alpha.0", + "@budibase/pro": "1.2.59", "@budibase/string-templates": "^1.2.59", "@budibase/types": "^1.2.59", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index f5cb949c22..931ba934d7 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.59-alpha.0": - version "1.2.59-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.59-alpha.0.tgz#34330175c26e31ec4838891e8ed561d5f75f1158" - integrity sha512-dXVX+IKeNMUIQUAH52E/9D73s+PSkXeU5m7dGjGeiWZQ2m3CALX0XhdL64NVEmpwmKwJVEvagi26lQSYwVrSyQ== +"@budibase/backend-core@1.2.59": + version "1.2.59" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.59.tgz#283b4c8bb24c4deacc28b3fb10dfb59d0e63e6ac" + integrity sha512-QC/ftdhdIQPTFbbGG4c5F7BqwPBQpevzj21GuYNbMda3OQPn6nS5SKK0fP99/DRSf9WIRi+5Pg1fzlHg2DIQLA== dependencies: - "@budibase/types" "1.2.59-alpha.0" + "@budibase/types" "^1.2.59" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -325,21 +325,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.2.59-alpha.0": - version "1.2.59-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.59-alpha.0.tgz#191865bf170832b17566336b047d3461f6036009" - integrity sha512-nP8LL0eZdWpLZ4NViou31dE3uY1dQPJDzvFE9r71OsSLG6KGHS7fkkMA+4hq3gfrsPzAIp729m6RroksqnnKGw== +"@budibase/pro@1.2.59": + version "1.2.59" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.59.tgz#2f266d9ede1f722d879841fdb8da1a98a0628136" + integrity sha512-QwNRb5JT+SZaES3sUFxxQA6Ep2dH/fVqXrnzKPV/CoMa43YWkjOUTX2hjgmOWDsipBK90RK3wRYzcTG0BgEkJw== dependencies: - "@budibase/backend-core" "1.2.59-alpha.0" - "@budibase/types" "1.2.59-alpha.0" + "@budibase/backend-core" "1.2.59" + "@budibase/types" "1.2.59" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.2.59-alpha.0": - version "1.2.59-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.59-alpha.0.tgz#7d77598607865a0f5b9a7c9063e0f7a774ebd2a1" - integrity sha512-ddoqBxRKYl3biVmg3l3jFE/eB8DvL1VqMA/sIaVYU16Js913pU0jauT9Z/y2uqiGescfoZReCabBjD7qhr6L7w== +"@budibase/types@1.2.59", "@budibase/types@^1.2.59": + version "1.2.59" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.59.tgz#e2a04f7fffcb68bd2cd12043430c0bf0db07ae71" + integrity sha512-2DpKE7NMGh2th/obOjT32uxLpQjyGLVQ925yM164pSvfZUyNA3zkQhOmNoMS9HJVHVavHyHVfSgGDQrF0YfNhA== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 28aaaf96617ae1dfe254cf3e0441ecd6d9647b22 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 2 Sep 2022 11:48:45 +0100 Subject: [PATCH 077/260] Update vite path for proxying websocket to be /vite --- hosting/nginx.dev.conf.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosting/nginx.dev.conf.hbs b/hosting/nginx.dev.conf.hbs index ecf73c4fb1..430ea75398 100644 --- a/hosting/nginx.dev.conf.hbs +++ b/hosting/nginx.dev.conf.hbs @@ -84,9 +84,9 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } - location /ws { + location /vite { proxy_pass http://{{ address }}:3000; - rewrite ^/ws(.*)$ /$1 break; + rewrite ^/vite(.*)$ /$1 break; } location / { From cc50f696ff37cbea18cd1c42971feba4c9952331 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 2 Sep 2022 12:04:18 +0100 Subject: [PATCH 078/260] Remove logs --- packages/client/src/websocket.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/client/src/websocket.js b/packages/client/src/websocket.js index 1a4ee49a92..eb859933f7 100644 --- a/packages/client/src/websocket.js +++ b/packages/client/src/websocket.js @@ -15,7 +15,6 @@ export const initWebsocket = () => { const proto = tls ? "wss:" : "ws:" const host = location.hostname const port = location.port || (tls ? 443 : 80) - console.log(`${proto}//${host}:${port}`) const socket = io(`${proto}//${host}:${port}`, { path: "/socket/client", }) From 6bd942840d4a400c5aa1404a22cf982778f15273 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 2 Sep 2022 11:10:25 +0000 Subject: [PATCH 079/260] v1.3.0 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lerna.json b/lerna.json index 31155ea968..b43a0447b1 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.2.59", + "version": "1.3.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 0107eda8e6..fb887f972b 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.2.59", + "version": "1.3.0", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "^1.2.59", + "@budibase/types": "^1.3.0", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 7176883c08..0c0a362965 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.2.59", + "version": "1.3.0", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.2.59", + "@budibase/string-templates": "^1.3.0", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index b62cb954c5..b81c91039b 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.2.59", + "version": "1.3.0", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.2.59", - "@budibase/client": "^1.2.59", - "@budibase/frontend-core": "^1.2.59", - "@budibase/string-templates": "^1.2.59", + "@budibase/bbui": "^1.3.0", + "@budibase/client": "^1.3.0", + "@budibase/frontend-core": "^1.3.0", + "@budibase/string-templates": "^1.3.0", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index ae14ca1ff2..bcb56d1b84 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.2.59", + "version": "1.3.0", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 0c3288cba4..645469958b 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.2.59", + "version": "1.3.0", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.2.59", - "@budibase/frontend-core": "^1.2.59", - "@budibase/string-templates": "^1.2.59", + "@budibase/bbui": "^1.3.0", + "@budibase/frontend-core": "^1.3.0", + "@budibase/string-templates": "^1.3.0", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index f781844301..bd29f9ba4e 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.2.59", + "version": "1.3.0", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.2.59", + "@budibase/bbui": "^1.3.0", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 29ab0a51a2..a09d8d051b 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.2.59", + "version": "1.3.0", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^1.2.59", - "@budibase/client": "^1.2.59", + "@budibase/backend-core": "^1.3.0", + "@budibase/client": "^1.3.0", "@budibase/pro": "1.2.59", - "@budibase/string-templates": "^1.2.59", - "@budibase/types": "^1.2.59", + "@budibase/string-templates": "^1.3.0", + "@budibase/types": "^1.3.0", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 74b3364691..bdf09fcaa6 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.2.59", + "version": "1.3.0", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index e6180bdced..0c7ea2cb2d 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.2.59", + "version": "1.3.0", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 0ade9a8363..6bb723e8d1 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.2.59", + "version": "1.3.0", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.2.59", + "@budibase/backend-core": "^1.3.0", "@budibase/pro": "1.2.59", - "@budibase/string-templates": "^1.2.59", - "@budibase/types": "^1.2.59", + "@budibase/string-templates": "^1.3.0", + "@budibase/types": "^1.3.0", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 2cbacb266e7b503c6f6c046be581e0b2292b14c2 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 2 Sep 2022 11:23:26 +0000 Subject: [PATCH 080/260] v1.3.1 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lerna.json b/lerna.json index b43a0447b1..9949bcfa80 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.0", + "version": "1.3.1", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index fb887f972b..12d13ca518 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.3.0", + "version": "1.3.1", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "^1.3.0", + "@budibase/types": "^1.3.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 0c0a362965..77e5e906d8 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.3.0", + "version": "1.3.1", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.3.0", + "@budibase/string-templates": "^1.3.1", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index b81c91039b..6463407199 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.3.0", + "version": "1.3.1", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.3.0", - "@budibase/client": "^1.3.0", - "@budibase/frontend-core": "^1.3.0", - "@budibase/string-templates": "^1.3.0", + "@budibase/bbui": "^1.3.1", + "@budibase/client": "^1.3.1", + "@budibase/frontend-core": "^1.3.1", + "@budibase/string-templates": "^1.3.1", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index bcb56d1b84..af28c5f851 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.3.0", + "version": "1.3.1", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 645469958b..723a9f91f7 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.3.0", + "version": "1.3.1", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.3.0", - "@budibase/frontend-core": "^1.3.0", - "@budibase/string-templates": "^1.3.0", + "@budibase/bbui": "^1.3.1", + "@budibase/frontend-core": "^1.3.1", + "@budibase/string-templates": "^1.3.1", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index bd29f9ba4e..8917ae11cf 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.3.0", + "version": "1.3.1", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.3.0", + "@budibase/bbui": "^1.3.1", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index a09d8d051b..103ea8992d 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.3.0", + "version": "1.3.1", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^1.3.0", - "@budibase/client": "^1.3.0", + "@budibase/backend-core": "^1.3.1", + "@budibase/client": "^1.3.1", "@budibase/pro": "1.2.59", - "@budibase/string-templates": "^1.3.0", - "@budibase/types": "^1.3.0", + "@budibase/string-templates": "^1.3.1", + "@budibase/types": "^1.3.1", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index bdf09fcaa6..dfa6736936 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.3.0", + "version": "1.3.1", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 0c7ea2cb2d..374989a52d 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.3.0", + "version": "1.3.1", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 6bb723e8d1..60cf16253c 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.3.0", + "version": "1.3.1", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.3.0", + "@budibase/backend-core": "^1.3.1", "@budibase/pro": "1.2.59", - "@budibase/string-templates": "^1.3.0", - "@budibase/types": "^1.3.0", + "@budibase/string-templates": "^1.3.1", + "@budibase/types": "^1.3.1", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From a794e19dfc036acbeeaec14d85b1f6a39305d650 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 2 Sep 2022 12:26:30 +0100 Subject: [PATCH 081/260] Update nginx confs and add to single image --- hosting/nginx.dev.conf.hbs | 3 +-- hosting/nginx.prod.conf.hbs | 9 +++++++++ hosting/single/nginx/nginx-default-site.conf | 9 +++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/hosting/nginx.dev.conf.hbs b/hosting/nginx.dev.conf.hbs index 778dc9dacd..7faa92e38a 100644 --- a/hosting/nginx.dev.conf.hbs +++ b/hosting/nginx.dev.conf.hbs @@ -90,13 +90,12 @@ http { } location /socket/ { - proxy_pass http://{{ address }}:4001; - proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; + proxy_pass http://{{ address }}:4001; } location / { diff --git a/hosting/nginx.prod.conf.hbs b/hosting/nginx.prod.conf.hbs index 5ecea67c42..5b69d2ab5c 100644 --- a/hosting/nginx.prod.conf.hbs +++ b/hosting/nginx.prod.conf.hbs @@ -162,6 +162,15 @@ http { rewrite ^/db/(.*)$ /$1 break; } + location /socket/ { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + proxy_pass http://$apps:4002; + } + location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/hosting/single/nginx/nginx-default-site.conf b/hosting/single/nginx/nginx-default-site.conf index c0d80a0185..bd89e21251 100644 --- a/hosting/single/nginx/nginx-default-site.conf +++ b/hosting/single/nginx/nginx-default-site.conf @@ -66,6 +66,15 @@ server { rewrite ^/db/(.*)$ /$1 break; } + location /socket/ { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + proxy_pass http://127.0.0.1:4001; + } + location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; From bf1587f82b182c76810ce648f99b99e88290a5d2 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 2 Sep 2022 11:26:39 +0000 Subject: [PATCH 082/260] Update pro version to 1.3.1 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 103ea8992d..24878de855 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^1.3.1", "@budibase/client": "^1.3.1", - "@budibase/pro": "1.2.59", + "@budibase/pro": "1.3.1", "@budibase/string-templates": "^1.3.1", "@budibase/types": "^1.3.1", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 82fce94706..3352038d8e 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.59": - version "1.2.59" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.59.tgz#283b4c8bb24c4deacc28b3fb10dfb59d0e63e6ac" - integrity sha512-QC/ftdhdIQPTFbbGG4c5F7BqwPBQpevzj21GuYNbMda3OQPn6nS5SKK0fP99/DRSf9WIRi+5Pg1fzlHg2DIQLA== +"@budibase/backend-core@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.1.tgz#7fb6437d9d8926c1500f8dd2ce51bc5e850b354a" + integrity sha512-H9iqfcVX/XSxJr9aWkhIUHD87fdJgDHpd6Gdkjsx/Ua3z3UJeW2dfkcP3so2MM/hPLpP181hOaFjk2/lDBiagw== dependencies: - "@budibase/types" "^1.2.59" + "@budibase/types" "^1.3.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1178,13 +1178,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.2.59": - version "1.2.59" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.59.tgz#2f266d9ede1f722d879841fdb8da1a98a0628136" - integrity sha512-QwNRb5JT+SZaES3sUFxxQA6Ep2dH/fVqXrnzKPV/CoMa43YWkjOUTX2hjgmOWDsipBK90RK3wRYzcTG0BgEkJw== +"@budibase/pro@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.1.tgz#5ab732dbdf30a1967ca5e92b4de48518d538cb32" + integrity sha512-ErZhpeMvhiN8bLkoXe0N/yBU1wHDnk962tQ2tzMqlkWE4fCtfvo3SxD7VsYbu6Qmakkys1QPd6lBphnBOw58FQ== dependencies: - "@budibase/backend-core" "1.2.59" - "@budibase/types" "1.2.59" + "@budibase/backend-core" "1.3.1" + "@budibase/types" "1.3.1" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1207,10 +1207,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.2.59", "@budibase/types@^1.2.59": - version "1.2.59" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.59.tgz#e2a04f7fffcb68bd2cd12043430c0bf0db07ae71" - integrity sha512-2DpKE7NMGh2th/obOjT32uxLpQjyGLVQ925yM164pSvfZUyNA3zkQhOmNoMS9HJVHVavHyHVfSgGDQrF0YfNhA== +"@budibase/types@1.3.1", "@budibase/types@^1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.1.tgz#84a8b0e6c574d6b53c50ffe2c6fba59241ede98b" + integrity sha512-dAZvJzvw0phvLub6nmeH4sPDWKqPQH6QrFjOcgE6XR/7o7QjwTCJ00Jz07FBjh/ax+/9v6y/GauozejoESwA2w== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 60cf16253c..d8f1aa8357 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.3.1", - "@budibase/pro": "1.2.59", + "@budibase/pro": "1.3.1", "@budibase/string-templates": "^1.3.1", "@budibase/types": "^1.3.1", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 931ba934d7..959b86fa00 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.2.59": - version "1.2.59" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.59.tgz#283b4c8bb24c4deacc28b3fb10dfb59d0e63e6ac" - integrity sha512-QC/ftdhdIQPTFbbGG4c5F7BqwPBQpevzj21GuYNbMda3OQPn6nS5SKK0fP99/DRSf9WIRi+5Pg1fzlHg2DIQLA== +"@budibase/backend-core@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.1.tgz#7fb6437d9d8926c1500f8dd2ce51bc5e850b354a" + integrity sha512-H9iqfcVX/XSxJr9aWkhIUHD87fdJgDHpd6Gdkjsx/Ua3z3UJeW2dfkcP3so2MM/hPLpP181hOaFjk2/lDBiagw== dependencies: - "@budibase/types" "^1.2.59" + "@budibase/types" "^1.3.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -325,21 +325,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.2.59": - version "1.2.59" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.59.tgz#2f266d9ede1f722d879841fdb8da1a98a0628136" - integrity sha512-QwNRb5JT+SZaES3sUFxxQA6Ep2dH/fVqXrnzKPV/CoMa43YWkjOUTX2hjgmOWDsipBK90RK3wRYzcTG0BgEkJw== +"@budibase/pro@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.1.tgz#5ab732dbdf30a1967ca5e92b4de48518d538cb32" + integrity sha512-ErZhpeMvhiN8bLkoXe0N/yBU1wHDnk962tQ2tzMqlkWE4fCtfvo3SxD7VsYbu6Qmakkys1QPd6lBphnBOw58FQ== dependencies: - "@budibase/backend-core" "1.2.59" - "@budibase/types" "1.2.59" + "@budibase/backend-core" "1.3.1" + "@budibase/types" "1.3.1" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.2.59", "@budibase/types@^1.2.59": - version "1.2.59" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.59.tgz#e2a04f7fffcb68bd2cd12043430c0bf0db07ae71" - integrity sha512-2DpKE7NMGh2th/obOjT32uxLpQjyGLVQ925yM164pSvfZUyNA3zkQhOmNoMS9HJVHVavHyHVfSgGDQrF0YfNhA== +"@budibase/types@1.3.1", "@budibase/types@^1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.1.tgz#84a8b0e6c574d6b53c50ffe2c6fba59241ede98b" + integrity sha512-dAZvJzvw0phvLub6nmeH4sPDWKqPQH6QrFjOcgE6XR/7o7QjwTCJ00Jz07FBjh/ax+/9v6y/GauozejoESwA2w== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From f9224df9416d1f692ca61a12af488c98872e8dca Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 2 Sep 2022 18:14:08 +0100 Subject: [PATCH 083/260] Adding in a check for when there are no screen actions that need to be performed - #7592. --- packages/cli/yarn.lock | 1115 +++++++++++++++++- packages/client/src/components/Screen.svelte | 6 +- 2 files changed, 1100 insertions(+), 21 deletions(-) diff --git a/packages/cli/yarn.lock b/packages/cli/yarn.lock index 86d4d40e78..a7559a48da 100644 --- a/packages/cli/yarn.lock +++ b/packages/cli/yarn.lock @@ -48,6 +48,45 @@ "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" +"@budibase/backend-core@1.2.58-alpha.7": + version "1.2.58-alpha.7" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.58-alpha.7.tgz#b7888eb0e9796a4e49283cf8b928a6771439dbc0" + integrity sha512-wdZlJDQtYkGNce9hlj30Np6BDxvS5Mr07XhMwERlKzSRjOOAkQtM5bX+7UVZoIE/X0f8/h47U8P4T3Y98WGMkg== + dependencies: + "@budibase/types" "1.2.58-alpha.7" + "@techpass/passport-openidconnect" "0.3.2" + aws-sdk "2.1030.0" + bcrypt "5.0.1" + dotenv "16.0.1" + emitter-listener "1.1.2" + ioredis "4.28.0" + joi "17.6.0" + jsonwebtoken "8.5.1" + koa-passport "4.1.4" + lodash "4.17.21" + lodash.isarguments "3.1.0" + node-fetch "2.6.7" + passport-google-auth "1.0.2" + passport-google-oauth "2.0.0" + passport-jwt "4.0.0" + passport-local "1.0.0" + passport-oauth2-refresh "^2.1.0" + posthog-node "1.3.0" + pouchdb "7.3.0" + pouchdb-find "7.2.2" + pouchdb-replication-stream "1.2.9" + redlock "4.2.0" + sanitize-s3-objectkey "0.0.1" + semver "7.3.7" + tar-fs "2.1.1" + uuid "8.3.2" + zlib "1.0.5" + +"@budibase/types@1.2.58-alpha.7": + version "1.2.58-alpha.7" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.58-alpha.7.tgz#5f4e7d262bb597d01a1bd7c0674453946de3cfa2" + integrity sha512-VVW7XKFyax5A69cMoR8gwI06cxt/1G1cLH+8ECjIiwb2oO3hHe6WnlA91dUar0IdcdBHji7vYXg4MD1p8wb6jA== + "@eslint/eslintrc@^0.4.3": version "0.4.3" resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz" @@ -63,6 +102,18 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@hapi/hoek@^9.0.0": + version "9.3.0" + resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb" + integrity sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ== + +"@hapi/topo@^5.0.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.1.0.tgz#dc448e332c6c6e37a4dc02fd84ba8d44b9afb012" + integrity sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg== + dependencies: + "@hapi/hoek" "^9.0.0" + "@humanwhocodes/config-array@^0.5.0": version "0.5.0" resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz" @@ -77,6 +128,21 @@ resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@mapbox/node-pre-gyp@^1.0.0": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.9.tgz#09a8781a3a036151cdebbe8719d6f8b25d4058bc" + integrity sha512-aDF3S3rK9Q2gey/WAttUlISduDItz5BU3306M9Eyv6/oS40aMprnopshtlKTykxRNIBEZuRMaZAnbrQ4QtKGyw== + dependencies: + detect-libc "^2.0.0" + https-proxy-agent "^5.0.0" + make-dir "^3.1.0" + node-fetch "^2.6.7" + nopt "^5.0.0" + npmlog "^5.0.1" + rimraf "^3.0.2" + semver "^7.3.5" + tar "^6.1.11" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz" @@ -98,6 +164,39 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@sideway/address@^4.1.3": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.4.tgz#03dccebc6ea47fdc226f7d3d1ad512955d4783f0" + integrity sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw== + dependencies: + "@hapi/hoek" "^9.0.0" + +"@sideway/formula@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.0.tgz#fe158aee32e6bd5de85044be615bc08478a0a13c" + integrity sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg== + +"@sideway/pinpoint@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df" + integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ== + +"@techpass/passport-openidconnect@0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@techpass/passport-openidconnect/-/passport-openidconnect-0.3.2.tgz#f8fd5d97256286665dbf26dac92431f977ab1e63" + integrity sha512-fnCtEiexXSHA029B//hJcCJlLJrT3lhpNCyA0rnz58Qttz0BLGCVv6yMT8HmOnGThH6vcDOVwdgKM3kbCQtEhw== + dependencies: + base64url "^3.0.1" + oauth "^0.9.15" + passport-strategy "^1.0.0" + request "^2.88.0" + webfinger "^0.4.2" + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== + abort-controller@3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz" @@ -144,7 +243,7 @@ agent-base@6: dependencies: debug "4" -ajv@^6.10.0, ajv@^6.12.4: +ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -205,6 +304,19 @@ aproba@^1.0.3: resolved "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz" integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== +"aproba@^1.0.3 || ^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" + integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== + +are-we-there-yet@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz#372e0e7bd279d8e94c653aaa1f67200884bf3e1c" + integrity sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw== + dependencies: + delegates "^1.0.0" + readable-stream "^3.6.0" + are-we-there-yet@~1.1.2: version "1.1.7" resolved "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz" @@ -250,16 +362,65 @@ array-uniq@1.0.2: resolved "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.2.tgz" integrity sha1-X8w3OSB3VyPP1k1lxkvvU7+eum0= +asn1@~0.2.3: + version "0.2.6" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" + integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== + astral-regex@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== +async@~2.1.4: + version "2.1.5" + resolved "https://registry.yarnpkg.com/async/-/async-2.1.5.tgz#e587c68580994ac67fc56ff86d3ac56bdbe810bc" + integrity sha512-+g/Ncjbx0JSq2Mk03WQkyKvNh5q9Qvyo/RIqIqnmC5feJY70PNl2ESwZU2BhAB+AZPkHNzzyC2Dq2AS5VnTKhQ== + dependencies: + lodash "^4.14.0" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + at-least-node@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== +aws-sdk@2.1030.0: + version "2.1030.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1030.0.tgz#24a856af3d2b8b37c14a8f59974993661c66fd82" + integrity sha512-to0STOb8DsSGuSsUb/WCbg/UFnMGfIYavnJH5ZlRCHzvCFjTyR+vfE8ku+qIZvfFM4+5MNTQC/Oxfun2X/TuyA== + dependencies: + buffer "4.9.2" + events "1.1.1" + ieee754 "1.1.13" + jmespath "0.15.0" + querystring "0.2.0" + sax "1.2.1" + url "0.10.3" + uuid "3.3.2" + xml2js "0.4.19" + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== + +aws4@^1.8.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" + integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== + axios-retry@^3.1.9: version "3.2.4" resolved "https://registry.npmjs.org/axios-retry/-/axios-retry-3.2.4.tgz" @@ -275,6 +436,13 @@ axios@0.21.2: dependencies: follow-redirects "^1.14.0" +axios@0.24.0: + version "0.24.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.24.0.tgz#804e6fa1e4b9c5288501dd9dff56a7a0940d20d6" + integrity sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA== + dependencies: + follow-redirects "^1.14.4" + axios@^0.21.1: version "0.21.4" resolved "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz" @@ -287,11 +455,31 @@ balanced-match@^1.0.0: resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -base64-js@^1.3.1: +base64-js@^1.0.2, base64-js@^1.3.1: version "1.5.1" resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== +base64url@3.x.x, base64url@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/base64url/-/base64url-3.0.1.tgz#6399d572e2bc3f90a9a8b22d5dbb0a32d33f788d" + integrity sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A== + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== + dependencies: + tweetnacl "^0.14.3" + +bcrypt@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/bcrypt/-/bcrypt-5.0.1.tgz#f1a2c20f208e2ccdceea4433df0c8b2c54ecdf71" + integrity sha512-9BTgmrhZM2t1bNuDtrtIMVSmmxZBrJ71n8Wg+YgdjHuIWYF7SjjmCPZFB+/5i/o/PIeRpwVJR3P+NrpIItUjqw== + dependencies: + "@mapbox/node-pre-gyp" "^1.0.0" + node-addon-api "^3.1.0" + bl@^4.0.3: version "4.1.0" resolved "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz" @@ -301,6 +489,11 @@ bl@^4.0.3: inherits "^2.0.4" readable-stream "^3.4.0" +bluebird@^3.7.2: + version "3.7.2" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" + integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" @@ -316,11 +509,30 @@ braces@^3.0.1: dependencies: fill-range "^7.0.1" +buffer-equal-constant-time@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" + integrity sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA== + +buffer-from@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + buffer-from@1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== +buffer@4.9.2: + version "4.9.2" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8" + integrity sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg== + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" + buffer@^5.5.0, buffer@^5.6.0: version "5.7.1" resolved "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz" @@ -334,6 +546,11 @@ callsites@^3.0.0: resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== + chalk@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" @@ -412,6 +629,11 @@ clone-buffer@1.0.0: resolved "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz" integrity sha512-KLLTJWrvwIP+OPfMn0x2PheDEP20RPUcGXj/ERegTgdmPEZylALQldygiqrPPu8P45uNuPs7ckmReLY6v/iA5g== +cluster-key-slot@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz#30474b2a981fb12172695833052bc0d01336d10d" + integrity sha512-2Nii8p3RwAPiFwsnZvukotvow2rIHM+yQ6ZcBXGHdniadkYGZYiGmkHJIbZPIV9nfv7m/U1IPMVVcAhoWFeklw== + code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz" @@ -441,6 +663,18 @@ color-name@~1.1.4: resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +color-support@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" + integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== + +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + command-line-args@^5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-5.2.1.tgz#c44c32e437a57d7c51157696893c5909e9cec42e" @@ -476,7 +710,7 @@ concat-map@0.0.1: resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -console-control-strings@^1.0.0, console-control-strings@~1.1.0: +console-control-strings@^1.0.0, console-control-strings@^1.1.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== @@ -494,6 +728,11 @@ copyfiles@^2.4.1: untildify "^4.0.0" yargs "^16.1.0" +core-util-is@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== + core-util-is@~1.0.0: version "1.0.3" resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz" @@ -518,6 +757,13 @@ current-module-paths@^1.1.0: resolved "https://registry.yarnpkg.com/current-module-paths/-/current-module-paths-1.1.0.tgz#5d5bf214281d80aea264e642f028e672098238f6" integrity sha512-HGhLUszcgprjKmzvQoCQda8iEWsQn3sWVzPdttyJVR5cjfVDYcoyozQA5D1YXgab9v84SPMpSuD+YrPX6i1IMQ== +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== + dependencies: + assert-plus "^1.0.0" + debug@4, debug@^4.0.1, debug@^4.1.1: version "4.3.2" resolved "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz" @@ -525,6 +771,13 @@ debug@4, debug@^4.0.1, debug@^4.1.1: dependencies: ms "2.1.2" +debug@^4.3.1: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + decompress-response@^4.2.0: version "4.2.1" resolved "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz" @@ -550,16 +803,31 @@ deferred-leveldown@~5.3.0: abstract-leveldown "~6.2.1" inherits "^2.0.3" +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + delegates@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz" integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= +denque@^1.1.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/denque/-/denque-1.5.1.tgz#07f670e29c9a78f8faecb2566a1e2c11929c5cbf" + integrity sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw== + detect-libc@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz" integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= +detect-libc@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.1.tgz#e1897aa88fa6ad197862937fbc0441ef352ee0cd" + integrity sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w== + dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz" @@ -589,6 +857,28 @@ double-ended-queue@2.1.0-0: resolved "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz" integrity sha512-+BNfZ+deCo8hMNpDqDnvT+c0XpJ5cUa6mqYq89bho2Ifze4URTqRkcwR399hWoTrTkbZ/XJYDgP6rc7pRgffEQ== +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +ecdsa-sig-formatter@1.0.11: + version "1.0.11" + resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" + integrity sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ== + dependencies: + safe-buffer "^5.0.1" + +emitter-listener@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/emitter-listener/-/emitter-listener-1.1.2.tgz#56b140e8f6992375b3d7cb2cab1cc7432d9632e8" + integrity sha512-Bt1sBAGFHY9DKY+4/2cV6izcKJUf5T7/gkdmkxzX/qv9CcGH8xSwVRW5mtX03SWJtRTWSOpzCuWN9rBFYZepZQ== + dependencies: + shimmer "^1.2.0" + emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" @@ -778,11 +1068,21 @@ event-target-shim@^5.0.0: resolved "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz" integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== +events@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" + integrity sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw== + expand-template@^2.0.3: version "2.0.3" resolved "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz" integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg== +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + external-editor@^3.0.3: version "3.1.0" resolved "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz" @@ -792,6 +1092,16 @@ external-editor@^3.0.3: iconv-lite "^0.4.24" tmp "^0.0.33" +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== + +extsprintf@^1.2.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" + integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== + fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" @@ -830,6 +1140,13 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" +fetch-cookie@0.10.1: + version "0.10.1" + resolved "https://registry.yarnpkg.com/fetch-cookie/-/fetch-cookie-0.10.1.tgz#5ea88f3d36950543c87997c27ae2aeafb4b5c4d4" + integrity sha512-beB+VEd4cNeVG1PY+ee74+PkuCQnik78pgLi5Ah/7qdUfov8IctU0vLUbBT8/10Ma5GMBeI4wtxhGrEfKNYs2g== + dependencies: + tough-cookie "^2.3.3 || ^3.0.1 || ^4.0.0" + fetch-cookie@0.11.0: version "0.11.0" resolved "https://registry.npmjs.org/fetch-cookie/-/fetch-cookie-0.11.0.tgz" @@ -886,11 +1203,25 @@ flatted@^3.1.0: resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz" integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== -follow-redirects@^1.14.0: +follow-redirects@^1.14.0, follow-redirects@^1.14.4: version "1.15.1" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5" integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA== +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + from2@^2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz" @@ -936,6 +1267,21 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= +gauge@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-3.0.2.tgz#03bf4441c044383908bcfa0656ad91803259b395" + integrity sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q== + dependencies: + aproba "^1.0.3 || ^2.0.0" + color-support "^1.1.2" + console-control-strings "^1.0.0" + has-unicode "^2.0.1" + object-assign "^4.1.1" + signal-exit "^3.0.0" + string-width "^4.2.3" + strip-ansi "^6.0.1" + wide-align "^1.1.2" + gauge@~2.7.3: version "2.7.4" resolved "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz" @@ -955,6 +1301,13 @@ get-caller-file@^2.0.5: resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== + dependencies: + assert-plus "^1.0.0" + github-from-package@0.0.0: version "0.0.0" resolved "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz" @@ -1017,11 +1370,60 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" +google-auth-library@~0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/google-auth-library/-/google-auth-library-0.10.0.tgz#6e15babee85fd1dd14d8d128a295b6838d52136e" + integrity sha512-KM54Y9GhdAzfXUHmWEoYmaOykSLuMG7W4HvVLYqyogxOyE6px8oSS8W13ngqW0oDGZ915GFW3V6OM6+qcdvPOA== + dependencies: + gtoken "^1.2.1" + jws "^3.1.4" + lodash.noop "^3.0.1" + request "^2.74.0" + +google-p12-pem@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/google-p12-pem/-/google-p12-pem-0.1.2.tgz#33c46ab021aa734fa0332b3960a9a3ffcb2f3177" + integrity sha512-puhMlJ2+E/rgvxWaqgN/nC7x623OAE8MR9vBUqxF0inCE7HoVfCHvTeQ9+BR+rj9KM0fIg6XV6tmbt7XHHssoQ== + dependencies: + node-forge "^0.7.1" + +googleapis@^16.0.0: + version "16.1.0" + resolved "https://registry.yarnpkg.com/googleapis/-/googleapis-16.1.0.tgz#0f19f2d70572d918881a0f626e3b1a2fa8629576" + integrity sha512-5czmF7xkIlJKc1+/+5tltrI1skoR3HKtkDOld9rk+DOucTpZRjOhCoJzoSjxB3M8rP2tEb1VIr1TPyzR3V2PUQ== + dependencies: + async "~2.1.4" + google-auth-library "~0.10.0" + string-template "~1.0.0" + graceful-fs@^4.1.6, graceful-fs@^4.2.0: version "4.2.8" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz" integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== +gtoken@^1.2.1: + version "1.2.3" + resolved "https://registry.yarnpkg.com/gtoken/-/gtoken-1.2.3.tgz#5509571b8afd4322e124cf66cf68115284c476d8" + integrity sha512-wQAJflfoqSgMWrSBk9Fg86q+sd6s7y6uJhIvvIPz++RElGlMtEqsdAR2oWwZ/WTEtp7P9xFbJRrT976oRgzJ/w== + dependencies: + google-p12-pem "^0.1.0" + jws "^3.0.0" + mime "^1.4.1" + request "^2.72.0" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== + +har-validator@~5.1.3: + version "5.1.5" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" + integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== + dependencies: + ajv "^6.12.3" + har-schema "^2.0.0" + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" @@ -1032,7 +1434,7 @@ has-flag@^4.0.0: resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-unicode@^2.0.0: +has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== @@ -1044,6 +1446,15 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + https-proxy-agent@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz" @@ -1059,7 +1470,12 @@ iconv-lite@^0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -ieee754@^1.1.13: +ieee754@1.1.13: + version "1.1.13" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" + integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== + +ieee754@^1.1.13, ieee754@^1.1.4: version "1.2.1" resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== @@ -1147,6 +1563,23 @@ into-stream@^6.0.0: from2 "^2.3.0" p-is-promise "^3.0.0" +ioredis@4.28.0: + version "4.28.0" + resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-4.28.0.tgz#5a2be3f37ff2075e2332f280eaeb02ab4d9ff0d3" + integrity sha512-I+zkeeWp3XFgPT2CtJKxvaF5FjGBGt4yGYljRjQecdQKteThuAsKqffeF1lgHVlYnuNeozRbPOCDNZ7tDWPeig== + dependencies: + cluster-key-slot "^1.1.0" + debug "^4.3.1" + denque "^1.1.0" + lodash.defaults "^4.2.0" + lodash.flatten "^4.4.0" + lodash.isarguments "^3.1.0" + p-map "^2.1.0" + redis-commands "1.7.0" + redis-errors "^1.2.0" + redis-parser "^3.0.0" + standard-as-callback "^2.1.0" + is-buffer@~1.1.6: version "1.1.6" resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz" @@ -1193,12 +1626,17 @@ is-retry-allowed@^2.2.0: resolved "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-2.2.0.tgz" integrity sha512-XVm7LOeLpTW4jV19QSH38vkswxoLud8sQ57YwJVTPWdiaI9I8keEhGFpBlslyVsgdQy4Opg8QOLb8YRgsyZiQg== +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== + isarray@0.0.1: version "0.0.1" resolved "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== -isarray@~1.0.0: +isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= @@ -1208,6 +1646,27 @@ isexe@^2.0.0: resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== + +jmespath@0.15.0: + version "0.15.0" + resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.15.0.tgz#a3f222a9aae9f966f5d27c796510e28091764217" + integrity sha512-+kHj8HXArPfpPEKGLZ+kB5ONRTCiGQXo8RQYL0hH8t6pWXUBBK5KkkQmTNOwKK4LEsd0yTsgtjJVm4UBSZea4w== + +joi@17.6.0: + version "17.6.0" + resolved "https://registry.yarnpkg.com/joi/-/joi-17.6.0.tgz#0bb54f2f006c09a96e75ce687957bd04290054b2" + integrity sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw== + dependencies: + "@hapi/hoek" "^9.0.0" + "@hapi/topo" "^5.0.0" + "@sideway/address" "^4.1.3" + "@sideway/formula" "^3.0.0" + "@sideway/pinpoint" "^2.0.0" + join-component@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/join-component/-/join-component-1.1.0.tgz" @@ -1226,6 +1685,11 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz" @@ -1236,12 +1700,17 @@ json-schema-traverse@^1.0.0: resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz" integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== +json-schema@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" + integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== + json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -json-stringify-safe@^5.0.1: +json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== @@ -1255,6 +1724,56 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" +jsonwebtoken@8.5.1, jsonwebtoken@^8.2.0: + version "8.5.1" + resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz#00e71e0b8df54c2121a1f26137df2280673bcc0d" + integrity sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w== + dependencies: + jws "^3.2.2" + lodash.includes "^4.3.0" + lodash.isboolean "^3.0.3" + lodash.isinteger "^4.0.4" + lodash.isnumber "^3.0.3" + lodash.isplainobject "^4.0.6" + lodash.isstring "^4.0.1" + lodash.once "^4.0.0" + ms "^2.1.1" + semver "^5.6.0" + +jsprim@^1.2.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" + integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.4.0" + verror "1.10.0" + +jwa@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jwa/-/jwa-1.4.1.tgz#743c32985cb9e98655530d53641b66c8645b039a" + integrity sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA== + dependencies: + buffer-equal-constant-time "1.0.1" + ecdsa-sig-formatter "1.0.11" + safe-buffer "^5.0.1" + +jws@^3.0.0, jws@^3.1.4, jws@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/jws/-/jws-3.2.2.tgz#001099f3639468c9414000e99995fa52fb478304" + integrity sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA== + dependencies: + jwa "^1.4.1" + safe-buffer "^5.0.1" + +koa-passport@4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/koa-passport/-/koa-passport-4.1.4.tgz#5f1665c1c2a37ace79af9f970b770885ca30ccfa" + integrity sha512-dJBCkl4X+zdYxbI2V2OtoGy0PUenpvp2ZLLWObc8UJhsId0iQpTFT8RVcuA0709AL2txGwRHnSPoT1bYNGa6Kg== + dependencies: + passport "^0.4.0" + level-codec@9.0.2, level-codec@^9.0.0: version "9.0.2" resolved "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz" @@ -1379,11 +1898,66 @@ lodash.camelcase@^4.3.0: resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== +lodash.defaults@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" + integrity sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ== + +lodash.flatten@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" + integrity sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g== + +lodash.includes@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" + integrity sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w== + +lodash.isarguments@3.1.0, lodash.isarguments@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" + integrity sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg== + +lodash.isboolean@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6" + integrity sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg== + +lodash.isinteger@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343" + integrity sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA== + +lodash.isnumber@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz#3ce76810c5928d03352301ac287317f11c0b1ffc" + integrity sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw== + +lodash.isplainobject@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" + integrity sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA== + +lodash.isstring@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" + integrity sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw== + lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lodash.noop@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash.noop/-/lodash.noop-3.0.1.tgz#38188f4d650a3a474258439b96ec45b32617133c" + integrity sha512-TmYdmu/pebrdTIBDK/FDx9Bmfzs9x0sZG6QIJuMDTqEPfeciLcN13ij+cOd0i9vwJfBtbG9UQ+C7MkXgYxrIJg== + +lodash.once@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" + integrity sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg== + lodash.pick@^4.0.0: version "4.4.0" resolved "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz" @@ -1394,7 +1968,7 @@ lodash.truncate@^4.4.2: resolved "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz" integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= -lodash@^4.17.21: +lodash@4.17.21, lodash@^4.14.0, lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -1416,6 +1990,13 @@ ltgt@2.2.1, ltgt@^2.1.2: resolved "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz" integrity sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA== +make-dir@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== + dependencies: + semver "^6.0.0" + md5@^2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz" @@ -1438,6 +2019,23 @@ micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +mime@^1.4.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" @@ -1497,7 +2095,7 @@ ms@2.1.2: resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@^2.1.3: +ms@^2.1.1, ms@^2.1.3: version "2.1.3" resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -1547,13 +2145,28 @@ node-abi@^2.21.0: dependencies: semver "^5.4.1" -node-fetch@2, node-fetch@2.6.7, node-fetch@^2.6.6: +node-addon-api@^3.1.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.2.1.tgz#81325e0a2117789c0128dab65e7e38f07ceba161" + integrity sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A== + +node-fetch@2, node-fetch@2.6.7, node-fetch@^2.6.6, node-fetch@^2.6.7: version "2.6.7" resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== dependencies: whatwg-url "^5.0.0" +node-fetch@2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" + integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== + +node-forge@^0.7.1: + version "0.7.6" + resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.7.6.tgz#fdf3b418aee1f94f0ef642cd63486c77ca9724ac" + integrity sha512-sol30LUpz1jQFBjOKwbjxijiE3b6pjd74YwfD0fJOKPjF+fONKb2Yg8rYgS6+bK6VDl+/wfr4IYpC7jDzLUIfw== + node-gyp-build@~4.1.0: version "4.1.1" resolved "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz" @@ -1567,6 +2180,13 @@ noms@0.0.0: inherits "^2.0.1" readable-stream "~1.0.31" +nopt@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-5.0.0.tgz#530942bb58a512fccafe53fe210f13a25355dc88" + integrity sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ== + dependencies: + abbrev "1" + npmlog@^4.0.1: version "4.1.2" resolved "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz" @@ -1577,12 +2197,32 @@ npmlog@^4.0.1: gauge "~2.7.3" set-blocking "~2.0.0" +npmlog@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-5.0.1.tgz#f06678e80e29419ad67ab964e0fa69959c1eb8b0" + integrity sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw== + dependencies: + are-we-there-yet "^2.0.0" + console-control-strings "^1.1.0" + gauge "^3.0.0" + set-blocking "^2.0.0" + number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= -object-assign@^4.1.0: +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +oauth@0.9.x, oauth@^0.9.15: + version "0.9.15" + resolved "https://registry.yarnpkg.com/oauth/-/oauth-0.9.15.tgz#bd1fefaf686c96b75475aed5196412ff60cfb9c1" + integrity sha512-a5ERWK1kh38ExDEfoO6qUHJb32rd7aYmPHuyCu3Fta/cnICvYmgd2uhuKXvPD+PXB+gCEYYEaQdIRAjCOwAKNA== + +object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== @@ -1635,6 +2275,11 @@ p-is-promise@^3.0.0: resolved "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz" integrity sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ== +p-map@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175" + integrity sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw== + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz" @@ -1642,6 +2287,89 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" +passport-google-auth@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/passport-google-auth/-/passport-google-auth-1.0.2.tgz#8b300b5aa442ef433de1d832ed3112877d0b2938" + integrity sha512-cfAqna6jZLyMEwUdd4PIwAh2mQKQVEDAaRIaom1pG6h4x4Gwjllf/Jflt3TkR1Sen5Rkvr3l7kSXCWE1EKkh8g== + dependencies: + googleapis "^16.0.0" + passport-strategy "1.x" + +passport-google-oauth1@1.x.x: + version "1.0.0" + resolved "https://registry.yarnpkg.com/passport-google-oauth1/-/passport-google-oauth1-1.0.0.tgz#af74a803df51ec646f66a44d82282be6f108e0cc" + integrity sha512-qpCEhuflJgYrdg5zZIpAq/K3gTqa1CtHjbubsEsidIdpBPLkEVq6tB1I8kBNcH89RdSiYbnKpCBXAZXX/dtx1Q== + dependencies: + passport-oauth1 "1.x.x" + +passport-google-oauth20@2.x.x: + version "2.0.0" + resolved "https://registry.yarnpkg.com/passport-google-oauth20/-/passport-google-oauth20-2.0.0.tgz#0d241b2d21ebd3dc7f2b60669ec4d587e3a674ef" + integrity sha512-KSk6IJ15RoxuGq7D1UKK/8qKhNfzbLeLrG3gkLZ7p4A6DBCcv7xpyQwuXtWdpyR0+E0mwkpjY1VfPOhxQrKzdQ== + dependencies: + passport-oauth2 "1.x.x" + +passport-google-oauth@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/passport-google-oauth/-/passport-google-oauth-2.0.0.tgz#f6eb4bc96dd6c16ec0ecfdf4e05ec48ca54d4dae" + integrity sha512-JKxZpBx6wBQXX1/a1s7VmdBgwOugohH+IxCy84aPTZNq/iIPX6u7Mqov1zY7MKRz3niFPol0KJz8zPLBoHKtYA== + dependencies: + passport-google-oauth1 "1.x.x" + passport-google-oauth20 "2.x.x" + +passport-jwt@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/passport-jwt/-/passport-jwt-4.0.0.tgz#7f0be7ba942e28b9f5d22c2ebbb8ce96ef7cf065" + integrity sha512-BwC0n2GP/1hMVjR4QpnvqA61TxenUMlmfNjYNgK0ZAs0HK4SOQkHcSv4L328blNTLtHq7DbmvyNJiH+bn6C5Mg== + dependencies: + jsonwebtoken "^8.2.0" + passport-strategy "^1.0.0" + +passport-local@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/passport-local/-/passport-local-1.0.0.tgz#1fe63268c92e75606626437e3b906662c15ba6ee" + integrity sha512-9wCE6qKznvf9mQYYbgJ3sVOHmCWoUNMVFoZzNoznmISbhnNNPhN9xfY3sLmScHMetEJeoY7CXwfhCe7argfQow== + dependencies: + passport-strategy "1.x.x" + +passport-oauth1@1.x.x: + version "1.2.0" + resolved "https://registry.yarnpkg.com/passport-oauth1/-/passport-oauth1-1.2.0.tgz#5229d431781bf5b265bec86ce9a9cce58a756cf9" + integrity sha512-Sv2YWodC6jN12M/OXwmR4BIXeeIHjjbwYTQw4kS6tHK4zYzSEpxBgSJJnknBjICA5cj0ju3FSnG1XmHgIhYnLg== + dependencies: + oauth "0.9.x" + passport-strategy "1.x.x" + utils-merge "1.x.x" + +passport-oauth2-refresh@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/passport-oauth2-refresh/-/passport-oauth2-refresh-2.1.0.tgz#c31cd133826383f5539d16ad8ab4f35ca73ce4a4" + integrity sha512-4ML7ooCESCqiTgdDBzNUFTBcPR8zQq9iM6eppEUGMMvLdsjqRL93jKwWm4Az3OJcI+Q2eIVyI8sVRcPFvxcF/A== + +passport-oauth2@1.x.x: + version "1.6.1" + resolved "https://registry.yarnpkg.com/passport-oauth2/-/passport-oauth2-1.6.1.tgz#c5aee8f849ce8bd436c7f81d904a3cd1666f181b" + integrity sha512-ZbV43Hq9d/SBSYQ22GOiglFsjsD1YY/qdiptA+8ej+9C1dL1TVB+mBE5kDH/D4AJo50+2i8f4bx0vg4/yDDZCQ== + dependencies: + base64url "3.x.x" + oauth "0.9.x" + passport-strategy "1.x.x" + uid2 "0.0.x" + utils-merge "1.x.x" + +passport-strategy@1.x, passport-strategy@1.x.x, passport-strategy@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/passport-strategy/-/passport-strategy-1.0.0.tgz#b5539aa8fc225a3d1ad179476ddf236b440f52e4" + integrity sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA== + +passport@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/passport/-/passport-0.4.1.tgz#941446a21cb92fc688d97a0861c38ce9f738f270" + integrity sha512-IxXgZZs8d7uFSt3eqNjM9NQ3g3uQCW5avD8mRNoXV99Yig50vjuaez6dQK2qC0kVWPRTujxY0dWgGfT09adjYg== + dependencies: + passport-strategy "1.x.x" + pause "0.0.1" + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" @@ -1662,6 +2390,16 @@ path-type@^4.0.0: resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +pause@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/pause/-/pause-0.0.1.tgz#1d408b3fdb76923b9543d96fb4c9dfd535d9cb5d" + integrity sha512-KG8UEiEVkR3wGEb4m5yZkVCzigAD+cVEJck2CzYZO37ZGJfctvVptVO192MwrtPhzONn6go8ylnOdMhKqi4nfg== + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== + picomatch@^2.2.3: version "2.3.0" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz" @@ -1715,6 +2453,20 @@ posthog-node@1.0.7: remove-trailing-slash "^0.1.1" uuid "^8.3.2" +posthog-node@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/posthog-node/-/posthog-node-1.3.0.tgz#804ed2f213a2f05253f798bf9569d55a9cad94f7" + integrity sha512-2+VhqiY/rKIqKIXyvemBFHbeijHE25sP7eKltnqcFqAssUE6+sX6vusN9A4luzToOqHQkUZexiCKxvuGagh7JA== + dependencies: + axios "0.24.0" + axios-retry "^3.1.9" + component-type "^1.2.1" + join-component "^1.1.0" + md5 "^2.3.0" + ms "^2.1.3" + remove-trailing-slash "^0.1.1" + uuid "^8.3.2" + pouch-stream@^0.4.0: version "0.4.1" resolved "https://registry.npmjs.org/pouch-stream/-/pouch-stream-0.4.1.tgz" @@ -1723,6 +2475,84 @@ pouch-stream@^0.4.0: inherits "^2.0.1" readable-stream "^1.0.27-1" +pouchdb-abstract-mapreduce@7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/pouchdb-abstract-mapreduce/-/pouchdb-abstract-mapreduce-7.2.2.tgz#dd1b10a83f8d24361dce9aaaab054614b39f766f" + integrity sha512-7HWN/2yV2JkwMnGnlp84lGvFtnm0Q55NiBUdbBcaT810+clCGKvhssBCrXnmwShD1SXTwT83aszsgiSfW+SnBA== + dependencies: + pouchdb-binary-utils "7.2.2" + pouchdb-collate "7.2.2" + pouchdb-collections "7.2.2" + pouchdb-errors "7.2.2" + pouchdb-fetch "7.2.2" + pouchdb-mapreduce-utils "7.2.2" + pouchdb-md5 "7.2.2" + pouchdb-utils "7.2.2" + +pouchdb-binary-utils@7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/pouchdb-binary-utils/-/pouchdb-binary-utils-7.2.2.tgz#0690b348052c543b1e67f032f47092ca82bcb10e" + integrity sha512-shacxlmyHbUrNfE6FGYpfyAJx7Q0m91lDdEAaPoKZM3SzAmbtB1i+OaDNtYFztXjJl16yeudkDb3xOeokVL3Qw== + dependencies: + buffer-from "1.1.1" + +pouchdb-collate@7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/pouchdb-collate/-/pouchdb-collate-7.2.2.tgz#fc261f5ef837c437e3445fb0abc3f125d982c37c" + integrity sha512-/SMY9GGasslknivWlCVwXMRMnQ8myKHs4WryQ5535nq1Wj/ehpqWloMwxEQGvZE1Sda3LOm7/5HwLTcB8Our+w== + +pouchdb-collections@7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/pouchdb-collections/-/pouchdb-collections-7.2.2.tgz#aeed77f33322429e3f59d59ea233b48ff0e68572" + integrity sha512-6O9zyAYlp3UdtfneiMYuOCWdUCQNo2bgdjvNsMSacQX+3g8WvIoFQCYJjZZCpTttQGb+MHeRMr8m2U95lhJTew== + +pouchdb-errors@7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/pouchdb-errors/-/pouchdb-errors-7.2.2.tgz#80d811d65c766c9d20b755c6e6cc123f8c3c4792" + integrity sha512-6GQsiWc+7uPfgEHeavG+7wuzH3JZW29Dnrvz8eVbDFE50kVFxNDVm3EkYHskvo5isG7/IkOx7PV7RPTA3keG3g== + dependencies: + inherits "2.0.4" + +pouchdb-fetch@7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/pouchdb-fetch/-/pouchdb-fetch-7.2.2.tgz#492791236d60c899d7e9973f9aca0d7b9cc02230" + integrity sha512-lUHmaG6U3zjdMkh8Vob9GvEiRGwJfXKE02aZfjiVQgew+9SLkuOxNw3y2q4d1B6mBd273y1k2Lm0IAziRNxQnA== + dependencies: + abort-controller "3.0.0" + fetch-cookie "0.10.1" + node-fetch "2.6.0" + +pouchdb-find@7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/pouchdb-find/-/pouchdb-find-7.2.2.tgz#1227afdd761812d508fe0794b3e904518a721089" + integrity sha512-BmFeFVQ0kHmDehvJxNZl9OmIztCjPlZlVSdpijuFbk/Fi1EFPU1BAv3kLC+6DhZuOqU/BCoaUBY9sn66pPY2ag== + dependencies: + pouchdb-abstract-mapreduce "7.2.2" + pouchdb-collate "7.2.2" + pouchdb-errors "7.2.2" + pouchdb-fetch "7.2.2" + pouchdb-md5 "7.2.2" + pouchdb-selector-core "7.2.2" + pouchdb-utils "7.2.2" + +pouchdb-mapreduce-utils@7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/pouchdb-mapreduce-utils/-/pouchdb-mapreduce-utils-7.2.2.tgz#13a46a3cc2a3f3b8e24861da26966904f2963146" + integrity sha512-rAllb73hIkU8rU2LJNbzlcj91KuulpwQu804/F6xF3fhZKC/4JQMClahk+N/+VATkpmLxp1zWmvmgdlwVU4HtQ== + dependencies: + argsarray "0.0.1" + inherits "2.0.4" + pouchdb-collections "7.2.2" + pouchdb-utils "7.2.2" + +pouchdb-md5@7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/pouchdb-md5/-/pouchdb-md5-7.2.2.tgz#415401acc5a844112d765bd1fb4e5d9f38fb0838" + integrity sha512-c/RvLp2oSh8PLAWU5vFBnp6ejJABIdKqboZwRRUrWcfGDf+oyX8RgmJFlYlzMMOh4XQLUT1IoaDV8cwlsuryZw== + dependencies: + pouchdb-binary-utils "7.2.2" + spark-md5 "3.0.1" + pouchdb-promise@^6.0.4: version "6.4.3" resolved "https://registry.npmjs.org/pouchdb-promise/-/pouchdb-promise-6.4.3.tgz" @@ -1743,6 +2573,28 @@ pouchdb-replication-stream@1.2.9: pouchdb-promise "^6.0.4" through2 "^2.0.0" +pouchdb-selector-core@7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/pouchdb-selector-core/-/pouchdb-selector-core-7.2.2.tgz#264d7436a8c8ac3801f39960e79875ef7f3879a0" + integrity sha512-XYKCNv9oiNmSXV5+CgR9pkEkTFqxQGWplnVhO3W9P154H08lU0ZoNH02+uf+NjZ2kjse7Q1fxV4r401LEcGMMg== + dependencies: + pouchdb-collate "7.2.2" + pouchdb-utils "7.2.2" + +pouchdb-utils@7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/pouchdb-utils/-/pouchdb-utils-7.2.2.tgz#c17c4788f1d052b0daf4ef8797bbc4aaa3945aa4" + integrity sha512-XmeM5ioB4KCfyB2MGZXu1Bb2xkElNwF1qG+zVFbQsKQij0zvepdOUfGuWvLRHxTOmt4muIuSOmWZObZa3NOgzQ== + dependencies: + argsarray "0.0.1" + clone-buffer "1.0.0" + immediate "3.3.0" + inherits "2.0.4" + pouchdb-collections "7.2.2" + pouchdb-errors "7.2.2" + pouchdb-md5 "7.2.2" + uuid "8.1.0" + pouchdb@7.3.0: version "7.3.0" resolved "https://registry.yarnpkg.com/pouchdb/-/pouchdb-7.3.0.tgz#440fbef12dfd8f9002320802528665e883a3b7f8" @@ -1818,6 +2670,11 @@ prr@~1.0.1: resolved "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz" integrity sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw== +psl@^1.1.28: + version "1.9.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" + integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== + psl@^1.1.33: version "1.8.0" resolved "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz" @@ -1831,11 +2688,26 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + integrity sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw== + punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== +qs@~6.5.2: + version "6.5.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" + integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + integrity sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g== + queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" @@ -1905,6 +2777,30 @@ readable-stream@~1.0.31: isarray "0.0.1" string_decoder "~0.10.x" +redis-commands@1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.7.0.tgz#15a6fea2d58281e27b1cd1acfb4b293e278c3a89" + integrity sha512-nJWqw3bTFy21hX/CPKHth6sfhZbdiHP6bTawSgQBlKOVRG7EZkfHbbHwQJnrE4vsQf0CMNE+3gJ4Fmm16vdVlQ== + +redis-errors@^1.0.0, redis-errors@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/redis-errors/-/redis-errors-1.2.0.tgz#eb62d2adb15e4eaf4610c04afe1529384250abad" + integrity sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w== + +redis-parser@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-3.0.0.tgz#b66d828cdcafe6b4b8a428a7def4c6bcac31c8b4" + integrity sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A== + dependencies: + redis-errors "^1.0.0" + +redlock@4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/redlock/-/redlock-4.2.0.tgz#c26590768559afd5fff76aa1133c94b411ff4f5f" + integrity sha512-j+oQlG+dOwcetUt2WJWttu4CZVeRzUrcVcISFmEmfyuwCVSJ93rDT7YSgg7H7rnxwoRyk/jU46kycVka5tW7jA== + dependencies: + bluebird "^3.7.2" + reduce-flatten@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-2.0.0.tgz#734fd84e65f375d7ca4465c69798c25c9d10ae27" @@ -1943,6 +2839,32 @@ renamer@^4.0.0: stream-read-all "^3.0.1" typical "^7.1.1" +request@^2.72.0, request@^2.74.0, request@^2.88.0: + version "2.88.2" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" + integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.3" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.5.0" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" @@ -2006,7 +2928,7 @@ rxjs@^6.6.6: dependencies: tslib "^1.9.0" -safe-buffer@^5.0.1, safe-buffer@~5.2.0: +safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -2016,16 +2938,43 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -"safer-buffer@>= 2.1.2 < 3": +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -semver@^5.4.1: +sanitize-s3-objectkey@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/sanitize-s3-objectkey/-/sanitize-s3-objectkey-0.0.1.tgz#efa9887cd45275b40234fb4bb12fc5754fe64e7e" + integrity sha512-ZTk7aqLxy4sD40GWcYWoLfbe05XLmkKvh6vGKe13ADlei24xlezcvjgKy1qRArlaIbIMYaqK7PCalvZtulZlaQ== + +sax@1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a" + integrity sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA== + +sax@>=0.1.1, sax@>=0.6.0: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== + +semver@7.3.7: + version "7.3.7" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" + integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== + dependencies: + lru-cache "^6.0.0" + +semver@^5.4.1, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== +semver@^6.0.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + semver@^7.2.1, semver@^7.3.5: version "7.3.5" resolved "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz" @@ -2033,7 +2982,7 @@ semver@^7.2.1, semver@^7.3.5: dependencies: lru-cache "^6.0.0" -set-blocking@~2.0.0: +set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== @@ -2050,6 +2999,11 @@ shebang-regex@^3.0.0: resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +shimmer@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/shimmer/-/shimmer-1.2.1.tgz#610859f7de327b587efebf501fb43117f9aff337" + integrity sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw== + signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.5" resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz" @@ -2088,6 +3042,11 @@ source-map@~0.6.1: resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +spark-md5@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/spark-md5/-/spark-md5-3.0.1.tgz#83a0e255734f2ab4e5c466e5a2cfc9ba2aa2124d" + integrity sha512-0tF3AGSD1ppQeuffsLDIOWlKUd3lS92tFxcsrh5Pe3ZphhnoK+oXIBTzOAThZCiuINZLvpiLH/1VS1/ANEJVig== + spark-md5@3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/spark-md5/-/spark-md5-3.0.2.tgz" @@ -2105,6 +3064,31 @@ sprintf-js@~1.0.2: resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= +sshpk@^1.7.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" + integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +standard-as-callback@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/standard-as-callback/-/standard-as-callback-2.1.0.tgz#8953fc05359868a77b5b9739a665c5977bb7df45" + integrity sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A== + +step@0.0.x: + version "0.0.6" + resolved "https://registry.yarnpkg.com/step/-/step-0.0.6.tgz#143e7849a5d7d3f4a088fe29af94915216eeede2" + integrity sha512-qSSeQinUJk2w38vUFobjFoE307GqsozMC8VisOCkJLpklvKPT0ptPHwWOrENoag8rgLudvTkfP3bancwP93/Jw== + stream-meter@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/stream-meter/-/stream-meter-1.0.4.tgz" @@ -2117,6 +3101,11 @@ stream-read-all@^3.0.1: resolved "https://registry.yarnpkg.com/stream-read-all/-/stream-read-all-3.0.1.tgz#60762ae45e61d93ba0978cda7f3913790052ad96" integrity sha512-EWZT9XOceBPlVJRrYcykW8jyRSZYbkb/0ZK36uLEmoWVO5gxBOnntNTseNzfREsqxqdfEGQrD8SXQ3QWbBmq8A== +string-template@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/string-template/-/string-template-1.0.0.tgz#9e9f2233dc00f218718ec379a28a5673ecca8b96" + integrity sha512-SLqR3GBUXuoPP5MmYtD7ompvXiG87QjT6lzOszyXjTM86Uu7At7vNnt2xgyTLq5o9T4IxTYFyGxcULqpsmsfdg== + string-width@^1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" @@ -2218,7 +3207,7 @@ table@^6.0.9: string-width "^4.2.3" strip-ansi "^6.0.1" -tar-fs@^2.0.0, tar-fs@^2.1.1: +tar-fs@2.1.1, tar-fs@^2.0.0, tar-fs@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784" integrity sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng== @@ -2239,7 +3228,7 @@ tar-stream@^2.1.4: inherits "^2.0.3" readable-stream "^3.1.1" -tar@6.1.11: +tar@6.1.11, tar@^6.1.11: version "6.1.11" resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== @@ -2305,6 +3294,14 @@ to-regex-range@^5.0.1: punycode "^2.1.1" universalify "^0.1.2" +tough-cookie@~2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + tr46@~0.0.3: version "0.0.3" resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" @@ -2322,6 +3319,11 @@ tunnel-agent@^0.6.0: dependencies: safe-buffer "^5.0.1" +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz" @@ -2361,6 +3363,11 @@ typical@^7.1.1: resolved "https://registry.yarnpkg.com/typical/-/typical-7.1.1.tgz#ba177ab7ab103b78534463ffa4c0c9754523ac1f" integrity sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA== +uid2@0.0.x: + version "0.0.4" + resolved "https://registry.yarnpkg.com/uid2/-/uid2-0.0.4.tgz#033f3b1d5d32505f5ce5f888b9f3b667123c0a44" + integrity sha512-IevTus0SbGwQzYh3+fRsAMTVVPOoIVufzacXcHPmdlle1jUpq7BRL+mw3dgeLanvGZdwwbWhRV6XrcFNdBmjWA== + universalify@^0.1.2: version "0.1.2" resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz" @@ -2383,26 +3390,71 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" +url@0.10.3: + version "0.10.3" + resolved "https://registry.yarnpkg.com/url/-/url-0.10.3.tgz#021e4d9c7705f21bbf37d03ceb58767402774c64" + integrity sha512-hzSUW2q06EqL1gKM/a+obYHLIO6ct2hwPuviqTTOcfFVc61UbfJ2Q32+uGL/HCPxKqrdGB5QUwIe7UqlDgwsOQ== + dependencies: + punycode "1.3.2" + querystring "0.2.0" + util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= +utils-merge@1.x.x: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== + +uuid@3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + +uuid@8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.1.0.tgz#6f1536eb43249f473abc6bd58ff983da1ca30d8d" + integrity sha512-CI18flHDznR0lq54xBycOVmphdCYnQLKn8abKn7PXUiKUGdEd+/l9LWNJmugXel4hXq7S+RMNl34ecyC9TntWg== + uuid@8.3.2, uuid@^8.3.2: version "8.3.2" resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +uuid@^3.3.2: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + v8-compile-cache@^2.0.3: version "2.3.0" resolved "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz" integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + vuvuzela@1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/vuvuzela/-/vuvuzela-1.0.3.tgz" integrity sha512-Tm7jR1xTzBbPW+6y1tknKiEhz04Wf/1iZkcTJjSFcpNko43+dFW6+OOeQe9taJIug3NdfUAjFKgUSyQrIKaDvQ== +webfinger@^0.4.2: + version "0.4.2" + resolved "https://registry.yarnpkg.com/webfinger/-/webfinger-0.4.2.tgz#3477a6d97799461896039fcffc650b73468ee76d" + integrity sha512-PvvQ/k74HkC3q5G7bGu4VYeKDt3ePZMzT5qFPtEnOL8eyIU1/06OtDn9X5vlkQ23BlegA3eN89rDLiYUife3xQ== + dependencies: + step "0.0.x" + xml2js "0.1.x" + webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" @@ -2423,7 +3475,7 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -wide-align@^1.1.0: +wide-align@^1.1.0, wide-align@^1.1.2: version "1.1.5" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== @@ -2464,6 +3516,26 @@ write-stream@~0.4.3: dependencies: readable-stream "~0.0.2" +xml2js@0.1.x: + version "0.1.14" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.1.14.tgz#5274e67f5a64c5f92974cd85139e0332adc6b90c" + integrity sha512-pbdws4PPPNc1HPluSUKamY4GWMk592K7qwcj6BExbVOhhubub8+pMda/ql68b6L3luZs/OGjGSB5goV7SnmgnA== + dependencies: + sax ">=0.1.1" + +xml2js@0.4.19: + version "0.4.19" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" + integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q== + dependencies: + sax ">=0.6.0" + xmlbuilder "~9.0.1" + +xmlbuilder@~9.0.1: + version "9.0.7" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" + integrity sha512-7YXTQc3P2l9+0rjaUbLwMKRhtmwg1M1eDf6nag7urC7pIPYLD9W/jmzQ4ptRSUbodw5S0jfoGTflLemQibSpeQ== + xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" @@ -2496,3 +3568,8 @@ yargs@^16.1.0, yargs@^16.2.0: string-width "^4.2.0" y18n "^5.0.5" yargs-parser "^20.2.2" + +zlib@1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/zlib/-/zlib-1.0.5.tgz#6e7c972fc371c645a6afb03ab14769def114fcc0" + integrity sha512-40fpE2II+Cd3k8HWTWONfeKE2jL+P42iWJ1zzps5W51qcTsOUKM5Q5m2PFb0CLxlmFAaUuUdJGc3OfZy947v0w== diff --git a/packages/client/src/components/Screen.svelte b/packages/client/src/components/Screen.svelte index 3ec8d1ea52..af895c6b82 100644 --- a/packages/client/src/components/Screen.svelte +++ b/packages/client/src/components/Screen.svelte @@ -3,7 +3,7 @@ import Component from "./Component.svelte" import Provider from "./context/Provider.svelte" import { onMount, getContext } from "svelte" - import { enrichButtonActions } from "utils/buttonActions.js" + import { enrichButtonActions } from "../utils/buttonActions.js" export let params = {} @@ -29,7 +29,9 @@ ...$context, url: params, }) - actions() + if (actions != null) { + actions() + } } }) From 151d70ef4324d23ae7241537914e56c2bca8a4fa Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 2 Sep 2022 18:35:06 +0100 Subject: [PATCH 084/260] improvements to redis connector - multi line pipelines and lowercase commands --- packages/server/src/integrations/redis.ts | 20 ++++++++++++++----- .../src/integrations/tests/redis.spec.js | 19 ++++++++++++++++-- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/packages/server/src/integrations/redis.ts b/packages/server/src/integrations/redis.ts index e8aa13560c..6764e20dca 100644 --- a/packages/server/src/integrations/redis.ts +++ b/packages/server/src/integrations/redis.ts @@ -132,12 +132,22 @@ module RedisModule { async command(query: { json: string }) { return this.redisContext(async () => { - const commands = query.json.trim().split(" ") - const pipeline = this.client.pipeline([commands]) - const result = await pipeline.exec() - return { - response: result[0][1], + // commands split line by line + const commands = query.json.trim().split("\n") + let pipelineCommands = [] + + // process each command separately + for (let command of commands) { + const tokenised = command.trim().split(" ") + // Pipeline only accepts lower case commands + tokenised[0] = tokenised[0].toLowerCase() + pipelineCommands.push(tokenised) } + + const pipeline = this.client.pipeline(pipelineCommands) + const result = await pipeline.exec() + + return result.map((output: string | string[]) => output[1]) }) } } diff --git a/packages/server/src/integrations/tests/redis.spec.js b/packages/server/src/integrations/tests/redis.spec.js index 219584bdb2..2483ccc382 100644 --- a/packages/server/src/integrations/tests/redis.spec.js +++ b/packages/server/src/integrations/tests/redis.spec.js @@ -46,7 +46,7 @@ describe("Redis Integration", () => { expect(await config.redis.get(body.key)).toEqual(null) }) - it("calls the command method with the correct params", async () => { + it("calls the pipeline method with the correct params", async () => { const body = { json: "KEYS *" } @@ -55,6 +55,21 @@ describe("Redis Integration", () => { config.integration.client.pipeline = jest.fn(() => ({ exec: jest.fn(() => [[]]) })) await config.integration.command(body) - expect(config.integration.client.pipeline).toHaveBeenCalledWith([["KEYS", "*"]]) + expect(config.integration.client.pipeline).toHaveBeenCalledWith([["keys", "*"]]) + }) + + it("calls the pipeline method with several separated commands when there are newlines", async () => { + const body = { + json: 'SET foo "bar"\nGET foo' + } + + // ioredis-mock doesn't support pipelines + config.integration.client.pipeline = jest.fn(() => ({ exec: jest.fn(() => [[]]) })) + + await config.integration.command(body) + expect(config.integration.client.pipeline).toHaveBeenCalledWith([ + ["set", 'foo', '"bar"'], + ["get", 'foo'] + ]) }) }) \ No newline at end of file From 0e915746aaaa69697dbc090dd4b8372d1ae546d2 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 2 Sep 2022 17:56:19 +0000 Subject: [PATCH 085/260] v1.3.2 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lerna.json b/lerna.json index 9949bcfa80..bc316f6990 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.1", + "version": "1.3.2", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 12d13ca518..e27f5b5218 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.3.1", + "version": "1.3.2", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "^1.3.1", + "@budibase/types": "^1.3.2", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 77e5e906d8..7142a08f71 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.3.1", + "version": "1.3.2", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.3.1", + "@budibase/string-templates": "^1.3.2", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 6463407199..9c7ff37215 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.3.1", + "version": "1.3.2", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.3.1", - "@budibase/client": "^1.3.1", - "@budibase/frontend-core": "^1.3.1", - "@budibase/string-templates": "^1.3.1", + "@budibase/bbui": "^1.3.2", + "@budibase/client": "^1.3.2", + "@budibase/frontend-core": "^1.3.2", + "@budibase/string-templates": "^1.3.2", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index af28c5f851..e9eb004a6b 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.3.1", + "version": "1.3.2", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 723a9f91f7..94b25d154b 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.3.1", + "version": "1.3.2", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.3.1", - "@budibase/frontend-core": "^1.3.1", - "@budibase/string-templates": "^1.3.1", + "@budibase/bbui": "^1.3.2", + "@budibase/frontend-core": "^1.3.2", + "@budibase/string-templates": "^1.3.2", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 8917ae11cf..7b11ea7207 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.3.1", + "version": "1.3.2", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.3.1", + "@budibase/bbui": "^1.3.2", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 24878de855..49c245a0aa 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.3.1", + "version": "1.3.2", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^1.3.1", - "@budibase/client": "^1.3.1", + "@budibase/backend-core": "^1.3.2", + "@budibase/client": "^1.3.2", "@budibase/pro": "1.3.1", - "@budibase/string-templates": "^1.3.1", - "@budibase/types": "^1.3.1", + "@budibase/string-templates": "^1.3.2", + "@budibase/types": "^1.3.2", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index dfa6736936..fe1b57de65 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.3.1", + "version": "1.3.2", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 374989a52d..8a8d76954e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.3.1", + "version": "1.3.2", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index d8f1aa8357..47d11c9693 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.3.1", + "version": "1.3.2", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.3.1", + "@budibase/backend-core": "^1.3.2", "@budibase/pro": "1.3.1", - "@budibase/string-templates": "^1.3.1", - "@budibase/types": "^1.3.1", + "@budibase/string-templates": "^1.3.2", + "@budibase/types": "^1.3.2", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 1bbc2f4aac50d8a0c7d7b1dd727cc9a21576b34f Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 2 Sep 2022 17:59:33 +0000 Subject: [PATCH 086/260] Update pro version to 1.3.2 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 49c245a0aa..a5fc2f23ae 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^1.3.2", "@budibase/client": "^1.3.2", - "@budibase/pro": "1.3.1", + "@budibase/pro": "1.3.2", "@budibase/string-templates": "^1.3.2", "@budibase/types": "^1.3.2", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 3352038d8e..4f683d03f0 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.1.tgz#7fb6437d9d8926c1500f8dd2ce51bc5e850b354a" - integrity sha512-H9iqfcVX/XSxJr9aWkhIUHD87fdJgDHpd6Gdkjsx/Ua3z3UJeW2dfkcP3so2MM/hPLpP181hOaFjk2/lDBiagw== +"@budibase/backend-core@1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.2.tgz#91e61915b8ab1938afea4a6fe5fc9806e6c75e16" + integrity sha512-3keFjRzmRhjwhMaUxLzUF4Osqwxe0ip3USS+hbP5P1kxFtydmCXSCiUovef2JhvjfkCI3JhDOUb/TUDTF6Tc1g== dependencies: - "@budibase/types" "^1.3.1" + "@budibase/types" "^1.3.2" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1178,13 +1178,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.1.tgz#5ab732dbdf30a1967ca5e92b4de48518d538cb32" - integrity sha512-ErZhpeMvhiN8bLkoXe0N/yBU1wHDnk962tQ2tzMqlkWE4fCtfvo3SxD7VsYbu6Qmakkys1QPd6lBphnBOw58FQ== +"@budibase/pro@1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.2.tgz#6d2fb2f09ff72824e9a72357ed22a993e5e8fbee" + integrity sha512-Is9SA0R/vFTWTMwRCg7TAWK/VW/Ww2zdDrtWwFY6W8uIi8wdv0ca+UUg6L3BgeWcO8Nd79P+8sAyHOe1EnfgCg== dependencies: - "@budibase/backend-core" "1.3.1" - "@budibase/types" "1.3.1" + "@budibase/backend-core" "1.3.2" + "@budibase/types" "1.3.2" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1207,10 +1207,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.3.1", "@budibase/types@^1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.1.tgz#84a8b0e6c574d6b53c50ffe2c6fba59241ede98b" - integrity sha512-dAZvJzvw0phvLub6nmeH4sPDWKqPQH6QrFjOcgE6XR/7o7QjwTCJ00Jz07FBjh/ax+/9v6y/GauozejoESwA2w== +"@budibase/types@1.3.2", "@budibase/types@^1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.2.tgz#64b2f3fc6474eecbfb7eb14f209b46c1f828a782" + integrity sha512-IBbfUvk163KZvThsyyDp2W6nlTQnCq4qx2vsO9kxz/pYHe12axYfkQD53w/hc4ZID5F0iA8/oNb3S6gAJjGQfA== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 47d11c9693..409d24211e 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.3.2", - "@budibase/pro": "1.3.1", + "@budibase/pro": "1.3.2", "@budibase/string-templates": "^1.3.2", "@budibase/types": "^1.3.2", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 959b86fa00..3a870a6e98 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.1.tgz#7fb6437d9d8926c1500f8dd2ce51bc5e850b354a" - integrity sha512-H9iqfcVX/XSxJr9aWkhIUHD87fdJgDHpd6Gdkjsx/Ua3z3UJeW2dfkcP3so2MM/hPLpP181hOaFjk2/lDBiagw== +"@budibase/backend-core@1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.2.tgz#91e61915b8ab1938afea4a6fe5fc9806e6c75e16" + integrity sha512-3keFjRzmRhjwhMaUxLzUF4Osqwxe0ip3USS+hbP5P1kxFtydmCXSCiUovef2JhvjfkCI3JhDOUb/TUDTF6Tc1g== dependencies: - "@budibase/types" "^1.3.1" + "@budibase/types" "^1.3.2" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -325,21 +325,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.1.tgz#5ab732dbdf30a1967ca5e92b4de48518d538cb32" - integrity sha512-ErZhpeMvhiN8bLkoXe0N/yBU1wHDnk962tQ2tzMqlkWE4fCtfvo3SxD7VsYbu6Qmakkys1QPd6lBphnBOw58FQ== +"@budibase/pro@1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.2.tgz#6d2fb2f09ff72824e9a72357ed22a993e5e8fbee" + integrity sha512-Is9SA0R/vFTWTMwRCg7TAWK/VW/Ww2zdDrtWwFY6W8uIi8wdv0ca+UUg6L3BgeWcO8Nd79P+8sAyHOe1EnfgCg== dependencies: - "@budibase/backend-core" "1.3.1" - "@budibase/types" "1.3.1" + "@budibase/backend-core" "1.3.2" + "@budibase/types" "1.3.2" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.3.1", "@budibase/types@^1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.1.tgz#84a8b0e6c574d6b53c50ffe2c6fba59241ede98b" - integrity sha512-dAZvJzvw0phvLub6nmeH4sPDWKqPQH6QrFjOcgE6XR/7o7QjwTCJ00Jz07FBjh/ax+/9v6y/GauozejoESwA2w== +"@budibase/types@1.3.2", "@budibase/types@^1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.2.tgz#64b2f3fc6474eecbfb7eb14f209b46c1f828a782" + integrity sha512-IBbfUvk163KZvThsyyDp2W6nlTQnCq4qx2vsO9kxz/pYHe12axYfkQD53w/hc4ZID5F0iA8/oNb3S6gAJjGQfA== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 5a08834def2c5ff8ec6804c91d2868896789e238 Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Fri, 2 Sep 2022 19:16:13 +0100 Subject: [PATCH 087/260] delete plugin through modal confirmation --- .../_components/DeletePluginModal.svelte | 31 +++++++++++++++++++ .../plugins/_components/PluginRow.svelte | 16 +++++++--- .../portal/manage/plugins/index.svelte | 16 +++++++++- 3 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 packages/builder/src/pages/builder/portal/manage/plugins/_components/DeletePluginModal.svelte diff --git a/packages/builder/src/pages/builder/portal/manage/plugins/_components/DeletePluginModal.svelte b/packages/builder/src/pages/builder/portal/manage/plugins/_components/DeletePluginModal.svelte new file mode 100644 index 0000000000..3907c1a0a2 --- /dev/null +++ b/packages/builder/src/pages/builder/portal/manage/plugins/_components/DeletePluginModal.svelte @@ -0,0 +1,31 @@ + + + + + Are you sure you want to delete {plugin?.name} + + diff --git a/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte b/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte index 3a92a699e6..9c166b8b1b 100644 --- a/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte +++ b/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte @@ -1,6 +1,8 @@
@@ -41,9 +51,7 @@ - plugins.deletePlugin(plugin._id, plugin._rev)} - icon="Delete">Delete remove(plugin)} icon="Delete">Delete editGroup(plugin)} icon="Edit">Edit diff --git a/packages/builder/src/pages/builder/portal/manage/plugins/index.svelte b/packages/builder/src/pages/builder/portal/manage/plugins/index.svelte index 61227786b0..489333b095 100644 --- a/packages/builder/src/pages/builder/portal/manage/plugins/index.svelte +++ b/packages/builder/src/pages/builder/portal/manage/plugins/index.svelte @@ -13,9 +13,12 @@ import { plugins } from "stores/portal" import PluginRow from "./_components/PluginRow.svelte" import AddPluginModal from "./_components/AddPluginModal.svelte" + import DeletePluginModal from "./_components/DeletePluginModal.svelte" let modal + let deleteModal let searchTerm = "" + let removePlugin let filterOptions = [ { label: "All Plugins", value: "all" }, @@ -31,6 +34,14 @@ .filter(plugin => plugin?.name?.toLowerCase().includes(searchTerm.toLowerCase()) ) + + const deletePlugin = evt => { + const { detail } = evt + + deleteModal.show() + removePlugin = detail + } + onMount(async () => { await plugins.load() }) @@ -66,7 +77,7 @@ {#if $plugins} {#each filteredPlugins as plugin} - + {/each} {/if} @@ -75,6 +86,9 @@ + + + From 9d4f40fc7de4739f1780081402d78a4ce66ef2f7 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Mon, 5 Sep 2022 09:46:54 +0100 Subject: [PATCH 103/260] Fix auto user creation for OIDC auth --- packages/worker/src/sdk/users/users.ts | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/packages/worker/src/sdk/users/users.ts b/packages/worker/src/sdk/users/users.ts index 0ea16bf670..a8944b936a 100644 --- a/packages/worker/src/sdk/users/users.ts +++ b/packages/worker/src/sdk/users/users.ts @@ -189,23 +189,34 @@ export const save = async ( const tenantId = tenancy.getTenantId() const db = tenancy.getGlobalDB() let { email, _id } = user + if (!email && !_id) { + throw new Error("_id or email is required") + } let dbUser: User | undefined if (_id) { // try to get existing user from db - dbUser = (await db.get(_id)) as User - if (email && dbUser.email !== email) { - throw "Email address cannot be changed" + try { + dbUser = (await db.get(_id)) as User + if (email && dbUser.email !== email) { + throw "Email address cannot be changed" + } + email = dbUser.email + } catch (e: any) { + if (e.status === 404) { + // do nothing, save this new user with the id specified - required for SSO auth + } else { + throw e + } } - email = dbUser.email - } else if (email) { + } + + if (!dbUser && email) { // no id was specified - load from email instead dbUser = await usersCore.getGlobalUserByEmail(email) if (dbUser && dbUser._id !== _id) { throw `Unavailable` } - } else { - throw new Error("_id or email is required") } await validateUniqueUser(email, tenantId) From 5a34bda3e24d9fcea7ca59c7e1e3aaca4989228f Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Mon, 5 Sep 2022 09:09:43 +0100 Subject: [PATCH 104/260] Configurable api rate limit through nginx --- hosting/docker-compose.yaml | 1 + hosting/nginx.prod.conf.hbs | 2 +- hosting/proxy/Dockerfile | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hosting/docker-compose.yaml b/hosting/docker-compose.yaml index 7d3e6960dc..c55ca34547 100644 --- a/hosting/docker-compose.yaml +++ b/hosting/docker-compose.yaml @@ -78,6 +78,7 @@ services: image: budibase/proxy environment: - PROXY_RATE_LIMIT_WEBHOOKS_PER_SECOND=10 + - PROXY_RATE_LIMIT_API_PER_SECOND=20 depends_on: - minio-service - worker-service diff --git a/hosting/nginx.prod.conf.hbs b/hosting/nginx.prod.conf.hbs index 5ecea67c42..0ff986d0a7 100644 --- a/hosting/nginx.prod.conf.hbs +++ b/hosting/nginx.prod.conf.hbs @@ -11,7 +11,7 @@ events { http { # rate limiting limit_req_status 429; - limit_req_zone $binary_remote_addr zone=ratelimit:10m rate=20r/s; + limit_req_zone $binary_remote_addr zone=ratelimit:10m rate=${PROXY_RATE_LIMIT_API_PER_SECOND}r/s; limit_req_zone $binary_remote_addr zone=webhooks:10m rate=${PROXY_RATE_LIMIT_WEBHOOKS_PER_SECOND}r/s; include /etc/nginx/mime.types; diff --git a/hosting/proxy/Dockerfile b/hosting/proxy/Dockerfile index d9b33e3e9a..298762aaf1 100644 --- a/hosting/proxy/Dockerfile +++ b/hosting/proxy/Dockerfile @@ -10,4 +10,5 @@ COPY .generated-nginx.prod.conf /etc/nginx/templates/nginx.conf.template COPY error.html /usr/share/nginx/html/error.html # Default environment -ENV PROXY_RATE_LIMIT_WEBHOOKS_PER_SECOND=10 \ No newline at end of file +ENV PROXY_RATE_LIMIT_WEBHOOKS_PER_SECOND=10 +ENV PROXY_RATE_LIMIT_API_PER_SECOND=20 \ No newline at end of file From 32b336cc2ddf2749b419a29d1883e95a68419feb Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Mon, 5 Sep 2022 10:13:55 +0100 Subject: [PATCH 105/260] cleaning minio folder when deleting plugin --- packages/server/src/api/controllers/plugin.ts | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/controllers/plugin.ts b/packages/server/src/api/controllers/plugin.ts index 337df0fc9e..8ec898d67d 100644 --- a/packages/server/src/api/controllers/plugin.ts +++ b/packages/server/src/api/controllers/plugin.ts @@ -4,11 +4,14 @@ import { createNpmPlugin, createUrlPlugin, createGithubPlugin, - loadJSFile + loadJSFile, } from "../../utilities/fileSystem" import { getGlobalDB } from "@budibase/backend-core/tenancy" import { generatePluginID, getPluginParams } from "../../db/utils" -import { uploadDirectory } from "@budibase/backend-core/objectStore" +import { + uploadDirectory, + deleteFolder, +} from "@budibase/backend-core/objectStore" import { PluginType, FileType } from "@budibase/types" import env from "../../environment" @@ -98,7 +101,20 @@ export async function fetch(ctx: any) { export async function destroy(ctx: any) { const db = getGlobalDB() - await db.remove(ctx.params.pluginId, ctx.params.pluginRev) + const { pluginId, pluginRev } = ctx.params + + try { + const plugin = await db.get(pluginId) + const bucketPath = `${plugin.name}/` + await deleteFolder(ObjectStoreBuckets.PLUGINS, bucketPath) + + await db.remove(pluginId, pluginRev) + } catch (err: any) { + const errMsg = err?.message ? err?.message : err + + ctx.throw(400, `Failed to delete plugin: ${errMsg}`) + } + ctx.message = `Plugin ${ctx.params.pluginId} deleted.` ctx.status = 200 } From a03d007821ea3224f21edfb692ee15c6355059eb Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Mon, 5 Sep 2022 10:28:09 +0100 Subject: [PATCH 106/260] random name in case it is needed --- packages/server/src/api/controllers/plugin.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/plugin.ts b/packages/server/src/api/controllers/plugin.ts index 8ec898d67d..254a008781 100644 --- a/packages/server/src/api/controllers/plugin.ts +++ b/packages/server/src/api/controllers/plugin.ts @@ -55,9 +55,11 @@ export async function upload(ctx: any) { } export async function create(ctx: any) { - const { type, source, name, url, headers, githubToken } = ctx.request.body + const { type, source, url, headers, githubToken } = ctx.request.body let metadata let directory + // Generating random name as a backup and needed for url + let name = "PLUGIN_" + Math.floor(100000 + Math.random() * 900000) switch (source) { case "npm": From cb4b918e5a3cf79733f306c9db305d81a101ad47 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Mon, 5 Sep 2022 11:27:43 +0100 Subject: [PATCH 107/260] remove name selection from UI --- packages/bbui/src/Modal/ModalContent.svelte | 2 +- .../plugins/_components/AddPluginModal.svelte | 1 + .../manage/plugins/_components/PluginRow.svelte | 14 ++++---------- packages/builder/src/stores/portal/plugins.js | 3 +-- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/packages/bbui/src/Modal/ModalContent.svelte b/packages/bbui/src/Modal/ModalContent.svelte index 4c70f2390a..d946268da6 100644 --- a/packages/bbui/src/Modal/ModalContent.svelte +++ b/packages/bbui/src/Modal/ModalContent.svelte @@ -88,7 +88,7 @@
- {#if showCancelButton || showConfirmButton} + {#if showCancelButton || showConfirmButton || $$slots.footer}
diff --git a/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte b/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte index 7149136dec..2ccc9283e9 100644 --- a/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte +++ b/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte @@ -92,6 +92,7 @@ { if (!e.detail || e.detail.length === 0) { diff --git a/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte b/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte index 0eabad111a..30fddb2f76 100644 --- a/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte +++ b/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte @@ -8,9 +8,9 @@ Label, Input, } from "@budibase/bbui" - import { plugins } from "stores/portal" export let plugin + export let deletePlugin let detailsModal @@ -74,17 +74,11 @@
diff --git a/packages/builder/src/stores/portal/plugins.js b/packages/builder/src/stores/portal/plugins.js index 821934307d..9d558561b6 100644 --- a/packages/builder/src/stores/portal/plugins.js +++ b/packages/builder/src/stores/portal/plugins.js @@ -17,11 +17,10 @@ export function createPluginsStore() { }) } - async function createPlugin(type, source, name, url, auth = null) { + async function createPlugin(type, source, url, auth = null) { let pluginData = { type, source, - name, url, } From 60bff4555160d56431c8ddd24b8ae90c0e135e45 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 5 Sep 2022 10:40:03 +0000 Subject: [PATCH 108/260] v1.3.5 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 4 ++-- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lerna.json b/lerna.json index bffcb4a06c..9e1ede8e2d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.4", + "version": "1.3.5", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index a338fc950d..6e5e8ab92a 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.3.4", + "version": "1.3.5", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "^1.3.4", + "@budibase/types": "^1.3.5", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 68aaf95155..b5a4e35683 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.3.4", + "version": "1.3.5", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.3.4", + "@budibase/string-templates": "^1.3.5", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 046fbda883..007d8aae6b 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.3.4", + "version": "1.3.5", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.3.4", - "@budibase/client": "^1.3.4", - "@budibase/frontend-core": "^1.3.4", - "@budibase/string-templates": "^1.3.4", + "@budibase/bbui": "^1.3.5", + "@budibase/client": "^1.3.5", + "@budibase/frontend-core": "^1.3.5", + "@budibase/string-templates": "^1.3.5", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 8a8962820f..a86c0b04f9 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.3.4", + "version": "1.3.5", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,7 +26,7 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "^1.3.4", + "@budibase/backend-core": "^1.3.5", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 317f84b1c5..5f930aee94 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.3.4", + "version": "1.3.5", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.3.4", - "@budibase/frontend-core": "^1.3.4", - "@budibase/string-templates": "^1.3.4", + "@budibase/bbui": "^1.3.5", + "@budibase/frontend-core": "^1.3.5", + "@budibase/string-templates": "^1.3.5", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 2b268900bf..65729b54ed 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.3.4", + "version": "1.3.5", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.3.4", + "@budibase/bbui": "^1.3.5", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index a104c56c9c..06fc5dd0be 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.3.4", + "version": "1.3.5", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^1.3.4", - "@budibase/client": "^1.3.4", + "@budibase/backend-core": "^1.3.5", + "@budibase/client": "^1.3.5", "@budibase/pro": "1.3.4", - "@budibase/string-templates": "^1.3.4", - "@budibase/types": "^1.3.4", + "@budibase/string-templates": "^1.3.5", + "@budibase/types": "^1.3.5", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 28d68cdd09..126ad55d19 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.3.4", + "version": "1.3.5", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 920c394d0d..38c8754f91 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.3.4", + "version": "1.3.5", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 0c89053da1..869e296438 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.3.4", + "version": "1.3.5", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.3.4", + "@budibase/backend-core": "^1.3.5", "@budibase/pro": "1.3.4", - "@budibase/string-templates": "^1.3.4", - "@budibase/types": "^1.3.4", + "@budibase/string-templates": "^1.3.5", + "@budibase/types": "^1.3.5", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 855c5d3ae1f6d4ead654b0e0e33e7a7c6b358dd1 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 5 Sep 2022 10:43:12 +0000 Subject: [PATCH 109/260] Update pro version to 1.3.5 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 06fc5dd0be..6dbb7e0d5b 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^1.3.5", "@budibase/client": "^1.3.5", - "@budibase/pro": "1.3.4", + "@budibase/pro": "1.3.5", "@budibase/string-templates": "^1.3.5", "@budibase/types": "^1.3.5", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index bd258ea6d6..38754c99e4 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.4": - version "1.3.4" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.4.tgz#91de405d2eff963cabe58b286b73711239ffea52" - integrity sha512-csKHVM9H+7s26k0h+kQm1u6qz7A5/TgOUCSyuysR9aUak5rb5klC2/84AUlpRS4RJWQ37/X0QpovbrakAdXzsw== +"@budibase/backend-core@1.3.5": + version "1.3.5" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.5.tgz#67f437bfe19f7c8db03f2d64a78be561cd827df5" + integrity sha512-hhEIb1rTOQxE3aj6O2UqklHWd0dcGUBdeoNJrtmWmwSUkqjk+WBZ9WZgzeVUUtSgTUFCjMe7aup6QV+NpEteWg== dependencies: - "@budibase/types" "^1.3.4" + "@budibase/types" "^1.3.5" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1178,13 +1178,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.3.4": - version "1.3.4" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.4.tgz#f21c23dcac5dce23d33fb09bc769447a960fc481" - integrity sha512-jOMRYu+7R8Dpn2l1BdwiaXkxQZb78jFEZIF2XJYUBSjKscgAZGgU+OyYYozRWQip563hTU3eZcqAtQKgfchEZg== +"@budibase/pro@1.3.5": + version "1.3.5" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.5.tgz#e828f5f5bbb8db69388df32fa6e7fb4de999a49b" + integrity sha512-3Pn1IW6R6DZ9J+6n2R/F0m357vjrnm/lonXpb6JcpWwSPLI5KtPIVSrKQaRxsSqc76355HSCoryGKorQIRq2Lg== dependencies: - "@budibase/backend-core" "1.3.4" - "@budibase/types" "1.3.4" + "@budibase/backend-core" "1.3.5" + "@budibase/types" "1.3.5" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1207,10 +1207,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.3.4", "@budibase/types@^1.3.4": - version "1.3.4" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.4.tgz#25f087b024e843eb372e50c81f8f925fb39f1dfd" - integrity sha512-ndyWs8yeCS7cpZjApDB1HhY6UUM2SRBUgAMCZOZaWABG9JHeCbx7x0e/pA2SZjswdMXqS5WmnEd3br5wuvUzJw== +"@budibase/types@1.3.5", "@budibase/types@^1.3.5": + version "1.3.5" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.5.tgz#55cb770527085ab573f15ef0e7b28b9cae2d76ba" + integrity sha512-SSqe8ojEbSNzQHTw2OeXmVWimb/C9Hclcxif0NCCPsan2btx84yMZLO+A3GXanTqzmvSz4ZbkS7/33xwDiOHIA== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 869e296438..45fb2336a2 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.3.5", - "@budibase/pro": "1.3.4", + "@budibase/pro": "1.3.5", "@budibase/string-templates": "^1.3.5", "@budibase/types": "^1.3.5", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index e7e258efe6..8f339d2ab1 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.4": - version "1.3.4" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.4.tgz#91de405d2eff963cabe58b286b73711239ffea52" - integrity sha512-csKHVM9H+7s26k0h+kQm1u6qz7A5/TgOUCSyuysR9aUak5rb5klC2/84AUlpRS4RJWQ37/X0QpovbrakAdXzsw== +"@budibase/backend-core@1.3.5": + version "1.3.5" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.5.tgz#67f437bfe19f7c8db03f2d64a78be561cd827df5" + integrity sha512-hhEIb1rTOQxE3aj6O2UqklHWd0dcGUBdeoNJrtmWmwSUkqjk+WBZ9WZgzeVUUtSgTUFCjMe7aup6QV+NpEteWg== dependencies: - "@budibase/types" "^1.3.4" + "@budibase/types" "^1.3.5" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -325,21 +325,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.3.4": - version "1.3.4" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.4.tgz#f21c23dcac5dce23d33fb09bc769447a960fc481" - integrity sha512-jOMRYu+7R8Dpn2l1BdwiaXkxQZb78jFEZIF2XJYUBSjKscgAZGgU+OyYYozRWQip563hTU3eZcqAtQKgfchEZg== +"@budibase/pro@1.3.5": + version "1.3.5" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.5.tgz#e828f5f5bbb8db69388df32fa6e7fb4de999a49b" + integrity sha512-3Pn1IW6R6DZ9J+6n2R/F0m357vjrnm/lonXpb6JcpWwSPLI5KtPIVSrKQaRxsSqc76355HSCoryGKorQIRq2Lg== dependencies: - "@budibase/backend-core" "1.3.4" - "@budibase/types" "1.3.4" + "@budibase/backend-core" "1.3.5" + "@budibase/types" "1.3.5" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.3.4", "@budibase/types@^1.3.4": - version "1.3.4" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.4.tgz#25f087b024e843eb372e50c81f8f925fb39f1dfd" - integrity sha512-ndyWs8yeCS7cpZjApDB1HhY6UUM2SRBUgAMCZOZaWABG9JHeCbx7x0e/pA2SZjswdMXqS5WmnEd3br5wuvUzJw== +"@budibase/types@1.3.5", "@budibase/types@^1.3.5": + version "1.3.5" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.5.tgz#55cb770527085ab573f15ef0e7b28b9cae2d76ba" + integrity sha512-SSqe8ojEbSNzQHTw2OeXmVWimb/C9Hclcxif0NCCPsan2btx84yMZLO+A3GXanTqzmvSz4ZbkS7/33xwDiOHIA== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 3f3f792c6589ae523baf1153ba2acf77808c92d9 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 5 Sep 2022 11:27:59 +0000 Subject: [PATCH 110/260] v1.3.4-alpha.1 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 4 ++-- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lerna.json b/lerna.json index 2c00056102..70a4e77a28 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.4-alpha.0", + "version": "1.3.4-alpha.1", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 098ba87298..b5765805cd 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.3.4-alpha.0", + "version": "1.3.4-alpha.1", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "1.3.4-alpha.0", + "@budibase/types": "1.3.4-alpha.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 9602a4f464..181c2ac0a8 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.3.4-alpha.0", + "version": "1.3.4-alpha.1", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "1.3.4-alpha.0", + "@budibase/string-templates": "1.3.4-alpha.1", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index d638331f62..f66178cf58 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.3.4-alpha.0", + "version": "1.3.4-alpha.1", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "1.3.4-alpha.0", - "@budibase/client": "1.3.4-alpha.0", - "@budibase/frontend-core": "1.3.4-alpha.0", - "@budibase/string-templates": "1.3.4-alpha.0", + "@budibase/bbui": "1.3.4-alpha.1", + "@budibase/client": "1.3.4-alpha.1", + "@budibase/frontend-core": "1.3.4-alpha.1", + "@budibase/string-templates": "1.3.4-alpha.1", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 72b1ed90c6..9f3c45c2e6 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.3.4-alpha.0", + "version": "1.3.4-alpha.1", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,7 +26,7 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "1.3.4-alpha.0", + "@budibase/backend-core": "1.3.4-alpha.1", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 4f5c5a0552..f5f4af13d6 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.3.4-alpha.0", + "version": "1.3.4-alpha.1", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "1.3.4-alpha.0", - "@budibase/frontend-core": "1.3.4-alpha.0", - "@budibase/string-templates": "1.3.4-alpha.0", + "@budibase/bbui": "1.3.4-alpha.1", + "@budibase/frontend-core": "1.3.4-alpha.1", + "@budibase/string-templates": "1.3.4-alpha.1", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 91c6f1807f..e894018bd7 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.3.4-alpha.0", + "version": "1.3.4-alpha.1", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "1.3.4-alpha.0", + "@budibase/bbui": "1.3.4-alpha.1", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 87391f472a..f56e50dc1f 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.3.4-alpha.0", + "version": "1.3.4-alpha.1", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "1.3.4-alpha.0", - "@budibase/client": "1.3.4-alpha.0", + "@budibase/backend-core": "1.3.4-alpha.1", + "@budibase/client": "1.3.4-alpha.1", "@budibase/pro": "1.3.4-alpha.0", - "@budibase/string-templates": "1.3.4-alpha.0", - "@budibase/types": "1.3.4-alpha.0", + "@budibase/string-templates": "1.3.4-alpha.1", + "@budibase/types": "1.3.4-alpha.1", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 2d5a300586..329d78894d 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.3.4-alpha.0", + "version": "1.3.4-alpha.1", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 1b6b12e87d..941860a34e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.3.4-alpha.0", + "version": "1.3.4-alpha.1", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index cd3d783f58..2c73c8d881 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.3.4-alpha.0", + "version": "1.3.4-alpha.1", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "1.3.4-alpha.0", + "@budibase/backend-core": "1.3.4-alpha.1", "@budibase/pro": "1.3.4-alpha.0", - "@budibase/string-templates": "1.3.4-alpha.0", - "@budibase/types": "1.3.4-alpha.0", + "@budibase/string-templates": "1.3.4-alpha.1", + "@budibase/types": "1.3.4-alpha.1", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From c05c7b5f1e6a2a23196bab36de7b45e0bc5d0d0e Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 5 Sep 2022 12:28:01 +0100 Subject: [PATCH 111/260] Prevent default browser events from firing when using keyboard shortcuts --- .../_components/navigation/ComponentKeyHandler.svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentKeyHandler.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentKeyHandler.svelte index 467d9a5a2f..77147d0f9a 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentKeyHandler.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentKeyHandler.svelte @@ -54,7 +54,7 @@ }, } - const handleKeyAction = async (component, key, ctrlKey = false) => { + const handleKeyAction = async (event, component, key, ctrlKey = false) => { if (!component || !key) { return false } @@ -70,6 +70,9 @@ const handler = keyHandlers[key] if (!handler) { return false + } else if (event) { + event.preventDefault() + event.stopPropagation() } return handler(component) } catch (error) { @@ -89,14 +92,14 @@ return } // Key events are always for the selected component - return handleKeyAction($selectedComponent, e.key, e.ctrlKey || e.metaKey) + return handleKeyAction(e, $selectedComponent, e.key, e.ctrlKey || e.metaKey) } const handleComponentMenu = async e => { // Menu events can be for any component const { id, key, ctrlKey } = e.detail const component = findComponent($selectedScreen.props, id) - return await handleKeyAction(component, key, ctrlKey) + return await handleKeyAction(null, component, key, ctrlKey) } onMount(() => { From 1ab8ffa687d97a46c8c29cdcc54ae6c0c96d764c Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 5 Sep 2022 11:31:57 +0000 Subject: [PATCH 112/260] Update pro version to 1.3.4-alpha.1 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index f56e50dc1f..002328863b 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "1.3.4-alpha.1", "@budibase/client": "1.3.4-alpha.1", - "@budibase/pro": "1.3.4-alpha.0", + "@budibase/pro": "1.3.4-alpha.1", "@budibase/string-templates": "1.3.4-alpha.1", "@budibase/types": "1.3.4-alpha.1", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 15bb54baab..5e5fd1d7b9 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.4-alpha.0": - version "1.3.4-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.4-alpha.0.tgz#630120bbbbeda7e13edc2d3ef878088d64fbdba5" - integrity sha512-LzAnOM06f0nDY76bgLjQuL2ChSOdhLg1zLPnwK07OEfQ9w8ZkkhNwJC/7/FAnnNEMypnKezrxXfhqee341JPZA== +"@budibase/backend-core@1.3.4-alpha.1": + version "1.3.4-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.4-alpha.1.tgz#5c7547bdf22da936ab6fea8c5fc3ad1b9d54a910" + integrity sha512-TH4AyFm31kduVYdciw0TLhkGbilSi6vtE2h0qbnr5QV8SszZ8iKt3vUljTHS0PsH2V/S7qLQVEqZ2blkpRHO0A== dependencies: - "@budibase/types" "1.3.4-alpha.0" + "@budibase/types" "1.3.4-alpha.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1178,13 +1178,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.3.4-alpha.0": - version "1.3.4-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.4-alpha.0.tgz#37af17330c85131be1d2fe3cb5ef9c15bb46ab0a" - integrity sha512-2hM/wXP2UrG52tlnoABdSnEMlk2edEjZF+FdYJGmJWGPkXhfI5sWV6B9a0+v9lH/xazj7Pv0XKdfe/IpfapLyQ== +"@budibase/pro@1.3.4-alpha.1": + version "1.3.4-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.4-alpha.1.tgz#fa58c6a0e58d620ddd329389ae896b823a4dd50e" + integrity sha512-e8dReYYw+weqYYAQC0zkatBgACaXcbM71kneUTYaX7DnYg7WGY3EHyfajjlQXq+gxmVuXc6wkY28dIozG+/8TQ== dependencies: - "@budibase/backend-core" "1.3.4-alpha.0" - "@budibase/types" "1.3.4-alpha.0" + "@budibase/backend-core" "1.3.4-alpha.1" + "@budibase/types" "1.3.4-alpha.1" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1207,10 +1207,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.3.4-alpha.0": - version "1.3.4-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.4-alpha.0.tgz#954a99cb10e564d8a28e789eced870f7602f092b" - integrity sha512-SXJ3kMBpsIVzXqux3z5X/L4IM5QhhrGNcS03k8pKpfqr5yoDwH+P5S2rAc0qZ7YgqlTBP9TVfzaJntWAc9YtQQ== +"@budibase/types@1.3.4-alpha.1": + version "1.3.4-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.4-alpha.1.tgz#e75aaf70b5c5a3e7b9fde6f77cb91447dffe0d2d" + integrity sha512-DpjO3bkPiOCDtIsvPWU4p6SGBAsN80vtr7zz3Cjrv7p98050fWzkUBPAISOTCWTq59OpF6dUhmMmOQuN6OrK+g== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 2c73c8d881..8f6d362a0e 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "1.3.4-alpha.1", - "@budibase/pro": "1.3.4-alpha.0", + "@budibase/pro": "1.3.4-alpha.1", "@budibase/string-templates": "1.3.4-alpha.1", "@budibase/types": "1.3.4-alpha.1", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index e8b842ac72..4098129265 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.4-alpha.0": - version "1.3.4-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.4-alpha.0.tgz#630120bbbbeda7e13edc2d3ef878088d64fbdba5" - integrity sha512-LzAnOM06f0nDY76bgLjQuL2ChSOdhLg1zLPnwK07OEfQ9w8ZkkhNwJC/7/FAnnNEMypnKezrxXfhqee341JPZA== +"@budibase/backend-core@1.3.4-alpha.1": + version "1.3.4-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.4-alpha.1.tgz#5c7547bdf22da936ab6fea8c5fc3ad1b9d54a910" + integrity sha512-TH4AyFm31kduVYdciw0TLhkGbilSi6vtE2h0qbnr5QV8SszZ8iKt3vUljTHS0PsH2V/S7qLQVEqZ2blkpRHO0A== dependencies: - "@budibase/types" "1.3.4-alpha.0" + "@budibase/types" "1.3.4-alpha.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -325,21 +325,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.3.4-alpha.0": - version "1.3.4-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.4-alpha.0.tgz#37af17330c85131be1d2fe3cb5ef9c15bb46ab0a" - integrity sha512-2hM/wXP2UrG52tlnoABdSnEMlk2edEjZF+FdYJGmJWGPkXhfI5sWV6B9a0+v9lH/xazj7Pv0XKdfe/IpfapLyQ== +"@budibase/pro@1.3.4-alpha.1": + version "1.3.4-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.4-alpha.1.tgz#fa58c6a0e58d620ddd329389ae896b823a4dd50e" + integrity sha512-e8dReYYw+weqYYAQC0zkatBgACaXcbM71kneUTYaX7DnYg7WGY3EHyfajjlQXq+gxmVuXc6wkY28dIozG+/8TQ== dependencies: - "@budibase/backend-core" "1.3.4-alpha.0" - "@budibase/types" "1.3.4-alpha.0" + "@budibase/backend-core" "1.3.4-alpha.1" + "@budibase/types" "1.3.4-alpha.1" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.3.4-alpha.0": - version "1.3.4-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.4-alpha.0.tgz#954a99cb10e564d8a28e789eced870f7602f092b" - integrity sha512-SXJ3kMBpsIVzXqux3z5X/L4IM5QhhrGNcS03k8pKpfqr5yoDwH+P5S2rAc0qZ7YgqlTBP9TVfzaJntWAc9YtQQ== +"@budibase/types@1.3.4-alpha.1": + version "1.3.4-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.4-alpha.1.tgz#e75aaf70b5c5a3e7b9fde6f77cb91447dffe0d2d" + integrity sha512-DpjO3bkPiOCDtIsvPWU4p6SGBAsN80vtr7zz3Cjrv7p98050fWzkUBPAISOTCWTq59OpF6dUhmMmOQuN6OrK+g== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 3afc781dca675960ceb9accdb8acadfbaf0bb156 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 5 Sep 2022 13:07:27 +0100 Subject: [PATCH 113/260] Fixing backend-core build, as raised in #7603. --- packages/backend-core/package.json | 2 +- packages/backend-core/tsconfig.build.json | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index a338fc950d..ce3dd11a7c 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -60,7 +60,7 @@ ] }, "devDependencies": { - "@shopify/jest-koa-mocks": "3.1.5", + "@shopify/jest-koa-mocks": "^5.0.1", "@types/jest": "27.5.1", "@types/koa": "2.0.52", "@types/lodash": "4.14.180", diff --git a/packages/backend-core/tsconfig.build.json b/packages/backend-core/tsconfig.build.json index 40ffe6b827..acf93df89e 100644 --- a/packages/backend-core/tsconfig.build.json +++ b/packages/backend-core/tsconfig.build.json @@ -20,6 +20,8 @@ "package.json" ], "exclude": [ + "scripts", + "tests", "node_modules", "dist", "**/*.spec.ts", From 3add018e2c609be399495c60af756205a8892ccd Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 5 Sep 2022 13:26:35 +0100 Subject: [PATCH 114/260] Pinning. --- packages/backend-core/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index ce3dd11a7c..01be6a2bcd 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -60,7 +60,7 @@ ] }, "devDependencies": { - "@shopify/jest-koa-mocks": "^5.0.1", + "@shopify/jest-koa-mocks": "5.0.1", "@types/jest": "27.5.1", "@types/koa": "2.0.52", "@types/lodash": "4.14.180", From 88bc74f68b306af54fb907379e120f53c1969af2 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Mon, 5 Sep 2022 13:48:37 +0100 Subject: [PATCH 115/260] Cypress: Smoke Build: Test Changes createComponents - Updated how the test gets nav-items from the side nav bar commands - Updating maximum timeout value for cy.visit instances (this seems specific to the CI runs) - Updated createUser command to ensure better timing between the create user modals --- .../integration/createComponents.spec.js | 14 +++++------ packages/builder/cypress/support/commands.js | 25 +++++++++++-------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/packages/builder/cypress/integration/createComponents.spec.js b/packages/builder/cypress/integration/createComponents.spec.js index 649a77e442..e39ce4a4a8 100644 --- a/packages/builder/cypress/integration/createComponents.spec.js +++ b/packages/builder/cypress/integration/createComponents.spec.js @@ -20,7 +20,7 @@ filterTests(["all"], () => { //Use the tree to delete a selected component const deleteSelectedComponent = () => { cy.get( - ".nav-items-container .nav-item.selected .actions > div > .icon" + ".nav-item.selected .actions > div > .icon" ).click({ force: true, }) @@ -91,7 +91,7 @@ filterTests(["all"], () => { cy.searchAndAddComponent("Paragraph").then(componentId => { cy.get("[data-cy=setting-_instanceName] input").type(componentId).blur() cy.get( - ".nav-items-container .nav-item.selected .actions > div > .icon" + ".nav-item.selected .actions > div > .icon" ).click({ force: true, }) @@ -145,7 +145,7 @@ filterTests(["all"], () => { return testFieldFocusOnCreate(label) }) .then(() => { - cy.get(".nav-items-container .nav-item") + cy.get(".nav-item") .contains(formId) .click({ force: true }) deleteSelectedComponent() @@ -195,7 +195,7 @@ filterTests(["all"], () => { return testFocusOnCreate(label) }) .then(() => { - cy.get(".nav-items-container .nav-item") + cy.get(".nav-item") .contains(providerId) .click({ force: true }) deleteSelectedComponent() @@ -218,7 +218,7 @@ filterTests(["all"], () => { .find(".component-placeholder") .should("not.exist") cy.getComponent(imageId).find(`img[alt=${imageId}]`).should("exist") - cy.get(".nav-items-container .nav-item") + cy.get(".nav-item") .contains(imageId) .click({ force: true }) deleteSelectedComponent() @@ -242,7 +242,7 @@ filterTests(["all"], () => { cy.getComponent(markdownId) .find(".editor-preview-full h1") .contains("Hi") - cy.get(".nav-items-container .nav-item") + cy.get(".nav-item") .contains(markdownId) .click({ force: true }) deleteSelectedComponent() @@ -265,7 +265,7 @@ filterTests(["all"], () => { .find(".component-placeholder") .should("not.exist") cy.getComponent(iconId).find("i.ri-save-fill").should("exist") - cy.get(".nav-items-container .nav-item") + cy.get(".nav-item") .contains(iconId) .click({ force: true }) deleteSelectedComponent() diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index d4b0ec80e8..394d5e9af2 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -4,7 +4,7 @@ Cypress.on("uncaught:exception", () => { // ACCOUNTS & USERS Cypress.Commands.add("login", (email, password) => { - cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 10000 }) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.url() .should("include", "/builder/") .then(url => { @@ -33,7 +33,7 @@ Cypress.Commands.add("login", (email, password) => { }) Cypress.Commands.add("logOut", () => { - cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 2000 }) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.get(".user-dropdown .avatar > .icon").click({ force: true }) cy.get(".spectrum-Popover[data-cy='user-menu']").within(() => { cy.get("li[data-cy='user-logout']").click({ force: true }) @@ -43,7 +43,7 @@ Cypress.Commands.add("logOut", () => { Cypress.Commands.add("logoutNoAppGrid", () => { // Logs user out when app grid is not present - cy.visit(`${Cypress.config().baseUrl}/builder`) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.get(".avatar > .icon").click({ force: true }) cy.get(".spectrum-Popover[data-cy='user-menu']").within(() => { cy.get(".spectrum-Menu-item").contains("Log out").click({ force: true }) @@ -68,11 +68,14 @@ Cypress.Commands.add("createUser", (email, permission) => { .click({ force: true }) }) } - // Add user and wait for modal to change - cy.get(".spectrum-Button").contains("Add user").click({ force: true }) + // Add user + cy.get(".spectrum-Button").contains("Add users").click({ force: true }) cy.get(".spectrum-ActionButton").contains("Add email").should("not.exist") }) // Onboarding modal + cy.get(".spectrum-Dialog-grid", { timeout: 5000 }).contains( + "Choose your onboarding" + ) cy.get(".spectrum-Dialog-grid").within(() => { cy.get(".onboarding-type").eq(1).click() cy.get(".spectrum-Button").contains("Done").click({ force: true }) @@ -163,7 +166,7 @@ Cypress.Commands.add("createApp", (name, addDefaultTable) => { const shouldCreateDefaultTable = typeof addDefaultTable != "boolean" ? true : addDefaultTable - cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 10000 }) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.url({ timeout: 30000 }).should("include", "/apps") cy.get(`[data-cy="create-app-btn"]`, { timeout: 5000 }).click({ force: true }) @@ -197,7 +200,7 @@ Cypress.Commands.add("createApp", (name, addDefaultTable) => { }) Cypress.Commands.add("deleteApp", name => { - cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 }) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.wait(2000) cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) .its("body") @@ -254,7 +257,7 @@ Cypress.Commands.add("deleteApp", name => { }) Cypress.Commands.add("deleteAllApps", () => { - cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 }) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.wait(500) cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`, { timeout: 5000, @@ -351,7 +354,7 @@ Cypress.Commands.add("alterAppVersion", (appId, version) => { }) Cypress.Commands.add("importApp", (exportFilePath, name) => { - cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 }) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) .its("body") @@ -386,7 +389,7 @@ Cypress.Commands.add("importApp", (exportFilePath, name) => { // Filters visible with 1 or more Cypress.Commands.add("searchForApplication", appName => { - cy.visit(`${Cypress.config().baseUrl}/builder`) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.wait(2000) // No app filter functionality if only 1 app exists @@ -409,7 +412,7 @@ Cypress.Commands.add("searchForApplication", appName => { // Assumes there are no others Cypress.Commands.add("applicationInAppTable", appName => { - cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 10000 }) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.get(".appTable", { timeout: 5000 }).within(() => { cy.get(".title").contains(appName).should("exist") }) From 2cbdb12cd4ddf9eb55581a52192303b5a7b0ab22 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 5 Sep 2022 14:06:35 +0100 Subject: [PATCH 116/260] Updating backend-core lockfile. --- packages/backend-core/yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/backend-core/yarn.lock b/packages/backend-core/yarn.lock index 9f71691f44..22c17a9444 100644 --- a/packages/backend-core/yarn.lock +++ b/packages/backend-core/yarn.lock @@ -543,13 +543,13 @@ semver "^7.3.5" tar "^6.1.11" -"@shopify/jest-koa-mocks@3.1.5": - version "3.1.5" - resolved "https://registry.yarnpkg.com/@shopify/jest-koa-mocks/-/jest-koa-mocks-3.1.5.tgz#11f77ccfbcaf35cf5ee2c6108a286e61e6bea084" - integrity sha512-gQ3/7ELerv00TWO37AGFX5mT9CsFCS+3/UbKMuoIlKEU0QH2OX8BV9WBf/EKw7adCDNlxss0lqV6J8kf5pgr4A== +"@shopify/jest-koa-mocks@5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@shopify/jest-koa-mocks/-/jest-koa-mocks-5.0.1.tgz#fba490b6b7985fbb571eb9974897d396a3642e94" + integrity sha512-4YskS9q8+TEHNoyopmuoy2XyhInyqeOl7CF5ShJs19sm6m0EA/jGGvgf/osv2PeTfuf42/L2G9CzWUSg49yTSg== dependencies: koa "^2.13.4" - node-mocks-http "^1.5.8" + node-mocks-http "^1.11.0" "@sideway/address@^4.1.3": version "4.1.4" @@ -3914,7 +3914,7 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-mocks-http@^1.5.8: +node-mocks-http@^1.11.0: version "1.11.0" resolved "https://registry.yarnpkg.com/node-mocks-http/-/node-mocks-http-1.11.0.tgz#defc0febf6b935f08245397d47534a8de592996e" integrity sha512-jS/WzSOcKbOeGrcgKbenZeNhxUNnP36Yw11+hL4TTxQXErGfqYZ+MaYNNvhaTiGIJlzNSqgQkk9j8dSu1YWSuw== From 58f389b0edc540038e1ed51c8942328931e7355a Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 5 Sep 2022 13:19:34 +0000 Subject: [PATCH 117/260] v1.3.6 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 4 ++-- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lerna.json b/lerna.json index 9e1ede8e2d..721ceba47f 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.5", + "version": "1.3.6", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index e9e242369e..dbfecf37bd 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.3.5", + "version": "1.3.6", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "^1.3.5", + "@budibase/types": "^1.3.6", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index b5a4e35683..a23285b479 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.3.5", + "version": "1.3.6", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.3.5", + "@budibase/string-templates": "^1.3.6", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 007d8aae6b..78cfa9c4c6 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.3.5", + "version": "1.3.6", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.3.5", - "@budibase/client": "^1.3.5", - "@budibase/frontend-core": "^1.3.5", - "@budibase/string-templates": "^1.3.5", + "@budibase/bbui": "^1.3.6", + "@budibase/client": "^1.3.6", + "@budibase/frontend-core": "^1.3.6", + "@budibase/string-templates": "^1.3.6", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index a86c0b04f9..ea1938256c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.3.5", + "version": "1.3.6", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,7 +26,7 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "^1.3.5", + "@budibase/backend-core": "^1.3.6", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 5f930aee94..05a6a81770 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.3.5", + "version": "1.3.6", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.3.5", - "@budibase/frontend-core": "^1.3.5", - "@budibase/string-templates": "^1.3.5", + "@budibase/bbui": "^1.3.6", + "@budibase/frontend-core": "^1.3.6", + "@budibase/string-templates": "^1.3.6", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 65729b54ed..0dfe6b190c 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.3.5", + "version": "1.3.6", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.3.5", + "@budibase/bbui": "^1.3.6", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 6dbb7e0d5b..2b0c0eb6f1 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.3.5", + "version": "1.3.6", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^1.3.5", - "@budibase/client": "^1.3.5", + "@budibase/backend-core": "^1.3.6", + "@budibase/client": "^1.3.6", "@budibase/pro": "1.3.5", - "@budibase/string-templates": "^1.3.5", - "@budibase/types": "^1.3.5", + "@budibase/string-templates": "^1.3.6", + "@budibase/types": "^1.3.6", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 126ad55d19..817c442e01 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.3.5", + "version": "1.3.6", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 38c8754f91..a5684d2502 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.3.5", + "version": "1.3.6", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 45fb2336a2..35994a67f7 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.3.5", + "version": "1.3.6", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.3.5", + "@budibase/backend-core": "^1.3.6", "@budibase/pro": "1.3.5", - "@budibase/string-templates": "^1.3.5", - "@budibase/types": "^1.3.5", + "@budibase/string-templates": "^1.3.6", + "@budibase/types": "^1.3.6", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 5b576d23a5c2aec1074f4530720c713ad95f7185 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 5 Sep 2022 13:22:34 +0000 Subject: [PATCH 118/260] Update pro version to 1.3.6 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 2b0c0eb6f1..392a1d8b93 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^1.3.6", "@budibase/client": "^1.3.6", - "@budibase/pro": "1.3.5", + "@budibase/pro": "1.3.6", "@budibase/string-templates": "^1.3.6", "@budibase/types": "^1.3.6", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 38754c99e4..f91e3a5442 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.5": - version "1.3.5" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.5.tgz#67f437bfe19f7c8db03f2d64a78be561cd827df5" - integrity sha512-hhEIb1rTOQxE3aj6O2UqklHWd0dcGUBdeoNJrtmWmwSUkqjk+WBZ9WZgzeVUUtSgTUFCjMe7aup6QV+NpEteWg== +"@budibase/backend-core@1.3.6": + version "1.3.6" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.6.tgz#340b55a71eba228d44c8dd6107e28872a6f432d6" + integrity sha512-WIGseaoUrUWpqlbKadNuusQa1y9Ucm34AVei6oWRK1czJtLddaEt2zaMlD/qikcBB6XBJE3UML0Z82EvvdZPBQ== dependencies: - "@budibase/types" "^1.3.5" + "@budibase/types" "^1.3.6" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1178,13 +1178,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.3.5": - version "1.3.5" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.5.tgz#e828f5f5bbb8db69388df32fa6e7fb4de999a49b" - integrity sha512-3Pn1IW6R6DZ9J+6n2R/F0m357vjrnm/lonXpb6JcpWwSPLI5KtPIVSrKQaRxsSqc76355HSCoryGKorQIRq2Lg== +"@budibase/pro@1.3.6": + version "1.3.6" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.6.tgz#2ac68b341401003a25619c36137a1960b97ac01d" + integrity sha512-5QFkeR/6DdvXdIgufmqACIEEGvqXlinQrXVV45C0n95gKEXvRybv5eiWR9OO7UyYeJzQOv0PTY8O7ZtOSQrdwg== dependencies: - "@budibase/backend-core" "1.3.5" - "@budibase/types" "1.3.5" + "@budibase/backend-core" "1.3.6" + "@budibase/types" "1.3.6" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1207,10 +1207,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.3.5", "@budibase/types@^1.3.5": - version "1.3.5" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.5.tgz#55cb770527085ab573f15ef0e7b28b9cae2d76ba" - integrity sha512-SSqe8ojEbSNzQHTw2OeXmVWimb/C9Hclcxif0NCCPsan2btx84yMZLO+A3GXanTqzmvSz4ZbkS7/33xwDiOHIA== +"@budibase/types@1.3.6", "@budibase/types@^1.3.6": + version "1.3.6" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.6.tgz#b2c8b2cfd7ef37c7803c07499887dfc0a716c2dc" + integrity sha512-gu+G9E04Bumc0oRdXjjKj+FgPGDj/r38iLx7yiHfWIFwaXqn+Lvmljb20nfYTVF49LDVz2jowzACRzVX4rq6kA== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 35994a67f7..9c3a03a675 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.3.6", - "@budibase/pro": "1.3.5", + "@budibase/pro": "1.3.6", "@budibase/string-templates": "^1.3.6", "@budibase/types": "^1.3.6", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 8f339d2ab1..9647129caf 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.5": - version "1.3.5" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.5.tgz#67f437bfe19f7c8db03f2d64a78be561cd827df5" - integrity sha512-hhEIb1rTOQxE3aj6O2UqklHWd0dcGUBdeoNJrtmWmwSUkqjk+WBZ9WZgzeVUUtSgTUFCjMe7aup6QV+NpEteWg== +"@budibase/backend-core@1.3.6": + version "1.3.6" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.6.tgz#340b55a71eba228d44c8dd6107e28872a6f432d6" + integrity sha512-WIGseaoUrUWpqlbKadNuusQa1y9Ucm34AVei6oWRK1czJtLddaEt2zaMlD/qikcBB6XBJE3UML0Z82EvvdZPBQ== dependencies: - "@budibase/types" "^1.3.5" + "@budibase/types" "^1.3.6" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -325,21 +325,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.3.5": - version "1.3.5" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.5.tgz#e828f5f5bbb8db69388df32fa6e7fb4de999a49b" - integrity sha512-3Pn1IW6R6DZ9J+6n2R/F0m357vjrnm/lonXpb6JcpWwSPLI5KtPIVSrKQaRxsSqc76355HSCoryGKorQIRq2Lg== +"@budibase/pro@1.3.6": + version "1.3.6" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.6.tgz#2ac68b341401003a25619c36137a1960b97ac01d" + integrity sha512-5QFkeR/6DdvXdIgufmqACIEEGvqXlinQrXVV45C0n95gKEXvRybv5eiWR9OO7UyYeJzQOv0PTY8O7ZtOSQrdwg== dependencies: - "@budibase/backend-core" "1.3.5" - "@budibase/types" "1.3.5" + "@budibase/backend-core" "1.3.6" + "@budibase/types" "1.3.6" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.3.5", "@budibase/types@^1.3.5": - version "1.3.5" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.5.tgz#55cb770527085ab573f15ef0e7b28b9cae2d76ba" - integrity sha512-SSqe8ojEbSNzQHTw2OeXmVWimb/C9Hclcxif0NCCPsan2btx84yMZLO+A3GXanTqzmvSz4ZbkS7/33xwDiOHIA== +"@budibase/types@1.3.6", "@budibase/types@^1.3.6": + version "1.3.6" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.6.tgz#b2c8b2cfd7ef37c7803c07499887dfc0a716c2dc" + integrity sha512-gu+G9E04Bumc0oRdXjjKj+FgPGDj/r38iLx7yiHfWIFwaXqn+Lvmljb20nfYTVF49LDVz2jowzACRzVX4rq6kA== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From f37c8e0b8818951e776fcb6bb8c01aacddce5d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9F?= Date: Wed, 23 Feb 2022 16:26:09 +0100 Subject: [PATCH 119/260] allow specifying resources on app, worker, proxy deployments --- charts/budibase/templates/app-service-deployment.yaml | 5 ++++- charts/budibase/templates/proxy-service-deployment.yaml | 5 ++++- charts/budibase/templates/worker-service-deployment.yaml | 5 ++++- charts/budibase/values.yaml | 3 +++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/charts/budibase/templates/app-service-deployment.yaml b/charts/budibase/templates/app-service-deployment.yaml index 74b98ac008..422097e699 100644 --- a/charts/budibase/templates/app-service-deployment.yaml +++ b/charts/budibase/templates/app-service-deployment.yaml @@ -158,7 +158,10 @@ spec: name: bbapps ports: - containerPort: {{ .Values.services.apps.port }} - resources: {} + {{ with .Values.services.apps.resources }} + resources: + {{- toYaml . | nindent 10 }} + {{ end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} diff --git a/charts/budibase/templates/proxy-service-deployment.yaml b/charts/budibase/templates/proxy-service-deployment.yaml index 505a46f1e8..5588022032 100644 --- a/charts/budibase/templates/proxy-service-deployment.yaml +++ b/charts/budibase/templates/proxy-service-deployment.yaml @@ -30,7 +30,10 @@ spec: name: proxy-service ports: - containerPort: {{ .Values.services.proxy.port }} - resources: {} + {{ with .Values.services.proxy.resources }} + resources: + {{- toYaml . | nindent 10 }} + {{ end }} volumeMounts: {{- with .Values.affinity }} affinity: diff --git a/charts/budibase/templates/worker-service-deployment.yaml b/charts/budibase/templates/worker-service-deployment.yaml index 083231eeff..902e9ac03d 100644 --- a/charts/budibase/templates/worker-service-deployment.yaml +++ b/charts/budibase/templates/worker-service-deployment.yaml @@ -151,7 +151,10 @@ spec: name: bbworker ports: - containerPort: {{ .Values.services.worker.port }} - resources: {} + {{ with .Values.services.worker.resources }} + resources: + {{- toYaml . | nindent 10 }} + {{ end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} diff --git a/charts/budibase/values.yaml b/charts/budibase/values.yaml index 9b5e76d0d7..0ebf625abd 100644 --- a/charts/budibase/values.yaml +++ b/charts/budibase/values.yaml @@ -125,16 +125,19 @@ services: proxy: port: 10000 replicaCount: 1 + resources: {} apps: port: 4002 replicaCount: 1 logLevel: info + resources: {} # nodeDebug: "" # set the value of NODE_DEBUG worker: port: 4003 replicaCount: 1 + resources: {} couchdb: enabled: true From 1057eab83a7d70e017a93e11fc902d65123831a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9F?= Date: Mon, 29 Aug 2022 13:51:08 +0200 Subject: [PATCH 120/260] allow specifying resources on minio, redis deployments --- charts/budibase/templates/minio-service-deployment.yaml | 5 ++++- charts/budibase/templates/redis-service-deployment.yaml | 5 ++++- charts/budibase/values.yaml | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/charts/budibase/templates/minio-service-deployment.yaml b/charts/budibase/templates/minio-service-deployment.yaml index 103f9e3ed2..144dbe539a 100644 --- a/charts/budibase/templates/minio-service-deployment.yaml +++ b/charts/budibase/templates/minio-service-deployment.yaml @@ -56,7 +56,10 @@ spec: name: minio-service ports: - containerPort: {{ .Values.services.objectStore.port }} - resources: {} + {{ with .Values.services.objectStore.resources }} + resources: + {{- toYaml . | nindent 10 }} + {{ end }} volumeMounts: - mountPath: /data name: minio-data diff --git a/charts/budibase/templates/redis-service-deployment.yaml b/charts/budibase/templates/redis-service-deployment.yaml index 6e09346cad..d94e4d70f8 100644 --- a/charts/budibase/templates/redis-service-deployment.yaml +++ b/charts/budibase/templates/redis-service-deployment.yaml @@ -35,7 +35,10 @@ spec: name: redis-service ports: - containerPort: {{ .Values.services.redis.port }} - resources: {} + {{ with .Values.services.redis.resources }} + resources: + {{- toYaml . | nindent 10 }} + {{ end }} volumeMounts: - mountPath: /data name: redis-data diff --git a/charts/budibase/values.yaml b/charts/budibase/values.yaml index 0ebf625abd..950a2f838e 100644 --- a/charts/budibase/values.yaml +++ b/charts/budibase/values.yaml @@ -164,6 +164,7 @@ services: ## If undefined (the default) or set to null, no storageClassName spec is ## set, choosing the default provisioner. storageClass: "" + resources: {} objectStore: minio: true @@ -180,6 +181,7 @@ services: ## If undefined (the default) or set to null, no storageClassName spec is ## set, choosing the default provisioner. storageClass: "" + resources: {} # Override values in couchDB subchart couchdb: From de62475d93c0bd2f0c99f301e3c1b71ad900e8f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9F?= Date: Mon, 29 Aug 2022 13:52:45 +0200 Subject: [PATCH 121/260] allow specifying resources on couchdb-backup deployment --- charts/budibase/templates/couchdb-backup.yaml | 5 ++++- charts/budibase/values.yaml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/charts/budibase/templates/couchdb-backup.yaml b/charts/budibase/templates/couchdb-backup.yaml index ae062475ce..68e5eab617 100644 --- a/charts/budibase/templates/couchdb-backup.yaml +++ b/charts/budibase/templates/couchdb-backup.yaml @@ -38,7 +38,10 @@ spec: image: redgeoff/replicate-couchdb-cluster imagePullPolicy: Always name: couchdb-backup - resources: {} + {{ with .Values.services.couchdb.backup.resources }} + resources: + {{- toYaml . | nindent 10 }} + {{ end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} diff --git a/charts/budibase/values.yaml b/charts/budibase/values.yaml index 950a2f838e..14c18205df 100644 --- a/charts/budibase/values.yaml +++ b/charts/budibase/values.yaml @@ -151,6 +151,7 @@ services: target: "" # backup interval in seconds interval: "" + resources: {} redis: enabled: true # disable if using external redis From 3e2b98c97926687345a1df5f26b0b316690fcf69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9F?= Date: Mon, 29 Aug 2022 13:54:21 +0200 Subject: [PATCH 122/260] remove unused value from chart defaults --- charts/budibase/values.yaml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/charts/budibase/values.yaml b/charts/budibase/values.yaml index 14c18205df..a15504d58c 100644 --- a/charts/budibase/values.yaml +++ b/charts/budibase/values.yaml @@ -60,19 +60,6 @@ ingress: port: number: 10000 -resources: - {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - autoscaling: enabled: false minReplicas: 1 From 5ad21ad3332bc21ad75cab0045c8d1df198e027f Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Mon, 5 Sep 2022 14:39:19 +0100 Subject: [PATCH 123/260] improve responsiveness of plugins ui --- .../plugins/_components/PluginRow.svelte | 27 +++++++++++++------ packages/server/src/api/controllers/plugin.ts | 2 +- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte b/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte index 30fddb2f76..848611c248 100644 --- a/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte +++ b/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte @@ -12,6 +12,11 @@ export let plugin export let deletePlugin + let icon = + plugin.schema.type === "component" + ? plugin.schema.schema.icon || "Book" + : plugin.schema.schema.icon || "Beaker" + let detailsModal @@ -19,7 +24,7 @@
- +
-
+
+ + +
+ +
-
+
-
+
-
+
-
+
@@ -88,7 +99,7 @@ diff --git a/packages/builder/src/stores/portal/plugins.js b/packages/builder/src/stores/portal/plugins.js index a3d62ca6e3..9703b30cb7 100644 --- a/packages/builder/src/stores/portal/plugins.js +++ b/packages/builder/src/stores/portal/plugins.js @@ -50,11 +50,11 @@ export function createPluginsStore() { }) } - async function uploadPlugin(file, source) { + async function uploadPlugin(file, source, updatePlugin) { let data = new FormData() data.append("file", file) data.append("source", source) - + data.append("update", updatePlugin) let resp = await API.uploadPlugin(data) let newPlugin = resp.plugins[0] update(state => { diff --git a/packages/server/src/api/controllers/plugin.ts b/packages/server/src/api/controllers/plugin.ts index ce35d2fad5..a84a077b33 100644 --- a/packages/server/src/api/controllers/plugin.ts +++ b/packages/server/src/api/controllers/plugin.ts @@ -39,7 +39,11 @@ export async function upload(ctx: any) { let docs = [] // can do single or multiple plugins for (let plugin of plugins) { - const doc = await processPlugin(plugin, ctx.request.body.source) + const doc = await processPlugin( + plugin, + ctx.request.body.source, + ctx.request.body.update + ) docs.push(doc) } ctx.body = { @@ -128,7 +132,8 @@ export async function destroy(ctx: any) { export async function storePlugin( metadata: any, directory: any, - source?: string + source?: string, + update?: boolean ) { const db = getGlobalDB() const version = metadata.package.version, @@ -167,6 +172,9 @@ export async function storePlugin( const existing = await db.get(pluginId) rev = existing._rev } catch (err) { + if (update) { + throw new Error("Unable to update. Plugin does not exist") + } rev = undefined } let doc = { @@ -185,6 +193,7 @@ export async function storePlugin( source, } } + const response = await db.put(doc) return { ...doc, @@ -192,11 +201,15 @@ export async function storePlugin( } } -export async function processPlugin(plugin: FileType, source?: string) { +export async function processPlugin( + plugin: FileType, + source?: string, + update?: boolean +) { if (!env.SELF_HOSTED) { throw new Error("Plugins not supported outside of self-host.") } const { metadata, directory } = await uploadedFilePlugin(plugin) - return await storePlugin(metadata, directory, source) + return await storePlugin(metadata, directory, source, update) } From 535007de2cb311e8182728577037c2083cbd6df2 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Wed, 7 Sep 2022 13:52:05 +0100 Subject: [PATCH 174/260] Update createDatasourceScreen Adding a manual wait this time go better determine the timing issue occurring against the CI runs --- packages/builder/cypress/support/commands.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index bb26e53d80..a07a22188f 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -642,6 +642,7 @@ Cypress.Commands.add( cy.intercept("**/api/datasources").as("autoScreens") cy.get(".spectrum-Button").contains("Continue").click({ force: true }) cy.wait("@autoScreens") + cy.wait(5000) }) cy.get("[data-cy='autogenerated-screens']").should("not.exist") cy.get("[data-cy='data-source-modal']", { timeout: 10000 }).within(() => { From 145eb775ceb01a1d497e4bea45497b99ab01a261 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 7 Sep 2022 13:27:13 +0000 Subject: [PATCH 175/260] v1.3.12-alpha.2 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lerna.json b/lerna.json index efbd4520e1..a74e653725 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.12-alpha.1", + "version": "1.3.12-alpha.2", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 0b58e3497e..5f3414bab9 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.3.12-alpha.1", + "version": "1.3.12-alpha.2", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "1.3.12-alpha.1", + "@budibase/types": "1.3.12-alpha.2", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index ee0b00a2b5..95fb5c855b 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.3.12-alpha.1", + "version": "1.3.12-alpha.2", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "1.3.12-alpha.1", + "@budibase/string-templates": "1.3.12-alpha.2", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index c596412bc7..3d7e34b8d7 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.3.12-alpha.1", + "version": "1.3.12-alpha.2", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "1.3.12-alpha.1", - "@budibase/client": "1.3.12-alpha.1", - "@budibase/frontend-core": "1.3.12-alpha.1", - "@budibase/string-templates": "1.3.12-alpha.1", + "@budibase/bbui": "1.3.12-alpha.2", + "@budibase/client": "1.3.12-alpha.2", + "@budibase/frontend-core": "1.3.12-alpha.2", + "@budibase/string-templates": "1.3.12-alpha.2", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index cef8ddfd72..3c11d7d624 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.3.12-alpha.1", + "version": "1.3.12-alpha.2", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "^1.3.12-alpha.1", - "@budibase/string-templates": "^1.3.12-alpha.1", - "@budibase/types": "^1.3.12-alpha.1", + "@budibase/backend-core": "1.3.12-alpha.2", + "@budibase/string-templates": "1.3.12-alpha.2", + "@budibase/types": "1.3.12-alpha.2", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 139ee20c9c..1df066dbdb 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.3.12-alpha.1", + "version": "1.3.12-alpha.2", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "1.3.12-alpha.1", - "@budibase/frontend-core": "1.3.12-alpha.1", - "@budibase/string-templates": "1.3.12-alpha.1", + "@budibase/bbui": "1.3.12-alpha.2", + "@budibase/frontend-core": "1.3.12-alpha.2", + "@budibase/string-templates": "1.3.12-alpha.2", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index e3a888a4e4..b686e3cea5 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.3.12-alpha.1", + "version": "1.3.12-alpha.2", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "1.3.12-alpha.1", + "@budibase/bbui": "1.3.12-alpha.2", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 127945266f..5c0b41c805 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.3.12-alpha.1", + "version": "1.3.12-alpha.2", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "1.3.12-alpha.1", - "@budibase/client": "1.3.12-alpha.1", + "@budibase/backend-core": "1.3.12-alpha.2", + "@budibase/client": "1.3.12-alpha.2", "@budibase/pro": "1.3.12-alpha.1", - "@budibase/string-templates": "1.3.12-alpha.1", - "@budibase/types": "1.3.12-alpha.1", + "@budibase/string-templates": "1.3.12-alpha.2", + "@budibase/types": "1.3.12-alpha.2", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index fa20295974..3c2e35aba6 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.3.12-alpha.1", + "version": "1.3.12-alpha.2", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 6af650da47..c5164852ed 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.3.12-alpha.1", + "version": "1.3.12-alpha.2", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index d0f391ed41..1547f24b30 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.3.12-alpha.1", + "version": "1.3.12-alpha.2", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "1.3.12-alpha.1", + "@budibase/backend-core": "1.3.12-alpha.2", "@budibase/pro": "1.3.12-alpha.1", - "@budibase/string-templates": "1.3.12-alpha.1", - "@budibase/types": "1.3.12-alpha.1", + "@budibase/string-templates": "1.3.12-alpha.2", + "@budibase/types": "1.3.12-alpha.2", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From ead9d5386df9f6e6569181966f981aa8a4540425 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 7 Sep 2022 13:30:26 +0000 Subject: [PATCH 176/260] Update pro version to 1.3.12-alpha.2 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 5c0b41c805..c72c68817d 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "1.3.12-alpha.2", "@budibase/client": "1.3.12-alpha.2", - "@budibase/pro": "1.3.12-alpha.1", + "@budibase/pro": "1.3.12-alpha.2", "@budibase/string-templates": "1.3.12-alpha.2", "@budibase/types": "1.3.12-alpha.2", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index ff811617dc..2a3db0f037 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.12-alpha.1": - version "1.3.12-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.12-alpha.1.tgz#a38f36610a4880b5f8c18192d82244a431c28a86" - integrity sha512-V1rtNBMob3BJjOGeMyvro2tqYoC85TSIO8wyJf1c4DRpPN0rW3s6MjSmVItqtZlbrcnHmxKFr4PDFDIBJaHnbg== +"@budibase/backend-core@1.3.12-alpha.2": + version "1.3.12-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.12-alpha.2.tgz#cab9edd5bde68c245c1b01e29bdd1468cfb10031" + integrity sha512-8NEGk71xnctP9xHGhC9Y5Dy3ilBE8HAW6WtWueOv7SZupa6Y5x0hdtzaJJY1/6oEqnhW/eGYXvPQpffOtfpgYg== dependencies: - "@budibase/types" "1.3.12-alpha.1" + "@budibase/types" "1.3.12-alpha.2" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1179,13 +1179,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.3.12-alpha.1": - version "1.3.12-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.12-alpha.1.tgz#5161f3c646e275fd7f9a72abf817fb407cfd6efe" - integrity sha512-lzsZeZuUGqs8eRsCB3T7yBo4yS7z7L3N2qW9Pzh7/VBwFv4NdQH56tniXCf3oFfxsQ+6xH++vklfRxddID/Dfg== +"@budibase/pro@1.3.12-alpha.2": + version "1.3.12-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.12-alpha.2.tgz#d49accc3c6258e4a258ed60046aa8756f2993895" + integrity sha512-gu/nKTKtHIhqeLrvQfB1z6sIEePWN3453TtVldPgDdl4luVcax4RhktWAw4/Bxyn/NyU80rNjcmBTlMh59Hj0A== dependencies: - "@budibase/backend-core" "1.3.12-alpha.1" - "@budibase/types" "1.3.12-alpha.1" + "@budibase/backend-core" "1.3.12-alpha.2" + "@budibase/types" "1.3.12-alpha.2" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1208,10 +1208,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.3.12-alpha.1": - version "1.3.12-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.12-alpha.1.tgz#18fda1652a757479be45fe096235af1b966ca49c" - integrity sha512-dNP+9zRKX7cYjwL+0/zdlYnMGMUWSyw3Vi+YmWNdXVcQnMXsc9gSbODBQMNv4YNqXBBC+0xgo/A5wRqWhZFL6g== +"@budibase/types@1.3.12-alpha.2": + version "1.3.12-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.12-alpha.2.tgz#e95c6d963000c5b561e8c3007df02ae8fd2a4869" + integrity sha512-pyw10xOPb78deK3aZzhpYuXMGBVrUzAb7Z5AANzDFvi4ggInY6c2GGjrzL/PfHy3DeLZkYnPDxkvaF6GNF6Txw== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 1547f24b30..85b7e4be7e 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "1.3.12-alpha.2", - "@budibase/pro": "1.3.12-alpha.1", + "@budibase/pro": "1.3.12-alpha.2", "@budibase/string-templates": "1.3.12-alpha.2", "@budibase/types": "1.3.12-alpha.2", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 431c655d1f..52ab196d8f 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.12-alpha.1": - version "1.3.12-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.12-alpha.1.tgz#a38f36610a4880b5f8c18192d82244a431c28a86" - integrity sha512-V1rtNBMob3BJjOGeMyvro2tqYoC85TSIO8wyJf1c4DRpPN0rW3s6MjSmVItqtZlbrcnHmxKFr4PDFDIBJaHnbg== +"@budibase/backend-core@1.3.12-alpha.2": + version "1.3.12-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.12-alpha.2.tgz#cab9edd5bde68c245c1b01e29bdd1468cfb10031" + integrity sha512-8NEGk71xnctP9xHGhC9Y5Dy3ilBE8HAW6WtWueOv7SZupa6Y5x0hdtzaJJY1/6oEqnhW/eGYXvPQpffOtfpgYg== dependencies: - "@budibase/types" "1.3.12-alpha.1" + "@budibase/types" "1.3.12-alpha.2" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -326,21 +326,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.3.12-alpha.1": - version "1.3.12-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.12-alpha.1.tgz#5161f3c646e275fd7f9a72abf817fb407cfd6efe" - integrity sha512-lzsZeZuUGqs8eRsCB3T7yBo4yS7z7L3N2qW9Pzh7/VBwFv4NdQH56tniXCf3oFfxsQ+6xH++vklfRxddID/Dfg== +"@budibase/pro@1.3.12-alpha.2": + version "1.3.12-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.12-alpha.2.tgz#d49accc3c6258e4a258ed60046aa8756f2993895" + integrity sha512-gu/nKTKtHIhqeLrvQfB1z6sIEePWN3453TtVldPgDdl4luVcax4RhktWAw4/Bxyn/NyU80rNjcmBTlMh59Hj0A== dependencies: - "@budibase/backend-core" "1.3.12-alpha.1" - "@budibase/types" "1.3.12-alpha.1" + "@budibase/backend-core" "1.3.12-alpha.2" + "@budibase/types" "1.3.12-alpha.2" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.3.12-alpha.1": - version "1.3.12-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.12-alpha.1.tgz#18fda1652a757479be45fe096235af1b966ca49c" - integrity sha512-dNP+9zRKX7cYjwL+0/zdlYnMGMUWSyw3Vi+YmWNdXVcQnMXsc9gSbODBQMNv4YNqXBBC+0xgo/A5wRqWhZFL6g== +"@budibase/types@1.3.12-alpha.2": + version "1.3.12-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.12-alpha.2.tgz#e95c6d963000c5b561e8c3007df02ae8fd2a4869" + integrity sha512-pyw10xOPb78deK3aZzhpYuXMGBVrUzAb7Z5AANzDFvi4ggInY6c2GGjrzL/PfHy3DeLZkYnPDxkvaF6GNF6Txw== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From dafb038cef5f3459c165f39063a029df9c17284a Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Wed, 7 Sep 2022 15:42:45 +0100 Subject: [PATCH 177/260] Oracle + datasource Wizard Test skips Skipping tests for Oracle & datasourceWizard Both are covered during general regressions There are timing issues associated with the CI Smoke run This will help reduce the smoke build run time The oracle test file was only covering a basic check of invalid configuration (Not essential for the smoke run) --- .../cypress/integration/datasources/datasourceWizard.spec.js | 2 +- packages/builder/cypress/integration/datasources/oracle.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/builder/cypress/integration/datasources/datasourceWizard.spec.js b/packages/builder/cypress/integration/datasources/datasourceWizard.spec.js index 14653d8286..837a433951 100644 --- a/packages/builder/cypress/integration/datasources/datasourceWizard.spec.js +++ b/packages/builder/cypress/integration/datasources/datasourceWizard.spec.js @@ -1,7 +1,7 @@ import filterTests from "../../support/filterTests" filterTests(['all'], () => { - context("Datasource Wizard", () => { + xcontext("Datasource Wizard", () => { if (Cypress.env("TEST_ENV")) { before(() => { cy.login() diff --git a/packages/builder/cypress/integration/datasources/oracle.spec.js b/packages/builder/cypress/integration/datasources/oracle.spec.js index 92a5737ff9..5d92d6b217 100644 --- a/packages/builder/cypress/integration/datasources/oracle.spec.js +++ b/packages/builder/cypress/integration/datasources/oracle.spec.js @@ -1,7 +1,7 @@ import filterTests from "../../support/filterTests" filterTests(["all"], () => { - context("Oracle Datasource Testing", () => { + xcontext("Oracle Datasource Testing", () => { if (Cypress.env("TEST_ENV")) { before(() => { cy.login() From 0ebe0b827575e97694b56ecf258c8dc1c8255367 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 7 Sep 2022 16:08:29 +0100 Subject: [PATCH 178/260] remove verify and fix deletion bug --- packages/bbui/src/Modal/ModalContent.svelte | 3 +- .../plugins/_components/AddPluginModal.svelte | 49 ++-------------- .../_components/DeletePluginModal.svelte | 5 +- .../plugins/_components/PluginRow.svelte | 58 +------------------ packages/builder/src/stores/portal/plugins.js | 3 +- packages/server/src/api/controllers/plugin.ts | 20 ++----- 6 files changed, 15 insertions(+), 123 deletions(-) diff --git a/packages/bbui/src/Modal/ModalContent.svelte b/packages/bbui/src/Modal/ModalContent.svelte index d946268da6..25fac63ec8 100644 --- a/packages/bbui/src/Modal/ModalContent.svelte +++ b/packages/bbui/src/Modal/ModalContent.svelte @@ -24,7 +24,6 @@ export let secondaryAction = undefined export let secondaryButtonWarning = false export let dataCy = null - export let buttonCta = true const { hide, cancel } = getContext(Context.Modal) let loading = false $: confirmDisabled = disabled || loading @@ -113,7 +112,7 @@
{/if} {/each} - -
-
- -
-
- {#if verificationSuccessful} - Verification Successful - {:else} - Verify your source - {/if} -
-
diff --git a/packages/builder/src/stores/portal/plugins.js b/packages/builder/src/stores/portal/plugins.js index 9703b30cb7..28f9bfc42d 100644 --- a/packages/builder/src/stores/portal/plugins.js +++ b/packages/builder/src/stores/portal/plugins.js @@ -50,11 +50,10 @@ export function createPluginsStore() { }) } - async function uploadPlugin(file, source, updatePlugin) { + async function uploadPlugin(file, source) { let data = new FormData() data.append("file", file) data.append("source", source) - data.append("update", updatePlugin) let resp = await API.uploadPlugin(data) let newPlugin = resp.plugins[0] update(state => { diff --git a/packages/server/src/api/controllers/plugin.ts b/packages/server/src/api/controllers/plugin.ts index a84a077b33..cb4d592812 100644 --- a/packages/server/src/api/controllers/plugin.ts +++ b/packages/server/src/api/controllers/plugin.ts @@ -39,11 +39,7 @@ export async function upload(ctx: any) { let docs = [] // can do single or multiple plugins for (let plugin of plugins) { - const doc = await processPlugin( - plugin, - ctx.request.body.source, - ctx.request.body.update - ) + const doc = await processPlugin(plugin, ctx.request.body.source) docs.push(doc) } ctx.body = { @@ -132,8 +128,7 @@ export async function destroy(ctx: any) { export async function storePlugin( metadata: any, directory: any, - source?: string, - update?: boolean + source?: string ) { const db = getGlobalDB() const version = metadata.package.version, @@ -172,9 +167,6 @@ export async function storePlugin( const existing = await db.get(pluginId) rev = existing._rev } catch (err) { - if (update) { - throw new Error("Unable to update. Plugin does not exist") - } rev = undefined } let doc = { @@ -201,15 +193,11 @@ export async function storePlugin( } } -export async function processPlugin( - plugin: FileType, - source?: string, - update?: boolean -) { +export async function processPlugin(plugin: FileType, source?: string) { if (!env.SELF_HOSTED) { throw new Error("Plugins not supported outside of self-host.") } const { metadata, directory } = await uploadedFilePlugin(plugin) - return await storePlugin(metadata, directory, source, update) + return await storePlugin(metadata, directory, source) } From 931bca92f358ca0d0646c03ada25b0aae771b5e8 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 7 Sep 2022 15:10:29 +0000 Subject: [PATCH 179/260] v1.3.12-alpha.3 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lerna.json b/lerna.json index a74e653725..bee30cbc57 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.12-alpha.2", + "version": "1.3.12-alpha.3", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 5f3414bab9..3f5cb33241 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.3.12-alpha.2", + "version": "1.3.12-alpha.3", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "1.3.12-alpha.2", + "@budibase/types": "1.3.12-alpha.3", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 95fb5c855b..c9e35848f3 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.3.12-alpha.2", + "version": "1.3.12-alpha.3", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "1.3.12-alpha.2", + "@budibase/string-templates": "1.3.12-alpha.3", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 3d7e34b8d7..fb5a3d2244 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.3.12-alpha.2", + "version": "1.3.12-alpha.3", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "1.3.12-alpha.2", - "@budibase/client": "1.3.12-alpha.2", - "@budibase/frontend-core": "1.3.12-alpha.2", - "@budibase/string-templates": "1.3.12-alpha.2", + "@budibase/bbui": "1.3.12-alpha.3", + "@budibase/client": "1.3.12-alpha.3", + "@budibase/frontend-core": "1.3.12-alpha.3", + "@budibase/string-templates": "1.3.12-alpha.3", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 3c11d7d624..497933ea76 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.3.12-alpha.2", + "version": "1.3.12-alpha.3", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "1.3.12-alpha.2", - "@budibase/string-templates": "1.3.12-alpha.2", - "@budibase/types": "1.3.12-alpha.2", + "@budibase/backend-core": "1.3.12-alpha.3", + "@budibase/string-templates": "1.3.12-alpha.3", + "@budibase/types": "1.3.12-alpha.3", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 1df066dbdb..9166a8ead2 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.3.12-alpha.2", + "version": "1.3.12-alpha.3", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "1.3.12-alpha.2", - "@budibase/frontend-core": "1.3.12-alpha.2", - "@budibase/string-templates": "1.3.12-alpha.2", + "@budibase/bbui": "1.3.12-alpha.3", + "@budibase/frontend-core": "1.3.12-alpha.3", + "@budibase/string-templates": "1.3.12-alpha.3", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index b686e3cea5..823a6a7458 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.3.12-alpha.2", + "version": "1.3.12-alpha.3", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "1.3.12-alpha.2", + "@budibase/bbui": "1.3.12-alpha.3", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index c72c68817d..8524eebe27 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.3.12-alpha.2", + "version": "1.3.12-alpha.3", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "1.3.12-alpha.2", - "@budibase/client": "1.3.12-alpha.2", + "@budibase/backend-core": "1.3.12-alpha.3", + "@budibase/client": "1.3.12-alpha.3", "@budibase/pro": "1.3.12-alpha.2", - "@budibase/string-templates": "1.3.12-alpha.2", - "@budibase/types": "1.3.12-alpha.2", + "@budibase/string-templates": "1.3.12-alpha.3", + "@budibase/types": "1.3.12-alpha.3", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 3c2e35aba6..da6ace54e7 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.3.12-alpha.2", + "version": "1.3.12-alpha.3", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index c5164852ed..84f7431d7d 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.3.12-alpha.2", + "version": "1.3.12-alpha.3", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 85b7e4be7e..e5a5968084 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.3.12-alpha.2", + "version": "1.3.12-alpha.3", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "1.3.12-alpha.2", + "@budibase/backend-core": "1.3.12-alpha.3", "@budibase/pro": "1.3.12-alpha.2", - "@budibase/string-templates": "1.3.12-alpha.2", - "@budibase/types": "1.3.12-alpha.2", + "@budibase/string-templates": "1.3.12-alpha.3", + "@budibase/types": "1.3.12-alpha.3", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From cc028affdb0eeb7d5cb5f5dc4141776fea35a960 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 7 Sep 2022 15:13:50 +0000 Subject: [PATCH 180/260] Update pro version to 1.3.12-alpha.3 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 8524eebe27..896d920045 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "1.3.12-alpha.3", "@budibase/client": "1.3.12-alpha.3", - "@budibase/pro": "1.3.12-alpha.2", + "@budibase/pro": "1.3.12-alpha.3", "@budibase/string-templates": "1.3.12-alpha.3", "@budibase/types": "1.3.12-alpha.3", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 2a3db0f037..d89a21f0d3 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.12-alpha.2": - version "1.3.12-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.12-alpha.2.tgz#cab9edd5bde68c245c1b01e29bdd1468cfb10031" - integrity sha512-8NEGk71xnctP9xHGhC9Y5Dy3ilBE8HAW6WtWueOv7SZupa6Y5x0hdtzaJJY1/6oEqnhW/eGYXvPQpffOtfpgYg== +"@budibase/backend-core@1.3.12-alpha.3": + version "1.3.12-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.12-alpha.3.tgz#baf7ea0590db9e49db08e4e05b7d374a2ed05f20" + integrity sha512-8xkaJX2kA2n7LKNXJ9SSyQnvOYRPDxiZ6BKDEPNoOa0WjYZ/htCnUJxgjdnSSzSojqfdDf8eqxa+pGXA87ZU6Q== dependencies: - "@budibase/types" "1.3.12-alpha.2" + "@budibase/types" "1.3.12-alpha.3" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1179,13 +1179,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.3.12-alpha.2": - version "1.3.12-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.12-alpha.2.tgz#d49accc3c6258e4a258ed60046aa8756f2993895" - integrity sha512-gu/nKTKtHIhqeLrvQfB1z6sIEePWN3453TtVldPgDdl4luVcax4RhktWAw4/Bxyn/NyU80rNjcmBTlMh59Hj0A== +"@budibase/pro@1.3.12-alpha.3": + version "1.3.12-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.12-alpha.3.tgz#30dce4ba54aa7c19b60d6faf2852e3402c81ee50" + integrity sha512-qDddYE6XNbiNIpADUIhXWvgBjJMNxWhHdCpS7Qoci2tmoS4ofLlh5C8qKJuddg3RaLkWIQmII/p/ZnZ0uQ3E9A== dependencies: - "@budibase/backend-core" "1.3.12-alpha.2" - "@budibase/types" "1.3.12-alpha.2" + "@budibase/backend-core" "1.3.12-alpha.3" + "@budibase/types" "1.3.12-alpha.3" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1208,10 +1208,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.3.12-alpha.2": - version "1.3.12-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.12-alpha.2.tgz#e95c6d963000c5b561e8c3007df02ae8fd2a4869" - integrity sha512-pyw10xOPb78deK3aZzhpYuXMGBVrUzAb7Z5AANzDFvi4ggInY6c2GGjrzL/PfHy3DeLZkYnPDxkvaF6GNF6Txw== +"@budibase/types@1.3.12-alpha.3": + version "1.3.12-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.12-alpha.3.tgz#26c5f168281f5ead4a108af2918ce9810d92d239" + integrity sha512-dvs+KWlu+DdaVKAA6vU2qTZJmS4ACIllBSSjDeG0sGOBkIlGJSi5aC6zvkPXpaaZlbDQpDwao/9xNP+Ub8wj1g== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index e5a5968084..79754d4ee0 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "1.3.12-alpha.3", - "@budibase/pro": "1.3.12-alpha.2", + "@budibase/pro": "1.3.12-alpha.3", "@budibase/string-templates": "1.3.12-alpha.3", "@budibase/types": "1.3.12-alpha.3", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 52ab196d8f..02d5bc0e3a 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.12-alpha.2": - version "1.3.12-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.12-alpha.2.tgz#cab9edd5bde68c245c1b01e29bdd1468cfb10031" - integrity sha512-8NEGk71xnctP9xHGhC9Y5Dy3ilBE8HAW6WtWueOv7SZupa6Y5x0hdtzaJJY1/6oEqnhW/eGYXvPQpffOtfpgYg== +"@budibase/backend-core@1.3.12-alpha.3": + version "1.3.12-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.12-alpha.3.tgz#baf7ea0590db9e49db08e4e05b7d374a2ed05f20" + integrity sha512-8xkaJX2kA2n7LKNXJ9SSyQnvOYRPDxiZ6BKDEPNoOa0WjYZ/htCnUJxgjdnSSzSojqfdDf8eqxa+pGXA87ZU6Q== dependencies: - "@budibase/types" "1.3.12-alpha.2" + "@budibase/types" "1.3.12-alpha.3" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -326,21 +326,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.3.12-alpha.2": - version "1.3.12-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.12-alpha.2.tgz#d49accc3c6258e4a258ed60046aa8756f2993895" - integrity sha512-gu/nKTKtHIhqeLrvQfB1z6sIEePWN3453TtVldPgDdl4luVcax4RhktWAw4/Bxyn/NyU80rNjcmBTlMh59Hj0A== +"@budibase/pro@1.3.12-alpha.3": + version "1.3.12-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.12-alpha.3.tgz#30dce4ba54aa7c19b60d6faf2852e3402c81ee50" + integrity sha512-qDddYE6XNbiNIpADUIhXWvgBjJMNxWhHdCpS7Qoci2tmoS4ofLlh5C8qKJuddg3RaLkWIQmII/p/ZnZ0uQ3E9A== dependencies: - "@budibase/backend-core" "1.3.12-alpha.2" - "@budibase/types" "1.3.12-alpha.2" + "@budibase/backend-core" "1.3.12-alpha.3" + "@budibase/types" "1.3.12-alpha.3" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.3.12-alpha.2": - version "1.3.12-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.12-alpha.2.tgz#e95c6d963000c5b561e8c3007df02ae8fd2a4869" - integrity sha512-pyw10xOPb78deK3aZzhpYuXMGBVrUzAb7Z5AANzDFvi4ggInY6c2GGjrzL/PfHy3DeLZkYnPDxkvaF6GNF6Txw== +"@budibase/types@1.3.12-alpha.3": + version "1.3.12-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.12-alpha.3.tgz#26c5f168281f5ead4a108af2918ce9810d92d239" + integrity sha512-dvs+KWlu+DdaVKAA6vU2qTZJmS4ACIllBSSjDeG0sGOBkIlGJSi5aC6zvkPXpaaZlbDQpDwao/9xNP+Ub8wj1g== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 86c8618e8f220ee65f80dc6ea05d1082355e92f3 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 7 Sep 2022 17:05:17 +0100 Subject: [PATCH 181/260] Fix for #7431 - reboot didn't work at all previously which is why apps couldn't be published with it enabled, this is now a self host only feature, I've removed the ability to enable a reboot cron in the Cloud and it will not run the lookup/execution. --- packages/backend-core/src/db/utils.ts | 11 +++- .../automation/SetupPanel/CronBuilder.svelte | 16 ++++-- .../src/api/controllers/deploy/index.ts | 2 +- packages/server/src/automations/index.js | 9 ++-- packages/server/src/automations/triggers.js | 54 +++++++++++++++---- packages/server/src/automations/utils.ts | 30 +++++++---- packages/server/src/threads/automation.ts | 6 +++ .../types/src/documents/app/automation.ts | 4 ++ 8 files changed, 103 insertions(+), 29 deletions(-) diff --git a/packages/backend-core/src/db/utils.ts b/packages/backend-core/src/db/utils.ts index 321ebd7f58..4926a60150 100644 --- a/packages/backend-core/src/db/utils.ts +++ b/packages/backend-core/src/db/utils.ts @@ -254,7 +254,16 @@ export async function getAllApps({ dev, all, idsOnly, efficient }: any = {}) { return false }) if (idsOnly) { - return appDbNames + const devAppIds = appDbNames.filter(appId => isDevAppID(appId)) + const prodAppIds = appDbNames.filter(appId => !isDevAppID(appId)) + switch (dev) { + case true: + return devAppIds + case false: + return prodAppIds + default: + return appDbNames + } } const appPromises = appDbNames.map((app: any) => // skip setup otherwise databases could be re-created diff --git a/packages/builder/src/components/automation/SetupPanel/CronBuilder.svelte b/packages/builder/src/components/automation/SetupPanel/CronBuilder.svelte index 93b8394b49..f2da863424 100644 --- a/packages/builder/src/components/automation/SetupPanel/CronBuilder.svelte +++ b/packages/builder/src/components/automation/SetupPanel/CronBuilder.svelte @@ -1,6 +1,7 @@
diff --git a/packages/server/src/api/controllers/deploy/index.ts b/packages/server/src/api/controllers/deploy/index.ts index 86718294de..2ac6c8a15c 100644 --- a/packages/server/src/api/controllers/deploy/index.ts +++ b/packages/server/src/api/controllers/deploy/index.ts @@ -125,7 +125,7 @@ async function deployApp(deployment: any) { const prodAppDoc = await db.get(DocumentType.APP_METADATA) appDoc._rev = prodAppDoc._rev } catch (err) { - // ignore the error - doesn't exist + delete appDoc._rev } // switch to production app ID diff --git a/packages/server/src/automations/index.js b/packages/server/src/automations/index.js index 9c23e35d1c..2baa868890 100644 --- a/packages/server/src/automations/index.js +++ b/packages/server/src/automations/index.js @@ -1,16 +1,19 @@ const { processEvent } = require("./utils") const { queue, shutdown } = require("./bullboard") -const { TRIGGER_DEFINITIONS } = require("./triggers") +const { TRIGGER_DEFINITIONS, rebootTrigger } = require("./triggers") const { ACTION_DEFINITIONS } = require("./actions") /** * This module is built purely to kick off the worker farm and manage the inputs/outputs */ -exports.init = function () { +exports.init = async function () { // this promise will not complete - return queue.process(async job => { + const promise = queue.process(async job => { await processEvent(job) }) + // on init we need to trigger any reboot automations + await rebootTrigger() + return promise } exports.getQueues = () => { diff --git a/packages/server/src/automations/triggers.js b/packages/server/src/automations/triggers.js index 216f24be02..395390113a 100644 --- a/packages/server/src/automations/triggers.js +++ b/packages/server/src/automations/triggers.js @@ -9,6 +9,7 @@ const { checkTestFlag } = require("../utilities/redis") const utils = require("./utils") const env = require("../environment") const { doInAppContext, getAppDB } = require("@budibase/backend-core/context") +const { getAllApps } = require("@budibase/backend-core/db") const TRIGGER_DEFINITIONS = definitions const JOB_OPTS = { @@ -16,24 +17,27 @@ const JOB_OPTS = { removeOnFail: true, } +async function getAllAutomations() { + const db = getAppDB() + let automations = await db.allDocs( + getAutomationParams(null, { include_docs: true }) + ) + return automations.rows.map(row => row.doc) +} + async function queueRelevantRowAutomations(event, eventType) { if (event.appId == null) { throw `No appId specified for ${eventType} - check event emitters.` } doInAppContext(event.appId, async () => { - const db = getAppDB() - let automations = await db.allDocs( - getAutomationParams(null, { include_docs: true }) - ) + let automations = await getAllAutomations() // filter down to the correct event type - automations = automations.rows - .map(automation => automation.doc) - .filter(automation => { - const trigger = automation.definition.trigger - return trigger && trigger.event === eventType - }) + automations = automations.filter(automation => { + const trigger = automation.definition.trigger + return trigger && trigger.event === eventType + }) for (let automation of automations) { let automationDef = automation.definition @@ -110,4 +114,34 @@ exports.externalTrigger = async function ( } } +exports.rebootTrigger = async () => { + // reboot cron option is only available on the main thread at + // startup and only usable in self host + if (env.isInThread() || !env.SELF_HOSTED) { + return + } + // iterate through all production apps, find the reboot crons + // and trigger events for them + const appIds = await getAllApps({ dev: false, idsOnly: true }) + for (let prodAppId of appIds) { + await doInAppContext(prodAppId, async () => { + let automations = await getAllAutomations() + let rebootEvents = [] + for (let automation of automations) { + if (utils.isRebootTrigger(automation)) { + const job = { + automation, + event: { + appId: prodAppId, + timestamp: Date.now(), + }, + } + rebootEvents.push(queue.add(job, JOB_OPTS)) + } + } + await Promise.all(rebootEvents) + }) + } +} + exports.TRIGGER_DEFINITIONS = TRIGGER_DEFINITIONS diff --git a/packages/server/src/automations/utils.ts b/packages/server/src/automations/utils.ts index e0979ac0d9..3093f147dc 100644 --- a/packages/server/src/automations/utils.ts +++ b/packages/server/src/automations/utils.ts @@ -17,6 +17,7 @@ import { tenancy } from "@budibase/backend-core" import { quotas } from "@budibase/pro" import { Automation } from "@budibase/types" +const REBOOT_CRON = "@reboot" const WH_STEP_ID = definitions.WEBHOOK.stepId const CRON_STEP_ID = definitions.CRON.stepId const Runner = new Thread(ThreadType.AUTOMATION) @@ -109,22 +110,33 @@ export async function clearMetadata() { await db.bulkDocs(automationMetadata) } +export function isCronTrigger(auto: Automation) { + return ( + auto && + auto.definition.trigger && + auto.definition.trigger.stepId === CRON_STEP_ID + ) +} + +export function isRebootTrigger(auto: Automation) { + const trigger = auto ? auto.definition.trigger : null + return isCronTrigger(auto) && trigger?.inputs.cron === REBOOT_CRON +} + /** * This function handles checking of any cron jobs that need to be enabled/updated. * @param {string} appId The ID of the app in which we are checking for webhooks * @param {object|undefined} automation The automation object to be updated. */ -export async function enableCronTrigger(appId: any, automation: any) { +export async function enableCronTrigger(appId: any, automation: Automation) { const trigger = automation ? automation.definition.trigger : null - function isCronTrigger(auto: any) { - return ( - auto && - auto.definition.trigger && - auto.definition.trigger.stepId === CRON_STEP_ID - ) - } + // need to create cron job - if (isCronTrigger(automation) && trigger?.inputs.cron) { + if ( + isCronTrigger(automation) && + !isRebootTrigger(automation) && + trigger?.inputs.cron + ) { // make a job id rather than letting Bull decide, makes it easier to handle on way out const jobId = `${appId}_cron_${newid()}` const job: any = await queue.add( diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts index 3136155869..f64552a92f 100644 --- a/packages/server/src/threads/automation.ts +++ b/packages/server/src/threads/automation.ts @@ -458,6 +458,9 @@ class Orchestrator { export function execute(input: AutomationEvent, callback: WorkerCallback) { const appId = input.data.event.appId + if (!appId) { + throw new Error("Unable to execute, event doesn't contain app ID.") + } doInAppContext(appId, async () => { const automationOrchestrator = new Orchestrator( input.data.automation, @@ -475,6 +478,9 @@ export function execute(input: AutomationEvent, callback: WorkerCallback) { export const removeStalled = async (input: AutomationEvent) => { const appId = input.data.event.appId + if (!appId) { + throw new Error("Unable to execute, event doesn't contain app ID.") + } await doInAppContext(appId, async () => { const automationOrchestrator = new Orchestrator( input.data.automation, diff --git a/packages/types/src/documents/app/automation.ts b/packages/types/src/documents/app/automation.ts index 50562461e4..a038e73d11 100644 --- a/packages/types/src/documents/app/automation.ts +++ b/packages/types/src/documents/app/automation.ts @@ -25,6 +25,10 @@ export interface AutomationStep { export interface AutomationTrigger { id: string stepId: string + inputs: { + [key: string]: any + } + cronJobId?: string } export enum AutomationStatus { From 2fb96b29c9cba715298c986b79d91efa93f580f4 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 7 Sep 2022 17:31:15 +0100 Subject: [PATCH 182/260] Encoding query string URI parameters for REST requests - #7683. --- packages/builder/src/helpers/data/utils.js | 2 +- packages/server/src/integrations/rest.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/helpers/data/utils.js b/packages/builder/src/helpers/data/utils.js index 647c2be33e..cd6a8cf481 100644 --- a/packages/builder/src/helpers/data/utils.js +++ b/packages/builder/src/helpers/data/utils.js @@ -46,7 +46,7 @@ export function buildQueryString(obj) { if (str !== "") { str += "&" } - str += `${key}=${value || ""}` + str += `${key}=${encodeURIComponent(value || "")}` } } return str diff --git a/packages/server/src/integrations/rest.ts b/packages/server/src/integrations/rest.ts index 284d2a921a..59eb1e9941 100644 --- a/packages/server/src/integrations/rest.ts +++ b/packages/server/src/integrations/rest.ts @@ -215,7 +215,7 @@ module RestModule { } } - const main = `${path}?${queryString}` + const main = `${path}?${encodeURIComponent(queryString)}` let complete = main if (this.config.url && !main.startsWith("http")) { complete = !this.config.url ? main : `${this.config.url}/${main}` From 61fdabc382a7155b5ced03fc025a4e81478a6f08 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 7 Sep 2022 17:45:14 +0100 Subject: [PATCH 183/260] Adding onTop attribute to tabs which allows setting the z-index for the container - #7679. --- packages/bbui/src/Tabs/Tabs.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/bbui/src/Tabs/Tabs.svelte b/packages/bbui/src/Tabs/Tabs.svelte index 74edc9cd02..7184aedbaf 100644 --- a/packages/bbui/src/Tabs/Tabs.svelte +++ b/packages/bbui/src/Tabs/Tabs.svelte @@ -10,6 +10,7 @@ export let noHorizPadding = false export let quiet = false export let emphasized = false + export let onTop = false export let size = "M" let thisSelected = undefined @@ -75,6 +76,7 @@ bind:this={container} class:spectrum-Tabs--quiet={quiet} class:noHorizPadding + class:onTop class:spectrum-Tabs--vertical={vertical} class:spectrum-Tabs--horizontal={!vertical} class="spectrum-Tabs spectrum-Tabs--size{size}" @@ -122,4 +124,7 @@ .noPadding { margin: 0; } + .onTop { + z-index: 100; + } From ac0443a876cf0c36e3bde3f83edaf8412a49c0a7 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 7 Sep 2022 17:49:29 +0100 Subject: [PATCH 184/260] fix build --- .../portal/manage/plugins/_components/AddPluginModal.svelte | 6 +++--- packages/server/src/api/controllers/plugin/utils.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte b/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte index f45eea9dc9..3520c18991 100644 --- a/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte +++ b/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte @@ -3,14 +3,14 @@ import { plugins } from "stores/portal" let authOptions = { + URL: ["Headers", "URL"], NPM: ["URL"], Github: ["Github Token", "URL"], - URL: ["Headers", "URL"], "File Upload": ["File Upload"], } let file - let sourceValue = "NPM" - let typeValue = "Datasource" + let sourceValue = "URL" + let typeValue = "Component" let dynamicValues = {} let validation diff --git a/packages/server/src/api/controllers/plugin/utils.js b/packages/server/src/api/controllers/plugin/utils.js index 86f8754a7a..df76ebc121 100644 --- a/packages/server/src/api/controllers/plugin/utils.js +++ b/packages/server/src/api/controllers/plugin/utils.js @@ -1,4 +1,3 @@ -import fetch from "node-fetch" import { createTempFolder, getPluginMetadata, @@ -8,6 +7,7 @@ import { deleteFolderFileSystem, } from "../../../utilities/fileSystem" import { join } from "path" +const fetch = require("node-fetch") export const uploadedFilePlugin = async file => { if (!file.name.endsWith(".tar.gz")) { From 8e56a7a4d9d356ec27bd95a0cf1d87d163425028 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 7 Sep 2022 17:57:02 +0100 Subject: [PATCH 185/260] Fixing an issue with external tables containing time only fields. --- packages/server/src/utilities/rowProcessor/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/utilities/rowProcessor/utils.js b/packages/server/src/utilities/rowProcessor/utils.js index c80dae497c..d659cb6822 100644 --- a/packages/server/src/utilities/rowProcessor/utils.js +++ b/packages/server/src/utilities/rowProcessor/utils.js @@ -76,7 +76,7 @@ exports.processDates = (table, rows) => { if (schema.type !== FieldTypes.DATETIME) { continue } - if (!schema.ignoreTimezones) { + if (!schema.timeOnly && !schema.ignoreTimezones) { datesWithTZ.push(column) } } From 3ef877f886a6a1d9b557559a1032cf2f4ddacb19 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 7 Sep 2022 18:11:17 +0100 Subject: [PATCH 186/260] fix build again --- packages/server/src/api/controllers/plugin/utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/controllers/plugin/utils.js b/packages/server/src/api/controllers/plugin/utils.js index df76ebc121..e15a72789e 100644 --- a/packages/server/src/api/controllers/plugin/utils.js +++ b/packages/server/src/api/controllers/plugin/utils.js @@ -1,12 +1,12 @@ -import { +const { createTempFolder, getPluginMetadata, findFileRec, downloadTarballDirect, extractTarball, deleteFolderFileSystem, -} from "../../../utilities/fileSystem" -import { join } from "path" +} = require("../../../utilities/fileSystem") +const join = require("path") const fetch = require("node-fetch") export const uploadedFilePlugin = async file => { From 7c9d0594f8e37c1cbd102ccf86ae8c0abd9c3faf Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 7 Sep 2022 18:30:17 +0100 Subject: [PATCH 187/260] Fixing #6980 - fixing choice of relational foreign key field name when working with fields named differently to the primary key. --- packages/server/src/api/controllers/row/ExternalRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/row/ExternalRequest.ts b/packages/server/src/api/controllers/row/ExternalRequest.ts index a1aecdb0f2..dd5778b9d9 100644 --- a/packages/server/src/api/controllers/row/ExternalRequest.ts +++ b/packages/server/src/api/controllers/row/ExternalRequest.ts @@ -534,7 +534,7 @@ module External { }) // this is the response from knex if no rows found const rows = !response[0].read ? response : [] - const storeTo = isMany ? field.throughFrom || linkPrimaryKey : manyKey + const storeTo = isMany ? field.throughFrom || linkPrimaryKey : fieldName related[storeTo] = { rows, isMany, tableId } } return related From 932f119fce48fd193198520aa5c9dbc7e220b6b9 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 7 Sep 2022 19:15:05 +0100 Subject: [PATCH 188/260] Updating params in the REST interface so that they can be used in and out of the URL - meaning that updating in one place affects the other. Reduces a bit of the confusing UX around this - discussed in #7683. --- .../bindings/DrawerBindableInput.svelte | 10 ++- .../integration/KeyValueBuilder.svelte | 9 ++- .../rest/[query]/index.svelte | 66 +++++++++++++------ 3 files changed, 62 insertions(+), 23 deletions(-) diff --git a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte index b8d418c62b..22d322985d 100644 --- a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte +++ b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte @@ -23,6 +23,7 @@ const dispatch = createEventDispatcher() let bindingDrawer let valid = true + let currentVal = value $: readableValue = runtimeToReadableBinding(bindings, value) $: tempValue = readableValue @@ -30,11 +31,17 @@ const saveBinding = () => { onChange(tempValue) + onBlur() bindingDrawer.hide() } const onChange = value => { - dispatch("change", readableToRuntimeBinding(bindings, value)) + currentVal = readableToRuntimeBinding(bindings, value) + dispatch("change", currentVal) + } + + const onBlur = () => { + dispatch("blur", currentVal) } @@ -45,6 +52,7 @@ readonly={isJS} value={isJS ? "(JavaScript function)" : readableValue} on:change={event => onChange(event.detail)} + on:blur={onBlur} {placeholder} {updateOnChange} /> diff --git a/packages/builder/src/components/integration/KeyValueBuilder.svelte b/packages/builder/src/components/integration/KeyValueBuilder.svelte index 4ffb380aa4..28db6b61c6 100644 --- a/packages/builder/src/components/integration/KeyValueBuilder.svelte +++ b/packages/builder/src/components/integration/KeyValueBuilder.svelte @@ -107,7 +107,7 @@ placeholder={keyPlaceholder} readonly={readOnly} bind:value={field.name} - on:change={changed} + on:blur={changed} /> {#if options} +
@@ -123,8 +115,8 @@ Platform Here you can set up general platform settings. -
-
+
+
- + {infoMessage(source)} {#each authOptions[source] as option} - {#if option === "File Upload"} + {#if option.name === PluginSource.FILE}
- + {:else}
- - +
+ + {#if option.optional} + + {/if} +
+ {#if option.name === "Headers"} + + {:else} + + {/if}
{/if} {/each} diff --git a/packages/builder/src/stores/portal/plugins.js b/packages/builder/src/stores/portal/plugins.js index bfdec9ae6b..8997e8f49d 100644 --- a/packages/builder/src/stores/portal/plugins.js +++ b/packages/builder/src/stores/portal/plugins.js @@ -1,5 +1,6 @@ import { writable } from "svelte/store" import { API } from "api" +import { PluginSource } from "constants" export function createPluginsStore() { const { subscribe, set, update } = writable([]) @@ -24,13 +25,10 @@ export function createPluginsStore() { } switch (source) { - case "url": + case PluginSource.URL: pluginData.headers = auth break - case "npm": - pluginData.npmToken = auth - break - case "github": + case PluginSource.GITHUB: pluginData.githubToken = auth break } diff --git a/packages/server/src/api/controllers/plugin/file.ts b/packages/server/src/api/controllers/plugin/file.ts new file mode 100644 index 0000000000..3b21f08387 --- /dev/null +++ b/packages/server/src/api/controllers/plugin/file.ts @@ -0,0 +1,15 @@ +import { + createTempFolder, + getPluginMetadata, + extractTarball, +} from "../../../utilities/fileSystem" + +export async function fileUpload(file: { name: string; path: string }) { + if (!file.name.endsWith(".tar.gz")) { + throw new Error("Plugin must be compressed into a gzipped tarball.") + } + const path = createTempFolder(file.name.split(".tar.gz")[0]) + await extractTarball(file.path, path) + + return await getPluginMetadata(path) +} diff --git a/packages/server/src/api/controllers/plugin/github.ts b/packages/server/src/api/controllers/plugin/github.ts new file mode 100644 index 0000000000..cbd16f2386 --- /dev/null +++ b/packages/server/src/api/controllers/plugin/github.ts @@ -0,0 +1,75 @@ +import { getPluginMetadata } from "../../../utilities/fileSystem" +import fetch from "node-fetch" +import { downloadUnzipTarball } from "./utils" + +export async function request( + url: string, + headers: { [key: string]: string }, + err: string +) { + const response = await fetch(url, { headers }) + if (response.status >= 300) { + const respErr = await response.text() + throw new Error(`Error: ${err} - ${respErr}`) + } + return response.json() +} + +export async function githubUpload(url: string, name = "", token = "") { + let githubUrl = url + + if (!githubUrl.includes("https://github.com/")) { + throw new Error("The plugin origin must be from Github") + } + + if (url.includes(".git")) { + githubUrl = url.replace(".git", "") + } + + const githubApiUrl = githubUrl.replace( + "https://github.com/", + "https://api.github.com/repos/" + ) + const headers: any = token ? { Authorization: `Bearer ${token}` } : {} + const pluginDetails = await request( + githubApiUrl, + headers, + "Repository not found" + ) + const pluginName = pluginDetails.name || name + const pluginLatestReleaseUrl = pluginDetails?.["releases_url"] + ? pluginDetails?.["releases_url"].replace("{/id}", "/latest") + : undefined + if (!pluginLatestReleaseUrl) { + throw new Error("Github release not found") + } + + const pluginReleaseDetails = await request( + pluginLatestReleaseUrl, + headers, + "Github latest release not found" + ) + const pluginReleaseTarballAsset = pluginReleaseDetails?.assets?.find( + (x: any) => x?.["content_type"] === "application/gzip" + ) + const pluginLastReleaseTarballUrl = + pluginReleaseTarballAsset?.["browser_download_url"] + if (!pluginLastReleaseTarballUrl) { + throw new Error("Github latest release url not found") + } + + try { + const path = await downloadUnzipTarball( + pluginLastReleaseTarballUrl, + pluginName, + headers + ) + return await getPluginMetadata(path) + } catch (err: any) { + let errMsg = err?.message || err + if (errMsg === "unexpected response Not Found") { + errMsg = "Github release tarball not found" + } + throw new Error(errMsg) + } +} diff --git a/packages/server/src/api/controllers/plugin/index.ts b/packages/server/src/api/controllers/plugin/index.ts index 3f3914f5ef..18a64d23a5 100644 --- a/packages/server/src/api/controllers/plugin/index.ts +++ b/packages/server/src/api/controllers/plugin/index.ts @@ -1,11 +1,6 @@ import { ObjectStoreBuckets } from "../../../constants" import { loadJSFile } from "../../../utilities/fileSystem" -import { - uploadedNpmPlugin, - uploadedUrlPlugin, - uploadedGithubPlugin, - uploadedFilePlugin, -} from "./utils" +import { npmUpload, urlUpload, githubUpload, fileUpload } from "./uploaders" import { getGlobalDB } from "@budibase/backend-core/tenancy" import { validate } from "@budibase/backend-core/plugins" import { generatePluginID, getPluginParams } from "../../../db/utils" @@ -70,20 +65,20 @@ export async function create(ctx: any) { switch (source) { case PluginSource.NPM: const { metadata: metadataNpm, directory: directoryNpm } = - await uploadedNpmPlugin(url, name) + await npmUpload(url, name) metadata = metadataNpm directory = directoryNpm break case PluginSource.GITHUB: const { metadata: metadataGithub, directory: directoryGithub } = - await uploadedGithubPlugin(ctx, url, name, githubToken) + await githubUpload(url, name, githubToken) metadata = metadataGithub directory = directoryGithub break case PluginSource.URL: - const headersObj = JSON.parse(headers || null) || {} + const headersObj = headers || {} const { metadata: metadataUrl, directory: directoryUrl } = - await uploadedUrlPlugin(url, name, headersObj) + await urlUpload(url, name, headersObj) metadata = metadataUrl directory = directoryUrl break @@ -202,6 +197,6 @@ export async function processPlugin(plugin: FileType, source?: string) { throw new Error("Plugins not supported outside of self-host.") } - const { metadata, directory } = await uploadedFilePlugin(plugin) + const { metadata, directory } = await fileUpload(plugin) return await storePlugin(metadata, directory, source) } diff --git a/packages/server/src/api/controllers/plugin/npm.ts b/packages/server/src/api/controllers/plugin/npm.ts new file mode 100644 index 0000000000..9463fad44a --- /dev/null +++ b/packages/server/src/api/controllers/plugin/npm.ts @@ -0,0 +1,56 @@ +import { + getPluginMetadata, + findFileRec, + extractTarball, + deleteFolderFileSystem, +} from "../../../utilities/fileSystem" +import fetch from "node-fetch" +import { join } from "path" +import { downloadUnzipTarball } from "./utils" + +export async function npmUpload(url: string, name: string, headers = {}) { + let npmTarballUrl = url + let pluginName = name + + if ( + !npmTarballUrl.includes("https://www.npmjs.com") && + !npmTarballUrl.includes("https://registry.npmjs.org") + ) { + throw new Error("The plugin origin must be from NPM") + } + + if (!npmTarballUrl.includes(".tgz")) { + const npmPackageURl = url.replace( + "https://www.npmjs.com/package/", + "https://registry.npmjs.org/" + ) + const response = await fetch(npmPackageURl) + if (response.status !== 200) { + throw new Error("NPM Package not found") + } + + let npmDetails = await response.json() + pluginName = npmDetails.name + const npmVersion = npmDetails["dist-tags"].latest + npmTarballUrl = npmDetails?.versions?.[npmVersion]?.dist?.tarball + + if (!npmTarballUrl) { + throw new Error("NPM tarball url not found") + } + } + + const path = await downloadUnzipTarball(npmTarballUrl, pluginName, headers) + const tarballPluginFile = findFileRec(path, ".tar.gz") + if (!tarballPluginFile) { + throw new Error("Tarball plugin file not found") + } + + try { + await extractTarball(tarballPluginFile, path) + deleteFolderFileSystem(join(path, "package")) + } catch (err: any) { + throw new Error(err) + } + + return await getPluginMetadata(path) +} diff --git a/packages/server/src/api/controllers/plugin/uploaders.ts b/packages/server/src/api/controllers/plugin/uploaders.ts new file mode 100644 index 0000000000..90b3ab2e64 --- /dev/null +++ b/packages/server/src/api/controllers/plugin/uploaders.ts @@ -0,0 +1,4 @@ +export { fileUpload } from "./file" +export { githubUpload } from "./github" +export { npmUpload } from "./npm" +export { urlUpload } from "./url" diff --git a/packages/server/src/api/controllers/plugin/url.ts b/packages/server/src/api/controllers/plugin/url.ts new file mode 100644 index 0000000000..489631e114 --- /dev/null +++ b/packages/server/src/api/controllers/plugin/url.ts @@ -0,0 +1,12 @@ +import { downloadUnzipTarball } from "./utils" +import { getPluginMetadata } from "../../../utilities/fileSystem" + +export async function urlUpload(url: string, name = "", headers = {}) { + if (!url.includes(".tar.gz")) { + throw new Error("Plugin must be compressed into a gzipped tarball.") + } + + const path = await downloadUnzipTarball(url, name, headers) + + return await getPluginMetadata(path) +} diff --git a/packages/server/src/api/controllers/plugin/utils.js b/packages/server/src/api/controllers/plugin/utils.js deleted file mode 100644 index 37d8ad6c3d..0000000000 --- a/packages/server/src/api/controllers/plugin/utils.js +++ /dev/null @@ -1,153 +0,0 @@ -const { - createTempFolder, - getPluginMetadata, - findFileRec, - downloadTarballDirect, - extractTarball, - deleteFolderFileSystem, -} = require("../../../utilities/fileSystem") -const { join } = require("path") -const fetch = require("node-fetch") - -exports.uploadedFilePlugin = async file => { - if (!file.name.endsWith(".tar.gz")) { - throw new Error("Plugin must be compressed into a gzipped tarball.") - } - const path = createTempFolder(file.name.split(".tar.gz")[0]) - await extractTarball(file.path, path) - - return await getPluginMetadata(path) -} - -exports.uploadedNpmPlugin = async (url, name, headers = {}) => { - let npmTarballUrl = url - let pluginName = name - - if ( - !npmTarballUrl.includes("https://www.npmjs.com") && - !npmTarballUrl.includes("https://registry.npmjs.org") - ) { - throw new Error("The plugin origin must be from NPM") - } - - if (!npmTarballUrl.includes(".tgz")) { - const npmPackageURl = url.replace( - "https://www.npmjs.com/package/", - "https://registry.npmjs.org/" - ) - const response = await fetch(npmPackageURl) - if (response.status !== 200) { - throw new Error("NPM Package not found") - } - - let npmDetails = await response.json() - pluginName = npmDetails.name - const npmVersion = npmDetails["dist-tags"].latest - npmTarballUrl = npmDetails?.versions?.[npmVersion]?.dist?.tarball - - if (!npmTarballUrl) { - throw new Error("NPM tarball url not found") - } - } - - const path = await downloadUnzipTarball(npmTarballUrl, pluginName, headers) - const tarballPluginFile = findFileRec(path, ".tar.gz") - if (!tarballPluginFile) { - throw new Error("Tarball plugin file not found") - } - - try { - await extractTarball(tarballPluginFile, path) - deleteFolderFileSystem(join(path, "package")) - } catch (err) { - throw new Error(err) - } - - return await getPluginMetadata(path) -} - -exports.uploadedUrlPlugin = async (url, name = "", headers = {}) => { - if (!url.includes(".tar.gz")) { - throw new Error("Plugin must be compressed into a gzipped tarball.") - } - - const path = await downloadUnzipTarball(url, name, headers) - - return await getPluginMetadata(path) -} - -exports.uploadedGithubPlugin = async (ctx, url, name = "", token = "") => { - let githubUrl = url - - if (!githubUrl.includes("https://github.com/")) { - throw new Error("The plugin origin must be from Github") - } - - if (url.includes(".git")) { - githubUrl = url.replace(".git", "") - } - - const githubApiUrl = githubUrl.replace( - "https://github.com/", - "https://api.github.com/repos/" - ) - const headers = token ? { Authorization: `Bearer ${token}` } : {} - try { - const pluginRaw = await fetch(githubApiUrl, { headers }) - if (pluginRaw.status !== 200) { - throw new Error(`Repository not found`) - } - - let pluginDetails = await pluginRaw.json() - const pluginName = pluginDetails.name || name - - const pluginLatestReleaseUrl = pluginDetails?.["releases_url"] - ? pluginDetails?.["releases_url"].replace("{/id}", "/latest") - : undefined - if (!pluginLatestReleaseUrl) { - throw new Error("Github release not found") - } - - const pluginReleaseRaw = await fetch(pluginLatestReleaseUrl, { headers }) - if (pluginReleaseRaw.status !== 200) { - throw new Error("Github latest release not found") - } - const pluginReleaseDetails = await pluginReleaseRaw.json() - const pluginReleaseTarballAsset = pluginReleaseDetails?.assets?.find( - x => x?.content_type === "application/gzip" - ) - const pluginLastReleaseTarballUrl = - pluginReleaseTarballAsset?.browser_download_url - if (!pluginLastReleaseTarballUrl) { - throw new Error("Github latest release url not found") - } - - const path = await downloadUnzipTarball( - pluginLastReleaseTarballUrl, - pluginName, - headers - ) - - return await getPluginMetadata(path) - } catch (err) { - let errMsg = err?.message || err - - if (errMsg === "unexpected response Not Found") { - errMsg = "Github release tarbal not found" - } - - throw new Error(errMsg) - } -} - -const downloadUnzipTarball = async (url, name, headers = {}) => { - try { - const path = createTempFolder(name) - - await downloadTarballDirect(url, path, headers) - - return path - } catch (e) { - throw new Error(e.message) - } -} diff --git a/packages/server/src/api/controllers/plugin/utils.ts b/packages/server/src/api/controllers/plugin/utils.ts new file mode 100644 index 0000000000..0e92fbb987 --- /dev/null +++ b/packages/server/src/api/controllers/plugin/utils.ts @@ -0,0 +1,19 @@ +import { + createTempFolder, + downloadTarballDirect, +} from "../../../utilities/fileSystem" + +export async function downloadUnzipTarball( + url: string, + name: string, + headers = {} +) { + try { + const path = createTempFolder(name) + await downloadTarballDirect(url, path, headers) + + return path + } catch (e: any) { + throw new Error(e.message) + } +} From f40de42478e591905b59c5d352e27ab84a595045 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 12 Sep 2022 19:47:27 +0100 Subject: [PATCH 221/260] Update plugin description text --- .../portal/manage/plugins/_components/AddPluginModal.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte b/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte index 7df0ca2a8d..9e88cdacb8 100644 --- a/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte +++ b/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte @@ -35,13 +35,13 @@ function infoMessage(optionName) { switch (optionName) { case PluginSource.URL: - return "Please specify a URL which directs to a built plugin TAR archive, you can provide headers if authentication is required." + return "Please specify a URL which directs to a built plugin TAR archive. You can provide headers if authentication is required." case PluginSource.NPM: return "Please specify the URL to a public NPM package which contains the built version of the plugin you wish to install." case PluginSource.GITHUB: return "Please specify the URL to a Github repository which contains built plugin releases. If this is a private repo you can provide a token to access it." case PluginSource.FILE: - return "Please provide a built plugin TAR archive, you can build a plugin locally using the Budibase CLI." + return "Please provide a built plugin TAR archive. You can build a plugin locally using the Budibase CLI." } } From 0077e1000cd0fe4e976817cdbc44e548414bec7b Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 12 Sep 2022 19:50:04 +0100 Subject: [PATCH 222/260] Fix plugin rows not being keyed properly, causing incorrect notifications --- .../portal/manage/plugins/_components/DeletePluginModal.svelte | 2 +- .../src/pages/builder/portal/manage/plugins/index.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/manage/plugins/_components/DeletePluginModal.svelte b/packages/builder/src/pages/builder/portal/manage/plugins/_components/DeletePluginModal.svelte index aed51e949e..6b09e7b276 100644 --- a/packages/builder/src/pages/builder/portal/manage/plugins/_components/DeletePluginModal.svelte +++ b/packages/builder/src/pages/builder/portal/manage/plugins/_components/DeletePluginModal.svelte @@ -10,7 +10,7 @@ async function deletePlugin() { try { await plugins.deletePlugin(plugin._id) - notifications.success(`Plugin ${plugin?.name} deleted.`) + notifications.success(`Plugin ${plugin?.name} deleted`) dispatch("deleted") } catch (error) { const msg = error?.message ? error.message : JSON.stringify(error) diff --git a/packages/builder/src/pages/builder/portal/manage/plugins/index.svelte b/packages/builder/src/pages/builder/portal/manage/plugins/index.svelte index 2602f4a034..5d73447710 100644 --- a/packages/builder/src/pages/builder/portal/manage/plugins/index.svelte +++ b/packages/builder/src/pages/builder/portal/manage/plugins/index.svelte @@ -67,7 +67,7 @@
{#if filteredPlugins?.length} - {#each filteredPlugins as plugin} + {#each filteredPlugins as plugin (plugin._id)} {/each} From c46604a26eebf94fba3f2d569d12eb063bac00ef Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 12 Sep 2022 19:09:31 +0000 Subject: [PATCH 223/260] v1.3.15-alpha.1 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lerna.json b/lerna.json index a276af2caf..76ba90b81c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.15-alpha.0", + "version": "1.3.15-alpha.1", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 32c8d3e1f2..bb94eaeaef 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.3.15-alpha.0", + "version": "1.3.15-alpha.1", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "1.3.15-alpha.0", + "@budibase/types": "1.3.15-alpha.1", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 081f6471af..525431c5c3 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.3.15-alpha.0", + "version": "1.3.15-alpha.1", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "1.3.15-alpha.0", + "@budibase/string-templates": "1.3.15-alpha.1", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 862fd2d333..246f1862e5 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.3.15-alpha.0", + "version": "1.3.15-alpha.1", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.0", - "@budibase/client": "1.3.15-alpha.0", - "@budibase/frontend-core": "1.3.15-alpha.0", - "@budibase/string-templates": "1.3.15-alpha.0", + "@budibase/bbui": "1.3.15-alpha.1", + "@budibase/client": "1.3.15-alpha.1", + "@budibase/frontend-core": "1.3.15-alpha.1", + "@budibase/string-templates": "1.3.15-alpha.1", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index f073a7913d..9ec1843c8f 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.3.15-alpha.0", + "version": "1.3.15-alpha.1", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.0", - "@budibase/string-templates": "1.3.15-alpha.0", - "@budibase/types": "1.3.15-alpha.0", + "@budibase/backend-core": "1.3.15-alpha.1", + "@budibase/string-templates": "1.3.15-alpha.1", + "@budibase/types": "1.3.15-alpha.1", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 370920f42b..2b227bce1b 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.3.15-alpha.0", + "version": "1.3.15-alpha.1", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.0", - "@budibase/frontend-core": "1.3.15-alpha.0", - "@budibase/string-templates": "1.3.15-alpha.0", + "@budibase/bbui": "1.3.15-alpha.1", + "@budibase/frontend-core": "1.3.15-alpha.1", + "@budibase/string-templates": "1.3.15-alpha.1", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index d6963ed5f4..9c7940dd45 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.3.15-alpha.0", + "version": "1.3.15-alpha.1", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "1.3.15-alpha.0", + "@budibase/bbui": "1.3.15-alpha.1", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 77890b483c..fdf5056cab 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.3.15-alpha.0", + "version": "1.3.15-alpha.1", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "1.3.15-alpha.0", - "@budibase/client": "1.3.15-alpha.0", + "@budibase/backend-core": "1.3.15-alpha.1", + "@budibase/client": "1.3.15-alpha.1", "@budibase/pro": "1.3.15-alpha.0", - "@budibase/string-templates": "1.3.15-alpha.0", - "@budibase/types": "1.3.15-alpha.0", + "@budibase/string-templates": "1.3.15-alpha.1", + "@budibase/types": "1.3.15-alpha.1", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 6b21c143a8..ff75e71129 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.3.15-alpha.0", + "version": "1.3.15-alpha.1", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index e2ff347691..1737ff69a2 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.3.15-alpha.0", + "version": "1.3.15-alpha.1", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index db818fed8d..0a7221b7d9 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.3.15-alpha.0", + "version": "1.3.15-alpha.1", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.0", + "@budibase/backend-core": "1.3.15-alpha.1", "@budibase/pro": "1.3.15-alpha.0", - "@budibase/string-templates": "1.3.15-alpha.0", - "@budibase/types": "1.3.15-alpha.0", + "@budibase/string-templates": "1.3.15-alpha.1", + "@budibase/types": "1.3.15-alpha.1", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From f5774d556954e364fc32dd45a603a78398c69e10 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 12 Sep 2022 19:12:42 +0000 Subject: [PATCH 224/260] Update pro version to 1.3.15-alpha.1 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index fdf5056cab..997646c583 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "1.3.15-alpha.1", "@budibase/client": "1.3.15-alpha.1", - "@budibase/pro": "1.3.15-alpha.0", + "@budibase/pro": "1.3.15-alpha.1", "@budibase/string-templates": "1.3.15-alpha.1", "@budibase/types": "1.3.15-alpha.1", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 63730ebd4c..4ec39fca77 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.0": - version "1.3.15-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.0.tgz#d4fd3a00008c3d5018c57bb5b4f04360d60f9807" - integrity sha512-3X7K3rHPBs065y1nihZdT45twPNiK5FGoi82DQc7z2ub6nuD7hfn+A8WpEGEpofFwNQHme1XTVrJJjyBDME/ZQ== +"@budibase/backend-core@1.3.15-alpha.1": + version "1.3.15-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.1.tgz#75f04e61374b00e507cad790f584b3a686f45533" + integrity sha512-ebkthJl0YMqpZAS+lm/OjX6TakAOnf0E1mBrxrPrlvq33Z8Imp5qrWq+UJswh/ltTUFd1Zxm21lMKweCdV2kOg== dependencies: - "@budibase/types" "1.3.15-alpha.0" + "@budibase/types" "1.3.15-alpha.1" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1179,13 +1179,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.3.15-alpha.0": - version "1.3.15-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.0.tgz#92d0a74c5aa31c22020aeb584e05c90a9ca210a0" - integrity sha512-mNdwrtJt++WNKttizfvD1mpDZqQHhUAsY5SvlKAL6EiOJVYpJzW/p7m4fxn8hjhLtTrKdDThmb7nTyxE43Scdw== +"@budibase/pro@1.3.15-alpha.1": + version "1.3.15-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.1.tgz#0575016bf9bed5c36b6ebbb6b98a999f1d365522" + integrity sha512-8cxkEZcuvmoor8zVTFz6X+oeYXEdYmPUrXCBmya6IwqmhtIk/rJ7Ps4S7JNgdndeEQsxQc8Ch8ur/KaA/tb94Q== dependencies: - "@budibase/backend-core" "1.3.15-alpha.0" - "@budibase/types" "1.3.15-alpha.0" + "@budibase/backend-core" "1.3.15-alpha.1" + "@budibase/types" "1.3.15-alpha.1" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1208,10 +1208,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.3.15-alpha.0": - version "1.3.15-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.0.tgz#813eb8415fc2df926572dd96d67467292fd692f4" - integrity sha512-rQ52X2v9xIbWfB9aUpiNfHsByg2OpAtUOrPkj/JQopyRdfTXuHC/IJiHvVBkYmappXo6D0p9VdcCvgeSPn/RMQ== +"@budibase/types@1.3.15-alpha.1": + version "1.3.15-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.1.tgz#28dc4457de6bfe3c673421fa4cae728d3a4d87b8" + integrity sha512-318QMe3RI0UX47FpOxcM7BQU+TSexMkTBaH6G/BAHhZr/dWTP6I9MITuWpVKUxZgdJHvhZdbUeknHXUgR7Wjcw== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 0a7221b7d9..9bb3db51f7 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "1.3.15-alpha.1", - "@budibase/pro": "1.3.15-alpha.0", + "@budibase/pro": "1.3.15-alpha.1", "@budibase/string-templates": "1.3.15-alpha.1", "@budibase/types": "1.3.15-alpha.1", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 6d8559052a..959d6bf5e7 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.0": - version "1.3.15-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.0.tgz#d4fd3a00008c3d5018c57bb5b4f04360d60f9807" - integrity sha512-3X7K3rHPBs065y1nihZdT45twPNiK5FGoi82DQc7z2ub6nuD7hfn+A8WpEGEpofFwNQHme1XTVrJJjyBDME/ZQ== +"@budibase/backend-core@1.3.15-alpha.1": + version "1.3.15-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.1.tgz#75f04e61374b00e507cad790f584b3a686f45533" + integrity sha512-ebkthJl0YMqpZAS+lm/OjX6TakAOnf0E1mBrxrPrlvq33Z8Imp5qrWq+UJswh/ltTUFd1Zxm21lMKweCdV2kOg== dependencies: - "@budibase/types" "1.3.15-alpha.0" + "@budibase/types" "1.3.15-alpha.1" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -326,21 +326,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.3.15-alpha.0": - version "1.3.15-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.0.tgz#92d0a74c5aa31c22020aeb584e05c90a9ca210a0" - integrity sha512-mNdwrtJt++WNKttizfvD1mpDZqQHhUAsY5SvlKAL6EiOJVYpJzW/p7m4fxn8hjhLtTrKdDThmb7nTyxE43Scdw== +"@budibase/pro@1.3.15-alpha.1": + version "1.3.15-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.1.tgz#0575016bf9bed5c36b6ebbb6b98a999f1d365522" + integrity sha512-8cxkEZcuvmoor8zVTFz6X+oeYXEdYmPUrXCBmya6IwqmhtIk/rJ7Ps4S7JNgdndeEQsxQc8Ch8ur/KaA/tb94Q== dependencies: - "@budibase/backend-core" "1.3.15-alpha.0" - "@budibase/types" "1.3.15-alpha.0" + "@budibase/backend-core" "1.3.15-alpha.1" + "@budibase/types" "1.3.15-alpha.1" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.3.15-alpha.0": - version "1.3.15-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.0.tgz#813eb8415fc2df926572dd96d67467292fd692f4" - integrity sha512-rQ52X2v9xIbWfB9aUpiNfHsByg2OpAtUOrPkj/JQopyRdfTXuHC/IJiHvVBkYmappXo6D0p9VdcCvgeSPn/RMQ== +"@budibase/types@1.3.15-alpha.1": + version "1.3.15-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.1.tgz#28dc4457de6bfe3c673421fa4cae728d3a4d87b8" + integrity sha512-318QMe3RI0UX47FpOxcM7BQU+TSexMkTBaH6G/BAHhZr/dWTP6I9MITuWpVKUxZgdJHvhZdbUeknHXUgR7Wjcw== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 4c301e962f87e2487a04bda7bd8783da588324c0 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 13 Sep 2022 09:54:25 +0100 Subject: [PATCH 225/260] Refactor server websocket dependency tree to fix jest tests --- packages/server/src/api/controllers/plugin/index.ts | 2 +- packages/server/src/app.ts | 6 ++---- packages/server/src/websocket.ts | 11 ++++++++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/server/src/api/controllers/plugin/index.ts b/packages/server/src/api/controllers/plugin/index.ts index d0c23c4e32..99a9e7db66 100644 --- a/packages/server/src/api/controllers/plugin/index.ts +++ b/packages/server/src/api/controllers/plugin/index.ts @@ -10,7 +10,7 @@ import { } from "@budibase/backend-core/objectStore" import { PluginType, FileType, PluginSource } from "@budibase/types" import env from "../../../environment" -import { ClientAppSocket } from "../../../app" +import { ClientAppSocket } from "../../../websocket" export async function getPlugins(type?: PluginType) { const db = getGlobalDB() diff --git a/packages/server/src/app.ts b/packages/server/src/app.ts index f9dce0c867..e001b77aba 100644 --- a/packages/server/src/app.ts +++ b/packages/server/src/app.ts @@ -32,7 +32,7 @@ import * as migrations from "./migrations" import { events, installation, tenancy } from "@budibase/backend-core" import { createAdminUser, getChecklist } from "./utilities/workerRequests" import { watch } from "./watch" -import { Websocket } from "./websocket" +import { initialise as initialiseWebsockets } from "./websocket" const app = new Koa() @@ -77,9 +77,7 @@ if (env.isProd()) { const server = http.createServer(app.callback()) destroyable(server) - -// initialise websockets -export const ClientAppSocket = new Websocket(server, "/socket/client") +initialiseWebsockets(server) let shuttingDown = false, errCode = 0 diff --git a/packages/server/src/websocket.ts b/packages/server/src/websocket.ts index 52942ab795..d6d91b0ca0 100644 --- a/packages/server/src/websocket.ts +++ b/packages/server/src/websocket.ts @@ -1,7 +1,7 @@ import { Server } from "socket.io" import http from "http" -export class Websocket { +class Websocket { socketServer: Server constructor(server: http.Server, path: string) { @@ -15,3 +15,12 @@ export class Websocket { this.socketServer.sockets.emit(event, payload) } } + +// Likely to be more socket instances in future +let ClientAppSocket: Websocket + +export const initialise = (server: http.Server) => { + ClientAppSocket = new Websocket(server, "/socket/client") +} + +export { ClientAppSocket } From 2e1dd12e45b151f130911eff6cc3bc1216739cf3 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 13 Sep 2022 09:24:01 +0000 Subject: [PATCH 226/260] v1.3.15-alpha.2 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lerna.json b/lerna.json index 76ba90b81c..d004e68e33 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.15-alpha.1", + "version": "1.3.15-alpha.2", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index bb94eaeaef..0c1ad0c7e8 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.3.15-alpha.1", + "version": "1.3.15-alpha.2", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "1.3.15-alpha.1", + "@budibase/types": "1.3.15-alpha.2", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 525431c5c3..4cdea18b36 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.3.15-alpha.1", + "version": "1.3.15-alpha.2", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "1.3.15-alpha.1", + "@budibase/string-templates": "1.3.15-alpha.2", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 246f1862e5..f6f1d04ef8 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.3.15-alpha.1", + "version": "1.3.15-alpha.2", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.1", - "@budibase/client": "1.3.15-alpha.1", - "@budibase/frontend-core": "1.3.15-alpha.1", - "@budibase/string-templates": "1.3.15-alpha.1", + "@budibase/bbui": "1.3.15-alpha.2", + "@budibase/client": "1.3.15-alpha.2", + "@budibase/frontend-core": "1.3.15-alpha.2", + "@budibase/string-templates": "1.3.15-alpha.2", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 9ec1843c8f..1e94041311 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.3.15-alpha.1", + "version": "1.3.15-alpha.2", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.1", - "@budibase/string-templates": "1.3.15-alpha.1", - "@budibase/types": "1.3.15-alpha.1", + "@budibase/backend-core": "1.3.15-alpha.2", + "@budibase/string-templates": "1.3.15-alpha.2", + "@budibase/types": "1.3.15-alpha.2", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 090f1e8f00..318b246c9d 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.3.15-alpha.1", + "version": "1.3.15-alpha.2", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.1", - "@budibase/frontend-core": "1.3.15-alpha.1", - "@budibase/string-templates": "1.3.15-alpha.1", + "@budibase/bbui": "1.3.15-alpha.2", + "@budibase/frontend-core": "1.3.15-alpha.2", + "@budibase/string-templates": "1.3.15-alpha.2", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 9c7940dd45..f33aa5d7d9 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.3.15-alpha.1", + "version": "1.3.15-alpha.2", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "1.3.15-alpha.1", + "@budibase/bbui": "1.3.15-alpha.2", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 6b9d04f0f7..de301ce0ca 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.3.15-alpha.1", + "version": "1.3.15-alpha.2", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "1.3.15-alpha.1", - "@budibase/client": "1.3.15-alpha.1", + "@budibase/backend-core": "1.3.15-alpha.2", + "@budibase/client": "1.3.15-alpha.2", "@budibase/pro": "1.3.15-alpha.1", - "@budibase/string-templates": "1.3.15-alpha.1", - "@budibase/types": "1.3.15-alpha.1", + "@budibase/string-templates": "1.3.15-alpha.2", + "@budibase/types": "1.3.15-alpha.2", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index ff75e71129..b2e7a81eeb 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.3.15-alpha.1", + "version": "1.3.15-alpha.2", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 1737ff69a2..19010a7d1d 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.3.15-alpha.1", + "version": "1.3.15-alpha.2", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 9bb3db51f7..b45fbf87b0 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.3.15-alpha.1", + "version": "1.3.15-alpha.2", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.1", + "@budibase/backend-core": "1.3.15-alpha.2", "@budibase/pro": "1.3.15-alpha.1", - "@budibase/string-templates": "1.3.15-alpha.1", - "@budibase/types": "1.3.15-alpha.1", + "@budibase/string-templates": "1.3.15-alpha.2", + "@budibase/types": "1.3.15-alpha.2", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 1553bfb67971e4d8116aafc2c311976b37bcd892 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 13 Sep 2022 09:26:58 +0000 Subject: [PATCH 227/260] Update pro version to 1.3.15-alpha.2 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index de301ce0ca..6d48c0471e 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "1.3.15-alpha.2", "@budibase/client": "1.3.15-alpha.2", - "@budibase/pro": "1.3.15-alpha.1", + "@budibase/pro": "1.3.15-alpha.2", "@budibase/string-templates": "1.3.15-alpha.2", "@budibase/types": "1.3.15-alpha.2", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 3c2eda8ba1..77b6daae57 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.1": - version "1.3.15-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.1.tgz#75f04e61374b00e507cad790f584b3a686f45533" - integrity sha512-ebkthJl0YMqpZAS+lm/OjX6TakAOnf0E1mBrxrPrlvq33Z8Imp5qrWq+UJswh/ltTUFd1Zxm21lMKweCdV2kOg== +"@budibase/backend-core@1.3.15-alpha.2": + version "1.3.15-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.2.tgz#ed3c7cc270147f660553b9f2972ef7cdc544fd21" + integrity sha512-voJFjd78CCdsINk+e1CYyXhGx4ubWJ9k2ILVUWooWgUAaYfjlJHKLH5yjNhVOdXGd0NVebLgMoTIgIHk5lPoFw== dependencies: - "@budibase/types" "1.3.15-alpha.1" + "@budibase/types" "1.3.15-alpha.2" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1179,13 +1179,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.3.15-alpha.1": - version "1.3.15-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.1.tgz#0575016bf9bed5c36b6ebbb6b98a999f1d365522" - integrity sha512-8cxkEZcuvmoor8zVTFz6X+oeYXEdYmPUrXCBmya6IwqmhtIk/rJ7Ps4S7JNgdndeEQsxQc8Ch8ur/KaA/tb94Q== +"@budibase/pro@1.3.15-alpha.2": + version "1.3.15-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.2.tgz#c6b0586ba2775fb7dd8bab7bebae49f38154056b" + integrity sha512-oaxt5fCpzaBHRkRwGxYt6zXTM9Mn1+niCBXCSA+weTNMqpCg9VlfE+XIvkwBTs0ehpnJsJsseZ/j49fHQ4TqGg== dependencies: - "@budibase/backend-core" "1.3.15-alpha.1" - "@budibase/types" "1.3.15-alpha.1" + "@budibase/backend-core" "1.3.15-alpha.2" + "@budibase/types" "1.3.15-alpha.2" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1208,10 +1208,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.3.15-alpha.1": - version "1.3.15-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.1.tgz#28dc4457de6bfe3c673421fa4cae728d3a4d87b8" - integrity sha512-318QMe3RI0UX47FpOxcM7BQU+TSexMkTBaH6G/BAHhZr/dWTP6I9MITuWpVKUxZgdJHvhZdbUeknHXUgR7Wjcw== +"@budibase/types@1.3.15-alpha.2": + version "1.3.15-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.2.tgz#e05d150327802940170b53d2a6ea8a17a1d597e6" + integrity sha512-zvOyOkTlSHAgV+e8xr9hR+E/M6gMXD6qxJGYyateBpIY/SPt+AoGUC5kn2YMD6ewlH+tNBQ6lahfU2pqPMPrxA== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index b45fbf87b0..ffb7057921 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "1.3.15-alpha.2", - "@budibase/pro": "1.3.15-alpha.1", + "@budibase/pro": "1.3.15-alpha.2", "@budibase/string-templates": "1.3.15-alpha.2", "@budibase/types": "1.3.15-alpha.2", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 959d6bf5e7..32f0b55f70 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.1": - version "1.3.15-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.1.tgz#75f04e61374b00e507cad790f584b3a686f45533" - integrity sha512-ebkthJl0YMqpZAS+lm/OjX6TakAOnf0E1mBrxrPrlvq33Z8Imp5qrWq+UJswh/ltTUFd1Zxm21lMKweCdV2kOg== +"@budibase/backend-core@1.3.15-alpha.2": + version "1.3.15-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.2.tgz#ed3c7cc270147f660553b9f2972ef7cdc544fd21" + integrity sha512-voJFjd78CCdsINk+e1CYyXhGx4ubWJ9k2ILVUWooWgUAaYfjlJHKLH5yjNhVOdXGd0NVebLgMoTIgIHk5lPoFw== dependencies: - "@budibase/types" "1.3.15-alpha.1" + "@budibase/types" "1.3.15-alpha.2" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -326,21 +326,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.3.15-alpha.1": - version "1.3.15-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.1.tgz#0575016bf9bed5c36b6ebbb6b98a999f1d365522" - integrity sha512-8cxkEZcuvmoor8zVTFz6X+oeYXEdYmPUrXCBmya6IwqmhtIk/rJ7Ps4S7JNgdndeEQsxQc8Ch8ur/KaA/tb94Q== +"@budibase/pro@1.3.15-alpha.2": + version "1.3.15-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.2.tgz#c6b0586ba2775fb7dd8bab7bebae49f38154056b" + integrity sha512-oaxt5fCpzaBHRkRwGxYt6zXTM9Mn1+niCBXCSA+weTNMqpCg9VlfE+XIvkwBTs0ehpnJsJsseZ/j49fHQ4TqGg== dependencies: - "@budibase/backend-core" "1.3.15-alpha.1" - "@budibase/types" "1.3.15-alpha.1" + "@budibase/backend-core" "1.3.15-alpha.2" + "@budibase/types" "1.3.15-alpha.2" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.3.15-alpha.1": - version "1.3.15-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.1.tgz#28dc4457de6bfe3c673421fa4cae728d3a4d87b8" - integrity sha512-318QMe3RI0UX47FpOxcM7BQU+TSexMkTBaH6G/BAHhZr/dWTP6I9MITuWpVKUxZgdJHvhZdbUeknHXUgR7Wjcw== +"@budibase/types@1.3.15-alpha.2": + version "1.3.15-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.2.tgz#e05d150327802940170b53d2a6ea8a17a1d597e6" + integrity sha512-zvOyOkTlSHAgV+e8xr9hR+E/M6gMXD6qxJGYyateBpIY/SPt+AoGUC5kn2YMD6ewlH+tNBQ6lahfU2pqPMPrxA== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 9375a685ff9da8a26fbc7cc1d01870b380d8efe5 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 13 Sep 2022 09:48:22 +0000 Subject: [PATCH 228/260] v1.3.15-alpha.3 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lerna.json b/lerna.json index d004e68e33..1089acf87a 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.15-alpha.2", + "version": "1.3.15-alpha.3", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 0c1ad0c7e8..9a770d3887 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.3.15-alpha.2", + "version": "1.3.15-alpha.3", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "1.3.15-alpha.2", + "@budibase/types": "1.3.15-alpha.3", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 4cdea18b36..41ca994b87 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.3.15-alpha.2", + "version": "1.3.15-alpha.3", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "1.3.15-alpha.2", + "@budibase/string-templates": "1.3.15-alpha.3", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index f6f1d04ef8..dd918132d7 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.3.15-alpha.2", + "version": "1.3.15-alpha.3", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.2", - "@budibase/client": "1.3.15-alpha.2", - "@budibase/frontend-core": "1.3.15-alpha.2", - "@budibase/string-templates": "1.3.15-alpha.2", + "@budibase/bbui": "1.3.15-alpha.3", + "@budibase/client": "1.3.15-alpha.3", + "@budibase/frontend-core": "1.3.15-alpha.3", + "@budibase/string-templates": "1.3.15-alpha.3", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 1e94041311..42499a3c00 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.3.15-alpha.2", + "version": "1.3.15-alpha.3", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.2", - "@budibase/string-templates": "1.3.15-alpha.2", - "@budibase/types": "1.3.15-alpha.2", + "@budibase/backend-core": "1.3.15-alpha.3", + "@budibase/string-templates": "1.3.15-alpha.3", + "@budibase/types": "1.3.15-alpha.3", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 318b246c9d..f20fda52f8 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.3.15-alpha.2", + "version": "1.3.15-alpha.3", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.2", - "@budibase/frontend-core": "1.3.15-alpha.2", - "@budibase/string-templates": "1.3.15-alpha.2", + "@budibase/bbui": "1.3.15-alpha.3", + "@budibase/frontend-core": "1.3.15-alpha.3", + "@budibase/string-templates": "1.3.15-alpha.3", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index f33aa5d7d9..8621675d2c 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.3.15-alpha.2", + "version": "1.3.15-alpha.3", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "1.3.15-alpha.2", + "@budibase/bbui": "1.3.15-alpha.3", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 6d48c0471e..3b1e4fd849 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.3.15-alpha.2", + "version": "1.3.15-alpha.3", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "1.3.15-alpha.2", - "@budibase/client": "1.3.15-alpha.2", + "@budibase/backend-core": "1.3.15-alpha.3", + "@budibase/client": "1.3.15-alpha.3", "@budibase/pro": "1.3.15-alpha.2", - "@budibase/string-templates": "1.3.15-alpha.2", - "@budibase/types": "1.3.15-alpha.2", + "@budibase/string-templates": "1.3.15-alpha.3", + "@budibase/types": "1.3.15-alpha.3", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index b2e7a81eeb..a3774ab480 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.3.15-alpha.2", + "version": "1.3.15-alpha.3", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 19010a7d1d..cd291963c6 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.3.15-alpha.2", + "version": "1.3.15-alpha.3", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index ffb7057921..3ea66bf60d 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.3.15-alpha.2", + "version": "1.3.15-alpha.3", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.2", + "@budibase/backend-core": "1.3.15-alpha.3", "@budibase/pro": "1.3.15-alpha.2", - "@budibase/string-templates": "1.3.15-alpha.2", - "@budibase/types": "1.3.15-alpha.2", + "@budibase/string-templates": "1.3.15-alpha.3", + "@budibase/types": "1.3.15-alpha.3", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 3717e8979b6dde6f966d9a71e9c7b9f90fe54bd8 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 13 Sep 2022 09:52:08 +0000 Subject: [PATCH 229/260] Update pro version to 1.3.15-alpha.3 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 3b1e4fd849..8a9281f47b 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "1.3.15-alpha.3", "@budibase/client": "1.3.15-alpha.3", - "@budibase/pro": "1.3.15-alpha.2", + "@budibase/pro": "1.3.15-alpha.3", "@budibase/string-templates": "1.3.15-alpha.3", "@budibase/types": "1.3.15-alpha.3", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 77b6daae57..e16d25abd2 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.2": - version "1.3.15-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.2.tgz#ed3c7cc270147f660553b9f2972ef7cdc544fd21" - integrity sha512-voJFjd78CCdsINk+e1CYyXhGx4ubWJ9k2ILVUWooWgUAaYfjlJHKLH5yjNhVOdXGd0NVebLgMoTIgIHk5lPoFw== +"@budibase/backend-core@1.3.15-alpha.3": + version "1.3.15-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.3.tgz#d7727555829511ac0abc5a95f791067bf7e316d5" + integrity sha512-4buol+Dz4oLOnwij/SepNV4tP1o2HGIPGUxnWYH4idLpnDFeNXLPZ+eh0Kmj3sEmkKm/Yb5MNcPl2gr+62Grfw== dependencies: - "@budibase/types" "1.3.15-alpha.2" + "@budibase/types" "1.3.15-alpha.3" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1179,13 +1179,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.3.15-alpha.2": - version "1.3.15-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.2.tgz#c6b0586ba2775fb7dd8bab7bebae49f38154056b" - integrity sha512-oaxt5fCpzaBHRkRwGxYt6zXTM9Mn1+niCBXCSA+weTNMqpCg9VlfE+XIvkwBTs0ehpnJsJsseZ/j49fHQ4TqGg== +"@budibase/pro@1.3.15-alpha.3": + version "1.3.15-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.3.tgz#d062351202f544bdfd11e1364dd36791c156e7be" + integrity sha512-6ndItwEEZxOgJayIqawbG6VYOO49hrlP1UrWAAW+X7ykFCZNi4KC4Qaa4AFaF6PRttvMHfvtjQ3Mlc9fr2CCmA== dependencies: - "@budibase/backend-core" "1.3.15-alpha.2" - "@budibase/types" "1.3.15-alpha.2" + "@budibase/backend-core" "1.3.15-alpha.3" + "@budibase/types" "1.3.15-alpha.3" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1208,10 +1208,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.3.15-alpha.2": - version "1.3.15-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.2.tgz#e05d150327802940170b53d2a6ea8a17a1d597e6" - integrity sha512-zvOyOkTlSHAgV+e8xr9hR+E/M6gMXD6qxJGYyateBpIY/SPt+AoGUC5kn2YMD6ewlH+tNBQ6lahfU2pqPMPrxA== +"@budibase/types@1.3.15-alpha.3": + version "1.3.15-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.3.tgz#d4fb023e68c0980b8cb54305a5ab31c5c34a20ee" + integrity sha512-geAkfvu1zaA0tf2Rn+sGnKTrZ9J9UkzqtrqffLKNVHdlWrOfCGrLtOufjFo5H7CfTMG/1ysvmSb4QaU/dPf3Ag== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 3ea66bf60d..aa5b04f4ab 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "1.3.15-alpha.3", - "@budibase/pro": "1.3.15-alpha.2", + "@budibase/pro": "1.3.15-alpha.3", "@budibase/string-templates": "1.3.15-alpha.3", "@budibase/types": "1.3.15-alpha.3", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 32f0b55f70..ba66cab653 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.2": - version "1.3.15-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.2.tgz#ed3c7cc270147f660553b9f2972ef7cdc544fd21" - integrity sha512-voJFjd78CCdsINk+e1CYyXhGx4ubWJ9k2ILVUWooWgUAaYfjlJHKLH5yjNhVOdXGd0NVebLgMoTIgIHk5lPoFw== +"@budibase/backend-core@1.3.15-alpha.3": + version "1.3.15-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.3.tgz#d7727555829511ac0abc5a95f791067bf7e316d5" + integrity sha512-4buol+Dz4oLOnwij/SepNV4tP1o2HGIPGUxnWYH4idLpnDFeNXLPZ+eh0Kmj3sEmkKm/Yb5MNcPl2gr+62Grfw== dependencies: - "@budibase/types" "1.3.15-alpha.2" + "@budibase/types" "1.3.15-alpha.3" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -326,21 +326,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.3.15-alpha.2": - version "1.3.15-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.2.tgz#c6b0586ba2775fb7dd8bab7bebae49f38154056b" - integrity sha512-oaxt5fCpzaBHRkRwGxYt6zXTM9Mn1+niCBXCSA+weTNMqpCg9VlfE+XIvkwBTs0ehpnJsJsseZ/j49fHQ4TqGg== +"@budibase/pro@1.3.15-alpha.3": + version "1.3.15-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.3.tgz#d062351202f544bdfd11e1364dd36791c156e7be" + integrity sha512-6ndItwEEZxOgJayIqawbG6VYOO49hrlP1UrWAAW+X7ykFCZNi4KC4Qaa4AFaF6PRttvMHfvtjQ3Mlc9fr2CCmA== dependencies: - "@budibase/backend-core" "1.3.15-alpha.2" - "@budibase/types" "1.3.15-alpha.2" + "@budibase/backend-core" "1.3.15-alpha.3" + "@budibase/types" "1.3.15-alpha.3" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.3.15-alpha.2": - version "1.3.15-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.2.tgz#e05d150327802940170b53d2a6ea8a17a1d597e6" - integrity sha512-zvOyOkTlSHAgV+e8xr9hR+E/M6gMXD6qxJGYyateBpIY/SPt+AoGUC5kn2YMD6ewlH+tNBQ6lahfU2pqPMPrxA== +"@budibase/types@1.3.15-alpha.3": + version "1.3.15-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.3.tgz#d4fb023e68c0980b8cb54305a5ab31c5c34a20ee" + integrity sha512-geAkfvu1zaA0tf2Rn+sGnKTrZ9J9UkzqtrqffLKNVHdlWrOfCGrLtOufjFo5H7CfTMG/1ysvmSb4QaU/dPf3Ag== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 6e29e0a7572184d6fb8daed676a2cc09d0791143 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Tue, 13 Sep 2022 10:55:38 +0100 Subject: [PATCH 230/260] Case insensitive table fetch --- packages/server/src/api/controllers/datasource.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/controllers/datasource.js b/packages/server/src/api/controllers/datasource.js index 75fd1db02a..f7784d31d6 100644 --- a/packages/server/src/api/controllers/datasource.js +++ b/packages/server/src/api/controllers/datasource.js @@ -58,7 +58,9 @@ exports.buildSchemaFromDb = async function (ctx) { datasource.entities = {} } for (let key in tables) { - if (tablesFilter.includes(key)) { + if ( + tablesFilter.some(filter => filter.toLowerCase() === key.toLowerCase()) + ) { datasource.entities[key] = tables[key] } } @@ -237,7 +239,7 @@ const buildSchemaHelper = async datasource => { await connector.buildSchema(datasource._id, datasource.entities) // make sure they all have a display name selected - for (let entity of Object.values(datasource.entities)) { + for (let entity of Object.values(datasource.entities ?? {})) { if (entity.primaryDisplay) { continue } From 171e5926d356e06035244be40ca4f01d2ce01620 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 13 Sep 2022 10:29:40 +0000 Subject: [PATCH 231/260] v1.3.15-alpha.4 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lerna.json b/lerna.json index 1089acf87a..526b8fad06 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.15-alpha.3", + "version": "1.3.15-alpha.4", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 9a770d3887..a256fb0b67 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.3.15-alpha.3", + "version": "1.3.15-alpha.4", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "1.3.15-alpha.3", + "@budibase/types": "1.3.15-alpha.4", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 41ca994b87..4843f9985d 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.3.15-alpha.3", + "version": "1.3.15-alpha.4", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "1.3.15-alpha.3", + "@budibase/string-templates": "1.3.15-alpha.4", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index dd918132d7..3027393181 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.3.15-alpha.3", + "version": "1.3.15-alpha.4", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.3", - "@budibase/client": "1.3.15-alpha.3", - "@budibase/frontend-core": "1.3.15-alpha.3", - "@budibase/string-templates": "1.3.15-alpha.3", + "@budibase/bbui": "1.3.15-alpha.4", + "@budibase/client": "1.3.15-alpha.4", + "@budibase/frontend-core": "1.3.15-alpha.4", + "@budibase/string-templates": "1.3.15-alpha.4", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 42499a3c00..ab1663ae1a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.3.15-alpha.3", + "version": "1.3.15-alpha.4", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.3", - "@budibase/string-templates": "1.3.15-alpha.3", - "@budibase/types": "1.3.15-alpha.3", + "@budibase/backend-core": "1.3.15-alpha.4", + "@budibase/string-templates": "1.3.15-alpha.4", + "@budibase/types": "1.3.15-alpha.4", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index f20fda52f8..dd81b5b667 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.3.15-alpha.3", + "version": "1.3.15-alpha.4", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.3", - "@budibase/frontend-core": "1.3.15-alpha.3", - "@budibase/string-templates": "1.3.15-alpha.3", + "@budibase/bbui": "1.3.15-alpha.4", + "@budibase/frontend-core": "1.3.15-alpha.4", + "@budibase/string-templates": "1.3.15-alpha.4", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 8621675d2c..062807e6f3 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.3.15-alpha.3", + "version": "1.3.15-alpha.4", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "1.3.15-alpha.3", + "@budibase/bbui": "1.3.15-alpha.4", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 8a9281f47b..635a6ae388 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.3.15-alpha.3", + "version": "1.3.15-alpha.4", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "1.3.15-alpha.3", - "@budibase/client": "1.3.15-alpha.3", + "@budibase/backend-core": "1.3.15-alpha.4", + "@budibase/client": "1.3.15-alpha.4", "@budibase/pro": "1.3.15-alpha.3", - "@budibase/string-templates": "1.3.15-alpha.3", - "@budibase/types": "1.3.15-alpha.3", + "@budibase/string-templates": "1.3.15-alpha.4", + "@budibase/types": "1.3.15-alpha.4", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index a3774ab480..21829db0a9 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.3.15-alpha.3", + "version": "1.3.15-alpha.4", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index cd291963c6..11fb341a73 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.3.15-alpha.3", + "version": "1.3.15-alpha.4", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index aa5b04f4ab..d0e6c313ce 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.3.15-alpha.3", + "version": "1.3.15-alpha.4", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.3", + "@budibase/backend-core": "1.3.15-alpha.4", "@budibase/pro": "1.3.15-alpha.3", - "@budibase/string-templates": "1.3.15-alpha.3", - "@budibase/types": "1.3.15-alpha.3", + "@budibase/string-templates": "1.3.15-alpha.4", + "@budibase/types": "1.3.15-alpha.4", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From c63eb01b18c92d928172741f9fc36e88dc91dfc3 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 13 Sep 2022 10:32:40 +0000 Subject: [PATCH 232/260] Update pro version to 1.3.15-alpha.4 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 635a6ae388..6134e6d329 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "1.3.15-alpha.4", "@budibase/client": "1.3.15-alpha.4", - "@budibase/pro": "1.3.15-alpha.3", + "@budibase/pro": "1.3.15-alpha.4", "@budibase/string-templates": "1.3.15-alpha.4", "@budibase/types": "1.3.15-alpha.4", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index e16d25abd2..fbc204b9b9 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.3": - version "1.3.15-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.3.tgz#d7727555829511ac0abc5a95f791067bf7e316d5" - integrity sha512-4buol+Dz4oLOnwij/SepNV4tP1o2HGIPGUxnWYH4idLpnDFeNXLPZ+eh0Kmj3sEmkKm/Yb5MNcPl2gr+62Grfw== +"@budibase/backend-core@1.3.15-alpha.4": + version "1.3.15-alpha.4" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.4.tgz#842a82753ee31537e5c603632bffe871d5921f10" + integrity sha512-1w8cYVfkHAVj3BwdNrbNcTSugFhljPPgdRJIou5uTg8x3teF1yFo8uvH4yhHxO3mRbMC4FPq5kJzOn9mflvx6w== dependencies: - "@budibase/types" "1.3.15-alpha.3" + "@budibase/types" "1.3.15-alpha.4" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1179,13 +1179,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.3.15-alpha.3": - version "1.3.15-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.3.tgz#d062351202f544bdfd11e1364dd36791c156e7be" - integrity sha512-6ndItwEEZxOgJayIqawbG6VYOO49hrlP1UrWAAW+X7ykFCZNi4KC4Qaa4AFaF6PRttvMHfvtjQ3Mlc9fr2CCmA== +"@budibase/pro@1.3.15-alpha.4": + version "1.3.15-alpha.4" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.4.tgz#c5959556d48b03874dafc45e6a4c75d85d0414d6" + integrity sha512-HXJgS8iku1kmBSc5XIJfRCDWpL1IDS7bJFDqA99gT7jMOD0xino9KH1gn2kN7RYhfBSOSVHVBHMOfuUJES4Fwg== dependencies: - "@budibase/backend-core" "1.3.15-alpha.3" - "@budibase/types" "1.3.15-alpha.3" + "@budibase/backend-core" "1.3.15-alpha.4" + "@budibase/types" "1.3.15-alpha.4" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1208,10 +1208,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.3.15-alpha.3": - version "1.3.15-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.3.tgz#d4fb023e68c0980b8cb54305a5ab31c5c34a20ee" - integrity sha512-geAkfvu1zaA0tf2Rn+sGnKTrZ9J9UkzqtrqffLKNVHdlWrOfCGrLtOufjFo5H7CfTMG/1ysvmSb4QaU/dPf3Ag== +"@budibase/types@1.3.15-alpha.4": + version "1.3.15-alpha.4" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.4.tgz#125f886ced79bad68ef17d945c5c237a6b5b9ff3" + integrity sha512-k/Rq73dzI1jzuLqU4/Zhlt7sRQdsthazCbtm8cYqZWb6HaCUUAK6YdwLUzUGNLwAz4vtZHICng8N2cYyYP4RPw== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index d0e6c313ce..e77d1d9ef4 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "1.3.15-alpha.4", - "@budibase/pro": "1.3.15-alpha.3", + "@budibase/pro": "1.3.15-alpha.4", "@budibase/string-templates": "1.3.15-alpha.4", "@budibase/types": "1.3.15-alpha.4", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index ba66cab653..eb5c016317 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.3": - version "1.3.15-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.3.tgz#d7727555829511ac0abc5a95f791067bf7e316d5" - integrity sha512-4buol+Dz4oLOnwij/SepNV4tP1o2HGIPGUxnWYH4idLpnDFeNXLPZ+eh0Kmj3sEmkKm/Yb5MNcPl2gr+62Grfw== +"@budibase/backend-core@1.3.15-alpha.4": + version "1.3.15-alpha.4" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.4.tgz#842a82753ee31537e5c603632bffe871d5921f10" + integrity sha512-1w8cYVfkHAVj3BwdNrbNcTSugFhljPPgdRJIou5uTg8x3teF1yFo8uvH4yhHxO3mRbMC4FPq5kJzOn9mflvx6w== dependencies: - "@budibase/types" "1.3.15-alpha.3" + "@budibase/types" "1.3.15-alpha.4" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -326,21 +326,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.3.15-alpha.3": - version "1.3.15-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.3.tgz#d062351202f544bdfd11e1364dd36791c156e7be" - integrity sha512-6ndItwEEZxOgJayIqawbG6VYOO49hrlP1UrWAAW+X7ykFCZNi4KC4Qaa4AFaF6PRttvMHfvtjQ3Mlc9fr2CCmA== +"@budibase/pro@1.3.15-alpha.4": + version "1.3.15-alpha.4" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.4.tgz#c5959556d48b03874dafc45e6a4c75d85d0414d6" + integrity sha512-HXJgS8iku1kmBSc5XIJfRCDWpL1IDS7bJFDqA99gT7jMOD0xino9KH1gn2kN7RYhfBSOSVHVBHMOfuUJES4Fwg== dependencies: - "@budibase/backend-core" "1.3.15-alpha.3" - "@budibase/types" "1.3.15-alpha.3" + "@budibase/backend-core" "1.3.15-alpha.4" + "@budibase/types" "1.3.15-alpha.4" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.3.15-alpha.3": - version "1.3.15-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.3.tgz#d4fb023e68c0980b8cb54305a5ab31c5c34a20ee" - integrity sha512-geAkfvu1zaA0tf2Rn+sGnKTrZ9J9UkzqtrqffLKNVHdlWrOfCGrLtOufjFo5H7CfTMG/1ysvmSb4QaU/dPf3Ag== +"@budibase/types@1.3.15-alpha.4": + version "1.3.15-alpha.4" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.4.tgz#125f886ced79bad68ef17d945c5c237a6b5b9ff3" + integrity sha512-k/Rq73dzI1jzuLqU4/Zhlt7sRQdsthazCbtm8cYqZWb6HaCUUAK6YdwLUzUGNLwAz4vtZHICng8N2cYyYP4RPw== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 3059e00c776701e0f5367a5c4d85b9c79787c1ff Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 13 Sep 2022 11:44:33 +0100 Subject: [PATCH 233/260] add backend name validation for app creation / update --- packages/server/src/api/routes/application.ts | 15 +++++++++++++-- .../server/src/api/routes/utils/validators.js | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/routes/application.ts b/packages/server/src/api/routes/application.ts index 49ecc2ee6f..0ebdf548e3 100644 --- a/packages/server/src/api/routes/application.ts +++ b/packages/server/src/api/routes/application.ts @@ -2,16 +2,27 @@ import Router from "@koa/router" import * as controller from "../controllers/application" import authorized from "../../middleware/authorized" import { BUILDER } from "@budibase/backend-core/permissions" +import { applicationValidator } from "./utils/validators" const router = new Router() router .post("/api/applications/:appId/sync", authorized(BUILDER), controller.sync) - .post("/api/applications", authorized(BUILDER), controller.create) + .post( + "/api/applications", + authorized(BUILDER), + applicationValidator(), + controller.create + ) .get("/api/applications/:appId/definition", controller.fetchAppDefinition) .get("/api/applications", controller.fetch) .get("/api/applications/:appId/appPackage", controller.fetchAppPackage) - .put("/api/applications/:appId", authorized(BUILDER), controller.update) + .put( + "/api/applications/:appId", + authorized(BUILDER), + applicationValidator(), + controller.update + ) .post( "/api/applications/:appId/client/update", authorized(BUILDER), diff --git a/packages/server/src/api/routes/utils/validators.js b/packages/server/src/api/routes/utils/validators.js index b43eea9e36..000c9655bc 100644 --- a/packages/server/src/api/routes/utils/validators.js +++ b/packages/server/src/api/routes/utils/validators.js @@ -10,6 +10,7 @@ const Joi = require("joi") const OPTIONAL_STRING = Joi.string().optional().allow(null).allow("") const OPTIONAL_NUMBER = Joi.number().optional().allow(null) const OPTIONAL_BOOLEAN = Joi.boolean().optional().allow(null) +const APP_NAME_REGEX = /^[\w\s]+$/ exports.tableValidator = () => { // prettier-ignore @@ -214,7 +215,7 @@ exports.applicationValidator = () => { return joiValidator.body(Joi.object({ _id: OPTIONAL_STRING, _rev: OPTIONAL_STRING, - name: Joi.string().required(), + name: Joi.string().pattern(new RegExp(APP_NAME_REGEX)).required().error(new Error('App name must be letters, numbers and spaces only')), url: OPTIONAL_STRING, template: Joi.object({ templateString: OPTIONAL_STRING, From 416a2c999f76196534b75ba3c1de042bfbed765a Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 13 Sep 2022 12:16:00 +0100 Subject: [PATCH 234/260] Fixing issue with plugin import for datasources - extract the integration correctly. --- packages/server/src/integrations/index.ts | 7 ++++++- packages/server/src/utilities/fileSystem/index.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/server/src/integrations/index.ts b/packages/server/src/integrations/index.ts index 007b7e91e6..000ab65a33 100644 --- a/packages/server/src/integrations/index.ts +++ b/packages/server/src/integrations/index.ts @@ -94,11 +94,16 @@ module.exports = { for (let plugin of plugins) { if (plugin.name === integration) { // need to use commonJS require due to its dynamic runtime nature - return getDatasourcePlugin( + const retrieved: any = await getDatasourcePlugin( plugin.name, plugin.jsUrl, plugin.schema?.hash ) + if (retrieved.integration) { + return retrieved.integration + } else { + return retrieved + } } } } diff --git a/packages/server/src/utilities/fileSystem/index.js b/packages/server/src/utilities/fileSystem/index.js index 40cc456356..1001cdcdb1 100644 --- a/packages/server/src/utilities/fileSystem/index.js +++ b/packages/server/src/utilities/fileSystem/index.js @@ -415,7 +415,7 @@ exports.getDatasourcePlugin = async (name, url, hash) => { const content = await response.text() fs.writeFileSync(filename, content) fs.writeFileSync(metadataName, hash) - require(filename) + return require(filename) } else { throw new Error( `Unable to retrieve plugin - reason: ${await response.text()}` From 9ee5d2b0d0db4ef120743fc39daee69437224eb8 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 13 Sep 2022 11:27:21 +0000 Subject: [PATCH 235/260] v1.3.15-alpha.5 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lerna.json b/lerna.json index 526b8fad06..91817f6b3e 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.15-alpha.4", + "version": "1.3.15-alpha.5", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index a256fb0b67..f6cb47bc8b 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.3.15-alpha.4", + "version": "1.3.15-alpha.5", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "1.3.15-alpha.4", + "@budibase/types": "1.3.15-alpha.5", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 4843f9985d..3d09ad9ba0 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.3.15-alpha.4", + "version": "1.3.15-alpha.5", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "1.3.15-alpha.4", + "@budibase/string-templates": "1.3.15-alpha.5", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 3027393181..0110889593 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.3.15-alpha.4", + "version": "1.3.15-alpha.5", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.4", - "@budibase/client": "1.3.15-alpha.4", - "@budibase/frontend-core": "1.3.15-alpha.4", - "@budibase/string-templates": "1.3.15-alpha.4", + "@budibase/bbui": "1.3.15-alpha.5", + "@budibase/client": "1.3.15-alpha.5", + "@budibase/frontend-core": "1.3.15-alpha.5", + "@budibase/string-templates": "1.3.15-alpha.5", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index ab1663ae1a..06fc5181a8 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.3.15-alpha.4", + "version": "1.3.15-alpha.5", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.4", - "@budibase/string-templates": "1.3.15-alpha.4", - "@budibase/types": "1.3.15-alpha.4", + "@budibase/backend-core": "1.3.15-alpha.5", + "@budibase/string-templates": "1.3.15-alpha.5", + "@budibase/types": "1.3.15-alpha.5", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index dd81b5b667..b98db72be4 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.3.15-alpha.4", + "version": "1.3.15-alpha.5", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.4", - "@budibase/frontend-core": "1.3.15-alpha.4", - "@budibase/string-templates": "1.3.15-alpha.4", + "@budibase/bbui": "1.3.15-alpha.5", + "@budibase/frontend-core": "1.3.15-alpha.5", + "@budibase/string-templates": "1.3.15-alpha.5", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 062807e6f3..703faeda4f 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.3.15-alpha.4", + "version": "1.3.15-alpha.5", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "1.3.15-alpha.4", + "@budibase/bbui": "1.3.15-alpha.5", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 6134e6d329..19b4229a78 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.3.15-alpha.4", + "version": "1.3.15-alpha.5", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "1.3.15-alpha.4", - "@budibase/client": "1.3.15-alpha.4", + "@budibase/backend-core": "1.3.15-alpha.5", + "@budibase/client": "1.3.15-alpha.5", "@budibase/pro": "1.3.15-alpha.4", - "@budibase/string-templates": "1.3.15-alpha.4", - "@budibase/types": "1.3.15-alpha.4", + "@budibase/string-templates": "1.3.15-alpha.5", + "@budibase/types": "1.3.15-alpha.5", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 21829db0a9..5638428f37 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.3.15-alpha.4", + "version": "1.3.15-alpha.5", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 11fb341a73..28189ce35e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.3.15-alpha.4", + "version": "1.3.15-alpha.5", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index e77d1d9ef4..eb9d70994f 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.3.15-alpha.4", + "version": "1.3.15-alpha.5", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.4", + "@budibase/backend-core": "1.3.15-alpha.5", "@budibase/pro": "1.3.15-alpha.4", - "@budibase/string-templates": "1.3.15-alpha.4", - "@budibase/types": "1.3.15-alpha.4", + "@budibase/string-templates": "1.3.15-alpha.5", + "@budibase/types": "1.3.15-alpha.5", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From d29a53d73aee44699158a60121146473ce7364c4 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 13 Sep 2022 11:30:40 +0000 Subject: [PATCH 236/260] Update pro version to 1.3.15-alpha.5 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 19b4229a78..83cee17797 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "1.3.15-alpha.5", "@budibase/client": "1.3.15-alpha.5", - "@budibase/pro": "1.3.15-alpha.4", + "@budibase/pro": "1.3.15-alpha.5", "@budibase/string-templates": "1.3.15-alpha.5", "@budibase/types": "1.3.15-alpha.5", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index fbc204b9b9..6775646a4e 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.4": - version "1.3.15-alpha.4" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.4.tgz#842a82753ee31537e5c603632bffe871d5921f10" - integrity sha512-1w8cYVfkHAVj3BwdNrbNcTSugFhljPPgdRJIou5uTg8x3teF1yFo8uvH4yhHxO3mRbMC4FPq5kJzOn9mflvx6w== +"@budibase/backend-core@1.3.15-alpha.5": + version "1.3.15-alpha.5" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.5.tgz#667233d65d6e2811ef97b77608770bd8def53670" + integrity sha512-bPt1wFQDbrcsrMsUPXqwNoe8mNgwZqnD4eDUmnKocUIy6EZJDiGoQ6qHz+y1NGZR/SORrP/QdFCsBPw1oixGfA== dependencies: - "@budibase/types" "1.3.15-alpha.4" + "@budibase/types" "1.3.15-alpha.5" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1179,13 +1179,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.3.15-alpha.4": - version "1.3.15-alpha.4" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.4.tgz#c5959556d48b03874dafc45e6a4c75d85d0414d6" - integrity sha512-HXJgS8iku1kmBSc5XIJfRCDWpL1IDS7bJFDqA99gT7jMOD0xino9KH1gn2kN7RYhfBSOSVHVBHMOfuUJES4Fwg== +"@budibase/pro@1.3.15-alpha.5": + version "1.3.15-alpha.5" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.5.tgz#6faad4cead27c65bfb52cbf9cda3bc55618e8c66" + integrity sha512-czMMfxM8p+toG18C++2qu2V1qiluwYGvij/v3gJFPu/HMEM3pD/eng84M2AgPCQTJunkknCFoi0fy/N9nIa4KQ== dependencies: - "@budibase/backend-core" "1.3.15-alpha.4" - "@budibase/types" "1.3.15-alpha.4" + "@budibase/backend-core" "1.3.15-alpha.5" + "@budibase/types" "1.3.15-alpha.5" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1208,10 +1208,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.3.15-alpha.4": - version "1.3.15-alpha.4" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.4.tgz#125f886ced79bad68ef17d945c5c237a6b5b9ff3" - integrity sha512-k/Rq73dzI1jzuLqU4/Zhlt7sRQdsthazCbtm8cYqZWb6HaCUUAK6YdwLUzUGNLwAz4vtZHICng8N2cYyYP4RPw== +"@budibase/types@1.3.15-alpha.5": + version "1.3.15-alpha.5" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.5.tgz#fa5da711f8b026e1dd4edcc38e0d40e2d4a76352" + integrity sha512-H8JCIKIGS/ybrogPuZtu49vhI/oMZ8dqRIBoRx1evxtehV7BEkHeDSSduHsX/qsUtpfw1ZyPb6aWO6RHLbRSFg== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index eb9d70994f..de305f7a33 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "1.3.15-alpha.5", - "@budibase/pro": "1.3.15-alpha.4", + "@budibase/pro": "1.3.15-alpha.5", "@budibase/string-templates": "1.3.15-alpha.5", "@budibase/types": "1.3.15-alpha.5", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index eb5c016317..e203e05b19 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.4": - version "1.3.15-alpha.4" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.4.tgz#842a82753ee31537e5c603632bffe871d5921f10" - integrity sha512-1w8cYVfkHAVj3BwdNrbNcTSugFhljPPgdRJIou5uTg8x3teF1yFo8uvH4yhHxO3mRbMC4FPq5kJzOn9mflvx6w== +"@budibase/backend-core@1.3.15-alpha.5": + version "1.3.15-alpha.5" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.5.tgz#667233d65d6e2811ef97b77608770bd8def53670" + integrity sha512-bPt1wFQDbrcsrMsUPXqwNoe8mNgwZqnD4eDUmnKocUIy6EZJDiGoQ6qHz+y1NGZR/SORrP/QdFCsBPw1oixGfA== dependencies: - "@budibase/types" "1.3.15-alpha.4" + "@budibase/types" "1.3.15-alpha.5" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -326,21 +326,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.3.15-alpha.4": - version "1.3.15-alpha.4" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.4.tgz#c5959556d48b03874dafc45e6a4c75d85d0414d6" - integrity sha512-HXJgS8iku1kmBSc5XIJfRCDWpL1IDS7bJFDqA99gT7jMOD0xino9KH1gn2kN7RYhfBSOSVHVBHMOfuUJES4Fwg== +"@budibase/pro@1.3.15-alpha.5": + version "1.3.15-alpha.5" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.5.tgz#6faad4cead27c65bfb52cbf9cda3bc55618e8c66" + integrity sha512-czMMfxM8p+toG18C++2qu2V1qiluwYGvij/v3gJFPu/HMEM3pD/eng84M2AgPCQTJunkknCFoi0fy/N9nIa4KQ== dependencies: - "@budibase/backend-core" "1.3.15-alpha.4" - "@budibase/types" "1.3.15-alpha.4" + "@budibase/backend-core" "1.3.15-alpha.5" + "@budibase/types" "1.3.15-alpha.5" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.3.15-alpha.4": - version "1.3.15-alpha.4" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.4.tgz#125f886ced79bad68ef17d945c5c237a6b5b9ff3" - integrity sha512-k/Rq73dzI1jzuLqU4/Zhlt7sRQdsthazCbtm8cYqZWb6HaCUUAK6YdwLUzUGNLwAz4vtZHICng8N2cYyYP4RPw== +"@budibase/types@1.3.15-alpha.5": + version "1.3.15-alpha.5" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.5.tgz#fa5da711f8b026e1dd4edcc38e0d40e2d4a76352" + integrity sha512-H8JCIKIGS/ybrogPuZtu49vhI/oMZ8dqRIBoRx1evxtehV7BEkHeDSSduHsX/qsUtpfw1ZyPb6aWO6RHLbRSFg== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From f38856431d7f9350c03fda51be74351339ae792a Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 13 Sep 2022 17:11:37 +0100 Subject: [PATCH 237/260] fix issue with date range filtering in automations --- packages/frontend-core/src/utils/lucene.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/frontend-core/src/utils/lucene.js b/packages/frontend-core/src/utils/lucene.js index 9ed5df3895..65e472b0c2 100644 --- a/packages/frontend-core/src/utils/lucene.js +++ b/packages/frontend-core/src/utils/lucene.js @@ -108,7 +108,7 @@ export const buildLuceneQuery = filter => { query.allOr = true return } - if (type === "datetime") { + if (type === "datetime" && !isHbs) { // Ensure date value is a valid date and parse into correct format if (!value) { return @@ -218,6 +218,7 @@ export const runLuceneQuery = (docs, query) => { // Process a range match const rangeMatch = match("range", (docValue, testValue) => { + console.log("test") return ( docValue == null || docValue === "" || From 5c5e1b10b49736160ecead44eab4051944957164 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 13 Sep 2022 18:00:10 +0100 Subject: [PATCH 238/260] Fixing CLI build - prebuilds required for hashing can be disabled via environment variable. --- packages/backend-core/package.json | 1 + packages/backend-core/src/environment.ts | 1 + packages/backend-core/src/hashing.js | 2 +- packages/cli/src/environment.js | 1 + packages/cli/src/prebuilds.js | 5 ++++- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index f6cb47bc8b..f1c4b2d28f 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -25,6 +25,7 @@ "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", + "bcryptjs": "2.4.3", "dotenv": "16.0.1", "emitter-listener": "1.1.2", "ioredis": "4.28.0", diff --git a/packages/backend-core/src/environment.ts b/packages/backend-core/src/environment.ts index 04d09d2eb7..b979635fcc 100644 --- a/packages/backend-core/src/environment.ts +++ b/packages/backend-core/src/environment.ts @@ -19,6 +19,7 @@ if (!LOADED && isDev() && !isTest()) { const env = { isTest, isDev, + JS_BCRYPT: process.env.JS_BCRYPT, JWT_SECRET: process.env.JWT_SECRET, COUCH_DB_URL: process.env.COUCH_DB_URL || "http://localhost:4005", COUCH_DB_USERNAME: process.env.COUCH_DB_USER, diff --git a/packages/backend-core/src/hashing.js b/packages/backend-core/src/hashing.js index 45abe2f9bd..7524e66043 100644 --- a/packages/backend-core/src/hashing.js +++ b/packages/backend-core/src/hashing.js @@ -1,5 +1,5 @@ -const bcrypt = require("bcrypt") const env = require("./environment") +const bcrypt = env.JS_BCRYPT ? require("bcryptjs") : require("bcrypt") const { v4 } = require("uuid") const SALT_ROUNDS = env.SALT_ROUNDS || 10 diff --git a/packages/cli/src/environment.js b/packages/cli/src/environment.js index a42eceb07e..c8c8fe87e9 100644 --- a/packages/cli/src/environment.js +++ b/packages/cli/src/environment.js @@ -1 +1,2 @@ process.env.NO_JS = "1" +process.env.JS_BCRYPT = "1" diff --git a/packages/cli/src/prebuilds.js b/packages/cli/src/prebuilds.js index b582b090e7..0decdc6c63 100644 --- a/packages/cli/src/prebuilds.js +++ b/packages/cli/src/prebuilds.js @@ -27,7 +27,10 @@ function checkForBinaries() { } function cleanup(evt) { - if (evt && evt.errno) { + if (!isNaN(evt)) { + return + } + if (evt) { console.error( error( "Failed to run CLI command - please report with the following message:" From 95f7bbd05be02d72ecb41229afb65eb9114ffe54 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 13 Sep 2022 18:22:15 +0100 Subject: [PATCH 239/260] Adding an option to disable top level parent directory creation during CLI plugin init incase using this for git repo creation. --- packages/cli/src/plugins/index.js | 19 +++++++++++++++++-- packages/cli/src/utils.js | 17 +++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/plugins/index.js b/packages/cli/src/plugins/index.js index 714187df56..bc105ed77b 100644 --- a/packages/cli/src/plugins/index.js +++ b/packages/cli/src/plugins/index.js @@ -7,7 +7,7 @@ const { PLUGIN_TYPE_ARR } = require("@budibase/types") const { validate } = require("@budibase/backend-core/plugins") const { runPkgCommand } = require("../exec") const { join } = require("path") -const { success, error, info } = require("../utils") +const { success, error, info, moveDirectory } = require("../utils") function checkInPlugin() { if (!fs.existsSync("package.json")) { @@ -45,13 +45,28 @@ async function init(opts) { `An amazing Budibase ${type}!` ) const version = await questions.string("Version", "1.0.0") + console.log( + info(`By default the plugin will be created in the directory "${name}"`) + ) + console.log( + info( + "if you are already in an empty directory, such as a new Git repo, you can disable this functionality." + ) + ) + const topLevel = await questions.confirmation("Create top level directory?") // get the skeleton console.log(info("Retrieving project...")) await getSkeleton(type, name) await fleshOutSkeleton(type, name, desc, version) console.log(info("Installing dependencies...")) await runPkgCommand("install", join(process.cwd(), name)) - console.log(info(`Plugin created in directory "${name}"`)) + // if no parent directory desired move to cwd + if (!topLevel) { + moveDirectory(name, process.cwd()) + console.log(info(`Plugin created in current directory.`)) + } else { + console.log(info(`Plugin created in directory "${name}"`)) + } } async function verify() { diff --git a/packages/cli/src/utils.js b/packages/cli/src/utils.js index 818153ef02..81520708d8 100644 --- a/packages/cli/src/utils.js +++ b/packages/cli/src/utils.js @@ -3,6 +3,7 @@ const fs = require("fs") const axios = require("axios") const path = require("path") const progress = require("cli-progress") +const { join } = require("path") exports.downloadFile = async (url, filePath) => { filePath = path.resolve(filePath) @@ -67,3 +68,19 @@ exports.progressBar = total => { exports.checkSlashesInUrl = url => { return url.replace(/(https?:\/\/)|(\/)+/g, "$1$2") } + +exports.moveDirectory = (oldPath, newPath) => { + const files = fs.readdirSync(oldPath) + // check any file exists already + for (let file of files) { + if (fs.existsSync(file)) { + throw new Error( + "Unable to remove top level directory - some skeleton files already exist." + ) + } + } + for (let file of files) { + fs.renameSync(join(oldPath, file), join(newPath, file)) + } + fs.rmdirSync(oldPath) +} From 4621f2d83087571a56b0d6b26d11a8fa11e3a5e2 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 13 Sep 2022 18:28:03 +0100 Subject: [PATCH 240/260] Defaulting behaviour for empty git repos. --- packages/cli/src/plugins/index.js | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/packages/cli/src/plugins/index.js b/packages/cli/src/plugins/index.js index bc105ed77b..3f712c7e75 100644 --- a/packages/cli/src/plugins/index.js +++ b/packages/cli/src/plugins/index.js @@ -22,6 +22,24 @@ function checkInPlugin() { } } +async function askAboutTopLevel() { + const files = fs.readdirSync(process.cwd()) + // we are in an empty git repo, don't ask + if (files.length === 1 && files[0] === ".git") { + return false + } else { + console.log( + info(`By default the plugin will be created in the directory "${name}"`) + ) + console.log( + info( + "if you are already in an empty directory, such as a new Git repo, you can disable this functionality." + ) + ) + return questions.confirmation("Create top level directory?") + } +} + async function init(opts) { const type = opts["init"] || opts if (!type || !PLUGIN_TYPE_ARR.includes(type)) { @@ -45,15 +63,7 @@ async function init(opts) { `An amazing Budibase ${type}!` ) const version = await questions.string("Version", "1.0.0") - console.log( - info(`By default the plugin will be created in the directory "${name}"`) - ) - console.log( - info( - "if you are already in an empty directory, such as a new Git repo, you can disable this functionality." - ) - ) - const topLevel = await questions.confirmation("Create top level directory?") + const topLevel = await askAboutTopLevel() // get the skeleton console.log(info("Retrieving project...")) await getSkeleton(type, name) From d2a91bcbebcf817ec11330d813f1bfef67d9293d Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 14 Sep 2022 10:14:17 +0100 Subject: [PATCH 241/260] Allow component plugins in cloud --- packages/server/src/api/controllers/plugin/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/controllers/plugin/index.ts b/packages/server/src/api/controllers/plugin/index.ts index 99a9e7db66..4f842b7708 100644 --- a/packages/server/src/api/controllers/plugin/index.ts +++ b/packages/server/src/api/controllers/plugin/index.ts @@ -197,10 +197,12 @@ export async function storePlugin( } export async function processPlugin(plugin: FileType, source?: string) { - if (!env.SELF_HOSTED) { - throw new Error("Plugins not supported outside of self-host.") + const { metadata, directory } = await fileUpload(plugin) + + // Only allow components in cloud + if (!env.SELF_HOSTED && metadata?.schema?.type !== PluginType.COMPONENT) { + throw new Error("Only component plugins are supported outside of self-host") } - const { metadata, directory } = await fileUpload(plugin) return await storePlugin(metadata, directory, source) } From 60b153809d1e8b660df179b140aa77ed521945bd Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 14 Sep 2022 09:52:46 +0000 Subject: [PATCH 242/260] v1.3.15-alpha.6 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lerna.json b/lerna.json index 91817f6b3e..9c733ae4a8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.15-alpha.5", + "version": "1.3.15-alpha.6", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index f6cb47bc8b..0ab10bea31 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.3.15-alpha.5", + "version": "1.3.15-alpha.6", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "1.3.15-alpha.5", + "@budibase/types": "1.3.15-alpha.6", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 3d09ad9ba0..6cdfe259c6 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.3.15-alpha.5", + "version": "1.3.15-alpha.6", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "1.3.15-alpha.5", + "@budibase/string-templates": "1.3.15-alpha.6", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 0110889593..98cd06d768 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.3.15-alpha.5", + "version": "1.3.15-alpha.6", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.5", - "@budibase/client": "1.3.15-alpha.5", - "@budibase/frontend-core": "1.3.15-alpha.5", - "@budibase/string-templates": "1.3.15-alpha.5", + "@budibase/bbui": "1.3.15-alpha.6", + "@budibase/client": "1.3.15-alpha.6", + "@budibase/frontend-core": "1.3.15-alpha.6", + "@budibase/string-templates": "1.3.15-alpha.6", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 06fc5181a8..073f2f826d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.3.15-alpha.5", + "version": "1.3.15-alpha.6", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.5", - "@budibase/string-templates": "1.3.15-alpha.5", - "@budibase/types": "1.3.15-alpha.5", + "@budibase/backend-core": "1.3.15-alpha.6", + "@budibase/string-templates": "1.3.15-alpha.6", + "@budibase/types": "1.3.15-alpha.6", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index b98db72be4..51da64940a 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.3.15-alpha.5", + "version": "1.3.15-alpha.6", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.5", - "@budibase/frontend-core": "1.3.15-alpha.5", - "@budibase/string-templates": "1.3.15-alpha.5", + "@budibase/bbui": "1.3.15-alpha.6", + "@budibase/frontend-core": "1.3.15-alpha.6", + "@budibase/string-templates": "1.3.15-alpha.6", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 703faeda4f..f5b4c307e2 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.3.15-alpha.5", + "version": "1.3.15-alpha.6", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "1.3.15-alpha.5", + "@budibase/bbui": "1.3.15-alpha.6", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 83cee17797..4a7e21c84b 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.3.15-alpha.5", + "version": "1.3.15-alpha.6", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "1.3.15-alpha.5", - "@budibase/client": "1.3.15-alpha.5", + "@budibase/backend-core": "1.3.15-alpha.6", + "@budibase/client": "1.3.15-alpha.6", "@budibase/pro": "1.3.15-alpha.5", - "@budibase/string-templates": "1.3.15-alpha.5", - "@budibase/types": "1.3.15-alpha.5", + "@budibase/string-templates": "1.3.15-alpha.6", + "@budibase/types": "1.3.15-alpha.6", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 5638428f37..22fa31128a 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.3.15-alpha.5", + "version": "1.3.15-alpha.6", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 28189ce35e..f128abd8c3 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.3.15-alpha.5", + "version": "1.3.15-alpha.6", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index de305f7a33..1de4541369 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.3.15-alpha.5", + "version": "1.3.15-alpha.6", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.5", + "@budibase/backend-core": "1.3.15-alpha.6", "@budibase/pro": "1.3.15-alpha.5", - "@budibase/string-templates": "1.3.15-alpha.5", - "@budibase/types": "1.3.15-alpha.5", + "@budibase/string-templates": "1.3.15-alpha.6", + "@budibase/types": "1.3.15-alpha.6", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From f9b333623951489bc9debe033436cfd0814703dc Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 14 Sep 2022 09:55:53 +0000 Subject: [PATCH 243/260] Update pro version to 1.3.15-alpha.6 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 4a7e21c84b..95a10872cb 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "1.3.15-alpha.6", "@budibase/client": "1.3.15-alpha.6", - "@budibase/pro": "1.3.15-alpha.5", + "@budibase/pro": "1.3.15-alpha.6", "@budibase/string-templates": "1.3.15-alpha.6", "@budibase/types": "1.3.15-alpha.6", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 6775646a4e..b360239419 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.5": - version "1.3.15-alpha.5" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.5.tgz#667233d65d6e2811ef97b77608770bd8def53670" - integrity sha512-bPt1wFQDbrcsrMsUPXqwNoe8mNgwZqnD4eDUmnKocUIy6EZJDiGoQ6qHz+y1NGZR/SORrP/QdFCsBPw1oixGfA== +"@budibase/backend-core@1.3.15-alpha.6": + version "1.3.15-alpha.6" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.6.tgz#c540ee4fcb9ef6fa61ea34724766ffe46aa0a04b" + integrity sha512-IuA1M+Fk8RGckQG8eivM7R90QO9V/Pexnww7WE2YvWozKR2HGmlLhyAmr+oydNksU6iGQnG++aWpDKHmKmEweQ== dependencies: - "@budibase/types" "1.3.15-alpha.5" + "@budibase/types" "1.3.15-alpha.6" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1179,13 +1179,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.3.15-alpha.5": - version "1.3.15-alpha.5" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.5.tgz#6faad4cead27c65bfb52cbf9cda3bc55618e8c66" - integrity sha512-czMMfxM8p+toG18C++2qu2V1qiluwYGvij/v3gJFPu/HMEM3pD/eng84M2AgPCQTJunkknCFoi0fy/N9nIa4KQ== +"@budibase/pro@1.3.15-alpha.6": + version "1.3.15-alpha.6" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.6.tgz#9bc14bec005357cf173b865f740cf3c7756cfb13" + integrity sha512-C+TYR0Jv6o/N3vclf1xHUfPTFOJID9ujjVbU+SPvgTtwTTjrRIKJ5IzTm9ijCE7f7N7m1328tkW8XTTyXomb1g== dependencies: - "@budibase/backend-core" "1.3.15-alpha.5" - "@budibase/types" "1.3.15-alpha.5" + "@budibase/backend-core" "1.3.15-alpha.6" + "@budibase/types" "1.3.15-alpha.6" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1208,10 +1208,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.3.15-alpha.5": - version "1.3.15-alpha.5" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.5.tgz#fa5da711f8b026e1dd4edcc38e0d40e2d4a76352" - integrity sha512-H8JCIKIGS/ybrogPuZtu49vhI/oMZ8dqRIBoRx1evxtehV7BEkHeDSSduHsX/qsUtpfw1ZyPb6aWO6RHLbRSFg== +"@budibase/types@1.3.15-alpha.6": + version "1.3.15-alpha.6" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.6.tgz#52f93873283fc586a97db1048a0f4da0099ad842" + integrity sha512-/eY96Zp2J3uXJ9sJgH92LnrieisFhuH2f6pB0WV5xOo/6gavxewAzioze+vAVwHTuQpetYvYpqM9LaovB6gWxg== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 1de4541369..d48bdad159 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "1.3.15-alpha.6", - "@budibase/pro": "1.3.15-alpha.5", + "@budibase/pro": "1.3.15-alpha.6", "@budibase/string-templates": "1.3.15-alpha.6", "@budibase/types": "1.3.15-alpha.6", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index e203e05b19..30ce3f27b8 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.5": - version "1.3.15-alpha.5" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.5.tgz#667233d65d6e2811ef97b77608770bd8def53670" - integrity sha512-bPt1wFQDbrcsrMsUPXqwNoe8mNgwZqnD4eDUmnKocUIy6EZJDiGoQ6qHz+y1NGZR/SORrP/QdFCsBPw1oixGfA== +"@budibase/backend-core@1.3.15-alpha.6": + version "1.3.15-alpha.6" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.6.tgz#c540ee4fcb9ef6fa61ea34724766ffe46aa0a04b" + integrity sha512-IuA1M+Fk8RGckQG8eivM7R90QO9V/Pexnww7WE2YvWozKR2HGmlLhyAmr+oydNksU6iGQnG++aWpDKHmKmEweQ== dependencies: - "@budibase/types" "1.3.15-alpha.5" + "@budibase/types" "1.3.15-alpha.6" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -326,21 +326,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.3.15-alpha.5": - version "1.3.15-alpha.5" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.5.tgz#6faad4cead27c65bfb52cbf9cda3bc55618e8c66" - integrity sha512-czMMfxM8p+toG18C++2qu2V1qiluwYGvij/v3gJFPu/HMEM3pD/eng84M2AgPCQTJunkknCFoi0fy/N9nIa4KQ== +"@budibase/pro@1.3.15-alpha.6": + version "1.3.15-alpha.6" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.6.tgz#9bc14bec005357cf173b865f740cf3c7756cfb13" + integrity sha512-C+TYR0Jv6o/N3vclf1xHUfPTFOJID9ujjVbU+SPvgTtwTTjrRIKJ5IzTm9ijCE7f7N7m1328tkW8XTTyXomb1g== dependencies: - "@budibase/backend-core" "1.3.15-alpha.5" - "@budibase/types" "1.3.15-alpha.5" + "@budibase/backend-core" "1.3.15-alpha.6" + "@budibase/types" "1.3.15-alpha.6" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.3.15-alpha.5": - version "1.3.15-alpha.5" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.5.tgz#fa5da711f8b026e1dd4edcc38e0d40e2d4a76352" - integrity sha512-H8JCIKIGS/ybrogPuZtu49vhI/oMZ8dqRIBoRx1evxtehV7BEkHeDSSduHsX/qsUtpfw1ZyPb6aWO6RHLbRSFg== +"@budibase/types@1.3.15-alpha.6": + version "1.3.15-alpha.6" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.6.tgz#52f93873283fc586a97db1048a0f4da0099ad842" + integrity sha512-/eY96Zp2J3uXJ9sJgH92LnrieisFhuH2f6pB0WV5xOo/6gavxewAzioze+vAVwHTuQpetYvYpqM9LaovB6gWxg== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 589d1442da04f74e1a30ac178fd10fd2d5784c7d Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 14 Sep 2022 10:58:01 +0100 Subject: [PATCH 244/260] Fixes from PR comments. --- packages/cli/src/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/src/utils.js b/packages/cli/src/utils.js index 81520708d8..91f3263cc1 100644 --- a/packages/cli/src/utils.js +++ b/packages/cli/src/utils.js @@ -73,7 +73,7 @@ exports.moveDirectory = (oldPath, newPath) => { const files = fs.readdirSync(oldPath) // check any file exists already for (let file of files) { - if (fs.existsSync(file)) { + if (fs.existsSync(join(newPath, file))) { throw new Error( "Unable to remove top level directory - some skeleton files already exist." ) From d67dcd78a62abffe37f38e900332ee1a2ef54062 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 14 Sep 2022 11:04:37 +0100 Subject: [PATCH 245/260] Fixing a minor issue with plugin name not being passed through in CLI function. --- packages/cli/src/plugins/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/plugins/index.js b/packages/cli/src/plugins/index.js index 3f712c7e75..7525e9d2b1 100644 --- a/packages/cli/src/plugins/index.js +++ b/packages/cli/src/plugins/index.js @@ -22,7 +22,7 @@ function checkInPlugin() { } } -async function askAboutTopLevel() { +async function askAboutTopLevel(name) { const files = fs.readdirSync(process.cwd()) // we are in an empty git repo, don't ask if (files.length === 1 && files[0] === ".git") { @@ -63,7 +63,7 @@ async function init(opts) { `An amazing Budibase ${type}!` ) const version = await questions.string("Version", "1.0.0") - const topLevel = await askAboutTopLevel() + const topLevel = await askAboutTopLevel(name) // get the skeleton console.log(info("Retrieving project...")) await getSkeleton(type, name) From e469ee6fe812dab489366f2b9475902401f152f5 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 14 Sep 2022 11:11:20 +0100 Subject: [PATCH 246/260] Adding better controls for .git checking. --- packages/cli/src/plugins/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/src/plugins/index.js b/packages/cli/src/plugins/index.js index 7525e9d2b1..d184c6e70a 100644 --- a/packages/cli/src/plugins/index.js +++ b/packages/cli/src/plugins/index.js @@ -25,7 +25,7 @@ function checkInPlugin() { async function askAboutTopLevel(name) { const files = fs.readdirSync(process.cwd()) // we are in an empty git repo, don't ask - if (files.length === 1 && files[0] === ".git") { + if (files.find(file => file === ".git")) { return false } else { console.log( From 449fa7b14b8eb461359e4aea8ed8de4db35ced02 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 14 Sep 2022 11:19:09 +0100 Subject: [PATCH 247/260] remove uneeded log --- packages/frontend-core/src/utils/lucene.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/frontend-core/src/utils/lucene.js b/packages/frontend-core/src/utils/lucene.js index 65e472b0c2..33099e9f6b 100644 --- a/packages/frontend-core/src/utils/lucene.js +++ b/packages/frontend-core/src/utils/lucene.js @@ -218,7 +218,6 @@ export const runLuceneQuery = (docs, query) => { // Process a range match const rangeMatch = match("range", (docValue, testValue) => { - console.log("test") return ( docValue == null || docValue === "" || From ac4e502bf9ccb3bf8afdd0f5c2f5c016684e0f03 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 14 Sep 2022 10:56:15 +0000 Subject: [PATCH 248/260] v1.3.15-alpha.7 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lerna.json b/lerna.json index 9c733ae4a8..6b8eaa45b2 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.15-alpha.6", + "version": "1.3.15-alpha.7", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index fb35285297..627cd16f8c 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.3.15-alpha.6", + "version": "1.3.15-alpha.7", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "1.3.15-alpha.6", + "@budibase/types": "1.3.15-alpha.7", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 6cdfe259c6..da52ae0084 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.3.15-alpha.6", + "version": "1.3.15-alpha.7", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "1.3.15-alpha.6", + "@budibase/string-templates": "1.3.15-alpha.7", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 98cd06d768..33ad9c46a8 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.3.15-alpha.6", + "version": "1.3.15-alpha.7", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.6", - "@budibase/client": "1.3.15-alpha.6", - "@budibase/frontend-core": "1.3.15-alpha.6", - "@budibase/string-templates": "1.3.15-alpha.6", + "@budibase/bbui": "1.3.15-alpha.7", + "@budibase/client": "1.3.15-alpha.7", + "@budibase/frontend-core": "1.3.15-alpha.7", + "@budibase/string-templates": "1.3.15-alpha.7", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 073f2f826d..341cc8604a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.3.15-alpha.6", + "version": "1.3.15-alpha.7", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.6", - "@budibase/string-templates": "1.3.15-alpha.6", - "@budibase/types": "1.3.15-alpha.6", + "@budibase/backend-core": "1.3.15-alpha.7", + "@budibase/string-templates": "1.3.15-alpha.7", + "@budibase/types": "1.3.15-alpha.7", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 51da64940a..dad087808b 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.3.15-alpha.6", + "version": "1.3.15-alpha.7", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.6", - "@budibase/frontend-core": "1.3.15-alpha.6", - "@budibase/string-templates": "1.3.15-alpha.6", + "@budibase/bbui": "1.3.15-alpha.7", + "@budibase/frontend-core": "1.3.15-alpha.7", + "@budibase/string-templates": "1.3.15-alpha.7", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index f5b4c307e2..c51dc4dc05 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.3.15-alpha.6", + "version": "1.3.15-alpha.7", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "1.3.15-alpha.6", + "@budibase/bbui": "1.3.15-alpha.7", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 95a10872cb..6c138b66a3 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.3.15-alpha.6", + "version": "1.3.15-alpha.7", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "1.3.15-alpha.6", - "@budibase/client": "1.3.15-alpha.6", + "@budibase/backend-core": "1.3.15-alpha.7", + "@budibase/client": "1.3.15-alpha.7", "@budibase/pro": "1.3.15-alpha.6", - "@budibase/string-templates": "1.3.15-alpha.6", - "@budibase/types": "1.3.15-alpha.6", + "@budibase/string-templates": "1.3.15-alpha.7", + "@budibase/types": "1.3.15-alpha.7", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 22fa31128a..b294b95d8a 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.3.15-alpha.6", + "version": "1.3.15-alpha.7", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index f128abd8c3..0b195ba541 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.3.15-alpha.6", + "version": "1.3.15-alpha.7", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index d48bdad159..1f419e2a21 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.3.15-alpha.6", + "version": "1.3.15-alpha.7", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.6", + "@budibase/backend-core": "1.3.15-alpha.7", "@budibase/pro": "1.3.15-alpha.6", - "@budibase/string-templates": "1.3.15-alpha.6", - "@budibase/types": "1.3.15-alpha.6", + "@budibase/string-templates": "1.3.15-alpha.7", + "@budibase/types": "1.3.15-alpha.7", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 64ee1677e6563ff068712a6ee72f3cd370bb4211 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 14 Sep 2022 11:58:59 +0100 Subject: [PATCH 249/260] Add validation to plugins uploaded using file upload and allow component uploads via non-file sources in cloud --- packages/server/src/api/controllers/plugin/index.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/server/src/api/controllers/plugin/index.ts b/packages/server/src/api/controllers/plugin/index.ts index 4f842b7708..0cd074e16b 100644 --- a/packages/server/src/api/controllers/plugin/index.ts +++ b/packages/server/src/api/controllers/plugin/index.ts @@ -53,10 +53,6 @@ export async function upload(ctx: any) { export async function create(ctx: any) { const { source, url, headers, githubToken } = ctx.request.body - if (!env.SELF_HOSTED) { - ctx.throw(400, "Plugins not supported outside of self-host.") - } - try { let metadata let directory @@ -87,6 +83,13 @@ export async function create(ctx: any) { validate(metadata?.schema) + // Only allow components in cloud + if (!env.SELF_HOSTED && metadata?.schema?.type !== PluginType.COMPONENT) { + throw new Error( + "Only component plugins are supported outside of self-host" + ) + } + const doc = await storePlugin(metadata, directory, source) ctx.body = { @@ -198,6 +201,7 @@ export async function storePlugin( export async function processPlugin(plugin: FileType, source?: string) { const { metadata, directory } = await fileUpload(plugin) + validate(metadata?.schema) // Only allow components in cloud if (!env.SELF_HOSTED && metadata?.schema?.type !== PluginType.COMPONENT) { From 0a73f46a592b0bdbdcf5ed284679f2d0be2a67f0 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 14 Sep 2022 10:59:40 +0000 Subject: [PATCH 250/260] Update pro version to 1.3.15-alpha.7 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 31 ++++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 31 ++++++++++++++++--------------- 4 files changed, 34 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 6c138b66a3..fbda6c9649 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "1.3.15-alpha.7", "@budibase/client": "1.3.15-alpha.7", - "@budibase/pro": "1.3.15-alpha.6", + "@budibase/pro": "1.3.15-alpha.7", "@budibase/string-templates": "1.3.15-alpha.7", "@budibase/types": "1.3.15-alpha.7", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index b360239419..180833b456 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,16 +1094,17 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.6": - version "1.3.15-alpha.6" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.6.tgz#c540ee4fcb9ef6fa61ea34724766ffe46aa0a04b" - integrity sha512-IuA1M+Fk8RGckQG8eivM7R90QO9V/Pexnww7WE2YvWozKR2HGmlLhyAmr+oydNksU6iGQnG++aWpDKHmKmEweQ== +"@budibase/backend-core@1.3.15-alpha.7": + version "1.3.15-alpha.7" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.7.tgz#322e842c9371c807f89b71ee2aed4ab4479b6d27" + integrity sha512-eymmLjHhEzBQEztmVRqLpAw4YzZ4xDBAtA1lnJ50AZs/ZlHE+W4BR6LX2jGvIhYK2QDGbNQtXDzkut+0Sacj0w== dependencies: - "@budibase/types" "1.3.15-alpha.6" + "@budibase/types" "1.3.15-alpha.7" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" + bcryptjs "2.4.3" dotenv "16.0.1" emitter-listener "1.1.2" ioredis "4.28.0" @@ -1179,13 +1180,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.3.15-alpha.6": - version "1.3.15-alpha.6" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.6.tgz#9bc14bec005357cf173b865f740cf3c7756cfb13" - integrity sha512-C+TYR0Jv6o/N3vclf1xHUfPTFOJID9ujjVbU+SPvgTtwTTjrRIKJ5IzTm9ijCE7f7N7m1328tkW8XTTyXomb1g== +"@budibase/pro@1.3.15-alpha.7": + version "1.3.15-alpha.7" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.7.tgz#3743a26fb99d58070c8ab2741ee912a4d973baf7" + integrity sha512-RerlV0A6wSU3mSOtY5ET4WR5Qaga1WNfUeG8Lqzx3z09vC23YuB0qvpadpKoUKUanzCyprrU4zBrLED8973stQ== dependencies: - "@budibase/backend-core" "1.3.15-alpha.6" - "@budibase/types" "1.3.15-alpha.6" + "@budibase/backend-core" "1.3.15-alpha.7" + "@budibase/types" "1.3.15-alpha.7" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1208,10 +1209,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.3.15-alpha.6": - version "1.3.15-alpha.6" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.6.tgz#52f93873283fc586a97db1048a0f4da0099ad842" - integrity sha512-/eY96Zp2J3uXJ9sJgH92LnrieisFhuH2f6pB0WV5xOo/6gavxewAzioze+vAVwHTuQpetYvYpqM9LaovB6gWxg== +"@budibase/types@1.3.15-alpha.7": + version "1.3.15-alpha.7" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.7.tgz#c69a38194786ea66a2c6137aa961292902472ee9" + integrity sha512-9XW5Qr0FxXRO5rC1SlwS8dcDDPYGEG5+tJcrQ0gzk+5uzQfYIB/crhB0z++9vAwkBEm09XKbjBvdf4w5haEi2w== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 1f419e2a21..1d5967b14e 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "1.3.15-alpha.7", - "@budibase/pro": "1.3.15-alpha.6", + "@budibase/pro": "1.3.15-alpha.7", "@budibase/string-templates": "1.3.15-alpha.7", "@budibase/types": "1.3.15-alpha.7", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 30ce3f27b8..dc60272795 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,16 +291,17 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.6": - version "1.3.15-alpha.6" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.6.tgz#c540ee4fcb9ef6fa61ea34724766ffe46aa0a04b" - integrity sha512-IuA1M+Fk8RGckQG8eivM7R90QO9V/Pexnww7WE2YvWozKR2HGmlLhyAmr+oydNksU6iGQnG++aWpDKHmKmEweQ== +"@budibase/backend-core@1.3.15-alpha.7": + version "1.3.15-alpha.7" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.7.tgz#322e842c9371c807f89b71ee2aed4ab4479b6d27" + integrity sha512-eymmLjHhEzBQEztmVRqLpAw4YzZ4xDBAtA1lnJ50AZs/ZlHE+W4BR6LX2jGvIhYK2QDGbNQtXDzkut+0Sacj0w== dependencies: - "@budibase/types" "1.3.15-alpha.6" + "@budibase/types" "1.3.15-alpha.7" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" + bcryptjs "2.4.3" dotenv "16.0.1" emitter-listener "1.1.2" ioredis "4.28.0" @@ -326,21 +327,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.3.15-alpha.6": - version "1.3.15-alpha.6" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.6.tgz#9bc14bec005357cf173b865f740cf3c7756cfb13" - integrity sha512-C+TYR0Jv6o/N3vclf1xHUfPTFOJID9ujjVbU+SPvgTtwTTjrRIKJ5IzTm9ijCE7f7N7m1328tkW8XTTyXomb1g== +"@budibase/pro@1.3.15-alpha.7": + version "1.3.15-alpha.7" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.7.tgz#3743a26fb99d58070c8ab2741ee912a4d973baf7" + integrity sha512-RerlV0A6wSU3mSOtY5ET4WR5Qaga1WNfUeG8Lqzx3z09vC23YuB0qvpadpKoUKUanzCyprrU4zBrLED8973stQ== dependencies: - "@budibase/backend-core" "1.3.15-alpha.6" - "@budibase/types" "1.3.15-alpha.6" + "@budibase/backend-core" "1.3.15-alpha.7" + "@budibase/types" "1.3.15-alpha.7" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.3.15-alpha.6": - version "1.3.15-alpha.6" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.6.tgz#52f93873283fc586a97db1048a0f4da0099ad842" - integrity sha512-/eY96Zp2J3uXJ9sJgH92LnrieisFhuH2f6pB0WV5xOo/6gavxewAzioze+vAVwHTuQpetYvYpqM9LaovB6gWxg== +"@budibase/types@1.3.15-alpha.7": + version "1.3.15-alpha.7" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.7.tgz#c69a38194786ea66a2c6137aa961292902472ee9" + integrity sha512-9XW5Qr0FxXRO5rC1SlwS8dcDDPYGEG5+tJcrQ0gzk+5uzQfYIB/crhB0z++9vAwkBEm09XKbjBvdf4w5haEi2w== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From c1b0e126af883e5c54f3564f935789fe6651c9b0 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 14 Sep 2022 12:01:49 +0100 Subject: [PATCH 251/260] Allow custom components in cloud --- .../server/src/api/controllers/component.js | 37 +++++++++---------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/packages/server/src/api/controllers/component.js b/packages/server/src/api/controllers/component.js index a0db34c9b8..86a0b1938f 100644 --- a/packages/server/src/api/controllers/component.js +++ b/packages/server/src/api/controllers/component.js @@ -33,26 +33,23 @@ exports.fetchAppComponentDefinitions = async function (ctx) { } } - // for now custom components only supported in self-host - if (env.SELF_HOSTED) { - // Add custom components - const globalDB = getGlobalDB() - const response = await globalDB.allDocs( - getPluginParams(null, { - include_docs: true, - }) - ) - response.rows - .map(row => row.doc) - .filter(plugin => plugin.schema.type === "component") - .forEach(plugin => { - const fullComponentName = `plugin/${plugin.name}` - definitions[fullComponentName] = { - component: fullComponentName, - ...plugin.schema.schema, - } - }) - } + // Add custom components + const globalDB = getGlobalDB() + const response = await globalDB.allDocs( + getPluginParams(null, { + include_docs: true, + }) + ) + response.rows + .map(row => row.doc) + .filter(plugin => plugin.schema.type === "component") + .forEach(plugin => { + const fullComponentName = `plugin/${plugin.name}` + definitions[fullComponentName] = { + component: fullComponentName, + ...plugin.schema.schema, + } + }) ctx.body = definitions } catch (err) { From 8744d0a86c086265fc10aa6a98734fa4bfb26c8f Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 14 Sep 2022 12:11:20 +0100 Subject: [PATCH 252/260] Renaming data source -> datasource as per Mel's request. --- README.md | 2 +- examples/nextjs-api-sales/definitions/openapi.ts | 6 +++--- .../cypress/integration/autoScreensUI.spec.js | 6 +++--- .../cypress/integration/datasources/mySql.spec.js | 10 +++++----- .../cypress/integration/datasources/oracle.spec.js | 14 +++++++------- .../integration/datasources/postgreSql.spec.js | 8 ++++---- .../cypress/integration/datasources/rest.spec.js | 4 ++-- packages/builder/cypress/support/commands.js | 4 ++-- packages/builder/src/builderStore/datasource.js | 2 +- .../DatasourceNavigator/DatasourceNavigator.svelte | 6 +++--- .../modals/CreateDatasourceModal.svelte | 6 +++--- .../ButtonActionEditor/actions/DuplicateRow.svelte | 4 ++-- .../ButtonActionEditor/actions/SaveRow.svelte | 4 ++-- .../screens/_components/DatasourceModal.svelte | 2 +- .../screens/_components/NewScreenModal.svelte | 2 +- .../client/src/components/app/forms/Form.svelte | 2 +- .../src/components/app/forms/InnerForm.svelte | 2 +- packages/client/src/utils/blocks.js | 2 +- packages/server/specs/openapi.json | 6 +++--- packages/server/specs/openapi.yaml | 6 +++--- packages/server/specs/resources/query.js | 2 +- .../server/src/api/controllers/row/external.js | 2 +- packages/server/src/api/routes/public/tables.ts | 2 +- packages/server/src/api/routes/table.js | 2 +- packages/server/src/definitions/openapi.ts | 6 +++--- .../src/tests/utilities/TestConfiguration.js | 2 +- 26 files changed, 57 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index 1dec1737da..bd38610566 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Budibase is open-source - licensed as GPL v3. This should fill you with confiden

### Load data or start from scratch -Budibase pulls in data from multiple sources, including MongoDB, CouchDB, PostgreSQL, MySQL, Airtable, S3, DynamoDB, or a REST API. And unlike other platforms, with Budibase you can start from scratch and create business apps with no data sources. [Request new data sources](https://github.com/Budibase/budibase/discussions?discussions_q=category%3AIdeas). +Budibase pulls in data from multiple sources, including MongoDB, CouchDB, PostgreSQL, MySQL, Airtable, S3, DynamoDB, or a REST API. And unlike other platforms, with Budibase you can start from scratch and create business apps with no datasources. [Request new datasources](https://github.com/Budibase/budibase/discussions?discussions_q=category%3AIdeas).

Budibase data diff --git a/examples/nextjs-api-sales/definitions/openapi.ts b/examples/nextjs-api-sales/definitions/openapi.ts index 4f4ad45fc6..7f7f6befec 100644 --- a/examples/nextjs-api-sales/definitions/openapi.ts +++ b/examples/nextjs-api-sales/definitions/openapi.ts @@ -348,7 +348,7 @@ export interface paths { } } responses: { - /** Returns the created table, including the ID which has been generated for it. This can be internal or external data sources. */ + /** Returns the created table, including the ID which has been generated for it. This can be internal or external datasources. */ 200: { content: { "application/json": components["schemas"]["tableOutput"] @@ -959,7 +959,7 @@ export interface components { query: { /** @description The ID of the query. */ _id: string - /** @description The ID of the data source the query belongs to. */ + /** @description The ID of the datasource the query belongs to. */ datasourceId?: string /** @description The bindings which are required to perform this query. */ parameters?: string[] @@ -983,7 +983,7 @@ export interface components { data: { /** @description The ID of the query. */ _id: string - /** @description The ID of the data source the query belongs to. */ + /** @description The ID of the datasource the query belongs to. */ datasourceId?: string /** @description The bindings which are required to perform this query. */ parameters?: string[] diff --git a/packages/builder/cypress/integration/autoScreensUI.spec.js b/packages/builder/cypress/integration/autoScreensUI.spec.js index 7a5dbef5a5..0253675c5b 100644 --- a/packages/builder/cypress/integration/autoScreensUI.spec.js +++ b/packages/builder/cypress/integration/autoScreensUI.spec.js @@ -82,10 +82,10 @@ filterTests(['smoke', 'all'], () => { }) if (Cypress.env("TEST_ENV")) { - it("should generate data source screens", () => { - // Using MySQL data source for testing this + it("should generate datasource screens", () => { + // Using MySQL datasource for testing this const datasource = "MySQL" - // Select & configure MySQL data source + // Select & configure MySQL datasource cy.selectExternalDatasource(datasource) cy.addDatasourceConfig(datasource) // Create Autogenerated screens from a MySQL table - MySQL contains books table diff --git a/packages/builder/cypress/integration/datasources/mySql.spec.js b/packages/builder/cypress/integration/datasources/mySql.spec.js index 654705a24e..33aa72f0bb 100644 --- a/packages/builder/cypress/integration/datasources/mySql.spec.js +++ b/packages/builder/cypress/integration/datasources/mySql.spec.js @@ -11,8 +11,8 @@ filterTests(["all"], () => { const queryName = "Cypress Test Query" const queryRename = "CT Query Rename" - it("Should add MySQL data source without configuration", () => { - // Select MySQL data source + it("Should add MySQL datasource without configuration", () => { + // Select MySQL datasource cy.selectExternalDatasource(datasource) // Attempt to fetch tables without applying configuration cy.intercept("**/datasources").as("datasource") @@ -35,8 +35,8 @@ filterTests(["all"], () => { cy.get(".spectrum-Button").contains("Skip table fetch").click({ force: true }) }) - it("should add MySQL data source and fetch tables", () => { - // Add & configure MySQL data source + it("should add MySQL datasource and fetch tables", () => { + // Add & configure MySQL datasource cy.selectExternalDatasource(datasource) cy.intercept("**/datasources").as("datasource") cy.addDatasourceConfig(datasource) @@ -52,7 +52,7 @@ filterTests(["all"], () => { }) it("should check table fetching error", () => { - // MySQL test data source contains tables without primary keys + // MySQL test datasource contains tables without primary keys cy.get(".spectrum-InLineAlert") .should("contain", "Error fetching tables") .and("contain", "No primary key constraint found") diff --git a/packages/builder/cypress/integration/datasources/oracle.spec.js b/packages/builder/cypress/integration/datasources/oracle.spec.js index 5d92d6b217..ae1ca5cd75 100644 --- a/packages/builder/cypress/integration/datasources/oracle.spec.js +++ b/packages/builder/cypress/integration/datasources/oracle.spec.js @@ -11,8 +11,8 @@ filterTests(["all"], () => { const queryName = "Cypress Test Query" const queryRename = "CT Query Rename" - it("Should add Oracle data source and skip table fetch", () => { - // Select Oracle data source + it("Should add Oracle datasource and skip table fetch", () => { + // Select Oracle datasource cy.selectExternalDatasource(datasource) // Skip table fetch - no config added cy.get(".spectrum-Button") @@ -23,7 +23,7 @@ filterTests(["all"], () => { cy.get(".spectrum-Textfield-input", { timeout: 500 }) .eq(1) .should("have.value", "localhost") - // Add another Oracle data source, configure & skip table fetch + // Add another Oracle datasource, configure & skip table fetch cy.selectExternalDatasource(datasource) cy.addDatasourceConfig(datasource, true) // Confirm config and no tables @@ -33,8 +33,8 @@ filterTests(["all"], () => { cy.get(".spectrum-Body").eq(2).should("contain", "No tables found.") }) - it("Should add Oracle data source and fetch tables without configuration", () => { - // Select Oracle data source + it("Should add Oracle datasource and fetch tables without configuration", () => { + // Select Oracle datasource cy.selectExternalDatasource(datasource) // Attempt to fetch tables without applying configuration cy.intercept("**/datasources").as("datasource") @@ -49,8 +49,8 @@ filterTests(["all"], () => { cy.get(".spectrum-Button").contains("Skip table fetch").click({ force: true }) }) - xit("should add Oracle data source and fetch tables", () => { - // Add & configure Oracle data source + xit("should add Oracle datasource and fetch tables", () => { + // Add & configure Oracle datasource cy.selectExternalDatasource(datasource) cy.intercept("**/datasources").as("datasource") cy.addDatasourceConfig(datasource) diff --git a/packages/builder/cypress/integration/datasources/postgreSql.spec.js b/packages/builder/cypress/integration/datasources/postgreSql.spec.js index 622c3ade73..8ef574566e 100644 --- a/packages/builder/cypress/integration/datasources/postgreSql.spec.js +++ b/packages/builder/cypress/integration/datasources/postgreSql.spec.js @@ -11,8 +11,8 @@ filterTests(["all"], () => { const queryName = "Cypress Test Query" const queryRename = "CT Query Rename" - xit("Should add PostgreSQL data source without configuration", () => { - // Select PostgreSQL data source + xit("Should add PostgreSQL datasource without configuration", () => { + // Select PostgreSQL datasource cy.selectExternalDatasource(datasource) // Attempt to fetch tables without applying configuration cy.intercept("**/datasources").as("datasource") @@ -27,8 +27,8 @@ filterTests(["all"], () => { cy.get(".spectrum-Button").contains("Skip table fetch").click({ force: true }) }) - it("should add PostgreSQL data source and fetch tables", () => { - // Add & configure PostgreSQL data source + it("should add PostgreSQL datasource and fetch tables", () => { + // Add & configure PostgreSQL datasource cy.selectExternalDatasource(datasource) cy.intercept("**/datasources").as("datasource") cy.addDatasourceConfig(datasource) diff --git a/packages/builder/cypress/integration/datasources/rest.spec.js b/packages/builder/cypress/integration/datasources/rest.spec.js index 7a145049e2..ec9864a47d 100644 --- a/packages/builder/cypress/integration/datasources/rest.spec.js +++ b/packages/builder/cypress/integration/datasources/rest.spec.js @@ -10,8 +10,8 @@ filterTests(["smoke", "all"], () => { const datasource = "REST" const restUrl = "https://api.openbrewerydb.org/breweries" - it("Should add REST data source with incorrect API", () => { - // Select REST data source + it("Should add REST datasource with incorrect API", () => { + // Select REST datasource cy.selectExternalDatasource(datasource) // Enter incorrect api & attempt to send query cy.get(".query-buttons", { timeout: 1000 }).contains("Add query").click({ force: true }) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index a07a22188f..53accfbbe4 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -763,7 +763,7 @@ Cypress.Commands.add("navigateToDataSection", () => { }) Cypress.Commands.add("navigateToAutogeneratedModal", () => { - // Screen name must already exist within data source + // Screen name must already exist within datasource cy.contains("Design").click() cy.get(".spectrum-Button").contains("Add screen").click({ force: true }) cy.get(".spectrum-Modal").within(() => { @@ -779,7 +779,7 @@ Cypress.Commands.add("navigateToAutogeneratedModal", () => { Cypress.Commands.add("selectExternalDatasource", datasourceName => { // Navigates to Data Section cy.navigateToDataSection() - // Open Data Source modal + // Open Datasource modal cy.get(".nav").within(() => { cy.get(".add-button").click() }) diff --git a/packages/builder/src/builderStore/datasource.js b/packages/builder/src/builderStore/datasource.js index 84edcdd6ad..e12b318e1c 100644 --- a/packages/builder/src/builderStore/datasource.js +++ b/packages/builder/src/builderStore/datasource.js @@ -27,7 +27,7 @@ export async function saveDatasource(config, skipFetch = false) { // Create datasource const resp = await datasources.save(datasource, !skipFetch && datasource.plus) - // update the tables incase data source plus + // update the tables incase datasource plus await tables.fetch() await datasources.select(resp._id) return resp diff --git a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte index 6235e52916..19946a2386 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte @@ -32,8 +32,8 @@ : [] $: openDataSource = enrichedDataSources.find(x => x.open) $: { - // Ensure the open data source is always included in the list of open - // data sources + // Ensure the open datasource is always included in the list of open + // datasources if (openDataSource) { openNode(openDataSource) } @@ -79,7 +79,7 @@ }) const containsActiveEntity = datasource => { - // If we're view a query then the data source ID is in the URL + // If we're view a query then the datasource ID is in the URL if ($params.selectedDatasource === datasource._id) { return true } diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte index 1c9d3c76a8..40ef294339 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte @@ -126,7 +126,7 @@ - Connect to an external data source + Connect to an external datasource

{#each Object.entries(integrations).filter(([key, val]) => key !== IntegrationTypes.INTERNAL && !val.custom) as [integrationType, schema]} 0} - Custom data source + Custom datasource
{#each customIntegrations as [integrationType, schema]} - Choose the data source that provides the row you would like to duplicate. + Choose the datasource that provides the row you would like to duplicate.
You can always add or override fields manually.
- + - Select which data source you would like to use to create your screens + Select which datasource you would like to use to create your screens {#each filteredSources as datasource} diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/NewScreenModal.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/NewScreenModal.svelte index e2d66a80c0..04e0cc242a 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/NewScreenModal.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/NewScreenModal.svelte @@ -66,7 +66,7 @@ Autogenerated screens Add autogenerated screens with CRUD functionality to get a working - app quickly! (Requires a data source) + app quickly! (Requires a datasource)
diff --git a/packages/client/src/components/app/forms/Form.svelte b/packages/client/src/components/app/forms/Form.svelte index 320fc712aa..26922ff312 100644 --- a/packages/client/src/components/app/forms/Form.svelte +++ b/packages/client/src/components/app/forms/Form.svelte @@ -41,7 +41,7 @@ if (["user", "url"].includes(context.closestComponentId)) { return {} } - // Always inherit the closest data source + // Always inherit the closest datasource const closestContext = context[`${context.closestComponentId}`] || {} return closestContext || {} } diff --git a/packages/client/src/components/app/forms/InnerForm.svelte b/packages/client/src/components/app/forms/InnerForm.svelte index 05178ecfd7..3b33ef1868 100644 --- a/packages/client/src/components/app/forms/InnerForm.svelte +++ b/packages/client/src/components/app/forms/InnerForm.svelte @@ -372,7 +372,7 @@ formState, formApi, - // Data source is needed by attachment fields to be able to upload files + // Datasource is needed by attachment fields to be able to upload files // to the correct table ID dataSource, }) diff --git a/packages/client/src/utils/blocks.js b/packages/client/src/utils/blocks.js index 3b97544238..61cd640bbc 100644 --- a/packages/client/src/utils/blocks.js +++ b/packages/client/src/utils/blocks.js @@ -13,7 +13,7 @@ const schemaComponentMap = { /** * Determine data types for search fields and only use those that are valid * @param searchColumns the search columns to use - * @param schema the data source schema + * @param schema the datasource schema */ export const enrichSearchColumns = (searchColumns, schema) => { let enrichedColumns = [] diff --git a/packages/server/specs/openapi.json b/packages/server/specs/openapi.json index ed58c12525..97c0fa9551 100644 --- a/packages/server/specs/openapi.json +++ b/packages/server/specs/openapi.json @@ -1327,7 +1327,7 @@ "type": "string" }, "datasourceId": { - "description": "The ID of the data source the query belongs to.", + "description": "The ID of the datasource the query belongs to.", "type": "string" }, "parameters": { @@ -1386,7 +1386,7 @@ "type": "string" }, "datasourceId": { - "description": "The ID of the data source the query belongs to.", + "description": "The ID of the datasource the query belongs to.", "type": "string" }, "parameters": { @@ -2289,7 +2289,7 @@ }, "responses": { "200": { - "description": "Returns the created table, including the ID which has been generated for it. This can be internal or external data sources.", + "description": "Returns the created table, including the ID which has been generated for it. This can be internal or external datasources.", "content": { "application/json": { "schema": { diff --git a/packages/server/specs/openapi.yaml b/packages/server/specs/openapi.yaml index cbc7c1ea53..3bcb893862 100644 --- a/packages/server/specs/openapi.yaml +++ b/packages/server/specs/openapi.yaml @@ -1004,7 +1004,7 @@ components: description: The ID of the query. type: string datasourceId: - description: The ID of the data source the query belongs to. + description: The ID of the datasource the query belongs to. type: string parameters: description: The bindings which are required to perform this query. @@ -1051,7 +1051,7 @@ components: description: The ID of the query. type: string datasourceId: - description: The ID of the data source the query belongs to. + description: The ID of the datasource the query belongs to. type: string parameters: description: The bindings which are required to perform this query. @@ -1665,7 +1665,7 @@ paths: responses: "200": description: Returns the created table, including the ID which has been - generated for it. This can be internal or external data sources. + generated for it. This can be internal or external datasources. content: application/json: schema: diff --git a/packages/server/specs/resources/query.js b/packages/server/specs/resources/query.js index d4a4882fb2..1442e46a04 100644 --- a/packages/server/specs/resources/query.js +++ b/packages/server/specs/resources/query.js @@ -82,7 +82,7 @@ const querySchema = object( type: "string", }, datasourceId: { - description: "The ID of the data source the query belongs to.", + description: "The ID of the datasource the query belongs to.", type: "string", }, parameters: { diff --git a/packages/server/src/api/controllers/row/external.js b/packages/server/src/api/controllers/row/external.js index c9f6aa2f78..fa48106d26 100644 --- a/packages/server/src/api/controllers/row/external.js +++ b/packages/server/src/api/controllers/row/external.js @@ -53,7 +53,7 @@ exports.save = async ctx => { } exports.fetchView = async ctx => { - // there are no views in external data sources, shouldn't ever be called + // there are no views in external datasources, shouldn't ever be called // for now just fetch const split = ctx.params.viewName.split("all_") ctx.params.tableId = split[1] ? split[1] : split[0] diff --git a/packages/server/src/api/routes/public/tables.ts b/packages/server/src/api/routes/public/tables.ts index b57425e08f..7e8ce29ae3 100644 --- a/packages/server/src/api/routes/public/tables.ts +++ b/packages/server/src/api/routes/public/tables.ts @@ -26,7 +26,7 @@ const read = [], * responses: * 200: * description: Returns the created table, including the ID which has been generated for it. This can be - * internal or external data sources. + * internal or external datasources. * content: * application/json: * schema: diff --git a/packages/server/src/api/routes/table.js b/packages/server/src/api/routes/table.js index 5d2378710d..9de36cac72 100644 --- a/packages/server/src/api/routes/table.js +++ b/packages/server/src/api/routes/table.js @@ -55,7 +55,7 @@ router * @apiParam (Body) {string} [_rev] If updating an existing internal table then the revision must also be specified. * @apiParam (Body) {string} type] This should either be "internal" or "external" depending on the table type - * this will default to internal. - * @apiParam (Body) {string} [sourceId] If creating an external table then this should be set to the data source ID. If + * @apiParam (Body) {string} [sourceId] If creating an external table then this should be set to the datasource ID. If * building an internal table this does not need to be set, although it will be returned as "bb_internal". * @apiParam (Body) {string} name The name of the table, this will be used in the UI. To rename the table simply * supply the table structure to this endpoint with the name changed. diff --git a/packages/server/src/definitions/openapi.ts b/packages/server/src/definitions/openapi.ts index 6cc0de2472..486901acad 100644 --- a/packages/server/src/definitions/openapi.ts +++ b/packages/server/src/definitions/openapi.ts @@ -344,7 +344,7 @@ export interface paths { }; }; responses: { - /** Returns the created table, including the ID which has been generated for it. This can be internal or external data sources. */ + /** Returns the created table, including the ID which has been generated for it. This can be internal or external datasources. */ 200: { content: { "application/json": components["schemas"]["tableOutput"]; @@ -965,7 +965,7 @@ export interface components { query: { /** @description The ID of the query. */ _id: string; - /** @description The ID of the data source the query belongs to. */ + /** @description The ID of the datasource the query belongs to. */ datasourceId?: string; /** @description The bindings which are required to perform this query. */ parameters?: string[]; @@ -989,7 +989,7 @@ export interface components { data: { /** @description The ID of the query. */ _id: string; - /** @description The ID of the data source the query belongs to. */ + /** @description The ID of the datasource the query belongs to. */ datasourceId?: string; /** @description The bindings which are required to perform this query. */ parameters?: string[]; diff --git a/packages/server/src/tests/utilities/TestConfiguration.js b/packages/server/src/tests/utilities/TestConfiguration.js index d1dbe59def..38aa84be2d 100644 --- a/packages/server/src/tests/utilities/TestConfiguration.js +++ b/packages/server/src/tests/utilities/TestConfiguration.js @@ -560,7 +560,7 @@ class TestConfiguration { async createQuery(config = null) { if (!this.datasource && !config) { - throw "No data source created for query." + throw "No datasource created for query." } config = config || basicQuery(this.datasource._id) return this._req(config, null, controllers.query.save) From 9e10aac786b35757dddfa615cc92e267ca083400 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 14 Sep 2022 13:15:33 +0100 Subject: [PATCH 253/260] Adding friendly name to plugin screen. --- .../manage/plugins/_components/PluginRow.svelte | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte b/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte index 73a6ebc700..0c82c37e2f 100644 --- a/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte +++ b/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte @@ -20,6 +20,9 @@ ? plugin.schema.schema.icon || "Book" : plugin.schema.schema.icon || "Beaker" + $: friendlyName = + plugin?.schema?.friendlyName || plugin?.schema?.schema?.friendlyName + function pluginDeleted() { if (detailsModal) { detailsModal.hide() @@ -41,6 +44,9 @@ > {plugin.name} + + {friendlyName} +
@@ -65,6 +71,11 @@
+
+ + +
+
Date: Wed, 14 Sep 2022 13:59:54 +0100 Subject: [PATCH 254/260] Minor fix - remove double friendlyname check. --- .../portal/manage/plugins/_components/PluginRow.svelte | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte b/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte index 0c82c37e2f..18390c7fcb 100644 --- a/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte +++ b/packages/builder/src/pages/builder/portal/manage/plugins/_components/PluginRow.svelte @@ -20,8 +20,7 @@ ? plugin.schema.schema.icon || "Book" : plugin.schema.schema.icon || "Beaker" - $: friendlyName = - plugin?.schema?.friendlyName || plugin?.schema?.schema?.friendlyName + $: friendlyName = plugin?.schema?.schema?.friendlyName function pluginDeleted() { if (detailsModal) { @@ -138,7 +137,7 @@ .details-row { display: grid; - grid-template-columns: 60px 1fr; + grid-template-columns: 70px 1fr; grid-gap: var(--spacing-l) var(--spacing-l); align-items: center; } From 70f2130cfc17d01a0f7866933b8bd25f1bd0f73e Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 14 Sep 2022 14:07:00 +0100 Subject: [PATCH 255/260] Fixing linting issue. --- packages/server/src/api/controllers/component.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/server/src/api/controllers/component.js b/packages/server/src/api/controllers/component.js index 86a0b1938f..e949db3042 100644 --- a/packages/server/src/api/controllers/component.js +++ b/packages/server/src/api/controllers/component.js @@ -2,7 +2,6 @@ const { DocumentType, getPluginParams } = require("../../db/utils") const { getComponentLibraryManifest } = require("../../utilities/fileSystem") const { getAppDB } = require("@budibase/backend-core/context") const { getGlobalDB } = require("@budibase/backend-core/tenancy") -const env = require("../../environment") exports.fetchAppComponentDefinitions = async function (ctx) { try { From 1fa2bc193c6c2dd20441523fbab65b3194348586 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 14 Sep 2022 14:35:08 +0100 Subject: [PATCH 256/260] Lint --- packages/server/src/api/controllers/component.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/server/src/api/controllers/component.js b/packages/server/src/api/controllers/component.js index 86a0b1938f..e949db3042 100644 --- a/packages/server/src/api/controllers/component.js +++ b/packages/server/src/api/controllers/component.js @@ -2,7 +2,6 @@ const { DocumentType, getPluginParams } = require("../../db/utils") const { getComponentLibraryManifest } = require("../../utilities/fileSystem") const { getAppDB } = require("@budibase/backend-core/context") const { getGlobalDB } = require("@budibase/backend-core/tenancy") -const env = require("../../environment") exports.fetchAppComponentDefinitions = async function (ctx) { try { From 441851883a14ebd31b8f4a4f231e2874137b049c Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 14 Sep 2022 14:00:26 +0000 Subject: [PATCH 257/260] v1.3.15-alpha.8 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lerna.json b/lerna.json index 6b8eaa45b2..f8b68054e7 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.15-alpha.7", + "version": "1.3.15-alpha.8", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 627cd16f8c..b9cdf99da8 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.3.15-alpha.7", + "version": "1.3.15-alpha.8", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "1.3.15-alpha.7", + "@budibase/types": "1.3.15-alpha.8", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index da52ae0084..af06d0c38c 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.3.15-alpha.7", + "version": "1.3.15-alpha.8", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "1.3.15-alpha.7", + "@budibase/string-templates": "1.3.15-alpha.8", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 33ad9c46a8..ea2db8412c 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.3.15-alpha.7", + "version": "1.3.15-alpha.8", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.7", - "@budibase/client": "1.3.15-alpha.7", - "@budibase/frontend-core": "1.3.15-alpha.7", - "@budibase/string-templates": "1.3.15-alpha.7", + "@budibase/bbui": "1.3.15-alpha.8", + "@budibase/client": "1.3.15-alpha.8", + "@budibase/frontend-core": "1.3.15-alpha.8", + "@budibase/string-templates": "1.3.15-alpha.8", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 341cc8604a..51d940cdaf 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.3.15-alpha.7", + "version": "1.3.15-alpha.8", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.7", - "@budibase/string-templates": "1.3.15-alpha.7", - "@budibase/types": "1.3.15-alpha.7", + "@budibase/backend-core": "1.3.15-alpha.8", + "@budibase/string-templates": "1.3.15-alpha.8", + "@budibase/types": "1.3.15-alpha.8", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index dad087808b..75b11bd879 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.3.15-alpha.7", + "version": "1.3.15-alpha.8", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.7", - "@budibase/frontend-core": "1.3.15-alpha.7", - "@budibase/string-templates": "1.3.15-alpha.7", + "@budibase/bbui": "1.3.15-alpha.8", + "@budibase/frontend-core": "1.3.15-alpha.8", + "@budibase/string-templates": "1.3.15-alpha.8", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index c51dc4dc05..1da7a73d83 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.3.15-alpha.7", + "version": "1.3.15-alpha.8", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "1.3.15-alpha.7", + "@budibase/bbui": "1.3.15-alpha.8", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index fbda6c9649..93bc91ca5c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.3.15-alpha.7", + "version": "1.3.15-alpha.8", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "1.3.15-alpha.7", - "@budibase/client": "1.3.15-alpha.7", + "@budibase/backend-core": "1.3.15-alpha.8", + "@budibase/client": "1.3.15-alpha.8", "@budibase/pro": "1.3.15-alpha.7", - "@budibase/string-templates": "1.3.15-alpha.7", - "@budibase/types": "1.3.15-alpha.7", + "@budibase/string-templates": "1.3.15-alpha.8", + "@budibase/types": "1.3.15-alpha.8", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index b294b95d8a..d1b65fff06 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.3.15-alpha.7", + "version": "1.3.15-alpha.8", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 0b195ba541..c59f9c005a 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.3.15-alpha.7", + "version": "1.3.15-alpha.8", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 1d5967b14e..4dafc2180c 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.3.15-alpha.7", + "version": "1.3.15-alpha.8", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.7", + "@budibase/backend-core": "1.3.15-alpha.8", "@budibase/pro": "1.3.15-alpha.7", - "@budibase/string-templates": "1.3.15-alpha.7", - "@budibase/types": "1.3.15-alpha.7", + "@budibase/string-templates": "1.3.15-alpha.8", + "@budibase/types": "1.3.15-alpha.8", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 829a20eb69462fcde29f8e81a2351715052b6af0 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 14 Sep 2022 14:03:57 +0000 Subject: [PATCH 258/260] Update pro version to 1.3.15-alpha.8 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 93bc91ca5c..09ac78d9d8 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "1.3.15-alpha.8", "@budibase/client": "1.3.15-alpha.8", - "@budibase/pro": "1.3.15-alpha.7", + "@budibase/pro": "1.3.15-alpha.8", "@budibase/string-templates": "1.3.15-alpha.8", "@budibase/types": "1.3.15-alpha.8", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 180833b456..40985a0376 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.7": - version "1.3.15-alpha.7" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.7.tgz#322e842c9371c807f89b71ee2aed4ab4479b6d27" - integrity sha512-eymmLjHhEzBQEztmVRqLpAw4YzZ4xDBAtA1lnJ50AZs/ZlHE+W4BR6LX2jGvIhYK2QDGbNQtXDzkut+0Sacj0w== +"@budibase/backend-core@1.3.15-alpha.8": + version "1.3.15-alpha.8" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.8.tgz#e4c18550f81fc250fe554e46a376c88d613f97fe" + integrity sha512-Ck2p5nP5lpv7XkowVBxvgVxlAv7ZLWL1d0RePIpTQAjWH+Fmq9RG9vvxfKXVidQ1ej5Sv3PQXItSFBMIkmix+g== dependencies: - "@budibase/types" "1.3.15-alpha.7" + "@budibase/types" "1.3.15-alpha.8" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1180,13 +1180,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.3.15-alpha.7": - version "1.3.15-alpha.7" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.7.tgz#3743a26fb99d58070c8ab2741ee912a4d973baf7" - integrity sha512-RerlV0A6wSU3mSOtY5ET4WR5Qaga1WNfUeG8Lqzx3z09vC23YuB0qvpadpKoUKUanzCyprrU4zBrLED8973stQ== +"@budibase/pro@1.3.15-alpha.8": + version "1.3.15-alpha.8" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.8.tgz#b328d53506751edbf22f4e39b1ca15bd3202b2bc" + integrity sha512-x2gHmaLlBJ01R3Oo3SDza5Xt643IEvNMgA6AjyvAK+dVwfLDKG5eNTRnLuTEGVasJ+xpVFwgZQVsXcbJEaL8hQ== dependencies: - "@budibase/backend-core" "1.3.15-alpha.7" - "@budibase/types" "1.3.15-alpha.7" + "@budibase/backend-core" "1.3.15-alpha.8" + "@budibase/types" "1.3.15-alpha.8" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1209,10 +1209,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.3.15-alpha.7": - version "1.3.15-alpha.7" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.7.tgz#c69a38194786ea66a2c6137aa961292902472ee9" - integrity sha512-9XW5Qr0FxXRO5rC1SlwS8dcDDPYGEG5+tJcrQ0gzk+5uzQfYIB/crhB0z++9vAwkBEm09XKbjBvdf4w5haEi2w== +"@budibase/types@1.3.15-alpha.8": + version "1.3.15-alpha.8" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.8.tgz#046c1bb6c62037a4048d513d4074132599ab5033" + integrity sha512-Z74soj0Tp6x5M+OO+4nqAUSzVkjWmGjDM6y+KTlfGT/Q4Ecq1xz+ftaHNS8f7KdhHZGkjACX4ad/34kdWJdWoQ== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 4dafc2180c..b67369d291 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "1.3.15-alpha.8", - "@budibase/pro": "1.3.15-alpha.7", + "@budibase/pro": "1.3.15-alpha.8", "@budibase/string-templates": "1.3.15-alpha.8", "@budibase/types": "1.3.15-alpha.8", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index dc60272795..f3e768eaad 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.7": - version "1.3.15-alpha.7" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.7.tgz#322e842c9371c807f89b71ee2aed4ab4479b6d27" - integrity sha512-eymmLjHhEzBQEztmVRqLpAw4YzZ4xDBAtA1lnJ50AZs/ZlHE+W4BR6LX2jGvIhYK2QDGbNQtXDzkut+0Sacj0w== +"@budibase/backend-core@1.3.15-alpha.8": + version "1.3.15-alpha.8" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.8.tgz#e4c18550f81fc250fe554e46a376c88d613f97fe" + integrity sha512-Ck2p5nP5lpv7XkowVBxvgVxlAv7ZLWL1d0RePIpTQAjWH+Fmq9RG9vvxfKXVidQ1ej5Sv3PQXItSFBMIkmix+g== dependencies: - "@budibase/types" "1.3.15-alpha.7" + "@budibase/types" "1.3.15-alpha.8" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -327,21 +327,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.3.15-alpha.7": - version "1.3.15-alpha.7" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.7.tgz#3743a26fb99d58070c8ab2741ee912a4d973baf7" - integrity sha512-RerlV0A6wSU3mSOtY5ET4WR5Qaga1WNfUeG8Lqzx3z09vC23YuB0qvpadpKoUKUanzCyprrU4zBrLED8973stQ== +"@budibase/pro@1.3.15-alpha.8": + version "1.3.15-alpha.8" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.8.tgz#b328d53506751edbf22f4e39b1ca15bd3202b2bc" + integrity sha512-x2gHmaLlBJ01R3Oo3SDza5Xt643IEvNMgA6AjyvAK+dVwfLDKG5eNTRnLuTEGVasJ+xpVFwgZQVsXcbJEaL8hQ== dependencies: - "@budibase/backend-core" "1.3.15-alpha.7" - "@budibase/types" "1.3.15-alpha.7" + "@budibase/backend-core" "1.3.15-alpha.8" + "@budibase/types" "1.3.15-alpha.8" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.3.15-alpha.7": - version "1.3.15-alpha.7" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.7.tgz#c69a38194786ea66a2c6137aa961292902472ee9" - integrity sha512-9XW5Qr0FxXRO5rC1SlwS8dcDDPYGEG5+tJcrQ0gzk+5uzQfYIB/crhB0z++9vAwkBEm09XKbjBvdf4w5haEi2w== +"@budibase/types@1.3.15-alpha.8": + version "1.3.15-alpha.8" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.8.tgz#046c1bb6c62037a4048d513d4074132599ab5033" + integrity sha512-Z74soj0Tp6x5M+OO+4nqAUSzVkjWmGjDM6y+KTlfGT/Q4Ecq1xz+ftaHNS8f7KdhHZGkjACX4ad/34kdWJdWoQ== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 5b61a8a3ea8fa238187db8b584ea57b60d5c491c Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 14 Sep 2022 16:58:05 +0000 Subject: [PATCH 259/260] v1.3.15-alpha.9 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lerna.json b/lerna.json index f8b68054e7..ea81293bd9 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.15-alpha.8", + "version": "1.3.15-alpha.9", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index b9cdf99da8..24df48b8f7 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.3.15-alpha.8", + "version": "1.3.15-alpha.9", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "1.3.15-alpha.8", + "@budibase/types": "1.3.15-alpha.9", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index af06d0c38c..c05ea9b038 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.3.15-alpha.8", + "version": "1.3.15-alpha.9", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "1.3.15-alpha.8", + "@budibase/string-templates": "1.3.15-alpha.9", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index ea2db8412c..18e0c56eb1 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.3.15-alpha.8", + "version": "1.3.15-alpha.9", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.8", - "@budibase/client": "1.3.15-alpha.8", - "@budibase/frontend-core": "1.3.15-alpha.8", - "@budibase/string-templates": "1.3.15-alpha.8", + "@budibase/bbui": "1.3.15-alpha.9", + "@budibase/client": "1.3.15-alpha.9", + "@budibase/frontend-core": "1.3.15-alpha.9", + "@budibase/string-templates": "1.3.15-alpha.9", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 51d940cdaf..32c377e842 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.3.15-alpha.8", + "version": "1.3.15-alpha.9", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.8", - "@budibase/string-templates": "1.3.15-alpha.8", - "@budibase/types": "1.3.15-alpha.8", + "@budibase/backend-core": "1.3.15-alpha.9", + "@budibase/string-templates": "1.3.15-alpha.9", + "@budibase/types": "1.3.15-alpha.9", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 75b11bd879..0ed9b93428 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.3.15-alpha.8", + "version": "1.3.15-alpha.9", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "1.3.15-alpha.8", - "@budibase/frontend-core": "1.3.15-alpha.8", - "@budibase/string-templates": "1.3.15-alpha.8", + "@budibase/bbui": "1.3.15-alpha.9", + "@budibase/frontend-core": "1.3.15-alpha.9", + "@budibase/string-templates": "1.3.15-alpha.9", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 1da7a73d83..7c915469b3 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.3.15-alpha.8", + "version": "1.3.15-alpha.9", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "1.3.15-alpha.8", + "@budibase/bbui": "1.3.15-alpha.9", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 09ac78d9d8..a4a7876cbe 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.3.15-alpha.8", + "version": "1.3.15-alpha.9", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "1.3.15-alpha.8", - "@budibase/client": "1.3.15-alpha.8", + "@budibase/backend-core": "1.3.15-alpha.9", + "@budibase/client": "1.3.15-alpha.9", "@budibase/pro": "1.3.15-alpha.8", - "@budibase/string-templates": "1.3.15-alpha.8", - "@budibase/types": "1.3.15-alpha.8", + "@budibase/string-templates": "1.3.15-alpha.9", + "@budibase/types": "1.3.15-alpha.9", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index d1b65fff06..40958b3434 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.3.15-alpha.8", + "version": "1.3.15-alpha.9", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index c59f9c005a..b42417b229 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.3.15-alpha.8", + "version": "1.3.15-alpha.9", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index b67369d291..3e9cd3de37 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.3.15-alpha.8", + "version": "1.3.15-alpha.9", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "1.3.15-alpha.8", + "@budibase/backend-core": "1.3.15-alpha.9", "@budibase/pro": "1.3.15-alpha.8", - "@budibase/string-templates": "1.3.15-alpha.8", - "@budibase/types": "1.3.15-alpha.8", + "@budibase/string-templates": "1.3.15-alpha.9", + "@budibase/types": "1.3.15-alpha.9", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 79e11923355fc166c91feedb1844e6a15727f158 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 14 Sep 2022 17:01:11 +0000 Subject: [PATCH 260/260] Update pro version to 1.3.15-alpha.9 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index a4a7876cbe..f951743347 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "1.3.15-alpha.9", "@budibase/client": "1.3.15-alpha.9", - "@budibase/pro": "1.3.15-alpha.8", + "@budibase/pro": "1.3.15-alpha.9", "@budibase/string-templates": "1.3.15-alpha.9", "@budibase/types": "1.3.15-alpha.9", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 40985a0376..62cc591d47 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.8": - version "1.3.15-alpha.8" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.8.tgz#e4c18550f81fc250fe554e46a376c88d613f97fe" - integrity sha512-Ck2p5nP5lpv7XkowVBxvgVxlAv7ZLWL1d0RePIpTQAjWH+Fmq9RG9vvxfKXVidQ1ej5Sv3PQXItSFBMIkmix+g== +"@budibase/backend-core@1.3.15-alpha.9": + version "1.3.15-alpha.9" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.9.tgz#06c582d1aac93ba689a9738ea35939ccc5bac430" + integrity sha512-uShQQVPE2EsfPY6BNZnl/yKQoR8VwJyiIfCNE/EYl5aIVvhrqva+vA7JeYAs4sf/vf8Y5kkZaJGzfvzEws4dHg== dependencies: - "@budibase/types" "1.3.15-alpha.8" + "@budibase/types" "1.3.15-alpha.9" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1180,13 +1180,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.3.15-alpha.8": - version "1.3.15-alpha.8" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.8.tgz#b328d53506751edbf22f4e39b1ca15bd3202b2bc" - integrity sha512-x2gHmaLlBJ01R3Oo3SDza5Xt643IEvNMgA6AjyvAK+dVwfLDKG5eNTRnLuTEGVasJ+xpVFwgZQVsXcbJEaL8hQ== +"@budibase/pro@1.3.15-alpha.9": + version "1.3.15-alpha.9" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.9.tgz#cb0ab3041df4c412eed9a8c7950f20ca0e3b62c5" + integrity sha512-1eE7O/bYeHxSoG8V61B2OZN3bGD44RAinAFJLHvBK7ncHZSTOOH4fe5HLvFiWPm0gV5ONDHpqr9W5Vs6ZBXukQ== dependencies: - "@budibase/backend-core" "1.3.15-alpha.8" - "@budibase/types" "1.3.15-alpha.8" + "@budibase/backend-core" "1.3.15-alpha.9" + "@budibase/types" "1.3.15-alpha.9" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1209,10 +1209,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.3.15-alpha.8": - version "1.3.15-alpha.8" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.8.tgz#046c1bb6c62037a4048d513d4074132599ab5033" - integrity sha512-Z74soj0Tp6x5M+OO+4nqAUSzVkjWmGjDM6y+KTlfGT/Q4Ecq1xz+ftaHNS8f7KdhHZGkjACX4ad/34kdWJdWoQ== +"@budibase/types@1.3.15-alpha.9": + version "1.3.15-alpha.9" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.9.tgz#443cab0ca757a37af7a45f99caac35643fe273e5" + integrity sha512-r1Z2PLPF3nR/bGzVyZ0/6RcOYb4Csmk4J/b1KJ57wzTeDdsRwgVgGO6QS+XYdwZctsKDNOm9FvpIQj3tNM8Rjw== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 3e9cd3de37..7495d39eeb 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "1.3.15-alpha.9", - "@budibase/pro": "1.3.15-alpha.8", + "@budibase/pro": "1.3.15-alpha.9", "@budibase/string-templates": "1.3.15-alpha.9", "@budibase/types": "1.3.15-alpha.9", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index f3e768eaad..828b02f1b8 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.3.15-alpha.8": - version "1.3.15-alpha.8" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.8.tgz#e4c18550f81fc250fe554e46a376c88d613f97fe" - integrity sha512-Ck2p5nP5lpv7XkowVBxvgVxlAv7ZLWL1d0RePIpTQAjWH+Fmq9RG9vvxfKXVidQ1ej5Sv3PQXItSFBMIkmix+g== +"@budibase/backend-core@1.3.15-alpha.9": + version "1.3.15-alpha.9" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.15-alpha.9.tgz#06c582d1aac93ba689a9738ea35939ccc5bac430" + integrity sha512-uShQQVPE2EsfPY6BNZnl/yKQoR8VwJyiIfCNE/EYl5aIVvhrqva+vA7JeYAs4sf/vf8Y5kkZaJGzfvzEws4dHg== dependencies: - "@budibase/types" "1.3.15-alpha.8" + "@budibase/types" "1.3.15-alpha.9" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -327,21 +327,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.3.15-alpha.8": - version "1.3.15-alpha.8" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.8.tgz#b328d53506751edbf22f4e39b1ca15bd3202b2bc" - integrity sha512-x2gHmaLlBJ01R3Oo3SDza5Xt643IEvNMgA6AjyvAK+dVwfLDKG5eNTRnLuTEGVasJ+xpVFwgZQVsXcbJEaL8hQ== +"@budibase/pro@1.3.15-alpha.9": + version "1.3.15-alpha.9" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.15-alpha.9.tgz#cb0ab3041df4c412eed9a8c7950f20ca0e3b62c5" + integrity sha512-1eE7O/bYeHxSoG8V61B2OZN3bGD44RAinAFJLHvBK7ncHZSTOOH4fe5HLvFiWPm0gV5ONDHpqr9W5Vs6ZBXukQ== dependencies: - "@budibase/backend-core" "1.3.15-alpha.8" - "@budibase/types" "1.3.15-alpha.8" + "@budibase/backend-core" "1.3.15-alpha.9" + "@budibase/types" "1.3.15-alpha.9" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.3.15-alpha.8": - version "1.3.15-alpha.8" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.8.tgz#046c1bb6c62037a4048d513d4074132599ab5033" - integrity sha512-Z74soj0Tp6x5M+OO+4nqAUSzVkjWmGjDM6y+KTlfGT/Q4Ecq1xz+ftaHNS8f7KdhHZGkjACX4ad/34kdWJdWoQ== +"@budibase/types@1.3.15-alpha.9": + version "1.3.15-alpha.9" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.15-alpha.9.tgz#443cab0ca757a37af7a45f99caac35643fe273e5" + integrity sha512-r1Z2PLPF3nR/bGzVyZ0/6RcOYb4Csmk4J/b1KJ57wzTeDdsRwgVgGO6QS+XYdwZctsKDNOm9FvpIQj3tNM8Rjw== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0"