Merge branch 'develop' into cypress-testing
This commit is contained in:
commit
a49994a9e1
|
@ -7,6 +7,7 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- develop
|
- develop
|
||||||
|
- new-design-ui
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
@ -59,3 +60,19 @@ jobs:
|
||||||
with:
|
with:
|
||||||
install: false
|
install: false
|
||||||
command: yarn test:e2e:ci
|
command: yarn test:e2e:ci
|
||||||
|
|
||||||
|
- name: Configure AWS Credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
|
with:
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws-region: eu-west-1
|
||||||
|
|
||||||
|
- name: Upload to S3
|
||||||
|
if: github.ref == 'refs/heads/new-design-ui'
|
||||||
|
run: |
|
||||||
|
tar -czvf new_ui.tar.gz packages/server/assets packages/server/index.html
|
||||||
|
aws s3 cp new_ui.tar.gz s3://prod-budi-app-assets/beta:design_ui/
|
||||||
|
aws s3 cp packages/client/dist/budibase-client.js s3://prod-budi-app-assets/beta:design_ui/budibase-client.js
|
||||||
|
aws cloudfront create-invalidation --distribution-id E3ELKP4RCEHVLW --paths "/beta:design_ui/*"
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ globals:
|
||||||
google:
|
google:
|
||||||
clientId: ""
|
clientId: ""
|
||||||
secret: ""
|
secret: ""
|
||||||
automationMaxIterations: "500"
|
automationMaxIterations: "200"
|
||||||
|
|
||||||
createSecrets: true # creates an internal API key, JWT secrets and redis password for you
|
createSecrets: true # creates an internal API key, JWT secrets and redis password for you
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "1.0.212-alpha.0",
|
"version": "1.0.212-alpha.2",
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/backend-core",
|
"name": "@budibase/backend-core",
|
||||||
"version": "1.0.212-alpha.0",
|
"version": "1.0.212-alpha.2",
|
||||||
"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.0.212-alpha.0",
|
"@budibase/types": "^1.0.212-alpha.2",
|
||||||
"@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",
|
||||||
|
|
|
@ -294,6 +294,16 @@ export const uploadDirectory = async (
|
||||||
await Promise.all(uploads)
|
await Promise.all(uploads)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.downloadTarballDirect = async (url: string, path: string) => {
|
||||||
|
path = sanitizeKey(path)
|
||||||
|
const response = await fetch(url)
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`unexpected response ${response.statusText}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
await streamPipeline(response.body, zlib.Unzip(), tar.extract(path))
|
||||||
|
}
|
||||||
|
|
||||||
export const downloadTarball = async (url: any, bucketName: any, path: any) => {
|
export const downloadTarball = async (url: any, bucketName: any, path: any) => {
|
||||||
bucketName = sanitizeBucket(bucketName)
|
bucketName = sanitizeBucket(bucketName)
|
||||||
path = sanitizeKey(path)
|
path = sanitizeKey(path)
|
||||||
|
|
|
@ -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.0.212-alpha.0",
|
"version": "1.0.212-alpha.2",
|
||||||
"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.0.212-alpha.0",
|
"@budibase/string-templates": "^1.0.212-alpha.2",
|
||||||
"@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.0.212-alpha.0",
|
"version": "1.0.212-alpha.2",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -69,10 +69,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/bbui": "^1.0.212-alpha.0",
|
"@budibase/bbui": "^1.0.212-alpha.2",
|
||||||
"@budibase/client": "^1.0.212-alpha.0",
|
"@budibase/client": "^1.0.212-alpha.2",
|
||||||
"@budibase/frontend-core": "^1.0.212-alpha.0",
|
"@budibase/frontend-core": "^1.0.212-alpha.2",
|
||||||
"@budibase/string-templates": "^1.0.212-alpha.0",
|
"@budibase/string-templates": "^1.0.212-alpha.2",
|
||||||
"@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",
|
||||||
|
|
|
@ -1,7 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
import { store, automationStore } from "builderStore"
|
import { store, automationStore } from "builderStore"
|
||||||
import { roles, flags } from "stores/backend"
|
import { roles, flags } from "stores/backend"
|
||||||
import { Icon, ActionGroup, Tabs, Tab, notifications } from "@budibase/bbui"
|
import {
|
||||||
|
Icon,
|
||||||
|
ActionGroup,
|
||||||
|
Tabs,
|
||||||
|
Tab,
|
||||||
|
notifications,
|
||||||
|
Banner,
|
||||||
|
} from "@budibase/bbui"
|
||||||
import RevertModal from "components/deploy/RevertModal.svelte"
|
import RevertModal from "components/deploy/RevertModal.svelte"
|
||||||
import VersionModal from "components/deploy/VersionModal.svelte"
|
import VersionModal from "components/deploy/VersionModal.svelte"
|
||||||
import DeployNavigation from "components/deploy/DeployNavigation.svelte"
|
import DeployNavigation from "components/deploy/DeployNavigation.svelte"
|
||||||
|
@ -17,6 +24,7 @@
|
||||||
|
|
||||||
// Get Package and set store
|
// Get Package and set store
|
||||||
let promise = getPackage()
|
let promise = getPackage()
|
||||||
|
let betaAccess = false
|
||||||
|
|
||||||
// Sync once when you load the app
|
// Sync once when you load the app
|
||||||
let hasSynced = false
|
let hasSynced = false
|
||||||
|
@ -58,10 +66,18 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function newDesignUi() {
|
||||||
|
await flags.toggleUiFeature("design_ui")
|
||||||
|
window.location.reload()
|
||||||
|
}
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
if (!hasSynced && application) {
|
if (!hasSynced && application) {
|
||||||
try {
|
try {
|
||||||
await API.syncApp(application)
|
await API.syncApp(application)
|
||||||
|
// check if user has beta access
|
||||||
|
const betaResponse = await API.checkBetaAccess($auth?.user?.email)
|
||||||
|
betaAccess = betaResponse.access
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
notifications.error("Failed to sync with production database")
|
notifications.error("Failed to sync with production database")
|
||||||
}
|
}
|
||||||
|
@ -79,6 +95,15 @@
|
||||||
<div class="loading" />
|
<div class="loading" />
|
||||||
{:then _}
|
{:then _}
|
||||||
<div class="root">
|
<div class="root">
|
||||||
|
{#if betaAccess}
|
||||||
|
<Banner
|
||||||
|
extraButtonText="Try New UI (Beta)"
|
||||||
|
extraButtonAction={newDesignUi}
|
||||||
|
>
|
||||||
|
Try the <b>all new</b> budibase design interface. (Not recommended for existing
|
||||||
|
budibase apps)
|
||||||
|
</Banner>
|
||||||
|
{/if}
|
||||||
<div class="top-nav">
|
<div class="top-nav">
|
||||||
<div class="topleftnav">
|
<div class="topleftnav">
|
||||||
<button class="home-logo">
|
<button class="home-logo">
|
||||||
|
|
|
@ -16,6 +16,9 @@ export function createFlagsStore() {
|
||||||
})
|
})
|
||||||
await actions.fetch()
|
await actions.fetch()
|
||||||
},
|
},
|
||||||
|
toggleUiFeature: async feature => {
|
||||||
|
await API.toggleUiFeature({ value: feature })
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -32,6 +32,9 @@ export default ({ mode }) => {
|
||||||
process.env.INTERCOM_TOKEN
|
process.env.INTERCOM_TOKEN
|
||||||
),
|
),
|
||||||
"process.env.SENTRY_DSN": JSON.stringify(process.env.SENTRY_DSN),
|
"process.env.SENTRY_DSN": JSON.stringify(process.env.SENTRY_DSN),
|
||||||
|
"process.env.FEATURE_PREVIEW_URL": JSON.stringify(
|
||||||
|
process.env.FEATURE_PREVIEW_URL
|
||||||
|
),
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/cli",
|
"name": "@budibase/cli",
|
||||||
"version": "1.0.212-alpha.0",
|
"version": "1.0.212-alpha.2",
|
||||||
"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.0.212-alpha.0",
|
"version": "1.0.212-alpha.2",
|
||||||
"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.0.212-alpha.0",
|
"@budibase/bbui": "^1.0.212-alpha.2",
|
||||||
"@budibase/frontend-core": "^1.0.212-alpha.0",
|
"@budibase/frontend-core": "^1.0.212-alpha.2",
|
||||||
"@budibase/string-templates": "^1.0.212-alpha.0",
|
"@budibase/string-templates": "^1.0.212-alpha.2",
|
||||||
"@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.0.212-alpha.0",
|
"version": "1.0.212-alpha.2",
|
||||||
"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.0.212-alpha.0",
|
"@budibase/bbui": "^1.0.212-alpha.2",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"svelte": "^3.46.2"
|
"svelte": "^3.46.2"
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,4 +22,13 @@ export const buildFlagEndpoints = API => ({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Allows us to experimentally toggle a beta UI feature through a cookie.
|
||||||
|
* @param value the feature to toggle
|
||||||
|
*/
|
||||||
|
toggleUiFeature: async ({ value }) => {
|
||||||
|
return await API.post({
|
||||||
|
url: `/api/beta/${value}`,
|
||||||
|
})
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
|
@ -54,4 +54,13 @@ export const buildOtherEndpoints = API => ({
|
||||||
url: "/api/permission/builtin",
|
url: "/api/permission/builtin",
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if they are part of the budibase beta program.
|
||||||
|
*/
|
||||||
|
checkBetaAccess: async email => {
|
||||||
|
return await API.get({
|
||||||
|
url: `${process.env.FEATURE_PREVIEW_URL}/api/beta/access?email=${email}`,
|
||||||
|
})
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,6 +2,7 @@ node_modules/
|
||||||
myapps/
|
myapps/
|
||||||
.env
|
.env
|
||||||
builder/*
|
builder/*
|
||||||
|
new_design_ui/*
|
||||||
client/*
|
client/*
|
||||||
db/dev.db/
|
db/dev.db/
|
||||||
dist
|
dist
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/server",
|
"name": "@budibase/server",
|
||||||
"email": "hi@budibase.com",
|
"email": "hi@budibase.com",
|
||||||
"version": "1.0.212-alpha.0",
|
"version": "1.0.212-alpha.2",
|
||||||
"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.0.212-alpha.0",
|
"@budibase/backend-core": "^1.0.212-alpha.2",
|
||||||
"@budibase/client": "^1.0.212-alpha.0",
|
"@budibase/client": "^1.0.212-alpha.2",
|
||||||
"@budibase/pro": "1.0.212-alpha.0",
|
"@budibase/pro": "1.0.212-alpha.2",
|
||||||
"@budibase/string-templates": "^1.0.212-alpha.0",
|
"@budibase/string-templates": "^1.0.212-alpha.2",
|
||||||
"@budibase/types": "^1.0.212-alpha.0",
|
"@budibase/types": "^1.0.212-alpha.2",
|
||||||
"@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",
|
||||||
|
|
|
@ -227,7 +227,11 @@ export const fetchAppPackage = async (ctx: any) => {
|
||||||
application,
|
application,
|
||||||
screens,
|
screens,
|
||||||
layouts,
|
layouts,
|
||||||
clientLibPath: clientLibraryPath(ctx.params.appId, application.version),
|
clientLibPath: clientLibraryPath(
|
||||||
|
ctx.params.appId,
|
||||||
|
application.version,
|
||||||
|
ctx
|
||||||
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,12 @@ const env = require("../../environment")
|
||||||
const { checkSlashesInUrl } = require("../../utilities")
|
const { checkSlashesInUrl } = require("../../utilities")
|
||||||
const { request } = require("../../utilities/workerRequests")
|
const { request } = require("../../utilities/workerRequests")
|
||||||
const { clearLock } = require("../../utilities/redis")
|
const { clearLock } = require("../../utilities/redis")
|
||||||
const { Replication, getProdAppID } = require("@budibase/backend-core/db")
|
const {
|
||||||
const { DocumentTypes } = require("../../db/utils")
|
Replication,
|
||||||
|
getProdAppID,
|
||||||
|
dangerousGetDB,
|
||||||
|
} = require("@budibase/backend-core/db")
|
||||||
|
const { DocumentTypes, getRowParams } = require("../../db/utils")
|
||||||
const { app: appCache } = require("@budibase/backend-core/cache")
|
const { app: appCache } = require("@budibase/backend-core/cache")
|
||||||
const { getProdAppDB, getAppDB } = require("@budibase/backend-core/context")
|
const { getProdAppDB, getAppDB } = require("@budibase/backend-core/context")
|
||||||
const { events } = require("@budibase/backend-core")
|
const { events } = require("@budibase/backend-core")
|
||||||
|
@ -133,3 +137,32 @@ exports.getBudibaseVersion = async ctx => {
|
||||||
}
|
}
|
||||||
await events.installation.versionChecked(version)
|
await events.installation.versionChecked(version)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: remove as part of beta program
|
||||||
|
exports.checkBetaAccess = async ctx => {
|
||||||
|
const userToCheck = ctx.query.email
|
||||||
|
const BETA_USERS_DB = "app_bb_f9b77d06b9db4e3ca185476ab87a2364"
|
||||||
|
const BETA_USERS_TABLE = "ta_8c2c6df1c03f49cfb6340e85e066dd15"
|
||||||
|
|
||||||
|
try {
|
||||||
|
const db = dangerousGetDB(BETA_USERS_DB)
|
||||||
|
const betaUsers = (
|
||||||
|
await db.allDocs(
|
||||||
|
getRowParams(BETA_USERS_TABLE, null, {
|
||||||
|
include_docs: true,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
).rows.map(row => row.doc)
|
||||||
|
|
||||||
|
let access = false
|
||||||
|
for (let betaUser of betaUsers) {
|
||||||
|
if (betaUser["Email address"].trim() === userToCheck) {
|
||||||
|
access = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ctx.body = { access }
|
||||||
|
} catch (err) {
|
||||||
|
ctx.body = { access: false }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -16,9 +16,15 @@ const { upload } = require("../../../utilities/fileSystem")
|
||||||
const { attachmentsRelativeURL } = require("../../../utilities")
|
const { attachmentsRelativeURL } = require("../../../utilities")
|
||||||
const { DocumentTypes, isDevAppID } = require("../../../db/utils")
|
const { DocumentTypes, isDevAppID } = require("../../../db/utils")
|
||||||
const { getAppDB, getAppId } = require("@budibase/backend-core/context")
|
const { getAppDB, getAppId } = require("@budibase/backend-core/context")
|
||||||
|
const { setCookie, clearCookie } = require("@budibase/backend-core/utils")
|
||||||
const AWS = require("aws-sdk")
|
const AWS = require("aws-sdk")
|
||||||
const { events } = require("@budibase/backend-core")
|
const { events } = require("@budibase/backend-core")
|
||||||
|
|
||||||
|
const fs = require("fs")
|
||||||
|
const {
|
||||||
|
downloadTarballDirect,
|
||||||
|
} = require("../../../utilities/fileSystem/utilities")
|
||||||
|
|
||||||
async function prepareUpload({ s3Key, bucket, metadata, file }) {
|
async function prepareUpload({ s3Key, bucket, metadata, file }) {
|
||||||
const response = await upload({
|
const response = await upload({
|
||||||
bucket,
|
bucket,
|
||||||
|
@ -38,8 +44,41 @@ async function prepareUpload({ s3Key, bucket, metadata, file }) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.toggleBetaUiFeature = async function (ctx) {
|
||||||
|
const cookieName = `beta:${ctx.params.feature}`
|
||||||
|
|
||||||
|
if (ctx.cookies.get(cookieName)) {
|
||||||
|
clearCookie(ctx, cookieName)
|
||||||
|
ctx.body = {
|
||||||
|
message: `${ctx.params.feature} disabled`,
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let builderPath = resolve(TOP_LEVEL_PATH, "new_design_ui")
|
||||||
|
|
||||||
|
// // download it from S3
|
||||||
|
if (!fs.existsSync(builderPath)) {
|
||||||
|
fs.mkdirSync(builderPath)
|
||||||
|
}
|
||||||
|
await downloadTarballDirect(
|
||||||
|
"https://cdn.budi.live/beta:design_ui/new_ui.tar.gz",
|
||||||
|
builderPath
|
||||||
|
)
|
||||||
|
setCookie(ctx, {}, cookieName)
|
||||||
|
|
||||||
|
ctx.body = {
|
||||||
|
message: `${ctx.params.feature} enabled`,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
exports.serveBuilder = async function (ctx) {
|
exports.serveBuilder = async function (ctx) {
|
||||||
let builderPath = resolve(TOP_LEVEL_PATH, "builder")
|
// Temporary: New Design UI
|
||||||
|
const designUiCookie = ctx.cookies.get("beta:design_ui")
|
||||||
|
// TODO: get this from the tmp Dir that we downloaded from MinIO
|
||||||
|
const uiPath = designUiCookie ? "new_design_ui" : "builder"
|
||||||
|
|
||||||
|
let builderPath = resolve(TOP_LEVEL_PATH, uiPath)
|
||||||
await send(ctx, ctx.file, { root: builderPath })
|
await send(ctx, ctx.file, { root: builderPath })
|
||||||
if (!ctx.file.includes("assets/")) {
|
if (!ctx.file.includes("assets/")) {
|
||||||
await events.serve.servedBuilder()
|
await events.serve.servedBuilder()
|
||||||
|
@ -78,7 +117,7 @@ exports.serveApp = async function (ctx) {
|
||||||
title: appInfo.name,
|
title: appInfo.name,
|
||||||
production: env.isProd(),
|
production: env.isProd(),
|
||||||
appId,
|
appId,
|
||||||
clientLibPath: clientLibraryPath(appId, appInfo.version),
|
clientLibPath: clientLibraryPath(appId, appInfo.version, ctx),
|
||||||
})
|
})
|
||||||
|
|
||||||
const appHbs = loadHandlebarsFile(`${__dirname}/templates/app.hbs`)
|
const appHbs = loadHandlebarsFile(`${__dirname}/templates/app.hbs`)
|
||||||
|
|
|
@ -22,5 +22,6 @@ router
|
||||||
.get("/api/dev/version", authorized(BUILDER), controller.getBudibaseVersion)
|
.get("/api/dev/version", authorized(BUILDER), controller.getBudibaseVersion)
|
||||||
.delete("/api/dev/:appId/lock", authorized(BUILDER), controller.clearLock)
|
.delete("/api/dev/:appId/lock", authorized(BUILDER), controller.clearLock)
|
||||||
.post("/api/dev/:appId/revert", authorized(BUILDER), controller.revert)
|
.post("/api/dev/:appId/revert", authorized(BUILDER), controller.revert)
|
||||||
|
.get("/api/beta/access", controller.checkBetaAccess)
|
||||||
|
|
||||||
module.exports = router
|
module.exports = router
|
||||||
|
|
|
@ -38,6 +38,7 @@ router
|
||||||
// TODO: for now this builder endpoint is not authorized/secured, will need to be
|
// TODO: for now this builder endpoint is not authorized/secured, will need to be
|
||||||
.get("/builder/:file*", controller.serveBuilder)
|
.get("/builder/:file*", controller.serveBuilder)
|
||||||
.post("/api/attachments/process", authorized(BUILDER), controller.uploadFile)
|
.post("/api/attachments/process", authorized(BUILDER), controller.uploadFile)
|
||||||
|
.post("/api/beta/:feature", controller.toggleBetaUiFeature)
|
||||||
.post(
|
.post(
|
||||||
"/api/attachments/:tableId/upload",
|
"/api/attachments/:tableId/upload",
|
||||||
paramResource("tableId"),
|
paramResource("tableId"),
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
const { getTable } = require("../api/controllers/table/utils")
|
const { getTable } = require("../api/controllers/table/utils")
|
||||||
const { findHBSBlocks } = require("@budibase/string-templates")
|
const {
|
||||||
|
findHBSBlocks,
|
||||||
|
decodeJSBinding,
|
||||||
|
isJSBinding,
|
||||||
|
encodeJSBinding,
|
||||||
|
} = require("@budibase/string-templates")
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When values are input to the system generally they will be of type string as this is required for template strings.
|
* When values are input to the system generally they will be of type string as this is required for template strings.
|
||||||
|
@ -77,11 +82,21 @@ exports.getError = err => {
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.substituteLoopStep = (hbsString, substitute) => {
|
exports.substituteLoopStep = (hbsString, substitute) => {
|
||||||
let blocks = findHBSBlocks(hbsString)
|
let blocks = []
|
||||||
|
let checkForJS = isJSBinding(hbsString)
|
||||||
|
if (checkForJS) {
|
||||||
|
hbsString = decodeJSBinding(hbsString)
|
||||||
|
blocks.push(hbsString)
|
||||||
|
} else {
|
||||||
|
blocks = findHBSBlocks(hbsString)
|
||||||
|
}
|
||||||
for (let block of blocks) {
|
for (let block of blocks) {
|
||||||
let oldBlock = block
|
|
||||||
block = block.replace(/loop/, substitute)
|
block = block.replace(/loop/, substitute)
|
||||||
hbsString = hbsString.replace(new RegExp(oldBlock, "g"), block)
|
if (checkForJS) {
|
||||||
|
hbsString = encodeJSBinding(block)
|
||||||
|
} else {
|
||||||
|
hbsString = block
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return hbsString
|
return hbsString
|
||||||
|
|
|
@ -67,7 +67,8 @@ module.exports = {
|
||||||
SALT_ROUNDS: process.env.SALT_ROUNDS,
|
SALT_ROUNDS: process.env.SALT_ROUNDS,
|
||||||
LOGGER: process.env.LOGGER,
|
LOGGER: process.env.LOGGER,
|
||||||
LOG_LEVEL: process.env.LOG_LEVEL,
|
LOG_LEVEL: process.env.LOG_LEVEL,
|
||||||
AUTOMATION_MAX_ITERATIONS: process.env.AUTOMATION_MAX_ITERATIONS,
|
AUTOMATION_MAX_ITERATIONS:
|
||||||
|
parseIntSafe(process.env.AUTOMATION_MAX_ITERATIONS) || 200,
|
||||||
SENDGRID_API_KEY: process.env.SENDGRID_API_KEY,
|
SENDGRID_API_KEY: process.env.SENDGRID_API_KEY,
|
||||||
DYNAMO_ENDPOINT: process.env.DYNAMO_ENDPOINT,
|
DYNAMO_ENDPOINT: process.env.DYNAMO_ENDPOINT,
|
||||||
QUERY_THREAD_TIMEOUT: parseIntSafe(process.env.QUERY_THREAD_TIMEOUT),
|
QUERY_THREAD_TIMEOUT: parseIntSafe(process.env.QUERY_THREAD_TIMEOUT),
|
||||||
|
|
|
@ -218,7 +218,7 @@ class Orchestrator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
index === parseInt(env.AUTOMATION_MAX_ITERATIONS) ||
|
index === env.AUTOMATION_MAX_ITERATION ||
|
||||||
index === parseInt(loopStep.inputs.iterations)
|
index === parseInt(loopStep.inputs.iterations)
|
||||||
) {
|
) {
|
||||||
this.updateContextAndOutput(loopStepNumber, step, tempOutput, {
|
this.updateContextAndOutput(loopStepNumber, step, tempOutput, {
|
||||||
|
|
|
@ -9,6 +9,7 @@ const {
|
||||||
deleteFolder,
|
deleteFolder,
|
||||||
uploadDirectory,
|
uploadDirectory,
|
||||||
downloadTarball,
|
downloadTarball,
|
||||||
|
downloadTarballDirect,
|
||||||
} = require("@budibase/backend-core/objectStore")
|
} = require("@budibase/backend-core/objectStore")
|
||||||
|
|
||||||
/***********************************
|
/***********************************
|
||||||
|
@ -29,4 +30,5 @@ exports.retrieveToTmp = retrieveToTmp
|
||||||
exports.deleteFolder = deleteFolder
|
exports.deleteFolder = deleteFolder
|
||||||
exports.uploadDirectory = uploadDirectory
|
exports.uploadDirectory = uploadDirectory
|
||||||
exports.downloadTarball = downloadTarball
|
exports.downloadTarball = downloadTarball
|
||||||
|
exports.downloadTarballDirect = downloadTarballDirect
|
||||||
exports.deleteFiles = deleteFiles
|
exports.deleteFiles = deleteFiles
|
||||||
|
|
|
@ -54,11 +54,17 @@ exports.objectStoreUrl = () => {
|
||||||
* @return {string} The URL to be inserted into appPackage response or server rendered
|
* @return {string} The URL to be inserted into appPackage response or server rendered
|
||||||
* app index file.
|
* app index file.
|
||||||
*/
|
*/
|
||||||
exports.clientLibraryPath = (appId, version) => {
|
exports.clientLibraryPath = (appId, version, ctx) => {
|
||||||
if (env.isProd()) {
|
if (env.isProd()) {
|
||||||
|
// TODO: remove - for beta testing UI
|
||||||
|
if (ctx && ctx.cookies.get("beta:design_ui")) {
|
||||||
|
return "https://cdn.budi.live/beta:design_ui/budibase-client.js"
|
||||||
|
}
|
||||||
|
|
||||||
let url = `${exports.objectStoreUrl()}/${sanitizeKey(
|
let url = `${exports.objectStoreUrl()}/${sanitizeKey(
|
||||||
appId
|
appId
|
||||||
)}/budibase-client.js`
|
)}/budibase-client.js`
|
||||||
|
|
||||||
// append app version to bust the cache
|
// append app version to bust the cache
|
||||||
if (version) {
|
if (version) {
|
||||||
url += `?v=${version}`
|
url += `?v=${version}`
|
||||||
|
|
|
@ -1094,11 +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.0.211":
|
"@budibase/backend-core@1.0.212-alpha.0":
|
||||||
version "1.0.211"
|
version "1.0.212-alpha.0"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.211.tgz#579bcc97acf1df2510e302bb70b43245e5ab0e37"
|
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.212-alpha.0.tgz#6ac3448c8272e918f1af1fff0cf8c5773ae61219"
|
||||||
integrity sha512-ham+Qk6WXQi37Lgnz1Gh/+ItcvCo+dnPZDcVvPESrVxqQkVVIejlxQinZSueIrsgOYHE1j3TUH5zER5M2t6RWw==
|
integrity sha512-hFvbQQEbF3w2u9fe/S+RhNw5HUETS6rhu9q5KDTDQ57k05D4YMPcpMBGSh7SPMqmVyEwUDgcL36mkFOc3AgjYQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
|
"@budibase/types" "^1.0.212-alpha.0"
|
||||||
"@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"
|
||||||
|
@ -1175,12 +1176,12 @@
|
||||||
svelte-flatpickr "^3.2.3"
|
svelte-flatpickr "^3.2.3"
|
||||||
svelte-portal "^1.0.0"
|
svelte-portal "^1.0.0"
|
||||||
|
|
||||||
"@budibase/pro@1.0.211":
|
"@budibase/pro@1.0.212-alpha.0":
|
||||||
version "1.0.211"
|
version "1.0.212-alpha.0"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.211.tgz#d362e9af8c15f6ed386f27b7cca95cc096a91344"
|
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.212-alpha.0.tgz#843f8291fcc0a2fbcb4d857a750bc116cdaee293"
|
||||||
integrity sha512-dfFByJhlTIURT3sXei5mVXq5rczFMM/ij2Scze0uqPZNpmIlWVqiYdGX7/HEcmIFSS0+UfcdBxjCJJlTGiK4/w==
|
integrity sha512-4nhWxjMcxSQBPXRy/U+37IaVLYOr4/RVe79/fUvnXrr5qAeecbEk/QbkJJd3dU1WaNxB2eGhNtH3uBUPQvcT9A==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/backend-core" "1.0.211"
|
"@budibase/backend-core" "1.0.212-alpha.0"
|
||||||
node-fetch "^2.6.1"
|
node-fetch "^2.6.1"
|
||||||
|
|
||||||
"@budibase/standard-components@^0.9.139":
|
"@budibase/standard-components@^0.9.139":
|
||||||
|
@ -1201,6 +1202,11 @@
|
||||||
svelte-apexcharts "^1.0.2"
|
svelte-apexcharts "^1.0.2"
|
||||||
svelte-flatpickr "^3.1.0"
|
svelte-flatpickr "^3.1.0"
|
||||||
|
|
||||||
|
"@budibase/types@^1.0.212-alpha.0":
|
||||||
|
version "1.0.212"
|
||||||
|
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.0.212.tgz#e66a15b711544b4fab7767261fd5f2f1dd7f40d7"
|
||||||
|
integrity sha512-DhGyw6snwJQZQlx7havVYnqPZfZERueKZfmVCBySzwInZZt0+sXZaBl1BVjGjYuwpaUQBMDBf7geBgHXp6DIKg==
|
||||||
|
|
||||||
"@bull-board/api@3.7.0":
|
"@bull-board/api@3.7.0":
|
||||||
version "3.7.0"
|
version "3.7.0"
|
||||||
resolved "https://registry.yarnpkg.com/@bull-board/api/-/api-3.7.0.tgz#231f687187c0cb34e0b97f463917b6aaeb4ef6af"
|
resolved "https://registry.yarnpkg.com/@bull-board/api/-/api-3.7.0.tgz#231f687187c0cb34e0b97f463917b6aaeb4ef6af"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/string-templates",
|
"name": "@budibase/string-templates",
|
||||||
"version": "1.0.212-alpha.0",
|
"version": "1.0.212-alpha.2",
|
||||||
"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.0.212-alpha.0",
|
"version": "1.0.212-alpha.2",
|
||||||
"description": "Budibase types",
|
"description": "Budibase types",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
node_modules
|
||||||
|
npm-debug.log
|
||||||
|
Dockerfile
|
||||||
|
.dockerignore
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/worker",
|
"name": "@budibase/worker",
|
||||||
"email": "hi@budibase.com",
|
"email": "hi@budibase.com",
|
||||||
"version": "1.0.212-alpha.0",
|
"version": "1.0.212-alpha.2",
|
||||||
"description": "Budibase background service",
|
"description": "Budibase background service",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -34,10 +34,10 @@
|
||||||
"author": "Budibase",
|
"author": "Budibase",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/backend-core": "^1.0.212-alpha.0",
|
"@budibase/backend-core": "^1.0.212-alpha.2",
|
||||||
"@budibase/pro": "1.0.212-alpha.0",
|
"@budibase/pro": "1.0.212-alpha.2",
|
||||||
"@budibase/string-templates": "^1.0.212-alpha.0",
|
"@budibase/string-templates": "^1.0.212-alpha.2",
|
||||||
"@budibase/types": "^1.0.212-alpha.0",
|
"@budibase/types": "^1.0.212-alpha.2",
|
||||||
"@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,11 +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.0.207-alpha.3":
|
"@budibase/backend-core@1.0.212-alpha.0":
|
||||||
version "1.0.207-alpha.3"
|
version "1.0.212-alpha.0"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.207-alpha.3.tgz#98bced0575ec4e2b158239a8c73b39ca2d816719"
|
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.212-alpha.0.tgz#6ac3448c8272e918f1af1fff0cf8c5773ae61219"
|
||||||
integrity sha512-DU4X6jJ+DfhzOv4TTa1w4Dk5ZEdlK/z1joCTruT+SGM5qI75bXrGeol5OX2OaEbNKtXFKJ1zeVTmBCYcu7OFUg==
|
integrity sha512-hFvbQQEbF3w2u9fe/S+RhNw5HUETS6rhu9q5KDTDQ57k05D4YMPcpMBGSh7SPMqmVyEwUDgcL36mkFOc3AgjYQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
|
"@budibase/types" "^1.0.212-alpha.0"
|
||||||
"@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"
|
||||||
|
@ -322,14 +323,19 @@
|
||||||
uuid "8.3.2"
|
uuid "8.3.2"
|
||||||
zlib "1.0.5"
|
zlib "1.0.5"
|
||||||
|
|
||||||
"@budibase/pro@1.0.207-alpha.3":
|
"@budibase/pro@1.0.212-alpha.0":
|
||||||
version "1.0.207-alpha.3"
|
version "1.0.212-alpha.0"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.207-alpha.3.tgz#9bde845ceb685f1b43286a124620c21fdf891a01"
|
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.212-alpha.0.tgz#843f8291fcc0a2fbcb4d857a750bc116cdaee293"
|
||||||
integrity sha512-WFEMujpKTVAMvAgLBnMdw8ou9PxsbM4Oa9Dq+DAUsWpPACsMWOProyHLsdRxJyvHlgGfwVjo5MEusvStjI4j6g==
|
integrity sha512-4nhWxjMcxSQBPXRy/U+37IaVLYOr4/RVe79/fUvnXrr5qAeecbEk/QbkJJd3dU1WaNxB2eGhNtH3uBUPQvcT9A==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/backend-core" "1.0.207-alpha.3"
|
"@budibase/backend-core" "1.0.212-alpha.0"
|
||||||
node-fetch "^2.6.1"
|
node-fetch "^2.6.1"
|
||||||
|
|
||||||
|
"@budibase/types@^1.0.212-alpha.0":
|
||||||
|
version "1.0.212"
|
||||||
|
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.0.212.tgz#e66a15b711544b4fab7767261fd5f2f1dd7f40d7"
|
||||||
|
integrity sha512-DhGyw6snwJQZQlx7havVYnqPZfZERueKZfmVCBySzwInZZt0+sXZaBl1BVjGjYuwpaUQBMDBf7geBgHXp6DIKg==
|
||||||
|
|
||||||
"@cspotcode/source-map-consumer@0.8.0":
|
"@cspotcode/source-map-consumer@0.8.0":
|
||||||
version "0.8.0"
|
version "0.8.0"
|
||||||
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz#33bf4b7b39c178821606f669bbc447a6a629786b"
|
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz#33bf4b7b39c178821606f669bbc447a6a629786b"
|
||||||
|
|
Loading…
Reference in New Issue