@budibase/server 1.0.128 → 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.
Files changed (171) hide show
  1. package/builder/assets/{index.15cf130d.js → index.a89d7b93.js} +53 -53
  2. package/builder/index.html +1 -1
  3. package/coverage/clover.xml +57 -56
  4. package/coverage/coverage-final.json +2 -2
  5. package/coverage/lcov-report/api/controllers/analytics.js.html +1 -1
  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 +1 -1
  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 +1 -1
  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 +10 -10
  26. package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
  27. package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +23 -14
  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 +1 -1
  78. package/coverage/lcov-report/automations/index.js.html +1 -1
  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 +1 -1
  105. package/coverage/lcov-report/constants/index.html +1 -1
  106. package/coverage/lcov-report/constants/index.js.html +15 -3
  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 +1 -1
  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 +8 -8
  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/threads/automation.js.html +1 -1
  135. package/coverage/lcov-report/threads/index.html +1 -1
  136. package/coverage/lcov-report/threads/query.js.html +1 -1
  137. package/coverage/lcov-report/threads/utils.js.html +1 -1
  138. package/coverage/lcov-report/utilities/bcrypt.js.html +1 -1
  139. package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
  140. package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
  141. package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
  142. package/coverage/lcov-report/utilities/global.js.html +1 -1
  143. package/coverage/lcov-report/utilities/index.html +1 -1
  144. package/coverage/lcov-report/utilities/index.js.html +1 -1
  145. package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
  146. package/coverage/lcov-report/utilities/queue/index.html +1 -1
  147. package/coverage/lcov-report/utilities/routing/index.html +1 -1
  148. package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
  149. package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
  150. package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
  151. package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
  152. package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
  153. package/coverage/lcov-report/utilities/security.js.html +1 -1
  154. package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
  155. package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
  156. package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
  157. package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
  158. package/coverage/lcov-report/utilities/users.js.html +1 -1
  159. package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
  160. package/coverage/lcov.info +82 -81
  161. package/dist/api/controllers/application.js +5 -2
  162. package/dist/api/controllers/row/internalSearch.js +9 -4
  163. package/dist/constants/index.js +5 -1
  164. package/dist/integrations/utils.js +15 -7
  165. package/dist/package.json +5 -5
  166. package/dist/tsconfig.build.tsbuildinfo +1 -1
  167. package/package.json +6 -6
  168. package/src/api/controllers/application.ts +5 -2
  169. package/src/api/controllers/row/internalSearch.js +9 -6
  170. package/src/constants/index.js +5 -1
  171. package/src/integrations/utils.ts +16 -7
@@ -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 Thu Apr 28 2022 08:24:11 GMT+0000 (Coordinated Universal Time)
119
+ at Thu Apr 28 2022 10:18:48 GMT+0000 (Coordinated Universal Time)
120
120
  </div>
121
121
  <script src="../../prettify.js"></script>
122
122
  <script>
