@budibase/server 2.6.18 → 2.6.19-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.
Files changed (64) hide show
  1. package/builder/assets/{index.86c992bf.css → index.07382a47.css} +2 -2
  2. package/builder/assets/{index.69c5c1ea.js → index.b9eeb2a8.js} +310 -318
  3. package/builder/index.html +2 -2
  4. package/dist/api/controllers/datasource.js +70 -39
  5. package/dist/api/controllers/integration.js +2 -2
  6. package/dist/api/routes/datasource.js +1 -0
  7. package/dist/automations/steps/make.js +19 -5
  8. package/dist/automations/steps/zapier.js +19 -6
  9. package/dist/automations/utils.js +13 -7
  10. package/dist/db/dynamoClient.js +1 -1
  11. package/dist/integrations/airtable.js +28 -2
  12. package/dist/integrations/arangodb.js +19 -3
  13. package/dist/integrations/couchdb.js +16 -1
  14. package/dist/integrations/dynamodb.js +16 -0
  15. package/dist/integrations/elasticsearch.js +15 -0
  16. package/dist/integrations/firebase.js +15 -0
  17. package/dist/integrations/googlesheets.js +30 -1
  18. package/dist/integrations/index.js +5 -2
  19. package/dist/integrations/microsoftSqlServer.js +16 -0
  20. package/dist/integrations/mongodb.js +16 -0
  21. package/dist/integrations/mysql.js +21 -5
  22. package/dist/integrations/oracle.js +29 -0
  23. package/dist/integrations/postgres.js +26 -7
  24. package/dist/integrations/redis.js +20 -1
  25. package/dist/integrations/s3.js +23 -4
  26. package/dist/integrations/snowflake.js +15 -0
  27. package/dist/migrations/functions/backfill/app/queries.js +1 -2
  28. package/dist/sdk/app/datasources/datasources.js +10 -3
  29. package/dist/tsconfig.build.tsbuildinfo +1 -1
  30. package/dist/utilities/fileSystem/app.js +1 -1
  31. package/jest.config.ts +3 -3
  32. package/nodemon.json +7 -3
  33. package/package.json +10 -9
  34. package/src/api/controllers/datasource.ts +88 -49
  35. package/src/api/controllers/integration.ts +3 -3
  36. package/src/api/routes/datasource.ts +5 -0
  37. package/src/automations/steps/make.ts +18 -1
  38. package/src/automations/steps/zapier.ts +18 -1
  39. package/src/automations/tests/make.spec.ts +54 -0
  40. package/src/automations/tests/zapier.spec.ts +56 -0
  41. package/src/automations/utils.ts +13 -7
  42. package/src/db/dynamoClient.ts +1 -1
  43. package/src/integration-test/postgres.spec.ts +0 -1
  44. package/src/integrations/airtable.ts +31 -4
  45. package/src/integrations/arangodb.ts +18 -2
  46. package/src/integrations/couchdb.ts +18 -4
  47. package/src/integrations/dynamodb.ts +34 -5
  48. package/src/integrations/elasticsearch.ts +16 -1
  49. package/src/integrations/firebase.ts +15 -0
  50. package/src/integrations/googlesheets.ts +31 -2
  51. package/src/integrations/index.ts +12 -7
  52. package/src/integrations/microsoftSqlServer.ts +16 -0
  53. package/src/integrations/mongodb.ts +16 -0
  54. package/src/integrations/mysql.ts +27 -16
  55. package/src/integrations/oracle.ts +28 -6
  56. package/src/integrations/postgres.ts +21 -3
  57. package/src/integrations/redis.ts +26 -3
  58. package/src/integrations/s3.ts +19 -3
  59. package/src/integrations/snowflake.ts +20 -1
  60. package/src/migrations/functions/backfill/app/queries.ts +1 -1
  61. package/src/sdk/app/datasources/datasources.ts +7 -1
  62. package/src/utilities/fileSystem/app.ts +1 -1
  63. package/tsconfig.json +1 -1
  64. package/src/automations/tests/zapier.spec.js +0 -27
