@budibase/server 2.1.32-alpha.1 → 2.1.32-alpha.3
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.24cb0a61.js → index.e3911b1e.js} +285 -285
- 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
|
@@ -0,0 +1,646 @@
|
|
|
1
|
+
const {
|
|
2
|
+
FieldTypes,
|
|
3
|
+
AutoFieldSubTypes,
|
|
4
|
+
RelationshipTypes,
|
|
5
|
+
} = require("../../constants/index")
|
|
6
|
+
const { importToRows } = require("../../api/controllers/table/utils")
|
|
7
|
+
const { cloneDeep } = require("lodash/fp")
|
|
8
|
+
const LinkDocument = require("../linkedRows/LinkDocument")
|
|
9
|
+
const { inventoryImport } = require("./inventoryImport")
|
|
10
|
+
const { employeeImport } = require("./employeeImport")
|
|
11
|
+
const { jobsImport } = require("./jobsImport")
|
|
12
|
+
const { expensesImport } = require("./expensesImport")
|
|
13
|
+
const { db: dbCore } = require("@budibase/backend-core")
|
|
14
|
+
|
|
15
|
+
exports.DEFAULT_JOBS_TABLE_ID = "ta_bb_jobs"
|
|
16
|
+
exports.DEFAULT_INVENTORY_TABLE_ID = "ta_bb_inventory"
|
|
17
|
+
exports.DEFAULT_EXPENSES_TABLE_ID = "ta_bb_expenses"
|
|
18
|
+
exports.DEFAULT_EMPLOYEE_TABLE_ID = "ta_bb_employee"
|
|
19
|
+
exports.DEFAULT_BB_DATASOURCE_ID = "datasource_internal_bb_default"
|
|
20
|
+
exports.DEFAULT_BB_DATASOURCE = {
|
|
21
|
+
_id: this.DEFAULT_BB_DATASOURCE_ID,
|
|
22
|
+
type: dbCore.BUDIBASE_DATASOURCE_TYPE,
|
|
23
|
+
name: "Sample Data",
|
|
24
|
+
source: "BUDIBASE",
|
|
25
|
+
config: {},
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const syncLastIds = (table, rowCount) => {
|
|
29
|
+
Object.keys(table.schema).forEach(key => {
|
|
30
|
+
const entry = table.schema[key]
|
|
31
|
+
if (entry.autocolumn && entry.subtype == "autoID") {
|
|
32
|
+
entry.lastID = rowCount
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const tableImport = (table, data) => {
|
|
38
|
+
const cloneTable = cloneDeep(table)
|
|
39
|
+
const rowDocs = importToRows(data, cloneTable)
|
|
40
|
+
syncLastIds(cloneTable, rowDocs.length)
|
|
41
|
+
return { rows: rowDocs, table: cloneTable }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// AUTO COLUMNS
|
|
45
|
+
const AUTO_COLUMNS = {
|
|
46
|
+
"Created At": {
|
|
47
|
+
name: "Created At",
|
|
48
|
+
type: FieldTypes.DATETIME,
|
|
49
|
+
subtype: AutoFieldSubTypes.CREATED_AT,
|
|
50
|
+
icon: "ri-magic-line",
|
|
51
|
+
autocolumn: true,
|
|
52
|
+
constraints: {
|
|
53
|
+
type: FieldTypes.STRING,
|
|
54
|
+
length: {},
|
|
55
|
+
presence: false,
|
|
56
|
+
datetime: {
|
|
57
|
+
latest: "",
|
|
58
|
+
earliest: "",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
"Updated At": {
|
|
63
|
+
name: "Updated At",
|
|
64
|
+
type: FieldTypes.DATETIME,
|
|
65
|
+
subtype: AutoFieldSubTypes.UPDATED_AT,
|
|
66
|
+
icon: "ri-magic-line",
|
|
67
|
+
autocolumn: true,
|
|
68
|
+
constraints: {
|
|
69
|
+
type: FieldTypes.STRING,
|
|
70
|
+
length: {},
|
|
71
|
+
presence: false,
|
|
72
|
+
datetime: {
|
|
73
|
+
latest: "",
|
|
74
|
+
earliest: "",
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
exports.DEFAULT_INVENTORY_TABLE_SCHEMA = {
|
|
81
|
+
_id: this.DEFAULT_INVENTORY_TABLE_ID,
|
|
82
|
+
type: "internal",
|
|
83
|
+
views: {},
|
|
84
|
+
sourceId: exports.DEFAULT_BB_DATASOURCE_ID,
|
|
85
|
+
primaryDisplay: "Item Name",
|
|
86
|
+
name: "Inventory",
|
|
87
|
+
schema: {
|
|
88
|
+
"Item ID": {
|
|
89
|
+
name: "Item ID",
|
|
90
|
+
type: FieldTypes.NUMBER,
|
|
91
|
+
subtype: AutoFieldSubTypes.AUTO_ID,
|
|
92
|
+
icon: "ri-magic-line",
|
|
93
|
+
autocolumn: true,
|
|
94
|
+
constraints: {
|
|
95
|
+
type: FieldTypes.NUMBER,
|
|
96
|
+
presence: false,
|
|
97
|
+
numericality: {
|
|
98
|
+
greaterThanOrEqualTo: "",
|
|
99
|
+
lessThanOrEqualTo: "",
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
"Item Name": {
|
|
104
|
+
type: FieldTypes.STRING,
|
|
105
|
+
constraints: {
|
|
106
|
+
type: FieldTypes.STRING,
|
|
107
|
+
length: {
|
|
108
|
+
maximum: null,
|
|
109
|
+
},
|
|
110
|
+
presence: {
|
|
111
|
+
allowEmpty: false,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
name: "Item Name",
|
|
115
|
+
},
|
|
116
|
+
"Item Tags": {
|
|
117
|
+
type: FieldTypes.ARRAY,
|
|
118
|
+
constraints: {
|
|
119
|
+
type: FieldTypes.ARRAY,
|
|
120
|
+
presence: {
|
|
121
|
+
allowEmpty: false,
|
|
122
|
+
},
|
|
123
|
+
inclusion: ["Electrical", "Material", "Vehicle", "Office", "Tools"],
|
|
124
|
+
},
|
|
125
|
+
name: "Item Tags",
|
|
126
|
+
sortable: false,
|
|
127
|
+
},
|
|
128
|
+
Notes: {
|
|
129
|
+
type: FieldTypes.LONGFORM,
|
|
130
|
+
constraints: {
|
|
131
|
+
type: FieldTypes.STRING,
|
|
132
|
+
length: {},
|
|
133
|
+
presence: false,
|
|
134
|
+
},
|
|
135
|
+
name: "Notes",
|
|
136
|
+
useRichText: null,
|
|
137
|
+
},
|
|
138
|
+
Status: {
|
|
139
|
+
type: FieldTypes.ARRAY,
|
|
140
|
+
constraints: {
|
|
141
|
+
type: FieldTypes.ARRAY,
|
|
142
|
+
presence: {
|
|
143
|
+
allowEmpty: false,
|
|
144
|
+
},
|
|
145
|
+
inclusion: ["Available", "Repair", "Broken"],
|
|
146
|
+
},
|
|
147
|
+
name: "Status",
|
|
148
|
+
sortable: false,
|
|
149
|
+
},
|
|
150
|
+
SKU: {
|
|
151
|
+
type: FieldTypes.BARCODEQR,
|
|
152
|
+
constraints: {
|
|
153
|
+
type: FieldTypes.STRING,
|
|
154
|
+
length: {},
|
|
155
|
+
presence: false,
|
|
156
|
+
},
|
|
157
|
+
name: "SKU",
|
|
158
|
+
},
|
|
159
|
+
"Purchase Date": {
|
|
160
|
+
type: FieldTypes.DATETIME,
|
|
161
|
+
constraints: {
|
|
162
|
+
type: FieldTypes.STRING,
|
|
163
|
+
length: {},
|
|
164
|
+
presence: false,
|
|
165
|
+
datetime: {
|
|
166
|
+
latest: "",
|
|
167
|
+
earliest: "",
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
name: "Purchase Date",
|
|
171
|
+
ignoreTimezones: true,
|
|
172
|
+
},
|
|
173
|
+
"Purchase Price": {
|
|
174
|
+
type: FieldTypes.NUMBER,
|
|
175
|
+
constraints: {
|
|
176
|
+
type: FieldTypes.NUMBER,
|
|
177
|
+
presence: false,
|
|
178
|
+
numericality: {
|
|
179
|
+
greaterThanOrEqualTo: null,
|
|
180
|
+
lessThanOrEqualTo: "",
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
name: "Purchase Price",
|
|
184
|
+
},
|
|
185
|
+
...AUTO_COLUMNS,
|
|
186
|
+
},
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
exports.DEFAULT_EMPLOYEE_TABLE_SCHEMA = {
|
|
190
|
+
_id: this.DEFAULT_EMPLOYEE_TABLE_ID,
|
|
191
|
+
type: "internal",
|
|
192
|
+
views: {},
|
|
193
|
+
name: "Employees",
|
|
194
|
+
sourceId: exports.DEFAULT_BB_DATASOURCE_ID,
|
|
195
|
+
primaryDisplay: "First Name",
|
|
196
|
+
schema: {
|
|
197
|
+
"First Name": {
|
|
198
|
+
name: "First Name",
|
|
199
|
+
type: FieldTypes.STRING,
|
|
200
|
+
constraints: {
|
|
201
|
+
type: FieldTypes.STRING,
|
|
202
|
+
length: {},
|
|
203
|
+
presence: false,
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
"Last Name": {
|
|
207
|
+
name: "Last Name",
|
|
208
|
+
type: FieldTypes.STRING,
|
|
209
|
+
constraints: {
|
|
210
|
+
type: FieldTypes.STRING,
|
|
211
|
+
length: {},
|
|
212
|
+
presence: false,
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
Email: {
|
|
216
|
+
name: "Email",
|
|
217
|
+
type: FieldTypes.STRING,
|
|
218
|
+
constraints: {
|
|
219
|
+
type: FieldTypes.STRING,
|
|
220
|
+
length: {},
|
|
221
|
+
presence: false,
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
Address: {
|
|
225
|
+
name: "Address",
|
|
226
|
+
type: FieldTypes.STRING,
|
|
227
|
+
constraints: {
|
|
228
|
+
type: FieldTypes.STRING,
|
|
229
|
+
length: {},
|
|
230
|
+
presence: false,
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
City: {
|
|
234
|
+
name: "City",
|
|
235
|
+
type: FieldTypes.STRING,
|
|
236
|
+
constraints: {
|
|
237
|
+
type: FieldTypes.STRING,
|
|
238
|
+
length: {},
|
|
239
|
+
presence: false,
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
Postcode: {
|
|
243
|
+
name: "Postcode",
|
|
244
|
+
type: FieldTypes.STRING,
|
|
245
|
+
constraints: {
|
|
246
|
+
type: FieldTypes.STRING,
|
|
247
|
+
length: {},
|
|
248
|
+
presence: false,
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
Phone: {
|
|
252
|
+
name: "Phone",
|
|
253
|
+
type: FieldTypes.STRING,
|
|
254
|
+
constraints: {
|
|
255
|
+
type: FieldTypes.STRING,
|
|
256
|
+
length: {},
|
|
257
|
+
presence: false,
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
"EMPLOYEE ID": {
|
|
261
|
+
name: "EMPLOYEE ID",
|
|
262
|
+
type: FieldTypes.NUMBER,
|
|
263
|
+
subtype: AutoFieldSubTypes.AUTO_ID,
|
|
264
|
+
icon: "ri-magic-line",
|
|
265
|
+
autocolumn: true,
|
|
266
|
+
constraints: {
|
|
267
|
+
type: FieldTypes.NUMBER,
|
|
268
|
+
presence: false,
|
|
269
|
+
numericality: {
|
|
270
|
+
greaterThanOrEqualTo: "",
|
|
271
|
+
lessThanOrEqualTo: "",
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
"Employee Level": {
|
|
276
|
+
type: FieldTypes.ARRAY,
|
|
277
|
+
constraints: {
|
|
278
|
+
type: FieldTypes.ARRAY,
|
|
279
|
+
presence: false,
|
|
280
|
+
inclusion: ["Manager", "Junior", "Senior", "Apprentice", "Contractor"],
|
|
281
|
+
},
|
|
282
|
+
name: "Employee Level",
|
|
283
|
+
sortable: false,
|
|
284
|
+
},
|
|
285
|
+
"Badge Photo": {
|
|
286
|
+
type: "attachment",
|
|
287
|
+
constraints: {
|
|
288
|
+
type: FieldTypes.ARRAY,
|
|
289
|
+
presence: false,
|
|
290
|
+
},
|
|
291
|
+
name: "Badge Photo",
|
|
292
|
+
sortable: false,
|
|
293
|
+
},
|
|
294
|
+
Jobs: {
|
|
295
|
+
type: FieldTypes.LINK,
|
|
296
|
+
constraints: {
|
|
297
|
+
type: FieldTypes.ARRAY,
|
|
298
|
+
presence: false,
|
|
299
|
+
},
|
|
300
|
+
fieldName: "Assigned",
|
|
301
|
+
name: "Jobs",
|
|
302
|
+
relationshipType: RelationshipTypes.MANY_TO_MANY,
|
|
303
|
+
tableId: this.DEFAULT_JOBS_TABLE_ID,
|
|
304
|
+
},
|
|
305
|
+
"Start Date": {
|
|
306
|
+
type: FieldTypes.DATETIME,
|
|
307
|
+
constraints: {
|
|
308
|
+
type: FieldTypes.STRING,
|
|
309
|
+
length: {},
|
|
310
|
+
presence: false,
|
|
311
|
+
datetime: {
|
|
312
|
+
latest: "",
|
|
313
|
+
earliest: "",
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
name: "Start Date",
|
|
317
|
+
ignoreTimezones: true,
|
|
318
|
+
},
|
|
319
|
+
"End Date": {
|
|
320
|
+
type: FieldTypes.DATETIME,
|
|
321
|
+
constraints: {
|
|
322
|
+
type: FieldTypes.STRING,
|
|
323
|
+
length: {},
|
|
324
|
+
presence: false,
|
|
325
|
+
datetime: {
|
|
326
|
+
latest: "",
|
|
327
|
+
earliest: "",
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
name: "End Date",
|
|
331
|
+
ignoreTimezones: true,
|
|
332
|
+
},
|
|
333
|
+
...AUTO_COLUMNS,
|
|
334
|
+
},
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
exports.DEFAULT_JOBS_TABLE_SCHEMA = {
|
|
338
|
+
_id: this.DEFAULT_JOBS_TABLE_ID,
|
|
339
|
+
type: "internal",
|
|
340
|
+
name: "Jobs",
|
|
341
|
+
sourceId: exports.DEFAULT_BB_DATASOURCE_ID,
|
|
342
|
+
primaryDisplay: "Job ID",
|
|
343
|
+
schema: {
|
|
344
|
+
"Job ID": {
|
|
345
|
+
name: "Job ID",
|
|
346
|
+
type: FieldTypes.NUMBER,
|
|
347
|
+
subtype: AutoFieldSubTypes.AUTO_ID,
|
|
348
|
+
icon: "ri-magic-line",
|
|
349
|
+
autocolumn: true,
|
|
350
|
+
constraints: {
|
|
351
|
+
type: FieldTypes.NUMBER,
|
|
352
|
+
presence: false,
|
|
353
|
+
numericality: {
|
|
354
|
+
greaterThanOrEqualTo: "",
|
|
355
|
+
lessThanOrEqualTo: "",
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
"Quote Date": {
|
|
360
|
+
type: FieldTypes.DATETIME,
|
|
361
|
+
constraints: {
|
|
362
|
+
type: FieldTypes.STRING,
|
|
363
|
+
length: {},
|
|
364
|
+
presence: {
|
|
365
|
+
allowEmpty: false,
|
|
366
|
+
},
|
|
367
|
+
datetime: {
|
|
368
|
+
latest: "",
|
|
369
|
+
earliest: "",
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
name: "Quote Date",
|
|
373
|
+
ignoreTimezones: true,
|
|
374
|
+
},
|
|
375
|
+
"Quote Price": {
|
|
376
|
+
type: FieldTypes.NUMBER,
|
|
377
|
+
constraints: {
|
|
378
|
+
type: FieldTypes.NUMBER,
|
|
379
|
+
presence: {
|
|
380
|
+
allowEmpty: false,
|
|
381
|
+
},
|
|
382
|
+
numericality: {
|
|
383
|
+
greaterThanOrEqualTo: "",
|
|
384
|
+
lessThanOrEqualTo: "",
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
name: "Quote Price",
|
|
388
|
+
},
|
|
389
|
+
"Works Start": {
|
|
390
|
+
type: FieldTypes.DATETIME,
|
|
391
|
+
constraints: {
|
|
392
|
+
type: FieldTypes.STRING,
|
|
393
|
+
length: {},
|
|
394
|
+
presence: false,
|
|
395
|
+
datetime: {
|
|
396
|
+
latest: "",
|
|
397
|
+
earliest: "",
|
|
398
|
+
},
|
|
399
|
+
},
|
|
400
|
+
name: "Works Start",
|
|
401
|
+
ignoreTimezones: true,
|
|
402
|
+
},
|
|
403
|
+
Address: {
|
|
404
|
+
type: FieldTypes.LONGFORM,
|
|
405
|
+
constraints: {
|
|
406
|
+
type: FieldTypes.STRING,
|
|
407
|
+
length: {},
|
|
408
|
+
presence: false,
|
|
409
|
+
},
|
|
410
|
+
name: "Address",
|
|
411
|
+
useRichText: null,
|
|
412
|
+
},
|
|
413
|
+
"Customer Name": {
|
|
414
|
+
type: FieldTypes.STRING,
|
|
415
|
+
constraints: {
|
|
416
|
+
type: FieldTypes.STRING,
|
|
417
|
+
length: {
|
|
418
|
+
maximum: null,
|
|
419
|
+
},
|
|
420
|
+
presence: false,
|
|
421
|
+
},
|
|
422
|
+
name: "Customer Name",
|
|
423
|
+
},
|
|
424
|
+
Notes: {
|
|
425
|
+
type: FieldTypes.LONGFORM,
|
|
426
|
+
constraints: {
|
|
427
|
+
type: FieldTypes.STRING,
|
|
428
|
+
length: {},
|
|
429
|
+
presence: false,
|
|
430
|
+
},
|
|
431
|
+
name: "Notes",
|
|
432
|
+
useRichText: null,
|
|
433
|
+
},
|
|
434
|
+
"Customer Phone": {
|
|
435
|
+
type: FieldTypes.STRING,
|
|
436
|
+
constraints: {
|
|
437
|
+
type: FieldTypes.STRING,
|
|
438
|
+
length: {
|
|
439
|
+
maximum: null,
|
|
440
|
+
},
|
|
441
|
+
presence: false,
|
|
442
|
+
},
|
|
443
|
+
name: "Customer Phone",
|
|
444
|
+
},
|
|
445
|
+
"Customer Email": {
|
|
446
|
+
type: FieldTypes.STRING,
|
|
447
|
+
constraints: {
|
|
448
|
+
type: FieldTypes.STRING,
|
|
449
|
+
length: {
|
|
450
|
+
maximum: null,
|
|
451
|
+
},
|
|
452
|
+
presence: false,
|
|
453
|
+
},
|
|
454
|
+
name: "Customer Email",
|
|
455
|
+
},
|
|
456
|
+
Assigned: {
|
|
457
|
+
name: "Assigned",
|
|
458
|
+
type: FieldTypes.LINK,
|
|
459
|
+
tableId: this.DEFAULT_EMPLOYEE_TABLE_ID,
|
|
460
|
+
fieldName: "Jobs",
|
|
461
|
+
relationshipType: RelationshipTypes.MANY_TO_MANY,
|
|
462
|
+
// sortable: true,
|
|
463
|
+
},
|
|
464
|
+
"Works End": {
|
|
465
|
+
type: "datetime",
|
|
466
|
+
constraints: {
|
|
467
|
+
type: "string",
|
|
468
|
+
length: {},
|
|
469
|
+
presence: false,
|
|
470
|
+
datetime: {
|
|
471
|
+
latest: "",
|
|
472
|
+
earliest: "",
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
name: "Works End",
|
|
476
|
+
ignoreTimezones: true,
|
|
477
|
+
},
|
|
478
|
+
"Updated Price": {
|
|
479
|
+
type: "number",
|
|
480
|
+
constraints: {
|
|
481
|
+
type: "number",
|
|
482
|
+
presence: false,
|
|
483
|
+
numericality: {
|
|
484
|
+
greaterThanOrEqualTo: "",
|
|
485
|
+
lessThanOrEqualTo: "",
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
|
+
name: "Updated Price",
|
|
489
|
+
},
|
|
490
|
+
...AUTO_COLUMNS,
|
|
491
|
+
},
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
exports.DEFAULT_EXPENSES_TABLE_SCHEMA = {
|
|
495
|
+
_id: this.DEFAULT_EXPENSES_TABLE_ID,
|
|
496
|
+
type: "internal",
|
|
497
|
+
views: {},
|
|
498
|
+
name: "Expenses",
|
|
499
|
+
sourceId: exports.DEFAULT_BB_DATASOURCE_ID,
|
|
500
|
+
primaryDisplay: "Expense ID",
|
|
501
|
+
schema: {
|
|
502
|
+
"Expense ID": {
|
|
503
|
+
name: "Expense ID",
|
|
504
|
+
type: FieldTypes.NUMBER,
|
|
505
|
+
subtype: AutoFieldSubTypes.AUTO_ID,
|
|
506
|
+
icon: "ri-magic-line",
|
|
507
|
+
autocolumn: true,
|
|
508
|
+
constraints: {
|
|
509
|
+
type: FieldTypes.NUMBER,
|
|
510
|
+
presence: false,
|
|
511
|
+
numericality: {
|
|
512
|
+
greaterThanOrEqualTo: "",
|
|
513
|
+
lessThanOrEqualTo: "",
|
|
514
|
+
},
|
|
515
|
+
},
|
|
516
|
+
},
|
|
517
|
+
"Expense Tags": {
|
|
518
|
+
type: FieldTypes.ARRAY,
|
|
519
|
+
constraints: {
|
|
520
|
+
type: FieldTypes.ARRAY,
|
|
521
|
+
presence: {
|
|
522
|
+
allowEmpty: false,
|
|
523
|
+
},
|
|
524
|
+
inclusion: [
|
|
525
|
+
"Fuel",
|
|
526
|
+
"Food",
|
|
527
|
+
"Materials",
|
|
528
|
+
"Repair",
|
|
529
|
+
"Equipment",
|
|
530
|
+
"Fees",
|
|
531
|
+
"Service",
|
|
532
|
+
"Office",
|
|
533
|
+
"Other",
|
|
534
|
+
],
|
|
535
|
+
},
|
|
536
|
+
name: "Expense Tags",
|
|
537
|
+
sortable: false,
|
|
538
|
+
},
|
|
539
|
+
Cost: {
|
|
540
|
+
type: FieldTypes.NUMBER,
|
|
541
|
+
constraints: {
|
|
542
|
+
type: FieldTypes.NUMBER,
|
|
543
|
+
presence: {
|
|
544
|
+
allowEmpty: false,
|
|
545
|
+
},
|
|
546
|
+
numericality: {
|
|
547
|
+
greaterThanOrEqualTo: "",
|
|
548
|
+
lessThanOrEqualTo: "",
|
|
549
|
+
},
|
|
550
|
+
},
|
|
551
|
+
name: "Cost",
|
|
552
|
+
},
|
|
553
|
+
Notes: {
|
|
554
|
+
type: FieldTypes.LONGFORM,
|
|
555
|
+
constraints: {
|
|
556
|
+
type: FieldTypes.STRING,
|
|
557
|
+
length: {},
|
|
558
|
+
presence: false,
|
|
559
|
+
},
|
|
560
|
+
name: "Notes",
|
|
561
|
+
useRichText: null,
|
|
562
|
+
},
|
|
563
|
+
"Payment Due": {
|
|
564
|
+
type: FieldTypes.DATETIME,
|
|
565
|
+
constraints: {
|
|
566
|
+
type: FieldTypes.STRING,
|
|
567
|
+
length: {},
|
|
568
|
+
presence: false,
|
|
569
|
+
datetime: {
|
|
570
|
+
latest: "",
|
|
571
|
+
earliest: "",
|
|
572
|
+
},
|
|
573
|
+
},
|
|
574
|
+
name: "Payment Due",
|
|
575
|
+
ignoreTimezones: true,
|
|
576
|
+
},
|
|
577
|
+
"Date Paid": {
|
|
578
|
+
type: FieldTypes.DATETIME,
|
|
579
|
+
constraints: {
|
|
580
|
+
type: FieldTypes.STRING,
|
|
581
|
+
length: {},
|
|
582
|
+
presence: false,
|
|
583
|
+
datetime: {
|
|
584
|
+
latest: "",
|
|
585
|
+
earliest: "",
|
|
586
|
+
},
|
|
587
|
+
},
|
|
588
|
+
name: "Date Paid",
|
|
589
|
+
ignoreTimezones: true,
|
|
590
|
+
},
|
|
591
|
+
Attachment: {
|
|
592
|
+
type: FieldTypes.ATTACHMENT,
|
|
593
|
+
constraints: {
|
|
594
|
+
type: FieldTypes.ARRAY,
|
|
595
|
+
presence: false,
|
|
596
|
+
},
|
|
597
|
+
name: "Attachment",
|
|
598
|
+
sortable: false,
|
|
599
|
+
},
|
|
600
|
+
...AUTO_COLUMNS,
|
|
601
|
+
},
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
exports.buildDefaultDocs = () => {
|
|
605
|
+
const inventoryData = tableImport(
|
|
606
|
+
this.DEFAULT_INVENTORY_TABLE_SCHEMA,
|
|
607
|
+
inventoryImport
|
|
608
|
+
)
|
|
609
|
+
|
|
610
|
+
const employeeData = tableImport(
|
|
611
|
+
this.DEFAULT_EMPLOYEE_TABLE_SCHEMA,
|
|
612
|
+
employeeImport
|
|
613
|
+
)
|
|
614
|
+
|
|
615
|
+
const jobData = tableImport(this.DEFAULT_JOBS_TABLE_SCHEMA, jobsImport)
|
|
616
|
+
|
|
617
|
+
const expensesData = tableImport(
|
|
618
|
+
this.DEFAULT_EXPENSES_TABLE_SCHEMA,
|
|
619
|
+
expensesImport
|
|
620
|
+
)
|
|
621
|
+
|
|
622
|
+
// Build one link doc for each employee/job
|
|
623
|
+
const jobEmployeeLinks = employeeData.rows.map((employee, index) => {
|
|
624
|
+
return new LinkDocument(
|
|
625
|
+
employeeData.table._id,
|
|
626
|
+
"Jobs",
|
|
627
|
+
employeeData.rows[index]._id,
|
|
628
|
+
jobData.table._id,
|
|
629
|
+
"Assigned",
|
|
630
|
+
jobData.rows[index]._id
|
|
631
|
+
)
|
|
632
|
+
})
|
|
633
|
+
|
|
634
|
+
return [
|
|
635
|
+
this.DEFAULT_BB_DATASOURCE,
|
|
636
|
+
inventoryData.table,
|
|
637
|
+
employeeData.table,
|
|
638
|
+
jobData.table,
|
|
639
|
+
expensesData.table,
|
|
640
|
+
...inventoryData.rows,
|
|
641
|
+
...employeeData.rows,
|
|
642
|
+
...jobData.rows,
|
|
643
|
+
...expensesData.rows,
|
|
644
|
+
...jobEmployeeLinks,
|
|
645
|
+
]
|
|
646
|
+
}
|