@budibase/server 1.0.27-alpha.12 → 1.0.27-alpha.16
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.0dce895b.css → index.39e01193.css} +1 -1
- package/builder/assets/{index.cd16a193.js → index.7d39f11e.js} +239 -239
- package/builder/index.html +2 -2
- package/coverage/clover.xml +197 -194
- package/coverage/coverage-final.json +6 -6
- 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 +2 -2
- package/coverage/lcov-report/api/controllers/hosting.js.html +2 -2
- 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/index.html +1 -1
- package/coverage/lcov-report/api/controllers/query/index.js.html +7 -4
- 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 +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/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/table/internal.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 +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 +2 -2
- 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 +2 -2
- 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/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 +3 -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/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 +16 -16
- 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 +17 -5
- 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/middleware/utils.js.html +1 -1
- package/coverage/lcov-report/threads/automation.js.html +2 -2
- package/coverage/lcov-report/threads/index.html +28 -28
- package/coverage/lcov-report/threads/index.js.html +1 -1
- package/coverage/lcov-report/threads/query.js.html +181 -13
- package/coverage/lcov-report/threads/utils.js.html +11 -161
- package/coverage/lcov-report/utilities/bcrypt.js.html +1 -1
- package/coverage/lcov-report/utilities/budibaseDir.js.html +2 -2
- 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 +4 -4
- package/coverage/lcov-report/utilities/index.js.html +10 -10
- 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/users.js.html +1 -1
- package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
- package/coverage/lcov.info +373 -366
- package/dist/api/controllers/dev.js +1 -1
- package/dist/api/controllers/hosting.js +1 -1
- package/dist/api/controllers/query/index.js +3 -2
- package/dist/api/index.js +1 -1
- package/dist/automations/steps/executeQuery.js +1 -1
- package/dist/constants/index.js +2 -2
- package/dist/environment.js +1 -0
- package/dist/integrations/dynamodb.js +19 -0
- package/dist/integrations/rest.js +68 -19
- package/dist/integrations/s3.js +17 -8
- package/dist/middleware/currentapp.js +2 -2
- package/dist/package.json +4 -4
- package/dist/tests/utilities/TestConfiguration.js +2 -2
- package/dist/threads/automation.js +1 -1
- package/dist/threads/query.js +52 -3
- package/dist/threads/utils.js +0 -44
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utilities/budibaseDir.js +1 -1
- package/dist/utilities/fileSystem/utilities.js +1 -1
- package/dist/utilities/index.js +2 -2
- package/package.json +5 -5
- package/src/api/controllers/dev.js +1 -1
- package/src/api/controllers/hosting.js +1 -1
- package/src/api/controllers/query/index.js +3 -2
- package/src/api/index.js +1 -1
- package/src/automations/steps/executeQuery.js +1 -1
- package/src/constants/index.js +2 -2
- package/src/definitions/datasource.ts +15 -0
- package/src/environment.js +1 -0
- package/src/integrations/dynamodb.ts +18 -0
- package/src/integrations/rest.ts +78 -17
- package/src/integrations/s3.ts +18 -7
- package/src/integrations/tests/rest.spec.js +287 -24
- package/src/middleware/currentapp.js +7 -3
- package/src/middleware/tests/currentapp.spec.js +34 -40
- package/src/tests/utilities/TestConfiguration.js +2 -2
- package/src/threads/automation.js +1 -1
- package/src/threads/query.js +59 -3
- package/src/threads/utils.js +0 -50
- package/src/utilities/budibaseDir.js +1 -1
- package/src/utilities/fileSystem/utilities.js +1 -1
- package/src/utilities/index.js +2 -2
package/src/threads/utils.js
CHANGED
|
@@ -3,14 +3,10 @@ const CouchDB = require("../db")
|
|
|
3
3
|
const { init } = require("@budibase/backend-core")
|
|
4
4
|
const redis = require("@budibase/backend-core/redis")
|
|
5
5
|
const { SEPARATOR } = require("@budibase/backend-core/db")
|
|
6
|
-
const { processStringSync } = require("@budibase/string-templates")
|
|
7
6
|
|
|
8
7
|
const VARIABLE_TTL_SECONDS = 3600
|
|
9
8
|
let client
|
|
10
9
|
|
|
11
|
-
const IS_TRIPLE_BRACE = new RegExp(/^{{3}.*}{3}$/)
|
|
12
|
-
const IS_HANDLEBARS = new RegExp(/^{{2}.*}{2}$/)
|
|
13
|
-
|
|
14
10
|
async function getClient() {
|
|
15
11
|
if (!client) {
|
|
16
12
|
client = await new redis.Client(redis.utils.Databases.QUERY_VARS).init()
|
|
@@ -80,49 +76,3 @@ exports.hasExtraData = response => {
|
|
|
80
76
|
response.info != null
|
|
81
77
|
)
|
|
82
78
|
}
|
|
83
|
-
|
|
84
|
-
exports.enrichQueryFields = (fields, parameters = {}) => {
|
|
85
|
-
const enrichedQuery = {}
|
|
86
|
-
|
|
87
|
-
// enrich the fields with dynamic parameters
|
|
88
|
-
for (let key of Object.keys(fields)) {
|
|
89
|
-
if (fields[key] == null) {
|
|
90
|
-
continue
|
|
91
|
-
}
|
|
92
|
-
if (typeof fields[key] === "object") {
|
|
93
|
-
// enrich nested fields object
|
|
94
|
-
enrichedQuery[key] = this.enrichQueryFields(fields[key], parameters)
|
|
95
|
-
} else if (typeof fields[key] === "string") {
|
|
96
|
-
// enrich string value as normal
|
|
97
|
-
let value = fields[key]
|
|
98
|
-
// add triple brace to avoid escaping e.g. '=' in cookie header
|
|
99
|
-
if (IS_HANDLEBARS.test(value) && !IS_TRIPLE_BRACE.test(value)) {
|
|
100
|
-
value = `{${value}}`
|
|
101
|
-
}
|
|
102
|
-
enrichedQuery[key] = processStringSync(value, parameters, {
|
|
103
|
-
noHelpers: true,
|
|
104
|
-
})
|
|
105
|
-
} else {
|
|
106
|
-
enrichedQuery[key] = fields[key]
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
if (
|
|
111
|
-
enrichedQuery.json ||
|
|
112
|
-
enrichedQuery.customData ||
|
|
113
|
-
enrichedQuery.requestBody
|
|
114
|
-
) {
|
|
115
|
-
try {
|
|
116
|
-
enrichedQuery.json = JSON.parse(
|
|
117
|
-
enrichedQuery.json ||
|
|
118
|
-
enrichedQuery.customData ||
|
|
119
|
-
enrichedQuery.requestBody
|
|
120
|
-
)
|
|
121
|
-
} catch (err) {
|
|
122
|
-
// no json found, ignore
|
|
123
|
-
}
|
|
124
|
-
delete enrichedQuery.customData
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return enrichedQuery
|
|
128
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { join } = require("./centralPath")
|
|
2
2
|
const { homedir } = require("os")
|
|
3
3
|
const env = require("../environment")
|
|
4
|
-
const { budibaseTempDir } = require("@budibase/backend-core")
|
|
4
|
+
const { budibaseTempDir } = require("@budibase/backend-core/objectStore")
|
|
5
5
|
|
|
6
6
|
module.exports.budibaseAppsDir = function () {
|
|
7
7
|
return env.BUDIBASE_DIR || join(homedir(), ".budibase")
|
package/src/utilities/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const env = require("../environment")
|
|
2
2
|
const { OBJ_STORE_DIRECTORY } = require("../constants")
|
|
3
|
-
const { sanitizeKey } = require("@budibase/backend-core/
|
|
3
|
+
const { sanitizeKey } = require("@budibase/backend-core/objectStore")
|
|
4
4
|
const CouchDB = require("../db")
|
|
5
5
|
const { generateMetadataID } = require("../db/utils")
|
|
6
6
|
const Readable = require("stream").Readable
|
|
@@ -34,7 +34,7 @@ exports.checkSlashesInUrl = url => {
|
|
|
34
34
|
* @return {string} The base URL of the object store (MinIO or S3).
|
|
35
35
|
*/
|
|
36
36
|
exports.objectStoreUrl = () => {
|
|
37
|
-
if (env.SELF_HOSTED) {
|
|
37
|
+
if (env.SELF_HOSTED || env.MINIO_URL) {
|
|
38
38
|
// can use a relative url for this as all goes through the proxy (this is hosted in minio)
|
|
39
39
|
return OBJ_STORE_DIRECTORY
|
|
40
40
|
} else {
|