@budibase/server 0.9.167-alpha.9 → 0.9.169-alpha.1
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.d79c9b4d.js → index.4d6df6a5.js} +2 -2
- package/builder/assets/{vendor.278a305c.js → vendor.2053eff2.js} +2 -2
- package/builder/index.html +2 -2
- package/coverage/clover.xml +75 -70
- package/coverage/coverage-final.json +5 -5
- 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 +1 -1
- package/coverage/lcov-report/api/controllers/hosting.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/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 +15 -15
- package/coverage/lcov-report/api/controllers/table/index.js.html +17 -8
- package/coverage/lcov-report/api/controllers/table/utils.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 +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 +1 -1
- package/coverage/lcov-report/api/routes/hosting.js.html +1 -1
- package/coverage/lcov-report/api/routes/index.html +1 -1
- 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 +5 -2
- 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 +21 -21
- 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 +2 -2
- 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 +2 -2
- 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 +26 -8
- 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 +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 +119 -106
- package/dist/api/controllers/table/index.js +3 -0
- package/dist/constants/index.js +1 -0
- package/dist/middleware/currentapp.js +1 -1
- package/dist/package.json +5 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utilities/global.js +1 -1
- package/dist/utilities/rowProcessor/index.js +4 -0
- package/package.json +6 -6
- package/src/api/controllers/table/index.js +3 -0
- package/src/constants/index.js +1 -0
- package/src/middleware/currentapp.js +1 -1
- package/src/middleware/tests/currentapp.spec.js +3 -3
- package/src/utilities/global.js +1 -1
- package/src/utilities/rowProcessor/index.js +6 -0
package/dist/utilities/global.js
CHANGED
|
@@ -194,6 +194,10 @@ exports.inputProcessing = (user = {}, table, row, opts = { noAutoRelationships:
|
|
|
194
194
|
clonedRow[key] = exports.coerce(value, field.type);
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
+
if (!clonedRow._id || !clonedRow._rev) {
|
|
198
|
+
clonedRow._id = row._id;
|
|
199
|
+
clonedRow._rev = row._rev;
|
|
200
|
+
}
|
|
197
201
|
// handle auto columns - this returns an object like {table, row}
|
|
198
202
|
return processAutoColumn(user, copiedTable, clonedRow, opts);
|
|
199
203
|
};
|
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.169-alpha.1",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"repository": {
|
|
@@ -68,13 +68,13 @@
|
|
|
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.169-alpha.1",
|
|
72
|
+
"@budibase/client": "^0.9.169-alpha.1",
|
|
73
|
+
"@budibase/string-templates": "^0.9.169-alpha.1",
|
|
74
74
|
"@elastic/elasticsearch": "7.10.0",
|
|
75
75
|
"@koa/router": "8.0.0",
|
|
76
76
|
"@sendgrid/mail": "7.1.1",
|
|
77
|
-
"@sentry/node": "
|
|
77
|
+
"@sentry/node": "^6.0.0",
|
|
78
78
|
"airtable": "0.10.1",
|
|
79
79
|
"arangojs": "7.2.0",
|
|
80
80
|
"aws-sdk": "^2.767.0",
|
|
@@ -149,5 +149,5 @@
|
|
|
149
149
|
"typescript": "^4.3.5",
|
|
150
150
|
"update-dotenv": "^1.1.1"
|
|
151
151
|
},
|
|
152
|
-
"gitHead": "
|
|
152
|
+
"gitHead": "340d52dc38d12b82f6c941c269fa8e9a51307826"
|
|
153
153
|
}
|
|
@@ -91,6 +91,9 @@ exports.save = async function (ctx) {
|
|
|
91
91
|
for (let propKey of Object.keys(tableToSave.schema)) {
|
|
92
92
|
let column = tableToSave.schema[propKey]
|
|
93
93
|
let oldColumn = oldTable.schema[propKey]
|
|
94
|
+
if (oldColumn && oldColumn.type === "internal") {
|
|
95
|
+
oldColumn.type = "auto"
|
|
96
|
+
}
|
|
94
97
|
if (oldColumn && oldColumn.type !== column.type) {
|
|
95
98
|
ctx.throw(400, "Cannot change the type of a column")
|
|
96
99
|
}
|
package/src/constants/index.js
CHANGED
|
@@ -45,7 +45,7 @@ module.exports = async (ctx, next) => {
|
|
|
45
45
|
const globalUser = await getCachedSelf(ctx, requestAppId)
|
|
46
46
|
appId = requestAppId
|
|
47
47
|
// retrieving global user gets the right role
|
|
48
|
-
roleId = globalUser.roleId ||
|
|
48
|
+
roleId = globalUser.roleId || roleId
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
// nothing more to do
|
|
@@ -127,8 +127,8 @@ describe("Current app middleware", () => {
|
|
|
127
127
|
} else {
|
|
128
128
|
expect(cookieFn).not.toHaveBeenCalled()
|
|
129
129
|
}
|
|
130
|
-
expect(config.ctx.roleId).toEqual("
|
|
131
|
-
expect(config.ctx.user.role._id).toEqual("
|
|
130
|
+
expect(config.ctx.roleId).toEqual("PUBLIC")
|
|
131
|
+
expect(config.ctx.user.role._id).toEqual("PUBLIC")
|
|
132
132
|
expect(config.ctx.appId).toEqual("app_test")
|
|
133
133
|
expect(config.next).toHaveBeenCalled()
|
|
134
134
|
}
|
|
@@ -163,7 +163,7 @@ describe("Current app middleware", () => {
|
|
|
163
163
|
return "app_test"
|
|
164
164
|
},
|
|
165
165
|
setCookie: jest.fn(),
|
|
166
|
-
getCookie: () => ({appId: "app_test", roleId: "
|
|
166
|
+
getCookie: () => ({appId: "app_test", roleId: "PUBLIC"}),
|
|
167
167
|
},
|
|
168
168
|
constants: { Cookies: {} },
|
|
169
169
|
}))
|
package/src/utilities/global.js
CHANGED
|
@@ -26,7 +26,7 @@ exports.updateAppRole = (appId, user) => {
|
|
|
26
26
|
if (!user.roleId && user.builder && user.builder.global) {
|
|
27
27
|
user.roleId = BUILTIN_ROLE_IDS.ADMIN
|
|
28
28
|
} else if (!user.roleId) {
|
|
29
|
-
user.roleId = BUILTIN_ROLE_IDS.
|
|
29
|
+
user.roleId = BUILTIN_ROLE_IDS.PUBLIC
|
|
30
30
|
}
|
|
31
31
|
delete user.roles
|
|
32
32
|
return user
|
|
@@ -200,6 +200,12 @@ exports.inputProcessing = (
|
|
|
200
200
|
clonedRow[key] = exports.coerce(value, field.type)
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
+
|
|
204
|
+
if (!clonedRow._id || !clonedRow._rev) {
|
|
205
|
+
clonedRow._id = row._id
|
|
206
|
+
clonedRow._rev = row._rev
|
|
207
|
+
}
|
|
208
|
+
|
|
203
209
|
// handle auto columns - this returns an object like {table, row}
|
|
204
210
|
return processAutoColumn(user, copiedTable, clonedRow, opts)
|
|
205
211
|
}
|