@budibase/server 1.1.32-alpha.6 → 1.1.32
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.133db51f.js +978 -0
- package/builder/assets/{index.4d57d3d4.css → index.192adf4c.css} +2 -2
- package/builder/assets/{vendor.6bcafa60.js → vendor.162098da.js} +1 -1
- package/builder/index.html +3 -3
- package/coverage/clover.xml +696 -381
- package/coverage/coverage-final.json +16 -13
- package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
- package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
- package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
- package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
- package/coverage/lcov-report/api/controllers/component.js.html +1 -1
- package/coverage/lcov-report/api/controllers/datasource.js.html +1 -1
- package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
- package/coverage/lcov-report/api/controllers/index.html +1 -1
- package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
- package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
- package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
- package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
- package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
- package/coverage/lcov-report/api/controllers/query/index.html +1 -1
- package/coverage/lcov-report/api/controllers/query/validation.js.html +4 -4
- package/coverage/lcov-report/api/controllers/role.js.html +1 -1
- package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/external.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/index.html +18 -18
- package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +49 -94
- package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/screen.js.html +1 -1
- package/coverage/lcov-report/api/controllers/script.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
- package/coverage/lcov-report/api/controllers/user.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
- package/coverage/lcov-report/api/controllers/webhook.js.html +15 -15
- package/coverage/lcov-report/api/index.html +1 -1
- package/coverage/lcov-report/api/index.js.html +1 -1
- package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
- package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/routes/auth.js.html +1 -1
- package/coverage/lcov-report/api/routes/automation.js.html +1 -1
- package/coverage/lcov-report/api/routes/backup.js.html +1 -1
- package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
- package/coverage/lcov-report/api/routes/component.js.html +1 -1
- package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
- package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
- package/coverage/lcov-report/api/routes/dev.js.html +1 -1
- package/coverage/lcov-report/api/routes/index.html +1 -1
- package/coverage/lcov-report/api/routes/integration.js.html +1 -1
- package/coverage/lcov-report/api/routes/layout.js.html +1 -1
- package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
- package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
- package/coverage/lcov-report/api/routes/permission.js.html +1 -1
- package/coverage/lcov-report/api/routes/query.js.html +1 -1
- package/coverage/lcov-report/api/routes/role.js.html +1 -1
- package/coverage/lcov-report/api/routes/routing.js.html +1 -1
- package/coverage/lcov-report/api/routes/screen.js.html +1 -1
- package/coverage/lcov-report/api/routes/script.js.html +1 -1
- package/coverage/lcov-report/api/routes/table.js.html +1 -1
- package/coverage/lcov-report/api/routes/templates.js.html +1 -1
- package/coverage/lcov-report/api/routes/user.js.html +1 -1
- package/coverage/lcov-report/api/routes/utils/index.html +1 -1
- package/coverage/lcov-report/api/routes/utils/validators.js.html +2 -2
- package/coverage/lcov-report/api/routes/view.js.html +1 -1
- package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
- package/coverage/lcov-report/automations/actions.js.html +1 -1
- package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
- package/coverage/lcov-report/automations/bullboard.js.html +17 -17
- package/coverage/lcov-report/automations/index.html +1 -1
- package/coverage/lcov-report/automations/index.js.html +1 -1
- package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
- package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
- package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeQuery.js.html +2 -5
- package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
- package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
- package/coverage/lcov-report/automations/steps/index.html +1 -1
- package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
- package/coverage/lcov-report/automations/steps/loop.js.html +1 -1
- package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
- package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
- package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
- package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
- package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
- package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
- package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
- package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
- package/coverage/lcov-report/automations/triggers.js.html +18 -18
- package/coverage/lcov-report/constants/index.html +1 -1
- package/coverage/lcov-report/constants/index.js.html +14 -5
- package/coverage/lcov-report/constants/layouts.js.html +1 -1
- package/coverage/lcov-report/constants/screens.js.html +1 -1
- package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
- package/coverage/lcov-report/db/index.html +19 -19
- package/coverage/lcov-report/db/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +1 -1
- package/coverage/lcov-report/db/newid.js.html +1 -1
- package/coverage/lcov-report/db/utils.js.html +13 -61
- package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
- package/coverage/lcov-report/events/index.html +1 -1
- package/coverage/lcov-report/events/index.js.html +1 -1
- package/coverage/lcov-report/events/utils.js.html +1 -1
- package/coverage/lcov-report/index.html +72 -57
- package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
- package/coverage/lcov-report/integrations/tests/index.html +1 -1
- package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
- package/coverage/lcov-report/middleware/builder.js.html +1 -1
- package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
- package/coverage/lcov-report/middleware/index.html +21 -21
- package/coverage/lcov-report/middleware/joi-validator.js.html +43 -43
- package/coverage/lcov-report/middleware/publicApi.js.html +1 -1
- package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
- package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
- package/coverage/lcov-report/middleware/utils.js.html +1 -1
- package/coverage/lcov-report/threads/automation.js.html +1114 -0
- package/coverage/lcov-report/threads/index.html +146 -0
- package/coverage/lcov-report/threads/query.js.html +916 -0
- package/coverage/lcov-report/threads/utils.js.html +319 -0
- package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
- package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
- package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
- package/coverage/lcov-report/utilities/global.js.html +14 -68
- package/coverage/lcov-report/utilities/index.html +19 -19
- package/coverage/lcov-report/utilities/index.js.html +1 -1
- package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +14 -26
- package/coverage/lcov-report/utilities/queue/index.html +17 -17
- package/coverage/lcov-report/utilities/routing/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
- package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
- package/coverage/lcov-report/utilities/security.js.html +2 -2
- package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
- package/coverage/lcov-report/utilities/users.js.html +1 -1
- package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
- package/coverage/lcov.info +1214 -695
- package/dist/api/controllers/deploy/index.js +0 -1
- package/dist/api/controllers/query/index.js +1 -1
- package/dist/api/controllers/query/validation.js +3 -3
- package/dist/api/controllers/row/internalSearch.js +16 -30
- package/dist/api/routes/utils/validators.js +1 -1
- package/dist/automations/utils.js +1 -47
- package/dist/constants/index.js +4 -1
- package/dist/db/utils.js +1 -14
- package/dist/integrations/base/sql.js +14 -43
- package/dist/package.json +8 -8
- package/dist/threads/automation.js +54 -147
- package/dist/threads/index.js +20 -27
- package/dist/threads/query.js +15 -23
- package/dist/threads/utils.js +24 -47
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/global.js +5 -24
- package/dist/utilities/queue/inMemoryQueue.js +0 -5
- package/package.json +9 -9
- package/src/api/controllers/deploy/index.ts +1 -6
- package/src/api/controllers/query/index.ts +1 -1
- package/src/api/controllers/query/validation.js +3 -3
- package/src/api/controllers/row/internalSearch.js +20 -35
- package/src/api/routes/tests/user.spec.js +0 -2
- package/src/api/routes/utils/validators.js +1 -1
- package/src/automations/steps/executeQuery.js +0 -1
- package/src/automations/tests/automation.spec.js +2 -2
- package/src/automations/utils.ts +1 -54
- package/src/constants/index.js +5 -2
- package/src/db/utils.js +0 -16
- package/src/definitions/datasource.ts +0 -3
- package/src/integrations/base/sql.ts +13 -44
- package/src/integrations/tests/sql.spec.js +4 -50
- package/src/middleware/tests/currentapp.spec.js +0 -11
- package/src/threads/{automation.ts → automation.js} +48 -172
- package/src/threads/index.ts +23 -31
- package/src/threads/{query.ts → query.js} +12 -32
- package/src/threads/{utils.ts → utils.js} +12 -31
- package/src/utilities/global.js +3 -21
- package/src/utilities/queue/inMemoryQueue.js +0 -4
- package/builder/assets/index.fdd9c6c9.js +0 -977
- package/dist/definitions/automations.js +0 -8
- package/dist/threads/definitions.js +0 -2
- package/src/definitions/automations.ts +0 -49
- package/src/threads/definitions.ts +0 -18
package/src/utilities/global.js
CHANGED
|
@@ -12,11 +12,9 @@ const {
|
|
|
12
12
|
} = require("@budibase/backend-core/tenancy")
|
|
13
13
|
const env = require("../environment")
|
|
14
14
|
const { getAppId } = require("@budibase/backend-core/context")
|
|
15
|
-
const { groups } = require("@budibase/pro")
|
|
16
15
|
|
|
17
16
|
exports.updateAppRole = (user, { appId } = {}) => {
|
|
18
17
|
appId = appId || getAppId()
|
|
19
|
-
|
|
20
18
|
if (!user || !user.roles) {
|
|
21
19
|
return user
|
|
22
20
|
}
|
|
@@ -32,33 +30,18 @@ exports.updateAppRole = (user, { appId } = {}) => {
|
|
|
32
30
|
// if a role wasn't found then either set as admin (builder) or public (everyone else)
|
|
33
31
|
if (!user.roleId && user.builder && user.builder.global) {
|
|
34
32
|
user.roleId = BUILTIN_ROLE_IDS.ADMIN
|
|
35
|
-
} else if (!user.roleId
|
|
33
|
+
} else if (!user.roleId) {
|
|
36
34
|
user.roleId = BUILTIN_ROLE_IDS.PUBLIC
|
|
37
|
-
} else if (user?.userGroups?.length) {
|
|
38
|
-
user.roleId = null
|
|
39
35
|
}
|
|
40
|
-
|
|
41
36
|
delete user.roles
|
|
42
37
|
return user
|
|
43
38
|
}
|
|
44
39
|
|
|
45
|
-
|
|
46
|
-
let roleId = await groups.getGroupRoleId(user, appId)
|
|
47
|
-
user.roleId = roleId
|
|
48
|
-
|
|
49
|
-
return user
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
async function processUser(user, { appId } = {}) {
|
|
40
|
+
function processUser(user, { appId } = {}) {
|
|
53
41
|
if (user) {
|
|
54
42
|
delete user.password
|
|
55
43
|
}
|
|
56
|
-
|
|
57
|
-
if (!user.roleId && user?.userGroups?.length) {
|
|
58
|
-
user = await checkGroupRoles(user, { appId })
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return user
|
|
44
|
+
return exports.updateAppRole(user, { appId })
|
|
62
45
|
}
|
|
63
46
|
|
|
64
47
|
exports.getCachedSelf = async (ctx, appId) => {
|
|
@@ -106,7 +89,6 @@ exports.getGlobalUsers = async (users = null) => {
|
|
|
106
89
|
if (!appId) {
|
|
107
90
|
return globalUsers
|
|
108
91
|
}
|
|
109
|
-
|
|
110
92
|
return globalUsers.map(user => exports.updateAppRole(user))
|
|
111
93
|
}
|
|
112
94
|
|