@budibase/server 1.0.57 → 1.0.58-alpha.3

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 (198) hide show
  1. package/builder/assets/index.38a1fb0a.css +6 -0
  2. package/builder/assets/{index.b86535ba.js → index.b4a2f10e.js} +240 -239
  3. package/builder/assets/{vendor.5ad9695a.js → vendor.20f80cec.js} +215 -189
  4. package/builder/index.html +3 -3
  5. package/coverage/clover.xml +83 -83
  6. package/coverage/coverage-final.json +6 -6
  7. package/coverage/lcov-report/api/controllers/analytics.js.html +1 -1
  8. package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
  9. package/coverage/lcov-report/api/controllers/application.js.html +1 -1
  10. package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
  11. package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
  12. package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
  13. package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
  14. package/coverage/lcov-report/api/controllers/component.js.html +1 -1
  15. package/coverage/lcov-report/api/controllers/datasource.js.html +1 -1
  16. package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
  17. package/coverage/lcov-report/api/controllers/index.html +1 -1
  18. package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
  19. package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
  20. package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
  21. package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
  22. package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
  23. package/coverage/lcov-report/api/controllers/query/index.html +12 -12
  24. package/coverage/lcov-report/api/controllers/query/index.js.html +13 -13
  25. package/coverage/lcov-report/api/controllers/query/validation.js.html +20 -2
  26. package/coverage/lcov-report/api/controllers/role.js.html +1 -1
  27. package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
  28. package/coverage/lcov-report/api/controllers/row/external.js.html +1 -1
  29. package/coverage/lcov-report/api/controllers/row/index.html +1 -1
  30. package/coverage/lcov-report/api/controllers/row/index.js.html +1 -1
  31. package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
  32. package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1 -1
  33. package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
  34. package/coverage/lcov-report/api/controllers/row/utils.js.html +1 -1
  35. package/coverage/lcov-report/api/controllers/screen.js.html +1 -1
  36. package/coverage/lcov-report/api/controllers/script.js.html +1 -1
  37. package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
  38. package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
  39. package/coverage/lcov-report/api/controllers/table/index.html +1 -1
  40. package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
  41. package/coverage/lcov-report/api/controllers/table/internal.js.html +1 -1
  42. package/coverage/lcov-report/api/controllers/table/utils.js.html +1 -1
  43. package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
  44. package/coverage/lcov-report/api/controllers/user.js.html +1 -1
  45. package/coverage/lcov-report/api/controllers/view/exporters.js.html +13 -4
  46. package/coverage/lcov-report/api/controllers/view/index.html +1 -1
  47. package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
  48. package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
  49. package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
  50. package/coverage/lcov-report/api/controllers/webhook.js.html +1 -1
  51. package/coverage/lcov-report/api/index.html +1 -1
  52. package/coverage/lcov-report/api/index.js.html +1 -1
  53. package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
  54. package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
  55. package/coverage/lcov-report/api/routes/application.js.html +1 -1
  56. package/coverage/lcov-report/api/routes/auth.js.html +1 -1
  57. package/coverage/lcov-report/api/routes/automation.js.html +1 -1
  58. package/coverage/lcov-report/api/routes/backup.js.html +1 -1
  59. package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
  60. package/coverage/lcov-report/api/routes/component.js.html +1 -1
  61. package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
  62. package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
  63. package/coverage/lcov-report/api/routes/dev.js.html +1 -1
  64. package/coverage/lcov-report/api/routes/index.html +1 -1
  65. package/coverage/lcov-report/api/routes/index.js.html +1 -1
  66. package/coverage/lcov-report/api/routes/integration.js.html +1 -1
  67. package/coverage/lcov-report/api/routes/layout.js.html +1 -1
  68. package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
  69. package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
  70. package/coverage/lcov-report/api/routes/permission.js.html +1 -1
  71. package/coverage/lcov-report/api/routes/query.js.html +1 -1
  72. package/coverage/lcov-report/api/routes/role.js.html +1 -1
  73. package/coverage/lcov-report/api/routes/routing.js.html +1 -1
  74. package/coverage/lcov-report/api/routes/row.js.html +1 -1
  75. package/coverage/lcov-report/api/routes/screen.js.html +1 -1
  76. package/coverage/lcov-report/api/routes/script.js.html +1 -1
  77. package/coverage/lcov-report/api/routes/static.js.html +1 -1
  78. package/coverage/lcov-report/api/routes/table.js.html +1 -1
  79. package/coverage/lcov-report/api/routes/templates.js.html +1 -1
  80. package/coverage/lcov-report/api/routes/user.js.html +1 -1
  81. package/coverage/lcov-report/api/routes/view.js.html +1 -1
  82. package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
  83. package/coverage/lcov-report/automations/actions.js.html +1 -1
  84. package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
  85. package/coverage/lcov-report/automations/bullboard.js.html +1 -1
  86. package/coverage/lcov-report/automations/index.html +1 -1
  87. package/coverage/lcov-report/automations/index.js.html +1 -1
  88. package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
  89. package/coverage/lcov-report/automations/steps/createRow.js.html +1 -1
  90. package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
  91. package/coverage/lcov-report/automations/steps/deleteRow.js.html +1 -1
  92. package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
  93. package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
  94. package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
  95. package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
  96. package/coverage/lcov-report/automations/steps/index.html +1 -1
  97. package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
  98. package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
  99. package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
  100. package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
  101. package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
  102. package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
  103. package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
  104. package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
  105. package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
  106. package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
  107. package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
  108. package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
  109. package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
  110. package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
  111. package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
  112. package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
  113. package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
  114. package/coverage/lcov-report/automations/triggers.js.html +1 -1
  115. package/coverage/lcov-report/automations/utils.js.html +1 -1
  116. package/coverage/lcov-report/constants/index.html +1 -1
  117. package/coverage/lcov-report/constants/index.js.html +1 -1
  118. package/coverage/lcov-report/constants/layouts.js.html +1 -1
  119. package/coverage/lcov-report/constants/screens.js.html +1 -1
  120. package/coverage/lcov-report/db/client.js.html +1 -1
  121. package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
  122. package/coverage/lcov-report/db/index.html +1 -1
  123. package/coverage/lcov-report/db/index.js.html +1 -1
  124. package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
  125. package/coverage/lcov-report/db/linkedRows/index.html +1 -1
  126. package/coverage/lcov-report/db/linkedRows/index.js.html +1 -1
  127. package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +1 -1
  128. package/coverage/lcov-report/db/newid.js.html +1 -1
  129. package/coverage/lcov-report/db/utils.js.html +1 -1
  130. package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
  131. package/coverage/lcov-report/events/index.html +1 -1
  132. package/coverage/lcov-report/events/index.js.html +1 -1
  133. package/coverage/lcov-report/events/utils.js.html +1 -1
  134. package/coverage/lcov-report/index.html +17 -17
  135. package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
  136. package/coverage/lcov-report/integrations/tests/index.html +1 -1
  137. package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
  138. package/coverage/lcov-report/middleware/authorized.js.html +1 -1
  139. package/coverage/lcov-report/middleware/builder.js.html +1 -1
  140. package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
  141. package/coverage/lcov-report/middleware/index.html +15 -15
  142. package/coverage/lcov-report/middleware/joi-validator.js.html +11 -11
  143. package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
  144. package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
  145. package/coverage/lcov-report/middleware/usageQuota.js.html +1 -1
  146. package/coverage/lcov-report/middleware/utils.js.html +1 -1
  147. package/coverage/lcov-report/threads/automation.js.html +1 -1
  148. package/coverage/lcov-report/threads/index.html +1 -1
  149. package/coverage/lcov-report/threads/index.js.html +12 -12
  150. package/coverage/lcov-report/threads/query.js.html +65 -44
  151. package/coverage/lcov-report/threads/utils.js.html +1 -1
  152. package/coverage/lcov-report/utilities/bcrypt.js.html +1 -1
  153. package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
  154. package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
  155. package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
  156. package/coverage/lcov-report/utilities/global.js.html +1 -1
  157. package/coverage/lcov-report/utilities/index.html +1 -1
  158. package/coverage/lcov-report/utilities/index.js.html +1 -1
  159. package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
  160. package/coverage/lcov-report/utilities/queue/index.html +1 -1
  161. package/coverage/lcov-report/utilities/routing/index.html +1 -1
  162. package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
  163. package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
  164. package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
  165. package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
  166. package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
  167. package/coverage/lcov-report/utilities/security.js.html +1 -1
  168. package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
  169. package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
  170. package/coverage/lcov-report/utilities/usageQuota/index.js.html +1 -1
  171. package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
  172. package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
  173. package/coverage/lcov-report/utilities/users.js.html +1 -1
  174. package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
  175. package/coverage/lcov.info +128 -128
  176. package/dist/api/controllers/query/validation.js +6 -0
  177. package/dist/api/controllers/row/ExternalRequest.js +2 -1
  178. package/dist/api/controllers/view/exporters.js +5 -2
  179. package/dist/integrations/base/sql.js +6 -6
  180. package/dist/integrations/dynamodb.js +4 -6
  181. package/dist/package.json +4 -4
  182. package/dist/tests/utilities/TestConfiguration.js +1 -0
  183. package/dist/threads/query.js +3 -0
  184. package/dist/tsconfig.tsbuildinfo +1 -1
  185. package/package.json +5 -5
  186. package/scripts/dev/manage.js +6 -6
  187. package/scripts/integrations/mssql/data/setup.sql +2 -6
  188. package/scripts/integrations/mysql/init.sql +6 -0
  189. package/scripts/likeCypress.ts +1 -1
  190. package/src/api/controllers/query/validation.js +6 -0
  191. package/src/api/controllers/row/ExternalRequest.ts +1 -1
  192. package/src/api/controllers/view/exporters.js +5 -2
  193. package/src/api/routes/tests/query.spec.js +13 -5
  194. package/src/integrations/base/sql.ts +28 -40
  195. package/src/integrations/dynamodb.ts +4 -6
  196. package/src/tests/utilities/TestConfiguration.js +1 -0
  197. package/src/threads/query.js +11 -4
  198. package/builder/assets/index.c0cc369d.css +0 -6
