@budibase/server 1.0.126 → 1.0.129
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.501b94ce.js → index.a89d7b93.js} +53 -53
- package/builder/index.html +1 -1
- package/coverage/clover.xml +57 -56
- package/coverage/coverage-final.json +2 -2
- 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/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 +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 +10 -10
- package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +23 -14
- 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 +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/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 +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/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 +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/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 +1 -1
- package/coverage/lcov-report/constants/index.html +1 -1
- package/coverage/lcov-report/constants/index.js.html +15 -3
- 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 +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 +8 -8
- 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 +1 -1
- package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/threads/index.html +1 -1
- package/coverage/lcov-report/threads/query.js.html +1 -1
- package/coverage/lcov-report/threads/utils.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 +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 +1 -1
- 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 +82 -81
- package/dist/api/controllers/application.js +5 -2
- package/dist/api/controllers/row/internalSearch.js +9 -4
- package/dist/constants/index.js +5 -1
- package/dist/integrations/utils.js +15 -7
- package/dist/package.json +5 -5
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/src/api/controllers/application.ts +5 -2
- package/src/api/controllers/row/internalSearch.js +9 -6
- package/src/constants/index.js +5 -1
- package/src/integrations/utils.ts +16 -7
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.129",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -68,10 +68,10 @@
|
|
|
68
68
|
"license": "GPL-3.0",
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@apidevtools/swagger-parser": "^10.0.3",
|
|
71
|
-
"@budibase/backend-core": "^1.0.
|
|
72
|
-
"@budibase/client": "^1.0.
|
|
73
|
-
"@budibase/pro": "1.0.
|
|
74
|
-
"@budibase/string-templates": "^1.0.
|
|
71
|
+
"@budibase/backend-core": "^1.0.129",
|
|
72
|
+
"@budibase/client": "^1.0.129",
|
|
73
|
+
"@budibase/pro": "1.0.128",
|
|
74
|
+
"@budibase/string-templates": "^1.0.129",
|
|
75
75
|
"@bull-board/api": "^3.7.0",
|
|
76
76
|
"@bull-board/koa": "^3.7.0",
|
|
77
77
|
"@elastic/elasticsearch": "7.10.0",
|
|
@@ -180,5 +180,5 @@
|
|
|
180
180
|
"optionalDependencies": {
|
|
181
181
|
"oracledb": "^5.3.0"
|
|
182
182
|
},
|
|
183
|
-
"gitHead": "
|
|
183
|
+
"gitHead": "6e1aa0a2f10d4cf4882182e17d37222e734e9927"
|
|
184
184
|
}
|
|
@@ -406,11 +406,14 @@ const destroyApp = async (ctx: any) => {
|
|
|
406
406
|
if (!env.isTest() && !isUnpublish) {
|
|
407
407
|
await deleteApp(appId)
|
|
408
408
|
}
|
|
409
|
+
// automations only in production
|
|
409
410
|
if (isUnpublish) {
|
|
410
411
|
await cleanupAutomations(appId)
|
|
411
412
|
}
|
|
412
|
-
//
|
|
413
|
-
|
|
413
|
+
// remove app role when the dev app is deleted (no trace of app anymore)
|
|
414
|
+
else {
|
|
415
|
+
await removeAppFromUserRoles(ctx, appId)
|
|
416
|
+
}
|
|
414
417
|
await appCache.invalidateAppMetadata(appId)
|
|
415
418
|
return result
|
|
416
419
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const { SearchIndexes } = require("../../../db/utils")
|
|
2
2
|
const fetch = require("node-fetch")
|
|
3
|
-
const {
|
|
3
|
+
const { getCouchInfo } = require("@budibase/backend-core/db")
|
|
4
4
|
const { getAppId } = require("@budibase/backend-core/context")
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -242,11 +242,10 @@ class QueryBuilder {
|
|
|
242
242
|
|
|
243
243
|
async run() {
|
|
244
244
|
const appId = getAppId()
|
|
245
|
-
const url =
|
|
246
|
-
|
|
247
|
-
}`
|
|
245
|
+
const { url, cookie } = getCouchInfo()
|
|
246
|
+
const fullPath = `${url}/${appId}/_design/database/_search/${SearchIndexes.ROWS}`
|
|
248
247
|
const body = this.buildSearchBody()
|
|
249
|
-
return await runQuery(
|
|
248
|
+
return await runQuery(fullPath, body, cookie)
|
|
250
249
|
}
|
|
251
250
|
}
|
|
252
251
|
|
|
@@ -254,12 +253,16 @@ class QueryBuilder {
|
|
|
254
253
|
* Executes a lucene search query.
|
|
255
254
|
* @param url The query URL
|
|
256
255
|
* @param body The request body defining search criteria
|
|
256
|
+
* @param cookie The auth cookie for CouchDB
|
|
257
257
|
* @returns {Promise<{rows: []}>}
|
|
258
258
|
*/
|
|
259
|
-
const runQuery = async (url, body) => {
|
|
259
|
+
const runQuery = async (url, body, cookie) => {
|
|
260
260
|
const response = await fetch(url, {
|
|
261
261
|
body: JSON.stringify(body),
|
|
262
262
|
method: "POST",
|
|
263
|
+
headers: {
|
|
264
|
+
Authorization: cookie,
|
|
265
|
+
},
|
|
263
266
|
})
|
|
264
267
|
const json = await response.json()
|
|
265
268
|
|
package/src/constants/index.js
CHANGED
|
@@ -47,7 +47,11 @@ exports.FieldTypes = {
|
|
|
47
47
|
|
|
48
48
|
exports.CanSwitchTypes = [
|
|
49
49
|
[exports.FieldTypes.JSON, exports.FieldTypes.ARRAY],
|
|
50
|
-
[
|
|
50
|
+
[
|
|
51
|
+
exports.FieldTypes.STRING,
|
|
52
|
+
exports.FieldTypes.OPTIONS,
|
|
53
|
+
exports.FieldTypes.LONGFORM,
|
|
54
|
+
],
|
|
51
55
|
[exports.FieldTypes.BOOLEAN, exports.FieldTypes.NUMBER],
|
|
52
56
|
]
|
|
53
57
|
|
|
@@ -42,9 +42,9 @@ const SQL_STRING_TYPE_MAP = {
|
|
|
42
42
|
nvarchar: FieldTypes.STRING,
|
|
43
43
|
ntext: FieldTypes.STRING,
|
|
44
44
|
enum: FieldTypes.STRING,
|
|
45
|
-
blob: FieldTypes.
|
|
46
|
-
long: FieldTypes.
|
|
47
|
-
text: FieldTypes.
|
|
45
|
+
blob: FieldTypes.STRING,
|
|
46
|
+
long: FieldTypes.STRING,
|
|
47
|
+
text: FieldTypes.STRING,
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
const SQL_BOOLEAN_TYPE_MAP = {
|
|
@@ -207,11 +207,20 @@ function shouldCopySpecialColumn(
|
|
|
207
207
|
column: { type: string },
|
|
208
208
|
fetchedColumn: { type: string } | undefined
|
|
209
209
|
) {
|
|
210
|
+
const specialTypes = [
|
|
211
|
+
FieldTypes.OPTIONS,
|
|
212
|
+
FieldTypes.LONGFORM,
|
|
213
|
+
FieldTypes.ARRAY,
|
|
214
|
+
FieldTypes.FORMULA,
|
|
215
|
+
]
|
|
216
|
+
if (column && !fetchedColumn) {
|
|
217
|
+
return true
|
|
218
|
+
}
|
|
219
|
+
const fetchedIsNumber =
|
|
220
|
+
!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER
|
|
210
221
|
return (
|
|
211
|
-
column.type
|
|
212
|
-
column.type === FieldTypes.
|
|
213
|
-
((!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER) &&
|
|
214
|
-
column.type === FieldTypes.BOOLEAN)
|
|
222
|
+
specialTypes.indexOf(column.type) !== -1 ||
|
|
223
|
+
(fetchedIsNumber && column.type === FieldTypes.BOOLEAN)
|
|
215
224
|
)
|
|
216
225
|
}
|
|
217
226
|
|