Merge remote-tracking branch 'origin/develop' into feature/configurable-sso-auth-scopes
This commit is contained in:
commit
afca8e02da
20 changed files with 204 additions and 179 deletions
|
@ -62,6 +62,10 @@ http {
|
||||||
proxy_pass http://{{ address }}:4001;
|
proxy_pass http://{{ address }}:4001;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location /preview {
|
||||||
|
proxy_pass http://{{ address }}:4001;
|
||||||
|
}
|
||||||
|
|
||||||
location /builder {
|
location /builder {
|
||||||
proxy_pass http://{{ address }}:3000;
|
proxy_pass http://{{ address }}:3000;
|
||||||
rewrite ^/builder(.*)$ /builder/$1 break;
|
rewrite ^/builder(.*)$ /builder/$1 break;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "1.2.44-alpha.0",
|
"version": "1.2.44-alpha.1",
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/backend-core",
|
"name": "@budibase/backend-core",
|
||||||
"version": "1.2.44-alpha.0",
|
"version": "1.2.44-alpha.1",
|
||||||
"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.2.44-alpha.0",
|
"@budibase/types": "1.2.44-alpha.1",
|
||||||
"@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",
|
||||||
|
|
|
@ -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.2.44-alpha.0",
|
"version": "1.2.44-alpha.1",
|
||||||
"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.2.44-alpha.0",
|
"@budibase/string-templates": "1.2.44-alpha.1",
|
||||||
"@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",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/builder",
|
"name": "@budibase/builder",
|
||||||
"version": "1.2.44-alpha.0",
|
"version": "1.2.44-alpha.1",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -69,10 +69,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/bbui": "1.2.44-alpha.0",
|
"@budibase/bbui": "1.2.44-alpha.1",
|
||||||
"@budibase/client": "1.2.44-alpha.0",
|
"@budibase/client": "1.2.44-alpha.1",
|
||||||
"@budibase/frontend-core": "1.2.44-alpha.0",
|
"@budibase/frontend-core": "1.2.44-alpha.1",
|
||||||
"@budibase/string-templates": "1.2.44-alpha.0",
|
"@budibase/string-templates": "1.2.44-alpha.1",
|
||||||
"@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",
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
selectedLayout,
|
selectedLayout,
|
||||||
currentAsset,
|
currentAsset,
|
||||||
} from "builderStore"
|
} from "builderStore"
|
||||||
import iframeTemplate from "./iframeTemplate"
|
|
||||||
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
||||||
import {
|
import {
|
||||||
ProgressCircle,
|
ProgressCircle,
|
||||||
|
@ -40,12 +39,6 @@
|
||||||
BUDIBASE: "type",
|
BUDIBASE: "type",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct iframe template
|
|
||||||
$: template = iframeTemplate.replace(
|
|
||||||
/\{\{ CLIENT_LIB_PATH }}/,
|
|
||||||
$store.clientLibPath
|
|
||||||
)
|
|
||||||
|
|
||||||
const placeholderScreen = new Screen()
|
const placeholderScreen = new Screen()
|
||||||
.name("Screen Placeholder")
|
.name("Screen Placeholder")
|
||||||
.route("/")
|
.route("/")
|
||||||
|
@ -298,7 +291,7 @@
|
||||||
<iframe
|
<iframe
|
||||||
title="componentPreview"
|
title="componentPreview"
|
||||||
bind:this={iframe}
|
bind:this={iframe}
|
||||||
srcdoc={template}
|
src="/preview"
|
||||||
class:hidden={loading || error}
|
class:hidden={loading || error}
|
||||||
class:tablet={$store.previewDevice === "tablet"}
|
class:tablet={$store.previewDevice === "tablet"}
|
||||||
class:mobile={$store.previewDevice === "mobile"}
|
class:mobile={$store.previewDevice === "mobile"}
|
||||||
|
|
|
@ -1,104 +0,0 @@
|
||||||
export default `
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
|
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
||||||
<link
|
|
||||||
href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
|
|
||||||
rel="stylesheet"
|
|
||||||
/>
|
|
||||||
<link
|
|
||||||
href="https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css"
|
|
||||||
rel="stylesheet"
|
|
||||||
/>
|
|
||||||
<style>
|
|
||||||
html, body {
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
html {
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: flex-start;
|
|
||||||
align-items: stretch;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
flex: 1 1 auto;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
*,
|
|
||||||
*:before,
|
|
||||||
*:after {
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script src='{{ CLIENT_LIB_PATH }}'></script>
|
|
||||||
<script>
|
|
||||||
function receiveMessage(event) {
|
|
||||||
if (!event.data) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parse received message
|
|
||||||
// If parsing fails, just ignore and wait for the next message
|
|
||||||
let parsed
|
|
||||||
try {
|
|
||||||
parsed = JSON.parse(event.data)
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Client received invalid JSON")
|
|
||||||
// Ignore
|
|
||||||
}
|
|
||||||
if (!parsed || !parsed.isBudibaseEvent) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Extract data from message
|
|
||||||
const {
|
|
||||||
selectedComponentId,
|
|
||||||
layout,
|
|
||||||
screen,
|
|
||||||
appId,
|
|
||||||
theme,
|
|
||||||
customTheme,
|
|
||||||
previewDevice,
|
|
||||||
navigation,
|
|
||||||
hiddenComponentIds
|
|
||||||
} = parsed
|
|
||||||
|
|
||||||
// Set some flags so the app knows we're in the builder
|
|
||||||
window["##BUDIBASE_IN_BUILDER##"] = true
|
|
||||||
window["##BUDIBASE_APP_ID##"] = appId
|
|
||||||
window["##BUDIBASE_PREVIEW_LAYOUT##"] = layout
|
|
||||||
window["##BUDIBASE_PREVIEW_SCREEN##"] = screen
|
|
||||||
window["##BUDIBASE_SELECTED_COMPONENT_ID##"] = selectedComponentId
|
|
||||||
window["##BUDIBASE_PREVIEW_ID##"] = Math.random()
|
|
||||||
window["##BUDIBASE_PREVIEW_THEME##"] = theme
|
|
||||||
window["##BUDIBASE_PREVIEW_CUSTOM_THEME##"] = customTheme
|
|
||||||
window["##BUDIBASE_PREVIEW_DEVICE##"] = previewDevice
|
|
||||||
window["##BUDIBASE_PREVIEW_NAVIGATION##"] = navigation
|
|
||||||
window["##BUDIBASE_HIDDEN_COMPONENT_IDS##"] = hiddenComponentIds
|
|
||||||
|
|
||||||
// Initialise app
|
|
||||||
try {
|
|
||||||
if (window.loadBudibase) {
|
|
||||||
window.loadBudibase()
|
|
||||||
document.documentElement.classList.add("loaded")
|
|
||||||
} else {
|
|
||||||
throw "The client library couldn't be loaded"
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
window.parent.postMessage({ type: "error", error })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener("message", receiveMessage)
|
|
||||||
window.parent.postMessage({ type: "ready" })
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body/>
|
|
||||||
</html>
|
|
||||||
`
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/cli",
|
"name": "@budibase/cli",
|
||||||
"version": "1.2.44-alpha.0",
|
"version": "1.2.44-alpha.1",
|
||||||
"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": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/client",
|
"name": "@budibase/client",
|
||||||
"version": "1.2.44-alpha.0",
|
"version": "1.2.44-alpha.1",
|
||||||
"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.2.44-alpha.0",
|
"@budibase/bbui": "1.2.44-alpha.1",
|
||||||
"@budibase/frontend-core": "1.2.44-alpha.0",
|
"@budibase/frontend-core": "1.2.44-alpha.1",
|
||||||
"@budibase/string-templates": "1.2.44-alpha.0",
|
"@budibase/string-templates": "1.2.44-alpha.1",
|
||||||
"@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",
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/frontend-core",
|
"name": "@budibase/frontend-core",
|
||||||
"version": "1.2.44-alpha.0",
|
"version": "1.2.44-alpha.1",
|
||||||
"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.2.44-alpha.0",
|
"@budibase/bbui": "1.2.44-alpha.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"svelte": "^3.46.2"
|
"svelte": "^3.46.2"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/server",
|
"name": "@budibase/server",
|
||||||
"email": "hi@budibase.com",
|
"email": "hi@budibase.com",
|
||||||
"version": "1.2.44-alpha.0",
|
"version": "1.2.44-alpha.1",
|
||||||
"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.2.44-alpha.0",
|
"@budibase/backend-core": "1.2.44-alpha.1",
|
||||||
"@budibase/client": "1.2.44-alpha.0",
|
"@budibase/client": "1.2.44-alpha.1",
|
||||||
"@budibase/pro": "1.2.44-alpha.0",
|
"@budibase/pro": "1.2.44-alpha.1",
|
||||||
"@budibase/string-templates": "1.2.44-alpha.0",
|
"@budibase/string-templates": "1.2.44-alpha.1",
|
||||||
"@budibase/types": "1.2.44-alpha.0",
|
"@budibase/types": "1.2.44-alpha.1",
|
||||||
"@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",
|
||||||
|
|
|
@ -128,6 +128,22 @@ export const serveApp = async function (ctx: any) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const serveBuilderPreview = async function (ctx: any) {
|
||||||
|
const db = getAppDB({ skip_setup: true })
|
||||||
|
const appInfo = await db.get(DocumentType.APP_METADATA)
|
||||||
|
|
||||||
|
if (!env.isJest()) {
|
||||||
|
let appId = getAppId()
|
||||||
|
const previewHbs = loadHandlebarsFile(`${__dirname}/templates/preview.hbs`)
|
||||||
|
ctx.body = await processString(previewHbs, {
|
||||||
|
clientLibPath: clientLibraryPath(appId, appInfo.version, ctx),
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// just return the app info for jest to assert on
|
||||||
|
ctx.body = { ...appInfo, builderPreview: true }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export const serveClientLibrary = async function (ctx: any) {
|
export const serveClientLibrary = async function (ctx: any) {
|
||||||
return send(ctx, "budibase-client.js", {
|
return send(ctx, "budibase-client.js", {
|
||||||
root: join(NODE_MODULES_PATH, "@budibase", "client", "dist"),
|
root: join(NODE_MODULES_PATH, "@budibase", "client", "dist"),
|
||||||
|
|
103
packages/server/src/api/controllers/static/templates/preview.hbs
Normal file
103
packages/server/src/api/controllers/static/templates/preview.hbs
Normal file
|
@ -0,0 +1,103 @@
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>Budibase Builder Preview</title>
|
||||||
|
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
||||||
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
|
<link
|
||||||
|
href="https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
|
<style>
|
||||||
|
html, body {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
html {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: stretch;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
*,
|
||||||
|
*:before,
|
||||||
|
*:after {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script src='{{ clientLibPath }}'></script>
|
||||||
|
<script>
|
||||||
|
function receiveMessage(event) {
|
||||||
|
if (!event.data) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse received message
|
||||||
|
// If parsing fails, just ignore and wait for the next message
|
||||||
|
let parsed
|
||||||
|
try {
|
||||||
|
parsed = JSON.parse(event.data)
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Client received invalid JSON")
|
||||||
|
// Ignore
|
||||||
|
}
|
||||||
|
if (!parsed || !parsed.isBudibaseEvent) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Extract data from message
|
||||||
|
const {
|
||||||
|
selectedComponentId,
|
||||||
|
layout,
|
||||||
|
screen,
|
||||||
|
appId,
|
||||||
|
theme,
|
||||||
|
customTheme,
|
||||||
|
previewDevice,
|
||||||
|
navigation,
|
||||||
|
hiddenComponentIds
|
||||||
|
} = parsed
|
||||||
|
|
||||||
|
// Set some flags so the app knows we're in the builder
|
||||||
|
window["##BUDIBASE_IN_BUILDER##"] = true
|
||||||
|
window["##BUDIBASE_APP_ID##"] = appId
|
||||||
|
window["##BUDIBASE_PREVIEW_LAYOUT##"] = layout
|
||||||
|
window["##BUDIBASE_PREVIEW_SCREEN##"] = screen
|
||||||
|
window["##BUDIBASE_SELECTED_COMPONENT_ID##"] = selectedComponentId
|
||||||
|
window["##BUDIBASE_PREVIEW_ID##"] = Math.random()
|
||||||
|
window["##BUDIBASE_PREVIEW_THEME##"] = theme
|
||||||
|
window["##BUDIBASE_PREVIEW_CUSTOM_THEME##"] = customTheme
|
||||||
|
window["##BUDIBASE_PREVIEW_DEVICE##"] = previewDevice
|
||||||
|
window["##BUDIBASE_PREVIEW_NAVIGATION##"] = navigation
|
||||||
|
window["##BUDIBASE_HIDDEN_COMPONENT_IDS##"] = hiddenComponentIds
|
||||||
|
|
||||||
|
// Initialise app
|
||||||
|
try {
|
||||||
|
if (window.loadBudibase) {
|
||||||
|
window.loadBudibase()
|
||||||
|
document.documentElement.classList.add("loaded")
|
||||||
|
} else {
|
||||||
|
throw "The client library couldn't be loaded"
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
window.parent.postMessage({ type: "error", error })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("message", receiveMessage)
|
||||||
|
window.parent.postMessage({ type: "ready" })
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body></body>
|
||||||
|
</html>
|
|
@ -56,6 +56,7 @@ router
|
||||||
authorized(PermissionTypes.TABLE, PermissionLevels.WRITE),
|
authorized(PermissionTypes.TABLE, PermissionLevels.WRITE),
|
||||||
controller.deleteObjects
|
controller.deleteObjects
|
||||||
)
|
)
|
||||||
|
.get("/preview", authorized(BUILDER), controller.serveBuilderPreview)
|
||||||
.get("/:appId/:path*", controller.serveApp)
|
.get("/:appId/:path*", controller.serveApp)
|
||||||
.get("/app/:appUrl/:path*", controller.serveApp)
|
.get("/app/:appUrl/:path*", controller.serveApp)
|
||||||
.post(
|
.post(
|
||||||
|
|
|
@ -40,7 +40,6 @@ describe("/static", () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("/app", () => {
|
describe("/app", () => {
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.clearAllMocks()
|
jest.clearAllMocks()
|
||||||
})
|
})
|
||||||
|
@ -60,7 +59,7 @@ describe("/static", () => {
|
||||||
it("should serve the app by url", async () => {
|
it("should serve the app by url", async () => {
|
||||||
const headers = config.defaultHeaders()
|
const headers = config.defaultHeaders()
|
||||||
delete headers[constants.Headers.APP_ID]
|
delete headers[constants.Headers.APP_ID]
|
||||||
|
|
||||||
const res = await request
|
const res = await request
|
||||||
.get(`/app${config.prodApp.url}`)
|
.get(`/app${config.prodApp.url}`)
|
||||||
.set(headers)
|
.set(headers)
|
||||||
|
@ -82,7 +81,7 @@ describe("/static", () => {
|
||||||
describe("/attachments", () => {
|
describe("/attachments", () => {
|
||||||
describe("generateSignedUrls", () => {
|
describe("generateSignedUrls", () => {
|
||||||
let datasource
|
let datasource
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
datasource = await config.createDatasource({
|
datasource = await config.createDatasource({
|
||||||
datasource: {
|
datasource: {
|
||||||
|
@ -93,7 +92,7 @@ describe("/static", () => {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should be able to generate a signed upload URL", async () => {
|
it("should be able to generate a signed upload URL", async () => {
|
||||||
const bucket = "foo"
|
const bucket = "foo"
|
||||||
const key = "bar"
|
const key = "bar"
|
||||||
|
@ -108,7 +107,7 @@ describe("/static", () => {
|
||||||
`https://${bucket}.s3.eu-west-1.amazonaws.com/${key}`
|
`https://${bucket}.s3.eu-west-1.amazonaws.com/${key}`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should handle an invalid datasource ID", async () => {
|
it("should handle an invalid datasource ID", async () => {
|
||||||
const res = await request
|
const res = await request
|
||||||
.post(`/api/attachments/foo/url`)
|
.post(`/api/attachments/foo/url`)
|
||||||
|
@ -123,7 +122,7 @@ describe("/static", () => {
|
||||||
"The specified datasource could not be found"
|
"The specified datasource could not be found"
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should require a bucket parameter", async () => {
|
it("should require a bucket parameter", async () => {
|
||||||
const res = await request
|
const res = await request
|
||||||
.post(`/api/attachments/${datasource._id}/url`)
|
.post(`/api/attachments/${datasource._id}/url`)
|
||||||
|
@ -136,7 +135,7 @@ describe("/static", () => {
|
||||||
.expect(400)
|
.expect(400)
|
||||||
expect(res.body.message).toEqual("bucket and key values are required")
|
expect(res.body.message).toEqual("bucket and key values are required")
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should require a key parameter", async () => {
|
it("should require a key parameter", async () => {
|
||||||
const res = await request
|
const res = await request
|
||||||
.post(`/api/attachments/${datasource._id}/url`)
|
.post(`/api/attachments/${datasource._id}/url`)
|
||||||
|
@ -151,4 +150,17 @@ describe("/static", () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe("/preview", () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.clearAllMocks()
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should serve the builder preview", async () => {
|
||||||
|
const headers = config.defaultHeaders()
|
||||||
|
const res = await request.get(`/preview`).set(headers).expect(200)
|
||||||
|
|
||||||
|
expect(res.body.appId).toBe(config.appId)
|
||||||
|
expect(res.body.builderPreview).toBe(true)
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -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@1.2.44-alpha.0":
|
"@budibase/backend-core@1.2.44-alpha.1":
|
||||||
version "1.2.44-alpha.0"
|
version "1.2.44-alpha.1"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.44-alpha.0.tgz#5fa2161c43e0686ab4b71a6e4a7689e19f28f050"
|
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.44-alpha.1.tgz#255c8550302ea0d4b10b231519e12021d008ad33"
|
||||||
integrity sha512-6d+lTxjHM5/awdlEqJojA3PybWYFEwo1UXg2WG8Rk4dB4s3v/1QAMdlbX7rSX2BZyojYwZFiPzellJpTH/44qg==
|
integrity sha512-9ceN00ioBD5iUc2Wbcs9Pyvh5gaSfkg1v4Qn9QdRwAG36eo3XVK8kiYWF0q0hkzgcTViJw6xq/1jqMa2InKv6g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/types" "1.2.44-alpha.0"
|
"@budibase/types" "1.2.44-alpha.1"
|
||||||
"@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"
|
||||||
|
@ -1178,13 +1178,13 @@
|
||||||
svelte-flatpickr "^3.2.3"
|
svelte-flatpickr "^3.2.3"
|
||||||
svelte-portal "^1.0.0"
|
svelte-portal "^1.0.0"
|
||||||
|
|
||||||
"@budibase/pro@1.2.44-alpha.0":
|
"@budibase/pro@1.2.44-alpha.1":
|
||||||
version "1.2.44-alpha.0"
|
version "1.2.44-alpha.1"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.44-alpha.0.tgz#7722dd571befe5663c27a36a4d63ec9ea96fa3e4"
|
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.44-alpha.1.tgz#d9e919b1df96f3d3d5cf37753721d41348279f59"
|
||||||
integrity sha512-pxlIkrntNhmXC7dcsCvJNxtUXPH2K8M5WyjpD4hdjbm5JbRhRilCR5fRciKKjMYa8pLupOd8P7K/qcB+C/qvsw==
|
integrity sha512-KaclS4qv4+hWenvuVwF2HxcPWkrDyR7IVyLKLMVUqCnaMoXMvEOe9KuQ+lXLbsLIBsCsCFkzE/WHsdmoaGqa0g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/backend-core" "1.2.44-alpha.0"
|
"@budibase/backend-core" "1.2.44-alpha.1"
|
||||||
"@budibase/types" "1.2.44-alpha.0"
|
"@budibase/types" "1.2.44-alpha.1"
|
||||||
"@koa/router" "8.0.8"
|
"@koa/router" "8.0.8"
|
||||||
joi "17.6.0"
|
joi "17.6.0"
|
||||||
node-fetch "^2.6.1"
|
node-fetch "^2.6.1"
|
||||||
|
@ -1207,10 +1207,10 @@
|
||||||
svelte-apexcharts "^1.0.2"
|
svelte-apexcharts "^1.0.2"
|
||||||
svelte-flatpickr "^3.1.0"
|
svelte-flatpickr "^3.1.0"
|
||||||
|
|
||||||
"@budibase/types@1.2.44-alpha.0":
|
"@budibase/types@1.2.44-alpha.1":
|
||||||
version "1.2.44-alpha.0"
|
version "1.2.44-alpha.1"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.44-alpha.0.tgz#350b51e961c5c3c25febe421c35e5f05e6cc6102"
|
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.44-alpha.1.tgz#6150d4494326438b46dd7354e5dd0fc7fdbfcc49"
|
||||||
integrity sha512-gM4WM+BQa1UZeV4TKnhQndAwTgpYBXLePichuOw0kehTY5xu96dACtVfMDlHFIANdv701dDzi+Zr/T27sKpS4Q==
|
integrity sha512-1eLGH5ym4oYbuRZRkD0slNqHlZ1EV0JHLkmoA47i7L/u8E8QRIyDIHyeZKC8ben33oQS4NX3IebD7zZ2JFhgcA==
|
||||||
|
|
||||||
"@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": "1.2.44-alpha.0",
|
"version": "1.2.44-alpha.1",
|
||||||
"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",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/types",
|
"name": "@budibase/types",
|
||||||
"version": "1.2.44-alpha.0",
|
"version": "1.2.44-alpha.1",
|
||||||
"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": "1.2.44-alpha.0",
|
"version": "1.2.44-alpha.1",
|
||||||
"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.2.44-alpha.0",
|
"@budibase/backend-core": "1.2.44-alpha.1",
|
||||||
"@budibase/pro": "1.2.44-alpha.0",
|
"@budibase/pro": "1.2.44-alpha.1",
|
||||||
"@budibase/string-templates": "1.2.44-alpha.0",
|
"@budibase/string-templates": "1.2.44-alpha.1",
|
||||||
"@budibase/types": "1.2.44-alpha.0",
|
"@budibase/types": "1.2.44-alpha.1",
|
||||||
"@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@1.2.44-alpha.0":
|
"@budibase/backend-core@1.2.44-alpha.1":
|
||||||
version "1.2.44-alpha.0"
|
version "1.2.44-alpha.1"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.44-alpha.0.tgz#5fa2161c43e0686ab4b71a6e4a7689e19f28f050"
|
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.2.44-alpha.1.tgz#255c8550302ea0d4b10b231519e12021d008ad33"
|
||||||
integrity sha512-6d+lTxjHM5/awdlEqJojA3PybWYFEwo1UXg2WG8Rk4dB4s3v/1QAMdlbX7rSX2BZyojYwZFiPzellJpTH/44qg==
|
integrity sha512-9ceN00ioBD5iUc2Wbcs9Pyvh5gaSfkg1v4Qn9QdRwAG36eo3XVK8kiYWF0q0hkzgcTViJw6xq/1jqMa2InKv6g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/types" "1.2.44-alpha.0"
|
"@budibase/types" "1.2.44-alpha.1"
|
||||||
"@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"
|
||||||
|
@ -325,21 +325,21 @@
|
||||||
uuid "8.3.2"
|
uuid "8.3.2"
|
||||||
zlib "1.0.5"
|
zlib "1.0.5"
|
||||||
|
|
||||||
"@budibase/pro@1.2.44-alpha.0":
|
"@budibase/pro@1.2.44-alpha.1":
|
||||||
version "1.2.44-alpha.0"
|
version "1.2.44-alpha.1"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.44-alpha.0.tgz#7722dd571befe5663c27a36a4d63ec9ea96fa3e4"
|
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.2.44-alpha.1.tgz#d9e919b1df96f3d3d5cf37753721d41348279f59"
|
||||||
integrity sha512-pxlIkrntNhmXC7dcsCvJNxtUXPH2K8M5WyjpD4hdjbm5JbRhRilCR5fRciKKjMYa8pLupOd8P7K/qcB+C/qvsw==
|
integrity sha512-KaclS4qv4+hWenvuVwF2HxcPWkrDyR7IVyLKLMVUqCnaMoXMvEOe9KuQ+lXLbsLIBsCsCFkzE/WHsdmoaGqa0g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/backend-core" "1.2.44-alpha.0"
|
"@budibase/backend-core" "1.2.44-alpha.1"
|
||||||
"@budibase/types" "1.2.44-alpha.0"
|
"@budibase/types" "1.2.44-alpha.1"
|
||||||
"@koa/router" "8.0.8"
|
"@koa/router" "8.0.8"
|
||||||
joi "17.6.0"
|
joi "17.6.0"
|
||||||
node-fetch "^2.6.1"
|
node-fetch "^2.6.1"
|
||||||
|
|
||||||
"@budibase/types@1.2.44-alpha.0":
|
"@budibase/types@1.2.44-alpha.1":
|
||||||
version "1.2.44-alpha.0"
|
version "1.2.44-alpha.1"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.44-alpha.0.tgz#350b51e961c5c3c25febe421c35e5f05e6cc6102"
|
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.2.44-alpha.1.tgz#6150d4494326438b46dd7354e5dd0fc7fdbfcc49"
|
||||||
integrity sha512-gM4WM+BQa1UZeV4TKnhQndAwTgpYBXLePichuOw0kehTY5xu96dACtVfMDlHFIANdv701dDzi+Zr/T27sKpS4Q==
|
integrity sha512-1eLGH5ym4oYbuRZRkD0slNqHlZ1EV0JHLkmoA47i7L/u8E8QRIyDIHyeZKC8ben33oQS4NX3IebD7zZ2JFhgcA==
|
||||||
|
|
||||||
"@cspotcode/source-map-consumer@0.8.0":
|
"@cspotcode/source-map-consumer@0.8.0":
|
||||||
version "0.8.0"
|
version "0.8.0"
|
||||||
|
|
Loading…
Reference in a new issue