@budibase/server 2.1.32-alpha.2 → 2.1.32-alpha.4
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.1c258fa9.js → index.dfb2f13a.js} +254 -254
- package/builder/index.html +1 -1
- package/coverage/clover.xml +751 -654
- package/coverage/coverage-final.json +12 -6
- package/coverage/lcov-report/index.html +49 -34
- package/coverage/lcov-report/src/api/controllers/analytics.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/apikeys.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/application.ts.html +70 -13
- package/coverage/lcov-report/src/api/controllers/auth.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/automation.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/backup.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/cloud.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/component.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/datasource.js.html +161 -23
- package/coverage/lcov-report/src/api/controllers/deploy/Deployment.js.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 +28 -28
- package/coverage/lcov-report/src/api/controllers/integration.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/layout.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/metadata.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/migrations.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/permission.js.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.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/role.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/routing.js.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.js.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.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/internalSearch.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/staticFormula.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/utils.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/screen.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/script.js.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.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/table/external.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/table/index.html +18 -18
- package/coverage/lcov-report/src/api/controllers/table/index.js.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 +48 -33
- package/coverage/lcov-report/src/api/controllers/templates.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/user.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/view/exporters.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/view/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/view/index.js.html +1 -1
- package/coverage/lcov-report/src/api/controllers/view/utils.js.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/src/api/index.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/analytics.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/apikeys.js.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.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/backup.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/cloud.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/component.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/datasource.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/deploy.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/dev.js.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.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/layout.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/metadata.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/migrations.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/permission.js.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/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 +1 -1
- package/coverage/lcov-report/src/api/routes/role.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/routing.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/row.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/screen.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/script.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/static.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/table.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/templates.js.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.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/user.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/utils/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/utils/validators.js.html +1 -1
- package/coverage/lcov-report/src/api/routes/view.js.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.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 +1 -1
- 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 +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.js.html +1 -1
- package/coverage/lcov-report/src/constants/layouts.js.html +1 -1
- package/coverage/lcov-report/src/constants/screens.js.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/datasource_bb_default.js.html +2023 -0
- package/coverage/lcov-report/src/db/defaultData/employeeImport.js.html +541 -0
- package/coverage/lcov-report/src/db/defaultData/expensesImport.js.html +427 -0
- package/coverage/lcov-report/src/db/defaultData/index.html +176 -0
- package/coverage/lcov-report/src/db/defaultData/inventoryImport.js.html +403 -0
- package/coverage/lcov-report/src/db/defaultData/jobsImport.js.html +559 -0
- package/coverage/lcov-report/src/db/dynamoClient.js.html +1 -1
- package/coverage/lcov-report/src/db/inMemoryView.js.html +1 -1
- 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 +11 -149
- package/coverage/lcov-report/src/db/linkedRows/LinkDocument.js.html +226 -0
- package/coverage/lcov-report/src/db/linkedRows/index.html +28 -13
- package/coverage/lcov-report/src/db/linkedRows/index.js.html +1 -1
- package/coverage/lcov-report/src/db/linkedRows/linkUtils.js.html +1 -1
- 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 +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 +1 -1
- 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/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/module.d.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 +1 -1
- package/coverage/lcov-report/src/sdk/app/backups/imports.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/app/backups/index.html +1 -1
- 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 +5 -5
- package/coverage/lcov-report/src/sdk/app/tables/index.ts.html +4 -4
- 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 +1 -1
- package/coverage/lcov-report/src/tests/utilities/TestConfiguration.js.html +1 -1
- package/coverage/lcov-report/src/tests/utilities/controllers.js.html +1 -1
- package/coverage/lcov-report/src/tests/utilities/index.html +1 -1
- package/coverage/lcov-report/src/tests/utilities/index.js.html +1 -1
- package/coverage/lcov-report/src/tests/utilities/structures.js.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.js.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/src/utilities/fileSystem/index.html +1 -1
- package/coverage/lcov-report/src/utilities/fileSystem/index.js.html +1 -1
- package/coverage/lcov-report/src/utilities/fileSystem/processor.js.html +1 -1
- package/coverage/lcov-report/src/utilities/fileSystem/utilities.js.html +1 -1
- package/coverage/lcov-report/src/utilities/global.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/index.html +1 -1
- package/coverage/lcov-report/src/utilities/index.js.html +3 -3
- 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 +1 -1
- package/coverage/lcov-report/src/utilities/routing/index.html +1 -1
- package/coverage/lcov-report/src/utilities/routing/index.js.html +1 -1
- package/coverage/lcov-report/src/utilities/rowProcessor/index.html +1 -1
- package/coverage/lcov-report/src/utilities/rowProcessor/index.js.html +1 -1
- package/coverage/lcov-report/src/utilities/rowProcessor/utils.js.html +1 -1
- package/coverage/lcov-report/src/utilities/scriptRunner.js.html +1 -1
- package/coverage/lcov-report/src/utilities/security.js.html +1 -1
- package/coverage/lcov-report/src/utilities/statusCodes.js.html +1 -1
- package/coverage/lcov-report/src/utilities/usageQuota/index.html +1 -1
- package/coverage/lcov-report/src/utilities/usageQuota/rows.js.html +1 -1
- package/coverage/lcov-report/src/utilities/usageQuota/usageQuoteReset.js.html +1 -1
- package/coverage/lcov-report/src/utilities/users.js.html +1 -1
- package/coverage/lcov-report/src/utilities/workerRequests.js.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 +1281 -1113
- package/dist/api/controllers/application.js +13 -2
- package/dist/api/controllers/datasource.js +47 -9
- package/dist/api/controllers/table/utils.js +31 -26
- package/dist/db/defaultData/datasource_bb_default.js +565 -0
- package/dist/db/defaultData/employeeImport.js +153 -0
- package/dist/db/defaultData/expensesImport.js +115 -0
- package/dist/db/defaultData/inventoryImport.js +107 -0
- package/dist/db/defaultData/jobsImport.js +150 -0
- package/dist/db/linkedRows/LinkController.js +2 -29
- package/dist/db/linkedRows/LinkDocument.js +32 -0
- package/dist/db/utils.js +1 -1
- package/dist/package.json +6 -6
- package/dist/sdk/app/tables/index.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/api/controllers/application.ts +22 -3
- package/src/api/controllers/datasource.js +57 -11
- package/src/api/controllers/table/utils.ts +17 -12
- package/src/db/defaultData/datasource_bb_default.js +646 -0
- package/src/db/defaultData/employeeImport.js +152 -0
- package/src/db/defaultData/expensesImport.js +114 -0
- package/src/db/defaultData/inventoryImport.js +106 -0
- package/src/db/defaultData/jobsImport.js +158 -0
- package/src/db/linkedRows/LinkController.js +2 -48
- package/src/db/linkedRows/LinkDocument.js +47 -0
- package/src/db/utils.ts +1 -1
- package/src/sdk/app/tables/index.ts +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.1.32-alpha.
|
|
4
|
+
"version": "2.1.32-alpha.4",
|
|
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.1.32-alpha.
|
|
47
|
-
"@budibase/client": "2.1.32-alpha.
|
|
48
|
-
"@budibase/pro": "2.1.
|
|
49
|
-
"@budibase/string-templates": "2.1.32-alpha.
|
|
50
|
-
"@budibase/types": "2.1.32-alpha.
|
|
46
|
+
"@budibase/backend-core": "2.1.32-alpha.4",
|
|
47
|
+
"@budibase/client": "2.1.32-alpha.4",
|
|
48
|
+
"@budibase/pro": "2.1.32-alpha.3",
|
|
49
|
+
"@budibase/string-templates": "2.1.32-alpha.4",
|
|
50
|
+
"@budibase/types": "2.1.32-alpha.4",
|
|
51
51
|
"@bull-board/api": "3.7.0",
|
|
52
52
|
"@bull-board/koa": "3.9.4",
|
|
53
53
|
"@elastic/elasticsearch": "7.10.0",
|
|
@@ -165,5 +165,5 @@
|
|
|
165
165
|
"optionalDependencies": {
|
|
166
166
|
"oracledb": "5.3.0"
|
|
167
167
|
},
|
|
168
|
-
"gitHead": "
|
|
168
|
+
"gitHead": "e8ebef0a915f25d6e9908a38c2b141196d53613f"
|
|
169
169
|
}
|
|
@@ -25,8 +25,14 @@ import {
|
|
|
25
25
|
migrations,
|
|
26
26
|
} from "@budibase/backend-core"
|
|
27
27
|
import { USERS_TABLE_SCHEMA } from "../../constants"
|
|
28
|
+
import { buildDefaultDocs } from "../../db/defaultData/datasource_bb_default"
|
|
29
|
+
|
|
28
30
|
import { removeAppFromUserRoles } from "../../utilities/workerRequests"
|
|
29
|
-
import {
|
|
31
|
+
import {
|
|
32
|
+
clientLibraryPath,
|
|
33
|
+
stringToReadStream,
|
|
34
|
+
isQsTrue,
|
|
35
|
+
} from "../../utilities"
|
|
30
36
|
import { getLocksById } from "../../utilities/redis"
|
|
31
37
|
import {
|
|
32
38
|
updateClientLibrary,
|
|
@@ -117,7 +123,7 @@ const checkAppName = (
|
|
|
117
123
|
}
|
|
118
124
|
}
|
|
119
125
|
|
|
120
|
-
async function createInstance(template: any) {
|
|
126
|
+
async function createInstance(template: any, includeSampleData: boolean) {
|
|
121
127
|
const tenantId = tenancy.isMultiTenant() ? tenancy.getTenantId() : null
|
|
122
128
|
const baseAppId = generateAppID(tenantId)
|
|
123
129
|
const appId = generateDevAppID(baseAppId)
|
|
@@ -149,11 +155,23 @@ async function createInstance(template: any) {
|
|
|
149
155
|
} else {
|
|
150
156
|
// create the users table
|
|
151
157
|
await db.put(USERS_TABLE_SCHEMA)
|
|
158
|
+
|
|
159
|
+
if (includeSampleData) {
|
|
160
|
+
// create ootb stock db
|
|
161
|
+
await addDefaultTables(db)
|
|
162
|
+
}
|
|
152
163
|
}
|
|
153
164
|
|
|
154
165
|
return { _id: appId }
|
|
155
166
|
}
|
|
156
167
|
|
|
168
|
+
const addDefaultTables = async (db: any) => {
|
|
169
|
+
const defaultDbDocs = buildDefaultDocs()
|
|
170
|
+
|
|
171
|
+
// add in the default db data docs - tables, datasource, rows and links
|
|
172
|
+
await db.bulkDocs([...defaultDbDocs])
|
|
173
|
+
}
|
|
174
|
+
|
|
157
175
|
export const fetch = async (ctx: any) => {
|
|
158
176
|
const dev = ctx.query && ctx.query.status === AppStatus.DEV
|
|
159
177
|
const all = ctx.query && ctx.query.status === AppStatus.ALL
|
|
@@ -234,7 +252,8 @@ const performAppCreate = async (ctx: any) => {
|
|
|
234
252
|
if (ctx.request.files && ctx.request.files.templateFile) {
|
|
235
253
|
instanceConfig.file = ctx.request.files.templateFile
|
|
236
254
|
}
|
|
237
|
-
const
|
|
255
|
+
const includeSampleData = isQsTrue(ctx.request.body.sampleData)
|
|
256
|
+
const instance = await createInstance(instanceConfig, includeSampleData)
|
|
238
257
|
const appId = instance._id
|
|
239
258
|
const db = context.getAppDB()
|
|
240
259
|
|
|
@@ -6,12 +6,14 @@ const {
|
|
|
6
6
|
BudibaseInternalDB,
|
|
7
7
|
getTableParams,
|
|
8
8
|
} = require("../../db/utils")
|
|
9
|
+
const { destroy: tableDestroy } = require("./table/internal")
|
|
9
10
|
const { BuildSchemaErrors, InvalidColumns } = require("../../constants")
|
|
10
11
|
const { getIntegration } = require("../../integrations")
|
|
11
12
|
const { getDatasourceAndQuery } = require("./row/utils")
|
|
12
13
|
const { invalidateDynamicVariables } = require("../../threads/utils")
|
|
13
14
|
const { getAppDB } = require("@budibase/backend-core/context")
|
|
14
15
|
const { events } = require("@budibase/backend-core")
|
|
16
|
+
const { db: dbCore } = require("@budibase/backend-core")
|
|
15
17
|
|
|
16
18
|
exports.fetch = async function (ctx) {
|
|
17
19
|
// Get internal tables
|
|
@@ -21,11 +23,16 @@ exports.fetch = async function (ctx) {
|
|
|
21
23
|
include_docs: true,
|
|
22
24
|
})
|
|
23
25
|
)
|
|
24
|
-
|
|
26
|
+
|
|
27
|
+
const internal = internalTables.rows.reduce((acc, row) => {
|
|
28
|
+
const sourceId = row.doc.sourceId || "bb_internal"
|
|
29
|
+
acc[sourceId] = acc[sourceId] || []
|
|
30
|
+
acc[sourceId].push(row.doc)
|
|
31
|
+
return acc
|
|
32
|
+
}, {})
|
|
25
33
|
|
|
26
34
|
const bbInternalDb = {
|
|
27
35
|
...BudibaseInternalDB,
|
|
28
|
-
entities: internal,
|
|
29
36
|
}
|
|
30
37
|
|
|
31
38
|
// Get external datasources
|
|
@@ -37,11 +44,17 @@ exports.fetch = async function (ctx) {
|
|
|
37
44
|
)
|
|
38
45
|
).rows.map(row => row.doc)
|
|
39
46
|
|
|
40
|
-
|
|
47
|
+
const allDatasources = [bbInternalDb, ...datasources]
|
|
48
|
+
|
|
49
|
+
for (let datasource of allDatasources) {
|
|
41
50
|
if (datasource.config && datasource.config.auth) {
|
|
42
51
|
// strip secrets from response so they don't show in the network request
|
|
43
52
|
delete datasource.config.auth
|
|
44
53
|
}
|
|
54
|
+
|
|
55
|
+
if (datasource.type === dbCore.BUDIBASE_DATASOURCE_TYPE) {
|
|
56
|
+
datasource.entities = internal[datasource._id]
|
|
57
|
+
}
|
|
45
58
|
}
|
|
46
59
|
|
|
47
60
|
ctx.body = [bbInternalDb, ...datasources]
|
|
@@ -196,20 +209,53 @@ exports.save = async function (ctx) {
|
|
|
196
209
|
ctx.body = response
|
|
197
210
|
}
|
|
198
211
|
|
|
212
|
+
const destroyInternalTablesBySourceId = async datasourceId => {
|
|
213
|
+
const db = getAppDB()
|
|
214
|
+
|
|
215
|
+
// Get all internal tables
|
|
216
|
+
const internalTables = await db.allDocs(
|
|
217
|
+
getTableParams(null, {
|
|
218
|
+
include_docs: true,
|
|
219
|
+
})
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
// Filter by datasource and return the docs.
|
|
223
|
+
const datasourceTableDocs = internalTables.rows.reduce((acc, table) => {
|
|
224
|
+
if (table.doc.sourceId == datasourceId) {
|
|
225
|
+
acc.push(table.doc)
|
|
226
|
+
}
|
|
227
|
+
return acc
|
|
228
|
+
}, [])
|
|
229
|
+
|
|
230
|
+
// Destroy the tables.
|
|
231
|
+
for (const table of datasourceTableDocs) {
|
|
232
|
+
await tableDestroy({
|
|
233
|
+
params: {
|
|
234
|
+
tableId: table._id,
|
|
235
|
+
},
|
|
236
|
+
})
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
199
240
|
exports.destroy = async function (ctx) {
|
|
200
241
|
const db = getAppDB()
|
|
201
242
|
const datasourceId = ctx.params.datasourceId
|
|
202
243
|
|
|
203
244
|
const datasource = await db.get(datasourceId)
|
|
204
245
|
// Delete all queries for the datasource
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
246
|
+
|
|
247
|
+
if (datasource.type === dbCore.BUDIBASE_DATASOURCE_TYPE) {
|
|
248
|
+
await destroyInternalTablesBySourceId(datasourceId)
|
|
249
|
+
} else {
|
|
250
|
+
const queries = await db.allDocs(getQueryParams(datasourceId, null))
|
|
251
|
+
await db.bulkDocs(
|
|
252
|
+
queries.rows.map(row => ({
|
|
253
|
+
_id: row.id,
|
|
254
|
+
_rev: row.value.rev,
|
|
255
|
+
_deleted: true,
|
|
256
|
+
}))
|
|
257
|
+
)
|
|
258
|
+
}
|
|
213
259
|
|
|
214
260
|
// delete the datasource
|
|
215
261
|
await db.remove(datasourceId, ctx.params.revId)
|
|
@@ -95,18 +95,7 @@ export function makeSureTableUpToDate(table: any, tableToSave: any) {
|
|
|
95
95
|
return tableToSave
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
export
|
|
99
|
-
if (!dataImport || !dataImport.csvString) {
|
|
100
|
-
return table
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const db = getAppDB()
|
|
104
|
-
// Populate the table with rows imported from CSV in a bulk update
|
|
105
|
-
const data = await transform({
|
|
106
|
-
...dataImport,
|
|
107
|
-
existingTable: table,
|
|
108
|
-
})
|
|
109
|
-
|
|
98
|
+
export function importToRows(data: any, table: any, user: any = {}) {
|
|
110
99
|
let finalData: any = []
|
|
111
100
|
for (let i = 0; i < data.length; i++) {
|
|
112
101
|
let row = data[i]
|
|
@@ -136,6 +125,22 @@ export async function handleDataImport(user: any, table: any, dataImport: any) {
|
|
|
136
125
|
|
|
137
126
|
finalData.push(row)
|
|
138
127
|
}
|
|
128
|
+
return finalData
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export async function handleDataImport(user: any, table: any, dataImport: any) {
|
|
132
|
+
if (!dataImport || !dataImport.csvString) {
|
|
133
|
+
return table
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const db = getAppDB()
|
|
137
|
+
// Populate the table with rows imported from CSV in a bulk update
|
|
138
|
+
const data = await transform({
|
|
139
|
+
...dataImport,
|
|
140
|
+
existingTable: table,
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
let finalData: any = importToRows(data, table, user)
|
|
139
144
|
|
|
140
145
|
await quotas.addRows(finalData.length, () => db.bulkDocs(finalData), {
|
|
141
146
|
tableId: table._id,
|