@budibase/server 1.0.167-alpha.8 → 1.0.169
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.074031c7.js → index.b0d22eeb.js} +160 -161
- package/builder/assets/{index.cdb3e448.css → index.bb5e3dfd.css} +2 -2
- package/builder/assets/{vendor.9d42becb.js → vendor.5240f480.js} +53 -53
- package/builder/index.html +3 -3
- package/coverage/clover.xml +53 -36
- package/coverage/coverage-final.json +5 -5
- 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 +15 -15
- 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 +9 -12
- package/coverage/lcov-report/api/controllers/user.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/exporters.js.html +3 -3
- package/coverage/lcov-report/api/controllers/view/index.html +4 -4
- package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
- 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 +2 -5
- 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 +27 -27
- 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 +32 -11
- 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 +29 -29
- 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 +73 -10
- package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
- package/coverage/lcov.info +92 -62
- package/dist/api/controllers/application.js +7 -0
- package/dist/api/controllers/public/users.js +3 -23
- package/dist/api/controllers/templates.js +1 -2
- package/dist/api/controllers/view/exporters.js +1 -1
- package/dist/automations/steps/queryRows.js +0 -1
- package/dist/environment.js +18 -10
- package/dist/package.json +5 -5
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/budibaseDir.js +6 -0
- package/dist/utilities/users.js +21 -0
- package/package.json +6 -6
- package/scripts/likeCypress.ts +1 -0
- package/scripts/load/users.js +97 -0
- package/src/api/controllers/application.ts +9 -0
- package/src/api/controllers/public/users.ts +3 -24
- package/src/api/controllers/templates.js +1 -2
- package/src/api/controllers/view/exporters.js +1 -1
- package/src/automations/steps/queryRows.js +0 -1
- package/src/environment.js +19 -10
- package/src/utilities/budibaseDir.js +7 -0
- package/src/utilities/users.js +21 -0
package/coverage/lcov.info
CHANGED
|
@@ -1372,36 +1372,36 @@ BRH:0
|
|
|
1372
1372
|
end_of_record
|
|
1373
1373
|
TN:
|
|
1374
1374
|
SF:src/api/controllers/templates.js
|
|
1375
|
-
FN:
|
|
1375
|
+
FN:8,(anonymous_0)
|
|
1376
1376
|
FNF:1
|
|
1377
1377
|
FNH:1
|
|
1378
1378
|
FNDA:1,(anonymous_0)
|
|
1379
1379
|
DA:1,24
|
|
1380
1380
|
DA:2,24
|
|
1381
|
-
DA:
|
|
1382
|
-
DA:
|
|
1383
|
-
DA:9,
|
|
1384
|
-
DA:
|
|
1381
|
+
DA:6,24
|
|
1382
|
+
DA:8,24
|
|
1383
|
+
DA:9,1
|
|
1384
|
+
DA:11,1
|
|
1385
1385
|
DA:12,1
|
|
1386
1386
|
DA:13,1
|
|
1387
1387
|
DA:14,1
|
|
1388
|
-
DA:15,
|
|
1389
|
-
DA:
|
|
1390
|
-
DA:
|
|
1388
|
+
DA:15,0
|
|
1389
|
+
DA:18,0
|
|
1390
|
+
DA:21,1
|
|
1391
1391
|
DA:22,1
|
|
1392
1392
|
DA:23,1
|
|
1393
|
-
DA:
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
BRDA:
|
|
1398
|
-
BRDA:
|
|
1399
|
-
BRDA:
|
|
1400
|
-
BRDA:
|
|
1401
|
-
BRDA:
|
|
1402
|
-
BRDA:
|
|
1403
|
-
BRF:
|
|
1404
|
-
BRH:
|
|
1393
|
+
DA:25,0
|
|
1394
|
+
LF:15
|
|
1395
|
+
LH:12
|
|
1396
|
+
BRDA:9,0,0,1
|
|
1397
|
+
BRDA:14,1,0,0
|
|
1398
|
+
BRDA:14,1,1,1
|
|
1399
|
+
BRDA:21,2,0,1
|
|
1400
|
+
BRDA:21,2,1,0
|
|
1401
|
+
BRDA:21,3,0,1
|
|
1402
|
+
BRDA:21,3,1,1
|
|
1403
|
+
BRF:7
|
|
1404
|
+
BRH:5
|
|
1405
1405
|
end_of_record
|
|
1406
1406
|
TN:
|
|
1407
1407
|
SF:src/api/controllers/user.js
|
|
@@ -3354,10 +3354,8 @@ LF:11
|
|
|
3354
3354
|
LH:11
|
|
3355
3355
|
BRDA:9,0,0,0
|
|
3356
3356
|
BRDA:9,0,1,2
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
BRF:4
|
|
3360
|
-
BRH:2
|
|
3357
|
+
BRF:2
|
|
3358
|
+
BRH:1
|
|
3361
3359
|
end_of_record
|
|
3362
3360
|
TN:
|
|
3363
3361
|
SF:src/api/controllers/view/index.js
|
|
@@ -4770,8 +4768,8 @@ BRH:12
|
|
|
4770
4768
|
end_of_record
|
|
4771
4769
|
TN:
|
|
4772
4770
|
SF:src/automations/steps/queryRows.js
|
|
4773
|
-
FN:
|
|
4774
|
-
FN:
|
|
4771
|
+
FN:74,getTable
|
|
4772
|
+
FN:84,(anonymous_1)
|
|
4775
4773
|
FNF:2
|
|
4776
4774
|
FNH:2
|
|
4777
4775
|
FNDA:1,getTable
|
|
@@ -4784,35 +4782,35 @@ DA:5,41
|
|
|
4784
4782
|
DA:7,41
|
|
4785
4783
|
DA:12,41
|
|
4786
4784
|
DA:17,41
|
|
4787
|
-
DA:
|
|
4785
|
+
DA:75,1
|
|
4786
|
+
DA:80,1
|
|
4788
4787
|
DA:81,1
|
|
4789
|
-
DA:
|
|
4790
|
-
DA:85,
|
|
4788
|
+
DA:84,41
|
|
4789
|
+
DA:85,1
|
|
4791
4790
|
DA:86,1
|
|
4792
4791
|
DA:87,1
|
|
4793
4792
|
DA:88,1
|
|
4794
4793
|
DA:89,1
|
|
4795
4794
|
DA:90,1
|
|
4796
|
-
DA:
|
|
4797
|
-
DA:
|
|
4795
|
+
DA:93,1
|
|
4796
|
+
DA:105,1
|
|
4798
4797
|
DA:106,1
|
|
4799
4798
|
DA:107,1
|
|
4800
|
-
DA:
|
|
4801
|
-
DA:113,0
|
|
4799
|
+
DA:112,0
|
|
4802
4800
|
LF:23
|
|
4803
4801
|
LH:22
|
|
4804
|
-
BRDA:
|
|
4805
|
-
BRDA:
|
|
4806
|
-
BRDA:
|
|
4807
|
-
BRDA:
|
|
4808
|
-
BRDA:
|
|
4809
|
-
BRDA:
|
|
4810
|
-
BRDA:
|
|
4811
|
-
BRDA:
|
|
4812
|
-
BRDA:
|
|
4813
|
-
BRDA:
|
|
4814
|
-
BRDA:
|
|
4815
|
-
BRDA:
|
|
4802
|
+
BRDA:88,0,0,1
|
|
4803
|
+
BRDA:88,0,1,0
|
|
4804
|
+
BRDA:88,1,0,1
|
|
4805
|
+
BRDA:88,1,1,1
|
|
4806
|
+
BRDA:88,1,2,1
|
|
4807
|
+
BRDA:88,1,3,1
|
|
4808
|
+
BRDA:91,2,0,0
|
|
4809
|
+
BRDA:91,2,1,1
|
|
4810
|
+
BRDA:101,3,0,1
|
|
4811
|
+
BRDA:101,3,1,0
|
|
4812
|
+
BRDA:108,4,0,1
|
|
4813
|
+
BRDA:108,4,1,0
|
|
4816
4814
|
BRF:12
|
|
4817
4815
|
BRH:8
|
|
4818
4816
|
end_of_record
|
|
@@ -7073,13 +7071,22 @@ BRH:0
|
|
|
7073
7071
|
end_of_record
|
|
7074
7072
|
TN:
|
|
7075
7073
|
SF:src/utilities/budibaseDir.js
|
|
7076
|
-
|
|
7074
|
+
FN:6,(anonymous_0)
|
|
7075
|
+
FNF:1
|
|
7077
7076
|
FNH:0
|
|
7077
|
+
FNDA:0,(anonymous_0)
|
|
7078
7078
|
DA:1,42
|
|
7079
|
+
DA:2,42
|
|
7079
7080
|
DA:3,42
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7081
|
+
DA:4,42
|
|
7082
|
+
DA:6,42
|
|
7083
|
+
DA:7,0
|
|
7084
|
+
DA:10,42
|
|
7085
|
+
LF:7
|
|
7086
|
+
LH:6
|
|
7087
|
+
BRDA:7,0,0,0
|
|
7088
|
+
BRDA:7,0,1,0
|
|
7089
|
+
BRF:2
|
|
7083
7090
|
BRH:0
|
|
7084
7091
|
end_of_record
|
|
7085
7092
|
TN:
|
|
@@ -7616,25 +7623,48 @@ BRH:0
|
|
|
7616
7623
|
end_of_record
|
|
7617
7624
|
TN:
|
|
7618
7625
|
SF:src/utilities/users.js
|
|
7619
|
-
FN:
|
|
7620
|
-
|
|
7621
|
-
|
|
7626
|
+
FN:6,(anonymous_0)
|
|
7627
|
+
FN:27,(anonymous_1)
|
|
7628
|
+
FNF:2
|
|
7629
|
+
FNH:2
|
|
7622
7630
|
FNDA:2,(anonymous_0)
|
|
7631
|
+
FNDA:2,(anonymous_1)
|
|
7623
7632
|
DA:1,41
|
|
7624
7633
|
DA:2,41
|
|
7625
7634
|
DA:3,41
|
|
7626
|
-
DA:
|
|
7627
|
-
DA:6,
|
|
7628
|
-
DA:
|
|
7629
|
-
DA:
|
|
7635
|
+
DA:4,41
|
|
7636
|
+
DA:6,41
|
|
7637
|
+
DA:7,2
|
|
7638
|
+
DA:9,2
|
|
7630
7639
|
DA:11,2
|
|
7631
|
-
DA:
|
|
7640
|
+
DA:12,2
|
|
7632
7641
|
DA:15,2
|
|
7633
|
-
DA:
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7642
|
+
DA:16,2
|
|
7643
|
+
DA:18,2
|
|
7644
|
+
DA:27,41
|
|
7645
|
+
DA:28,2
|
|
7646
|
+
DA:29,0
|
|
7647
|
+
DA:31,2
|
|
7648
|
+
DA:32,1
|
|
7649
|
+
DA:34,2
|
|
7650
|
+
DA:35,2
|
|
7651
|
+
DA:37,0
|
|
7652
|
+
DA:38,0
|
|
7653
|
+
DA:40,0
|
|
7654
|
+
DA:42,0
|
|
7655
|
+
DA:44,2
|
|
7656
|
+
LF:24
|
|
7657
|
+
LH:19
|
|
7658
|
+
BRDA:28,0,0,0
|
|
7659
|
+
BRDA:28,0,1,2
|
|
7660
|
+
BRDA:31,1,0,1
|
|
7661
|
+
BRDA:31,1,1,1
|
|
7662
|
+
BRDA:31,2,0,2
|
|
7663
|
+
BRDA:31,2,1,2
|
|
7664
|
+
BRDA:34,3,0,2
|
|
7665
|
+
BRDA:34,3,1,0
|
|
7666
|
+
BRF:8
|
|
7667
|
+
BRH:6
|
|
7638
7668
|
end_of_record
|
|
7639
7669
|
TN:
|
|
7640
7670
|
SF:src/utilities/workerRequests.js
|
|
@@ -385,6 +385,13 @@ const destroy = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
385
385
|
});
|
|
386
386
|
exports.destroy = destroy;
|
|
387
387
|
const sync = (ctx, next) => __awaiter(void 0, void 0, void 0, function* () {
|
|
388
|
+
if (environment_1.default.DISABLE_AUTO_PROD_APP_SYNC) {
|
|
389
|
+
ctx.status = 200;
|
|
390
|
+
ctx.body = {
|
|
391
|
+
message: "App sync disabled. You can reenable with the DISABLE_AUTO_PROD_APP_SYNC environment variable.",
|
|
392
|
+
};
|
|
393
|
+
return next();
|
|
394
|
+
}
|
|
388
395
|
const appId = ctx.params.appId;
|
|
389
396
|
if (!isDevAppID(appId)) {
|
|
390
397
|
ctx.throw(400, "This action cannot be performed for production apps");
|
|
@@ -11,28 +11,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.destroy = exports.update = exports.read = exports.create = exports.search = void 0;
|
|
13
13
|
const workerRequests_1 = require("../../../utilities/workerRequests");
|
|
14
|
+
const users_1 = require("../../../utilities/users");
|
|
14
15
|
const utils_1 = require("./utils");
|
|
15
|
-
const { getProdAppID } = require("@budibase/backend-core/db");
|
|
16
|
-
function fixUser(ctx) {
|
|
17
|
-
if (!ctx.request.body) {
|
|
18
|
-
return ctx;
|
|
19
|
-
}
|
|
20
|
-
if (!ctx.request.body._id && ctx.params.userId) {
|
|
21
|
-
ctx.request.body._id = ctx.params.userId;
|
|
22
|
-
}
|
|
23
|
-
if (!ctx.request.body.roles) {
|
|
24
|
-
ctx.request.body.roles = {};
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
const newRoles = {};
|
|
28
|
-
for (let [appId, role] of Object.entries(ctx.request.body.roles)) {
|
|
29
|
-
// @ts-ignore
|
|
30
|
-
newRoles[getProdAppID(appId)] = role;
|
|
31
|
-
}
|
|
32
|
-
ctx.request.body.roles = newRoles;
|
|
33
|
-
}
|
|
34
|
-
return ctx;
|
|
35
|
-
}
|
|
36
16
|
function getUser(ctx, userId) {
|
|
37
17
|
var _a;
|
|
38
18
|
if (userId) {
|
|
@@ -54,7 +34,7 @@ function search(ctx, next) {
|
|
|
54
34
|
exports.search = search;
|
|
55
35
|
function create(ctx, next) {
|
|
56
36
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
const response = yield (0, workerRequests_1.saveGlobalUser)(
|
|
37
|
+
const response = yield (0, workerRequests_1.saveGlobalUser)((0, users_1.publicApiUserFix)(ctx));
|
|
58
38
|
ctx.body = yield getUser(ctx, response._id);
|
|
59
39
|
yield next();
|
|
60
40
|
});
|
|
@@ -71,7 +51,7 @@ function update(ctx, next) {
|
|
|
71
51
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
52
|
const user = yield (0, workerRequests_1.readGlobalUser)(ctx);
|
|
73
53
|
ctx.request.body = Object.assign(Object.assign({}, ctx.request.body), { _rev: user._rev });
|
|
74
|
-
const response = yield (0, workerRequests_1.saveGlobalUser)(
|
|
54
|
+
const response = yield (0, workerRequests_1.saveGlobalUser)((0, users_1.publicApiUserFix)(ctx));
|
|
75
55
|
ctx.body = yield getUser(ctx, response._id);
|
|
76
56
|
yield next();
|
|
77
57
|
});
|
|
@@ -10,12 +10,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
const fetch = require("node-fetch");
|
|
12
12
|
const { downloadTemplate } = require("../../utilities/fileSystem");
|
|
13
|
-
const env = require("../../environment");
|
|
14
13
|
// development flag, can be used to test against templates exported locally
|
|
15
14
|
const DEFAULT_TEMPLATES_BUCKET = "prod-budi-templates.s3-eu-west-1.amazonaws.com";
|
|
16
15
|
exports.fetch = function (ctx) {
|
|
17
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
|
|
17
|
+
const { type = "app" } = ctx.query;
|
|
19
18
|
let response, error = false;
|
|
20
19
|
try {
|
|
21
20
|
response = yield fetch(`https://${DEFAULT_TEMPLATES_BUCKET}/manifest.json`);
|
package/dist/environment.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
const { join } = require("path");
|
|
2
3
|
function isTest() {
|
|
3
4
|
return (process.env.NODE_ENV === "jest" ||
|
|
4
5
|
process.env.NODE_ENV === "cypress" ||
|
|
@@ -14,7 +15,9 @@ function isCypress() {
|
|
|
14
15
|
}
|
|
15
16
|
let LOADED = false;
|
|
16
17
|
if (!LOADED && isDev() && !isTest()) {
|
|
17
|
-
require("dotenv").config(
|
|
18
|
+
require("dotenv").config({
|
|
19
|
+
path: join(__dirname, "..", ".env"),
|
|
20
|
+
});
|
|
18
21
|
LOADED = true;
|
|
19
22
|
}
|
|
20
23
|
function parseIntSafe(number) {
|
|
@@ -30,12 +33,15 @@ module.exports = {
|
|
|
30
33
|
COUCH_DB_URL: process.env.COUCH_DB_URL,
|
|
31
34
|
MINIO_URL: process.env.MINIO_URL,
|
|
32
35
|
WORKER_URL: process.env.WORKER_URL,
|
|
36
|
+
SELF_HOSTED: process.env.SELF_HOSTED,
|
|
33
37
|
AWS_REGION: process.env.AWS_REGION,
|
|
38
|
+
ENABLE_ANALYTICS: process.env.ENABLE_ANALYTICS,
|
|
34
39
|
MINIO_ACCESS_KEY: process.env.MINIO_ACCESS_KEY,
|
|
35
40
|
MINIO_SECRET_KEY: process.env.MINIO_SECRET_KEY,
|
|
36
41
|
REDIS_URL: process.env.REDIS_URL,
|
|
37
42
|
REDIS_PASSWORD: process.env.REDIS_PASSWORD,
|
|
38
43
|
INTERNAL_API_KEY: process.env.INTERNAL_API_KEY,
|
|
44
|
+
MULTI_TENANCY: process.env.MULTI_TENANCY,
|
|
39
45
|
HTTP_MIGRATIONS: process.env.HTTP_MIGRATIONS,
|
|
40
46
|
API_REQ_LIMIT_PER_SEC: process.env.API_REQ_LIMIT_PER_SEC,
|
|
41
47
|
GOOGLE_CLIENT_ID: process.env.GOOGLE_CLIENT_ID,
|
|
@@ -45,26 +51,28 @@ module.exports = {
|
|
|
45
51
|
JEST_WORKER_ID: process.env.JEST_WORKER_ID,
|
|
46
52
|
BUDIBASE_ENVIRONMENT: process.env.BUDIBASE_ENVIRONMENT,
|
|
47
53
|
DISABLE_ACCOUNT_PORTAL: process.env.DISABLE_ACCOUNT_PORTAL,
|
|
48
|
-
|
|
54
|
+
DISABLE_AUTO_PROD_APP_SYNC: process.env.DISABLE_AUTO_PROD_APP_SYNC,
|
|
49
55
|
// minor
|
|
50
56
|
SALT_ROUNDS: process.env.SALT_ROUNDS,
|
|
51
57
|
LOGGER: process.env.LOGGER,
|
|
52
58
|
LOG_LEVEL: process.env.LOG_LEVEL,
|
|
59
|
+
AUTOMATION_DIRECTORY: process.env.AUTOMATION_DIRECTORY,
|
|
60
|
+
AUTOMATION_BUCKET: process.env.AUTOMATION_BUCKET,
|
|
53
61
|
AUTOMATION_MAX_ITERATIONS: process.env.AUTOMATION_MAX_ITERATIONS,
|
|
54
62
|
SENDGRID_API_KEY: process.env.SENDGRID_API_KEY,
|
|
55
63
|
DYNAMO_ENDPOINT: process.env.DYNAMO_ENDPOINT,
|
|
56
64
|
POSTHOG_TOKEN: process.env.POSTHOG_TOKEN,
|
|
57
65
|
QUERY_THREAD_TIMEOUT: parseIntSafe(process.env.QUERY_THREAD_TIMEOUT),
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
// old - to remove
|
|
67
|
+
CLIENT_ID: process.env.CLIENT_ID,
|
|
68
|
+
BUDIBASE_DIR: process.env.BUDIBASE_DIR,
|
|
69
|
+
DEPLOYMENT_DB_URL: process.env.DEPLOYMENT_DB_URL,
|
|
70
|
+
BUDIBASE_API_KEY: process.env.BUDIBASE_API_KEY,
|
|
71
|
+
USERID_API_KEY: process.env.USERID_API_KEY,
|
|
72
|
+
DEPLOYMENT_CREDENTIALS_URL: process.env.DEPLOYMENT_CREDENTIALS_URL,
|
|
60
73
|
ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS,
|
|
61
74
|
DISABLE_THREADING: process.env.DISABLE_THREADING,
|
|
62
|
-
|
|
63
|
-
MULTI_TENANCY: process.env.MULTI_TENANCY,
|
|
64
|
-
ENABLE_ANALYTICS: process.env.ENABLE_ANALYTICS,
|
|
65
|
-
SELF_HOSTED: process.env.SELF_HOSTED,
|
|
66
|
-
// old
|
|
67
|
-
CLIENT_ID: process.env.CLIENT_ID,
|
|
75
|
+
SQL_MAX_ROWS: process.env.SQL_MAX_ROWS,
|
|
68
76
|
_set(key, value) {
|
|
69
77
|
process.env[key] = value;
|
|
70
78
|
module.exports[key] = value;
|
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.168",
|
|
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.168",
|
|
73
|
+
"@budibase/client": "^1.0.168",
|
|
74
|
+
"@budibase/pro": "1.0.168",
|
|
75
|
+
"@budibase/string-templates": "^1.0.168",
|
|
76
76
|
"@bull-board/api": "^3.7.0",
|
|
77
77
|
"@bull-board/koa": "^3.7.0",
|
|
78
78
|
"@elastic/elasticsearch": "7.10.0",
|