@budibase/server 1.0.161 → 1.0.164-alpha.0

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.bb5e3dfd.css → index.9d13e5e6.css} +2 -2
  2. package/builder/assets/{index.29f75f3c.js → index.ec92e588.js} +162 -162
  3. package/builder/assets/{vendor.5240f480.js → vendor.3d08483f.js} +1 -1
  4. package/builder/index.html +3 -3
  5. package/coverage/clover.xml +106 -98
  6. package/coverage/coverage-final.json +4 -4
  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/auth.js.html +1 -1
  10. package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
  11. package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
  12. package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
  13. package/coverage/lcov-report/api/controllers/component.js.html +1 -1
  14. package/coverage/lcov-report/api/controllers/datasource.js.html +1 -1
  15. package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
  16. package/coverage/lcov-report/api/controllers/index.html +1 -1
  17. package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
  18. package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
  19. package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
  20. package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
  21. package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
  22. package/coverage/lcov-report/api/controllers/query/index.html +1 -1
  23. package/coverage/lcov-report/api/controllers/query/validation.js.html +1 -1
  24. package/coverage/lcov-report/api/controllers/role.js.html +1 -1
  25. package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
  26. package/coverage/lcov-report/api/controllers/row/external.js.html +1 -1
  27. package/coverage/lcov-report/api/controllers/row/index.html +1 -1
  28. package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
  29. package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1 -1
  30. package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
  31. package/coverage/lcov-report/api/controllers/row/utils.js.html +1 -1
  32. package/coverage/lcov-report/api/controllers/screen.js.html +1 -1
  33. package/coverage/lcov-report/api/controllers/script.js.html +1 -1
  34. package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
  35. package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
  36. package/coverage/lcov-report/api/controllers/table/index.html +1 -1
  37. package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
  38. package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
  39. package/coverage/lcov-report/api/controllers/user.js.html +1 -1
  40. package/coverage/lcov-report/api/controllers/view/exporters.js.html +3 -3
  41. package/coverage/lcov-report/api/controllers/view/index.html +25 -25
  42. package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
  43. package/coverage/lcov-report/api/controllers/view/utils.js.html +14 -8
  44. package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +111 -48
  45. package/coverage/lcov-report/api/controllers/webhook.js.html +1 -1
  46. package/coverage/lcov-report/api/index.html +1 -1
  47. package/coverage/lcov-report/api/index.js.html +1 -1
  48. package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
  49. package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
  50. package/coverage/lcov-report/api/routes/auth.js.html +1 -1
  51. package/coverage/lcov-report/api/routes/automation.js.html +1 -1
  52. package/coverage/lcov-report/api/routes/backup.js.html +1 -1
  53. package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
  54. package/coverage/lcov-report/api/routes/component.js.html +1 -1
  55. package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
  56. package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
  57. package/coverage/lcov-report/api/routes/dev.js.html +1 -1
  58. package/coverage/lcov-report/api/routes/index.html +1 -1
  59. package/coverage/lcov-report/api/routes/integration.js.html +1 -1
  60. package/coverage/lcov-report/api/routes/layout.js.html +1 -1
  61. package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
  62. package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
  63. package/coverage/lcov-report/api/routes/permission.js.html +1 -1
  64. package/coverage/lcov-report/api/routes/query.js.html +1 -1
  65. package/coverage/lcov-report/api/routes/role.js.html +1 -1
  66. package/coverage/lcov-report/api/routes/routing.js.html +1 -1
  67. package/coverage/lcov-report/api/routes/screen.js.html +1 -1
  68. package/coverage/lcov-report/api/routes/script.js.html +1 -1
  69. package/coverage/lcov-report/api/routes/table.js.html +1 -1
  70. package/coverage/lcov-report/api/routes/templates.js.html +1 -1
  71. package/coverage/lcov-report/api/routes/user.js.html +1 -1
  72. package/coverage/lcov-report/api/routes/utils/index.html +1 -1
  73. package/coverage/lcov-report/api/routes/utils/validators.js.html +1 -1
  74. package/coverage/lcov-report/api/routes/view.js.html +1 -1
  75. package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
  76. package/coverage/lcov-report/automations/actions.js.html +1 -1
  77. package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
  78. package/coverage/lcov-report/automations/bullboard.js.html +1 -1
  79. package/coverage/lcov-report/automations/index.html +1 -1
  80. package/coverage/lcov-report/automations/index.js.html +1 -1
  81. package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
  82. package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
  83. package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
  84. package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
  85. package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
  86. package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
  87. package/coverage/lcov-report/automations/steps/index.html +1 -1
  88. package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
  89. package/coverage/lcov-report/automations/steps/loop.js.html +1 -1
  90. package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
  91. package/coverage/lcov-report/automations/steps/queryRows.js.html +5 -2
  92. package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
  93. package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
  94. package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
  95. package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
  96. package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
  97. package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
  98. package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
  99. package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
  100. package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
  101. package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
  102. package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
  103. package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
  104. package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
  105. package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
  106. package/coverage/lcov-report/automations/triggers.js.html +1 -1
  107. package/coverage/lcov-report/constants/index.html +1 -1
  108. package/coverage/lcov-report/constants/index.js.html +1 -1
  109. package/coverage/lcov-report/constants/layouts.js.html +1 -1
  110. package/coverage/lcov-report/constants/screens.js.html +1 -1
  111. package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
  112. package/coverage/lcov-report/db/index.html +1 -1
  113. package/coverage/lcov-report/db/index.js.html +1 -1
  114. package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
  115. package/coverage/lcov-report/db/linkedRows/index.html +1 -1
  116. package/coverage/lcov-report/db/linkedRows/index.js.html +1 -1
  117. package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +1 -1
  118. package/coverage/lcov-report/db/newid.js.html +1 -1
  119. package/coverage/lcov-report/db/utils.js.html +1 -1
  120. package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
  121. package/coverage/lcov-report/events/index.html +1 -1
  122. package/coverage/lcov-report/events/index.js.html +1 -1
  123. package/coverage/lcov-report/events/utils.js.html +1 -1
  124. package/coverage/lcov-report/index.html +19 -19
  125. package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
  126. package/coverage/lcov-report/integrations/tests/index.html +1 -1
  127. package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
  128. package/coverage/lcov-report/middleware/builder.js.html +1 -1
  129. package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
  130. package/coverage/lcov-report/middleware/index.html +1 -1
  131. package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
  132. package/coverage/lcov-report/middleware/publicApi.js.html +1 -1
  133. package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
  134. package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
  135. package/coverage/lcov-report/middleware/utils.js.html +1 -1
  136. package/coverage/lcov-report/threads/automation.js.html +1 -1
  137. package/coverage/lcov-report/threads/index.html +1 -1
  138. package/coverage/lcov-report/threads/query.js.html +1 -1
  139. package/coverage/lcov-report/threads/utils.js.html +1 -1
  140. package/coverage/lcov-report/utilities/bcrypt.js.html +1 -1
  141. package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
  142. package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
  143. package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
  144. package/coverage/lcov-report/utilities/global.js.html +1 -1
  145. package/coverage/lcov-report/utilities/index.html +1 -1
  146. package/coverage/lcov-report/utilities/index.js.html +1 -1
  147. package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
  148. package/coverage/lcov-report/utilities/queue/index.html +1 -1
  149. package/coverage/lcov-report/utilities/routing/index.html +1 -1
  150. package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
  151. package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
  152. package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
  153. package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
  154. package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
  155. package/coverage/lcov-report/utilities/security.js.html +1 -1
  156. package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
  157. package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
  158. package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
  159. package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
  160. package/coverage/lcov-report/utilities/users.js.html +1 -1
  161. package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
  162. package/coverage/lcov.info +189 -171
  163. package/dist/api/controllers/view/exporters.js +1 -1
  164. package/dist/api/controllers/view/utils.js +4 -2
  165. package/dist/api/controllers/view/viewBuilder.js +22 -8
  166. package/dist/automations/steps/queryRows.js +1 -0
  167. package/dist/integrations/mongodb.js +77 -13
  168. package/dist/package.json +5 -5
  169. package/dist/tsconfig.build.tsbuildinfo +1 -1
  170. package/package.json +6 -6
  171. package/src/api/controllers/view/exporters.js +1 -1
  172. package/src/api/controllers/view/tests/__snapshots__/viewBuilder.spec.js.snap +58 -1
  173. package/src/api/controllers/view/tests/viewBuilder.spec.js +18 -0
  174. package/src/api/controllers/view/utils.js +4 -2
  175. package/src/api/controllers/view/viewBuilder.js +32 -11
  176. package/src/automations/steps/queryRows.js +1 -0
  177. package/src/integrations/mongodb.ts +112 -13
  178. package/src/integrations/tests/mongo.spec.js +34 -17
