Merge branch 'master' of github.com:Budibase/budibase into develop
This commit is contained in:
commit
5414fde7ee
|
@ -66,7 +66,7 @@ jobs:
|
||||||
config-files: values.production.yaml
|
config-files: values.production.yaml
|
||||||
chart-path: charts/budibase
|
chart-path: charts/budibase
|
||||||
namespace: budibase
|
namespace: budibase
|
||||||
values: globals.appVersion=v${{ env.RELEASE_VERSION }}
|
values: globals.appVersion=v${{ env.RELEASE_VERSION }},services.couchdb.url=${{ secrets.PRODUCTION_COUCHDB_URL }},services.couchdb.password=${{ secrets.PRODUCTION_COUCHDB_PASSWORD }}
|
||||||
name: budibase-prod
|
name: budibase-prod
|
||||||
|
|
||||||
- name: Discord Webhook Action
|
- name: Discord Webhook Action
|
||||||
|
|
|
@ -12,10 +12,8 @@ spec:
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: {{ .Values.services.objectStore.storage }}
|
storage: {{ .Values.services.objectStore.storage }}
|
||||||
{{- if (eq "-" .Values.services.objectStore.storageClass) }}
|
{{ if .Values.services.objectStore.storageClass }}
|
||||||
storageClassName: ""
|
storageClassName: {{ .Values.services.objectStore.storageClass }}
|
||||||
{{- else }}
|
|
||||||
storageClassName: "{{ .Values.services.objectStore.storageClass }}"
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
status: {}
|
status: {}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -12,10 +12,8 @@ spec:
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: {{ .Values.services.redis.storage }}
|
storage: {{ .Values.services.redis.storage }}
|
||||||
{{- if (eq "-" .Values.services.redis.storageClass) }}
|
{{ if .Values.services.redis.storageClass }}
|
||||||
storageClassName: ""
|
storageClassName: {{ .Values.services.redis.storageClass }}
|
||||||
{{- else }}
|
{{ end }}
|
||||||
storageClassName: "{{ .Values.services.redis.storageClass }}"
|
|
||||||
{{- end }}
|
|
||||||
status: {}
|
status: {}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -155,7 +155,7 @@ services:
|
||||||
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
||||||
## If undefined (the default) or set to null, no storageClassName spec is
|
## If undefined (the default) or set to null, no storageClassName spec is
|
||||||
## set, choosing the default provisioner.
|
## set, choosing the default provisioner.
|
||||||
storageClass: "-"
|
storageClass: ""
|
||||||
|
|
||||||
objectStore:
|
objectStore:
|
||||||
minio: true
|
minio: true
|
||||||
|
@ -171,7 +171,7 @@ services:
|
||||||
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
||||||
## If undefined (the default) or set to null, no storageClassName spec is
|
## If undefined (the default) or set to null, no storageClassName spec is
|
||||||
## set, choosing the default provisioner.
|
## set, choosing the default provisioner.
|
||||||
storageClass: "-"
|
storageClass: ""
|
||||||
|
|
||||||
# Override values in couchDB subchart
|
# Override values in couchDB subchart
|
||||||
couchdb:
|
couchdb:
|
||||||
|
|
|
@ -48,7 +48,7 @@ http {
|
||||||
set $csp_style "style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com https://rsms.me https://maxcdn.bootstrapcdn.com";
|
set $csp_style "style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com https://rsms.me https://maxcdn.bootstrapcdn.com";
|
||||||
set $csp_object "object-src 'none'";
|
set $csp_object "object-src 'none'";
|
||||||
set $csp_base_uri "base-uri 'self'";
|
set $csp_base_uri "base-uri 'self'";
|
||||||
set $csp_connect "connect-src 'self' https://api-iam.intercom.io https://api-iam.intercom.io https://api-ping.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io wss://nexus-websocket-b.intercom.io https://nexus-websocket-a.intercom.io https://nexus-websocket-b.intercom.io https://uploads.intercomcdn.com https://uploads.intercomusercontent.com";
|
set $csp_connect "connect-src 'self' https://api-iam.intercom.io https://api-iam.intercom.io https://api-ping.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io wss://nexus-websocket-b.intercom.io https://nexus-websocket-a.intercom.io https://nexus-websocket-b.intercom.io https://uploads.intercomcdn.com https://uploads.intercomusercontent.com https://*.s3.*.amazonaws.com";
|
||||||
set $csp_font "font-src 'self' data: https://cdn.jsdelivr.net https://fonts.gstatic.com https://rsms.me https://maxcdn.bootstrapcdn.com https://js.intercomcdn.com https://fonts.intercomcdn.com";
|
set $csp_font "font-src 'self' data: https://cdn.jsdelivr.net https://fonts.gstatic.com https://rsms.me https://maxcdn.bootstrapcdn.com https://js.intercomcdn.com https://fonts.intercomcdn.com";
|
||||||
set $csp_frame "frame-src 'self' https:";
|
set $csp_frame "frame-src 'self' https:";
|
||||||
set $csp_img "img-src http: https: data: blob:";
|
set $csp_img "img-src http: https: data: blob:";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "1.0.126-alpha.0",
|
"version": "1.0.129",
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/backend-core",
|
"name": "@budibase/backend-core",
|
||||||
"version": "1.0.126-alpha.0",
|
"version": "1.0.129",
|
||||||
"description": "Budibase backend core libraries used in server and worker",
|
"description": "Budibase backend core libraries used in server and worker",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"author": "Budibase",
|
"author": "Budibase",
|
||||||
|
|
|
@ -41,7 +41,8 @@ exports.closeDB = async db => {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
return db.close()
|
// specifically await so that if there is an error, it can be ignored
|
||||||
|
return await db.close()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// ignore error, already closed
|
// ignore error, already closed
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,19 @@
|
||||||
const PouchDB = require("pouchdb")
|
const PouchDB = require("pouchdb")
|
||||||
const env = require("../environment")
|
const env = require("../environment")
|
||||||
|
|
||||||
exports.getCouchUrl = () => {
|
function getUrlInfo() {
|
||||||
if (!env.COUCH_DB_URL) return
|
let url = env.COUCH_DB_URL
|
||||||
|
let username, password, host
|
||||||
// username and password already exist in URL
|
|
||||||
if (env.COUCH_DB_URL.includes("@")) {
|
|
||||||
return env.COUCH_DB_URL
|
|
||||||
}
|
|
||||||
|
|
||||||
const [protocol, ...rest] = env.COUCH_DB_URL.split("://")
|
|
||||||
|
|
||||||
if (!env.COUCH_DB_USERNAME || !env.COUCH_DB_PASSWORD) {
|
|
||||||
throw new Error(
|
|
||||||
"CouchDB configuration invalid. You must provide a fully qualified CouchDB url, or the COUCH_DB_USER and COUCH_DB_PASSWORD environment variables."
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return `${protocol}://${env.COUCH_DB_USERNAME}:${env.COUCH_DB_PASSWORD}@${rest}`
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.splitCouchUrl = url => {
|
|
||||||
const [protocol, rest] = url.split("://")
|
const [protocol, rest] = url.split("://")
|
||||||
const [auth, host] = rest.split("@")
|
if (url.includes("@")) {
|
||||||
const [username, password] = auth.split(":")
|
const hostParts = rest.split("@")
|
||||||
|
host = hostParts[1]
|
||||||
|
const authParts = hostParts[0].split(":")
|
||||||
|
username = authParts[0]
|
||||||
|
password = authParts[1]
|
||||||
|
} else {
|
||||||
|
host = rest
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
url: `${protocol}://${host}`,
|
url: `${protocol}://${host}`,
|
||||||
auth: {
|
auth: {
|
||||||
|
@ -33,32 +23,51 @@ exports.splitCouchUrl = url => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.getCouchInfo = () => {
|
||||||
|
const urlInfo = getUrlInfo()
|
||||||
|
let username
|
||||||
|
let password
|
||||||
|
if (env.COUCH_DB_USERNAME) {
|
||||||
|
// set from env
|
||||||
|
username = env.COUCH_DB_USERNAME
|
||||||
|
} else if (urlInfo.auth.username) {
|
||||||
|
// set from url
|
||||||
|
username = urlInfo.auth.username
|
||||||
|
} else if (!env.isTest()) {
|
||||||
|
throw new Error("CouchDB username not set")
|
||||||
|
}
|
||||||
|
if (env.COUCH_DB_PASSWORD) {
|
||||||
|
// set from env
|
||||||
|
password = env.COUCH_DB_PASSWORD
|
||||||
|
} else if (urlInfo.auth.password) {
|
||||||
|
// set from url
|
||||||
|
password = urlInfo.auth.password
|
||||||
|
} else if (!env.isTest()) {
|
||||||
|
throw new Error("CouchDB password not set")
|
||||||
|
}
|
||||||
|
const authCookie = Buffer.from(`${username}:${password}`).toString("base64")
|
||||||
|
return {
|
||||||
|
url: urlInfo.url,
|
||||||
|
auth: {
|
||||||
|
username: username,
|
||||||
|
password: password,
|
||||||
|
},
|
||||||
|
cookie: `Basic ${authCookie}`,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a constructor for PouchDB.
|
* Return a constructor for PouchDB.
|
||||||
* This should be rarely used outside of the main application config.
|
* This should be rarely used outside of the main application config.
|
||||||
* Exposed for exceptional cases such as in-memory views.
|
* Exposed for exceptional cases such as in-memory views.
|
||||||
*/
|
*/
|
||||||
exports.getPouch = (opts = {}) => {
|
exports.getPouch = (opts = {}) => {
|
||||||
let auth = {
|
let { url, cookie } = exports.getCouchInfo()
|
||||||
username: env.COUCH_DB_USERNAME,
|
|
||||||
password: env.COUCH_DB_PASSWORD,
|
|
||||||
}
|
|
||||||
let url = exports.getCouchUrl() || "http://localhost:4005"
|
|
||||||
// need to update security settings
|
|
||||||
if (!auth.username || !auth.password || url.includes("@")) {
|
|
||||||
const split = exports.splitCouchUrl(url)
|
|
||||||
url = split.url
|
|
||||||
auth = split.auth
|
|
||||||
}
|
|
||||||
|
|
||||||
const authCookie = Buffer.from(`${auth.username}:${auth.password}`).toString(
|
|
||||||
"base64"
|
|
||||||
)
|
|
||||||
let POUCH_DB_DEFAULTS = {
|
let POUCH_DB_DEFAULTS = {
|
||||||
prefix: url,
|
prefix: url,
|
||||||
fetch: (url, opts) => {
|
fetch: (url, opts) => {
|
||||||
// use a specific authorization cookie - be very explicit about how we authenticate
|
// use a specific authorization cookie - be very explicit about how we authenticate
|
||||||
opts.headers.set("Authorization", `Basic ${authCookie}`)
|
opts.headers.set("Authorization", cookie)
|
||||||
return PouchDB.fetch(url, opts)
|
return PouchDB.fetch(url, opts)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ const {
|
||||||
const { getTenantId, getGlobalDBName } = require("../tenancy")
|
const { getTenantId, getGlobalDBName } = require("../tenancy")
|
||||||
const fetch = require("node-fetch")
|
const fetch = require("node-fetch")
|
||||||
const { doWithDB, allDbs } = require("./index")
|
const { doWithDB, allDbs } = require("./index")
|
||||||
const { getCouchUrl } = require("./pouch")
|
const { getCouchInfo } = require("./pouch")
|
||||||
const { getAppMetadata } = require("../cache/appMetadata")
|
const { getAppMetadata } = require("../cache/appMetadata")
|
||||||
const { checkSlashesInUrl } = require("../helpers")
|
const { checkSlashesInUrl } = require("../helpers")
|
||||||
const {
|
const {
|
||||||
|
@ -169,8 +169,14 @@ exports.getAllDbs = async (opts = { efficient: false }) => {
|
||||||
return allDbs()
|
return allDbs()
|
||||||
}
|
}
|
||||||
let dbs = []
|
let dbs = []
|
||||||
async function addDbs(url) {
|
let { url, cookie } = getCouchInfo()
|
||||||
const response = await fetch(checkSlashesInUrl(encodeURI(url)))
|
async function addDbs(couchUrl) {
|
||||||
|
const response = await fetch(checkSlashesInUrl(encodeURI(couchUrl)), {
|
||||||
|
method: "GET",
|
||||||
|
headers: {
|
||||||
|
Authorization: cookie,
|
||||||
|
},
|
||||||
|
})
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
let json = await response.json()
|
let json = await response.json()
|
||||||
dbs = dbs.concat(json)
|
dbs = dbs.concat(json)
|
||||||
|
@ -178,7 +184,7 @@ exports.getAllDbs = async (opts = { efficient: false }) => {
|
||||||
throw "Cannot connect to CouchDB instance"
|
throw "Cannot connect to CouchDB instance"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let couchUrl = `${getCouchUrl()}/_all_dbs`
|
let couchUrl = `${url}/_all_dbs`
|
||||||
let tenantId = getTenantId()
|
let tenantId = getTenantId()
|
||||||
if (!env.MULTI_TENANCY || (!efficient && tenantId === DEFAULT_TENANT_ID)) {
|
if (!env.MULTI_TENANCY || (!efficient && tenantId === DEFAULT_TENANT_ID)) {
|
||||||
// just get all DBs when:
|
// just get all DBs when:
|
||||||
|
|
|
@ -8,7 +8,7 @@ function isTest() {
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
JWT_SECRET: process.env.JWT_SECRET,
|
JWT_SECRET: process.env.JWT_SECRET,
|
||||||
COUCH_DB_URL: process.env.COUCH_DB_URL,
|
COUCH_DB_URL: process.env.COUCH_DB_URL || "http://localhost:4005",
|
||||||
COUCH_DB_USERNAME: process.env.COUCH_DB_USER,
|
COUCH_DB_USERNAME: process.env.COUCH_DB_USER,
|
||||||
COUCH_DB_PASSWORD: process.env.COUCH_DB_PASSWORD,
|
COUCH_DB_PASSWORD: process.env.COUCH_DB_PASSWORD,
|
||||||
GOOGLE_CLIENT_ID: process.env.GOOGLE_CLIENT_ID,
|
GOOGLE_CLIENT_ID: process.env.GOOGLE_CLIENT_ID,
|
||||||
|
|
|
@ -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.126-alpha.0",
|
"version": "1.0.129",
|
||||||
"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.126-alpha.0",
|
"@budibase/string-templates": "^1.0.129",
|
||||||
"@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.126-alpha.0",
|
"version": "1.0.129",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -65,10 +65,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/bbui": "^1.0.126-alpha.0",
|
"@budibase/bbui": "^1.0.129",
|
||||||
"@budibase/client": "^1.0.126-alpha.0",
|
"@budibase/client": "^1.0.129",
|
||||||
"@budibase/frontend-core": "^1.0.126-alpha.0",
|
"@budibase/frontend-core": "^1.0.129",
|
||||||
"@budibase/string-templates": "^1.0.126-alpha.0",
|
"@budibase/string-templates": "^1.0.129",
|
||||||
"@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",
|
||||||
|
|
|
@ -165,7 +165,7 @@
|
||||||
<TableFilterButton
|
<TableFilterButton
|
||||||
{schema}
|
{schema}
|
||||||
on:change={onFilter}
|
on:change={onFilter}
|
||||||
disabled={!hasCols || !hasRows}
|
disabled={!hasCols}
|
||||||
/>
|
/>
|
||||||
{/key}
|
{/key}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -144,7 +144,11 @@ export const RelationshipTypes = {
|
||||||
MANY_TO_ONE: "many-to-one",
|
MANY_TO_ONE: "many-to-one",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ALLOWABLE_STRING_OPTIONS = [FIELDS.STRING, FIELDS.OPTIONS]
|
export const ALLOWABLE_STRING_OPTIONS = [
|
||||||
|
FIELDS.STRING,
|
||||||
|
FIELDS.OPTIONS,
|
||||||
|
FIELDS.LONGFORM,
|
||||||
|
]
|
||||||
export const ALLOWABLE_STRING_TYPES = ALLOWABLE_STRING_OPTIONS.map(
|
export const ALLOWABLE_STRING_TYPES = ALLOWABLE_STRING_OPTIONS.map(
|
||||||
opt => opt.type
|
opt => opt.type
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/cli",
|
"name": "@budibase/cli",
|
||||||
"version": "1.0.126-alpha.0",
|
"version": "1.0.129",
|
||||||
"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.126-alpha.0",
|
"version": "1.0.129",
|
||||||
"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.126-alpha.0",
|
"@budibase/bbui": "^1.0.129",
|
||||||
"@budibase/frontend-core": "^1.0.126-alpha.0",
|
"@budibase/frontend-core": "^1.0.129",
|
||||||
"@budibase/string-templates": "^1.0.126-alpha.0",
|
"@budibase/string-templates": "^1.0.129",
|
||||||
"@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.126-alpha.0",
|
"version": "1.0.129",
|
||||||
"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.126-alpha.0",
|
"@budibase/bbui": "^1.0.129",
|
||||||
"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.0.126-alpha.0",
|
"version": "1.0.129",
|
||||||
"description": "Budibase Web Server",
|
"description": "Budibase Web Server",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -68,10 +68,10 @@
|
||||||
"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.126-alpha.0",
|
"@budibase/backend-core": "^1.0.129",
|
||||||
"@budibase/client": "^1.0.126-alpha.0",
|
"@budibase/client": "^1.0.129",
|
||||||
"@budibase/pro": "1.0.126-alpha.0",
|
"@budibase/pro": "1.0.129",
|
||||||
"@budibase/string-templates": "^1.0.126-alpha.0",
|
"@budibase/string-templates": "^1.0.129",
|
||||||
"@bull-board/api": "^3.7.0",
|
"@bull-board/api": "^3.7.0",
|
||||||
"@bull-board/koa": "^3.7.0",
|
"@bull-board/koa": "^3.7.0",
|
||||||
"@elastic/elasticsearch": "7.10.0",
|
"@elastic/elasticsearch": "7.10.0",
|
||||||
|
|
|
@ -406,11 +406,14 @@ const destroyApp = async (ctx: any) => {
|
||||||
if (!env.isTest() && !isUnpublish) {
|
if (!env.isTest() && !isUnpublish) {
|
||||||
await deleteApp(appId)
|
await deleteApp(appId)
|
||||||
}
|
}
|
||||||
|
// automations only in production
|
||||||
if (isUnpublish) {
|
if (isUnpublish) {
|
||||||
await cleanupAutomations(appId)
|
await cleanupAutomations(appId)
|
||||||
}
|
}
|
||||||
// make sure the app/role doesn't stick around after the app has been deleted
|
// remove app role when the dev app is deleted (no trace of app anymore)
|
||||||
await removeAppFromUserRoles(ctx, appId)
|
else {
|
||||||
|
await removeAppFromUserRoles(ctx, appId)
|
||||||
|
}
|
||||||
await appCache.invalidateAppMetadata(appId)
|
await appCache.invalidateAppMetadata(appId)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const { SearchIndexes } = require("../../../db/utils")
|
const { SearchIndexes } = require("../../../db/utils")
|
||||||
const fetch = require("node-fetch")
|
const fetch = require("node-fetch")
|
||||||
const { getCouchUrl } = require("@budibase/backend-core/db")
|
const { getCouchInfo } = require("@budibase/backend-core/db")
|
||||||
const { getAppId } = require("@budibase/backend-core/context")
|
const { getAppId } = require("@budibase/backend-core/context")
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -242,11 +242,10 @@ class QueryBuilder {
|
||||||
|
|
||||||
async run() {
|
async run() {
|
||||||
const appId = getAppId()
|
const appId = getAppId()
|
||||||
const url = `${getCouchUrl()}/${appId}/_design/database/_search/${
|
const { url, cookie } = getCouchInfo()
|
||||||
SearchIndexes.ROWS
|
const fullPath = `${url}/${appId}/_design/database/_search/${SearchIndexes.ROWS}`
|
||||||
}`
|
|
||||||
const body = this.buildSearchBody()
|
const body = this.buildSearchBody()
|
||||||
return await runQuery(url, body)
|
return await runQuery(fullPath, body, cookie)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,12 +253,16 @@ class QueryBuilder {
|
||||||
* Executes a lucene search query.
|
* Executes a lucene search query.
|
||||||
* @param url The query URL
|
* @param url The query URL
|
||||||
* @param body The request body defining search criteria
|
* @param body The request body defining search criteria
|
||||||
|
* @param cookie The auth cookie for CouchDB
|
||||||
* @returns {Promise<{rows: []}>}
|
* @returns {Promise<{rows: []}>}
|
||||||
*/
|
*/
|
||||||
const runQuery = async (url, body) => {
|
const runQuery = async (url, body, cookie) => {
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
body: JSON.stringify(body),
|
body: JSON.stringify(body),
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
Authorization: cookie,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
const json = await response.json()
|
const json = await response.json()
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,11 @@ exports.FieldTypes = {
|
||||||
|
|
||||||
exports.CanSwitchTypes = [
|
exports.CanSwitchTypes = [
|
||||||
[exports.FieldTypes.JSON, exports.FieldTypes.ARRAY],
|
[exports.FieldTypes.JSON, exports.FieldTypes.ARRAY],
|
||||||
[exports.FieldTypes.STRING, exports.FieldTypes.OPTIONS],
|
[
|
||||||
|
exports.FieldTypes.STRING,
|
||||||
|
exports.FieldTypes.OPTIONS,
|
||||||
|
exports.FieldTypes.LONGFORM,
|
||||||
|
],
|
||||||
[exports.FieldTypes.BOOLEAN, exports.FieldTypes.NUMBER],
|
[exports.FieldTypes.BOOLEAN, exports.FieldTypes.NUMBER],
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -42,9 +42,9 @@ const SQL_STRING_TYPE_MAP = {
|
||||||
nvarchar: FieldTypes.STRING,
|
nvarchar: FieldTypes.STRING,
|
||||||
ntext: FieldTypes.STRING,
|
ntext: FieldTypes.STRING,
|
||||||
enum: FieldTypes.STRING,
|
enum: FieldTypes.STRING,
|
||||||
blob: FieldTypes.LONGFORM,
|
blob: FieldTypes.STRING,
|
||||||
long: FieldTypes.LONGFORM,
|
long: FieldTypes.STRING,
|
||||||
text: FieldTypes.LONGFORM,
|
text: FieldTypes.STRING,
|
||||||
}
|
}
|
||||||
|
|
||||||
const SQL_BOOLEAN_TYPE_MAP = {
|
const SQL_BOOLEAN_TYPE_MAP = {
|
||||||
|
@ -207,11 +207,20 @@ function shouldCopySpecialColumn(
|
||||||
column: { type: string },
|
column: { type: string },
|
||||||
fetchedColumn: { type: string } | undefined
|
fetchedColumn: { type: string } | undefined
|
||||||
) {
|
) {
|
||||||
|
const specialTypes = [
|
||||||
|
FieldTypes.OPTIONS,
|
||||||
|
FieldTypes.LONGFORM,
|
||||||
|
FieldTypes.ARRAY,
|
||||||
|
FieldTypes.FORMULA,
|
||||||
|
]
|
||||||
|
if (column && !fetchedColumn) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
const fetchedIsNumber =
|
||||||
|
!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER
|
||||||
return (
|
return (
|
||||||
column.type === FieldTypes.OPTIONS ||
|
specialTypes.indexOf(column.type) !== -1 ||
|
||||||
column.type === FieldTypes.ARRAY ||
|
(fetchedIsNumber && column.type === FieldTypes.BOOLEAN)
|
||||||
((!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER) &&
|
|
||||||
column.type === FieldTypes.BOOLEAN)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1014,10 +1014,10 @@
|
||||||
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.124-alpha.0":
|
"@budibase/backend-core@1.0.127":
|
||||||
version "1.0.124-alpha.0"
|
version "1.0.127"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.124-alpha.0.tgz#33a9408206088da49154710910dafc8088d864d2"
|
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.127.tgz#5d1f4b18b31436ddb770dc1ddf16f201ec95dda7"
|
||||||
integrity sha512-0ZUkDeqaoXS9qyK91SjwokYEA1wUPhi48nFE0+UwBloF8i7zVDFp2kOX7VNUrUer4gLuND9BoihEdpqsdQDvAg==
|
integrity sha512-3INFkAIxL0Q8Sa65ELRGQqPs+4baykKyb1z/XuO1MyuDPnbFKXGOjl1V61EMy622gsmLk90IJL6aQfh3Grwhvw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@techpass/passport-openidconnect" "^0.3.0"
|
"@techpass/passport-openidconnect" "^0.3.0"
|
||||||
aws-sdk "^2.901.0"
|
aws-sdk "^2.901.0"
|
||||||
|
@ -1091,12 +1091,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.124-alpha.0":
|
"@budibase/pro@1.0.127":
|
||||||
version "1.0.124-alpha.0"
|
version "1.0.127"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.124-alpha.0.tgz#6287a51fa7c19754e44374c209c4aa3480fc3ac9"
|
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.127.tgz#a8bcffb8ccc6afde64370b3a3dc22e2d0dd04f46"
|
||||||
integrity sha512-EgMuh+XSd/9tb3Ej9EZa4Y8hgiS6fHG+tuUwUcTuP6zvHbTijQGPb9075yImUbSc10bS3o41AP2qa2/ZdZKV2w==
|
integrity sha512-dj0SFTmO8JuMQ97/Ik6jVPQsh9AW7U5Wkgpa4yeNfwWw3DvSoktCxpeZ9mND6BR/DWTaeZljFKsQ6uk6nimzdQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/backend-core" "1.0.124-alpha.0"
|
"@budibase/backend-core" "1.0.127"
|
||||||
node-fetch "^2.6.1"
|
node-fetch "^2.6.1"
|
||||||
|
|
||||||
"@budibase/standard-components@^0.9.139":
|
"@budibase/standard-components@^0.9.139":
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/string-templates",
|
"name": "@budibase/string-templates",
|
||||||
"version": "1.0.126-alpha.0",
|
"version": "1.0.129",
|
||||||
"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,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/worker",
|
"name": "@budibase/worker",
|
||||||
"email": "hi@budibase.com",
|
"email": "hi@budibase.com",
|
||||||
"version": "1.0.126-alpha.0",
|
"version": "1.0.129",
|
||||||
"description": "Budibase background service",
|
"description": "Budibase background service",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -31,9 +31,9 @@
|
||||||
"author": "Budibase",
|
"author": "Budibase",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/backend-core": "^1.0.126-alpha.0",
|
"@budibase/backend-core": "^1.0.129",
|
||||||
"@budibase/pro": "1.0.126-alpha.0",
|
"@budibase/pro": "1.0.129",
|
||||||
"@budibase/string-templates": "^1.0.126-alpha.0",
|
"@budibase/string-templates": "^1.0.129",
|
||||||
"@koa/router": "^8.0.0",
|
"@koa/router": "^8.0.0",
|
||||||
"@sentry/node": "6.17.7",
|
"@sentry/node": "6.17.7",
|
||||||
"@techpass/passport-openidconnect": "^0.3.0",
|
"@techpass/passport-openidconnect": "^0.3.0",
|
||||||
|
|
|
@ -293,10 +293,10 @@
|
||||||
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.124-alpha.0":
|
"@budibase/backend-core@1.0.127":
|
||||||
version "1.0.124-alpha.0"
|
version "1.0.127"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.124-alpha.0.tgz#33a9408206088da49154710910dafc8088d864d2"
|
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.127.tgz#5d1f4b18b31436ddb770dc1ddf16f201ec95dda7"
|
||||||
integrity sha512-0ZUkDeqaoXS9qyK91SjwokYEA1wUPhi48nFE0+UwBloF8i7zVDFp2kOX7VNUrUer4gLuND9BoihEdpqsdQDvAg==
|
integrity sha512-3INFkAIxL0Q8Sa65ELRGQqPs+4baykKyb1z/XuO1MyuDPnbFKXGOjl1V61EMy622gsmLk90IJL6aQfh3Grwhvw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@techpass/passport-openidconnect" "^0.3.0"
|
"@techpass/passport-openidconnect" "^0.3.0"
|
||||||
aws-sdk "^2.901.0"
|
aws-sdk "^2.901.0"
|
||||||
|
@ -321,12 +321,12 @@
|
||||||
uuid "^8.3.2"
|
uuid "^8.3.2"
|
||||||
zlib "^1.0.5"
|
zlib "^1.0.5"
|
||||||
|
|
||||||
"@budibase/pro@1.0.124-alpha.0":
|
"@budibase/pro@1.0.127":
|
||||||
version "1.0.124-alpha.0"
|
version "1.0.127"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.124-alpha.0.tgz#6287a51fa7c19754e44374c209c4aa3480fc3ac9"
|
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.127.tgz#a8bcffb8ccc6afde64370b3a3dc22e2d0dd04f46"
|
||||||
integrity sha512-EgMuh+XSd/9tb3Ej9EZa4Y8hgiS6fHG+tuUwUcTuP6zvHbTijQGPb9075yImUbSc10bS3o41AP2qa2/ZdZKV2w==
|
integrity sha512-dj0SFTmO8JuMQ97/Ik6jVPQsh9AW7U5Wkgpa4yeNfwWw3DvSoktCxpeZ9mND6BR/DWTaeZljFKsQ6uk6nimzdQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/backend-core" "1.0.124-alpha.0"
|
"@budibase/backend-core" "1.0.127"
|
||||||
node-fetch "^2.6.1"
|
node-fetch "^2.6.1"
|
||||||
|
|
||||||
"@cspotcode/source-map-consumer@0.8.0":
|
"@cspotcode/source-map-consumer@0.8.0":
|
||||||
|
|
Loading…
Reference in New Issue