@budibase/server 1.0.94 → 1.0.97
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.305b7738.js → index.3c2af30f.js} +1 -1
- package/builder/index.html +1 -1
- package/coverage/clover.xml +107 -107
- package/coverage/coverage-final.json +12 -12
- 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/application.js.html +1 -1
- package/coverage/lcov-report/api/controllers/auth.js.html +2 -2
- 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/index.js.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/index.js.html +20 -20
- package/coverage/lcov-report/api/controllers/row/internal.js.html +29 -29
- 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 +4 -4
- 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/table/internal.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/utils.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 +1 -1
- 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 +15 -15
- package/coverage/lcov-report/api/index.js.html +15 -27
- 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/application.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/index.js.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/row.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/static.js.html +3 -6
- 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/createRow.js.html +1 -1
- package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
- package/coverage/lcov-report/automations/steps/deleteRow.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 +5 -5
- package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
- package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
- package/coverage/lcov-report/automations/steps/queryRows.js.html +4 -4
- 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 +3 -3
- package/coverage/lcov-report/automations/utils.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/client.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 +2 -2
- package/coverage/lcov-report/db/utils.js.html +3 -3
- 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 +23 -23
- 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/authorized.js.html +1 -1
- package/coverage/lcov-report/middleware/builder.js.html +1 -1
- package/coverage/lcov-report/middleware/currentapp.js.html +15 -12
- package/coverage/lcov-report/middleware/index.html +11 -11
- package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
- package/coverage/lcov-report/middleware/publicApi.js.html +3 -3
- 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/usageQuota.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/index.js.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 +13 -13
- 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/index.js.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 +163 -164
- package/dist/api/controllers/auth.js +1 -1
- package/dist/api/controllers/public/rows.js +2 -2
- package/dist/api/controllers/static/index.js +2 -15
- package/dist/api/controllers/table/external.js +3 -3
- package/dist/api/index.js +3 -6
- package/dist/api/routes/static.js +1 -2
- package/dist/automations/steps/queryRows.js +1 -1
- package/dist/db/views/staticViews.js +2 -0
- package/dist/middleware/currentapp.js +7 -6
- package/dist/middleware/publicApi.js +2 -2
- package/dist/package.json +4 -8
- package/dist/tests/utilities/TestConfiguration.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -9
- package/scripts/integrations/customer-categories/docker-compose.yml +2 -2
- package/scripts/integrations/oracle/docker-compose.yml +1 -1
- package/scripts/integrations/postgres/docker-compose.yml +2 -2
- package/scripts/integrations/service-vehicles/docker-compose.yml +2 -2
- package/src/api/controllers/auth.js +1 -1
- package/src/api/controllers/public/rows.ts +2 -4
- package/src/api/controllers/static/index.js +2 -18
- package/src/api/controllers/table/external.js +3 -3
- package/src/api/index.js +3 -7
- package/src/api/routes/static.js +1 -2
- package/src/automations/steps/queryRows.js +1 -1
- package/src/db/views/staticViews.js +2 -0
- package/src/middleware/currentapp.js +7 -6
- package/src/middleware/publicApi.js +2 -2
- package/src/middleware/tests/authorized.spec.js +1 -3
- package/src/middleware/tests/currentapp.spec.js +4 -4
- package/src/tests/utilities/TestConfiguration.js +1 -1
- package/.eslintrc +0 -13
package/coverage/lcov.info
CHANGED
|
@@ -1,55 +1,52 @@
|
|
|
1
1
|
TN:
|
|
2
2
|
SF:src/api/index.js
|
|
3
|
-
FN:
|
|
4
|
-
FN:
|
|
5
|
-
FN:
|
|
6
|
-
FN:
|
|
7
|
-
|
|
8
|
-
FNF:5
|
|
3
|
+
FN:16,(anonymous_0)
|
|
4
|
+
FN:17,(anonymous_1)
|
|
5
|
+
FN:32,(anonymous_2)
|
|
6
|
+
FN:58,(anonymous_3)
|
|
7
|
+
FNF:4
|
|
9
8
|
FNH:4
|
|
10
|
-
FNDA:
|
|
9
|
+
FNDA:1,(anonymous_0)
|
|
11
10
|
FNDA:1,(anonymous_1)
|
|
12
|
-
FNDA:
|
|
11
|
+
FNDA:188,(anonymous_2)
|
|
13
12
|
FNDA:186,(anonymous_3)
|
|
14
|
-
FNDA:0,(anonymous_4)
|
|
15
13
|
DA:1,24
|
|
14
|
+
DA:6,24
|
|
16
15
|
DA:7,24
|
|
17
16
|
DA:8,24
|
|
18
17
|
DA:9,24
|
|
19
18
|
DA:10,24
|
|
20
19
|
DA:11,24
|
|
21
20
|
DA:12,24
|
|
22
|
-
DA:
|
|
23
|
-
DA:
|
|
21
|
+
DA:14,24
|
|
22
|
+
DA:16,24
|
|
24
23
|
DA:17,24
|
|
25
|
-
DA:
|
|
26
|
-
DA:
|
|
27
|
-
DA:37,
|
|
28
|
-
DA:
|
|
29
|
-
DA:
|
|
30
|
-
DA:
|
|
31
|
-
DA:62,
|
|
32
|
-
DA:
|
|
33
|
-
DA:
|
|
34
|
-
DA:
|
|
35
|
-
DA:
|
|
36
|
-
DA:
|
|
37
|
-
DA:77,
|
|
38
|
-
DA:
|
|
39
|
-
DA:81,
|
|
40
|
-
DA:82,
|
|
24
|
+
DA:19,24
|
|
25
|
+
DA:33,188
|
|
26
|
+
DA:37,188
|
|
27
|
+
DA:58,24
|
|
28
|
+
DA:59,186
|
|
29
|
+
DA:60,186
|
|
30
|
+
DA:62,39
|
|
31
|
+
DA:63,39
|
|
32
|
+
DA:68,39
|
|
33
|
+
DA:69,0
|
|
34
|
+
DA:70,0
|
|
35
|
+
DA:76,24
|
|
36
|
+
DA:77,624
|
|
37
|
+
DA:78,624
|
|
38
|
+
DA:81,24
|
|
39
|
+
DA:82,24
|
|
41
40
|
DA:85,24
|
|
42
41
|
DA:86,24
|
|
43
|
-
DA:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
BRDA:
|
|
49
|
-
BRDA:
|
|
50
|
-
BRDA:
|
|
51
|
-
BRDA:70,1,0,0
|
|
52
|
-
BRDA:70,1,1,39
|
|
42
|
+
DA:88,24
|
|
43
|
+
LF:30
|
|
44
|
+
LH:28
|
|
45
|
+
BRDA:62,0,0,39
|
|
46
|
+
BRDA:62,0,1,0
|
|
47
|
+
BRDA:62,0,2,0
|
|
48
|
+
BRDA:68,1,0,0
|
|
49
|
+
BRDA:68,1,1,39
|
|
53
50
|
BRF:5
|
|
54
51
|
BRH:2
|
|
55
52
|
end_of_record
|
|
@@ -2422,8 +2419,8 @@ FN:141,(anonymous_11)
|
|
|
2422
2419
|
FNF:12
|
|
2423
2420
|
FNH:11
|
|
2424
2421
|
FNDA:119,pickApi
|
|
2425
|
-
FNDA:
|
|
2426
|
-
FNDA:
|
|
2422
|
+
FNDA:122,getTableId
|
|
2423
|
+
FNDA:7,(anonymous_2)
|
|
2427
2424
|
FNDA:74,(anonymous_3)
|
|
2428
2425
|
FNDA:7,(anonymous_4)
|
|
2429
2426
|
FNDA:4,(anonymous_5)
|
|
@@ -2439,37 +2436,37 @@ DA:3,40
|
|
|
2439
2436
|
DA:6,119
|
|
2440
2437
|
DA:7,0
|
|
2441
2438
|
DA:9,118
|
|
2442
|
-
DA:13,
|
|
2443
|
-
DA:14,
|
|
2444
|
-
DA:16,
|
|
2445
|
-
DA:17,
|
|
2439
|
+
DA:13,122
|
|
2440
|
+
DA:14,80
|
|
2441
|
+
DA:16,42
|
|
2442
|
+
DA:17,34
|
|
2446
2443
|
DA:19,8
|
|
2447
2444
|
DA:20,7
|
|
2448
2445
|
DA:24,40
|
|
2449
|
-
DA:25,
|
|
2450
|
-
DA:26,
|
|
2451
|
-
DA:27,
|
|
2452
|
-
DA:29,
|
|
2446
|
+
DA:25,7
|
|
2447
|
+
DA:26,7
|
|
2448
|
+
DA:27,7
|
|
2449
|
+
DA:29,7
|
|
2453
2450
|
DA:30,0
|
|
2454
|
-
DA:32,
|
|
2455
|
-
DA:33,
|
|
2456
|
-
DA:34,
|
|
2457
|
-
DA:35,
|
|
2458
|
-
DA:37,
|
|
2459
|
-
DA:38,
|
|
2451
|
+
DA:32,7
|
|
2452
|
+
DA:33,7
|
|
2453
|
+
DA:34,5
|
|
2454
|
+
DA:35,5
|
|
2455
|
+
DA:37,5
|
|
2456
|
+
DA:38,5
|
|
2460
2457
|
DA:40,2
|
|
2461
2458
|
DA:44,40
|
|
2462
2459
|
DA:45,74
|
|
2463
2460
|
DA:46,74
|
|
2464
2461
|
DA:47,74
|
|
2465
2462
|
DA:49,74
|
|
2466
|
-
DA:50,
|
|
2467
|
-
DA:52,
|
|
2468
|
-
DA:53,
|
|
2469
|
-
DA:54,
|
|
2470
|
-
DA:55,
|
|
2471
|
-
DA:56,
|
|
2472
|
-
DA:57,
|
|
2463
|
+
DA:50,3
|
|
2464
|
+
DA:52,71
|
|
2465
|
+
DA:53,71
|
|
2466
|
+
DA:54,70
|
|
2467
|
+
DA:55,70
|
|
2468
|
+
DA:56,70
|
|
2469
|
+
DA:57,70
|
|
2473
2470
|
DA:59,1
|
|
2474
2471
|
DA:63,40
|
|
2475
2472
|
DA:64,7
|
|
@@ -2527,30 +2524,30 @@ LF:90
|
|
|
2527
2524
|
LH:80
|
|
2528
2525
|
BRDA:6,0,0,0
|
|
2529
2526
|
BRDA:6,0,1,118
|
|
2530
|
-
BRDA:13,1,0,
|
|
2531
|
-
BRDA:13,1,1,
|
|
2532
|
-
BRDA:13,2,0,
|
|
2533
|
-
BRDA:13,2,1,
|
|
2534
|
-
BRDA:16,3,0,
|
|
2527
|
+
BRDA:13,1,0,80
|
|
2528
|
+
BRDA:13,1,1,42
|
|
2529
|
+
BRDA:13,2,0,122
|
|
2530
|
+
BRDA:13,2,1,109
|
|
2531
|
+
BRDA:16,3,0,34
|
|
2535
2532
|
BRDA:16,3,1,8
|
|
2536
|
-
BRDA:16,4,0,
|
|
2537
|
-
BRDA:16,4,1,
|
|
2533
|
+
BRDA:16,4,0,42
|
|
2534
|
+
BRDA:16,4,1,42
|
|
2538
2535
|
BRDA:19,5,0,7
|
|
2539
2536
|
BRDA:19,5,1,1
|
|
2540
2537
|
BRDA:19,6,0,8
|
|
2541
2538
|
BRDA:19,6,1,8
|
|
2542
2539
|
BRDA:29,7,0,0
|
|
2543
|
-
BRDA:29,7,1,
|
|
2544
|
-
BRDA:29,8,0,
|
|
2545
|
-
BRDA:29,8,1,
|
|
2546
|
-
BRDA:35,9,0,
|
|
2547
|
-
BRDA:35,9,1,
|
|
2548
|
-
BRDA:49,10,0,
|
|
2549
|
-
BRDA:49,10,1,
|
|
2540
|
+
BRDA:29,7,1,7
|
|
2541
|
+
BRDA:29,8,0,7
|
|
2542
|
+
BRDA:29,8,1,7
|
|
2543
|
+
BRDA:35,9,0,5
|
|
2544
|
+
BRDA:35,9,1,4
|
|
2545
|
+
BRDA:49,10,0,3
|
|
2546
|
+
BRDA:49,10,1,71
|
|
2550
2547
|
BRDA:49,11,0,74
|
|
2551
2548
|
BRDA:49,11,1,74
|
|
2552
|
-
BRDA:55,12,0,
|
|
2553
|
-
BRDA:55,12,1,
|
|
2549
|
+
BRDA:55,12,0,70
|
|
2550
|
+
BRDA:55,12,1,10
|
|
2554
2551
|
BRDA:95,13,0,2
|
|
2555
2552
|
BRDA:95,13,1,4
|
|
2556
2553
|
BRDA:99,14,0,3
|
|
@@ -2595,8 +2592,8 @@ FNH:22
|
|
|
2595
2592
|
FNDA:6,getView
|
|
2596
2593
|
FNDA:5,getRawTableData
|
|
2597
2594
|
FNDA:10,(anonymous_2)
|
|
2598
|
-
FNDA:
|
|
2599
|
-
FNDA:
|
|
2595
|
+
FNDA:6,(anonymous_3)
|
|
2596
|
+
FNDA:71,(anonymous_4)
|
|
2600
2597
|
FNDA:7,(anonymous_5)
|
|
2601
2598
|
FNDA:3,(anonymous_6)
|
|
2602
2599
|
FNDA:3,(anonymous_7)
|
|
@@ -2657,44 +2654,44 @@ DA:71,5
|
|
|
2657
2654
|
DA:76,10
|
|
2658
2655
|
DA:78,5
|
|
2659
2656
|
DA:81,40
|
|
2660
|
-
DA:82,
|
|
2661
|
-
DA:83,
|
|
2662
|
-
DA:84,
|
|
2663
|
-
DA:85,
|
|
2664
|
-
DA:87,
|
|
2665
|
-
DA:88,
|
|
2657
|
+
DA:82,6
|
|
2658
|
+
DA:83,6
|
|
2659
|
+
DA:84,6
|
|
2660
|
+
DA:85,6
|
|
2661
|
+
DA:87,6
|
|
2662
|
+
DA:88,6
|
|
2666
2663
|
DA:90,0
|
|
2667
2664
|
DA:93,0
|
|
2668
2665
|
DA:97,0
|
|
2669
|
-
DA:100,
|
|
2670
|
-
DA:102,
|
|
2671
|
-
DA:103,
|
|
2672
|
-
DA:104,
|
|
2673
|
-
DA:105,
|
|
2674
|
-
DA:109,
|
|
2675
|
-
DA:110,
|
|
2676
|
-
DA:115,
|
|
2666
|
+
DA:100,6
|
|
2667
|
+
DA:102,6
|
|
2668
|
+
DA:103,6
|
|
2669
|
+
DA:104,26
|
|
2670
|
+
DA:105,7
|
|
2671
|
+
DA:109,6
|
|
2672
|
+
DA:110,6
|
|
2673
|
+
DA:115,6
|
|
2677
2674
|
DA:116,1
|
|
2678
|
-
DA:120,
|
|
2679
|
-
DA:127,
|
|
2680
|
-
DA:129,
|
|
2675
|
+
DA:120,5
|
|
2676
|
+
DA:127,5
|
|
2677
|
+
DA:129,5
|
|
2681
2678
|
DA:131,0
|
|
2682
2679
|
DA:132,0
|
|
2683
2680
|
DA:133,0
|
|
2684
|
-
DA:136,
|
|
2681
|
+
DA:136,5
|
|
2685
2682
|
DA:142,40
|
|
2686
|
-
DA:143,
|
|
2687
|
-
DA:144,
|
|
2688
|
-
DA:145,
|
|
2689
|
-
DA:147,
|
|
2690
|
-
DA:148,
|
|
2691
|
-
DA:152,
|
|
2692
|
-
DA:153,
|
|
2693
|
-
DA:154,
|
|
2694
|
-
DA:159,
|
|
2683
|
+
DA:143,71
|
|
2684
|
+
DA:144,71
|
|
2685
|
+
DA:145,71
|
|
2686
|
+
DA:147,71
|
|
2687
|
+
DA:148,71
|
|
2688
|
+
DA:152,71
|
|
2689
|
+
DA:153,71
|
|
2690
|
+
DA:154,71
|
|
2691
|
+
DA:159,71
|
|
2695
2692
|
DA:160,0
|
|
2696
|
-
DA:164,
|
|
2697
|
-
DA:171,
|
|
2693
|
+
DA:164,71
|
|
2694
|
+
DA:171,70
|
|
2698
2695
|
DA:177,40
|
|
2699
2696
|
DA:178,7
|
|
2700
2697
|
DA:181,7
|
|
@@ -2846,18 +2843,18 @@ BRDA:67,6,0,0
|
|
|
2846
2843
|
BRDA:67,6,1,5
|
|
2847
2844
|
BRDA:90,7,0,0
|
|
2848
2845
|
BRDA:90,7,1,0
|
|
2849
|
-
BRDA:104,8,0,
|
|
2850
|
-
BRDA:104,8,1,
|
|
2846
|
+
BRDA:104,8,0,19
|
|
2847
|
+
BRDA:104,8,1,7
|
|
2851
2848
|
BRDA:115,9,0,1
|
|
2852
|
-
BRDA:115,9,1,
|
|
2849
|
+
BRDA:115,9,1,5
|
|
2853
2850
|
BRDA:129,10,0,0
|
|
2854
|
-
BRDA:129,10,1,
|
|
2855
|
-
BRDA:147,11,0,
|
|
2851
|
+
BRDA:129,10,1,5
|
|
2852
|
+
BRDA:147,11,0,71
|
|
2856
2853
|
BRDA:147,11,1,0
|
|
2857
|
-
BRDA:147,12,0,
|
|
2858
|
-
BRDA:147,12,1,
|
|
2854
|
+
BRDA:147,12,0,71
|
|
2855
|
+
BRDA:147,12,1,71
|
|
2859
2856
|
BRDA:159,13,0,0
|
|
2860
|
-
BRDA:159,13,1,
|
|
2857
|
+
BRDA:159,13,1,71
|
|
2861
2858
|
BRDA:181,14,0,1
|
|
2862
2859
|
BRDA:181,14,1,6
|
|
2863
2860
|
BRDA:190,15,0,5
|
|
@@ -5244,7 +5241,7 @@ DA:13,24
|
|
|
5244
5241
|
DA:33,24
|
|
5245
5242
|
DA:34,24
|
|
5246
5243
|
DA:37,24
|
|
5247
|
-
DA:
|
|
5244
|
+
DA:54,24
|
|
5248
5245
|
LF:12
|
|
5249
5246
|
LH:12
|
|
5250
5247
|
BRDA:33,0,0,24
|
|
@@ -5607,8 +5604,8 @@ FNDA:19,queueRelevantRowAutomations
|
|
|
5607
5604
|
FNDA:19,(anonymous_1)
|
|
5608
5605
|
FNDA:4,(anonymous_2)
|
|
5609
5606
|
FNDA:4,(anonymous_3)
|
|
5610
|
-
FNDA:
|
|
5611
|
-
FNDA:
|
|
5607
|
+
FNDA:9,(anonymous_4)
|
|
5608
|
+
FNDA:4,(anonymous_5)
|
|
5612
5609
|
FNDA:6,(anonymous_6)
|
|
5613
5610
|
FNDA:6,(anonymous_7)
|
|
5614
5611
|
DA:1,39
|
|
@@ -5640,9 +5637,9 @@ DA:49,0
|
|
|
5640
5637
|
DA:51,4
|
|
5641
5638
|
DA:55,4
|
|
5642
5639
|
DA:61,39
|
|
5643
|
-
DA:66,
|
|
5640
|
+
DA:66,9
|
|
5644
5641
|
DA:69,39
|
|
5645
|
-
DA:74,
|
|
5642
|
+
DA:74,4
|
|
5646
5643
|
DA:77,39
|
|
5647
5644
|
DA:82,6
|
|
5648
5645
|
DA:85,39
|
|
@@ -6182,14 +6179,15 @@ BRDA:88,0,1,0
|
|
|
6182
6179
|
BRDA:88,1,0,1
|
|
6183
6180
|
BRDA:88,1,1,1
|
|
6184
6181
|
BRDA:88,1,2,1
|
|
6182
|
+
BRDA:88,1,3,1
|
|
6185
6183
|
BRDA:91,2,0,0
|
|
6186
6184
|
BRDA:91,2,1,1
|
|
6187
6185
|
BRDA:101,3,0,1
|
|
6188
6186
|
BRDA:101,3,1,0
|
|
6189
6187
|
BRDA:108,4,0,1
|
|
6190
6188
|
BRDA:108,4,1,0
|
|
6191
|
-
BRF:
|
|
6192
|
-
BRH:
|
|
6189
|
+
BRF:12
|
|
6190
|
+
BRH:8
|
|
6193
6191
|
end_of_record
|
|
6194
6192
|
TN:
|
|
6195
6193
|
SF:src/automations/steps/sendSmtpEmail.js
|
|
@@ -6584,10 +6582,10 @@ SF:src/db/newid.js
|
|
|
6584
6582
|
FN:3,(anonymous_0)
|
|
6585
6583
|
FNF:1
|
|
6586
6584
|
FNH:1
|
|
6587
|
-
FNDA:
|
|
6585
|
+
FNDA:945,(anonymous_0)
|
|
6588
6586
|
DA:1,55
|
|
6589
6587
|
DA:3,55
|
|
6590
|
-
DA:4,
|
|
6588
|
+
DA:4,945
|
|
6591
6589
|
LF:3
|
|
6592
6590
|
LH:3
|
|
6593
6591
|
BRF:0
|
|
@@ -6635,7 +6633,7 @@ FNDA:222,(anonymous_2)
|
|
|
6635
6633
|
FNDA:106,(anonymous_3)
|
|
6636
6634
|
FNDA:16,(anonymous_4)
|
|
6637
6635
|
FNDA:0,(anonymous_5)
|
|
6638
|
-
FNDA:
|
|
6636
|
+
FNDA:265,(anonymous_6)
|
|
6639
6637
|
FNDA:3,(anonymous_7)
|
|
6640
6638
|
FNDA:193,(anonymous_8)
|
|
6641
6639
|
FNDA:2,(anonymous_9)
|
|
@@ -6706,8 +6704,8 @@ DA:154,55
|
|
|
6706
6704
|
DA:155,0
|
|
6707
6705
|
DA:158,0
|
|
6708
6706
|
DA:167,55
|
|
6709
|
-
DA:168,
|
|
6710
|
-
DA:169,
|
|
6707
|
+
DA:168,265
|
|
6708
|
+
DA:169,265
|
|
6711
6709
|
DA:175,55
|
|
6712
6710
|
DA:176,3
|
|
6713
6711
|
DA:184,55
|
|
@@ -6789,9 +6787,9 @@ BRDA:140,8,0,4
|
|
|
6789
6787
|
BRDA:140,8,1,12
|
|
6790
6788
|
BRDA:144,9,0,12
|
|
6791
6789
|
BRDA:144,9,1,0
|
|
6792
|
-
BRDA:167,10,0,
|
|
6793
|
-
BRDA:168,11,0,
|
|
6794
|
-
BRDA:168,11,1,
|
|
6790
|
+
BRDA:167,10,0,72
|
|
6791
|
+
BRDA:168,11,0,265
|
|
6792
|
+
BRDA:168,11,1,72
|
|
6795
6793
|
BRDA:175,12,0,0
|
|
6796
6794
|
BRDA:175,13,0,0
|
|
6797
6795
|
BRDA:193,14,0,1
|
|
@@ -7772,15 +7770,16 @@ DA:85,0
|
|
|
7772
7770
|
DA:86,0
|
|
7773
7771
|
DA:87,0
|
|
7774
7772
|
DA:88,0
|
|
7775
|
-
DA:
|
|
7773
|
+
DA:89,0
|
|
7776
7774
|
DA:92,190
|
|
7777
7775
|
DA:93,190
|
|
7778
7776
|
DA:94,190
|
|
7779
7777
|
DA:95,190
|
|
7780
|
-
DA:
|
|
7781
|
-
DA:
|
|
7782
|
-
DA:
|
|
7783
|
-
|
|
7778
|
+
DA:96,190
|
|
7779
|
+
DA:105,190
|
|
7780
|
+
DA:111,7
|
|
7781
|
+
DA:114,190
|
|
7782
|
+
LF:56
|
|
7784
7783
|
LH:46
|
|
7785
7784
|
BRDA:28,0,0,1
|
|
7786
7785
|
BRDA:28,0,1,192
|
|
@@ -7815,16 +7814,16 @@ BRDA:78,13,0,190
|
|
|
7815
7814
|
BRDA:78,13,1,0
|
|
7816
7815
|
BRDA:78,13,2,0
|
|
7817
7816
|
BRDA:78,13,3,0
|
|
7818
|
-
BRDA:
|
|
7819
|
-
BRDA:
|
|
7820
|
-
BRDA:
|
|
7821
|
-
BRDA:
|
|
7822
|
-
BRDA:
|
|
7823
|
-
BRDA:
|
|
7824
|
-
BRDA:
|
|
7825
|
-
BRDA:
|
|
7826
|
-
BRDA:
|
|
7827
|
-
BRDA:
|
|
7817
|
+
BRDA:93,14,0,190
|
|
7818
|
+
BRDA:93,14,1,0
|
|
7819
|
+
BRDA:95,15,0,185
|
|
7820
|
+
BRDA:95,15,1,5
|
|
7821
|
+
BRDA:105,16,0,7
|
|
7822
|
+
BRDA:105,16,1,183
|
|
7823
|
+
BRDA:106,17,0,190
|
|
7824
|
+
BRDA:106,17,1,190
|
|
7825
|
+
BRDA:106,17,2,185
|
|
7826
|
+
BRDA:106,17,3,7
|
|
7828
7827
|
BRF:43
|
|
7829
7828
|
BRH:33
|
|
7830
7829
|
end_of_record
|
|
@@ -9486,7 +9485,7 @@ FNDA:182,(anonymous_11)
|
|
|
9486
9485
|
FNDA:78,(anonymous_12)
|
|
9487
9486
|
FNDA:107,(anonymous_13)
|
|
9488
9487
|
FNDA:2,(anonymous_14)
|
|
9489
|
-
FNDA:
|
|
9488
|
+
FNDA:14,(anonymous_15)
|
|
9490
9489
|
FNDA:0,addFiles
|
|
9491
9490
|
FNDA:0,(anonymous_17)
|
|
9492
9491
|
FNDA:0,(anonymous_18)
|
|
@@ -9562,17 +9561,17 @@ DA:221,78
|
|
|
9562
9561
|
DA:223,78
|
|
9563
9562
|
DA:224,78
|
|
9564
9563
|
DA:225,78
|
|
9565
|
-
DA:226,
|
|
9566
|
-
DA:228,
|
|
9567
|
-
DA:229,
|
|
9564
|
+
DA:226,353
|
|
9565
|
+
DA:228,353
|
|
9566
|
+
DA:229,172
|
|
9568
9567
|
DA:230,3
|
|
9569
|
-
DA:232,
|
|
9568
|
+
DA:232,172
|
|
9570
9569
|
DA:235,181
|
|
9571
9570
|
DA:236,0
|
|
9572
9571
|
DA:240,181
|
|
9573
9572
|
DA:244,78
|
|
9574
|
-
DA:245,
|
|
9575
|
-
DA:246,
|
|
9573
|
+
DA:245,72
|
|
9574
|
+
DA:246,72
|
|
9576
9575
|
DA:250,78
|
|
9577
9576
|
DA:262,40
|
|
9578
9577
|
DA:263,107
|
|
@@ -9592,12 +9591,12 @@ DA:287,107
|
|
|
9592
9591
|
DA:288,27
|
|
9593
9592
|
DA:290,107
|
|
9594
9593
|
DA:303,40
|
|
9595
|
-
DA:304,
|
|
9596
|
-
DA:305,
|
|
9597
|
-
DA:306,
|
|
9598
|
-
DA:308,
|
|
9599
|
-
DA:309,
|
|
9600
|
-
DA:310,
|
|
9594
|
+
DA:304,14
|
|
9595
|
+
DA:305,14
|
|
9596
|
+
DA:306,14
|
|
9597
|
+
DA:308,14
|
|
9598
|
+
DA:309,14
|
|
9599
|
+
DA:310,14
|
|
9601
9600
|
DA:313,0
|
|
9602
9601
|
DA:315,0
|
|
9603
9602
|
DA:316,0
|
|
@@ -9670,14 +9669,14 @@ BRDA:199,22,0,22
|
|
|
9670
9669
|
BRDA:199,22,1,144
|
|
9671
9670
|
BRDA:216,23,0,0
|
|
9672
9671
|
BRDA:219,24,0,77
|
|
9673
|
-
BRDA:228,25,0,
|
|
9672
|
+
BRDA:228,25,0,172
|
|
9674
9673
|
BRDA:228,25,1,181
|
|
9675
9674
|
BRDA:229,26,0,3
|
|
9676
|
-
BRDA:229,26,1,
|
|
9675
|
+
BRDA:229,26,1,169
|
|
9677
9676
|
BRDA:235,27,0,0
|
|
9678
9677
|
BRDA:235,27,1,181
|
|
9679
|
-
BRDA:244,28,0,
|
|
9680
|
-
BRDA:244,28,1,
|
|
9678
|
+
BRDA:244,28,0,72
|
|
9679
|
+
BRDA:244,28,1,6
|
|
9681
9680
|
BRDA:244,29,0,78
|
|
9682
9681
|
BRDA:244,29,1,78
|
|
9683
9682
|
BRDA:262,30,0,27
|
|
@@ -9693,9 +9692,9 @@ BRDA:287,35,0,27
|
|
|
9693
9692
|
BRDA:287,35,1,80
|
|
9694
9693
|
BRDA:290,36,0,14
|
|
9695
9694
|
BRDA:290,36,1,93
|
|
9696
|
-
BRDA:305,37,0,
|
|
9695
|
+
BRDA:305,37,0,14
|
|
9697
9696
|
BRDA:305,37,1,0
|
|
9698
|
-
BRDA:309,38,0,
|
|
9697
|
+
BRDA:309,38,0,14
|
|
9699
9698
|
BRDA:309,38,1,0
|
|
9700
9699
|
BRDA:315,39,0,0
|
|
9701
9700
|
BRDA:315,39,1,0
|
|
@@ -16,7 +16,7 @@ const { getAppDB, getAppId } = require("@budibase/backend-core/context");
|
|
|
16
16
|
exports.fetchSelf = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
17
|
let userId = ctx.user.userId || ctx.user._id;
|
|
18
18
|
/* istanbul ignore next */
|
|
19
|
-
if (!userId) {
|
|
19
|
+
if (!userId || !ctx.isAuthenticated) {
|
|
20
20
|
ctx.body = {};
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
@@ -71,7 +71,7 @@ function read(ctx, next) {
|
|
|
71
71
|
exports.read = read;
|
|
72
72
|
function update(ctx, next) {
|
|
73
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
ctx.request.body = yield utils_1.addRev(fixRow(ctx.request.body, ctx.params
|
|
74
|
+
ctx.request.body = yield utils_1.addRev(fixRow(ctx.request.body, ctx.params));
|
|
75
75
|
yield row_1.default.save(ctx);
|
|
76
76
|
yield next();
|
|
77
77
|
});
|
|
@@ -80,7 +80,7 @@ exports.update = update;
|
|
|
80
80
|
function destroy(ctx, next) {
|
|
81
81
|
return __awaiter(this, void 0, void 0, function* () {
|
|
82
82
|
// set the body as expected, with the _id and _rev fields
|
|
83
|
-
ctx.request.body = yield utils_1.addRev(fixRow({ _id: ctx.params.rowId }, ctx.params
|
|
83
|
+
ctx.request.body = yield utils_1.addRev(fixRow({ _id: ctx.params.rowId }, ctx.params));
|
|
84
84
|
yield row_1.default.destroy(ctx);
|
|
85
85
|
// destroy controller doesn't currently return the row as the body, need to adjust this
|
|
86
86
|
// in the public API to be correct
|
|
@@ -14,14 +14,13 @@ const { resolve, join } = require("../../../utilities/centralPath");
|
|
|
14
14
|
const uuid = require("uuid");
|
|
15
15
|
const { ObjectStoreBuckets } = require("../../../constants");
|
|
16
16
|
const { processString } = require("@budibase/string-templates");
|
|
17
|
-
const { getAllApps } = require("@budibase/backend-core/db");
|
|
18
17
|
const { loadHandlebarsFile, NODE_MODULES_PATH, TOP_LEVEL_PATH, } = require("../../../utilities/fileSystem");
|
|
19
18
|
const env = require("../../../environment");
|
|
20
19
|
const { clientLibraryPath } = require("../../../utilities");
|
|
21
20
|
const { upload } = require("../../../utilities/fileSystem");
|
|
22
21
|
const { attachmentsRelativeURL } = require("../../../utilities");
|
|
23
22
|
const { DocumentTypes } = require("../../../db/utils");
|
|
24
|
-
const { getAppDB,
|
|
23
|
+
const { getAppDB, getAppId } = require("@budibase/backend-core/context");
|
|
25
24
|
const AWS = require("aws-sdk");
|
|
26
25
|
const AWS_REGION = env.AWS_REGION ? env.AWS_REGION : "eu-west-1";
|
|
27
26
|
function prepareUpload({ s3Key, bucket, metadata, file }) {
|
|
@@ -43,18 +42,6 @@ function prepareUpload({ s3Key, bucket, metadata, file }) {
|
|
|
43
42
|
};
|
|
44
43
|
});
|
|
45
44
|
}
|
|
46
|
-
function getAppIdFromUrl(ctx) {
|
|
47
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
// the "appId" component of the URL can be the id or the custom url
|
|
49
|
-
let possibleAppUrl = `/${encodeURI(ctx.params.appId).toLowerCase()}`;
|
|
50
|
-
// search prod apps for a url that matches, exclude dev where id is always used
|
|
51
|
-
const apps = yield getAllApps({ dev: false });
|
|
52
|
-
const app = apps.filter(a => a.url && a.url.toLowerCase() === possibleAppUrl)[0];
|
|
53
|
-
const appId = app && app.appId ? app.appId : ctx.params.appId;
|
|
54
|
-
updateAppId(appId);
|
|
55
|
-
return appId;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
45
|
exports.serveBuilder = function (ctx) {
|
|
59
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
47
|
let builderPath = resolve(TOP_LEVEL_PATH, "builder");
|
|
@@ -81,10 +68,10 @@ exports.uploadFile = function (ctx) {
|
|
|
81
68
|
};
|
|
82
69
|
exports.serveApp = function (ctx) {
|
|
83
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
-
let appId = yield getAppIdFromUrl(ctx);
|
|
85
71
|
const App = require("./templates/BudibaseApp.svelte").default;
|
|
86
72
|
const db = getAppDB({ skip_setup: true });
|
|
87
73
|
const appInfo = yield db.get(DocumentTypes.APP_METADATA);
|
|
74
|
+
let appId = getAppId();
|
|
88
75
|
const { head, html, css } = App.render({
|
|
89
76
|
title: appInfo.name,
|
|
90
77
|
production: env.isProd(),
|
|
@@ -97,8 +97,8 @@ function generateManyLinkSchema(datasource, column, table, relatedTable) {
|
|
|
97
97
|
},
|
|
98
98
|
};
|
|
99
99
|
column.through = junctionTable._id;
|
|
100
|
-
column.throughFrom =
|
|
101
|
-
column.throughTo =
|
|
100
|
+
column.throughFrom = relatedPrimary;
|
|
101
|
+
column.throughTo = primary;
|
|
102
102
|
column.fieldName = relatedPrimary;
|
|
103
103
|
return junctionTable;
|
|
104
104
|
}
|
|
@@ -123,7 +123,7 @@ function generateRelatedSchema(linkColumn, table, relatedTable, columnName) {
|
|
|
123
123
|
// is many to many
|
|
124
124
|
else {
|
|
125
125
|
// don't need to copy through, already got it
|
|
126
|
-
relatedSchema.fieldName = linkColumn.
|
|
126
|
+
relatedSchema.fieldName = linkColumn.throughTo;
|
|
127
127
|
relatedSchema.throughTo = linkColumn.throughFrom;
|
|
128
128
|
relatedSchema.throughFrom = linkColumn.throughTo;
|
|
129
129
|
}
|
package/dist/api/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
const Router = require("@koa/router");
|
|
12
|
-
const { buildAuthMiddleware, auditLog, buildTenancyMiddleware,
|
|
12
|
+
const { buildAuthMiddleware, auditLog, buildTenancyMiddleware, } = require("@budibase/backend-core/auth");
|
|
13
13
|
const currentApp = require("../middleware/currentapp");
|
|
14
14
|
const compress = require("koa-compress");
|
|
15
15
|
const zlib = require("zlib");
|
|
@@ -17,6 +17,8 @@ const { mainRoutes, staticRoutes, publicRoutes } = require("./routes");
|
|
|
17
17
|
const pkg = require("../../package.json");
|
|
18
18
|
const env = require("../environment");
|
|
19
19
|
const router = new Router();
|
|
20
|
+
router.get("/health", ctx => (ctx.status = 200));
|
|
21
|
+
router.get("/version", ctx => (ctx.body = pkg.version));
|
|
20
22
|
router
|
|
21
23
|
.use(compress({
|
|
22
24
|
threshold: 2048,
|
|
@@ -35,8 +37,6 @@ router
|
|
|
35
37
|
};
|
|
36
38
|
yield next();
|
|
37
39
|
}))
|
|
38
|
-
.use("/health", ctx => (ctx.status = 200))
|
|
39
|
-
.use("/version", ctx => (ctx.body = pkg.version))
|
|
40
40
|
// re-direct before any middlewares occur
|
|
41
41
|
.redirect("/", "/builder")
|
|
42
42
|
.use(buildAuthMiddleware(null, {
|
|
@@ -49,8 +49,6 @@ router
|
|
|
49
49
|
noTenancyRequired: true,
|
|
50
50
|
}))
|
|
51
51
|
.use(currentApp)
|
|
52
|
-
// this middleware will try to use the app ID to determine the tenancy
|
|
53
|
-
.use(buildAppTenancyMiddleware())
|
|
54
52
|
.use(auditLog);
|
|
55
53
|
// error handling middleware
|
|
56
54
|
router.use((ctx, next) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -70,7 +68,6 @@ router.use((ctx, next) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
70
68
|
}
|
|
71
69
|
}
|
|
72
70
|
}));
|
|
73
|
-
router.get("/health", ctx => (ctx.status = 200));
|
|
74
71
|
// authenticated routes
|
|
75
72
|
for (let route of mainRoutes) {
|
|
76
73
|
router.use(route.routes());
|
|
@@ -42,7 +42,6 @@ router
|
|
|
42
42
|
.get("/builder/:file*", controller.serveBuilder)
|
|
43
43
|
.post("/api/attachments/process", authorized(BUILDER), controller.uploadFile)
|
|
44
44
|
.post("/api/attachments/:tableId/upload", paramResource("tableId"), authorized(PermissionTypes.TABLE, PermissionLevels.WRITE), controller.uploadFile)
|
|
45
|
-
|
|
46
|
-
.get("/:appId/:path*", controller.serveApp)
|
|
45
|
+
.get("/app/:appUrl/:path*", controller.serveApp)
|
|
47
46
|
.post("/api/attachments/:datasourceId/url", authorized(PermissionTypes.TABLE, PermissionLevels.READ), controller.getSignedUploadURL);
|
|
48
47
|
module.exports = router;
|
|
@@ -93,7 +93,7 @@ exports.run = function ({ inputs, appId }) {
|
|
|
93
93
|
const { tableId, filters, sortColumn, sortOrder, limit } = inputs;
|
|
94
94
|
const table = yield getTable(appId, tableId);
|
|
95
95
|
let sortType = FieldTypes.STRING;
|
|
96
|
-
if (table && table.schema && sortColumn) {
|
|
96
|
+
if (table && table.schema && table.schema[sortColumn] && sortColumn) {
|
|
97
97
|
const fieldType = table.schema[sortColumn].type;
|
|
98
98
|
sortType =
|
|
99
99
|
fieldType === FieldTypes.NUMBER ? FieldTypes.NUMBER : FieldTypes.STRING;
|