@@ -3354,8 +3354,10 @@ LF:11
3354
3354
  LH:11
3355
3355
  BRDA:9,0,0,0
3356
3356
  BRDA:9,0,1,2
3357
- BRF:2
3358
- BRH:1
3357
+ BRDA:9,1,0,2
3358
+ BRDA:9,1,1,0
3359
+ BRF:4
3360
+ BRH:2
3359
3361
  end_of_record
3360
3362
  TN:
3361
3363
  SF:src/api/controllers/view/index.js
@@ -3477,15 +3479,15 @@ BRH:18
3477
3479
  end_of_record
3478
3480
  TN:
3479
3481
  SF:src/api/controllers/view/utils.js
3480
- FN:11,(anonymous_0)
3481
- FN:27,(anonymous_1)
3482
- FN:49,(anonymous_2)
3483
- FN:60,(anonymous_3)
3484
- FN:98,(anonymous_4)
3485
- FN:114,(anonymous_5)
3486
- FN:123,(anonymous_6)
3487
- FN:131,(anonymous_7)
3488
- FN:140,(anonymous_8)
3482
+ FN:12,(anonymous_0)
3483
+ FN:28,(anonymous_1)
3484
+ FN:50,(anonymous_2)
3485
+ FN:61,(anonymous_3)
3486
+ FN:99,(anonymous_4)
3487
+ FN:115,(anonymous_5)
3488
+ FN:125,(anonymous_6)
3489
+ FN:133,(anonymous_7)
3490
+ FN:142,(anonymous_8)
3489
3491
  FNF:9
