Merge branch 'master' of github.com:Budibase/budibase into dep/node-gyp

This commit is contained in:
mike12345567 2022-05-27 12:45:11 +01:00
commit 5d5244b9f6
15 changed files with 108 additions and 109 deletions

View File

@ -1,5 +1,5 @@
{
"version": "1.0.185",
"version": "1.0.187",
"npmClient": "yarn",
"packages": [
"packages/*"

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/backend-core",
"version": "1.0.185",
"version": "1.0.187",
"description": "Budibase backend core libraries used in server and worker",
"main": "src/index.js",
"author": "Budibase",

View File

@ -999,11 +999,6 @@ bcrypt@^5.0.1:
"@mapbox/node-pre-gyp" "^1.0.0"
node-addon-api "^3.1.0"
bcryptjs@^2.4.3:
version "2.4.3"
resolved "https://registry.yarnpkg.com/bcryptjs/-/bcryptjs-2.4.3.tgz#9ab5627b93e60621ff7cdac5da9733027df1d0cb"
integrity sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==
bl@^4.0.3:
version "4.1.0"
resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a"

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.",
"version": "1.0.185",
"version": "1.0.187",
"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.0.185",
"@budibase/string-templates": "^1.0.187",
"@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.0.185",
"version": "1.0.187",
"license": "GPL-3.0",
"private": true,
"scripts": {
@ -67,10 +67,10 @@
}
},
"dependencies": {
"@budibase/bbui": "^1.0.185",
"@budibase/client": "^1.0.185",
"@budibase/frontend-core": "^1.0.185",
"@budibase/string-templates": "^1.0.185",
"@budibase/bbui": "^1.0.187",
"@budibase/client": "^1.0.187",
"@budibase/frontend-core": "^1.0.187",
"@budibase/string-templates": "^1.0.187",
"@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/cli",
"version": "1.0.185",
"version": "1.0.187",
"description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js",
"bin": {

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/client",
"version": "1.0.185",
"version": "1.0.187",
"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.0.185",
"@budibase/frontend-core": "^1.0.185",
"@budibase/string-templates": "^1.0.185",
"@budibase/bbui": "^1.0.187",
"@budibase/frontend-core": "^1.0.187",
"@budibase/string-templates": "^1.0.187",
"@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.0.185",
"version": "1.0.187",
"description": "Budibase frontend core libraries used in builder and client",
"author": "Budibase",
"license": "MPL-2.0",
"svelte": "src/index.js",
"dependencies": {
"@budibase/bbui": "^1.0.185",
"@budibase/bbui": "^1.0.187",
"lodash": "^4.17.21",
"svelte": "^3.46.2"
}

View File

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

View File

@ -1014,10 +1014,10 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@1.0.185":
version "1.0.185"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.185.tgz#a8b71e4234ac21f3b5c8cbcae0c63b481039d4b3"
integrity sha512-Q6MelbxX7UP21lAe7HFb9uUczPaydN6gqq1s8R985A1Yatx2K8gV7vxQo3BD9eGhSb464V9WBasWJT9If96kqA==
"@budibase/backend-core@1.0.187":
version "1.0.187"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.187.tgz#bf2d6de627185e5388d567762491334bc1d2d546"
integrity sha512-C9FqOf+/SNNWk7bZU7PfnzDvXM5ntnZFgpX1bI/bfHH3xYGw6jOFB2BpoTaV2sQGq14wfmo9e9vNHqYIT9tPrg==
dependencies:
"@techpass/passport-openidconnect" "^0.3.0"
aws-sdk "^2.901.0"
@ -1091,12 +1091,12 @@
svelte-flatpickr "^3.2.3"
svelte-portal "^1.0.0"
"@budibase/pro@1.0.185":
version "1.0.185"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.185.tgz#535ab62117d27fbae8480a702b99dd1b3876ebbc"
integrity sha512-G6+BjdJ2tcars6f0o1BVXEIeL4gmcU0lXhrFoMLUG4z73RzsvMy+W1kRMi+g7D/Se9CtZ6kV5pKNjlRj6A/qvg==
"@budibase/pro@1.0.187":
version "1.0.187"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.187.tgz#40ed5e9809f924e5d0c7bbb7d09a602ea47dfe92"
integrity sha512-whEcWAcgkIL4EHgh08jp8itR37LZYlZxFLl0GYY5AOIguEScJ1FRe9WcYFNW0Pw768uaq7IE7hKkrAzWetzu4g==
dependencies:
"@budibase/backend-core" "1.0.185"
"@budibase/backend-core" "1.0.187"
node-fetch "^2.6.1"
"@budibase/standard-components@^0.9.139":

View File

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

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
if [[ -z $CLUSTER_MODE ]]; then
yarn run:docker

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/worker",
"email": "hi@budibase.com",
"version": "1.0.185",
"version": "1.0.187",
"description": "Budibase background service",
"main": "src/index.ts",
"repository": {
@ -32,9 +32,9 @@
"author": "Budibase",
"license": "GPL-3.0",
"dependencies": {
"@budibase/backend-core": "^1.0.185",
"@budibase/pro": "1.0.185",
"@budibase/string-templates": "^1.0.185",
"@budibase/backend-core": "^1.0.187",
"@budibase/pro": "1.0.187",
"@budibase/string-templates": "^1.0.187",
"@koa/router": "^8.0.0",
"@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "^0.3.0",

View File

@ -12,6 +12,7 @@ const {
getTenantId,
getTenantUser,
doesTenantExist,
doInTenant,
} = require("@budibase/backend-core/tenancy")
const { removeUserFromInfoDB } = require("@budibase/backend-core/deprovision")
const { errors } = require("@budibase/backend-core")
@ -41,70 +42,73 @@ const parseBooleanParam = (param: any) => {
export const adminUser = async (ctx: any) => {
const { email, password, tenantId } = ctx.request.body
await doInTenant(tenantId, async () => {
// account portal sends a pre-hashed password - honour param to prevent double hashing
const hashPassword = parseBooleanParam(ctx.request.query.hashPassword)
// account portal sends no password for SSO users
const requirePassword = parseBooleanParam(ctx.request.query.requirePassword)
// account portal sends a pre-hashed password - honour param to prevent double hashing
const hashPassword = parseBooleanParam(ctx.request.query.hashPassword)
// account portal sends no password for SSO users
const requirePassword = parseBooleanParam(ctx.request.query.requirePassword)
if (await doesTenantExist(tenantId)) {
ctx.throw(403, "Organisation already exists.")
}
const response = await doWithGlobalDB(tenantId, async (db: any) => {
const response = await db.allDocs(
getGlobalUserParams(null, {
include_docs: true,
})
)
// write usage quotas for cloud
if (!env.SELF_HOSTED) {
// could be a scenario where it exists, make sure its clean
try {
const usageQuota = await db.get(StaticDatabases.GLOBAL.docs.usageQuota)
if (usageQuota) {
await db.remove(usageQuota._id, usageQuota._rev)
}
} catch (err) {
// don't worry about errors
}
await db.put(quotas.generateNewQuotaUsage())
if (await doesTenantExist(tenantId)) {
ctx.throw(403, "Organisation already exists.")
}
return response
})
if (response.rows.some((row: any) => row.doc.admin)) {
ctx.throw(
403,
"You cannot initialise once an global user has been created."
)
}
const response = await doWithGlobalDB(tenantId, async (db: any) => {
const response = await db.allDocs(
getGlobalUserParams(null, {
include_docs: true,
})
)
// write usage quotas for cloud
if (!env.SELF_HOSTED) {
// could be a scenario where it exists, make sure its clean
try {
const usageQuota = await db.get(
StaticDatabases.GLOBAL.docs.usageQuota
)
if (usageQuota) {
await db.remove(usageQuota._id, usageQuota._rev)
}
} catch (err) {
// don't worry about errors
}
await db.put(quotas.generateNewQuotaUsage())
}
return response
})
const user = {
email: email,
password: password,
createdAt: Date.now(),
roles: {},
builder: {
global: true,
},
admin: {
global: true,
},
tenantId,
}
try {
const finalUser = await users.save(
user,
if (response.rows.some((row: any) => row.doc.admin)) {
ctx.throw(
403,
"You cannot initialise once an global user has been created."
)
}
const user = {
email: email,
password: password,
createdAt: Date.now(),
roles: {},
builder: {
global: true,
},
admin: {
global: true,
},
tenantId,
hashPassword,
requirePassword
)
await bustCache(CacheKeys.CHECKLIST)
ctx.body = finalUser
} catch (err: any) {
ctx.throw(err.status || 400, err)
}
}
try {
const finalUser = await users.save(
user,
tenantId,
hashPassword,
requirePassword
)
await bustCache(CacheKeys.CHECKLIST)
ctx.body = finalUser
} catch (err: any) {
ctx.throw(err.status || 400, err)
}
})
}
export const destroy = async (ctx: any) => {

View File

@ -293,10 +293,10 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@1.0.185":
version "1.0.185"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.185.tgz#a8b71e4234ac21f3b5c8cbcae0c63b481039d4b3"
integrity sha512-Q6MelbxX7UP21lAe7HFb9uUczPaydN6gqq1s8R985A1Yatx2K8gV7vxQo3BD9eGhSb464V9WBasWJT9If96kqA==
"@budibase/backend-core@1.0.187":
version "1.0.187"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.187.tgz#bf2d6de627185e5388d567762491334bc1d2d546"
integrity sha512-C9FqOf+/SNNWk7bZU7PfnzDvXM5ntnZFgpX1bI/bfHH3xYGw6jOFB2BpoTaV2sQGq14wfmo9e9vNHqYIT9tPrg==
dependencies:
"@techpass/passport-openidconnect" "^0.3.0"
aws-sdk "^2.901.0"
@ -321,12 +321,12 @@
uuid "^8.3.2"
zlib "^1.0.5"
"@budibase/pro@1.0.185":
version "1.0.185"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.185.tgz#535ab62117d27fbae8480a702b99dd1b3876ebbc"
integrity sha512-G6+BjdJ2tcars6f0o1BVXEIeL4gmcU0lXhrFoMLUG4z73RzsvMy+W1kRMi+g7D/Se9CtZ6kV5pKNjlRj6A/qvg==
"@budibase/pro@1.0.187":
version "1.0.187"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.187.tgz#40ed5e9809f924e5d0c7bbb7d09a602ea47dfe92"
integrity sha512-whEcWAcgkIL4EHgh08jp8itR37LZYlZxFLl0GYY5AOIguEScJ1FRe9WcYFNW0Pw768uaq7IE7hKkrAzWetzu4g==
dependencies:
"@budibase/backend-core" "1.0.185"
"@budibase/backend-core" "1.0.187"
node-fetch "^2.6.1"
"@cspotcode/source-map-consumer@0.8.0":