@@ -307,7 +307,7 @@ exports.getUniqueRows = async appIds =&gt; {
307
307
  <div class='footer quiet pad2 space-top1 center small'>
308
308
  Code coverage generated by
309
309
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
310
- at Thu Apr 28 2022 08:24:11 GMT+0000 (Coordinated Universal Time)
310
+ at Thu Apr 28 2022 10:18:48 GMT+0000 (Coordinated Universal Time)
311
311
  </div>
312
312
  <script src="../../prettify.js"></script>
313
313
  <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 Thu Apr 28 2022 08:24:11 GMT+0000 (Coordinated Universal Time)
127
+ at Thu Apr 28 2022 10:18:48 GMT+0000 (Coordinated Universal Time)
128
128
  </div>
129
129
  <script src="../../prettify.js"></script>
130
130
  <script>
@@ -142,7 +142,7 @@ exports.getFullUser = async (ctx, userId) =&gt; {
142
142
  <div class='footer quiet pad2 space-top1 center small'>
143
143
  Code coverage generated by
144
144
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
145
- at Thu Apr 28 2022 08:24:11 GMT+0000 (Coordinated Universal Time)
145
+ at Thu Apr 28 2022 10:18:48 GMT+0000 (Coordinated Universal Time)
146
146
  </div>
147
147
  <script src="../prettify.js"></script>
148
148
  <script>
@@ -487,7 +487,7 @@ exports.readGlobalUser = <span class="fstat-no" title="function not covered" >as
487
487
  <div class='footer quiet pad2 space-top1 center small'>
488
488
  Code coverage generated by
489
489
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
490
- at Thu Apr 28 2022 08:24:11 GMT+0000 (Coordinated Universal Time)
490
+ at Thu Apr 28 2022 10:18:48 GMT+0000 (Coordinated Universal Time)
491
491
  </div>
492
492
  <script src="../prettify.js"></script>
493
493
  <script>
@@ -2289,10 +2289,10 @@ FN:221,(anonymous_25)
2289
2289
  FN:226,(anonymous_26)
2290
2290
  FN:243,(anonymous_27)
2291
2291
  FN:259,(anonymous_28)
2292
- FN:270,(anonymous_29)
2293
- FN:294,(anonymous_30)
2294
- FN:342,(anonymous_31)
2295
- FN:387,(anonymous_32)
2292
+ FN:273,(anonymous_29)
2293
+ FN:297,(anonymous_30)
2294
+ FN:345,(anonymous_31)
2295
+ FN:390,(anonymous_32)
2296
2296
  FNF:33
2297
2297
  FNH:18
2298
2298
  FNDA:1,(anonymous_0)
@@ -2438,50 +2438,51 @@ DA:238,0
2438
2438
  DA:240,1
2439
2439
  DA:244,1
2440
2440
  DA:245,1
2441
+ DA:246,1
2442
+ DA:247,1
2441
2443
  DA:248,1
2442
- DA:249,1
2443
2444
  DA:259,40
2444
2445
  DA:260,1
2445
- DA:264,1
2446
- DA:266,1
2446
+ DA:267,1
2447
2447
  DA:269,1
2448
- DA:270,1
2449
2448
  DA:272,1
2450
2449
  DA:273,1
2451
2450
  DA:275,1
2452
- DA:294,40
2453
- DA:295,1
2454
- DA:296,1
2455
- DA:297,1
2456
- DA:298,0
2451
+ DA:276,1
2452
+ DA:278,1
2453
+ DA:297,40
2454
+ DA:298,1
2455
+ DA:299,1
2457
2456
  DA:300,1
2458
- DA:301,1
2459
- DA:302,0
2457
+ DA:301,0
2458
+ DA:303,1
2460
2459
  DA:304,1
2461
- DA:313,1
2462
- DA:314,0
2460
+ DA:305,0
2461
+ DA:307,1
2463
2462
  DA:316,1
2464
- DA:317,1
2465
- DA:319,0
2466
- DA:324,0
2467
- DA:342,40
2468
- DA:343,0
2469
- DA:344,0
2470
- DA:345,0
2463
+ DA:317,0
2464
+ DA:319,1
2465
+ DA:320,1
2466
+ DA:322,0
2467
+ DA:327,0
2468
+ DA:345,40
2469
+ DA:346,0
2471
2470
  DA:347,0
2472
2471
  DA:348,0
2473
- DA:354,0
2474
- DA:361,0
2475
- DA:366,0
2476
- DA:387,40
2477
- DA:388,1
2478
- DA:389,1
2479
- DA:390,1
2472
+ DA:350,0
2473
+ DA:351,0
2474
+ DA:357,0
2475
+ DA:364,0
2476
+ DA:369,0
2477
+ DA:390,40
2478
+ DA:391,1
2480
2479
  DA:392,1
2481
2480
  DA:393,1
2482
- DA:394,1
2483
- LF:152
2484
- LH:93
2481
+ DA:395,1
2482
+ DA:396,1
2483
+ DA:397,1
2484
+ LF:153
2485
+ LH:94
2485
2486
  BRDA:40,0,0,1
2486
2487
  BRDA:40,0,1,0
2487
2488
  BRDA:47,1,0,0
@@ -2549,34 +2550,34 @@ BRDA:235,32,0,0
2549
2550
  BRDA:235,32,1,1
2550
2551
  BRDA:236,33,0,0
2551
2552
  BRDA:236,33,1,0
2552
- BRDA:269,34,0,1
2553
- BRDA:269,34,1,0
2554
- BRDA:269,35,0,1
2555
- BRDA:269,35,1,1
2556
- BRDA:272,36,0,1
2557
- BRDA:272,36,1,0
2558
- BRDA:296,37,0,1
2559
- BRDA:296,37,1,1
2560
- BRDA:297,38,0,0
2561
- BRDA:297,38,1,1
2562
- BRDA:301,39,0,0
2563
- BRDA:301,39,1,1
2564
- BRDA:313,40,0,0
2565
- BRDA:313,40,1,1
2566
- BRDA:316,41,0,1
2567
- BRDA:316,41,1,0
2568
- BRDA:344,42,0,0
2569
- BRDA:344,42,1,0
2570
- BRDA:344,43,0,0
2571
- BRDA:344,43,1,0
2572
- BRDA:344,43,2,0
2573
- BRDA:368,44,0,0
2574
- BRDA:368,44,1,0
2575
- BRDA:389,45,0,1
2576
- BRDA:389,45,1,0
2577
- BRDA:389,46,0,1
2578
- BRDA:389,46,1,0
2579
- BRDA:389,46,2,0
2553
+ BRDA:272,34,0,1
2554
+ BRDA:272,34,1,0
2555
+ BRDA:272,35,0,1
2556
+ BRDA:272,35,1,1
2557
+ BRDA:275,36,0,1
2558
+ BRDA:275,36,1,0
2559
+ BRDA:299,37,0,1
2560
+ BRDA:299,37,1,1
2561
+ BRDA:300,38,0,0
2562
+ BRDA:300,38,1,1
2563
+ BRDA:304,39,0,0
2564
+ BRDA:304,39,1,1
2565
+ BRDA:316,40,0,0
2566
+ BRDA:316,40,1,1
2567
+ BRDA:319,41,0,1
2568
+ BRDA:319,41,1,0
2569
+ BRDA:347,42,0,0
2570
+ BRDA:347,42,1,0
2571
+ BRDA:347,43,0,0
2572
+ BRDA:347,43,1,0
2573
+ BRDA:347,43,2,0
2574
+ BRDA:371,44,0,0
2575
+ BRDA:371,44,1,0
2576
+ BRDA:392,45,0,1
2577
+ BRDA:392,45,1,0
2578
+ BRDA:392,46,0,1
2579
+ BRDA:392,46,1,0
2580
+ BRDA:392,46,2,0
2580
2581
  BRF:95
2581
2582
  BRH:38
2582
2583
  end_of_record
@@ -5025,7 +5026,7 @@ BRH:0
5025
5026
  end_of_record
5026
5027
  TN:
5027
5028
  SF:src/constants/index.js
5028
- FN:54,(anonymous_0)
5029
+ FN:58,(anonymous_0)
5029
5030
  FNF:1
5030
5031
  FNH:1
5031
5032
  FNDA:96,(anonymous_0)
@@ -5038,29 +5039,29 @@ DA:22,48
5038
5039
  DA:23,48
5039
5040
  DA:32,48
5040
5041
  DA:48,48
5041
- DA:54,48
5042
- DA:55,96
5043
5042
  DA:58,48
5044
- DA:64,48
5045
- DA:69,48
5046
- DA:75,48
5047
- DA:86,48
5043
+ DA:59,96
5044
+ DA:62,48
5045
+ DA:68,48
5046
+ DA:73,48
5047
+ DA:79,48
5048
5048
  DA:90,48
5049
- DA:95,48
5050
- DA:157,48
5051
- DA:165,48
5052
- DA:173,48
5053
- DA:174,48
5054
- DA:181,48
5055
- DA:186,48
5056
- DA:192,48
5057
- DA:197,48
5049
+ DA:94,48
5050
+ DA:99,48
5051
+ DA:161,48
5052
+ DA:169,48
5053
+ DA:177,48
5054
+ DA:178,48
5055
+ DA:185,48
5056
+ DA:190,48
5057
+ DA:196,48
5058
5058
  DA:201,48
5059
- DA:208,48
5059
+ DA:205,48
5060
+ DA:212,48
5060
5061
  LF:28
5061
5062
  LH:28
5062
- BRDA:55,0,0,96
5063
- BRDA:55,0,1,0
5063
+ BRDA:59,0,0,96
5064
+ BRDA:59,0,1,0
5064
5065
  BRF:2
5065
5066
  BRH:1
5066
5067
  end_of_record
@@ -355,11 +355,14 @@ const destroyApp = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
355
355
  if (!environment_1.default.isTest() && !isUnpublish) {
356
356
  yield (0, fileSystem_1.deleteApp)(appId);
357
357
  }
358
+ // automations only in production
358
359
  if (isUnpublish) {
359
360
  yield (0, utils_2.cleanupAutomations)(appId);
360
361
  }
361
- // make sure the app/role doesn't stick around after the app has been deleted
362
- yield (0, workerRequests_1.removeAppFromUserRoles)(ctx, appId);
362
+ // remove app role when the dev app is deleted (no trace of app anymore)
363
+ else {
364
+ yield (0, workerRequests_1.removeAppFromUserRoles)(ctx, appId);
365
+ }
363
366
  yield appCache.invalidateAppMetadata(appId);
364
367
  return result;
365
368
  });
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  const { SearchIndexes } = require("../../../db/utils");
12
12
  const fetch = require("node-fetch");