3490
3492
  FNH:6
3491
3493
  FNDA:2,(anonymous_0)
@@ -3500,194 +3502,210 @@ FNDA:1,(anonymous_8)
3500
3502
  DA:7,41
3501
3503
  DA:8,41
3502
3504
  DA:9,41
3503
- DA:11,41
3504
- DA:12,2
3505
+ DA:10,41
3506
+ DA:12,41
3505
3507
  DA:13,2
3506
3508
  DA:14,2
3507
3509
  DA:15,2
3508
- DA:18,0
3510
+ DA:16,2
3509
3511
  DA:19,0
3510
- DA:22,0
3512
+ DA:20,0
3511
3513
  DA:23,0
3512
- DA:27,41
3513
- DA:28,2
3514
+ DA:24,0
3515
+ DA:28,41
3514
3516
  DA:29,2
3515
3517
  DA:30,2
3516
3518
  DA:31,2
3517
3519
  DA:32,2
3518
- DA:34,5
3519
- DA:35,4
3520
- DA:37,1
3521
- DA:43,0
3522
- DA:49,0
3520
+ DA:33,2
3521
+ DA:35,5
3522
+ DA:36,4
3523
+ DA:38,1
3524
+ DA:44,0
3523
3525
  DA:50,0
3524
3526
  DA:51,0
3525
- DA:57,2
3526
- DA:60,41
3527
- DA:61,8
3527
+ DA:52,0
3528
+ DA:58,2
3529
+ DA:61,41
3528
3530
  DA:62,8
