@budibase/server 1.3.13 → 1.3.14

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.
Files changed (187) hide show
  1. package/builder/assets/{index.e50bda9f.css → index.a70e216a.css} +1 -1
  2. package/builder/assets/{index.fb22f106.js → index.d8428ac8.js} +166 -165
  3. package/builder/index.html +2 -2
  4. package/coverage/clover.xml +90 -68
  5. package/coverage/coverage-final.json +7 -7
  6. package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
  7. package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
  8. package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
  9. package/coverage/lcov-report/api/controllers/backup.js.html +8 -5
  10. package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
  11. package/coverage/lcov-report/api/controllers/component.js.html +1 -1
  12. package/coverage/lcov-report/api/controllers/datasource.js.html +1 -1
  13. package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
  14. package/coverage/lcov-report/api/controllers/index.html +7 -7
  15. package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
  16. package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
  17. package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
  18. package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
  19. package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
  20. package/coverage/lcov-report/api/controllers/query/index.html +1 -1
  21. package/coverage/lcov-report/api/controllers/query/validation.js.html +1 -1
  22. package/coverage/lcov-report/api/controllers/role.js.html +1 -1
  23. package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
  24. package/coverage/lcov-report/api/controllers/row/external.js.html +1 -1
  25. package/coverage/lcov-report/api/controllers/row/index.html +1 -1
  26. package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
  27. package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1 -1
  28. package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
  29. package/coverage/lcov-report/api/controllers/row/utils.js.html +1 -1
  30. package/coverage/lcov-report/api/controllers/screen.js.html +1 -1
  31. package/coverage/lcov-report/api/controllers/script.js.html +1 -1
  32. package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
  33. package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
  34. package/coverage/lcov-report/api/controllers/table/index.html +1 -1
  35. package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
  36. package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
  37. package/coverage/lcov-report/api/controllers/user.js.html +1 -1
  38. package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
  39. package/coverage/lcov-report/api/controllers/view/index.html +1 -1
  40. package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
  41. package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
  42. package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
  43. package/coverage/lcov-report/api/controllers/webhook.js.html +1 -1
  44. package/coverage/lcov-report/api/index.html +1 -1
  45. package/coverage/lcov-report/api/index.js.html +1 -1
  46. package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
  47. package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
  48. package/coverage/lcov-report/api/routes/auth.js.html +1 -1
  49. package/coverage/lcov-report/api/routes/automation.js.html +1 -1
  50. package/coverage/lcov-report/api/routes/backup.js.html +1 -1
  51. package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
  52. package/coverage/lcov-report/api/routes/component.js.html +1 -1
  53. package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
  54. package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
  55. package/coverage/lcov-report/api/routes/dev.js.html +1 -1
  56. package/coverage/lcov-report/api/routes/index.html +1 -1
  57. package/coverage/lcov-report/api/routes/integration.js.html +1 -1
  58. package/coverage/lcov-report/api/routes/layout.js.html +1 -1
  59. package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
  60. package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
  61. package/coverage/lcov-report/api/routes/permission.js.html +1 -1
  62. package/coverage/lcov-report/api/routes/query.js.html +1 -1
  63. package/coverage/lcov-report/api/routes/role.js.html +1 -1
  64. package/coverage/lcov-report/api/routes/routing.js.html +1 -1
  65. package/coverage/lcov-report/api/routes/screen.js.html +1 -1
  66. package/coverage/lcov-report/api/routes/script.js.html +1 -1
  67. package/coverage/lcov-report/api/routes/table.js.html +1 -1
  68. package/coverage/lcov-report/api/routes/templates.js.html +1 -1
  69. package/coverage/lcov-report/api/routes/user.js.html +1 -1
  70. package/coverage/lcov-report/api/routes/utils/index.html +1 -1
  71. package/coverage/lcov-report/api/routes/utils/validators.js.html +1 -1
  72. package/coverage/lcov-report/api/routes/view.js.html +1 -1
  73. package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
  74. package/coverage/lcov-report/automations/actions.js.html +1 -1
  75. package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
  76. package/coverage/lcov-report/automations/bullboard.js.html +1 -1
  77. package/coverage/lcov-report/automations/index.html +24 -24
  78. package/coverage/lcov-report/automations/index.js.html +18 -9
  79. package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
  80. package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
  81. package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
  82. package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
  83. package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
  84. package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
  85. package/coverage/lcov-report/automations/steps/index.html +1 -1
  86. package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
  87. package/coverage/lcov-report/automations/steps/loop.js.html +1 -1
  88. package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
  89. package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
  90. package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
  91. package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
  92. package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
  93. package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
  94. package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
  95. package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
  96. package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
  97. package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
  98. package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
  99. package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
  100. package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
  101. package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
  102. package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
  103. package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
  104. package/coverage/lcov-report/automations/triggers.js.html +126 -24
  105. package/coverage/lcov-report/constants/index.html +1 -1
  106. package/coverage/lcov-report/constants/index.js.html +1 -1
  107. package/coverage/lcov-report/constants/layouts.js.html +1 -1
  108. package/coverage/lcov-report/constants/screens.js.html +1 -1
  109. package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
  110. package/coverage/lcov-report/db/index.html +1 -1
  111. package/coverage/lcov-report/db/index.js.html +1 -1
  112. package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
  113. package/coverage/lcov-report/db/linkedRows/index.html +1 -1
  114. package/coverage/lcov-report/db/linkedRows/index.js.html +1 -1
  115. package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +1 -1
  116. package/coverage/lcov-report/db/newid.js.html +1 -1
  117. package/coverage/lcov-report/db/utils.js.html +5 -5
  118. package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
  119. package/coverage/lcov-report/events/index.html +1 -1
  120. package/coverage/lcov-report/events/index.js.html +1 -1
  121. package/coverage/lcov-report/events/utils.js.html +1 -1
  122. package/coverage/lcov-report/index.html +34 -34
  123. package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
  124. package/coverage/lcov-report/integrations/tests/index.html +1 -1
  125. package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
  126. package/coverage/lcov-report/middleware/builder.js.html +1 -1
  127. package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
  128. package/coverage/lcov-report/middleware/index.html +1 -1
  129. package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
  130. package/coverage/lcov-report/middleware/publicApi.js.html +1 -1
  131. package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
  132. package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
  133. package/coverage/lcov-report/middleware/utils.js.html +1 -1
  134. package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
  135. package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
  136. package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
  137. package/coverage/lcov-report/utilities/global.js.html +1 -1
  138. package/coverage/lcov-report/utilities/index.html +19 -19
  139. package/coverage/lcov-report/utilities/index.js.html +40 -16
  140. package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
  141. package/coverage/lcov-report/utilities/queue/index.html +1 -1
  142. package/coverage/lcov-report/utilities/routing/index.html +1 -1
  143. package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
  144. package/coverage/lcov-report/utilities/rowProcessor/index.html +5 -5
  145. package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
  146. package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +4 -4
  147. package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
  148. package/coverage/lcov-report/utilities/security.js.html +1 -1
  149. package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
  150. package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
  151. package/coverage/lcov-report/utilities/usageQuota/rows.js.html +6 -3
  152. package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
  153. package/coverage/lcov-report/utilities/users.js.html +1 -1
  154. package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
  155. package/coverage/lcov.info +167 -127
  156. package/dist/api/controllers/application.js +1 -5
  157. package/dist/api/controllers/backup.js +2 -1
  158. package/dist/api/controllers/deploy/index.js +17 -2
  159. package/dist/api/controllers/row/ExternalRequest.js +1 -1
  160. package/dist/automations/index.js +10 -5
  161. package/dist/automations/triggers.js +39 -5
  162. package/dist/automations/utils.js +16 -7
  163. package/dist/integrations/rest.js +16 -1
  164. package/dist/package.json +6 -6
  165. package/dist/threads/automation.js +6 -0
  166. package/dist/tsconfig.build.tsbuildinfo +1 -1
  167. package/dist/utilities/fileSystem/index.js +6 -6
  168. package/dist/utilities/index.js +8 -0
  169. package/dist/utilities/rowProcessor/utils.js +1 -1
  170. package/dist/utilities/usageQuota/rows.js +2 -1
  171. package/package.json +7 -7
  172. package/src/api/controllers/application.ts +1 -5
  173. package/src/api/controllers/backup.js +2 -1
  174. package/src/api/controllers/deploy/index.ts +17 -4
  175. package/src/api/controllers/row/ExternalRequest.ts +1 -1
  176. package/src/api/routes/tests/query.spec.js +3 -3
  177. package/src/automations/index.js +6 -3
  178. package/src/automations/triggers.js +44 -10
  179. package/src/automations/utils.ts +21 -9
  180. package/src/definitions/datasource.ts +1 -0
  181. package/src/integrations/rest.ts +14 -1
  182. package/src/integrations/tests/rest.spec.js +38 -3
  183. package/src/threads/automation.ts +6 -0
  184. package/src/utilities/fileSystem/index.js +6 -6
  185. package/src/utilities/index.js +8 -0
  186. package/src/utilities/rowProcessor/utils.js +1 -1
  187. package/src/utilities/usageQuota/rows.js +2 -1