13
- const { getCouchUrl } = require("@budibase/backend-core/db");
13
+ const { getCouchInfo } = require("@budibase/backend-core/db");
14
14
  const { getAppId } = require("@budibase/backend-core/context");
15
15
  /**
16
16
  * Class to build lucene query URLs.
@@ -222,9 +222,10 @@ class QueryBuilder {
222
222
  run() {
223
223
  return __awaiter(this, void 0, void 0, function* () {
224
224
  const appId = getAppId();
225
- const url = `${getCouchUrl()}/${appId}/_design/database/_search/${SearchIndexes.ROWS}`;
225
+ const { url, cookie } = getCouchInfo();
226
+ const fullPath = `${url}/${appId}/_design/database/_search/${SearchIndexes.ROWS}`;
226
227
  const body = this.buildSearchBody();
227
- return yield runQuery(url, body);
228
+ return yield runQuery(fullPath, body, cookie);
228
229
  });
229
230
  }
230
231
  }
@@ -232,12 +233,16 @@ class QueryBuilder {
232
233
  * Executes a lucene search query.
233
234
  * @param url The query URL
234
235
  * @param body The request body defining search criteria
236
+ * @param cookie The auth cookie for CouchDB
235
237
  * @returns {Promise<{rows: []}>}
236
238
  */
