@budibase/server 2.1.32-alpha.5 → 2.1.32-alpha.7
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.192baaa3.js → index.e0fdcf54.js} +184 -184
- package/builder/index.html +1 -1
- package/coverage/clover.xml +3112 -3177
- package/coverage/coverage-final.json +105 -106
- package/coverage/lcov-report/index.html +145 -145
- package/coverage/lcov-report/src/api/controllers/analytics.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/{apikeys.js.html → apikeys.ts.html} +19 -19
- package/coverage/lcov-report/src/api/controllers/application.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/auth.ts.html +3 -3
- package/coverage/lcov-report/src/api/controllers/{automation.js.html → automation.ts.html} +68 -68
- package/coverage/lcov-report/src/api/controllers/backup.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/{cloud.js.html → cloud.ts.html} +40 -40
- package/coverage/lcov-report/src/api/controllers/component.ts.html +6 -3
- package/coverage/lcov-report/src/api/controllers/{datasource.js.html → datasource.ts.html} +100 -79
- package/coverage/lcov-report/src/api/controllers/deploy/{Deployment.js.html → Deployment.ts.html} +30 -21
- package/coverage/lcov-report/src/api/controllers/deploy/index.html +6 -6
- package/coverage/lcov-report/src/api/controllers/deploy/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/dev.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/index.html +108 -108
- package/coverage/lcov-report/src/api/controllers/integration.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/{layout.js.html → layout.ts.html} +19 -19
- package/coverage/lcov-report/src/api/controllers/{metadata.js.html → metadata.ts.html} +19 -16
- package/coverage/lcov-report/src/api/controllers/migrations.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/{permission.js.html → permission.ts.html} +73 -64
- package/coverage/lcov-report/src/api/controllers/plugin/file.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/plugin/github.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/plugin/index.html +11 -11
- package/coverage/lcov-report/src/api/controllers/plugin/index.ts.html +10 -13
- package/coverage/lcov-report/src/api/controllers/plugin/npm.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/plugin/uploaders.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/plugin/url.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/plugin/utils.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/applications.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/mapping/applications.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/mapping/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/mapping/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/mapping/queries.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/mapping/rows.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/mapping/tables.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/mapping/users.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/queries.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/rows.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/tables.ts.html +3 -3
- package/coverage/lcov-report/src/api/controllers/public/users.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/utils.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/import/index.html +11 -11
- package/coverage/lcov-report/src/api/controllers/query/import/index.ts.html +8 -11
- package/coverage/lcov-report/src/api/controllers/query/import/sources/base/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/import/sources/base/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/import/sources/base/openapi.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/import/sources/curl.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/import/sources/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/import/sources/openapi2.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/import/sources/openapi3.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/index.html +2 -2
- package/coverage/lcov-report/src/api/controllers/query/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/{validation.js.html → validation.ts.html} +10 -10
- package/coverage/lcov-report/src/api/controllers/{role.js.html → role.ts.html} +37 -49
- package/coverage/lcov-report/src/api/controllers/{routing.js.html → routing.ts.html} +58 -49
- package/coverage/lcov-report/src/api/controllers/row/ExternalRequest.ts.html +6 -18
- package/coverage/lcov-report/src/api/controllers/row/external.js.html +4 -4
- package/coverage/lcov-report/src/api/controllers/row/index.html +35 -35
- package/coverage/lcov-report/src/api/controllers/row/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/internal.js.html +17 -20
- package/coverage/lcov-report/src/api/controllers/row/{internalSearch.js.html → internalSearch.ts.html} +175 -103
- package/coverage/lcov-report/src/api/controllers/row/{staticFormula.js.html → staticFormula.ts.html} +62 -47
- package/coverage/lcov-report/src/api/controllers/row/{utils.js.html → utils.ts.html} +57 -36
- package/coverage/lcov-report/src/api/controllers/screen.ts.html +29 -17
- package/coverage/lcov-report/src/api/controllers/{script.js.html → script.ts.html} +10 -7
- package/coverage/lcov-report/src/api/controllers/static/index.html +10 -10
- package/coverage/lcov-report/src/api/controllers/static/index.ts.html +15 -27
- package/coverage/lcov-report/src/api/controllers/table/{bulkFormula.js.html → bulkFormula.ts.html} +89 -47
- package/coverage/lcov-report/src/api/controllers/table/{external.js.html → external.ts.html} +192 -87
- package/coverage/lcov-report/src/api/controllers/table/index.html +39 -39
- package/coverage/lcov-report/src/api/controllers/table/{index.js.html → index.ts.html} +28 -28
- package/coverage/lcov-report/src/api/controllers/table/internal.ts.html +3 -6
- package/coverage/lcov-report/src/api/controllers/table/utils.ts.html +18 -18
- package/coverage/lcov-report/src/api/controllers/{templates.js.html → templates.ts.html} +27 -18
- package/coverage/lcov-report/src/api/controllers/{user.js.html → user.ts.html} +72 -78
- package/coverage/lcov-report/src/api/controllers/view/{exporters.js.html → exporters.ts.html} +13 -7
- package/coverage/lcov-report/src/api/controllers/view/index.html +21 -21
- package/coverage/lcov-report/src/api/controllers/view/{index.js.html → index.ts.html} +68 -41
- package/coverage/lcov-report/src/api/controllers/view/{utils.js.html → utils.ts.html} +54 -36
- package/coverage/lcov-report/src/api/controllers/view/viewBuilder.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/webhook.ts.html +1 -1
- package/coverage/lcov-report/src/api/index.html +14 -14
- package/coverage/lcov-report/src/api/{index.js.html → index.ts.html} +28 -49
- package/coverage/lcov-report/src/api/routes/{analytics.js.html → analytics.ts.html} +7 -7
- package/coverage/lcov-report/src/api/routes/{apikeys.js.html → apikeys.ts.html} +11 -11
- package/coverage/lcov-report/src/api/routes/application.ts.html +35 -11
- package/coverage/lcov-report/src/api/routes/auth.ts.html +3 -3
- package/coverage/lcov-report/src/api/routes/{automation.js.html → automation.ts.html} +41 -35
- package/coverage/lcov-report/src/api/routes/backup.ts.html +18 -6
- package/coverage/lcov-report/src/api/routes/{deploy.js.html → cloud.ts.html} +18 -15
- package/coverage/lcov-report/src/api/routes/{component.js.html → component.ts.html} +10 -10
- package/coverage/lcov-report/src/api/routes/{datasource.js.html → datasource.ts.html} +53 -26
- package/coverage/lcov-report/src/api/routes/deploy.ts.html +148 -0
- package/coverage/lcov-report/src/api/routes/{dev.js.html → dev.ts.html} +54 -18
- package/coverage/lcov-report/src/api/routes/index.html +41 -41
- package/coverage/lcov-report/src/api/routes/index.ts.html +3 -3
- package/coverage/lcov-report/src/api/routes/integration.ts.html +133 -0
- package/coverage/lcov-report/src/api/routes/{layout.js.html → layout.ts.html} +11 -11
- package/coverage/lcov-report/src/api/routes/{metadata.js.html → metadata.ts.html} +17 -17
- package/coverage/lcov-report/src/api/routes/{migrations.js.html → migrations.ts.html} +12 -12
- package/coverage/lcov-report/src/api/routes/{permission.js.html → permission.ts.html} +41 -17
- package/coverage/lcov-report/src/api/routes/plugin.ts.html +32 -8
- package/coverage/lcov-report/src/api/routes/public/applications.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/middleware/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/middleware/mapper.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/queries.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/rows.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/tables.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/users.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/utils/Endpoint.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/utils/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/{query.js.html → query.ts.html} +24 -33
- package/coverage/lcov-report/src/{utilities/routing/index.js.html → api/routes/role.ts.html} +32 -35
- package/coverage/lcov-report/src/api/routes/{routing.js.html → routing.ts.html} +10 -10
- package/coverage/lcov-report/src/api/routes/row.ts.html +8 -14
- package/coverage/lcov-report/src/api/routes/{screen.js.html → screen.ts.html} +29 -14
- package/coverage/lcov-report/src/api/routes/{script.js.html → script.ts.html} +10 -10
- package/coverage/lcov-report/src/api/routes/static.ts.html +9 -18
- package/coverage/lcov-report/src/api/routes/{table.js.html → table.ts.html} +16 -25
- package/coverage/lcov-report/src/api/routes/{templates.js.html → templates.ts.html} +11 -11
- package/coverage/lcov-report/src/api/routes/tests/utilities/TestFunctions.ts.html +12 -18
- package/coverage/lcov-report/src/api/routes/tests/utilities/index.html +10 -10
- package/coverage/lcov-report/src/api/routes/tests/utilities/index.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/{user.js.html → user.ts.html} +14 -20
- package/coverage/lcov-report/src/api/routes/utils/index.html +6 -6
- package/coverage/lcov-report/src/api/routes/utils/{validators.js.html → validators.ts.html} +39 -51
- package/coverage/lcov-report/src/api/routes/{view.js.html → view.ts.html} +33 -24
- package/coverage/lcov-report/src/api/routes/webhook.ts.html +3 -3
- package/coverage/lcov-report/src/app.ts.html +9 -12
- package/coverage/lcov-report/src/automations/actions.js.html +1 -1
- package/coverage/lcov-report/src/automations/automationUtils.js.html +1 -1
- package/coverage/lcov-report/src/automations/bullboard.js.html +1 -1
- package/coverage/lcov-report/src/automations/index.html +10 -10
- package/coverage/lcov-report/src/automations/index.js.html +1 -1
- package/coverage/lcov-report/src/automations/logging/index.html +1 -1
- package/coverage/lcov-report/src/automations/logging/index.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/bash.js.html +1 -1
- package/coverage/lcov-report/src/automations/steps/createRow.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/delay.js.html +1 -1
- package/coverage/lcov-report/src/automations/steps/deleteRow.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/discord.js.html +1 -1
- package/coverage/lcov-report/src/automations/steps/executeQuery.js.html +1 -1
- package/coverage/lcov-report/src/automations/steps/executeScript.js.html +1 -1
- package/coverage/lcov-report/src/automations/steps/filter.js.html +1 -1
- package/coverage/lcov-report/src/automations/steps/index.html +1 -1
- package/coverage/lcov-report/src/automations/steps/integromat.js.html +1 -1
- package/coverage/lcov-report/src/automations/steps/loop.js.html +1 -1
- package/coverage/lcov-report/src/automations/steps/outgoingWebhook.js.html +1 -1
- package/coverage/lcov-report/src/automations/steps/queryRows.js.html +1 -1
- package/coverage/lcov-report/src/automations/steps/sendSmtpEmail.js.html +1 -1
- package/coverage/lcov-report/src/automations/steps/serverLog.js.html +1 -1
- package/coverage/lcov-report/src/automations/steps/slack.js.html +1 -1
- package/coverage/lcov-report/src/automations/steps/updateRow.js.html +1 -1
- package/coverage/lcov-report/src/automations/steps/utils.js.html +1 -1
- package/coverage/lcov-report/src/automations/steps/zapier.js.html +1 -1
- package/coverage/lcov-report/src/automations/tests/utilities/index.html +1 -1
- package/coverage/lcov-report/src/automations/tests/utilities/index.js.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/app.js.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/cron.js.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/index.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/index.js.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/rowDeleted.js.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/rowSaved.js.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/rowUpdated.js.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/webhook.js.html +1 -1
- package/coverage/lcov-report/src/automations/triggers.js.html +11 -14
- package/coverage/lcov-report/src/automations/utils.ts.html +1 -1
- package/coverage/lcov-report/src/constants/index.html +5 -5
- package/coverage/lcov-report/src/constants/index.js.html +7 -13
- package/coverage/lcov-report/src/constants/layouts.js.html +1 -1
- package/coverage/lcov-report/src/constants/screens.js.html +3 -3
- package/coverage/lcov-report/src/db/defaultData/datasource_bb_default.js.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/employeeImport.js.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/expensesImport.js.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/index.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/inventoryImport.js.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/jobsImport.js.html +1 -1
- package/coverage/lcov-report/src/db/dynamoClient.js.html +1 -1
- package/coverage/lcov-report/src/db/inMemoryView.js.html +4 -4
- package/coverage/lcov-report/src/db/index.html +1 -1
- package/coverage/lcov-report/src/db/index.js.html +1 -1
- package/coverage/lcov-report/src/db/linkedRows/LinkController.js.html +3 -3
- package/coverage/lcov-report/src/db/linkedRows/LinkDocument.js.html +1 -1
- package/coverage/lcov-report/src/db/linkedRows/index.html +1 -1
- package/coverage/lcov-report/src/db/linkedRows/index.js.html +3 -3
- package/coverage/lcov-report/src/db/linkedRows/linkUtils.js.html +4 -4
- package/coverage/lcov-report/src/db/newid.js.html +1 -1
- package/coverage/lcov-report/src/db/utils.ts.html +2 -2
- package/coverage/lcov-report/src/definitions/automations.ts.html +1 -1
- package/coverage/lcov-report/src/definitions/datasource.ts.html +1 -1
- package/coverage/lcov-report/src/definitions/index.html +1 -1
- package/coverage/lcov-report/src/environment.js.html +1 -1
- package/coverage/lcov-report/src/events/AutomationEmitter.js.html +1 -1
- package/coverage/lcov-report/src/events/index.html +1 -1
- package/coverage/lcov-report/src/events/index.js.html +1 -1
- package/coverage/lcov-report/src/events/utils.js.html +1 -1
- package/coverage/lcov-report/src/index.html +17 -32
- package/coverage/lcov-report/src/index.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/airtable.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/arangodb.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/base/index.html +1 -1
- package/coverage/lcov-report/src/integrations/base/query.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/base/sql.ts.html +2 -2
- package/coverage/lcov-report/src/integrations/base/sqlTable.ts.html +2 -2
- package/coverage/lcov-report/src/integrations/base/utils.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/couchdb.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/dynamodb.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/elasticsearch.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/firebase.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/googlesheets.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/index.html +4 -4
- package/coverage/lcov-report/src/integrations/index.ts.html +58 -46
- package/coverage/lcov-report/src/integrations/microsoftSqlServer.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/mongodb.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/mysql.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/oracle.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/postgres.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/queries/index.html +1 -1
- package/coverage/lcov-report/src/integrations/queries/sql.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/redis.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/rest.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/s3.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/snowflake.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/tests/TestConfiguration.js.html +1 -1
- package/coverage/lcov-report/src/integrations/tests/index.html +1 -1
- package/coverage/lcov-report/src/integrations/utils.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/appInfo.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/authorized.ts.html +30 -51
- package/coverage/lcov-report/src/middleware/builder.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/currentapp.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/index.html +10 -10
- package/coverage/lcov-report/src/middleware/joi-validator.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/publicApi.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/resourceId.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/selfhost.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/utils.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/appUrls.ts.html +3 -3
- package/coverage/lcov-report/src/migrations/functions/backfill/app/automations.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/app/datasources.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/app/index.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/app/layouts.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/app/queries.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/app/roles.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/app/screens.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/app/tables.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/app.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/global/configs.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/global/index.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/global/quotas.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/global/users.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/global.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/index.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/index.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/installation.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/index.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/syncQuotas.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/index.html +9 -9
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/index.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncApps.ts.html +7 -10
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncPlugins.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncRows.ts.html +7 -10
- package/coverage/lcov-report/src/migrations/functions/userEmailViewCasing.ts.html +4 -4
- package/coverage/lcov-report/src/migrations/index.html +1 -1
- package/coverage/lcov-report/src/migrations/index.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/tests/helpers.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/tests/index.html +1 -1
- package/coverage/lcov-report/src/migrations/tests/structures.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/app/automations/index.html +1 -1
- package/coverage/lcov-report/src/sdk/app/automations/index.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/app/automations/webhook.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/app/backups/constants.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/app/backups/exports.ts.html +16 -10
- package/coverage/lcov-report/src/sdk/app/backups/imports.ts.html +9 -21
- package/coverage/lcov-report/src/sdk/app/backups/index.html +16 -16
- package/coverage/lcov-report/src/sdk/app/backups/index.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/app/backups/statistics.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/app/tables/index.html +1 -1
- package/coverage/lcov-report/src/sdk/app/tables/index.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/index.html +1 -1
- package/coverage/lcov-report/src/sdk/index.ts.html +1 -1
- package/coverage/lcov-report/src/startup.ts.html +3 -3
- package/coverage/lcov-report/src/tests/utilities/TestConfiguration.js.html +61 -49
- package/coverage/lcov-report/src/tests/utilities/controllers.js.html +1 -1
- package/coverage/lcov-report/src/tests/utilities/index.html +15 -15
- package/coverage/lcov-report/src/tests/utilities/index.js.html +1 -1
- package/coverage/lcov-report/src/tests/utilities/structures.js.html +9 -12
- package/coverage/lcov-report/src/threads/automation.ts.html +20 -23
- package/coverage/lcov-report/src/threads/index.html +24 -24
- package/coverage/lcov-report/src/threads/index.ts.html +1 -1
- package/coverage/lcov-report/src/threads/query.ts.html +18 -33
- package/coverage/lcov-report/src/threads/utils.ts.html +10 -13
- package/coverage/lcov-report/src/utilities/{budibaseDir.js.html → budibaseDir.ts.html} +5 -5
- package/coverage/lcov-report/src/utilities/centralPath.js.html +1 -1
- package/coverage/lcov-report/src/utilities/csvParser.js.html +1 -1
- package/coverage/lcov-report/src/utilities/fileSystem/clientLibrary.js.html +13 -13
- package/coverage/lcov-report/src/utilities/fileSystem/index.html +5 -20
- package/coverage/lcov-report/src/utilities/fileSystem/index.js.html +16 -16
- package/coverage/lcov-report/src/utilities/fileSystem/processor.js.html +1 -1
- package/coverage/lcov-report/src/utilities/global.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/index.html +44 -44
- package/coverage/lcov-report/src/utilities/{index.js.html → index.ts.html} +68 -44
- package/coverage/lcov-report/src/utilities/plugins.js.html +1 -1
- package/coverage/lcov-report/src/utilities/queue/inMemoryQueue.js.html +1 -1
- package/coverage/lcov-report/src/utilities/queue/index.html +1 -1
- package/coverage/lcov-report/src/utilities/{redis.js.html → redis.ts.html} +36 -33
- package/coverage/lcov-report/src/utilities/routing/index.html +6 -6
- package/coverage/lcov-report/src/utilities/routing/index.ts.html +181 -0
- package/coverage/lcov-report/src/utilities/rowProcessor/index.html +38 -23
- package/coverage/lcov-report/src/utilities/rowProcessor/{index.js.html → index.ts.html} +106 -337
- package/coverage/lcov-report/src/utilities/rowProcessor/map.js.html +370 -0
- package/coverage/lcov-report/src/utilities/rowProcessor/{utils.js.html → utils.ts.html} +43 -31
- package/coverage/lcov-report/src/utilities/scriptRunner.js.html +1 -1
- package/coverage/lcov-report/src/utilities/{security.js.html → security.ts.html} +49 -67
- package/coverage/lcov-report/src/utilities/statusCodes.js.html +1 -1
- package/coverage/lcov-report/src/utilities/usageQuota/index.html +18 -18
- package/coverage/lcov-report/src/utilities/usageQuota/{rows.js.html → rows.ts.html} +27 -39
- package/coverage/lcov-report/src/utilities/usageQuota/usageQuoteReset.js.html +1 -1
- package/coverage/lcov-report/src/utilities/{users.js.html → users.ts.html} +22 -28
- package/coverage/lcov-report/src/utilities/{workerRequests.js.html → workerRequests.ts.html} +69 -54
- package/coverage/lcov-report/src/watch.ts.html +8 -11
- package/coverage/lcov-report/src/websocket.ts.html +1 -1
- package/coverage/lcov.info +5519 -5768
- package/dist/api/controllers/apikeys.js +12 -9
- package/dist/api/controllers/automation.js +104 -84
- package/dist/api/controllers/cloud.js +84 -71
- package/dist/api/controllers/component.js +4 -2
- package/dist/api/controllers/datasource.js +125 -111
- package/dist/api/controllers/deploy/Deployment.js +10 -6
- package/dist/api/controllers/layout.js +18 -15
- package/dist/api/controllers/metadata.js +51 -37
- package/dist/api/controllers/permission.js +52 -43
- package/dist/api/controllers/plugin/index.js +6 -7
- package/dist/api/controllers/public/tables.js +29 -9
- package/dist/api/controllers/query/import/index.js +1 -2
- package/dist/api/controllers/query/validation.js +41 -33
- package/dist/api/controllers/role.js +29 -27
- package/dist/api/controllers/routing.js +71 -58
- package/dist/api/controllers/row/ExternalRequest.js +6 -7
- package/dist/api/controllers/row/external.js +3 -3
- package/dist/api/controllers/row/internal.js +11 -12
- package/dist/api/controllers/row/internalSearch.js +95 -80
- package/dist/api/controllers/row/staticFormula.js +85 -75
- package/dist/api/controllers/row/utils.js +118 -84
- package/dist/api/controllers/screen.js +81 -66
- package/dist/api/controllers/script.js +13 -6
- package/dist/api/controllers/static/index.js +9 -11
- package/dist/api/controllers/table/bulkFormula.js +47 -35
- package/dist/api/controllers/table/external.js +67 -54
- package/dist/api/controllers/table/index.js +66 -33
- package/dist/api/controllers/table/internal.js +1 -2
- package/dist/api/controllers/table/utils.js +8 -9
- package/dist/api/controllers/templates.js +17 -10
- package/dist/api/controllers/user.js +82 -70
- package/dist/api/controllers/view/exporters.js +8 -4
- package/dist/api/controllers/view/index.js +201 -153
- package/dist/api/controllers/view/utils.js +151 -121
- package/dist/api/index.js +38 -34
- package/dist/api/routes/analytics.js +29 -3
- package/dist/api/routes/apikeys.js +33 -7
- package/dist/api/routes/application.js +8 -9
- package/dist/api/routes/auth.js +1 -2
- package/dist/api/routes/automation.js +46 -20
- package/dist/api/routes/backup.js +3 -4
- package/dist/api/routes/cloud.js +32 -6
- package/dist/api/routes/component.js +32 -6
- package/dist/api/routes/datasource.js +39 -13
- package/dist/api/routes/deploy.js +34 -8
- package/dist/api/routes/dev.js +36 -10
- package/dist/api/routes/integration.js +10 -7
- package/dist/api/routes/layout.js +33 -7
- package/dist/api/routes/metadata.js +36 -10
- package/dist/api/routes/migrations.js +32 -6
- package/dist/api/routes/permission.js +38 -12
- package/dist/api/routes/plugin.js +5 -5
- package/dist/api/routes/query.js +42 -15
- package/dist/api/routes/role.js +36 -10
- package/dist/api/routes/routing.js +32 -6
- package/dist/api/routes/row.js +2 -1
- package/dist/api/routes/screen.js +35 -9
- package/dist/api/routes/script.js +32 -6
- package/dist/api/routes/static.js +9 -9
- package/dist/api/routes/table.js +40 -13
- package/dist/api/routes/templates.js +33 -7
- package/dist/api/routes/tests/utilities/TestFunctions.js +6 -8
- package/dist/api/routes/user.js +40 -13
- package/dist/api/routes/utils/validators.js +142 -126
- package/dist/api/routes/view.js +38 -12
- package/dist/api/routes/webhook.js +1 -2
- package/dist/app.js +3 -4
- package/dist/automations/triggers.js +5 -6
- package/dist/constants/index.js +3 -5
- package/dist/constants/screens.js +2 -2
- package/dist/db/inMemoryView.js +3 -3
- package/dist/db/linkedRows/LinkController.js +2 -2
- package/dist/db/linkedRows/index.js +2 -2
- package/dist/db/linkedRows/linkUtils.js +3 -3
- package/dist/db/views/staticViews.js +4 -4
- package/dist/integrations/index.js +15 -6
- package/dist/middleware/authorized.js +22 -21
- package/dist/migrations/functions/appUrls.js +2 -2
- package/dist/migrations/functions/usageQuotas/syncApps.js +3 -4
- package/dist/migrations/functions/usageQuotas/syncRows.js +3 -4
- package/dist/migrations/functions/userEmailViewCasing.js +3 -3
- package/dist/package.json +6 -6
- package/dist/sdk/app/backups/exports.js +1 -2
- package/dist/sdk/app/backups/imports.js +2 -3
- package/dist/startup.js +4 -4
- package/dist/tests/utilities/TestConfiguration.js +27 -35
- package/dist/tests/utilities/structures.js +3 -4
- package/dist/threads/automation.js +15 -16
- package/dist/threads/query.js +17 -19
- package/dist/threads/utils.js +11 -9
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/budibaseDir.js +4 -2
- package/dist/utilities/fileSystem/clientLibrary.js +12 -12
- package/dist/utilities/fileSystem/index.js +3 -3
- package/dist/utilities/index.js +102 -75
- package/dist/utilities/redis.js +100 -65
- package/dist/utilities/routing/index.js +27 -23
- package/dist/utilities/rowProcessor/index.js +124 -191
- package/dist/utilities/rowProcessor/map.js +96 -0
- package/dist/utilities/rowProcessor/utils.js +35 -26
- package/dist/utilities/security.js +39 -35
- package/dist/utilities/usageQuota/rows.js +56 -49
- package/dist/utilities/users.js +31 -28
- package/dist/utilities/workerRequests.js +115 -82
- package/dist/watch.js +1 -2
- package/package.json +7 -7
- package/scripts/exportAppTemplate.js +2 -2
- package/src/api/controllers/{apikeys.js → apikeys.ts} +10 -10
- package/src/api/controllers/auth.ts +2 -2
- package/src/api/controllers/{automation.js → automation.ts} +48 -48
- package/src/api/controllers/{cloud.js → cloud.ts} +24 -24
- package/src/api/controllers/component.ts +2 -1
- package/src/api/controllers/{datasource.js → datasource.ts} +55 -48
- package/src/api/controllers/deploy/{Deployment.js → Deployment.ts} +13 -10
- package/src/api/controllers/{layout.js → layout.ts} +8 -8
- package/src/api/controllers/{metadata.js → metadata.ts} +11 -10
- package/src/api/controllers/{permission.js → permission.ts} +49 -46
- package/src/api/controllers/plugin/index.ts +4 -5
- package/src/api/controllers/public/tables.ts +2 -2
- package/src/api/controllers/query/import/index.ts +2 -3
- package/src/api/controllers/query/{validation.js → validation.ts} +7 -7
- package/src/api/controllers/{role.js → role.ts} +21 -25
- package/src/api/controllers/{routing.js → routing.ts} +37 -34
- package/src/api/controllers/row/ExternalRequest.ts +4 -8
- package/src/api/controllers/row/external.js +3 -3
- package/src/api/controllers/row/internal.js +11 -12
- package/src/api/controllers/row/{internalSearch.js → internalSearch.ts} +92 -68
- package/src/api/controllers/row/{staticFormula.js → staticFormula.ts} +28 -23
- package/src/api/controllers/row/{utils.js → utils.ts} +25 -18
- package/src/api/controllers/screen.ts +10 -6
- package/src/api/controllers/script.ts +12 -0
- package/src/api/controllers/static/index.ts +9 -13
- package/src/api/controllers/table/{bulkFormula.js → bulkFormula.ts} +39 -25
- package/src/api/controllers/table/{external.js → external.ts} +86 -51
- package/src/api/controllers/table/{index.js → index.ts} +17 -17
- package/src/api/controllers/table/internal.ts +1 -2
- package/src/api/controllers/table/utils.ts +10 -10
- package/src/api/controllers/{templates.js → templates.ts} +10 -7
- package/src/api/controllers/{user.js → user.ts} +47 -49
- package/src/api/controllers/view/{exporters.js → exporters.ts} +5 -3
- package/src/api/controllers/view/{index.js → index.ts} +36 -27
- package/src/api/controllers/view/{utils.js → utils.ts} +26 -20
- package/src/api/{index.js → index.ts} +15 -22
- package/src/api/routes/analytics.ts +9 -0
- package/src/api/routes/apikeys.ts +12 -0
- package/src/api/routes/application.ts +17 -9
- package/src/api/routes/auth.ts +2 -2
- package/src/api/routes/automation.ts +87 -0
- package/src/api/routes/backup.ts +8 -4
- package/src/api/routes/cloud.ts +18 -0
- package/src/api/routes/component.ts +14 -0
- package/src/api/routes/datasource.ts +60 -0
- package/src/api/routes/deploy.ts +21 -0
- package/src/api/routes/dev.ts +38 -0
- package/src/api/routes/integration.ts +16 -0
- package/src/api/routes/layout.ts +16 -0
- package/src/api/routes/{metadata.js → metadata.ts} +13 -13
- package/src/api/routes/migrations.ts +14 -0
- package/src/api/routes/permission.ts +41 -0
- package/src/api/routes/plugin.ts +14 -6
- package/src/api/routes/{query.js → query.ts} +17 -20
- package/src/api/routes/role.ts +24 -0
- package/src/api/routes/routing.ts +14 -0
- package/src/api/routes/row.ts +3 -5
- package/src/api/routes/screen.ts +23 -0
- package/src/api/routes/script.ts +10 -0
- package/src/api/routes/static.ts +4 -7
- package/src/api/routes/{table.js → table.ts} +9 -12
- package/src/api/routes/templates.ts +16 -0
- package/src/api/routes/tests/backup.spec.js +9 -1
- package/src/api/routes/tests/permissions.spec.js +2 -1
- package/src/api/routes/tests/role.spec.js +3 -5
- package/src/api/routes/tests/routing.spec.js +2 -1
- package/src/api/routes/tests/row.spec.js +3 -4
- package/src/api/routes/tests/user.spec.js +2 -1
- package/src/api/routes/tests/utilities/TestFunctions.ts +6 -8
- package/src/api/routes/{user.js → user.ts} +7 -9
- package/src/api/routes/utils/{validators.js → validators.ts} +33 -37
- package/src/api/routes/view.ts +34 -0
- package/src/api/routes/webhook.ts +2 -2
- package/src/app.ts +3 -4
- package/src/automations/triggers.js +5 -6
- package/src/constants/index.js +3 -5
- package/src/constants/screens.js +2 -2
- package/src/db/inMemoryView.js +3 -3
- package/src/db/linkedRows/LinkController.js +2 -2
- package/src/db/linkedRows/index.js +2 -2
- package/src/db/linkedRows/linkUtils.js +3 -3
- package/src/db/utils.ts +1 -1
- package/src/db/views/staticViews.js +4 -4
- package/src/integrations/base/sql.ts +1 -1
- package/src/integrations/base/sqlTable.ts +1 -1
- package/src/integrations/index.ts +45 -41
- package/src/middleware/authorized.ts +21 -28
- package/src/middleware/tests/authorized.spec.js +5 -6
- package/src/migrations/functions/appUrls.ts +2 -2
- package/src/migrations/functions/tests/appUrls.spec.js +4 -4
- package/src/migrations/functions/tests/userEmailViewCasing.spec.js +14 -9
- package/src/migrations/functions/usageQuotas/syncApps.ts +3 -4
- package/src/migrations/functions/usageQuotas/syncRows.ts +3 -4
- package/src/migrations/functions/usageQuotas/tests/syncRows.spec.ts +7 -7
- package/src/migrations/functions/userEmailViewCasing.ts +3 -3
- package/src/sdk/app/backups/exports.ts +5 -3
- package/src/sdk/app/backups/imports.ts +3 -7
- package/src/startup.ts +2 -2
- package/src/tests/utilities/TestConfiguration.js +39 -35
- package/src/tests/utilities/structures.js +3 -4
- package/src/threads/automation.ts +14 -15
- package/src/threads/query.ts +11 -16
- package/src/threads/utils.ts +4 -5
- package/src/utilities/budibaseDir.ts +3 -0
- package/src/utilities/fileSystem/clientLibrary.js +12 -12
- package/src/utilities/fileSystem/index.js +8 -8
- package/src/utilities/{index.js → index.ts} +40 -32
- package/src/utilities/{redis.js → redis.ts} +21 -20
- package/src/utilities/routing/index.ts +32 -0
- package/src/utilities/rowProcessor/{index.js → index.ts} +65 -142
- package/src/utilities/rowProcessor/map.js +95 -0
- package/src/utilities/rowProcessor/{utils.js → utils.ts} +19 -15
- package/src/utilities/security.ts +65 -0
- package/src/utilities/usageQuota/{rows.js → rows.ts} +14 -18
- package/src/utilities/{users.js → users.ts} +11 -13
- package/src/utilities/{workerRequests.js → workerRequests.ts} +43 -38
- package/src/watch.ts +2 -3
- package/coverage/lcov-report/src/api/routes/cloud.js.html +0 -127
- package/coverage/lcov-report/src/api/routes/integration.js.html +0 -121
- package/coverage/lcov-report/src/api/routes/role.js.html +0 -130
- package/coverage/lcov-report/src/module.d.ts.html +0 -127
- package/coverage/lcov-report/src/utilities/fileSystem/utilities.js.html +0 -193
- package/dist/utilities/fileSystem/utilities.js +0 -22
- package/src/api/controllers/script.js +0 -11
- package/src/api/routes/analytics.js +0 -9
- package/src/api/routes/apikeys.js +0 -12
- package/src/api/routes/automation.js +0 -85
- package/src/api/routes/cloud.js +0 -14
- package/src/api/routes/component.js +0 -14
- package/src/api/routes/datasource.js +0 -51
- package/src/api/routes/deploy.js +0 -17
- package/src/api/routes/dev.js +0 -26
- package/src/api/routes/integration.js +0 -12
- package/src/api/routes/layout.js +0 -16
- package/src/api/routes/migrations.js +0 -14
- package/src/api/routes/permission.js +0 -33
- package/src/api/routes/role.js +0 -15
- package/src/api/routes/routing.js +0 -14
- package/src/api/routes/screen.js +0 -18
- package/src/api/routes/script.js +0 -10
- package/src/api/routes/templates.js +0 -16
- package/src/api/routes/view.js +0 -31
- package/src/module.d.ts +0 -14
- package/src/utilities/budibaseDir.js +0 -3
- package/src/utilities/fileSystem/utilities.js +0 -36
- package/src/utilities/routing/index.js +0 -25
- package/src/utilities/security.js +0 -71
|
@@ -8,20 +8,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.query = exports.find = exports.destroy = exports.save = exports.update = exports.buildSchemaFromDb = exports.fetch = void 0;
|
|
13
|
+
const utils_1 = require("../../db/utils");
|
|
14
|
+
const internal_1 = require("./table/internal");
|
|
15
|
+
const constants_1 = require("../../constants");
|
|
16
|
+
const integrations_1 = require("../../integrations");
|
|
17
|
+
const utils_2 = require("./row/utils");
|
|
18
|
+
const utils_3 = require("../../threads/utils");
|
|
19
|
+
const backend_core_1 = require("@budibase/backend-core");
|
|
20
|
+
function fetch(ctx) {
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
22
|
// Get internal tables
|
|
23
|
-
const db = getAppDB();
|
|
24
|
-
const internalTables = yield db.allDocs(getTableParams(null, {
|
|
23
|
+
const db = backend_core_1.context.getAppDB();
|
|
24
|
+
const internalTables = yield db.allDocs((0, utils_1.getTableParams)(null, {
|
|
25
25
|
include_docs: true,
|
|
26
26
|
}));
|
|
27
27
|
const internal = internalTables.rows.reduce((acc, row) => {
|
|
@@ -30,9 +30,9 @@ exports.fetch = function (ctx) {
|
|
|
30
30
|
acc[sourceId].push(row.doc);
|
|
31
31
|
return acc;
|
|
32
32
|
}, {});
|
|
33
|
-
const bbInternalDb = Object.assign({}, BudibaseInternalDB);
|
|
33
|
+
const bbInternalDb = Object.assign({}, utils_1.BudibaseInternalDB);
|
|
34
34
|
// Get external datasources
|
|
35
|
-
const datasources = (yield db.allDocs(getDatasourceParams(null, {
|
|
35
|
+
const datasources = (yield db.allDocs((0, utils_1.getDatasourceParams)(null, {
|
|
36
36
|
include_docs: true,
|
|
37
37
|
}))).rows.map(row => row.doc);
|
|
38
38
|
const allDatasources = [bbInternalDb, ...datasources];
|
|
@@ -41,16 +41,17 @@ exports.fetch = function (ctx) {
|
|
|
41
41
|
// strip secrets from response so they don't show in the network request
|
|
42
42
|
delete datasource.config.auth;
|
|
43
43
|
}
|
|
44
|
-
if (datasource.type ===
|
|
44
|
+
if (datasource.type === backend_core_1.db.BUDIBASE_DATASOURCE_TYPE) {
|
|
45
45
|
datasource.entities = internal[datasource._id];
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
ctx.body = [bbInternalDb, ...datasources];
|
|
49
49
|
});
|
|
50
|
-
}
|
|
51
|
-
exports.
|
|
50
|
+
}
|
|
51
|
+
exports.fetch = fetch;
|
|
52
|
+
function buildSchemaFromDb(ctx) {
|
|
52
53
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
const db = getAppDB();
|
|
54
|
+
const db = backend_core_1.context.getAppDB();
|
|
54
55
|
const datasource = yield db.get(ctx.params.datasourceId);
|
|
55
56
|
const tablesFilter = ctx.request.body.tablesFilter;
|
|
56
57
|
let { tables, error } = yield buildSchemaHelper(datasource);
|
|
@@ -59,7 +60,7 @@ exports.buildSchemaFromDb = function (ctx) {
|
|
|
59
60
|
datasource.entities = {};
|
|
60
61
|
}
|
|
61
62
|
for (let key in tables) {
|
|
62
|
-
if (tablesFilter.some(filter => filter.toLowerCase() === key.toLowerCase())) {
|
|
63
|
+
if (tablesFilter.some((filter) => filter.toLowerCase() === key.toLowerCase())) {
|
|
63
64
|
datasource.entities[key] = tables[key];
|
|
64
65
|
}
|
|
65
66
|
}
|
|
@@ -76,13 +77,14 @@ exports.buildSchemaFromDb = function (ctx) {
|
|
|
76
77
|
}
|
|
77
78
|
ctx.body = response;
|
|
78
79
|
});
|
|
79
|
-
}
|
|
80
|
+
}
|
|
81
|
+
exports.buildSchemaFromDb = buildSchemaFromDb;
|
|
80
82
|
/**
|
|
81
83
|
* Make sure all datasource entities have a display name selected
|
|
82
84
|
*/
|
|
83
|
-
|
|
85
|
+
function setDefaultDisplayColumns(datasource) {
|
|
84
86
|
//
|
|
85
|
-
for (let entity of Object.values(datasource.entities)) {
|
|
87
|
+
for (let entity of Object.values(datasource.entities || {})) {
|
|
86
88
|
if (entity.primaryDisplay) {
|
|
87
89
|
continue;
|
|
88
90
|
}
|
|
@@ -91,37 +93,40 @@ const setDefaultDisplayColumns = datasource => {
|
|
|
91
93
|
entity.primaryDisplay = notAutoColumn.name;
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
|
-
}
|
|
96
|
+
}
|
|
95
97
|
/**
|
|
96
98
|
* Check for variables that have been updated or removed and invalidate them.
|
|
97
99
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
existing.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
100
|
+
function invalidateVariables(existingDatasource, updatedDatasource) {
|
|
101
|
+
var _a, _b;
|
|
102
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
const existingVariables = (_a = existingDatasource.config) === null || _a === void 0 ? void 0 : _a.dynamicVariables;
|
|
104
|
+
const updatedVariables = (_b = updatedDatasource.config) === null || _b === void 0 ? void 0 : _b.dynamicVariables;
|
|
105
|
+
const toInvalidate = [];
|
|
106
|
+
if (!existingVariables) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (!updatedVariables) {
|
|
110
|
+
// invalidate all
|
|
111
|
+
toInvalidate.push(...existingVariables);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
// invaldate changed / removed
|
|
115
|
+
existingVariables.forEach((existing) => {
|
|
116
|
+
const unchanged = updatedVariables.find((updated) => existing.name === updated.name &&
|
|
117
|
+
existing.queryId === updated.queryId &&
|
|
118
|
+
existing.value === updated.value);
|
|
119
|
+
if (!unchanged) {
|
|
120
|
+
toInvalidate.push(existing);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
yield (0, utils_3.invalidateDynamicVariables)(toInvalidate);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function update(ctx) {
|
|
123
128
|
return __awaiter(this, void 0, void 0, function* () {
|
|
124
|
-
const db = getAppDB();
|
|
129
|
+
const db = backend_core_1.context.getAppDB();
|
|
125
130
|
const datasourceId = ctx.params.datasourceId;
|
|
126
131
|
let datasource = yield db.get(datasourceId);
|
|
127
132
|
const auth = datasource.config.auth;
|
|
@@ -132,11 +137,11 @@ exports.update = function (ctx) {
|
|
|
132
137
|
datasource.config.auth = auth;
|
|
133
138
|
}
|
|
134
139
|
const response = yield db.put(datasource);
|
|
135
|
-
yield events.datasource.updated(datasource);
|
|
140
|
+
yield backend_core_1.events.datasource.updated(datasource);
|
|
136
141
|
datasource._rev = response.rev;
|
|
137
142
|
// Drain connection pools when configuration is changed
|
|
138
143
|
if (datasource.source) {
|
|
139
|
-
const source = yield getIntegration(datasource.source);
|
|
144
|
+
const source = yield (0, integrations_1.getIntegration)(datasource.source);
|
|
140
145
|
if (source && source.pool) {
|
|
141
146
|
yield source.pool.end();
|
|
142
147
|
}
|
|
@@ -145,13 +150,14 @@ exports.update = function (ctx) {
|
|
|
145
150
|
ctx.message = "Datasource saved successfully.";
|
|
146
151
|
ctx.body = { datasource };
|
|
147
152
|
});
|
|
148
|
-
}
|
|
149
|
-
exports.
|
|
153
|
+
}
|
|
154
|
+
exports.update = update;
|
|
155
|
+
function save(ctx) {
|
|
150
156
|
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
-
const db = getAppDB();
|
|
157
|
+
const db = backend_core_1.context.getAppDB();
|
|
152
158
|
const plus = ctx.request.body.datasource.plus;
|
|
153
159
|
const fetchSchema = ctx.request.body.fetchSchema;
|
|
154
|
-
const datasource = Object.assign({ _id: generateDatasourceID({ plus }), type: plus ? DocumentType.DATASOURCE_PLUS : DocumentType.DATASOURCE }, ctx.request.body.datasource);
|
|
160
|
+
const datasource = Object.assign({ _id: (0, utils_1.generateDatasourceID)({ plus }), type: plus ? utils_1.DocumentType.DATASOURCE_PLUS : utils_1.DocumentType.DATASOURCE }, ctx.request.body.datasource);
|
|
155
161
|
let schemaError = null;
|
|
156
162
|
if (fetchSchema) {
|
|
157
163
|
const { tables, error } = yield buildSchemaHelper(datasource);
|
|
@@ -160,11 +166,11 @@ exports.save = function (ctx) {
|
|
|
160
166
|
setDefaultDisplayColumns(datasource);
|
|
161
167
|
}
|
|
162
168
|
const dbResp = yield db.put(datasource);
|
|
163
|
-
yield events.datasource.created(datasource);
|
|
169
|
+
yield backend_core_1.events.datasource.created(datasource);
|
|
164
170
|
datasource._rev = dbResp.rev;
|
|
165
171
|
// Drain connection pools when configuration is changed
|
|
166
172
|
if (datasource.source) {
|
|
167
|
-
const source = yield getIntegration(datasource.source);
|
|
173
|
+
const source = yield (0, integrations_1.getIntegration)(datasource.source);
|
|
168
174
|
if (source && source.pool) {
|
|
169
175
|
yield source.pool.end();
|
|
170
176
|
}
|
|
@@ -175,41 +181,44 @@ exports.save = function (ctx) {
|
|
|
175
181
|
}
|
|
176
182
|
ctx.body = response;
|
|
177
183
|
});
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
184
|
+
}
|
|
185
|
+
exports.save = save;
|
|
186
|
+
function destroyInternalTablesBySourceId(datasourceId) {
|
|
187
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
188
|
+
const db = backend_core_1.context.getAppDB();
|
|
189
|
+
// Get all internal tables
|
|
190
|
+
const internalTables = yield db.allDocs((0, utils_1.getTableParams)(null, {
|
|
191
|
+
include_docs: true,
|
|
192
|
+
}));
|
|
193
|
+
// Filter by datasource and return the docs.
|
|
194
|
+
const datasourceTableDocs = internalTables.rows.reduce((acc, table) => {
|
|
195
|
+
if (table.doc.sourceId == datasourceId) {
|
|
196
|
+
acc.push(table.doc);
|
|
197
|
+
}
|
|
198
|
+
return acc;
|
|
199
|
+
}, []);
|
|
200
|
+
// Destroy the tables.
|
|
201
|
+
for (const table of datasourceTableDocs) {
|
|
202
|
+
yield (0, internal_1.destroy)({
|
|
203
|
+
params: {
|
|
204
|
+
tableId: table._id,
|
|
205
|
+
},
|
|
206
|
+
});
|
|
189
207
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
for (const table of datasourceTableDocs) {
|
|
194
|
-
yield tableDestroy({
|
|
195
|
-
params: {
|
|
196
|
-
tableId: table._id,
|
|
197
|
-
},
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
exports.destroy = function (ctx) {
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
function destroy(ctx) {
|
|
202
211
|
return __awaiter(this, void 0, void 0, function* () {
|
|
203
|
-
const db = getAppDB();
|
|
212
|
+
const db = backend_core_1.context.getAppDB();
|
|
204
213
|
const datasourceId = ctx.params.datasourceId;
|
|
205
214
|
const datasource = yield db.get(datasourceId);
|
|
206
215
|
// Delete all queries for the datasource
|
|
207
|
-
if (datasource.type ===
|
|
216
|
+
if (datasource.type === backend_core_1.db.BUDIBASE_DATASOURCE_TYPE) {
|
|
208
217
|
yield destroyInternalTablesBySourceId(datasourceId);
|
|
209
218
|
}
|
|
210
219
|
else {
|
|
211
|
-
const queries = yield db.allDocs(getQueryParams(datasourceId, null));
|
|
212
|
-
yield db.bulkDocs(queries.rows.map(row => ({
|
|
220
|
+
const queries = yield db.allDocs((0, utils_1.getQueryParams)(datasourceId, null));
|
|
221
|
+
yield db.bulkDocs(queries.rows.map((row) => ({
|
|
213
222
|
_id: row.id,
|
|
214
223
|
_rev: row.value.rev,
|
|
215
224
|
_deleted: true,
|
|
@@ -217,29 +226,32 @@ exports.destroy = function (ctx) {
|
|
|
217
226
|
}
|
|
218
227
|
// delete the datasource
|
|
219
228
|
yield db.remove(datasourceId, ctx.params.revId);
|
|
220
|
-
yield events.datasource.deleted(datasource);
|
|
229
|
+
yield backend_core_1.events.datasource.deleted(datasource);
|
|
221
230
|
ctx.message = `Datasource deleted.`;
|
|
222
231
|
ctx.status = 200;
|
|
223
232
|
});
|
|
224
|
-
}
|
|
225
|
-
exports.
|
|
233
|
+
}
|
|
234
|
+
exports.destroy = destroy;
|
|
235
|
+
function find(ctx) {
|
|
226
236
|
return __awaiter(this, void 0, void 0, function* () {
|
|
227
|
-
const database = getAppDB();
|
|
237
|
+
const database = backend_core_1.context.getAppDB();
|
|
228
238
|
ctx.body = yield database.get(ctx.params.datasourceId);
|
|
229
239
|
});
|
|
230
|
-
}
|
|
240
|
+
}
|
|
241
|
+
exports.find = find;
|
|
231
242
|
// dynamic query functionality
|
|
232
|
-
|
|
243
|
+
function query(ctx) {
|
|
233
244
|
return __awaiter(this, void 0, void 0, function* () {
|
|
234
245
|
const queryJson = ctx.request.body;
|
|
235
246
|
try {
|
|
236
|
-
ctx.body = yield getDatasourceAndQuery(queryJson);
|
|
247
|
+
ctx.body = yield (0, utils_2.getDatasourceAndQuery)(queryJson);
|
|
237
248
|
}
|
|
238
249
|
catch (err) {
|
|
239
250
|
ctx.throw(400, err);
|
|
240
251
|
}
|
|
241
252
|
});
|
|
242
|
-
}
|
|
253
|
+
}
|
|
254
|
+
exports.query = query;
|
|
243
255
|
function getErrorTables(errors, errorType) {
|
|
244
256
|
return Object.entries(errors)
|
|
245
257
|
.filter(entry => entry[1] === errorType)
|
|
@@ -255,23 +267,25 @@ function updateError(error, newError, tables) {
|
|
|
255
267
|
error += `${newError} ${tables.join(", ")}`;
|
|
256
268
|
return error;
|
|
257
269
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
270
|
+
function buildSchemaHelper(datasource) {
|
|
271
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
272
|
+
const Connector = yield (0, integrations_1.getIntegration)(datasource.source);
|
|
273
|
+
// Connect to the DB and build the schema
|
|
274
|
+
const connector = new Connector(datasource.config);
|
|
275
|
+
yield connector.buildSchema(datasource._id, datasource.entities);
|
|
276
|
+
const errors = connector.schemaErrors;
|
|
277
|
+
let error = null;
|
|
278
|
+
if (errors && Object.keys(errors).length > 0) {
|
|
279
|
+
const noKey = getErrorTables(errors, constants_1.BuildSchemaErrors.NO_KEY);
|
|
280
|
+
const invalidCol = getErrorTables(errors, constants_1.BuildSchemaErrors.INVALID_COLUMN);
|
|
281
|
+
if (noKey.length) {
|
|
282
|
+
error = updateError(error, "No primary key constraint found for the following:", noKey);
|
|
283
|
+
}
|
|
284
|
+
if (invalidCol.length) {
|
|
285
|
+
const invalidCols = Object.values(constants_1.InvalidColumns).join(", ");
|
|
286
|
+
error = updateError(error, `Cannot use columns ${invalidCols} found in following:`, invalidCol);
|
|
287
|
+
}
|
|
274
288
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
289
|
+
return { tables: connector.tables, error };
|
|
290
|
+
});
|
|
291
|
+
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const newid_1 = __importDefault(require("../../../db/newid"));
|
|
7
|
+
const backend_core_1 = require("@budibase/backend-core");
|
|
4
8
|
/**
|
|
5
9
|
* This is used to pass around information about the deployment that is occurring
|
|
6
10
|
*/
|
|
7
11
|
class Deployment {
|
|
8
12
|
constructor(id = null) {
|
|
9
|
-
this._id = id ||
|
|
13
|
+
this._id = id || (0, newid_1.default)();
|
|
10
14
|
}
|
|
11
15
|
setVerification(verification) {
|
|
12
16
|
if (!verification) {
|
|
@@ -17,7 +21,7 @@ class Deployment {
|
|
|
17
21
|
getVerification() {
|
|
18
22
|
return this.verification;
|
|
19
23
|
}
|
|
20
|
-
setStatus(status, err
|
|
24
|
+
setStatus(status, err) {
|
|
21
25
|
this.status = status;
|
|
22
26
|
if (err) {
|
|
23
27
|
this.err = err;
|
|
@@ -34,7 +38,7 @@ class Deployment {
|
|
|
34
38
|
getJSON() {
|
|
35
39
|
const obj = {
|
|
36
40
|
_id: this._id,
|
|
37
|
-
appId: getAppId(),
|
|
41
|
+
appId: backend_core_1.context.getAppId(),
|
|
38
42
|
status: this.status,
|
|
39
43
|
};
|
|
40
44
|
if (this.err) {
|
|
@@ -46,4 +50,4 @@ class Deployment {
|
|
|
46
50
|
return obj;
|
|
47
51
|
}
|
|
48
52
|
}
|
|
49
|
-
|
|
53
|
+
exports.default = Deployment;
|
|
@@ -8,39 +8,42 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.destroy = exports.save = void 0;
|
|
13
|
+
const layouts_1 = require("../../constants/layouts");
|
|
14
|
+
const utils_1 = require("../../db/utils");
|
|
15
|
+
const backend_core_1 = require("@budibase/backend-core");
|
|
16
|
+
function save(ctx) {
|
|
16
17
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const db = getAppDB();
|
|
18
|
+
const db = backend_core_1.context.getAppDB();
|
|
18
19
|
let layout = ctx.request.body;
|
|
19
20
|
if (!layout.props) {
|
|
20
|
-
layout = Object.assign(Object.assign({}, EMPTY_LAYOUT), layout);
|
|
21
|
+
layout = Object.assign(Object.assign({}, layouts_1.EMPTY_LAYOUT), layout);
|
|
21
22
|
layout.props._instanceName = layout.name;
|
|
22
23
|
}
|
|
23
|
-
layout._id = layout._id || generateLayoutID();
|
|
24
|
+
layout._id = layout._id || (0, utils_1.generateLayoutID)();
|
|
24
25
|
const response = yield db.put(layout);
|
|
25
|
-
yield events.layout.created(layout);
|
|
26
|
+
yield backend_core_1.events.layout.created(layout);
|
|
26
27
|
layout._rev = response.rev;
|
|
27
28
|
ctx.body = layout;
|
|
28
29
|
ctx.status = 200;
|
|
29
30
|
});
|
|
30
|
-
}
|
|
31
|
-
exports.
|
|
31
|
+
}
|
|
32
|
+
exports.save = save;
|
|
33
|
+
function destroy(ctx) {
|
|
32
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const db = getAppDB();
|
|
35
|
+
const db = backend_core_1.context.getAppDB();
|
|
34
36
|
const layoutId = ctx.params.layoutId, layoutRev = ctx.params.layoutRev;
|
|
35
|
-
const layoutsUsedByScreens = (yield db.allDocs(getScreenParams(null, {
|
|
37
|
+
const layoutsUsedByScreens = (yield db.allDocs((0, utils_1.getScreenParams)(null, {
|
|
36
38
|
include_docs: true,
|
|
37
39
|
}))).rows.map(element => element.doc.layoutId);
|
|
38
40
|
if (layoutsUsedByScreens.includes(layoutId)) {
|
|
39
41
|
ctx.throw(400, "Cannot delete a layout that's being used by a screen");
|
|
40
42
|
}
|
|
41
43
|
yield db.remove(layoutId, layoutRev);
|
|
42
|
-
yield events.layout.deleted(layoutId);
|
|
44
|
+
yield backend_core_1.events.layout.deleted(layoutId);
|
|
43
45
|
ctx.body = { message: "Layout deleted successfully" };
|
|
44
46
|
ctx.status = 200;
|
|
45
47
|
});
|
|
46
|
-
}
|
|
48
|
+
}
|
|
49
|
+
exports.destroy = destroy;
|
|
@@ -8,42 +8,56 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
ctx.body = {
|
|
31
|
-
message: "Metadata deleted successfully",
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
exports.getMetadata = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
-
const { type, entityId } = ctx.params;
|
|
36
|
-
const db = getAppDB();
|
|
37
|
-
const id = generateMetadataID(type, entityId);
|
|
38
|
-
try {
|
|
39
|
-
ctx.body = yield db.get(id);
|
|
40
|
-
}
|
|
41
|
-
catch (err) {
|
|
42
|
-
if (err.status === 404) {
|
|
43
|
-
ctx.body = {};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getMetadata = exports.deleteMetadata = exports.saveMetadata = exports.getTypes = void 0;
|
|
13
|
+
const constants_1 = require("../../constants");
|
|
14
|
+
const utils_1 = require("../../db/utils");
|
|
15
|
+
const utilities_1 = require("../../utilities");
|
|
16
|
+
const backend_core_1 = require("@budibase/backend-core");
|
|
17
|
+
function getTypes(ctx) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
ctx.body = {
|
|
20
|
+
types: constants_1.MetadataTypes,
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
exports.getTypes = getTypes;
|
|
25
|
+
function saveMetadata(ctx) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const { type, entityId } = ctx.params;
|
|
28
|
+
if (type === constants_1.MetadataTypes.AUTOMATION_TEST_HISTORY) {
|
|
29
|
+
ctx.throw(400, "Cannot save automation history type");
|
|
44
30
|
}
|
|
45
|
-
|
|
46
|
-
|
|
31
|
+
ctx.body = yield (0, utilities_1.saveEntityMetadata)(type, entityId, ctx.request.body);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
exports.saveMetadata = saveMetadata;
|
|
35
|
+
function deleteMetadata(ctx) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const { type, entityId } = ctx.params;
|
|
38
|
+
yield (0, utilities_1.deleteEntityMetadata)(type, entityId);
|
|
39
|
+
ctx.body = {
|
|
40
|
+
message: "Metadata deleted successfully",
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
exports.deleteMetadata = deleteMetadata;
|
|
45
|
+
function getMetadata(ctx) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
const { type, entityId } = ctx.params;
|
|
48
|
+
const db = backend_core_1.context.getAppDB();
|
|
49
|
+
const id = (0, utils_1.generateMetadataID)(type, entityId);
|
|
50
|
+
try {
|
|
51
|
+
ctx.body = yield db.get(id);
|
|
47
52
|
}
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
catch (err) {
|
|
54
|
+
if (err.status === 404) {
|
|
55
|
+
ctx.body = {};
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
ctx.throw(err.status, err);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
exports.getMetadata = getMetadata;
|