3529
3531
  DA:63,8
3530
3532
  DA:64,8
3531
- DA:69,8
3532
- DA:70,0
3533
- DA:72,8
3534
- DA:74,0
3533
+ DA:65,8
3534
+ DA:70,8
3535
+ DA:71,0
3536
+ DA:73,8
3535
3537
  DA:75,0
3536
3538
  DA:76,0
3537
- DA:82,0
3539
+ DA:77,0
3538
3540
  DA:83,0
3539
3541
  DA:84,0
3540
3542
  DA:85,0
3541
3543
  DA:86,0
3542
- DA:88,0
3544
+ DA:87,0
3543
3545
  DA:89,0
3544
- DA:94,0
3545
- DA:98,41
3546
- DA:99,1
3546
+ DA:90,0
3547
+ DA:95,0
3548
+ DA:99,41
3547
3549
  DA:100,1
3548
3550
  DA:101,1
3549
3551
  DA:102,1
3550
3552
  DA:103,1
3551
3553
  DA:104,1
3552
3554
  DA:105,1
3553
- DA:107,0
3555
+ DA:106,1
3554
3556
  DA:108,0
3555
3557
  DA:109,0
3556
3558
  DA:110,0
3557
- DA:114,41
3558
- DA:116,0
3559
+ DA:111,0
3560
+ DA:115,41
3559
3561
  DA:117,0
3560
- DA:118,0
3561
3562
  DA:119,0
3562
3563
  DA:120,0
3563
- DA:123,41
3564
- DA:124,0
3565
- DA:125,0
3564
+ DA:121,0
3565
+ DA:122,0
3566
+ DA:125,41
3566
3567
  DA:126,0
3567
3568
  DA:127,0
3568
3569
  DA:128,0
3569
- DA:131,41
3570
- DA:132,6
3571
- DA:133,6
3570
+ DA:129,0
3571
+ DA:130,0
3572
+ DA:133,41
3572
3573
  DA:134,6
3573
- DA:135,1
3574
- DA:137,5
3575
- DA:140,41
3576
- DA:141,1
3577
- DA:142,0
3578
- DA:143,0
3574
+ DA:135,6
3575
+ DA:136,6
3576
+ DA:137,1
3577
+ DA:139,5
3578
+ DA:142,41
3579
+ DA:143,1
3580
+ DA:144,0
3579
3581
  DA:145,0
3580
3582
  DA:147,0
3581
- LF:81
3582
- LH:43
3583
- BRDA:13,0,0,2
3584
- BRDA:13,0,1,0
3585
- BRDA:18,1,0,0
3586
- BRDA:18,1,1,0
3587
- BRDA:30,2,0,2
3588
- BRDA:30,2,1,0
3589
- BRDA:34,3,0,4
3590
- BRDA:34,3,1,1
3591
- BRDA:62,4,0,8
3592
- BRDA:62,4,1,0
3593
- BRDA:69,5,0,0
3594
- BRDA:69,5,1,8
3595
- BRDA:75,6,0,0
3596
- BRDA:75,6,1,0
3597
- BRDA:84,7,0,0
3598
- BRDA:84,7,1,0
3599
- BRDA:88,8,0,0
3600
- BRDA:88,8,1,0
3601
- BRDA:88,9,0,0
3602
- BRDA:88,9,1,0
3603
- BRDA:100,10,0,1
3604
- BRDA:100,10,1,0
3605
- BRDA:134,11,0,1
3606
- BRDA:134,11,1,5
3607
- BRDA:142,12,0,0
3608
- BRDA:142,12,1,0
3583
+ DA:149,0
3584
+ LF:82
3585
+ LH:44
3586
+ BRDA:14,0,0,2
3587
+ BRDA:14,0,1,0
3588
+ BRDA:19,1,0,0
3589
+ BRDA:19,1,1,0
3590
+ BRDA:31,2,0,2
3591
+ BRDA:31,2,1,0
3592
+ BRDA:35,3,0,4
3593
+ BRDA:35,3,1,1
3594
+ BRDA:63,4,0,8
3595
+ BRDA:63,4,1,0
3596
+ BRDA:70,5,0,0
3597
+ BRDA:70,5,1,8
3598
+ BRDA:76,6,0,0
3599
+ BRDA:76,6,1,0
3600
+ BRDA:85,7,0,0
3601
+ BRDA:85,7,1,0
3602
+ BRDA:89,8,0,0
3603
+ BRDA:89,8,1,0
3604
+ BRDA:89,9,0,0
3605
+ BRDA:89,9,1,0
3606
+ BRDA:101,10,0,1
3607
+ BRDA:101,10,1,0
3608
+ BRDA:136,11,0,1
3609
+ BRDA:136,11,1,5
3610
+ BRDA:144,12,0,0
3611
+ BRDA:144,12,1,0
3609
3612
  BRF:26