@@ -2047,7 +2047,7 @@ FNDA:1,(anonymous_2)
2047
2047
  FNDA:0,(anonymous_3)
2048
2048
  FNDA:28,(anonymous_4)
2049
2049
  FNDA:3,(anonymous_5)
2050
- FNDA:8,(anonymous_6)
2050
+ FNDA:7,(anonymous_6)
2051
2051
  FNDA:2,execute
2052
2052
  FNDA:2,(anonymous_8)
2053
2053
  FNDA:0,(anonymous_9)
@@ -2107,13 +2107,13 @@ DA:101,1
2107
2107
  DA:102,1
2108
2108
  DA:104,3
2109
2109
  DA:107,39
2110
- DA:108,8
2111
- DA:110,8
2112
- DA:114,8
2113
- DA:116,8
2114
- DA:117,8
2110
+ DA:108,7
2111
+ DA:110,7
2112
+ DA:114,7
2113
+ DA:116,7
2114
+ DA:117,7
2115
2115
  DA:127,7
2116
- DA:134,1
2116
+ DA:134,0
2117
2117
  DA:139,2
2118
2118
  DA:141,2
2119
2119
  DA:142,2
@@ -2151,7 +2151,7 @@ DA:208,2
2151
2151
  DA:209,2
2152
2152
  DA:210,2
