@budibase/server 2.6.16-alpha.1 → 2.6.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builder/assets/{index.99a64f16.css → index.86c992bf.css} +1 -1
- package/builder/assets/{index.6871cd96.js → index.a40dcadd.js} +330 -330
- package/builder/index.html +2 -2
- package/dist/automations/steps/make.js +5 -19
- package/dist/automations/steps/zapier.js +6 -19
- package/dist/integrations/googlesheets.js +1 -14
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/jest.config.ts +3 -3
- package/nodemon.json +3 -7
- package/package.json +8 -8
- package/src/automations/steps/make.ts +1 -18
- package/src/automations/steps/zapier.ts +1 -18
- package/src/automations/tests/zapier.spec.js +27 -0
- package/src/integrations/googlesheets.ts +2 -15
- package/tsconfig.json +1 -1
- package/src/automations/tests/make.spec.ts +0 -54
- package/src/automations/tests/zapier.spec.ts +0 -56
package/jest.config.ts
CHANGED
|
@@ -20,9 +20,9 @@ const baseConfig: Config.InitialProjectOptions = {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
// add pro sources if they exist
|
|
23
|
-
if (fs.existsSync("
|
|
24
|
-
baseConfig.moduleNameMapper
|
|
25
|
-
"<rootDir
|
|
23
|
+
if (fs.existsSync("../../../budibase-pro")) {
|
|
24
|
+
baseConfig.moduleNameMapper["@budibase/pro"] =
|
|
25
|
+
"<rootDir>/../../../budibase-pro/packages/pro/src"
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const config: Config.InitialOptions = {
|
package/nodemon.json
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"watch": ["src", "../backend-core", "
|
|
2
|
+
"watch": ["src", "../backend-core", "../../../budibase-pro/packages/pro"],
|
|
3
3
|
"ext": "js,ts,json",
|
|
4
|
-
"ignore": [
|
|
5
|
-
"src/**/*.spec.ts",
|
|
6
|
-
"src/**/*.spec.js",
|
|
7
|
-
"../backend-core/dist/**/*"
|
|
8
|
-
],
|
|
4
|
+
"ignore": ["src/**/*.spec.ts", "src/**/*.spec.js", "../backend-core/dist/**/*"],
|
|
9
5
|
"exec": "ts-node src/index.ts"
|
|
10
|
-
}
|
|
6
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.6.16
|
|
4
|
+
"version": "2.6.16",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"license": "GPL-3.0",
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
48
|
-
"@budibase/backend-core": "2.6.16
|
|
49
|
-
"@budibase/client": "2.6.16
|
|
50
|
-
"@budibase/pro": "2.6.
|
|
51
|
-
"@budibase/shared-core": "2.6.16
|
|
52
|
-
"@budibase/string-templates": "2.6.16
|
|
53
|
-
"@budibase/types": "2.6.16
|
|
48
|
+
"@budibase/backend-core": "^2.6.16",
|
|
49
|
+
"@budibase/client": "^2.6.16",
|
|
50
|
+
"@budibase/pro": "2.6.15",
|
|
51
|
+
"@budibase/shared-core": "^2.6.16",
|
|
52
|
+
"@budibase/string-templates": "^2.6.16",
|
|
53
|
+
"@budibase/types": "^2.6.16",
|
|
54
54
|
"@bull-board/api": "3.7.0",
|
|
55
55
|
"@bull-board/koa": "3.9.4",
|
|
56
56
|
"@elastic/elasticsearch": "7.10.0",
|
|
@@ -176,5 +176,5 @@
|
|
|
176
176
|
"optionalDependencies": {
|
|
177
177
|
"oracledb": "5.3.0"
|
|
178
178
|
},
|
|
179
|
-
"gitHead": "
|
|
179
|
+
"gitHead": "d43a6a44bd074e077ea131303c0f7a2b0e0ddb75"
|
|
180
180
|
}
|
|
@@ -26,10 +26,6 @@ export const definition: AutomationStepSchema = {
|
|
|
26
26
|
type: AutomationIOType.STRING,
|
|
27
27
|
title: "Webhook URL",
|
|
28
28
|
},
|
|
29
|
-
body: {
|
|
30
|
-
type: AutomationIOType.JSON,
|
|
31
|
-
title: "Payload",
|
|
32
|
-
},
|
|
33
29
|
value1: {
|
|
34
30
|
type: AutomationIOType.STRING,
|
|
35
31
|
title: "Input Value 1",
|
|
@@ -74,19 +70,7 @@ export const definition: AutomationStepSchema = {
|
|
|
74
70
|
}
|
|
75
71
|
|
|
76
72
|
export async function run({ inputs }: AutomationStepInput) {
|
|
77
|
-
|
|
78
|
-
const { url, value1, value2, value3, value4, value5, body } = inputs
|
|
79
|
-
|
|
80
|
-
let payload = {}
|
|
81
|
-
try {
|
|
82
|
-
payload = body?.value ? JSON.parse(body?.value) : {}
|
|
83
|
-
} catch (err) {
|
|
84
|
-
return {
|
|
85
|
-
httpStatus: 400,
|
|
86
|
-
response: "Invalid payload JSON",
|
|
87
|
-
success: false,
|
|
88
|
-
}
|
|
89
|
-
}
|
|
73
|
+
const { url, value1, value2, value3, value4, value5 } = inputs
|
|
90
74
|
|
|
91
75
|
if (!url?.trim()?.length) {
|
|
92
76
|
return {
|
|
@@ -105,7 +89,6 @@ export async function run({ inputs }: AutomationStepInput) {
|
|
|
105
89
|
value3,
|
|
106
90
|
value4,
|
|
107
91
|
value5,
|
|
108
|
-
...payload,
|
|
109
92
|
}),
|
|
110
93
|
headers: {
|
|
111
94
|
"Content-Type": "application/json",
|
|
@@ -24,10 +24,6 @@ export const definition: AutomationStepSchema = {
|
|
|
24
24
|
type: AutomationIOType.STRING,
|
|
25
25
|
title: "Webhook URL",
|
|
26
26
|
},
|
|
27
|
-
body: {
|
|
28
|
-
type: AutomationIOType.JSON,
|
|
29
|
-
title: "Payload",
|
|
30
|
-
},
|
|
31
27
|
value1: {
|
|
32
28
|
type: AutomationIOType.STRING,
|
|
33
29
|
title: "Payload Value 1",
|
|
@@ -67,19 +63,7 @@ export const definition: AutomationStepSchema = {
|
|
|
67
63
|
}
|
|
68
64
|
|
|
69
65
|
export async function run({ inputs }: AutomationStepInput) {
|
|
70
|
-
|
|
71
|
-
const { url, value1, value2, value3, value4, value5, body } = inputs
|
|
72
|
-
|
|
73
|
-
let payload = {}
|
|
74
|
-
try {
|
|
75
|
-
payload = body?.value ? JSON.parse(body?.value) : {}
|
|
76
|
-
} catch (err) {
|
|
77
|
-
return {
|
|
78
|
-
httpStatus: 400,
|
|
79
|
-
response: "Invalid payload JSON",
|
|
80
|
-
success: false,
|
|
81
|
-
}
|
|
82
|
-
}
|
|
66
|
+
const { url, value1, value2, value3, value4, value5 } = inputs
|
|
83
67
|
|
|
84
68
|
if (!url?.trim()?.length) {
|
|
85
69
|
return {
|
|
@@ -101,7 +85,6 @@ export async function run({ inputs }: AutomationStepInput) {
|
|
|
101
85
|
value3,
|
|
102
86
|
value4,
|
|
103
87
|
value5,
|
|
104
|
-
...payload,
|
|
105
88
|
}),
|
|
106
89
|
headers: {
|
|
107
90
|
"Content-Type": "application/json",
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
})
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "@budibase/types"
|
|
16
16
|
import { OAuth2Client } from "google-auth-library"
|
|
17
17
|
import { buildExternalTableId, finaliseExternalTables } from "./utils"
|
|
18
|
-
import { GoogleSpreadsheet
|
|
18
|
+
import { GoogleSpreadsheet } from "google-spreadsheet"
|
|
19
19
|
import fetch from "node-fetch"
|
|
20
20
|
import { configs, HTTPError } from "@budibase/backend-core"
|
|
21
21
|
import { dataFilters } from "@budibase/shared-core"
|
|
@@ -434,20 +434,7 @@ class GoogleSheetsIntegration implements DatasourcePlus {
|
|
|
434
434
|
try {
|
|
435
435
|
await this.connect()
|
|
436
436
|
const sheet = this.client.sheetsByTitle[query.sheet]
|
|
437
|
-
|
|
438
|
-
if (query.paginate) {
|
|
439
|
-
const limit = query.paginate.limit || 100
|
|
440
|
-
let page: number =
|
|
441
|
-
typeof query.paginate.page === "number"
|
|
442
|
-
? query.paginate.page
|
|
443
|
-
: parseInt(query.paginate.page || "1")
|
|
444
|
-
rows = await sheet.getRows({
|
|
445
|
-
limit,
|
|
446
|
-
offset: (page - 1) * limit,
|
|
447
|
-
})
|
|
448
|
-
} else {
|
|
449
|
-
rows = await sheet.getRows()
|
|
450
|
-
}
|
|
437
|
+
const rows = await sheet.getRows()
|
|
451
438
|
const filtered = dataFilters.runLuceneQuery(rows, query.filters)
|
|
452
439
|
const headerValues = sheet.headerValues
|
|
453
440
|
let response = []
|
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": ["
|
|
14
|
+
"@budibase/pro": ["../../../budibase-pro/packages/pro/src"]
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"ts-node": {
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { getConfig, afterAll, runStep, actions } from "./utilities"
|
|
2
|
-
|
|
3
|
-
describe("test the outgoing webhook action", () => {
|
|
4
|
-
let config = getConfig()
|
|
5
|
-
|
|
6
|
-
beforeAll(async () => {
|
|
7
|
-
await config.init()
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
afterAll()
|
|
11
|
-
|
|
12
|
-
it("should be able to run the action", async () => {
|
|
13
|
-
const res = await runStep(actions.integromat.stepId, {
|
|
14
|
-
value1: "test",
|
|
15
|
-
url: "http://www.test.com",
|
|
16
|
-
})
|
|
17
|
-
expect(res.response.url).toEqual("http://www.test.com")
|
|
18
|
-
expect(res.response.method).toEqual("post")
|
|
19
|
-
expect(res.success).toEqual(true)
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
it("should add the payload props when a JSON string is provided", async () => {
|
|
23
|
-
const payload = `{"value1":1,"value2":2,"value3":3,"value4":4,"value5":5,"name":"Adam","age":9}`
|
|
24
|
-
const res = await runStep(actions.integromat.stepId, {
|
|
25
|
-
value1: "ONE",
|
|
26
|
-
value2: "TWO",
|
|
27
|
-
value3: "THREE",
|
|
28
|
-
value4: "FOUR",
|
|
29
|
-
value5: "FIVE",
|
|
30
|
-
body: {
|
|
31
|
-
value: payload,
|
|
32
|
-
},
|
|
33
|
-
url: "http://www.test.com",
|
|
34
|
-
})
|
|
35
|
-
expect(res.response.url).toEqual("http://www.test.com")
|
|
36
|
-
expect(res.response.method).toEqual("post")
|
|
37
|
-
expect(res.response.body).toEqual(payload)
|
|
38
|
-
expect(res.success).toEqual(true)
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
it("should return a 400 if the JSON payload string is malformed", async () => {
|
|
42
|
-
const payload = `{ value1 1 }`
|
|
43
|
-
const res = await runStep(actions.integromat.stepId, {
|
|
44
|
-
value1: "ONE",
|
|
45
|
-
body: {
|
|
46
|
-
value: payload,
|
|
47
|
-
},
|
|
48
|
-
url: "http://www.test.com",
|
|
49
|
-
})
|
|
50
|
-
expect(res.httpStatus).toEqual(400)
|
|
51
|
-
expect(res.response).toEqual("Invalid payload JSON")
|
|
52
|
-
expect(res.success).toEqual(false)
|
|
53
|
-
})
|
|
54
|
-
})
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { getConfig, afterAll, runStep, actions } from "./utilities"
|
|
2
|
-
|
|
3
|
-
describe("test the outgoing webhook action", () => {
|
|
4
|
-
let config = getConfig()
|
|
5
|
-
|
|
6
|
-
beforeAll(async () => {
|
|
7
|
-
await config.init()
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
afterAll()
|
|
11
|
-
|
|
12
|
-
it("should be able to run the action", async () => {
|
|
13
|
-
const res = await runStep(actions.zapier.stepId, {
|
|
14
|
-
value1: "test",
|
|
15
|
-
url: "http://www.test.com",
|
|
16
|
-
})
|
|
17
|
-
expect(res.response.url).toEqual("http://www.test.com")
|
|
18
|
-
expect(res.response.method).toEqual("post")
|
|
19
|
-
expect(res.success).toEqual(true)
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
it("should add the payload props when a JSON string is provided", async () => {
|
|
23
|
-
const payload = `{ "value1": 1, "value2": 2, "value3": 3, "value4": 4, "value5": 5, "name": "Adam", "age": 9 }`
|
|
24
|
-
const res = await runStep(actions.zapier.stepId, {
|
|
25
|
-
value1: "ONE",
|
|
26
|
-
value2: "TWO",
|
|
27
|
-
value3: "THREE",
|
|
28
|
-
value4: "FOUR",
|
|
29
|
-
value5: "FIVE",
|
|
30
|
-
body: {
|
|
31
|
-
value: payload,
|
|
32
|
-
},
|
|
33
|
-
url: "http://www.test.com",
|
|
34
|
-
})
|
|
35
|
-
expect(res.response.url).toEqual("http://www.test.com")
|
|
36
|
-
expect(res.response.method).toEqual("post")
|
|
37
|
-
expect(res.response.body).toEqual(
|
|
38
|
-
`{"platform":"budibase","value1":1,"value2":2,"value3":3,"value4":4,"value5":5,"name":"Adam","age":9}`
|
|
39
|
-
)
|
|
40
|
-
expect(res.success).toEqual(true)
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
it("should return a 400 if the JSON payload string is malformed", async () => {
|
|
44
|
-
const payload = `{ value1 1 }`
|
|
45
|
-
const res = await runStep(actions.zapier.stepId, {
|
|
46
|
-
value1: "ONE",
|
|
47
|
-
body: {
|
|
48
|
-
value: payload,
|
|
49
|
-
},
|
|
50
|
-
url: "http://www.test.com",
|
|
51
|
-
})
|
|
52
|
-
expect(res.httpStatus).toEqual(400)
|
|
53
|
-
expect(res.response).toEqual("Invalid payload JSON")
|
|
54
|
-
expect(res.success).toEqual(false)
|
|
55
|
-
})
|
|
56
|
-
})
|