3610
3613
  BRH:9
3611
3614
  end_of_record
3612
3615
  TN:
3613
3616
  SF:src/api/controllers/view/viewBuilder.js
3614
- FN:13,(anonymous_0)
3615
- FN:71,parseFilterExpression
3616
- FN:108,parseEmitExpression
3617
- FN:123,viewTemplate
3618
- FNF:4
3619
- FNH:3
3620
- FNDA:0,(anonymous_0)
3621
- FNDA:11,parseFilterExpression
3622
- FNDA:11,parseEmitExpression
3623
- FNDA:11,viewTemplate
3617
+ FN:19,(anonymous_0)
3618
+ FN:77,parseFilterExpression
3619
+ FN:114,parseEmitExpression
3620
+ FN:129,viewTemplate
3621
+ FN:145,(anonymous_4)
3622
+ FNF:5
3623
+ FNH:5
3624
+ FNDA:7,(anonymous_0)
3625
+ FNDA:19,parseFilterExpression
3626
+ FNDA:12,parseEmitExpression
3627
+ FNDA:12,viewTemplate
3628
+ FNDA:1,(anonymous_4)
3624
3629
  DA:1,42
3625
3630
  DA:13,42
3626
- DA:14,0
3627
- DA:22,42
3631
+ DA:19,42
3632
+ DA:20,7
3628
3633
  DA:28,42
3629
3634
  DA:34,42
3630
- DA:72,11
3631
- DA:74,11
3632
- DA:75,11
3633
- DA:76,2
3634
- DA:77,1
3635
- DA:80,2
3636
- DA:81,0
3637
- DA:84,2
3638
- DA:85,0
3639
- DA:86,2
3635
+ DA:40,42
3636
+ DA:78,19
3637
+ DA:80,19
3638
+ DA:81,19
3639
+ DA:82,10
3640
+ DA:83,1
3641
+ DA:86,10
3640
3642
  DA:87,0