2153
2153
  LF:95
2154
- LH:76
2154
+ LH:75
2155
2155
  BRDA:15,0,0,39
2156
2156
  BRDA:15,0,1,39
2157
2157
  BRDA:21,1,0,2
@@ -4393,7 +4393,7 @@ SF:src/api/controllers/view/exporters.js
4393
4393
  FN:1,(anonymous_0)
4394
4394
  FN:2,(anonymous_1)
4395
4395
  FN:6,(anonymous_2)
4396
- FN:16,(anonymous_3)
4396
+ FN:19,(anonymous_3)
4397
4397
  FNF:4
4398
4398
  FNH:4
4399
4399
  FNDA:1,(anonymous_0)
@@ -4406,15 +4406,15 @@ DA:4,1
4406
4406
  DA:5,1
4407
4407
  DA:7,2
4408
4408
  DA:8,2
4409
- DA:9,2
4410
- DA:13,1
4411
- DA:16,38
4412
- DA:17,1
4413
- DA:20,38
4409
+ DA:12,2
4410
+ DA:16,1
4411
+ DA:19,38
4412
+ DA:20,1
4413
+ DA:23,38
4414
4414
  LF:11
4415
4415
  LH:11
4416
- BRDA:8,0,0,0
4417
- BRDA:8,0,1,2
4416
+ BRDA:9,0,0,0
4417
+ BRDA:9,0,1,2
4418
4418
  BRF:2
