@budibase/server 1.3.21 → 1.3.22-alpha.1
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__/mongodb.ts +1 -1
- package/builder/assets/index.96c69636.js +1008 -0
- package/builder/assets/index.c167b5c3.css +6 -0
- package/builder/index.html +2 -4
- package/coverage/clover.xml +308 -338
- package/coverage/coverage-final.json +19 -21
- package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/controllers/auth.js.html +41 -8
- package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
- package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
- package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
- package/coverage/lcov-report/api/controllers/datasource.js.html +73 -34
- package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
- package/coverage/lcov-report/api/controllers/index.html +27 -57
- package/coverage/lcov-report/api/controllers/integration.js.html +6 -6
- package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
- package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
- package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
- package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
- package/coverage/lcov-report/api/controllers/query/index.html +1 -1
- package/coverage/lcov-report/api/controllers/query/validation.js.html +1 -1
- package/coverage/lcov-report/api/controllers/role.js.html +1 -1
- package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/external.js.html +2 -2
- package/coverage/lcov-report/api/controllers/row/index.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/script.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
- package/coverage/lcov-report/api/controllers/user.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
- package/coverage/lcov-report/api/controllers/webhook.js.html +1 -1
- package/coverage/lcov-report/api/index.html +1 -1
- package/coverage/lcov-report/api/index.js.html +13 -13
- package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
- package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/routes/auth.js.html +1 -1
- package/coverage/lcov-report/api/routes/automation.js.html +1 -1
- package/coverage/lcov-report/api/routes/backup.js.html +1 -1
- package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
- package/coverage/lcov-report/api/routes/component.js.html +1 -1
- package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
- package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
- package/coverage/lcov-report/api/routes/dev.js.html +1 -1
- package/coverage/lcov-report/api/routes/index.html +1 -1
- package/coverage/lcov-report/api/routes/integration.js.html +1 -1
- package/coverage/lcov-report/api/routes/layout.js.html +1 -1
- package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
- package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
- package/coverage/lcov-report/api/routes/permission.js.html +1 -1
- package/coverage/lcov-report/api/routes/query.js.html +1 -1
- package/coverage/lcov-report/api/routes/role.js.html +1 -1
- package/coverage/lcov-report/api/routes/routing.js.html +1 -1
- package/coverage/lcov-report/api/routes/screen.js.html +1 -1
- package/coverage/lcov-report/api/routes/script.js.html +1 -1
- package/coverage/lcov-report/api/routes/table.js.html +2 -2
- package/coverage/lcov-report/api/routes/templates.js.html +1 -1
- package/coverage/lcov-report/api/routes/user.js.html +1 -1
- package/coverage/lcov-report/api/routes/utils/index.html +9 -9
- package/coverage/lcov-report/api/routes/utils/validators.js.html +75 -12
- package/coverage/lcov-report/api/routes/view.js.html +1 -1
- package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
- package/coverage/lcov-report/automations/actions.js.html +1 -1
- package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
- package/coverage/lcov-report/automations/bullboard.js.html +1 -1
- package/coverage/lcov-report/automations/index.html +1 -1
- package/coverage/lcov-report/automations/index.js.html +1 -1
- package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
- package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
- package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
- package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
- package/coverage/lcov-report/automations/steps/index.html +1 -1
- package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
- package/coverage/lcov-report/automations/steps/loop.js.html +1 -1
- package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
- package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
- package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
- package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
- package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
- package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
- package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
- package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
- package/coverage/lcov-report/automations/triggers.js.html +1 -1
- package/coverage/lcov-report/constants/index.html +1 -1
- package/coverage/lcov-report/constants/index.js.html +1 -1
- package/coverage/lcov-report/constants/layouts.js.html +1 -1
- package/coverage/lcov-report/constants/screens.js.html +1 -1
- package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
- package/coverage/lcov-report/db/index.html +14 -14
- package/coverage/lcov-report/db/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +1 -1
- package/coverage/lcov-report/db/newid.js.html +2 -2
- package/coverage/lcov-report/db/utils.js.html +30 -18
- package/coverage/lcov-report/events/AutomationEmitter.js.html +3 -3
- package/coverage/lcov-report/events/index.html +1 -1
- package/coverage/lcov-report/events/index.js.html +1 -1
- package/coverage/lcov-report/events/utils.js.html +1 -1
- package/coverage/lcov-report/index.html +44 -44
- package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
- package/coverage/lcov-report/integrations/tests/index.html +1 -1
- package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
- package/coverage/lcov-report/middleware/builder.js.html +12 -12
- package/coverage/lcov-report/middleware/currentapp.js.html +46 -40
- package/coverage/lcov-report/middleware/index.html +15 -15
- package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
- package/coverage/lcov-report/middleware/publicApi.js.html +1 -1
- package/coverage/lcov-report/middleware/resourceId.js.html +7 -7
- package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
- package/coverage/lcov-report/middleware/utils.js.html +2 -2
- package/coverage/lcov-report/utilities/budibaseDir.js.html +3 -3
- package/coverage/lcov-report/utilities/centralPath.js.html +4 -4
- package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
- package/coverage/lcov-report/utilities/global.js.html +16 -16
- package/coverage/lcov-report/utilities/index.html +15 -15
- package/coverage/lcov-report/utilities/index.js.html +24 -24
- package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +2 -2
- package/coverage/lcov-report/utilities/queue/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
- package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
- package/coverage/lcov-report/utilities/security.js.html +2 -2
- package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
- package/coverage/lcov-report/utilities/users.js.html +1 -1
- package/coverage/lcov-report/utilities/workerRequests.js.html +32 -8
- package/coverage/lcov.info +521 -558
- package/dist/api/controllers/application.js +5 -5
- package/dist/api/controllers/auth.js +9 -0
- package/dist/api/controllers/component.js +19 -6
- package/dist/api/controllers/datasource.js +21 -8
- package/dist/api/controllers/deploy/index.js +1 -8
- package/dist/api/controllers/integration.js +4 -4
- package/dist/{migrations/functions/usageQuotas/syncDevelopers.js → api/controllers/plugin/file.js} +13 -13
- package/dist/api/controllers/plugin/github.js +69 -0
- package/dist/api/controllers/plugin/index.js +144 -0
- package/dist/api/controllers/plugin/npm.js +58 -0
- package/dist/api/controllers/plugin/uploaders.js +11 -0
- package/dist/{migrations/functions/usageQuotas/syncPublishedApps.js → api/controllers/plugin/url.js} +13 -15
- package/dist/api/controllers/plugin/utils.js +26 -0
- package/dist/api/controllers/row/external.js +1 -1
- package/dist/api/controllers/screen.js +62 -14
- package/dist/api/controllers/static/index.js +1 -0
- package/dist/api/controllers/static/templates/BudibaseApp.svelte +10 -0
- package/dist/api/controllers/static/templates/preview.hbs +5 -1
- package/dist/api/index.js +1 -1
- package/dist/api/routes/application.js +3 -2
- package/dist/api/routes/index.js +2 -0
- package/dist/{migrations/functions/publishedAppsQuota.js → api/routes/plugin.js} +13 -21
- package/dist/api/routes/public/rows.js +1 -82
- package/dist/api/routes/public/tables.js +1 -1
- package/dist/api/routes/table.js +1 -1
- package/dist/api/routes/utils/validators.js +20 -2
- package/dist/app.js +16 -1
- package/dist/db/utils.js +3 -0
- package/dist/environment.js +1 -0
- package/dist/integrations/airtable.js +126 -129
- package/dist/integrations/arangodb.js +86 -89
- package/dist/integrations/base/query.js +2 -2
- package/dist/integrations/base/sqlTable.js +3 -1
- package/dist/integrations/couchdb.js +80 -83
- package/dist/integrations/dynamodb.js +161 -164
- package/dist/integrations/elasticsearch.js +135 -138
- package/dist/integrations/firebase.js +154 -157
- package/dist/integrations/googlesheets.js +323 -327
- package/dist/integrations/index.js +99 -51
- package/dist/integrations/microsoftSqlServer.js +240 -243
- package/dist/integrations/mongodb.js +239 -242
- package/dist/integrations/mysql.js +215 -219
- package/dist/integrations/oracle.js +318 -322
- package/dist/integrations/postgres.js +262 -265
- package/dist/integrations/redis.js +134 -139
- package/dist/integrations/rest.js +289 -292
- package/dist/integrations/s3.js +61 -64
- package/dist/integrations/snowflake.js +83 -86
- package/dist/middleware/currentapp.js +2 -0
- package/dist/migrations/functions/backfill/global.js +0 -3
- package/dist/migrations/index.js +0 -10
- package/dist/package.json +9 -6
- package/dist/tests/utilities/TestConfiguration.js +1 -1
- package/dist/threads/query.js +2 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/fileSystem/index.js +105 -1
- package/dist/utilities/workerRequests.js +4 -0
- package/dist/watch.js +77 -0
- package/dist/websocket.js +22 -0
- package/package.json +10 -7
- package/scripts/dev/manage.js +4 -0
- package/scripts/localdomain.js +3 -1
- package/specs/openapi.json +115 -112
- package/specs/openapi.yaml +96 -94
- package/specs/resources/misc.js +116 -0
- package/specs/resources/query.js +1 -1
- package/src/api/controllers/application.ts +1 -2
- package/src/api/controllers/auth.js +11 -0
- package/src/api/controllers/component.ts +57 -0
- package/src/api/controllers/datasource.js +21 -8
- package/src/api/controllers/deploy/index.ts +1 -6
- package/src/api/controllers/integration.js +4 -4
- package/src/api/controllers/plugin/file.ts +15 -0
- package/src/api/controllers/plugin/github.ts +75 -0
- package/src/api/controllers/plugin/index.ts +134 -0
- package/src/api/controllers/plugin/npm.ts +56 -0
- package/src/api/controllers/plugin/uploaders.ts +4 -0
- package/src/api/controllers/plugin/url.ts +12 -0
- package/src/api/controllers/plugin/utils.ts +19 -0
- package/src/api/controllers/public/mapping/types.ts +8 -0
- package/src/api/controllers/row/external.js +1 -1
- package/src/api/controllers/screen.ts +122 -0
- package/src/api/controllers/static/index.ts +1 -1
- package/src/api/controllers/static/templates/BudibaseApp.svelte +10 -0
- package/src/api/controllers/static/templates/preview.hbs +5 -1
- package/src/api/index.js +1 -1
- package/src/api/routes/application.ts +13 -2
- package/src/api/routes/index.ts +2 -0
- package/src/api/routes/plugin.ts +14 -0
- package/src/api/routes/public/rows.ts +1 -82
- package/src/api/routes/public/tables.ts +1 -1
- package/src/api/routes/table.js +1 -1
- package/src/api/routes/tests/query.spec.js +8 -25
- package/src/api/routes/tests/user.spec.js +0 -2
- package/src/api/routes/utils/validators.js +26 -5
- package/src/app.ts +25 -2
- package/src/db/utils.js +4 -0
- package/src/definitions/openapi.ts +56 -55
- package/src/environment.js +1 -0
- package/src/integrations/airtable.ts +116 -118
- package/src/integrations/arangodb.ts +87 -89
- package/src/integrations/base/query.ts +2 -2
- package/src/integrations/base/sqlTable.ts +3 -1
- package/src/integrations/couchdb.ts +83 -89
- package/src/integrations/dynamodb.ts +173 -175
- package/src/integrations/elasticsearch.ts +120 -122
- package/src/integrations/firebase.ts +157 -159
- package/src/integrations/googlesheets.ts +328 -338
- package/src/integrations/index.ts +64 -21
- package/src/integrations/microsoftSqlServer.ts +249 -251
- package/src/integrations/mongodb.ts +261 -258
- package/src/integrations/mysql.ts +229 -234
- package/src/integrations/oracle.ts +373 -380
- package/src/integrations/postgres.ts +264 -268
- package/src/integrations/redis.ts +128 -132
- package/src/integrations/rest.ts +324 -329
- package/src/integrations/s3.ts +68 -71
- package/src/integrations/snowflake.ts +80 -82
- package/src/integrations/tests/{airtable.spec.js → airtable.spec.ts} +21 -18
- package/src/integrations/tests/{arangodb.spec.js → arangodb.spec.ts} +12 -9
- package/src/integrations/tests/{couchdb.spec.js → couchdb.spec.ts} +33 -27
- package/src/integrations/tests/{dynamodb.spec.js → dynamodb.spec.ts} +45 -41
- package/src/integrations/tests/{elasticsearch.spec.js → elasticsearch.spec.ts} +22 -21
- package/src/integrations/tests/{firebase.spec.js → firebase.spec.ts} +33 -28
- package/src/integrations/tests/{microsoftSqlServer.spec.js → microsoftSqlServer.spec.ts} +12 -11
- package/src/integrations/tests/{mongo.spec.js → mongo.spec.ts} +46 -35
- package/src/integrations/tests/{mysql.spec.js → mysql.spec.ts} +17 -15
- package/src/integrations/tests/{oracle.spec.js → oracle.spec.ts} +19 -17
- package/src/integrations/tests/{postgres.spec.js → postgres.spec.ts} +19 -17
- package/src/integrations/tests/{redis.spec.js → redis.spec.ts} +27 -18
- package/src/integrations/tests/{rest.spec.js → rest.spec.ts} +22 -14
- package/src/integrations/tests/{s3.spec.js → s3.spec.ts} +10 -8
- package/src/integrations/tests/{sql.spec.js → sql.spec.ts} +228 -177
- package/src/middleware/currentapp.js +2 -0
- package/src/migrations/functions/backfill/global.ts +0 -3
- package/src/migrations/index.ts +0 -16
- package/src/module.d.ts +2 -0
- package/src/tests/utilities/TestConfiguration.js +1 -1
- package/src/threads/query.ts +2 -2
- package/src/utilities/fileSystem/index.js +123 -0
- package/src/utilities/workerRequests.js +8 -0
- package/src/watch.ts +38 -0
- package/src/websocket.ts +26 -0
- package/builder/assets/index.8d12d461.css +0 -6
- package/builder/assets/index.d354271c.js +0 -879
- package/builder/assets/vendor.5e1fe644.css +0 -1
- package/builder/assets/vendor.67dbd8fa.js +0 -248
- package/coverage/lcov-report/api/controllers/component.js.html +0 -199
- package/coverage/lcov-report/api/controllers/screen.js.html +0 -259
- package/dist/migrations/functions/developerQuota.js +0 -49
- package/src/api/controllers/component.js +0 -38
- package/src/api/controllers/screen.js +0 -58
- package/src/migrations/functions/developerQuota.ts +0 -15
- package/src/migrations/functions/publishedAppsQuota.ts +0 -13
- package/src/migrations/functions/usageQuotas/syncDevelopers.ts +0 -19
- package/src/migrations/functions/usageQuotas/syncPublishedApps.ts +0 -21
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
const DynamoDBIntegration = require("../dynamodb")
|
|
1
|
+
import { default as DynamoDBIntegration } from "../dynamodb"
|
|
3
2
|
jest.mock("aws-sdk")
|
|
4
3
|
|
|
5
4
|
class TestConfiguration {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
integration: any
|
|
6
|
+
|
|
7
|
+
constructor(config: any = {}) {
|
|
8
|
+
this.integration = new DynamoDBIntegration.integration(config)
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
describe("DynamoDB Integration", () => {
|
|
12
|
-
let config
|
|
13
|
+
let config: any
|
|
13
14
|
let tableName = "Users"
|
|
14
15
|
|
|
15
16
|
beforeEach(() => {
|
|
@@ -17,25 +18,25 @@ describe("DynamoDB Integration", () => {
|
|
|
17
18
|
})
|
|
18
19
|
|
|
19
20
|
it("calls the create method with the correct params", async () => {
|
|
20
|
-
const response = await config.integration.create({
|
|
21
|
+
const response = await config.integration.create({
|
|
21
22
|
table: tableName,
|
|
22
23
|
json: {
|
|
23
|
-
Name: "John"
|
|
24
|
-
}
|
|
24
|
+
Name: "John",
|
|
25
|
+
},
|
|
25
26
|
})
|
|
26
27
|
expect(config.integration.client.put).toHaveBeenCalledWith({
|
|
27
28
|
TableName: tableName,
|
|
28
|
-
Name: "John"
|
|
29
|
+
Name: "John",
|
|
29
30
|
})
|
|
30
31
|
})
|
|
31
32
|
|
|
32
33
|
it("calls the read method with the correct params", async () => {
|
|
33
34
|
const indexName = "Test"
|
|
34
35
|
|
|
35
|
-
const response = await config.integration.read({
|
|
36
|
+
const response = await config.integration.read({
|
|
36
37
|
table: tableName,
|
|
37
|
-
index: indexName,
|
|
38
|
-
json: {}
|
|
38
|
+
index: indexName,
|
|
39
|
+
json: {},
|
|
39
40
|
})
|
|
40
41
|
expect(config.integration.client.query).toHaveBeenCalledWith({
|
|
41
42
|
TableName: tableName,
|
|
@@ -47,57 +48,59 @@ describe("DynamoDB Integration", () => {
|
|
|
47
48
|
it("calls the scan method with the correct params", async () => {
|
|
48
49
|
const indexName = "Test"
|
|
49
50
|
|
|
50
|
-
const response = await config.integration.scan({
|
|
51
|
+
const response = await config.integration.scan({
|
|
51
52
|
table: tableName,
|
|
52
|
-
index: indexName,
|
|
53
|
-
json: {}
|
|
53
|
+
index: indexName,
|
|
54
|
+
json: {},
|
|
54
55
|
})
|
|
55
56
|
expect(config.integration.client.scan).toHaveBeenCalledWith({
|
|
56
57
|
TableName: tableName,
|
|
57
58
|
IndexName: indexName,
|
|
58
59
|
})
|
|
59
|
-
expect(response).toEqual([
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
expect(response).toEqual([
|
|
61
|
+
{
|
|
62
|
+
Name: "test",
|
|
63
|
+
},
|
|
64
|
+
])
|
|
62
65
|
})
|
|
63
66
|
|
|
64
67
|
it("calls the get method with the correct params", async () => {
|
|
65
|
-
const response = await config.integration.get({
|
|
68
|
+
const response = await config.integration.get({
|
|
66
69
|
table: tableName,
|
|
67
70
|
json: {
|
|
68
|
-
Id: 123
|
|
69
|
-
}
|
|
71
|
+
Id: 123,
|
|
72
|
+
},
|
|
70
73
|
})
|
|
71
74
|
|
|
72
75
|
expect(config.integration.client.get).toHaveBeenCalledWith({
|
|
73
76
|
TableName: tableName,
|
|
74
|
-
Id: 123
|
|
77
|
+
Id: 123,
|
|
75
78
|
})
|
|
76
79
|
})
|
|
77
80
|
|
|
78
81
|
it("calls the update method with the correct params", async () => {
|
|
79
|
-
const response = await config.integration.update({
|
|
82
|
+
const response = await config.integration.update({
|
|
80
83
|
table: tableName,
|
|
81
84
|
json: {
|
|
82
|
-
Name: "John"
|
|
83
|
-
}
|
|
85
|
+
Name: "John",
|
|
86
|
+
},
|
|
84
87
|
})
|
|
85
88
|
expect(config.integration.client.update).toHaveBeenCalledWith({
|
|
86
89
|
TableName: tableName,
|
|
87
|
-
Name: "John"
|
|
90
|
+
Name: "John",
|
|
88
91
|
})
|
|
89
92
|
})
|
|
90
93
|
|
|
91
94
|
it("calls the delete method with the correct params", async () => {
|
|
92
|
-
const response = await config.integration.delete({
|
|
95
|
+
const response = await config.integration.delete({
|
|
93
96
|
table: tableName,
|
|
94
97
|
json: {
|
|
95
|
-
Name: "John"
|
|
96
|
-
}
|
|
98
|
+
Name: "John",
|
|
99
|
+
},
|
|
97
100
|
})
|
|
98
101
|
expect(config.integration.client.delete).toHaveBeenCalledWith({
|
|
99
102
|
TableName: tableName,
|
|
100
|
-
Name: "John"
|
|
103
|
+
Name: "John",
|
|
101
104
|
})
|
|
102
105
|
})
|
|
103
106
|
|
|
@@ -105,14 +108,14 @@ describe("DynamoDB Integration", () => {
|
|
|
105
108
|
const config = {
|
|
106
109
|
region: "us-east-1",
|
|
107
110
|
accessKeyId: "test",
|
|
108
|
-
|
|
111
|
+
secretAccessKey: "test",
|
|
109
112
|
}
|
|
110
113
|
|
|
111
|
-
const integration = new DynamoDBIntegration.integration(config)
|
|
114
|
+
const integration: any = new DynamoDBIntegration.integration(config)
|
|
112
115
|
|
|
113
116
|
expect(integration.config).toEqual({
|
|
114
117
|
currentClockSkew: true,
|
|
115
|
-
...config
|
|
118
|
+
...config,
|
|
116
119
|
})
|
|
117
120
|
})
|
|
118
121
|
|
|
@@ -120,16 +123,16 @@ describe("DynamoDB Integration", () => {
|
|
|
120
123
|
const config = {
|
|
121
124
|
region: "us-east-1",
|
|
122
125
|
accessKeyId: "test",
|
|
123
|
-
|
|
124
|
-
endpoint: "localhost:8080"
|
|
126
|
+
secretAccessKey: "test",
|
|
127
|
+
endpoint: "localhost:8080",
|
|
125
128
|
}
|
|
126
129
|
|
|
127
|
-
const integration = new DynamoDBIntegration.integration(config)
|
|
130
|
+
const integration: any = new DynamoDBIntegration.integration(config)
|
|
128
131
|
|
|
129
132
|
expect(integration.config).toEqual({
|
|
130
133
|
region: "us-east-1",
|
|
131
134
|
currentClockSkew: true,
|
|
132
|
-
endpoint: "localhost:8080"
|
|
135
|
+
endpoint: "localhost:8080",
|
|
133
136
|
})
|
|
134
137
|
})
|
|
135
138
|
|
|
@@ -137,15 +140,16 @@ describe("DynamoDB Integration", () => {
|
|
|
137
140
|
const config = {
|
|
138
141
|
region: "us-east-1",
|
|
139
142
|
accessKeyId: "test",
|
|
140
|
-
|
|
141
|
-
endpoint: "dynamodb.aws.foo.net"
|
|
143
|
+
secretAccessKey: "test",
|
|
144
|
+
endpoint: "dynamodb.aws.foo.net",
|
|
142
145
|
}
|
|
143
146
|
|
|
144
147
|
const integration = new DynamoDBIntegration.integration(config)
|
|
145
148
|
|
|
149
|
+
// @ts-ignore
|
|
146
150
|
expect(integration.config).toEqual({
|
|
147
151
|
currentClockSkew: true,
|
|
148
|
-
...config
|
|
152
|
+
...config,
|
|
149
153
|
})
|
|
150
154
|
})
|
|
151
|
-
})
|
|
155
|
+
})
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
const ElasticSearchIntegration = require("../elasticsearch")
|
|
1
|
+
import { default as ElasticSearchIntegration } from "../elasticsearch"
|
|
3
2
|
jest.mock("@elastic/elasticsearch")
|
|
4
3
|
|
|
5
4
|
class TestConfiguration {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
integration: any
|
|
6
|
+
|
|
7
|
+
constructor(config: any = {}) {
|
|
8
|
+
this.integration = new ElasticSearchIntegration.integration(config)
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
describe("Elasticsearch Integration", () => {
|
|
12
|
-
let config
|
|
13
|
+
let config: any
|
|
13
14
|
let indexName = "Users"
|
|
14
15
|
|
|
15
16
|
beforeEach(() => {
|
|
@@ -18,15 +19,15 @@ describe("Elasticsearch Integration", () => {
|
|
|
18
19
|
|
|
19
20
|
it("calls the create method with the correct params", async () => {
|
|
20
21
|
const body = {
|
|
21
|
-
name: "Hello"
|
|
22
|
+
name: "Hello",
|
|
22
23
|
}
|
|
23
|
-
const response = await config.integration.create({
|
|
24
|
+
const response = await config.integration.create({
|
|
24
25
|
index: indexName,
|
|
25
|
-
json: body
|
|
26
|
+
json: body,
|
|
26
27
|
})
|
|
27
28
|
expect(config.integration.client.index).toHaveBeenCalledWith({
|
|
28
29
|
index: indexName,
|
|
29
|
-
body
|
|
30
|
+
body,
|
|
30
31
|
})
|
|
31
32
|
})
|
|
32
33
|
|
|
@@ -34,43 +35,43 @@ describe("Elasticsearch Integration", () => {
|
|
|
34
35
|
const body = {
|
|
35
36
|
query: {
|
|
36
37
|
term: {
|
|
37
|
-
name: "kimchy"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
38
|
+
name: "kimchy",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
40
41
|
}
|
|
41
|
-
const response = await config.integration.read({
|
|
42
|
+
const response = await config.integration.read({
|
|
42
43
|
index: indexName,
|
|
43
|
-
json: body
|
|
44
|
+
json: body,
|
|
44
45
|
})
|
|
45
46
|
expect(config.integration.client.search).toHaveBeenCalledWith({
|
|
46
47
|
index: indexName,
|
|
47
|
-
body
|
|
48
|
+
body,
|
|
48
49
|
})
|
|
49
50
|
expect(response).toEqual(expect.any(Array))
|
|
50
51
|
})
|
|
51
52
|
|
|
52
53
|
it("calls the update method with the correct params", async () => {
|
|
53
54
|
const body = {
|
|
54
|
-
name: "updated"
|
|
55
|
+
name: "updated",
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
const response = await config.integration.update({
|
|
58
|
+
const response = await config.integration.update({
|
|
58
59
|
id: "1234",
|
|
59
60
|
index: indexName,
|
|
60
|
-
json: body
|
|
61
|
+
json: body,
|
|
61
62
|
})
|
|
62
63
|
|
|
63
64
|
expect(config.integration.client.update).toHaveBeenCalledWith({
|
|
64
65
|
id: "1234",
|
|
65
66
|
index: indexName,
|
|
66
|
-
body
|
|
67
|
+
body,
|
|
67
68
|
})
|
|
68
69
|
expect(response).toEqual(expect.any(Array))
|
|
69
70
|
})
|
|
70
71
|
|
|
71
72
|
it("calls the delete method with the correct params", async () => {
|
|
72
73
|
const body = {
|
|
73
|
-
id: "1234"
|
|
74
|
+
id: "1234",
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
const response = await config.integration.delete(body)
|
|
@@ -78,4 +79,4 @@ describe("Elasticsearch Integration", () => {
|
|
|
78
79
|
expect(config.integration.client.delete).toHaveBeenCalledWith(body)
|
|
79
80
|
expect(response).toEqual(expect.any(Array))
|
|
80
81
|
})
|
|
81
|
-
})
|
|
82
|
+
})
|
|
@@ -1,92 +1,97 @@
|
|
|
1
|
-
|
|
2
|
-
const FirebaseIntegration = require("../firebase")
|
|
1
|
+
import { default as FirebaseIntegration } from "../firebase"
|
|
3
2
|
jest.mock("@google-cloud/firestore")
|
|
4
3
|
|
|
5
4
|
class TestConfiguration {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
integration: any
|
|
6
|
+
|
|
7
|
+
constructor(config: any = {}) {
|
|
8
|
+
this.integration = new FirebaseIntegration.integration(config)
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
describe("Firebase Integration", () => {
|
|
12
|
-
let config
|
|
13
|
+
let config: any
|
|
13
14
|
let tableName = "Users"
|
|
14
15
|
|
|
15
16
|
beforeEach(() => {
|
|
16
17
|
config = new TestConfiguration({
|
|
17
|
-
serviceAccount: "{}"
|
|
18
|
+
serviceAccount: "{}",
|
|
18
19
|
})
|
|
19
20
|
})
|
|
20
21
|
|
|
21
22
|
it("calls the create method with the correct params", async () => {
|
|
22
|
-
await config.integration.create({
|
|
23
|
+
await config.integration.create({
|
|
23
24
|
table: tableName,
|
|
24
25
|
json: {
|
|
25
|
-
Name: "Test Name"
|
|
26
|
+
Name: "Test Name",
|
|
26
27
|
},
|
|
27
28
|
extra: {
|
|
28
|
-
collection: "test"
|
|
29
|
-
}
|
|
29
|
+
collection: "test",
|
|
30
|
+
},
|
|
30
31
|
})
|
|
31
32
|
expect(config.integration.client.collection).toHaveBeenCalledWith("test")
|
|
32
|
-
expect(config.integration.client.set).toHaveBeenCalledWith({
|
|
33
|
+
expect(config.integration.client.set).toHaveBeenCalledWith({
|
|
33
34
|
Name: "Test Name",
|
|
34
|
-
id: "test_id"
|
|
35
|
+
id: "test_id",
|
|
35
36
|
})
|
|
36
37
|
})
|
|
37
38
|
|
|
38
39
|
it("calls the read method with the correct params", async () => {
|
|
39
|
-
const response = await config.integration.read({
|
|
40
|
+
const response = await config.integration.read({
|
|
40
41
|
table: tableName,
|
|
41
42
|
json: {
|
|
42
|
-
Name: "Test"
|
|
43
|
+
Name: "Test",
|
|
43
44
|
},
|
|
44
45
|
extra: {
|
|
45
46
|
collection: "test",
|
|
46
47
|
filterField: "field",
|
|
47
48
|
filter: "==",
|
|
48
49
|
filterValue: "value",
|
|
49
|
-
}
|
|
50
|
+
},
|
|
50
51
|
})
|
|
51
52
|
expect(config.integration.client.collection).toHaveBeenCalledWith("test")
|
|
52
|
-
expect(config.integration.client.where).toHaveBeenCalledWith(
|
|
53
|
-
|
|
53
|
+
expect(config.integration.client.where).toHaveBeenCalledWith(
|
|
54
|
+
"field",
|
|
55
|
+
"==",
|
|
56
|
+
"value"
|
|
57
|
+
)
|
|
58
|
+
expect(response).toEqual([{ result: "test" }])
|
|
54
59
|
})
|
|
55
60
|
|
|
56
61
|
it("calls the update method with the correct params", async () => {
|
|
57
|
-
const response = await config.integration.update({
|
|
62
|
+
const response = await config.integration.update({
|
|
58
63
|
table: tableName,
|
|
59
64
|
json: {
|
|
60
65
|
id: "test",
|
|
61
|
-
Name: "Test"
|
|
66
|
+
Name: "Test",
|
|
62
67
|
},
|
|
63
68
|
extra: {
|
|
64
|
-
collection: "test"
|
|
65
|
-
}
|
|
69
|
+
collection: "test",
|
|
70
|
+
},
|
|
66
71
|
})
|
|
67
72
|
expect(config.integration.client.collection).toHaveBeenCalledWith("test")
|
|
68
73
|
expect(config.integration.client.update).toHaveBeenCalledWith({
|
|
69
74
|
Name: "Test",
|
|
70
|
-
id: "test"
|
|
75
|
+
id: "test",
|
|
71
76
|
})
|
|
72
77
|
expect(response).toEqual({
|
|
73
|
-
result: "test"
|
|
78
|
+
result: "test",
|
|
74
79
|
})
|
|
75
80
|
})
|
|
76
81
|
|
|
77
82
|
it("calls the delete method with the correct params", async () => {
|
|
78
|
-
const response = await config.integration.delete({
|
|
83
|
+
const response = await config.integration.delete({
|
|
79
84
|
table: tableName,
|
|
80
85
|
json: {
|
|
81
86
|
id: "test",
|
|
82
|
-
Name: "Test"
|
|
87
|
+
Name: "Test",
|
|
83
88
|
},
|
|
84
89
|
extra: {
|
|
85
|
-
collection: "test"
|
|
86
|
-
}
|
|
90
|
+
collection: "test",
|
|
91
|
+
},
|
|
87
92
|
})
|
|
88
93
|
expect(config.integration.client.collection).toHaveBeenCalledWith("test")
|
|
89
94
|
expect(config.integration.client.doc).toHaveBeenCalledWith("test")
|
|
90
95
|
expect(config.integration.client.delete).toHaveBeenCalled()
|
|
91
96
|
})
|
|
92
|
-
})
|
|
97
|
+
})
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
const MSSQLIntegration = require("../microsoftSqlServer")
|
|
1
|
+
import { default as MSSQLIntegration } from "../microsoftSqlServer"
|
|
3
2
|
jest.mock("mssql")
|
|
4
3
|
|
|
5
4
|
class TestConfiguration {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
integration: any
|
|
6
|
+
|
|
7
|
+
constructor(config: any = {}) {
|
|
8
|
+
this.integration = new MSSQLIntegration.integration(config)
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
describe("MS SQL Server Integration", () => {
|
|
12
|
-
let config
|
|
13
|
+
let config: any
|
|
13
14
|
|
|
14
15
|
beforeEach(async () => {
|
|
15
16
|
config = new TestConfiguration()
|
|
@@ -23,7 +24,7 @@ describe("MS SQL Server Integration", () => {
|
|
|
23
24
|
it("calls the create method with the correct params", async () => {
|
|
24
25
|
const sql = "insert into users (name, age) values ('Joe', 123);"
|
|
25
26
|
const response = await config.integration.create({
|
|
26
|
-
sql
|
|
27
|
+
sql,
|
|
27
28
|
})
|
|
28
29
|
expect(config.integration.client.request).toHaveBeenCalledWith()
|
|
29
30
|
expect(response[0]).toEqual(sql)
|
|
@@ -32,7 +33,7 @@ describe("MS SQL Server Integration", () => {
|
|
|
32
33
|
it("calls the read method with the correct params", async () => {
|
|
33
34
|
const sql = "select * from users;"
|
|
34
35
|
const response = await config.integration.read({
|
|
35
|
-
sql
|
|
36
|
+
sql,
|
|
36
37
|
})
|
|
37
38
|
expect(config.integration.client.request).toHaveBeenCalledWith()
|
|
38
39
|
expect(response[0]).toEqual(sql)
|
|
@@ -45,11 +46,11 @@ describe("MS SQL Server Integration", () => {
|
|
|
45
46
|
})
|
|
46
47
|
|
|
47
48
|
it("returns the correct response when the create response has no rows", async () => {
|
|
48
|
-
|
|
49
|
-
const response = await config.integration.create({
|
|
50
|
-
sql
|
|
49
|
+
const sql = "insert into users (name, age) values ('Joe', 123);"
|
|
50
|
+
const response = await config.integration.create({
|
|
51
|
+
sql,
|
|
51
52
|
})
|
|
52
53
|
expect(response[0]).toEqual(sql)
|
|
53
54
|
})
|
|
54
55
|
})
|
|
55
|
-
})
|
|
56
|
+
})
|