Merge branch 'master' into fix/add-cron-validation

This commit is contained in:
Michael Drury 2024-02-13 13:45:10 +00:00 committed by GitHub
commit b9265679d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 29 additions and 21 deletions

View File

@ -1,5 +1,5 @@
{
"version": "2.19.0",
"version": "2.19.1",
"npmClient": "yarn",
"packages": [
"packages/*",

@ -1 +1 @@
Subproject commit cc12291732ee902dc832bc7d93cf2086ffdf0cff
Subproject commit ba40a467484963f8041144345469f4b395e31acc

View File

@ -341,7 +341,10 @@ const exportDataHandler = async action => {
format: action.parameters.type,
columns: action.parameters.columns,
})
download(data, `${selection.tableId}.${action.parameters.type}`)
download(
new Blob([data], { type: "text/plain" }),
`${selection.tableId}.${action.parameters.type}`
)
} catch (error) {
notificationStore.actions.error("There was an error exporting the data")
}

View File

@ -103,6 +103,7 @@
"pouchdb-all-dbs": "1.1.1",
"pouchdb-find": "7.2.2",
"redis": "4",
"serialize-error": "^7.0.1",
"server-destroy": "1.0.1",
"snowflake-promise": "^4.5.0",
"socket.io": "4.6.1",

View File

@ -3,6 +3,7 @@ import env from "../environment"
import { setJSRunner, setOnErrorLog } from "@budibase/string-templates"
import { context, logging, timers } from "@budibase/backend-core"
import tracer from "dd-trace"
import { serializeError } from "serialize-error"
type TrackerFn = <T>(f: () => T) => T
@ -61,7 +62,7 @@ export function init() {
if (env.LOG_JS_ERRORS) {
setOnErrorLog((error: Error) => {
logging.logWarn(JSON.stringify(error))
logging.logWarn(JSON.stringify(serializeError(error)))
})
}
}

View File

@ -2,6 +2,7 @@ import { QueryVariable } from "./definitions"
import env from "../environment"
import * as db from "../db"
import { redis, db as dbCore } from "@budibase/backend-core"
import * as jsRunner from "../jsRunner"
const VARIABLE_TTL_SECONDS = 3600
let client: any
@ -29,7 +30,9 @@ export function threadSetup() {
console.debug(`[${env.FORKED_PROCESS_NAME}] thread setup skipped`)
return
}
console.debug(`[${env.FORKED_PROCESS_NAME}] thread setup running`)
jsRunner.init()
db.init()
}

View File

@ -1,3 +1,4 @@
const vm = require("vm")
const handlebars = require("handlebars")
const { registerAll, registerMinimum } = require("./helpers/index")
const processors = require("./processors")
@ -402,3 +403,19 @@ const errors = require("./errors")
module.exports.JsErrorTimeout = errors.JsErrorTimeout
module.exports.helpersToRemoveForJs = helpersToRemoveForJs
if (process && !process.env.NO_JS) {
/**
* Use polyfilled vm to run JS scripts in a browser Env
*/
javascript.setJSRunner((js, context) => {
context = {
...context,
alert: undefined,
setInterval: undefined,
setTimeout: undefined,
}
vm.createContext(context)
return vm.runInNewContext(js, context, { timeout: 1000 })
})
}

View File

@ -1,4 +1,3 @@
import vm from "vm"
import templates from "./index.js"
/**
@ -24,20 +23,4 @@ export const setOnErrorLog = templates.setOnErrorLog
export const FIND_ANY_HBS_REGEX = templates.FIND_ANY_HBS_REGEX
export const helpersToRemoveForJs = templates.helpersToRemoveForJs
if (process && !process.env.NO_JS) {
/**
* Use polyfilled vm to run JS scripts in a browser Env
*/
setJSRunner((js, context) => {
context = {
...context,
alert: undefined,
setInterval: undefined,
setTimeout: undefined,
}
vm.createContext(context)
return vm.runInNewContext(js, context, { timeout: 1000 })
})
}
export * from "./errors.js"