Merge branch 'master' of github.com:Budibase/budibase into develop

This commit is contained in:
mike12345567 2022-09-06 14:09:26 +01:00
commit bc9686d470
24 changed files with 229 additions and 107 deletions

View File

@ -1,5 +1,5 @@
{
"version": "1.3.4-alpha.3",
"version": "1.3.11",
"npmClient": "yarn",
"packages": [
"packages/*"

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/backend-core",
"version": "1.3.4-alpha.3",
"version": "1.3.11",
"description": "Budibase backend core libraries used in server and worker",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
@ -20,7 +20,8 @@
"test:watch": "jest --watchAll"
},
"dependencies": {
"@budibase/types": "1.3.4-alpha.3",
"@budibase/types": "^1.3.11",
"@shopify/jest-koa-mocks": "5.0.1",
"@techpass/passport-openidconnect": "0.3.2",
"aws-sdk": "2.1030.0",
"bcrypt": "5.0.1",
@ -60,7 +61,6 @@
]
},
"devDependencies": {
"@shopify/jest-koa-mocks": "3.1.5",
"@types/jest": "27.5.1",
"@types/koa": "2.0.52",
"@types/lodash": "4.14.180",

View File

@ -543,13 +543,13 @@
semver "^7.3.5"
tar "^6.1.11"
"@shopify/jest-koa-mocks@3.1.5":
version "3.1.5"
resolved "https://registry.yarnpkg.com/@shopify/jest-koa-mocks/-/jest-koa-mocks-3.1.5.tgz#11f77ccfbcaf35cf5ee2c6108a286e61e6bea084"
integrity sha512-gQ3/7ELerv00TWO37AGFX5mT9CsFCS+3/UbKMuoIlKEU0QH2OX8BV9WBf/EKw7adCDNlxss0lqV6J8kf5pgr4A==
"@shopify/jest-koa-mocks@5.0.1":
version "5.0.1"
resolved "https://registry.yarnpkg.com/@shopify/jest-koa-mocks/-/jest-koa-mocks-5.0.1.tgz#fba490b6b7985fbb571eb9974897d396a3642e94"
integrity sha512-4YskS9q8+TEHNoyopmuoy2XyhInyqeOl7CF5ShJs19sm6m0EA/jGGvgf/osv2PeTfuf42/L2G9CzWUSg49yTSg==
dependencies:
koa "^2.13.4"
node-mocks-http "^1.5.8"
node-mocks-http "^1.11.0"
"@sideway/address@^4.1.3":
version "4.1.4"
@ -3914,7 +3914,7 @@ node-int64@^0.4.0:
resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"
integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==
node-mocks-http@^1.5.8:
node-mocks-http@^1.11.0:
version "1.11.0"
resolved "https://registry.yarnpkg.com/node-mocks-http/-/node-mocks-http-1.11.0.tgz#defc0febf6b935f08245397d47534a8de592996e"
integrity sha512-jS/WzSOcKbOeGrcgKbenZeNhxUNnP36Yw11+hL4TTxQXErGfqYZ+MaYNNvhaTiGIJlzNSqgQkk9j8dSu1YWSuw==

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.",
"version": "1.3.4-alpha.3",
"version": "1.3.11",
"license": "MPL-2.0",
"svelte": "src/index.js",
"module": "dist/bbui.es.js",
@ -38,7 +38,7 @@
],
"dependencies": {
"@adobe/spectrum-css-workflow-icons": "^1.2.1",
"@budibase/string-templates": "1.3.4-alpha.3",
"@budibase/string-templates": "^1.3.11",
"@spectrum-css/actionbutton": "^1.0.1",
"@spectrum-css/actiongroup": "^1.0.1",
"@spectrum-css/avatar": "^3.0.2",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/builder",
"version": "1.3.4-alpha.3",
"version": "1.3.11",
"license": "GPL-3.0",
"private": true,
"scripts": {
@ -69,10 +69,10 @@
}
},
"dependencies": {
"@budibase/bbui": "1.3.4-alpha.3",
"@budibase/client": "1.3.4-alpha.3",
"@budibase/frontend-core": "1.3.4-alpha.3",
"@budibase/string-templates": "1.3.4-alpha.3",
"@budibase/bbui": "^1.3.11",
"@budibase/client": "^1.3.11",
"@budibase/frontend-core": "^1.3.11",
"@budibase/string-templates": "^1.3.11",
"@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1",

View File

@ -54,7 +54,7 @@
},
}
const handleKeyAction = async (component, key, ctrlKey = false) => {
const handleKeyAction = async (event, component, key, ctrlKey = false) => {
if (!component || !key) {
return false
}
@ -70,6 +70,9 @@
const handler = keyHandlers[key]
if (!handler) {
return false
} else if (event) {
event.preventDefault()
event.stopPropagation()
}
return handler(component)
} catch (error) {
@ -89,14 +92,19 @@
return
}
// Key events are always for the selected component
return handleKeyAction($selectedComponent, e.key, e.ctrlKey || e.metaKey)
return await handleKeyAction(
e,
$selectedComponent,
e.key,
e.ctrlKey || e.metaKey
)
}
const handleComponentMenu = async e => {
// Menu events can be for any component
const { id, key, ctrlKey } = e.detail
const component = findComponent($selectedScreen.props, id)
return await handleKeyAction(component, key, ctrlKey)
return await handleKeyAction(null, component, key, ctrlKey)
}
onMount(() => {

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/cli",
"version": "1.3.4-alpha.3",
"version": "1.3.11",
"description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js",
"bin": {
@ -26,7 +26,7 @@
"outputPath": "build"
},
"dependencies": {
"@budibase/backend-core": "1.3.4-alpha.3",
"@budibase/backend-core": "^1.3.11",
"axios": "0.21.2",
"chalk": "4.1.0",
"cli-progress": "3.11.2",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/client",
"version": "1.3.4-alpha.3",
"version": "1.3.11",
"license": "MPL-2.0",
"module": "dist/budibase-client.js",
"main": "dist/budibase-client.js",
@ -19,9 +19,9 @@
"dev:builder": "rollup -cw"
},
"dependencies": {
"@budibase/bbui": "1.3.4-alpha.3",
"@budibase/frontend-core": "1.3.4-alpha.3",
"@budibase/string-templates": "1.3.4-alpha.3",
"@budibase/bbui": "^1.3.11",
"@budibase/frontend-core": "^1.3.11",
"@budibase/string-templates": "^1.3.11",
"@spectrum-css/button": "^3.0.3",
"@spectrum-css/card": "^3.0.3",
"@spectrum-css/divider": "^1.0.3",

View File

@ -1,12 +1,12 @@
{
"name": "@budibase/frontend-core",
"version": "1.3.4-alpha.3",
"version": "1.3.11",
"description": "Budibase frontend core libraries used in builder and client",
"author": "Budibase",
"license": "MPL-2.0",
"svelte": "src/index.js",
"dependencies": {
"@budibase/bbui": "1.3.4-alpha.3",
"@budibase/bbui": "^1.3.11",
"lodash": "^4.17.21",
"svelte": "^3.46.2"
}

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
"version": "1.3.4-alpha.3",
"version": "1.3.11",
"description": "Budibase Web Server",
"main": "src/index.ts",
"repository": {
@ -77,11 +77,11 @@
"license": "GPL-3.0",
"dependencies": {
"@apidevtools/swagger-parser": "10.0.3",
"@budibase/backend-core": "1.3.4-alpha.3",
"@budibase/client": "1.3.4-alpha.3",
"@budibase/pro": "1.3.4-alpha.3",
"@budibase/string-templates": "1.3.4-alpha.3",
"@budibase/types": "1.3.4-alpha.3",
"@budibase/backend-core": "^1.3.11",
"@budibase/client": "^1.3.11",
"@budibase/pro": "1.3.11",
"@budibase/string-templates": "^1.3.11",
"@budibase/types": "^1.3.11",
"@bull-board/api": "3.7.0",
"@bull-board/koa": "3.9.4",
"@elastic/elasticsearch": "7.10.0",

View File

@ -379,7 +379,8 @@ module GoogleSheetsModule {
const rows = await sheet.getRows()
const row = rows[query.rowIndex]
if (row) {
const updateValues = query.row
const updateValues =
typeof query.row === "string" ? JSON.parse(query.row) : query.row
for (let key in updateValues) {
row[key] = updateValues[key]
}

View File

@ -132,12 +132,22 @@ module RedisModule {
async command(query: { json: string }) {
return this.redisContext(async () => {
const commands = query.json.trim().split(" ")
const pipeline = this.client.pipeline([commands])
const result = await pipeline.exec()
return {
response: result[0][1],
// commands split line by line
const commands = query.json.trim().split("\n")
let pipelineCommands = []
// process each command separately
for (let command of commands) {
const tokenised = command.trim().split(" ")
// Pipeline only accepts lower case commands
tokenised[0] = tokenised[0].toLowerCase()
pipelineCommands.push(tokenised)
}
const pipeline = this.client.pipeline(pipelineCommands)
const result = await pipeline.exec()
return result.map((output: string | string[]) => output[1])
})
}
}

View File

@ -46,7 +46,7 @@ describe("Redis Integration", () => {
expect(await config.redis.get(body.key)).toEqual(null)
})
it("calls the command method with the correct params", async () => {
it("calls the pipeline method with the correct params", async () => {
const body = {
json: "KEYS *"
}
@ -55,6 +55,21 @@ describe("Redis Integration", () => {
config.integration.client.pipeline = jest.fn(() => ({ exec: jest.fn(() => [[]]) }))
await config.integration.command(body)
expect(config.integration.client.pipeline).toHaveBeenCalledWith([["KEYS", "*"]])
expect(config.integration.client.pipeline).toHaveBeenCalledWith([["keys", "*"]])
})
it("calls the pipeline method with several separated commands when there are newlines", async () => {
const body = {
json: 'SET foo "bar"\nGET foo'
}
// ioredis-mock doesn't support pipelines
config.integration.client.pipeline = jest.fn(() => ({ exec: jest.fn(() => [[]]) }))
await config.integration.command(body)
expect(config.integration.client.pipeline).toHaveBeenCalledWith([
["set", 'foo', '"bar"'],
["get", 'foo']
])
})
})

View File

@ -19,6 +19,7 @@
"exclude": [
"node_modules",
"dist",
"src/tests",
"**/*.spec.ts",
"**/*.spec.js"
]

View File

@ -1094,12 +1094,13 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@1.3.4-alpha.3":
version "1.3.4-alpha.3"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.4-alpha.3.tgz#2adcd2e111287ffd91a964325f59c8b904b158ae"
integrity sha512-CBlpSQODyG7qGH5jIQlRchQ6xWRTi2B+2eD2IoeI9j2duoNKPxkpvGAzh0NaFEwfmShSfNrC/yrr4YKkMnV3/g==
"@budibase/backend-core@1.3.11":
version "1.3.11"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.11.tgz#ecd2125a97d7edd8c290caea659af01b08d456f7"
integrity sha512-JwZlHml5E4BCSRc94dUvM88ZWb6ZKogdaws366XQy0aa70z7M191LpsPP3x3mKZDg4H2hNNv2k4mQZBQBv0l8A==
dependencies:
"@budibase/types" "1.3.4-alpha.3"
"@budibase/types" "^1.3.11"
"@shopify/jest-koa-mocks" "5.0.1"
"@techpass/passport-openidconnect" "0.3.2"
aws-sdk "2.1030.0"
bcrypt "5.0.1"
@ -1178,13 +1179,13 @@
svelte-flatpickr "^3.2.3"
svelte-portal "^1.0.0"
"@budibase/pro@1.3.4-alpha.3":
version "1.3.4-alpha.3"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.4-alpha.3.tgz#64d46b83ee658635ae32441e3ed97b2902de5286"
integrity sha512-SYmaTMIXDJSRZLXKQrtLEmIeigrL6biiVizDXqo4FbJgNIQg0UVdVP7mTO3sEg1VCbqEB89DEZ1tTaPgmKmgSA==
"@budibase/pro@1.3.11":
version "1.3.11"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.11.tgz#f21a31b13557effd6694c19c56aa6abca1853f93"
integrity sha512-L1UpN81SX3XKoMr9YqHQpOTKnxe3j0hixlOlJlFTU5bVWPVv0CGFAWnc7cDXlpVT8frgpyajNwrf6irNB4P7zw==
dependencies:
"@budibase/backend-core" "1.3.4-alpha.3"
"@budibase/types" "1.3.4-alpha.3"
"@budibase/backend-core" "1.3.11"
"@budibase/types" "1.3.11"
"@koa/router" "8.0.8"
joi "17.6.0"
node-fetch "^2.6.1"
@ -1207,10 +1208,10 @@
svelte-apexcharts "^1.0.2"
svelte-flatpickr "^3.1.0"
"@budibase/types@1.3.4-alpha.3":
version "1.3.4-alpha.3"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.4-alpha.3.tgz#198d00ea7cdc4393044c07ee301f176f0b391378"
integrity sha512-ThpEPNC2vQunqJ6G2avwCqh3zr6Lo28G5CEJUBNrUpnAyJ/Pvw0DPU6shN9loVxR3fmGtWKoU0sA/mapH8QWCg==
"@budibase/types@1.3.11", "@budibase/types@^1.3.11":
version "1.3.11"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.11.tgz#41f2a5c7274e305751636df4aa645d5b418cbe7f"
integrity sha512-hXDqWxH0nVRlgU7CiaqAbD7txdctBed6ZSLmNUD0a2LGY/yueR6MbAO04TD5kXDGvLsEnjxcSWI2N+/GvzqluA==
"@bull-board/api@3.7.0":
version "3.7.0"
@ -2274,6 +2275,14 @@
"@sentry/types" "6.17.7"
tslib "^1.9.3"
"@shopify/jest-koa-mocks@5.0.1":
version "5.0.1"
resolved "https://registry.yarnpkg.com/@shopify/jest-koa-mocks/-/jest-koa-mocks-5.0.1.tgz#fba490b6b7985fbb571eb9974897d396a3642e94"
integrity sha512-4YskS9q8+TEHNoyopmuoy2XyhInyqeOl7CF5ShJs19sm6m0EA/jGGvgf/osv2PeTfuf42/L2G9CzWUSg49yTSg==
dependencies:
koa "^2.13.4"
node-mocks-http "^1.11.0"
"@sideway/address@^4.1.3":
version "4.1.4"
resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.4.tgz#03dccebc6ea47fdc226f7d3d1ad512955d4783f0"
@ -3283,7 +3292,7 @@ abstract-leveldown@~6.2.1, abstract-leveldown@~6.2.3:
level-supports "~1.0.0"
xtend "~4.0.0"
accepts@^1.3.5:
accepts@^1.3.5, accepts@^1.3.7:
version "1.3.8"
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e"
integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==
@ -4838,7 +4847,7 @@ container-info@^1.0.1:
resolved "https://registry.yarnpkg.com/container-info/-/container-info-1.1.0.tgz#6fcb94e93eacd397c6316ca2834491ede44e55ee"
integrity sha512-eD2zLAmxGS2kmL4f1jY8BdOqnmpL6X70kvzTBW/9FIQnxoxiBJ4htMsTmtPLPWRs7NHYFvqKQ1VtppV08mdsQA==
content-disposition@^0.5.2, content-disposition@~0.5.2:
content-disposition@^0.5.2, content-disposition@^0.5.3, content-disposition@~0.5.2:
version "0.5.4"
resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe"
integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==
@ -5290,7 +5299,7 @@ depd@2.0.0, depd@^2.0.0, depd@~2.0.0:
resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df"
integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==
depd@^1.1.2, depd@~1.1.2:
depd@^1.1.0, depd@^1.1.2, depd@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==
@ -6615,7 +6624,7 @@ fragment-cache@^0.2.1:
dependencies:
map-cache "^0.2.2"
fresh@~0.5.2:
fresh@^0.5.2, fresh@~0.5.2:
version "0.5.2"
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==
@ -9458,7 +9467,7 @@ koa@2.7.0:
type-is "^1.6.16"
vary "^1.1.2"
koa@^2.13.1:
koa@^2.13.1, koa@^2.13.4:
version "2.13.4"
resolved "https://registry.yarnpkg.com/koa/-/koa-2.13.4.tgz#ee5b0cb39e0b8069c38d115139c774833d32462e"
integrity sha512-43zkIKubNbnrULWlHdN5h1g3SEKXOEzoAlRsHOTFpnlDu8JlAOZSMJBLULusuXRequboiwJcj5vtYXKB3k7+2g==
@ -10037,6 +10046,11 @@ memorystream@0.3.1:
resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2"
integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==
merge-descriptors@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61"
integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==
merge-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
@ -10440,6 +10454,22 @@ node-int64@^0.4.0:
resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"
integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==
node-mocks-http@^1.11.0:
version "1.11.0"
resolved "https://registry.yarnpkg.com/node-mocks-http/-/node-mocks-http-1.11.0.tgz#defc0febf6b935f08245397d47534a8de592996e"
integrity sha512-jS/WzSOcKbOeGrcgKbenZeNhxUNnP36Yw11+hL4TTxQXErGfqYZ+MaYNNvhaTiGIJlzNSqgQkk9j8dSu1YWSuw==
dependencies:
accepts "^1.3.7"
content-disposition "^0.5.3"
depd "^1.1.0"
fresh "^0.5.2"
merge-descriptors "^1.0.1"
methods "^1.1.2"
mime "^1.3.4"
parseurl "^1.3.3"
range-parser "^1.2.0"
type-is "^1.6.18"
node-releases@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.5.tgz#280ed5bc3eba0d96ce44897d8aee478bfb3d9666"
@ -10986,7 +11016,7 @@ parse5@6.0.1:
resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b"
integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==
parseurl@^1.3.2:
parseurl@^1.3.2, parseurl@^1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4"
integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==
@ -11845,6 +11875,11 @@ randombytes@^2.1.0:
dependencies:
safe-buffer "^5.1.0"
range-parser@^1.2.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031"
integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==
raw-body@^2.2.0:
version "2.5.1"
resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857"
@ -13893,7 +13928,7 @@ type-fest@^0.8.1:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==
type-is@^1.6.14, type-is@^1.6.16:
type-is@^1.6.14, type-is@^1.6.16, type-is@^1.6.18:
version "1.6.18"
resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131"
integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/string-templates",
"version": "1.3.4-alpha.3",
"version": "1.3.11",
"description": "Handlebars wrapper for Budibase templating.",
"main": "src/index.cjs",
"module": "dist/bundle.mjs",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/types",
"version": "1.3.4-alpha.3",
"version": "1.3.11",
"description": "Budibase types",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/worker",
"email": "hi@budibase.com",
"version": "1.3.4-alpha.3",
"version": "1.3.11",
"description": "Budibase background service",
"main": "src/index.ts",
"repository": {
@ -35,10 +35,10 @@
"author": "Budibase",
"license": "GPL-3.0",
"dependencies": {
"@budibase/backend-core": "1.3.4-alpha.3",
"@budibase/pro": "1.3.4-alpha.3",
"@budibase/string-templates": "1.3.4-alpha.3",
"@budibase/types": "1.3.4-alpha.3",
"@budibase/backend-core": "^1.3.11",
"@budibase/pro": "1.3.11",
"@budibase/string-templates": "^1.3.11",
"@budibase/types": "^1.3.11",
"@koa/router": "8.0.8",
"@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "0.3.2",

View File

@ -1,6 +1,7 @@
const { StaticDatabases, doWithDB } = require("@budibase/backend-core/db")
const { getTenantId } = require("@budibase/backend-core/tenancy")
const { deleteTenant } = require("@budibase/backend-core/deprovision")
const { quotas } = require("@budibase/pro")
exports.exists = async ctx => {
const tenantId = ctx.request.params
@ -48,6 +49,7 @@ exports.delete = async ctx => {
try {
await deleteTenant(tenantId)
await quotas.bustCache()
ctx.status = 204
} catch (err) {
ctx.log.error(err)

View File

@ -47,10 +47,7 @@ describe("accounts", () => {
const response = await api.accounts.destroyMetadata(id)
expect(response.status).toBe(404)
expect(response.body.message).toBe(
`id=${accounts.formatAccountMetadataId(id)} does not exist`
)
expect(response.status).toBe(204)
})
})
})

View File

@ -46,8 +46,14 @@ export const destroyMetadata = async (accountId: string) => {
await db.doWithDB(StaticDatabases.PLATFORM_INFO.name, async (db: any) => {
const metadata = await getMetadata(accountId)
if (!metadata) {
throw new HTTPError(`id=${accountId} does not exist`, 404)
return
}
try {
await db.remove(accountId, metadata._rev)
} catch (e: any) {
if (e.status !== 404) {
throw e
}
}
await db.remove(accountId, metadata._rev)
})
}

View File

@ -189,23 +189,34 @@ export const save = async (
const tenantId = tenancy.getTenantId()
const db = tenancy.getGlobalDB()
let { email, _id } = user
if (!email && !_id) {
throw new Error("_id or email is required")
}
let dbUser: User | undefined
if (_id) {
// try to get existing user from db
dbUser = (await db.get(_id)) as User
if (email && dbUser.email !== email) {
throw "Email address cannot be changed"
try {
dbUser = (await db.get(_id)) as User
if (email && dbUser.email !== email) {
throw "Email address cannot be changed"
}
email = dbUser.email
} catch (e: any) {
if (e.status === 404) {
// do nothing, save this new user with the id specified - required for SSO auth
} else {
throw e
}
}
email = dbUser.email
} else if (email) {
}
if (!dbUser && email) {
// no id was specified - load from email instead
dbUser = await usersCore.getGlobalUserByEmail(email)
if (dbUser && dbUser._id !== _id) {
throw `Unavailable`
}
} else {
throw new Error("_id or email is required")
}
await validateUniqueUser(email, tenantId)

View File

@ -19,6 +19,7 @@
"exclude": [
"node_modules",
"dist",
"src/tests",
"**/*.spec.ts",
"**/*.spec.js"
]

View File

@ -291,12 +291,13 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@1.3.4-alpha.3":
version "1.3.4-alpha.3"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.4-alpha.3.tgz#2adcd2e111287ffd91a964325f59c8b904b158ae"
integrity sha512-CBlpSQODyG7qGH5jIQlRchQ6xWRTi2B+2eD2IoeI9j2duoNKPxkpvGAzh0NaFEwfmShSfNrC/yrr4YKkMnV3/g==
"@budibase/backend-core@1.3.11":
version "1.3.11"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.11.tgz#ecd2125a97d7edd8c290caea659af01b08d456f7"
integrity sha512-JwZlHml5E4BCSRc94dUvM88ZWb6ZKogdaws366XQy0aa70z7M191LpsPP3x3mKZDg4H2hNNv2k4mQZBQBv0l8A==
dependencies:
"@budibase/types" "1.3.4-alpha.3"
"@budibase/types" "^1.3.11"
"@shopify/jest-koa-mocks" "5.0.1"
"@techpass/passport-openidconnect" "0.3.2"
aws-sdk "2.1030.0"
bcrypt "5.0.1"
@ -325,21 +326,21 @@
uuid "8.3.2"
zlib "1.0.5"
"@budibase/pro@1.3.4-alpha.3":
version "1.3.4-alpha.3"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.4-alpha.3.tgz#64d46b83ee658635ae32441e3ed97b2902de5286"
integrity sha512-SYmaTMIXDJSRZLXKQrtLEmIeigrL6biiVizDXqo4FbJgNIQg0UVdVP7mTO3sEg1VCbqEB89DEZ1tTaPgmKmgSA==
"@budibase/pro@1.3.11":
version "1.3.11"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.11.tgz#f21a31b13557effd6694c19c56aa6abca1853f93"
integrity sha512-L1UpN81SX3XKoMr9YqHQpOTKnxe3j0hixlOlJlFTU5bVWPVv0CGFAWnc7cDXlpVT8frgpyajNwrf6irNB4P7zw==
dependencies:
"@budibase/backend-core" "1.3.4-alpha.3"
"@budibase/types" "1.3.4-alpha.3"
"@budibase/backend-core" "1.3.11"
"@budibase/types" "1.3.11"
"@koa/router" "8.0.8"
joi "17.6.0"
node-fetch "^2.6.1"
"@budibase/types@1.3.4-alpha.3":
version "1.3.4-alpha.3"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.4-alpha.3.tgz#198d00ea7cdc4393044c07ee301f176f0b391378"
integrity sha512-ThpEPNC2vQunqJ6G2avwCqh3zr6Lo28G5CEJUBNrUpnAyJ/Pvw0DPU6shN9loVxR3fmGtWKoU0sA/mapH8QWCg==
"@budibase/types@1.3.11", "@budibase/types@^1.3.11":
version "1.3.11"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.11.tgz#41f2a5c7274e305751636df4aa645d5b418cbe7f"
integrity sha512-hXDqWxH0nVRlgU7CiaqAbD7txdctBed6ZSLmNUD0a2LGY/yueR6MbAO04TD5kXDGvLsEnjxcSWI2N+/GvzqluA==
"@cspotcode/source-map-consumer@0.8.0":
version "0.8.0"
@ -741,6 +742,14 @@
"@sentry/types" "6.17.7"
tslib "^1.9.3"
"@shopify/jest-koa-mocks@5.0.1":
version "5.0.1"
resolved "https://registry.yarnpkg.com/@shopify/jest-koa-mocks/-/jest-koa-mocks-5.0.1.tgz#fba490b6b7985fbb571eb9974897d396a3642e94"
integrity sha512-4YskS9q8+TEHNoyopmuoy2XyhInyqeOl7CF5ShJs19sm6m0EA/jGGvgf/osv2PeTfuf42/L2G9CzWUSg49yTSg==
dependencies:
koa "^2.13.4"
node-mocks-http "^1.11.0"
"@sideway/address@^4.1.3":
version "4.1.4"
resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.4.tgz#03dccebc6ea47fdc226f7d3d1ad512955d4783f0"
@ -1208,7 +1217,7 @@ abstract-leveldown@~6.2.1, abstract-leveldown@~6.2.3:
level-supports "~1.0.0"
xtend "~4.0.0"
accepts@^1.3.5:
accepts@^1.3.5, accepts@^1.3.7:
version "1.3.8"
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e"
integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==
@ -2054,7 +2063,7 @@ container-info@^1.0.1:
resolved "https://registry.yarnpkg.com/container-info/-/container-info-1.1.0.tgz#6fcb94e93eacd397c6316ca2834491ede44e55ee"
integrity sha512-eD2zLAmxGS2kmL4f1jY8BdOqnmpL6X70kvzTBW/9FIQnxoxiBJ4htMsTmtPLPWRs7NHYFvqKQ1VtppV08mdsQA==
content-disposition@~0.5.2:
content-disposition@^0.5.3, content-disposition@~0.5.2:
version "0.5.4"
resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe"
integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==
@ -2308,7 +2317,7 @@ depd@2.0.0, depd@^2.0.0, depd@~2.0.0:
resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df"
integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==
depd@^1.1.2, depd@~1.1.2:
depd@^1.1.0, depd@^1.1.2, depd@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==
@ -3045,7 +3054,7 @@ forwarded-parse@^2.1.0:
resolved "https://registry.yarnpkg.com/forwarded-parse/-/forwarded-parse-2.1.2.tgz#08511eddaaa2ddfd56ba11138eee7df117a09325"
integrity sha512-alTFZZQDKMporBH77856pXgzhEzaUVmLCDk+egLgIgHst3Tpndzz8MnKe+GzRJRfvVdn69HhpW7cmXzvtLvJAw==
fresh@~0.5.2:
fresh@^0.5.2, fresh@~0.5.2:
version "0.5.2"
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==
@ -4653,7 +4662,7 @@ koa-static@5.0.0:
debug "^3.1.0"
koa-send "^5.0.0"
koa@2.13.4:
koa@2.13.4, koa@^2.13.4:
version "2.13.4"
resolved "https://registry.yarnpkg.com/koa/-/koa-2.13.4.tgz#ee5b0cb39e0b8069c38d115139c774833d32462e"
integrity sha512-43zkIKubNbnrULWlHdN5h1g3SEKXOEzoAlRsHOTFpnlDu8JlAOZSMJBLULusuXRequboiwJcj5vtYXKB3k7+2g==
@ -5000,6 +5009,11 @@ memdown@1.4.1:
ltgt "~2.2.0"
safe-buffer "~5.1.1"
merge-descriptors@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61"
integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==
merge-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
@ -5040,7 +5054,7 @@ mime@2.6.0:
resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367"
integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==
mime@^1.4.1:
mime@^1.3.4, mime@^1.4.1:
version "1.6.0"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==
@ -5201,6 +5215,22 @@ node-int64@^0.4.0:
resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"
integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==
node-mocks-http@^1.11.0:
version "1.11.0"
resolved "https://registry.yarnpkg.com/node-mocks-http/-/node-mocks-http-1.11.0.tgz#defc0febf6b935f08245397d47534a8de592996e"
integrity sha512-jS/WzSOcKbOeGrcgKbenZeNhxUNnP36Yw11+hL4TTxQXErGfqYZ+MaYNNvhaTiGIJlzNSqgQkk9j8dSu1YWSuw==
dependencies:
accepts "^1.3.7"
content-disposition "^0.5.3"
depd "^1.1.0"
fresh "^0.5.2"
merge-descriptors "^1.0.1"
methods "^1.1.2"
mime "^1.3.4"
parseurl "^1.3.3"
range-parser "^1.2.0"
type-is "^1.6.18"
node-releases@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.5.tgz#280ed5bc3eba0d96ce44897d8aee478bfb3d9666"
@ -5468,7 +5498,7 @@ parse5@6.0.1:
resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b"
integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==
parseurl@^1.3.2:
parseurl@^1.3.2, parseurl@^1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4"
integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==
@ -6061,6 +6091,11 @@ quick-lru@^5.1.1:
resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932"
integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==
range-parser@^1.2.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031"
integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==
raw-body@^2.2.0:
version "2.5.1"
resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857"
@ -7168,7 +7203,7 @@ type-fest@^0.8.1:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==
type-is@^1.6.14, type-is@^1.6.16:
type-is@^1.6.14, type-is@^1.6.16, type-is@^1.6.18:
version "1.6.18"
resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131"
integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==