4419
4419
  BRH:1
4420
4420
  end_of_record
@@ -7738,25 +7738,25 @@ DA:10,23
7738
7738
  DA:11,23
7739
7739
  DA:13,24
7740
7740
  DA:14,24
7741
- DA:15,0
7741
+ DA:15,1
7742
7742
  DA:16,0
7743
- DA:18,24
7743
+ DA:18,23
7744
7744
  DA:22,40
7745
7745
  DA:23,230
7746
7746
  DA:26,40
7747
7747
  DA:27,46
7748
7748
  LF:17
7749
- LH:14
7749
+ LH:15
7750
7750
  BRDA:4,0,0,0
7751
7751
  BRDA:4,0,1,24
7752
7752
  BRDA:8,1,0,1
7753
7753
  BRDA:8,1,1,23
7754
7754
  BRDA:10,2,0,23
7755
7755
  BRDA:10,2,1,0
7756
- BRDA:14,3,0,0
7757
- BRDA:14,3,1,24
7756
+ BRDA:14,3,0,1
7757
+ BRDA:14,3,1,23
7758
7758
  BRF:8
7759
- BRH:5
7759
+ BRH:6
7760
7760
  end_of_record
7761
7761
  TN:
7762
7762
  SF:src/middleware/resourceId.js
@@ -8144,22 +8144,22 @@ FN:46,(anonymous_3)
8144
8144
  FN:54,(anonymous_4)
8145
8145
  FNF:5
8146
8146
  FNH:5
8147
- FNDA:20,typeToFile
8147
+ FNDA:19,typeToFile
8148
8148
  FNDA:77,(anonymous_1)
8149
- FNDA:20,(anonymous_2)
8150
- FNDA:20,(anonymous_3)
8151
- FNDA:16,(anonymous_4)
8149
+ FNDA:19,(anonymous_2)
8150
+ FNDA:19,(anonymous_3)
8151
+ FNDA:15,(anonymous_4)
8152
8152
  DA:1,39
8153
8153
  DA:2,39
8154
8154
  DA:4,39
8155
- DA:10,20
8156
- DA:11,20
8157
- DA:13,10
8158
- DA:14,10
8155
+ DA:10,19
8156
+ DA:11,19
8157
+ DA:13,9
8158
+ DA:14,9
8159
8159
  DA:16,10
8160
8160
  DA:17,10
8161
8161
  DA:19,0
8162
- DA:21,20
8162
+ DA:21,19
8163
8163
  DA:26,77
8164
8164
  DA:27,77
8165
8165
  DA:28,77
@@ -8168,19 +8168,19 @@ DA:34,0
8168
8168
  DA:38,0
8169
8169
  DA:39,0
8170
8170
  DA:41,0
8171
- DA:46,20
8172
- DA:49,20
8173
- DA:50,20
8171
+ DA:46,19
8172
+ DA:49,19
8173
+ DA:50,19
8174
8174
  DA:52,0
8175
- DA:54,20
8176
- DA:55,16
8177
- DA:56,2
8175
+ DA:54,19
8176
+ DA:55,15
8177
+ DA:56,1
8178
8178
  DA:58,14