3641
- DA:90,2
3642
- DA:92,2
3643
- DA:96,2
3644
- DA:99,11
3645
- DA:109,11
3646
- DA:125,11
3647
- DA:126,0
3648
- DA:128,11
3649
- DA:129,11
3650
- DA:131,11
3651
- DA:133,11
3652
- DA:135,11
3653
- DA:137,11
3654
- DA:138,6
3655
- DA:144,11
3656
- DA:162,42
3657
- LF:33
3658
- LH:28
3659
- BRDA:76,0,0,1
3660
- BRDA:76,0,1,1
3661
- BRDA:76,1,0,2
3662
- BRDA:76,1,1,1
3663
- BRDA:80,2,0,0
3664
- BRDA:80,2,1,2
3665
- BRDA:84,3,0,0
3666
- BRDA:84,3,1,2
3667
- BRDA:86,4,0,0
3668
- BRDA:86,4,1,2
3669
- BRDA:90,5,0,2
3670
- BRDA:90,5,1,0
3671
- BRDA:109,6,0,11
3672
- BRDA:109,6,1,9
3673
- BRDA:123,7,0,8
3674
- BRDA:125,8,0,0
3675
- BRDA:125,8,1,11
3676
- BRDA:125,9,0,11
3677
- BRDA:125,9,1,11
3678
- BRDA:125,9,2,1
3679
- BRDA:129,10,0,1
3680
- BRDA:129,10,1,10
3681
- BRDA:133,11,0,6
3682
- BRDA:133,11,1,5
3683
- BRDA:133,12,0,11
3684
- BRDA:133,12,1,7
3685
- BRDA:137,13,0,6
3686
- BRDA:137,13,1,5
3687
- BRDA:139,14,0,1
3688
- BRDA:139,14,1,5
3689
- BRF:30
3690
- BRH:25
3643
+ DA:90,10
3644
+ DA:91,0
3645
+ DA:92,10
3646
+ DA:93,7
3647
+ DA:96,3
3648
+ DA:98,3
3649
+ DA:102,10
3650
+ DA:105,19
3651
+ DA:115,12
3652
+ DA:131,12
3653
+ DA:132,0
3654
+ DA:135,12
3655
+ DA:136,12
3656
+ DA:138,12
3657
+ DA:139,7
3658
+ DA:143,7
3659
+ DA:146,1
3660
+ DA:149,7
3661
+ DA:155,12
3662
+ DA:156,12
3663
+ DA:158,12
3664
+ DA:159,12
3665
+ DA:160,12
3666
+ DA:163,12
3667
+ DA:165,12
3668
+ DA:183,42
3669
+ LF:40
3670
+ LH:37
3671
+ BRDA:82,0,0,1
3672
+ BRDA:82,0,1,9
3673
+ BRDA:82,1,0,10
3674
+ BRDA:82,1,1,1
3675
+ BRDA:86,2,0,0
3676
+ BRDA:86,2,1,10
3677
+ BRDA:90,3,0,0
3678
+ BRDA:90,3,1,10
3679
+ BRDA:92,4,0,7
3680
+ BRDA:92,4,1,3
3681
+ BRDA:96,5,0,2
3682
+ BRDA:96,5,1,1
3683
+ BRDA:115,6,0,12
3684
+ BRDA:115,6,1,10
3685
+ BRDA:129,7,0,8
3686
+ BRDA:131,8,0,0
3687
+ BRDA:131,8,1,12
3688
+ BRDA:131,9,0,12
3689
+ BRDA:131,9,1,12
3690
+ BRDA:131,9,2,2
3691
+ BRDA:138,10,0,7
3692
+ BRDA:138,10,1,5
3693
+ BRDA:140,11,0,1
3694
+ BRDA:140,11,1,6
3695
+ BRDA:143,12,0,7
3696
+ BRDA:143,12,1,0
3697
+ BRDA:146,13,0,1
3698
+ BRDA:146,13,1,0
3699
+ BRDA:156,14,0,2
3700
+ BRDA:156,14,1,10
3701
+ BRDA:160,15,0,7
3702
+ BRDA:160,15,1,5
3703
+ BRDA:163,16,0,7
3704
+ BRDA:163,16,1,5
3705
+ BRDA:163,17,0,12
3706
+ BRDA:163,17,1,8
3707
+ BRF:36
3708
+ BRH:31
3691
3709
  end_of_record
3692
3710
  TN:
3693
3711
  SF:src/api/routes/analytics.js
@@ -4752,8 +4770,8 @@ BRH:12
4752
4770
  end_of_record
4753
4771
  TN:
4754
4772
  SF:src/automations/steps/queryRows.js
4755
- FN:74,getTable
4756
- FN:84,(anonymous_1)
4773
+ FN:75,getTable
4774
+ FN:85,(anonymous_1)
4757
4775
  FNF:2
4758
4776
  FNH:2
4759
4777
  FNDA:1,getTable
@@ -4766,35 +4784,35 @@ DA:5,41
4766
4784
  DA:7,41
4767
4785
  DA:12,41
4768
4786
  DA:17,41
