@budibase/server 1.0.138 → 1.0.141
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.a48ac266.js → index.ac01847e.js} +90 -90
- package/builder/index.html +1 -1
- package/coverage/clover.xml +79 -64
- 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 +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/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 +46 -10
- package/coverage/lcov-report/automations/bullboard.js.html +1 -1
- package/coverage/lcov-report/automations/index.html +19 -19
- 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 +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/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 +29 -29
- 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 +103 -22
- package/coverage/lcov-report/threads/index.html +19 -19
- 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 +137 -106
- package/dist/automations/automationUtils.js +12 -0
- package/dist/package.json +5 -5
- package/dist/threads/automation.js +30 -9
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/src/automations/automationUtils.js +12 -0
- package/src/threads/automation.js +36 -9
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.141",
|
|
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.141",
|
|
72
|
+
"@budibase/client": "^1.0.141",
|
|
73
|
+
"@budibase/pro": "1.0.140",
|
|
74
|
+
"@budibase/string-templates": "^1.0.141",
|
|
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": "6a7c52fc841551314addd695bad28a22a1f1f29b"
|
|
184
184
|
}
|
|
@@ -86,3 +86,15 @@ exports.substituteLoopStep = (hbsString, substitute) => {
|
|
|
86
86
|
|
|
87
87
|
return hbsString
|
|
88
88
|
}
|
|
89
|
+
|
|
90
|
+
exports.stringSplit = value => {
|
|
91
|
+
if (value == null) {
|
|
92
|
+
return []
|
|
93
|
+
}
|
|
94
|
+
if (value.split("\n").length > 1) {
|
|
95
|
+
value = value.split("\n")
|
|
96
|
+
} else {
|
|
97
|
+
value = value.split(",")
|
|
98
|
+
}
|
|
99
|
+
return value
|
|
100
|
+
}
|
|
@@ -117,15 +117,17 @@ class Orchestrator {
|
|
|
117
117
|
if (loopStep) {
|
|
118
118
|
input = await processObject(loopStep.inputs, this._context)
|
|
119
119
|
}
|
|
120
|
-
let iterations = loopStep
|
|
120
|
+
let iterations = loopStep
|
|
121
|
+
? Array.isArray(input.binding)
|
|
122
|
+
? input.binding.length
|
|
123
|
+
: automationUtils.stringSplit(input.binding).length
|
|
124
|
+
: 1
|
|
121
125
|
let iterationCount = 0
|
|
122
126
|
for (let index = 0; index < iterations; index++) {
|
|
123
127
|
let originalStepInput = cloneDeep(step.inputs)
|
|
124
128
|
|
|
125
129
|
// Handle if the user has set a max iteration count or if it reaches the max limit set by us
|
|
126
130
|
if (loopStep) {
|
|
127
|
-
// lets first of all handle the input
|
|
128
|
-
// if the input is array then use it, if it is a string then split it on every new line
|
|
129
131
|
let newInput = await processObject(
|
|
130
132
|
loopStep.inputs,
|
|
131
133
|
cloneDeep(this._context)
|
|
@@ -134,9 +136,6 @@ class Orchestrator {
|
|
|
134
136
|
newInput,
|
|
135
137
|
loopStep.schema.inputs
|
|
136
138
|
)
|
|
137
|
-
this._context.steps[loopStepNumber] = {
|
|
138
|
-
currentItem: newInput.binding[index],
|
|
139
|
-
}
|
|
140
139
|
|
|
141
140
|
let tempOutput = { items: loopSteps, iterations: iterationCount }
|
|
142
141
|
if (
|
|
@@ -154,6 +153,20 @@ class Orchestrator {
|
|
|
154
153
|
break
|
|
155
154
|
}
|
|
156
155
|
|
|
156
|
+
let item
|
|
157
|
+
if (
|
|
158
|
+
typeof loopStep.inputs.binding === "string" &&
|
|
159
|
+
loopStep.inputs.option === "String"
|
|
160
|
+
) {
|
|
161
|
+
item = automationUtils.stringSplit(newInput.binding)
|
|
162
|
+
} else {
|
|
163
|
+
item = loopStep.inputs.binding
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
this._context.steps[loopStepNumber] = {
|
|
167
|
+
currentItem: item[index],
|
|
168
|
+
}
|
|
169
|
+
|
|
157
170
|
// The "Loop" binding in the front end is "fake", so replace it here so the context can understand it
|
|
158
171
|
// Pretty hacky because we need to account for the row object
|
|
159
172
|
for (let [key, value] of Object.entries(originalStepInput)) {
|
|
@@ -178,7 +191,6 @@ class Orchestrator {
|
|
|
178
191
|
}
|
|
179
192
|
}
|
|
180
193
|
}
|
|
181
|
-
|
|
182
194
|
if (
|
|
183
195
|
index === parseInt(env.AUTOMATION_MAX_ITERATIONS) ||
|
|
184
196
|
index === loopStep.inputs.iterations
|
|
@@ -192,10 +204,25 @@ class Orchestrator {
|
|
|
192
204
|
break
|
|
193
205
|
}
|
|
194
206
|
|
|
207
|
+
let isFailure = false
|
|
195
208
|
if (
|
|
196
|
-
this._context.steps[loopStepNumber]?.currentItem ===
|
|
197
|
-
loopStep.inputs.failure
|
|
209
|
+
typeof this._context.steps[loopStepNumber]?.currentItem === "object"
|
|
198
210
|
) {
|
|
211
|
+
isFailure = Object.keys(
|
|
212
|
+
this._context.steps[loopStepNumber].currentItem
|
|
213
|
+
).some(value => {
|
|
214
|
+
return (
|
|
215
|
+
this._context.steps[loopStepNumber].currentItem[value] ===
|
|
216
|
+
loopStep.inputs.failure
|
|
217
|
+
)
|
|
218
|
+
})
|
|
219
|
+
} else {
|
|
220
|
+
isFailure =
|
|
221
|
+
this._context.steps[loopStepNumber]?.currentItem ===
|
|
222
|
+
loopStep.inputs.failure
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (isFailure) {
|
|
199
226
|
this.updateContextAndOutput(loopStepNumber, step, tempOutput, {
|
|
200
227
|
status: AutomationErrors.FAILURE_CONDITION,
|
|
201
228
|
success: false,
|