8179
8179
  DA:65,39
8180
8180
  DA:66,39
8181
8181
  LF:29
8182
8182
  LH:23
8183
- BRDA:11,0,0,10
8183
+ BRDA:11,0,0,9
8184
8184
  BRDA:11,0,1,10
8185
8185
  BRDA:11,0,2,0
8186
8186
  BRDA:25,1,0,38
@@ -8194,9 +8194,9 @@ BRDA:33,4,0,0
8194
8194
  BRDA:33,4,1,77
8195
8195
  BRDA:38,5,0,0
8196
8196
  BRDA:38,5,1,0
8197
- BRDA:49,6,0,20
8197
+ BRDA:49,6,0,19
8198
8198
  BRDA:49,6,1,0
8199
- BRDA:55,7,0,2
8199
+ BRDA:55,7,0,1
8200
8200
  BRDA:55,7,1,14
8201
8201
  BRF:18
8202
8202
  BRH:10
@@ -8212,52 +8212,52 @@ FN:118,(anonymous_5)
8212
8212
  FN:136,(anonymous_6)
8213
8213
  FN:151,(anonymous_7)
8214
8214
  FN:160,(anonymous_8)
8215
- FN:175,(anonymous_9)
8216
- FN:216,(anonymous_10)
8217
- FN:217,(anonymous_11)
8218
- FN:220,(anonymous_12)
8219
- FN:223,(anonymous_13)
8215
+ FN:181,(anonymous_9)
8216
+ FN:223,(anonymous_10)
8217
+ FN:224,(anonymous_11)
8218
+ FN:227,(anonymous_12)
8219
+ FN:230,(anonymous_13)
8220
8220
  FNF:14
8221
8221
  FNH:13
8222
- FNDA:15,(anonymous_0)
8223
- FNDA:16,(anonymous_1)
8222
+ FNDA:14,(anonymous_0)
8223
+ FNDA:15,(anonymous_1)
8224
8224
  FNDA:13,(anonymous_2)
8225
8225
  FNDA:0,(anonymous_3)
8226
8226
  FNDA:5,(anonymous_4)
8227
8227
  FNDA:6,(anonymous_5)
8228
- FNDA:16,(anonymous_6)
8228
+ FNDA:15,(anonymous_6)
8229
8229
  FNDA:6,(anonymous_7)
8230
8230
  FNDA:6,(anonymous_8)
8231
- FNDA:16,(anonymous_9)
8232
- FNDA:10,(anonymous_10)
8233
- FNDA:10,(anonymous_11)
8231
+ FNDA:15,(anonymous_9)
8232
+ FNDA:9,(anonymous_10)
8233
+ FNDA:9,(anonymous_11)
8234
8234
  FNDA:8,(anonymous_12)
8235
- FNDA:2,(anonymous_13)
8235
+ FNDA:1,(anonymous_13)
8236
8236
  DA:1,2
8237
8237
  DA:2,2
8238
8238
  DA:3,2
8239
8239
  DA:4,2
8240
8240
  DA:5,2
8241
8241
  DA:6,2
8242
- DA:10,15
8243
- DA:11,15
8244
- DA:12,15
8245
- DA:13,15
8246
- DA:14,15
8247
- DA:15,15
8248
- DA:16,15
8249
- DA:17,15
8250
- DA:18,15
8251
- DA:22,15
8252
- DA:23,15
8253
- DA:27,16
8254
- DA:29,16
8255
- DA:30,16
8256
- DA:33,16
8242
+ DA:10,14
8243
+ DA:11,14
8244
+ DA:12,14
8245
+ DA:13,14
8246
+ DA:14,14
8247
+ DA:15,14
8248
+ DA:16,14
8249
+ DA:17,14
8250
+ DA:18,14
8251
+ DA:22,14
8252
+ DA:23,14
8253
+ DA:27,15
8254
+ DA:29,15
8255
+ DA:30,15
8256
+ DA:33,15
8257
8257
  DA:34,0
8258
- DA:37,16
8259
- DA:38,16
8260
- DA:39,2
8258
+ DA:37,15
8259
+ DA:38,15
8260
+ DA:39,1
8261
8261
  DA:41,14
