Merge remote-tracking branch 'refs/remotes/origin/fix/add-cron-validation' into fix/add-cron-validation
This commit is contained in:
commit
aaf476ca25
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "2.19.0",
|
"version": "2.19.1",
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/*",
|
"packages/*",
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit cc12291732ee902dc832bc7d93cf2086ffdf0cff
|
Subproject commit ba40a467484963f8041144345469f4b395e31acc
|
|
@ -341,7 +341,10 @@ const exportDataHandler = async action => {
|
||||||
format: action.parameters.type,
|
format: action.parameters.type,
|
||||||
columns: action.parameters.columns,
|
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) {
|
} catch (error) {
|
||||||
notificationStore.actions.error("There was an error exporting the data")
|
notificationStore.actions.error("There was an error exporting the data")
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,6 +103,7 @@
|
||||||
"pouchdb-all-dbs": "1.1.1",
|
"pouchdb-all-dbs": "1.1.1",
|
||||||
"pouchdb-find": "7.2.2",
|
"pouchdb-find": "7.2.2",
|
||||||
"redis": "4",
|
"redis": "4",
|
||||||
|
"serialize-error": "^7.0.1",
|
||||||
"server-destroy": "1.0.1",
|
"server-destroy": "1.0.1",
|
||||||
"snowflake-promise": "^4.5.0",
|
"snowflake-promise": "^4.5.0",
|
||||||
"socket.io": "4.6.1",
|
"socket.io": "4.6.1",
|
||||||
|
|
|
@ -3,6 +3,7 @@ import env from "../environment"
|
||||||
import { setJSRunner, setOnErrorLog } from "@budibase/string-templates"
|
import { setJSRunner, setOnErrorLog } from "@budibase/string-templates"
|
||||||
import { context, logging, timers } from "@budibase/backend-core"
|
import { context, logging, timers } from "@budibase/backend-core"
|
||||||
import tracer from "dd-trace"
|
import tracer from "dd-trace"
|
||||||
|
import { serializeError } from "serialize-error"
|
||||||
|
|
||||||
type TrackerFn = <T>(f: () => T) => T
|
type TrackerFn = <T>(f: () => T) => T
|
||||||
|
|
||||||
|
@ -61,7 +62,7 @@ export function init() {
|
||||||
|
|
||||||
if (env.LOG_JS_ERRORS) {
|
if (env.LOG_JS_ERRORS) {
|
||||||
setOnErrorLog((error: Error) => {
|
setOnErrorLog((error: Error) => {
|
||||||
logging.logWarn(JSON.stringify(error))
|
logging.logWarn(JSON.stringify(serializeError(error)))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { QueryVariable } from "./definitions"
|
||||||
import env from "../environment"
|
import env from "../environment"
|
||||||
import * as db from "../db"
|
import * as db from "../db"
|
||||||
import { redis, db as dbCore } from "@budibase/backend-core"
|
import { redis, db as dbCore } from "@budibase/backend-core"
|
||||||
|
import * as jsRunner from "../jsRunner"
|
||||||
|
|
||||||
const VARIABLE_TTL_SECONDS = 3600
|
const VARIABLE_TTL_SECONDS = 3600
|
||||||
let client: any
|
let client: any
|
||||||
|
@ -29,7 +30,9 @@ export function threadSetup() {
|
||||||
console.debug(`[${env.FORKED_PROCESS_NAME}] thread setup skipped`)
|
console.debug(`[${env.FORKED_PROCESS_NAME}] thread setup skipped`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
console.debug(`[${env.FORKED_PROCESS_NAME}] thread setup running`)
|
console.debug(`[${env.FORKED_PROCESS_NAME}] thread setup running`)
|
||||||
|
jsRunner.init()
|
||||||
db.init()
|
db.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/types": "0.0.0",
|
"@budibase/types": "0.0.0",
|
||||||
"cron-validate": "^1.4.5"
|
"cron-validate": "1.4.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"rimraf": "3.0.2",
|
"rimraf": "3.0.2",
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
const vm = require("vm")
|
||||||
const handlebars = require("handlebars")
|
const handlebars = require("handlebars")
|
||||||
const { registerAll, registerMinimum } = require("./helpers/index")
|
const { registerAll, registerMinimum } = require("./helpers/index")
|
||||||
const processors = require("./processors")
|
const processors = require("./processors")
|
||||||
|
@ -402,3 +403,19 @@ const errors = require("./errors")
|
||||||
module.exports.JsErrorTimeout = errors.JsErrorTimeout
|
module.exports.JsErrorTimeout = errors.JsErrorTimeout
|
||||||
|
|
||||||
module.exports.helpersToRemoveForJs = helpersToRemoveForJs
|
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 })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import vm from "vm"
|
|
||||||
import templates from "./index.js"
|
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 FIND_ANY_HBS_REGEX = templates.FIND_ANY_HBS_REGEX
|
||||||
export const helpersToRemoveForJs = templates.helpersToRemoveForJs
|
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"
|
export * from "./errors.js"
|
||||||
|
|
|
@ -8553,7 +8553,7 @@ cron-parser@^4.2.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
luxon "^3.2.1"
|
luxon "^3.2.1"
|
||||||
|
|
||||||
cron-validate@^1.4.5:
|
cron-validate@1.4.5:
|
||||||
version "1.4.5"
|
version "1.4.5"
|
||||||
resolved "https://registry.yarnpkg.com/cron-validate/-/cron-validate-1.4.5.tgz#eceb221f7558e6302e5f84c7b3a454fdf4d064c3"
|
resolved "https://registry.yarnpkg.com/cron-validate/-/cron-validate-1.4.5.tgz#eceb221f7558e6302e5f84c7b3a454fdf4d064c3"
|
||||||
integrity sha512-nKlOJEnYKudMn/aNyNH8xxWczlfpaazfWV32Pcx/2St51r2bxWbGhZD7uwzMcRhunA/ZNL+Htm/i0792Z59UMQ==
|
integrity sha512-nKlOJEnYKudMn/aNyNH8xxWczlfpaazfWV32Pcx/2St51r2bxWbGhZD7uwzMcRhunA/ZNL+Htm/i0792Z59UMQ==
|
||||||
|
|
Loading…
Reference in New Issue