@budibase/server 0.9.140-alpha.1 → 0.9.140-alpha.5
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.e8745f5e.js → index.80d850d1.js} +35 -35
- package/builder/assets/{vendor.d39b3c1e.js → vendor.820de34b.js} +10 -2
- package/builder/index.html +2 -2
- package/coverage/clover.xml +798 -530
- package/coverage/coverage-final.json +19 -16
- package/coverage/lcov-report/api/controllers/analytics.js.html +4 -4
- 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/component.js.html +1 -1
- package/coverage/lcov-report/api/controllers/datasource.js.html +3 -3
- 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 +5 -5
- 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 +34 -19
- package/coverage/lcov-report/api/controllers/row/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internal.js.html +242 -47
- package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1244 -0
- 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 +2 -2
- package/coverage/lcov-report/api/controllers/table/utils.js.html +31 -19
- 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 +32 -17
- package/coverage/lcov-report/api/controllers/view/index.js.html +84 -186
- package/coverage/lcov-report/api/controllers/view/utils.js.html +407 -0
- 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/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 +10 -19
- package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
- package/coverage/lcov-report/automations/steps/deleteRow.js.html +14 -20
- 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 +31 -31
- 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 +18 -27
- 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 +12 -21
- package/coverage/lcov-report/automations/steps/utils.js.html +23 -23
- 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 +224 -0
- package/coverage/lcov-report/db/index.html +34 -19
- package/coverage/lcov-report/db/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/LinkController.js.html +4 -4
- package/coverage/lcov-report/db/linkedRows/index.html +14 -14
- package/coverage/lcov-report/db/linkedRows/index.js.html +18 -9
- 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 +37 -10
- 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 +68 -68
- 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 +58 -13
- package/coverage/lcov-report/utilities/rowProcessor/utils.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/users.js.html +1 -1
- package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
- package/coverage/lcov.info +1405 -886
- package/dist/api/controllers/analytics.js +1 -1
- package/dist/api/controllers/datasource.js +2 -2
- package/dist/api/controllers/row/ExternalRequest.js +4 -0
- package/dist/api/controllers/row/internal.js +97 -23
- package/dist/api/controllers/table/index.js +1 -1
- package/dist/api/controllers/table/utils.js +13 -11
- package/dist/api/controllers/view/index.js +74 -96
- package/dist/api/controllers/view/utils.js +102 -0
- package/dist/automations/steps/createRow.js +5 -8
- package/dist/automations/steps/deleteRow.js +7 -10
- package/dist/automations/steps/queryRows.js +11 -14
- package/dist/automations/steps/updateRow.js +4 -7
- package/dist/db/inMemoryView.js +51 -0
- package/dist/db/linkedRows/index.js +5 -2
- package/dist/db/utils.js +7 -0
- package/dist/environment.js +7 -1
- package/dist/integrations/mysql.js +2 -13
- package/dist/integrations/postgres.js +8 -14
- package/dist/integrations/utils.js +19 -1
- package/dist/package.json +10 -12
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utilities/rowProcessor/index.js +10 -5
- package/package.json +11 -13
- package/scripts/integrations/service-vehicles/docker-compose.yml +28 -0
- package/scripts/integrations/service-vehicles/init.sql +52 -0
- package/scripts/integrations/service-vehicles/reset.sh +3 -0
- package/src/api/controllers/analytics.js +1 -1
- package/src/api/controllers/datasource.js +2 -2
- package/src/api/controllers/row/ExternalRequest.ts +5 -1
- package/src/api/controllers/row/internal.js +88 -23
- package/src/api/controllers/table/index.js +1 -1
- package/src/api/controllers/table/utils.js +16 -12
- package/src/api/controllers/view/index.js +82 -116
- package/src/api/controllers/view/utils.js +109 -0
- package/src/api/routes/tests/view.spec.js +1 -1
- package/src/automations/steps/createRow.js +5 -8
- package/src/automations/steps/deleteRow.js +8 -10
- package/src/automations/steps/queryRows.js +11 -14
- package/src/automations/steps/updateRow.js +7 -10
- package/src/db/inMemoryView.js +48 -0
- package/src/db/linkedRows/index.js +5 -2
- package/src/db/utils.js +9 -0
- package/src/environment.js +8 -1
- package/src/integrations/mysql.ts +2 -13
- package/src/integrations/postgres.ts +9 -16
- package/src/integrations/utils.ts +18 -0
- package/src/utilities/rowProcessor/index.js +20 -5
|
@@ -82,3 +82,21 @@ export function isIsoDateString(str: string) {
|
|
|
82
82
|
let d = new Date(str)
|
|
83
83
|
return d.toISOString() === str
|
|
84
84
|
}
|
|
85
|
+
|
|
86
|
+
// add the existing relationships from the entities if they exist, to prevent them from being overridden
|
|
87
|
+
export function copyExistingPropsOver(tableName: string, tables: { [key: string]: any }, entities: { [key: string]: any }) {
|
|
88
|
+
if (entities && entities[tableName]) {
|
|
89
|
+
if (entities[tableName].primaryDisplay) {
|
|
90
|
+
tables[tableName].primaryDisplay = entities[tableName].primaryDisplay
|
|
91
|
+
}
|
|
92
|
+
const existingTableSchema = entities[tableName].schema
|
|
93
|
+
for (let key in existingTableSchema) {
|
|
94
|
+
if (!existingTableSchema.hasOwnProperty(key)) {
|
|
95
|
+
continue
|
|
96
|
+
}
|
|
97
|
+
if (existingTableSchema[key].type === "link") {
|
|
98
|
+
tables[tableName].schema[key] = existingTableSchema[key]
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -89,10 +89,16 @@ const TYPE_TRANSFORM_MAP = {
|
|
|
89
89
|
* @param {Object} user The user to be used for an appId as well as the createdBy and createdAt fields.
|
|
90
90
|
* @param {Object} table The table which is to be used for the schema, as well as handling auto IDs incrementing.
|
|
91
91
|
* @param {Object} row The row which is to be updated with information for the auto columns.
|
|
92
|
+
* @param {Object} opts specific options for function to carry out optional features.
|
|
92
93
|
* @returns {{row: Object, table: Object}} The updated row and table, the table may need to be updated
|
|
93
94
|
* for automatic ID purposes.
|
|
94
95
|
*/
|
|
95
|
-
function processAutoColumn(
|
|
96
|
+
function processAutoColumn(
|
|
97
|
+
user,
|
|
98
|
+
table,
|
|
99
|
+
row,
|
|
100
|
+
opts = { reprocessing: false, noAutoRelationships: false }
|
|
101
|
+
) {
|
|
96
102
|
let now = new Date().toISOString()
|
|
97
103
|
// if a row doesn't have a revision then it doesn't exist yet
|
|
98
104
|
const creating = !row._rev
|
|
@@ -102,7 +108,7 @@ function processAutoColumn(user, table, row) {
|
|
|
102
108
|
}
|
|
103
109
|
switch (schema.subtype) {
|
|
104
110
|
case AutoFieldSubTypes.CREATED_BY:
|
|
105
|
-
if (creating) {
|
|
111
|
+
if (creating && !opts.reprocessing && !opts.noAutoRelationships) {
|
|
106
112
|
row[key] = [user.userId]
|
|
107
113
|
}
|
|
108
114
|
break
|
|
@@ -112,7 +118,9 @@ function processAutoColumn(user, table, row) {
|
|
|
112
118
|
}
|
|
113
119
|
break
|
|
114
120
|
case AutoFieldSubTypes.UPDATED_BY:
|
|
115
|
-
|
|
121
|
+
if (!opts.reprocessing && !opts.noAutoRelationships) {
|
|
122
|
+
row[key] = [user.userId]
|
|
123
|
+
}
|
|
116
124
|
break
|
|
117
125
|
case AutoFieldSubTypes.UPDATED_AT:
|
|
118
126
|
row[key] = now
|
|
@@ -127,6 +135,7 @@ function processAutoColumn(user, table, row) {
|
|
|
127
135
|
}
|
|
128
136
|
return { table, row }
|
|
129
137
|
}
|
|
138
|
+
exports.processAutoColumn = processAutoColumn
|
|
130
139
|
|
|
131
140
|
/**
|
|
132
141
|
* This will coerce a value to the correct types based on the type transform map
|
|
@@ -151,9 +160,15 @@ exports.coerce = (row, type) => {
|
|
|
151
160
|
* @param {object} user the user which is performing the input.
|
|
152
161
|
* @param {object} row the row which is being created/updated.
|
|
153
162
|
* @param {object} table the table which the row is being saved to.
|
|
163
|
+
* @param {object} opts some input processing options (like disabling auto-column relationships).
|
|
154
164
|
* @returns {object} the row which has been prepared to be written to the DB.
|
|
155
165
|
*/
|
|
156
|
-
exports.inputProcessing = (
|
|
166
|
+
exports.inputProcessing = (
|
|
167
|
+
user = {},
|
|
168
|
+
table,
|
|
169
|
+
row,
|
|
170
|
+
opts = { noAutoRelationships: false }
|
|
171
|
+
) => {
|
|
157
172
|
let clonedRow = cloneDeep(row)
|
|
158
173
|
// need to copy the table so it can be differenced on way out
|
|
159
174
|
const copiedTable = cloneDeep(table)
|
|
@@ -176,7 +191,7 @@ exports.inputProcessing = (user = {}, table, row) => {
|
|
|
176
191
|
}
|
|
177
192
|
}
|
|
178
193
|
// handle auto columns - this returns an object like {table, row}
|
|
179
|
-
return processAutoColumn(user, copiedTable, clonedRow)
|
|
194
|
+
return processAutoColumn(user, copiedTable, clonedRow, opts)
|
|
180
195
|
}
|
|
181
196
|
|
|
182
197
|
/**
|