Merge branch 'develop' into bug/sev3/automation-mysql-id-relationship-uri-decode
This commit is contained in:
commit
3f8ad9caa2
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "2.0.34-alpha.7",
|
"version": "2.0.40-alpha.0",
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/backend-core",
|
"name": "@budibase/backend-core",
|
||||||
"version": "2.0.34-alpha.7",
|
"version": "2.0.40-alpha.0",
|
||||||
"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": "2.0.34-alpha.7",
|
"@budibase/types": "2.0.40-alpha.0",
|
||||||
"@shopify/jest-koa-mocks": "5.0.1",
|
"@shopify/jest-koa-mocks": "5.0.1",
|
||||||
"@techpass/passport-openidconnect": "0.3.2",
|
"@techpass/passport-openidconnect": "0.3.2",
|
||||||
"aws-sdk": "2.1030.0",
|
"aws-sdk": "2.1030.0",
|
||||||
|
|
|
@ -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": "2.0.34-alpha.7",
|
"version": "2.0.40-alpha.0",
|
||||||
"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": "2.0.34-alpha.7",
|
"@budibase/string-templates": "2.0.40-alpha.0",
|
||||||
"@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",
|
||||||
|
|
|
@ -139,7 +139,7 @@
|
||||||
{#if open}
|
{#if open}
|
||||||
<div
|
<div
|
||||||
use:clickOutside={handleOutsideClick}
|
use:clickOutside={handleOutsideClick}
|
||||||
transition:fly={{ y: -20, duration: 200 }}
|
transition:fly|local={{ y: -20, duration: 200 }}
|
||||||
class="spectrum-Popover spectrum-Popover--bottom spectrum-Picker-popover is-open"
|
class="spectrum-Popover spectrum-Popover--bottom spectrum-Picker-popover is-open"
|
||||||
class:spectrum-Popover--align-right={alignRight}
|
class:spectrum-Popover--align-right={alignRight}
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import Picker from "./Picker.svelte"
|
import Picker from "./Picker.svelte"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher, onMount } from "svelte"
|
||||||
|
|
||||||
export let value = []
|
export let value = []
|
||||||
export let id = null
|
export let id = null
|
||||||
|
@ -16,8 +16,33 @@
|
||||||
export let autoWidth = false
|
export let autoWidth = false
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
|
const parseValues = value => {
|
||||||
|
return Array.isArray(value)
|
||||||
|
? value.reduce((acc, entry) => {
|
||||||
|
if (typeof ele === "string" && entry.trim() === "") {
|
||||||
|
return acc
|
||||||
|
}
|
||||||
|
let processedOption = String(entry)
|
||||||
|
if (options.indexOf(processedOption) > -1) {
|
||||||
|
acc.push(processedOption)
|
||||||
|
}
|
||||||
|
return acc
|
||||||
|
}, [])
|
||||||
|
: []
|
||||||
|
}
|
||||||
|
let loaded = false
|
||||||
|
|
||||||
|
$: combinedValues = value ? [...value].concat(options) : []
|
||||||
|
$: superSet = new Set(combinedValues)
|
||||||
|
|
||||||
|
$: if (loaded && options.length != superSet.size) {
|
||||||
|
// ensure that the values being pushed in are valid.
|
||||||
|
dispatch("change", parseValues(value))
|
||||||
|
}
|
||||||
|
|
||||||
$: selectedLookupMap = getSelectedLookupMap(value)
|
$: selectedLookupMap = getSelectedLookupMap(value)
|
||||||
$: optionLookupMap = getOptionLookupMap(options)
|
$: optionLookupMap = getOptionLookupMap(options)
|
||||||
|
|
||||||
$: fieldText = getFieldText(value, optionLookupMap, placeholder)
|
$: fieldText = getFieldText(value, optionLookupMap, placeholder)
|
||||||
$: isOptionSelected = optionValue => selectedLookupMap[optionValue] === true
|
$: isOptionSelected = optionValue => selectedLookupMap[optionValue] === true
|
||||||
$: toggleOption = makeToggleOption(selectedLookupMap, value)
|
$: toggleOption = makeToggleOption(selectedLookupMap, value)
|
||||||
|
@ -70,6 +95,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
loaded = true
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Picker
|
<Picker
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/builder",
|
"name": "@budibase/builder",
|
||||||
"version": "2.0.34-alpha.7",
|
"version": "2.0.40-alpha.0",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -71,10 +71,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/bbui": "2.0.34-alpha.7",
|
"@budibase/bbui": "2.0.40-alpha.0",
|
||||||
"@budibase/client": "2.0.34-alpha.7",
|
"@budibase/client": "2.0.40-alpha.0",
|
||||||
"@budibase/frontend-core": "2.0.34-alpha.7",
|
"@budibase/frontend-core": "2.0.40-alpha.0",
|
||||||
"@budibase/string-templates": "2.0.34-alpha.7",
|
"@budibase/string-templates": "2.0.40-alpha.0",
|
||||||
"@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",
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
export let webhookModal
|
export let webhookModal
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="title">
|
<div class="nav">
|
||||||
<Tabs selected="Automations">
|
<Tabs selected="Automations">
|
||||||
<Tab title="Automations">
|
<Tab title="Automations">
|
||||||
<AutomationList />
|
<AutomationList />
|
||||||
|
@ -27,12 +27,15 @@
|
||||||
top: var(--spacing-l);
|
top: var(--spacing-l);
|
||||||
right: var(--spacing-xl);
|
right: var(--spacing-xl);
|
||||||
}
|
}
|
||||||
|
.nav {
|
||||||
.title {
|
overflow-y: auto;
|
||||||
|
background: var(--background);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
border-right: var(--border-light);
|
||||||
|
padding-bottom: 60px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -120,7 +120,7 @@
|
||||||
allSteps[idx]?.stepId === ActionStepID.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, decrement the index so the following
|
||||||
// steps are in the correct order
|
// steps are in the correct order
|
||||||
if (wasLoopBlock) {
|
if (wasLoopBlock) {
|
||||||
loopBlockCount++
|
loopBlockCount++
|
||||||
|
|
|
@ -14,6 +14,12 @@
|
||||||
export let block
|
export let block
|
||||||
export let isTestModal
|
export let isTestModal
|
||||||
|
|
||||||
|
$: parsedBindings = bindings.map(binding => {
|
||||||
|
let clone = Object.assign({}, binding)
|
||||||
|
clone.icon = "ShareAndroid"
|
||||||
|
return clone
|
||||||
|
})
|
||||||
|
|
||||||
let table
|
let table
|
||||||
let schemaFields
|
let schemaFields
|
||||||
|
|
||||||
|
@ -79,6 +85,10 @@
|
||||||
return [value]
|
return [value]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type === "json") {
|
||||||
|
return value.value
|
||||||
|
}
|
||||||
|
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +119,7 @@
|
||||||
{isTestModal}
|
{isTestModal}
|
||||||
{field}
|
{field}
|
||||||
{schema}
|
{schema}
|
||||||
{bindings}
|
bindings={parsedBindings}
|
||||||
{value}
|
{value}
|
||||||
{onChange}
|
{onChange}
|
||||||
/>
|
/>
|
||||||
|
@ -124,7 +134,7 @@
|
||||||
on:change={e => onChange(e, field, schema.type)}
|
on:change={e => onChange(e, field, schema.type)}
|
||||||
label={field}
|
label={field}
|
||||||
type="string"
|
type="string"
|
||||||
{bindings}
|
bindings={parsedBindings}
|
||||||
fillWidth={true}
|
fillWidth={true}
|
||||||
allowJS={true}
|
allowJS={true}
|
||||||
updateOnChange={false}
|
updateOnChange={false}
|
||||||
|
|
|
@ -5,11 +5,13 @@
|
||||||
DatePicker,
|
DatePicker,
|
||||||
Multiselect,
|
Multiselect,
|
||||||
TextArea,
|
TextArea,
|
||||||
|
Label,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import LinkedRowSelector from "components/common/LinkedRowSelector.svelte"
|
import LinkedRowSelector from "components/common/LinkedRowSelector.svelte"
|
||||||
import DrawerBindableInput from "../../common/bindings/DrawerBindableInput.svelte"
|
import DrawerBindableInput from "../../common/bindings/DrawerBindableInput.svelte"
|
||||||
import ModalBindableInput from "../../common/bindings/ModalBindableInput.svelte"
|
import ModalBindableInput from "../../common/bindings/ModalBindableInput.svelte"
|
||||||
import AutomationBindingPanel from "../../common/bindings/ServerBindingPanel.svelte"
|
import AutomationBindingPanel from "../../common/bindings/ServerBindingPanel.svelte"
|
||||||
|
import Editor from "components/integration/QueryEditor.svelte"
|
||||||
|
|
||||||
export let onChange
|
export let onChange
|
||||||
export let field
|
export let field
|
||||||
|
@ -18,6 +20,12 @@
|
||||||
export let bindings
|
export let bindings
|
||||||
export let isTestModal
|
export let isTestModal
|
||||||
|
|
||||||
|
$: parsedBindings = bindings.map(binding => {
|
||||||
|
let clone = Object.assign({}, binding)
|
||||||
|
clone.icon = "ShareAndroid"
|
||||||
|
return clone
|
||||||
|
})
|
||||||
|
|
||||||
function schemaHasOptions(schema) {
|
function schemaHasOptions(schema) {
|
||||||
return !!schema.constraints?.inclusion?.length
|
return !!schema.constraints?.inclusion?.length
|
||||||
}
|
}
|
||||||
|
@ -50,6 +58,20 @@
|
||||||
/>
|
/>
|
||||||
{:else if schema.type === "longform"}
|
{:else if schema.type === "longform"}
|
||||||
<TextArea label={field} bind:value={value[field]} />
|
<TextArea label={field} bind:value={value[field]} />
|
||||||
|
{:else if schema.type === "json"}
|
||||||
|
<span>
|
||||||
|
<Label>{field}</Label>
|
||||||
|
<Editor
|
||||||
|
editorHeight="150"
|
||||||
|
mode="json"
|
||||||
|
on:change={e => {
|
||||||
|
if (e.detail?.value !== value[field]) {
|
||||||
|
onChange(e, field, schema.type)
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
value={value[field]}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
{:else if schema.type === "link"}
|
{:else if schema.type === "link"}
|
||||||
<LinkedRowSelector bind:linkedRows={value[field]} {schema} />
|
<LinkedRowSelector bind:linkedRows={value[field]} {schema} />
|
||||||
{:else if schema.type === "string" || schema.type === "number"}
|
{:else if schema.type === "string" || schema.type === "number"}
|
||||||
|
@ -60,7 +82,7 @@
|
||||||
on:change={e => onChange(e, field)}
|
on:change={e => onChange(e, field)}
|
||||||
label={field}
|
label={field}
|
||||||
type="string"
|
type="string"
|
||||||
{bindings}
|
bindings={parsedBindings}
|
||||||
fillWidth={true}
|
fillWidth={true}
|
||||||
allowJS={true}
|
allowJS={true}
|
||||||
updateOnChange={false}
|
updateOnChange={false}
|
||||||
|
|
|
@ -70,7 +70,11 @@
|
||||||
.map(([key, error]) => ({ dataPath: key, message: error }))
|
.map(([key, error]) => ({ dataPath: key, message: error }))
|
||||||
.flat()
|
.flat()
|
||||||
}
|
}
|
||||||
} else if (error.status === 400) {
|
} else if (error.status === 400 && response?.validationErrors) {
|
||||||
|
errors = Object.keys(response.validationErrors).map(field => ({
|
||||||
|
message: `${field} ${response.validationErrors[field][0]}`,
|
||||||
|
}))
|
||||||
|
} else {
|
||||||
errors = [{ message: response?.message || "Unknown error" }]
|
errors = [{ message: response?.message || "Unknown error" }]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -247,7 +247,7 @@
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
hoverTarget = {
|
hoverTarget = {
|
||||||
title: binding.display?.name || binding.fieldSchema.name,
|
title: binding.display?.name || binding.fieldSchema?.name,
|
||||||
description: binding.description,
|
description: binding.description,
|
||||||
}
|
}
|
||||||
popover.show()
|
popover.show()
|
||||||
|
|
|
@ -305,6 +305,9 @@
|
||||||
getOptionLabel={x => x}
|
getOptionLabel={x => x}
|
||||||
getOptionValue={x => x}
|
getOptionValue={x => x}
|
||||||
value={rule.value}
|
value={rule.value}
|
||||||
|
on:change={e => {
|
||||||
|
rule.value = e.detail
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
{:else if rule.type === "boolean"}
|
{:else if rule.type === "boolean"}
|
||||||
<Select
|
<Select
|
||||||
|
|
|
@ -28,15 +28,13 @@ export const createValidationStore = () => {
|
||||||
let propertyValidator
|
let propertyValidator
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "number":
|
case "number":
|
||||||
propertyValidator = number().transform(value =>
|
propertyValidator = number().nullable()
|
||||||
isNaN(value) ? undefined : value
|
|
||||||
)
|
|
||||||
break
|
break
|
||||||
case "email":
|
case "email":
|
||||||
propertyValidator = string().email()
|
propertyValidator = string().email().nullable()
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
propertyValidator = string()
|
propertyValidator = string().nullable()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (required) {
|
if (required) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/cli",
|
"name": "@budibase/cli",
|
||||||
"version": "2.0.34-alpha.7",
|
"version": "2.0.40-alpha.0",
|
||||||
"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": {
|
||||||
|
@ -26,9 +26,9 @@
|
||||||
"outputPath": "build"
|
"outputPath": "build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/backend-core": "2.0.34-alpha.7",
|
"@budibase/backend-core": "2.0.40-alpha.0",
|
||||||
"@budibase/string-templates": "2.0.34-alpha.7",
|
"@budibase/string-templates": "2.0.40-alpha.0",
|
||||||
"@budibase/types": "2.0.34-alpha.7",
|
"@budibase/types": "2.0.40-alpha.0",
|
||||||
"axios": "0.21.2",
|
"axios": "0.21.2",
|
||||||
"chalk": "4.1.0",
|
"chalk": "4.1.0",
|
||||||
"cli-progress": "3.11.2",
|
"cli-progress": "3.11.2",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/client",
|
"name": "@budibase/client",
|
||||||
"version": "2.0.34-alpha.7",
|
"version": "2.0.40-alpha.0",
|
||||||
"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": "2.0.34-alpha.7",
|
"@budibase/bbui": "2.0.40-alpha.0",
|
||||||
"@budibase/frontend-core": "2.0.34-alpha.7",
|
"@budibase/frontend-core": "2.0.40-alpha.0",
|
||||||
"@budibase/string-templates": "2.0.34-alpha.7",
|
"@budibase/string-templates": "2.0.40-alpha.0",
|
||||||
"@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",
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
validation,
|
validation,
|
||||||
formStep
|
formStep
|
||||||
)
|
)
|
||||||
|
|
||||||
$: schemaType = fieldSchema?.type !== "formula" ? fieldSchema?.type : "string"
|
$: schemaType = fieldSchema?.type !== "formula" ? fieldSchema?.type : "string"
|
||||||
|
|
||||||
// Focus label when editing
|
// Focus label when editing
|
||||||
|
|
|
@ -143,6 +143,7 @@
|
||||||
|
|
||||||
// Create validation function based on field schema
|
// Create validation function based on field schema
|
||||||
const schemaConstraints = schema?.[field]?.constraints
|
const schemaConstraints = schema?.[field]?.constraints
|
||||||
|
|
||||||
const validator = disableValidation
|
const validator = disableValidation
|
||||||
? null
|
? null
|
||||||
: createValidatorFromConstraints(
|
: createValidatorFromConstraints(
|
||||||
|
|
|
@ -671,9 +671,15 @@ has@^1.0.3:
|
||||||
function-bind "^1.1.1"
|
function-bind "^1.1.1"
|
||||||
|
|
||||||
html5-qrcode@^2.2.1:
|
html5-qrcode@^2.2.1:
|
||||||
|
<<<<<<< HEAD
|
||||||
|
version "2.2.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/html5-qrcode/-/html5-qrcode-2.2.4.tgz#99e4b36fbd8fbc4956036cf3f21ea3e98c3463d1"
|
||||||
|
integrity sha512-X8wVVsHpNb35tl7KcoCGAboc6Nep2VyT3CIMjFvrfWrHbHTC0yYTjE+DhO/VcswY2MfHy1uB7b1G9+L13gM6dQ==
|
||||||
|
=======
|
||||||
version "2.2.3"
|
version "2.2.3"
|
||||||
resolved "https://registry.yarnpkg.com/html5-qrcode/-/html5-qrcode-2.2.3.tgz#5acb826860365e7c7ab91e1e14528ea16a502e8a"
|
resolved "https://registry.yarnpkg.com/html5-qrcode/-/html5-qrcode-2.2.3.tgz#5acb826860365e7c7ab91e1e14528ea16a502e8a"
|
||||||
integrity sha512-9CtEz5FVT56T76entiQxyrASzBWl8Rm30NHiQH8T163Eml5LS14BoZlYel9igxbikOt7O8KhvrT3awN1Y2HMqw==
|
integrity sha512-9CtEz5FVT56T76entiQxyrASzBWl8Rm30NHiQH8T163Eml5LS14BoZlYel9igxbikOt7O8KhvrT3awN1Y2HMqw==
|
||||||
|
>>>>>>> 50f0a0509d79dcee7a0f12608054279d65662b10
|
||||||
|
|
||||||
htmlparser2@^6.0.0:
|
htmlparser2@^6.0.0:
|
||||||
version "6.1.0"
|
version "6.1.0"
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/frontend-core",
|
"name": "@budibase/frontend-core",
|
||||||
"version": "2.0.34-alpha.7",
|
"version": "2.0.40-alpha.0",
|
||||||
"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": "2.0.34-alpha.7",
|
"@budibase/bbui": "2.0.40-alpha.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"svelte": "^3.46.2"
|
"svelte": "^3.46.2"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/sdk",
|
"name": "@budibase/sdk",
|
||||||
"version": "2.0.34-alpha.7",
|
"version": "2.0.40-alpha.0",
|
||||||
"description": "Budibase Public API SDK",
|
"description": "Budibase Public API SDK",
|
||||||
"author": "Budibase",
|
"author": "Budibase",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/server",
|
"name": "@budibase/server",
|
||||||
"email": "hi@budibase.com",
|
"email": "hi@budibase.com",
|
||||||
"version": "2.0.34-alpha.7",
|
"version": "2.0.40-alpha.0",
|
||||||
"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": "2.0.34-alpha.7",
|
"@budibase/backend-core": "2.0.40-alpha.0",
|
||||||
"@budibase/client": "2.0.34-alpha.7",
|
"@budibase/client": "2.0.40-alpha.0",
|
||||||
"@budibase/pro": "2.0.34-alpha.7",
|
"@budibase/pro": "2.0.40-alpha.0",
|
||||||
"@budibase/string-templates": "2.0.34-alpha.7",
|
"@budibase/string-templates": "2.0.40-alpha.0",
|
||||||
"@budibase/types": "2.0.34-alpha.7",
|
"@budibase/types": "2.0.40-alpha.0",
|
||||||
"@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",
|
||||||
|
|
|
@ -58,7 +58,6 @@ export const save = async (ctx: any) => {
|
||||||
if (body && body._id) {
|
if (body && body._id) {
|
||||||
return patch(ctx)
|
return patch(ctx)
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
const { row, table } = await quotas.addRow(() =>
|
const { row, table } = await quotas.addRow(() =>
|
||||||
quotas.addQuery(() => pickApi(tableId).save(ctx), {
|
quotas.addQuery(() => pickApi(tableId).save(ctx), {
|
||||||
datasourceId: tableId,
|
datasourceId: tableId,
|
||||||
|
@ -68,42 +67,26 @@ export const save = async (ctx: any) => {
|
||||||
ctx.eventEmitter && ctx.eventEmitter.emitRow(`row:save`, appId, row, table)
|
ctx.eventEmitter && ctx.eventEmitter.emitRow(`row:save`, appId, row, table)
|
||||||
ctx.message = `${table.name} saved successfully`
|
ctx.message = `${table.name} saved successfully`
|
||||||
ctx.body = row
|
ctx.body = row
|
||||||
} catch (err) {
|
|
||||||
ctx.throw(400, err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchView(ctx: any) {
|
export async function fetchView(ctx: any) {
|
||||||
const tableId = getTableId(ctx)
|
const tableId = getTableId(ctx)
|
||||||
try {
|
|
||||||
ctx.body = await quotas.addQuery(() => pickApi(tableId).fetchView(ctx), {
|
ctx.body = await quotas.addQuery(() => pickApi(tableId).fetchView(ctx), {
|
||||||
datasourceId: tableId,
|
datasourceId: tableId,
|
||||||
})
|
})
|
||||||
} catch (err) {
|
|
||||||
ctx.throw(400, err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetch(ctx: any) {
|
export async function fetch(ctx: any) {
|
||||||
const tableId = getTableId(ctx)
|
const tableId = getTableId(ctx)
|
||||||
try {
|
|
||||||
ctx.body = await quotas.addQuery(() => pickApi(tableId).fetch(ctx), {
|
ctx.body = await quotas.addQuery(() => pickApi(tableId).fetch(ctx), {
|
||||||
datasourceId: tableId,
|
datasourceId: tableId,
|
||||||
})
|
})
|
||||||
} catch (err) {
|
|
||||||
ctx.throw(400, err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function find(ctx: any) {
|
export async function find(ctx: any) {
|
||||||
const tableId = getTableId(ctx)
|
const tableId = getTableId(ctx)
|
||||||
try {
|
|
||||||
ctx.body = await quotas.addQuery(() => pickApi(tableId).find(ctx), {
|
ctx.body = await quotas.addQuery(() => pickApi(tableId).find(ctx), {
|
||||||
datasourceId: tableId,
|
datasourceId: tableId,
|
||||||
})
|
})
|
||||||
} catch (err) {
|
|
||||||
ctx.throw(400, err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function destroy(ctx: any) {
|
export async function destroy(ctx: any) {
|
||||||
|
@ -140,46 +123,30 @@ export async function destroy(ctx: any) {
|
||||||
|
|
||||||
export async function search(ctx: any) {
|
export async function search(ctx: any) {
|
||||||
const tableId = getTableId(ctx)
|
const tableId = getTableId(ctx)
|
||||||
try {
|
|
||||||
ctx.status = 200
|
ctx.status = 200
|
||||||
ctx.body = await quotas.addQuery(() => pickApi(tableId).search(ctx), {
|
ctx.body = await quotas.addQuery(() => pickApi(tableId).search(ctx), {
|
||||||
datasourceId: tableId,
|
datasourceId: tableId,
|
||||||
})
|
})
|
||||||
} catch (err) {
|
|
||||||
ctx.throw(400, err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function validate(ctx: any) {
|
export async function validate(ctx: any) {
|
||||||
const tableId = getTableId(ctx)
|
const tableId = getTableId(ctx)
|
||||||
try {
|
|
||||||
ctx.body = await pickApi(tableId).validate(ctx)
|
ctx.body = await pickApi(tableId).validate(ctx)
|
||||||
} catch (err) {
|
|
||||||
ctx.throw(400, err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchEnrichedRow(ctx: any) {
|
export async function fetchEnrichedRow(ctx: any) {
|
||||||
const tableId = getTableId(ctx)
|
const tableId = getTableId(ctx)
|
||||||
try {
|
|
||||||
ctx.body = await quotas.addQuery(
|
ctx.body = await quotas.addQuery(
|
||||||
() => pickApi(tableId).fetchEnrichedRow(ctx),
|
() => pickApi(tableId).fetchEnrichedRow(ctx),
|
||||||
{
|
{
|
||||||
datasourceId: tableId,
|
datasourceId: tableId,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
} catch (err) {
|
|
||||||
ctx.throw(400, err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const exportRows = async (ctx: any) => {
|
export const exportRows = async (ctx: any) => {
|
||||||
const tableId = getTableId(ctx)
|
const tableId = getTableId(ctx)
|
||||||
try {
|
|
||||||
ctx.body = await quotas.addQuery(() => pickApi(tableId).exportRows(ctx), {
|
ctx.body = await quotas.addQuery(() => pickApi(tableId).exportRows(ctx), {
|
||||||
datasourceId: tableId,
|
datasourceId: tableId,
|
||||||
})
|
})
|
||||||
} catch (err) {
|
|
||||||
ctx.throw(400, err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,7 @@ exports.patch = async ctx => {
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!validateResult.valid) {
|
if (!validateResult.valid) {
|
||||||
throw { validation: validateResult.errors }
|
ctx.throw(400, { validation: validateResult.errors })
|
||||||
}
|
}
|
||||||
|
|
||||||
// returned row is cleaned and prepared for writing to DB
|
// returned row is cleaned and prepared for writing to DB
|
||||||
|
|
|
@ -111,6 +111,8 @@ export const serveApp = async function (ctx: any) {
|
||||||
const App = require("./templates/BudibaseApp.svelte").default
|
const App = require("./templates/BudibaseApp.svelte").default
|
||||||
const plugins = enrichPluginURLs(appInfo.usedPlugins)
|
const plugins = enrichPluginURLs(appInfo.usedPlugins)
|
||||||
const { head, html, css } = App.render({
|
const { head, html, css } = App.render({
|
||||||
|
metaImage:
|
||||||
|
"https://res.cloudinary.com/daog6scxm/image/upload/v1666109324/meta-images/budibase-meta-image_uukc1m.png",
|
||||||
title: appInfo.name,
|
title: appInfo.name,
|
||||||
production: env.isProd(),
|
production: env.isProd(),
|
||||||
appId,
|
appId,
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
<script>
|
<script>
|
||||||
export let title = ""
|
export let title = ""
|
||||||
export let favicon = ""
|
export let favicon = ""
|
||||||
|
export let metaImage = ""
|
||||||
|
export let url = ""
|
||||||
|
|
||||||
export let clientLibPath
|
export let clientLibPath
|
||||||
export let usedPlugins
|
export let usedPlugins
|
||||||
|
@ -12,6 +14,15 @@
|
||||||
name="viewport"
|
name="viewport"
|
||||||
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
|
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
|
||||||
/>
|
/>
|
||||||
|
<!-- Opengraph Meta Tags -->
|
||||||
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
|
<meta name="twitter:site" content="@budibase" />
|
||||||
|
<meta name="twitter:image" content={metaImage} />
|
||||||
|
<meta name="twitter:title" content="{title} - built with Budibase" />
|
||||||
|
<meta property="og:site_name" content="Budibase" />
|
||||||
|
<meta property="og:title" content="{title} - built with Budibase" />
|
||||||
|
<meta property="og:type" content="website" />
|
||||||
|
<meta property="og:image" content={metaImage} />
|
||||||
|
|
||||||
<title>{title}</title>
|
<title>{title}</title>
|
||||||
<link rel="icon" type="image/png" href={favicon} />
|
<link rel="icon" type="image/png" href={favicon} />
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
const {
|
const {
|
||||||
findHBSBlocks,
|
|
||||||
decodeJSBinding,
|
decodeJSBinding,
|
||||||
isJSBinding,
|
isJSBinding,
|
||||||
encodeJSBinding,
|
encodeJSBinding,
|
||||||
|
@ -82,24 +81,34 @@ exports.getError = err => {
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.substituteLoopStep = (hbsString, substitute) => {
|
exports.substituteLoopStep = (hbsString, substitute) => {
|
||||||
let blocks = []
|
|
||||||
let checkForJS = isJSBinding(hbsString)
|
let checkForJS = isJSBinding(hbsString)
|
||||||
|
let substitutedHbsString = ""
|
||||||
|
let open = checkForJS ? `$("` : "{{"
|
||||||
|
let closed = checkForJS ? `")` : "}}"
|
||||||
if (checkForJS) {
|
if (checkForJS) {
|
||||||
hbsString = decodeJSBinding(hbsString)
|
hbsString = decodeJSBinding(hbsString)
|
||||||
blocks.push(hbsString)
|
|
||||||
} else {
|
|
||||||
blocks = findHBSBlocks(hbsString)
|
|
||||||
}
|
}
|
||||||
for (let block of blocks) {
|
let pointer = 0,
|
||||||
block = block.replace(/loop/, substitute)
|
openPointer = 0,
|
||||||
|
closedPointer = 0
|
||||||
|
while (pointer < hbsString.length) {
|
||||||
|
openPointer = hbsString.indexOf(open, pointer)
|
||||||
|
closedPointer = hbsString.indexOf(closed, pointer) + 2
|
||||||
|
if (openPointer < 0 || closedPointer < 0) {
|
||||||
|
substitutedHbsString += hbsString.substring(pointer)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
let before = hbsString.substring(pointer, openPointer)
|
||||||
|
let block = hbsString
|
||||||
|
.substring(openPointer, closedPointer)
|
||||||
|
.replace(/loop/, substitute)
|
||||||
|
substitutedHbsString += before + block
|
||||||
|
pointer = closedPointer
|
||||||
|
}
|
||||||
if (checkForJS) {
|
if (checkForJS) {
|
||||||
hbsString = encodeJSBinding(block)
|
substitutedHbsString = encodeJSBinding(substitutedHbsString)
|
||||||
} else {
|
|
||||||
hbsString = block
|
|
||||||
}
|
}
|
||||||
}
|
return substitutedHbsString
|
||||||
|
|
||||||
return hbsString
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.stringSplit = value => {
|
exports.stringSplit = value => {
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
const automationUtils = require("../automationUtils")
|
||||||
|
|
||||||
|
describe("automationUtils", () => {
|
||||||
|
test("substituteLoopStep should allow multiple loop binding substitutes", () => {
|
||||||
|
expect(automationUtils.substituteLoopStep(
|
||||||
|
`{{ loop.currentItem._id }} {{ loop.currentItem._id }} {{ loop.currentItem._id }}`,
|
||||||
|
"step.2"))
|
||||||
|
.toBe(`{{ step.2.currentItem._id }} {{ step.2.currentItem._id }} {{ step.2.currentItem._id }}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
test("substituteLoopStep should handle not subsituting outside of curly braces", () => {
|
||||||
|
expect(automationUtils.substituteLoopStep(
|
||||||
|
`loop {{ loop.currentItem._id }}loop loop{{ loop.currentItem._id }}loop`,
|
||||||
|
"step.2"))
|
||||||
|
.toBe(`loop {{ step.2.currentItem._id }}loop loop{{ step.2.currentItem._id }}loop`)
|
||||||
|
})
|
||||||
|
})
|
|
@ -120,6 +120,9 @@ async function updateAutomations(prodAppId: string, db: PouchDB.Database) {
|
||||||
* @returns {Object} Returns a fs read stream which can be loaded into the database.
|
* @returns {Object} Returns a fs read stream which can be loaded into the database.
|
||||||
*/
|
*/
|
||||||
async function getTemplateStream(template: TemplateType) {
|
async function getTemplateStream(template: TemplateType) {
|
||||||
|
if (template.file && template.file.type !== "text/plain") {
|
||||||
|
throw new Error("Cannot import a non-text based file.")
|
||||||
|
}
|
||||||
if (template.file) {
|
if (template.file) {
|
||||||
return fs.createReadStream(template.file.path)
|
return fs.createReadStream(template.file.path)
|
||||||
} else if (template.key) {
|
} else if (template.key) {
|
||||||
|
@ -156,7 +159,7 @@ export async function importApp(
|
||||||
) {
|
) {
|
||||||
let prodAppId = dbCore.getProdAppID(appId)
|
let prodAppId = dbCore.getProdAppID(appId)
|
||||||
let dbStream: any
|
let dbStream: any
|
||||||
const isTar = template.file && template.file.type === "application/gzip"
|
const isTar = template.file && template?.file?.type?.endsWith("gzip")
|
||||||
const isDirectory =
|
const isDirectory =
|
||||||
template.file && fs.lstatSync(template.file.path).isDirectory()
|
template.file && fs.lstatSync(template.file.path).isDirectory()
|
||||||
if (template.file && (isTar || isDirectory)) {
|
if (template.file && (isTar || isDirectory)) {
|
||||||
|
|
|
@ -1094,12 +1094,12 @@
|
||||||
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
||||||
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
||||||
|
|
||||||
"@budibase/backend-core@2.0.34-alpha.7":
|
"@budibase/backend-core@2.0.40-alpha.0":
|
||||||
version "2.0.34-alpha.7"
|
version "2.0.40-alpha.0"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.34-alpha.7.tgz#cb51d0433694fdc8603882deeef1e2cb931083a4"
|
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.40-alpha.0.tgz#197df7756b8352bbda189e0f497b8df64a4a09de"
|
||||||
integrity sha512-he8s48GkotnYFeGk6M6F6EvgaKwFbcLBo+nx51J+hKP/nnc6wUihw1JLiu6qv4nfsi6ufkjWK8KuRYLL4mkXXA==
|
integrity sha512-7HjMzpSMDcxgJwUrWvibK0Koj348JyAkMhtSjGxj7s8lhu+z9GcqiWNHssx5sdramShmbSkcNny5vnM+A9w+tQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/types" "2.0.34-alpha.7"
|
"@budibase/types" "2.0.40-alpha.0"
|
||||||
"@shopify/jest-koa-mocks" "5.0.1"
|
"@shopify/jest-koa-mocks" "5.0.1"
|
||||||
"@techpass/passport-openidconnect" "0.3.2"
|
"@techpass/passport-openidconnect" "0.3.2"
|
||||||
aws-sdk "2.1030.0"
|
aws-sdk "2.1030.0"
|
||||||
|
@ -1181,13 +1181,13 @@
|
||||||
svelte-flatpickr "^3.2.3"
|
svelte-flatpickr "^3.2.3"
|
||||||
svelte-portal "^1.0.0"
|
svelte-portal "^1.0.0"
|
||||||
|
|
||||||
"@budibase/pro@2.0.34-alpha.7":
|
"@budibase/pro@2.0.40-alpha.0":
|
||||||
version "2.0.34-alpha.7"
|
version "2.0.40-alpha.0"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.34-alpha.7.tgz#5eb16030569474994c1f47a19f9447a2eff5f97e"
|
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.40-alpha.0.tgz#748fdad163159cc04b5b2b3103179c9e3bb22ab1"
|
||||||
integrity sha512-TwHrt62uC9pySUirnSLJ67pVikvPsFKz8NqwQJkyP0ZEtx29jSV8FZmLbYN8GrLd0n6xJ7DxBztX9ua/0Jt+pg==
|
integrity sha512-brBVT2B/nzZw8iYnC6Xhu0+x3JprgEsN1s40tQaYbVAvXB6GuHCtnkJ6mDoGDB5xQTilNdx+xNfF/qpZQv7h9w==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/backend-core" "2.0.34-alpha.7"
|
"@budibase/backend-core" "2.0.40-alpha.0"
|
||||||
"@budibase/types" "2.0.34-alpha.7"
|
"@budibase/types" "2.0.40-alpha.0"
|
||||||
"@koa/router" "8.0.8"
|
"@koa/router" "8.0.8"
|
||||||
bull "4.10.1"
|
bull "4.10.1"
|
||||||
joi "17.6.0"
|
joi "17.6.0"
|
||||||
|
@ -1211,10 +1211,10 @@
|
||||||
svelte-apexcharts "^1.0.2"
|
svelte-apexcharts "^1.0.2"
|
||||||
svelte-flatpickr "^3.1.0"
|
svelte-flatpickr "^3.1.0"
|
||||||
|
|
||||||
"@budibase/types@2.0.34-alpha.7":
|
"@budibase/types@2.0.40-alpha.0":
|
||||||
version "2.0.34-alpha.7"
|
version "2.0.40-alpha.0"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.34-alpha.7.tgz#4ea62b08ba6ebda069add3abdec3c0efd0f4d93e"
|
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.40-alpha.0.tgz#22664329f7662cbf6fc4755f08fb1e6eed65f8c7"
|
||||||
integrity sha512-QOvLx4lopEEowS39HTRXC6m/AIR0RfPhQq2wKRQ55wLmRSxxuN4VzGAnAAn1qyG0Y2+xCHlR1dNQeRzTH7T5og==
|
integrity sha512-Z/PZrzkiK4MfsngSzyYmCnYHcGmTQci6achej3q2qPtnG7+AZpmTDszovznMytfyNA+TMvFesECzBy1p+KBTDQ==
|
||||||
|
|
||||||
"@bull-board/api@3.7.0":
|
"@bull-board/api@3.7.0":
|
||||||
version "3.7.0"
|
version "3.7.0"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/string-templates",
|
"name": "@budibase/string-templates",
|
||||||
"version": "2.0.34-alpha.7",
|
"version": "2.0.40-alpha.0",
|
||||||
"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",
|
||||||
|
|
|
@ -323,6 +323,9 @@ module.exports.doesContainStrings = (template, strings) => {
|
||||||
* @return {string[]} The found HBS blocks.
|
* @return {string[]} The found HBS blocks.
|
||||||
*/
|
*/
|
||||||
module.exports.findHBSBlocks = string => {
|
module.exports.findHBSBlocks = string => {
|
||||||
|
if (!string || typeof string !== "string") {
|
||||||
|
return []
|
||||||
|
}
|
||||||
let regexp = new RegExp(FIND_ANY_HBS_REGEX)
|
let regexp = new RegExp(FIND_ANY_HBS_REGEX)
|
||||||
let matches = string.match(regexp)
|
let matches = string.match(regexp)
|
||||||
if (matches == null) {
|
if (matches == null) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/types",
|
"name": "@budibase/types",
|
||||||
"version": "2.0.34-alpha.7",
|
"version": "2.0.40-alpha.0",
|
||||||
"description": "Budibase types",
|
"description": "Budibase types",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/worker",
|
"name": "@budibase/worker",
|
||||||
"email": "hi@budibase.com",
|
"email": "hi@budibase.com",
|
||||||
"version": "2.0.34-alpha.7",
|
"version": "2.0.40-alpha.0",
|
||||||
"description": "Budibase background service",
|
"description": "Budibase background service",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -36,10 +36,10 @@
|
||||||
"author": "Budibase",
|
"author": "Budibase",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/backend-core": "2.0.34-alpha.7",
|
"@budibase/backend-core": "2.0.40-alpha.0",
|
||||||
"@budibase/pro": "2.0.34-alpha.7",
|
"@budibase/pro": "2.0.40-alpha.0",
|
||||||
"@budibase/string-templates": "2.0.34-alpha.7",
|
"@budibase/string-templates": "2.0.40-alpha.0",
|
||||||
"@budibase/types": "2.0.34-alpha.7",
|
"@budibase/types": "2.0.40-alpha.0",
|
||||||
"@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",
|
||||||
|
|
|
@ -291,12 +291,12 @@
|
||||||
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
||||||
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
||||||
|
|
||||||
"@budibase/backend-core@2.0.34-alpha.7":
|
"@budibase/backend-core@2.0.40-alpha.0":
|
||||||
version "2.0.34-alpha.7"
|
version "2.0.40-alpha.0"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.34-alpha.7.tgz#cb51d0433694fdc8603882deeef1e2cb931083a4"
|
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.40-alpha.0.tgz#197df7756b8352bbda189e0f497b8df64a4a09de"
|
||||||
integrity sha512-he8s48GkotnYFeGk6M6F6EvgaKwFbcLBo+nx51J+hKP/nnc6wUihw1JLiu6qv4nfsi6ufkjWK8KuRYLL4mkXXA==
|
integrity sha512-7HjMzpSMDcxgJwUrWvibK0Koj348JyAkMhtSjGxj7s8lhu+z9GcqiWNHssx5sdramShmbSkcNny5vnM+A9w+tQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/types" "2.0.34-alpha.7"
|
"@budibase/types" "2.0.40-alpha.0"
|
||||||
"@shopify/jest-koa-mocks" "5.0.1"
|
"@shopify/jest-koa-mocks" "5.0.1"
|
||||||
"@techpass/passport-openidconnect" "0.3.2"
|
"@techpass/passport-openidconnect" "0.3.2"
|
||||||
aws-sdk "2.1030.0"
|
aws-sdk "2.1030.0"
|
||||||
|
@ -328,22 +328,22 @@
|
||||||
uuid "8.3.2"
|
uuid "8.3.2"
|
||||||
zlib "1.0.5"
|
zlib "1.0.5"
|
||||||
|
|
||||||
"@budibase/pro@2.0.34-alpha.7":
|
"@budibase/pro@2.0.40-alpha.0":
|
||||||
version "2.0.34-alpha.7"
|
version "2.0.40-alpha.0"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.34-alpha.7.tgz#5eb16030569474994c1f47a19f9447a2eff5f97e"
|
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.40-alpha.0.tgz#748fdad163159cc04b5b2b3103179c9e3bb22ab1"
|
||||||
integrity sha512-TwHrt62uC9pySUirnSLJ67pVikvPsFKz8NqwQJkyP0ZEtx29jSV8FZmLbYN8GrLd0n6xJ7DxBztX9ua/0Jt+pg==
|
integrity sha512-brBVT2B/nzZw8iYnC6Xhu0+x3JprgEsN1s40tQaYbVAvXB6GuHCtnkJ6mDoGDB5xQTilNdx+xNfF/qpZQv7h9w==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/backend-core" "2.0.34-alpha.7"
|
"@budibase/backend-core" "2.0.40-alpha.0"
|
||||||
"@budibase/types" "2.0.34-alpha.7"
|
"@budibase/types" "2.0.40-alpha.0"
|
||||||
"@koa/router" "8.0.8"
|
"@koa/router" "8.0.8"
|
||||||
bull "4.10.1"
|
bull "4.10.1"
|
||||||
joi "17.6.0"
|
joi "17.6.0"
|
||||||
node-fetch "^2.6.1"
|
node-fetch "^2.6.1"
|
||||||
|
|
||||||
"@budibase/types@2.0.34-alpha.7":
|
"@budibase/types@2.0.40-alpha.0":
|
||||||
version "2.0.34-alpha.7"
|
version "2.0.40-alpha.0"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.34-alpha.7.tgz#4ea62b08ba6ebda069add3abdec3c0efd0f4d93e"
|
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.40-alpha.0.tgz#22664329f7662cbf6fc4755f08fb1e6eed65f8c7"
|
||||||
integrity sha512-QOvLx4lopEEowS39HTRXC6m/AIR0RfPhQq2wKRQ55wLmRSxxuN4VzGAnAAn1qyG0Y2+xCHlR1dNQeRzTH7T5og==
|
integrity sha512-Z/PZrzkiK4MfsngSzyYmCnYHcGmTQci6achej3q2qPtnG7+AZpmTDszovznMytfyNA+TMvFesECzBy1p+KBTDQ==
|
||||||
|
|
||||||
"@cspotcode/source-map-consumer@0.8.0":
|
"@cspotcode/source-map-consumer@0.8.0":
|
||||||
version "0.8.0"
|
version "0.8.0"
|
||||||
|
|
|
@ -7,6 +7,7 @@ import { RouteConfig } from "../fixtures/types/routing"
|
||||||
import { AppPackageResponse } from "../fixtures/types/appPackage"
|
import { AppPackageResponse } from "../fixtures/types/appPackage"
|
||||||
import { DeployConfig } from "../fixtures/types/deploy"
|
import { DeployConfig } from "../fixtures/types/deploy"
|
||||||
import { responseMessage } from "../fixtures/types/responseMessage"
|
import { responseMessage } from "../fixtures/types/responseMessage"
|
||||||
|
import { UnpublishAppResponse } from "../fixtures/types/unpublishAppResponse"
|
||||||
|
|
||||||
export default class AppApi {
|
export default class AppApi {
|
||||||
api: InternalAPIClient
|
api: InternalAPIClient
|
||||||
|
@ -100,4 +101,14 @@ export default class AppApi {
|
||||||
const json = await response.json()
|
const json = await response.json()
|
||||||
return [response, json]
|
return [response, json]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async unpublish(appId: string): Promise<[Response, UnpublishAppResponse]> {
|
||||||
|
const response = await this.api.del(`/applications/${appId}?unpublish=1`)
|
||||||
|
expect(response).toHaveStatusCode(200)
|
||||||
|
const json = await response.json()
|
||||||
|
expect(json.data.ok).toBe(true)
|
||||||
|
expect(json.ok).toBe(true)
|
||||||
|
expect(json.status).toBe(200)
|
||||||
|
return [response, json]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
export interface UnpublishAppResponse {
|
||||||
|
data: {
|
||||||
|
ok: boolean
|
||||||
|
},
|
||||||
|
ok: boolean,
|
||||||
|
status: number
|
||||||
|
}
|
|
@ -63,7 +63,7 @@ describe("Internal API - /applications endpoints", () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
it("POST - Create an application from a template, publish and check it renders", async () => {
|
it("Publish app flow", async () => {
|
||||||
// create the app
|
// create the app
|
||||||
const appName = generator.word()
|
const appName = generator.word()
|
||||||
const app = await createAppFromTemplate()
|
const app = await createAppFromTemplate()
|
||||||
|
@ -83,6 +83,10 @@ describe("Internal API - /applications endpoints", () => {
|
||||||
const [publishedAppResponse, publishedAppRenders] =
|
const [publishedAppResponse, publishedAppRenders] =
|
||||||
await config.applications.canRender()
|
await config.applications.canRender()
|
||||||
expect(publishedAppRenders).toBe(true)
|
expect(publishedAppRenders).toBe(true)
|
||||||
|
|
||||||
|
// unpublish app
|
||||||
|
await config.applications.unpublish(<string>app.appId)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it("POST - Sync application before deployment", async () => {
|
it("POST - Sync application before deployment", async () => {
|
||||||
|
|
Loading…
Reference in New Issue