@budibase/server 1.2.35 → 1.2.38
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.05962580.js → index.47bfb9a6.js} +48 -48
- package/builder/index.html +1 -1
- package/coverage/clover.xml +2 -2
- package/coverage/coverage-final.json +13 -13
- 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 +3 -3
- package/coverage/lcov-report/api/controllers/backup.js.html +3 -3
- package/coverage/lcov-report/api/controllers/cloud.js.html +4 -4
- package/coverage/lcov-report/api/controllers/component.js.html +3 -3
- package/coverage/lcov-report/api/controllers/datasource.js.html +3 -3
- package/coverage/lcov-report/api/controllers/dev.js.html +4 -4
- package/coverage/lcov-report/api/controllers/index.html +1 -1
- package/coverage/lcov-report/api/controllers/integration.js.html +3 -3
- 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 +3 -3
- 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 +1 -1
- package/coverage/lcov-report/api/controllers/view/index.js.html +3 -3
- package/coverage/lcov-report/api/controllers/view/utils.js.html +5 -5
- 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 +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 +3 -3
- package/coverage/lcov-report/db/newid.js.html +1 -1
- package/coverage/lcov-report/db/utils.js.html +39 -39
- 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 +1 -1
- 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 +3 -3
- 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/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 +3 -3
- 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 +9 -9
- 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/dist/api/controllers/analytics.js +1 -1
- package/dist/api/controllers/application.js +8 -8
- package/dist/api/controllers/automation.js +2 -2
- package/dist/api/controllers/backup.js +2 -2
- package/dist/api/controllers/cloud.js +3 -3
- package/dist/api/controllers/component.js +2 -2
- package/dist/api/controllers/datasource.js +2 -2
- package/dist/api/controllers/deploy/index.js +6 -6
- package/dist/api/controllers/dev.js +3 -3
- package/dist/api/controllers/integration.js +2 -2
- package/dist/api/controllers/public/utils.js +1 -1
- package/dist/api/controllers/row/ExternalRequest.js +3 -3
- package/dist/api/controllers/row/internal.js +2 -2
- package/dist/api/controllers/static/index.js +2 -2
- package/dist/api/controllers/view/index.js +2 -2
- package/dist/api/controllers/view/utils.js +3 -3
- package/dist/db/linkedRows/linkUtils.js +2 -2
- package/dist/db/utils.js +37 -37
- package/dist/db/views/staticViews.js +4 -4
- package/dist/definitions/automations.js +6 -6
- package/dist/definitions/datasource.js +6 -70
- package/dist/integrations/airtable.js +13 -13
- package/dist/integrations/arangodb.js +8 -8
- package/dist/integrations/base/sql.js +28 -28
- package/dist/integrations/base/sqlTable.js +4 -4
- package/dist/integrations/couchdb.js +8 -8
- package/dist/integrations/dynamodb.js +21 -21
- package/dist/integrations/elasticsearch.js +12 -12
- package/dist/integrations/firebase.js +12 -12
- package/dist/integrations/googlesheets.js +14 -14
- package/dist/integrations/index.js +34 -34
- package/dist/integrations/microsoftSqlServer.js +14 -14
- package/dist/integrations/mongodb.js +9 -9
- package/dist/integrations/mysql.js +13 -13
- package/dist/integrations/oracle.js +13 -13
- package/dist/integrations/postgres.js +15 -15
- package/dist/integrations/redis.js +10 -10
- package/dist/integrations/rest.js +15 -14
- package/dist/integrations/s3.js +2 -2
- package/dist/integrations/snowflake.js +5 -5
- package/dist/integrations/utils.js +14 -14
- package/dist/middleware/builder.js +2 -2
- package/dist/migrations/functions/appUrls.js +2 -2
- package/dist/migrations/functions/backfill/app/queries.js +3 -1
- package/dist/migrations/functions/backfill/app.js +1 -1
- package/dist/migrations/functions/backfill/global/users.js +1 -1
- package/dist/package.json +6 -6
- package/dist/tests/utilities/TestConfiguration.js +2 -2
- package/dist/threads/automation.js +2 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/routing/index.js +2 -2
- package/dist/utilities/security.js +8 -8
- package/package.json +7 -7
- package/src/api/controllers/analytics.ts +2 -2
- package/src/api/controllers/application.ts +9 -9
- package/src/api/controllers/automation.js +2 -2
- package/src/api/controllers/backup.js +2 -2
- package/src/api/controllers/cloud.js +3 -3
- package/src/api/controllers/component.js +2 -2
- package/src/api/controllers/datasource.js +2 -2
- package/src/api/controllers/deploy/index.ts +7 -7
- package/src/api/controllers/dev.js +3 -3
- package/src/api/controllers/integration.js +2 -2
- package/src/api/controllers/public/utils.ts +2 -2
- package/src/api/controllers/query/import/sources/openapi2.ts +1 -1
- package/src/api/controllers/query/import/sources/openapi3.ts +1 -1
- package/src/api/controllers/row/ExternalRequest.ts +5 -7
- package/src/api/controllers/row/internal.js +2 -2
- package/src/api/controllers/static/index.ts +2 -2
- package/src/api/controllers/view/index.js +2 -2
- package/src/api/controllers/view/utils.js +4 -4
- package/src/db/linkedRows/linkUtils.js +2 -2
- package/src/db/utils.js +38 -38
- package/src/db/views/staticViews.js +4 -9
- package/src/definitions/automations.ts +2 -2
- package/src/definitions/common.ts +14 -65
- package/src/definitions/datasource.ts +5 -250
- package/src/integrations/airtable.ts +16 -16
- package/src/integrations/arangodb.ts +11 -11
- package/src/integrations/base/sql.ts +16 -16
- package/src/integrations/base/sqlTable.ts +1 -6
- package/src/integrations/base/utils.ts +1 -2
- package/src/integrations/couchdb.ts +11 -11
- package/src/integrations/dynamodb.ts +24 -24
- package/src/integrations/elasticsearch.ts +15 -15
- package/src/integrations/firebase.ts +15 -15
- package/src/integrations/googlesheets.ts +19 -18
- package/src/integrations/index.ts +34 -34
- package/src/integrations/microsoftSqlServer.ts +19 -18
- package/src/integrations/mongodb.ts +12 -12
- package/src/integrations/mysql.ts +19 -18
- package/src/integrations/oracle.ts +16 -16
- package/src/integrations/postgres.ts +20 -20
- package/src/integrations/queries/sql.ts +1 -2
- package/src/integrations/redis.ts +10 -14
- package/src/integrations/rest.ts +22 -20
- package/src/integrations/s3.ts +2 -3
- package/src/integrations/snowflake.ts +5 -5
- package/src/integrations/tests/sql.spec.js +7 -7
- package/src/integrations/utils.ts +8 -9
- package/src/middleware/builder.js +2 -2
- package/src/migrations/functions/appUrls.ts +2 -2
- package/src/migrations/functions/backfill/app/queries.ts +3 -2
- package/src/migrations/functions/backfill/app.ts +1 -1
- package/src/migrations/functions/backfill/global/users.ts +1 -1
- package/src/migrations/functions/tests/appUrls.spec.js +3 -3
- package/src/migrations/tests/index.spec.ts +2 -2
- package/src/tests/utilities/TestConfiguration.js +2 -2
- package/src/threads/automation.ts +3 -3
- package/src/utilities/routing/index.js +2 -2
- package/src/utilities/security.js +8 -8
- package/dist/integrations/base/IntegrationBase.js +0 -2
- package/dist/integrations/base/datasourcePlus.js +0 -2
- package/src/integrations/base/IntegrationBase.ts +0 -6
- package/src/integrations/base/datasourcePlus.ts +0 -13
|
@@ -178,7 +178,7 @@ function <span class="fstat-no" title="function not covered" >validate(</span>sc
|
|
|
178
178
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
179
179
|
Code coverage generated by
|
|
180
180
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
181
|
-
at
|
|
181
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
182
182
|
</div>
|
|
183
183
|
<script src="../prettify.js"></script>
|
|
184
184
|
<script>
|
|
@@ -133,7 +133,7 @@ module.exports = function ({ requiresAppId } = <span class="branch-0 cbranch-no"
|
|
|
133
133
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
134
134
|
Code coverage generated by
|
|
135
135
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
136
|
-
at
|
|
136
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
137
137
|
</div>
|
|
138
138
|
<script src="../prettify.js"></script>
|
|
139
139
|
<script>
|
|
@@ -253,7 +253,7 @@ module.exports.bodySubResource = (main, sub) => {
|
|
|
253
253
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
254
254
|
Code coverage generated by
|
|
255
255
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
256
|
-
at
|
|
256
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
257
257
|
</div>
|
|
258
258
|
<script src="../prettify.js"></script>
|
|
259
259
|
<script>
|
|
@@ -100,7 +100,7 @@ module.exports = async (ctx, next) => {
|
|
|
100
100
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
101
101
|
Code coverage generated by
|
|
102
102
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
103
|
-
at
|
|
103
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
104
104
|
</div>
|
|
105
105
|
<script src="../prettify.js"></script>
|
|
106
106
|
<script>
|
|
@@ -91,7 +91,7 @@ exports.isWebhookEndpoint = ctx => {
|
|
|
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 Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
95
95
|
</div>
|
|
96
96
|
<script src="../prettify.js"></script>
|
|
97
97
|
<script>
|
|
@@ -79,7 +79,7 @@ module.exports.budibaseTempDir = budibaseTempDir
|
|
|
79
79
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
80
80
|
Code coverage generated by
|
|
81
81
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
82
|
-
at
|
|
82
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
83
83
|
</div>
|
|
84
84
|
<script src="../prettify.js"></script>
|
|
85
85
|
<script>
|
|
@@ -136,7 +136,7 @@ exports.resolve = function (...args) {
|
|
|
136
136
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
137
137
|
Code coverage generated by
|
|
138
138
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
139
|
-
at
|
|
139
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
140
140
|
</div>
|
|
141
141
|
<script src="../prettify.js"></script>
|
|
142
142
|
<script>
|
|
@@ -502,7 +502,7 @@ module.exports = {
|
|
|
502
502
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
503
503
|
Code coverage generated by
|
|
504
504
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
505
|
-
at
|
|
505
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
506
506
|
</div>
|
|
507
507
|
<script src="../prettify.js"></script>
|
|
508
508
|
<script>
|
|
@@ -445,7 +445,7 @@ exports.getGlobalUsersFromMetadata = async users => {
|
|
|
445
445
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
446
446
|
Code coverage generated by
|
|
447
447
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
448
|
-
at
|
|
448
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
449
449
|
</div>
|
|
450
450
|
<script src="../prettify.js"></script>
|
|
451
451
|
<script>
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
237
237
|
Code coverage generated by
|
|
238
238
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
239
|
-
at
|
|
239
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
240
240
|
</div>
|
|
241
241
|
<script src="../prettify.js"></script>
|
|
242
242
|
<script>
|
|
@@ -562,7 +562,7 @@ exports.convertBookmark = bookmark => {
|
|
|
562
562
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
563
563
|
Code coverage generated by
|
|
564
564
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
565
|
-
at
|
|
565
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
566
566
|
</div>
|
|
567
567
|
<script src="../prettify.js"></script>
|
|
568
568
|
<script>
|
|
@@ -424,7 +424,7 @@ module.exports = InMemoryQueue
|
|
|
424
424
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
425
425
|
Code coverage generated by
|
|
426
426
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
427
|
-
at
|
|
427
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
428
428
|
</div>
|
|
429
429
|
<script src="../../prettify.js"></script>
|
|
430
430
|
<script>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
103
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at
|
|
104
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
103
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at
|
|
104
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -114,13 +114,13 @@
|
|
|
114
114
|
<span class="cline-any cline-neutral"> </span>
|
|
115
115
|
<span class="cline-any cline-yes">28x</span>
|
|
116
116
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">const { createRoutingView } = require("../../db/views/staticViews")
|
|
117
|
-
const {
|
|
117
|
+
const { ViewName, getQueryIndex, UNICODE_MAX } = require("../../db/utils")
|
|
118
118
|
const { getAppDB } = require("@budibase/backend-core/context")
|
|
119
119
|
|
|
120
120
|
exports.getRoutingInfo = async () => {
|
|
121
121
|
const db = getAppDB()
|
|
122
122
|
try {
|
|
123
|
-
const allRouting = await db.query(getQueryIndex(
|
|
123
|
+
const allRouting = await db.query(getQueryIndex(ViewName.ROUTING), {
|
|
124
124
|
startKey: "",
|
|
125
125
|
endKey: UNICODE_MAX,
|
|
126
126
|
})
|
|
@@ -145,7 +145,7 @@ exports.createRoutingView = createRoutingView
|
|
|
145
145
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
146
146
|
Code coverage generated by
|
|
147
147
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
148
|
-
at
|
|
148
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
149
149
|
</div>
|
|
150
150
|
<script src="../../prettify.js"></script>
|
|
151
151
|
<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 Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
120
120
|
</div>
|
|
121
121
|
<script src="../../prettify.js"></script>
|
|
122
122
|
<script>
|
|
@@ -1096,7 +1096,7 @@ exports.cleanupAttachments = async (table, { row, rows, oldRow, oldTable }) =>
|
|
|
1096
1096
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1097
1097
|
Code coverage generated by
|
|
1098
1098
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1099
|
-
at
|
|
1099
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
1100
1100
|
</div>
|
|
1101
1101
|
<script src="../../prettify.js"></script>
|
|
1102
1102
|
<script>
|
|
@@ -346,7 +346,7 @@ exports.processDates = <span class="fstat-no" title="function not covered" >(t</
|
|
|
346
346
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
347
347
|
Code coverage generated by
|
|
348
348
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
349
|
-
at
|
|
349
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
350
350
|
</div>
|
|
351
351
|
<script src="../../prettify.js"></script>
|
|
352
352
|
<script>
|
|
@@ -142,7 +142,7 @@ module.exports = ScriptRunner
|
|
|
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 Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
146
146
|
</div>
|
|
147
147
|
<script src="../prettify.js"></script>
|
|
148
148
|
<script>
|
|
@@ -215,7 +215,7 @@ const {
|
|
|
215
215
|
lowerBuiltinRoleID,
|
|
216
216
|
getBuiltinRoles,
|
|
217
217
|
} = require("@budibase/backend-core/roles")
|
|
218
|
-
const {
|
|
218
|
+
const { DocumentType } = require("../db/utils")
|
|
219
219
|
|
|
220
220
|
const CURRENTLY_SUPPORTED_LEVELS = [
|
|
221
221
|
PermissionLevels.WRITE,
|
|
@@ -224,19 +224,19 @@ const CURRENTLY_SUPPORTED_LEVELS = [
|
|
|
224
224
|
]
|
|
225
225
|
|
|
226
226
|
exports.getPermissionType = resourceId => {
|
|
227
|
-
const docType = Object.values(
|
|
227
|
+
const docType = Object.values(DocumentType).filter(docType =>
|
|
228
228
|
resourceId.startsWith(docType)
|
|
229
229
|
)[0]
|
|
230
230
|
switch (docType) {
|
|
231
|
-
case
|
|
232
|
-
case
|
|
231
|
+
case DocumentType.TABLE:
|
|
232
|
+
case DocumentType.ROW:
|
|
233
233
|
return PermissionTypes.TABLE
|
|
234
|
-
<span class="branch-2 cbranch-no" title="branch not covered" > case
|
|
234
|
+
<span class="branch-2 cbranch-no" title="branch not covered" > case DocumentType.AUTOMATION:</span>
|
|
235
235
|
<span class="cstat-no" title="statement not covered" > return PermissionTypes.AUTOMATION</span>
|
|
236
|
-
<span class="branch-3 cbranch-no" title="branch not covered" > case
|
|
236
|
+
<span class="branch-3 cbranch-no" title="branch not covered" > case DocumentType.WEBHOOK:</span>
|
|
237
237
|
<span class="cstat-no" title="statement not covered" > return PermissionTypes.WEBHOOK</span>
|
|
238
|
-
<span class="branch-4 cbranch-no" title="branch not covered" > case
|
|
239
|
-
<span class="branch-5 cbranch-no" title="branch not covered" > case
|
|
238
|
+
<span class="branch-4 cbranch-no" title="branch not covered" > case DocumentType.QUERY:</span>
|
|
239
|
+
<span class="branch-5 cbranch-no" title="branch not covered" > case DocumentType.DATASOURCE:</span>
|
|
240
240
|
<span class="cstat-no" title="statement not covered" > return PermissionTypes.QUERY</span>
|
|
241
241
|
<span class="branch-6 cbranch-no" title="branch not covered" > default:</span>
|
|
242
242
|
// views don't have an ID, will end up here
|
|
@@ -283,7 +283,7 @@ exports.CURRENTLY_SUPPORTED_LEVELS = CURRENTLY_SUPPORTED_LEVELS
|
|
|
283
283
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
284
284
|
Code coverage generated by
|
|
285
285
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
286
|
-
at
|
|
286
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
287
287
|
</div>
|
|
288
288
|
<script src="../prettify.js"></script>
|
|
289
289
|
<script>
|
|
@@ -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 Thu Aug 11 2022 14:28:59 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 Thu Aug 11 2022 14:28:59 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 Thu Aug 11 2022 14:28:59 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 Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
128
128
|
</div>
|
|
129
129
|
<script src="../../prettify.js"></script>
|
|
130
130
|
<script>
|
|
@@ -205,7 +205,7 @@ exports.publicApiUserFix = ctx => {
|
|
|
205
205
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
206
206
|
Code coverage generated by
|
|
207
207
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
208
|
-
at
|
|
208
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
209
209
|
</div>
|
|
210
210
|
<script src="../prettify.js"></script>
|
|
211
211
|
<script>
|
|
@@ -535,7 +535,7 @@ exports.getChecklist = <span class="fstat-no" title="function not covered" >as</
|
|
|
535
535
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
536
536
|
Code coverage generated by
|
|
537
537
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
538
|
-
at
|
|
538
|
+
at Thu Aug 11 2022 14:28:59 GMT+0000 (Coordinated Universal Time)
|
|
539
539
|
</div>
|
|
540
540
|
<script src="../prettify.js"></script>
|
|
541
541
|
<script>
|
|
@@ -26,7 +26,7 @@ const ping = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
26
26
|
switch (body.source) {
|
|
27
27
|
case types_1.PingSource.APP: {
|
|
28
28
|
const db = backend_core_2.context.getAppDB({ skip_setup: true });
|
|
29
|
-
const appInfo = yield db.get(utils_1.
|
|
29
|
+
const appInfo = yield db.get(utils_1.DocumentType.APP_METADATA);
|
|
30
30
|
let appId = backend_core_2.context.getAppId();
|
|
31
31
|
if ((0, utils_1.isDevAppID)(appId)) {
|
|
32
32
|
yield backend_core_1.events.serve.servedAppPreview(appInfo, body.timezone);
|
|
@@ -174,7 +174,7 @@ const fetchAppDefinition = (ctx) => __awaiter(void 0, void 0, void 0, function*
|
|
|
174
174
|
exports.fetchAppDefinition = fetchAppDefinition;
|
|
175
175
|
const fetchAppPackage = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
176
176
|
const db = backend_core_1.context.getAppDB();
|
|
177
|
-
const application = yield db.get(utils_1.
|
|
177
|
+
const application = yield db.get(utils_1.DocumentType.APP_METADATA);
|
|
178
178
|
const layouts = yield getLayouts();
|
|
179
179
|
let screens = yield getScreens();
|
|
180
180
|
// Only filter screens if the user is not a builder
|
|
@@ -212,14 +212,14 @@ const performAppCreate = (ctx) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
212
212
|
let _rev;
|
|
213
213
|
try {
|
|
214
214
|
// if template there will be an existing doc
|
|
215
|
-
const existing = yield db.get(utils_1.
|
|
215
|
+
const existing = yield db.get(utils_1.DocumentType.APP_METADATA);
|
|
216
216
|
_rev = existing._rev;
|
|
217
217
|
}
|
|
218
218
|
catch (err) {
|
|
219
219
|
// nothing to do
|
|
220
220
|
}
|
|
221
221
|
const newApplication = {
|
|
222
|
-
_id: utils_1.
|
|
222
|
+
_id: utils_1.DocumentType.APP_METADATA,
|
|
223
223
|
_rev,
|
|
224
224
|
appId: instance._id,
|
|
225
225
|
type: "app",
|
|
@@ -342,7 +342,7 @@ exports.update = update;
|
|
|
342
342
|
const updateClient = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
343
343
|
// Get current app version
|
|
344
344
|
const db = backend_core_1.context.getAppDB();
|
|
345
|
-
const application = yield db.get(utils_1.
|
|
345
|
+
const application = yield db.get(utils_1.DocumentType.APP_METADATA);
|
|
346
346
|
const currentVersion = application.version;
|
|
347
347
|
// Update client library and manifest
|
|
348
348
|
if (!environment_1.default.isTest()) {
|
|
@@ -364,7 +364,7 @@ exports.updateClient = updateClient;
|
|
|
364
364
|
const revertClient = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
365
365
|
// Check app can be reverted
|
|
366
366
|
const db = backend_core_1.context.getAppDB();
|
|
367
|
-
const application = yield db.get(utils_1.
|
|
367
|
+
const application = yield db.get(utils_1.DocumentType.APP_METADATA);
|
|
368
368
|
if (!application.revertableVersion) {
|
|
369
369
|
ctx.throw(400, "There is no version to revert to");
|
|
370
370
|
}
|
|
@@ -392,7 +392,7 @@ const destroyApp = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
392
392
|
appId = getProdAppID(appId);
|
|
393
393
|
}
|
|
394
394
|
const db = isUnpublish ? backend_core_1.context.getProdAppDB() : backend_core_1.context.getAppDB();
|
|
395
|
-
const app = yield db.get(utils_1.
|
|
395
|
+
const app = yield db.get(utils_1.DocumentType.APP_METADATA);
|
|
396
396
|
const result = yield db.destroy();
|
|
397
397
|
if (isUnpublish) {
|
|
398
398
|
yield pro_1.quotas.removePublishedApp();
|
|
@@ -472,7 +472,7 @@ const sync = (ctx, next) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
472
472
|
try {
|
|
473
473
|
yield replication.replicate({
|
|
474
474
|
filter: function (doc) {
|
|
475
|
-
return doc._id !== utils_1.
|
|
475
|
+
return doc._id !== utils_1.DocumentType.APP_METADATA;
|
|
476
476
|
},
|
|
477
477
|
});
|
|
478
478
|
}
|
|
@@ -497,7 +497,7 @@ exports.sync = sync;
|
|
|
497
497
|
const updateAppPackage = (appPackage, appId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
498
498
|
return backend_core_1.context.doInAppContext(appId, () => __awaiter(void 0, void 0, void 0, function* () {
|
|
499
499
|
const db = backend_core_1.context.getAppDB();
|
|
500
|
-
const application = yield db.get(utils_1.
|
|
500
|
+
const application = yield db.get(utils_1.DocumentType.APP_METADATA);
|
|
501
501
|
const newAppPackage = Object.assign(Object.assign({}, application), appPackage);
|
|
502
502
|
if (appPackage._rev !== application._rev) {
|
|
503
503
|
newAppPackage._rev = application._rev;
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
const actions = require("../../automations/actions");
|
|
12
12
|
const triggers = require("../../automations/triggers");
|
|
13
|
-
const { getAutomationParams, generateAutomationID,
|
|
13
|
+
const { getAutomationParams, generateAutomationID, DocumentType, } = require("../../db/utils");
|
|
14
14
|
const { checkForWebhooks, updateTestHistory, removeDeprecated, } = require("../../automations/utils");
|
|
15
15
|
const { deleteEntityMetadata } = require("../../utilities");
|
|
16
16
|
const { MetadataTypes } = require("../../constants");
|
|
@@ -174,7 +174,7 @@ exports.clearLogError = function (ctx) {
|
|
|
174
174
|
const { automationId, appId } = ctx.request.body;
|
|
175
175
|
yield doInAppContext(appId, () => __awaiter(this, void 0, void 0, function* () {
|
|
176
176
|
const db = getProdAppDB();
|
|
177
|
-
const metadata = yield db.get(
|
|
177
|
+
const metadata = yield db.get(DocumentType.APP_METADATA);
|
|
178
178
|
if (!automationId) {
|
|
179
179
|
delete metadata.automationErrors;
|
|
180
180
|
}
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
const { streamBackup } = require("../../utilities/fileSystem");
|
|
12
12
|
const { events, context } = require("@budibase/backend-core");
|
|
13
|
-
const {
|
|
13
|
+
const { DocumentType } = require("../../db/utils");
|
|
14
14
|
exports.exportAppDump = function (ctx) {
|
|
15
15
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
16
|
let { appId, excludeRows } = ctx.query;
|
|
@@ -21,7 +21,7 @@ exports.exportAppDump = function (ctx) {
|
|
|
21
21
|
ctx.body = yield streamBackup(appId, excludeRows);
|
|
22
22
|
yield context.doInAppContext(appId, () => __awaiter(this, void 0, void 0, function* () {
|
|
23
23
|
const appDb = context.getAppDB();
|
|
24
|
-
const app = yield appDb.get(
|
|
24
|
+
const app = yield appDb.get(DocumentType.APP_METADATA);
|
|
25
25
|
yield events.app.exported(app);
|
|
26
26
|
}));
|
|
27
27
|
});
|
|
@@ -14,7 +14,7 @@ const { exportDB, sendTempFile, readFileSync, } = require("../../utilities/fileS
|
|
|
14
14
|
const { stringToReadStream } = require("../../utilities");
|
|
15
15
|
const { getGlobalDBName, getGlobalDB, } = require("@budibase/backend-core/tenancy");
|
|
16
16
|
const { create } = require("./application");
|
|
17
|
-
const { getDocParams,
|
|
17
|
+
const { getDocParams, DocumentType, isDevAppID } = require("../../db/utils");
|
|
18
18
|
function createApp(appName, appImport) {
|
|
19
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
20
|
const ctx = {
|
|
@@ -34,7 +34,7 @@ exports.exportApps = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
34
34
|
}
|
|
35
35
|
const apps = yield getAllApps({ all: true });
|
|
36
36
|
const globalDBString = yield exportDB(getGlobalDBName(), {
|
|
37
|
-
filter: doc => !doc._id.startsWith(
|
|
37
|
+
filter: doc => !doc._id.startsWith(DocumentType.USER),
|
|
38
38
|
});
|
|
39
39
|
let allDBs = {
|
|
40
40
|
global: globalDBString,
|
|
@@ -94,7 +94,7 @@ exports.importApps = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
94
94
|
yield createApp(appName, appImport);
|
|
95
95
|
}
|
|
96
96
|
// if there are any users make sure to remove them
|
|
97
|
-
let users = yield getAllDocType(globalDb,
|
|
97
|
+
let users = yield getAllDocType(globalDb, DocumentType.USER);
|
|
98
98
|
let userDeletionPromises = [];
|
|
99
99
|
for (let user of users) {
|
|
100
100
|
userDeletionPromises.push(globalDb.remove(user._id, user._rev));
|
|
@@ -8,13 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
const {
|
|
11
|
+
const { DocumentType } = require("../../db/utils");
|
|
12
12
|
const { getComponentLibraryManifest } = require("../../utilities/fileSystem");
|
|
13
13
|
const { getAppDB } = require("@budibase/backend-core/context");
|
|
14
14
|
exports.fetchAppComponentDefinitions = function (ctx) {
|
|
15
15
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
16
|
const db = getAppDB();
|
|
17
|
-
const app = yield db.get(
|
|
17
|
+
const app = yield db.get(DocumentType.APP_METADATA);
|
|
18
18
|
let componentManifests = yield Promise.all(app.componentLibraries.map((library) => __awaiter(this, void 0, void 0, function* () {
|
|
19
19
|
let manifest = yield getComponentLibraryManifest(library);
|
|
20
20
|
return {
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
const { generateDatasourceID, getDatasourceParams, getQueryParams,
|
|
11
|
+
const { generateDatasourceID, getDatasourceParams, getQueryParams, DocumentType, BudibaseInternalDB, getTableParams, } = require("../../db/utils");
|
|
12
12
|
const { BuildSchemaErrors, InvalidColumns } = require("../../constants");
|
|
13
13
|
const { integrations } = require("../../integrations");
|
|
14
14
|
const { getDatasourceAndQuery } = require("./row/utils");
|
|
@@ -111,7 +111,7 @@ exports.save = function (ctx) {
|
|
|
111
111
|
const db = getAppDB();
|
|
112
112
|
const plus = ctx.request.body.datasource.plus;
|
|
113
113
|
const fetchSchema = ctx.request.body.fetchSchema;
|
|
114
|
-
const datasource = Object.assign({ _id: generateDatasourceID({ plus }), type: plus ?
|
|
114
|
+
const datasource = Object.assign({ _id: generateDatasourceID({ plus }), type: plus ? DocumentType.DATASOURCE_PLUS : DocumentType.DATASOURCE }, ctx.request.body.datasource);
|
|
115
115
|
let schemaError = null;
|
|
116
116
|
if (fetchSchema) {
|
|
117
117
|
const { tables, error } = yield buildSchemaHelper(datasource);
|
|
@@ -52,10 +52,10 @@ function storeDeploymentHistory(deployment) {
|
|
|
52
52
|
let deploymentDoc;
|
|
53
53
|
try {
|
|
54
54
|
// theres only one deployment doc per app database
|
|
55
|
-
deploymentDoc = yield db.get(utils_1.
|
|
55
|
+
deploymentDoc = yield db.get(utils_1.DocumentType.DEPLOYMENTS);
|
|
56
56
|
}
|
|
57
57
|
catch (err) {
|
|
58
|
-
deploymentDoc = { _id: utils_1.
|
|
58
|
+
deploymentDoc = { _id: utils_1.DocumentType.DEPLOYMENTS, history: {} };
|
|
59
59
|
}
|
|
60
60
|
const deploymentId = deploymentJSON._id;
|
|
61
61
|
// first time deployment
|
|
@@ -104,7 +104,7 @@ function deployApp(deployment) {
|
|
|
104
104
|
yield replication.replicate();
|
|
105
105
|
console.log("replication complete.. replacing app meta doc");
|
|
106
106
|
const db = (0, context_1.getProdAppDB)();
|
|
107
|
-
const appDoc = yield db.get(utils_1.
|
|
107
|
+
const appDoc = yield db.get(utils_1.DocumentType.APP_METADATA);
|
|
108
108
|
deployment.appUrl = appDoc.url;
|
|
109
109
|
appDoc.appId = productionAppId;
|
|
110
110
|
appDoc.instance._id = productionAppId;
|
|
@@ -133,7 +133,7 @@ function fetchDeployments(ctx) {
|
|
|
133
133
|
return __awaiter(this, void 0, void 0, function* () {
|
|
134
134
|
try {
|
|
135
135
|
const db = (0, context_1.getAppDB)();
|
|
136
|
-
const deploymentDoc = yield db.get(utils_1.
|
|
136
|
+
const deploymentDoc = yield db.get(utils_1.DocumentType.DEPLOYMENTS);
|
|
137
137
|
const { updated, deployments } = yield checkAllDeployments(deploymentDoc);
|
|
138
138
|
if (updated) {
|
|
139
139
|
yield db.put(deployments);
|
|
@@ -150,7 +150,7 @@ function deploymentProgress(ctx) {
|
|
|
150
150
|
return __awaiter(this, void 0, void 0, function* () {
|
|
151
151
|
try {
|
|
152
152
|
const db = (0, context_1.getAppDB)();
|
|
153
|
-
const deploymentDoc = yield db.get(utils_1.
|
|
153
|
+
const deploymentDoc = yield db.get(utils_1.DocumentType.DEPLOYMENTS);
|
|
154
154
|
ctx.body = deploymentDoc[ctx.params.deploymentId];
|
|
155
155
|
}
|
|
156
156
|
catch (err) {
|
|
@@ -162,7 +162,7 @@ exports.deploymentProgress = deploymentProgress;
|
|
|
162
162
|
const isFirstDeploy = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
163
163
|
try {
|
|
164
164
|
const db = (0, context_1.getProdAppDB)();
|
|
165
|
-
yield db.get(utils_1.
|
|
165
|
+
yield db.get(utils_1.DocumentType.APP_METADATA);
|
|
166
166
|
}
|
|
167
167
|
catch (e) {
|
|
168
168
|
if (e.status === 404) {
|
|
@@ -14,7 +14,7 @@ const { checkSlashesInUrl } = require("../../utilities");
|
|
|
14
14
|
const { request } = require("../../utilities/workerRequests");
|
|
15
15
|
const { clearLock } = require("../../utilities/redis");
|
|
16
16
|
const { Replication, getProdAppID } = require("@budibase/backend-core/db");
|
|
17
|
-
const {
|
|
17
|
+
const { DocumentType } = require("../../db/utils");
|
|
18
18
|
const { app: appCache } = require("@budibase/backend-core/cache");
|
|
19
19
|
const { getProdAppDB, getAppDB } = require("@budibase/backend-core/context");
|
|
20
20
|
const { events } = require("@budibase/backend-core");
|
|
@@ -85,7 +85,7 @@ exports.revert = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
85
85
|
if (info.error) {
|
|
86
86
|
throw info.error;
|
|
87
87
|
}
|
|
88
|
-
const deploymentDoc = yield db.get(
|
|
88
|
+
const deploymentDoc = yield db.get(DocumentType.DEPLOYMENTS);
|
|
89
89
|
if (!deploymentDoc.history ||
|
|
90
90
|
Object.keys(deploymentDoc.history).length === 0) {
|
|
91
91
|
throw new Error("No deployments for app");
|
|
@@ -105,7 +105,7 @@ exports.revert = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
105
105
|
}
|
|
106
106
|
// update appID in reverted app to be dev version again
|
|
107
107
|
const db = getAppDB();
|
|
108
|
-
const appDoc = yield db.get(
|
|
108
|
+
const appDoc = yield db.get(DocumentType.APP_METADATA);
|
|
109
109
|
appDoc.appId = appId;
|
|
110
110
|
appDoc.instance._id = appId;
|
|
111
111
|
yield db.put(appDoc);
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
const { cloneDeep } = require("lodash");
|
|
12
12
|
const { definitions } = require("../../integrations");
|
|
13
|
-
const {
|
|
13
|
+
const { SourceName } = require("@budibase/types");
|
|
14
14
|
const googlesheets = require("../../integrations/googlesheets");
|
|
15
15
|
const { featureFlags } = require("@budibase/backend-core");
|
|
16
16
|
exports.fetch = function (ctx) {
|
|
@@ -19,7 +19,7 @@ exports.fetch = function (ctx) {
|
|
|
19
19
|
const defs = cloneDeep(definitions);
|
|
20
20
|
// for google sheets integration google verification
|
|
21
21
|
if (featureFlags.isEnabled(featureFlags.FeatureFlag.GOOGLE_SHEETS)) {
|
|
22
|
-
defs[
|
|
22
|
+
defs[SourceName.GOOGLE_SHEETS] = googlesheets.schema;
|
|
23
23
|
}
|
|
24
24
|
ctx.body = defs;
|
|
25
25
|
});
|
|
@@ -20,7 +20,7 @@ function addRev(body, tableId) {
|
|
|
20
20
|
}
|
|
21
21
|
let id = body._id;
|
|
22
22
|
if (body._id.startsWith(utils_2.APP_PREFIX)) {
|
|
23
|
-
id = utils_2.
|
|
23
|
+
id = utils_2.DocumentType.APP_METADATA;
|
|
24
24
|
}
|
|
25
25
|
const db = getAppDB();
|
|
26
26
|
const dbDoc = yield db.get(id);
|