@@ -283,7 +283,7 @@ exports.CURRENTLY_SUPPORTED_LEVELS = CURRENTLY_SUPPORTED_LEVELS
283
283
  <div class='footer quiet pad2 space-top1 center small'>
284
284
  Code coverage generated by
285
285
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
286
- at Mon Sep 12 2022 08:31:07 GMT+0000 (Coordinated Universal Time)
286
+ at Mon Sep 12 2022 11:44:23 GMT+0000 (Coordinated Universal Time)
287
287
  </div>
288
288
  <script src="../prettify.js"></script>
289
289
  <script>
@@ -91,7 +91,7 @@
91
91
  <div class='footer quiet pad2 space-top1 center small'>
92
92
  Code coverage generated by
93
93
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
94
- at Mon Sep 12 2022 08:31:07 GMT+0000 (Coordinated Universal Time)
94
+ at Mon Sep 12 2022 11:44:23 GMT+0000 (Coordinated Universal Time)
95
95
  </div>
96
96
  <script src="../prettify.js"></script>
97
97
  <script>
@@ -116,7 +116,7 @@
116
116
  <div class='footer quiet pad2 space-top1 center small'>
117
117
  Code coverage generated by
118
118
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
119
- at Mon Sep 12 2022 08:31:07 GMT+0000 (Coordinated Universal Time)
119
+ at Mon Sep 12 2022 11:44:23 GMT+0000 (Coordinated Universal Time)
120
120
  </div>
