Merge branch 'master' into merge-master

This commit is contained in:
Rory Powell 2022-10-12 10:19:46 +01:00
commit 2f0f36e635
22 changed files with 118 additions and 108 deletions

View File

@ -1,5 +1,5 @@
{
"version": "2.0.24-alpha.4",
"version": "2.0.29",
"npmClient": "yarn",
"packages": [
"packages/*"

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/backend-core",
"version": "2.0.24-alpha.4",
"version": "2.0.29",
"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": "2.0.24-alpha.4",
"@budibase/types": "^2.0.29",
"@shopify/jest-koa-mocks": "5.0.1",
"@techpass/passport-openidconnect": "0.3.2",
"aws-sdk": "2.1030.0",

View File

@ -216,6 +216,9 @@ export = class RedisWrapper {
async bulkGet(keys: string[]) {
const db = this._db
if (keys.length === 0) {
return {}
}
const prefixedKeys = keys.map(key => addDbPrefix(db, key))
let response = await this.getClient().mget(prefixedKeys)
if (Array.isArray(response)) {

View File

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

View File

@ -17,12 +17,21 @@
$: selectedRoleId = selectedRole._id
$: otherRoles = editableRoles.filter(role => role._id !== selectedRoleId)
$: isCreating = selectedRoleId == null || selectedRoleId === ""
$: hasUniqueRoleName = !otherRoles
?.map(role => role.name)
?.includes(selectedRole.name)
$: valid =
selectedRole.name &&
selectedRole.inherits &&
selectedRole.permissionId &&
!builtInRoles.includes(selectedRole.name)
$: shouldDisableRoleInput =
builtInRoles.includes(selectedRole.name) &&
selectedRole.name?.toLowerCase() === selectedRoleId?.toLowerCase()
const fetchBasePermissions = async () => {
try {
basePermissions = await API.getBasePermissions()
@ -99,7 +108,7 @@
title="Edit Roles"
confirmText={isCreating ? "Create" : "Save"}
onConfirm={saveRole}
disabled={!valid}
disabled={!valid || !hasUniqueRoleName}
>
{#if errors.length}
<ErrorsBox {errors} />
@ -119,15 +128,16 @@
<Input
label="Name"
bind:value={selectedRole.name}
disabled={builtInRoles.includes(selectedRole.name)}
disabled={shouldDisableRoleInput}
error={!hasUniqueRoleName ? "Select a unique role name." : null}
/>
<Select
label="Inherits Role"
bind:value={selectedRole.inherits}
options={otherRoles}
options={selectedRole._id === "BASIC" ? $roles : otherRoles}
getOptionValue={role => role._id}
getOptionLabel={role => role.name}
disabled={builtInRoles.includes(selectedRole.name)}
disabled={shouldDisableRoleInput}
/>
<Select
label="Base Permissions"
@ -135,11 +145,11 @@
options={basePermissions}
getOptionValue={x => x._id}
getOptionLabel={x => x.name}
disabled={builtInRoles.includes(selectedRole.name)}
disabled={shouldDisableRoleInput}
/>
{/if}
<div slot="footer">
{#if !isCreating}
{#if !isCreating && !builtInRoles.includes(selectedRole.name)}
<Button warning on:click={deleteRole}>Delete</Button>
{/if}
</div>

View File

@ -209,27 +209,29 @@
{:else}
<Body size="S"><i>No tables found.</i></Body>
{/if}
<Divider />
<div class="query-header">
<Heading size="S">Relationships</Heading>
<Button primary on:click={() => openRelationshipModal()}>
Define relationship
</Button>
</div>
<Body>
Tell budibase how your tables are related to get even more smart features.
</Body>
{#if relationshipInfo && relationshipInfo.length > 0}
<Table
on:click={({ detail }) => openRelationshipModal(detail.from, detail.to)}
schema={relationshipSchema}
data={relationshipInfo}
allowEditColumns={false}
allowEditRows={false}
allowSelectRows={false}
/>
{:else}
<Body size="S"><i>No relationships configured.</i></Body>
{#if integration.relationships !== false}
<Divider />
<div class="query-header">
<Heading size="S">Relationships</Heading>
<Button primary on:click={() => openRelationshipModal()}>
Define relationship
</Button>
</div>
<Body>
Tell budibase how your tables are related to get even more smart features.
</Body>
{#if relationshipInfo && relationshipInfo.length > 0}
<Table
on:click={({ detail }) => openRelationshipModal(detail.from, detail.to)}
schema={relationshipSchema}
data={relationshipInfo}
allowEditColumns={false}
allowEditRows={false}
allowSelectRows={false}
/>
{:else}
<Body size="S"><i>No relationships configured.</i></Body>
{/if}
{/if}
<style>

View File

@ -156,8 +156,8 @@
page={$usersFetch.pageNumber + 1}
hasPrevPage={$usersFetch.hasPrevPage}
hasNextPage={$usersFetch.hasNextPage}
goToPrevPage={$usersFetch.loading ? null : fetch.prevPage}
goToNextPage={$usersFetch.loading ? null : fetch.nextPage}
goToPrevPage={$usersFetch.loading ? null : usersFetch.prevPage}
goToNextPage={$usersFetch.loading ? null : usersFetch.nextPage}
/>
</div>
</div>

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/client",
"version": "2.0.24-alpha.4",
"version": "2.0.29",
"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": "2.0.24-alpha.4",
"@budibase/frontend-core": "2.0.24-alpha.4",
"@budibase/string-templates": "2.0.24-alpha.4",
"@budibase/bbui": "^2.0.29",
"@budibase/frontend-core": "^2.0.29",
"@budibase/string-templates": "^2.0.29",
"@spectrum-css/button": "^3.0.3",
"@spectrum-css/card": "^3.0.3",
"@spectrum-css/divider": "^1.0.3",

View File

@ -47,6 +47,9 @@ const createBuilderStore = () => {
duplicateComponent: id => {
dispatchEvent("duplicate-component", { id })
},
deleteComponent: id => {
dispatchEvent("delete-component", { id })
},
notifyLoaded: () => {
dispatchEvent("preview-loaded")
},

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/sdk",
"version": "2.0.24-alpha.4",
"version": "2.0.29",
"description": "Budibase Public API SDK",
"author": "Budibase",
"license": "MPL-2.0",

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
"version": "2.0.24-alpha.4",
"version": "2.0.29",
"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": "2.0.24-alpha.4",
"@budibase/client": "2.0.24-alpha.4",
"@budibase/pro": "2.0.24-alpha.4",
"@budibase/string-templates": "2.0.24-alpha.4",
"@budibase/types": "2.0.24-alpha.4",
"@budibase/backend-core": "^2.0.29",
"@budibase/client": "^2.0.29",
"@budibase/pro": "2.0.29",
"@budibase/string-templates": "^2.0.29",
"@budibase/types": "^2.0.29",
"@bull-board/api": "3.7.0",
"@bull-board/koa": "3.9.4",
"@elastic/elasticsearch": "7.10.0",

View File

@ -1,17 +1,9 @@
const { getDefinitions } = require("../../integrations")
const { SourceName } = require("@budibase/types")
const googlesheets = require("../../integrations/googlesheets")
const { featureFlags } = require("@budibase/backend-core")
exports.fetch = async function (ctx) {
ctx.status = 200
const defs = await getDefinitions()
// for google sheets integration google verification
if (featureFlags.isEnabled(featureFlags.TenantFeatureFlag.GOOGLE_SHEETS)) {
defs[SourceName.GOOGLE_SHEETS] = googlesheets.schema
}
ctx.body = defs
}

View File

@ -33,6 +33,7 @@ const DEFINITIONS: { [key: string]: Integration } = {
[SourceName.ARANGODB]: arangodb.schema,
[SourceName.REST]: rest.schema,
[SourceName.FIRESTORE]: firebase.schema,
[SourceName.GOOGLE_SHEETS]: googlesheets.schema,
[SourceName.REDIS]: redis.schema,
[SourceName.SNOWFLAKE]: snowflake.schema,
}
@ -66,10 +67,6 @@ if (
INTEGRATIONS[SourceName.ORACLE] = oracle.integration
}
if (environment.SELF_HOSTED) {
DEFINITIONS[SourceName.GOOGLE_SHEETS] = googlesheets.schema
}
module.exports = {
getDefinitions: async () => {
const pluginSchemas: { [key: string]: Integration } = {}

View File

@ -7,14 +7,17 @@ const { BUILTIN_ROLE_IDS } = require("@budibase/backend-core/roles")
exports.getFullUser = async (ctx, userId) => {
const global = await getGlobalUser(userId)
let metadata = {}
// always prefer the user metadata _id and _rev
delete global._id
delete global._rev
try {
// this will throw an error if the db doesn't exist, or there is no appId
const db = getAppDB()
metadata = await db.get(userId)
} catch (err) {
// it is fine if there is no user metadata, just remove global db info
delete global._id
delete global._rev
// it is fine if there is no user metadata yet
}
delete metadata.csrfToken
return {

View File

@ -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@2.0.24-alpha.4":
version "2.0.24-alpha.4"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.24-alpha.4.tgz#e6ecb50ebf00e4ac263675bafacbd3feb47fabfc"
integrity sha512-d5tRjxllR3PAqk15wGRBag1HXFq5/ZeU6uN0Ohas/z4vGBNevyeTWdqW+bLVo1IBfyj5eLE+xghsjUDlpZsz2w==
"@budibase/backend-core@2.0.29":
version "2.0.29"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.29.tgz#d5856d49d8cc64790961631dfe0fface7f7be4e4"
integrity sha512-05mnl6YcucWrO1X6bVBYG6r7Yig/fIHbokLRfEvFFrZNe/EcRB3iLeOG1+2190dv5TbO/jhabS3kcrbDs54HHw==
dependencies:
"@budibase/types" "2.0.24-alpha.4"
"@budibase/types" "^2.0.29"
"@shopify/jest-koa-mocks" "5.0.1"
"@techpass/passport-openidconnect" "0.3.2"
aws-sdk "2.1030.0"
@ -1180,13 +1180,13 @@
svelte-flatpickr "^3.2.3"
svelte-portal "^1.0.0"
"@budibase/pro@2.0.24-alpha.4":
version "2.0.24-alpha.4"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.24-alpha.4.tgz#1bfe333961014cb305580ceb6195b93d7eeec1dc"
integrity sha512-lq2WNl3EpMRV35SJb0jQ1ojeqt02gMVk8GCQ7Qoj276Dstp6XK8nZGQtJQ6vvf4JWgxuC2DX3cctdpWNgoas8w==
"@budibase/pro@2.0.29":
version "2.0.29"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.29.tgz#169055bc39894f90341226fbff4a1601418d0b42"
integrity sha512-ELBoQ7/MXlgatCJNvTNXgF7DK02pfYx5Yy1s/2BJr4iGe26+5Q65ztiC7Jp+d/owese+f5kqKJRNuU1KINUfjQ==
dependencies:
"@budibase/backend-core" "2.0.24-alpha.4"
"@budibase/types" "2.0.24-alpha.4"
"@budibase/backend-core" "2.0.29"
"@budibase/types" "2.0.29"
"@koa/router" "8.0.8"
joi "17.6.0"
node-fetch "^2.6.1"
@ -1209,10 +1209,10 @@
svelte-apexcharts "^1.0.2"
svelte-flatpickr "^3.1.0"
"@budibase/types@2.0.24-alpha.4":
version "2.0.24-alpha.4"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.24-alpha.4.tgz#1819aeb538bd4fae5e701b1823f86f7071304a24"
integrity sha512-oXxfo1Nkw41LyK6Kb0O0bHt+jZx+kmJX39VZGNej2xts5I0hx/DDZYV8ZSlXNoTQWLBm3ye3XKj/JBge7h8QzA==
"@budibase/types@2.0.29", "@budibase/types@^2.0.29":
version "2.0.29"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.29.tgz#8b27f695aded7ad7523c4943deb556eadfb66c3c"
integrity sha512-wwpHgDwKff2UhNmKAdrzIxmDQ/crY77AZdFyWNpPvrHYIetyh2Kp5ikEKyZlYHTEpS2IPDE8EKn4coDeu+mGlQ==
"@bull-board/api@3.7.0":
version "3.7.0"

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/types",
"version": "2.0.24-alpha.4",
"version": "2.0.29",
"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": "2.0.24-alpha.4",
"version": "2.0.29",
"description": "Budibase background service",
"main": "src/index.ts",
"repository": {
@ -36,10 +36,10 @@
"author": "Budibase",
"license": "GPL-3.0",
"dependencies": {
"@budibase/backend-core": "2.0.24-alpha.4",
"@budibase/pro": "2.0.24-alpha.4",
"@budibase/string-templates": "2.0.24-alpha.4",
"@budibase/types": "2.0.24-alpha.4",
"@budibase/backend-core": "^2.0.29",
"@budibase/pro": "2.0.29",
"@budibase/string-templates": "^2.0.29",
"@budibase/types": "^2.0.29",
"@koa/router": "8.0.8",
"@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "0.3.2",

View File

@ -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@2.0.24-alpha.4":
version "2.0.24-alpha.4"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.24-alpha.4.tgz#e6ecb50ebf00e4ac263675bafacbd3feb47fabfc"
integrity sha512-d5tRjxllR3PAqk15wGRBag1HXFq5/ZeU6uN0Ohas/z4vGBNevyeTWdqW+bLVo1IBfyj5eLE+xghsjUDlpZsz2w==
"@budibase/backend-core@2.0.29":
version "2.0.29"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.29.tgz#d5856d49d8cc64790961631dfe0fface7f7be4e4"
integrity sha512-05mnl6YcucWrO1X6bVBYG6r7Yig/fIHbokLRfEvFFrZNe/EcRB3iLeOG1+2190dv5TbO/jhabS3kcrbDs54HHw==
dependencies:
"@budibase/types" "2.0.24-alpha.4"
"@budibase/types" "^2.0.29"
"@shopify/jest-koa-mocks" "5.0.1"
"@techpass/passport-openidconnect" "0.3.2"
aws-sdk "2.1030.0"
@ -327,21 +327,21 @@
uuid "8.3.2"
zlib "1.0.5"
"@budibase/pro@2.0.24-alpha.4":
version "2.0.24-alpha.4"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.24-alpha.4.tgz#1bfe333961014cb305580ceb6195b93d7eeec1dc"
integrity sha512-lq2WNl3EpMRV35SJb0jQ1ojeqt02gMVk8GCQ7Qoj276Dstp6XK8nZGQtJQ6vvf4JWgxuC2DX3cctdpWNgoas8w==
"@budibase/pro@2.0.29":
version "2.0.29"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.29.tgz#169055bc39894f90341226fbff4a1601418d0b42"
integrity sha512-ELBoQ7/MXlgatCJNvTNXgF7DK02pfYx5Yy1s/2BJr4iGe26+5Q65ztiC7Jp+d/owese+f5kqKJRNuU1KINUfjQ==
dependencies:
"@budibase/backend-core" "2.0.24-alpha.4"
"@budibase/types" "2.0.24-alpha.4"
"@budibase/backend-core" "2.0.29"
"@budibase/types" "2.0.29"
"@koa/router" "8.0.8"
joi "17.6.0"
node-fetch "^2.6.1"
"@budibase/types@2.0.24-alpha.4":
version "2.0.24-alpha.4"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.24-alpha.4.tgz#1819aeb538bd4fae5e701b1823f86f7071304a24"
integrity sha512-oXxfo1Nkw41LyK6Kb0O0bHt+jZx+kmJX39VZGNej2xts5I0hx/DDZYV8ZSlXNoTQWLBm3ye3XKj/JBge7h8QzA==
"@budibase/types@2.0.29", "@budibase/types@^2.0.29":
version "2.0.29"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.29.tgz#8b27f695aded7ad7523c4943deb556eadfb66c3c"
integrity sha512-wwpHgDwKff2UhNmKAdrzIxmDQ/crY77AZdFyWNpPvrHYIetyh2Kp5ikEKyZlYHTEpS2IPDE8EKn4coDeu+mGlQ==
"@cspotcode/source-map-consumer@0.8.0":
version "0.8.0"