@budibase/server 2.1.30 → 2.1.32-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/__mocks__/aws-sdk.ts +14 -0
- package/__mocks__/node-fetch.ts +5 -1
- package/builder/assets/{index.bdbc5a13.js → index.3a6f5b99.js} +270 -270
- package/builder/assets/{index.534f6c29.css → index.7176fd99.css} +1 -1
- package/builder/index.html +2 -2
- package/coverage/clover.xml +9664 -2787
- package/coverage/coverage-final.json +162 -19
- package/coverage/lcov-report/index.html +621 -126
- package/coverage/lcov-report/src/api/controllers/analytics.ts.html +190 -0
- package/coverage/lcov-report/{api → src/api}/controllers/apikeys.js.html +10 -10
- package/coverage/lcov-report/src/api/controllers/application.ts.html +1981 -0
- package/coverage/lcov-report/src/api/controllers/auth.ts.html +301 -0
- package/coverage/lcov-report/{api → src/api}/controllers/automation.js.html +10 -10
- package/coverage/lcov-report/src/api/controllers/backup.ts.html +148 -0
- package/coverage/lcov-report/{api → src/api}/controllers/cloud.js.html +10 -10
- package/coverage/lcov-report/src/api/controllers/component.ts.html +256 -0
- package/coverage/lcov-report/{api → src/api}/controllers/datasource.js.html +10 -10
- package/coverage/lcov-report/src/api/controllers/deploy/Deployment.js.html +250 -0
- package/coverage/lcov-report/src/api/controllers/deploy/index.html +131 -0
- package/coverage/lcov-report/src/api/controllers/deploy/index.ts.html +730 -0
- package/coverage/lcov-report/{api/controllers/dev.js.html → src/api/controllers/dev.ts.html} +53 -71
- package/coverage/lcov-report/{api → src/api}/controllers/index.html +134 -29
- package/coverage/lcov-report/{api → src/api}/controllers/integration.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/controllers/layout.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/controllers/metadata.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/controllers/migrations.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/controllers/permission.js.html +10 -10
- package/coverage/lcov-report/src/api/controllers/plugin/file.ts.html +130 -0
- package/coverage/lcov-report/src/api/controllers/plugin/github.ts.html +310 -0
- package/coverage/lcov-report/src/api/controllers/plugin/index.html +206 -0
- package/coverage/lcov-report/src/api/controllers/plugin/index.ts.html +487 -0
- package/coverage/lcov-report/src/api/controllers/plugin/npm.ts.html +253 -0
- package/coverage/lcov-report/src/api/controllers/plugin/uploaders.ts.html +97 -0
- package/coverage/lcov-report/src/api/controllers/plugin/url.ts.html +121 -0
- package/coverage/lcov-report/src/api/controllers/plugin/utils.ts.html +142 -0
- package/coverage/lcov-report/src/api/controllers/public/applications.ts.html +334 -0
- package/coverage/lcov-report/src/api/controllers/public/index.html +191 -0
- package/coverage/lcov-report/src/api/controllers/public/mapping/applications.ts.html +181 -0
- package/coverage/lcov-report/src/api/controllers/public/mapping/index.html +191 -0
- package/coverage/lcov-report/src/api/controllers/public/mapping/index.ts.html +124 -0
- package/coverage/lcov-report/src/api/controllers/public/mapping/queries.ts.html +202 -0
- package/coverage/lcov-report/src/api/controllers/public/mapping/rows.ts.html +178 -0
- package/coverage/lcov-report/src/api/controllers/public/mapping/tables.ts.html +163 -0
- package/coverage/lcov-report/src/api/controllers/public/mapping/users.ts.html +181 -0
- package/coverage/lcov-report/src/api/controllers/public/queries.ts.html +145 -0
- package/coverage/lcov-report/src/api/controllers/public/rows.ts.html +328 -0
- package/coverage/lcov-report/src/api/controllers/public/tables.ts.html +253 -0
- package/coverage/lcov-report/src/api/controllers/public/users.ts.html +268 -0
- package/coverage/lcov-report/src/api/controllers/public/utils.ts.html +220 -0
- package/coverage/lcov-report/src/api/controllers/query/import/index.html +116 -0
- package/coverage/lcov-report/src/api/controllers/query/import/index.ts.html +376 -0
- package/coverage/lcov-report/src/api/controllers/query/import/sources/base/index.html +131 -0
- package/coverage/lcov-report/src/api/controllers/query/import/sources/base/index.ts.html +379 -0
- package/coverage/lcov-report/src/api/controllers/query/import/sources/base/openapi.ts.html +157 -0
- package/coverage/lcov-report/src/api/controllers/query/import/sources/curl.ts.html +403 -0
- package/coverage/lcov-report/src/api/controllers/query/import/sources/index.html +146 -0
- package/coverage/lcov-report/src/api/controllers/query/import/sources/openapi2.ts.html +586 -0
- package/coverage/lcov-report/src/api/controllers/query/import/sources/openapi3.ts.html +712 -0
- package/coverage/lcov-report/src/api/controllers/query/index.html +131 -0
- package/coverage/lcov-report/src/api/controllers/query/index.ts.html +976 -0
- package/coverage/lcov-report/{api → src/api}/controllers/query/validation.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/controllers/role.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/controllers/routing.js.html +10 -10
- package/coverage/lcov-report/src/api/controllers/row/ExternalRequest.ts.html +2332 -0
- package/coverage/lcov-report/{api → src/api}/controllers/row/external.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/controllers/row/index.html +48 -18
- package/coverage/lcov-report/src/api/controllers/row/index.ts.html +541 -0
- package/coverage/lcov-report/{api → src/api}/controllers/row/internal.js.html +12 -12
- package/coverage/lcov-report/{api → src/api}/controllers/row/internalSearch.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/controllers/row/staticFormula.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/controllers/row/utils.js.html +10 -10
- package/coverage/lcov-report/src/api/controllers/screen.ts.html +451 -0
- package/coverage/lcov-report/{api → src/api}/controllers/script.js.html +10 -10
- package/coverage/lcov-report/src/api/controllers/static/index.html +116 -0
- package/coverage/lcov-report/src/api/controllers/static/index.ts.html +700 -0
- package/coverage/lcov-report/{api → src/api}/controllers/table/bulkFormula.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/controllers/table/external.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/controllers/table/index.html +49 -19
- package/coverage/lcov-report/{api → src/api}/controllers/table/index.js.html +10 -10
- package/coverage/lcov-report/src/api/controllers/table/internal.ts.html +664 -0
- package/coverage/lcov-report/src/api/controllers/table/utils.ts.html +1240 -0
- package/coverage/lcov-report/{api → src/api}/controllers/templates.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/controllers/user.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/controllers/view/exporters.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/controllers/view/index.html +10 -10
- package/coverage/lcov-report/{api → src/api}/controllers/view/index.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/controllers/view/utils.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/controllers/view/viewBuilder.js.html +10 -10
- package/coverage/lcov-report/src/api/controllers/webhook.ts.html +379 -0
- package/coverage/lcov-report/{api → src/api}/index.html +10 -10
- package/coverage/lcov-report/{api → src/api}/index.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/routes/analytics.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/routes/apikeys.js.html +10 -10
- package/coverage/lcov-report/src/api/routes/application.ts.html +199 -0
- package/coverage/lcov-report/src/api/routes/auth.ts.html +109 -0
- package/coverage/lcov-report/{api → src/api}/routes/automation.js.html +14 -14
- package/coverage/lcov-report/src/api/routes/backup.ts.html +115 -0
- package/coverage/lcov-report/{api → src/api}/routes/cloud.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/routes/component.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/routes/datasource.js.html +15 -15
- package/coverage/lcov-report/{api → src/api}/routes/deploy.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/routes/dev.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/routes/index.html +137 -17
- package/coverage/lcov-report/src/api/routes/index.ts.html +289 -0
- package/coverage/lcov-report/{api → src/api}/routes/integration.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/routes/layout.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/routes/metadata.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/routes/migrations.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/routes/permission.js.html +10 -10
- package/coverage/lcov-report/src/api/routes/plugin.ts.html +127 -0
- package/coverage/lcov-report/src/api/routes/public/applications.ts.html +541 -0
- package/coverage/lcov-report/src/api/routes/public/index.html +191 -0
- package/coverage/lcov-report/src/api/routes/public/index.ts.html +502 -0
- package/coverage/lcov-report/src/api/routes/public/middleware/index.html +116 -0
- package/coverage/lcov-report/src/api/routes/public/middleware/mapper.ts.html +328 -0
- package/coverage/lcov-report/src/api/routes/public/queries.ts.html +313 -0
- package/coverage/lcov-report/src/api/routes/public/rows.ts.html +598 -0
- package/coverage/lcov-report/src/api/routes/public/tables.ts.html +586 -0
- package/coverage/lcov-report/src/api/routes/public/users.ts.html +511 -0
- package/coverage/lcov-report/src/api/routes/public/utils/Endpoint.ts.html +238 -0
- package/coverage/lcov-report/src/api/routes/public/utils/index.html +116 -0
- package/coverage/lcov-report/{api → src/api}/routes/query.js.html +15 -15
- package/coverage/lcov-report/{api → src/api}/routes/role.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/routes/routing.js.html +10 -10
- package/coverage/lcov-report/src/api/routes/row.ts.html +889 -0
- package/coverage/lcov-report/{api → src/api}/routes/screen.js.html +10 -10
- package/coverage/lcov-report/{api → src/api}/routes/script.js.html +10 -10
- package/coverage/lcov-report/src/api/routes/static.ts.html +289 -0
- package/coverage/lcov-report/{api → src/api}/routes/table.js.html +13 -13
- package/coverage/lcov-report/{api → src/api}/routes/templates.js.html +10 -10
- package/coverage/lcov-report/src/api/routes/tests/utilities/TestFunctions.ts.html +556 -0
- package/coverage/lcov-report/src/api/routes/tests/utilities/index.html +131 -0
- package/coverage/lcov-report/src/api/routes/tests/utilities/index.js.html +367 -0
- package/coverage/lcov-report/{api → src/api}/routes/user.js.html +20 -20
- package/coverage/lcov-report/{api → src/api}/routes/utils/index.html +10 -10
- package/coverage/lcov-report/{api → src/api}/routes/utils/validators.js.html +15 -15
- package/coverage/lcov-report/{api → src/api}/routes/view.js.html +13 -13
- package/coverage/lcov-report/src/api/routes/webhook.ts.html +166 -0
- package/coverage/lcov-report/src/app.ts.html +403 -0
- package/coverage/lcov-report/{automations → src/automations}/actions.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/automationUtils.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/bullboard.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/index.html +34 -19
- package/coverage/lcov-report/{automations → src/automations}/index.js.html +10 -10
- package/coverage/lcov-report/src/automations/logging/index.html +116 -0
- package/coverage/lcov-report/src/automations/logging/index.ts.html +199 -0
- package/coverage/lcov-report/{automations → src/automations}/steps/bash.js.html +10 -10
- package/coverage/lcov-report/src/automations/steps/createRow.ts.html +367 -0
- package/coverage/lcov-report/{automations → src/automations}/steps/delay.js.html +10 -10
- package/coverage/lcov-report/src/automations/steps/deleteRow.ts.html +334 -0
- package/coverage/lcov-report/{automations → src/automations}/steps/discord.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/steps/executeQuery.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/steps/executeScript.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/steps/filter.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/steps/index.html +56 -26
- package/coverage/lcov-report/{automations → src/automations}/steps/integromat.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/steps/loop.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/steps/outgoingWebhook.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/steps/queryRows.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/steps/sendSmtpEmail.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/steps/serverLog.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/steps/slack.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/steps/updateRow.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/steps/utils.js.html +19 -19
- package/coverage/lcov-report/{automations → src/automations}/steps/zapier.js.html +10 -10
- package/coverage/lcov-report/src/automations/tests/utilities/index.html +116 -0
- package/coverage/lcov-report/src/automations/tests/utilities/index.js.html +256 -0
- package/coverage/lcov-report/{automations → src/automations}/triggerInfo/app.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/triggerInfo/cron.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/triggerInfo/index.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/triggerInfo/index.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/triggerInfo/rowDeleted.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/triggerInfo/rowSaved.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/triggerInfo/rowUpdated.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/triggerInfo/webhook.js.html +10 -10
- package/coverage/lcov-report/{automations → src/automations}/triggers.js.html +10 -10
- package/coverage/lcov-report/src/automations/utils.ts.html +886 -0
- package/coverage/lcov-report/{constants → src/constants}/index.html +10 -10
- package/coverage/lcov-report/{constants → src/constants}/index.js.html +10 -10
- package/coverage/lcov-report/{constants → src/constants}/layouts.js.html +10 -10
- package/coverage/lcov-report/{constants → src/constants}/screens.js.html +10 -10
- package/coverage/lcov-report/src/db/dynamoClient.js.html +466 -0
- package/coverage/lcov-report/{db → src/db}/inMemoryView.js.html +12 -12
- package/coverage/lcov-report/{db → src/db}/index.html +42 -27
- package/coverage/lcov-report/{db → src/db}/index.js.html +18 -18
- package/coverage/lcov-report/{db → src/db}/linkedRows/LinkController.js.html +10 -10
- package/coverage/lcov-report/{db → src/db}/linkedRows/index.html +10 -10
- package/coverage/lcov-report/{db → src/db}/linkedRows/index.js.html +10 -10
- package/coverage/lcov-report/{db → src/db}/linkedRows/linkUtils.js.html +10 -10
- package/coverage/lcov-report/{db → src/db}/newid.js.html +10 -10
- package/coverage/lcov-report/{db/utils.js.html → src/db/utils.ts.html} +104 -152
- package/coverage/lcov-report/src/definitions/automations.ts.html +181 -0
- package/coverage/lcov-report/src/definitions/datasource.ts.html +235 -0
- package/coverage/lcov-report/src/definitions/index.html +131 -0
- package/coverage/lcov-report/src/environment.js.html +445 -0
- package/coverage/lcov-report/{events → src/events}/AutomationEmitter.js.html +10 -10
- package/coverage/lcov-report/{events → src/events}/index.html +10 -10
- package/coverage/lcov-report/{events → src/events}/index.js.html +10 -10
- package/coverage/lcov-report/{events → src/events}/utils.js.html +10 -10
- package/coverage/lcov-report/src/index.html +206 -0
- package/coverage/lcov-report/src/index.ts.html +133 -0
- package/coverage/lcov-report/src/integrations/airtable.ts.html +529 -0
- package/coverage/lcov-report/src/integrations/arangodb.ts.html +415 -0
- package/coverage/lcov-report/src/integrations/base/index.html +161 -0
- package/coverage/lcov-report/src/integrations/base/query.ts.html +133 -0
- package/coverage/lcov-report/src/integrations/base/sql.ts.html +1951 -0
- package/coverage/lcov-report/src/integrations/base/sqlTable.ts.html +691 -0
- package/coverage/lcov-report/src/integrations/base/utils.ts.html +121 -0
- package/coverage/lcov-report/src/integrations/couchdb.ts.html +406 -0
- package/coverage/lcov-report/src/integrations/dynamodb.ts.html +745 -0
- package/coverage/lcov-report/src/integrations/elasticsearch.ts.html +634 -0
- package/coverage/lcov-report/src/integrations/firebase.ts.html +646 -0
- package/coverage/lcov-report/src/integrations/googlesheets.ts.html +1312 -0
- package/coverage/lcov-report/src/integrations/index.html +371 -0
- package/coverage/lcov-report/src/integrations/index.ts.html +433 -0
- package/coverage/lcov-report/src/integrations/microsoftSqlServer.ts.html +1006 -0
- package/coverage/lcov-report/src/integrations/mongodb.ts.html +1867 -0
- package/coverage/lcov-report/src/integrations/mysql.ts.html +952 -0
- package/coverage/lcov-report/src/integrations/oracle.ts.html +1474 -0
- package/coverage/lcov-report/src/integrations/postgres.ts.html +1069 -0
- package/coverage/lcov-report/src/integrations/queries/index.html +116 -0
- package/coverage/lcov-report/src/integrations/queries/sql.ts.html +463 -0
- package/coverage/lcov-report/src/integrations/redis.ts.html +550 -0
- package/coverage/lcov-report/src/integrations/rest.ts.html +1381 -0
- package/coverage/lcov-report/src/integrations/s3.ts.html +862 -0
- package/coverage/lcov-report/src/integrations/snowflake.ts.html +376 -0
- package/coverage/lcov-report/{integrations → src/integrations}/tests/TestConfiguration.js.html +10 -10
- package/coverage/lcov-report/{integrations → src/integrations}/tests/index.html +10 -10
- package/coverage/lcov-report/src/integrations/utils.ts.html +1006 -0
- package/coverage/lcov-report/{middleware/appInfo.js.html → src/middleware/appInfo.ts.html} +31 -28
- package/coverage/lcov-report/src/middleware/authorized.ts.html +481 -0
- package/coverage/lcov-report/{middleware/builder.js.html → src/middleware/builder.ts.html} +43 -37
- package/coverage/lcov-report/{middleware/currentapp.js.html → src/middleware/currentapp.ts.html} +77 -68
- package/coverage/lcov-report/{middleware → src/middleware}/index.html +78 -63
- package/coverage/lcov-report/{middleware/joi-validator.js.html → src/middleware/joi-validator.ts.html} +25 -22
- package/coverage/lcov-report/{middleware/publicApi.js.html → src/middleware/publicApi.ts.html} +24 -24
- package/coverage/lcov-report/{middleware/resourceId.js.html → src/middleware/resourceId.ts.html} +40 -25
- package/coverage/lcov-report/{middleware/selfhost.js.html → src/middleware/selfhost.ts.html} +25 -19
- package/coverage/lcov-report/{middleware/utils.js.html → src/middleware/utils.ts.html} +19 -13
- package/coverage/lcov-report/src/migrations/functions/appUrls.ts.html +187 -0
- package/coverage/lcov-report/src/migrations/functions/backfill/app/automations.ts.html +163 -0
- package/coverage/lcov-report/src/migrations/functions/backfill/app/datasources.ts.html +151 -0
- package/coverage/lcov-report/src/migrations/functions/backfill/app/index.html +206 -0
- package/coverage/lcov-report/src/migrations/functions/backfill/app/layouts.ts.html +172 -0
- package/coverage/lcov-report/src/migrations/functions/backfill/app/queries.ts.html +226 -0
- package/coverage/lcov-report/src/migrations/functions/backfill/app/roles.ts.html +151 -0
- package/coverage/lcov-report/src/migrations/functions/backfill/app/screens.ts.html +151 -0
- package/coverage/lcov-report/src/migrations/functions/backfill/app/tables.ts.html +166 -0
- package/coverage/lcov-report/src/migrations/functions/backfill/app.ts.html +532 -0
- package/coverage/lcov-report/src/migrations/functions/backfill/global/configs.ts.html +283 -0
- package/coverage/lcov-report/src/migrations/functions/backfill/global/index.html +146 -0
- package/coverage/lcov-report/src/migrations/functions/backfill/global/quotas.ts.html +265 -0
- package/coverage/lcov-report/src/migrations/functions/backfill/global/users.ts.html +232 -0
- package/coverage/lcov-report/src/migrations/functions/backfill/global.ts.html +724 -0
- package/coverage/lcov-report/src/migrations/functions/backfill/index.html +161 -0
- package/coverage/lcov-report/src/migrations/functions/backfill/index.ts.html +106 -0
- package/coverage/lcov-report/src/migrations/functions/backfill/installation.ts.html +235 -0
- package/coverage/lcov-report/src/migrations/functions/index.html +146 -0
- package/coverage/lcov-report/src/migrations/functions/syncQuotas.ts.html +130 -0
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/index.html +161 -0
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/index.ts.html +94 -0
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncApps.ts.html +130 -0
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncPlugins.ts.html +115 -0
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncRows.ts.html +172 -0
- package/coverage/lcov-report/src/migrations/functions/userEmailViewCasing.ts.html +124 -0
- package/coverage/lcov-report/src/migrations/index.html +116 -0
- package/coverage/lcov-report/src/migrations/index.ts.html +403 -0
- package/coverage/lcov-report/src/migrations/tests/helpers.ts.html +205 -0
- package/coverage/lcov-report/src/migrations/tests/index.html +131 -0
- package/coverage/lcov-report/src/migrations/tests/structures.ts.html +283 -0
- package/coverage/lcov-report/src/module.d.ts.html +127 -0
- package/coverage/lcov-report/src/sdk/app/automations/index.html +131 -0
- package/coverage/lcov-report/src/sdk/app/automations/index.ts.html +100 -0
- package/coverage/lcov-report/src/sdk/app/automations/webhook.ts.html +214 -0
- package/coverage/lcov-report/src/sdk/app/backups/constants.ts.html +91 -0
- package/coverage/lcov-report/src/sdk/app/backups/exports.ts.html +598 -0
- package/coverage/lcov-report/src/sdk/app/backups/imports.ts.html +694 -0
- package/coverage/lcov-report/src/sdk/app/backups/index.html +176 -0
- package/coverage/lcov-report/src/sdk/app/backups/index.ts.html +112 -0
- package/coverage/lcov-report/src/sdk/app/backups/statistics.ts.html +292 -0
- package/coverage/lcov-report/src/sdk/app/tables/index.html +116 -0
- package/coverage/lcov-report/src/sdk/app/tables/index.ts.html +265 -0
- package/coverage/lcov-report/{utilities/routing → src/sdk}/index.html +10 -10
- package/coverage/lcov-report/src/sdk/index.ts.html +130 -0
- package/coverage/lcov-report/src/startup.ts.html +499 -0
- package/coverage/lcov-report/src/tests/utilities/TestConfiguration.js.html +1873 -0
- package/coverage/lcov-report/src/tests/utilities/controllers.js.html +133 -0
- package/coverage/lcov-report/src/tests/utilities/index.html +161 -0
- package/coverage/lcov-report/src/tests/utilities/index.js.html +118 -0
- package/coverage/lcov-report/src/tests/utilities/structures.js.html +652 -0
- package/coverage/lcov-report/src/threads/automation.ts.html +1597 -0
- package/coverage/lcov-report/src/threads/index.html +161 -0
- package/coverage/lcov-report/src/threads/index.ts.html +418 -0
- package/coverage/lcov-report/src/threads/query.ts.html +976 -0
- package/coverage/lcov-report/src/threads/utils.ts.html +376 -0
- package/coverage/lcov-report/{utilities → src/utilities}/budibaseDir.js.html +10 -10
- package/coverage/lcov-report/{utilities → src/utilities}/centralPath.js.html +10 -10
- package/coverage/lcov-report/{utilities → src/utilities}/csvParser.js.html +10 -10
- package/coverage/lcov-report/src/utilities/fileSystem/clientLibrary.js.html +547 -0
- package/coverage/lcov-report/src/utilities/fileSystem/index.html +161 -0
- package/coverage/lcov-report/src/utilities/fileSystem/index.js.html +1141 -0
- package/coverage/lcov-report/src/utilities/fileSystem/processor.js.html +148 -0
- package/coverage/lcov-report/src/utilities/fileSystem/utilities.js.html +193 -0
- package/coverage/lcov-report/{utilities/global.js.html → src/utilities/global.ts.html} +107 -74
- package/coverage/lcov-report/{utilities → src/utilities}/index.html +42 -27
- package/coverage/lcov-report/{utilities → src/utilities}/index.js.html +10 -10
- package/coverage/lcov-report/{utilities → src/utilities}/plugins.js.html +10 -10
- package/coverage/lcov-report/{utilities → src/utilities}/queue/inMemoryQueue.js.html +10 -10
- package/coverage/lcov-report/{utilities → src/utilities}/queue/index.html +10 -10
- package/coverage/lcov-report/src/utilities/redis.js.html +340 -0
- package/coverage/lcov-report/{api/controllers/query → src/utilities/routing}/index.html +8 -8
- package/coverage/lcov-report/{utilities → src/utilities}/routing/index.js.html +10 -10
- package/coverage/lcov-report/{utilities → src/utilities}/rowProcessor/index.html +10 -10
- package/coverage/lcov-report/{utilities → src/utilities}/rowProcessor/index.js.html +10 -10
- package/coverage/lcov-report/{utilities → src/utilities}/rowProcessor/utils.js.html +10 -10
- package/coverage/lcov-report/{utilities → src/utilities}/scriptRunner.js.html +10 -10
- package/coverage/lcov-report/{utilities → src/utilities}/security.js.html +22 -22
- package/coverage/lcov-report/{utilities → src/utilities}/statusCodes.js.html +10 -10
- package/coverage/lcov-report/{utilities → src/utilities}/usageQuota/index.html +10 -10
- package/coverage/lcov-report/{utilities → src/utilities}/usageQuota/rows.js.html +10 -10
- package/coverage/lcov-report/{utilities → src/utilities}/usageQuota/usageQuoteReset.js.html +10 -10
- package/coverage/lcov-report/{utilities → src/utilities}/users.js.html +10 -10
- package/coverage/lcov-report/{utilities → src/utilities}/workerRequests.js.html +13 -13
- package/coverage/lcov-report/src/watch.ts.html +199 -0
- package/coverage/lcov-report/src/websocket.ts.html +163 -0
- package/coverage/lcov.info +17589 -5003
- package/dist/api/controllers/application.js +35 -43
- package/dist/api/controllers/deploy/index.js +13 -16
- package/dist/api/controllers/dev.js +96 -81
- package/dist/api/controllers/public/applications.js +17 -9
- package/dist/api/controllers/query/index.js +10 -13
- package/dist/api/controllers/row/ExternalRequest.js +6 -1
- package/dist/api/controllers/row/index.js +16 -7
- package/dist/api/controllers/row/internal.js +2 -2
- package/dist/api/controllers/table/internal.js +4 -4
- package/dist/api/routes/automation.js +3 -3
- package/dist/api/routes/datasource.js +4 -4
- package/dist/api/routes/public/index.js +9 -9
- package/dist/api/routes/query.js +4 -4
- package/dist/api/routes/row.js +11 -11
- package/dist/api/routes/static.js +3 -3
- package/dist/api/routes/table.js +2 -2
- package/dist/api/routes/user.js +9 -9
- package/dist/api/routes/utils/validators.js +4 -4
- package/dist/api/routes/view.js +2 -2
- package/dist/automations/tests/utilities/index.js +21 -12
- package/dist/automations/utils.js +9 -8
- package/dist/db/inMemoryView.js +2 -2
- package/dist/db/utils.js +145 -118
- package/dist/integrations/elasticsearch.js +26 -2
- package/dist/integrations/googlesheets.js +4 -6
- package/dist/integrations/s3.js +157 -1
- package/dist/middleware/appInfo.js +14 -9
- package/dist/middleware/authorized.js +5 -5
- package/dist/middleware/builder.js +41 -40
- package/dist/middleware/currentapp.js +39 -37
- package/dist/middleware/joi-validator.js +17 -10
- package/dist/middleware/publicApi.js +5 -6
- package/dist/middleware/resourceId.js +16 -9
- package/dist/middleware/selfhost.js +5 -4
- package/dist/middleware/utils.js +5 -2
- package/dist/migrations/functions/backfill/global.js +1 -1
- package/dist/migrations/functions/usageQuotas/syncRows.js +1 -1
- package/dist/package.json +10 -44
- package/dist/sdk/app/tables/index.js +4 -4
- package/dist/tests/utilities/TestConfiguration.js +12 -10
- package/dist/tests/utilities/structures.js +2 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/global.js +87 -66
- package/dist/utilities/security.js +10 -10
- package/dist/utilities/workerRequests.js +3 -3
- package/jest.config.ts +33 -0
- package/package.json +11 -45
- package/scripts/localdomain.js +34 -6
- package/src/api/controllers/application.ts +34 -39
- package/src/api/controllers/auth.ts +3 -2
- package/src/api/controllers/deploy/index.ts +13 -25
- package/src/api/controllers/{dev.js → dev.ts} +31 -37
- package/src/api/controllers/public/applications.ts +15 -9
- package/src/api/controllers/query/index.ts +11 -14
- package/src/api/controllers/row/ExternalRequest.ts +5 -3
- package/src/api/controllers/row/index.ts +17 -9
- package/src/api/controllers/row/internal.js +2 -2
- package/src/api/controllers/table/internal.ts +4 -4
- package/src/api/routes/automation.js +4 -4
- package/src/api/routes/datasource.js +5 -5
- package/src/api/routes/public/index.ts +10 -10
- package/src/api/routes/public/tests/compare.spec.js +1 -1
- package/src/api/routes/query.js +5 -5
- package/src/api/routes/row.ts +12 -12
- package/src/api/routes/static.ts +5 -5
- package/src/api/routes/table.js +3 -3
- package/src/api/routes/tests/analytics.spec.js +1 -1
- package/src/api/routes/tests/query.spec.js +15 -10
- package/src/api/routes/tests/role.spec.js +5 -5
- package/src/api/routes/tests/static.spec.js +2 -2
- package/src/api/routes/tests/table.spec.js +38 -35
- package/src/api/routes/user.js +10 -10
- package/src/api/routes/utils/validators.js +5 -5
- package/src/api/routes/view.js +3 -3
- package/src/automations/tests/updateRow.spec.js +0 -1
- package/src/automations/tests/utilities/index.js +10 -4
- package/src/automations/utils.ts +9 -12
- package/src/db/inMemoryView.js +2 -2
- package/src/db/tests/linkController.spec.js +73 -57
- package/src/db/tests/linkTests.spec.js +17 -14
- package/src/db/{utils.js → utils.ts} +76 -92
- package/src/integrations/elasticsearch.ts +32 -2
- package/src/integrations/googlesheets.ts +4 -7
- package/src/integrations/s3.ts +179 -3
- package/src/integrations/tests/s3.spec.ts +85 -1
- package/src/middleware/appInfo.ts +20 -0
- package/src/middleware/authorized.ts +6 -6
- package/src/middleware/{builder.js → builder.ts} +17 -15
- package/src/middleware/{currentapp.js → currentapp.ts} +42 -39
- package/src/middleware/{joi-validator.js → joi-validator.ts} +9 -8
- package/src/middleware/publicApi.ts +21 -0
- package/src/middleware/{resourceId.js → resourceId.ts} +16 -11
- package/src/middleware/{selfhost.js → selfhost.ts} +4 -2
- package/src/middleware/tests/authorized.spec.js +5 -5
- package/src/middleware/tests/currentapp.spec.js +118 -63
- package/src/middleware/{utils.js → utils.ts} +3 -1
- package/src/migrations/functions/backfill/app/tables.ts +2 -5
- package/src/migrations/functions/backfill/global.ts +1 -1
- package/src/migrations/functions/usageQuotas/syncRows.ts +2 -2
- package/src/sdk/app/backups/imports.ts +4 -7
- package/src/sdk/app/backups/statistics.ts +9 -18
- package/src/sdk/app/tables/index.ts +6 -7
- package/{scripts/jestSetup.js → src/tests/jestSetup.ts} +11 -2
- package/src/tests/utilities/TestConfiguration.js +12 -10
- package/src/tests/utilities/structures.js +2 -2
- package/src/threads/automation.ts +1 -1
- package/src/utilities/global.ts +138 -0
- package/src/utilities/security.js +12 -12
- package/src/utilities/workerRequests.js +3 -3
- package/tsconfig.json +3 -1
- package/src/middleware/appInfo.js +0 -19
- package/src/middleware/publicApi.js +0 -21
- package/src/utilities/global.js +0 -127
package/dist/db/inMemoryView.js
CHANGED
|
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
const newid = require("./newid");
|
|
12
12
|
// bypass the main application db config
|
|
13
13
|
// use in memory pouchdb directly
|
|
14
|
-
const { getPouch,
|
|
14
|
+
const { getPouch, closePouchDB } = require("@budibase/backend-core/db");
|
|
15
15
|
const Pouch = getPouch({ inMemory: true });
|
|
16
16
|
exports.runView = (view, calculation, group, data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
17
|
// use a different ID each time for the DB, make sure they
|
|
@@ -48,6 +48,6 @@ exports.runView = (view, calculation, group, data) => __awaiter(void 0, void 0,
|
|
|
48
48
|
}
|
|
49
49
|
finally {
|
|
50
50
|
yield db.destroy();
|
|
51
|
-
yield
|
|
51
|
+
yield closePouchDB(db);
|
|
52
52
|
}
|
|
53
53
|
});
|
package/dist/db/utils.js
CHANGED
|
@@ -1,87 +1,93 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generateMemoryViewID = exports.getMetadataParams = exports.generateMetadataID = exports.generateUserFlagID = exports.getQueryParams = exports.getAutomationMetadataParams = exports.generateAutomationMetadataID = exports.generateQueryID = exports.getDatasourceParams = exports.generateDatasourceID = exports.getWebhookParams = exports.generateWebhookID = exports.getScreenParams = exports.generateScreenID = exports.getLayoutParams = exports.generateLayoutID = exports.getLinkParams = exports.generateLinkID = exports.generateAutomationID = exports.getAutomationParams = exports.getTableIDFromRowID = exports.generateTableID = exports.getTableParams = exports.getGlobalIDFromUserMetadataID = exports.generateUserMetadataID = exports.getUserMetadataParams = exports.generateRowID = exports.getRowParams = exports.getDocParams = exports.getQueryIndex = exports.getRoleParams = exports.generateRoleID = exports.generateDevAppID = exports.generateAppID = exports.UNICODE_MAX = exports.InternalTables = exports.ViewName = exports.TABLE_ROW_PREFIX = exports.LINK_USER_METADATA_PREFIX = exports.USER_METDATA_PREFIX = exports.isProdAppID = exports.isDevAppID = exports.APP_DEV_PREFIX = exports.APP_PREFIX = exports.DocumentType = exports.StaticDatabases = exports.SEPARATOR = exports.BudibaseInternalDB = exports.SearchIndexes = exports.AppStatus = void 0;
|
|
7
|
+
exports.getMultiIDParams = exports.generatePluginID = exports.getMemoryViewParams = void 0;
|
|
8
|
+
const newid_1 = __importDefault(require("./newid"));
|
|
9
|
+
const backend_core_1 = require("@budibase/backend-core");
|
|
10
|
+
exports.AppStatus = {
|
|
6
11
|
DEV: "development",
|
|
7
12
|
ALL: "all",
|
|
8
13
|
DEPLOYED: "published",
|
|
9
14
|
};
|
|
10
|
-
|
|
11
|
-
const SearchIndexes = {
|
|
15
|
+
exports.SearchIndexes = {
|
|
12
16
|
ROWS: "rows",
|
|
13
17
|
};
|
|
14
|
-
exports.
|
|
15
|
-
const BudibaseInternalDB = {
|
|
18
|
+
exports.BudibaseInternalDB = {
|
|
16
19
|
_id: "bb_internal",
|
|
17
20
|
type: "budibase",
|
|
18
21
|
name: "Budibase DB",
|
|
19
22
|
source: "BUDIBASE",
|
|
20
23
|
config: {},
|
|
21
24
|
};
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
exports.
|
|
25
|
-
exports.
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
30
|
-
exports.
|
|
31
|
-
exports.
|
|
32
|
-
exports.
|
|
33
|
-
exports.
|
|
34
|
-
exports.
|
|
35
|
-
exports.
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
38
|
-
exports.
|
|
39
|
-
exports.
|
|
40
|
-
exports.
|
|
41
|
-
exports.
|
|
42
|
-
exports.
|
|
43
|
-
exports.
|
|
44
|
-
exports.
|
|
45
|
-
exports.
|
|
46
|
-
exports.generateUserMetadataID = generateUserMetadataID;
|
|
47
|
-
exports.getGlobalIDFromUserMetadataID = getGlobalIDFromUserMetadataID;
|
|
25
|
+
exports.SEPARATOR = backend_core_1.db.SEPARATOR;
|
|
26
|
+
exports.StaticDatabases = backend_core_1.db.StaticDatabases;
|
|
27
|
+
exports.DocumentType = backend_core_1.db.DocumentType;
|
|
28
|
+
exports.APP_PREFIX = backend_core_1.db.APP_PREFIX;
|
|
29
|
+
exports.APP_DEV_PREFIX = backend_core_1.db.APP_DEV_PREFIX;
|
|
30
|
+
exports.isDevAppID = backend_core_1.db.isDevAppID;
|
|
31
|
+
exports.isProdAppID = backend_core_1.db.isProdAppID;
|
|
32
|
+
exports.USER_METDATA_PREFIX = `${exports.DocumentType.ROW}${exports.SEPARATOR}${backend_core_1.db.InternalTable.USER_METADATA}${exports.SEPARATOR}`;
|
|
33
|
+
exports.LINK_USER_METADATA_PREFIX = `${exports.DocumentType.LINK}${exports.SEPARATOR}${backend_core_1.db.InternalTable.USER_METADATA}${exports.SEPARATOR}`;
|
|
34
|
+
exports.TABLE_ROW_PREFIX = `${exports.DocumentType.ROW}${exports.SEPARATOR}${exports.DocumentType.TABLE}`;
|
|
35
|
+
exports.ViewName = backend_core_1.db.ViewName;
|
|
36
|
+
exports.InternalTables = backend_core_1.db.InternalTable;
|
|
37
|
+
exports.UNICODE_MAX = backend_core_1.db.UNICODE_MAX;
|
|
38
|
+
exports.generateAppID = backend_core_1.db.generateAppID;
|
|
39
|
+
exports.generateDevAppID = backend_core_1.db.getDevelopmentAppID;
|
|
40
|
+
exports.generateRoleID = backend_core_1.db.generateRoleID;
|
|
41
|
+
exports.getRoleParams = backend_core_1.db.getRoleParams;
|
|
42
|
+
exports.getQueryIndex = backend_core_1.db.getQueryIndex;
|
|
43
|
+
exports.getDocParams = backend_core_1.db.getDocParams;
|
|
44
|
+
exports.getRowParams = backend_core_1.db.getRowParams;
|
|
45
|
+
exports.generateRowID = backend_core_1.db.generateRowID;
|
|
46
|
+
exports.getUserMetadataParams = backend_core_1.db.getUserMetadataParams;
|
|
47
|
+
exports.generateUserMetadataID = backend_core_1.db.generateUserMetadataID;
|
|
48
|
+
exports.getGlobalIDFromUserMetadataID = backend_core_1.db.getGlobalIDFromUserMetadataID;
|
|
48
49
|
/**
|
|
49
50
|
* Gets parameters for retrieving tables, this is a utility function for the getDocParams function.
|
|
50
51
|
*/
|
|
51
|
-
|
|
52
|
-
return getDocParams(DocumentType.TABLE, tableId, otherProps);
|
|
53
|
-
}
|
|
52
|
+
function getTableParams(tableId, otherProps = {}) {
|
|
53
|
+
return (0, exports.getDocParams)(exports.DocumentType.TABLE, tableId, otherProps);
|
|
54
|
+
}
|
|
55
|
+
exports.getTableParams = getTableParams;
|
|
54
56
|
/**
|
|
55
57
|
* Generates a new table ID.
|
|
56
58
|
* @returns {string} The new table ID which the table doc can be stored under.
|
|
57
59
|
*/
|
|
58
|
-
|
|
59
|
-
return `${DocumentType.TABLE}${SEPARATOR}${
|
|
60
|
-
}
|
|
60
|
+
function generateTableID() {
|
|
61
|
+
return `${exports.DocumentType.TABLE}${exports.SEPARATOR}${(0, newid_1.default)()}`;
|
|
62
|
+
}
|
|
63
|
+
exports.generateTableID = generateTableID;
|
|
61
64
|
/**
|
|
62
65
|
* Given a row ID this will find the table ID within it (only works for internal tables).
|
|
63
66
|
* @param {string} rowId The ID of the row.
|
|
64
67
|
* @returns {string} The table ID.
|
|
65
68
|
*/
|
|
66
|
-
|
|
69
|
+
function getTableIDFromRowID(rowId) {
|
|
67
70
|
const components = rowId
|
|
68
|
-
.split(DocumentType.TABLE + SEPARATOR)[1]
|
|
69
|
-
.split(SEPARATOR);
|
|
70
|
-
return `${DocumentType.TABLE}${SEPARATOR}${components[0]}`;
|
|
71
|
-
}
|
|
71
|
+
.split(exports.DocumentType.TABLE + exports.SEPARATOR)[1]
|
|
72
|
+
.split(exports.SEPARATOR);
|
|
73
|
+
return `${exports.DocumentType.TABLE}${exports.SEPARATOR}${components[0]}`;
|
|
74
|
+
}
|
|
75
|
+
exports.getTableIDFromRowID = getTableIDFromRowID;
|
|
72
76
|
/**
|
|
73
77
|
* Gets parameters for retrieving automations, this is a utility function for the getDocParams function.
|
|
74
78
|
*/
|
|
75
|
-
|
|
76
|
-
return getDocParams(DocumentType.AUTOMATION, automationId, otherProps);
|
|
77
|
-
}
|
|
79
|
+
function getAutomationParams(automationId, otherProps = {}) {
|
|
80
|
+
return (0, exports.getDocParams)(exports.DocumentType.AUTOMATION, automationId, otherProps);
|
|
81
|
+
}
|
|
82
|
+
exports.getAutomationParams = getAutomationParams;
|
|
78
83
|
/**
|
|
79
84
|
* Generates a new automation ID.
|
|
80
85
|
* @returns {string} The new automation ID which the automation doc can be stored under.
|
|
81
86
|
*/
|
|
82
|
-
|
|
83
|
-
return `${DocumentType.AUTOMATION}${SEPARATOR}${
|
|
84
|
-
}
|
|
87
|
+
function generateAutomationID() {
|
|
88
|
+
return `${exports.DocumentType.AUTOMATION}${exports.SEPARATOR}${(0, newid_1.default)()}`;
|
|
89
|
+
}
|
|
90
|
+
exports.generateAutomationID = generateAutomationID;
|
|
85
91
|
/**
|
|
86
92
|
* Generates a new link doc ID. This is currently not usable with the alldocs call,
|
|
87
93
|
* instead a view is built to make walking to tree easier.
|
|
@@ -93,131 +99,152 @@ exports.generateAutomationID = () => {
|
|
|
93
99
|
* @param {string} fieldName2 the name of the field in the linked row.
|
|
94
100
|
* @returns {string} The new link doc ID which the automation doc can be stored under.
|
|
95
101
|
*/
|
|
96
|
-
|
|
97
|
-
const tables = `${SEPARATOR}${tableId1}${SEPARATOR}${tableId2}`;
|
|
98
|
-
const rows = `${SEPARATOR}${rowId1}${SEPARATOR}${rowId2}`;
|
|
99
|
-
const fields = `${SEPARATOR}${fieldName1}${SEPARATOR}${fieldName2}`;
|
|
100
|
-
return `${DocumentType.LINK}${tables}${rows}${fields}`;
|
|
101
|
-
}
|
|
102
|
+
function generateLinkID(tableId1, tableId2, rowId1, rowId2, fieldName1, fieldName2) {
|
|
103
|
+
const tables = `${exports.SEPARATOR}${tableId1}${exports.SEPARATOR}${tableId2}`;
|
|
104
|
+
const rows = `${exports.SEPARATOR}${rowId1}${exports.SEPARATOR}${rowId2}`;
|
|
105
|
+
const fields = `${exports.SEPARATOR}${fieldName1}${exports.SEPARATOR}${fieldName2}`;
|
|
106
|
+
return `${exports.DocumentType.LINK}${tables}${rows}${fields}`;
|
|
107
|
+
}
|
|
108
|
+
exports.generateLinkID = generateLinkID;
|
|
102
109
|
/**
|
|
103
110
|
* Gets parameters for retrieving link docs, this is a utility function for the getDocParams function.
|
|
104
111
|
*/
|
|
105
|
-
|
|
106
|
-
return getDocParams(DocumentType.LINK, null, otherProps);
|
|
107
|
-
}
|
|
112
|
+
function getLinkParams(otherProps = {}) {
|
|
113
|
+
return (0, exports.getDocParams)(exports.DocumentType.LINK, null, otherProps);
|
|
114
|
+
}
|
|
115
|
+
exports.getLinkParams = getLinkParams;
|
|
108
116
|
/**
|
|
109
117
|
* Generates a new layout ID.
|
|
110
118
|
* @returns {string} The new layout ID which the layout doc can be stored under.
|
|
111
119
|
*/
|
|
112
|
-
|
|
113
|
-
return `${DocumentType.LAYOUT}${SEPARATOR}${id ||
|
|
114
|
-
}
|
|
120
|
+
function generateLayoutID(id) {
|
|
121
|
+
return `${exports.DocumentType.LAYOUT}${exports.SEPARATOR}${id || (0, newid_1.default)()}`;
|
|
122
|
+
}
|
|
123
|
+
exports.generateLayoutID = generateLayoutID;
|
|
115
124
|
/**
|
|
116
125
|
* Gets parameters for retrieving layout, this is a utility function for the getDocParams function.
|
|
117
126
|
*/
|
|
118
|
-
|
|
119
|
-
return getDocParams(DocumentType.LAYOUT, layoutId, otherProps);
|
|
120
|
-
}
|
|
127
|
+
function getLayoutParams(layoutId, otherProps = {}) {
|
|
128
|
+
return (0, exports.getDocParams)(exports.DocumentType.LAYOUT, layoutId, otherProps);
|
|
129
|
+
}
|
|
130
|
+
exports.getLayoutParams = getLayoutParams;
|
|
121
131
|
/**
|
|
122
132
|
* Generates a new screen ID.
|
|
123
133
|
* @returns {string} The new screen ID which the screen doc can be stored under.
|
|
124
134
|
*/
|
|
125
|
-
|
|
126
|
-
return `${DocumentType.SCREEN}${SEPARATOR}${
|
|
127
|
-
}
|
|
135
|
+
function generateScreenID() {
|
|
136
|
+
return `${exports.DocumentType.SCREEN}${exports.SEPARATOR}${(0, newid_1.default)()}`;
|
|
137
|
+
}
|
|
138
|
+
exports.generateScreenID = generateScreenID;
|
|
128
139
|
/**
|
|
129
140
|
* Gets parameters for retrieving screens, this is a utility function for the getDocParams function.
|
|
130
141
|
*/
|
|
131
|
-
|
|
132
|
-
return getDocParams(DocumentType.SCREEN, screenId, otherProps);
|
|
133
|
-
}
|
|
142
|
+
function getScreenParams(screenId, otherProps = {}) {
|
|
143
|
+
return (0, exports.getDocParams)(exports.DocumentType.SCREEN, screenId, otherProps);
|
|
144
|
+
}
|
|
145
|
+
exports.getScreenParams = getScreenParams;
|
|
134
146
|
/**
|
|
135
147
|
* Generates a new webhook ID.
|
|
136
148
|
* @returns {string} The new webhook ID which the webhook doc can be stored under.
|
|
137
149
|
*/
|
|
138
|
-
|
|
139
|
-
return `${DocumentType.WEBHOOK}${SEPARATOR}${
|
|
140
|
-
}
|
|
150
|
+
function generateWebhookID() {
|
|
151
|
+
return `${exports.DocumentType.WEBHOOK}${exports.SEPARATOR}${(0, newid_1.default)()}`;
|
|
152
|
+
}
|
|
153
|
+
exports.generateWebhookID = generateWebhookID;
|
|
141
154
|
/**
|
|
142
155
|
* Gets parameters for retrieving a webhook, this is a utility function for the getDocParams function.
|
|
143
156
|
*/
|
|
144
|
-
|
|
145
|
-
return getDocParams(DocumentType.WEBHOOK, webhookId, otherProps);
|
|
146
|
-
}
|
|
157
|
+
function getWebhookParams(webhookId, otherProps = {}) {
|
|
158
|
+
return (0, exports.getDocParams)(exports.DocumentType.WEBHOOK, webhookId, otherProps);
|
|
159
|
+
}
|
|
160
|
+
exports.getWebhookParams = getWebhookParams;
|
|
147
161
|
/**
|
|
148
162
|
* Generates a new datasource ID.
|
|
149
163
|
* @returns {string} The new datasource ID which the webhook doc can be stored under.
|
|
150
164
|
*/
|
|
151
|
-
|
|
152
|
-
return `${plus ? DocumentType.DATASOURCE_PLUS : DocumentType.DATASOURCE}${SEPARATOR}${
|
|
153
|
-
}
|
|
165
|
+
function generateDatasourceID({ plus = false } = {}) {
|
|
166
|
+
return `${plus ? exports.DocumentType.DATASOURCE_PLUS : exports.DocumentType.DATASOURCE}${exports.SEPARATOR}${(0, newid_1.default)()}`;
|
|
167
|
+
}
|
|
168
|
+
exports.generateDatasourceID = generateDatasourceID;
|
|
154
169
|
/**
|
|
155
170
|
* Gets parameters for retrieving a datasource, this is a utility function for the getDocParams function.
|
|
156
171
|
*/
|
|
157
|
-
|
|
158
|
-
return getDocParams(DocumentType.DATASOURCE, datasourceId, otherProps);
|
|
159
|
-
}
|
|
172
|
+
function getDatasourceParams(datasourceId, otherProps = {}) {
|
|
173
|
+
return (0, exports.getDocParams)(exports.DocumentType.DATASOURCE, datasourceId, otherProps);
|
|
174
|
+
}
|
|
175
|
+
exports.getDatasourceParams = getDatasourceParams;
|
|
160
176
|
/**
|
|
161
177
|
* Generates a new query ID.
|
|
162
178
|
* @returns {string} The new query ID which the query doc can be stored under.
|
|
163
179
|
*/
|
|
164
|
-
|
|
165
|
-
return `${DocumentType.QUERY}${SEPARATOR}${datasourceId}${SEPARATOR}${
|
|
166
|
-
}
|
|
180
|
+
function generateQueryID(datasourceId) {
|
|
181
|
+
return `${exports.DocumentType.QUERY}${exports.SEPARATOR}${datasourceId}${exports.SEPARATOR}${(0, newid_1.default)()}`;
|
|
182
|
+
}
|
|
183
|
+
exports.generateQueryID = generateQueryID;
|
|
167
184
|
/**
|
|
168
185
|
* Generates a metadata ID for automations, used to track errors in recurring
|
|
169
186
|
* automations etc.
|
|
170
187
|
*/
|
|
171
|
-
|
|
172
|
-
return `${DocumentType.AUTOMATION_METADATA}${SEPARATOR}${automationId}`;
|
|
173
|
-
}
|
|
188
|
+
function generateAutomationMetadataID(automationId) {
|
|
189
|
+
return `${exports.DocumentType.AUTOMATION_METADATA}${exports.SEPARATOR}${automationId}`;
|
|
190
|
+
}
|
|
191
|
+
exports.generateAutomationMetadataID = generateAutomationMetadataID;
|
|
174
192
|
/**
|
|
175
193
|
* Retrieve all automation metadata in an app database.
|
|
176
194
|
*/
|
|
177
|
-
|
|
178
|
-
return getDocParams(DocumentType.AUTOMATION_METADATA, null, otherProps);
|
|
179
|
-
}
|
|
195
|
+
function getAutomationMetadataParams(otherProps = {}) {
|
|
196
|
+
return (0, exports.getDocParams)(exports.DocumentType.AUTOMATION_METADATA, null, otherProps);
|
|
197
|
+
}
|
|
198
|
+
exports.getAutomationMetadataParams = getAutomationMetadataParams;
|
|
180
199
|
/**
|
|
181
200
|
* Gets parameters for retrieving a query, this is a utility function for the getDocParams function.
|
|
182
201
|
*/
|
|
183
|
-
|
|
202
|
+
function getQueryParams(datasourceId, otherProps = {}) {
|
|
184
203
|
if (datasourceId == null) {
|
|
185
|
-
return getDocParams(DocumentType.QUERY, null, otherProps);
|
|
204
|
+
return (0, exports.getDocParams)(exports.DocumentType.QUERY, null, otherProps);
|
|
186
205
|
}
|
|
187
|
-
return getDocParams(DocumentType.QUERY, `${datasourceId}${SEPARATOR}`, otherProps);
|
|
188
|
-
}
|
|
206
|
+
return (0, exports.getDocParams)(exports.DocumentType.QUERY, `${datasourceId}${exports.SEPARATOR}`, otherProps);
|
|
207
|
+
}
|
|
208
|
+
exports.getQueryParams = getQueryParams;
|
|
189
209
|
/**
|
|
190
210
|
* Generates a new flag document ID.
|
|
191
211
|
* @returns {string} The ID of the flag document that was generated.
|
|
192
212
|
*/
|
|
193
|
-
|
|
194
|
-
return `${DocumentType.USER_FLAG}${SEPARATOR}${userId}`;
|
|
195
|
-
}
|
|
196
|
-
exports.
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
213
|
+
function generateUserFlagID(userId) {
|
|
214
|
+
return `${exports.DocumentType.USER_FLAG}${exports.SEPARATOR}${userId}`;
|
|
215
|
+
}
|
|
216
|
+
exports.generateUserFlagID = generateUserFlagID;
|
|
217
|
+
function generateMetadataID(type, entityId) {
|
|
218
|
+
return `${exports.DocumentType.METADATA}${exports.SEPARATOR}${type}${exports.SEPARATOR}${entityId}`;
|
|
219
|
+
}
|
|
220
|
+
exports.generateMetadataID = generateMetadataID;
|
|
221
|
+
function getMetadataParams(type, entityId, otherProps = {}) {
|
|
222
|
+
let docId = `${type}${exports.SEPARATOR}`;
|
|
201
223
|
if (entityId != null) {
|
|
202
224
|
docId += entityId;
|
|
203
225
|
}
|
|
204
|
-
return getDocParams(DocumentType.METADATA, docId, otherProps);
|
|
205
|
-
}
|
|
206
|
-
exports.
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
exports.
|
|
213
|
-
|
|
214
|
-
|
|
226
|
+
return (0, exports.getDocParams)(exports.DocumentType.METADATA, docId, otherProps);
|
|
227
|
+
}
|
|
228
|
+
exports.getMetadataParams = getMetadataParams;
|
|
229
|
+
function generateMemoryViewID(viewName) {
|
|
230
|
+
return `${exports.DocumentType.MEM_VIEW}${exports.SEPARATOR}${viewName}`;
|
|
231
|
+
}
|
|
232
|
+
exports.generateMemoryViewID = generateMemoryViewID;
|
|
233
|
+
function getMemoryViewParams(otherProps = {}) {
|
|
234
|
+
return (0, exports.getDocParams)(exports.DocumentType.MEM_VIEW, null, otherProps);
|
|
235
|
+
}
|
|
236
|
+
exports.getMemoryViewParams = getMemoryViewParams;
|
|
237
|
+
function generatePluginID(name) {
|
|
238
|
+
return `${exports.DocumentType.PLUGIN}${exports.SEPARATOR}${name}`;
|
|
239
|
+
}
|
|
240
|
+
exports.generatePluginID = generatePluginID;
|
|
215
241
|
/**
|
|
216
242
|
* This can be used with the db.allDocs to get a list of IDs
|
|
217
243
|
*/
|
|
218
|
-
|
|
244
|
+
function getMultiIDParams(ids) {
|
|
219
245
|
return {
|
|
220
246
|
keys: ids,
|
|
221
247
|
include_docs: true,
|
|
222
248
|
};
|
|
223
|
-
}
|
|
249
|
+
}
|
|
250
|
+
exports.getMultiIDParams = getMultiIDParams;
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const types_1 = require("@budibase/types");
|
|
13
|
-
const
|
|
13
|
+
const elasticsearch_1 = require("@elastic/elasticsearch");
|
|
14
14
|
const SCHEMA = {
|
|
15
15
|
docs: "https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html",
|
|
16
16
|
description: "Elasticsearch is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.",
|
|
@@ -22,6 +22,21 @@ const SCHEMA = {
|
|
|
22
22
|
required: true,
|
|
23
23
|
default: "http://localhost:9200",
|
|
24
24
|
},
|
|
25
|
+
ssl: {
|
|
26
|
+
type: types_1.DatasourceFieldType.BOOLEAN,
|
|
27
|
+
default: false,
|
|
28
|
+
required: false,
|
|
29
|
+
},
|
|
30
|
+
rejectUnauthorized: {
|
|
31
|
+
type: types_1.DatasourceFieldType.BOOLEAN,
|
|
32
|
+
default: true,
|
|
33
|
+
required: false,
|
|
34
|
+
},
|
|
35
|
+
ca: {
|
|
36
|
+
type: types_1.DatasourceFieldType.LONGFORM,
|
|
37
|
+
default: false,
|
|
38
|
+
required: false,
|
|
39
|
+
},
|
|
25
40
|
},
|
|
26
41
|
query: {
|
|
27
42
|
create: {
|
|
@@ -76,7 +91,16 @@ const SCHEMA = {
|
|
|
76
91
|
class ElasticSearchIntegration {
|
|
77
92
|
constructor(config) {
|
|
78
93
|
this.config = config;
|
|
79
|
-
|
|
94
|
+
const clientConfig = {
|
|
95
|
+
node: this.config.url,
|
|
96
|
+
};
|
|
97
|
+
if (this.config.ssl) {
|
|
98
|
+
clientConfig.ssl = {
|
|
99
|
+
rejectUnauthorized: this.config.rejectUnauthorized,
|
|
100
|
+
ca: this.config.ca || undefined,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
this.client = new elasticsearch_1.Client(clientConfig);
|
|
80
104
|
}
|
|
81
105
|
create(query) {
|
|
82
106
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -18,9 +18,7 @@ const utils_1 = require("./utils");
|
|
|
18
18
|
const constants_1 = require("../constants");
|
|
19
19
|
const google_spreadsheet_1 = require("google-spreadsheet");
|
|
20
20
|
const environment_1 = __importDefault(require("../environment"));
|
|
21
|
-
const
|
|
22
|
-
const { getScopedConfig } = require("@budibase/backend-core/db");
|
|
23
|
-
const { Configs } = require("@budibase/backend-core/constants");
|
|
21
|
+
const backend_core_1 = require("@budibase/backend-core");
|
|
24
22
|
const fetch = require("node-fetch");
|
|
25
23
|
const SCHEMA = {
|
|
26
24
|
plus: true,
|
|
@@ -140,9 +138,9 @@ class GoogleSheetsIntegration {
|
|
|
140
138
|
return __awaiter(this, void 0, void 0, function* () {
|
|
141
139
|
try {
|
|
142
140
|
// Initialise oAuth client
|
|
143
|
-
const db = getGlobalDB();
|
|
144
|
-
let googleConfig = yield getScopedConfig(db, {
|
|
145
|
-
type:
|
|
141
|
+
const db = backend_core_1.tenancy.getGlobalDB();
|
|
142
|
+
let googleConfig = yield backend_core_1.db.getScopedConfig(db, {
|
|
143
|
+
type: backend_core_1.constants.Config.GOOGLE,
|
|
146
144
|
});
|
|
147
145
|
if (!googleConfig) {
|
|
148
146
|
googleConfig = {
|
package/dist/integrations/s3.js
CHANGED
|
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const types_1 = require("@budibase/types");
|
|
13
13
|
const AWS = require("aws-sdk");
|
|
14
|
+
const csv = require("csvtojson");
|
|
14
15
|
const SCHEMA = {
|
|
15
16
|
docs: "https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html",
|
|
16
17
|
description: "Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance.",
|
|
@@ -41,16 +42,106 @@ const SCHEMA = {
|
|
|
41
42
|
},
|
|
42
43
|
},
|
|
43
44
|
query: {
|
|
45
|
+
create: {
|
|
46
|
+
type: types_1.QueryType.FIELDS,
|
|
47
|
+
fields: {
|
|
48
|
+
bucket: {
|
|
49
|
+
display: "New Bucket",
|
|
50
|
+
type: types_1.DatasourceFieldType.STRING,
|
|
51
|
+
required: true,
|
|
52
|
+
},
|
|
53
|
+
location: {
|
|
54
|
+
required: true,
|
|
55
|
+
default: "us-east-1",
|
|
56
|
+
type: types_1.DatasourceFieldType.STRING,
|
|
57
|
+
},
|
|
58
|
+
grantFullControl: {
|
|
59
|
+
display: "Grant full control",
|
|
60
|
+
type: types_1.DatasourceFieldType.STRING,
|
|
61
|
+
},
|
|
62
|
+
grantRead: {
|
|
63
|
+
display: "Grant read",
|
|
64
|
+
type: types_1.DatasourceFieldType.STRING,
|
|
65
|
+
},
|
|
66
|
+
grantReadAcp: {
|
|
67
|
+
display: "Grant read ACP",
|
|
68
|
+
type: types_1.DatasourceFieldType.STRING,
|
|
69
|
+
},
|
|
70
|
+
grantWrite: {
|
|
71
|
+
display: "Grant write",
|
|
72
|
+
type: types_1.DatasourceFieldType.STRING,
|
|
73
|
+
},
|
|
74
|
+
grantWriteAcp: {
|
|
75
|
+
display: "Grant write ACP",
|
|
76
|
+
type: types_1.DatasourceFieldType.STRING,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
44
80
|
read: {
|
|
45
81
|
type: types_1.QueryType.FIELDS,
|
|
46
82
|
fields: {
|
|
47
83
|
bucket: {
|
|
48
|
-
type:
|
|
84
|
+
type: types_1.DatasourceFieldType.STRING,
|
|
85
|
+
required: true,
|
|
86
|
+
},
|
|
87
|
+
delimiter: {
|
|
88
|
+
type: types_1.DatasourceFieldType.STRING,
|
|
89
|
+
},
|
|
90
|
+
marker: {
|
|
91
|
+
type: types_1.DatasourceFieldType.STRING,
|
|
92
|
+
},
|
|
93
|
+
maxKeys: {
|
|
94
|
+
type: types_1.DatasourceFieldType.NUMBER,
|
|
95
|
+
display: "Max Keys",
|
|
96
|
+
},
|
|
97
|
+
prefix: {
|
|
98
|
+
type: types_1.DatasourceFieldType.STRING,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
readCsv: {
|
|
103
|
+
displayName: "Read CSV",
|
|
104
|
+
type: types_1.QueryType.FIELDS,
|
|
105
|
+
fields: {
|
|
106
|
+
bucket: {
|
|
107
|
+
type: types_1.DatasourceFieldType.STRING,
|
|
108
|
+
required: true,
|
|
109
|
+
},
|
|
110
|
+
key: {
|
|
111
|
+
type: types_1.DatasourceFieldType.STRING,
|
|
112
|
+
required: true,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
delete: {
|
|
117
|
+
type: types_1.QueryType.FIELDS,
|
|
118
|
+
fields: {
|
|
119
|
+
bucket: {
|
|
120
|
+
type: types_1.DatasourceFieldType.STRING,
|
|
121
|
+
required: true,
|
|
122
|
+
},
|
|
123
|
+
delete: {
|
|
124
|
+
type: types_1.DatasourceFieldType.JSON,
|
|
49
125
|
required: true,
|
|
50
126
|
},
|
|
51
127
|
},
|
|
52
128
|
},
|
|
53
129
|
},
|
|
130
|
+
extra: {
|
|
131
|
+
acl: {
|
|
132
|
+
required: false,
|
|
133
|
+
displayName: "ACL",
|
|
134
|
+
type: types_1.DatasourceFieldType.LIST,
|
|
135
|
+
data: {
|
|
136
|
+
create: [
|
|
137
|
+
"private",
|
|
138
|
+
"public-read",
|
|
139
|
+
"public-read-write",
|
|
140
|
+
"authenticated-read",
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
54
145
|
};
|
|
55
146
|
class S3Integration {
|
|
56
147
|
constructor(config) {
|
|
@@ -63,16 +154,81 @@ class S3Integration {
|
|
|
63
154
|
}
|
|
64
155
|
this.client = new AWS.S3(this.config);
|
|
65
156
|
}
|
|
157
|
+
create(query) {
|
|
158
|
+
var _a;
|
|
159
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
+
let params = {
|
|
161
|
+
Bucket: query.bucket,
|
|
162
|
+
ACL: (_a = query.extra) === null || _a === void 0 ? void 0 : _a.acl,
|
|
163
|
+
GrantFullControl: query.grantFullControl,
|
|
164
|
+
GrantRead: query.grantRead,
|
|
165
|
+
GrantReadACP: query.grantReadAcp,
|
|
166
|
+
GrantWrite: query.grantWrite,
|
|
167
|
+
GrantWriteACP: query.grantWriteAcp,
|
|
168
|
+
};
|
|
169
|
+
if (query.location) {
|
|
170
|
+
params["CreateBucketConfiguration"] = {
|
|
171
|
+
LocationConstraint: query.location,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
return yield this.client.createBucket(params).promise();
|
|
175
|
+
});
|
|
176
|
+
}
|
|
66
177
|
read(query) {
|
|
67
178
|
return __awaiter(this, void 0, void 0, function* () {
|
|
68
179
|
const response = yield this.client
|
|
69
180
|
.listObjects({
|
|
70
181
|
Bucket: query.bucket,
|
|
182
|
+
Delimiter: query.delimiter,
|
|
183
|
+
Marker: query.marker,
|
|
184
|
+
MaxKeys: query.maxKeys,
|
|
185
|
+
Prefix: query.prefix,
|
|
71
186
|
})
|
|
72
187
|
.promise();
|
|
73
188
|
return response.Contents;
|
|
74
189
|
});
|
|
75
190
|
}
|
|
191
|
+
readCsv(query) {
|
|
192
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
+
const stream = this.client
|
|
194
|
+
.getObject({
|
|
195
|
+
Bucket: query.bucket,
|
|
196
|
+
Key: query.key,
|
|
197
|
+
})
|
|
198
|
+
.createReadStream();
|
|
199
|
+
let csvError = false;
|
|
200
|
+
return new Promise((resolve, reject) => {
|
|
201
|
+
stream.on("error", (err) => {
|
|
202
|
+
reject(err);
|
|
203
|
+
});
|
|
204
|
+
const response = csv()
|
|
205
|
+
.fromStream(stream)
|
|
206
|
+
.on("error", () => {
|
|
207
|
+
csvError = true;
|
|
208
|
+
});
|
|
209
|
+
stream.on("finish", () => {
|
|
210
|
+
resolve(response);
|
|
211
|
+
});
|
|
212
|
+
}).catch(err => {
|
|
213
|
+
if (csvError) {
|
|
214
|
+
throw new Error("Could not read CSV");
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
throw err;
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
delete(query) {
|
|
223
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
224
|
+
return yield this.client
|
|
225
|
+
.deleteObjects({
|
|
226
|
+
Bucket: query.bucket,
|
|
227
|
+
Delete: JSON.parse(query.delete),
|
|
228
|
+
})
|
|
229
|
+
.promise();
|
|
230
|
+
});
|
|
231
|
+
}
|
|
76
232
|
}
|
|
77
233
|
exports.default = {
|
|
78
234
|
schema: SCHEMA,
|