@budibase/server 2.2.4-alpha.1 → 2.2.5
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 +0 -19
- package/__mocks__/node-fetch.ts +0 -78
- package/builder/assets/{index.77b82b83.js → index.18998a03.js} +194 -194
- package/builder/index.html +1 -1
- package/coverage/clover.xml +4897 -4907
- package/coverage/coverage-final.json +262 -265
- package/coverage/lcov-report/index.html +169 -169
- package/coverage/lcov-report/src/api/controllers/analytics.ts.html +7 -7
- package/coverage/lcov-report/src/api/controllers/apikeys.ts.html +5 -5
- package/coverage/lcov-report/src/api/controllers/application.ts.html +159 -171
- package/coverage/lcov-report/src/api/controllers/auth.ts.html +11 -11
- package/coverage/lcov-report/src/api/controllers/automation.ts.html +51 -51
- package/coverage/lcov-report/src/api/controllers/backup.ts.html +6 -6
- package/coverage/lcov-report/src/api/controllers/cloud.ts.html +79 -91
- package/coverage/lcov-report/src/api/controllers/component.ts.html +5 -5
- package/coverage/lcov-report/src/api/controllers/datasource.ts.html +30 -30
- package/coverage/lcov-report/src/api/controllers/deploy/Deployment.ts.html +14 -14
- package/coverage/lcov-report/src/api/controllers/deploy/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/deploy/index.ts.html +83 -83
- package/coverage/lcov-report/src/api/controllers/dev.ts.html +18 -18
- package/coverage/lcov-report/src/api/controllers/index.html +51 -51
- package/coverage/lcov-report/src/api/controllers/integration.ts.html +4 -4
- package/coverage/lcov-report/src/api/controllers/layout.ts.html +6 -6
- package/coverage/lcov-report/src/api/controllers/metadata.ts.html +9 -9
- package/coverage/lcov-report/src/api/controllers/migrations.ts.html +4 -4
- package/coverage/lcov-report/src/api/controllers/permission.ts.html +13 -13
- package/coverage/lcov-report/src/api/controllers/plugin/file.ts.html +19 -19
- package/coverage/lcov-report/src/api/controllers/plugin/github.ts.html +63 -63
- package/coverage/lcov-report/src/api/controllers/plugin/index.html +72 -72
- package/coverage/lcov-report/src/api/controllers/plugin/index.ts.html +135 -150
- package/coverage/lcov-report/src/api/controllers/plugin/npm.ts.html +55 -55
- package/coverage/lcov-report/src/api/controllers/plugin/uploaders.ts.html +11 -11
- package/coverage/lcov-report/src/api/controllers/plugin/url.ts.html +18 -18
- package/coverage/lcov-report/src/api/controllers/plugin/utils.ts.html +20 -20
- package/coverage/lcov-report/src/api/controllers/public/applications.ts.html +10 -10
- package/coverage/lcov-report/src/api/controllers/public/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/mapping/applications.ts.html +2 -2
- 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 +7 -7
- package/coverage/lcov-report/src/api/controllers/public/mapping/queries.ts.html +2 -2
- package/coverage/lcov-report/src/api/controllers/public/mapping/rows.ts.html +2 -2
- package/coverage/lcov-report/src/api/controllers/public/mapping/tables.ts.html +2 -2
- package/coverage/lcov-report/src/api/controllers/public/mapping/users.ts.html +2 -2
- package/coverage/lcov-report/src/api/controllers/public/queries.ts.html +6 -6
- package/coverage/lcov-report/src/api/controllers/public/rows.ts.html +10 -10
- package/coverage/lcov-report/src/api/controllers/public/tables.ts.html +9 -9
- package/coverage/lcov-report/src/api/controllers/public/users.ts.html +11 -11
- package/coverage/lcov-report/src/api/controllers/public/utils.ts.html +6 -6
- 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 +8 -8
- 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 +8 -8
- package/coverage/lcov-report/src/api/controllers/query/import/sources/base/openapi.ts.html +5 -5
- package/coverage/lcov-report/src/api/controllers/query/import/sources/curl.ts.html +8 -8
- 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 +10 -10
- package/coverage/lcov-report/src/api/controllers/query/import/sources/openapi3.ts.html +14 -14
- package/coverage/lcov-report/src/api/controllers/query/index.html +19 -19
- package/coverage/lcov-report/src/api/controllers/query/index.ts.html +60 -60
- package/coverage/lcov-report/src/api/controllers/query/validation.ts.html +10 -10
- package/coverage/lcov-report/src/api/controllers/role.ts.html +8 -8
- package/coverage/lcov-report/src/api/controllers/routing.ts.html +6 -6
- package/coverage/lcov-report/src/api/controllers/row/ExternalRequest.ts.html +15 -12
- package/coverage/lcov-report/src/api/controllers/row/external.ts.html +20 -20
- package/coverage/lcov-report/src/api/controllers/row/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/index.ts.html +14 -14
- package/coverage/lcov-report/src/api/controllers/row/internal.ts.html +51 -54
- package/coverage/lcov-report/src/api/controllers/row/internalSearch.ts.html +9 -9
- package/coverage/lcov-report/src/api/controllers/row/staticFormula.ts.html +12 -21
- package/coverage/lcov-report/src/api/controllers/row/utils.ts.html +14 -17
- package/coverage/lcov-report/src/api/controllers/screen.ts.html +26 -26
- package/coverage/lcov-report/src/api/controllers/script.ts.html +18 -18
- package/coverage/lcov-report/src/api/controllers/static/index.html +11 -11
- package/coverage/lcov-report/src/api/controllers/static/index.ts.html +44 -32
- package/coverage/lcov-report/src/api/controllers/table/bulkFormula.ts.html +10 -10
- package/coverage/lcov-report/src/api/controllers/table/external.ts.html +14 -14
- package/coverage/lcov-report/src/api/controllers/table/index.html +19 -19
- package/coverage/lcov-report/src/api/controllers/table/index.ts.html +14 -14
- package/coverage/lcov-report/src/api/controllers/table/internal.ts.html +17 -17
- package/coverage/lcov-report/src/api/controllers/table/utils.ts.html +51 -51
- package/coverage/lcov-report/src/api/controllers/templates.ts.html +7 -7
- package/coverage/lcov-report/src/api/controllers/user.ts.html +119 -119
- package/coverage/lcov-report/src/api/controllers/view/exporters.ts.html +4 -4
- package/coverage/lcov-report/src/api/controllers/view/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/view/index.ts.html +47 -47
- package/coverage/lcov-report/src/api/controllers/view/utils.ts.html +22 -22
- package/coverage/lcov-report/src/api/controllers/view/viewBuilder.ts.html +33 -33
- package/coverage/lcov-report/src/api/controllers/webhook.ts.html +14 -14
- package/coverage/lcov-report/src/api/index.html +1 -1
- package/coverage/lcov-report/src/api/index.ts.html +33 -33
- package/coverage/lcov-report/src/api/routes/analytics.ts.html +7 -7
- package/coverage/lcov-report/src/api/routes/apikeys.ts.html +8 -8
- package/coverage/lcov-report/src/api/routes/application.ts.html +9 -9
- package/coverage/lcov-report/src/api/routes/auth.ts.html +6 -6
- package/coverage/lcov-report/src/api/routes/automation.ts.html +11 -11
- package/coverage/lcov-report/src/api/routes/backup.ts.html +8 -8
- package/coverage/lcov-report/src/api/routes/cloud.ts.html +8 -8
- package/coverage/lcov-report/src/api/routes/component.ts.html +8 -8
- package/coverage/lcov-report/src/api/routes/datasource.ts.html +9 -9
- package/coverage/lcov-report/src/api/routes/deploy.ts.html +8 -8
- package/coverage/lcov-report/src/api/routes/dev.ts.html +13 -13
- package/coverage/lcov-report/src/api/routes/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/index.ts.html +37 -40
- package/coverage/lcov-report/src/api/routes/integration.ts.html +8 -8
- package/coverage/lcov-report/src/api/routes/layout.ts.html +8 -8
- package/coverage/lcov-report/src/api/routes/metadata.ts.html +9 -9
- package/coverage/lcov-report/src/api/routes/migrations.ts.html +7 -7
- package/coverage/lcov-report/src/api/routes/permission.ts.html +9 -9
- package/coverage/lcov-report/src/api/routes/plugin.ts.html +8 -8
- package/coverage/lcov-report/src/api/routes/public/applications.ts.html +12 -12
- package/coverage/lcov-report/src/api/routes/public/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/index.ts.html +52 -52
- 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 +10 -10
- package/coverage/lcov-report/src/api/routes/public/queries.ts.html +9 -9
- package/coverage/lcov-report/src/api/routes/public/rows.ts.html +12 -12
- package/coverage/lcov-report/src/api/routes/public/tables.ts.html +12 -12
- package/coverage/lcov-report/src/api/routes/public/tests/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/tests/utils.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/users.ts.html +12 -12
- package/coverage/lcov-report/src/api/routes/public/utils/Endpoint.ts.html +19 -19
- package/coverage/lcov-report/src/api/routes/public/utils/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/query.ts.html +11 -11
- package/coverage/lcov-report/src/api/routes/role.ts.html +9 -9
- package/coverage/lcov-report/src/api/routes/routing.ts.html +8 -8
- package/coverage/lcov-report/src/api/routes/row.ts.html +11 -11
- package/coverage/lcov-report/src/api/routes/screen.ts.html +9 -9
- package/coverage/lcov-report/src/api/routes/script.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/static.ts.html +14 -14
- package/coverage/lcov-report/src/api/routes/table.ts.html +11 -11
- package/coverage/lcov-report/src/api/routes/templates.ts.html +8 -8
- package/coverage/lcov-report/src/api/routes/tests/utilities/TestFunctions.ts.html +16 -16
- package/coverage/lcov-report/src/api/routes/tests/utilities/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/tests/utilities/index.ts.html +22 -22
- package/coverage/lcov-report/src/api/routes/user.ts.html +9 -9
- package/coverage/lcov-report/src/api/routes/utils/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/utils/validators.ts.html +42 -42
- package/coverage/lcov-report/src/api/routes/view.ts.html +10 -10
- package/coverage/lcov-report/src/api/routes/webhook.ts.html +10 -10
- package/coverage/lcov-report/src/app.ts.html +32 -32
- package/coverage/lcov-report/src/automations/actions.ts.html +25 -25
- package/coverage/lcov-report/src/automations/automationUtils.ts.html +19 -91
- package/coverage/lcov-report/src/automations/bullboard.ts.html +11 -11
- package/coverage/lcov-report/src/automations/index.html +19 -19
- package/coverage/lcov-report/src/automations/index.ts.html +13 -13
- package/coverage/lcov-report/src/automations/logging/index.html +1 -1
- package/coverage/lcov-report/src/automations/logging/index.ts.html +11 -11
- package/coverage/lcov-report/src/automations/steps/bash.ts.html +34 -34
- package/coverage/lcov-report/src/automations/steps/createRow.ts.html +7 -7
- package/coverage/lcov-report/src/automations/steps/delay.ts.html +5 -5
- package/coverage/lcov-report/src/automations/steps/deleteRow.ts.html +7 -7
- package/coverage/lcov-report/src/automations/steps/discord.ts.html +33 -33
- package/coverage/lcov-report/src/automations/steps/executeQuery.ts.html +35 -35
- package/coverage/lcov-report/src/automations/steps/executeScript.ts.html +31 -31
- package/coverage/lcov-report/src/automations/steps/filter.ts.html +6 -6
- package/coverage/lcov-report/src/automations/steps/index.html +83 -83
- package/coverage/lcov-report/src/automations/steps/integromat.ts.html +6 -6
- package/coverage/lcov-report/src/automations/steps/loop.ts.html +3 -3
- package/coverage/lcov-report/src/automations/steps/outgoingWebhook.ts.html +14 -14
- package/coverage/lcov-report/src/automations/steps/queryRows.ts.html +17 -17
- package/coverage/lcov-report/src/automations/steps/sendSmtpEmail.ts.html +28 -28
- package/coverage/lcov-report/src/automations/steps/serverLog.ts.html +18 -18
- package/coverage/lcov-report/src/automations/steps/slack.ts.html +6 -6
- package/coverage/lcov-report/src/automations/steps/updateRow.ts.html +7 -7
- package/coverage/lcov-report/src/automations/steps/utils.ts.html +16 -16
- package/coverage/lcov-report/src/automations/steps/zapier.ts.html +22 -22
- package/coverage/lcov-report/src/automations/tests/utilities/index.html +5 -5
- package/coverage/lcov-report/src/automations/tests/utilities/index.ts.html +26 -26
- package/coverage/lcov-report/src/automations/triggerInfo/app.ts.html +3 -3
- package/coverage/lcov-report/src/automations/triggerInfo/cron.ts.html +3 -3
- package/coverage/lcov-report/src/automations/triggerInfo/index.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/index.ts.html +8 -8
- package/coverage/lcov-report/src/automations/triggerInfo/rowDeleted.ts.html +3 -3
- package/coverage/lcov-report/src/automations/triggerInfo/rowSaved.ts.html +3 -3
- package/coverage/lcov-report/src/automations/triggerInfo/rowUpdated.ts.html +3 -3
- package/coverage/lcov-report/src/automations/triggerInfo/webhook.ts.html +3 -3
- package/coverage/lcov-report/src/automations/triggers.ts.html +21 -21
- package/coverage/lcov-report/src/automations/utils.ts.html +56 -56
- package/coverage/lcov-report/src/constants/index.html +1 -1
- package/coverage/lcov-report/src/constants/index.ts.html +92 -92
- package/coverage/lcov-report/src/constants/layouts.ts.html +4 -4
- package/coverage/lcov-report/src/constants/screens.ts.html +5 -5
- package/coverage/lcov-report/src/db/defaultData/datasource_bb_default.ts.html +23 -23
- package/coverage/lcov-report/src/db/defaultData/employeeImport.ts.html +2 -2
- package/coverage/lcov-report/src/db/defaultData/expensesImport.ts.html +2 -2
- package/coverage/lcov-report/src/db/defaultData/index.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/inventoryImport.ts.html +2 -2
- package/coverage/lcov-report/src/db/defaultData/jobsImport.ts.html +2 -2
- package/coverage/lcov-report/src/db/dynamoClient.ts.html +16 -16
- package/coverage/lcov-report/src/db/inMemoryView.ts.html +5 -5
- package/coverage/lcov-report/src/db/index.html +19 -19
- package/coverage/lcov-report/src/db/index.ts.html +9 -9
- package/coverage/lcov-report/src/db/linkedRows/LinkController.ts.html +8 -8
- package/coverage/lcov-report/src/db/linkedRows/LinkDocument.ts.html +4 -4
- package/coverage/lcov-report/src/db/linkedRows/index.html +1 -1
- package/coverage/lcov-report/src/db/linkedRows/index.ts.html +15 -15
- package/coverage/lcov-report/src/db/linkedRows/linkUtils.ts.html +12 -12
- package/coverage/lcov-report/src/db/newid.ts.html +4 -4
- package/coverage/lcov-report/src/db/utils.ts.html +80 -80
- package/coverage/lcov-report/src/definitions/automations.ts.html +4 -4
- package/coverage/lcov-report/src/definitions/datasource.ts.html +4 -4
- package/coverage/lcov-report/src/definitions/index.html +1 -1
- package/coverage/lcov-report/src/environment.ts.html +31 -43
- package/coverage/lcov-report/src/events/AutomationEmitter.ts.html +6 -6
- package/coverage/lcov-report/src/events/BudibaseEmitter.ts.html +5 -5
- package/coverage/lcov-report/src/events/index.html +1 -1
- package/coverage/lcov-report/src/events/index.ts.html +4 -4
- package/coverage/lcov-report/src/events/utils.ts.html +3 -3
- package/coverage/lcov-report/src/index.html +26 -26
- package/coverage/lcov-report/src/index.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/airtable.ts.html +5 -5
- package/coverage/lcov-report/src/integrations/arangodb.ts.html +5 -5
- package/coverage/lcov-report/src/integrations/base/index.html +1 -1
- package/coverage/lcov-report/src/integrations/base/query.ts.html +3 -3
- package/coverage/lcov-report/src/integrations/base/sql.ts.html +14 -14
- package/coverage/lcov-report/src/integrations/base/sqlTable.ts.html +8 -8
- package/coverage/lcov-report/src/integrations/base/utils.ts.html +3 -3
- package/coverage/lcov-report/src/integrations/couchdb.ts.html +5 -5
- package/coverage/lcov-report/src/integrations/dynamodb.ts.html +6 -6
- package/coverage/lcov-report/src/integrations/elasticsearch.ts.html +5 -5
- package/coverage/lcov-report/src/integrations/firebase.ts.html +5 -5
- package/coverage/lcov-report/src/integrations/googlesheets.ts.html +11 -11
- package/coverage/lcov-report/src/integrations/index.html +5 -5
- package/coverage/lcov-report/src/integrations/index.ts.html +47 -35
- package/coverage/lcov-report/src/integrations/microsoftSqlServer.ts.html +8 -8
- package/coverage/lcov-report/src/integrations/mongodb.ts.html +5 -5
- package/coverage/lcov-report/src/integrations/mysql.ts.html +10 -10
- package/coverage/lcov-report/src/integrations/oracle.ts.html +13 -13
- package/coverage/lcov-report/src/integrations/postgres.ts.html +42 -42
- package/coverage/lcov-report/src/integrations/queries/index.html +1 -1
- package/coverage/lcov-report/src/integrations/queries/sql.ts.html +13 -13
- package/coverage/lcov-report/src/integrations/redis.ts.html +5 -5
- package/coverage/lcov-report/src/integrations/rest.ts.html +16 -16
- package/coverage/lcov-report/src/integrations/s3.ts.html +6 -6
- package/coverage/lcov-report/src/integrations/snowflake.ts.html +5 -5
- 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 +36 -36
- package/coverage/lcov-report/src/middleware/appInfo.ts.html +7 -7
- package/coverage/lcov-report/src/middleware/authorized.ts.html +28 -28
- package/coverage/lcov-report/src/middleware/builder.ts.html +17 -17
- package/coverage/lcov-report/src/middleware/currentapp.ts.html +39 -39
- 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 +4 -4
- package/coverage/lcov-report/src/middleware/resourceId.ts.html +22 -22
- package/coverage/lcov-report/src/middleware/selfhost.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/utils.ts.html +4 -4
- package/coverage/lcov-report/src/migrations/functions/appUrls.ts.html +4 -4
- package/coverage/lcov-report/src/migrations/functions/backfill/app/automations.ts.html +5 -5
- package/coverage/lcov-report/src/migrations/functions/backfill/app/datasources.ts.html +5 -5
- 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 +5 -5
- package/coverage/lcov-report/src/migrations/functions/backfill/app/queries.ts.html +7 -7
- package/coverage/lcov-report/src/migrations/functions/backfill/app/roles.ts.html +5 -5
- package/coverage/lcov-report/src/migrations/functions/backfill/app/screens.ts.html +5 -5
- package/coverage/lcov-report/src/migrations/functions/backfill/app/tables.ts.html +4 -4
- package/coverage/lcov-report/src/migrations/functions/backfill/app.ts.html +19 -19
- package/coverage/lcov-report/src/migrations/functions/backfill/global/configs.ts.html +10 -13
- 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 +7 -7
- package/coverage/lcov-report/src/migrations/functions/backfill/global/users.ts.html +6 -6
- package/coverage/lcov-report/src/migrations/functions/backfill/global.ts.html +15 -15
- package/coverage/lcov-report/src/migrations/functions/backfill/index.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/index.ts.html +5 -5
- package/coverage/lcov-report/src/migrations/functions/backfill/installation.ts.html +8 -8
- package/coverage/lcov-report/src/migrations/functions/index.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/syncQuotas.ts.html +6 -6
- package/coverage/lcov-report/src/migrations/functions/tableSettings.ts.html +6 -6
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/index.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/index.ts.html +2 -2
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncApps.ts.html +5 -5
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncPlugins.ts.html +4 -4
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncRows.ts.html +6 -6
- package/coverage/lcov-report/src/migrations/functions/userEmailViewCasing.ts.html +3 -3
- package/coverage/lcov-report/src/migrations/index.html +1 -1
- package/coverage/lcov-report/src/migrations/index.ts.html +32 -32
- package/coverage/lcov-report/src/migrations/tests/helpers.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/tests/index.html +1 -1
- package/coverage/lcov-report/src/migrations/tests/structures.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/app/applications/index.html +15 -15
- package/coverage/lcov-report/src/sdk/app/applications/index.ts.html +4 -4
- package/coverage/lcov-report/src/sdk/app/applications/sync.ts.html +34 -34
- package/coverage/lcov-report/src/sdk/app/applications/utils.ts.html +9 -9
- package/coverage/lcov-report/src/sdk/app/automations/index.html +1 -1
- package/coverage/lcov-report/src/sdk/app/automations/index.ts.html +3 -3
- package/coverage/lcov-report/src/sdk/app/automations/webhook.ts.html +6 -6
- package/coverage/lcov-report/src/sdk/app/backups/constants.ts.html +3 -3
- package/coverage/lcov-report/src/sdk/app/backups/exports.ts.html +17 -17
- package/coverage/lcov-report/src/sdk/app/backups/imports.ts.html +54 -42
- package/coverage/lcov-report/src/sdk/app/backups/index.html +30 -30
- package/coverage/lcov-report/src/sdk/app/backups/index.ts.html +5 -5
- package/coverage/lcov-report/src/sdk/app/backups/statistics.ts.html +73 -73
- package/coverage/lcov-report/src/sdk/app/tables/index.html +1 -1
- package/coverage/lcov-report/src/sdk/app/tables/index.ts.html +5 -5
- package/coverage/lcov-report/src/sdk/index.html +1 -1
- package/coverage/lcov-report/src/sdk/index.ts.html +8 -8
- package/coverage/lcov-report/src/sdk/users/index.html +5 -5
- package/coverage/lcov-report/src/sdk/users/index.ts.html +3 -3
- package/coverage/lcov-report/src/sdk/users/utils.ts.html +34 -34
- package/coverage/lcov-report/src/startup.ts.html +42 -42
- package/coverage/lcov-report/src/tests/utilities/TestConfiguration.ts.html +119 -146
- package/coverage/lcov-report/src/tests/utilities/controllers.ts.html +15 -15
- package/coverage/lcov-report/src/tests/utilities/index.html +10 -10
- package/coverage/lcov-report/src/tests/utilities/index.ts.html +1 -1
- package/coverage/lcov-report/src/tests/utilities/structures.ts.html +30 -30
- package/coverage/lcov-report/src/threads/automation.ts.html +101 -32
- package/coverage/lcov-report/src/threads/index.html +19 -19
- package/coverage/lcov-report/src/threads/index.ts.html +25 -25
- package/coverage/lcov-report/src/threads/query.ts.html +71 -71
- package/coverage/lcov-report/src/threads/utils.ts.html +18 -18
- package/coverage/lcov-report/src/utilities/budibaseDir.ts.html +3 -3
- package/coverage/lcov-report/src/utilities/centralPath.ts.html +4 -4
- package/coverage/lcov-report/src/utilities/csvParser.ts.html +8 -8
- package/coverage/lcov-report/src/utilities/fileSystem/clientLibrary.ts.html +12 -12
- package/coverage/lcov-report/src/utilities/fileSystem/index.html +19 -79
- package/coverage/lcov-report/src/utilities/fileSystem/index.ts.html +1049 -20
- package/coverage/lcov-report/src/utilities/fileSystem/processor.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/global.ts.html +42 -42
- package/coverage/lcov-report/src/utilities/index.html +63 -48
- package/coverage/lcov-report/src/utilities/index.ts.html +168 -36
- package/coverage/lcov-report/src/utilities/plugins.ts.html +151 -0
- package/coverage/lcov-report/src/utilities/redis.ts.html +32 -32
- package/coverage/lcov-report/src/utilities/routing/index.html +1 -1
- package/coverage/lcov-report/src/utilities/routing/index.ts.html +5 -5
- package/coverage/lcov-report/src/utilities/rowProcessor/index.html +28 -28
- package/coverage/lcov-report/src/utilities/rowProcessor/index.ts.html +33 -60
- package/coverage/lcov-report/src/utilities/rowProcessor/map.ts.html +3 -3
- package/coverage/lcov-report/src/utilities/rowProcessor/utils.ts.html +38 -38
- package/coverage/lcov-report/src/utilities/scriptRunner.ts.html +32 -32
- package/coverage/lcov-report/src/utilities/security.ts.html +6 -6
- package/coverage/lcov-report/src/utilities/statusCodes.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/usageQuota/index.html +1 -1
- package/coverage/lcov-report/src/utilities/usageQuota/rows.ts.html +35 -35
- package/coverage/lcov-report/src/utilities/usageQuota/usageQuoteReset.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/users.ts.html +6 -6
- package/coverage/lcov-report/src/utilities/workerRequests.ts.html +56 -56
- package/coverage/lcov-report/src/watch.ts.html +9 -9
- package/coverage/lcov-report/src/websocket.ts.html +15 -15
- package/coverage/lcov.info +6958 -6989
- package/dist/api/controllers/application.js +10 -9
- package/dist/api/controllers/cloud.js +2 -6
- package/dist/api/controllers/plugin/index.js +6 -6
- package/dist/api/controllers/row/ExternalRequest.js +1 -0
- package/dist/api/controllers/row/internal.js +11 -11
- package/dist/api/controllers/row/staticFormula.js +1 -1
- package/dist/api/controllers/static/index.js +11 -8
- package/dist/api/routes/tests/utilities/TestFunctions.js +167 -0
- package/dist/api/routes/tests/utilities/index.js +131 -0
- package/dist/automations/automationUtils.js +1 -26
- package/dist/automations/tests/utilities/index.js +81 -0
- package/dist/environment.js +2 -6
- package/dist/integrations/index.js +2 -1
- package/dist/migrations/functions/backfill/global/configs.js +4 -4
- package/dist/package.json +7 -9
- package/dist/sdk/app/backups/imports.js +7 -3
- package/dist/tests/utilities/TestConfiguration.js +562 -0
- package/dist/tests/utilities/controllers.js +40 -0
- package/dist/tests/utilities/structures.js +168 -0
- package/dist/threads/automation.js +26 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/fileSystem/clientLibrary.js +3 -3
- package/dist/utilities/fileSystem/index.js +342 -18
- package/dist/utilities/index.js +44 -1
- package/dist/utilities/plugins.js +26 -0
- package/dist/utilities/rowProcessor/index.js +4 -12
- package/package.json +8 -10
- package/src/api/controllers/application.ts +12 -16
- package/src/api/controllers/auth.ts +2 -2
- package/src/api/controllers/cloud.ts +6 -10
- package/src/api/controllers/plugin/index.ts +9 -14
- package/src/api/controllers/row/ExternalRequest.ts +1 -0
- package/src/api/controllers/row/internal.ts +22 -23
- package/src/api/controllers/row/staticFormula.ts +2 -5
- package/src/api/controllers/row/utils.ts +1 -2
- package/src/api/controllers/static/index.ts +10 -6
- package/src/api/routes/index.ts +3 -4
- package/src/api/routes/tests/__snapshots__/{datasource.spec.ts.snap → datasource.spec.js.snap} +0 -0
- package/src/api/routes/tests/{application.spec.ts → application.spec.js} +7 -40
- package/src/api/routes/tests/{backup.spec.ts → backup.spec.js} +6 -17
- package/src/api/routes/tests/{datasource.spec.ts → datasource.spec.js} +15 -23
- package/src/api/routes/tests/routing.spec.js +1 -0
- package/src/api/routes/tests/row.spec.js +2 -4
- package/src/api/routes/tests/static.spec.js +17 -2
- package/src/api/routes/tests/table.spec.js +2 -8
- package/src/api/routes/tests/user.spec.js +0 -86
- package/src/api/routes/tests/utilities/index.ts +2 -2
- package/src/automations/automationUtils.ts +0 -24
- package/src/automations/tests/utilities/index.ts +2 -2
- package/src/automations/unitTests/automationUtils.spec.js +17 -0
- package/src/environment.ts +2 -6
- package/src/integrations/index.ts +5 -1
- package/src/migrations/functions/backfill/global/configs.ts +4 -5
- package/src/sdk/app/backups/imports.ts +7 -3
- package/src/tests/jestSetup.ts +1 -4
- package/src/tests/utilities/TestConfiguration.ts +0 -9
- package/src/threads/automation.ts +25 -2
- package/src/utilities/fileSystem/clientLibrary.ts +1 -1
- package/src/utilities/fileSystem/index.ts +348 -5
- package/src/utilities/index.ts +45 -1
- package/src/utilities/plugins.ts +22 -0
- package/src/utilities/rowProcessor/index.ts +8 -17
- package/tsconfig.build.json +0 -2
- package/coverage/lcov-report/src/utilities/fileSystem/app.ts.html +0 -343
- package/coverage/lcov-report/src/utilities/fileSystem/filesystem.ts.html +0 -595
- package/coverage/lcov-report/src/utilities/fileSystem/plugin.ts.html +0 -280
- package/coverage/lcov-report/src/utilities/fileSystem/template.ts.html +0 -193
- package/dist/utilities/fileSystem/app.js +0 -97
- package/dist/utilities/fileSystem/filesystem.js +0 -182
- package/dist/utilities/fileSystem/plugin.js +0 -63
- package/dist/utilities/fileSystem/template.js +0 -44
- package/src/api/routes/tests/cloud.spec.ts +0 -66
- package/src/api/routes/tests/data/budibase-component-1.0.1.tgz +0 -0
- package/src/api/routes/tests/data/comment-box-1.0.2.tar.gz +0 -0
- package/src/api/routes/tests/data/export-test.tar.gz +0 -0
- package/src/api/routes/tests/plugin.spec.ts +0 -179
- package/src/automations/tests/bash.spec.js +0 -34
- package/src/automations/tests/discord.spec.js +0 -27
- package/src/automations/tests/executeQuery.spec.js +0 -49
- package/src/automations/tests/executeScript.spec.js +0 -48
- package/src/automations/tests/sendSmtpEmail.spec.js +0 -71
- package/src/automations/tests/serverLog.spec.js +0 -22
- package/src/automations/tests/zapier.spec.js +0 -27
- package/src/automations/unitTests/automationUtils.spec.ts +0 -65
- package/src/utilities/fileSystem/app.ts +0 -86
- package/src/utilities/fileSystem/filesystem.ts +0 -170
- package/src/utilities/fileSystem/plugin.ts +0 -65
- package/src/utilities/fileSystem/template.ts +0 -36
- package/src/utilities/rowProcessor/tests/utils.spec.ts +0 -57
|
@@ -1,5 +1,20 @@
|
|
|
1
|
+
jest.mock("node-fetch")
|
|
2
|
+
jest.mock("aws-sdk", () => ({
|
|
3
|
+
config: {
|
|
4
|
+
update: jest.fn(),
|
|
5
|
+
},
|
|
6
|
+
DynamoDB: {
|
|
7
|
+
DocumentClient: jest.fn(),
|
|
8
|
+
},
|
|
9
|
+
S3: jest.fn(() => ({
|
|
10
|
+
getSignedUrl: jest.fn(() => {
|
|
11
|
+
return "my-url"
|
|
12
|
+
}),
|
|
13
|
+
})),
|
|
14
|
+
}))
|
|
15
|
+
|
|
1
16
|
const setup = require("./utilities")
|
|
2
|
-
const { constants } = require("@budibase/backend-core")
|
|
17
|
+
const { events, constants } = require("@budibase/backend-core")
|
|
3
18
|
|
|
4
19
|
describe("/static", () => {
|
|
5
20
|
let request = setup.getRequest()
|
|
@@ -87,7 +102,7 @@ describe("/static", () => {
|
|
|
87
102
|
.set(config.defaultHeaders())
|
|
88
103
|
.expect("Content-Type", /json/)
|
|
89
104
|
.expect(200)
|
|
90
|
-
expect(res.body.signedUrl).toEqual("
|
|
105
|
+
expect(res.body.signedUrl).toEqual("my-url")
|
|
91
106
|
expect(res.body.publicUrl).toEqual(
|
|
92
107
|
`https://${bucket}.s3.eu-west-1.amazonaws.com/${key}`
|
|
93
108
|
)
|
|
@@ -51,7 +51,7 @@ describe("/tables", () => {
|
|
|
51
51
|
table.dataImport.schema = table.schema
|
|
52
52
|
|
|
53
53
|
const res = await createTable(table)
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
expect(events.table.created).toBeCalledTimes(1)
|
|
56
56
|
expect(events.table.created).toBeCalledWith(res.body)
|
|
57
57
|
expect(events.table.imported).toBeCalledTimes(1)
|
|
@@ -87,12 +87,6 @@ describe("/tables", () => {
|
|
|
87
87
|
|
|
88
88
|
it("updates all the row fields for a table when a schema key is renamed", async () => {
|
|
89
89
|
const testTable = await config.createTable()
|
|
90
|
-
await config.createView({
|
|
91
|
-
name: "TestView",
|
|
92
|
-
field: "Price",
|
|
93
|
-
calculation: "stats",
|
|
94
|
-
tableId: testTable._id,
|
|
95
|
-
})
|
|
96
90
|
|
|
97
91
|
const testRow = await request
|
|
98
92
|
.post(`/api/${testTable._id}/rows`)
|
|
@@ -115,7 +109,7 @@ describe("/tables", () => {
|
|
|
115
109
|
updated: "updatedName"
|
|
116
110
|
},
|
|
117
111
|
schema: {
|
|
118
|
-
updatedName: {
|
|
112
|
+
updatedName: {type: "string"}
|
|
119
113
|
}
|
|
120
114
|
})
|
|
121
115
|
.set(config.defaultHeaders())
|
|
@@ -90,90 +90,4 @@ describe("/users", () => {
|
|
|
90
90
|
expect(res.body.tableId).toBeDefined()
|
|
91
91
|
})
|
|
92
92
|
})
|
|
93
|
-
describe("setFlag", () => {
|
|
94
|
-
it("should throw an error if a flag is not provided", async () => {
|
|
95
|
-
await config.createUser()
|
|
96
|
-
const res = await request
|
|
97
|
-
.post(`/api/users/flags`)
|
|
98
|
-
.set(config.defaultHeaders())
|
|
99
|
-
.send({ value: "test" })
|
|
100
|
-
.expect(400)
|
|
101
|
-
.expect("Content-Type", /json/)
|
|
102
|
-
expect(res.body.message).toEqual("Must supply a 'flag' field in request body.")
|
|
103
|
-
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
it("should be able to set a flag on the user", async () => {
|
|
107
|
-
await config.createUser()
|
|
108
|
-
const res = await request
|
|
109
|
-
.post(`/api/users/flags`)
|
|
110
|
-
.set(config.defaultHeaders())
|
|
111
|
-
.send({ value: "test", flag: "test" })
|
|
112
|
-
.expect(200)
|
|
113
|
-
.expect("Content-Type", /json/)
|
|
114
|
-
expect(res.body.message).toEqual("Flag set successfully")
|
|
115
|
-
})
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
describe("getFlags", () => {
|
|
119
|
-
it("should get flags for a specific user", async () => {
|
|
120
|
-
let flagData = { value: "test", flag: "test" }
|
|
121
|
-
await config.createUser()
|
|
122
|
-
await request
|
|
123
|
-
.post(`/api/users/flags`)
|
|
124
|
-
.set(config.defaultHeaders())
|
|
125
|
-
.send(flagData)
|
|
126
|
-
.expect(200)
|
|
127
|
-
.expect("Content-Type", /json/)
|
|
128
|
-
|
|
129
|
-
const res = await request
|
|
130
|
-
.get(`/api/users/flags`)
|
|
131
|
-
.set(config.defaultHeaders())
|
|
132
|
-
.expect(200)
|
|
133
|
-
.expect("Content-Type", /json/)
|
|
134
|
-
expect(res.body[flagData.value]).toEqual(flagData.flag)
|
|
135
|
-
})
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
describe("setFlag", () => {
|
|
139
|
-
it("should throw an error if a flag is not provided", async () => {
|
|
140
|
-
await config.createUser()
|
|
141
|
-
const res = await request
|
|
142
|
-
.post(`/api/users/flags`)
|
|
143
|
-
.set(config.defaultHeaders())
|
|
144
|
-
.send({ value: "test" })
|
|
145
|
-
.expect(400)
|
|
146
|
-
.expect("Content-Type", /json/)
|
|
147
|
-
expect(res.body.message).toEqual("Must supply a 'flag' field in request body.")
|
|
148
|
-
|
|
149
|
-
})
|
|
150
|
-
|
|
151
|
-
it("should be able to set a flag on the user", async () => {
|
|
152
|
-
await config.createUser()
|
|
153
|
-
const res = await request
|
|
154
|
-
.post(`/api/users/flags`)
|
|
155
|
-
.set(config.defaultHeaders())
|
|
156
|
-
.send({ value: "test", flag: "test" })
|
|
157
|
-
.expect(200)
|
|
158
|
-
.expect("Content-Type", /json/)
|
|
159
|
-
expect(res.body.message).toEqual("Flag set successfully")
|
|
160
|
-
})
|
|
161
|
-
})
|
|
162
|
-
|
|
163
|
-
describe("syncUser", () => {
|
|
164
|
-
it("should sync the user", async () => {
|
|
165
|
-
let user = await config.createUser()
|
|
166
|
-
await config.createApp('New App')
|
|
167
|
-
let res = await request
|
|
168
|
-
.post(`/api/users/metadata/sync/${user._id}`)
|
|
169
|
-
.set(config.defaultHeaders())
|
|
170
|
-
.expect(200)
|
|
171
|
-
.expect("Content-Type", /json/)
|
|
172
|
-
expect(res.body.message).toEqual('User synced.')
|
|
173
|
-
})
|
|
174
|
-
})
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
93
|
})
|
|
@@ -63,14 +63,14 @@ export function afterAll() {
|
|
|
63
63
|
|
|
64
64
|
export function getRequest() {
|
|
65
65
|
if (!request) {
|
|
66
|
-
beforeAll()
|
|
66
|
+
exports.beforeAll()
|
|
67
67
|
}
|
|
68
68
|
return request
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
export function getConfig() {
|
|
72
72
|
if (!config) {
|
|
73
|
-
beforeAll()
|
|
73
|
+
exports.beforeAll()
|
|
74
74
|
}
|
|
75
75
|
return config
|
|
76
76
|
}
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
} from "@budibase/string-templates"
|
|
6
6
|
import sdk from "../sdk"
|
|
7
7
|
import { Row } from "@budibase/types"
|
|
8
|
-
import { LoopStep, LoopStepType, LoopInput } from "../definitions/automations"
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* When values are input to the system generally they will be of type string as this is required for template strings.
|
|
@@ -124,26 +123,3 @@ export function stringSplit(value: string | string[]) {
|
|
|
124
123
|
}
|
|
125
124
|
return value
|
|
126
125
|
}
|
|
127
|
-
|
|
128
|
-
export function typecastForLooping(loopStep: LoopStep, input: LoopInput) {
|
|
129
|
-
if (!input || !input.binding) {
|
|
130
|
-
return null
|
|
131
|
-
}
|
|
132
|
-
try {
|
|
133
|
-
switch (loopStep.inputs.option) {
|
|
134
|
-
case LoopStepType.ARRAY:
|
|
135
|
-
if (typeof input.binding === "string") {
|
|
136
|
-
return JSON.parse(input.binding)
|
|
137
|
-
}
|
|
138
|
-
break
|
|
139
|
-
case LoopStepType.STRING:
|
|
140
|
-
if (Array.isArray(input.binding)) {
|
|
141
|
-
return input.binding.join(",")
|
|
142
|
-
}
|
|
143
|
-
break
|
|
144
|
-
}
|
|
145
|
-
} catch (err) {
|
|
146
|
-
throw new Error("Unable to cast to correct type")
|
|
147
|
-
}
|
|
148
|
-
return input.binding
|
|
149
|
-
}
|
|
@@ -31,7 +31,7 @@ export async function runInProd(fn: any) {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export async function runStep(stepId: string, inputs: any
|
|
34
|
+
export async function runStep(stepId: string, inputs: any) {
|
|
35
35
|
async function run() {
|
|
36
36
|
let step = await getAction(stepId)
|
|
37
37
|
expect(step).toBeDefined()
|
|
@@ -39,7 +39,7 @@ export async function runStep(stepId: string, inputs: any, stepContext?: any) {
|
|
|
39
39
|
throw new Error("No step found")
|
|
40
40
|
}
|
|
41
41
|
return step({
|
|
42
|
-
context:
|
|
42
|
+
context: {},
|
|
43
43
|
inputs,
|
|
44
44
|
appId: config ? config.getAppId() : null,
|
|
45
45
|
// don't really need an API key, mocked out usage quota, not being tested here
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const automationUtils = require("../automationUtils")
|
|
2
|
+
|
|
3
|
+
describe("automationUtils", () => {
|
|
4
|
+
test("substituteLoopStep should allow multiple loop binding substitutes", () => {
|
|
5
|
+
expect(automationUtils.substituteLoopStep(
|
|
6
|
+
`{{ loop.currentItem._id }} {{ loop.currentItem._id }} {{ loop.currentItem._id }}`,
|
|
7
|
+
"step.2"))
|
|
8
|
+
.toBe(`{{ step.2.currentItem._id }} {{ step.2.currentItem._id }} {{ step.2.currentItem._id }}`)
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
test("substituteLoopStep should handle not subsituting outside of curly braces", () => {
|
|
12
|
+
expect(automationUtils.substituteLoopStep(
|
|
13
|
+
`loop {{ loop.currentItem._id }}loop loop{{ loop.currentItem._id }}loop`,
|
|
14
|
+
"step.2"))
|
|
15
|
+
.toBe(`loop {{ step.2.currentItem._id }}loop loop{{ step.2.currentItem._id }}loop`)
|
|
16
|
+
})
|
|
17
|
+
})
|
package/src/environment.ts
CHANGED
|
@@ -79,6 +79,7 @@ const environment = {
|
|
|
79
79
|
// flags
|
|
80
80
|
ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS,
|
|
81
81
|
DISABLE_THREADING: process.env.DISABLE_THREADING,
|
|
82
|
+
DISABLE_DEVELOPER_LICENSE: process.env.DISABLE_DEVELOPER_LICENSE,
|
|
82
83
|
DISABLE_AUTOMATION_LOGS: process.env.DISABLE_AUTOMATION_LOGS,
|
|
83
84
|
MULTI_TENANCY: process.env.MULTI_TENANCY,
|
|
84
85
|
ENABLE_ANALYTICS: process.env.ENABLE_ANALYTICS,
|
|
@@ -112,17 +113,12 @@ if (isDev() && module.exports.DISABLE_THREADING == null) {
|
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
// clean up any environment variable edge cases
|
|
115
|
-
for (let [key, value] of Object.entries(
|
|
116
|
+
for (let [key, value] of Object.entries(module.exports)) {
|
|
116
117
|
// handle the edge case of "0" to disable an environment variable
|
|
117
118
|
if (value === "0") {
|
|
118
119
|
// @ts-ignore
|
|
119
120
|
environment[key] = 0
|
|
120
121
|
}
|
|
121
|
-
// handle the edge case of "false" to disable an environment variable
|
|
122
|
-
if (value === "false") {
|
|
123
|
-
// @ts-ignore
|
|
124
|
-
environment[key] = 0
|
|
125
|
-
}
|
|
126
122
|
}
|
|
127
123
|
|
|
128
124
|
export = environment
|
|
@@ -98,7 +98,11 @@ export async function getIntegration(integration: string) {
|
|
|
98
98
|
for (let plugin of plugins) {
|
|
99
99
|
if (plugin.name === integration) {
|
|
100
100
|
// need to use commonJS require due to its dynamic runtime nature
|
|
101
|
-
const retrieved: any = await getDatasourcePlugin(
|
|
101
|
+
const retrieved: any = await getDatasourcePlugin(
|
|
102
|
+
plugin.name,
|
|
103
|
+
plugin.jsUrl,
|
|
104
|
+
plugin.schema?.hash
|
|
105
|
+
)
|
|
102
106
|
if (retrieved.integration) {
|
|
103
107
|
return retrieved.integration
|
|
104
108
|
} else {
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
isGoogleConfig,
|
|
6
6
|
isOIDCConfig,
|
|
7
7
|
isSettingsConfig,
|
|
8
|
-
ConfigType,
|
|
9
8
|
} from "@budibase/types"
|
|
10
9
|
import env from "./../../../../environment"
|
|
11
10
|
|
|
@@ -32,15 +31,15 @@ export const backfill = async (
|
|
|
32
31
|
await events.email.SMTPCreated(timestamp)
|
|
33
32
|
}
|
|
34
33
|
if (isGoogleConfig(config)) {
|
|
35
|
-
await events.auth.SSOCreated(
|
|
34
|
+
await events.auth.SSOCreated("google", timestamp)
|
|
36
35
|
if (config.config.activated) {
|
|
37
|
-
await events.auth.SSOActivated(
|
|
36
|
+
await events.auth.SSOActivated("google", timestamp)
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
if (isOIDCConfig(config)) {
|
|
41
|
-
await events.auth.SSOCreated(
|
|
40
|
+
await events.auth.SSOCreated("oidc", timestamp)
|
|
42
41
|
if (config.config.configs[0].activated) {
|
|
43
|
-
await events.auth.SSOActivated(
|
|
42
|
+
await events.auth.SSOActivated("oidc", timestamp)
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
if (isSettingsConfig(config)) {
|
|
@@ -55,8 +55,12 @@ async function updateAttachmentColumns(prodAppId: string, db: Database) {
|
|
|
55
55
|
continue
|
|
56
56
|
}
|
|
57
57
|
row[column] = row[column].map((attachment: RowAttachment) => {
|
|
58
|
-
//
|
|
59
|
-
const urlParts = attachment.
|
|
58
|
+
// URL looks like: /prod-budi-app-assets/appId/attachments/file.csv
|
|
59
|
+
const urlParts = attachment.url.split("/")
|
|
60
|
+
// drop the first empty element
|
|
61
|
+
urlParts.shift()
|
|
62
|
+
// get the prefix
|
|
63
|
+
const prefix = urlParts.shift()
|
|
60
64
|
// remove the app ID
|
|
61
65
|
urlParts.shift()
|
|
62
66
|
// add new app ID
|
|
@@ -65,7 +69,7 @@ async function updateAttachmentColumns(prodAppId: string, db: Database) {
|
|
|
65
69
|
return {
|
|
66
70
|
...attachment,
|
|
67
71
|
key,
|
|
68
|
-
url:
|
|
72
|
+
url: `/${prefix}/${key}`,
|
|
69
73
|
}
|
|
70
74
|
})
|
|
71
75
|
}
|
package/src/tests/jestSetup.ts
CHANGED
|
@@ -19,10 +19,7 @@ import { mocks } from "@budibase/backend-core/tests"
|
|
|
19
19
|
const tk = require("timekeeper")
|
|
20
20
|
tk.freeze(mocks.date.MOCK_DATE)
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
global.console.log = jest.fn() // console.log are ignored in tests
|
|
24
|
-
global.console.warn = jest.fn() // console.warn are ignored in tests
|
|
25
|
-
}
|
|
22
|
+
global.console.log = jest.fn() // console.log are ignored in tests
|
|
26
23
|
|
|
27
24
|
if (!process.env.CI) {
|
|
28
25
|
// set a longer timeout in dev for debugging
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import { mocks } from "@budibase/backend-core/tests"
|
|
2
|
-
|
|
3
|
-
// init the licensing mock
|
|
4
|
-
import * as pro from "@budibase/pro"
|
|
5
|
-
mocks.licenses.init(pro)
|
|
6
|
-
|
|
7
|
-
// use unlimited license by default
|
|
8
|
-
mocks.licenses.useUnlimited()
|
|
9
|
-
|
|
10
1
|
import { init as dbInit } from "../../db"
|
|
11
2
|
dbInit()
|
|
12
3
|
import env from "../../environment"
|
|
@@ -32,8 +32,31 @@ const LOOP_STEP_ID = actions.ACTION_DEFINITIONS.LOOP.stepId
|
|
|
32
32
|
const CRON_STEP_ID = triggerDefs.CRON.stepId
|
|
33
33
|
const STOPPED_STATUS = { success: true, status: AutomationStatus.STOPPED }
|
|
34
34
|
|
|
35
|
+
function typecastForLooping(loopStep: LoopStep, input: LoopInput) {
|
|
36
|
+
if (!input || !input.binding) {
|
|
37
|
+
return null
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
switch (loopStep.inputs.option) {
|
|
41
|
+
case LoopStepType.ARRAY:
|
|
42
|
+
if (typeof input.binding === "string") {
|
|
43
|
+
return JSON.parse(input.binding)
|
|
44
|
+
}
|
|
45
|
+
break
|
|
46
|
+
case LoopStepType.STRING:
|
|
47
|
+
if (Array.isArray(input.binding)) {
|
|
48
|
+
return input.binding.join(",")
|
|
49
|
+
}
|
|
50
|
+
break
|
|
51
|
+
}
|
|
52
|
+
} catch (err) {
|
|
53
|
+
throw new Error("Unable to cast to correct type")
|
|
54
|
+
}
|
|
55
|
+
return input.binding
|
|
56
|
+
}
|
|
57
|
+
|
|
35
58
|
function getLoopIterations(loopStep: LoopStep, input: LoopInput) {
|
|
36
|
-
const binding =
|
|
59
|
+
const binding = typecastForLooping(loopStep, input)
|
|
37
60
|
if (!loopStep || !binding) {
|
|
38
61
|
return 1
|
|
39
62
|
}
|
|
@@ -266,7 +289,7 @@ class Orchestrator {
|
|
|
266
289
|
|
|
267
290
|
let tempOutput = { items: loopSteps, iterations: iterationCount }
|
|
268
291
|
try {
|
|
269
|
-
newInput.binding =
|
|
292
|
+
newInput.binding = typecastForLooping(
|
|
270
293
|
loopStep as LoopStep,
|
|
271
294
|
newInput
|
|
272
295
|
)
|
|
@@ -4,7 +4,7 @@ import fs from "fs"
|
|
|
4
4
|
import { objectStore } from "@budibase/backend-core"
|
|
5
5
|
import { resolve } from "../centralPath"
|
|
6
6
|
import env from "../../environment"
|
|
7
|
-
|
|
7
|
+
const TOP_LEVEL_PATH = join(__dirname, "..", "..", "..")
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Client library paths in the object store:
|