From 0095a9a56642cab494f8a4f8fa2c921f07718da9 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 10 Aug 2022 15:38:08 +0100 Subject: [PATCH 01/23] onEmptyFilter selection for automations --- .../server/src/automations/steps/queryRows.js | 35 +++++++++- .../src/automations/tests/queryRows.spec.js | 69 ++++++++++++++++++- 2 files changed, 101 insertions(+), 3 deletions(-) diff --git a/packages/server/src/automations/steps/queryRows.js b/packages/server/src/automations/steps/queryRows.js index 58e7313dd2..6cd1640b76 100644 --- a/packages/server/src/automations/steps/queryRows.js +++ b/packages/server/src/automations/steps/queryRows.js @@ -14,6 +14,16 @@ const SortOrdersPretty = { [SortOrders.DESCENDING]: "Descending", } +const EmptyFilterOptions = { + RETURN_ALL: "all", + RETURN_NONE: "none", +} + +const EmptyFilterOptionsPretty = { + [EmptyFilterOptions.RETURN_ALL]: "Return all table rows", + [EmptyFilterOptions.RETURN_NONE]: "Return no rows", +} + exports.definition = { description: "Query rows from the database", icon: "Search", @@ -52,6 +62,12 @@ exports.definition = { title: "Limit", customType: "queryLimit", }, + onEmptyFilter: { + pretty: Object.values(EmptyFilterOptionsPretty), + enum: Object.values(EmptyFilterOptions), + type: "string", + title: "When Filter Empty", + }, }, required: ["tableId"], }, @@ -103,6 +119,9 @@ function typeCoercion(filters, table) { return filters } +const hasNullFilters = filters => + filters.length === 0 || filters.some(filter => filter.value === null) + exports.run = async function ({ inputs, appId }) { const { tableId, filters, sortColumn, sortOrder, limit } = inputs const table = await getTable(appId, tableId) @@ -127,9 +146,21 @@ exports.run = async function ({ inputs, appId }) { version: "1", }) try { - await rowController.search(ctx) + let rows + + if ( + inputs.onEmptyFilter === EmptyFilterOptions.RETURN_NONE && + inputs["filters-def"] && + hasNullFilters(inputs["filters-def"]) + ) { + rows = [] + } else { + await rowController.search(ctx) + rows = ctx.body ? ctx.body.rows : [] + } + return { - rows: ctx.body ? ctx.body.rows : [], + rows, success: ctx.status === 200, } } catch (err) { diff --git a/packages/server/src/automations/tests/queryRows.spec.js b/packages/server/src/automations/tests/queryRows.spec.js index ec966302a8..091b95e685 100644 --- a/packages/server/src/automations/tests/queryRows.spec.js +++ b/packages/server/src/automations/tests/queryRows.spec.js @@ -16,7 +16,7 @@ describe("Test a query step automation", () => { let table let config = setup.getConfig() - beforeEach(async () => { + beforeAll(async () => { await config.init() table = await config.createTable() const row = { @@ -48,4 +48,71 @@ describe("Test a query step automation", () => { expect(res.rows.length).toBe(2) expect(res.rows[0].name).toBe(NAME) }) + + it("Returns all rows when onEmptyFilter has no value and no filters are passed", async () => { + console.log(rows) + const inputs = { + tableId: table._id, + filters: {}, + sortColumn: "name", + sortOrder: "ascending", + limit: 10, + } + const res = await setup.runStep(setup.actions.QUERY_ROWS.stepId, inputs) + expect(res.success).toBe(true) + expect(res.rows).toBeDefined() + expect(res.rows.length).toBe(2) + expect(res.rows[0].name).toBe(NAME) + }) + + it("Returns no rows when onEmptyFilter is RETURN_NONE and theres no filters", async () => { + const inputs = { + tableId: table._id, + filters: {}, + "filters-def": [], + sortColumn: "name", + sortOrder: "ascending", + limit: 10, + onEmptyFilter: "none", + } + const res = await setup.runStep(setup.actions.QUERY_ROWS.stepId, inputs) + expect(res.success).toBe(false) + expect(res.rows).toBeDefined() + expect(res.rows.length).toBe(0) + }) + + it("Returns no rows when onEmptyFilters RETURN_NONE and a filter is passed with a null value", async () => { + const inputs = { + tableId: table._id, + onEmptyFilter: "none", + filters: {}, + "filters-def": [ + { + value: null + } + ], + sortColumn: "name", + sortOrder: "ascending", + limit: 10, + } + const res = await setup.runStep(setup.actions.QUERY_ROWS.stepId, inputs) + expect(res.success).toBe(false) + expect(res.rows).toBeDefined() + expect(res.rows.length).toBe(0) + }) + + it("Returns rows when onEmptyFilter is RETURN_ALL and no filter is passed", async () => { + const inputs = { + tableId: table._id, + onEmptyFilter: "all", + filters: {}, + sortColumn: "name", + sortOrder: "ascending", + limit: 10, + } + const res = await setup.runStep(setup.actions.QUERY_ROWS.stepId, inputs) + expect(res.success).toBe(true) + expect(res.rows).toBeDefined() + expect(res.rows.length).toBe(2) + }) }) From dd9740272c0e2a943a0177e7abd8362141a1dca5 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Wed, 10 Aug 2022 16:17:56 +0100 Subject: [PATCH 02/23] Add git fetch --tags to release-selfhost --- .github/workflows/release-selfhost.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-selfhost.yml b/.github/workflows/release-selfhost.yml index 5544a35827..16742ea873 100644 --- a/.github/workflows/release-selfhost.yml +++ b/.github/workflows/release-selfhost.yml @@ -38,7 +38,9 @@ jobs: echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - name: Checkout tag - run: git checkout v${{ env.RELEASE_VERSION }} + run: | + git fetch --tags + git checkout v${{ env.RELEASE_VERSION }} - name: Tag and release Docker images (Self Host) run: | From 25571d7751fefca8ba27d437e237c91efa47199f Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 10 Aug 2022 16:26:10 +0100 Subject: [PATCH 03/23] pr comments --- packages/server/src/automations/steps/queryRows.js | 3 ++- packages/server/src/automations/tests/queryRows.spec.js | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/automations/steps/queryRows.js b/packages/server/src/automations/steps/queryRows.js index 6cd1640b76..b02f31b1ec 100644 --- a/packages/server/src/automations/steps/queryRows.js +++ b/packages/server/src/automations/steps/queryRows.js @@ -120,7 +120,8 @@ function typeCoercion(filters, table) { } const hasNullFilters = filters => - filters.length === 0 || filters.some(filter => filter.value === null) + filters.length === 0 || + filters.some(filter => filter.value === null || filter.value === "") exports.run = async function ({ inputs, appId }) { const { tableId, filters, sortColumn, sortOrder, limit } = inputs diff --git a/packages/server/src/automations/tests/queryRows.spec.js b/packages/server/src/automations/tests/queryRows.spec.js index 091b95e685..1ce7460806 100644 --- a/packages/server/src/automations/tests/queryRows.spec.js +++ b/packages/server/src/automations/tests/queryRows.spec.js @@ -50,7 +50,6 @@ describe("Test a query step automation", () => { }) it("Returns all rows when onEmptyFilter has no value and no filters are passed", async () => { - console.log(rows) const inputs = { tableId: table._id, filters: {}, From 3fc5ede82e5cbd26631db8e5deea82be34ad32af Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Wed, 10 Aug 2022 16:27:53 +0100 Subject: [PATCH 04/23] fixing wrong filter, excluding just bb_internal --- .../controls/ButtonActionEditor/actions/ExecuteQuery.svelte | 6 ++---- packages/builder/src/constants/backend/index.js | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExecuteQuery.svelte b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExecuteQuery.svelte index 042a55d761..e19a975ef9 100644 --- a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExecuteQuery.svelte +++ b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExecuteQuery.svelte @@ -3,7 +3,7 @@ import { datasources, integrations, queries } from "stores/backend" import BindingBuilder from "components/integration/QueryBindingBuilder.svelte" import IntegrationQueryEditor from "components/integration/index.svelte" - import { IntegrationTypes } from "constants/backend" + import { BUDIBASE_DATASOURCE_ID } from "constants/backend" export let parameters export let bindings = [] @@ -14,9 +14,7 @@ ) // Executequery action just works on PostgreSQL and MongoDB datasources $: executeQueryDatasources = $datasources.list.filter( - x => - x.source === IntegrationTypes.POSTGRES || - x.source === IntegrationTypes.MONGODB + x => x._id !== BUDIBASE_DATASOURCE_ID ) function fetchQueryDefinition(query) { diff --git a/packages/builder/src/constants/backend/index.js b/packages/builder/src/constants/backend/index.js index d8d09d592f..28ce35d9f7 100644 --- a/packages/builder/src/constants/backend/index.js +++ b/packages/builder/src/constants/backend/index.js @@ -163,6 +163,8 @@ export const SWITCHABLE_TYPES = [ ...ALLOWABLE_NUMBER_TYPES, ] +export const BUDIBASE_DATASOURCE_ID = "bb_internal" + export const IntegrationTypes = { POSTGRES: "POSTGRES", MONGODB: "MONGODB", From 4a1090c55631777cb70b59680db2e7b19344bdbc Mon Sep 17 00:00:00 2001 From: NEOLPAR Date: Wed, 10 Aug 2022 16:30:26 +0100 Subject: [PATCH 05/23] wrong comment --- .../controls/ButtonActionEditor/actions/ExecuteQuery.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExecuteQuery.svelte b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExecuteQuery.svelte index e19a975ef9..6b9efa76d3 100644 --- a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExecuteQuery.svelte +++ b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExecuteQuery.svelte @@ -12,7 +12,7 @@ $: datasource = $datasources.list.find( ds => ds._id === parameters.datasourceId ) - // Executequery action just works on PostgreSQL and MongoDB datasources + // Executequery must exclude budibase datasource $: executeQueryDatasources = $datasources.list.filter( x => x._id !== BUDIBASE_DATASOURCE_ID ) From 46cc9a8e543c916fc933d3af6dd700084e8d28a7 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 10 Aug 2022 15:36:06 +0000 Subject: [PATCH 06/23] v1.2.33 --- 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 b97375a635..d5f2d8e3e3 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.2.32", + "version": "1.2.33", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 9393178c1c..6f3f84fd1d 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.2.32", + "version": "1.2.33", "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.32", + "@budibase/types": "^1.2.33", "@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 b888587bd1..879192ac9f 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.32", + "version": "1.2.33", "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.32", + "@budibase/string-templates": "^1.2.33", "@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 822d5bea00..b930164f33 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.2.32", + "version": "1.2.33", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.2.32", - "@budibase/client": "^1.2.32", - "@budibase/frontend-core": "^1.2.32", - "@budibase/string-templates": "^1.2.32", + "@budibase/bbui": "^1.2.33", + "@budibase/client": "^1.2.33", + "@budibase/frontend-core": "^1.2.33", + "@budibase/string-templates": "^1.2.33", "@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 62dc3e663a..81173dc74c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.2.32", + "version": "1.2.33", "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 056d5aab79..a1efc6c732 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.2.32", + "version": "1.2.33", "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.32", - "@budibase/frontend-core": "^1.2.32", - "@budibase/string-templates": "^1.2.32", + "@budibase/bbui": "^1.2.33", + "@budibase/frontend-core": "^1.2.33", + "@budibase/string-templates": "^1.2.33", "@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 d5403cf924..df0113d29a 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.2.32", + "version": "1.2.33", "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.32", + "@budibase/bbui": "^1.2.33", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index fb38ab6c78..ef9f81b3fe 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.32", + "version": "1.2.33", "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.32", - "@budibase/client": "^1.2.32", + "@budibase/backend-core": "^1.2.33", + "@budibase/client": "^1.2.33", "@budibase/pro": "1.2.32", - "@budibase/string-templates": "^1.2.32", - "@budibase/types": "^1.2.32", + "@budibase/string-templates": "^1.2.33", + "@budibase/types": "^1.2.33", "@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 493f4bd65b..373d7d3980 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.2.32", + "version": "1.2.33", "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 26b44dc6c9..497fe38c00 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.2.32", + "version": "1.2.33", "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 97e6e8b79f..9d5b71f1eb 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.32", + "version": "1.2.33", "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.32", + "@budibase/backend-core": "^1.2.33", "@budibase/pro": "1.2.32", - "@budibase/string-templates": "^1.2.32", - "@budibase/types": "^1.2.32", + "@budibase/string-templates": "^1.2.33", + "@budibase/types": "^1.2.33", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From fa4abfda76b3c1cb1dbce8bb496a4a0bd327227c Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 10 Aug 2022 15:39:19 +0000 Subject: [PATCH 07/23] Update pro version to 1.2.33 --- 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 ef9f81b3fe..6efa411454 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.33", "@budibase/client": "^1.2.33", - "@budibase/pro": "1.2.32", + "@budibase/pro": "1.2.33", "@budibase/string-templates": "^1.2.33", "@budibase/types": "^1.2.33", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index de2a2dbd2d..157926f39b 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.32": - version "1.2.32" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.32.tgz#4ec9350a0afb3dc096123ff891ec0da0b5ebca24" - integrity sha512-g0kKpByyhpQI+T2tmW3f2alWHB1KRO6jOJLvtHXGQndayRFA3dJZtDyW8Rd4KqfOEztmYUb6mbc0un8KzeMGqw== +"@budibase/backend-core@1.2.33": + version "1.2.33" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.33.tgz#8a08763f2ebb3b21d3c1ce2dfb993da32647681f" + integrity sha512-/CI/8Kacf7I+K5HTT6l3KzrYU7Him4V6e+RRTvv7gRpxmegODZXf1Q0U//OOLOEgpYCuKD8PbtJmSabjMjKI4A== dependencies: - "@budibase/types" "^1.2.32" + "@budibase/types" "^1.2.33" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1177,13 +1177,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.2.32": - version "1.2.32" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.32.tgz#7116f54ee26218a179ad6720c444f238d47bea5e" - integrity sha512-TbwtUT50ErL/346fGiZdK+I3ddlVkP3hOeafa608Z/kuAwiEpBB8XNk8bbJjjpQfPsy1nbqyWNR66FtXcjE/TA== +"@budibase/pro@1.2.33": + version "1.2.33" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.33.tgz#a664e9ddc685329278d0adad11f46c52bea2d4c1" + integrity sha512-AWLxLggpRBsGn3G0pX3W/L7r/4WX9NFZ0REtBKgVOZr5yDmyyBkGxcyaaVYfqp6jHJFrvZEPK+M5pbqHOCDAfQ== dependencies: - "@budibase/backend-core" "1.2.32" - "@budibase/types" "1.2.32" + "@budibase/backend-core" "1.2.33" + "@budibase/types" "1.2.33" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1206,10 +1206,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.2.32", "@budibase/types@^1.2.32": - version "1.2.32" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.32.tgz#121ab38c0a956662673f8ca689f6cc4371e652b3" - integrity sha512-cmcNSUppv2tkM/R+SHt611uh7jmfJRtFzxwMEaceJMRxFuk9d++v3gmNJxf4Q+C9ENi1lvBOw87SLakqaMfCgQ== +"@budibase/types@1.2.33", "@budibase/types@^1.2.33": + version "1.2.33" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.33.tgz#d1b403b4d6a908e106bbc76300b6877a780dfc8f" + integrity sha512-WS26qNH2QlUAAXCbpGLbENtBDLQRBA4VAFSbbW8Mrn3vtMY4fh5btmtM3aY6Qg0O3QICs+W9EuHz9rEzbbfLTw== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 9d5b71f1eb..9313144072 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.33", - "@budibase/pro": "1.2.32", + "@budibase/pro": "1.2.33", "@budibase/string-templates": "^1.2.33", "@budibase/types": "^1.2.33", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index d2c4e0494b..da24d428b3 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.32": - version "1.2.32" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.32.tgz#4ec9350a0afb3dc096123ff891ec0da0b5ebca24" - integrity sha512-g0kKpByyhpQI+T2tmW3f2alWHB1KRO6jOJLvtHXGQndayRFA3dJZtDyW8Rd4KqfOEztmYUb6mbc0un8KzeMGqw== +"@budibase/backend-core@1.2.33": + version "1.2.33" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.33.tgz#8a08763f2ebb3b21d3c1ce2dfb993da32647681f" + integrity sha512-/CI/8Kacf7I+K5HTT6l3KzrYU7Him4V6e+RRTvv7gRpxmegODZXf1Q0U//OOLOEgpYCuKD8PbtJmSabjMjKI4A== dependencies: - "@budibase/types" "^1.2.32" + "@budibase/types" "^1.2.33" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -324,21 +324,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.2.32": - version "1.2.32" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.32.tgz#7116f54ee26218a179ad6720c444f238d47bea5e" - integrity sha512-TbwtUT50ErL/346fGiZdK+I3ddlVkP3hOeafa608Z/kuAwiEpBB8XNk8bbJjjpQfPsy1nbqyWNR66FtXcjE/TA== +"@budibase/pro@1.2.33": + version "1.2.33" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.33.tgz#a664e9ddc685329278d0adad11f46c52bea2d4c1" + integrity sha512-AWLxLggpRBsGn3G0pX3W/L7r/4WX9NFZ0REtBKgVOZr5yDmyyBkGxcyaaVYfqp6jHJFrvZEPK+M5pbqHOCDAfQ== dependencies: - "@budibase/backend-core" "1.2.32" - "@budibase/types" "1.2.32" + "@budibase/backend-core" "1.2.33" + "@budibase/types" "1.2.33" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.2.32", "@budibase/types@^1.2.32": - version "1.2.32" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.32.tgz#121ab38c0a956662673f8ca689f6cc4371e652b3" - integrity sha512-cmcNSUppv2tkM/R+SHt611uh7jmfJRtFzxwMEaceJMRxFuk9d++v3gmNJxf4Q+C9ENi1lvBOw87SLakqaMfCgQ== +"@budibase/types@1.2.33", "@budibase/types@^1.2.33": + version "1.2.33" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.33.tgz#d1b403b4d6a908e106bbc76300b6877a780dfc8f" + integrity sha512-WS26qNH2QlUAAXCbpGLbENtBDLQRBA4VAFSbbW8Mrn3vtMY4fh5btmtM3aY6Qg0O3QICs+W9EuHz9rEzbbfLTw== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From b4c8077c0a8c3acf354f622cac028c5486b2ee5b Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 10 Aug 2022 15:58:32 +0000 Subject: [PATCH 08/23] v1.2.34 --- 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 d5f2d8e3e3..401fb87894 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.2.33", + "version": "1.2.34", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 6f3f84fd1d..7f55c703bd 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.2.33", + "version": "1.2.34", "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.33", + "@budibase/types": "^1.2.34", "@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 879192ac9f..5355db3a1f 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.33", + "version": "1.2.34", "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.33", + "@budibase/string-templates": "^1.2.34", "@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 b930164f33..c98d1a1d6e 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.2.33", + "version": "1.2.34", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.2.33", - "@budibase/client": "^1.2.33", - "@budibase/frontend-core": "^1.2.33", - "@budibase/string-templates": "^1.2.33", + "@budibase/bbui": "^1.2.34", + "@budibase/client": "^1.2.34", + "@budibase/frontend-core": "^1.2.34", + "@budibase/string-templates": "^1.2.34", "@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 81173dc74c..8b597b6a3a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.2.33", + "version": "1.2.34", "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 a1efc6c732..716ddb2e0f 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.2.33", + "version": "1.2.34", "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.33", - "@budibase/frontend-core": "^1.2.33", - "@budibase/string-templates": "^1.2.33", + "@budibase/bbui": "^1.2.34", + "@budibase/frontend-core": "^1.2.34", + "@budibase/string-templates": "^1.2.34", "@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 df0113d29a..24baf22108 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.2.33", + "version": "1.2.34", "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.33", + "@budibase/bbui": "^1.2.34", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 6efa411454..43a2c1eb37 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.33", + "version": "1.2.34", "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.33", - "@budibase/client": "^1.2.33", + "@budibase/backend-core": "^1.2.34", + "@budibase/client": "^1.2.34", "@budibase/pro": "1.2.33", - "@budibase/string-templates": "^1.2.33", - "@budibase/types": "^1.2.33", + "@budibase/string-templates": "^1.2.34", + "@budibase/types": "^1.2.34", "@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 373d7d3980..84c0d0b5be 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.2.33", + "version": "1.2.34", "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 497fe38c00..1f8656d3de 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.2.33", + "version": "1.2.34", "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 9313144072..d9ab538b9a 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.33", + "version": "1.2.34", "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.33", + "@budibase/backend-core": "^1.2.34", "@budibase/pro": "1.2.33", - "@budibase/string-templates": "^1.2.33", - "@budibase/types": "^1.2.33", + "@budibase/string-templates": "^1.2.34", + "@budibase/types": "^1.2.34", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From a47a076532dae3726bb879be0d4f5b9b437e454b Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 10 Aug 2022 16:01:36 +0000 Subject: [PATCH 09/23] Update pro version to 1.2.34 --- 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 43a2c1eb37..b4a1a60461 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.34", "@budibase/client": "^1.2.34", - "@budibase/pro": "1.2.33", + "@budibase/pro": "1.2.34", "@budibase/string-templates": "^1.2.34", "@budibase/types": "^1.2.34", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 157926f39b..1f18accece 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.33": - version "1.2.33" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.33.tgz#8a08763f2ebb3b21d3c1ce2dfb993da32647681f" - integrity sha512-/CI/8Kacf7I+K5HTT6l3KzrYU7Him4V6e+RRTvv7gRpxmegODZXf1Q0U//OOLOEgpYCuKD8PbtJmSabjMjKI4A== +"@budibase/backend-core@1.2.34": + version "1.2.34" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.34.tgz#5c8271102a87d69d50081f04b4cd04e8da6e7547" + integrity sha512-hDsyPTu3sZhGOpT/a+XFigyiKePkcVbeceJnUZojoKgJ1gPDndBsTLcIBqTK/y/FbBC4d043RGoGwO8cDE+Fxw== dependencies: - "@budibase/types" "^1.2.33" + "@budibase/types" "^1.2.34" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1177,13 +1177,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.2.33": - version "1.2.33" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.33.tgz#a664e9ddc685329278d0adad11f46c52bea2d4c1" - integrity sha512-AWLxLggpRBsGn3G0pX3W/L7r/4WX9NFZ0REtBKgVOZr5yDmyyBkGxcyaaVYfqp6jHJFrvZEPK+M5pbqHOCDAfQ== +"@budibase/pro@1.2.34": + version "1.2.34" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.34.tgz#2e5e2bf6de445c902458404a6b0e3eccc8f1c560" + integrity sha512-GJvO7SlzZCbpUYD5GMQGQn4zNFlhuF0L2AbwQBwBTrdEnEbBntOT8dj3coo7kiOhV/He/Fm7SJZCw3mGh+rHTA== dependencies: - "@budibase/backend-core" "1.2.33" - "@budibase/types" "1.2.33" + "@budibase/backend-core" "1.2.34" + "@budibase/types" "1.2.34" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1206,10 +1206,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.2.33", "@budibase/types@^1.2.33": - version "1.2.33" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.33.tgz#d1b403b4d6a908e106bbc76300b6877a780dfc8f" - integrity sha512-WS26qNH2QlUAAXCbpGLbENtBDLQRBA4VAFSbbW8Mrn3vtMY4fh5btmtM3aY6Qg0O3QICs+W9EuHz9rEzbbfLTw== +"@budibase/types@1.2.34", "@budibase/types@^1.2.34": + version "1.2.34" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.34.tgz#a60d5e65fef747c3f7a5b897279c09ad6c309fb6" + integrity sha512-3xYsW1R1qFBhAZCYD95MmqxxPpRYjtVTi69W4oHeO1GmBrCXV4xVwDuSgGzVB6vu0WqGDdw7bA5Kb8qWT8hY2g== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index d9ab538b9a..8dafd0930a 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.34", - "@budibase/pro": "1.2.33", + "@budibase/pro": "1.2.34", "@budibase/string-templates": "^1.2.34", "@budibase/types": "^1.2.34", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index da24d428b3..77bd60d00a 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.33": - version "1.2.33" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.33.tgz#8a08763f2ebb3b21d3c1ce2dfb993da32647681f" - integrity sha512-/CI/8Kacf7I+K5HTT6l3KzrYU7Him4V6e+RRTvv7gRpxmegODZXf1Q0U//OOLOEgpYCuKD8PbtJmSabjMjKI4A== +"@budibase/backend-core@1.2.34": + version "1.2.34" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.34.tgz#5c8271102a87d69d50081f04b4cd04e8da6e7547" + integrity sha512-hDsyPTu3sZhGOpT/a+XFigyiKePkcVbeceJnUZojoKgJ1gPDndBsTLcIBqTK/y/FbBC4d043RGoGwO8cDE+Fxw== dependencies: - "@budibase/types" "^1.2.33" + "@budibase/types" "^1.2.34" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -324,21 +324,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.2.33": - version "1.2.33" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.33.tgz#a664e9ddc685329278d0adad11f46c52bea2d4c1" - integrity sha512-AWLxLggpRBsGn3G0pX3W/L7r/4WX9NFZ0REtBKgVOZr5yDmyyBkGxcyaaVYfqp6jHJFrvZEPK+M5pbqHOCDAfQ== +"@budibase/pro@1.2.34": + version "1.2.34" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.34.tgz#2e5e2bf6de445c902458404a6b0e3eccc8f1c560" + integrity sha512-GJvO7SlzZCbpUYD5GMQGQn4zNFlhuF0L2AbwQBwBTrdEnEbBntOT8dj3coo7kiOhV/He/Fm7SJZCw3mGh+rHTA== dependencies: - "@budibase/backend-core" "1.2.33" - "@budibase/types" "1.2.33" + "@budibase/backend-core" "1.2.34" + "@budibase/types" "1.2.34" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.2.33", "@budibase/types@^1.2.33": - version "1.2.33" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.33.tgz#d1b403b4d6a908e106bbc76300b6877a780dfc8f" - integrity sha512-WS26qNH2QlUAAXCbpGLbENtBDLQRBA4VAFSbbW8Mrn3vtMY4fh5btmtM3aY6Qg0O3QICs+W9EuHz9rEzbbfLTw== +"@budibase/types@1.2.34", "@budibase/types@^1.2.34": + version "1.2.34" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.34.tgz#a60d5e65fef747c3f7a5b897279c09ad6c309fb6" + integrity sha512-3xYsW1R1qFBhAZCYD95MmqxxPpRYjtVTi69W4oHeO1GmBrCXV4xVwDuSgGzVB6vu0WqGDdw7bA5Kb8qWT8hY2g== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 13e34e591d400de1925f60c6509cad1eecb63f2b Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Wed, 10 Aug 2022 17:07:33 +0100 Subject: [PATCH 10/23] Revert to using branches only for selfhost release --- .github/workflows/release-selfhost.yml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.github/workflows/release-selfhost.yml b/.github/workflows/release-selfhost.yml index 16742ea873..da064f3e32 100644 --- a/.github/workflows/release-selfhost.yml +++ b/.github/workflows/release-selfhost.yml @@ -2,10 +2,6 @@ name: Budibase Release Selfhost on: workflow_dispatch: - inputs: - version: - description: Budibase release version. For example - 1.0.0 - required: false env: BRANCH: ${{ github.event.pull_request.head.ref }} @@ -30,18 +26,9 @@ jobs: - name: Get the latest budibase release version id: version run: | - if [ -z "${{ github.event.inputs.version }}" ]; then - release_version=$(cat lerna.json | jq -r '.version') - else - release_version=${{ github.event.inputs.version }} - fi + release_version=$(cat lerna.json | jq -r '.version') echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - - name: Checkout tag - run: | - git fetch --tags - git checkout v${{ env.RELEASE_VERSION }} - - name: Tag and release Docker images (Self Host) run: | docker login -u $DOCKER_USER -p $DOCKER_PASSWORD From b06fdb066f631b96b5026da396cd662726ffbbd4 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Wed, 10 Aug 2022 17:09:51 +0100 Subject: [PATCH 11/23] Null safety --- .../automation/SetupPanel/AutomationBlockSetup.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index 90e7ab661c..8016283094 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -79,7 +79,7 @@ automationStore.actions.addTestDataToAutomation({ body: { [key]: e.detail, - ...$automationStore.selectedAutomation.automation.testData.body, + ...$automationStore.selectedAutomation.automation.testData?.body, }, }) } From a1c1185fc5dcdaf0c363565a97436b6933bb174c Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 10 Aug 2022 16:44:10 +0000 Subject: [PATCH 12/23] v1.2.35 --- 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 401fb87894..491072e201 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.2.34", + "version": "1.2.35", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 7f55c703bd..7b794348e8 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.2.34", + "version": "1.2.35", "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.34", + "@budibase/types": "^1.2.35", "@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 5355db3a1f..976f6554ab 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.34", + "version": "1.2.35", "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.34", + "@budibase/string-templates": "^1.2.35", "@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 c98d1a1d6e..8ff8efaf87 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.2.34", + "version": "1.2.35", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.2.34", - "@budibase/client": "^1.2.34", - "@budibase/frontend-core": "^1.2.34", - "@budibase/string-templates": "^1.2.34", + "@budibase/bbui": "^1.2.35", + "@budibase/client": "^1.2.35", + "@budibase/frontend-core": "^1.2.35", + "@budibase/string-templates": "^1.2.35", "@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 8b597b6a3a..3994af4851 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.2.34", + "version": "1.2.35", "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 716ddb2e0f..9ffbc0ec08 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.2.34", + "version": "1.2.35", "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.34", - "@budibase/frontend-core": "^1.2.34", - "@budibase/string-templates": "^1.2.34", + "@budibase/bbui": "^1.2.35", + "@budibase/frontend-core": "^1.2.35", + "@budibase/string-templates": "^1.2.35", "@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 24baf22108..951cc65d87 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.2.34", + "version": "1.2.35", "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.34", + "@budibase/bbui": "^1.2.35", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index b4a1a60461..4086087270 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.34", + "version": "1.2.35", "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.34", - "@budibase/client": "^1.2.34", + "@budibase/backend-core": "^1.2.35", + "@budibase/client": "^1.2.35", "@budibase/pro": "1.2.34", - "@budibase/string-templates": "^1.2.34", - "@budibase/types": "^1.2.34", + "@budibase/string-templates": "^1.2.35", + "@budibase/types": "^1.2.35", "@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 84c0d0b5be..fa44e763e8 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.2.34", + "version": "1.2.35", "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 1f8656d3de..7703c2913f 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.2.34", + "version": "1.2.35", "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 8dafd0930a..4039dd3dc2 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.34", + "version": "1.2.35", "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.34", + "@budibase/backend-core": "^1.2.35", "@budibase/pro": "1.2.34", - "@budibase/string-templates": "^1.2.34", - "@budibase/types": "^1.2.34", + "@budibase/string-templates": "^1.2.35", + "@budibase/types": "^1.2.35", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From a63305c6da298dc839e0c698694f10ea294eaab7 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 10 Aug 2022 16:47:30 +0000 Subject: [PATCH 13/23] Update pro version to 1.2.35 --- 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 4086087270..59679fc197 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.35", "@budibase/client": "^1.2.35", - "@budibase/pro": "1.2.34", + "@budibase/pro": "1.2.35", "@budibase/string-templates": "^1.2.35", "@budibase/types": "^1.2.35", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 1f18accece..f12c16f4fa 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.34": - version "1.2.34" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.34.tgz#5c8271102a87d69d50081f04b4cd04e8da6e7547" - integrity sha512-hDsyPTu3sZhGOpT/a+XFigyiKePkcVbeceJnUZojoKgJ1gPDndBsTLcIBqTK/y/FbBC4d043RGoGwO8cDE+Fxw== +"@budibase/backend-core@1.2.35": + version "1.2.35" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.35.tgz#ae1a5d336604ffd32570773ca41b93ecc12c6645" + integrity sha512-nb4kcsTw+tW3jAJNtJMQ4/y3oVIvwBHuIohqmuOlIWq0OlhXlGh0NSe/54H9NgPAYEkEHpx59jF3dwcbxFzMrA== dependencies: - "@budibase/types" "^1.2.34" + "@budibase/types" "^1.2.35" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1177,13 +1177,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.2.34": - version "1.2.34" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.34.tgz#2e5e2bf6de445c902458404a6b0e3eccc8f1c560" - integrity sha512-GJvO7SlzZCbpUYD5GMQGQn4zNFlhuF0L2AbwQBwBTrdEnEbBntOT8dj3coo7kiOhV/He/Fm7SJZCw3mGh+rHTA== +"@budibase/pro@1.2.35": + version "1.2.35" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.35.tgz#862a995bc169341c72803b686c9f5f3f408d3a14" + integrity sha512-exLQa4mBkIVODk2wecIWH7tZP8+u0EswAy/qQcsTOaRwEuHht6C3bNANGdEun8XpUELX+lIabsLmj4vMpBp45A== dependencies: - "@budibase/backend-core" "1.2.34" - "@budibase/types" "1.2.34" + "@budibase/backend-core" "1.2.35" + "@budibase/types" "1.2.35" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1206,10 +1206,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.2.34", "@budibase/types@^1.2.34": - version "1.2.34" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.34.tgz#a60d5e65fef747c3f7a5b897279c09ad6c309fb6" - integrity sha512-3xYsW1R1qFBhAZCYD95MmqxxPpRYjtVTi69W4oHeO1GmBrCXV4xVwDuSgGzVB6vu0WqGDdw7bA5Kb8qWT8hY2g== +"@budibase/types@1.2.35", "@budibase/types@^1.2.35": + version "1.2.35" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.35.tgz#1986df433d4df1d88a9744da4ecd2595a73668c1" + integrity sha512-Dl603oaG7ra3pr9Kehxk6p9bzneDIdjPK4Vc5fLLE84dCKcPpy3xPJeVP69Wk9+8do1E0gO9yTjDc1QbIOwVbw== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 4039dd3dc2..2d234a77bf 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.35", - "@budibase/pro": "1.2.34", + "@budibase/pro": "1.2.35", "@budibase/string-templates": "^1.2.35", "@budibase/types": "^1.2.35", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 77bd60d00a..413efb6f82 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.34": - version "1.2.34" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.34.tgz#5c8271102a87d69d50081f04b4cd04e8da6e7547" - integrity sha512-hDsyPTu3sZhGOpT/a+XFigyiKePkcVbeceJnUZojoKgJ1gPDndBsTLcIBqTK/y/FbBC4d043RGoGwO8cDE+Fxw== +"@budibase/backend-core@1.2.35": + version "1.2.35" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.35.tgz#ae1a5d336604ffd32570773ca41b93ecc12c6645" + integrity sha512-nb4kcsTw+tW3jAJNtJMQ4/y3oVIvwBHuIohqmuOlIWq0OlhXlGh0NSe/54H9NgPAYEkEHpx59jF3dwcbxFzMrA== dependencies: - "@budibase/types" "^1.2.34" + "@budibase/types" "^1.2.35" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -324,21 +324,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.2.34": - version "1.2.34" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.34.tgz#2e5e2bf6de445c902458404a6b0e3eccc8f1c560" - integrity sha512-GJvO7SlzZCbpUYD5GMQGQn4zNFlhuF0L2AbwQBwBTrdEnEbBntOT8dj3coo7kiOhV/He/Fm7SJZCw3mGh+rHTA== +"@budibase/pro@1.2.35": + version "1.2.35" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.35.tgz#862a995bc169341c72803b686c9f5f3f408d3a14" + integrity sha512-exLQa4mBkIVODk2wecIWH7tZP8+u0EswAy/qQcsTOaRwEuHht6C3bNANGdEun8XpUELX+lIabsLmj4vMpBp45A== dependencies: - "@budibase/backend-core" "1.2.34" - "@budibase/types" "1.2.34" + "@budibase/backend-core" "1.2.35" + "@budibase/types" "1.2.35" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.2.34", "@budibase/types@^1.2.34": - version "1.2.34" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.34.tgz#a60d5e65fef747c3f7a5b897279c09ad6c309fb6" - integrity sha512-3xYsW1R1qFBhAZCYD95MmqxxPpRYjtVTi69W4oHeO1GmBrCXV4xVwDuSgGzVB6vu0WqGDdw7bA5Kb8qWT8hY2g== +"@budibase/types@1.2.35", "@budibase/types@^1.2.35": + version "1.2.35" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.35.tgz#1986df433d4df1d88a9744da4ecd2595a73668c1" + integrity sha512-Dl603oaG7ra3pr9Kehxk6p9bzneDIdjPK4Vc5fLLE84dCKcPpy3xPJeVP69Wk9+8do1E0gO9yTjDc1QbIOwVbw== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 7e76f33033ba8489da32f343cb4bec73d3649808 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 10 Aug 2022 20:04:54 +0000 Subject: [PATCH 14/23] v1.2.36 --- 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 491072e201..990f32d01c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.2.35", + "version": "1.2.36", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 7b794348e8..e8cabab62a 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.2.35", + "version": "1.2.36", "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.35", + "@budibase/types": "^1.2.36", "@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 976f6554ab..dd488d00b3 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.35", + "version": "1.2.36", "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.35", + "@budibase/string-templates": "^1.2.36", "@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 8ff8efaf87..cfecbf01b6 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.2.35", + "version": "1.2.36", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.2.35", - "@budibase/client": "^1.2.35", - "@budibase/frontend-core": "^1.2.35", - "@budibase/string-templates": "^1.2.35", + "@budibase/bbui": "^1.2.36", + "@budibase/client": "^1.2.36", + "@budibase/frontend-core": "^1.2.36", + "@budibase/string-templates": "^1.2.36", "@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 3994af4851..29500b3341 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.2.35", + "version": "1.2.36", "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 9ffbc0ec08..1d5a3f057e 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.2.35", + "version": "1.2.36", "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.35", - "@budibase/frontend-core": "^1.2.35", - "@budibase/string-templates": "^1.2.35", + "@budibase/bbui": "^1.2.36", + "@budibase/frontend-core": "^1.2.36", + "@budibase/string-templates": "^1.2.36", "@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 951cc65d87..650b61100b 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.2.35", + "version": "1.2.36", "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.35", + "@budibase/bbui": "^1.2.36", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 59679fc197..fc4b85e19d 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.35", + "version": "1.2.36", "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.35", - "@budibase/client": "^1.2.35", + "@budibase/backend-core": "^1.2.36", + "@budibase/client": "^1.2.36", "@budibase/pro": "1.2.35", - "@budibase/string-templates": "^1.2.35", - "@budibase/types": "^1.2.35", + "@budibase/string-templates": "^1.2.36", + "@budibase/types": "^1.2.36", "@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 fa44e763e8..342cf03b14 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.2.35", + "version": "1.2.36", "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 7703c2913f..ff78bba3ec 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.2.35", + "version": "1.2.36", "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 2d234a77bf..a900aa4646 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.35", + "version": "1.2.36", "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.35", + "@budibase/backend-core": "^1.2.36", "@budibase/pro": "1.2.35", - "@budibase/string-templates": "^1.2.35", - "@budibase/types": "^1.2.35", + "@budibase/string-templates": "^1.2.36", + "@budibase/types": "^1.2.36", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From ed18d3b7348713fd49b48432fdb5798edc34cd9f Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 10 Aug 2022 20:07:57 +0000 Subject: [PATCH 15/23] Update pro version to 1.2.36 --- 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 fc4b85e19d..83696fa2db 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.36", "@budibase/client": "^1.2.36", - "@budibase/pro": "1.2.35", + "@budibase/pro": "1.2.36", "@budibase/string-templates": "^1.2.36", "@budibase/types": "^1.2.36", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index f12c16f4fa..0070e84a9d 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.35": - version "1.2.35" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.35.tgz#ae1a5d336604ffd32570773ca41b93ecc12c6645" - integrity sha512-nb4kcsTw+tW3jAJNtJMQ4/y3oVIvwBHuIohqmuOlIWq0OlhXlGh0NSe/54H9NgPAYEkEHpx59jF3dwcbxFzMrA== +"@budibase/backend-core@1.2.36": + version "1.2.36" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.36.tgz#f1499a7d4cd9f501a8b6868dfe827d6308282f06" + integrity sha512-30xjxE/r2KIf/KTQnkZFRque7YvPVDVrWlU0FkYz/ECxVJuA0Uvv9/u6z7/7Vzs51OU7OhvQ1SV0agIgk5fLUg== dependencies: - "@budibase/types" "^1.2.35" + "@budibase/types" "^1.2.36" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1177,13 +1177,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.2.35": - version "1.2.35" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.35.tgz#862a995bc169341c72803b686c9f5f3f408d3a14" - integrity sha512-exLQa4mBkIVODk2wecIWH7tZP8+u0EswAy/qQcsTOaRwEuHht6C3bNANGdEun8XpUELX+lIabsLmj4vMpBp45A== +"@budibase/pro@1.2.36": + version "1.2.36" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.36.tgz#d77f4713b9a935b30b597f05117b2ba56fe977a4" + integrity sha512-5cGYjK6WLzag1Pp4wEE2ErKkUAnIHDOH1dp1ZaKIhSJy972p12ZLhGzgLgvZbp6BbVvOjbB0jG1SXX3QErtkMA== dependencies: - "@budibase/backend-core" "1.2.35" - "@budibase/types" "1.2.35" + "@budibase/backend-core" "1.2.36" + "@budibase/types" "1.2.36" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1206,10 +1206,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.2.35", "@budibase/types@^1.2.35": - version "1.2.35" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.35.tgz#1986df433d4df1d88a9744da4ecd2595a73668c1" - integrity sha512-Dl603oaG7ra3pr9Kehxk6p9bzneDIdjPK4Vc5fLLE84dCKcPpy3xPJeVP69Wk9+8do1E0gO9yTjDc1QbIOwVbw== +"@budibase/types@1.2.36", "@budibase/types@^1.2.36": + version "1.2.36" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.36.tgz#e7f43b15215c48da46fbcf96a51950370dd6385b" + integrity sha512-6V1ECWLBxiZZfS/XGbWT5pMg2lEGIoMCcjdYoZD2WbeaV/cx6tp7zot9agIP6/nPQvyWuF9DK9WJfjBPg28U0Q== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index a900aa4646..66e24f4996 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.36", - "@budibase/pro": "1.2.35", + "@budibase/pro": "1.2.36", "@budibase/string-templates": "^1.2.36", "@budibase/types": "^1.2.36", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 413efb6f82..6e1d99a01c 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.35": - version "1.2.35" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.35.tgz#ae1a5d336604ffd32570773ca41b93ecc12c6645" - integrity sha512-nb4kcsTw+tW3jAJNtJMQ4/y3oVIvwBHuIohqmuOlIWq0OlhXlGh0NSe/54H9NgPAYEkEHpx59jF3dwcbxFzMrA== +"@budibase/backend-core@1.2.36": + version "1.2.36" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.36.tgz#f1499a7d4cd9f501a8b6868dfe827d6308282f06" + integrity sha512-30xjxE/r2KIf/KTQnkZFRque7YvPVDVrWlU0FkYz/ECxVJuA0Uvv9/u6z7/7Vzs51OU7OhvQ1SV0agIgk5fLUg== dependencies: - "@budibase/types" "^1.2.35" + "@budibase/types" "^1.2.36" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -324,21 +324,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.2.35": - version "1.2.35" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.35.tgz#862a995bc169341c72803b686c9f5f3f408d3a14" - integrity sha512-exLQa4mBkIVODk2wecIWH7tZP8+u0EswAy/qQcsTOaRwEuHht6C3bNANGdEun8XpUELX+lIabsLmj4vMpBp45A== +"@budibase/pro@1.2.36": + version "1.2.36" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.36.tgz#d77f4713b9a935b30b597f05117b2ba56fe977a4" + integrity sha512-5cGYjK6WLzag1Pp4wEE2ErKkUAnIHDOH1dp1ZaKIhSJy972p12ZLhGzgLgvZbp6BbVvOjbB0jG1SXX3QErtkMA== dependencies: - "@budibase/backend-core" "1.2.35" - "@budibase/types" "1.2.35" + "@budibase/backend-core" "1.2.36" + "@budibase/types" "1.2.36" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.2.35", "@budibase/types@^1.2.35": - version "1.2.35" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.35.tgz#1986df433d4df1d88a9744da4ecd2595a73668c1" - integrity sha512-Dl603oaG7ra3pr9Kehxk6p9bzneDIdjPK4Vc5fLLE84dCKcPpy3xPJeVP69Wk9+8do1E0gO9yTjDc1QbIOwVbw== +"@budibase/types@1.2.36", "@budibase/types@^1.2.36": + version "1.2.36" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.36.tgz#e7f43b15215c48da46fbcf96a51950370dd6385b" + integrity sha512-6V1ECWLBxiZZfS/XGbWT5pMg2lEGIoMCcjdYoZD2WbeaV/cx6tp7zot9agIP6/nPQvyWuF9DK9WJfjBPg28U0Q== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 3ba01b0a74974a3bb48adbad91a4221a112e0d6c Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 11 Aug 2022 08:52:16 +0000 Subject: [PATCH 16/23] v1.2.37 --- 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 990f32d01c..ba50ac2b31 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.2.36", + "version": "1.2.37", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index e8cabab62a..4e3582fd41 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.2.36", + "version": "1.2.37", "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.36", + "@budibase/types": "^1.2.37", "@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 dd488d00b3..20db0ae447 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.36", + "version": "1.2.37", "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.36", + "@budibase/string-templates": "^1.2.37", "@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 cfecbf01b6..6a9507a340 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.2.36", + "version": "1.2.37", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.2.36", - "@budibase/client": "^1.2.36", - "@budibase/frontend-core": "^1.2.36", - "@budibase/string-templates": "^1.2.36", + "@budibase/bbui": "^1.2.37", + "@budibase/client": "^1.2.37", + "@budibase/frontend-core": "^1.2.37", + "@budibase/string-templates": "^1.2.37", "@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 29500b3341..8fa274a5ac 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.2.36", + "version": "1.2.37", "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 1d5a3f057e..72ff026965 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.2.36", + "version": "1.2.37", "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.36", - "@budibase/frontend-core": "^1.2.36", - "@budibase/string-templates": "^1.2.36", + "@budibase/bbui": "^1.2.37", + "@budibase/frontend-core": "^1.2.37", + "@budibase/string-templates": "^1.2.37", "@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 650b61100b..0d54ec5158 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.2.36", + "version": "1.2.37", "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.36", + "@budibase/bbui": "^1.2.37", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 83696fa2db..685e618149 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.36", + "version": "1.2.37", "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.36", - "@budibase/client": "^1.2.36", + "@budibase/backend-core": "^1.2.37", + "@budibase/client": "^1.2.37", "@budibase/pro": "1.2.36", - "@budibase/string-templates": "^1.2.36", - "@budibase/types": "^1.2.36", + "@budibase/string-templates": "^1.2.37", + "@budibase/types": "^1.2.37", "@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 342cf03b14..bc34f8bc1f 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.2.36", + "version": "1.2.37", "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 ff78bba3ec..7e66f0bdaf 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.2.36", + "version": "1.2.37", "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 66e24f4996..32f77badfe 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.36", + "version": "1.2.37", "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.36", + "@budibase/backend-core": "^1.2.37", "@budibase/pro": "1.2.36", - "@budibase/string-templates": "^1.2.36", - "@budibase/types": "^1.2.36", + "@budibase/string-templates": "^1.2.37", + "@budibase/types": "^1.2.37", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 47c3bc8c3028bf068034163a245f9068713edc3d Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 11 Aug 2022 08:55:15 +0000 Subject: [PATCH 17/23] Update pro version to 1.2.37 --- 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 685e618149..75968e8d96 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.37", "@budibase/client": "^1.2.37", - "@budibase/pro": "1.2.36", + "@budibase/pro": "1.2.37", "@budibase/string-templates": "^1.2.37", "@budibase/types": "^1.2.37", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 0070e84a9d..c6e88b370d 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.36": - version "1.2.36" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.36.tgz#f1499a7d4cd9f501a8b6868dfe827d6308282f06" - integrity sha512-30xjxE/r2KIf/KTQnkZFRque7YvPVDVrWlU0FkYz/ECxVJuA0Uvv9/u6z7/7Vzs51OU7OhvQ1SV0agIgk5fLUg== +"@budibase/backend-core@1.2.37": + version "1.2.37" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.37.tgz#e9751c183edfb5c74bcd74259affefcd74f1e977" + integrity sha512-70bUAiRXHsy/3NtD/zKZeQpRX93Zhp3l8//f8CIgyxiGunfYInoDyCe1tWsMFsi7BZdBFUH5mcrdw0K7Xi6jaA== dependencies: - "@budibase/types" "^1.2.36" + "@budibase/types" "^1.2.37" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1177,13 +1177,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.2.36": - version "1.2.36" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.36.tgz#d77f4713b9a935b30b597f05117b2ba56fe977a4" - integrity sha512-5cGYjK6WLzag1Pp4wEE2ErKkUAnIHDOH1dp1ZaKIhSJy972p12ZLhGzgLgvZbp6BbVvOjbB0jG1SXX3QErtkMA== +"@budibase/pro@1.2.37": + version "1.2.37" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.37.tgz#5e49d33901a5a9ba642cbe38b681e075d6e80226" + integrity sha512-9x9II47sg7i6jo09BG1w17/IH6XkB1M8cabZWUNAx2LYGiG/3v7e7tHXU3RWN/VlI3zxcfuSuyCgkQzsvOGvig== dependencies: - "@budibase/backend-core" "1.2.36" - "@budibase/types" "1.2.36" + "@budibase/backend-core" "1.2.37" + "@budibase/types" "1.2.37" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1206,10 +1206,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.2.36", "@budibase/types@^1.2.36": - version "1.2.36" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.36.tgz#e7f43b15215c48da46fbcf96a51950370dd6385b" - integrity sha512-6V1ECWLBxiZZfS/XGbWT5pMg2lEGIoMCcjdYoZD2WbeaV/cx6tp7zot9agIP6/nPQvyWuF9DK9WJfjBPg28U0Q== +"@budibase/types@1.2.37", "@budibase/types@^1.2.37": + version "1.2.37" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.37.tgz#4c78197ea67f50cf09cd4c03aecdec99243aaba2" + integrity sha512-7svPsrhev/ElXKQvrBJTzfHWE+jWUqZQzOBdj0mL+uD8xBIa4pOpxoLvo3CkyeFrLWZKMlepap4MWQCKeJnazw== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 32f77badfe..0e53176a9e 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.37", - "@budibase/pro": "1.2.36", + "@budibase/pro": "1.2.37", "@budibase/string-templates": "^1.2.37", "@budibase/types": "^1.2.37", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 6e1d99a01c..672f62f005 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.36": - version "1.2.36" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.36.tgz#f1499a7d4cd9f501a8b6868dfe827d6308282f06" - integrity sha512-30xjxE/r2KIf/KTQnkZFRque7YvPVDVrWlU0FkYz/ECxVJuA0Uvv9/u6z7/7Vzs51OU7OhvQ1SV0agIgk5fLUg== +"@budibase/backend-core@1.2.37": + version "1.2.37" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.37.tgz#e9751c183edfb5c74bcd74259affefcd74f1e977" + integrity sha512-70bUAiRXHsy/3NtD/zKZeQpRX93Zhp3l8//f8CIgyxiGunfYInoDyCe1tWsMFsi7BZdBFUH5mcrdw0K7Xi6jaA== dependencies: - "@budibase/types" "^1.2.36" + "@budibase/types" "^1.2.37" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -324,21 +324,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.2.36": - version "1.2.36" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.36.tgz#d77f4713b9a935b30b597f05117b2ba56fe977a4" - integrity sha512-5cGYjK6WLzag1Pp4wEE2ErKkUAnIHDOH1dp1ZaKIhSJy972p12ZLhGzgLgvZbp6BbVvOjbB0jG1SXX3QErtkMA== +"@budibase/pro@1.2.37": + version "1.2.37" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.37.tgz#5e49d33901a5a9ba642cbe38b681e075d6e80226" + integrity sha512-9x9II47sg7i6jo09BG1w17/IH6XkB1M8cabZWUNAx2LYGiG/3v7e7tHXU3RWN/VlI3zxcfuSuyCgkQzsvOGvig== dependencies: - "@budibase/backend-core" "1.2.36" - "@budibase/types" "1.2.36" + "@budibase/backend-core" "1.2.37" + "@budibase/types" "1.2.37" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.2.36", "@budibase/types@^1.2.36": - version "1.2.36" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.36.tgz#e7f43b15215c48da46fbcf96a51950370dd6385b" - integrity sha512-6V1ECWLBxiZZfS/XGbWT5pMg2lEGIoMCcjdYoZD2WbeaV/cx6tp7zot9agIP6/nPQvyWuF9DK9WJfjBPg28U0Q== +"@budibase/types@1.2.37", "@budibase/types@^1.2.37": + version "1.2.37" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.37.tgz#4c78197ea67f50cf09cd4c03aecdec99243aaba2" + integrity sha512-7svPsrhev/ElXKQvrBJTzfHWE+jWUqZQzOBdj0mL+uD8xBIa4pOpxoLvo3CkyeFrLWZKMlepap4MWQCKeJnazw== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 5dce4fc16a8080023c51d41944299a773ab25d1a Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 11 Aug 2022 11:48:58 +0100 Subject: [PATCH 18/23] Moving all datasource types around - this is needed to make the SDK/Document types more accesible for the development datasource plugins. --- packages/server/src/definitions/common.ts | 66 +--- packages/server/src/definitions/datasource.ts | 282 ++---------------- packages/server/src/integrations/airtable.ts | 4 +- packages/server/src/integrations/arangodb.ts | 4 +- .../src/integrations/base/IntegrationBase.ts | 6 - .../src/integrations/base/datasourcePlus.ts | 13 - packages/server/src/integrations/couchdb.ts | 4 +- packages/server/src/integrations/dynamodb.ts | 4 +- .../server/src/integrations/elasticsearch.ts | 4 +- packages/server/src/integrations/firebase.ts | 4 +- .../server/src/integrations/googlesheets.ts | 9 +- .../src/integrations/microsoftSqlServer.ts | 7 +- packages/server/src/integrations/mongodb.ts | 4 +- packages/server/src/integrations/mysql.ts | 7 +- packages/server/src/integrations/oracle.ts | 6 +- packages/server/src/integrations/postgres.ts | 6 +- .../server/src/integrations/queries/sql.ts | 3 +- packages/server/src/integrations/redis.ts | 6 +- packages/server/src/integrations/rest.ts | 8 +- packages/server/src/integrations/s3.ts | 3 +- packages/server/src/integrations/snowflake.ts | 2 +- .../types/src/documents/app/datasource.ts | 14 +- packages/types/src/documents/app/row.ts | 22 +- packages/types/src/documents/app/table.ts | 50 +++- packages/types/src/sdk/datasources.ts | 121 ++++++++ packages/types/src/sdk/index.ts | 2 + packages/types/src/sdk/search.ts | 91 ++++++ 27 files changed, 374 insertions(+), 378 deletions(-) delete mode 100644 packages/server/src/integrations/base/IntegrationBase.ts delete mode 100644 packages/server/src/integrations/base/datasourcePlus.ts create mode 100644 packages/types/src/sdk/datasources.ts create mode 100644 packages/types/src/sdk/search.ts diff --git a/packages/server/src/definitions/common.ts b/packages/server/src/definitions/common.ts index f7e5a9a049..cdbe82344f 100644 --- a/packages/server/src/definitions/common.ts +++ b/packages/server/src/definitions/common.ts @@ -1,70 +1,10 @@ export { Query, Datasource } from "./datasource" +export { FieldSchema, TableSchema, Table, Document, Row } from "@budibase/types" -export interface Base { - _id?: string - _rev?: string -} - -export interface Application extends Base { +export interface Application extends Document { appId?: string } -export interface FieldSchema { - // TODO: replace with field types enum when done - type: string - externalType?: string - fieldName?: string - name: string - tableId?: string - relationshipType?: string - through?: string - foreignKey?: string - autocolumn?: boolean - subtype?: string - throughFrom?: string - throughTo?: string - formula?: string - formulaType?: string - main?: boolean - ignoreTimezones?: boolean - meta?: { - toTable: string - toKey: string - } - constraints?: { - type?: string - email?: boolean - inclusion?: string[] - length?: { - minimum?: string | number - maximum?: string | number - } - presence?: boolean - } -} - -export interface TableSchema { - [key: string]: FieldSchema -} - -export interface Table extends Base { - type?: string - views?: {} - name: string - primary?: string[] - schema: TableSchema - primaryDisplay?: string - sourceId?: string - relatedFormula?: string[] - constrained?: string[] -} - -export interface Row extends Base { - type?: string - tableId?: string - [key: string]: any -} - interface JsonSchemaField { properties: { [key: string]: { @@ -94,7 +34,7 @@ export interface AutomationStep { type: string } -export interface Automation extends Base { +export interface Automation extends Document { name: string type: string appId?: string diff --git a/packages/server/src/definitions/datasource.ts b/packages/server/src/definitions/datasource.ts index 9752fc947a..ff4f5e9f5b 100644 --- a/packages/server/src/definitions/datasource.ts +++ b/packages/server/src/definitions/datasource.ts @@ -1,214 +1,42 @@ -import { Row, Table, Base } from "./common" +import { SortDirection, Operation, SourceNames } from "@budibase/types" +// export everything that used to be exported from here +export { + Operation, + SortDirection, + QueryTypes, + DatasourceFieldTypes, + SourceNames, + IncludeRelationships, + FilterTypes, + QueryDefinition, + ExtraQueryConfig, + Integration, + IntegrationBase, + QueryParameter, + PaginationConfig, + PaginationValues, + RestQueryFields, + Query, + Datasource, + SearchFilters, + SortJson, + PaginationJson, + RenameColumn, + RelationshipsJson, + QueryJson, + SqlQuery, +} 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", -} - -export interface QueryDefinition { - type: QueryTypes - displayName?: string - readable?: boolean - customisable?: boolean - fields?: object - urlDisplay?: boolean -} - -export interface ExtraQueryConfig { - [key: string]: { - displayName: string - type: string - required: boolean - data?: object - } -} - -export interface Integration { - docs: string - plus?: boolean - auth?: { type: string } - relationships?: boolean - description: string - friendlyName: string - type?: string - datasource: {} - query: { - [key: string]: QueryDefinition - } - extra?: ExtraQueryConfig -} - -export interface SearchFilters { - allOr?: boolean - string?: { - [key: string]: string - } - fuzzy?: { - [key: string]: string - } - range?: { - [key: string]: { - high: number | string - low: number | string - } - } - equal?: { - [key: string]: any - } - notEqual?: { - [key: string]: any - } - empty?: { - [key: string]: any - } - notEmpty?: { - [key: string]: any - } - oneOf?: { - [key: string]: any[] - } - contains?: { - [key: string]: any - } -} - -export interface SortJson { - [key: string]: SortDirection -} - -export interface PaginationJson { - limit: number - page?: string | number -} - -export interface RenameColumn { - old: string - updated: string -} - -export interface RelationshipsJson { - through?: string - from?: string - to?: string - fromPrimary?: string - toPrimary?: string - tableName: string - column: string -} - -export interface QueryJson { - endpoint: { - datasourceId: string - entityId: string - operation: Operation - schema?: string - } - resource: { - fields: string[] - } - filters?: SearchFilters - sort?: SortJson - paginate?: PaginationJson - body?: Row | Row[] - table?: Table - meta?: { - table?: Table - tables?: Record - renamed: RenameColumn - } - extra?: { - idFilter?: SearchFilters - } - relationships?: RelationshipsJson[] -} - -export interface SqlQuery { - sql: string - bindings?: string[] -} +/******************************************** + * This file contains structures which are * + * internal to the server and don't need to * + * be exposed for use by other services. * + ********************************************/ export interface QueryOptions { disableReturning?: boolean } -export interface Datasource extends Base { - type: string - name: string - source: SourceNames - // the config is defined by the schema - config: { - [key: string]: string | number | boolean - } - plus: boolean - entities?: { - [key: string]: Table - } -} - export enum AuthType { BASIC = "basic", BEARER = "bearer", @@ -230,25 +58,6 @@ export interface BearerAuthConfig { token: string } -export interface QueryParameter { - name: string - default: string -} - -export interface RestQueryFields { - path: string - queryString?: string - headers: { [key: string]: any } - disabledHeaders: { [key: string]: any } - requestBody: any - bodyType: string - json: object - method: string - authConfigId: string - pagination: PaginationConfig | null - paginationValues: PaginationValues | null -} - export interface RestConfig { url: string defaultHeaders: { @@ -266,28 +75,3 @@ export interface RestConfig { } ] } - -export interface PaginationConfig { - type: string - location: string - pageParam: string - sizeParam: string | null - responseParam: string | null -} - -export interface PaginationValues { - page: string | number | null - limit: number | null -} - -export interface Query { - _id?: string - datasourceId: string - name: string - parameters: QueryParameter[] - fields: RestQueryFields | any - transformer: string | null - schema: any - readable: boolean - queryVerb: string -} diff --git a/packages/server/src/integrations/airtable.ts b/packages/server/src/integrations/airtable.ts index eaf4317953..199741b312 100644 --- a/packages/server/src/integrations/airtable.ts +++ b/packages/server/src/integrations/airtable.ts @@ -2,8 +2,8 @@ import { Integration, DatasourceFieldTypes, QueryTypes, -} from "../definitions/datasource" -import { IntegrationBase } from "./base/IntegrationBase" + IntegrationBase, +} from "@budibase/types" module AirtableModule { const Airtable = require("airtable") diff --git a/packages/server/src/integrations/arangodb.ts b/packages/server/src/integrations/arangodb.ts index e6e2c0db35..682b941b23 100644 --- a/packages/server/src/integrations/arangodb.ts +++ b/packages/server/src/integrations/arangodb.ts @@ -2,8 +2,8 @@ import { Integration, DatasourceFieldTypes, QueryTypes, -} from "../definitions/datasource" -import { IntegrationBase } from "./base/IntegrationBase" + IntegrationBase, +} from "@budibase/types" module ArangoModule { const { Database, aql } = require("arangojs") diff --git a/packages/server/src/integrations/base/IntegrationBase.ts b/packages/server/src/integrations/base/IntegrationBase.ts deleted file mode 100644 index bfda4fbd4d..0000000000 --- a/packages/server/src/integrations/base/IntegrationBase.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface IntegrationBase { - create?(query: any): Promise - read?(query: any): Promise - update?(query: any): Promise - delete?(query: any): Promise -} diff --git a/packages/server/src/integrations/base/datasourcePlus.ts b/packages/server/src/integrations/base/datasourcePlus.ts deleted file mode 100644 index f55dcf0f9a..0000000000 --- a/packages/server/src/integrations/base/datasourcePlus.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Table } from "../../definitions/common" -import { IntegrationBase } from "./IntegrationBase" - -export interface DatasourcePlus extends IntegrationBase { - tables: Record - schemaErrors: Record - - // if the datasource supports the use of bindings directly (to protect against SQL injection) - // this returns the format of the identifier - getBindingIdentifier(): string - getStringConcat(parts: string[]): string - buildSchema(datasourceId: string, entities: Record): any -} diff --git a/packages/server/src/integrations/couchdb.ts b/packages/server/src/integrations/couchdb.ts index 6d33658988..d32415ca29 100644 --- a/packages/server/src/integrations/couchdb.ts +++ b/packages/server/src/integrations/couchdb.ts @@ -2,8 +2,8 @@ import { Integration, DatasourceFieldTypes, QueryTypes, -} from "../definitions/datasource" -import { IntegrationBase } from "./base/IntegrationBase" + IntegrationBase, +} from "@budibase/types" module CouchDBModule { const PouchDB = require("pouchdb") diff --git a/packages/server/src/integrations/dynamodb.ts b/packages/server/src/integrations/dynamodb.ts index f06bba02e9..28e163a8aa 100644 --- a/packages/server/src/integrations/dynamodb.ts +++ b/packages/server/src/integrations/dynamodb.ts @@ -2,8 +2,8 @@ import { Integration, DatasourceFieldTypes, QueryTypes, -} from "../definitions/datasource" -import { IntegrationBase } from "./base/IntegrationBase" + IntegrationBase, +} from "@budibase/types" module DynamoModule { const AWS = require("aws-sdk") diff --git a/packages/server/src/integrations/elasticsearch.ts b/packages/server/src/integrations/elasticsearch.ts index eb27966df0..a2b90b4b87 100644 --- a/packages/server/src/integrations/elasticsearch.ts +++ b/packages/server/src/integrations/elasticsearch.ts @@ -2,8 +2,8 @@ import { Integration, DatasourceFieldTypes, QueryTypes, -} from "../definitions/datasource" -import { IntegrationBase } from "./base/IntegrationBase" + IntegrationBase, +} from "@budibase/types" module ElasticsearchModule { const { Client } = require("@elastic/elasticsearch") diff --git a/packages/server/src/integrations/firebase.ts b/packages/server/src/integrations/firebase.ts index c0f5d3c798..572514f739 100644 --- a/packages/server/src/integrations/firebase.ts +++ b/packages/server/src/integrations/firebase.ts @@ -2,8 +2,8 @@ import { DatasourceFieldTypes, Integration, QueryTypes, -} from "../definitions/datasource" -import { IntegrationBase } from "./base/IntegrationBase" + IntegrationBase, +} from "@budibase/types" import { Firestore, WhereFilterOp } from "@google-cloud/firestore" module Firebase { diff --git a/packages/server/src/integrations/googlesheets.ts b/packages/server/src/integrations/googlesheets.ts index d2562ddccf..644b8d352f 100644 --- a/packages/server/src/integrations/googlesheets.ts +++ b/packages/server/src/integrations/googlesheets.ts @@ -1,12 +1,13 @@ import { DatasourceFieldTypes, Integration, - QueryJson, QueryTypes, -} from "../definitions/datasource" + Table, + TableSchema, + QueryJson, + DatasourcePlus, +} from "@budibase/types" import { OAuth2Client } from "google-auth-library" -import { DatasourcePlus } from "./base/datasourcePlus" -import { Table, TableSchema } from "../definitions/common" import { buildExternalTableId } from "./utils" import { DataSourceOperation, FieldTypes } from "../constants" import { GoogleSpreadsheet } from "google-spreadsheet" diff --git a/packages/server/src/integrations/microsoftSqlServer.ts b/packages/server/src/integrations/microsoftSqlServer.ts index 1e5664748d..67b2b0cfe2 100644 --- a/packages/server/src/integrations/microsoftSqlServer.ts +++ b/packages/server/src/integrations/microsoftSqlServer.ts @@ -2,10 +2,13 @@ import { DatasourceFieldTypes, Integration, Operation, + Table, + TableSchema, QueryJson, QueryTypes, SqlQuery, -} from "../definitions/datasource" + DatasourcePlus, +} from "@budibase/types" import { getSqlQuery, buildExternalTableId, @@ -13,8 +16,6 @@ import { finaliseExternalTables, SqlClients, } from "./utils" -import { DatasourcePlus } from "./base/datasourcePlus" -import { Table, TableSchema } from "../definitions/common" module MSSQLModule { const sqlServer = require("mssql") diff --git a/packages/server/src/integrations/mongodb.ts b/packages/server/src/integrations/mongodb.ts index 802696ff40..b387bb80d8 100644 --- a/packages/server/src/integrations/mongodb.ts +++ b/packages/server/src/integrations/mongodb.ts @@ -2,8 +2,8 @@ import { Integration, DatasourceFieldTypes, QueryTypes, -} from "../definitions/datasource" -import { IntegrationBase } from "./base/IntegrationBase" + IntegrationBase, +} from "@budibase/types" import { MongoClient, ObjectID, diff --git a/packages/server/src/integrations/mysql.ts b/packages/server/src/integrations/mysql.ts index 1fdab66701..740bd4f2d6 100644 --- a/packages/server/src/integrations/mysql.ts +++ b/packages/server/src/integrations/mysql.ts @@ -4,8 +4,10 @@ import { QueryTypes, QueryJson, SqlQuery, -} from "../definitions/datasource" -import { Table, TableSchema } from "../definitions/common" + Table, + TableSchema, + DatasourcePlus, +} from "@budibase/types" import { getSqlQuery, SqlClients, @@ -13,7 +15,6 @@ import { convertSqlType, finaliseExternalTables, } from "./utils" -import { DatasourcePlus } from "./base/datasourcePlus" import dayjs from "dayjs" const { NUMBER_REGEX } = require("../utilities") diff --git a/packages/server/src/integrations/oracle.ts b/packages/server/src/integrations/oracle.ts index ab742d9009..1d96f5c44f 100644 --- a/packages/server/src/integrations/oracle.ts +++ b/packages/server/src/integrations/oracle.ts @@ -5,7 +5,9 @@ import { QueryJson, QueryTypes, SqlQuery, -} from "../definitions/datasource" + Table, + DatasourcePlus, +} from "@budibase/types" import { buildExternalTableId, convertSqlType, @@ -21,8 +23,6 @@ import oracledb, { Result, } from "oracledb" import Sql from "./base/sql" -import { Table } from "../definitions/common" -import { DatasourcePlus } from "./base/datasourcePlus" import { FieldTypes } from "../constants" module OracleModule { diff --git a/packages/server/src/integrations/postgres.ts b/packages/server/src/integrations/postgres.ts index 7cc01bdc79..58e6e8c214 100644 --- a/packages/server/src/integrations/postgres.ts +++ b/packages/server/src/integrations/postgres.ts @@ -4,8 +4,9 @@ import { QueryTypes, QueryJson, SqlQuery, -} from "../definitions/datasource" -import { Table } from "../definitions/common" + Table, + DatasourcePlus, +} from "@budibase/types" import { getSqlQuery, buildExternalTableId, @@ -13,7 +14,6 @@ import { finaliseExternalTables, SqlClients, } from "./utils" -import { DatasourcePlus } from "./base/datasourcePlus" module PostgresModule { const { Client, types } = require("pg") diff --git a/packages/server/src/integrations/queries/sql.ts b/packages/server/src/integrations/queries/sql.ts index 271a414d44..6e66114ec2 100644 --- a/packages/server/src/integrations/queries/sql.ts +++ b/packages/server/src/integrations/queries/sql.ts @@ -1,6 +1,5 @@ import { findHBSBlocks, processStringSync } from "@budibase/string-templates" -import { Integration } from "../../definitions/datasource" -import { DatasourcePlus } from "../base/datasourcePlus" +import { DatasourcePlus } from "@budibase/types" const CONST_CHAR_REGEX = new RegExp("'[^']*'", "g") diff --git a/packages/server/src/integrations/redis.ts b/packages/server/src/integrations/redis.ts index a1a9804cc0..92e245011f 100644 --- a/packages/server/src/integrations/redis.ts +++ b/packages/server/src/integrations/redis.ts @@ -1,8 +1,4 @@ -import { - DatasourceFieldTypes, - Integration, - QueryTypes, -} from "../definitions/datasource" +import { DatasourceFieldTypes, Integration, QueryTypes } from "@budibase/types" import Redis from "ioredis" module RedisModule { diff --git a/packages/server/src/integrations/rest.ts b/packages/server/src/integrations/rest.ts index 9cc8e1a841..87ed374aef 100644 --- a/packages/server/src/integrations/rest.ts +++ b/packages/server/src/integrations/rest.ts @@ -2,15 +2,17 @@ import { Integration, DatasourceFieldTypes, QueryTypes, + PaginationConfig, + IntegrationBase, + PaginationValues, +} from "@budibase/types" +import { RestConfig, RestQueryFields as RestQuery, - PaginationConfig, AuthType, BasicAuthConfig, BearerAuthConfig, - PaginationValues, } from "../definitions/datasource" -import { IntegrationBase } from "./base/IntegrationBase" import { get } from "lodash" const BodyTypes = { diff --git a/packages/server/src/integrations/s3.ts b/packages/server/src/integrations/s3.ts index 12371e703f..e92eaf9417 100644 --- a/packages/server/src/integrations/s3.ts +++ b/packages/server/src/integrations/s3.ts @@ -1,5 +1,4 @@ -import { Integration, QueryTypes } from "../definitions/datasource" -import { IntegrationBase } from "./base/IntegrationBase" +import { Integration, QueryTypes, IntegrationBase } from "@budibase/types" module S3Module { const AWS = require("aws-sdk") diff --git a/packages/server/src/integrations/snowflake.ts b/packages/server/src/integrations/snowflake.ts index 5e04e858e5..82f26e733a 100644 --- a/packages/server/src/integrations/snowflake.ts +++ b/packages/server/src/integrations/snowflake.ts @@ -1,4 +1,4 @@ -import { Integration, QueryTypes, SqlQuery } from "../definitions/datasource" +import { Integration, QueryTypes, SqlQuery } from "@budibase/types" import { Snowflake } from "snowflake-promise" module SnowflakeModule { diff --git a/packages/types/src/documents/app/datasource.ts b/packages/types/src/documents/app/datasource.ts index 3a8704a0a9..68f84e4b98 100644 --- a/packages/types/src/documents/app/datasource.ts +++ b/packages/types/src/documents/app/datasource.ts @@ -1,5 +1,17 @@ import { Document } from "../document" +import { SourceNames } from "../../sdk" +import { Table } from "./table" export interface Datasource extends Document { - source: string + type: string + name: string + source: SourceNames + // the config is defined by the schema + config: { + [key: string]: string | number | boolean + } + plus: boolean + entities?: { + [key: string]: Table + } } diff --git a/packages/types/src/documents/app/row.ts b/packages/types/src/documents/app/row.ts index d053d3d938..41ad1b1449 100644 --- a/packages/types/src/documents/app/row.ts +++ b/packages/types/src/documents/app/row.ts @@ -1,3 +1,23 @@ import { Document } from "../document" -export interface Row extends Document {} +export enum FieldTypes { + STRING = "string", + LONGFORM = "longform", + OPTIONS = "options", + NUMBER = "number", + BOOLEAN = "boolean", + ARRAY = "array", + DATETIME = "datetime", + ATTACHMENT = "attachment", + LINK = "link", + FORMULA = "formula", + AUTO = "auto", + JSON = "json", + INTERNAL = "internal", +} + +export interface Row extends Document { + type?: string + tableId?: string + [key: string]: any +} diff --git a/packages/types/src/documents/app/table.ts b/packages/types/src/documents/app/table.ts index 4ee7afd03c..72cff4f056 100644 --- a/packages/types/src/documents/app/table.ts +++ b/packages/types/src/documents/app/table.ts @@ -1,6 +1,52 @@ import { Document } from "../document" import { View } from "./view" -export interface Table extends Document { - views: { [key: string]: View } +export interface FieldSchema { + // TODO: replace with field types enum when done + type: string + externalType?: string + fieldName?: string + name: string + tableId?: string + relationshipType?: string + through?: string + foreignKey?: string + autocolumn?: boolean + subtype?: string + throughFrom?: string + throughTo?: string + formula?: string + formulaType?: string + main?: boolean + ignoreTimezones?: boolean + meta?: { + toTable: string + toKey: string + } + constraints?: { + type?: string + email?: boolean + inclusion?: string[] + length?: { + minimum?: string | number + maximum?: string | number + } + presence?: boolean + } +} + +export interface TableSchema { + [key: string]: FieldSchema +} + +export interface Table extends Document { + type?: string + views?: { [key: string]: View } + name: string + primary?: string[] + schema: TableSchema + primaryDisplay?: string + sourceId?: string + relatedFormula?: string[] + constrained?: string[] } diff --git a/packages/types/src/sdk/datasources.ts b/packages/types/src/sdk/datasources.ts new file mode 100644 index 0000000000..6e2f158c09 --- /dev/null +++ b/packages/types/src/sdk/datasources.ts @@ -0,0 +1,121 @@ +import { Table } from "../documents" + +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 QueryDefinition { + type: QueryTypes + displayName?: string + readable?: boolean + customisable?: boolean + fields?: object + urlDisplay?: boolean +} + +export interface ExtraQueryConfig { + [key: string]: { + displayName: string + type: string + required: boolean + data?: object + } +} + +export interface Integration { + docs: string + plus?: boolean + auth?: { type: string } + relationships?: boolean + description: string + friendlyName: string + type?: string + datasource: {} + query: { + [key: string]: QueryDefinition + } + extra?: ExtraQueryConfig +} + +export interface IntegrationBase { + create?(query: any): Promise + read?(query: any): Promise + update?(query: any): Promise + delete?(query: any): Promise +} + +export interface DatasourcePlus extends IntegrationBase { + tables: Record + schemaErrors: Record + + // if the datasource supports the use of bindings directly (to protect against SQL injection) + // this returns the format of the identifier + getBindingIdentifier(): string + getStringConcat(parts: string[]): string + buildSchema(datasourceId: string, entities: Record): any +} diff --git a/packages/types/src/sdk/index.ts b/packages/types/src/sdk/index.ts index 0f2eee6e13..d6ca92f607 100644 --- a/packages/types/src/sdk/index.ts +++ b/packages/types/src/sdk/index.ts @@ -3,3 +3,5 @@ export * from "./context" export * from "./events" export * from "./licensing" export * from "./migrations" +export * from "./datasources" +export * from "./search" diff --git a/packages/types/src/sdk/search.ts b/packages/types/src/sdk/search.ts new file mode 100644 index 0000000000..6721fe6b55 --- /dev/null +++ b/packages/types/src/sdk/search.ts @@ -0,0 +1,91 @@ +import { Operation, SortDirection } from "./datasources" +import { Row, Table } from "../documents" + +export interface SearchFilters { + allOr?: boolean + string?: { + [key: string]: string + } + fuzzy?: { + [key: string]: string + } + range?: { + [key: string]: { + high: number | string + low: number | string + } + } + equal?: { + [key: string]: any + } + notEqual?: { + [key: string]: any + } + empty?: { + [key: string]: any + } + notEmpty?: { + [key: string]: any + } + oneOf?: { + [key: string]: any[] + } + contains?: { + [key: string]: any + } +} + +export interface SortJson { + [key: string]: SortDirection +} + +export interface PaginationJson { + limit: number + page?: string | number +} + +export interface RenameColumn { + old: string + updated: string +} + +export interface RelationshipsJson { + through?: string + from?: string + to?: string + fromPrimary?: string + toPrimary?: string + tableName: string + column: string +} + +export interface QueryJson { + endpoint: { + datasourceId: string + entityId: string + operation: Operation + schema?: string + } + resource: { + fields: string[] + } + filters?: SearchFilters + sort?: SortJson + paginate?: PaginationJson + body?: Row | Row[] + table?: Table + meta?: { + table?: Table + tables?: Record + renamed: RenameColumn + } + extra?: { + idFilter?: SearchFilters + } + relationships?: RelationshipsJson[] +} + +export interface SqlQuery { + sql: string + bindings?: string[] +} From f48fcfd0c862135178aa82e3e70d9ec554e8a9e8 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 11 Aug 2022 12:24:36 +0100 Subject: [PATCH 19/23] Fixes based on re-trying everything with the new type structures (some empty structures being filled out affected things). --- packages/server/src/definitions/common.ts | 1 + .../server/src/migrations/functions/backfill/app/queries.ts | 5 +++-- packages/types/src/documents/app/datasource.ts | 6 +++--- packages/types/src/sdk/datasources.ts | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/server/src/definitions/common.ts b/packages/server/src/definitions/common.ts index cdbe82344f..dd7286213b 100644 --- a/packages/server/src/definitions/common.ts +++ b/packages/server/src/definitions/common.ts @@ -2,6 +2,7 @@ export { Query, Datasource } from "./datasource" export { FieldSchema, TableSchema, Table, Document, Row } from "@budibase/types" export interface Application extends Document { + _id: string appId?: string } diff --git a/packages/server/src/migrations/functions/backfill/app/queries.ts b/packages/server/src/migrations/functions/backfill/app/queries.ts index b2ea31c19c..c47a4061c7 100644 --- a/packages/server/src/migrations/functions/backfill/app/queries.ts +++ b/packages/server/src/migrations/functions/backfill/app/queries.ts @@ -1,6 +1,6 @@ import { events } from "@budibase/backend-core" import { getQueryParams } from "../../../../db/utils" -import { Query, Datasource } from "@budibase/types" +import { Query, Datasource, SourceNames } from "@budibase/types" const getQueries = async (appDb: any): Promise => { const response = await appDb.allDocs( @@ -31,8 +31,9 @@ export const backfill = async (appDb: any, timestamp: string | number) => { // and the query has not if (e.status === 404) { datasource = { + type: "unknown", _id: query.datasourceId, - source: "unknown", + source: SourceNames.UNKNOWN, } } else { throw e diff --git a/packages/types/src/documents/app/datasource.ts b/packages/types/src/documents/app/datasource.ts index 68f84e4b98..10bdd24afa 100644 --- a/packages/types/src/documents/app/datasource.ts +++ b/packages/types/src/documents/app/datasource.ts @@ -4,13 +4,13 @@ import { Table } from "./table" export interface Datasource extends Document { type: string - name: string + name?: string source: SourceNames // the config is defined by the schema - config: { + config?: { [key: string]: string | number | boolean } - plus: boolean + plus?: boolean entities?: { [key: string]: Table } diff --git a/packages/types/src/sdk/datasources.ts b/packages/types/src/sdk/datasources.ts index 6e2f158c09..e6b5582a6f 100644 --- a/packages/types/src/sdk/datasources.ts +++ b/packages/types/src/sdk/datasources.ts @@ -51,6 +51,7 @@ export enum SourceNames { FIRESTORE = "FIRESTORE", REDIS = "REDIS", SNOWFLAKE = "SNOWFLAKE", + UNKNOWN = "unknown", } export enum IncludeRelationships { From b920f8cb059e001c3a1327d27e2d82fd3c818eb0 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 11 Aug 2022 13:50:05 +0100 Subject: [PATCH 20/23] Replacing all plural TS enumerations with singular - this involves a major rename of the DocumentTypes. --- .../backend-core/src/cache/appMetadata.js | 4 +- .../backend-core/src/context/constants.ts | 2 +- packages/backend-core/src/context/index.ts | 54 +++++++------- packages/backend-core/src/context/utils.ts | 26 +++---- packages/backend-core/src/db/constants.ts | 12 ++-- packages/backend-core/src/db/utils.ts | 40 +++++------ packages/backend-core/src/db/views.js | 26 +++---- packages/backend-core/src/index.ts | 1 + .../src/middleware/authenticated.ts | 4 +- .../backend-core/src/migrations/migrations.ts | 6 +- packages/backend-core/src/security/roles.js | 8 +-- packages/backend-core/src/users.js | 8 +-- packages/backend-core/src/utils.js | 11 +-- .../server/src/api/controllers/analytics.ts | 4 +- .../server/src/api/controllers/application.ts | 18 ++--- .../server/src/api/controllers/automation.js | 4 +- packages/server/src/api/controllers/backup.js | 4 +- packages/server/src/api/controllers/cloud.js | 6 +- .../server/src/api/controllers/component.js | 4 +- .../server/src/api/controllers/datasource.js | 4 +- .../src/api/controllers/deploy/index.ts | 14 ++-- packages/server/src/api/controllers/dev.js | 6 +- .../server/src/api/controllers/integration.js | 4 +- .../src/api/controllers/public/utils.ts | 4 +- .../query/import/sources/openapi2.ts | 2 +- .../query/import/sources/openapi3.ts | 2 +- .../api/controllers/row/ExternalRequest.ts | 12 ++-- .../src/api/controllers/row/internal.js | 4 +- .../src/api/controllers/static/index.ts | 4 +- .../server/src/api/controllers/view/index.js | 4 +- .../server/src/api/controllers/view/utils.js | 4 +- packages/server/src/db/utils.js | 72 +++++++++---------- packages/server/src/db/views/staticViews.js | 4 +- .../server/src/definitions/automations.ts | 4 +- packages/server/src/definitions/common.ts | 12 +++- packages/server/src/definitions/datasource.ts | 29 -------- packages/server/src/integrations/airtable.ts | 28 ++++---- packages/server/src/integrations/arangodb.ts | 18 ++--- packages/server/src/integrations/base/sql.ts | 32 ++++----- .../server/src/integrations/base/sqlTable.ts | 7 +- .../server/src/integrations/base/utils.ts | 3 +- packages/server/src/integrations/couchdb.ts | 18 ++--- packages/server/src/integrations/dynamodb.ts | 44 ++++++------ .../server/src/integrations/elasticsearch.ts | 26 +++---- packages/server/src/integrations/firebase.ts | 26 +++---- .../server/src/integrations/googlesheets.ts | 30 ++++---- packages/server/src/integrations/index.ts | 68 +++++++++--------- .../src/integrations/microsoftSqlServer.ts | 30 ++++---- packages/server/src/integrations/mongodb.ts | 20 +++--- packages/server/src/integrations/mysql.ts | 30 ++++---- packages/server/src/integrations/oracle.ts | 26 +++---- packages/server/src/integrations/postgres.ts | 34 ++++----- packages/server/src/integrations/redis.ts | 20 +++--- packages/server/src/integrations/rest.ts | 34 ++++----- packages/server/src/integrations/s3.ts | 4 +- packages/server/src/integrations/snowflake.ts | 10 +-- .../server/src/integrations/tests/sql.spec.js | 14 ++-- packages/server/src/integrations/utils.ts | 17 +++-- packages/server/src/middleware/builder.js | 4 +- .../src/migrations/functions/appUrls.ts | 4 +- .../src/migrations/functions/backfill/app.ts | 2 +- .../functions/backfill/app/queries.ts | 4 +- .../functions/backfill/global/users.ts | 2 +- .../functions/tests/appUrls.spec.js | 6 +- .../server/src/migrations/tests/index.spec.ts | 4 +- .../src/tests/utilities/TestConfiguration.js | 4 +- packages/server/src/threads/automation.ts | 6 +- packages/server/src/utilities/security.js | 16 ++--- .../types/src/documents/app/datasource.ts | 4 +- packages/types/src/documents/app/row.ts | 2 +- packages/types/src/documents/index.ts | 1 + packages/types/src/sdk/datasources.ts | 12 ++-- .../src/api/controllers/global/roles.js | 4 +- 73 files changed, 502 insertions(+), 539 deletions(-) diff --git a/packages/backend-core/src/cache/appMetadata.js b/packages/backend-core/src/cache/appMetadata.js index b0d9481cbd..a7ff0d2fc1 100644 --- a/packages/backend-core/src/cache/appMetadata.js +++ b/packages/backend-core/src/cache/appMetadata.js @@ -1,6 +1,6 @@ const redis = require("../redis/init") const { doWithDB } = require("../db") -const { DocumentTypes } = require("../db/constants") +const { DocumentType } = require("../db/constants") const AppState = { INVALID: "invalid", @@ -14,7 +14,7 @@ const populateFromDB = async appId => { return doWithDB( appId, db => { - return db.get(DocumentTypes.APP_METADATA) + return db.get(DocumentType.APP_METADATA) }, { skip_setup: true } ) diff --git a/packages/backend-core/src/context/constants.ts b/packages/backend-core/src/context/constants.ts index ef8dcd7821..937ad8f248 100644 --- a/packages/backend-core/src/context/constants.ts +++ b/packages/backend-core/src/context/constants.ts @@ -1,4 +1,4 @@ -export enum ContextKeys { +export enum ContextKey { TENANT_ID = "tenantId", GLOBAL_DB = "globalDb", APP_ID = "appId", diff --git a/packages/backend-core/src/context/index.ts b/packages/backend-core/src/context/index.ts index 1e430f01de..78ce764d55 100644 --- a/packages/backend-core/src/context/index.ts +++ b/packages/backend-core/src/context/index.ts @@ -1,11 +1,11 @@ import env from "../environment" -import { SEPARATOR, DocumentTypes } from "../db/constants" +import { SEPARATOR, DocumentType } from "../db/constants" import cls from "./FunctionContext" import { dangerousGetDB, closeDB } from "../db" import { baseGlobalDBName } from "../tenancy/utils" import { IdentityContext } from "@budibase/types" import { DEFAULT_TENANT_ID as _DEFAULT_TENANT_ID } from "../constants" -import { ContextKeys } from "./constants" +import { ContextKey } from "./constants" import { updateUsing, closeWithUsing, @@ -33,8 +33,8 @@ export const closeTenancy = async () => { } await closeDB(db) // clear from context now that database is closed/task is finished - cls.setOnContext(ContextKeys.TENANT_ID, null) - cls.setOnContext(ContextKeys.GLOBAL_DB, null) + cls.setOnContext(ContextKey.TENANT_ID, null) + cls.setOnContext(ContextKey.GLOBAL_DB, null) } // export const isDefaultTenant = () => { @@ -54,7 +54,7 @@ export const getTenantIDFromAppID = (appId: string) => { return null } const split = appId.split(SEPARATOR) - const hasDev = split[1] === DocumentTypes.DEV + const hasDev = split[1] === DocumentType.DEV if ((hasDev && split.length === 3) || (!hasDev && split.length === 2)) { return null } @@ -83,14 +83,14 @@ export const doInTenant = (tenantId: string | null, task: any) => { // invoke the task return await task() } finally { - await closeWithUsing(ContextKeys.TENANCY_IN_USE, () => { + await closeWithUsing(ContextKey.TENANCY_IN_USE, () => { return closeTenancy() }) } } - const existing = cls.getFromContext(ContextKeys.TENANT_ID) === tenantId - return updateUsing(ContextKeys.TENANCY_IN_USE, existing, internal) + const existing = cls.getFromContext(ContextKey.TENANT_ID) === tenantId + return updateUsing(ContextKey.TENANCY_IN_USE, existing, internal) } export const doInAppContext = (appId: string, task: any) => { @@ -108,7 +108,7 @@ export const doInAppContext = (appId: string, task: any) => { setAppTenantId(appId) } // set the app ID - cls.setOnContext(ContextKeys.APP_ID, appId) + cls.setOnContext(ContextKey.APP_ID, appId) // preserve the identity if (identity) { @@ -118,14 +118,14 @@ export const doInAppContext = (appId: string, task: any) => { // invoke the task return await task() } finally { - await closeWithUsing(ContextKeys.APP_IN_USE, async () => { + await closeWithUsing(ContextKey.APP_IN_USE, async () => { await closeAppDBs() await closeTenancy() }) } } - const existing = cls.getFromContext(ContextKeys.APP_ID) === appId - return updateUsing(ContextKeys.APP_IN_USE, existing, internal) + const existing = cls.getFromContext(ContextKey.APP_ID) === appId + return updateUsing(ContextKey.APP_IN_USE, existing, internal) } export const doInIdentityContext = (identity: IdentityContext, task: any) => { @@ -135,7 +135,7 @@ export const doInIdentityContext = (identity: IdentityContext, task: any) => { async function internal(opts = { existing: false }) { if (!opts.existing) { - cls.setOnContext(ContextKeys.IDENTITY, identity) + cls.setOnContext(ContextKey.IDENTITY, identity) // set the tenant so that doInTenant will preserve identity if (identity.tenantId) { updateTenantId(identity.tenantId) @@ -146,27 +146,27 @@ export const doInIdentityContext = (identity: IdentityContext, task: any) => { // invoke the task return await task() } finally { - await closeWithUsing(ContextKeys.IDENTITY_IN_USE, async () => { + await closeWithUsing(ContextKey.IDENTITY_IN_USE, async () => { setIdentity(null) await closeTenancy() }) } } - const existing = cls.getFromContext(ContextKeys.IDENTITY) - return updateUsing(ContextKeys.IDENTITY_IN_USE, existing, internal) + const existing = cls.getFromContext(ContextKey.IDENTITY) + return updateUsing(ContextKey.IDENTITY_IN_USE, existing, internal) } export const getIdentity = (): IdentityContext | undefined => { try { - return cls.getFromContext(ContextKeys.IDENTITY) + return cls.getFromContext(ContextKey.IDENTITY) } catch (e) { // do nothing - identity is not in context } } export const updateTenantId = (tenantId: string | null) => { - cls.setOnContext(ContextKeys.TENANT_ID, tenantId) + cls.setOnContext(ContextKey.TENANT_ID, tenantId) if (env.USE_COUCH) { setGlobalDB(tenantId) } @@ -176,7 +176,7 @@ export const updateAppId = async (appId: string) => { try { // have to close first, before removing the databases from context await closeAppDBs() - cls.setOnContext(ContextKeys.APP_ID, appId) + cls.setOnContext(ContextKey.APP_ID, appId) } catch (err) { if (env.isTest()) { TEST_APP_ID = appId @@ -189,12 +189,12 @@ export const updateAppId = async (appId: string) => { export const setGlobalDB = (tenantId: string | null) => { const dbName = baseGlobalDBName(tenantId) const db = dangerousGetDB(dbName) - cls.setOnContext(ContextKeys.GLOBAL_DB, db) + cls.setOnContext(ContextKey.GLOBAL_DB, db) return db } export const getGlobalDB = () => { - const db = cls.getFromContext(ContextKeys.GLOBAL_DB) + const db = cls.getFromContext(ContextKey.GLOBAL_DB) if (!db) { throw new Error("Global DB not found") } @@ -202,7 +202,7 @@ export const getGlobalDB = () => { } export const isTenantIdSet = () => { - const tenantId = cls.getFromContext(ContextKeys.TENANT_ID) + const tenantId = cls.getFromContext(ContextKey.TENANT_ID) return !!tenantId } @@ -210,7 +210,7 @@ export const getTenantId = () => { if (!isMultiTenant()) { return DEFAULT_TENANT_ID } - const tenantId = cls.getFromContext(ContextKeys.TENANT_ID) + const tenantId = cls.getFromContext(ContextKey.TENANT_ID) if (!tenantId) { throw new Error("Tenant id not found") } @@ -218,7 +218,7 @@ export const getTenantId = () => { } export const getAppId = () => { - const foundId = cls.getFromContext(ContextKeys.APP_ID) + const foundId = cls.getFromContext(ContextKey.APP_ID) if (!foundId && env.isTest() && TEST_APP_ID) { return TEST_APP_ID } else { @@ -231,7 +231,7 @@ export const getAppId = () => { * contained, dev or prod. */ export const getAppDB = (opts?: any) => { - return getContextDB(ContextKeys.CURRENT_DB, opts) + return getContextDB(ContextKey.CURRENT_DB, opts) } /** @@ -239,7 +239,7 @@ export const getAppDB = (opts?: any) => { * contained a development app ID, this will open the prod one. */ export const getProdAppDB = (opts?: any) => { - return getContextDB(ContextKeys.PROD_DB, opts) + return getContextDB(ContextKey.PROD_DB, opts) } /** @@ -247,5 +247,5 @@ export const getProdAppDB = (opts?: any) => { * contained a prod app ID, this will open the dev one. */ export const getDevAppDB = (opts?: any) => { - return getContextDB(ContextKeys.DEV_DB, opts) + return getContextDB(ContextKey.DEV_DB, opts) } diff --git a/packages/backend-core/src/context/utils.ts b/packages/backend-core/src/context/utils.ts index 62693f18e8..6e7100b594 100644 --- a/packages/backend-core/src/context/utils.ts +++ b/packages/backend-core/src/context/utils.ts @@ -6,7 +6,7 @@ import { } from "./index" import cls from "./FunctionContext" import { IdentityContext } from "@budibase/types" -import { ContextKeys } from "./constants" +import { ContextKey } from "./constants" import { dangerousGetDB, closeDB } from "../db" import { isEqual } from "lodash" import { getDevelopmentAppID, getProdAppID } from "../db/conversions" @@ -47,17 +47,13 @@ export const setAppTenantId = (appId: string) => { } export const setIdentity = (identity: IdentityContext | null) => { - cls.setOnContext(ContextKeys.IDENTITY, identity) + cls.setOnContext(ContextKey.IDENTITY, identity) } // this function makes sure the PouchDB objects are closed and // fully deleted when finished - this protects against memory leaks export async function closeAppDBs() { - const dbKeys = [ - ContextKeys.CURRENT_DB, - ContextKeys.PROD_DB, - ContextKeys.DEV_DB, - ] + const dbKeys = [ContextKey.CURRENT_DB, ContextKey.PROD_DB, ContextKey.DEV_DB] for (let dbKey of dbKeys) { const db = cls.getFromContext(dbKey) if (!db) { @@ -68,16 +64,16 @@ export async function closeAppDBs() { cls.setOnContext(dbKey, null) } // clear the app ID now that the databases are closed - if (cls.getFromContext(ContextKeys.APP_ID)) { - cls.setOnContext(ContextKeys.APP_ID, null) + if (cls.getFromContext(ContextKey.APP_ID)) { + cls.setOnContext(ContextKey.APP_ID, null) } - if (cls.getFromContext(ContextKeys.DB_OPTS)) { - cls.setOnContext(ContextKeys.DB_OPTS, null) + if (cls.getFromContext(ContextKey.DB_OPTS)) { + cls.setOnContext(ContextKey.DB_OPTS, null) } } export function getContextDB(key: string, opts: any) { - const dbOptsKey = `${key}${ContextKeys.DB_OPTS}` + const dbOptsKey = `${key}${ContextKey.DB_OPTS}` let storedOpts = cls.getFromContext(dbOptsKey) let db = cls.getFromContext(key) if (db && isEqual(opts, storedOpts)) { @@ -88,13 +84,13 @@ export function getContextDB(key: string, opts: any) { let toUseAppId switch (key) { - case ContextKeys.CURRENT_DB: + case ContextKey.CURRENT_DB: toUseAppId = appId break - case ContextKeys.PROD_DB: + case ContextKey.PROD_DB: toUseAppId = getProdAppID(appId) break - case ContextKeys.DEV_DB: + case ContextKey.DEV_DB: toUseAppId = getDevelopmentAppID(appId) break } diff --git a/packages/backend-core/src/db/constants.ts b/packages/backend-core/src/db/constants.ts index 9c6be25424..460476da24 100644 --- a/packages/backend-core/src/db/constants.ts +++ b/packages/backend-core/src/db/constants.ts @@ -4,13 +4,13 @@ export const UNICODE_MAX = "\ufff0" /** * Can be used to create a few different forms of querying a view. */ -export enum AutomationViewModes { +export enum AutomationViewMode { ALL = "all", AUTOMATION = "automation", STATUS = "status", } -export enum ViewNames { +export enum ViewName { USER_BY_APP = "by_app", USER_BY_EMAIL = "by_email2", BY_API_KEY = "by_api_key", @@ -21,13 +21,13 @@ export enum ViewNames { } export const DeprecatedViews = { - [ViewNames.USER_BY_EMAIL]: [ + [ViewName.USER_BY_EMAIL]: [ // removed due to inaccuracy in view doc filter logic "by_email", ], } -export enum DocumentTypes { +export enum DocumentType { USER = "us", GROUP = "gr", WORKSPACE = "workspace", @@ -62,6 +62,6 @@ export const StaticDatabases = { }, } -export const APP_PREFIX = exports.DocumentTypes.APP + exports.SEPARATOR -export const APP_DEV = exports.DocumentTypes.APP_DEV + exports.SEPARATOR +export const APP_PREFIX = DocumentType.APP + SEPARATOR +export const APP_DEV = DocumentType.APP_DEV + SEPARATOR export const APP_DEV_PREFIX = APP_DEV diff --git a/packages/backend-core/src/db/utils.ts b/packages/backend-core/src/db/utils.ts index 8ab6fa6e98..41479c2b31 100644 --- a/packages/backend-core/src/db/utils.ts +++ b/packages/backend-core/src/db/utils.ts @@ -1,7 +1,7 @@ import { newid } from "../hashing" import { DEFAULT_TENANT_ID, Configs } from "../constants" import env from "../environment" -import { SEPARATOR, DocumentTypes, UNICODE_MAX, ViewNames } from "./constants" +import { SEPARATOR, DocumentType, UNICODE_MAX, ViewName } from "./constants" import { getTenantId, getGlobalDBName, getGlobalDB } from "../tenancy" import fetch from "node-fetch" import { doWithDB, allDbs } from "./index" @@ -58,7 +58,7 @@ export function getDocParams( /** * Retrieve the correct index for a view based on default design DB. */ -export function getQueryIndex(viewName: ViewNames) { +export function getQueryIndex(viewName: ViewName) { return `database/${viewName}` } @@ -67,7 +67,7 @@ export function getQueryIndex(viewName: ViewNames) { * @returns {string} The new workspace ID which the workspace doc can be stored under. */ export function generateWorkspaceID() { - return `${DocumentTypes.WORKSPACE}${SEPARATOR}${newid()}` + return `${DocumentType.WORKSPACE}${SEPARATOR}${newid()}` } /** @@ -76,8 +76,8 @@ export function generateWorkspaceID() { export function getWorkspaceParams(id = "", otherProps = {}) { return { ...otherProps, - startkey: `${DocumentTypes.WORKSPACE}${SEPARATOR}${id}`, - endkey: `${DocumentTypes.WORKSPACE}${SEPARATOR}${id}${UNICODE_MAX}`, + startkey: `${DocumentType.WORKSPACE}${SEPARATOR}${id}`, + endkey: `${DocumentType.WORKSPACE}${SEPARATOR}${id}${UNICODE_MAX}`, } } @@ -86,7 +86,7 @@ export function getWorkspaceParams(id = "", otherProps = {}) { * @returns {string} The new user ID which the user doc can be stored under. */ export function generateGlobalUserID(id?: any) { - return `${DocumentTypes.USER}${SEPARATOR}${id || newid()}` + return `${DocumentType.USER}${SEPARATOR}${id || newid()}` } /** @@ -102,8 +102,8 @@ export function getGlobalUserParams(globalId: any, otherProps: any = {}) { // need to include this incase pagination startkey: startkey ? startkey - : `${DocumentTypes.USER}${SEPARATOR}${globalId}`, - endkey: `${DocumentTypes.USER}${SEPARATOR}${globalId}${UNICODE_MAX}`, + : `${DocumentType.USER}${SEPARATOR}${globalId}`, + endkey: `${DocumentType.USER}${SEPARATOR}${globalId}${UNICODE_MAX}`, } } @@ -121,7 +121,7 @@ export function getUsersByAppParams(appId: any, otherProps: any = {}) { * @param ownerId The owner/user of the template, this could be global or a workspace level. */ export function generateTemplateID(ownerId: any) { - return `${DocumentTypes.TEMPLATE}${SEPARATOR}${ownerId}${SEPARATOR}${newid()}` + return `${DocumentType.TEMPLATE}${SEPARATOR}${ownerId}${SEPARATOR}${newid()}` } export function generateAppUserID(prodAppId: string, userId: string) { @@ -143,7 +143,7 @@ export function getTemplateParams( if (templateId) { final = templateId } else { - final = `${DocumentTypes.TEMPLATE}${SEPARATOR}${ownerId}${SEPARATOR}` + final = `${DocumentType.TEMPLATE}${SEPARATOR}${ownerId}${SEPARATOR}` } return { ...otherProps, @@ -157,14 +157,14 @@ export function getTemplateParams( * @returns {string} The new role ID which the role doc can be stored under. */ export function generateRoleID(id: any) { - return `${DocumentTypes.ROLE}${SEPARATOR}${id || newid()}` + return `${DocumentType.ROLE}${SEPARATOR}${id || newid()}` } /** * Gets parameters for retrieving a role, this is a utility function for the getDocParams function. */ export function getRoleParams(roleId = null, otherProps = {}) { - return getDocParams(DocumentTypes.ROLE, roleId, otherProps) + return getDocParams(DocumentType.ROLE, roleId, otherProps) } export function getStartEndKeyURL(base: any, baseKey: any, tenantId = null) { @@ -211,9 +211,9 @@ export async function getAllDbs(opts = { efficient: false }) { await addDbs(couchUrl) } else { // get prod apps - await addDbs(getStartEndKeyURL(couchUrl, DocumentTypes.APP, tenantId)) + await addDbs(getStartEndKeyURL(couchUrl, DocumentType.APP, tenantId)) // get dev apps - await addDbs(getStartEndKeyURL(couchUrl, DocumentTypes.APP_DEV, tenantId)) + await addDbs(getStartEndKeyURL(couchUrl, DocumentType.APP_DEV, tenantId)) // add global db name dbs.push(getGlobalDBName(tenantId)) } @@ -235,12 +235,12 @@ export async function getAllApps({ dev, all, idsOnly, efficient }: any = {}) { const appDbNames = dbs.filter((dbName: any) => { const split = dbName.split(SEPARATOR) // it is an app, check the tenantId - if (split[0] === DocumentTypes.APP) { + if (split[0] === DocumentType.APP) { // tenantId is always right before the UUID const possibleTenantId = split[split.length - 2] const noTenantId = - split.length === 2 || possibleTenantId === DocumentTypes.DEV + split.length === 2 || possibleTenantId === DocumentType.DEV return ( (tenantId === DEFAULT_TENANT_ID && noTenantId) || @@ -326,7 +326,7 @@ export async function dbExists(dbName: any) { export const generateConfigID = ({ type, workspace, user }: any) => { const scope = [type, workspace, user].filter(Boolean).join(SEPARATOR) - return `${DocumentTypes.CONFIG}${SEPARATOR}${scope}` + return `${DocumentType.CONFIG}${SEPARATOR}${scope}` } /** @@ -340,8 +340,8 @@ export const getConfigParams = ( return { ...otherProps, - startkey: `${DocumentTypes.CONFIG}${SEPARATOR}${scope}`, - endkey: `${DocumentTypes.CONFIG}${SEPARATOR}${scope}${UNICODE_MAX}`, + startkey: `${DocumentType.CONFIG}${SEPARATOR}${scope}`, + endkey: `${DocumentType.CONFIG}${SEPARATOR}${scope}${UNICODE_MAX}`, } } @@ -350,7 +350,7 @@ export const getConfigParams = ( * @returns {string} The new dev info ID which info for dev (like api key) can be stored under. */ export const generateDevInfoID = (userId: any) => { - return `${DocumentTypes.DEV_INFO}${SEPARATOR}${userId}` + return `${DocumentType.DEV_INFO}${SEPARATOR}${userId}` } /** diff --git a/packages/backend-core/src/db/views.js b/packages/backend-core/src/db/views.js index baf1807ca5..3a45611a8f 100644 --- a/packages/backend-core/src/db/views.js +++ b/packages/backend-core/src/db/views.js @@ -1,6 +1,6 @@ const { - DocumentTypes, - ViewNames, + DocumentType, + ViewName, DeprecatedViews, SEPARATOR, } = require("./utils") @@ -44,14 +44,14 @@ exports.createNewUserEmailView = async () => { const view = { // if using variables in a map function need to inject them before use map: `function(doc) { - if (doc._id.startsWith("${DocumentTypes.USER}${SEPARATOR}")) { + if (doc._id.startsWith("${DocumentType.USER}${SEPARATOR}")) { emit(doc.email.toLowerCase(), doc._id) } }`, } designDoc.views = { ...designDoc.views, - [ViewNames.USER_BY_EMAIL]: view, + [ViewName.USER_BY_EMAIL]: view, } await db.put(designDoc) } @@ -68,7 +68,7 @@ exports.createUserAppView = async () => { const view = { // if using variables in a map function need to inject them before use map: `function(doc) { - if (doc._id.startsWith("${DocumentTypes.USER}${SEPARATOR}") && doc.roles) { + if (doc._id.startsWith("${DocumentType.USER}${SEPARATOR}") && doc.roles) { for (let prodAppId of Object.keys(doc.roles)) { let emitted = prodAppId + "${SEPARATOR}" + doc._id emit(emitted, null) @@ -78,7 +78,7 @@ exports.createUserAppView = async () => { } designDoc.views = { ...designDoc.views, - [ViewNames.USER_BY_APP]: view, + [ViewName.USER_BY_APP]: view, } await db.put(designDoc) } @@ -93,14 +93,14 @@ exports.createApiKeyView = async () => { } const view = { map: `function(doc) { - if (doc._id.startsWith("${DocumentTypes.DEV_INFO}") && doc.apiKey) { + if (doc._id.startsWith("${DocumentType.DEV_INFO}") && doc.apiKey) { emit(doc.apiKey, doc.userId) } }`, } designDoc.views = { ...designDoc.views, - [ViewNames.BY_API_KEY]: view, + [ViewName.BY_API_KEY]: view, } await db.put(designDoc) } @@ -123,17 +123,17 @@ exports.createUserBuildersView = async () => { } designDoc.views = { ...designDoc.views, - [ViewNames.USER_BY_BUILDERS]: view, + [ViewName.USER_BY_BUILDERS]: view, } await db.put(designDoc) } exports.queryGlobalView = async (viewName, params, db = null) => { const CreateFuncByName = { - [ViewNames.USER_BY_EMAIL]: exports.createNewUserEmailView, - [ViewNames.BY_API_KEY]: exports.createApiKeyView, - [ViewNames.USER_BY_BUILDERS]: exports.createUserBuildersView, - [ViewNames.USER_BY_APP]: exports.createUserAppView, + [ViewName.USER_BY_EMAIL]: exports.createNewUserEmailView, + [ViewName.BY_API_KEY]: exports.createApiKeyView, + [ViewName.USER_BY_BUILDERS]: exports.createUserBuildersView, + [ViewName.USER_BY_APP]: exports.createUserAppView, } // can pass DB in if working with something specific if (!db) { diff --git a/packages/backend-core/src/index.ts b/packages/backend-core/src/index.ts index e585d4b6c3..6d2e8dcd10 100644 --- a/packages/backend-core/src/index.ts +++ b/packages/backend-core/src/index.ts @@ -1,4 +1,5 @@ import errors from "./errors" + const errorClasses = errors.errors import * as events from "./events" import * as migrations from "./migrations" diff --git a/packages/backend-core/src/middleware/authenticated.ts b/packages/backend-core/src/middleware/authenticated.ts index 3406b00812..b51ead46b9 100644 --- a/packages/backend-core/src/middleware/authenticated.ts +++ b/packages/backend-core/src/middleware/authenticated.ts @@ -4,7 +4,7 @@ import { getUser } from "../cache/user" import { getSession, updateSessionTTL } from "../security/sessions" import { buildMatcherRegex, matches } from "./matchers" import { SEPARATOR } from "../db/constants" -import { ViewNames } from "../db/utils" +import { ViewName } from "../db/utils" import { queryGlobalView } from "../db/views" import { getGlobalDB, doInTenant } from "../tenancy" import { decrypt } from "../security/encryption" @@ -43,7 +43,7 @@ async function checkApiKey(apiKey: string, populateUser?: Function) { const db = getGlobalDB() // api key is encrypted in the database const userId = await queryGlobalView( - ViewNames.BY_API_KEY, + ViewName.BY_API_KEY, { key: apiKey, }, diff --git a/packages/backend-core/src/migrations/migrations.ts b/packages/backend-core/src/migrations/migrations.ts index 2e4ef0da76..ca238ff80e 100644 --- a/packages/backend-core/src/migrations/migrations.ts +++ b/packages/backend-core/src/migrations/migrations.ts @@ -1,6 +1,6 @@ import { DEFAULT_TENANT_ID } from "../constants" import { doWithDB } from "../db" -import { DocumentTypes, StaticDatabases } from "../db/constants" +import { DocumentType, StaticDatabases } from "../db/constants" import { getAllApps } from "../db/utils" import environment from "../environment" import { @@ -21,10 +21,10 @@ import { export const getMigrationsDoc = async (db: any) => { // get the migrations doc try { - return await db.get(DocumentTypes.MIGRATIONS) + return await db.get(DocumentType.MIGRATIONS) } catch (err: any) { if (err.status && err.status === 404) { - return { _id: DocumentTypes.MIGRATIONS } + return { _id: DocumentType.MIGRATIONS } } else { console.error(err) throw err diff --git a/packages/backend-core/src/security/roles.js b/packages/backend-core/src/security/roles.js index 30869da68e..983aebf676 100644 --- a/packages/backend-core/src/security/roles.js +++ b/packages/backend-core/src/security/roles.js @@ -3,7 +3,7 @@ const { BUILTIN_PERMISSION_IDS, PermissionLevels } = require("./permissions") const { generateRoleID, getRoleParams, - DocumentTypes, + DocumentType, SEPARATOR, } = require("../db/utils") const { getAppDB } = require("../context") @@ -338,7 +338,7 @@ class AccessController { * Adds the "role_" for builtin role IDs which are to be written to the DB (for permissions). */ exports.getDBRoleID = roleId => { - if (roleId.startsWith(DocumentTypes.ROLE)) { + if (roleId.startsWith(DocumentType.ROLE)) { return roleId } return generateRoleID(roleId) @@ -349,8 +349,8 @@ exports.getDBRoleID = roleId => { */ exports.getExternalRoleID = roleId => { // for built in roles we want to remove the DB role ID element (role_) - if (roleId.startsWith(DocumentTypes.ROLE) && isBuiltin(roleId)) { - return roleId.split(`${DocumentTypes.ROLE}${SEPARATOR}`)[1] + if (roleId.startsWith(DocumentType.ROLE) && isBuiltin(roleId)) { + return roleId.split(`${DocumentType.ROLE}${SEPARATOR}`)[1] } return roleId } diff --git a/packages/backend-core/src/users.js b/packages/backend-core/src/users.js index 34d546a8bb..de5ce238c1 100644 --- a/packages/backend-core/src/users.js +++ b/packages/backend-core/src/users.js @@ -1,5 +1,5 @@ const { - ViewNames, + ViewName, getUsersByAppParams, getProdAppID, generateAppUserID, @@ -18,7 +18,7 @@ exports.getGlobalUserByEmail = async email => { throw "Must supply an email address to view" } - return await queryGlobalView(ViewNames.USER_BY_EMAIL, { + return await queryGlobalView(ViewName.USER_BY_EMAIL, { key: email.toLowerCase(), include_docs: true, }) @@ -32,7 +32,7 @@ exports.searchGlobalUsersByApp = async (appId, opts) => { include_docs: true, }) params.startkey = opts && opts.startkey ? opts.startkey : params.startkey - let response = await queryGlobalView(ViewNames.USER_BY_APP, params) + let response = await queryGlobalView(ViewName.USER_BY_APP, params) if (!response) { response = [] } @@ -56,7 +56,7 @@ exports.searchGlobalUsersByEmail = async (email, opts) => { const lcEmail = email.toLowerCase() // handle if passing up startkey for pagination const startkey = opts && opts.startkey ? opts.startkey : lcEmail - let response = await queryGlobalView(ViewNames.USER_BY_EMAIL, { + let response = await queryGlobalView(ViewName.USER_BY_EMAIL, { ...opts, startkey, endkey: `${lcEmail}${UNICODE_MAX}`, diff --git a/packages/backend-core/src/utils.js b/packages/backend-core/src/utils.js index 1e143968d9..0587267e9a 100644 --- a/packages/backend-core/src/utils.js +++ b/packages/backend-core/src/utils.js @@ -1,9 +1,4 @@ -const { - DocumentTypes, - SEPARATOR, - ViewNames, - getAllApps, -} = require("./db/utils") +const { DocumentType, SEPARATOR, ViewName, getAllApps } = require("./db/utils") const jwt = require("jsonwebtoken") const { options } = require("./middleware/passport/jwt") const { queryGlobalView } = require("./db/views") @@ -17,7 +12,7 @@ const { const events = require("./events") const tenancy = require("./tenancy") -const APP_PREFIX = DocumentTypes.APP + SEPARATOR +const APP_PREFIX = DocumentType.APP + SEPARATOR const PROD_APP_PREFIX = "/app/" function confirmAppId(possibleAppId) { @@ -154,7 +149,7 @@ exports.isClient = ctx => { } const getBuilders = async () => { - const builders = await queryGlobalView(ViewNames.USER_BY_BUILDERS, { + const builders = await queryGlobalView(ViewName.USER_BY_BUILDERS, { include_docs: false, }) diff --git a/packages/server/src/api/controllers/analytics.ts b/packages/server/src/api/controllers/analytics.ts index 44a99bbbb6..6c80593d5d 100644 --- a/packages/server/src/api/controllers/analytics.ts +++ b/packages/server/src/api/controllers/analytics.ts @@ -1,6 +1,6 @@ import { events } from "@budibase/backend-core" import { AnalyticsPingRequest, PingSource } from "@budibase/types" -import { DocumentTypes, isDevAppID } from "../../db/utils" +import { DocumentType, isDevAppID } from "../../db/utils" import { context } from "@budibase/backend-core" export const isEnabled = async (ctx: any) => { @@ -15,7 +15,7 @@ export const ping = async (ctx: any) => { switch (body.source) { case PingSource.APP: { const db = context.getAppDB({ skip_setup: true }) - const appInfo = await db.get(DocumentTypes.APP_METADATA) + const appInfo = await db.get(DocumentType.APP_METADATA) let appId = context.getAppId() if (isDevAppID(appId)) { diff --git a/packages/server/src/api/controllers/application.ts b/packages/server/src/api/controllers/application.ts index 57a18e7df3..ae4a60d78d 100644 --- a/packages/server/src/api/controllers/application.ts +++ b/packages/server/src/api/controllers/application.ts @@ -15,7 +15,7 @@ import { getLayoutParams, getScreenParams, generateDevAppID, - DocumentTypes, + DocumentType, AppStatus, } from "../../db/utils" const { @@ -206,7 +206,7 @@ export const fetchAppDefinition = async (ctx: any) => { export const fetchAppPackage = async (ctx: any) => { const db = context.getAppDB() - const application = await db.get(DocumentTypes.APP_METADATA) + const application = await db.get(DocumentType.APP_METADATA) const layouts = await getLayouts() let screens = await getScreens() @@ -248,13 +248,13 @@ const performAppCreate = async (ctx: any) => { let _rev try { // if template there will be an existing doc - const existing = await db.get(DocumentTypes.APP_METADATA) + const existing = await db.get(DocumentType.APP_METADATA) _rev = existing._rev } catch (err) { // nothing to do } const newApplication: App = { - _id: DocumentTypes.APP_METADATA, + _id: DocumentType.APP_METADATA, _rev, appId: instance._id, type: "app", @@ -383,7 +383,7 @@ export const update = async (ctx: any) => { export const updateClient = async (ctx: any) => { // Get current app version const db = context.getAppDB() - const application = await db.get(DocumentTypes.APP_METADATA) + const application = await db.get(DocumentType.APP_METADATA) const currentVersion = application.version // Update client library and manifest @@ -407,7 +407,7 @@ export const updateClient = async (ctx: any) => { export const revertClient = async (ctx: any) => { // Check app can be reverted const db = context.getAppDB() - const application = await db.get(DocumentTypes.APP_METADATA) + const application = await db.get(DocumentType.APP_METADATA) if (!application.revertableVersion) { ctx.throw(400, "There is no version to revert to") } @@ -439,7 +439,7 @@ const destroyApp = async (ctx: any) => { } const db = isUnpublish ? context.getProdAppDB() : context.getAppDB() - const app = await db.get(DocumentTypes.APP_METADATA) + const app = await db.get(DocumentType.APP_METADATA) const result = await db.destroy() if (isUnpublish) { @@ -526,7 +526,7 @@ export const sync = async (ctx: any, next: any) => { try { await replication.replicate({ filter: function (doc: any) { - return doc._id !== DocumentTypes.APP_METADATA + return doc._id !== DocumentType.APP_METADATA }, }) } catch (err) { @@ -550,7 +550,7 @@ export const sync = async (ctx: any, next: any) => { const updateAppPackage = async (appPackage: any, appId: any) => { return context.doInAppContext(appId, async () => { const db = context.getAppDB() - const application = await db.get(DocumentTypes.APP_METADATA) + const application = await db.get(DocumentType.APP_METADATA) const newAppPackage = { ...application, ...appPackage } if (appPackage._rev !== application._rev) { diff --git a/packages/server/src/api/controllers/automation.js b/packages/server/src/api/controllers/automation.js index 775fe03b0f..2190adc3b9 100644 --- a/packages/server/src/api/controllers/automation.js +++ b/packages/server/src/api/controllers/automation.js @@ -3,7 +3,7 @@ const triggers = require("../../automations/triggers") const { getAutomationParams, generateAutomationID, - DocumentTypes, + DocumentType, } = require("../../db/utils") const { checkForWebhooks, @@ -201,7 +201,7 @@ exports.clearLogError = async function (ctx) { const { automationId, appId } = ctx.request.body await doInAppContext(appId, async () => { const db = getProdAppDB() - const metadata = await db.get(DocumentTypes.APP_METADATA) + const metadata = await db.get(DocumentType.APP_METADATA) if (!automationId) { delete metadata.automationErrors } else if ( diff --git a/packages/server/src/api/controllers/backup.js b/packages/server/src/api/controllers/backup.js index f92b3fb256..a31ab134db 100644 --- a/packages/server/src/api/controllers/backup.js +++ b/packages/server/src/api/controllers/backup.js @@ -1,6 +1,6 @@ const { streamBackup } = require("../../utilities/fileSystem") const { events, context } = require("@budibase/backend-core") -const { DocumentTypes } = require("../../db/utils") +const { DocumentType } = require("../../db/utils") exports.exportAppDump = async function (ctx) { let { appId, excludeRows } = ctx.query @@ -12,7 +12,7 @@ exports.exportAppDump = async function (ctx) { await context.doInAppContext(appId, async () => { const appDb = context.getAppDB() - const app = await appDb.get(DocumentTypes.APP_METADATA) + const app = await appDb.get(DocumentType.APP_METADATA) await events.app.exported(app) }) } diff --git a/packages/server/src/api/controllers/cloud.js b/packages/server/src/api/controllers/cloud.js index 38804f4d4a..7be8b14bcd 100644 --- a/packages/server/src/api/controllers/cloud.js +++ b/packages/server/src/api/controllers/cloud.js @@ -11,7 +11,7 @@ const { getGlobalDB, } = require("@budibase/backend-core/tenancy") const { create } = require("./application") -const { getDocParams, DocumentTypes, isDevAppID } = require("../../db/utils") +const { getDocParams, DocumentType, isDevAppID } = require("../../db/utils") async function createApp(appName, appImport) { const ctx = { @@ -31,7 +31,7 @@ exports.exportApps = async ctx => { } const apps = await getAllApps({ all: true }) const globalDBString = await exportDB(getGlobalDBName(), { - filter: doc => !doc._id.startsWith(DocumentTypes.USER), + filter: doc => !doc._id.startsWith(DocumentType.USER), }) let allDBs = { global: globalDBString, @@ -97,7 +97,7 @@ exports.importApps = async ctx => { } // if there are any users make sure to remove them - let users = await getAllDocType(globalDb, DocumentTypes.USER) + let users = await getAllDocType(globalDb, DocumentType.USER) let userDeletionPromises = [] for (let user of users) { userDeletionPromises.push(globalDb.remove(user._id, user._rev)) diff --git a/packages/server/src/api/controllers/component.js b/packages/server/src/api/controllers/component.js index 2d0aaea23a..dec5aebb7c 100644 --- a/packages/server/src/api/controllers/component.js +++ b/packages/server/src/api/controllers/component.js @@ -1,10 +1,10 @@ -const { DocumentTypes } = require("../../db/utils") +const { DocumentType } = require("../../db/utils") const { getComponentLibraryManifest } = require("../../utilities/fileSystem") const { getAppDB } = require("@budibase/backend-core/context") exports.fetchAppComponentDefinitions = async function (ctx) { const db = getAppDB() - const app = await db.get(DocumentTypes.APP_METADATA) + const app = await db.get(DocumentType.APP_METADATA) let componentManifests = await Promise.all( app.componentLibraries.map(async library => { diff --git a/packages/server/src/api/controllers/datasource.js b/packages/server/src/api/controllers/datasource.js index 379b719f4f..8b9b765a5f 100644 --- a/packages/server/src/api/controllers/datasource.js +++ b/packages/server/src/api/controllers/datasource.js @@ -2,7 +2,7 @@ const { generateDatasourceID, getDatasourceParams, getQueryParams, - DocumentTypes, + DocumentType, BudibaseInternalDB, getTableParams, } = require("../../db/utils") @@ -132,7 +132,7 @@ exports.save = async function (ctx) { const datasource = { _id: generateDatasourceID({ plus }), - type: plus ? DocumentTypes.DATASOURCE_PLUS : DocumentTypes.DATASOURCE, + type: plus ? DocumentType.DATASOURCE_PLUS : DocumentType.DATASOURCE, ...ctx.request.body.datasource, } diff --git a/packages/server/src/api/controllers/deploy/index.ts b/packages/server/src/api/controllers/deploy/index.ts index e2b66fc936..d63e167dfb 100644 --- a/packages/server/src/api/controllers/deploy/index.ts +++ b/packages/server/src/api/controllers/deploy/index.ts @@ -4,7 +4,7 @@ import { getProdAppID, getDevelopmentAppID, } from "@budibase/backend-core/db" -import { DocumentTypes, getAutomationParams } from "../../../db/utils" +import { DocumentType, getAutomationParams } from "../../../db/utils" import { disableAllCrons, enableCronTrigger, @@ -52,9 +52,9 @@ async function storeDeploymentHistory(deployment: any) { let deploymentDoc try { // theres only one deployment doc per app database - deploymentDoc = await db.get(DocumentTypes.DEPLOYMENTS) + deploymentDoc = await db.get(DocumentType.DEPLOYMENTS) } catch (err) { - deploymentDoc = { _id: DocumentTypes.DEPLOYMENTS, history: {} } + deploymentDoc = { _id: DocumentType.DEPLOYMENTS, history: {} } } const deploymentId = deploymentJSON._id @@ -115,7 +115,7 @@ async function deployApp(deployment: any) { await replication.replicate() console.log("replication complete.. replacing app meta doc") const db = getProdAppDB() - const appDoc = await db.get(DocumentTypes.APP_METADATA) + const appDoc = await db.get(DocumentType.APP_METADATA) deployment.appUrl = appDoc.url @@ -146,7 +146,7 @@ async function deployApp(deployment: any) { export async function fetchDeployments(ctx: any) { try { const db = getAppDB() - const deploymentDoc = await db.get(DocumentTypes.DEPLOYMENTS) + const deploymentDoc = await db.get(DocumentType.DEPLOYMENTS) const { updated, deployments } = await checkAllDeployments(deploymentDoc) if (updated) { await db.put(deployments) @@ -160,7 +160,7 @@ export async function fetchDeployments(ctx: any) { export async function deploymentProgress(ctx: any) { try { const db = getAppDB() - const deploymentDoc = await db.get(DocumentTypes.DEPLOYMENTS) + const deploymentDoc = await db.get(DocumentType.DEPLOYMENTS) ctx.body = deploymentDoc[ctx.params.deploymentId] } catch (err) { ctx.throw( @@ -173,7 +173,7 @@ export async function deploymentProgress(ctx: any) { const isFirstDeploy = async () => { try { const db = getProdAppDB() - await db.get(DocumentTypes.APP_METADATA) + await db.get(DocumentType.APP_METADATA) } catch (e: any) { if (e.status === 404) { return true diff --git a/packages/server/src/api/controllers/dev.js b/packages/server/src/api/controllers/dev.js index 3c5835ac21..8438175ca8 100644 --- a/packages/server/src/api/controllers/dev.js +++ b/packages/server/src/api/controllers/dev.js @@ -4,7 +4,7 @@ const { checkSlashesInUrl } = require("../../utilities") const { request } = require("../../utilities/workerRequests") const { clearLock } = require("../../utilities/redis") const { Replication, getProdAppID } = require("@budibase/backend-core/db") -const { DocumentTypes } = require("../../db/utils") +const { DocumentType } = require("../../db/utils") const { app: appCache } = require("@budibase/backend-core/cache") const { getProdAppDB, getAppDB } = require("@budibase/backend-core/context") const { events } = require("@budibase/backend-core") @@ -87,7 +87,7 @@ exports.revert = async ctx => { if (info.error) { throw info.error } - const deploymentDoc = await db.get(DocumentTypes.DEPLOYMENTS) + const deploymentDoc = await db.get(DocumentType.DEPLOYMENTS) if ( !deploymentDoc.history || Object.keys(deploymentDoc.history).length === 0 @@ -110,7 +110,7 @@ exports.revert = async ctx => { // update appID in reverted app to be dev version again const db = getAppDB() - const appDoc = await db.get(DocumentTypes.APP_METADATA) + const appDoc = await db.get(DocumentType.APP_METADATA) appDoc.appId = appId appDoc.instance._id = appId await db.put(appDoc) diff --git a/packages/server/src/api/controllers/integration.js b/packages/server/src/api/controllers/integration.js index 28748541c4..cc9efac93a 100644 --- a/packages/server/src/api/controllers/integration.js +++ b/packages/server/src/api/controllers/integration.js @@ -1,6 +1,6 @@ const { cloneDeep } = require("lodash") const { definitions } = require("../../integrations") -const { SourceNames } = require("../../definitions/datasource") +const { SourceName } = require("@budibase/types") const googlesheets = require("../../integrations/googlesheets") const { featureFlags } = require("@budibase/backend-core") @@ -10,7 +10,7 @@ exports.fetch = async function (ctx) { // for google sheets integration google verification if (featureFlags.isEnabled(featureFlags.FeatureFlag.GOOGLE_SHEETS)) { - defs[SourceNames.GOOGLE_SHEETS] = googlesheets.schema + defs[SourceName.GOOGLE_SHEETS] = googlesheets.schema } ctx.body = defs diff --git a/packages/server/src/api/controllers/public/utils.ts b/packages/server/src/api/controllers/public/utils.ts index 8a7d7c4f4e..d86eced9ba 100644 --- a/packages/server/src/api/controllers/public/utils.ts +++ b/packages/server/src/api/controllers/public/utils.ts @@ -1,6 +1,6 @@ const { getAppDB } = require("@budibase/backend-core/context") import { isExternalTable } from "../../../integrations/utils" -import { APP_PREFIX, DocumentTypes } from "../../../db/utils" +import { APP_PREFIX, DocumentType } from "../../../db/utils" export async function addRev( body: { _id?: string; _rev?: string }, @@ -11,7 +11,7 @@ export async function addRev( } let id = body._id if (body._id.startsWith(APP_PREFIX)) { - id = DocumentTypes.APP_METADATA + id = DocumentType.APP_METADATA } const db = getAppDB() const dbDoc = await db.get(id) diff --git a/packages/server/src/api/controllers/query/import/sources/openapi2.ts b/packages/server/src/api/controllers/query/import/sources/openapi2.ts index e2dcec7613..230647475e 100644 --- a/packages/server/src/api/controllers/query/import/sources/openapi2.ts +++ b/packages/server/src/api/controllers/query/import/sources/openapi2.ts @@ -1,5 +1,5 @@ import { ImportInfo } from "./base" -import { Query, QueryParameter } from "../../../../../definitions/datasource" +import { Query, QueryParameter } from "@budibase/types" import { OpenAPIV2 } from "openapi-types" import { OpenAPISource } from "./base/openapi" import { URL } from "url" diff --git a/packages/server/src/api/controllers/query/import/sources/openapi3.ts b/packages/server/src/api/controllers/query/import/sources/openapi3.ts index f08f21e495..f86f684c32 100644 --- a/packages/server/src/api/controllers/query/import/sources/openapi3.ts +++ b/packages/server/src/api/controllers/query/import/sources/openapi3.ts @@ -1,5 +1,5 @@ import { ImportInfo } from "./base" -import { Query, QueryParameter } from "../../../../../definitions/datasource" +import { Query, QueryParameter } from "@budibase/types" import { OpenAPIV3 } from "openapi-types" import { OpenAPISource } from "./base/openapi" import { URL } from "url" diff --git a/packages/server/src/api/controllers/row/ExternalRequest.ts b/packages/server/src/api/controllers/row/ExternalRequest.ts index 7983044f66..a1aecdb0f2 100644 --- a/packages/server/src/api/controllers/row/ExternalRequest.ts +++ b/packages/server/src/api/controllers/row/ExternalRequest.ts @@ -1,18 +1,16 @@ import { - FilterTypes, - IncludeRelationships, + FilterType, + IncludeRelationship, Operation, PaginationJson, RelationshipsJson, SearchFilters, SortJson, -} from "../../../definitions/datasource" -import { Datasource, FieldSchema, Row, Table, -} from "../../../definitions/common" +} from "@budibase/types" import { breakRowIdField, generateRowIdField, @@ -128,7 +126,7 @@ module External { if ( typeof filter !== "object" || Object.keys(filter).length === 0 || - key === FilterTypes.ONE_OF + key === FilterType.ONE_OF ) { continue } @@ -634,7 +632,7 @@ module External { */ buildFields( table: Table, - includeRelations: IncludeRelationships = IncludeRelationships.INCLUDE + includeRelations: IncludeRelationship = IncludeRelationship.INCLUDE ) { function extractRealFields(table: Table, existing: string[] = []) { return Object.entries(table.schema) diff --git a/packages/server/src/api/controllers/row/internal.js b/packages/server/src/api/controllers/row/internal.js index b2b932a69a..086e1d9ce4 100644 --- a/packages/server/src/api/controllers/row/internal.js +++ b/packages/server/src/api/controllers/row/internal.js @@ -3,7 +3,7 @@ const { generateRowID, getRowParams, getTableIDFromRowID, - DocumentTypes, + DocumentType, InternalTables, } = require("../../../db/utils") const { dangerousGetDB } = require("@budibase/backend-core/db") @@ -183,7 +183,7 @@ exports.fetchView = async ctx => { const viewName = ctx.params.viewName // if this is a table view being looked for just transfer to that - if (viewName.startsWith(DocumentTypes.TABLE)) { + if (viewName.startsWith(DocumentType.TABLE)) { ctx.params.tableId = viewName return exports.fetch(ctx) } diff --git a/packages/server/src/api/controllers/static/index.ts b/packages/server/src/api/controllers/static/index.ts index 235bcd234c..7aeea98adc 100644 --- a/packages/server/src/api/controllers/static/index.ts +++ b/packages/server/src/api/controllers/static/index.ts @@ -14,7 +14,7 @@ const env = require("../../../environment") const { clientLibraryPath } = require("../../../utilities") const { upload } = require("../../../utilities/fileSystem") const { attachmentsRelativeURL } = require("../../../utilities") -const { DocumentTypes } = require("../../../db/utils") +const { DocumentType } = require("../../../db/utils") const { getAppDB, getAppId } = require("@budibase/backend-core/context") const { setCookie, clearCookie } = require("@budibase/backend-core/utils") const AWS = require("aws-sdk") @@ -99,7 +99,7 @@ export const uploadFile = async function (ctx: any) { export const serveApp = async function (ctx: any) { const db = getAppDB({ skip_setup: true }) - const appInfo = await db.get(DocumentTypes.APP_METADATA) + const appInfo = await db.get(DocumentType.APP_METADATA) let appId = getAppId() if (!env.isJest()) { diff --git a/packages/server/src/api/controllers/view/index.js b/packages/server/src/api/controllers/view/index.js index 5fc479adfb..b2c3a84c59 100644 --- a/packages/server/src/api/controllers/view/index.js +++ b/packages/server/src/api/controllers/view/index.js @@ -7,7 +7,7 @@ const { getTable } = require("../table/utils") const { FieldTypes } = require("../../../constants") const { getAppDB } = require("@budibase/backend-core/context") const { events } = require("@budibase/backend-core") -const { DocumentTypes } = require("../../../db/utils") +const { DocumentType } = require("../../../db/utils") const { cloneDeep, isEqual } = require("lodash") exports.fetch = async ctx => { @@ -181,7 +181,7 @@ exports.exportView = async ctx => { ctx.attachment(filename) ctx.body = apiFileReturn(exporter(headers, rows)) - if (viewName.startsWith(DocumentTypes.TABLE)) { + if (viewName.startsWith(DocumentType.TABLE)) { await events.table.exported(table, format) } else { await events.view.exported(table, format) diff --git a/packages/server/src/api/controllers/view/utils.js b/packages/server/src/api/controllers/view/utils.js index 5bddbf345c..bb3819f290 100644 --- a/packages/server/src/api/controllers/view/utils.js +++ b/packages/server/src/api/controllers/view/utils.js @@ -2,7 +2,7 @@ const { ViewNames, generateMemoryViewID, getMemoryViewParams, - DocumentTypes, + DocumentType, SEPARATOR, } = require("../../../db/utils") const env = require("../../../environment") @@ -16,7 +16,7 @@ exports.getView = async viewName => { return designDoc.views[viewName] } else { // This is a table view, don't read the view from the DB - if (viewName.startsWith(DocumentTypes.TABLE + SEPARATOR)) { + if (viewName.startsWith(DocumentType.TABLE + SEPARATOR)) { return null } diff --git a/packages/server/src/db/utils.js b/packages/server/src/db/utils.js index 8372040723..8a556dd854 100644 --- a/packages/server/src/db/utils.js +++ b/packages/server/src/db/utils.js @@ -1,6 +1,6 @@ const newid = require("./newid") const { - DocumentTypes: CoreDocTypes, + DocumentType: CoreDocTypes, getRoleParams, generateRoleID, APP_DEV_PREFIX, @@ -23,7 +23,7 @@ const AppStatus = { DEPLOYED: "published", } -const DocumentTypes = { +const DocumentType = { ...CoreDocTypes, TABLE: "ta", ROW: "ro", @@ -66,12 +66,12 @@ exports.APP_PREFIX = APP_PREFIX exports.APP_DEV_PREFIX = APP_DEV_PREFIX exports.isDevAppID = isDevAppID exports.isProdAppID = isProdAppID -exports.USER_METDATA_PREFIX = `${DocumentTypes.ROW}${SEPARATOR}${InternalTables.USER_METADATA}${SEPARATOR}` -exports.LINK_USER_METADATA_PREFIX = `${DocumentTypes.LINK}${SEPARATOR}${InternalTables.USER_METADATA}${SEPARATOR}` -exports.TABLE_ROW_PREFIX = `${DocumentTypes.ROW}${SEPARATOR}${DocumentTypes.TABLE}` +exports.USER_METDATA_PREFIX = `${DocumentType.ROW}${SEPARATOR}${InternalTables.USER_METADATA}${SEPARATOR}` +exports.LINK_USER_METADATA_PREFIX = `${DocumentType.LINK}${SEPARATOR}${InternalTables.USER_METADATA}${SEPARATOR}` +exports.TABLE_ROW_PREFIX = `${DocumentType.ROW}${SEPARATOR}${DocumentType.TABLE}` exports.ViewNames = ViewNames exports.InternalTables = InternalTables -exports.DocumentTypes = DocumentTypes +exports.DocumentType = DocumentType exports.SEPARATOR = SEPARATOR exports.UNICODE_MAX = UNICODE_MAX exports.SearchIndexes = SearchIndexes @@ -114,7 +114,7 @@ exports.getDocParams = getDocParams * Gets parameters for retrieving tables, this is a utility function for the getDocParams function. */ exports.getTableParams = (tableId = null, otherProps = {}) => { - return getDocParams(DocumentTypes.TABLE, tableId, otherProps) + return getDocParams(DocumentType.TABLE, tableId, otherProps) } /** @@ -122,7 +122,7 @@ exports.getTableParams = (tableId = null, otherProps = {}) => { * @returns {string} The new table ID which the table doc can be stored under. */ exports.generateTableID = () => { - return `${DocumentTypes.TABLE}${SEPARATOR}${newid()}` + return `${DocumentType.TABLE}${SEPARATOR}${newid()}` } /** @@ -135,12 +135,12 @@ exports.generateTableID = () => { */ exports.getRowParams = (tableId = null, rowId = null, otherProps = {}) => { if (tableId == null) { - return getDocParams(DocumentTypes.ROW, null, otherProps) + return getDocParams(DocumentType.ROW, null, otherProps) } const endOfKey = rowId == null ? `${tableId}${SEPARATOR}` : rowId - return getDocParams(DocumentTypes.ROW, endOfKey, otherProps) + return getDocParams(DocumentType.ROW, endOfKey, otherProps) } /** @@ -150,9 +150,9 @@ exports.getRowParams = (tableId = null, rowId = null, otherProps = {}) => { */ exports.getTableIDFromRowID = rowId => { const components = rowId - .split(DocumentTypes.TABLE + SEPARATOR)[1] + .split(DocumentType.TABLE + SEPARATOR)[1] .split(SEPARATOR) - return `${DocumentTypes.TABLE}${SEPARATOR}${components[0]}` + return `${DocumentType.TABLE}${SEPARATOR}${components[0]}` } /** @@ -163,7 +163,7 @@ exports.getTableIDFromRowID = rowId => { */ exports.generateRowID = (tableId, id = null) => { id = id || newid() - return `${DocumentTypes.ROW}${SEPARATOR}${tableId}${SEPARATOR}${id}` + return `${DocumentType.ROW}${SEPARATOR}${tableId}${SEPARATOR}${id}` } /** @@ -186,7 +186,7 @@ exports.generateUserMetadataID = globalId => { * Breaks up the ID to get the global ID. */ exports.getGlobalIDFromUserMetadataID = id => { - const prefix = `${DocumentTypes.ROW}${SEPARATOR}${InternalTables.USER_METADATA}${SEPARATOR}` + const prefix = `${DocumentType.ROW}${SEPARATOR}${InternalTables.USER_METADATA}${SEPARATOR}` if (!id || !id.includes(prefix)) { return id } @@ -197,7 +197,7 @@ exports.getGlobalIDFromUserMetadataID = id => { * Gets parameters for retrieving automations, this is a utility function for the getDocParams function. */ exports.getAutomationParams = (automationId = null, otherProps = {}) => { - return getDocParams(DocumentTypes.AUTOMATION, automationId, otherProps) + return getDocParams(DocumentType.AUTOMATION, automationId, otherProps) } /** @@ -205,7 +205,7 @@ exports.getAutomationParams = (automationId = null, otherProps = {}) => { * @returns {string} The new automation ID which the automation doc can be stored under. */ exports.generateAutomationID = () => { - return `${DocumentTypes.AUTOMATION}${SEPARATOR}${newid()}` + return `${DocumentType.AUTOMATION}${SEPARATOR}${newid()}` } /** @@ -230,14 +230,14 @@ exports.generateLinkID = ( const tables = `${SEPARATOR}${tableId1}${SEPARATOR}${tableId2}` const rows = `${SEPARATOR}${rowId1}${SEPARATOR}${rowId2}` const fields = `${SEPARATOR}${fieldName1}${SEPARATOR}${fieldName2}` - return `${DocumentTypes.LINK}${tables}${rows}${fields}` + return `${DocumentType.LINK}${tables}${rows}${fields}` } /** * Gets parameters for retrieving link docs, this is a utility function for the getDocParams function. */ exports.getLinkParams = (otherProps = {}) => { - return getDocParams(DocumentTypes.LINK, null, otherProps) + return getDocParams(DocumentType.LINK, null, otherProps) } /** @@ -245,14 +245,14 @@ exports.getLinkParams = (otherProps = {}) => { * @returns {string} The new layout ID which the layout doc can be stored under. */ exports.generateLayoutID = id => { - return `${DocumentTypes.LAYOUT}${SEPARATOR}${id || newid()}` + return `${DocumentType.LAYOUT}${SEPARATOR}${id || newid()}` } /** * Gets parameters for retrieving layout, this is a utility function for the getDocParams function. */ exports.getLayoutParams = (layoutId = null, otherProps = {}) => { - return getDocParams(DocumentTypes.LAYOUT, layoutId, otherProps) + return getDocParams(DocumentType.LAYOUT, layoutId, otherProps) } /** @@ -260,14 +260,14 @@ exports.getLayoutParams = (layoutId = null, otherProps = {}) => { * @returns {string} The new screen ID which the screen doc can be stored under. */ exports.generateScreenID = () => { - return `${DocumentTypes.SCREEN}${SEPARATOR}${newid()}` + return `${DocumentType.SCREEN}${SEPARATOR}${newid()}` } /** * Gets parameters for retrieving screens, this is a utility function for the getDocParams function. */ exports.getScreenParams = (screenId = null, otherProps = {}) => { - return getDocParams(DocumentTypes.SCREEN, screenId, otherProps) + return getDocParams(DocumentType.SCREEN, screenId, otherProps) } /** @@ -275,14 +275,14 @@ exports.getScreenParams = (screenId = null, otherProps = {}) => { * @returns {string} The new webhook ID which the webhook doc can be stored under. */ exports.generateWebhookID = () => { - return `${DocumentTypes.WEBHOOK}${SEPARATOR}${newid()}` + return `${DocumentType.WEBHOOK}${SEPARATOR}${newid()}` } /** * Gets parameters for retrieving a webhook, this is a utility function for the getDocParams function. */ exports.getWebhookParams = (webhookId = null, otherProps = {}) => { - return getDocParams(DocumentTypes.WEBHOOK, webhookId, otherProps) + return getDocParams(DocumentType.WEBHOOK, webhookId, otherProps) } /** @@ -291,7 +291,7 @@ exports.getWebhookParams = (webhookId = null, otherProps = {}) => { */ exports.generateDatasourceID = ({ plus = false } = {}) => { return `${ - plus ? DocumentTypes.DATASOURCE_PLUS : DocumentTypes.DATASOURCE + plus ? DocumentType.DATASOURCE_PLUS : DocumentType.DATASOURCE }${SEPARATOR}${newid()}` } @@ -299,7 +299,7 @@ exports.generateDatasourceID = ({ plus = false } = {}) => { * Gets parameters for retrieving a datasource, this is a utility function for the getDocParams function. */ exports.getDatasourceParams = (datasourceId = null, otherProps = {}) => { - return getDocParams(DocumentTypes.DATASOURCE, datasourceId, otherProps) + return getDocParams(DocumentType.DATASOURCE, datasourceId, otherProps) } /** @@ -308,7 +308,7 @@ exports.getDatasourceParams = (datasourceId = null, otherProps = {}) => { */ exports.generateQueryID = datasourceId => { return `${ - DocumentTypes.QUERY + DocumentType.QUERY }${SEPARATOR}${datasourceId}${SEPARATOR}${newid()}` } @@ -317,14 +317,14 @@ exports.generateQueryID = datasourceId => { * automations etc. */ exports.generateAutomationMetadataID = automationId => { - return `${DocumentTypes.AUTOMATION_METADATA}${SEPARATOR}${automationId}` + return `${DocumentType.AUTOMATION_METADATA}${SEPARATOR}${automationId}` } /** * Retrieve all automation metadata in an app database. */ exports.getAutomationMetadataParams = (otherProps = {}) => { - return getDocParams(DocumentTypes.AUTOMATION_METADATA, null, otherProps) + return getDocParams(DocumentType.AUTOMATION_METADATA, null, otherProps) } /** @@ -332,11 +332,11 @@ exports.getAutomationMetadataParams = (otherProps = {}) => { */ exports.getQueryParams = (datasourceId = null, otherProps = {}) => { if (datasourceId == null) { - return getDocParams(DocumentTypes.QUERY, null, otherProps) + return getDocParams(DocumentType.QUERY, null, otherProps) } return getDocParams( - DocumentTypes.QUERY, + DocumentType.QUERY, `${datasourceId}${SEPARATOR}`, otherProps ) @@ -347,11 +347,11 @@ exports.getQueryParams = (datasourceId = null, otherProps = {}) => { * @returns {string} The ID of the flag document that was generated. */ exports.generateUserFlagID = userId => { - return `${DocumentTypes.USER_FLAG}${SEPARATOR}${userId}` + return `${DocumentType.USER_FLAG}${SEPARATOR}${userId}` } exports.generateMetadataID = (type, entityId) => { - return `${DocumentTypes.METADATA}${SEPARATOR}${type}${SEPARATOR}${entityId}` + return `${DocumentType.METADATA}${SEPARATOR}${type}${SEPARATOR}${entityId}` } exports.getMetadataParams = (type, entityId = null, otherProps = {}) => { @@ -359,15 +359,15 @@ exports.getMetadataParams = (type, entityId = null, otherProps = {}) => { if (entityId != null) { docId += entityId } - return getDocParams(DocumentTypes.METADATA, docId, otherProps) + return getDocParams(DocumentType.METADATA, docId, otherProps) } exports.generateMemoryViewID = viewName => { - return `${DocumentTypes.MEM_VIEW}${SEPARATOR}${viewName}` + return `${DocumentType.MEM_VIEW}${SEPARATOR}${viewName}` } exports.getMemoryViewParams = (otherProps = {}) => { - return getDocParams(DocumentTypes.MEM_VIEW, null, otherProps) + return getDocParams(DocumentType.MEM_VIEW, null, otherProps) } /** diff --git a/packages/server/src/db/views/staticViews.js b/packages/server/src/db/views/staticViews.js index 5cfae746df..f51e695f27 100644 --- a/packages/server/src/db/views/staticViews.js +++ b/packages/server/src/db/views/staticViews.js @@ -1,11 +1,11 @@ const { getAppDB } = require("@budibase/backend-core/context") const { - DocumentTypes, + DocumentType, SEPARATOR, ViewNames, SearchIndexes, } = require("../utils") -const SCREEN_PREFIX = DocumentTypes.SCREEN + SEPARATOR +const SCREEN_PREFIX = DocumentType.SCREEN + SEPARATOR /************************************************** * INFORMATION * diff --git a/packages/server/src/definitions/automations.ts b/packages/server/src/definitions/automations.ts index e1ac690bf1..ed1455c049 100644 --- a/packages/server/src/definitions/automations.ts +++ b/packages/server/src/definitions/automations.ts @@ -5,14 +5,14 @@ import { Document, } from "@budibase/types" -export enum LoopStepTypes { +export enum LoopStepType { ARRAY = "Array", STRING = "String", } export interface LoopStep extends AutomationStep { inputs: { - option: LoopStepTypes + option: LoopStepType [key: string]: any } } diff --git a/packages/server/src/definitions/common.ts b/packages/server/src/definitions/common.ts index dd7286213b..33eefefdc8 100644 --- a/packages/server/src/definitions/common.ts +++ b/packages/server/src/definitions/common.ts @@ -1,5 +1,13 @@ -export { Query, Datasource } from "./datasource" -export { FieldSchema, TableSchema, Table, Document, Row } from "@budibase/types" +import { Document } from "@budibase/types" +export { + Query, + Datasource, + FieldSchema, + TableSchema, + Table, + Document, + Row, +} from "@budibase/types" export interface Application extends Document { _id: string diff --git a/packages/server/src/definitions/datasource.ts b/packages/server/src/definitions/datasource.ts index ff4f5e9f5b..f44706c696 100644 --- a/packages/server/src/definitions/datasource.ts +++ b/packages/server/src/definitions/datasource.ts @@ -1,32 +1,3 @@ -import { SortDirection, Operation, SourceNames } from "@budibase/types" -// export everything that used to be exported from here -export { - Operation, - SortDirection, - QueryTypes, - DatasourceFieldTypes, - SourceNames, - IncludeRelationships, - FilterTypes, - QueryDefinition, - ExtraQueryConfig, - Integration, - IntegrationBase, - QueryParameter, - PaginationConfig, - PaginationValues, - RestQueryFields, - Query, - Datasource, - SearchFilters, - SortJson, - PaginationJson, - RenameColumn, - RelationshipsJson, - QueryJson, - SqlQuery, -} from "@budibase/types" - /******************************************** * This file contains structures which are * * internal to the server and don't need to * diff --git a/packages/server/src/integrations/airtable.ts b/packages/server/src/integrations/airtable.ts index 199741b312..e4c941b21c 100644 --- a/packages/server/src/integrations/airtable.ts +++ b/packages/server/src/integrations/airtable.ts @@ -1,7 +1,7 @@ import { Integration, - DatasourceFieldTypes, - QueryTypes, + DatasourceFieldType, + QueryType, IntegrationBase, } from "@budibase/types" @@ -21,61 +21,61 @@ module AirtableModule { type: "Spreadsheet", datasource: { apiKey: { - type: DatasourceFieldTypes.PASSWORD, + type: DatasourceFieldType.PASSWORD, default: "enter api key", required: true, }, base: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, default: "mybase", required: true, }, }, query: { create: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, customisable: true, fields: { table: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, }, read: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, fields: { table: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, view: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, numRecords: { - type: DatasourceFieldTypes.NUMBER, + type: DatasourceFieldType.NUMBER, default: 10, }, }, }, update: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, customisable: true, fields: { id: { display: "Record ID", - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, table: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, }, delete: { - type: QueryTypes.JSON, + type: QueryType.JSON, }, }, } diff --git a/packages/server/src/integrations/arangodb.ts b/packages/server/src/integrations/arangodb.ts index 682b941b23..968197474a 100644 --- a/packages/server/src/integrations/arangodb.ts +++ b/packages/server/src/integrations/arangodb.ts @@ -1,7 +1,7 @@ import { Integration, - DatasourceFieldTypes, - QueryTypes, + DatasourceFieldType, + QueryType, IntegrationBase, } from "@budibase/types" @@ -24,35 +24,35 @@ module ArangoModule { "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: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, default: "http://localhost:8529", required: true, }, username: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, default: "root", required: true, }, password: { - type: DatasourceFieldTypes.PASSWORD, + type: DatasourceFieldType.PASSWORD, required: true, }, databaseName: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, default: "_system", required: true, }, collection: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, query: { read: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, create: { - type: QueryTypes.JSON, + type: QueryType.JSON, }, }, } diff --git a/packages/server/src/integrations/base/sql.ts b/packages/server/src/integrations/base/sql.ts index 750564c6ff..06d6298d32 100644 --- a/packages/server/src/integrations/base/sql.ts +++ b/packages/server/src/integrations/base/sql.ts @@ -2,12 +2,12 @@ import { Knex, knex } from "knex" import { Operation, QueryJson, - QueryOptions, RelationshipsJson, SearchFilters, SortDirection, -} from "../../definitions/datasource" -import { isIsoDateString, SqlClients } from "../utils" +} from "@budibase/types" +import { QueryOptions } from "../../definitions/datasource" +import { isIsoDateString, SqlClient } from "../utils" import SqlTableQueryBuilder from "./sqlTable" import environment from "../../environment" @@ -27,14 +27,14 @@ function likeKey(client: string, key: string): string { } let start: string, end: string switch (client) { - case SqlClients.MY_SQL: + case SqlClient.MY_SQL: start = end = "`" break - case SqlClients.ORACLE: - case SqlClients.POSTGRES: + case SqlClient.ORACLE: + case SqlClient.POSTGRES: start = end = '"' break - case SqlClients.MS_SQL: + case SqlClient.MS_SQL: start = "[" end = "]" break @@ -102,7 +102,7 @@ function generateSelectStatement( if ( columnName && schema?.[columnName] && - knex.client.config.client === SqlClients.POSTGRES + knex.client.config.client === SqlClient.POSTGRES ) { const externalType = schema[columnName].externalType if (externalType?.includes("money")) { @@ -146,7 +146,7 @@ class InternalBuilder { const like = (key: string, value: any) => { const fnc = allOr ? "orWhere" : "where" // postgres supports ilike, nothing else does - if (this.client === SqlClients.POSTGRES) { + if (this.client === SqlClient.POSTGRES) { query = query[fnc](key, "ilike", `%${value}%`) } else { const rawFnc = `${fnc}Raw` @@ -173,7 +173,7 @@ class InternalBuilder { iterate(filters.string, (key, value) => { const fnc = allOr ? "orWhere" : "where" // postgres supports ilike, nothing else does - if (this.client === SqlClients.POSTGRES) { + if (this.client === SqlClient.POSTGRES) { query = query[fnc](key, "ilike", `${value}%`) } else { const rawFnc = `${fnc}Raw` @@ -229,7 +229,7 @@ class InternalBuilder { if (filters.contains) { const fnc = allOr ? "orWhere" : "where" const rawFnc = `${fnc}Raw` - if (this.client === SqlClients.POSTGRES) { + if (this.client === SqlClient.POSTGRES) { iterate(filters.contains, (key: string, value: any) => { const fieldNames = key.split(/\./g) const tableName = fieldNames[0] @@ -242,7 +242,7 @@ class InternalBuilder { `"${tableName}"."${columnName}"::jsonb @> '[${value}]'` ) }) - } else if (this.client === SqlClients.MY_SQL) { + } else if (this.client === SqlClient.MY_SQL) { iterate(filters.contains, (key: string, value: any) => { if (typeof value === "string") { value = `"${value}"` @@ -265,7 +265,7 @@ class InternalBuilder { const direction = value === SortDirection.ASCENDING ? "asc" : "desc" query = query.orderBy(`${table?.name}.${key}`, direction) } - } else if (this.client === SqlClients.MS_SQL && paginate?.limit) { + } else if (this.client === SqlClient.MS_SQL && paginate?.limit) { // @ts-ignore query = query.orderBy(`${table?.name}.${table?.primary[0]}`) } @@ -414,7 +414,7 @@ class InternalBuilder { [tableName]: query, }).select(selectStatement) // have to add after as well (this breaks MS-SQL) - if (this.client !== SqlClients.MS_SQL) { + if (this.client !== SqlClient.MS_SQL) { preQuery = this.addSorting(preQuery, json) } // handle joins @@ -565,9 +565,9 @@ class SqlQueryBuilder extends SqlTableQueryBuilder { // same as delete, manage returning if (operation === Operation.CREATE || operation === Operation.UPDATE) { let id - if (sqlClient === SqlClients.MS_SQL) { + if (sqlClient === SqlClient.MS_SQL) { id = results?.[0].id - } else if (sqlClient === SqlClients.MY_SQL) { + } else if (sqlClient === SqlClient.MY_SQL) { id = results?.insertId } row = processFn( diff --git a/packages/server/src/integrations/base/sqlTable.ts b/packages/server/src/integrations/base/sqlTable.ts index 71f9c4aa64..4b715e5f3a 100644 --- a/packages/server/src/integrations/base/sqlTable.ts +++ b/packages/server/src/integrations/base/sqlTable.ts @@ -1,10 +1,5 @@ import { Knex, knex } from "knex" -import { Table } from "../../definitions/common" -import { - Operation, - QueryJson, - RenameColumn, -} from "../../definitions/datasource" +import { Operation, QueryJson, RenameColumn, Table } from "@budibase/types" import { breakExternalTableId } from "../utils" import SchemaBuilder = Knex.SchemaBuilder import CreateTableBuilder = Knex.CreateTableBuilder diff --git a/packages/server/src/integrations/base/utils.ts b/packages/server/src/integrations/base/utils.ts index 086912b920..fb286e16c1 100644 --- a/packages/server/src/integrations/base/utils.ts +++ b/packages/server/src/integrations/base/utils.ts @@ -1,5 +1,4 @@ -import { QueryJson } from "../../definitions/datasource" -import { Datasource } from "../../definitions/common" +import { QueryJson, Datasource } from "@budibase/types" module DatasourceUtils { const { integrations } = require("../index") diff --git a/packages/server/src/integrations/couchdb.ts b/packages/server/src/integrations/couchdb.ts index d32415ca29..c23593dbd4 100644 --- a/packages/server/src/integrations/couchdb.ts +++ b/packages/server/src/integrations/couchdb.ts @@ -1,7 +1,7 @@ import { Integration, - DatasourceFieldTypes, - QueryTypes, + DatasourceFieldType, + QueryType, IntegrationBase, } from "@budibase/types" @@ -21,30 +21,30 @@ module CouchDBModule { "Apache CouchDB is an open-source document-oriented NoSQL database, implemented in Erlang.", datasource: { url: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, default: "http://localhost:5984", }, database: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, query: { create: { - type: QueryTypes.JSON, + type: QueryType.JSON, }, read: { - type: QueryTypes.JSON, + type: QueryType.JSON, }, update: { - type: QueryTypes.JSON, + type: QueryType.JSON, }, delete: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, fields: { id: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, diff --git a/packages/server/src/integrations/dynamodb.ts b/packages/server/src/integrations/dynamodb.ts index 28e163a8aa..5321da4791 100644 --- a/packages/server/src/integrations/dynamodb.ts +++ b/packages/server/src/integrations/dynamodb.ts @@ -1,7 +1,7 @@ import { Integration, - DatasourceFieldTypes, - QueryTypes, + DatasourceFieldType, + QueryType, IntegrationBase, } from "@budibase/types" @@ -24,101 +24,101 @@ module DynamoModule { type: "Non-relational", datasource: { region: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, default: "us-east-1", }, accessKeyId: { - type: DatasourceFieldTypes.PASSWORD, + type: DatasourceFieldType.PASSWORD, required: true, }, secretAccessKey: { - type: DatasourceFieldTypes.PASSWORD, + type: DatasourceFieldType.PASSWORD, required: true, }, endpoint: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: false, default: "https://dynamodb.us-east-1.amazonaws.com", }, }, query: { create: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, customisable: true, fields: { table: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, }, read: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, customisable: true, readable: true, fields: { table: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, index: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, }, }, }, scan: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, customisable: true, readable: true, fields: { table: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, index: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, }, }, }, describe: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, customisable: true, readable: true, fields: { table: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, }, get: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, customisable: true, readable: true, fields: { table: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, }, update: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, customisable: true, fields: { table: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, }, delete: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, customisable: true, fields: { table: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, diff --git a/packages/server/src/integrations/elasticsearch.ts b/packages/server/src/integrations/elasticsearch.ts index a2b90b4b87..5c61545ecd 100644 --- a/packages/server/src/integrations/elasticsearch.ts +++ b/packages/server/src/integrations/elasticsearch.ts @@ -1,7 +1,7 @@ import { Integration, - DatasourceFieldTypes, - QueryTypes, + DatasourceFieldType, + QueryType, IntegrationBase, } from "@budibase/types" @@ -20,55 +20,55 @@ module ElasticsearchModule { type: "Non-relational", datasource: { url: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, default: "http://localhost:9200", }, }, query: { create: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, customisable: true, fields: { index: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, }, read: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, customisable: true, fields: { index: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, }, update: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, customisable: true, fields: { id: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, index: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, }, delete: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, fields: { index: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, id: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, diff --git a/packages/server/src/integrations/firebase.ts b/packages/server/src/integrations/firebase.ts index 572514f739..1f82e9dafe 100644 --- a/packages/server/src/integrations/firebase.ts +++ b/packages/server/src/integrations/firebase.ts @@ -1,7 +1,7 @@ import { - DatasourceFieldTypes, + DatasourceFieldType, Integration, - QueryTypes, + QueryType, IntegrationBase, } from "@budibase/types" import { Firestore, WhereFilterOp } from "@google-cloud/firestore" @@ -21,46 +21,46 @@ module Firebase { "Cloud Firestore is a flexible, scalable database for mobile, web, and server development from Firebase and Google Cloud.", datasource: { email: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, privateKey: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, projectId: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, query: { create: { - type: QueryTypes.JSON, + type: QueryType.JSON, }, read: { - type: QueryTypes.JSON, + type: QueryType.JSON, }, update: { - type: QueryTypes.JSON, + type: QueryType.JSON, }, delete: { - type: QueryTypes.JSON, + type: QueryType.JSON, }, }, extra: { collection: { displayName: "Collection", - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, filterField: { displayName: "Filter field", - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: false, }, filter: { displayName: "Filter comparison", - type: DatasourceFieldTypes.LIST, + type: DatasourceFieldType.LIST, required: false, data: { read: [ @@ -79,7 +79,7 @@ module Firebase { }, filterValue: { displayName: "Filter value", - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: false, }, }, diff --git a/packages/server/src/integrations/googlesheets.ts b/packages/server/src/integrations/googlesheets.ts index 644b8d352f..129ab485cd 100644 --- a/packages/server/src/integrations/googlesheets.ts +++ b/packages/server/src/integrations/googlesheets.ts @@ -1,7 +1,7 @@ import { - DatasourceFieldTypes, + DatasourceFieldType, Integration, - QueryTypes, + QueryType, Table, TableSchema, QueryJson, @@ -54,59 +54,59 @@ module GoogleSheetsModule { datasource: { spreadsheetId: { display: "Google Sheet URL", - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, query: { create: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, fields: { sheet: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, row: { - type: QueryTypes.JSON, + type: QueryType.JSON, required: true, }, }, }, read: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, fields: { sheet: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, }, update: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, fields: { sheet: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, rowIndex: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, row: { - type: QueryTypes.JSON, + type: QueryType.JSON, required: true, }, }, }, delete: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, fields: { sheet: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, rowIndex: { - type: DatasourceFieldTypes.NUMBER, + type: DatasourceFieldType.NUMBER, required: true, }, }, diff --git a/packages/server/src/integrations/index.ts b/packages/server/src/integrations/index.ts index 6edc65f08c..fd2ce75391 100644 --- a/packages/server/src/integrations/index.ts +++ b/packages/server/src/integrations/index.ts @@ -13,54 +13,54 @@ const googlesheets = require("./googlesheets") const firebase = require("./firebase") const redis = require("./redis") const snowflake = require("./snowflake") -const { SourceNames } = require("../definitions/datasource") +const { SourceName } = require("@budibase/types") const environment = require("../environment") const DEFINITIONS = { - [SourceNames.POSTGRES]: postgres.schema, - [SourceNames.DYNAMODB]: dynamodb.schema, - [SourceNames.MONGODB]: mongodb.schema, - [SourceNames.ELASTICSEARCH]: elasticsearch.schema, - [SourceNames.COUCHDB]: couchdb.schema, - [SourceNames.SQL_SERVER]: sqlServer.schema, - [SourceNames.S3]: s3.schema, - [SourceNames.AIRTABLE]: airtable.schema, - [SourceNames.MYSQL]: mysql.schema, - [SourceNames.ARANGODB]: arangodb.schema, - [SourceNames.REST]: rest.schema, - [SourceNames.FIRESTORE]: firebase.schema, - [SourceNames.REDIS]: redis.schema, - [SourceNames.SNOWFLAKE]: snowflake.schema, + [SourceName.POSTGRES]: postgres.schema, + [SourceName.DYNAMODB]: dynamodb.schema, + [SourceName.MONGODB]: mongodb.schema, + [SourceName.ELASTICSEARCH]: elasticsearch.schema, + [SourceName.COUCHDB]: couchdb.schema, + [SourceName.SQL_SERVER]: sqlServer.schema, + [SourceName.S3]: s3.schema, + [SourceName.AIRTABLE]: airtable.schema, + [SourceName.MYSQL]: mysql.schema, + [SourceName.ARANGODB]: arangodb.schema, + [SourceName.REST]: rest.schema, + [SourceName.FIRESTORE]: firebase.schema, + [SourceName.REDIS]: redis.schema, + [SourceName.SNOWFLAKE]: snowflake.schema, } const INTEGRATIONS = { - [SourceNames.POSTGRES]: postgres.integration, - [SourceNames.DYNAMODB]: dynamodb.integration, - [SourceNames.MONGODB]: mongodb.integration, - [SourceNames.ELASTICSEARCH]: elasticsearch.integration, - [SourceNames.COUCHDB]: couchdb.integration, - [SourceNames.SQL_SERVER]: sqlServer.integration, - [SourceNames.S3]: s3.integration, - [SourceNames.AIRTABLE]: airtable.integration, - [SourceNames.MYSQL]: mysql.integration, - [SourceNames.ARANGODB]: arangodb.integration, - [SourceNames.REST]: rest.integration, - [SourceNames.FIRESTORE]: firebase.integration, - [SourceNames.GOOGLE_SHEETS]: googlesheets.integration, - [SourceNames.REDIS]: redis.integration, - [SourceNames.FIREBASE]: firebase.integration, - [SourceNames.SNOWFLAKE]: snowflake.integration, + [SourceName.POSTGRES]: postgres.integration, + [SourceName.DYNAMODB]: dynamodb.integration, + [SourceName.MONGODB]: mongodb.integration, + [SourceName.ELASTICSEARCH]: elasticsearch.integration, + [SourceName.COUCHDB]: couchdb.integration, + [SourceName.SQL_SERVER]: sqlServer.integration, + [SourceName.S3]: s3.integration, + [SourceName.AIRTABLE]: airtable.integration, + [SourceName.MYSQL]: mysql.integration, + [SourceName.ARANGODB]: arangodb.integration, + [SourceName.REST]: rest.integration, + [SourceName.FIRESTORE]: firebase.integration, + [SourceName.GOOGLE_SHEETS]: googlesheets.integration, + [SourceName.REDIS]: redis.integration, + [SourceName.FIREBASE]: firebase.integration, + [SourceName.SNOWFLAKE]: snowflake.integration, } // optionally add oracle integration if the oracle binary can be installed if (process.arch && !process.arch.startsWith("arm")) { const oracle = require("./oracle") - DEFINITIONS[SourceNames.ORACLE] = oracle.schema - INTEGRATIONS[SourceNames.ORACLE] = oracle.integration + DEFINITIONS[SourceName.ORACLE] = oracle.schema + INTEGRATIONS[SourceName.ORACLE] = oracle.integration } if (environment.SELF_HOSTED) { - DEFINITIONS[SourceNames.GOOGLE_SHEETS] = googlesheets.schema + DEFINITIONS[SourceName.GOOGLE_SHEETS] = googlesheets.schema } module.exports = { diff --git a/packages/server/src/integrations/microsoftSqlServer.ts b/packages/server/src/integrations/microsoftSqlServer.ts index 67b2b0cfe2..4284cff0a7 100644 --- a/packages/server/src/integrations/microsoftSqlServer.ts +++ b/packages/server/src/integrations/microsoftSqlServer.ts @@ -1,11 +1,11 @@ import { - DatasourceFieldTypes, + DatasourceFieldType, Integration, Operation, Table, TableSchema, QueryJson, - QueryTypes, + QueryType, SqlQuery, DatasourcePlus, } from "@budibase/types" @@ -14,7 +14,7 @@ import { buildExternalTableId, convertSqlType, finaliseExternalTables, - SqlClients, + SqlClient, } from "./utils" module MSSQLModule { @@ -48,48 +48,48 @@ module MSSQLModule { type: "Relational", datasource: { user: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, default: "localhost", }, password: { - type: DatasourceFieldTypes.PASSWORD, + type: DatasourceFieldType.PASSWORD, required: true, }, server: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, default: "localhost", }, port: { - type: DatasourceFieldTypes.NUMBER, + type: DatasourceFieldType.NUMBER, required: false, default: 1433, }, database: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, default: "root", }, schema: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, default: DEFAULT_SCHEMA, }, encrypt: { - type: DatasourceFieldTypes.BOOLEAN, + type: DatasourceFieldType.BOOLEAN, default: true, }, }, query: { create: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, read: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, update: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, delete: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, }, } @@ -112,7 +112,7 @@ module MSSQLModule { "SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'" constructor(config: MSSQLConfig) { - super(SqlClients.MS_SQL) + super(SqlClient.MS_SQL) this.config = config const clientCfg = { ...this.config, diff --git a/packages/server/src/integrations/mongodb.ts b/packages/server/src/integrations/mongodb.ts index b387bb80d8..bc221c9155 100644 --- a/packages/server/src/integrations/mongodb.ts +++ b/packages/server/src/integrations/mongodb.ts @@ -1,7 +1,7 @@ import { Integration, - DatasourceFieldTypes, - QueryTypes, + DatasourceFieldType, + QueryType, IntegrationBase, } from "@budibase/types" import { @@ -29,38 +29,38 @@ module MongoDBModule { "MongoDB is a general purpose, document-based, distributed database built for modern application developers and for the cloud era.", datasource: { connectionString: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, default: "mongodb://localhost:27017", }, db: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, query: { create: { - type: QueryTypes.JSON, + type: QueryType.JSON, }, read: { - type: QueryTypes.JSON, + type: QueryType.JSON, }, update: { - type: QueryTypes.JSON, + type: QueryType.JSON, }, delete: { - type: QueryTypes.JSON, + type: QueryType.JSON, }, }, extra: { collection: { displayName: "Collection", - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, actionTypes: { displayName: "Action Types", - type: DatasourceFieldTypes.LIST, + type: DatasourceFieldType.LIST, required: true, data: { read: ["find", "findOne", "findOneAndUpdate", "count", "distinct"], diff --git a/packages/server/src/integrations/mysql.ts b/packages/server/src/integrations/mysql.ts index 740bd4f2d6..d68aded6ba 100644 --- a/packages/server/src/integrations/mysql.ts +++ b/packages/server/src/integrations/mysql.ts @@ -1,7 +1,7 @@ import { Integration, - DatasourceFieldTypes, - QueryTypes, + DatasourceFieldType, + QueryType, QueryJson, SqlQuery, Table, @@ -10,7 +10,7 @@ import { } from "@budibase/types" import { getSqlQuery, - SqlClients, + SqlClient, buildExternalTableId, convertSqlType, finaliseExternalTables, @@ -42,51 +42,51 @@ module MySQLModule { "MySQL Database Service is a fully managed database service to deploy cloud-native applications. ", datasource: { host: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, default: "localhost", required: true, }, port: { - type: DatasourceFieldTypes.NUMBER, + type: DatasourceFieldType.NUMBER, default: 3306, required: false, }, user: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, default: "root", required: true, }, password: { - type: DatasourceFieldTypes.PASSWORD, + type: DatasourceFieldType.PASSWORD, default: "root", required: true, }, database: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, ssl: { - type: DatasourceFieldTypes.OBJECT, + type: DatasourceFieldType.OBJECT, required: false, }, rejectUnauthorized: { - type: DatasourceFieldTypes.BOOLEAN, + type: DatasourceFieldType.BOOLEAN, default: true, required: false, }, }, query: { create: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, read: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, update: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, delete: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, }, } @@ -120,7 +120,7 @@ module MySQLModule { public schemaErrors: Record = {} constructor(config: MySQLConfig) { - super(SqlClients.MY_SQL) + super(SqlClient.MY_SQL) this.config = config if (config.ssl && Object.keys(config.ssl).length === 0) { delete config.ssl diff --git a/packages/server/src/integrations/oracle.ts b/packages/server/src/integrations/oracle.ts index 1d96f5c44f..fa8a3837b2 100644 --- a/packages/server/src/integrations/oracle.ts +++ b/packages/server/src/integrations/oracle.ts @@ -1,9 +1,9 @@ import { - DatasourceFieldTypes, + DatasourceFieldType, Integration, Operation, QueryJson, - QueryTypes, + QueryType, SqlQuery, Table, DatasourcePlus, @@ -13,7 +13,7 @@ import { convertSqlType, finaliseExternalTables, getSqlQuery, - SqlClients, + SqlClient, } from "./utils" import oracledb, { BindParameters, @@ -45,40 +45,40 @@ module OracleModule { "Oracle Database is an object-relational database management system developed by Oracle Corporation", datasource: { host: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, default: "localhost", required: true, }, port: { - type: DatasourceFieldTypes.NUMBER, + type: DatasourceFieldType.NUMBER, required: true, default: 1521, }, database: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, user: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, password: { - type: DatasourceFieldTypes.PASSWORD, + type: DatasourceFieldType.PASSWORD, required: true, }, }, query: { create: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, read: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, update: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, delete: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, }, } @@ -172,7 +172,7 @@ module OracleModule { OR cons.status IS NULL) ` constructor(config: OracleConfig) { - super(SqlClients.ORACLE) + super(SqlClient.ORACLE) this.config = config } diff --git a/packages/server/src/integrations/postgres.ts b/packages/server/src/integrations/postgres.ts index 58e6e8c214..40adcac816 100644 --- a/packages/server/src/integrations/postgres.ts +++ b/packages/server/src/integrations/postgres.ts @@ -1,7 +1,7 @@ import { Integration, - DatasourceFieldTypes, - QueryTypes, + DatasourceFieldType, + QueryType, QueryJson, SqlQuery, Table, @@ -12,7 +12,7 @@ import { buildExternalTableId, convertSqlType, finaliseExternalTables, - SqlClients, + SqlClient, } from "./utils" module PostgresModule { @@ -52,63 +52,63 @@ module PostgresModule { "PostgreSQL, also known as Postgres, is a free and open-source relational database management system emphasizing extensibility and SQL compliance.", datasource: { host: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, default: "localhost", required: true, }, port: { - type: DatasourceFieldTypes.NUMBER, + type: DatasourceFieldType.NUMBER, required: true, default: 5432, }, database: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, default: "postgres", required: true, }, user: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, default: "root", required: true, }, password: { - type: DatasourceFieldTypes.PASSWORD, + type: DatasourceFieldType.PASSWORD, default: "root", required: true, }, schema: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, default: "public", required: true, }, ssl: { - type: DatasourceFieldTypes.BOOLEAN, + type: DatasourceFieldType.BOOLEAN, default: false, required: false, }, rejectUnauthorized: { - type: DatasourceFieldTypes.BOOLEAN, + type: DatasourceFieldType.BOOLEAN, default: false, required: false, }, ca: { - type: DatasourceFieldTypes.LONGFORM, + type: DatasourceFieldType.LONGFORM, default: false, required: false, }, }, query: { create: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, read: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, update: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, delete: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, }, } @@ -133,7 +133,7 @@ module PostgresModule { ` constructor(config: PostgresConfig) { - super(SqlClients.POSTGRES) + super(SqlClient.POSTGRES) this.config = config let newConfig = { diff --git a/packages/server/src/integrations/redis.ts b/packages/server/src/integrations/redis.ts index 92e245011f..e8aa13560c 100644 --- a/packages/server/src/integrations/redis.ts +++ b/packages/server/src/integrations/redis.ts @@ -1,4 +1,4 @@ -import { DatasourceFieldTypes, Integration, QueryTypes } from "@budibase/types" +import { DatasourceFieldType, Integration, QueryType } from "@budibase/types" import Redis from "ioredis" module RedisModule { @@ -36,36 +36,36 @@ module RedisModule { }, query: { create: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, fields: { key: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, value: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, ttl: { - type: DatasourceFieldTypes.NUMBER, + type: DatasourceFieldType.NUMBER, }, }, }, read: { readable: true, - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, fields: { key: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, }, delete: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, fields: { key: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, required: true, }, }, @@ -73,7 +73,7 @@ module RedisModule { command: { readable: true, displayName: "Redis Command", - type: QueryTypes.JSON, + type: QueryType.JSON, }, }, } diff --git a/packages/server/src/integrations/rest.ts b/packages/server/src/integrations/rest.ts index 87ed374aef..284d2a921a 100644 --- a/packages/server/src/integrations/rest.ts +++ b/packages/server/src/integrations/rest.ts @@ -1,14 +1,14 @@ import { Integration, - DatasourceFieldTypes, - QueryTypes, + DatasourceFieldType, + QueryType, PaginationConfig, IntegrationBase, PaginationValues, + RestQueryFields as RestQuery, } from "@budibase/types" import { RestConfig, - RestQueryFields as RestQuery, AuthType, BasicAuthConfig, BearerAuthConfig, @@ -26,27 +26,27 @@ const BodyTypes = { const coreFields = { path: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, display: "URL", }, queryString: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, }, headers: { - type: DatasourceFieldTypes.OBJECT, + type: DatasourceFieldType.OBJECT, }, enabledHeaders: { - type: DatasourceFieldTypes.OBJECT, + type: DatasourceFieldType.OBJECT, }, requestBody: { - type: DatasourceFieldTypes.JSON, + type: DatasourceFieldType.JSON, }, bodyType: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, enum: Object.values(BodyTypes), }, pagination: { - type: DatasourceFieldTypes.OBJECT, + type: DatasourceFieldType.OBJECT, }, } @@ -69,13 +69,13 @@ module RestModule { type: "API", datasource: { url: { - type: DatasourceFieldTypes.STRING, + type: DatasourceFieldType.STRING, default: "", required: false, deprecated: true, }, defaultHeaders: { - type: DatasourceFieldTypes.OBJECT, + type: DatasourceFieldType.OBJECT, required: false, default: {}, }, @@ -84,30 +84,30 @@ module RestModule { create: { readable: true, displayName: "POST", - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, fields: coreFields, }, read: { displayName: "GET", readable: true, - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, fields: coreFields, }, update: { displayName: "PUT", readable: true, - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, fields: coreFields, }, patch: { displayName: "PATCH", readable: true, - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, fields: coreFields, }, delete: { displayName: "DELETE", - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, fields: coreFields, }, }, diff --git a/packages/server/src/integrations/s3.ts b/packages/server/src/integrations/s3.ts index e92eaf9417..e8da696424 100644 --- a/packages/server/src/integrations/s3.ts +++ b/packages/server/src/integrations/s3.ts @@ -1,4 +1,4 @@ -import { Integration, QueryTypes, IntegrationBase } from "@budibase/types" +import { Integration, QueryType, IntegrationBase } from "@budibase/types" module S3Module { const AWS = require("aws-sdk") @@ -43,7 +43,7 @@ module S3Module { }, query: { read: { - type: QueryTypes.FIELDS, + type: QueryType.FIELDS, fields: { bucket: { type: "string", diff --git a/packages/server/src/integrations/snowflake.ts b/packages/server/src/integrations/snowflake.ts index 82f26e733a..7155d27b66 100644 --- a/packages/server/src/integrations/snowflake.ts +++ b/packages/server/src/integrations/snowflake.ts @@ -1,4 +1,4 @@ -import { Integration, QueryTypes, SqlQuery } from "@budibase/types" +import { Integration, QueryType, SqlQuery } from "@budibase/types" import { Snowflake } from "snowflake-promise" module SnowflakeModule { @@ -45,16 +45,16 @@ module SnowflakeModule { }, query: { create: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, read: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, update: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, delete: { - type: QueryTypes.SQL, + type: QueryType.SQL, }, }, } diff --git a/packages/server/src/integrations/tests/sql.spec.js b/packages/server/src/integrations/tests/sql.spec.js index 55c762573a..985a019b78 100644 --- a/packages/server/src/integrations/tests/sql.spec.js +++ b/packages/server/src/integrations/tests/sql.spec.js @@ -1,5 +1,5 @@ const Sql = require("../base/sql") -const { SqlClients } = require("../utils") +const { SqlClient } = require("../utils") const TABLE_NAME = "test" @@ -47,7 +47,7 @@ function generateDeleteJson(table = TABLE_NAME, filters = {}) { describe("SQL query builder", () => { const limit = 500 - const client = SqlClients.POSTGRES + const client = SqlClient.POSTGRES let sql beforeEach(() => { @@ -174,7 +174,7 @@ describe("SQL query builder", () => { }) it("should work with MS-SQL", () => { - const query = new Sql(SqlClients.MS_SQL, 10)._query(generateReadJson()) + 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}]` @@ -182,7 +182,7 @@ describe("SQL query builder", () => { }) it("should work with MySQL", () => { - const query = new Sql(SqlClients.MY_SQL, 10)._query(generateReadJson()) + 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}\`` @@ -241,7 +241,7 @@ describe("SQL query builder", () => { }) it("should use like expression for MS-SQL when filter is contains", () => { - const query = new Sql(SqlClients.MS_SQL, 10)._query(generateReadJson({ + const query = new Sql(SqlClient.MS_SQL, 10)._query(generateReadJson({ filters: { contains: { age: 20, @@ -256,7 +256,7 @@ describe("SQL query builder", () => { }) it("should use JSON_CONTAINS expression for MySQL when filter is contains", () => { - const query = new Sql(SqlClients.MY_SQL, 10)._query(generateReadJson({ + const query = new Sql(SqlClient.MY_SQL, 10)._query(generateReadJson({ filters: { contains: { age: 20, @@ -271,7 +271,7 @@ describe("SQL query builder", () => { }) it("should use jsonb operator expression for PostgreSQL when filter is contains", () => { - const query = new Sql(SqlClients.POSTGRES, 10)._query(generateReadJson({ + const query = new Sql(SqlClient.POSTGRES, 10)._query(generateReadJson({ filters: { contains: { age: 20, diff --git a/packages/server/src/integrations/utils.ts b/packages/server/src/integrations/utils.ts index a0f2b764bc..287783eec6 100644 --- a/packages/server/src/integrations/utils.ts +++ b/packages/server/src/integrations/utils.ts @@ -1,6 +1,5 @@ -import { SourceNames, SqlQuery } from "../definitions/datasource" -import { Datasource, Table } from "../definitions/common" -import { DocumentTypes, SEPARATOR } from "../db/utils" +import { SourceName, SqlQuery, Datasource, Table } from "@budibase/types" +import { DocumentType, SEPARATOR } from "../db/utils" import { FieldTypes, BuildSchemaErrors, InvalidColumns } from "../constants" const DOUBLE_SEPARATOR = `${SEPARATOR}${SEPARATOR}` @@ -68,7 +67,7 @@ const SQL_TYPE_MAP = { ...SQL_MISC_TYPE_MAP, } -export enum SqlClients { +export enum SqlClient { MS_SQL = "mssql", POSTGRES = "pg", MY_SQL = "mysql2", @@ -76,7 +75,7 @@ export enum SqlClients { } export function isExternalTable(tableId: string) { - return tableId.includes(DocumentTypes.DATASOURCE) + return tableId.includes(DocumentType.DATASOURCE) } export function buildExternalTableId(datasourceId: string, tableName: string) { @@ -169,10 +168,10 @@ export function isSQL(datasource: Datasource): boolean { return false } const SQL = [ - SourceNames.POSTGRES, - SourceNames.SQL_SERVER, - SourceNames.MYSQL, - SourceNames.ORACLE, + SourceName.POSTGRES, + SourceName.SQL_SERVER, + SourceName.MYSQL, + SourceName.ORACLE, ] return SQL.indexOf(datasource.source) !== -1 } diff --git a/packages/server/src/middleware/builder.js b/packages/server/src/middleware/builder.js index b63a086d48..12c4b93c75 100644 --- a/packages/server/src/middleware/builder.js +++ b/packages/server/src/middleware/builder.js @@ -6,7 +6,7 @@ const { setDebounce, } = require("../utilities/redis") const { doWithDB } = require("@budibase/backend-core/db") -const { DocumentTypes, getGlobalIDFromUserMetadataID } = require("../db/utils") +const { DocumentType, getGlobalIDFromUserMetadataID } = require("../db/utils") const { PermissionTypes } = require("@budibase/backend-core/permissions") const { app: appCache } = require("@budibase/backend-core/cache") @@ -49,7 +49,7 @@ async function updateAppUpdatedAt(ctx) { return } await doWithDB(appId, async db => { - const metadata = await db.get(DocumentTypes.APP_METADATA) + const metadata = await db.get(DocumentType.APP_METADATA) metadata.updatedAt = new Date().toISOString() metadata.updatedBy = getGlobalIDFromUserMetadataID(ctx.user.userId) diff --git a/packages/server/src/migrations/functions/appUrls.ts b/packages/server/src/migrations/functions/appUrls.ts index 1446fcafc0..1b563bb932 100644 --- a/packages/server/src/migrations/functions/appUrls.ts +++ b/packages/server/src/migrations/functions/appUrls.ts @@ -1,4 +1,4 @@ -const { DocumentTypes } = require("@budibase/backend-core/db") +const { DocumentType } = require("@budibase/backend-core/db") import { getAppUrl } from "../../api/controllers/application" /** @@ -11,7 +11,7 @@ import { getAppUrl } from "../../api/controllers/application" export const run = async (appDb: any) => { let metadata try { - metadata = await appDb.get(DocumentTypes.APP_METADATA) + metadata = await appDb.get(DocumentType.APP_METADATA) } catch (e) { // sometimes the metadata document doesn't exist // exit early instead of failing the migration diff --git a/packages/server/src/migrations/functions/backfill/app.ts b/packages/server/src/migrations/functions/backfill/app.ts index 476344e7b0..51a37108b0 100644 --- a/packages/server/src/migrations/functions/backfill/app.ts +++ b/packages/server/src/migrations/functions/backfill/app.ts @@ -62,7 +62,7 @@ export const run = async (appDb: any) => { await events.backfillCache.start(EVENTS) let timestamp: string | number = DEFAULT_TIMESTAMP - const app: App = await appDb.get(dbUtils.DocumentTypes.APP_METADATA) + const app: App = await appDb.get(dbUtils.DocumentType.APP_METADATA) if (app.createdAt) { timestamp = app.createdAt as string } diff --git a/packages/server/src/migrations/functions/backfill/app/queries.ts b/packages/server/src/migrations/functions/backfill/app/queries.ts index c47a4061c7..e66c7af841 100644 --- a/packages/server/src/migrations/functions/backfill/app/queries.ts +++ b/packages/server/src/migrations/functions/backfill/app/queries.ts @@ -1,6 +1,6 @@ import { events } from "@budibase/backend-core" import { getQueryParams } from "../../../../db/utils" -import { Query, Datasource, SourceNames } from "@budibase/types" +import { Query, Datasource, SourceName } from "@budibase/types" const getQueries = async (appDb: any): Promise => { const response = await appDb.allDocs( @@ -33,7 +33,7 @@ export const backfill = async (appDb: any, timestamp: string | number) => { datasource = { type: "unknown", _id: query.datasourceId, - source: SourceNames.UNKNOWN, + source: SourceName.UNKNOWN, } } else { throw e diff --git a/packages/server/src/migrations/functions/backfill/global/users.ts b/packages/server/src/migrations/functions/backfill/global/users.ts index 5f811614b4..05c5f8f56e 100644 --- a/packages/server/src/migrations/functions/backfill/global/users.ts +++ b/packages/server/src/migrations/functions/backfill/global/users.ts @@ -4,7 +4,7 @@ import { DEFAULT_TIMESTAMP } from ".." // manually define user doc params - normally server doesn't read users from the db const getUserParams = (props: any) => { - return dbUtils.getDocParams(dbUtils.DocumentTypes.USER, null, props) + return dbUtils.getDocParams(dbUtils.DocumentType.USER, null, props) } export const getUsers = async (globalDb: any): Promise => { diff --git a/packages/server/src/migrations/functions/tests/appUrls.spec.js b/packages/server/src/migrations/functions/tests/appUrls.spec.js index fe5b9aeeae..4551bac160 100644 --- a/packages/server/src/migrations/functions/tests/appUrls.spec.js +++ b/packages/server/src/migrations/functions/tests/appUrls.spec.js @@ -1,4 +1,4 @@ -const { DocumentTypes, doWithDB } = require("@budibase/backend-core/db") +const { DocumentType, doWithDB } = require("@budibase/backend-core/db") const TestConfig = require("../../../tests/utilities/TestConfiguration") const migration = require("../appUrls") @@ -15,11 +15,11 @@ describe("run", () => { it("runs successfully", async () => { const app = await config.createApp("testApp") const metadata = await doWithDB(app.appId, async db => { - const metadataDoc = await db.get(DocumentTypes.APP_METADATA) + const metadataDoc = await db.get( DocumentType.APP_METADATA) delete metadataDoc.url await db.put(metadataDoc) await migration.run(db) - return await db.get(DocumentTypes.APP_METADATA) + return await db.get( DocumentType.APP_METADATA) }) expect(metadata.url).toEqual("/testapp") }) diff --git a/packages/server/src/migrations/tests/index.spec.ts b/packages/server/src/migrations/tests/index.spec.ts index 72bf2ff1a9..e2c2fb5c96 100644 --- a/packages/server/src/migrations/tests/index.spec.ts +++ b/packages/server/src/migrations/tests/index.spec.ts @@ -2,7 +2,7 @@ import { events, migrations, tenancy, - DocumentTypes, + DocumentType, context, db, } from "@budibase/backend-core" @@ -17,7 +17,7 @@ const timestamp = mocks.date.MOCK_DATE.toISOString() const clearMigrations = async () => { const dbs = [context.getDevAppDB(), context.getProdAppDB()] for (const db of dbs) { - const doc = await db.get(DocumentTypes.MIGRATIONS) + const doc = await db.get(DocumentType.MIGRATIONS) const newDoc = { _id: doc._id, _rev: doc._rev } await db.put(newDoc) } diff --git a/packages/server/src/tests/utilities/TestConfiguration.js b/packages/server/src/tests/utilities/TestConfiguration.js index cf0bd6f5b6..d1dbe59def 100644 --- a/packages/server/src/tests/utilities/TestConfiguration.js +++ b/packages/server/src/tests/utilities/TestConfiguration.js @@ -25,7 +25,7 @@ const newid = require("../../db/newid") const context = require("@budibase/backend-core/context") const { generateDevInfoID, SEPARATOR } = require("@budibase/backend-core/db") const { encrypt } = require("@budibase/backend-core/encryption") -const { DocumentTypes } = require("../../db/utils") +const { DocumentType } = require("../../db/utils") const GLOBAL_USER_ID = "us_uuid1" const EMAIL = "babs@babs.com" @@ -344,7 +344,7 @@ class TestConfiguration { return context.doInAppContext(prodAppId, async () => { const db = context.getProdAppDB() - return await db.get(DocumentTypes.APP_METADATA) + return await db.get(DocumentType.APP_METADATA) }) } diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts index 0b8d2e89bd..d04c49ce79 100644 --- a/packages/server/src/threads/automation.ts +++ b/packages/server/src/threads/automation.ts @@ -11,7 +11,7 @@ import { storeLog } from "../automations/logging" import { Automation, AutomationStep, AutomationStatus } from "@budibase/types" import { LoopStep, - LoopStepTypes, + LoopStepType, LoopInput, AutomationEvent, TriggerOutput, @@ -35,12 +35,12 @@ function typecastForLooping(loopStep: LoopStep, input: LoopInput) { } try { switch (loopStep.inputs.option) { - case LoopStepTypes.ARRAY: + case LoopStepType.ARRAY: if (typeof input.binding === "string") { return JSON.parse(input.binding) } break - case LoopStepTypes.STRING: + case LoopStepType.STRING: if (Array.isArray(input.binding)) { return input.binding.join(",") } diff --git a/packages/server/src/utilities/security.js b/packages/server/src/utilities/security.js index a0d9c8d57f..d8133e585b 100644 --- a/packages/server/src/utilities/security.js +++ b/packages/server/src/utilities/security.js @@ -8,7 +8,7 @@ const { lowerBuiltinRoleID, getBuiltinRoles, } = require("@budibase/backend-core/roles") -const { DocumentTypes } = require("../db/utils") +const { DocumentType } = require("../db/utils") const CURRENTLY_SUPPORTED_LEVELS = [ PermissionLevels.WRITE, @@ -17,19 +17,19 @@ const CURRENTLY_SUPPORTED_LEVELS = [ ] exports.getPermissionType = resourceId => { - const docType = Object.values(DocumentTypes).filter(docType => + const docType = Object.values(DocumentType).filter(docType => resourceId.startsWith(docType) )[0] switch (docType) { - case DocumentTypes.TABLE: - case DocumentTypes.ROW: + case DocumentType.TABLE: + case DocumentType.ROW: return PermissionTypes.TABLE - case DocumentTypes.AUTOMATION: + case DocumentType.AUTOMATION: return PermissionTypes.AUTOMATION - case DocumentTypes.WEBHOOK: + case DocumentType.WEBHOOK: return PermissionTypes.WEBHOOK - case DocumentTypes.QUERY: - case DocumentTypes.DATASOURCE: + case DocumentType.QUERY: + case DocumentType.DATASOURCE: return PermissionTypes.QUERY default: // views don't have an ID, will end up here diff --git a/packages/types/src/documents/app/datasource.ts b/packages/types/src/documents/app/datasource.ts index 10bdd24afa..efdc2ca1bd 100644 --- a/packages/types/src/documents/app/datasource.ts +++ b/packages/types/src/documents/app/datasource.ts @@ -1,11 +1,11 @@ import { Document } from "../document" -import { SourceNames } from "../../sdk" +import { SourceName } from "../../sdk" import { Table } from "./table" export interface Datasource extends Document { type: string name?: string - source: SourceNames + source: SourceName // the config is defined by the schema config?: { [key: string]: string | number | boolean diff --git a/packages/types/src/documents/app/row.ts b/packages/types/src/documents/app/row.ts index 41ad1b1449..ee5c0231e7 100644 --- a/packages/types/src/documents/app/row.ts +++ b/packages/types/src/documents/app/row.ts @@ -1,6 +1,6 @@ import { Document } from "../document" -export enum FieldTypes { +export enum FieldType { STRING = "string", LONGFORM = "longform", OPTIONS = "options", diff --git a/packages/types/src/documents/index.ts b/packages/types/src/documents/index.ts index 7938052425..4f5b278a4b 100644 --- a/packages/types/src/documents/index.ts +++ b/packages/types/src/documents/index.ts @@ -2,3 +2,4 @@ export * from "./account" export * from "./app" export * from "./global" export * from "./platform" +export * from "./document" diff --git a/packages/types/src/sdk/datasources.ts b/packages/types/src/sdk/datasources.ts index e6b5582a6f..970613b322 100644 --- a/packages/types/src/sdk/datasources.ts +++ b/packages/types/src/sdk/datasources.ts @@ -16,13 +16,13 @@ export enum SortDirection { DESCENDING = "DESCENDING", } -export enum QueryTypes { +export enum QueryType { SQL = "sql", JSON = "json", FIELDS = "fields", } -export enum DatasourceFieldTypes { +export enum DatasourceFieldType { STRING = "string", LONGFORM = "longForm", BOOLEAN = "boolean", @@ -34,7 +34,7 @@ export enum DatasourceFieldTypes { FILE = "file", } -export enum SourceNames { +export enum SourceName { POSTGRES = "POSTGRES", DYNAMODB = "DYNAMODB", MONGODB = "MONGODB", @@ -54,12 +54,12 @@ export enum SourceNames { UNKNOWN = "unknown", } -export enum IncludeRelationships { +export enum IncludeRelationship { INCLUDE = 1, EXCLUDE = 0, } -export enum FilterTypes { +export enum FilterType { STRING = "string", FUZZY = "fuzzy", RANGE = "range", @@ -71,7 +71,7 @@ export enum FilterTypes { } export interface QueryDefinition { - type: QueryTypes + type: QueryType displayName?: string readable?: boolean customisable?: boolean diff --git a/packages/worker/src/api/controllers/global/roles.js b/packages/worker/src/api/controllers/global/roles.js index 0859fc1a21..800311b6be 100644 --- a/packages/worker/src/api/controllers/global/roles.js +++ b/packages/worker/src/api/controllers/global/roles.js @@ -2,7 +2,7 @@ const { getAllRoles } = require("@budibase/backend-core/roles") const { getAllApps, getProdAppID, - DocumentTypes, + DocumentType, } = require("@budibase/backend-core/db") const { doInAppContext, getAppDB } = require("@budibase/backend-core/context") const { user: userCache } = require("@budibase/backend-core/cache") @@ -36,7 +36,7 @@ exports.find = async ctx => { const appId = ctx.params.appId await doInAppContext(appId, async () => { const db = getAppDB() - const app = await db.get(DocumentTypes.APP_METADATA) + const app = await db.get(DocumentType.APP_METADATA) ctx.body = { roles: await getAllRoles(), name: app.name, From 86ab50fe33b6048e397ada4e70413988e62d8dd9 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 11 Aug 2022 14:40:17 +0100 Subject: [PATCH 21/23] Fixing viewname enumeration. --- packages/server/src/api/controllers/view/utils.js | 4 ++-- packages/server/src/db/linkedRows/linkUtils.js | 4 ++-- packages/server/src/db/utils.js | 4 ++-- packages/server/src/db/views/staticViews.js | 11 +++-------- packages/server/src/utilities/routing/index.js | 4 ++-- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/packages/server/src/api/controllers/view/utils.js b/packages/server/src/api/controllers/view/utils.js index bb3819f290..97a179532e 100644 --- a/packages/server/src/api/controllers/view/utils.js +++ b/packages/server/src/api/controllers/view/utils.js @@ -1,5 +1,5 @@ const { - ViewNames, + ViewName, generateMemoryViewID, getMemoryViewParams, DocumentType, @@ -32,7 +32,7 @@ exports.getViews = async () => { const designDoc = await db.get("_design/database") for (let name of Object.keys(designDoc.views)) { // Only return custom views, not built ins - if (Object.values(ViewNames).indexOf(name) !== -1) { + if (Object.values(ViewName).indexOf(name) !== -1) { continue } response.push({ diff --git a/packages/server/src/db/linkedRows/linkUtils.js b/packages/server/src/db/linkedRows/linkUtils.js index 5af4aa919a..5fc393ecf0 100644 --- a/packages/server/src/db/linkedRows/linkUtils.js +++ b/packages/server/src/db/linkedRows/linkUtils.js @@ -1,5 +1,5 @@ const Sentry = require("@sentry/node") -const { ViewNames, getQueryIndex } = require("../utils") +const { ViewName, getQueryIndex } = require("../utils") const { FieldTypes } = require("../../constants") const { createLinkView } = require("../views/staticViews") const { getAppDB } = require("@budibase/backend-core/context") @@ -41,7 +41,7 @@ exports.getLinkDocuments = async function (args) { } params.include_docs = !!includeDocs try { - let linkRows = (await db.query(getQueryIndex(ViewNames.LINK), params)).rows + let linkRows = (await db.query(getQueryIndex(ViewName.LINK), params)).rows // filter to get unique entries const foundIds = [] linkRows = linkRows.filter(link => { diff --git a/packages/server/src/db/utils.js b/packages/server/src/db/utils.js index 8a556dd854..d23152a663 100644 --- a/packages/server/src/db/utils.js +++ b/packages/server/src/db/utils.js @@ -12,7 +12,7 @@ const { getDevelopmentAppID, generateAppID, getQueryIndex, - ViewNames, + ViewName, } = require("@budibase/backend-core/db") const UNICODE_MAX = "\ufff0" @@ -69,7 +69,7 @@ exports.isProdAppID = isProdAppID exports.USER_METDATA_PREFIX = `${DocumentType.ROW}${SEPARATOR}${InternalTables.USER_METADATA}${SEPARATOR}` exports.LINK_USER_METADATA_PREFIX = `${DocumentType.LINK}${SEPARATOR}${InternalTables.USER_METADATA}${SEPARATOR}` exports.TABLE_ROW_PREFIX = `${DocumentType.ROW}${SEPARATOR}${DocumentType.TABLE}` -exports.ViewNames = ViewNames +exports.ViewName = ViewName exports.InternalTables = InternalTables exports.DocumentType = DocumentType exports.SEPARATOR = SEPARATOR diff --git a/packages/server/src/db/views/staticViews.js b/packages/server/src/db/views/staticViews.js index f51e695f27..d715c02968 100644 --- a/packages/server/src/db/views/staticViews.js +++ b/packages/server/src/db/views/staticViews.js @@ -1,10 +1,5 @@ const { getAppDB } = require("@budibase/backend-core/context") -const { - DocumentType, - SEPARATOR, - ViewNames, - SearchIndexes, -} = require("../utils") +const { DocumentType, SEPARATOR, ViewName, SearchIndexes } = require("../utils") const SCREEN_PREFIX = DocumentType.SCREEN + SEPARATOR /************************************************** @@ -53,7 +48,7 @@ exports.createLinkView = async () => { } designDoc.views = { ...designDoc.views, - [ViewNames.LINK]: view, + [ViewName.LINK]: view, } await db.put(designDoc) } @@ -74,7 +69,7 @@ exports.createRoutingView = async () => { } designDoc.views = { ...designDoc.views, - [ViewNames.ROUTING]: view, + [ViewName.ROUTING]: view, } await db.put(designDoc) } diff --git a/packages/server/src/utilities/routing/index.js b/packages/server/src/utilities/routing/index.js index b68001c3c3..963119130b 100644 --- a/packages/server/src/utilities/routing/index.js +++ b/packages/server/src/utilities/routing/index.js @@ -1,11 +1,11 @@ const { createRoutingView } = require("../../db/views/staticViews") -const { ViewNames, getQueryIndex, UNICODE_MAX } = require("../../db/utils") +const { ViewName, getQueryIndex, UNICODE_MAX } = require("../../db/utils") const { getAppDB } = require("@budibase/backend-core/context") exports.getRoutingInfo = async () => { const db = getAppDB() try { - const allRouting = await db.query(getQueryIndex(ViewNames.ROUTING), { + const allRouting = await db.query(getQueryIndex(ViewName.ROUTING), { startKey: "", endKey: UNICODE_MAX, }) From 4472b3cedce97eef5a2f19bd6f8fd49a78da50e9 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 11 Aug 2022 14:29:57 +0000 Subject: [PATCH 22/23] v1.2.38 --- 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 ba50ac2b31..92a1d5913f 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.2.37", + "version": "1.2.38", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 4e3582fd41..2145ebea9f 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.2.37", + "version": "1.2.38", "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.37", + "@budibase/types": "^1.2.38", "@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 20db0ae447..2483b8b662 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.37", + "version": "1.2.38", "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.37", + "@budibase/string-templates": "^1.2.38", "@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 6a9507a340..6c8d837a50 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.2.37", + "version": "1.2.38", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.2.37", - "@budibase/client": "^1.2.37", - "@budibase/frontend-core": "^1.2.37", - "@budibase/string-templates": "^1.2.37", + "@budibase/bbui": "^1.2.38", + "@budibase/client": "^1.2.38", + "@budibase/frontend-core": "^1.2.38", + "@budibase/string-templates": "^1.2.38", "@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 8fa274a5ac..06de78e3c4 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.2.37", + "version": "1.2.38", "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 72ff026965..0dd03497ec 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.2.37", + "version": "1.2.38", "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.37", - "@budibase/frontend-core": "^1.2.37", - "@budibase/string-templates": "^1.2.37", + "@budibase/bbui": "^1.2.38", + "@budibase/frontend-core": "^1.2.38", + "@budibase/string-templates": "^1.2.38", "@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 0d54ec5158..c6aa010300 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.2.37", + "version": "1.2.38", "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.37", + "@budibase/bbui": "^1.2.38", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 75968e8d96..164966e723 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.37", + "version": "1.2.38", "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.37", - "@budibase/client": "^1.2.37", + "@budibase/backend-core": "^1.2.38", + "@budibase/client": "^1.2.38", "@budibase/pro": "1.2.37", - "@budibase/string-templates": "^1.2.37", - "@budibase/types": "^1.2.37", + "@budibase/string-templates": "^1.2.38", + "@budibase/types": "^1.2.38", "@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 bc34f8bc1f..cc4b07f8cd 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.2.37", + "version": "1.2.38", "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 7e66f0bdaf..5541ecfe91 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.2.37", + "version": "1.2.38", "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 0e53176a9e..692f15754e 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.37", + "version": "1.2.38", "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.37", + "@budibase/backend-core": "^1.2.38", "@budibase/pro": "1.2.37", - "@budibase/string-templates": "^1.2.37", - "@budibase/types": "^1.2.37", + "@budibase/string-templates": "^1.2.38", + "@budibase/types": "^1.2.38", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From c8bf6afe1a6ba3e6cf2843ebfb92507379ee66b8 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 11 Aug 2022 14:33:24 +0000 Subject: [PATCH 23/23] Update pro version to 1.2.38 --- 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 164966e723..e6007e2bd5 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.38", "@budibase/client": "^1.2.38", - "@budibase/pro": "1.2.37", + "@budibase/pro": "1.2.38", "@budibase/string-templates": "^1.2.38", "@budibase/types": "^1.2.38", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index c6e88b370d..5874379e25 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.37": - version "1.2.37" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.37.tgz#e9751c183edfb5c74bcd74259affefcd74f1e977" - integrity sha512-70bUAiRXHsy/3NtD/zKZeQpRX93Zhp3l8//f8CIgyxiGunfYInoDyCe1tWsMFsi7BZdBFUH5mcrdw0K7Xi6jaA== +"@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.37" + "@budibase/types" "^1.2.38" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -1177,13 +1177,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.2.37": - version "1.2.37" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.37.tgz#5e49d33901a5a9ba642cbe38b681e075d6e80226" - integrity sha512-9x9II47sg7i6jo09BG1w17/IH6XkB1M8cabZWUNAx2LYGiG/3v7e7tHXU3RWN/VlI3zxcfuSuyCgkQzsvOGvig== +"@budibase/pro@1.2.38": + version "1.2.38" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.38.tgz#12253371baccab9e29126a296b10c368054497c5" + integrity sha512-VmzceZhgz+TolXKCpgGmxh2E1maBLCX68h6B8OQ0ksNlHFi4x0nn3qBJr1XNta8KhG8fnAVxSteBuMVuixGIfQ== dependencies: - "@budibase/backend-core" "1.2.37" - "@budibase/types" "1.2.37" + "@budibase/backend-core" "1.2.38" + "@budibase/types" "1.2.38" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1206,10 +1206,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@1.2.37", "@budibase/types@^1.2.37": - version "1.2.37" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.37.tgz#4c78197ea67f50cf09cd4c03aecdec99243aaba2" - integrity sha512-7svPsrhev/ElXKQvrBJTzfHWE+jWUqZQzOBdj0mL+uD8xBIa4pOpxoLvo3CkyeFrLWZKMlepap4MWQCKeJnazw== +"@budibase/types@1.2.38", "@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== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 692f15754e..9d6cad67b1 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.38", - "@budibase/pro": "1.2.37", + "@budibase/pro": "1.2.38", "@budibase/string-templates": "^1.2.38", "@budibase/types": "^1.2.38", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 672f62f005..587adb9a84 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.37": - version "1.2.37" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.37.tgz#e9751c183edfb5c74bcd74259affefcd74f1e977" - integrity sha512-70bUAiRXHsy/3NtD/zKZeQpRX93Zhp3l8//f8CIgyxiGunfYInoDyCe1tWsMFsi7BZdBFUH5mcrdw0K7Xi6jaA== +"@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.37" + "@budibase/types" "^1.2.38" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" bcrypt "5.0.1" @@ -324,21 +324,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.2.37": - version "1.2.37" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.37.tgz#5e49d33901a5a9ba642cbe38b681e075d6e80226" - integrity sha512-9x9II47sg7i6jo09BG1w17/IH6XkB1M8cabZWUNAx2LYGiG/3v7e7tHXU3RWN/VlI3zxcfuSuyCgkQzsvOGvig== +"@budibase/pro@1.2.38": + version "1.2.38" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.38.tgz#12253371baccab9e29126a296b10c368054497c5" + integrity sha512-VmzceZhgz+TolXKCpgGmxh2E1maBLCX68h6B8OQ0ksNlHFi4x0nn3qBJr1XNta8KhG8fnAVxSteBuMVuixGIfQ== dependencies: - "@budibase/backend-core" "1.2.37" - "@budibase/types" "1.2.37" + "@budibase/backend-core" "1.2.38" + "@budibase/types" "1.2.38" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@1.2.37", "@budibase/types@^1.2.37": - version "1.2.37" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.37.tgz#4c78197ea67f50cf09cd4c03aecdec99243aaba2" - integrity sha512-7svPsrhev/ElXKQvrBJTzfHWE+jWUqZQzOBdj0mL+uD8xBIa4pOpxoLvo3CkyeFrLWZKMlepap4MWQCKeJnazw== +"@budibase/types@1.2.38", "@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== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0"