@budibase/server 2.6.19-alpha.31 → 2.6.19-alpha.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builder/assets/{index.8469b14c.css → index.a96c516c.css} +1 -1
- package/builder/assets/{index.3dd3d237.js → index.b6e30d5b.js} +3 -3
- package/builder/index.html +2 -2
- package/dist/automation.js +79 -65
- package/dist/automation.js.map +3 -3
- package/dist/index.js +183 -150
- package/dist/index.js.map +3 -3
- package/dist/query.js +23 -13
- package/dist/query.js.map +2 -2
- package/package.json +8 -8
- package/src/middleware/builder.ts +22 -13
- package/src/threads/automation.ts +5 -1
- package/src/utilities/fileSystem/app.ts +14 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.6.19-alpha.
|
|
4
|
+
"version": "2.6.19-alpha.35",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"license": "GPL-3.0",
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
49
|
-
"@budibase/backend-core": "2.6.19-alpha.
|
|
50
|
-
"@budibase/client": "2.6.19-alpha.
|
|
51
|
-
"@budibase/pro": "2.6.19-alpha.
|
|
52
|
-
"@budibase/shared-core": "2.6.19-alpha.
|
|
53
|
-
"@budibase/string-templates": "2.6.19-alpha.
|
|
54
|
-
"@budibase/types": "2.6.19-alpha.
|
|
49
|
+
"@budibase/backend-core": "2.6.19-alpha.35",
|
|
50
|
+
"@budibase/client": "2.6.19-alpha.35",
|
|
51
|
+
"@budibase/pro": "2.6.19-alpha.35",
|
|
52
|
+
"@budibase/shared-core": "2.6.19-alpha.35",
|
|
53
|
+
"@budibase/string-templates": "2.6.19-alpha.35",
|
|
54
|
+
"@budibase/types": "2.6.19-alpha.35",
|
|
55
55
|
"@bull-board/api": "3.7.0",
|
|
56
56
|
"@bull-board/koa": "3.9.4",
|
|
57
57
|
"@elastic/elasticsearch": "7.10.0",
|
|
@@ -196,5 +196,5 @@
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
},
|
|
199
|
-
"gitHead": "
|
|
199
|
+
"gitHead": "2e6bc8435cb14649a8cc000a76d661fc121f21d1"
|
|
200
200
|
}
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
checkDebounce,
|
|
10
10
|
setDebounce,
|
|
11
11
|
} from "../utilities/redis"
|
|
12
|
-
import { db as dbCore, cache
|
|
13
|
-
import {
|
|
12
|
+
import { db as dbCore, cache } from "@budibase/backend-core"
|
|
13
|
+
import { UserCtx, Database } from "@budibase/types"
|
|
14
14
|
|
|
15
15
|
const DEBOUNCE_TIME_SEC = 30
|
|
16
16
|
|
|
@@ -23,7 +23,7 @@ const DEBOUNCE_TIME_SEC = 30
|
|
|
23
23
|
* through the authorized middleware *
|
|
24
24
|
****************************************************/
|
|
25
25
|
|
|
26
|
-
async function checkDevAppLocks(ctx:
|
|
26
|
+
async function checkDevAppLocks(ctx: UserCtx) {
|
|
27
27
|
const appId = ctx.appId
|
|
28
28
|
|
|
29
29
|
// if any public usage, don't proceed
|
|
@@ -42,7 +42,7 @@ async function checkDevAppLocks(ctx: BBContext) {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
async function updateAppUpdatedAt(ctx:
|
|
45
|
+
async function updateAppUpdatedAt(ctx: UserCtx) {
|
|
46
46
|
const appId = ctx.appId
|
|
47
47
|
// if debouncing skip this update
|
|
48
48
|
// get methods also aren't updating
|
|
@@ -50,20 +50,29 @@ async function updateAppUpdatedAt(ctx: BBContext) {
|
|
|
50
50
|
return
|
|
51
51
|
}
|
|
52
52
|
await dbCore.doWithDB(appId, async (db: Database) => {
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
try {
|
|
54
|
+
const metadata = await db.get(DocumentType.APP_METADATA)
|
|
55
|
+
metadata.updatedAt = new Date().toISOString()
|
|
55
56
|
|
|
56
|
-
|
|
57
|
+
metadata.updatedBy = getGlobalIDFromUserMetadataID(ctx.user?.userId!)
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
const response = await db.put(metadata)
|
|
60
|
+
metadata._rev = response.rev
|
|
61
|
+
await cache.app.invalidateAppMetadata(appId, metadata)
|
|
62
|
+
// set a new debounce record with a short TTL
|
|
63
|
+
await setDebounce(appId, DEBOUNCE_TIME_SEC)
|
|
64
|
+
} catch (err: any) {
|
|
65
|
+
// if a 409 occurs, then multiple clients connected at the same time - ignore
|
|
66
|
+
if (err?.status === 409) {
|
|
67
|
+
return
|
|
68
|
+
} else {
|
|
69
|
+
throw err
|
|
70
|
+
}
|
|
71
|
+
}
|
|
63
72
|
})
|
|
64
73
|
}
|
|
65
74
|
|
|
66
|
-
export default async function builder(ctx:
|
|
75
|
+
export default async function builder(ctx: UserCtx) {
|
|
67
76
|
const appId = ctx.appId
|
|
68
77
|
// this only functions within an app context
|
|
69
78
|
if (!appId) {
|
|
@@ -31,6 +31,7 @@ import { WorkerCallback } from "./definitions"
|
|
|
31
31
|
import { context, logging } from "@budibase/backend-core"
|
|
32
32
|
import { processObject } from "@budibase/string-templates"
|
|
33
33
|
import { cloneDeep } from "lodash/fp"
|
|
34
|
+
import { performance } from "perf_hooks"
|
|
34
35
|
import * as sdkUtils from "../sdk/utils"
|
|
35
36
|
import env from "../environment"
|
|
36
37
|
const FILTER_STEP_ID = actions.BUILTIN_ACTION_DEFINITIONS.FILTER.stepId
|
|
@@ -477,7 +478,10 @@ class Orchestrator {
|
|
|
477
478
|
const end = performance.now()
|
|
478
479
|
const executionTime = end - start
|
|
479
480
|
|
|
480
|
-
console.
|
|
481
|
+
console.info(`Execution time: ${executionTime} milliseconds`, {
|
|
482
|
+
_logKey: "automation",
|
|
483
|
+
executionTime,
|
|
484
|
+
})
|
|
481
485
|
|
|
482
486
|
// store the logs for the automation run
|
|
483
487
|
try {
|
|
@@ -35,10 +35,20 @@ export const getComponentLibraryManifest = async (library: string) => {
|
|
|
35
35
|
const filename = "manifest.json"
|
|
36
36
|
|
|
37
37
|
if (env.isDev() || env.isTest()) {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
const paths = [
|
|
39
|
+
join(TOP_LEVEL_PATH, "packages/client", filename),
|
|
40
|
+
join(process.cwd(), "client", filename),
|
|
41
|
+
]
|
|
42
|
+
for (let path of paths) {
|
|
43
|
+
if (fs.existsSync(path)) {
|
|
44
|
+
// always load from new so that updates are refreshed
|
|
45
|
+
delete require.cache[require.resolve(path)]
|
|
46
|
+
return require(path)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
throw new Error(
|
|
50
|
+
`Unable to find ${filename} in development environment (may need to build).`
|
|
51
|
+
)
|
|
42
52
|
}
|
|
43
53
|
|
|
44
54
|
if (!appId) {
|