@@ -1,4 +1,10 @@
1
- import { DatasourceFieldType, Integration, QueryType } from "@budibase/types"
1
+ import {
2
+ ConnectionInfo,
3
+ DatasourceFeature,
4
+ DatasourceFieldType,
5
+ Integration,
6
+ QueryType,
7
+ } from "@budibase/types"
2
8
  import Redis from "ioredis"
3
9
 
4
10
  interface RedisConfig {
@@ -11,9 +17,11 @@ interface RedisConfig {
11
17
 
12
18
  const SCHEMA: Integration = {
13
19
  docs: "https://redis.io/docs/",
14
- description: "",
20
+ description:
21
+ "Redis is a caching tool, providing powerful key-value store capabilities.",
15
22
  friendlyName: "Redis",
16
23
  type: "Non-relational",
24
+ features: [DatasourceFeature.CONNECTION_CHECKING],
17
25
  datasource: {
18
26
  host: {
19
27
  type: "string",
@@ -86,7 +94,7 @@ const SCHEMA: Integration = {
86
94
 
87
95
  class RedisIntegration {
88
96
  private readonly config: RedisConfig
89
- private client: any
97
+ private client
90
98
 
91
99
  constructor(config: RedisConfig) {
92
100
  this.config = config
@@ -99,6 +107,21 @@ class RedisIntegration {
99
107
  })
100
108
  }
101
109
 
110
+ async testConnection() {
111
+ const response: ConnectionInfo = {
112
+ connected: false,
113
+ }
114
+ try {
115
+ await this.client.ping()
116
+ response.connected = true
117
+ } catch (e: any) {
118
+ response.error = e.message as string
119
+ } finally {
120
+ await this.disconnect()
121
+ }
122
+ return response
123
+ }
124
+
102
125
  async disconnect() {
103
126
  return this.client.quit()
104
127
  }
@@ -3,10 +3,12 @@ import {
3
3
  QueryType,
4
4
  IntegrationBase,
5
5
  DatasourceFieldType,
6
+ DatasourceFeature,
7
+ ConnectionInfo,
6
8
  } from "@budibase/types"
7
9
 
8
- const AWS = require("aws-sdk")
9
- const csv = require("csvtojson")
10
+ import AWS from "aws-sdk"
11
+ import csv from "csvtojson"
10
12
 
11
13
  interface S3Config {
12
14
  region: string
@@ -22,6 +24,7 @@ const SCHEMA: Integration = {
22
24
  "Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance.",
23
25
  friendlyName: "Amazon S3",
24
26
  type: "Object store",
27
+ features: [DatasourceFeature.CONNECTION_CHECKING],
25
28
  datasource: {
26
29
  region: {
27
30
  type: "string",
@@ -152,7 +155,7 @@ const SCHEMA: Integration = {
152
155
 
153
156
  class S3Integration implements IntegrationBase {
154
157
  private readonly config: S3Config
155
- private client: any
158
+ private client
156
159
 
157
160
  constructor(config: S3Config) {
158
161
  this.config = config
@@ -165,6 +168,19 @@ class S3Integration implements IntegrationBase {
165
168
  this.client = new AWS.S3(this.config)
166
169
  }
167
170
 
171
+ async testConnection() {
172
+ const response: ConnectionInfo = {
173
+ connected: false,
174
+ }
175
+ try {
176
+ await this.client.listBuckets().promise()
177
+ response.connected = true
178
+ } catch (e: any) {
179
+ response.error = e.message as string
180
+ }
181
+ return response
182
+ }
183
+
168
184
  async create(query: {
169
185
  bucket: string
170
186
  location: string
@@ -1,4 +1,10 @@
1
- import { Integration, QueryType, SqlQuery } from "@budibase/types"
1
+ import {
2
+ ConnectionInfo,
3
+ DatasourceFeature,
4
+ Integration,
5
+ QueryType,
6
+ SqlQuery,
7
+ } from "@budibase/types"
2
8
  import { Snowflake } from "snowflake-promise"
3
9
 
4
10
  interface SnowflakeConfig {
@@ -16,6 +22,7 @@ const SCHEMA: Integration = {
16
22
  "Snowflake is a solution for data warehousing, data lakes, data engineering, data science, data application development, and securely sharing and consuming shared data.",
17
23
  friendlyName: "Snowflake",
18
24
  type: "Relational",
25
+ features: [DatasourceFeature.CONNECTION_CHECKING],
19
26
  datasource: {
20
27
  account: {
21
28
  type: "string",
@@ -65,6 +72,18 @@ class SnowflakeIntegration {
65
72
  this.client = new Snowflake(config)
66
73
  }
67
74
 
75
+ async testConnection(): Promise<ConnectionInfo> {
76
+ try {
77
+ await this.client.connect()
78
+ return { connected: true }
79
+ } catch (e: any) {
80
+ return {
81
+ connected: false,
82
+ error: e.message as string,
83
+ }
84
+ }
85
+ }
86
+
68
87
  async internalQuery(query: SqlQuery) {
69
88
  await this.client.connect()
70
89
  try {
@@ -33,7 +33,7 @@ export const backfill = async (appDb: any, timestamp: string | number) => {
33
33
  datasource = {
34
34
  type: "unknown",
35
35
  _id: query.datasourceId,
36
- source: SourceName.UNKNOWN,
36
+ source: "unknown" as SourceName,
37
37
  }
38
38
  } else {
39
39
  throw e
@@ -13,6 +13,7 @@ import {
13
13
  import { cloneDeep } from "lodash/fp"
14
14
  import { getEnvironmentVariables } from "../../utils"
15
15
  import { getDefinitions, getDefinition } from "../../../integrations"
16
+ import _ from "lodash"
16
17
 
17
18
  const ENV_VAR_PREFIX = "env."
18
19
 
@@ -41,7 +42,7 @@ async function enrichDatasourceWithValues(datasource: Datasource) {
41
42
  { onlyFound: true }
42
43
  ) as Datasource
43
44
  const definition = await getDefinition(processed.source)
44
- processed.config = checkDatasourceTypes(definition, processed.config)
45
+ processed.config = checkDatasourceTypes(definition!, processed.config)
45
46
  return {
46
47
  datasource: processed,
47
48
  envVars: env as Record<string, string>,
@@ -147,6 +148,11 @@ export function mergeConfigs(update: Datasource, old: Datasource) {
147
148
  }
148
149
  }
149
150
  }
151
+
152
+ if (old.config?.auth) {
153
+ update.config = _.merge(old.config, update.config)
154
+ }
155
+
150
156
  // update back to actual passwords for everything else
151
157
  for (let [key, value] of Object.entries(update.config)) {
152
158
  if (value !== PASSWORD_REPLACEMENT) {
@@ -35,7 +35,7 @@ export const getComponentLibraryManifest = async (library: string) => {
35
35
  const filename = "manifest.json"
36
36
 
37
37
  if (env.isDev() || env.isTest()) {
38
- const path = join(NODE_MODULES_PATH, "@budibase", "client", filename)
38
+ const path = join(TOP_LEVEL_PATH, "../client", filename)
39
39
  // always load from new so that updates are refreshed
40
40
  delete require.cache[require.resolve(path)]
41
41
  return require(path)
package/tsconfig.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "@budibase/backend-core": ["../backend-core/src"],
12
12
  "@budibase/backend-core/*": ["../backend-core/*"],
13
13
  "@budibase/shared-core": ["../shared-core/src"],
14
- "@budibase/pro": ["../../../budibase-pro/packages/pro/src"]
14
+ "@budibase/pro": ["../pro/packages/pro/src"]
15
15
  }
16
16
  },
17
17
  "ts-node": {
@@ -1,27 +0,0 @@
1
- const setup = require("./utilities")
2
- const fetch = require("node-fetch")
3
-
4
- jest.mock("node-fetch")
5
-
6
- describe("test the outgoing webhook action", () => {
7
- let inputs
8
- let config = setup.getConfig()
9
-
10
- beforeAll(async () => {
11
- await config.init()
12
- inputs = {
13
- value1: "test",
14
- url: "http://www.test.com",
15
- }
16
- })
17
-
18
- afterAll(setup.afterAll)
19
-
20
- it("should be able to run the action", async () => {
21
- const res = await setup.runStep(setup.actions.zapier.stepId, inputs)
22
- expect(res.response.url).toEqual("http://www.test.com")
23
- expect(res.response.method).toEqual("post")
24
- expect(res.success).toEqual(true)
25
- })
26
-
27
- })