@budibase/server 1.3.15-alpha.7 → 1.3.15-alpha.9

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 (178) hide show
  1. package/builder/assets/{index.6e6a747c.js → index.15b76cd8.js} +205 -205
  2. package/builder/assets/{index.ecdac070.css → index.3850883f.css} +1 -1
  3. package/builder/index.html +2 -2
  4. package/coverage/clover.xml +49 -50
  5. package/coverage/coverage-final.json +2 -2
  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 +25 -37
  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 +15 -15
  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 +2 -2
  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 +2 -2
  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 +5 -5
  71. package/coverage/lcov-report/api/routes/utils/validators.js.html +9 -6
  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 +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 +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 +15 -15
  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 +1 -1
  139. package/coverage/lcov-report/utilities/index.js.html +1 -1
  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 +1 -1
  145. package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
  146. package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
  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 +1 -1
  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 +74 -77
  156. package/dist/api/controllers/component.js +12 -16
  157. package/dist/api/controllers/plugin/index.js +6 -3
  158. package/dist/api/controllers/row/external.js +1 -1
  159. package/dist/api/routes/application.js +3 -2
  160. package/dist/api/routes/public/tables.js +1 -1
  161. package/dist/api/routes/table.js +1 -1
  162. package/dist/api/routes/utils/validators.js +2 -1
  163. package/dist/package.json +6 -6
  164. package/dist/tests/utilities/TestConfiguration.js +1 -1
  165. package/dist/tsconfig.build.tsbuildinfo +1 -1
  166. package/package.json +7 -7
  167. package/specs/openapi.json +3 -3
  168. package/specs/openapi.yaml +3 -3
  169. package/specs/resources/query.js +1 -1
  170. package/src/api/controllers/component.js +17 -21
  171. package/src/api/controllers/plugin/index.ts +8 -4
  172. package/src/api/controllers/row/external.js +1 -1
  173. package/src/api/routes/application.ts +13 -2
  174. package/src/api/routes/public/tables.ts +1 -1
  175. package/src/api/routes/table.js +1 -1
  176. package/src/api/routes/utils/validators.js +2 -1
  177. package/src/definitions/openapi.ts +3 -3
  178. package/src/tests/utilities/TestConfiguration.js +1 -1
@@ -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 Wed Sep 14 2022 10:55:18 GMT+0000 (Coordinated Universal Time)
94
+ at Wed Sep 14 2022 16:57:18 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 Wed Sep 14 2022 10:55:18 GMT+0000 (Coordinated Universal Time)
119
+ at Wed Sep 14 2022 16:57:18 GMT+0000 (Coordinated Universal Time)
120
120
  </div>
121
121
  <script src="../../prettify.js"></script>
122
122
  <script>
