@budibase/server 0.9.165 → 0.9.167-alpha.2
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.43a8bb3b.js → index.941194ee.js} +1 -1
- package/builder/index.html +1 -1
- package/coverage/clover.xml +96 -82
- package/coverage/coverage-final.json +4 -4
- package/coverage/lcov-report/api/controllers/analytics.js.html +1 -1
- package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/controllers/application.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 +41 -17
- package/coverage/lcov-report/api/controllers/hosting.js.html +1 -1
- package/coverage/lcov-report/api/controllers/index.html +26 -26
- 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/permission.js.html +1 -1
- package/coverage/lcov-report/api/controllers/query.js.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/api/controllers/row/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internalSearch.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/index.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/templates.js.html +49 -13
- 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 +1 -1
- 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/application.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 +26 -11
- package/coverage/lcov-report/api/routes/hosting.js.html +1 -1
- package/coverage/lcov-report/api/routes/index.html +9 -9
- package/coverage/lcov-report/api/routes/index.js.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/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/row.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/static.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/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 +1 -1
- 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/createRow.js.html +1 -1
- package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
- package/coverage/lcov-report/automations/steps/deleteRow.js.html +1 -1
- package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
- 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/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/thread.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 +1 -1
- package/coverage/lcov-report/automations/utils.js.html +1 -1
- package/coverage/lcov-report/constants/index.html +1 -1
- package/coverage/lcov-report/constants/index.js.html +1 -1
- 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/client.js.html +1 -1
- package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
- package/coverage/lcov-report/db/index.html +1 -1
- 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 +1 -1
- 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 +32 -32
- 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/authorized.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 +1 -1
- package/coverage/lcov-report/middleware/joi-validator.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/usageQuota.js.html +1 -1
- package/coverage/lcov-report/utilities/bcrypt.js.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/utilities/index.html +1 -1
- package/coverage/lcov-report/utilities/index.js.html +1 -1
- package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
- package/coverage/lcov-report/utilities/queue/index.html +1 -1
- 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 +15 -15
- package/coverage/lcov-report/utilities/rowProcessor/index.js.html +20 -8
- package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
- package/coverage/lcov-report/utilities/security.js.html +1 -1
- package/coverage/lcov-report/utilities/statusCodes.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 +167 -136
- package/dist/api/controllers/dev.js +17 -11
- package/dist/api/controllers/templates.js +18 -3
- package/dist/api/routes/dev.js +8 -4
- package/dist/package.json +4 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utilities/rowProcessor/index.js +4 -0
- package/package.json +5 -5
- package/src/api/controllers/dev.js +16 -8
- package/src/api/controllers/templates.js +17 -5
- package/src/api/routes/dev.js +9 -4
- package/src/utilities/rowProcessor/index.js +4 -0
|
@@ -149,6 +149,10 @@ exports.processAutoColumn = processAutoColumn;
|
|
|
149
149
|
* @returns {object} The coerced value
|
|
150
150
|
*/
|
|
151
151
|
exports.coerce = (row, type) => {
|
|
152
|
+
// no coercion specified for type, skip it
|
|
153
|
+
if (!TYPE_TRANSFORM_MAP[type]) {
|
|
154
|
+
return row;
|
|
155
|
+
}
|
|
152
156
|
// eslint-disable-next-line no-prototype-builtins
|
|
153
157
|
if (TYPE_TRANSFORM_MAP[type].hasOwnProperty(row)) {
|
|
154
158
|
return TYPE_TRANSFORM_MAP[type][row];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.167-alpha.2",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"repository": {
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"author": "Budibase",
|
|
69
69
|
"license": "AGPL-3.0-or-later",
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@budibase/auth": "^0.9.
|
|
72
|
-
"@budibase/client": "^0.9.
|
|
73
|
-
"@budibase/string-templates": "^0.9.
|
|
71
|
+
"@budibase/auth": "^0.9.167-alpha.2",
|
|
72
|
+
"@budibase/client": "^0.9.167-alpha.2",
|
|
73
|
+
"@budibase/string-templates": "^0.9.167-alpha.2",
|
|
74
74
|
"@elastic/elasticsearch": "7.10.0",
|
|
75
75
|
"@koa/router": "8.0.0",
|
|
76
76
|
"@sendgrid/mail": "7.1.1",
|
|
@@ -148,5 +148,5 @@
|
|
|
148
148
|
"typescript": "^4.3.5",
|
|
149
149
|
"update-dotenv": "^1.1.1"
|
|
150
150
|
},
|
|
151
|
-
"gitHead": "
|
|
151
|
+
"gitHead": "750aa078c0337e9657f940a032787bcdb9addb13"
|
|
152
152
|
}
|
|
@@ -7,11 +7,13 @@ const { clearLock } = require("../../utilities/redis")
|
|
|
7
7
|
const { Replication } = require("@budibase/auth").db
|
|
8
8
|
const { DocumentTypes } = require("../../db/utils")
|
|
9
9
|
|
|
10
|
-
async function redirect(ctx, method) {
|
|
10
|
+
async function redirect(ctx, method, path = "global") {
|
|
11
11
|
const { devPath } = ctx.params
|
|
12
12
|
const queryString = ctx.originalUrl.split("?")[1] || ""
|
|
13
13
|
const response = await fetch(
|
|
14
|
-
checkSlashesInUrl(
|
|
14
|
+
checkSlashesInUrl(
|
|
15
|
+
`${env.WORKER_URL}/api/${path}/${devPath}?${queryString}`
|
|
16
|
+
),
|
|
15
17
|
request(
|
|
16
18
|
ctx,
|
|
17
19
|
{
|
|
@@ -41,16 +43,22 @@ async function redirect(ctx, method) {
|
|
|
41
43
|
ctx.cookies
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
exports.
|
|
45
|
-
|
|
46
|
+
exports.buildRedirectGet = path => {
|
|
47
|
+
return async ctx => {
|
|
48
|
+
await redirect(ctx, "GET", path)
|
|
49
|
+
}
|
|
46
50
|
}
|
|
47
51
|
|
|
48
|
-
exports.
|
|
49
|
-
|
|
52
|
+
exports.buildRedirectPost = path => {
|
|
53
|
+
return async ctx => {
|
|
54
|
+
await redirect(ctx, "POST", path)
|
|
55
|
+
}
|
|
50
56
|
}
|
|
51
57
|
|
|
52
|
-
exports.
|
|
53
|
-
|
|
58
|
+
exports.buildRedirectDelete = path => {
|
|
59
|
+
return async ctx => {
|
|
60
|
+
await redirect(ctx, "DELETE", path)
|
|
61
|
+
}
|
|
54
62
|
}
|
|
55
63
|
|
|
56
64
|
exports.clearLock = async ctx => {
|
|
@@ -7,11 +7,23 @@ const DEFAULT_TEMPLATES_BUCKET =
|
|
|
7
7
|
|
|
8
8
|
exports.fetch = async function (ctx) {
|
|
9
9
|
const { type = "app" } = ctx.query
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
let response,
|
|
11
|
+
error = false
|
|
12
|
+
try {
|
|
13
|
+
response = await fetch(`https://${DEFAULT_TEMPLATES_BUCKET}/manifest.json`)
|
|
14
|
+
if (response.status !== 200) {
|
|
15
|
+
error = true
|
|
16
|
+
}
|
|
17
|
+
} catch (err) {
|
|
18
|
+
error = true
|
|
19
|
+
}
|
|
20
|
+
// if there is an error, simply return no templates
|
|
21
|
+
if (!error && response) {
|
|
22
|
+
const json = await response.json()
|
|
23
|
+
ctx.body = Object.values(json.templates[type])
|
|
24
|
+
} else {
|
|
25
|
+
ctx.body = []
|
|
26
|
+
}
|
|
15
27
|
}
|
|
16
28
|
|
|
17
29
|
// can't currently test this, have to ignore from coverage
|
package/src/api/routes/dev.js
CHANGED
|
@@ -6,11 +6,16 @@ const { BUILDER } = require("@budibase/auth/permissions")
|
|
|
6
6
|
|
|
7
7
|
const router = Router()
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
function redirectPath(path) {
|
|
10
10
|
router
|
|
11
|
-
.get(
|
|
12
|
-
.post(
|
|
13
|
-
.delete(
|
|
11
|
+
.get(`/api/${path}/:devPath(.*)`, controller.buildRedirectGet(path))
|
|
12
|
+
.post(`/api/${path}/:devPath(.*)`, controller.buildRedirectPost(path))
|
|
13
|
+
.delete(`/api/${path}/:devPath(.*)`, controller.buildRedirectDelete(path))
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (env.isDev() || env.isTest()) {
|
|
17
|
+
redirectPath("global")
|
|
18
|
+
redirectPath("system")
|
|
14
19
|
}
|
|
15
20
|
|
|
16
21
|
router
|
|
@@ -150,6 +150,10 @@ exports.processAutoColumn = processAutoColumn
|
|
|
150
150
|
* @returns {object} The coerced value
|
|
151
151
|
*/
|
|
152
152
|
exports.coerce = (row, type) => {
|
|
153
|
+
// no coercion specified for type, skip it
|
|
154
|
+
if (!TYPE_TRANSFORM_MAP[type]) {
|
|
155
|
+
return row
|
|
156
|
+
}
|
|
153
157
|
// eslint-disable-next-line no-prototype-builtins
|
|
154
158
|
if (TYPE_TRANSFORM_MAP[type].hasOwnProperty(row)) {
|
|
155
159
|
return TYPE_TRANSFORM_MAP[type][row]
|