4769
- DA:75,1
4770
- DA:80,1
4787
+ DA:76,1
4771
4788
  DA:81,1
4772
- DA:84,41
4773
- DA:85,1
4789
+ DA:82,1
4790
+ DA:85,41
4774
4791
  DA:86,1
4775
4792
  DA:87,1
4776
4793
  DA:88,1
4777
4794
  DA:89,1
4778
4795
  DA:90,1
4779
- DA:93,1
4780
- DA:105,1
4796
+ DA:91,1
4797
+ DA:94,1
4781
4798
  DA:106,1
4782
4799
  DA:107,1
4783
- DA:112,0
4800
+ DA:108,1
4801
+ DA:113,0
4784
4802
  LF:23
4785
4803
  LH:22
4786
- BRDA:88,0,0,1
4787
- BRDA:88,0,1,0
4788
- BRDA:88,1,0,1
4789
- BRDA:88,1,1,1
4790
- BRDA:88,1,2,1
4791
- BRDA:88,1,3,1
4792
- BRDA:91,2,0,0
4793
- BRDA:91,2,1,1
4794
- BRDA:101,3,0,1
4795
- BRDA:101,3,1,0
4796
- BRDA:108,4,0,1
4797
- BRDA:108,4,1,0
4804
+ BRDA:89,0,0,1
4805
+ BRDA:89,0,1,0
4806
+ BRDA:89,1,0,1
4807
+ BRDA:89,1,1,1
4808
+ BRDA:89,1,2,1
4809
+ BRDA:89,1,3,1
4810
+ BRDA:92,2,0,0
4811
+ BRDA:92,2,1,1
4812
+ BRDA:102,3,0,1
4813
+ BRDA:102,3,1,0
4814
+ BRDA:109,4,0,1
4815
+ BRDA:109,4,1,0
4798
4816
  BRF:12
4799
4817
  BRH:8
4800
4818
  end_of_record