121
121
  <script src="../../prettify.js"></script>
122
122
  <script>
@@ -142,7 +142,8 @@
142
142
  <a name='L77'></a><a href='#L77'>77</a>
143
143
  <a name='L78'></a><a href='#L78'>78</a>
144
144
  <a name='L79'></a><a href='#L79'>79</a>
145
- <a name='L80'></a><a href='#L80'>80</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">44x</span>
145
+ <a name='L80'></a><a href='#L80'>80</a>
146
+ <a name='L81'></a><a href='#L81'>81</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">44x</span>
146
147
  <span class="cline-any cline-neutral">&nbsp;</span>
147
148
  <span class="cline-any cline-neutral">&nbsp;</span>
148
149
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -216,6 +217,7 @@
216
217
  <span class="cline-any cline-neutral">&nbsp;</span>
217
218
  <span class="cline-any cline-neutral">&nbsp;</span>
218
219
  <span class="cline-any cline-neutral">&nbsp;</span>
220
+ <span class="cline-any cline-neutral">&nbsp;</span>
219
221
  <span class="cline-any cline-yes">28x</span>
220
222
  <span class="cline-any cline-neutral">&nbsp;</span>
221
223
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -295,7 +297,8 @@ exports.getUniqueRows = async appIds =&gt; {
295
297
  // ensure uniqueness on a per app pair basis
296
298
  // this can't be done on all rows because app import results in
297
299
  // duplicate row ids across apps
298
- uniqueRows = uniqueRows.concat(...new Set(appRows))
300
+ // the array pre-concat is important to avoid stack overflow
301
+ uniqueRows = uniqueRows.concat([...new Set(appRows)])
299
302
  }
300
303
  &nbsp;
301
304
  return uniqueRows
