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

This commit is contained in:
mike12345567 2022-07-18 14:16:39 +01:00
commit 6f78b5eea8
33 changed files with 182 additions and 82 deletions

View File

@ -57,3 +57,12 @@ jobs:
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
tags: budibase/budibase,budibase/budibase:v${{ env.RELEASE_VERSION }} tags: budibase/budibase,budibase/budibase:v${{ env.RELEASE_VERSION }}
file: ./hosting/single/Dockerfile file: ./hosting/single/Dockerfile
- name: Tag and release Budibase Azure App Service docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
platforms: linux/amd64
build-args: TARGETBUILD=aas
tags: budibase/budibase-aas,budibase/budibase-aas:v${{ env.RELEASE_VERSION }}
file: ./hosting/single/Dockerfile

View File

@ -3,15 +3,15 @@
echo ${TARGETBUILD} > /buildtarget.txt echo ${TARGETBUILD} > /buildtarget.txt
if [[ "${TARGETBUILD}" = "aas" ]]; then if [[ "${TARGETBUILD}" = "aas" ]]; then
# Azure AppService uses /home for persisent data & SSH on port 2222 # Azure AppService uses /home for persisent data & SSH on port 2222
mkdir -p /home/budibase/{minio,couchdb} mkdir -p /home/{search,minio,couch}
mkdir -p /home/budibase/couchdb/data mkdir -p /home/couch/{dbs,views}
chown -R couchdb:couchdb /home/budibase/couchdb/ chown -R couchdb:couchdb /home/couch/
apt update apt update
apt-get install -y openssh-server apt-get install -y openssh-server
sed -i 's#dir=/opt/couchdb/data/search#dir=/home/budibase/couchdb/data/search#' /opt/clouseau/clouseau.ini sed -i 's#dir=/opt/couchdb/data/search#dir=/home/search#' /opt/clouseau/clouseau.ini
sed -i 's#/minio/minio server /minio &#/minio/minio server /home/budibase/minio &#' /runner.sh sed -i 's#/minio/minio server /minio &#/minio/minio server /home/minio &#' /runner.sh
sed -i 's#database_dir = ./data#database_dir = /home/budibase/couchdb/data#' /opt/couchdb/etc/default.ini sed -i 's#database_dir = ./data#database_dir = /home/couch/dbs#' /opt/couchdb/etc/default.ini
sed -i 's#view_index_dir = ./data#view_index_dir = /home/budibase/couchdb/data#' /opt/couchdb/etc/default.ini sed -i 's#view_index_dir = ./data#view_index_dir = /home/couch/views#' /opt/couchdb/etc/default.ini
sed -i "s/#Port 22/Port 2222/" /etc/ssh/sshd_config sed -i "s/#Port 22/Port 2222/" /etc/ssh/sshd_config
/etc/init.d/ssh restart /etc/init.d/ssh restart
fi fi

View File

@ -122,8 +122,7 @@ RUN yarn cache clean -f
EXPOSE 80 EXPOSE 80
EXPOSE 443 EXPOSE 443
VOLUME /opt/couchdb/data VOLUME /data
VOLUME /minio
# setup letsencrypt certificate # setup letsencrypt certificate
RUN apt-get install -y certbot python3-certbot-nginx RUN apt-get install -y certbot python3-certbot-nginx

View File

@ -24,8 +24,8 @@ if [ ! -f "/data/.env" ]; then
fi fi
# make these directories in runner, incase of mount # make these directories in runner, incase of mount
mkdir -p /data/couch/dbs /data/couch/views mkdir -p /data/couch/{dbs,views} /home/couch/{dbs,views}
chown couchdb:couchdb /data/couch /data/couch/dbs /data/couch/views chown -R couchdb:couchdb /data/couch /home/couch
redis-server --requirepass $REDIS_PASSWORD & redis-server --requirepass $REDIS_PASSWORD &
/opt/clouseau/bin/clouseau & /opt/clouseau/bin/clouseau &
/minio/minio server /data/minio & /minio/minio server /data/minio &

