@budibase/server 2.5.9 → 2.5.10-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/builder/assets/index.24635afb.js +1794 -0
- package/builder/assets/index.4eae16b2.css +6 -0
- package/builder/index.html +2 -2
- package/dist/api/controllers/application.js +3 -4
- package/dist/api/controllers/automation.js +13 -7
- package/dist/api/controllers/datasource.js +1 -1
- package/dist/api/controllers/dev.js +1 -1
- package/dist/api/controllers/ops.js +40 -0
- package/dist/api/controllers/plugin/index.js +6 -37
- package/dist/api/controllers/query/index.js +2 -2
- package/dist/api/controllers/row/ExternalRequest.js +21 -14
- package/dist/api/controllers/row/internal.js +5 -2
- package/dist/api/controllers/row/utils.js +2 -2
- package/dist/api/controllers/table/index.js +2 -2
- package/dist/api/controllers/table/utils.js +9 -3
- package/dist/api/controllers/user.js +1 -83
- package/dist/api/controllers/view/exporters.js +3 -1
- package/dist/api/index.js +1 -2
- package/dist/api/routes/index.js +2 -2
- package/dist/api/routes/{cloud.js → ops.js} +19 -6
- package/dist/api/routes/user.js +0 -1
- package/dist/app.js +4 -13
- package/dist/automations/actions.js +32 -6
- package/dist/automations/index.js +3 -2
- package/dist/automations/steps/bash.js +6 -6
- package/dist/automations/steps/createRow.js +11 -11
- package/dist/automations/steps/delay.js +3 -3
- package/dist/automations/steps/deleteRow.js +8 -8
- package/dist/automations/steps/discord.js +8 -8
- package/dist/automations/steps/executeQuery.js +9 -9
- package/dist/automations/steps/executeScript.js +6 -6
- package/dist/automations/steps/filter.js +6 -6
- package/dist/automations/steps/integromat.js +10 -10
- package/dist/automations/steps/loop.js +9 -9
- package/dist/automations/steps/outgoingWebhook.js +10 -10
- package/dist/automations/steps/queryRows.js +14 -14
- package/dist/automations/steps/sendSmtpEmail.js +9 -9
- package/dist/automations/steps/serverLog.js +4 -4
- package/dist/automations/steps/slack.js +6 -6
- package/dist/automations/steps/updateRow.js +11 -11
- package/dist/automations/steps/zapier.js +9 -9
- package/dist/automations/triggerInfo/app.js +5 -5
- package/dist/automations/triggerInfo/cron.js +4 -4
- package/dist/automations/triggerInfo/rowDeleted.js +5 -5
- package/dist/automations/triggerInfo/rowSaved.js +7 -7
- package/dist/automations/triggerInfo/rowUpdated.js +7 -7
- package/dist/automations/triggerInfo/webhook.js +6 -6
- package/dist/db/utils.js +3 -2
- package/dist/environment.js +0 -1
- package/dist/events/docUpdates/index.js +17 -0
- package/dist/events/docUpdates/processors.js +18 -0
- package/dist/events/docUpdates/syncUsers.js +49 -0
- package/dist/events/index.js +3 -0
- package/dist/integrations/base/sqlTable.js +9 -2
- package/dist/integrations/index.js +3 -3
- package/dist/integrations/microsoftSqlServer.js +5 -2
- package/dist/integrations/mysql.js +5 -3
- package/dist/integrations/postgres.js +7 -5
- package/dist/integrations/redis.js +7 -0
- package/dist/integrations/rest.js +4 -0
- package/dist/migrations/functions/syncQuotas.js +2 -0
- package/dist/migrations/functions/usageQuotas/syncApps.js +1 -2
- package/dist/migrations/functions/usageQuotas/syncRows.js +1 -2
- package/dist/migrations/functions/usageQuotas/syncUsers.js +21 -0
- package/dist/sdk/app/applications/sync.js +117 -23
- package/dist/sdk/app/backups/exports.js +14 -38
- package/dist/sdk/index.js +2 -0
- package/dist/sdk/plugins/index.js +27 -0
- package/dist/sdk/plugins/plugins.js +53 -0
- package/dist/sdk/users/utils.js +21 -4
- package/dist/startup.js +31 -28
- package/dist/threads/automation.js +16 -5
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/csv.js +33 -0
- package/dist/utilities/fileSystem/plugin.js +33 -23
- package/dist/utilities/global.js +17 -12
- package/dist/utilities/rowProcessor/utils.js +4 -5
- package/dist/utilities/schema.js +5 -1
- package/dist/watch.js +2 -2
- package/dist/websockets/client.js +14 -0
- package/dist/websockets/grid.js +60 -0
- package/dist/websockets/index.js +17 -0
- package/dist/websockets/websocket.js +78 -0
- package/package.json +16 -16
- package/scripts/dev/manage.js +2 -0
- package/scripts/integrations/mssql/data/entrypoint.sh +1 -0
- package/scripts/integrations/mssql/data/setup.sql +17 -17
- package/scripts/integrations/mysql/init.sql +1 -1
- package/scripts/integrations/postgres/init.sql +1 -0
- package/src/api/controllers/application.ts +4 -4
- package/src/api/controllers/automation.ts +12 -6
- package/src/api/controllers/datasource.ts +15 -5
- package/src/api/controllers/dev.ts +2 -2
- package/src/api/controllers/ops.ts +32 -0
- package/src/api/controllers/plugin/index.ts +8 -45
- package/src/api/controllers/query/index.ts +2 -2
- package/src/api/controllers/row/ExternalRequest.ts +21 -12
- package/src/api/controllers/row/internal.ts +13 -11
- package/src/api/controllers/row/utils.ts +4 -4
- package/src/api/controllers/table/index.ts +2 -2
- package/src/api/controllers/table/utils.ts +10 -3
- package/src/api/controllers/user.ts +10 -96
- package/src/api/controllers/view/exporters.ts +3 -1
- package/src/api/index.ts +2 -4
- package/src/api/routes/index.ts +2 -2
- package/src/api/routes/ops.ts +30 -0
- package/src/api/routes/tests/automation.spec.js +7 -4
- package/src/api/routes/tests/user.spec.js +48 -37
- package/src/api/routes/user.ts +0 -5
- package/src/app.ts +4 -15
- package/src/automations/actions.ts +56 -24
- package/src/automations/index.ts +1 -1
- package/src/automations/steps/bash.ts +10 -7
- package/src/automations/steps/createRow.ts +15 -12
- package/src/automations/steps/delay.ts +6 -4
- package/src/automations/steps/deleteRow.ts +12 -9
- package/src/automations/steps/discord.ts +10 -8
- package/src/automations/steps/executeQuery.ts +13 -10
- package/src/automations/steps/executeScript.ts +10 -7
- package/src/automations/steps/filter.ts +8 -6
- package/src/automations/steps/integromat.ts +12 -10
- package/src/automations/steps/loop.ts +16 -10
- package/src/automations/steps/outgoingWebhook.ts +14 -11
- package/src/automations/steps/queryRows.ts +18 -15
- package/src/automations/steps/sendSmtpEmail.ts +11 -9
- package/src/automations/steps/serverLog.ts +6 -4
- package/src/automations/steps/slack.ts +8 -6
- package/src/automations/steps/updateRow.ts +15 -12
- package/src/automations/steps/zapier.ts +11 -9
- package/src/automations/tests/utilities/index.ts +2 -2
- package/src/automations/triggerInfo/app.ts +8 -5
- package/src/automations/triggerInfo/cron.ts +7 -4
- package/src/automations/triggerInfo/rowDeleted.ts +8 -5
- package/src/automations/triggerInfo/rowSaved.ts +10 -7
- package/src/automations/triggerInfo/rowUpdated.ts +10 -7
- package/src/automations/triggerInfo/webhook.ts +9 -6
- package/src/db/utils.ts +1 -0
- package/src/environment.ts +0 -1
- package/src/events/docUpdates/index.ts +1 -0
- package/src/events/docUpdates/processors.ts +14 -0
- package/src/events/docUpdates/syncUsers.ts +35 -0
- package/src/events/index.ts +1 -0
- package/src/integration-test/postgres.spec.ts +3 -1
- package/src/integrations/base/sqlTable.ts +9 -2
- package/src/integrations/index.ts +3 -3
- package/src/integrations/microsoftSqlServer.ts +5 -2
- package/src/integrations/mysql.ts +5 -3
- package/src/integrations/postgres.ts +7 -5
- package/src/integrations/redis.ts +8 -0
- package/src/integrations/rest.ts +3 -0
- package/src/migrations/functions/syncQuotas.ts +2 -0
- package/src/migrations/functions/usageQuotas/syncApps.ts +2 -3
- package/src/migrations/functions/usageQuotas/syncRows.ts +2 -3
- package/src/migrations/functions/usageQuotas/syncUsers.ts +9 -0
- package/src/migrations/functions/usageQuotas/tests/syncRows.spec.ts +2 -2
- package/src/migrations/functions/usageQuotas/tests/syncUsers.spec.ts +26 -0
- package/src/migrations/index.ts +1 -0
- package/src/sdk/app/applications/sync.ts +129 -22
- package/src/sdk/app/applications/tests/sync.spec.ts +137 -0
- package/src/sdk/app/backups/exports.ts +17 -41
- package/src/sdk/index.ts +2 -0
- package/src/sdk/plugins/index.ts +5 -0
- package/src/sdk/plugins/plugins.ts +41 -0
- package/src/sdk/users/tests/utils.spec.ts +1 -32
- package/src/sdk/users/utils.ts +23 -5
- package/src/startup.ts +36 -34
- package/src/tests/jestEnv.ts +0 -1
- package/src/tests/jestSetup.ts +0 -1
- package/src/tests/utilities/TestConfiguration.ts +28 -0
- package/src/tests/utilities/structures.ts +25 -17
- package/src/threads/automation.ts +18 -6
- package/src/utilities/csv.ts +22 -0
- package/src/utilities/fileSystem/plugin.ts +13 -4
- package/src/utilities/global.ts +21 -16
- package/src/utilities/rowProcessor/utils.ts +9 -10
- package/src/utilities/schema.ts +8 -0
- package/src/utilities/tests/csv.spec.ts +33 -0
- package/src/watch.ts +2 -2
- package/src/websockets/client.ts +11 -0
- package/src/websockets/grid.ts +55 -0
- package/src/websockets/index.ts +14 -0
- package/src/websockets/websocket.ts +83 -0
- package/tsconfig.build.json +3 -5
- package/tsconfig.json +2 -1
- package/builder/assets/index.0b358332.js +0 -1817
- package/builder/assets/index.7f9a008b.css +0 -6
- package/dist/api/controllers/cloud.js +0 -130
- package/dist/elasticApm.js +0 -14
- package/dist/package.json +0 -180
- package/dist/websocket.js +0 -22
- package/scripts/likeCypress.ts +0 -35
- package/src/api/controllers/cloud.ts +0 -119
- package/src/api/routes/cloud.ts +0 -18
- package/src/api/routes/tests/cloud.spec.ts +0 -54
- package/src/elasticApm.ts +0 -10
- package/src/migrations/functions/tests/syncQuotas.spec.js +0 -26
- package/src/tests/logging.ts +0 -34
- package/src/websocket.ts +0 -26
|
@@ -3,8 +3,11 @@ import { cleanUpRow, getError } from "../automationUtils"
|
|
|
3
3
|
import { buildCtx } from "./utils"
|
|
4
4
|
import {
|
|
5
5
|
AutomationActionStepId,
|
|
6
|
-
|
|
6
|
+
AutomationCustomIOType,
|
|
7
|
+
AutomationIOType,
|
|
7
8
|
AutomationStepInput,
|
|
9
|
+
AutomationStepSchema,
|
|
10
|
+
AutomationStepType,
|
|
8
11
|
} from "@budibase/types"
|
|
9
12
|
|
|
10
13
|
export const definition: AutomationStepSchema = {
|
|
@@ -12,7 +15,7 @@ export const definition: AutomationStepSchema = {
|
|
|
12
15
|
tagline: "Create a {{inputs.enriched.table.name}} row",
|
|
13
16
|
icon: "TableRowAddBottom",
|
|
14
17
|
description: "Add a row to your database",
|
|
15
|
-
type:
|
|
18
|
+
type: AutomationStepType.ACTION,
|
|
16
19
|
internal: true,
|
|
17
20
|
stepId: AutomationActionStepId.CREATE_ROW,
|
|
18
21
|
inputs: {},
|
|
@@ -20,14 +23,14 @@ export const definition: AutomationStepSchema = {
|
|
|
20
23
|
inputs: {
|
|
21
24
|
properties: {
|
|
22
25
|
row: {
|
|
23
|
-
type:
|
|
26
|
+
type: AutomationIOType.OBJECT,
|
|
24
27
|
properties: {
|
|
25
28
|
tableId: {
|
|
26
|
-
type:
|
|
27
|
-
customType:
|
|
29
|
+
type: AutomationIOType.STRING,
|
|
30
|
+
customType: AutomationCustomIOType.TABLE,
|
|
28
31
|
},
|
|
29
32
|
},
|
|
30
|
-
customType:
|
|
33
|
+
customType: AutomationCustomIOType.ROW,
|
|
31
34
|
title: "Table",
|
|
32
35
|
required: ["tableId"],
|
|
33
36
|
},
|
|
@@ -37,24 +40,24 @@ export const definition: AutomationStepSchema = {
|
|
|
37
40
|
outputs: {
|
|
38
41
|
properties: {
|
|
39
42
|
row: {
|
|
40
|
-
type:
|
|
41
|
-
customType:
|
|
43
|
+
type: AutomationIOType.OBJECT,
|
|
44
|
+
customType: AutomationCustomIOType.ROW,
|
|
42
45
|
description: "The new row",
|
|
43
46
|
},
|
|
44
47
|
response: {
|
|
45
|
-
type:
|
|
48
|
+
type: AutomationIOType.OBJECT,
|
|
46
49
|
description: "The response from the table",
|
|
47
50
|
},
|
|
48
51
|
success: {
|
|
49
|
-
type:
|
|
52
|
+
type: AutomationIOType.BOOLEAN,
|
|
50
53
|
description: "Whether the row creation was successful",
|
|
51
54
|
},
|
|
52
55
|
id: {
|
|
53
|
-
type:
|
|
56
|
+
type: AutomationIOType.STRING,
|
|
54
57
|
description: "The identifier of the new row",
|
|
55
58
|
},
|
|
56
59
|
revision: {
|
|
57
|
-
type:
|
|
60
|
+
type: AutomationIOType.STRING,
|
|
58
61
|
description: "The revision of the new row",
|
|
59
62
|
},
|
|
60
63
|
},
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { wait } from "../../utilities"
|
|
2
2
|
import {
|
|
3
3
|
AutomationActionStepId,
|
|
4
|
-
|
|
4
|
+
AutomationIOType,
|
|
5
5
|
AutomationStepInput,
|
|
6
|
+
AutomationStepSchema,
|
|
7
|
+
AutomationStepType,
|
|
6
8
|
} from "@budibase/types"
|
|
7
9
|
|
|
8
10
|
export const definition: AutomationStepSchema = {
|
|
@@ -17,7 +19,7 @@ export const definition: AutomationStepSchema = {
|
|
|
17
19
|
inputs: {
|
|
18
20
|
properties: {
|
|
19
21
|
time: {
|
|
20
|
-
type:
|
|
22
|
+
type: AutomationIOType.NUMBER,
|
|
21
23
|
title: "Delay in milliseconds",
|
|
22
24
|
},
|
|
23
25
|
},
|
|
@@ -26,14 +28,14 @@ export const definition: AutomationStepSchema = {
|
|
|
26
28
|
outputs: {
|
|
27
29
|
properties: {
|
|
28
30
|
success: {
|
|
29
|
-
type:
|
|
31
|
+
type: AutomationIOType.BOOLEAN,
|
|
30
32
|
description: "Whether the delay was successful",
|
|
31
33
|
},
|
|
32
34
|
},
|
|
33
35
|
required: ["success"],
|
|
34
36
|
},
|
|
35
37
|
},
|
|
36
|
-
type:
|
|
38
|
+
type: AutomationStepType.LOGIC,
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
export async function run({ inputs }: AutomationStepInput) {
|
|
@@ -3,8 +3,11 @@ import { buildCtx } from "./utils"
|
|
|
3
3
|
import { getError } from "../automationUtils"
|
|
4
4
|
import {
|
|
5
5
|
AutomationActionStepId,
|
|
6
|
-
AutomationStepSchema,
|
|
7
6
|
AutomationStepInput,
|
|
7
|
+
AutomationStepSchema,
|
|
8
|
+
AutomationStepType,
|
|
9
|
+
AutomationIOType,
|
|
10
|
+
AutomationCustomIOType,
|
|
8
11
|
} from "@budibase/types"
|
|
9
12
|
|
|
10
13
|
export const definition: AutomationStepSchema = {
|
|
@@ -12,7 +15,7 @@ export const definition: AutomationStepSchema = {
|
|
|
12
15
|
icon: "TableRowRemoveCenter",
|
|
13
16
|
name: "Delete Row",
|
|
14
17
|
tagline: "Delete a {{inputs.enriched.table.name}} row",
|
|
15
|
-
type:
|
|
18
|
+
type: AutomationStepType.ACTION,
|
|
16
19
|
stepId: AutomationActionStepId.DELETE_ROW,
|
|
17
20
|
internal: true,
|
|
18
21
|
inputs: {},
|
|
@@ -20,12 +23,12 @@ export const definition: AutomationStepSchema = {
|
|
|
20
23
|
inputs: {
|
|
21
24
|
properties: {
|
|
22
25
|
tableId: {
|
|
23
|
-
type:
|
|
24
|
-
customType:
|
|
26
|
+
type: AutomationIOType.STRING,
|
|
27
|
+
customType: AutomationCustomIOType.TABLE,
|
|
25
28
|
title: "Table",
|
|
26
29
|
},
|
|
27
30
|
id: {
|
|
28
|
-
type:
|
|
31
|
+
type: AutomationIOType.STRING,
|
|
29
32
|
title: "Row ID",
|
|
30
33
|
},
|
|
31
34
|
},
|
|
@@ -34,16 +37,16 @@ export const definition: AutomationStepSchema = {
|
|
|
34
37
|
outputs: {
|
|
35
38
|
properties: {
|
|
36
39
|
row: {
|
|
37
|
-
type:
|
|
38
|
-
customType:
|
|
40
|
+
type: AutomationIOType.OBJECT,
|
|
41
|
+
customType: AutomationCustomIOType.ROW,
|
|
39
42
|
description: "The deleted row",
|
|
40
43
|
},
|
|
41
44
|
response: {
|
|
42
|
-
type:
|
|
45
|
+
type: AutomationIOType.OBJECT,
|
|
43
46
|
description: "The response from the table",
|
|
44
47
|
},
|
|
45
48
|
success: {
|
|
46
|
-
type:
|
|
49
|
+
type: AutomationIOType.BOOLEAN,
|
|
47
50
|
description: "Whether the deletion was successful",
|
|
48
51
|
},
|
|
49
52
|
},
|
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
AutomationActionStepId,
|
|
5
5
|
AutomationStepSchema,
|
|
6
6
|
AutomationStepInput,
|
|
7
|
+
AutomationStepType,
|
|
8
|
+
AutomationIOType,
|
|
7
9
|
} from "@budibase/types"
|
|
8
10
|
|
|
9
11
|
const DEFAULT_USERNAME = "Budibase Automate"
|
|
@@ -15,26 +17,26 @@ export const definition: AutomationStepSchema = {
|
|
|
15
17
|
description: "Send a message to a Discord server",
|
|
16
18
|
icon: "ri-discord-line",
|
|
17
19
|
stepId: AutomationActionStepId.discord,
|
|
18
|
-
type:
|
|
20
|
+
type: AutomationStepType.ACTION,
|
|
19
21
|
internal: false,
|
|
20
22
|
inputs: {},
|
|
21
23
|
schema: {
|
|
22
24
|
inputs: {
|
|
23
25
|
properties: {
|
|
24
26
|
url: {
|
|
25
|
-
type:
|
|
27
|
+
type: AutomationIOType.STRING,
|
|
26
28
|
title: "Discord Webhook URL",
|
|
27
29
|
},
|
|
28
30
|
username: {
|
|
29
|
-
type:
|
|
31
|
+
type: AutomationIOType.STRING,
|
|
30
32
|
title: "Bot Name",
|
|
31
33
|
},
|
|
32
34
|
avatar_url: {
|
|
33
|
-
type:
|
|
35
|
+
type: AutomationIOType.STRING,
|
|
34
36
|
title: "Bot Avatar URL",
|
|
35
37
|
},
|
|
36
38
|
content: {
|
|
37
|
-
type:
|
|
39
|
+
type: AutomationIOType.STRING,
|
|
38
40
|
title: "Message",
|
|
39
41
|
},
|
|
40
42
|
},
|
|
@@ -43,15 +45,15 @@ export const definition: AutomationStepSchema = {
|
|
|
43
45
|
outputs: {
|
|
44
46
|
properties: {
|
|
45
47
|
httpStatus: {
|
|
46
|
-
type:
|
|
48
|
+
type: AutomationIOType.NUMBER,
|
|
47
49
|
description: "The HTTP status code of the request",
|
|
48
50
|
},
|
|
49
51
|
response: {
|
|
50
|
-
type:
|
|
52
|
+
type: AutomationIOType.STRING,
|
|
51
53
|
description: "The response from the Discord Webhook",
|
|
52
54
|
},
|
|
53
55
|
success: {
|
|
54
|
-
type:
|
|
56
|
+
type: AutomationIOType.BOOLEAN,
|
|
55
57
|
description: "Whether the message sent successfully",
|
|
56
58
|
},
|
|
57
59
|
},
|
|
@@ -3,8 +3,11 @@ import { buildCtx } from "./utils"
|
|
|
3
3
|
import * as automationUtils from "../automationUtils"
|
|
4
4
|
import {
|
|
5
5
|
AutomationActionStepId,
|
|
6
|
-
|
|
6
|
+
AutomationCustomIOType,
|
|
7
|
+
AutomationIOType,
|
|
7
8
|
AutomationStepInput,
|
|
9
|
+
AutomationStepSchema,
|
|
10
|
+
AutomationStepType,
|
|
8
11
|
} from "@budibase/types"
|
|
9
12
|
|
|
10
13
|
export const definition: AutomationStepSchema = {
|
|
@@ -12,7 +15,7 @@ export const definition: AutomationStepSchema = {
|
|
|
12
15
|
tagline: "Execute Data Connector",
|
|
13
16
|
icon: "Data",
|
|
14
17
|
description: "Execute a query in an external data connector",
|
|
15
|
-
type:
|
|
18
|
+
type: AutomationStepType.ACTION,
|
|
16
19
|
stepId: AutomationActionStepId.EXECUTE_QUERY,
|
|
17
20
|
internal: true,
|
|
18
21
|
inputs: {},
|
|
@@ -20,14 +23,14 @@ export const definition: AutomationStepSchema = {
|
|
|
20
23
|
inputs: {
|
|
21
24
|
properties: {
|
|
22
25
|
query: {
|
|
23
|
-
type:
|
|
26
|
+
type: AutomationIOType.OBJECT,
|
|
24
27
|
properties: {
|
|
25
28
|
queryId: {
|
|
26
|
-
type:
|
|
27
|
-
customType:
|
|
29
|
+
type: AutomationIOType.STRING,
|
|
30
|
+
customType: AutomationCustomIOType.QUERY,
|
|
28
31
|
},
|
|
29
32
|
},
|
|
30
|
-
customType:
|
|
33
|
+
customType: AutomationCustomIOType.QUERY_PARAMS,
|
|
31
34
|
title: "Parameters",
|
|
32
35
|
required: ["queryId"],
|
|
33
36
|
},
|
|
@@ -37,21 +40,21 @@ export const definition: AutomationStepSchema = {
|
|
|
37
40
|
outputs: {
|
|
38
41
|
properties: {
|
|
39
42
|
response: {
|
|
40
|
-
type:
|
|
43
|
+
type: AutomationIOType.OBJECT,
|
|
41
44
|
description: "The response from the datasource execution",
|
|
42
45
|
},
|
|
43
46
|
info: {
|
|
44
|
-
type:
|
|
47
|
+
type: AutomationIOType.OBJECT,
|
|
45
48
|
description:
|
|
46
49
|
"Some query types may return extra data, like headers from a REST query",
|
|
47
50
|
},
|
|
48
51
|
success: {
|
|
49
|
-
type:
|
|
52
|
+
type: AutomationIOType.BOOLEAN,
|
|
50
53
|
description: "Whether the action was successful",
|
|
51
54
|
},
|
|
52
55
|
},
|
|
56
|
+
required: ["response", "success"],
|
|
53
57
|
},
|
|
54
|
-
required: ["response", "success"],
|
|
55
58
|
},
|
|
56
59
|
}
|
|
57
60
|
|
|
@@ -3,8 +3,11 @@ import { buildCtx } from "./utils"
|
|
|
3
3
|
import * as automationUtils from "../automationUtils"
|
|
4
4
|
import {
|
|
5
5
|
AutomationActionStepId,
|
|
6
|
-
|
|
6
|
+
AutomationCustomIOType,
|
|
7
|
+
AutomationIOType,
|
|
7
8
|
AutomationStepInput,
|
|
9
|
+
AutomationStepSchema,
|
|
10
|
+
AutomationStepType,
|
|
8
11
|
} from "@budibase/types"
|
|
9
12
|
|
|
10
13
|
export const definition: AutomationStepSchema = {
|
|
@@ -12,7 +15,7 @@ export const definition: AutomationStepSchema = {
|
|
|
12
15
|
tagline: "Execute JavaScript Code",
|
|
13
16
|
icon: "Code",
|
|
14
17
|
description: "Run a piece of JavaScript code in your automation",
|
|
15
|
-
type:
|
|
18
|
+
type: AutomationStepType.ACTION,
|
|
16
19
|
internal: true,
|
|
17
20
|
stepId: AutomationActionStepId.EXECUTE_SCRIPT,
|
|
18
21
|
inputs: {},
|
|
@@ -20,8 +23,8 @@ export const definition: AutomationStepSchema = {
|
|
|
20
23
|
inputs: {
|
|
21
24
|
properties: {
|
|
22
25
|
code: {
|
|
23
|
-
type:
|
|
24
|
-
customType:
|
|
26
|
+
type: AutomationIOType.STRING,
|
|
27
|
+
customType: AutomationCustomIOType.CODE,
|
|
25
28
|
title: "Code",
|
|
26
29
|
},
|
|
27
30
|
},
|
|
@@ -30,16 +33,16 @@ export const definition: AutomationStepSchema = {
|
|
|
30
33
|
outputs: {
|
|
31
34
|
properties: {
|
|
32
35
|
value: {
|
|
33
|
-
type:
|
|
36
|
+
type: AutomationIOType.STRING,
|
|
34
37
|
description: "The result of the return statement",
|
|
35
38
|
},
|
|
36
39
|
success: {
|
|
37
|
-
type:
|
|
40
|
+
type: AutomationIOType.BOOLEAN,
|
|
38
41
|
description: "Whether the action was successful",
|
|
39
42
|
},
|
|
40
43
|
},
|
|
44
|
+
required: ["success"],
|
|
41
45
|
},
|
|
42
|
-
required: ["success"],
|
|
43
46
|
},
|
|
44
47
|
}
|
|
45
48
|
|
|
@@ -2,6 +2,8 @@ import {
|
|
|
2
2
|
AutomationActionStepId,
|
|
3
3
|
AutomationStepSchema,
|
|
4
4
|
AutomationStepInput,
|
|
5
|
+
AutomationStepType,
|
|
6
|
+
AutomationIOType,
|
|
5
7
|
} from "@budibase/types"
|
|
6
8
|
|
|
7
9
|
export const FilterConditions = {
|
|
@@ -24,7 +26,7 @@ export const definition: AutomationStepSchema = {
|
|
|
24
26
|
icon: "Branch2",
|
|
25
27
|
description:
|
|
26
28
|
"Conditionally halt automations which do not meet certain conditions",
|
|
27
|
-
type:
|
|
29
|
+
type: AutomationStepType.LOGIC,
|
|
28
30
|
internal: true,
|
|
29
31
|
stepId: AutomationActionStepId.FILTER,
|
|
30
32
|
inputs: {
|
|
@@ -34,17 +36,17 @@ export const definition: AutomationStepSchema = {
|
|
|
34
36
|
inputs: {
|
|
35
37
|
properties: {
|
|
36
38
|
field: {
|
|
37
|
-
type:
|
|
39
|
+
type: AutomationIOType.STRING,
|
|
38
40
|
title: "Reference Value",
|
|
39
41
|
},
|
|
40
42
|
condition: {
|
|
41
|
-
type:
|
|
43
|
+
type: AutomationIOType.STRING,
|
|
42
44
|
title: "Condition",
|
|
43
45
|
enum: Object.values(FilterConditions),
|
|
44
46
|
pretty: Object.values(PrettyFilterConditions),
|
|
45
47
|
},
|
|
46
48
|
value: {
|
|
47
|
-
type:
|
|
49
|
+
type: AutomationIOType.STRING,
|
|
48
50
|
title: "Comparison Value",
|
|
49
51
|
},
|
|
50
52
|
},
|
|
@@ -53,11 +55,11 @@ export const definition: AutomationStepSchema = {
|
|
|
53
55
|
outputs: {
|
|
54
56
|
properties: {
|
|
55
57
|
success: {
|
|
56
|
-
type:
|
|
58
|
+
type: AutomationIOType.BOOLEAN,
|
|
57
59
|
description: "Whether the action was successful",
|
|
58
60
|
},
|
|
59
61
|
result: {
|
|
60
|
-
type:
|
|
62
|
+
type: AutomationIOType.BOOLEAN,
|
|
61
63
|
description: "Whether the logic block passed",
|
|
62
64
|
},
|
|
63
65
|
},
|
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
AutomationActionStepId,
|
|
5
5
|
AutomationStepSchema,
|
|
6
6
|
AutomationStepInput,
|
|
7
|
+
AutomationStepType,
|
|
8
|
+
AutomationIOType,
|
|
7
9
|
} from "@budibase/types"
|
|
8
10
|
|
|
9
11
|
export const definition: AutomationStepSchema = {
|
|
@@ -13,34 +15,34 @@ export const definition: AutomationStepSchema = {
|
|
|
13
15
|
"Performs a webhook call to Integromat and gets the response (if configured)",
|
|
14
16
|
icon: "ri-shut-down-line",
|
|
15
17
|
stepId: AutomationActionStepId.integromat,
|
|
16
|
-
type:
|
|
18
|
+
type: AutomationStepType.ACTION,
|
|
17
19
|
internal: false,
|
|
18
20
|
inputs: {},
|
|
19
21
|
schema: {
|
|
20
22
|
inputs: {
|
|
21
23
|
properties: {
|
|
22
24
|
url: {
|
|
23
|
-
type:
|
|
25
|
+
type: AutomationIOType.STRING,
|
|
24
26
|
title: "Webhook URL",
|
|
25
27
|
},
|
|
26
28
|
value1: {
|
|
27
|
-
type:
|
|
29
|
+
type: AutomationIOType.STRING,
|
|
28
30
|
title: "Input Value 1",
|
|
29
31
|
},
|
|
30
32
|
value2: {
|
|
31
|
-
type:
|
|
33
|
+
type: AutomationIOType.STRING,
|
|
32
34
|
title: "Input Value 2",
|
|
33
35
|
},
|
|
34
36
|
value3: {
|
|
35
|
-
type:
|
|
37
|
+
type: AutomationIOType.STRING,
|
|
36
38
|
title: "Input Value 3",
|
|
37
39
|
},
|
|
38
40
|
value4: {
|
|
39
|
-
type:
|
|
41
|
+
type: AutomationIOType.STRING,
|
|
40
42
|
title: "Input Value 4",
|
|
41
43
|
},
|
|
42
44
|
value5: {
|
|
43
|
-
type:
|
|
45
|
+
type: AutomationIOType.STRING,
|
|
44
46
|
title: "Input Value 5",
|
|
45
47
|
},
|
|
46
48
|
},
|
|
@@ -49,15 +51,15 @@ export const definition: AutomationStepSchema = {
|
|
|
49
51
|
outputs: {
|
|
50
52
|
properties: {
|
|
51
53
|
success: {
|
|
52
|
-
type:
|
|
54
|
+
type: AutomationIOType.BOOLEAN,
|
|
53
55
|
description: "Whether call was successful",
|
|
54
56
|
},
|
|
55
57
|
httpStatus: {
|
|
56
|
-
type:
|
|
58
|
+
type: AutomationIOType.NUMBER,
|
|
57
59
|
description: "The HTTP status code returned",
|
|
58
60
|
},
|
|
59
61
|
response: {
|
|
60
|
-
type:
|
|
62
|
+
type: AutomationIOType.OBJECT,
|
|
61
63
|
description: "The webhook response - this can have properties",
|
|
62
64
|
},
|
|
63
65
|
},
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AutomationActionStepId,
|
|
3
|
+
AutomationCustomIOType,
|
|
4
|
+
AutomationIOType,
|
|
5
|
+
AutomationStepSchema,
|
|
6
|
+
AutomationStepType,
|
|
7
|
+
} from "@budibase/types"
|
|
2
8
|
|
|
3
9
|
export const definition: AutomationStepSchema = {
|
|
4
10
|
name: "Looping",
|
|
@@ -12,19 +18,19 @@ export const definition: AutomationStepSchema = {
|
|
|
12
18
|
inputs: {
|
|
13
19
|
properties: {
|
|
14
20
|
option: {
|
|
15
|
-
customType:
|
|
21
|
+
customType: AutomationCustomIOType.LOOP_OPTION,
|
|
16
22
|
title: "Input type",
|
|
17
23
|
},
|
|
18
24
|
binding: {
|
|
19
|
-
type:
|
|
25
|
+
type: AutomationIOType.STRING,
|
|
20
26
|
title: "Binding / Value",
|
|
21
27
|
},
|
|
22
28
|
iterations: {
|
|
23
|
-
type:
|
|
29
|
+
type: AutomationIOType.NUMBER,
|
|
24
30
|
title: "Max loop iterations",
|
|
25
31
|
},
|
|
26
32
|
failure: {
|
|
27
|
-
type:
|
|
33
|
+
type: AutomationIOType.STRING,
|
|
28
34
|
title: "Failure Condition",
|
|
29
35
|
},
|
|
30
36
|
},
|
|
@@ -33,20 +39,20 @@ export const definition: AutomationStepSchema = {
|
|
|
33
39
|
outputs: {
|
|
34
40
|
properties: {
|
|
35
41
|
items: {
|
|
36
|
-
customType:
|
|
42
|
+
customType: AutomationCustomIOType.ITEM,
|
|
37
43
|
description: "The item currently being executed",
|
|
38
44
|
},
|
|
39
45
|
success: {
|
|
40
|
-
type:
|
|
46
|
+
type: AutomationIOType.BOOLEAN,
|
|
41
47
|
description: "Whether the message loop was successfully",
|
|
42
48
|
},
|
|
43
49
|
iterations: {
|
|
44
|
-
type:
|
|
45
|
-
|
|
50
|
+
type: AutomationIOType.NUMBER,
|
|
51
|
+
description: "The amount of times the block ran",
|
|
46
52
|
},
|
|
47
53
|
},
|
|
48
54
|
required: ["success", "items", "iterations"],
|
|
49
55
|
},
|
|
50
56
|
},
|
|
51
|
-
type:
|
|
57
|
+
type: AutomationStepType.LOGIC,
|
|
52
58
|
}
|
|
@@ -3,8 +3,11 @@ import { getFetchResponse } from "./utils"
|
|
|
3
3
|
import * as automationUtils from "../automationUtils"
|
|
4
4
|
import {
|
|
5
5
|
AutomationActionStepId,
|
|
6
|
-
|
|
6
|
+
AutomationCustomIOType,
|
|
7
|
+
AutomationIOType,
|
|
7
8
|
AutomationStepInput,
|
|
9
|
+
AutomationStepSchema,
|
|
10
|
+
AutomationStepType,
|
|
8
11
|
} from "@budibase/types"
|
|
9
12
|
|
|
10
13
|
enum RequestType {
|
|
@@ -27,7 +30,7 @@ export const definition: AutomationStepSchema = {
|
|
|
27
30
|
tagline: "Send a {{inputs.requestMethod}} request",
|
|
28
31
|
icon: "Send",
|
|
29
32
|
description: "Send a request of specified method to a URL",
|
|
30
|
-
type:
|
|
33
|
+
type: AutomationStepType.ACTION,
|
|
31
34
|
internal: true,
|
|
32
35
|
stepId: AutomationActionStepId.OUTGOING_WEBHOOK,
|
|
33
36
|
inputs: {
|
|
@@ -40,23 +43,23 @@ export const definition: AutomationStepSchema = {
|
|
|
40
43
|
inputs: {
|
|
41
44
|
properties: {
|
|
42
45
|
requestMethod: {
|
|
43
|
-
type:
|
|
46
|
+
type: AutomationIOType.STRING,
|
|
44
47
|
enum: Object.values(RequestType),
|
|
45
48
|
title: "Request method",
|
|
46
49
|
},
|
|
47
50
|
url: {
|
|
48
|
-
type:
|
|
51
|
+
type: AutomationIOType.STRING,
|
|
49
52
|
title: "URL",
|
|
50
53
|
},
|
|
51
54
|
requestBody: {
|
|
52
|
-
type:
|
|
55
|
+
type: AutomationIOType.STRING,
|
|
53
56
|
title: "JSON Body",
|
|
54
|
-
customType:
|
|
57
|
+
customType: AutomationCustomIOType.WIDE,
|
|
55
58
|
},
|
|
56
59
|
headers: {
|
|
57
|
-
type:
|
|
60
|
+
type: AutomationIOType.STRING,
|
|
58
61
|
title: "Headers",
|
|
59
|
-
customType:
|
|
62
|
+
customType: AutomationCustomIOType.WIDE,
|
|
60
63
|
},
|
|
61
64
|
},
|
|
62
65
|
required: ["requestMethod", "url"],
|
|
@@ -64,15 +67,15 @@ export const definition: AutomationStepSchema = {
|
|
|
64
67
|
outputs: {
|
|
65
68
|
properties: {
|
|
66
69
|
response: {
|
|
67
|
-
type:
|
|
70
|
+
type: AutomationIOType.OBJECT,
|
|
68
71
|
description: "The response from the webhook",
|
|
69
72
|
},
|
|
70
73
|
httpStatus: {
|
|
71
|
-
type:
|
|
74
|
+
type: AutomationIOType.NUMBER,
|
|
72
75
|
description: "The HTTP status code returned",
|
|
73
76
|
},
|
|
74
77
|
success: {
|
|
75
|
-
type:
|
|
78
|
+
type: AutomationIOType.BOOLEAN,
|
|
76
79
|
description: "Whether the action was successful",
|
|
77
80
|
},
|
|
78
81
|
},
|
|
@@ -5,8 +5,11 @@ import { buildCtx } from "./utils"
|
|
|
5
5
|
import * as automationUtils from "../automationUtils"
|
|
6
6
|
import {
|
|
7
7
|
AutomationActionStepId,
|
|
8
|
-
|
|
8
|
+
AutomationCustomIOType,
|
|
9
|
+
AutomationIOType,
|
|
9
10
|
AutomationStepInput,
|
|
11
|
+
AutomationStepSchema,
|
|
12
|
+
AutomationStepType,
|
|
10
13
|
SearchFilters,
|
|
11
14
|
Table,
|
|
12
15
|
} from "@budibase/types"
|
|
@@ -36,7 +39,7 @@ export const definition: AutomationStepSchema = {
|
|
|
36
39
|
icon: "Search",
|
|
37
40
|
name: "Query rows",
|
|
38
41
|
tagline: "Query rows from {{inputs.enriched.table.name}} table",
|
|
39
|
-
type:
|
|
42
|
+
type: AutomationStepType.ACTION,
|
|
40
43
|
stepId: AutomationActionStepId.QUERY_ROWS,
|
|
41
44
|
internal: true,
|
|
42
45
|
inputs: {},
|
|
@@ -44,35 +47,35 @@ export const definition: AutomationStepSchema = {
|
|
|
44
47
|
inputs: {
|
|
45
48
|
properties: {
|
|
46
49
|
tableId: {
|
|
47
|
-
type:
|
|
48
|
-
customType:
|
|
50
|
+
type: AutomationIOType.STRING,
|
|
51
|
+
customType: AutomationCustomIOType.TABLE,
|
|
49
52
|
title: "Table",
|
|
50
53
|
},
|
|
51
54
|
filters: {
|
|
52
|
-
type:
|
|
53
|
-
customType:
|
|
55
|
+
type: AutomationIOType.OBJECT,
|
|
56
|
+
customType: AutomationCustomIOType.FILTERS,
|
|
54
57
|
title: "Filtering",
|
|
55
58
|
},
|
|
56
59
|
sortColumn: {
|
|
57
|
-
type:
|
|
60
|
+
type: AutomationIOType.STRING,
|
|
58
61
|
title: "Sort Column",
|
|
59
|
-
customType:
|
|
62
|
+
customType: AutomationCustomIOType.COLUMN,
|
|
60
63
|
},
|
|
61
64
|
sortOrder: {
|
|
62
|
-
type:
|
|
65
|
+
type: AutomationIOType.STRING,
|
|
63
66
|
title: "Sort Order",
|
|
64
67
|
enum: Object.values(SortOrder),
|
|
65
68
|
pretty: Object.values(SortOrderPretty),
|
|
66
69
|
},
|
|
67
70
|
limit: {
|
|
68
|
-
type:
|
|
71
|
+
type: AutomationIOType.NUMBER,
|
|
69
72
|
title: "Limit",
|
|
70
|
-
customType:
|
|
73
|
+
customType: AutomationCustomIOType.QUERY_LIMIT,
|
|
71
74
|
},
|
|
72
75
|
onEmptyFilter: {
|
|
73
76
|
pretty: Object.values(EmptyFilterOptionPretty),
|
|
74
77
|
enum: Object.values(EmptyFilterOption),
|
|
75
|
-
type:
|
|
78
|
+
type: AutomationIOType.STRING,
|
|
76
79
|
title: "When Filter Empty",
|
|
77
80
|
},
|
|
78
81
|
},
|
|
@@ -81,12 +84,12 @@ export const definition: AutomationStepSchema = {
|
|
|
81
84
|
outputs: {
|
|
82
85
|
properties: {
|
|
83
86
|
rows: {
|
|
84
|
-
type:
|
|
85
|
-
customType:
|
|
87
|
+
type: AutomationIOType.ARRAY,
|
|
88
|
+
customType: AutomationCustomIOType.ROWS,
|
|
86
89
|
description: "The rows that were found",
|
|
87
90
|
},
|
|
88
91
|
success: {
|
|
89
|
-
type:
|
|
92
|
+
type: AutomationIOType.BOOLEAN,
|
|
90
93
|
description: "Whether the query was successful",
|
|
91
94
|
},
|
|
92
95
|
},
|