@@ -6,7 +6,7 @@ exports.csv = function (headers, rows) {
6
6
  .map(header => {
7
7
  let val = row[header];
8
8
  val =
9
- typeof val === "object"
9
+ typeof val === "object" && !(val instanceof Date)
10
10
  ? `"${JSON.stringify(val).replace(/"/g, "'")}"`
11
11
  : `"${val}"`;
12
12
  return val.trim();
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  const { ViewNames, generateMemoryViewID, getMemoryViewParams, DocumentTypes, SEPARATOR, } = require("../../../db/utils");
12
12
  const env = require("../../../environment");
13
13
  const { getAppDB } = require("@budibase/backend-core/context");
14
+ const viewBuilder = require("./viewBuilder");
14
15
  exports.getView = (viewName) => __awaiter(void 0, void 0, void 0, function* () {
15
16
  const db = getAppDB();
16
17
  if (env.SELF_HOSTED) {
@@ -104,7 +105,8 @@ exports.deleteView = (viewName) => __awaiter(void 0, void 0, void 0, function* (
104
105
  exports.migrateToInMemoryView = (db, viewName) => __awaiter(void 0, void 0, void 0, function* () {
105
106
  // delete the view initially
106
107
  const designDoc = yield db.get("_design/database");
107
- const view = designDoc.views[viewName];
108
+ // run the view back through the view builder to update it
109
+ const view = viewBuilder(designDoc.views[viewName].meta);
108
110
  delete designDoc.views[viewName];
109
111
  yield db.put(designDoc);
110
112
  yield exports.saveView(db, null, viewName, view);
@@ -112,7 +114,7 @@ exports.migrateToInMemoryView = (db, viewName) => __awaiter(void 0, void 0, void
112
114
  exports.migrateToDesignView = (db, viewName) => __awaiter(void 0, void 0, void 0, function* () {
113
115
  let view = yield db.get(generateMemoryViewID(viewName));
114
116
  const designDoc = yield db.get("_design/database");
115
- designDoc.views[viewName] = view.view;
117
+ designDoc.views[viewName] = viewBuilder(view.view.meta);
116
118
  yield db.put(designDoc);
117
119
  yield db.remove(view._id, view._rev);
118
120
  });
@@ -10,6 +10,11 @@ const TOKEN_MAP = {
10
10
  AND: "&&",
11
11
  OR: "||",
12
12
  };
13
+ const CONDITIONS = {
14
+ EMPTY: "EMPTY",
15
+ NOT_EMPTY: "NOT_EMPTY",
16
+ CONTAINS: "CONTAINS",
17
+ };
13
18
  const isEmptyExpression = key => {
14
19
  return `(
15
20
  doc["${key}"] === undefined ||
@@ -71,13 +76,13 @@ function parseFilterExpression(filters) {
71
76
  if (!first && filter.conjunction) {
72
77
  expression.push(TOKEN_MAP[filter.conjunction]);
73
78
  }
74
- if (filter.condition === "CONTAINS") {
79
+ if (filter.condition === CONDITIONS.CONTAINS) {
75
80
  expression.push(`doc["${filter.key}"].${TOKEN_MAP[filter.condition]}("${filter.value}")`);
76
81
  }
77
- else if (filter.condition === "EMPTY") {
82
+ else if (filter.condition === CONDITIONS.EMPTY) {
78
83
  expression.push(isEmptyExpression(filter.key));
79
84
  }
80
- else if (filter.condition === "NOT_EMPTY") {
85
+ else if (filter.condition === CONDITIONS.NOT_EMPTY) {
81
86
  expression.push(`!${isEmptyExpression(filter.key)}`);
82
87
  }
83
88
  else {
@@ -113,14 +118,23 @@ function viewTemplate({ field, tableId, groupBy, filters = [], calculation }) {
113
118
  if (filters && filters.length > 0 && filters[0].conjunction) {
114
119
  delete filters[0].conjunction;
115
120
  }
121
+ let schema = null, statFilter = null;
122
+ if (calculation) {
123
+ schema = Object.assign(Object.assign({}, (groupBy ? GROUP_PROPERTY : FIELD_PROPERTY)), SCHEMA_MAP[calculation]);
124
+ if (!filters.find(filter => filter.key === field && filter.condition === CONDITIONS.NOT_EMPTY)) {
125
+ statFilter = parseFilterExpression([
126
+ { key: field, condition: CONDITIONS.NOT_EMPTY },
127
+ ]);
128
+ }
129
+ }
116
130
  const parsedFilters = parseFilterExpression(filters);
117
131
  const filterExpression = parsedFilters ? `&& (${parsedFilters})` : "";
118
132
  const emitExpression = parseEmitExpression(field, groupBy);
133
+ const tableExpression = `doc.tableId === "${tableId}"`;
134
+ const coreExpression = statFilter
135
+ ? `(${tableExpression} && ${statFilter})`
136
+ : tableExpression;
119
137
  const reduction = field && calculation ? { reduce: `_${calculation}` } : {};
120
- let schema = null;
121
- if (calculation) {
122
- schema = Object.assign(Object.assign({}, (groupBy ? GROUP_PROPERTY : FIELD_PROPERTY)), SCHEMA_MAP[calculation]);
123
- }
124
138
  return Object.assign({ meta: {
125
139
  field,
126
140
  tableId,
@@ -129,7 +143,7 @@ function viewTemplate({ field, tableId, groupBy, filters = [], calculation }) {
129
143
  schema,
130
144
  calculation,
131
145
  }, map: `function (doc) {
132
- if (doc.tableId === "${tableId}" ${filterExpression}) {
146
+ if (${coreExpression} ${filterExpression}) {
133
147
  ${emitExpression}
134
148
  }
135
149
  }` }, reduction);
@@ -57,6 +57,7 @@ exports.definition = {
57
57
  limit: {
58
58
  type: "number",
59
59
  title: "Limit",
60
+ customType: "queryLimit",
60
61
  },
61
62
  },
62
63
  required: ["tableId"],