View File

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

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/backend-core", "name": "@budibase/backend-core",
"version": "1.1.10-alpha.4", "version": "1.1.14",
"description": "Budibase backend core libraries used in server and worker", "description": "Budibase backend core libraries used in server and worker",
"main": "dist/src/index.js", "main": "dist/src/index.js",
"types": "dist/src/index.d.ts", "types": "dist/src/index.d.ts",
@ -20,7 +20,7 @@
"test:watch": "jest --watchAll" "test:watch": "jest --watchAll"
}, },
"dependencies": { "dependencies": {
"@budibase/types": "^1.1.10-alpha.4", "@budibase/types": "^1.1.14",
"@techpass/passport-openidconnect": "0.3.2", "@techpass/passport-openidconnect": "0.3.2",
"aws-sdk": "2.1030.0", "aws-sdk": "2.1030.0",
"bcrypt": "5.0.1", "bcrypt": "5.0.1",

View File

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

View File

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

View File

@ -52,8 +52,8 @@ export default class IntercomClient {
* @param {Object} user - user to identify * @param {Object} user - user to identify
* @returns Intercom global object * @returns Intercom global object
*/ */
show(user = {}) { show(user = {}, enabled) {
if (!this.initialised || !user?.admin) return if (!this.initialised || !enabled) return
return window.Intercom("boot", { return window.Intercom("boot", {
app_id: this.token, app_id: this.token,

View File

@ -12,6 +12,7 @@
notifications, notifications,
Modal, Modal,
} from "@budibase/bbui" } from "@budibase/bbui"
import { ActionStepID } from "constants/backend/automations"
export let automation export let automation
let testDataModal let testDataModal
@ -82,7 +83,7 @@
in:fly|local={{ x: 500, duration: 500 }} in:fly|local={{ x: 500, duration: 500 }}
out:fly|local={{ x: 500, duration: 500 }} out:fly|local={{ x: 500, duration: 500 }}
> >
{#if block.stepId !== "LOOP"} {#if block.stepId !== ActionStepID.LOOP}
<FlowItem {testDataModal} {block} /> <FlowItem {testDataModal} {block} />
{/if} {/if}
</div> </div>

View File

@ -10,11 +10,15 @@
Select, Select,
ActionButton, ActionButton,
notifications, notifications,
Label,
} from "@budibase/bbui" } from "@budibase/bbui"
import AutomationBlockSetup from "../../SetupPanel/AutomationBlockSetup.svelte" import AutomationBlockSetup from "../../SetupPanel/AutomationBlockSetup.svelte"
import CreateWebhookModal from "components/automation/Shared/CreateWebhookModal.svelte" import CreateWebhookModal from "components/automation/Shared/CreateWebhookModal.svelte"
import ActionModal from "./ActionModal.svelte" import ActionModal from "./ActionModal.svelte"
import FlowItemHeader from "./FlowItemHeader.svelte" import FlowItemHeader from "./FlowItemHeader.svelte"
import RoleSelect from "components/design/settings/controls/RoleSelect.svelte"
import { ActionStepID, TriggerStepID } from "constants/backend/automations"
import { permissions } from "stores/backend"
export let block export let block
export let testDataModal export let testDataModal
@ -23,9 +27,12 @@
let actionModal let actionModal
let blockComplete let blockComplete
let showLooping = false let showLooping = false
let role
$: automationId = $automationStore.selectedAutomation?.automation._id
$: showBindingPicker = $: showBindingPicker =
block.stepId === "CREATE_ROW" || block.stepId === "UPDATE_ROW" block.stepId === ActionStepID.CREATE_ROW ||
block.stepId === ActionStepID.UPDATE_ROW
$: isTrigger = block.type === "TRIGGER" $: isTrigger = block.type === "TRIGGER"
@ -45,6 +52,32 @@
x => x.blockToLoop === block.id x => x.blockToLoop === block.id
) )
$: setPermissions(role)
$: getPermissions(automationId)
async function setPermissions(role) {
if (!role || !automationId) {
return
}
await permissions.save({
level: "execute",
role,
resource: automationId,
})
}
async function getPermissions(automationId) {
if (!automationId) {
return
}
const perms = await permissions.forResource(automationId)
if (!perms["execute"]) {
role = "BASIC"
} else {
role = perms["execute"]
}
}
async function removeLooping() { async function removeLooping() {
loopingSelected = false loopingSelected = false
let loopBlock = let loopBlock =
@ -205,6 +238,10 @@
</div> </div>
{/if} {/if}
{#if block.stepId === TriggerStepID.APP}
<Label>Role</Label>
<RoleSelect bind:value={role} />
{/if}
<AutomationBlockSetup <AutomationBlockSetup
schemaProperties={Object.entries(block.schema.inputs.properties)} schemaProperties={Object.entries(block.schema.inputs.properties)}
{block} {block}

View File

@ -1,6 +1,7 @@
<script> <script>
import { Icon, Divider, Tabs, Tab, TextArea, Label } from "@budibase/bbui" import { Icon, Divider, Tabs, Tab, TextArea, Label } from "@budibase/bbui"
import FlowItemHeader from "./FlowChart/FlowItemHeader.svelte" import FlowItemHeader from "./FlowChart/FlowItemHeader.svelte"
import { ActionStepID } from "constants/backend/automations"
export let automation export let automation
export let testResults export let testResults
@ -10,7 +11,7 @@
let blocks let blocks
function prepTestResults(results) { function prepTestResults(results) {
return results?.steps.filter(x => x.stepId !== "LOOP" || []) return results?.steps.filter(x => x.stepId !== ActionStepID.LOOP || [])
} }
function textArea(results, message) { function textArea(results, message) {
@ -30,7 +31,7 @@
} }
blocks = blocks blocks = blocks
.concat(automation.definition.steps || []) .concat(automation.definition.steps || [])
.filter(x => x.stepId !== "LOOP") .filter(x => x.stepId !== ActionStepID.LOOP)
} else if (filteredResults) { } else if (filteredResults) {
blocks = filteredResults || [] blocks = filteredResults || []
// make sure there is an ID for each block being displayed // make sure there is an ID for each block being displayed
@ -45,7 +46,7 @@
<div class="container"> <div class="container">
{#each blocks as block, idx} {#each blocks as block, idx}
<div class="block" style={width ? `width: ${width}` : ""}> <div class="block" style={width ? `width: ${width}` : ""}>
{#if block.stepId !== "LOOP"} {#if block.stepId !== ActionStepID.LOOP}
<FlowItemHeader <FlowItemHeader
showTestStatus={true} showTestStatus={true}
bind:showParameters bind:showParameters

View File

@ -2,6 +2,7 @@
import { Icon, Divider } from "@budibase/bbui" import { Icon, Divider } from "@budibase/bbui"
import TestDisplay from "./TestDisplay.svelte" import TestDisplay from "./TestDisplay.svelte"
import { automationStore } from "builderStore" import { automationStore } from "builderStore"
import { ActionStepID } from "constants/backend/automations"
export let automation export let automation
export let testResults export let testResults
@ -16,7 +17,7 @@
} }
blocks = blocks blocks = blocks
.concat(automation.definition.steps || []) .concat(automation.definition.steps || [])
.filter(x => x.stepId !== "LOOP") .filter(x => x.stepId !== ActionStepID.LOOP)
} else if (testResults) { } else if (testResults) {
blocks = testResults.steps || [] blocks = testResults.steps || []
} }

View File

@ -11,6 +11,7 @@
Body, Body,
Icon, Icon,
} from "@budibase/bbui" } from "@budibase/bbui"
import { TriggerStepID } from "constants/backend/automations"
let name let name
let selectedTrigger let selectedTrigger
@ -35,7 +36,7 @@
) )
automationStore.actions.addBlockToAutomation(newBlock) automationStore.actions.addBlockToAutomation(newBlock)
if (triggerVal.stepId === "WEBHOOK") { if (triggerVal.stepId === TriggerStepID.WEBHOOK) {
webhookModal.show webhookModal.show
} }

View File

@ -30,6 +30,7 @@
import { LuceneUtils } from "@budibase/frontend-core" import { LuceneUtils } from "@budibase/frontend-core"
import { getSchemaForTable } from "builderStore/dataBinding" import { getSchemaForTable } from "builderStore/dataBinding"
import { Utils } from "@budibase/frontend-core" import { Utils } from "@budibase/frontend-core"
import { TriggerStepID, ActionStepID } from "constants/backend/automations"
export let block export let block
export let testData export let testData
@ -54,12 +55,13 @@
$: schema = getSchemaForTable(tableId, { searchableSchema: true }).schema $: schema = getSchemaForTable(tableId, { searchableSchema: true }).schema
$: schemaFields = Object.values(schema || {}) $: schemaFields = Object.values(schema || {})
$: queryLimit = tableId?.includes("datasource") ? "∞" : "1000" $: queryLimit = tableId?.includes("datasource") ? "∞" : "1000"
$: isTrigger = block?.type === "TRIGGER"
const onChange = Utils.sequential(async (e, key) => { const onChange = Utils.sequential(async (e, key) => {
try { try {
if (isTestModal) { if (isTestModal) {
// Special case for webhook, as it requires a body, but the schema already brings back the body's contents // Special case for webhook, as it requires a body, but the schema already brings back the body's contents
if (stepId === "WEBHOOK") { if (stepId === TriggerStepID.WEBHOOK) {
automationStore.actions.addTestDataToAutomation({ automationStore.actions.addTestDataToAutomation({
body: { body: {
[key]: e.detail, [key]: e.detail,
@ -100,9 +102,9 @@
// Extract all outputs from all previous steps as available bindins // Extract all outputs from all previous steps as available bindins
let bindings = [] let bindings = []
for (let idx = 0; idx < blockIdx; idx++) { for (let idx = 0; idx < blockIdx; idx++) {
let wasLoopBlock = allSteps[idx]?.stepId === "LOOP" let wasLoopBlock = allSteps[idx]?.stepId === ActionStepID.LOOP
let isLoopBlock = let isLoopBlock =
allSteps[idx]?.stepId === "LOOP" && allSteps[idx]?.stepId === ActionStepID.LOOP &&
allSteps.find(x => x.blockToLoop === block.id) allSteps.find(x => x.blockToLoop === block.id)
// If the previous block was a loop block, decerement the index so the following // If the previous block was a loop block, decerement the index so the following
@ -261,6 +263,7 @@
/> />
{:else if value.customType === "table"} {:else if value.customType === "table"}
<TableSelector <TableSelector
{isTrigger}
value={inputData[key]} value={inputData[key]}
on:change={e => onChange(e, key)} on:change={e => onChange(e, key)}
/> />
@ -343,7 +346,7 @@
<CreateWebhookModal /> <CreateWebhookModal />
</Modal> </Modal>
{#if stepId === "WEBHOOK"} {#if stepId === TriggerStepID.WEBHOOK}
<Button secondary on:click={() => webhookModal.show()}>Set Up Webhook</Button> <Button secondary on:click={() => webhookModal.show()}>Set Up Webhook</Button>
{/if} {/if}

View File

@ -1,5 +1,5 @@
<script> <script>
import { Button, Select, Input } from "@budibase/bbui" import { Button, Select, Input, Label } from "@budibase/bbui"
import { createEventDispatcher } from "svelte" import { createEventDispatcher } from "svelte"
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
@ -9,6 +9,7 @@
dispatch("change", e.detail) dispatch("change", e.detail)
} }
let touched = false
let presets = false let presets = false
const CRON_EXPRESSIONS = [ const CRON_EXPRESSIONS = [
@ -36,8 +37,10 @@
</script> </script>
<div class="block-field"> <div class="block-field">
<Input on:change={onChange} {value} /> <Input on:change={onChange} {value} on:blur={() => (touched = true)} />
{#if touched && !value}
<Label><div class="error">Please specify a CRON expression</div></Label>
{/if}
<div class="presets"> <div class="presets">
<Button on:click={() => (presets = !presets)} <Button on:click={() => (presets = !presets)}
>{presets ? "Hide" : "Show"} Presets</Button >{presets ? "Hide" : "Show"} Presets</Button
@ -62,4 +65,8 @@
.block-field { .block-field {
padding-top: var(--spacing-s); padding-top: var(--spacing-s);
} }
.error {
padding-top: var(--spacing-xs);
color: var(--spectrum-global-color-red-500);
}
</style> </style>

View File

@ -2,10 +2,16 @@
import { tables } from "stores/backend" import { tables } from "stores/backend"
import { Select } from "@budibase/bbui" import { Select } from "@budibase/bbui"
import { createEventDispatcher } from "svelte" import { createEventDispatcher } from "svelte"
import { TableNames } from "constants"
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
export let value export let value
export let isTrigger
$: filteredTables = $tables.list.filter(table => {
return !isTrigger || table._id !== TableNames.USERS
})
const onChange = e => { const onChange = e => {
value = e.detail value = e.detail
@ -16,7 +22,7 @@
<Select <Select
on:change={onChange} on:change={onChange}
bind:value bind:value
options={$tables.list} options={filteredTables}
getOptionLabel={table => table.name} getOptionLabel={table => table.name}
getOptionValue={table => table._id} getOptionValue={table => table._id}
/> />

View File

@ -3,6 +3,7 @@
import { ModalContent } from "@budibase/bbui" import { ModalContent } from "@budibase/bbui"
import { onMount } from "svelte" import { onMount } from "svelte"
import WebhookDisplay from "../automation/Shared/WebhookDisplay.svelte" import WebhookDisplay from "../automation/Shared/WebhookDisplay.svelte"
import { TriggerStepID } from "constants/backend/automations"
let webhookUrls = [] let webhookUrls = []
@ -11,7 +12,7 @@
onMount(() => { onMount(() => {
webhookUrls = automations.map(automation => { webhookUrls = automations.map(automation => {
const trigger = automation.definition.trigger const trigger = automation.definition.trigger
if (trigger?.stepId === "WEBHOOK" && trigger.inputs) { if (trigger?.stepId === TriggerStepID.WEBHOOK && trigger.inputs) {
return { return {
type: "Automation", type: "Automation",
name: automation.name, name: automation.name,

View File

@ -2,6 +2,7 @@
import { Select, Label, Input, Checkbox } from "@budibase/bbui" import { Select, Label, Input, Checkbox } from "@budibase/bbui"
import { automationStore } from "builderStore" import { automationStore } from "builderStore"
import SaveFields from "./SaveFields.svelte" import SaveFields from "./SaveFields.svelte"
import { TriggerStepID } from "constants/backend/automations"
export let parameters = {} export let parameters = {}
export let bindings = [] export let bindings = []
@ -16,7 +17,7 @@
: AUTOMATION_STATUS.NEW : AUTOMATION_STATUS.NEW
$: automations = $automationStore.automations $: automations = $automationStore.automations
.filter(a => a.definition.trigger?.stepId === "APP") .filter(a => a.definition.trigger?.stepId === TriggerStepID.APP)
.map(automation => { .map(automation => {
const schema = Object.entries( const schema = Object.entries(
automation.definition.trigger.inputs.fields || {} automation.definition.trigger.inputs.fields || {}

View File

@ -0,0 +1,28 @@
export const TriggerStepID = {
ROW_SAVED: "ROW_SAVED",
ROW_UPDATED: "ROW_UPDATED",
ROW_DELETED: "ROW_DELETED",
WEBHOOK: "WEBHOOK",
APP: "APP",
CRON: "CRON",
}
export const ActionStepID = {
SEND_EMAIL_SMTP: "SEND_EMAIL_SMTP",
CREATE_ROW: "CREATE_ROW",
UPDATE_ROW: "UPDATE_ROW",
DELETE_ROW: "DELETE_ROW",
OUTGOING_WEBHOOK: "OUTGOING_WEBHOOK",
EXECUTE_SCRIPT: "EXECUTE_SCRIPT",
EXECUTE_QUERY: "EXECUTE_QUERY",
SERVER_LOG: "SERVER_LOG",
DELAY: "DELAY",
FILTER: "FILTER",
QUERY_ROWS: "QUERY_ROWS",
LOOP: "LOOP",
// these used to be lowercase step IDs, maintain for backwards compat
discord: "discord",
slack: "slack",
zapier: "zapier",
integromat: "integromat",
}

View File

@ -58,17 +58,20 @@ export function createAuthStore() {
.activate() .activate()
.then(() => { .then(() => {
analytics.identify(user._id) analytics.identify(user._id)
analytics.showChat({ analytics.showChat(
email: user.email, {
created_at: (user.createdAt || Date.now()) / 1000, email: user.email,
name: user.account?.name, created_at: (user.createdAt || Date.now()) / 1000,
user_id: user._id, name: user.account?.name,
tenant: user.tenantId, user_id: user._id,
admin: user?.admin?.global, tenant: user.tenantId,
builder: user?.builder?.global, admin: user?.admin?.global,
"Company size": user.account?.size, builder: user?.builder?.global,
"Job role": user.account?.profession, "Company size": user.account?.size,
}) "Job role": user.account?.profession,
},
!!user?.account
)
}) })
.catch(() => { .catch(() => {
// This request may fail due to browser extensions blocking requests // This request may fail due to browser extensions blocking requests

View File

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

View File

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

View File

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

View File

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

View File

@ -37,9 +37,10 @@ describe("/permission", () => {
.expect("Content-Type", /json/) .expect("Content-Type", /json/)
.expect(200) .expect(200)
expect(res.body).toBeDefined() expect(res.body).toBeDefined()
expect(res.body.length).toEqual(2) expect(res.body.length).toEqual(3)
expect(res.body).toContain("read") expect(res.body).toContain("read")
expect(res.body).toContain("write") expect(res.body).toContain("write")
expect(res.body).toContain("execute")
}) })
}) })

View File

@ -97,7 +97,7 @@ export async function enableCronTrigger(appId: any, automation: any) {
) )
} }
// need to create cron job // need to create cron job
if (isCronTrigger(automation)) { if (isCronTrigger(automation) && trigger?.inputs.cron) {
// make a job id rather than letting Bull decide, makes it easier to handle on way out // make a job id rather than letting Bull decide, makes it easier to handle on way out
const jobId = `${appId}_cron_${newid()}` const jobId = `${appId}_cron_${newid()}`
const job: any = await queue.add( const job: any = await queue.add(

View File

@ -4,15 +4,13 @@ const { getGlobalDB, doInTenant } = require("@budibase/backend-core/tenancy")
// mock email view creation // mock email view creation
const coreDb = require("@budibase/backend-core/db") const coreDb = require("@budibase/backend-core/db")
const createUserEmailView = jest.fn() const createNewUserEmailView = jest.fn()
coreDb.createUserEmailView = createUserEmailView coreDb.createNewUserEmailView = createNewUserEmailView
const migration = require("../userEmailViewCasing") const migration = require("../userEmailViewCasing")
describe("run", () => { describe("run", () => {
doInTenant(TENANT_ID, () => {
let config = new TestConfig(false) let config = new TestConfig(false)
const globalDb = getGlobalDB()
beforeEach(async () => { beforeEach(async () => {
await config.init() await config.init()
@ -21,8 +19,10 @@ describe("run", () => {
afterAll(config.end) afterAll(config.end)
it("runs successfully", async () => { it("runs successfully", async () => {
await migration.run(globalDb) await doInTenant(TENANT_ID, async () => {
expect(createUserEmailView).toHaveBeenCalledTimes(1) const globalDb = getGlobalDB()
await migration.run(globalDb)
expect(createNewUserEmailView).toHaveBeenCalledTimes(1)
})
}) })
})
}) })

View File

@ -1,4 +1,4 @@
const { createUserEmailView } = require("@budibase/backend-core/db") const { createNewUserEmailView } = require("@budibase/backend-core/db")
/** /**
* Date: * Date:
@ -9,5 +9,5 @@ const { createUserEmailView } = require("@budibase/backend-core/db")
*/ */
export const run = async (db: any) => { export const run = async (db: any) => {
await createUserEmailView(db) await createNewUserEmailView(db)
} }

View File

@ -13,6 +13,7 @@ const { DocumentTypes } = require("../db/utils")
const CURRENTLY_SUPPORTED_LEVELS = [ const CURRENTLY_SUPPORTED_LEVELS = [
PermissionLevels.WRITE, PermissionLevels.WRITE,
PermissionLevels.READ, PermissionLevels.READ,
PermissionLevels.EXECUTE,
] ]
exports.getPermissionType = resourceId => { exports.getPermissionType = resourceId => {

View File

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

View File

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

View File

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