@@ -307,7 +310,7 @@ exports.getUniqueRows = async appIds =&gt; {
307
310
  <div class='footer quiet pad2 space-top1 center small'>
308
311
  Code coverage generated by
309
312
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
310
- at Mon Sep 12 2022 08:31:07 GMT+0000 (Coordinated Universal Time)
313
+ at Mon Sep 12 2022 11:44:23 GMT+0000 (Coordinated Universal Time)
311
314
  </div>
312
315
  <script src="../../prettify.js"></script>
313
316
  <script>
@@ -124,7 +124,7 @@ function <span class="fstat-no" title="function not covered" >resetQuotasIfRequi
124
124
  <div class='footer quiet pad2 space-top1 center small'>
125
125
  Code coverage generated by
126
126
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
127
- at Mon Sep 12 2022 08:31:07 GMT+0000 (Coordinated Universal Time)
127
+ at Mon Sep 12 2022 11:44:23 GMT+0000 (Coordinated Universal Time)
128
128
  </div>
129
129
  <script src="../../prettify.js"></script>
130
130
  <script>
@@ -205,7 +205,7 @@ exports.publicApiUserFix = ctx =&gt; {
205
205
  <div class='footer quiet pad2 space-top1 center small'>
206
206
  Code coverage generated by
207
207
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
208
- at Mon Sep 12 2022 08:31:07 GMT+0000 (Coordinated Universal Time)
208
+ at Mon Sep 12 2022 11:44:23 GMT+0000 (Coordinated Universal Time)
209
209
  </div>
210
210
  <script src="../prettify.js"></script>
211
211
  <script>
@@ -535,7 +535,7 @@ exports.getChecklist = <span class="fstat-no" title="function not covered" >as</
535
535
  <div class='footer quiet pad2 space-top1 center small'>
536
536
  Code coverage generated by
537
537
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
538
- at Mon Sep 12 2022 08:31:07 GMT+0000 (Coordinated Universal Time)
538
+ at Mon Sep 12 2022 11:44:23 GMT+0000 (Coordinated Universal Time)
539
539
  </div>
540
540
  <script src="../prettify.js"></script>
541
541
  <script>
@@ -377,8 +377,8 @@ BRH:25
377
377
  end_of_record
378
378
  TN:
379
379
  SF:src/api/controllers/backup.js
380
- FN:5,(anonymous_0)
381
- FN:13,(anonymous_1)
380
+ FN:6,(anonymous_0)
381
+ FN:14,(anonymous_1)
382
382
  FNF:2
383
383
  FNH:2
384
384
  FNDA:1,(anonymous_0)
@@ -386,19 +386,20 @@ FNDA:1,(anonymous_1)
386
386
  DA:1,28
387
387
  DA:2,28
388
388
  DA:3,28
389
- DA:5,28
390
- DA:6,1
389
+ DA:4,28
390
+ DA:6,28
391
391
  DA:7,1
392
392
  DA:8,1
393
393
  DA:9,1
394
394
  DA:10,1
395
395
  DA:11,1
396
- DA:13,1
396
+ DA:12,1
397
397
  DA:14,1
398
398
  DA:15,1
399
399
  DA:16,1
400
- LF:14
401
- LH:14
400
+ DA:17,1
401
+ LF:15
402
+ LH:15
402
403
  BRF:0
403
404
  BRH:0
404
405
  end_of_record
@@ -4724,8 +4725,8 @@ TN:
4724
4725
  SF:src/automations/index.js
4725
4726
  FN:9,(anonymous_0)
4726
4727
  FN:11,(anonymous_1)
4727
- FN:16,(anonymous_2)
4728
- FN:20,(anonymous_3)
4728
+ FN:19,(anonymous_2)
4729
+ FN:23,(anonymous_3)
4729
4730
  FNF:4
4730
4731
  FNH:2
4731
4732
  FNDA:32,(anonymous_0)
@@ -4739,38 +4740,46 @@ DA:4,44
4739
4740
  DA:9,44
4740
4741
  DA:11,32
4741
4742
  DA:12,8
4742
- DA:16,44
4743
- DA:17,0
4744
- DA:20,44
4745
- DA:21,0
4746
- DA:24,44
4747
- DA:25,44
4748
- DA:26,44
4749
- LF:14
4750
- LH:12
4743
+ DA:15,32
4744
+ DA:16,32
4745
+ DA:19,44
4746
+ DA:20,0
4747
+ DA:23,44
4748
+ DA:24,0
4749
+ DA:27,44
4750
+ DA:28,44
4751
+ DA:29,44
4752
+ LF:16
4753
+ LH:14
4751
4754
  BRF:0
4752
4755
  BRH:0
4753
4756
  end_of_record
4754
4757
  TN:
4755
4758
  SF:src/automations/triggers.js
4756
- FN:19,queueRelevantRowAutomations
4757
- FN:24,(anonymous_1)
4758
- FN:32,(anonymous_2)
4759
+ FN:20,getAllAutomations
4760
+ FN:25,(anonymous_1)
4761
+ FN:28,queueRelevantRowAutomations
4759
4762
  FN:33,(anonymous_3)
4760
- FN:61,(anonymous_4)
4761
- FN:69,(anonymous_5)
4762
- FN:77,(anonymous_6)
4763
- FN:85,(anonymous_7)
4764
- FNF:8
4765
- FNH:8
4763
+ FN:37,(anonymous_4)
4764
+ FN:65,(anonymous_5)
4765
+ FN:73,(anonymous_6)
4766
+ FN:81,(anonymous_7)
4767
+ FN:89,(anonymous_8)
4768
+ FN:117,(anonymous_9)
4769
+ FN:127,(anonymous_10)
4770
+ FNF:11
4771
+ FNH:11
4772
+ FNDA:23,getAllAutomations
4773
+ FNDA:4,(anonymous_1)
4766
4774
  FNDA:17,queueRelevantRowAutomations
4767
- FNDA:17,(anonymous_1)
4768
- FNDA:4,(anonymous_2)
4769
- FNDA:4,(anonymous_3)
4770
- FNDA:7,(anonymous_4)
4771
- FNDA:4,(anonymous_5)
4772
- FNDA:6,(anonymous_6)
4775
+ FNDA:17,(anonymous_3)
4776
+ FNDA:4,(anonymous_4)
4777
+ FNDA:7,(anonymous_5)
4778
+ FNDA:4,(anonymous_6)
4773
4779
  FNDA:6,(anonymous_7)
4780
+ FNDA:6,(anonymous_8)
4781
+ FNDA:32,(anonymous_9)
4782
+ FNDA:6,(anonymous_10)
4774
4783
  DA:1,45
4775
4784
  DA:2,45
4776
4785
  DA:3,45
@@ -4781,73 +4790,94 @@ DA:8,45
4781
4790
  DA:9,45
4782
4791
  DA:10,45
4783
4792
  DA:11,45
4784
- DA:13,45
4793
+ DA:12,45
4785
4794
  DA:14,45
4786
- DA:20,17
4787
- DA:21,0
4788
- DA:24,17
4789
- DA:25,17
4790
- DA:26,17
4791
- DA:31,17
4792
- DA:32,4
4793
- DA:34,4
4794
- DA:35,4
4795
- DA:38,17
4795
+ DA:15,45
4796
+ DA:21,23
4797
+ DA:22,23
4798
+ DA:25,23
4799
+ DA:29,17
4800
+ DA:30,0
4801
+ DA:33,17
4802
+ DA:34,17
4803
+ DA:37,17
4804
+ DA:38,4
4796
4805
  DA:39,4
4797
- DA:40,4
4806
+ DA:42,17
4807
+ DA:43,4
4798
4808
  DA:44,4
4799
- DA:49,0
4800
- DA:51,4
4809
+ DA:48,4
4810
+ DA:53,0
4801
4811
  DA:55,4
4802
- DA:61,45
4803
- DA:66,7
4804
- DA:69,45
4805
- DA:74,4
4806
- DA:77,45
4807
- DA:82,6
4808
- DA:85,45
4809
- DA:90,6
4810
- DA:98,1
4811
- DA:99,1
4812
- DA:100,1
4813
- DA:101,1
4812
+ DA:59,4
4813
+ DA:65,45
4814
+ DA:70,7
4815
+ DA:73,45
4816
+ DA:78,4
4817
+ DA:81,45
4818
+ DA:86,6
4819
+ DA:89,45
4820
+ DA:94,6
4821
+ DA:102,1
4814
4822
  DA:103,1
4815
- DA:105,6
4816
- DA:106,6
4817
- DA:107,2
4818
- DA:109,4
4819
- DA:113,45
4820
- LF:46
4821
- LH:44
4822
- BRDA:20,0,0,0
4823
- BRDA:20,0,1,17
4824
- BRDA:35,1,0,4
4825
- BRDA:35,1,1,4
4826
- BRDA:40,2,0,4
4827
- BRDA:40,2,1,0
4828
- BRDA:44,3,0,0
4829
- BRDA:44,3,1,4
4830
- BRDA:45,4,0,4
4831
- BRDA:45,4,1,4
4832
- BRDA:45,4,2,4
4833
- BRDA:51,5,0,4
4834
- BRDA:51,5,1,0
4835
- BRDA:52,6,0,4
4836
- BRDA:52,6,1,4
4837
- BRDA:88,7,0,4
4838
- BRDA:90,8,0,1
4839
- BRDA:90,8,1,5
4840
- BRDA:91,9,0,6
4841
- BRDA:91,9,1,6
4842
- BRDA:91,9,2,6
4843
- BRDA:91,9,3,1
4844
- BRDA:91,9,4,1
4845
- BRDA:100,10,0,1
4846
- BRDA:100,10,1,0
4847
- BRDA:106,11,0,2
4848
- BRDA:106,11,1,4
4849
- BRF:27
4850
- BRH:22
4823
+ DA:104,1
4824
+ DA:105,1
4825
+ DA:107,1
4826
+ DA:109,6
4827
+ DA:110,6
4828
+ DA:111,2
4829
+ DA:113,4
4830
+ DA:117,45
4831
+ DA:120,32
4832
+ DA:121,0
4833
+ DA:125,32
4834
+ DA:126,32
4835
+ DA:127,6
4836
+ DA:128,6
4837
+ DA:129,6
4838
+ DA:130,6
4839
+ DA:131,0
4840
+ DA:132,0
4841
+ DA:139,0
4842
+ DA:142,6
4843
+ DA:147,45
4844
+ LF:61
4845
+ LH:55
4846
+ BRDA:29,0,0,0
4847
+ BRDA:29,0,1,17
4848
+ BRDA:39,1,0,4
4849
+ BRDA:39,1,1,4
4850
+ BRDA:44,2,0,4
4851
+ BRDA:44,2,1,0
4852
+ BRDA:48,3,0,0
4853
+ BRDA:48,3,1,4
4854
+ BRDA:49,4,0,4
4855
+ BRDA:49,4,1,4
4856
+ BRDA:49,4,2,4
4857
+ BRDA:55,5,0,4
4858
+ BRDA:55,5,1,0
4859
+ BRDA:56,6,0,4
4860
+ BRDA:56,6,1,4
4861
+ BRDA:92,7,0,4
4862
+ BRDA:94,8,0,1
4863
+ BRDA:94,8,1,5
4864
+ BRDA:95,9,0,6
4865
+ BRDA:95,9,1,6
4866
+ BRDA:95,9,2,6
4867
+ BRDA:95,9,3,1
4868
+ BRDA:95,9,4,1
4869
+ BRDA:104,10,0,1
4870
+ BRDA:104,10,1,0
4871
+ BRDA:110,11,0,2
4872
+ BRDA:110,11,1,4
4873
+ BRDA:120,12,0,0
4874
+ BRDA:120,12,1,32
4875
+ BRDA:120,13,0,32
4876
+ BRDA:120,13,1,32
4877
+ BRDA:131,14,0,0
4878
+ BRDA:131,14,1,0
4879
+ BRF:33
4880
+ BRH:25
4851
4881
  end_of_record
4852
4882
  TN:
4853
4883
  SF:src/automations/steps/bash.js
@@ -5645,7 +5675,7 @@ FN:369,(anonymous_29)
5645
5675
  FN:376,(anonymous_30)
5646
5676
  FNF:31
5647
5677
  FNH:25
5648
- FNDA:875,getDocParams
5678
+ FNDA:881,getDocParams
5649
5679
  FNDA:271,(anonymous_1)
5650
5680
  FNDA:130,(anonymous_2)
5651
5681
  FNDA:44,(anonymous_3)
@@ -5654,7 +5684,7 @@ FNDA:323,(anonymous_5)
5654
5684
  FNDA:3,(anonymous_6)
5655
5685
  FNDA:244,(anonymous_7)
5656
5686
  FNDA:3,(anonymous_8)
5657
- FNDA:274,(anonymous_9)
5687
+ FNDA:280,(anonymous_9)
5658
5688
  FNDA:27,(anonymous_10)
5659
5689
  FNDA:9,(anonymous_11)
5660
5690
  FNDA:0,(anonymous_12)
@@ -5705,9 +5735,9 @@ DA:81,59
5705
5735
  DA:83,59
5706
5736
  DA:84,59
5707
5737
  DA:86,59
5708
- DA:101,875
5709
- DA:102,858
5710
- DA:104,875
5738
+ DA:101,881
5739
+ DA:102,864
5740
+ DA:104,881
5711
5741
  DA:111,59
5712
5742
  DA:116,59
5713
5743
  DA:117,271
@@ -5734,7 +5764,7 @@ DA:190,3
5734
5764
  DA:191,1
5735
5765
  DA:193,2
5736
5766
  DA:199,59
5737
- DA:200,274
5767
+ DA:200,280
5738
5768
  DA:207,59
5739
5769
  DA:208,27
5740
5770
  DA:222,59
@@ -5789,7 +5819,7 @@ LF:109
5789
5819
  LH:99
5790
5820
  BRDA:100,0,0,0
5791
5821
  BRDA:100,1,0,0
5792
- BRDA:101,2,0,858
5822
+ BRDA:101,2,0,864
5793
5823
  BRDA:101,2,1,17
5794
5824
  BRDA:116,3,0,0
5795
5825
  BRDA:116,4,0,0
@@ -7300,8 +7330,9 @@ FN:138,(anonymous_12)
7300
7330
  FN:140,(anonymous_13)
7301
7331
  FN:147,(anonymous_14)
7302
7332
  FN:158,(anonymous_15)
7303
- FNF:16
7304
- FNH:15
7333
+ FN:166,(anonymous_16)
7334
+ FNF:17
7335
+ FNH:16
7305
7336
  FNDA:4,(anonymous_0)
7306
7337
  FNDA:4,(anonymous_1)
7307
7338
  FNDA:1,(anonymous_2)
@@ -7316,8 +7347,9 @@ FNDA:4,(anonymous_10)
7316
7347
  FNDA:0,(anonymous_11)
7317
7348
  FNDA:1,(anonymous_12)
7318
7349
  FNDA:1,(anonymous_13)
7319
- FNDA:36,(anonymous_14)
7350
+ FNDA:38,(anonymous_14)
7320
7351
  FNDA:1,(anonymous_15)
7352
+ FNDA:1,(anonymous_16)
7321
7353
  DA:1,49
7322
7354
  DA:2,49
7323
7355
  DA:3,49
@@ -7382,20 +7414,24 @@ DA:139,1
7382
7414
  DA:141,1
7383
7415
  DA:142,1
7384
7416
  DA:147,49
7385
- DA:148,36
7386
- DA:149,36
7387
- DA:150,36
7388
- DA:151,36
7389
- DA:152,36
7417
+ DA:148,38
7418
+ DA:149,38
7419
+ DA:150,38
7420
+ DA:151,38
7421
+ DA:152,38
7390
7422
  DA:153,0
7391
- DA:155,36
7423
+ DA:155,38
7392
7424
  DA:158,49
7393
7425
  DA:159,1
7394
7426
  DA:160,1
7395
7427
  DA:161,0
7396
7428
  DA:163,1
7397
- LF:76
7398
- LH:62
7429
+ DA:166,49
7430
+ DA:167,1
7431
+ DA:168,0
7432
+ DA:170,1
7433
+ LF:80
7434
+ LH:65
7399
7435
  BRDA:18,0,0,1
7400
7436
  BRDA:18,0,1,0
7401
7437
  BRDA:39,1,0,2
@@ -7414,20 +7450,22 @@ BRDA:123,7,0,0
7414
7450
  BRDA:123,7,1,4
7415
7451
  BRDA:123,8,0,4
7416
7452
  BRDA:123,8,1,4
7417
- BRDA:151,9,0,36
7418
- BRDA:151,9,1,33
7419
- BRDA:152,10,0,36
7453
+ BRDA:151,9,0,38
7454
+ BRDA:151,9,1,35
7455
+ BRDA:152,10,0,38
7420
7456
  BRDA:152,10,1,0
7421
7457
  BRDA:155,11,0,0
7422
- BRDA:155,11,1,36
7423
- BRDA:155,12,0,36
7424
- BRDA:155,12,1,33
7458
+ BRDA:155,11,1,38
7459
+ BRDA:155,12,0,38
7460
+ BRDA:155,12,1,35
7425
7461
  BRDA:160,13,0,0
7426
7462
  BRDA:160,13,1,1
7427
7463
  BRDA:160,14,0,1
7428
7464
  BRDA:160,14,1,0
7429
- BRF:30
7430
- BRH:16
7465
+ BRDA:167,15,0,0
7466
+ BRDA:167,15,1,1
7467
+ BRF:32
7468
+ BRH:17
7431
7469
  end_of_record
7432
7470
  TN:
7433
7471
  SF:src/utilities/scriptRunner.js
@@ -8146,12 +8184,14 @@ BRDA:76,15,0,0
8146
8184
  BRDA:76,15,1,0
8147
8185
  BRDA:79,16,0,0
8148
8186
  BRDA:79,16,1,0
8149
- BRDA:86,17,0,0
8150
- BRDA:86,17,1,0
8187
+ BRDA:79,17,0,0
8188
+ BRDA:79,17,1,0
8151
8189
  BRDA:86,18,0,0
8152
8190
  BRDA:86,18,1,0
8153
- BRDA:86,18,2,0
8154
- BRF:42
8191
+ BRDA:86,19,0,0
8192
+ BRDA:86,19,1,0
8193
+ BRDA:86,19,2,0
8194
+ BRF:44
8155
8195
  BRH:18
8156
8196
  end_of_record
8157
8197
  TN:
@@ -8203,8 +8243,8 @@ DA:62,26
8203
8243
  DA:64,30
8204
8244
  DA:65,30
8205
8245
  DA:67,0
8206
- DA:75,28
8207
- DA:78,27
8246
+ DA:76,28
8247
+ DA:79,27
8208
8248
  LF:35
8209
8249
  LH:33
8210
8250
  BRDA:16,0,0,28
@@ -490,11 +490,7 @@ const sync = (ctx, next) => __awaiter(void 0, void 0, void 0, function* () {
490
490
  });
491
491
  let error;
492
492
  try {
493
- yield replication.replicate({
494
- filter: function (doc) {
495
- return doc._id !== utils_1.DocumentType.APP_METADATA;
496
- },
497
- });
493
+ yield replication.replicate(replication.appReplicateOpts());
498
494
  }
499
495
  catch (err) {
500
496
  error = err;
@@ -11,11 +11,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  const { streamBackup } = require("../../utilities/fileSystem");
12
12
  const { events, context } = require("@budibase/backend-core");
13
13
  const { DocumentType } = require("../../db/utils");
14
+ const { isQsTrue } = require("../../utilities");
14
15
  exports.exportAppDump = function (ctx) {
15
16
  return __awaiter(this, void 0, void 0, function* () {
16
17
  let { appId, excludeRows } = ctx.query;
17
18
  const appName = decodeURI(ctx.query.appname);
18
- excludeRows = excludeRows === "true";
19
+ excludeRows = isQsTrue(excludeRows);
19
20
  const backupIdentifier = `${appName}-export-${new Date().getTime()}.txt`;
20
21
  ctx.attachment(backupIdentifier);
21
22
  ctx.body = yield streamBackup(appId, excludeRows);
@@ -100,14 +100,29 @@ function deployApp(deployment) {
100
100
  target: productionAppId,
101
101
  };
102
102
  replication = new db_1.Replication(config);
103
+ const devDb = (0, context_1.getDevAppDB)();
104
+ console.log("Compacting development DB");
105
+ yield devDb.compact();
103
106
  console.log("Replication object created");
104
- yield replication.replicate();
107
+ yield replication.replicate(replication.appReplicateOpts());
105
108
  console.log("replication complete.. replacing app meta doc");
109
+ // app metadata is excluded as it is likely to be in conflict
110
+ // replicate the app metadata document manually
106
111
  const db = (0, context_1.getProdAppDB)();
107
- const appDoc = yield db.get(utils_1.DocumentType.APP_METADATA);
112
+ const appDoc = yield devDb.get(utils_1.DocumentType.APP_METADATA);
113
+ try {
114
+ const prodAppDoc = yield db.get(utils_1.DocumentType.APP_METADATA);
115
+ appDoc._rev = prodAppDoc._rev;
116
+ }
117
+ catch (err) {
118
+ delete appDoc._rev;
119
+ }
120
+ // switch to production app ID
108
121
  deployment.appUrl = appDoc.url;
109
122
  appDoc.appId = productionAppId;
110
123
  appDoc.instance._id = productionAppId;
124
+ // remove automation errors if they exist
125
+ delete appDoc.automationErrors;
111
126
  yield db.put(appDoc);
112
127
  yield cache_1.app.invalidateAppMetadata(productionAppId);
113
128
  console.log("New app doc written successfully.");
@@ -446,7 +446,7 @@ var External;
446
446
  });
447
447
  // this is the response from knex if no rows found
448
448
  const rows = !response[0].read ? response : [];
449
- const storeTo = isMany ? field.throughFrom || linkPrimaryKey : manyKey;
449
+ const storeTo = isMany ? field.throughFrom || linkPrimaryKey : fieldName;
450
450
  related[storeTo] = { rows, isMany, tableId };
451
451
  }
452
452
  return related;
@@ -10,16 +10,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  const { processEvent } = require("./utils");
12
12
  const { queue, shutdown } = require("./bullboard");
13
- const { TRIGGER_DEFINITIONS } = require("./triggers");
13
+ const { TRIGGER_DEFINITIONS, rebootTrigger } = require("./triggers");
14
14
  const { ACTION_DEFINITIONS } = require("./actions");
15
15
  /**
16
16
  * This module is built purely to kick off the worker farm and manage the inputs/outputs
17
17
  */
18
18
  exports.init = function () {
19
- // this promise will not complete
20
- return queue.process((job) => __awaiter(this, void 0, void 0, function* () {
21
- yield processEvent(job);
22
- }));
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ // this promise will not complete
21
+ const promise = queue.process((job) => __awaiter(this, void 0, void 0, function* () {
22
+ yield processEvent(job);
23
+ }));
24
+ // on init we need to trigger any reboot automations
25
+ yield rebootTrigger();
26
+ return promise;
27
+ });
23
28
  };
24
29
  exports.getQueues = () => {
25
30
  return [queue];