@budibase/server 2.2.11-alpha.2 → 2.2.12-alpha.0
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.2e639c70.js → index.a4f7991a.js} +1 -1
- package/builder/index.html +1 -1
- package/coverage/clover.xml +483 -436
- package/coverage/coverage-final.json +31 -28
- package/coverage/lcov-report/index.html +35 -20
- package/coverage/lcov-report/src/api/controllers/analytics.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/apikeys.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/application.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/auth.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/automation.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/backup.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/cloud.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/component.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/datasource.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/deploy/Deployment.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/deploy/index.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/src/api/controllers/integration.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/layout.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/metadata.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/migrations.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/permission.ts.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/src/api/controllers/plugin/index.ts.html +1 -1
- 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 +1 -1
- 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 +1 -1
- package/coverage/lcov-report/src/api/controllers/query/import/index.ts.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/src/api/controllers/query/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/validation.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/role.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/routing.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/ExternalRequest.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/external.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/internal.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/internalSearch.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/staticFormula.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/utils.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/screen.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/script.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/static/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/static/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/table/bulkFormula.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/table/external.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/table/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/table/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/table/internal.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/table/utils.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/templates.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/user.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/view/exporters.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/view/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/view/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/view/utils.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/view/viewBuilder.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/webhook.ts.html +1 -1
- package/coverage/lcov-report/src/api/index.html +1 -1
- package/coverage/lcov-report/src/api/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/analytics.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/apikeys.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/application.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/auth.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/automation.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/backup.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/cloud.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/component.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/datasource.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/deploy.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/dev.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/integration.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/layout.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/metadata.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/migrations.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/permission.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/plugin.ts.html +1 -1
- 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/tests/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/tests/utils.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.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/role.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/routing.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/row.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/screen.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/script.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/static.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/table.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/templates.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/tests/utilities/TestFunctions.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/tests/utilities/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/tests/utilities/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/user.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/utils/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/utils/validators.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/view.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/webhook.ts.html +1 -1
- package/coverage/lcov-report/src/app.ts.html +1 -1
- package/coverage/lcov-report/src/automations/actions.ts.html +1 -1
- package/coverage/lcov-report/src/automations/automationUtils.ts.html +1 -1
- package/coverage/lcov-report/src/automations/bullboard.ts.html +1 -1
- package/coverage/lcov-report/src/automations/index.html +1 -1
- package/coverage/lcov-report/src/automations/index.ts.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.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/createRow.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/delay.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/deleteRow.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/discord.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/executeQuery.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/executeScript.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/filter.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/index.html +1 -1
- package/coverage/lcov-report/src/automations/steps/integromat.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/loop.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/outgoingWebhook.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/queryRows.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/sendSmtpEmail.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/serverLog.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/slack.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/updateRow.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/utils.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/zapier.ts.html +1 -1
- package/coverage/lcov-report/src/automations/tests/utilities/index.html +1 -1
- package/coverage/lcov-report/src/automations/tests/utilities/index.ts.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/app.ts.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/cron.ts.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/index.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/index.ts.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/rowDeleted.ts.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/rowSaved.ts.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/rowUpdated.ts.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/webhook.ts.html +1 -1
- package/coverage/lcov-report/src/automations/triggers.ts.html +1 -1
- package/coverage/lcov-report/src/automations/utils.ts.html +1 -1
- package/coverage/lcov-report/src/constants/index.html +1 -1
- package/coverage/lcov-report/src/constants/index.ts.html +92 -92
- package/coverage/lcov-report/src/constants/layouts.ts.html +1 -1
- package/coverage/lcov-report/src/constants/screens.ts.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/datasource_bb_default.ts.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/employeeImport.ts.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/expensesImport.ts.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/index.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/inventoryImport.ts.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/jobsImport.ts.html +1 -1
- package/coverage/lcov-report/src/db/dynamoClient.ts.html +1 -1
- package/coverage/lcov-report/src/db/inMemoryView.ts.html +1 -1
- package/coverage/lcov-report/src/db/index.html +1 -1
- package/coverage/lcov-report/src/db/index.ts.html +1 -1
- package/coverage/lcov-report/src/db/linkedRows/LinkController.ts.html +1 -1
- package/coverage/lcov-report/src/db/linkedRows/LinkDocument.ts.html +1 -1
- package/coverage/lcov-report/src/db/linkedRows/index.html +1 -1
- package/coverage/lcov-report/src/db/linkedRows/index.ts.html +1 -1
- package/coverage/lcov-report/src/db/linkedRows/linkUtils.ts.html +1 -1
- package/coverage/lcov-report/src/db/newid.ts.html +4 -4
- package/coverage/lcov-report/src/db/utils.ts.html +57 -57
- 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.ts.html +19 -19
- package/coverage/lcov-report/src/events/AutomationEmitter.ts.html +1 -1
- package/coverage/lcov-report/src/events/BudibaseEmitter.ts.html +1 -1
- package/coverage/lcov-report/src/events/index.html +1 -1
- package/coverage/lcov-report/src/events/index.ts.html +1 -1
- package/coverage/lcov-report/src/events/utils.ts.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/src/integrations/base/sqlTable.ts.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/src/integrations/index.ts.html +1 -1
- 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 +31 -31
- package/coverage/lcov-report/src/middleware/appInfo.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/authorized.ts.html +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/tableSettings.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/index.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/index.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncApps.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncPlugins.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncRows.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/userEmailViewCasing.ts.html +1 -1
- 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/applications/index.html +1 -1
- package/coverage/lcov-report/src/sdk/app/applications/index.ts.html +4 -4
- package/coverage/lcov-report/src/sdk/app/applications/sync.ts.html +5 -5
- package/coverage/lcov-report/src/sdk/app/applications/utils.ts.html +3 -3
- package/coverage/lcov-report/src/sdk/app/automations/index.html +1 -1
- package/coverage/lcov-report/src/sdk/app/automations/index.ts.html +3 -3
- package/coverage/lcov-report/src/sdk/app/automations/webhook.ts.html +6 -6
- package/coverage/lcov-report/src/sdk/app/backups/constants.ts.html +3 -3
- package/coverage/lcov-report/src/sdk/app/backups/exports.ts.html +17 -17
- package/coverage/lcov-report/src/sdk/app/backups/imports.ts.html +78 -108
- package/coverage/lcov-report/src/sdk/app/backups/index.html +19 -19
- package/coverage/lcov-report/src/sdk/app/backups/index.ts.html +5 -5
- package/coverage/lcov-report/src/sdk/app/backups/statistics.ts.html +7 -7
- package/coverage/lcov-report/src/sdk/app/rows/attachments.ts.html +265 -0
- package/coverage/lcov-report/src/sdk/app/rows/index.html +146 -0
- package/coverage/lcov-report/src/sdk/app/rows/index.ts.html +106 -0
- package/coverage/lcov-report/src/sdk/app/rows/rows.ts.html +139 -0
- package/coverage/lcov-report/src/sdk/app/tables/index.html +1 -1
- package/coverage/lcov-report/src/sdk/app/tables/index.ts.html +8 -8
- package/coverage/lcov-report/src/sdk/index.html +5 -5
- package/coverage/lcov-report/src/sdk/index.ts.html +16 -10
- package/coverage/lcov-report/src/sdk/users/index.html +1 -1
- package/coverage/lcov-report/src/sdk/users/index.ts.html +3 -3
- package/coverage/lcov-report/src/sdk/users/utils.ts.html +8 -8
- package/coverage/lcov-report/src/startup.ts.html +1 -1
- package/coverage/lcov-report/src/tests/utilities/TestConfiguration.ts.html +1 -1
- package/coverage/lcov-report/src/tests/utilities/controllers.ts.html +1 -1
- package/coverage/lcov-report/src/tests/utilities/index.html +1 -1
- package/coverage/lcov-report/src/tests/utilities/index.ts.html +1 -1
- package/coverage/lcov-report/src/tests/utilities/structures.ts.html +1 -1
- package/coverage/lcov-report/src/threads/automation.ts.html +1 -1
- package/coverage/lcov-report/src/threads/index.html +1 -1
- package/coverage/lcov-report/src/threads/index.ts.html +1 -1
- package/coverage/lcov-report/src/threads/query.ts.html +1 -1
- package/coverage/lcov-report/src/threads/utils.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/budibaseDir.ts.html +3 -3
- package/coverage/lcov-report/src/utilities/centralPath.ts.html +4 -4
- package/coverage/lcov-report/src/utilities/csvParser.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/fileSystem/app.ts.html +14 -14
- package/coverage/lcov-report/src/utilities/fileSystem/clientLibrary.ts.html +11 -11
- package/coverage/lcov-report/src/utilities/fileSystem/filesystem.ts.html +22 -22
- package/coverage/lcov-report/src/utilities/fileSystem/index.html +1 -1
- package/coverage/lcov-report/src/utilities/fileSystem/index.ts.html +6 -6
- package/coverage/lcov-report/src/utilities/fileSystem/plugin.ts.html +8 -8
- package/coverage/lcov-report/src/utilities/fileSystem/processor.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/fileSystem/template.ts.html +7 -7
- package/coverage/lcov-report/src/utilities/global.ts.html +11 -11
- package/coverage/lcov-report/src/utilities/index.html +1 -1
- package/coverage/lcov-report/src/utilities/index.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/redis.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/routing/index.html +1 -1
- package/coverage/lcov-report/src/utilities/routing/index.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/rowProcessor/index.html +1 -1
- package/coverage/lcov-report/src/utilities/rowProcessor/index.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/rowProcessor/map.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/rowProcessor/utils.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/scriptRunner.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/security.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/statusCodes.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/usageQuota/index.html +1 -1
- package/coverage/lcov-report/src/utilities/usageQuota/rows.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/usageQuota/usageQuoteReset.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/users.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/workerRequests.ts.html +1 -1
- package/coverage/lcov-report/src/watch.ts.html +1 -1
- package/coverage/lcov-report/src/websocket.ts.html +1 -1
- package/coverage/lcov.info +653 -576
- package/dist/package.json +6 -6
- package/dist/sdk/app/backups/imports.js +22 -38
- package/dist/sdk/app/rows/attachments.js +61 -0
- package/dist/sdk/app/rows/index.js +28 -0
- package/dist/sdk/app/rows/rows.js +30 -0
- package/dist/sdk/index.js +2 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/api/routes/tests/analytics.spec.js +1 -1
- package/src/sdk/app/backups/imports.ts +36 -46
- package/src/sdk/app/rows/attachments.ts +60 -0
- package/src/sdk/app/rows/index.ts +7 -0
- package/src/sdk/app/rows/rows.ts +18 -0
- package/src/sdk/index.ts +2 -0
- package/src/sdk/tests/attachments.spec.ts +76 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.12-alpha.0",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"license": "GPL-3.0",
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
46
|
-
"@budibase/backend-core": "2.2.
|
|
47
|
-
"@budibase/client": "2.2.
|
|
48
|
-
"@budibase/pro": "2.2.11
|
|
49
|
-
"@budibase/string-templates": "2.2.
|
|
50
|
-
"@budibase/types": "2.2.
|
|
46
|
+
"@budibase/backend-core": "2.2.12-alpha.0",
|
|
47
|
+
"@budibase/client": "2.2.12-alpha.0",
|
|
48
|
+
"@budibase/pro": "2.2.11",
|
|
49
|
+
"@budibase/string-templates": "2.2.12-alpha.0",
|
|
50
|
+
"@budibase/types": "2.2.12-alpha.0",
|
|
51
51
|
"@bull-board/api": "3.7.0",
|
|
52
52
|
"@bull-board/koa": "3.9.4",
|
|
53
53
|
"@elastic/elasticsearch": "7.10.0",
|
|
@@ -167,5 +167,5 @@
|
|
|
167
167
|
"optionalDependencies": {
|
|
168
168
|
"oracledb": "5.3.0"
|
|
169
169
|
},
|
|
170
|
-
"gitHead": "
|
|
170
|
+
"gitHead": "e6c14a259b4490dabf1b1a62009e021e8eae3b80"
|
|
171
171
|
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { db as dbCore, objectStore } from "@budibase/backend-core"
|
|
2
|
-
import { Database } from "@budibase/types"
|
|
2
|
+
import { Database, Row } from "@budibase/types"
|
|
3
3
|
import { getAutomationParams, TABLE_ROW_PREFIX } from "../../../db/utils"
|
|
4
4
|
import { budibaseTempDir } from "../../../utilities/budibaseDir"
|
|
5
5
|
import { DB_EXPORT_FILE, GLOBAL_DB_EXPORT_FILE } from "./constants"
|
|
6
6
|
import { downloadTemplate } from "../../../utilities/fileSystem"
|
|
7
|
-
import {
|
|
7
|
+
import { ObjectStoreBuckets } from "../../../constants"
|
|
8
8
|
import { join } from "path"
|
|
9
9
|
import fs from "fs"
|
|
10
10
|
import sdk from "../../"
|
|
11
11
|
import {
|
|
12
12
|
Automation,
|
|
13
13
|
AutomationTriggerStepId,
|
|
14
|
-
CouchFindOptions,
|
|
15
14
|
RowAttachment,
|
|
16
15
|
} from "@budibase/types"
|
|
17
16
|
const uuid = require("uuid/v4")
|
|
@@ -25,54 +24,45 @@ type TemplateType = {
|
|
|
25
24
|
key?: string
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
function rewriteAttachmentUrl(appId: string, attachment: RowAttachment) {
|
|
28
|
+
// URL looks like: /prod-budi-app-assets/appId/attachments/file.csv
|
|
29
|
+
const urlParts = attachment.key.split("/")
|
|
30
|
+
// remove the app ID
|
|
31
|
+
urlParts.shift()
|
|
32
|
+
// add new app ID
|
|
33
|
+
urlParts.unshift(appId)
|
|
34
|
+
const key = urlParts.join("/")
|
|
35
|
+
return {
|
|
36
|
+
...attachment,
|
|
37
|
+
key,
|
|
38
|
+
url: "", // calculated on retrieval using key
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export async function updateAttachmentColumns(prodAppId: string, db: Database) {
|
|
29
43
|
// iterate through attachment documents and update them
|
|
30
44
|
const tables = await sdk.tables.getAllInternalTables(db)
|
|
45
|
+
let updatedRows: Row[] = []
|
|
31
46
|
for (let table of tables) {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const params: CouchFindOptions = {
|
|
44
|
-
selector: {
|
|
45
|
-
_id: {
|
|
46
|
-
$regex: `^${TABLE_ROW_PREFIX}`,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
}
|
|
50
|
-
attachmentCols.forEach(col => (params.selector[col] = { $exists: true }))
|
|
51
|
-
const { rows } = await dbCore.directCouchFind(db.name, params)
|
|
52
|
-
for (let row of rows) {
|
|
53
|
-
for (let column of attachmentCols) {
|
|
54
|
-
if (!Array.isArray(row[column])) {
|
|
55
|
-
continue
|
|
56
|
-
}
|
|
57
|
-
row[column] = row[column].map((attachment: RowAttachment) => {
|
|
58
|
-
// Key looks like: appId/attachments/file.csv
|
|
59
|
-
const urlParts = attachment.key.split("/")
|
|
60
|
-
// remove the app ID
|
|
61
|
-
urlParts.shift()
|
|
62
|
-
// add new app ID
|
|
63
|
-
urlParts.unshift(prodAppId)
|
|
64
|
-
const key = urlParts.join("/")
|
|
65
|
-
return {
|
|
66
|
-
...attachment,
|
|
67
|
-
key,
|
|
68
|
-
url: "", // calculated on retrieval using key
|
|
47
|
+
const { rows, columns } = await sdk.rows.getRowsWithAttachments(
|
|
48
|
+
db.name,
|
|
49
|
+
table
|
|
50
|
+
)
|
|
51
|
+
updatedRows = updatedRows.concat(
|
|
52
|
+
rows.map(row => {
|
|
53
|
+
for (let column of columns) {
|
|
54
|
+
if (Array.isArray(row[column])) {
|
|
55
|
+
row[column] = row[column].map((attachment: RowAttachment) =>
|
|
56
|
+
rewriteAttachmentUrl(prodAppId, attachment)
|
|
57
|
+
)
|
|
69
58
|
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
await db.bulkDocs(rows)
|
|
59
|
+
}
|
|
60
|
+
return row
|
|
61
|
+
})
|
|
62
|
+
)
|
|
75
63
|
}
|
|
64
|
+
// write back the updated attachments
|
|
65
|
+
await db.bulkDocs(updatedRows)
|
|
76
66
|
}
|
|
77
67
|
|
|
78
68
|
async function updateAutomations(prodAppId: string, db: Database) {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { CouchFindOptions, Table, Row } from "@budibase/types"
|
|
2
|
+
import { db as dbCore } from "@budibase/backend-core"
|
|
3
|
+
import { DocumentType, SEPARATOR } from "../../../db/utils"
|
|
4
|
+
import { FieldTypes } from "../../../constants"
|
|
5
|
+
|
|
6
|
+
// default limit - seems to work well for performance
|
|
7
|
+
export const FIND_LIMIT = 25
|
|
8
|
+
|
|
9
|
+
function generateAttachmentFindParams(
|
|
10
|
+
tableId: string,
|
|
11
|
+
attachmentCols: string[],
|
|
12
|
+
bookmark: null | string
|
|
13
|
+
) {
|
|
14
|
+
const params: CouchFindOptions = {
|
|
15
|
+
selector: {
|
|
16
|
+
_id: {
|
|
17
|
+
$regex: `^${DocumentType.ROW}${SEPARATOR}${tableId}`,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
limit: FIND_LIMIT,
|
|
21
|
+
}
|
|
22
|
+
attachmentCols.forEach(col => (params.selector[col] = { $exists: true }))
|
|
23
|
+
if (bookmark) {
|
|
24
|
+
params.bookmark = bookmark
|
|
25
|
+
}
|
|
26
|
+
return params
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function getRowsWithAttachments(appId: string, table: Table) {
|
|
30
|
+
// iterate through attachment documents and update them
|
|
31
|
+
const db = dbCore.getDB(appId)
|
|
32
|
+
const attachmentCols: string[] = []
|
|
33
|
+
for (let [key, column] of Object.entries(table.schema)) {
|
|
34
|
+
if (column.type === FieldTypes.ATTACHMENT) {
|
|
35
|
+
attachmentCols.push(key)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// no attachment columns, nothing to do
|
|
39
|
+
if (attachmentCols.length === 0) {
|
|
40
|
+
return { rows: [], columns: [] }
|
|
41
|
+
}
|
|
42
|
+
let bookmark: null | string = null,
|
|
43
|
+
rowsLength = 0,
|
|
44
|
+
rowList: Row[] = []
|
|
45
|
+
do {
|
|
46
|
+
const params = generateAttachmentFindParams(
|
|
47
|
+
table._id!,
|
|
48
|
+
attachmentCols,
|
|
49
|
+
bookmark
|
|
50
|
+
)
|
|
51
|
+
// use the CouchDB Mango query API to lookup rows that have attachments
|
|
52
|
+
const resp = await dbCore.directCouchFind(db.name, params)
|
|
53
|
+
bookmark = resp.bookmark
|
|
54
|
+
rowsLength = resp.rows.length
|
|
55
|
+
const rows = resp.rows
|
|
56
|
+
rowList = rowList.concat(rows)
|
|
57
|
+
} while (rowsLength === FIND_LIMIT)
|
|
58
|
+
// write back the updated attachments
|
|
59
|
+
return { rows: rowList, columns: attachmentCols }
|
|
60
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { db as dbCore, context } from "@budibase/backend-core"
|
|
2
|
+
import { Database, Row } from "@budibase/types"
|
|
3
|
+
import { getRowParams } from "../../../db/utils"
|
|
4
|
+
|
|
5
|
+
export async function getAllInternalRows(appId?: string) {
|
|
6
|
+
let db: Database
|
|
7
|
+
if (appId) {
|
|
8
|
+
db = dbCore.getDB(appId)
|
|
9
|
+
} else {
|
|
10
|
+
db = context.getAppDB()
|
|
11
|
+
}
|
|
12
|
+
const response = await db.allDocs(
|
|
13
|
+
getRowParams(null, null, {
|
|
14
|
+
include_docs: true,
|
|
15
|
+
})
|
|
16
|
+
)
|
|
17
|
+
return response.rows.map(row => row.doc) as Row[]
|
|
18
|
+
}
|
package/src/sdk/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { default as backups } from "./app/backups"
|
|
|
2
2
|
import { default as tables } from "./app/tables"
|
|
3
3
|
import { default as automations } from "./app/automations"
|
|
4
4
|
import { default as applications } from "./app/applications"
|
|
5
|
+
import { default as rows } from "./app/rows"
|
|
5
6
|
import { default as users } from "./users"
|
|
6
7
|
|
|
7
8
|
const sdk = {
|
|
@@ -9,6 +10,7 @@ const sdk = {
|
|
|
9
10
|
tables,
|
|
10
11
|
automations,
|
|
11
12
|
applications,
|
|
13
|
+
rows,
|
|
12
14
|
users,
|
|
13
15
|
}
|
|
14
16
|
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import newid from "../../db/newid"
|
|
2
|
+
|
|
3
|
+
const attachment = {
|
|
4
|
+
size: 73479,
|
|
5
|
+
name: "2022-12-14 11_11_44-.png",
|
|
6
|
+
url: "/prod-budi-app-assets/app_bbb/attachments/a.png",
|
|
7
|
+
extension: "png",
|
|
8
|
+
key: "app_bbb/attachments/a.png",
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const row = {
|
|
12
|
+
_id: "ro_ta_aaa",
|
|
13
|
+
photo: [attachment],
|
|
14
|
+
otherCol: "string",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const table = {
|
|
18
|
+
_id: "ta_aaa",
|
|
19
|
+
name: "photos",
|
|
20
|
+
schema: {
|
|
21
|
+
photo: {
|
|
22
|
+
type: "attachment",
|
|
23
|
+
name: "photo",
|
|
24
|
+
},
|
|
25
|
+
otherCol: {
|
|
26
|
+
type: "string",
|
|
27
|
+
name: "otherCol",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
jest.mock("@budibase/backend-core", () => {
|
|
33
|
+
const core = jest.requireActual("@budibase/backend-core")
|
|
34
|
+
return {
|
|
35
|
+
...core,
|
|
36
|
+
db: {
|
|
37
|
+
...core.db,
|
|
38
|
+
directCouchFind: jest.fn(),
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
import { db as dbCore } from "@budibase/backend-core"
|
|
44
|
+
import sdk from "../index"
|
|
45
|
+
|
|
46
|
+
describe("should be able to re-write attachment URLs", () => {
|
|
47
|
+
it("it should update URLs on a number of rows over the limit", async () => {
|
|
48
|
+
const db = dbCore.getDB("app_aaa")
|
|
49
|
+
await db.put(table)
|
|
50
|
+
const limit = 30
|
|
51
|
+
let rows = []
|
|
52
|
+
for (let i = 0; i < limit; i++) {
|
|
53
|
+
const rowToWrite = {
|
|
54
|
+
...row,
|
|
55
|
+
_id: `${row._id}_${newid()}`,
|
|
56
|
+
}
|
|
57
|
+
const { rev } = await db.put(rowToWrite)
|
|
58
|
+
rows.push({
|
|
59
|
+
...rowToWrite,
|
|
60
|
+
_rev: rev,
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
dbCore.directCouchFind
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
.mockReturnValueOnce({ rows: rows.slice(0, 25), bookmark: "aaa" })
|
|
67
|
+
.mockReturnValueOnce({ rows: rows.slice(25, limit), bookmark: "bbb" })
|
|
68
|
+
await sdk.backups.updateAttachmentColumns(db.name, db)
|
|
69
|
+
const finalRows = await sdk.rows.getAllInternalRows(db.name)
|
|
70
|
+
for (let rowToCheck of finalRows) {
|
|
71
|
+
expect(rowToCheck.otherCol).toBe(row.otherCol)
|
|
72
|
+
expect(rowToCheck.photo[0].url).toBe("")
|
|
73
|
+
expect(rowToCheck.photo[0].key).toBe(`${db.name}/attachments/a.png`)
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
})
|