8262
8262
  DA:43,14
8263
8263
  DA:44,14
@@ -8300,54 +8300,54 @@ DA:128,5
8300
8300
  DA:129,5
8301
8301
  DA:131,1
8302
8302
  DA:133,6
8303
- DA:137,16
8304
- DA:138,16
8303
+ DA:137,15
8304
+ DA:138,15
8305
8305
  DA:139,0
8306
- DA:141,16
8307
- DA:142,16
8308
- DA:143,16
8306
+ DA:141,15
8307
+ DA:142,15
8308
+ DA:143,15
8309
8309
  DA:144,2
8310
8310
  DA:145,2
8311
- DA:148,16
8312
- DA:150,11
8313
- DA:151,11
8311
+ DA:148,15
8312
+ DA:150,10
8313
+ DA:151,10
8314
8314
  DA:153,6
8315
8315
  DA:154,0
8316
8316
  DA:157,6
8317
8317
  DA:158,6
8318
- DA:160,11
8319
- DA:161,11
8320
- DA:162,11
8318
+ DA:160,10
8319
+ DA:161,10
8320
+ DA:162,10
8321
8321
  DA:163,6
8322
8322
  DA:164,6
8323
- DA:169,6
8324
- DA:172,16
8325
- DA:176,16
8326
- DA:179,16
8327
- DA:180,19
8328
- DA:181,0
8329
- DA:183,19
8330
- DA:185,0
8323
+ DA:175,6
8324
+ DA:178,15
8325
+ DA:182,15
8326
+ DA:185,15
8331
8327
  DA:186,19
8332
- DA:188,19
8333
- DA:193,0
8334
- DA:196,16
8335
- DA:201,0
8336
- DA:202,0
8337
- DA:210,0
8338
- DA:212,16
8339
- DA:216,2
8340
- DA:217,10
8341
- DA:218,10
8342
- DA:219,10
8343
- DA:221,8
8344
- DA:224,2
8328
+ DA:187,0
8329
+ DA:189,19
8330
+ DA:191,0
8331
+ DA:192,19
8332
+ DA:194,19
8333
+ DA:200,0
8334
+ DA:203,15
8335
+ DA:208,0
8336
+ DA:209,0
8337
+ DA:217,0
8338
+ DA:219,15
8339
+ DA:223,2
8340
+ DA:224,9
8341
+ DA:225,9
8342
+ DA:226,9
8343
+ DA:228,8
8344
+ DA:231,1
8345
8345
  LF:109
8346
8346
  LH:95
8347
- BRDA:9,0,0,10
8347
+ BRDA:9,0,0,9
8348
8348
  BRDA:33,1,0,0
8349
- BRDA:33,1,1,16
8350
- BRDA:38,2,0,2
8349
+ BRDA:33,1,1,15
8350
+ BRDA:38,2,0,1
8351
8351
  BRDA:38,2,1,14
8352
8352
  BRDA:48,3,0,12
8353
8353
  BRDA:48,3,1,2
@@ -8372,34 +8372,34 @@ BRDA:123,11,1,1
8372
8372
  BRDA:124,12,0,0
8373
8373
  BRDA:124,12,1,5
8374
8374
  BRDA:138,13,0,0
8375
- BRDA:138,13,1,16
8376
- BRDA:138,14,0,16
8377
- BRDA:138,14,1,16
8378
- BRDA:141,15,0,16
8379
- BRDA:141,15,1,15
8380
- BRDA:142,16,0,16
8381
- BRDA:142,16,1,5
8375
+ BRDA:138,13,1,15
8376
+ BRDA:138,14,0,15
8377
+ BRDA:138,14,1,15
8378
+ BRDA:141,15,0,15
8379
+ BRDA:141,15,1,14
8380
+ BRDA:142,16,0,15
8381
+ BRDA:142,16,1,4
8382
8382
  BRDA:144,17,0,2
8383
8383
  BRDA:144,17,1,0
