@budibase/server 2.5.6-alpha.9 → 2.5.7
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.7f9a008b.css +6 -0
- package/builder/assets/index.f02eef32.js +1817 -0
- package/builder/index.html +2 -2
- package/dist/api/controllers/automation.js +7 -13
- package/dist/api/controllers/plugin/index.js +37 -6
- package/dist/api/controllers/table/utils.js +1 -2
- package/dist/api/controllers/user.js +83 -1
- package/dist/api/routes/index.js +0 -2
- package/dist/api/routes/user.js +1 -0
- package/dist/app.js +13 -4
- package/dist/automations/actions.js +6 -32
- package/dist/automations/index.js +2 -3
- 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/elasticApm.js +14 -0
- package/dist/environment.js +1 -0
- package/dist/events/index.js +0 -3
- package/dist/integrations/index.js +3 -3
- package/dist/integrations/microsoftSqlServer.js +2 -5
- package/dist/integrations/mysql.js +3 -5
- package/dist/integrations/postgres.js +5 -7
- package/dist/integrations/redis.js +0 -7
- package/dist/integrations/rest.js +0 -4
- package/dist/migrations/functions/usageQuotas/syncApps.js +1 -1
- package/dist/migrations/functions/usageQuotas/syncRows.js +2 -1
- package/dist/package.json +15 -15
- package/dist/sdk/app/applications/sync.js +23 -117
- package/dist/sdk/index.js +0 -2
- package/dist/sdk/users/utils.js +4 -21
- package/dist/startup.js +28 -31
- package/dist/threads/automation.js +5 -16
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/fileSystem/plugin.js +23 -33
- package/dist/utilities/global.js +12 -17
- package/dist/watch.js +2 -2
- package/dist/websocket.js +22 -0
- package/jest.config.ts +3 -3
- package/nodemon.json +3 -7
- package/package.json +16 -16
- package/scripts/dev/manage.js +0 -2
- package/scripts/integrations/mssql/data/entrypoint.sh +0 -1
- package/scripts/integrations/mssql/data/setup.sql +17 -17
- package/scripts/integrations/mysql/init.sql +1 -1
- package/scripts/integrations/postgres/init.sql +0 -1
- package/scripts/likeCypress.ts +35 -0
- package/src/api/controllers/automation.ts +6 -12
- package/src/api/controllers/plugin/index.ts +45 -8
- package/src/api/controllers/row/internal.ts +10 -9
- package/src/api/controllers/row/utils.ts +2 -2
- package/src/api/controllers/table/utils.ts +1 -2
- package/src/api/controllers/user.ts +96 -10
- package/src/api/routes/index.ts +0 -2
- package/src/api/routes/tests/automation.spec.js +4 -7
- package/src/api/routes/tests/user.spec.js +37 -48
- package/src/api/routes/user.ts +5 -0
- package/src/app.ts +15 -4
- package/src/automations/actions.ts +24 -56
- package/src/automations/index.ts +1 -1
- package/src/automations/steps/bash.ts +7 -10
- package/src/automations/steps/createRow.ts +12 -15
- package/src/automations/steps/delay.ts +4 -6
- package/src/automations/steps/deleteRow.ts +9 -12
- package/src/automations/steps/discord.ts +8 -10
- package/src/automations/steps/executeQuery.ts +10 -13
- package/src/automations/steps/executeScript.ts +7 -10
- package/src/automations/steps/filter.ts +6 -8
- package/src/automations/steps/integromat.ts +10 -12
- package/src/automations/steps/loop.ts +10 -16
- package/src/automations/steps/outgoingWebhook.ts +11 -14
- package/src/automations/steps/queryRows.ts +15 -18
- package/src/automations/steps/sendSmtpEmail.ts +9 -11
- package/src/automations/steps/serverLog.ts +4 -6
- package/src/automations/steps/slack.ts +6 -8
- package/src/automations/steps/updateRow.ts +12 -15
- package/src/automations/steps/zapier.ts +9 -11
- package/src/automations/tests/utilities/index.ts +2 -2
- package/src/automations/triggerInfo/app.ts +5 -8
- package/src/automations/triggerInfo/cron.ts +4 -7
- package/src/automations/triggerInfo/rowDeleted.ts +5 -8
- package/src/automations/triggerInfo/rowSaved.ts +7 -10
- package/src/automations/triggerInfo/rowUpdated.ts +7 -10
- package/src/automations/triggerInfo/webhook.ts +6 -9
- package/src/elasticApm.ts +10 -0
- package/src/environment.ts +1 -0
- package/src/events/index.ts +0 -1
- package/src/integrations/index.ts +3 -3
- package/src/integrations/microsoftSqlServer.ts +2 -5
- package/src/integrations/mysql.ts +3 -5
- package/src/integrations/postgres.ts +5 -7
- package/src/integrations/redis.ts +0 -8
- package/src/integrations/rest.ts +0 -3
- package/src/migrations/functions/usageQuotas/syncApps.ts +1 -1
- package/src/migrations/functions/usageQuotas/syncRows.ts +3 -2
- package/src/migrations/functions/usageQuotas/tests/syncRows.spec.ts +2 -2
- package/src/sdk/app/applications/sync.ts +22 -129
- package/src/sdk/index.ts +0 -2
- package/src/sdk/users/tests/utils.spec.ts +32 -1
- package/src/sdk/users/utils.ts +5 -23
- package/src/startup.ts +34 -36
- package/src/tests/jestEnv.ts +1 -0
- package/src/tests/jestSetup.ts +1 -0
- package/src/tests/logging.ts +34 -0
- package/src/tests/utilities/TestConfiguration.ts +0 -28
- package/src/tests/utilities/structures.ts +17 -25
- package/src/threads/automation.ts +6 -18
- package/src/utilities/fileSystem/plugin.ts +4 -13
- package/src/utilities/global.ts +16 -21
- package/src/watch.ts +2 -2
- package/src/websocket.ts +26 -0
- package/tsconfig.json +7 -1
- package/builder/assets/index.5c1a6913.js +0 -1776
- package/builder/assets/index.c0265b74.css +0 -6
- package/dist/api/controllers/ops.js +0 -40
- package/dist/api/routes/ops.js +0 -52
- package/dist/events/docUpdates/index.js +0 -17
- package/dist/events/docUpdates/processors.js +0 -18
- package/dist/events/docUpdates/syncUsers.js +0 -49
- package/dist/sdk/plugins/index.js +0 -27
- package/dist/sdk/plugins/plugins.js +0 -53
- package/dist/websockets/client.js +0 -14
- package/dist/websockets/grid.js +0 -60
- package/dist/websockets/index.js +0 -17
- package/dist/websockets/websocket.js +0 -78
- package/src/api/controllers/ops.ts +0 -32
- package/src/api/routes/ops.ts +0 -30
- package/src/events/docUpdates/index.ts +0 -1
- package/src/events/docUpdates/processors.ts +0 -14
- package/src/events/docUpdates/syncUsers.ts +0 -35
- package/src/sdk/app/applications/tests/sync.spec.ts +0 -137
- package/src/sdk/plugins/index.ts +0 -5
- package/src/sdk/plugins/plugins.ts +0 -41
- package/src/websockets/client.ts +0 -11
- package/src/websockets/grid.ts +0 -55
- package/src/websockets/index.ts +0 -14
- package/src/websockets/websocket.ts +0 -83
|
@@ -4,8 +4,6 @@ import {
|
|
|
4
4
|
AutomationActionStepId,
|
|
5
5
|
AutomationStepSchema,
|
|
6
6
|
AutomationStepInput,
|
|
7
|
-
AutomationStepType,
|
|
8
|
-
AutomationIOType,
|
|
9
7
|
} from "@budibase/types"
|
|
10
8
|
|
|
11
9
|
export const definition: AutomationStepSchema = {
|
|
@@ -13,7 +11,7 @@ export const definition: AutomationStepSchema = {
|
|
|
13
11
|
tagline: "Send SMTP email to {{inputs.to}}",
|
|
14
12
|
icon: "Email",
|
|
15
13
|
name: "Send Email (SMTP)",
|
|
16
|
-
type:
|
|
14
|
+
type: "ACTION",
|
|
17
15
|
internal: true,
|
|
18
16
|
stepId: AutomationActionStepId.SEND_EMAIL_SMTP,
|
|
19
17
|
inputs: {},
|
|
@@ -21,27 +19,27 @@ export const definition: AutomationStepSchema = {
|
|
|
21
19
|
inputs: {
|
|
22
20
|
properties: {
|
|
23
21
|
to: {
|
|
24
|
-
type:
|
|
22
|
+
type: "string",
|
|
25
23
|
title: "Send To",
|
|
26
24
|
},
|
|
27
25
|
from: {
|
|
28
|
-
type:
|
|
26
|
+
type: "string",
|
|
29
27
|
title: "Send From",
|
|
30
28
|
},
|
|
31
29
|
cc: {
|
|
32
|
-
type:
|
|
30
|
+
type: "string",
|
|
33
31
|
title: "CC",
|
|
34
32
|
},
|
|
35
33
|
bcc: {
|
|
36
|
-
type:
|
|
34
|
+
type: "string",
|
|
37
35
|
title: "BCC",
|
|
38
36
|
},
|
|
39
37
|
subject: {
|
|
40
|
-
type:
|
|
38
|
+
type: "string",
|
|
41
39
|
title: "Email Subject",
|
|
42
40
|
},
|
|
43
41
|
contents: {
|
|
44
|
-
type:
|
|
42
|
+
type: "string",
|
|
45
43
|
title: "HTML Contents",
|
|
46
44
|
},
|
|
47
45
|
},
|
|
@@ -50,11 +48,11 @@ export const definition: AutomationStepSchema = {
|
|
|
50
48
|
outputs: {
|
|
51
49
|
properties: {
|
|
52
50
|
success: {
|
|
53
|
-
type:
|
|
51
|
+
type: "boolean",
|
|
54
52
|
description: "Whether the email was sent",
|
|
55
53
|
},
|
|
56
54
|
response: {
|
|
57
|
-
type:
|
|
55
|
+
type: "object",
|
|
58
56
|
description: "A response from the email client, this may be an error",
|
|
59
57
|
},
|
|
60
58
|
},
|
|
@@ -2,8 +2,6 @@ import {
|
|
|
2
2
|
AutomationActionStepId,
|
|
3
3
|
AutomationStepSchema,
|
|
4
4
|
AutomationStepInput,
|
|
5
|
-
AutomationStepType,
|
|
6
|
-
AutomationIOType,
|
|
7
5
|
} from "@budibase/types"
|
|
8
6
|
|
|
9
7
|
/**
|
|
@@ -17,7 +15,7 @@ export const definition: AutomationStepSchema = {
|
|
|
17
15
|
tagline: "Console log a value in the backend",
|
|
18
16
|
icon: "Monitoring",
|
|
19
17
|
description: "Logs the given text to the server (using console.log)",
|
|
20
|
-
type:
|
|
18
|
+
type: "ACTION",
|
|
21
19
|
internal: true,
|
|
22
20
|
stepId: AutomationActionStepId.SERVER_LOG,
|
|
23
21
|
inputs: {
|
|
@@ -27,7 +25,7 @@ export const definition: AutomationStepSchema = {
|
|
|
27
25
|
inputs: {
|
|
28
26
|
properties: {
|
|
29
27
|
text: {
|
|
30
|
-
type:
|
|
28
|
+
type: "string",
|
|
31
29
|
title: "Log",
|
|
32
30
|
},
|
|
33
31
|
},
|
|
@@ -36,11 +34,11 @@ export const definition: AutomationStepSchema = {
|
|
|
36
34
|
outputs: {
|
|
37
35
|
properties: {
|
|
38
36
|
success: {
|
|
39
|
-
type:
|
|
37
|
+
type: "boolean",
|
|
40
38
|
description: "Whether the action was successful",
|
|
41
39
|
},
|
|
42
40
|
message: {
|
|
43
|
-
type:
|
|
41
|
+
type: "string",
|
|
44
42
|
description: "What was output",
|
|
45
43
|
},
|
|
46
44
|
},
|
|
@@ -4,8 +4,6 @@ import {
|
|
|
4
4
|
AutomationActionStepId,
|
|
5
5
|
AutomationStepSchema,
|
|
6
6
|
AutomationStepInput,
|
|
7
|
-
AutomationStepType,
|
|
8
|
-
AutomationIOType,
|
|
9
7
|
} from "@budibase/types"
|
|
10
8
|
|
|
11
9
|
export const definition: AutomationStepSchema = {
|
|
@@ -14,18 +12,18 @@ export const definition: AutomationStepSchema = {
|
|
|
14
12
|
description: "Send a message to Slack",
|
|
15
13
|
icon: "ri-slack-line",
|
|
16
14
|
stepId: AutomationActionStepId.slack,
|
|
17
|
-
type:
|
|
15
|
+
type: "ACTION",
|
|
18
16
|
internal: false,
|
|
19
17
|
inputs: {},
|
|
20
18
|
schema: {
|
|
21
19
|
inputs: {
|
|
22
20
|
properties: {
|
|
23
21
|
url: {
|
|
24
|
-
type:
|
|
22
|
+
type: "string",
|
|
25
23
|
title: "Incoming Webhook URL",
|
|
26
24
|
},
|
|
27
25
|
text: {
|
|
28
|
-
type:
|
|
26
|
+
type: "string",
|
|
29
27
|
title: "Message",
|
|
30
28
|
},
|
|
31
29
|
},
|
|
@@ -34,15 +32,15 @@ export const definition: AutomationStepSchema = {
|
|
|
34
32
|
outputs: {
|
|
35
33
|
properties: {
|
|
36
34
|
httpStatus: {
|
|
37
|
-
type:
|
|
35
|
+
type: "number",
|
|
38
36
|
description: "The HTTP status code of the request",
|
|
39
37
|
},
|
|
40
38
|
success: {
|
|
41
|
-
type:
|
|
39
|
+
type: "boolean",
|
|
42
40
|
description: "Whether the message sent successfully",
|
|
43
41
|
},
|
|
44
42
|
response: {
|
|
45
|
-
type:
|
|
43
|
+
type: "string",
|
|
46
44
|
description: "The response from the Slack Webhook",
|
|
47
45
|
},
|
|
48
46
|
},
|
|
@@ -3,11 +3,8 @@ import * as automationUtils from "../automationUtils"
|
|
|
3
3
|
import { buildCtx } from "./utils"
|
|
4
4
|
import {
|
|
5
5
|
AutomationActionStepId,
|
|
6
|
-
AutomationCustomIOType,
|
|
7
|
-
AutomationIOType,
|
|
8
|
-
AutomationStepInput,
|
|
9
6
|
AutomationStepSchema,
|
|
10
|
-
|
|
7
|
+
AutomationStepInput,
|
|
11
8
|
} from "@budibase/types"
|
|
12
9
|
|
|
13
10
|
export const definition: AutomationStepSchema = {
|
|
@@ -15,7 +12,7 @@ export const definition: AutomationStepSchema = {
|
|
|
15
12
|
tagline: "Update a {{inputs.enriched.table.name}} row",
|
|
16
13
|
icon: "Refresh",
|
|
17
14
|
description: "Update a row in your database",
|
|
18
|
-
type:
|
|
15
|
+
type: "ACTION",
|
|
19
16
|
internal: true,
|
|
20
17
|
stepId: AutomationActionStepId.UPDATE_ROW,
|
|
21
18
|
inputs: {},
|
|
@@ -23,16 +20,16 @@ export const definition: AutomationStepSchema = {
|
|
|
23
20
|
inputs: {
|
|
24
21
|
properties: {
|
|
25
22
|
meta: {
|
|
26
|
-
type:
|
|
23
|
+
type: "object",
|
|
27
24
|
title: "Field settings",
|
|
28
25
|
},
|
|
29
26
|
row: {
|
|
30
|
-
type:
|
|
31
|
-
customType:
|
|
27
|
+
type: "object",
|
|
28
|
+
customType: "row",
|
|
32
29
|
title: "Table",
|
|
33
30
|
},
|
|
34
31
|
rowId: {
|
|
35
|
-
type:
|
|
32
|
+
type: "string",
|
|
36
33
|
title: "Row ID",
|
|
37
34
|
},
|
|
38
35
|
},
|
|
@@ -41,24 +38,24 @@ export const definition: AutomationStepSchema = {
|
|
|
41
38
|
outputs: {
|
|
42
39
|
properties: {
|
|
43
40
|
row: {
|
|
44
|
-
type:
|
|
45
|
-
customType:
|
|
41
|
+
type: "object",
|
|
42
|
+
customType: "row",
|
|
46
43
|
description: "The updated row",
|
|
47
44
|
},
|
|
48
45
|
response: {
|
|
49
|
-
type:
|
|
46
|
+
type: "object",
|
|
50
47
|
description: "The response from the table",
|
|
51
48
|
},
|
|
52
49
|
success: {
|
|
53
|
-
type:
|
|
50
|
+
type: "boolean",
|
|
54
51
|
description: "Whether the action was successful",
|
|
55
52
|
},
|
|
56
53
|
id: {
|
|
57
|
-
type:
|
|
54
|
+
type: "string",
|
|
58
55
|
description: "The identifier of the updated row",
|
|
59
56
|
},
|
|
60
57
|
revision: {
|
|
61
|
-
type:
|
|
58
|
+
type: "string",
|
|
62
59
|
description: "The revision of the updated row",
|
|
63
60
|
},
|
|
64
61
|
},
|
|
@@ -4,14 +4,12 @@ import {
|
|
|
4
4
|
AutomationActionStepId,
|
|
5
5
|
AutomationStepSchema,
|
|
6
6
|
AutomationStepInput,
|
|
7
|
-
AutomationStepType,
|
|
8
|
-
AutomationIOType,
|
|
9
7
|
} from "@budibase/types"
|
|
10
8
|
|
|
11
9
|
export const definition: AutomationStepSchema = {
|
|
12
10
|
name: "Zapier Webhook",
|
|
13
11
|
stepId: AutomationActionStepId.zapier,
|
|
14
|
-
type:
|
|
12
|
+
type: "ACTION",
|
|
15
13
|
internal: false,
|
|
16
14
|
description: "Trigger a Zapier Zap via webhooks",
|
|
17
15
|
tagline: "Trigger a Zapier Zap",
|
|
@@ -21,27 +19,27 @@ export const definition: AutomationStepSchema = {
|
|
|
21
19
|
inputs: {
|
|
22
20
|
properties: {
|
|
23
21
|
url: {
|
|
24
|
-
type:
|
|
22
|
+
type: "string",
|
|
25
23
|
title: "Webhook URL",
|
|
26
24
|
},
|
|
27
25
|
value1: {
|
|
28
|
-
type:
|
|
26
|
+
type: "string",
|
|
29
27
|
title: "Payload Value 1",
|
|
30
28
|
},
|
|
31
29
|
value2: {
|
|
32
|
-
type:
|
|
30
|
+
type: "string",
|
|
33
31
|
title: "Payload Value 2",
|
|
34
32
|
},
|
|
35
33
|
value3: {
|
|
36
|
-
type:
|
|
34
|
+
type: "string",
|
|
37
35
|
title: "Payload Value 3",
|
|
38
36
|
},
|
|
39
37
|
value4: {
|
|
40
|
-
type:
|
|
38
|
+
type: "string",
|
|
41
39
|
title: "Payload Value 4",
|
|
42
40
|
},
|
|
43
41
|
value5: {
|
|
44
|
-
type:
|
|
42
|
+
type: "string",
|
|
45
43
|
title: "Payload Value 5",
|
|
46
44
|
},
|
|
47
45
|
},
|
|
@@ -50,11 +48,11 @@ export const definition: AutomationStepSchema = {
|
|
|
50
48
|
outputs: {
|
|
51
49
|
properties: {
|
|
52
50
|
httpStatus: {
|
|
53
|
-
type:
|
|
51
|
+
type: "number",
|
|
54
52
|
description: "The HTTP status code of the request",
|
|
55
53
|
},
|
|
56
54
|
response: {
|
|
57
|
-
type:
|
|
55
|
+
type: "string",
|
|
58
56
|
description: "The response from Zapier",
|
|
59
57
|
},
|
|
60
58
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import TestConfig from "../../../tests/utilities/TestConfiguration"
|
|
2
2
|
import { context } from "@budibase/backend-core"
|
|
3
|
-
import {
|
|
3
|
+
import { ACTION_DEFINITIONS, getAction } from "../../actions"
|
|
4
4
|
import emitter from "../../../events/index"
|
|
5
5
|
import env from "../../../environment"
|
|
6
6
|
|
|
@@ -57,4 +57,4 @@ export async function runStep(stepId: string, inputs: any, stepContext?: any) {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
export const apiKey = "test"
|
|
60
|
-
export const actions =
|
|
60
|
+
export const actions = ACTION_DEFINITIONS
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
AutomationCustomIOType,
|
|
3
|
-
AutomationIOType,
|
|
4
|
-
AutomationStepType,
|
|
5
2
|
AutomationTriggerSchema,
|
|
6
3
|
AutomationTriggerStepId,
|
|
7
4
|
} from "@budibase/types"
|
|
@@ -18,8 +15,8 @@ export const definition: AutomationTriggerSchema = {
|
|
|
18
15
|
inputs: {
|
|
19
16
|
properties: {
|
|
20
17
|
fields: {
|
|
21
|
-
type:
|
|
22
|
-
customType:
|
|
18
|
+
type: "object",
|
|
19
|
+
customType: "triggerSchema",
|
|
23
20
|
title: "Fields",
|
|
24
21
|
},
|
|
25
22
|
},
|
|
@@ -28,13 +25,13 @@ export const definition: AutomationTriggerSchema = {
|
|
|
28
25
|
outputs: {
|
|
29
26
|
properties: {
|
|
30
27
|
fields: {
|
|
31
|
-
type:
|
|
28
|
+
type: "object",
|
|
32
29
|
description: "Fields submitted from the app frontend",
|
|
33
|
-
customType:
|
|
30
|
+
customType: "triggerSchema",
|
|
34
31
|
},
|
|
35
32
|
},
|
|
36
33
|
required: ["fields"],
|
|
37
34
|
},
|
|
38
35
|
},
|
|
39
|
-
type:
|
|
36
|
+
type: "TRIGGER",
|
|
40
37
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
AutomationCustomIOType,
|
|
3
|
-
AutomationIOType,
|
|
4
|
-
AutomationStepType,
|
|
5
2
|
AutomationTriggerSchema,
|
|
6
3
|
AutomationTriggerStepId,
|
|
7
4
|
} from "@budibase/types"
|
|
@@ -18,8 +15,8 @@ export const definition: AutomationTriggerSchema = {
|
|
|
18
15
|
inputs: {
|
|
19
16
|
properties: {
|
|
20
17
|
cron: {
|
|
21
|
-
type:
|
|
22
|
-
customType:
|
|
18
|
+
type: "string",
|
|
19
|
+
customType: "cron",
|
|
23
20
|
title: "Expression",
|
|
24
21
|
},
|
|
25
22
|
},
|
|
@@ -28,12 +25,12 @@ export const definition: AutomationTriggerSchema = {
|
|
|
28
25
|
outputs: {
|
|
29
26
|
properties: {
|
|
30
27
|
timestamp: {
|
|
31
|
-
type:
|
|
28
|
+
type: "number",
|
|
32
29
|
description: "Timestamp the cron was executed",
|
|
33
30
|
},
|
|
34
31
|
},
|
|
35
32
|
required: ["timestamp"],
|
|
36
33
|
},
|
|
37
34
|
},
|
|
38
|
-
type:
|
|
35
|
+
type: "TRIGGER",
|
|
39
36
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
AutomationCustomIOType,
|
|
3
|
-
AutomationIOType,
|
|
4
|
-
AutomationStepType,
|
|
5
2
|
AutomationTriggerSchema,
|
|
6
3
|
AutomationTriggerStepId,
|
|
7
4
|
} from "@budibase/types"
|
|
@@ -18,8 +15,8 @@ export const definition: AutomationTriggerSchema = {
|
|
|
18
15
|
inputs: {
|
|
19
16
|
properties: {
|
|
20
17
|
tableId: {
|
|
21
|
-
type:
|
|
22
|
-
customType:
|
|
18
|
+
type: "string",
|
|
19
|
+
customType: "table",
|
|
23
20
|
title: "Table",
|
|
24
21
|
},
|
|
25
22
|
},
|
|
@@ -28,13 +25,13 @@ export const definition: AutomationTriggerSchema = {
|
|
|
28
25
|
outputs: {
|
|
29
26
|
properties: {
|
|
30
27
|
row: {
|
|
31
|
-
type:
|
|
32
|
-
customType:
|
|
28
|
+
type: "object",
|
|
29
|
+
customType: "row",
|
|
33
30
|
description: "The row that was deleted",
|
|
34
31
|
},
|
|
35
32
|
},
|
|
36
33
|
required: ["row"],
|
|
37
34
|
},
|
|
38
35
|
},
|
|
39
|
-
type:
|
|
36
|
+
type: "TRIGGER",
|
|
40
37
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
AutomationCustomIOType,
|
|
3
|
-
AutomationIOType,
|
|
4
|
-
AutomationStepType,
|
|
5
2
|
AutomationTriggerSchema,
|
|
6
3
|
AutomationTriggerStepId,
|
|
7
4
|
} from "@budibase/types"
|
|
@@ -18,8 +15,8 @@ export const definition: AutomationTriggerSchema = {
|
|
|
18
15
|
inputs: {
|
|
19
16
|
properties: {
|
|
20
17
|
tableId: {
|
|
21
|
-
type:
|
|
22
|
-
customType:
|
|
18
|
+
type: "string",
|
|
19
|
+
customType: "table",
|
|
23
20
|
title: "Table",
|
|
24
21
|
},
|
|
25
22
|
},
|
|
@@ -28,21 +25,21 @@ export const definition: AutomationTriggerSchema = {
|
|
|
28
25
|
outputs: {
|
|
29
26
|
properties: {
|
|
30
27
|
row: {
|
|
31
|
-
type:
|
|
32
|
-
customType:
|
|
28
|
+
type: "object",
|
|
29
|
+
customType: "row",
|
|
33
30
|
description: "The new row that was created",
|
|
34
31
|
},
|
|
35
32
|
id: {
|
|
36
|
-
type:
|
|
33
|
+
type: "string",
|
|
37
34
|
description: "Row ID - can be used for updating",
|
|
38
35
|
},
|
|
39
36
|
revision: {
|
|
40
|
-
type:
|
|
37
|
+
type: "string",
|
|
41
38
|
description: "Revision of row",
|
|
42
39
|
},
|
|
43
40
|
},
|
|
44
41
|
required: ["row", "id"],
|
|
45
42
|
},
|
|
46
43
|
},
|
|
47
|
-
type:
|
|
44
|
+
type: "TRIGGER",
|
|
48
45
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
AutomationCustomIOType,
|
|
3
|
-
AutomationIOType,
|
|
4
|
-
AutomationStepType,
|
|
5
2
|
AutomationTriggerSchema,
|
|
6
3
|
AutomationTriggerStepId,
|
|
7
4
|
} from "@budibase/types"
|
|
@@ -18,8 +15,8 @@ export const definition: AutomationTriggerSchema = {
|
|
|
18
15
|
inputs: {
|
|
19
16
|
properties: {
|
|
20
17
|
tableId: {
|
|
21
|
-
type:
|
|
22
|
-
customType:
|
|
18
|
+
type: "string",
|
|
19
|
+
customType: "table",
|
|
23
20
|
title: "Table",
|
|
24
21
|
},
|
|
25
22
|
},
|
|
@@ -28,21 +25,21 @@ export const definition: AutomationTriggerSchema = {
|
|
|
28
25
|
outputs: {
|
|
29
26
|
properties: {
|
|
30
27
|
row: {
|
|
31
|
-
type:
|
|
32
|
-
customType:
|
|
28
|
+
type: "object",
|
|
29
|
+
customType: "row",
|
|
33
30
|
description: "The row that was updated",
|
|
34
31
|
},
|
|
35
32
|
id: {
|
|
36
|
-
type:
|
|
33
|
+
type: "string",
|
|
37
34
|
description: "Row ID - can be used for updating",
|
|
38
35
|
},
|
|
39
36
|
revision: {
|
|
40
|
-
type:
|
|
37
|
+
type: "string",
|
|
41
38
|
description: "Revision of row",
|
|
42
39
|
},
|
|
43
40
|
},
|
|
44
41
|
required: ["row", "id"],
|
|
45
42
|
},
|
|
46
43
|
},
|
|
47
|
-
type:
|
|
44
|
+
type: "TRIGGER",
|
|
48
45
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
AutomationCustomIOType,
|
|
3
|
-
AutomationIOType,
|
|
4
|
-
AutomationStepType,
|
|
5
2
|
AutomationTriggerSchema,
|
|
6
3
|
AutomationTriggerStepId,
|
|
7
4
|
} from "@budibase/types"
|
|
@@ -18,13 +15,13 @@ export const definition: AutomationTriggerSchema = {
|
|
|
18
15
|
inputs: {
|
|
19
16
|
properties: {
|
|
20
17
|
schemaUrl: {
|
|
21
|
-
type:
|
|
22
|
-
customType:
|
|
18
|
+
type: "string",
|
|
19
|
+
customType: "webhookUrl",
|
|
23
20
|
title: "Schema URL",
|
|
24
21
|
},
|
|
25
22
|
triggerUrl: {
|
|
26
|
-
type:
|
|
27
|
-
customType:
|
|
23
|
+
type: "string",
|
|
24
|
+
customType: "webhookUrl",
|
|
28
25
|
title: "Trigger URL",
|
|
29
26
|
},
|
|
30
27
|
},
|
|
@@ -33,12 +30,12 @@ export const definition: AutomationTriggerSchema = {
|
|
|
33
30
|
outputs: {
|
|
34
31
|
properties: {
|
|
35
32
|
body: {
|
|
36
|
-
type:
|
|
33
|
+
type: "object",
|
|
37
34
|
description: "Body of the request which hit the webhook",
|
|
38
35
|
},
|
|
39
36
|
},
|
|
40
37
|
required: ["body"],
|
|
41
38
|
},
|
|
42
39
|
},
|
|
43
|
-
type:
|
|
40
|
+
type: "TRIGGER",
|
|
44
41
|
}
|
package/src/environment.ts
CHANGED
|
@@ -62,6 +62,7 @@ const environment = {
|
|
|
62
62
|
// minor
|
|
63
63
|
SALT_ROUNDS: process.env.SALT_ROUNDS,
|
|
64
64
|
LOGGER: process.env.LOGGER,
|
|
65
|
+
LOG_LEVEL: process.env.LOG_LEVEL,
|
|
65
66
|
ACCOUNT_PORTAL_URL: process.env.ACCOUNT_PORTAL_URL,
|
|
66
67
|
AUTOMATION_MAX_ITERATIONS:
|
|
67
68
|
parseIntSafe(process.env.AUTOMATION_MAX_ITERATIONS) || 200,
|
package/src/events/index.ts
CHANGED
|
@@ -14,11 +14,11 @@ import firebase from "./firebase"
|
|
|
14
14
|
import redis from "./redis"
|
|
15
15
|
import snowflake from "./snowflake"
|
|
16
16
|
import oracle from "./oracle"
|
|
17
|
+
import { getPlugins } from "../api/controllers/plugin"
|
|
17
18
|
import { SourceName, Integration, PluginType } from "@budibase/types"
|
|
18
19
|
import { getDatasourcePlugin } from "../utilities/fileSystem"
|
|
19
20
|
import env from "../environment"
|
|
20
21
|
import { cloneDeep } from "lodash"
|
|
21
|
-
import sdk from "../sdk"
|
|
22
22
|
|
|
23
23
|
const DEFINITIONS: { [key: string]: Integration } = {
|
|
24
24
|
[SourceName.POSTGRES]: postgres.schema,
|
|
@@ -79,7 +79,7 @@ export async function getDefinition(source: SourceName): Promise<Integration> {
|
|
|
79
79
|
export async function getDefinitions() {
|
|
80
80
|
const pluginSchemas: { [key: string]: Integration } = {}
|
|
81
81
|
if (env.SELF_HOSTED) {
|
|
82
|
-
const plugins = await
|
|
82
|
+
const plugins = await getPlugins(PluginType.DATASOURCE)
|
|
83
83
|
// extract the actual schema from each custom
|
|
84
84
|
for (let plugin of plugins) {
|
|
85
85
|
const sourceId = plugin.name
|
|
@@ -103,7 +103,7 @@ export async function getIntegration(integration: string) {
|
|
|
103
103
|
return INTEGRATIONS[integration]
|
|
104
104
|
}
|
|
105
105
|
if (env.SELF_HOSTED) {
|
|
106
|
-
const plugins = await
|
|
106
|
+
const plugins = await getPlugins(PluginType.DATASOURCE)
|
|
107
107
|
for (let plugin of plugins) {
|
|
108
108
|
if (plugin.name === integration) {
|
|
109
109
|
// need to use commonJS require due to its dynamic runtime nature
|
|
@@ -243,14 +243,11 @@ class SqlServerIntegration extends Sql implements DatasourcePlus {
|
|
|
243
243
|
if (typeof name !== "string") {
|
|
244
244
|
continue
|
|
245
245
|
}
|
|
246
|
-
const hasDefault = def.COLUMN_DEFAULT
|
|
247
|
-
const isAuto = !!autoColumns.find(col => col === name)
|
|
248
|
-
const required = !!requiredColumns.find(col => col === name)
|
|
249
246
|
schema[name] = {
|
|
250
|
-
autocolumn:
|
|
247
|
+
autocolumn: !!autoColumns.find(col => col === name),
|
|
251
248
|
name: name,
|
|
252
249
|
constraints: {
|
|
253
|
-
presence:
|
|
250
|
+
presence: requiredColumns.find(col => col === name),
|
|
254
251
|
},
|
|
255
252
|
...convertSqlType(def.DATA_TYPE),
|
|
256
253
|
externalType: def.DATA_TYPE,
|
|
@@ -229,15 +229,13 @@ class MySQLIntegration extends Sql implements DatasourcePlus {
|
|
|
229
229
|
if (column.Key === "PRI" && primaryKeys.indexOf(column.Key) === -1) {
|
|
230
230
|
primaryKeys.push(columnName)
|
|
231
231
|
}
|
|
232
|
-
const
|
|
232
|
+
const constraints = {
|
|
233
|
+
presence: column.Null !== "YES",
|
|
234
|
+
}
|
|
233
235
|
const isAuto: boolean =
|
|
234
236
|
typeof column.Extra === "string" &&
|
|
235
237
|
(column.Extra === "auto_increment" ||
|
|
236
238
|
column.Extra.toLowerCase().includes("generated"))
|
|
237
|
-
const required = column.Null !== "YES"
|
|
238
|
-
const constraints = {
|
|
239
|
-
presence: required && !isAuto && !hasDefault,
|
|
240
|
-
}
|
|
241
239
|
schema[columnName] = {
|
|
242
240
|
name: columnName,
|
|
243
241
|
autocolumn: isAuto,
|
|
@@ -262,17 +262,15 @@ class PostgresIntegration extends Sql implements DatasourcePlus {
|
|
|
262
262
|
column.identity_start ||
|
|
263
263
|
column.identity_increment
|
|
264
264
|
)
|
|
265
|
-
const
|
|
266
|
-
|
|
265
|
+
const constraints = {
|
|
266
|
+
presence: column.is_nullable === "NO",
|
|
267
|
+
}
|
|
268
|
+
const hasDefault =
|
|
267
269
|
typeof column.column_default === "string" &&
|
|
268
270
|
column.column_default.startsWith("nextval")
|
|
269
271
|
const isGenerated =
|
|
270
272
|
column.is_generated && column.is_generated !== "NEVER"
|
|
271
|
-
const isAuto: boolean =
|
|
272
|
-
const required = column.is_nullable === "NO"
|
|
273
|
-
const constraints = {
|
|
274
|
-
presence: required && !hasDefault && !isGenerated,
|
|
275
|
-
}
|
|
273
|
+
const isAuto: boolean = hasDefault || identity || isGenerated
|
|
276
274
|
tables[tableName].schema[columnName] = {
|
|
277
275
|
autocolumn: isAuto,
|
|
278
276
|
name: columnName,
|