237
- const runQuery = (url, body) => __awaiter(void 0, void 0, void 0, function* () {
239
+ const runQuery = (url, body, cookie) => __awaiter(void 0, void 0, void 0, function* () {
238
240
  const response = yield fetch(url, {
239
241
  body: JSON.stringify(body),
240
242
  method: "POST",
243
+ headers: {
244
+ Authorization: cookie,
245
+ },
241
246
  });
242
247
  const json = yield response.json();
243
248
  let output = {
@@ -43,7 +43,11 @@ exports.FieldTypes = {
43
43
  };
44
44
  exports.CanSwitchTypes = [
45
45
  [exports.FieldTypes.JSON, exports.FieldTypes.ARRAY],
46
- [exports.FieldTypes.STRING, exports.FieldTypes.OPTIONS],
46
+ [
47
+ exports.FieldTypes.STRING,
48
+ exports.FieldTypes.OPTIONS,
49
+ exports.FieldTypes.LONGFORM,
50
+ ],
47
51
  [exports.FieldTypes.BOOLEAN, exports.FieldTypes.NUMBER],
48
52
  ];
49
53
  exports.SwitchableTypes = exports.CanSwitchTypes.reduce((prev, current) => prev ? prev.concat(current) : current);
@@ -40,9 +40,9 @@ const SQL_STRING_TYPE_MAP = {
40
40
  nvarchar: constants_1.FieldTypes.STRING,
41
41
  ntext: constants_1.FieldTypes.STRING,
42
42
  enum: constants_1.FieldTypes.STRING,
43
- blob: constants_1.FieldTypes.LONGFORM,
44
- long: constants_1.FieldTypes.LONGFORM,
45
- text: constants_1.FieldTypes.LONGFORM,
43
+ blob: constants_1.FieldTypes.STRING,
44
+ long: constants_1.FieldTypes.STRING,
45
+ text: constants_1.FieldTypes.STRING,
46
46
  };
47
47
  const SQL_BOOLEAN_TYPE_MAP = {
48
48
  boolean: constants_1.FieldTypes.BOOLEAN,
@@ -186,10 +186,18 @@ function shouldCopyRelationship(column, tableIds) {
186
186
  * @param fetchedColumn The fetched column to check for the type in the external database.
187
187
  */
188
188
  function shouldCopySpecialColumn(column, fetchedColumn) {
189
- return (column.type === constants_1.FieldTypes.OPTIONS ||
190
- column.type === constants_1.FieldTypes.ARRAY ||
191
- ((!fetchedColumn || fetchedColumn.type === constants_1.FieldTypes.NUMBER) &&
192
- column.type === constants_1.FieldTypes.BOOLEAN));
189
+ const specialTypes = [
190
+ constants_1.FieldTypes.OPTIONS,
191
+ constants_1.FieldTypes.LONGFORM,
192
+ constants_1.FieldTypes.ARRAY,
193
+ constants_1.FieldTypes.FORMULA,
194
+ ];
195
+ if (column && !fetchedColumn) {
196
+ return true;
197
+ }
198
+ const fetchedIsNumber = !fetchedColumn || fetchedColumn.type === constants_1.FieldTypes.NUMBER;
199
+ return (specialTypes.indexOf(column.type) !== -1 ||
200
+ (fetchedIsNumber && column.type === constants_1.FieldTypes.BOOLEAN));
193
201
  }
194
202
  /**
195
203
  * Looks for columns which need to be copied over into the new table definitions, like relationships
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/server",
3
3
  "email": "hi@budibase.com",
4
- "version": "1.0.127",
4
+ "version": "1.0.128",
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.127",
72
- "@budibase/client": "^1.0.127",
73
- "@budibase/pro": "1.0.127",
74
- "@budibase/string-templates": "^1.0.127",
71
+ "@budibase/backend-core": "^1.0.128",
72
+ "@budibase/client": "^1.0.128",
73
+ "@budibase/pro": "1.0.128",
74
+ "@budibase/string-templates": "^1.0.128",
75
75
  "@bull-board/api": "^3.7.0",
76
76
  "@bull-board/koa": "^3.7.0",
77
77
  "@elastic/elasticsearch": "7.10.0",