@budibase/server 1.0.161 → 1.0.162
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.
- package/builder/assets/{index.29f75f3c.js → index.54fa98bf.js} +1 -1
- package/builder/index.html +1 -1
- package/coverage/clover.xml +96 -88
- package/coverage/coverage-final.json +2 -2
- package/coverage/lcov-report/api/controllers/analytics.js.html +1 -1
- package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
- package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
- package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
- package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
- package/coverage/lcov-report/api/controllers/component.js.html +1 -1
- package/coverage/lcov-report/api/controllers/datasource.js.html +1 -1
- package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
- package/coverage/lcov-report/api/controllers/index.html +1 -1
- package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
- package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
- package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
- package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
- package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
- package/coverage/lcov-report/api/controllers/query/index.html +1 -1
- package/coverage/lcov-report/api/controllers/query/validation.js.html +1 -1
- package/coverage/lcov-report/api/controllers/role.js.html +1 -1
- package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/external.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/index.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/screen.js.html +1 -1
- package/coverage/lcov-report/api/controllers/script.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
- package/coverage/lcov-report/api/controllers/user.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.html +24 -24
- package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/utils.js.html +14 -8
- package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +111 -48
- package/coverage/lcov-report/api/controllers/webhook.js.html +1 -1
- package/coverage/lcov-report/api/index.html +1 -1
- package/coverage/lcov-report/api/index.js.html +1 -1
- package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
- package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/routes/auth.js.html +1 -1
- package/coverage/lcov-report/api/routes/automation.js.html +1 -1
- package/coverage/lcov-report/api/routes/backup.js.html +1 -1
- package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
- package/coverage/lcov-report/api/routes/component.js.html +1 -1
- package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
- package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
- package/coverage/lcov-report/api/routes/dev.js.html +1 -1
- package/coverage/lcov-report/api/routes/index.html +1 -1
- package/coverage/lcov-report/api/routes/integration.js.html +1 -1
- package/coverage/lcov-report/api/routes/layout.js.html +1 -1
- package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
- package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
- package/coverage/lcov-report/api/routes/permission.js.html +1 -1
- package/coverage/lcov-report/api/routes/query.js.html +1 -1
- package/coverage/lcov-report/api/routes/role.js.html +1 -1
- package/coverage/lcov-report/api/routes/routing.js.html +1 -1
- package/coverage/lcov-report/api/routes/screen.js.html +1 -1
- package/coverage/lcov-report/api/routes/script.js.html +1 -1
- package/coverage/lcov-report/api/routes/table.js.html +1 -1
- package/coverage/lcov-report/api/routes/templates.js.html +1 -1
- package/coverage/lcov-report/api/routes/user.js.html +1 -1
- package/coverage/lcov-report/api/routes/utils/index.html +1 -1
- package/coverage/lcov-report/api/routes/utils/validators.js.html +1 -1
- package/coverage/lcov-report/api/routes/view.js.html +1 -1
- package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
- package/coverage/lcov-report/automations/actions.js.html +1 -1
- package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
- package/coverage/lcov-report/automations/bullboard.js.html +1 -1
- package/coverage/lcov-report/automations/index.html +1 -1
- package/coverage/lcov-report/automations/index.js.html +1 -1
- package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
- package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
- package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
- package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
- package/coverage/lcov-report/automations/steps/index.html +1 -1
- package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
- package/coverage/lcov-report/automations/steps/loop.js.html +1 -1
- package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
- package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
- package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
- package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
- package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
- package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
- package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
- package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
- package/coverage/lcov-report/automations/triggers.js.html +1 -1
- package/coverage/lcov-report/constants/index.html +1 -1
- package/coverage/lcov-report/constants/index.js.html +1 -1
- package/coverage/lcov-report/constants/layouts.js.html +1 -1
- package/coverage/lcov-report/constants/screens.js.html +1 -1
- package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
- package/coverage/lcov-report/db/index.html +1 -1
- package/coverage/lcov-report/db/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +1 -1
- package/coverage/lcov-report/db/newid.js.html +1 -1
- package/coverage/lcov-report/db/utils.js.html +1 -1
- package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
- package/coverage/lcov-report/events/index.html +1 -1
- package/coverage/lcov-report/events/index.js.html +1 -1
- package/coverage/lcov-report/events/utils.js.html +1 -1
- package/coverage/lcov-report/index.html +19 -19
- package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
- package/coverage/lcov-report/integrations/tests/index.html +1 -1
- package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
- package/coverage/lcov-report/middleware/builder.js.html +1 -1
- package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
- package/coverage/lcov-report/middleware/index.html +1 -1
- package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
- package/coverage/lcov-report/middleware/publicApi.js.html +1 -1
- package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
- package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
- package/coverage/lcov-report/middleware/utils.js.html +1 -1
- package/coverage/lcov-report/threads/automation.js.html +1 -1
- package/coverage/lcov-report/threads/index.html +1 -1
- package/coverage/lcov-report/threads/query.js.html +1 -1
- package/coverage/lcov-report/threads/utils.js.html +1 -1
- package/coverage/lcov-report/utilities/bcrypt.js.html +1 -1
- package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
- package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
- package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
- package/coverage/lcov-report/utilities/global.js.html +1 -1
- package/coverage/lcov-report/utilities/index.html +1 -1
- package/coverage/lcov-report/utilities/index.js.html +1 -1
- package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
- package/coverage/lcov-report/utilities/queue/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
- package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
- package/coverage/lcov-report/utilities/security.js.html +1 -1
- package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
- package/coverage/lcov-report/utilities/users.js.html +1 -1
- package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
- package/coverage/lcov.info +164 -148
- package/dist/api/controllers/view/utils.js +4 -2
- package/dist/api/controllers/view/viewBuilder.js +22 -8
- package/dist/package.json +5 -5
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/src/api/controllers/view/tests/__snapshots__/viewBuilder.spec.js.snap +58 -1
- package/src/api/controllers/view/tests/viewBuilder.spec.js +18 -0
- package/src/api/controllers/view/utils.js +4 -2
- package/src/api/controllers/view/viewBuilder.js +32 -11
|
@@ -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
|
|
94
|
+
at Mon May 16 2022 16:48:23 GMT+0000 (Coordinated Universal Time)
|
|
95
95
|
</div>
|
|
96
96
|
<script src="../prettify.js"></script>
|
|
97
97
|
<script>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
117
117
|
Code coverage generated by
|
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
119
|
-
at
|
|
119
|
+
at Mon May 16 2022 16:48:23 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 => {
|
|
|
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
|
|
310
|
+
at Mon May 16 2022 16:48:23 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
|
|
127
|
+
at Mon May 16 2022 16:48:23 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) => {
|
|
|
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
|
|
145
|
+
at Mon May 16 2022 16:48:23 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
|
|
490
|
+
at Mon May 16 2022 16:48:23 GMT+0000 (Coordinated Universal Time)
|
|
491
491
|
</div>
|
|
492
492
|
<script src="../prettify.js"></script>
|
|
493
493
|
<script>
|
package/coverage/lcov.info
CHANGED
|
@@ -3477,15 +3477,15 @@ BRH:18
|
|
|
3477
3477
|
end_of_record
|
|
3478
3478
|
TN:
|
|
3479
3479
|
SF:src/api/controllers/view/utils.js
|
|
3480
|
-
FN:
|
|
3481
|
-
FN:
|
|
3482
|
-
FN:
|
|
3483
|
-
FN:
|
|
3484
|
-
FN:
|
|
3485
|
-
FN:
|
|
3486
|
-
FN:
|
|
3487
|
-
FN:
|
|
3488
|
-
FN:
|
|
3480
|
+
FN:12,(anonymous_0)
|
|
3481
|
+
FN:28,(anonymous_1)
|
|
3482
|
+
FN:50,(anonymous_2)
|
|
3483
|
+
FN:61,(anonymous_3)
|
|
3484
|
+
FN:99,(anonymous_4)
|
|
3485
|
+
FN:115,(anonymous_5)
|
|
3486
|
+
FN:125,(anonymous_6)
|
|
3487
|
+
FN:133,(anonymous_7)
|
|
3488
|
+
FN:142,(anonymous_8)
|
|
3489
3489
|
FNF:9
|
|
3490
3490
|
FNH:6
|
|
3491
3491
|
FNDA:2,(anonymous_0)
|
|
@@ -3500,194 +3500,210 @@ FNDA:1,(anonymous_8)
|
|
|
3500
3500
|
DA:7,41
|
|
3501
3501
|
DA:8,41
|
|
3502
3502
|
DA:9,41
|
|
3503
|
-
DA:
|
|
3504
|
-
DA:12,
|
|
3503
|
+
DA:10,41
|
|
3504
|
+
DA:12,41
|
|
3505
3505
|
DA:13,2
|
|
3506
3506
|
DA:14,2
|
|
3507
3507
|
DA:15,2
|
|
3508
|
-
DA:
|
|
3508
|
+
DA:16,2
|
|
3509
3509
|
DA:19,0
|
|
3510
|
-
DA:
|
|
3510
|
+
DA:20,0
|
|
3511
3511
|
DA:23,0
|
|
3512
|
-
DA:
|
|
3513
|
-
DA:28,
|
|
3512
|
+
DA:24,0
|
|
3513
|
+
DA:28,41
|
|
3514
3514
|
DA:29,2
|
|
3515
3515
|
DA:30,2
|
|
3516
3516
|
DA:31,2
|
|
3517
3517
|
DA:32,2
|
|
3518
|
-
DA:
|
|
3519
|
-
DA:35,
|
|
3520
|
-
DA:
|
|
3521
|
-
DA:
|
|
3522
|
-
DA:
|
|
3518
|
+
DA:33,2
|
|
3519
|
+
DA:35,5
|
|
3520
|
+
DA:36,4
|
|
3521
|
+
DA:38,1
|
|
3522
|
+
DA:44,0
|
|
3523
3523
|
DA:50,0
|
|
3524
3524
|
DA:51,0
|
|
3525
|
-
DA:
|
|
3526
|
-
DA:
|
|
3527
|
-
DA:61,
|
|
3525
|
+
DA:52,0
|
|
3526
|
+
DA:58,2
|
|
3527
|
+
DA:61,41
|
|
3528
3528
|
DA:62,8
|
|
3529
3529
|
DA:63,8
|
|
3530
3530
|
DA:64,8
|
|
3531
|
-
DA:
|
|
3532
|
-
DA:70,
|
|
3533
|
-
DA:
|
|
3534
|
-
DA:
|
|
3531
|
+
DA:65,8
|
|
3532
|
+
DA:70,8
|
|
3533
|
+
DA:71,0
|
|
3534
|
+
DA:73,8
|
|
3535
3535
|
DA:75,0
|
|
3536
3536
|
DA:76,0
|
|
3537
|
-
DA:
|
|
3537
|
+
DA:77,0
|
|
3538
3538
|
DA:83,0
|
|
3539
3539
|
DA:84,0
|
|
3540
3540
|
DA:85,0
|
|
3541
3541
|
DA:86,0
|
|
3542
|
-
DA:
|
|
3542
|
+
DA:87,0
|
|
3543
3543
|
DA:89,0
|
|
3544
|
-
DA:
|
|
3545
|
-
DA:
|
|
3546
|
-
DA:99,
|
|
3544
|
+
DA:90,0
|
|
3545
|
+
DA:95,0
|
|
3546
|
+
DA:99,41
|
|
3547
3547
|
DA:100,1
|
|
3548
3548
|
DA:101,1
|
|
3549
3549
|
DA:102,1
|
|
3550
3550
|
DA:103,1
|
|
3551
3551
|
DA:104,1
|
|
3552
3552
|
DA:105,1
|
|
3553
|
-
DA:
|
|
3553
|
+
DA:106,1
|
|
3554
3554
|
DA:108,0
|
|
3555
3555
|
DA:109,0
|
|
3556
3556
|
DA:110,0
|
|
3557
|
-
DA:
|
|
3558
|
-
DA:
|
|
3557
|
+
DA:111,0
|
|
3558
|
+
DA:115,41
|
|
3559
3559
|
DA:117,0
|
|
3560
|
-
DA:118,0
|
|
3561
3560
|
DA:119,0
|
|
3562
3561
|
DA:120,0
|
|
3563
|
-
DA:
|
|
3564
|
-
DA:
|
|
3565
|
-
DA:125,
|
|
3562
|
+
DA:121,0
|
|
3563
|
+
DA:122,0
|
|
3564
|
+
DA:125,41
|
|
3566
3565
|
DA:126,0
|
|
3567
3566
|
DA:127,0
|
|
3568
3567
|
DA:128,0
|
|
3569
|
-
DA:
|
|
3570
|
-
DA:
|
|
3571
|
-
DA:133,
|
|
3568
|
+
DA:129,0
|
|
3569
|
+
DA:130,0
|
|
3570
|
+
DA:133,41
|
|
3572
3571
|
DA:134,6
|
|
3573
|
-
DA:135,
|
|
3574
|
-
DA:
|
|
3575
|
-
DA:
|
|
3576
|
-
DA:
|
|
3577
|
-
DA:142,
|
|
3578
|
-
DA:143,
|
|
3572
|
+
DA:135,6
|
|
3573
|
+
DA:136,6
|
|
3574
|
+
DA:137,1
|
|
3575
|
+
DA:139,5
|
|
3576
|
+
DA:142,41
|
|
3577
|
+
DA:143,1
|
|
3578
|
+
DA:144,0
|
|
3579
3579
|
DA:145,0
|
|
3580
3580
|
DA:147,0
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
BRDA:
|
|
3585
|
-
BRDA:
|
|
3586
|
-
BRDA:
|
|
3587
|
-
BRDA:
|
|
3588
|
-
BRDA:
|
|
3589
|
-
BRDA:
|
|
3590
|
-
BRDA:
|
|
3591
|
-
BRDA:
|
|
3592
|
-
BRDA:
|
|
3593
|
-
BRDA:
|
|
3594
|
-
BRDA:
|
|
3595
|
-
BRDA:
|
|
3596
|
-
BRDA:
|
|
3597
|
-
BRDA:
|
|
3598
|
-
BRDA:
|
|
3599
|
-
BRDA:
|
|
3600
|
-
BRDA:
|
|
3601
|
-
BRDA:
|
|
3602
|
-
BRDA:
|
|
3603
|
-
BRDA:
|
|
3604
|
-
BRDA:
|
|
3605
|
-
BRDA:
|
|
3606
|
-
BRDA:
|
|
3607
|
-
BRDA:
|
|
3608
|
-
BRDA:
|
|
3581
|
+
DA:149,0
|
|
3582
|
+
LF:82
|
|
3583
|
+
LH:44
|
|
3584
|
+
BRDA:14,0,0,2
|
|
3585
|
+
BRDA:14,0,1,0
|
|
3586
|
+
BRDA:19,1,0,0
|
|
3587
|
+
BRDA:19,1,1,0
|
|
3588
|
+
BRDA:31,2,0,2
|
|
3589
|
+
BRDA:31,2,1,0
|
|
3590
|
+
BRDA:35,3,0,4
|
|
3591
|
+
BRDA:35,3,1,1
|
|
3592
|
+
BRDA:63,4,0,8
|
|
3593
|
+
BRDA:63,4,1,0
|
|
3594
|
+
BRDA:70,5,0,0
|
|
3595
|
+
BRDA:70,5,1,8
|
|
3596
|
+
BRDA:76,6,0,0
|
|
3597
|
+
BRDA:76,6,1,0
|
|
3598
|
+
BRDA:85,7,0,0
|
|
3599
|
+
BRDA:85,7,1,0
|
|
3600
|
+
BRDA:89,8,0,0
|
|
3601
|
+
BRDA:89,8,1,0
|
|
3602
|
+
BRDA:89,9,0,0
|
|
3603
|
+
BRDA:89,9,1,0
|
|
3604
|
+
BRDA:101,10,0,1
|
|
3605
|
+
BRDA:101,10,1,0
|
|
3606
|
+
BRDA:136,11,0,1
|
|
3607
|
+
BRDA:136,11,1,5
|
|
3608
|
+
BRDA:144,12,0,0
|
|
3609
|
+
BRDA:144,12,1,0
|
|
3609
3610
|
BRF:26
|
|
3610
3611
|
BRH:9
|
|
3611
3612
|
end_of_record
|
|
3612
3613
|
TN:
|
|
3613
3614
|
SF:src/api/controllers/view/viewBuilder.js
|
|
3614
|
-
FN:
|
|
3615
|
-
FN:
|
|
3616
|
-
FN:
|
|
3617
|
-
FN:
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
FNDA:
|
|
3622
|
-
FNDA:
|
|
3623
|
-
FNDA:
|
|
3615
|
+
FN:19,(anonymous_0)
|
|
3616
|
+
FN:77,parseFilterExpression
|
|
3617
|
+
FN:114,parseEmitExpression
|
|
3618
|
+
FN:129,viewTemplate
|
|
3619
|
+
FN:145,(anonymous_4)
|
|
3620
|
+
FNF:5
|
|
3621
|
+
FNH:5
|
|
3622
|
+
FNDA:7,(anonymous_0)
|
|
3623
|
+
FNDA:19,parseFilterExpression
|
|
3624
|
+
FNDA:12,parseEmitExpression
|
|
3625
|
+
FNDA:12,viewTemplate
|
|
3626
|
+
FNDA:1,(anonymous_4)
|
|
3624
3627
|
DA:1,42
|
|
3625
3628
|
DA:13,42
|
|
3626
|
-
DA:
|
|
3627
|
-
DA:
|
|
3629
|
+
DA:19,42
|
|
3630
|
+
DA:20,7
|
|
3628
3631
|
DA:28,42
|
|
3629
3632
|
DA:34,42
|
|
3630
|
-
DA:
|
|
3631
|
-
DA:
|
|
3632
|
-
DA:
|
|
3633
|
-
DA:
|
|
3634
|
-
DA:
|
|
3635
|
-
DA:
|
|
3636
|
-
DA:
|
|
3637
|
-
DA:84,2
|
|
3638
|
-
DA:85,0
|
|
3639
|
-
DA:86,2
|
|
3633
|
+
DA:40,42
|
|
3634
|
+
DA:78,19
|
|
3635
|
+
DA:80,19
|
|
3636
|
+
DA:81,19
|
|
3637
|
+
DA:82,10
|
|
3638
|
+
DA:83,1
|
|
3639
|
+
DA:86,10
|
|
3640
3640
|
DA:87,0
|
|
3641
|
-
DA:90,
|
|
3642
|
-
DA:
|
|
3643
|
-
DA:
|
|
3644
|
-
DA:
|
|
3645
|
-
DA:
|
|
3646
|
-
DA:
|
|
3647
|
-
DA:
|
|
3648
|
-
DA:
|
|
3649
|
-
DA:
|
|
3650
|
-
DA:131,
|
|
3651
|
-
DA:
|
|
3652
|
-
DA:135,
|
|
3653
|
-
DA:
|
|
3654
|
-
DA:138,
|
|
3655
|
-
DA:
|
|
3656
|
-
DA:
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
BRDA:
|
|
3670
|
-
BRDA:
|
|
3671
|
-
BRDA:
|
|
3672
|
-
BRDA:
|
|
3673
|
-
BRDA:
|
|
3674
|
-
BRDA:
|
|
3675
|
-
BRDA:
|
|
3676
|
-
BRDA:
|
|
3677
|
-
BRDA:
|
|
3678
|
-
BRDA:
|
|
3679
|
-
BRDA:
|
|
3680
|
-
BRDA:
|
|
3681
|
-
BRDA:
|
|
3682
|
-
BRDA:
|
|
3683
|
-
BRDA:
|
|
3684
|
-
BRDA:
|
|
3685
|
-
BRDA:
|
|
3686
|
-
BRDA:
|
|
3687
|
-
BRDA:
|
|
3688
|
-
BRDA:
|
|
3689
|
-
|
|
3690
|
-
|
|
3641
|
+
DA:90,10
|
|
3642
|
+
DA:91,0
|
|
3643
|
+
DA:92,10
|
|
3644
|
+
DA:93,7
|
|
3645
|
+
DA:96,3
|
|
3646
|
+
DA:98,3
|
|
3647
|
+
DA:102,10
|
|
3648
|
+
DA:105,19
|
|
3649
|
+
DA:115,12
|
|
3650
|
+
DA:131,12
|
|
3651
|
+
DA:132,0
|
|
3652
|
+
DA:135,12
|
|
3653
|
+
DA:136,12
|
|
3654
|
+
DA:138,12
|
|
3655
|
+
DA:139,7
|
|
3656
|
+
DA:143,7
|
|
3657
|
+
DA:146,1
|
|
3658
|
+
DA:149,7
|
|
3659
|
+
DA:155,12
|
|
3660
|
+
DA:156,12
|
|
3661
|
+
DA:158,12
|
|
3662
|
+
DA:159,12
|
|
3663
|
+
DA:160,12
|
|
3664
|
+
DA:163,12
|
|
3665
|
+
DA:165,12
|
|
3666
|
+
DA:183,42
|
|
3667
|
+
LF:40
|
|
3668
|
+
LH:37
|
|
3669
|
+
BRDA:82,0,0,1
|
|
3670
|
+
BRDA:82,0,1,9
|
|
3671
|
+
BRDA:82,1,0,10
|
|
3672
|
+
BRDA:82,1,1,1
|
|
3673
|
+
BRDA:86,2,0,0
|
|
3674
|
+
BRDA:86,2,1,10
|
|
3675
|
+
BRDA:90,3,0,0
|
|
3676
|
+
BRDA:90,3,1,10
|
|
3677
|
+
BRDA:92,4,0,7
|
|
3678
|
+
BRDA:92,4,1,3
|
|
3679
|
+
BRDA:96,5,0,2
|
|
3680
|
+
BRDA:96,5,1,1
|
|
3681
|
+
BRDA:115,6,0,12
|
|
3682
|
+
BRDA:115,6,1,10
|
|
3683
|
+
BRDA:129,7,0,8
|
|
3684
|
+
BRDA:131,8,0,0
|
|
3685
|
+
BRDA:131,8,1,12
|
|
3686
|
+
BRDA:131,9,0,12
|
|
3687
|
+
BRDA:131,9,1,12
|
|
3688
|
+
BRDA:131,9,2,2
|
|
3689
|
+
BRDA:138,10,0,7
|
|
3690
|
+
BRDA:138,10,1,5
|
|
3691
|
+
BRDA:140,11,0,1
|
|
3692
|
+
BRDA:140,11,1,6
|
|
3693
|
+
BRDA:143,12,0,7
|
|
3694
|
+
BRDA:143,12,1,0
|
|
3695
|
+
BRDA:146,13,0,1
|
|
3696
|
+
BRDA:146,13,1,0
|
|
3697
|
+
BRDA:156,14,0,2
|
|
3698
|
+
BRDA:156,14,1,10
|
|
3699
|
+
BRDA:160,15,0,7
|
|
3700
|
+
BRDA:160,15,1,5
|
|
3701
|
+
BRDA:163,16,0,7
|
|
3702
|
+
BRDA:163,16,1,5
|
|
3703
|
+
BRDA:163,17,0,12
|
|
3704
|
+
BRDA:163,17,1,8
|
|
3705
|
+
BRF:36
|
|
3706
|
+
BRH:31
|
|
3691
3707
|
end_of_record
|
|
3692
3708
|
TN:
|
|
3693
3709
|
SF:src/api/routes/analytics.js
|
|
@@ -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
|
-
|
|
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 ===
|
|
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 ===
|
|
82
|
+
else if (filter.condition === CONDITIONS.EMPTY) {
|
|
78
83
|
expression.push(isEmptyExpression(filter.key));
|
|
79
84
|
}
|
|
80
|
-
else if (filter.condition ===
|
|
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 (
|
|
146
|
+
if (${coreExpression} ${filterExpression}) {
|
|
133
147
|
${emitExpression}
|
|
134
148
|
}
|
|
135
149
|
}` }, reduction);
|
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.
|
|
4
|
+
"version": "1.0.161",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -69,10 +69,10 @@
|
|
|
69
69
|
"license": "GPL-3.0",
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"@apidevtools/swagger-parser": "^10.0.3",
|
|
72
|
-
"@budibase/backend-core": "^1.0.
|
|
73
|
-
"@budibase/client": "^1.0.
|
|
74
|
-
"@budibase/pro": "1.0.
|
|
75
|
-
"@budibase/string-templates": "^1.0.
|
|
72
|
+
"@budibase/backend-core": "^1.0.161",
|
|
73
|
+
"@budibase/client": "^1.0.161",
|
|
74
|
+
"@budibase/pro": "1.0.161",
|
|
75
|
+
"@budibase/string-templates": "^1.0.161",
|
|
76
76
|
"@bull-board/api": "^3.7.0",
|
|
77
77
|
"@bull-board/koa": "^3.7.0",
|
|
78
78
|
"@elastic/elasticsearch": "7.10.0",
|