@budibase/server 2.4.44-alpha.1 → 2.4.44-alpha.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/server",
3
3
  "email": "hi@budibase.com",
4
- "version": "2.4.44-alpha.1",
4
+ "version": "2.4.44-alpha.2",
5
5
  "description": "Budibase Web Server",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -44,12 +44,12 @@
44
44
  "license": "GPL-3.0",
45
45
  "dependencies": {
46
46
  "@apidevtools/swagger-parser": "10.0.3",
47
- "@budibase/backend-core": "2.4.44-alpha.1",
48
- "@budibase/client": "2.4.44-alpha.1",
49
- "@budibase/pro": "2.4.44-alpha.0",
50
- "@budibase/shared-core": "2.4.44-alpha.1",
51
- "@budibase/string-templates": "2.4.44-alpha.1",
52
- "@budibase/types": "2.4.44-alpha.1",
47
+ "@budibase/backend-core": "2.4.44-alpha.2",
48
+ "@budibase/client": "2.4.44-alpha.2",
49
+ "@budibase/pro": "2.4.44-alpha.1",
50
+ "@budibase/shared-core": "2.4.44-alpha.2",
51
+ "@budibase/string-templates": "2.4.44-alpha.2",
52
+ "@budibase/types": "2.4.44-alpha.2",
53
53
  "@bull-board/api": "3.7.0",
54
54
  "@bull-board/koa": "3.9.4",
55
55
  "@elastic/elasticsearch": "7.10.0",
@@ -176,5 +176,5 @@
176
176
  "optionalDependencies": {
177
177
  "oracledb": "5.3.0"
178
178
  },
179
- "gitHead": "2597bbe05cd384874fad4f4da9ffd525117dcacf"
179
+ "gitHead": "5fbbef1a1a350a2efc1cd582bc7e2982183dea29"
180
180
  }
@@ -34,8 +34,8 @@ const STOPPED_STATUS = { success: true, status: AutomationStatus.STOPPED }
34
34
 
35
35
  function getLoopIterations(loopStep: LoopStep, input: LoopInput) {
36
36
  const binding = automationUtils.typecastForLooping(loopStep, input)
37
- if (!loopStep || !binding) {
38
- return 1
37
+ if (!binding) {
38
+ return 0
39
39
  }
40
40
  if (Array.isArray(binding)) {
41
41
  return binding.length
@@ -43,7 +43,7 @@ function getLoopIterations(loopStep: LoopStep, input: LoopInput) {
43
43
  if (typeof binding === "string") {
44
44
  return automationUtils.stringSplit(binding).length
45
45
  }
46
- return 1
46
+ return 0
47
47
  }
48
48
 
49
49
  /**
@@ -423,13 +423,25 @@ class Orchestrator {
423
423
  }
424
424
  }
425
425
 
426
+ if (loopStep && iterations === 0) {
427
+ loopStep = undefined
428
+ this.executionOutput.steps.splice(loopStepNumber + 1, 0, {
429
+ id: step.id,
430
+ stepId: step.stepId,
431
+ outputs: { status: AutomationStatus.NO_ITERATIONS, success: true },
432
+ inputs: {},
433
+ })
434
+
435
+ this._context.steps.splice(loopStepNumber, 1)
436
+ iterations = 1
437
+ }
438
+
426
439
  // Delete the step after the loop step as it's irrelevant, since information is included
427
440
  // in the loop step
428
441
  if (wasLoopStep && !loopStep) {
429
442
  this._context.steps.splice(loopStepNumber + 1, 1)
430
443
  wasLoopStep = false
431
444
  }
432
-
433
445
  if (loopSteps && loopSteps.length) {
434
446
  let tempOutput = {
435
447
  success: true,