8384
- BRDA:148,18,0,11
8384
+ BRDA:148,18,0,10
8385
8385
  BRDA:148,18,1,5
8386
8386
  BRDA:153,19,0,0
8387
8387
  BRDA:153,19,1,6
8388
- BRDA:175,20,0,0
8389
- BRDA:180,21,0,0
8390
- BRDA:180,21,1,19
8391
- BRDA:183,22,0,0
8392
- BRDA:183,22,1,19
8393
- BRDA:186,23,0,19
8394
- BRDA:186,23,1,0
8395
- BRDA:196,24,0,0
8396
- BRDA:196,24,1,16
8397
- BRDA:197,25,0,16
8398
- BRDA:197,25,1,16
8399
- BRDA:197,25,2,16
8400
- BRDA:203,26,0,0
8401
- BRDA:203,26,1,0
8402
- BRDA:203,26,2,0
8388
+ BRDA:181,20,0,0
8389
+ BRDA:186,21,0,0
8390
+ BRDA:186,21,1,19
8391
+ BRDA:189,22,0,0
8392
+ BRDA:189,22,1,19
8393
+ BRDA:192,23,0,19
8394
+ BRDA:192,23,1,0
8395
+ BRDA:203,24,0,0
8396
+ BRDA:203,24,1,15
8397
+ BRDA:204,25,0,15
8398
+ BRDA:204,25,1,15
8399
+ BRDA:204,25,2,15
8400
+ BRDA:210,26,0,0
8401
+ BRDA:210,26,1,0
8402
+ BRDA:210,26,2,0
8403
8403
  BRF:56
8404
8404
  BRH:39
8405
8405
  end_of_record
