@budibase/server 2.1.32-alpha.4 → 2.1.32-alpha.6
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.dfb2f13a.js → index.3ca79a83.js} +1 -1
- 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 +15 -15
- 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 +5516 -5765
- 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
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.budibaseTempDir = void 0;
|
|
4
|
+
const backend_core_1 = require("@budibase/backend-core");
|
|
5
|
+
exports.budibaseTempDir = backend_core_1.objectStore.budibaseTempDir;
|
|
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
const { join } = require("path");
|
|
12
12
|
const { ObjectStoreBuckets } = require("../../constants");
|
|
13
13
|
const fs = require("fs");
|
|
14
|
-
const {
|
|
14
|
+
const { objectStore } = require("@budibase/backend-core");
|
|
15
15
|
const { resolve } = require("../centralPath");
|
|
16
16
|
const env = require("../../environment");
|
|
17
17
|
const TOP_LEVEL_PATH = join(__dirname, "..", "..", "..");
|
|
@@ -46,22 +46,22 @@ exports.backupClientLibrary = (appId) => __awaiter(void 0, void 0, void 0, funct
|
|
|
46
46
|
let tmpManifestPath;
|
|
47
47
|
try {
|
|
48
48
|
// Try to load the manifest from the new file location
|
|
49
|
-
tmpManifestPath = yield retrieveToTmp(ObjectStoreBuckets.APPS, join(appId, "manifest.json"));
|
|
49
|
+
tmpManifestPath = yield objectStore.retrieveToTmp(ObjectStoreBuckets.APPS, join(appId, "manifest.json"));
|
|
50
50
|
}
|
|
51
51
|
catch (error) {
|
|
52
52
|
// Fallback to loading it from the old location for old apps
|
|
53
|
-
tmpManifestPath = yield retrieveToTmp(ObjectStoreBuckets.APPS, join(appId, "node_modules", "budibase", "standard-components", "package", "manifest.json"));
|
|
53
|
+
tmpManifestPath = yield objectStore.retrieveToTmp(ObjectStoreBuckets.APPS, join(appId, "node_modules", "budibase", "standard-components", "package", "manifest.json"));
|
|
54
54
|
}
|
|
55
55
|
// Copy existing client lib to tmp
|
|
56
|
-
const tmpClientPath = yield retrieveToTmp(ObjectStoreBuckets.APPS, join(appId, "budibase-client.js"));
|
|
56
|
+
const tmpClientPath = yield objectStore.retrieveToTmp(ObjectStoreBuckets.APPS, join(appId, "budibase-client.js"));
|
|
57
57
|
// Upload manifest and client library as backups
|
|
58
|
-
const manifestUpload = upload({
|
|
58
|
+
const manifestUpload = objectStore.upload({
|
|
59
59
|
bucket: ObjectStoreBuckets.APPS,
|
|
60
60
|
filename: join(appId, "manifest.json.bak"),
|
|
61
61
|
path: tmpManifestPath,
|
|
62
62
|
type: "application/json",
|
|
63
63
|
});
|
|
64
|
-
const clientUpload = upload({
|
|
64
|
+
const clientUpload = objectStore.upload({
|
|
65
65
|
bucket: ObjectStoreBuckets.APPS,
|
|
66
66
|
filename: join(appId, "budibase-client.js.bak"),
|
|
67
67
|
path: tmpClientPath,
|
|
@@ -88,10 +88,10 @@ exports.updateClientLibrary = (appId) => __awaiter(void 0, void 0, void 0, funct
|
|
|
88
88
|
client = resolve(TOP_LEVEL_PATH, "client", "budibase-client.js");
|
|
89
89
|
}
|
|
90
90
|
// Upload latest manifest and client library
|
|
91
|
-
const manifestUpload = streamUpload(ObjectStoreBuckets.APPS, join(appId, "manifest.json"), fs.createReadStream(manifest), {
|
|
91
|
+
const manifestUpload = objectStore.streamUpload(ObjectStoreBuckets.APPS, join(appId, "manifest.json"), fs.createReadStream(manifest), {
|
|
92
92
|
ContentType: "application/json",
|
|
93
93
|
});
|
|
94
|
-
const clientUpload = streamUpload(ObjectStoreBuckets.APPS, join(appId, "budibase-client.js"), fs.createReadStream(client), {
|
|
94
|
+
const clientUpload = objectStore.streamUpload(ObjectStoreBuckets.APPS, join(appId, "budibase-client.js"), fs.createReadStream(client), {
|
|
95
95
|
ContentType: "application/javascript",
|
|
96
96
|
});
|
|
97
97
|
yield Promise.all([manifestUpload, clientUpload]);
|
|
@@ -104,17 +104,17 @@ exports.updateClientLibrary = (appId) => __awaiter(void 0, void 0, void 0, funct
|
|
|
104
104
|
*/
|
|
105
105
|
exports.revertClientLibrary = (appId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
106
106
|
// Copy backups manifest to tmp directory
|
|
107
|
-
const tmpManifestPath = yield retrieveToTmp(ObjectStoreBuckets.APPS, join(appId, "manifest.json.bak"));
|
|
107
|
+
const tmpManifestPath = yield objectStore.retrieveToTmp(ObjectStoreBuckets.APPS, join(appId, "manifest.json.bak"));
|
|
108
108
|
// Copy backup client lib to tmp
|
|
109
|
-
const tmpClientPath = yield retrieveToTmp(ObjectStoreBuckets.APPS, join(appId, "budibase-client.js.bak"));
|
|
109
|
+
const tmpClientPath = yield objectStore.retrieveToTmp(ObjectStoreBuckets.APPS, join(appId, "budibase-client.js.bak"));
|
|
110
110
|
// Upload backups as new versions
|
|
111
|
-
const manifestUpload = upload({
|
|
111
|
+
const manifestUpload = objectStore.upload({
|
|
112
112
|
bucket: ObjectStoreBuckets.APPS,
|
|
113
113
|
filename: join(appId, "manifest.json"),
|
|
114
114
|
path: tmpManifestPath,
|
|
115
115
|
type: "application/json",
|
|
116
116
|
});
|
|
117
|
-
const clientUpload = upload({
|
|
117
|
+
const clientUpload = objectStore.upload({
|
|
118
118
|
bucket: ObjectStoreBuckets.APPS,
|
|
119
119
|
filename: join(appId, "budibase-client.js"),
|
|
120
120
|
path: tmpClientPath,
|
|
@@ -12,14 +12,14 @@ const { budibaseTempDir } = require("../budibaseDir");
|
|
|
12
12
|
const fs = require("fs");
|
|
13
13
|
const { join } = require("path");
|
|
14
14
|
const uuid = require("uuid/v4");
|
|
15
|
+
const { context, objectStore } = require("@budibase/backend-core");
|
|
15
16
|
const { ObjectStoreBuckets } = require("../../constants");
|
|
16
|
-
const { upload, retrieve, retrieveToTmp, deleteFolder, downloadTarball, downloadTarballDirect, deleteFiles, } = require("./utilities");
|
|
17
17
|
const { updateClientLibrary } = require("./clientLibrary");
|
|
18
18
|
const { checkSlashesInUrl } = require("../");
|
|
19
19
|
const env = require("../../environment");
|
|
20
|
-
const { getAppId } = require("@budibase/backend-core/context");
|
|
21
20
|
const tar = require("tar");
|
|
22
21
|
const fetch = require("node-fetch");
|
|
22
|
+
const { upload, retrieve, retrieveToTmp, deleteFolder, downloadTarball, downloadTarballDirect, deleteFiles, } = objectStore;
|
|
23
23
|
const TOP_LEVEL_PATH = join(__dirname, "..", "..", "..");
|
|
24
24
|
const NODE_MODULES_PATH = join(TOP_LEVEL_PATH, "node_modules");
|
|
25
25
|
const DATASOURCE_PATH = join(budibaseTempDir(), "datasource");
|
|
@@ -153,7 +153,7 @@ exports.downloadTemplate = (type, name) => __awaiter(void 0, void 0, void 0, fun
|
|
|
153
153
|
* Retrieves component libraries from object store (or tmp symlink if in local)
|
|
154
154
|
*/
|
|
155
155
|
exports.getComponentLibraryManifest = (library) => __awaiter(void 0, void 0, void 0, function* () {
|
|
156
|
-
const appId = getAppId();
|
|
156
|
+
const appId = context.getAppId();
|
|
157
157
|
const filename = "manifest.json";
|
|
158
158
|
/* istanbul ignore next */
|
|
159
159
|
// when testing in cypress and so on we need to get the package
|
package/dist/utilities/index.js
CHANGED
|
@@ -8,44 +8,55 @@ 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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.isQsTrue = exports.convertBookmark = exports.formatBytes = exports.stringToReadStream = exports.escapeDangerousCharacters = exports.deleteEntityMetadata = exports.saveEntityMetadata = exports.updateEntityMetadata = exports.attachmentsRelativeURL = exports.clientLibraryPath = exports.objectStoreUrl = exports.checkSlashesInUrl = exports.removeFromArray = exports.NUMBER_REGEX = exports.isDev = exports.wait = void 0;
|
|
16
|
+
const environment_1 = __importDefault(require("../environment"));
|
|
17
|
+
const constants_1 = require("../constants");
|
|
18
|
+
const backend_core_1 = require("@budibase/backend-core");
|
|
19
|
+
const utils_1 = require("../db/utils");
|
|
20
|
+
const stream_1 = __importDefault(require("stream"));
|
|
21
|
+
const Readable = stream_1.default.Readable;
|
|
22
|
+
function wait(ms) {
|
|
23
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
24
|
+
}
|
|
25
|
+
exports.wait = wait;
|
|
26
|
+
exports.isDev = environment_1.default.isDev;
|
|
19
27
|
exports.NUMBER_REGEX = /^[+-]?([0-9]*[.])?[0-9]+$/g;
|
|
20
|
-
|
|
28
|
+
function removeFromArray(array, element) {
|
|
21
29
|
const index = array.indexOf(element);
|
|
22
30
|
if (index !== -1) {
|
|
23
31
|
array.splice(index, 1);
|
|
24
32
|
}
|
|
25
33
|
return array;
|
|
26
|
-
}
|
|
34
|
+
}
|
|
35
|
+
exports.removeFromArray = removeFromArray;
|
|
27
36
|
/**
|
|
28
37
|
* Makes sure that a URL has the correct number of slashes, while maintaining the
|
|
29
38
|
* http(s):// double slashes.
|
|
30
39
|
* @param {string} url The URL to test and remove any extra double slashes.
|
|
31
40
|
* @return {string} The updated url.
|
|
32
41
|
*/
|
|
33
|
-
|
|
42
|
+
function checkSlashesInUrl(url) {
|
|
34
43
|
return url.replace(/(https?:\/\/)|(\/)+/g, "$1$2");
|
|
35
|
-
}
|
|
44
|
+
}
|
|
45
|
+
exports.checkSlashesInUrl = checkSlashesInUrl;
|
|
36
46
|
/**
|
|
37
47
|
* Gets the address of the object store, depending on whether self hosted or in cloud.
|
|
38
48
|
* @return {string} The base URL of the object store (MinIO or S3).
|
|
39
49
|
*/
|
|
40
|
-
|
|
41
|
-
if (
|
|
50
|
+
function objectStoreUrl() {
|
|
51
|
+
if (environment_1.default.SELF_HOSTED || environment_1.default.MINIO_URL) {
|
|
42
52
|
// can use a relative url for this as all goes through the proxy (this is hosted in minio)
|
|
43
|
-
return OBJ_STORE_DIRECTORY;
|
|
53
|
+
return constants_1.OBJ_STORE_DIRECTORY;
|
|
44
54
|
}
|
|
45
55
|
else {
|
|
46
|
-
return
|
|
56
|
+
return environment_1.default.CDN_URL;
|
|
47
57
|
}
|
|
48
|
-
}
|
|
58
|
+
}
|
|
59
|
+
exports.objectStoreUrl = objectStoreUrl;
|
|
49
60
|
/**
|
|
50
61
|
* In production the client library is stored in the object store, however in development
|
|
51
62
|
* we use the symlinked version produced by lerna, located in node modules. We link to this
|
|
@@ -56,9 +67,9 @@ exports.objectStoreUrl = () => {
|
|
|
56
67
|
* @return {string} The URL to be inserted into appPackage response or server rendered
|
|
57
68
|
* app index file.
|
|
58
69
|
*/
|
|
59
|
-
|
|
60
|
-
if (
|
|
61
|
-
let url = `${
|
|
70
|
+
function clientLibraryPath(appId, version) {
|
|
71
|
+
if (environment_1.default.isProd()) {
|
|
72
|
+
let url = `${objectStoreUrl()}/${backend_core_1.objectStore.sanitizeKey(appId)}/budibase-client.js`;
|
|
62
73
|
// append app version to bust the cache
|
|
63
74
|
if (version) {
|
|
64
75
|
url += `?v=${version}`;
|
|
@@ -68,54 +79,65 @@ exports.clientLibraryPath = (appId, version) => {
|
|
|
68
79
|
else {
|
|
69
80
|
return `/api/assets/client`;
|
|
70
81
|
}
|
|
71
|
-
}
|
|
72
|
-
exports.
|
|
73
|
-
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
rev
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return metadata;
|
|
82
|
+
}
|
|
83
|
+
exports.clientLibraryPath = clientLibraryPath;
|
|
84
|
+
function attachmentsRelativeURL(attachmentKey) {
|
|
85
|
+
return checkSlashesInUrl(`${objectStoreUrl()}/${attachmentKey}`);
|
|
86
|
+
}
|
|
87
|
+
exports.attachmentsRelativeURL = attachmentsRelativeURL;
|
|
88
|
+
function updateEntityMetadata(type, entityId, updateFn) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
const db = backend_core_1.context.getAppDB();
|
|
91
|
+
const id = (0, utils_1.generateMetadataID)(type, entityId);
|
|
92
|
+
// read it to see if it exists, we'll overwrite it no matter what
|
|
93
|
+
let rev, metadata;
|
|
94
|
+
try {
|
|
95
|
+
const oldMetadata = yield db.get(id);
|
|
96
|
+
rev = oldMetadata._rev;
|
|
97
|
+
metadata = updateFn(oldMetadata);
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
rev = null;
|
|
101
|
+
metadata = updateFn({});
|
|
102
|
+
}
|
|
103
|
+
metadata._id = id;
|
|
104
|
+
if (rev) {
|
|
105
|
+
metadata._rev = rev;
|
|
106
|
+
}
|
|
107
|
+
const response = yield db.put(metadata);
|
|
108
|
+
return Object.assign(Object.assign({}, metadata), { _id: id, _rev: response.rev });
|
|
99
109
|
});
|
|
100
|
-
}
|
|
101
|
-
exports.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
}
|
|
111
|
+
exports.updateEntityMetadata = updateEntityMetadata;
|
|
112
|
+
function saveEntityMetadata(type, entityId, metadata) {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
+
return updateEntityMetadata(type, entityId, () => {
|
|
115
|
+
return metadata;
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
exports.saveEntityMetadata = saveEntityMetadata;
|
|
120
|
+
function deleteEntityMetadata(type, entityId) {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
const db = backend_core_1.context.getAppDB();
|
|
123
|
+
const id = (0, utils_1.generateMetadataID)(type, entityId);
|
|
124
|
+
let rev;
|
|
125
|
+
try {
|
|
126
|
+
const metadata = yield db.get(id);
|
|
127
|
+
if (metadata) {
|
|
128
|
+
rev = metadata._rev;
|
|
129
|
+
}
|
|
109
130
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
exports.
|
|
131
|
+
catch (err) {
|
|
132
|
+
// don't need to error if it doesn't exist
|
|
133
|
+
}
|
|
134
|
+
if (id && rev) {
|
|
135
|
+
yield db.remove(id, rev);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
exports.deleteEntityMetadata = deleteEntityMetadata;
|
|
140
|
+
function escapeDangerousCharacters(string) {
|
|
119
141
|
return string
|
|
120
142
|
.replace(/[\\]/g, "\\\\")
|
|
121
143
|
.replace(/[\b]/g, "\\b")
|
|
@@ -123,16 +145,18 @@ exports.escapeDangerousCharacters = string => {
|
|
|
123
145
|
.replace(/[\n]/g, "\\n")
|
|
124
146
|
.replace(/[\r]/g, "\\r")
|
|
125
147
|
.replace(/[\t]/g, "\\t");
|
|
126
|
-
}
|
|
127
|
-
exports.
|
|
148
|
+
}
|
|
149
|
+
exports.escapeDangerousCharacters = escapeDangerousCharacters;
|
|
150
|
+
function stringToReadStream(string) {
|
|
128
151
|
return new Readable({
|
|
129
152
|
read() {
|
|
130
153
|
this.push(string);
|
|
131
154
|
this.push(null);
|
|
132
155
|
},
|
|
133
156
|
});
|
|
134
|
-
}
|
|
135
|
-
exports.
|
|
157
|
+
}
|
|
158
|
+
exports.stringToReadStream = stringToReadStream;
|
|
159
|
+
function formatBytes(bytes) {
|
|
136
160
|
const units = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
137
161
|
const byteIncrements = 1024;
|
|
138
162
|
let unit = 0;
|
|
@@ -141,19 +165,22 @@ exports.formatBytes = bytes => {
|
|
|
141
165
|
size /= byteIncrements;
|
|
142
166
|
}
|
|
143
167
|
return `${size.toFixed(size < 10 && unit > 0 ? 1 : 0)}${units[unit]}`;
|
|
144
|
-
}
|
|
145
|
-
exports.
|
|
168
|
+
}
|
|
169
|
+
exports.formatBytes = formatBytes;
|
|
170
|
+
function convertBookmark(bookmark) {
|
|
146
171
|
const IS_NUMBER = /^\d+\.?\d*$/;
|
|
147
172
|
if (typeof bookmark === "string" && bookmark.match(IS_NUMBER)) {
|
|
148
173
|
return parseFloat(bookmark);
|
|
149
174
|
}
|
|
150
175
|
return bookmark;
|
|
151
|
-
}
|
|
152
|
-
exports.
|
|
176
|
+
}
|
|
177
|
+
exports.convertBookmark = convertBookmark;
|
|
178
|
+
function isQsTrue(param) {
|
|
153
179
|
if (typeof param === "string") {
|
|
154
180
|
return param.toLowerCase() === "true";
|
|
155
181
|
}
|
|
156
182
|
else {
|
|
157
183
|
return param === true;
|
|
158
184
|
}
|
|
159
|
-
}
|
|
185
|
+
}
|
|
186
|
+
exports.isQsTrue = isQsTrue;
|
package/dist/utilities/redis.js
CHANGED
|
@@ -8,73 +8,108 @@ 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
|
-
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.clearTestFlag = exports.checkTestFlag = exports.setTestFlag = exports.setDebounce = exports.checkDebounce = exports.clearLock = exports.updateLock = exports.getLocksById = exports.doesUserHaveLock = exports.shutdown = exports.init = void 0;
|
|
13
|
+
const backend_core_1 = require("@budibase/backend-core");
|
|
14
|
+
const utils_1 = require("../db/utils");
|
|
13
15
|
const APP_DEV_LOCK_SECONDS = 600;
|
|
14
16
|
const AUTOMATION_TEST_FLAG_SECONDS = 60;
|
|
15
17
|
let devAppClient, debounceClient, flagClient;
|
|
16
18
|
// we init this as we want to keep the connection open all the time
|
|
17
19
|
// reduces the performance hit
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
exports.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
});
|
|
20
|
+
function init() {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
devAppClient = new backend_core_1.redis.Client(backend_core_1.redis.utils.Databases.DEV_LOCKS);
|
|
23
|
+
debounceClient = new backend_core_1.redis.Client(backend_core_1.redis.utils.Databases.DEBOUNCE);
|
|
24
|
+
flagClient = new backend_core_1.redis.Client(backend_core_1.redis.utils.Databases.FLAGS);
|
|
25
|
+
yield devAppClient.init();
|
|
26
|
+
yield debounceClient.init();
|
|
27
|
+
yield flagClient.init();
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.init = init;
|
|
31
|
+
function shutdown() {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
if (devAppClient)
|
|
34
|
+
yield devAppClient.finish();
|
|
35
|
+
if (debounceClient)
|
|
36
|
+
yield debounceClient.finish();
|
|
37
|
+
if (flagClient)
|
|
38
|
+
yield flagClient.finish();
|
|
39
|
+
console.log("Redis shutdown");
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
exports.shutdown = shutdown;
|
|
43
|
+
function doesUserHaveLock(devAppId, user) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const value = yield devAppClient.get(devAppId);
|
|
46
|
+
if (!value) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
// make sure both IDs are global
|
|
50
|
+
const expected = (0, utils_1.getGlobalIDFromUserMetadataID)(value._id);
|
|
51
|
+
const userId = (0, utils_1.getGlobalIDFromUserMetadataID)(user._id);
|
|
52
|
+
return expected === userId;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
exports.doesUserHaveLock = doesUserHaveLock;
|
|
56
|
+
function getLocksById(appIds) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
return yield devAppClient.bulkGet(appIds);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
exports.getLocksById = getLocksById;
|
|
62
|
+
function updateLock(devAppId, user) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
// make sure always global user ID
|
|
65
|
+
const globalId = (0, utils_1.getGlobalIDFromUserMetadataID)(user._id);
|
|
66
|
+
const inputUser = Object.assign(Object.assign({}, user), { userId: globalId, _id: globalId, lockedAt: new Date().getTime() });
|
|
67
|
+
yield devAppClient.store(devAppId, inputUser, APP_DEV_LOCK_SECONDS);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
exports.updateLock = updateLock;
|
|
71
|
+
function clearLock(devAppId, user) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
const value = yield devAppClient.get(devAppId);
|
|
74
|
+
if (!value) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const userId = (0, utils_1.getGlobalIDFromUserMetadataID)(user._id);
|
|
78
|
+
if (value._id !== userId) {
|
|
79
|
+
throw "User does not hold lock, cannot clear it.";
|
|
80
|
+
}
|
|
81
|
+
yield devAppClient.delete(devAppId);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
exports.clearLock = clearLock;
|
|
85
|
+
function checkDebounce(id) {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
return debounceClient.get(id);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
exports.checkDebounce = checkDebounce;
|
|
91
|
+
function setDebounce(id, seconds) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
yield debounceClient.store(id, "debouncing", seconds);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
exports.setDebounce = setDebounce;
|
|
97
|
+
function setTestFlag(id) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
yield flagClient.store(id, { testing: true }, AUTOMATION_TEST_FLAG_SECONDS);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
exports.setTestFlag = setTestFlag;
|
|
103
|
+
function checkTestFlag(id) {
|
|
104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
const flag = yield flagClient.get(id);
|
|
106
|
+
return !!(flag && flag.testing);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
exports.checkTestFlag = checkTestFlag;
|
|
110
|
+
function clearTestFlag(id) {
|
|
111
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
+
yield devAppClient.delete(id);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
exports.clearTestFlag = clearTestFlag;
|
|
@@ -8,28 +8,32 @@ 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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/* istanbul ignore next */
|
|
26
|
-
if (err != null && err.name === "not_found") {
|
|
27
|
-
yield createRoutingView();
|
|
28
|
-
return exports.getRoutingInfo();
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getRoutingInfo = void 0;
|
|
13
|
+
const staticViews_1 = require("../../db/views/staticViews");
|
|
14
|
+
const utils_1 = require("../../db/utils");
|
|
15
|
+
const backend_core_1 = require("@budibase/backend-core");
|
|
16
|
+
function getRoutingInfo() {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
const db = backend_core_1.context.getAppDB();
|
|
19
|
+
try {
|
|
20
|
+
const allRouting = yield db.query((0, utils_1.getQueryIndex)(utils_1.ViewName.ROUTING), {
|
|
21
|
+
startkey: "",
|
|
22
|
+
endkey: utils_1.UNICODE_MAX,
|
|
23
|
+
});
|
|
24
|
+
return allRouting.rows.map(row => row.value);
|
|
29
25
|
}
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
catch (err) {
|
|
27
|
+
// check if the view doesn't exist, it should for all new instances
|
|
28
|
+
/* istanbul ignore next */
|
|
29
|
+
if (err != null && err.name === "not_found") {
|
|
30
|
+
yield (0, staticViews_1.createRoutingView)();
|
|
31
|
+
return getRoutingInfo();
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
throw err;
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
exports.getRoutingInfo = getRoutingInfo;
|