@@ -310,7 +310,7 @@ exports.getUniqueRows = async appIds =&gt; {
310
310
  <div class='footer quiet pad2 space-top1 center small'>
311
311
  Code coverage generated by
312
312
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
313
- at Wed Sep 14 2022 10:55:18 GMT+0000 (Coordinated Universal Time)
313
+ at Wed Sep 14 2022 16:57:18 GMT+0000 (Coordinated Universal Time)
314
314
  </div>
315
315
  <script src="../../prettify.js"></script>
316
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 Wed Sep 14 2022 10:55:18 GMT+0000 (Coordinated Universal Time)
127
+ at Wed Sep 14 2022 16:57:18 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 Wed Sep 14 2022 10:55:18 GMT+0000 (Coordinated Universal Time)
208
+ at Wed Sep 14 2022 16:57:18 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 Wed Sep 14 2022 10:55:18 GMT+0000 (Coordinated Universal Time)
538
+ at Wed Sep 14 2022 16:57:18 GMT+0000 (Coordinated Universal Time)
539
539
  </div>
540
540
  <script src="../prettify.js"></script>
541
541
  <script>
@@ -507,11 +507,11 @@ BRH:0
507
507
  end_of_record
508
508
  TN:
509
509
  SF:src/api/controllers/component.js
510
- FN:7,(anonymous_0)
511
- FN:13,(anonymous_1)
512
- FN:46,(anonymous_2)
513
- FN:47,(anonymous_3)
514
- FN:48,(anonymous_4)
510
+ FN:6,(anonymous_0)
511
+ FN:12,(anonymous_1)
512
+ FN:43,(anonymous_2)
513
+ FN:44,(anonymous_3)
514
+ FN:45,(anonymous_4)
515
515
  FNF:5
516
516
  FNH:2
517
517
  FNDA:1,(anonymous_0)
@@ -523,39 +523,35 @@ DA:1,28
523
523
  DA:2,28
524
524
  DA:3,28
525
525
  DA:4,28
526
- DA:5,28
527
- DA:7,28
526
+ DA:6,28
527
+ DA:7,1
528
528
  DA:8,1
529
529
  DA:9,1
530
- DA:10,1
531
- DA:12,1
530
+ DA:11,1
531
+ DA:13,1
532
532
  DA:14,1
533
- DA:15,1
533
+ DA:20,1
534
534
  DA:21,1
535
535
  DA:22,1
536
- DA:23,1
537
- DA:24,52
538
- DA:25,1
536
+ DA:23,52
537
+ DA:24,1
538
+ DA:26,51
539
539
  DA:27,51
540
- DA:28,51
540
+ DA:36,1
541
541
  DA:37,1
542
- DA:39,1
543
- DA:40,1
544
- DA:45,1
542
+ DA:42,1
543
+ DA:43,0
544
+ DA:44,0
545
545
  DA:46,0
546
546
  DA:47,0
547
- DA:49,0
548
- DA:50,0
549
- DA:57,1
550
- DA:59,0
551
- LF:29
552
- LH:24
553
- BRDA:24,0,0,1
554
- BRDA:24,0,1,51
555
- BRDA:37,1,0,1
556
- BRDA:37,1,1,0
557
- BRF:4
558
- BRH:3
547
+ DA:53,1
548
+ DA:55,0
549
+ LF:27
550
+ LH:22
551
+ BRDA:23,0,0,1
552
+ BRDA:23,0,1,51
553
+ BRF:2
554
+ BRH:2
559
555
  end_of_record
560
556
  TN:
561
557
  SF:src/api/controllers/datasource.js
@@ -4540,20 +4536,20 @@ BRH:0
4540
4536
  end_of_record
4541
4537
  TN:
4542
4538
  SF:src/api/routes/utils/validators.js
4543
- FN:14,(anonymous_0)
4544
- FN:28,(anonymous_1)
4545
- FN:35,(anonymous_2)
4546
- FN:49,filterObject
4547
- FN:66,(anonymous_4)
4548
- FN:80,(anonymous_5)
4549
- FN:98,(anonymous_6)
4550
- FN:119,(anonymous_7)
4551
- FN:134,(anonymous_8)
4552
- FN:150,(anonymous_9)
4553
- FN:160,(anonymous_10)
4554
- FN:183,generateStepSchema
4555
- FN:198,(anonymous_12)
4556
- FN:212,(anonymous_13)
4539
+ FN:15,(anonymous_0)
4540
+ FN:29,(anonymous_1)
4541
+ FN:36,(anonymous_2)
4542
+ FN:50,filterObject
4543
+ FN:67,(anonymous_4)
4544
+ FN:81,(anonymous_5)
4545
+ FN:99,(anonymous_6)
4546
+ FN:120,(anonymous_7)
4547
+ FN:135,(anonymous_8)
4548
+ FN:151,(anonymous_9)
4549
+ FN:161,(anonymous_10)
4550
+ FN:184,generateStepSchema
4551
+ FN:199,(anonymous_12)
4552
+ FN:213,(anonymous_13)
4557
4553
  FNF:14
4558
4554
  FNH:14
4559
4555
  FNDA:84,(anonymous_0)
@@ -4569,7 +4565,7 @@ FNDA:56,(anonymous_9)
4569
4565
  FNDA:28,(anonymous_10)
4570
4566
  FNDA:112,generateStepSchema
4571
4567
  FNDA:56,(anonymous_12)
4572
- FNDA:56,(anonymous_13)
4568
+ FNDA:112,(anonymous_13)
4573
4569
  DA:1,28
4574
4570
  DA:2,28
4575
4571
  DA:3,28
@@ -4578,41 +4574,42 @@ DA:8,28
4578
4574
  DA:10,28
4579
4575
  DA:11,28
4580
4576
  DA:12,28
4581
- DA:14,28
4582
- DA:16,84
4583
- DA:28,28
4584
- DA:30,112
4585
- DA:35,28
4586
- DA:37,28
4587
- DA:51,84
4588
- DA:66,28
4589
- DA:68,28
4590
- DA:80,28
4577
+ DA:13,28
4578
+ DA:15,28
4579
+ DA:17,84
4580
+ DA:29,28
4581
+ DA:31,112
4582
+ DA:36,28
4583
+ DA:38,28
4584
+ DA:52,84
4585
+ DA:67,28
4586
+ DA:69,28
4591
4587
  DA:81,28
4592
- DA:98,28
4593
- DA:100,28
4594
- DA:119,28
4595
- DA:121,28
4596
- DA:134,28
4588
+ DA:82,28
4589
+ DA:99,28
4590
+ DA:101,28
4591
+ DA:120,28
4592
+ DA:122,28
4597
4593
  DA:135,28
4598
- DA:137,28
4599
- DA:150,28
4600
- DA:151,56
4601
- DA:153,56
4602
- DA:160,28
4603
- DA:162,28
4604
- DA:185,112
4605
- DA:198,28
4606
- DA:200,56
4607
- DA:212,28
4608
- DA:214,56
4609
- LF:36
4610
- LH:36
4611
- BRDA:198,0,0,0
4612
- BRDA:201,1,0,28
4613
- BRDA:201,1,1,28
4614
- BRDA:202,2,0,28
4615
- BRDA:202,2,1,28
4594
+ DA:136,28
4595
+ DA:138,28
4596
+ DA:151,28
4597
+ DA:152,56
4598
+ DA:154,56
4599
+ DA:161,28
4600
+ DA:163,28
4601
+ DA:186,112
4602
+ DA:199,28
4603
+ DA:201,56
4604
+ DA:213,28
4605
+ DA:215,112
4606
+ LF:37
4607
+ LH:37
4608
+ BRDA:199,0,0,0
4609
+ BRDA:202,1,0,28
4610
+ BRDA:202,1,1,28
4611
+ BRDA:203,2,0,28
4612
+ BRDA:203,2,1,28
4616
4613
  BRF:5
4617
4614
  BRH:4
4618
4615
  end_of_record
@@ -12,7 +12,6 @@ const { DocumentType, getPluginParams } = require("../../db/utils");
12
12
  const { getComponentLibraryManifest } = require("../../utilities/fileSystem");
13
13
  const { getAppDB } = require("@budibase/backend-core/context");
14
14
  const { getGlobalDB } = require("@budibase/backend-core/tenancy");
15
- const env = require("../../environment");
16
15
  exports.fetchAppComponentDefinitions = function (ctx) {
17
16
  return __awaiter(this, void 0, void 0, function* () {
18
17
  try {
@@ -37,21 +36,18 @@ exports.fetchAppComponentDefinitions = function (ctx) {
37
36
  }
38
37
  }
39
38
  }
40
- // for now custom components only supported in self-host
41
- if (env.SELF_HOSTED) {
42
- // Add custom components
43
- const globalDB = getGlobalDB();
44
- const response = yield globalDB.allDocs(getPluginParams(null, {
45
- include_docs: true,
46
- }));
47
- response.rows
48
- .map(row => row.doc)
49
- .filter(plugin => plugin.schema.type === "component")
50
- .forEach(plugin => {
51
- const fullComponentName = `plugin/${plugin.name}`;
52
- definitions[fullComponentName] = Object.assign({ component: fullComponentName }, plugin.schema.schema);
53
- });
54
- }
39
+ // Add custom components
40
+ const globalDB = getGlobalDB();
41
+ const response = yield globalDB.allDocs(getPluginParams(null, {
42
+ include_docs: true,
43
+ }));
44
+ response.rows
45
+ .map(row => row.doc)
46
+ .filter(plugin => plugin.schema.type === "component")
47
+ .forEach(plugin => {
48
+ const fullComponentName = `plugin/${plugin.name}`;
49
+ definitions[fullComponentName] = Object.assign({ component: fullComponentName }, plugin.schema.schema);
50
+ });
55
51
  ctx.body = definitions;
56
52
  }
57
53
  catch (err) {
@@ -64,11 +64,9 @@ function upload(ctx) {
64
64
  }
65
65
  exports.upload = upload;
66
66
  function create(ctx) {
67
+ var _a;
67
68
  return __awaiter(this, void 0, void 0, function* () {
68
69
  const { source, url, headers, githubToken } = ctx.request.body;
69
- if (!environment_1.default.SELF_HOSTED) {
70
- ctx.throw(400, "Plugins not supported outside of self-host.");
71
- }
72
70
  try {
73
71
  let metadata;
74
72
  let directory;
@@ -93,6 +91,10 @@ function create(ctx) {
93
91
  break;
94
92
  }
95
93
  (0, plugins_1.validate)(metadata === null || metadata === void 0 ? void 0 : metadata.schema);
94
+ // Only allow components in cloud
95
+ if (!environment_1.default.SELF_HOSTED && ((_a = metadata === null || metadata === void 0 ? void 0 : metadata.schema) === null || _a === void 0 ? void 0 : _a.type) !== types_1.PluginType.COMPONENT) {
96
+ throw new Error("Only component plugins are supported outside of self-host");
97
+ }
96
98
  const doc = yield storePlugin(metadata, directory, source);
97
99
  ctx.body = {
98
100
  message: "Plugin uploaded successfully",
@@ -184,6 +186,7 @@ function processPlugin(plugin, source) {
184
186
  var _a;
185
187
  return __awaiter(this, void 0, void 0, function* () {
186
188
  const { metadata, directory } = yield (0, uploaders_1.fileUpload)(plugin);
189
+ (0, plugins_1.validate)(metadata === null || metadata === void 0 ? void 0 : metadata.schema);
187
190
  // Only allow components in cloud
188
191
  if (!environment_1.default.SELF_HOSTED && ((_a = metadata === null || metadata === void 0 ? void 0 : metadata.schema) === null || _a === void 0 ? void 0 : _a.type) !== types_1.PluginType.COMPONENT) {
189
192
  throw new Error("Only component plugins are supported outside of self-host");
@@ -63,7 +63,7 @@ exports.save = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
63
63
  });
64
64
  });
65
65
  exports.fetchView = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
66
- // there are no views in external data sources, shouldn't ever be called
66
+ // there are no views in external datasources, shouldn't ever be called
67
67
  // for now just fetch
68
68
  const split = ctx.params.viewName.split("all_");
69
69
  ctx.params.tableId = split[1] ? split[1] : split[0];
@@ -30,14 +30,15 @@ const router_1 = __importDefault(require("@koa/router"));
30
30
  const controller = __importStar(require("../controllers/application"));
31
31
  const authorized_1 = __importDefault(require("../../middleware/authorized"));
32
32
  const permissions_1 = require("@budibase/backend-core/permissions");
33
+ const validators_1 = require("./utils/validators");
33
34
  const router = new router_1.default();
34
35
  router
35
36
  .post("/api/applications/:appId/sync", (0, authorized_1.default)(permissions_1.BUILDER), controller.sync)
36
- .post("/api/applications", (0, authorized_1.default)(permissions_1.BUILDER), controller.create)
37
+ .post("/api/applications", (0, authorized_1.default)(permissions_1.BUILDER), (0, validators_1.applicationValidator)(), controller.create)
37
38
  .get("/api/applications/:appId/definition", controller.fetchAppDefinition)
38
39
  .get("/api/applications", controller.fetch)
39
40
  .get("/api/applications/:appId/appPackage", controller.fetchAppPackage)
40
- .put("/api/applications/:appId", (0, authorized_1.default)(permissions_1.BUILDER), controller.update)
41
+ .put("/api/applications/:appId", (0, authorized_1.default)(permissions_1.BUILDER), (0, validators_1.applicationValidator)(), controller.update)
41
42
  .post("/api/applications/:appId/client/update", (0, authorized_1.default)(permissions_1.BUILDER), controller.updateClient)
42
43
  .post("/api/applications/:appId/client/revert", (0, authorized_1.default)(permissions_1.BUILDER), controller.revertClient)
43
44
  .delete("/api/applications/:appId", (0, authorized_1.default)(permissions_1.BUILDER), controller.destroy);
@@ -28,7 +28,7 @@ const read = [], write = [];
28
28
  * responses:
29
29
  * 200:
30
30
  * description: Returns the created table, including the ID which has been generated for it. This can be
31
- * internal or external data sources.
31
+ * internal or external datasources.
32
32
  * content:
33
33
  * application/json:
34
34
  * schema:
@@ -45,7 +45,7 @@ router
45
45
  * @apiParam (Body) {string} [_rev] If updating an existing internal table then the revision must also be specified.
46
46
  * @apiParam (Body) {string} type] This should either be "internal" or "external" depending on the table type -
47
47
  * this will default to internal.
48
- * @apiParam (Body) {string} [sourceId] If creating an external table then this should be set to the data source ID. If
48
+ * @apiParam (Body) {string} [sourceId] If creating an external table then this should be set to the datasource ID. If
49
49
  * building an internal table this does not need to be set, although it will be returned as "bb_internal".
50
50
  * @apiParam (Body) {string} name The name of the table, this will be used in the UI. To rename the table simply
51
51
  * supply the table structure to this endpoint with the name changed.
@@ -7,6 +7,7 @@ const Joi = require("joi");
7
7
  const OPTIONAL_STRING = Joi.string().optional().allow(null).allow("");
8
8
  const OPTIONAL_NUMBER = Joi.number().optional().allow(null);
9
9
  const OPTIONAL_BOOLEAN = Joi.boolean().optional().allow(null);
10
+ const APP_NAME_REGEX = /^[\w\s]+$/;
10
11
  exports.tableValidator = () => {
11
12
  // prettier-ignore
12
13
  return joiValidator.body(Joi.object({
@@ -195,7 +196,7 @@ exports.applicationValidator = () => {
195
196
  return joiValidator.body(Joi.object({
196
197
  _id: OPTIONAL_STRING,
197
198
  _rev: OPTIONAL_STRING,
198
- name: Joi.string().required(),
199
+ name: Joi.string().pattern(new RegExp(APP_NAME_REGEX)).required().error(new Error('App name must be letters, numbers and spaces only')),
199
200
  url: OPTIONAL_STRING,
200
201
  template: Joi.object({
201
202
  templateString: OPTIONAL_STRING,
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.3.15-alpha.6",
4
+ "version": "1.3.15-alpha.8",
5
5
  "description": "Budibase Web Server",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -77,11 +77,11 @@
77
77
  "license": "GPL-3.0",
78
78
  "dependencies": {
79
79
  "@apidevtools/swagger-parser": "10.0.3",
80
- "@budibase/backend-core": "1.3.15-alpha.6",
81
- "@budibase/client": "1.3.15-alpha.6",
82
- "@budibase/pro": "1.3.15-alpha.6",
83
- "@budibase/string-templates": "1.3.15-alpha.6",
84
- "@budibase/types": "1.3.15-alpha.6",
80
+ "@budibase/backend-core": "1.3.15-alpha.8",
81
+ "@budibase/client": "1.3.15-alpha.8",
82
+ "@budibase/pro": "1.3.15-alpha.8",
83
+ "@budibase/string-templates": "1.3.15-alpha.8",
84
+ "@budibase/types": "1.3.15-alpha.8",
85
85
  "@bull-board/api": "3.7.0",
86
86
  "@bull-board/koa": "3.9.4",
87
87
  "@elastic/elasticsearch": "7.10.0",
@@ -504,7 +504,7 @@ class TestConfiguration {
504
504
  createQuery(config = null) {
505
505
  return __awaiter(this, void 0, void 0, function* () {
506
506
  if (!this.datasource && !config) {
507
- throw "No data source created for query.";
507
+ throw "No datasource created for query.";
508
508
  }
509
509
  config = config || basicQuery(this.datasource._id);
510
510
  return this._req(config, null, controllers.query.save);