@@ -27,8 +27,14 @@ exports.generateQueryValidation = () => {
27
27
  exports.generateQueryPreviewValidation = () => {
28
28
  // prettier-ignore
29
29
  return joiValidator.body(Joi.object({
30
+ _id: Joi.string().optional(),
31
+ _rev: Joi.string().optional(),
32
+ readable: Joi.boolean().optional(),
30
33
  fields: Joi.object().required(),
31
34
  queryVerb: Joi.string().allow().required(),
35
+ name: Joi.string().required(),
36
+ flags: Joi.object().optional(),
37
+ schema: Joi.object().optional(),
32
38
  extra: Joi.object().optional(),
33
39
  datasourceId: Joi.string().required(),
34
40
  transformer: Joi.string().optional(),
@@ -447,6 +447,7 @@ var External;
447
447
  * all and then re-create, as theres no chance of losing data (e.g. delete succeed, but write fail).
448
448
  */
449
449
  handleManyRelationships(mainTableId, row, relationships) {
450
+ var _a;
450
451
  return __awaiter(this, void 0, void 0, function* () {
451
452
  // if we're creating (in a through table) need to wipe the existing ones first
452
453
  const promises = [];
@@ -460,7 +461,7 @@ var External;
460
461
  if (!linkTable || !linkPrimary) {
461
462
  return;
462
463
  }
463
- const rows = related[key].rows || [];
464
+ const rows = ((_a = related[key]) === null || _a === void 0 ? void 0 : _a.rows) || [];
464
465
  const found = rows.find((row) => row[linkPrimary] === relationship.id ||
465
466
  row[linkPrimary] === (body === null || body === void 0 ? void 0 : body[linkPrimary]));
466
467
  const operation = isUpdate
@@ -5,8 +5,11 @@ exports.csv = function (headers, rows) {
5
5
  csv = `${csv}\n${headers
6
6
  .map(header => {
7
7
  let val = row[header];
8
- val = typeof val === "object" ? JSON.stringify(val) : val;
9
- return `"${val}"`.trim();
8
+ val =
9
+ typeof val === "object"
10
+ ? `"${JSON.stringify(val).replace(/"/g, "'")}"`
11
+ : `"${val}"`;
12
+ return val.trim();
10
13
  })
11
14
  .join(",")}`;
12
15
  }
@@ -198,33 +198,33 @@ class InternalBuilder {
198
198
  const { toTable, throughTable } = JSON.parse(key);
199
199
  if (!throughTable) {
200
200
  // @ts-ignore
201
- query = query.join(toTable, function () {
201
+ query = query.leftJoin(toTable, function () {
202
202
  for (let relationship of relationships) {
203
203
  const from = relationship.from, to = relationship.to;
204
204
  // @ts-ignore
205
205
  this.orOn(`${fromTable}.${from}`, "=", `${toTable}.${to}`);
206
206
  }
207
- }, "left");
207
+ });
208
208
  }
209
209
  else {
210
210
  query = query
211
211
  // @ts-ignore
212
- .join(throughTable, function () {
212
+ .leftJoin(throughTable, function () {
213
213
  for (let relationship of relationships) {
214
214
  const fromPrimary = relationship.fromPrimary;
215
215
  const from = relationship.from;
216
216
  // @ts-ignore
217
217
  this.orOn(`${fromTable}.${fromPrimary}`, "=", `${throughTable}.${from}`);
218
218
  }
219
- }, "left")
220
- .join(toTable, function () {
219
+ })
220
+ .leftJoin(toTable, function () {
221
221
  for (let relationship of relationships) {
222
222
  const toPrimary = relationship.toPrimary;
223
223
  const to = relationship.to;
224
224
  // @ts-ignore
225
225
  this.orOn(`${toTable}.${toPrimary}`, `${throughTable}.${to}`);
226
226
  }
227
- }, "left");
227
+ });
228
228
  }
229
229
  }
230
230
  return query.limit(BASE_LIMIT);
@@ -153,13 +153,11 @@ var DynamoModule;
153
153
  read(query) {
154
154
  return __awaiter(this, void 0, void 0, function* () {
155
155
  const params = Object.assign({ TableName: query.table, IndexName: query.index ? query.index : undefined }, query.json);
156
- if (query.index) {
157
- const response = yield this.client.query(params).promise();
158
- if (response.Items) {
159
- return response.Items;
160
- }
161
- return response;
156
+ const response = yield this.client.query(params).promise();
157
+ if (response.Items) {
158
+ return response.Items;
162
159
  }
160
+ return response;
163
161
  });
164
162
  }
165
163
  scan(query) {
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.56",
4
+ "version": "1.0.58-alpha.2",
5
5
  "description": "Budibase Web Server",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -70,9 +70,9 @@
70
70
  "license": "GPL-3.0",
71
71
  "dependencies": {
72
72
  "@apidevtools/swagger-parser": "^10.0.3",
73
- "@budibase/backend-core": "^1.0.56",
74
- "@budibase/client": "^1.0.56",
75
- "@budibase/string-templates": "^1.0.56",
73
+ "@budibase/backend-core": "^1.0.58-alpha.2",
74
+ "@budibase/client": "^1.0.58-alpha.2",
75
+ "@budibase/string-templates": "^1.0.58-alpha.2",
76
76
  "@bull-board/api": "^3.7.0",
77
77
  "@bull-board/koa": "^3.7.0",
78
78
  "@elastic/elasticsearch": "7.10.0",
@@ -363,6 +363,7 @@ class TestConfiguration {
363
363
  parameters: {},
364
364
  fields,
365
365
  queryVerb: "read",
366
+ name: datasource.name,
366
367
  })
367
368
  .set(config.defaultHeaders())
368
369
  .expect("Content-Type", /json/)
@@ -157,6 +157,8 @@ class QueryRunner {
157
157
  parameters[variable.name] = processStringSync(variable.value, {
158
158
  data: responses[i].rows,
159
159
  info: responses[i].extra,
160
+ }, {
161
+ escapeNewlines: true,
160
162
  });
161
163
  // make sure its known that this uses dynamic variables in case it fails
162
164
  this.hasDynamicVariables = true;
@@ -181,6 +183,7 @@ class QueryRunner {
181
183
  enrichedQuery[key] = processStringSync(fields[key], parameters, {
182
184
  noEscaping: true,
183
185
  noHelpers: true,
186
+ escapeNewlines: true,
184
187
  });
185
188
  }
186
189
  else {