@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.
Files changed (198) hide show
  1. package/builder/assets/index.24635afb.js +1794 -0
  2. package/builder/assets/index.4eae16b2.css +6 -0
  3. package/builder/index.html +2 -2
  4. package/dist/api/controllers/application.js +3 -4
  5. package/dist/api/controllers/automation.js +13 -7
  6. package/dist/api/controllers/datasource.js +1 -1
  7. package/dist/api/controllers/dev.js +1 -1
  8. package/dist/api/controllers/ops.js +40 -0
  9. package/dist/api/controllers/plugin/index.js +6 -37
  10. package/dist/api/controllers/query/index.js +2 -2
  11. package/dist/api/controllers/row/ExternalRequest.js +21 -14
  12. package/dist/api/controllers/row/internal.js +5 -2
  13. package/dist/api/controllers/row/utils.js +2 -2
  14. package/dist/api/controllers/table/index.js +2 -2
  15. package/dist/api/controllers/table/utils.js +9 -3
  16. package/dist/api/controllers/user.js +1 -83
  17. package/dist/api/controllers/view/exporters.js +3 -1
  18. package/dist/api/index.js +1 -2
  19. package/dist/api/routes/index.js +2 -2
  20. package/dist/api/routes/{cloud.js → ops.js} +19 -6
  21. package/dist/api/routes/user.js +0 -1
  22. package/dist/app.js +4 -13
  23. package/dist/automations/actions.js +32 -6
  24. package/dist/automations/index.js +3 -2
  25. package/dist/automations/steps/bash.js +6 -6
  26. package/dist/automations/steps/createRow.js +11 -11
  27. package/dist/automations/steps/delay.js +3 -3
  28. package/dist/automations/steps/deleteRow.js +8 -8
  29. package/dist/automations/steps/discord.js +8 -8
  30. package/dist/automations/steps/executeQuery.js +9 -9
  31. package/dist/automations/steps/executeScript.js +6 -6
  32. package/dist/automations/steps/filter.js +6 -6
  33. package/dist/automations/steps/integromat.js +10 -10
  34. package/dist/automations/steps/loop.js +9 -9
  35. package/dist/automations/steps/outgoingWebhook.js +10 -10
  36. package/dist/automations/steps/queryRows.js +14 -14
  37. package/dist/automations/steps/sendSmtpEmail.js +9 -9
  38. package/dist/automations/steps/serverLog.js +4 -4
  39. package/dist/automations/steps/slack.js +6 -6
  40. package/dist/automations/steps/updateRow.js +11 -11
  41. package/dist/automations/steps/zapier.js +9 -9
  42. package/dist/automations/triggerInfo/app.js +5 -5
  43. package/dist/automations/triggerInfo/cron.js +4 -4
  44. package/dist/automations/triggerInfo/rowDeleted.js +5 -5
  45. package/dist/automations/triggerInfo/rowSaved.js +7 -7
  46. package/dist/automations/triggerInfo/rowUpdated.js +7 -7
  47. package/dist/automations/triggerInfo/webhook.js +6 -6
  48. package/dist/db/utils.js +3 -2
  49. package/dist/environment.js +0 -1
  50. package/dist/events/docUpdates/index.js +17 -0
  51. package/dist/events/docUpdates/processors.js +18 -0
  52. package/dist/events/docUpdates/syncUsers.js +49 -0
  53. package/dist/events/index.js +3 -0
  54. package/dist/integrations/base/sqlTable.js +9 -2
  55. package/dist/integrations/index.js +3 -3
  56. package/dist/integrations/microsoftSqlServer.js +5 -2
  57. package/dist/integrations/mysql.js +5 -3
  58. package/dist/integrations/postgres.js +7 -5
  59. package/dist/integrations/redis.js +7 -0
  60. package/dist/integrations/rest.js +4 -0
  61. package/dist/migrations/functions/syncQuotas.js +2 -0
  62. package/dist/migrations/functions/usageQuotas/syncApps.js +1 -2
  63. package/dist/migrations/functions/usageQuotas/syncRows.js +1 -2
  64. package/dist/migrations/functions/usageQuotas/syncUsers.js +21 -0
  65. package/dist/sdk/app/applications/sync.js +117 -23
  66. package/dist/sdk/app/backups/exports.js +14 -38
  67. package/dist/sdk/index.js +2 -0
  68. package/dist/sdk/plugins/index.js +27 -0
  69. package/dist/sdk/plugins/plugins.js +53 -0
  70. package/dist/sdk/users/utils.js +21 -4
  71. package/dist/startup.js +31 -28
  72. package/dist/threads/automation.js +16 -5
  73. package/dist/tsconfig.build.tsbuildinfo +1 -1
  74. package/dist/utilities/csv.js +33 -0
  75. package/dist/utilities/fileSystem/plugin.js +33 -23
  76. package/dist/utilities/global.js +17 -12
  77. package/dist/utilities/rowProcessor/utils.js +4 -5
  78. package/dist/utilities/schema.js +5 -1
  79. package/dist/watch.js +2 -2
  80. package/dist/websockets/client.js +14 -0
  81. package/dist/websockets/grid.js +60 -0
  82. package/dist/websockets/index.js +17 -0
  83. package/dist/websockets/websocket.js +78 -0
  84. package/package.json +16 -16
  85. package/scripts/dev/manage.js +2 -0
  86. package/scripts/integrations/mssql/data/entrypoint.sh +1 -0
  87. package/scripts/integrations/mssql/data/setup.sql +17 -17
  88. package/scripts/integrations/mysql/init.sql +1 -1
  89. package/scripts/integrations/postgres/init.sql +1 -0
  90. package/src/api/controllers/application.ts +4 -4
  91. package/src/api/controllers/automation.ts +12 -6
  92. package/src/api/controllers/datasource.ts +15 -5
  93. package/src/api/controllers/dev.ts +2 -2
  94. package/src/api/controllers/ops.ts +32 -0
  95. package/src/api/controllers/plugin/index.ts +8 -45
  96. package/src/api/controllers/query/index.ts +2 -2
  97. package/src/api/controllers/row/ExternalRequest.ts +21 -12
  98. package/src/api/controllers/row/internal.ts +13 -11
  99. package/src/api/controllers/row/utils.ts +4 -4
  100. package/src/api/controllers/table/index.ts +2 -2
  101. package/src/api/controllers/table/utils.ts +10 -3
  102. package/src/api/controllers/user.ts +10 -96
  103. package/src/api/controllers/view/exporters.ts +3 -1
  104. package/src/api/index.ts +2 -4
  105. package/src/api/routes/index.ts +2 -2
  106. package/src/api/routes/ops.ts +30 -0
  107. package/src/api/routes/tests/automation.spec.js +7 -4
  108. package/src/api/routes/tests/user.spec.js +48 -37
  109. package/src/api/routes/user.ts +0 -5
  110. package/src/app.ts +4 -15
  111. package/src/automations/actions.ts +56 -24
  112. package/src/automations/index.ts +1 -1
  113. package/src/automations/steps/bash.ts +10 -7
  114. package/src/automations/steps/createRow.ts +15 -12
  115. package/src/automations/steps/delay.ts +6 -4
  116. package/src/automations/steps/deleteRow.ts +12 -9
  117. package/src/automations/steps/discord.ts +10 -8
  118. package/src/automations/steps/executeQuery.ts +13 -10
  119. package/src/automations/steps/executeScript.ts +10 -7
  120. package/src/automations/steps/filter.ts +8 -6
  121. package/src/automations/steps/integromat.ts +12 -10
  122. package/src/automations/steps/loop.ts +16 -10
  123. package/src/automations/steps/outgoingWebhook.ts +14 -11
  124. package/src/automations/steps/queryRows.ts +18 -15
  125. package/src/automations/steps/sendSmtpEmail.ts +11 -9
  126. package/src/automations/steps/serverLog.ts +6 -4
  127. package/src/automations/steps/slack.ts +8 -6
  128. package/src/automations/steps/updateRow.ts +15 -12
  129. package/src/automations/steps/zapier.ts +11 -9
  130. package/src/automations/tests/utilities/index.ts +2 -2
  131. package/src/automations/triggerInfo/app.ts +8 -5
  132. package/src/automations/triggerInfo/cron.ts +7 -4
  133. package/src/automations/triggerInfo/rowDeleted.ts +8 -5
  134. package/src/automations/triggerInfo/rowSaved.ts +10 -7
  135. package/src/automations/triggerInfo/rowUpdated.ts +10 -7
  136. package/src/automations/triggerInfo/webhook.ts +9 -6
  137. package/src/db/utils.ts +1 -0
  138. package/src/environment.ts +0 -1
  139. package/src/events/docUpdates/index.ts +1 -0
  140. package/src/events/docUpdates/processors.ts +14 -0
  141. package/src/events/docUpdates/syncUsers.ts +35 -0
  142. package/src/events/index.ts +1 -0
  143. package/src/integration-test/postgres.spec.ts +3 -1
  144. package/src/integrations/base/sqlTable.ts +9 -2
  145. package/src/integrations/index.ts +3 -3
  146. package/src/integrations/microsoftSqlServer.ts +5 -2
  147. package/src/integrations/mysql.ts +5 -3
  148. package/src/integrations/postgres.ts +7 -5
  149. package/src/integrations/redis.ts +8 -0
  150. package/src/integrations/rest.ts +3 -0
  151. package/src/migrations/functions/syncQuotas.ts +2 -0
  152. package/src/migrations/functions/usageQuotas/syncApps.ts +2 -3
  153. package/src/migrations/functions/usageQuotas/syncRows.ts +2 -3
  154. package/src/migrations/functions/usageQuotas/syncUsers.ts +9 -0
  155. package/src/migrations/functions/usageQuotas/tests/syncRows.spec.ts +2 -2
  156. package/src/migrations/functions/usageQuotas/tests/syncUsers.spec.ts +26 -0
  157. package/src/migrations/index.ts +1 -0
  158. package/src/sdk/app/applications/sync.ts +129 -22
  159. package/src/sdk/app/applications/tests/sync.spec.ts +137 -0
  160. package/src/sdk/app/backups/exports.ts +17 -41
  161. package/src/sdk/index.ts +2 -0
  162. package/src/sdk/plugins/index.ts +5 -0
  163. package/src/sdk/plugins/plugins.ts +41 -0
  164. package/src/sdk/users/tests/utils.spec.ts +1 -32
  165. package/src/sdk/users/utils.ts +23 -5
  166. package/src/startup.ts +36 -34
  167. package/src/tests/jestEnv.ts +0 -1
  168. package/src/tests/jestSetup.ts +0 -1
  169. package/src/tests/utilities/TestConfiguration.ts +28 -0
  170. package/src/tests/utilities/structures.ts +25 -17
  171. package/src/threads/automation.ts +18 -6
  172. package/src/utilities/csv.ts +22 -0
  173. package/src/utilities/fileSystem/plugin.ts +13 -4
  174. package/src/utilities/global.ts +21 -16
  175. package/src/utilities/rowProcessor/utils.ts +9 -10
  176. package/src/utilities/schema.ts +8 -0
  177. package/src/utilities/tests/csv.spec.ts +33 -0
  178. package/src/watch.ts +2 -2
  179. package/src/websockets/client.ts +11 -0
  180. package/src/websockets/grid.ts +55 -0
  181. package/src/websockets/index.ts +14 -0
  182. package/src/websockets/websocket.ts +83 -0
  183. package/tsconfig.build.json +3 -5
  184. package/tsconfig.json +2 -1
  185. package/builder/assets/index.0b358332.js +0 -1817
  186. package/builder/assets/index.7f9a008b.css +0 -6
  187. package/dist/api/controllers/cloud.js +0 -130
  188. package/dist/elasticApm.js +0 -14
  189. package/dist/package.json +0 -180
  190. package/dist/websocket.js +0 -22
  191. package/scripts/likeCypress.ts +0 -35
  192. package/src/api/controllers/cloud.ts +0 -119
  193. package/src/api/routes/cloud.ts +0 -18
  194. package/src/api/routes/tests/cloud.spec.ts +0 -54
  195. package/src/elasticApm.ts +0 -10
  196. package/src/migrations/functions/tests/syncQuotas.spec.js +0 -26
  197. package/src/tests/logging.ts +0 -34
  198. 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
- AutomationStepSchema,
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: "ACTION",
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: "object",
26
+ type: AutomationIOType.OBJECT,
24
27
  properties: {
25
28
  tableId: {
26
- type: "string",
27
- customType: "table",
29
+ type: AutomationIOType.STRING,
30
+ customType: AutomationCustomIOType.TABLE,
28
31
  },
29
32
  },
30
- customType: "row",
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: "object",
41
- customType: "row",
43
+ type: AutomationIOType.OBJECT,
44
+ customType: AutomationCustomIOType.ROW,
42
45
  description: "The new row",
43
46
  },
44
47
  response: {
45
- type: "object",
48
+ type: AutomationIOType.OBJECT,
46
49
  description: "The response from the table",
47
50
  },
48
51
  success: {
49
- type: "boolean",
52
+ type: AutomationIOType.BOOLEAN,
50
53
  description: "Whether the row creation was successful",
51
54
  },
52
55
  id: {
53
- type: "string",
56
+ type: AutomationIOType.STRING,
54
57
  description: "The identifier of the new row",
55
58
  },
56
59
  revision: {
57
- type: "string",
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
- AutomationStepSchema,
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: "number",
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: "boolean",
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: "LOGIC",
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: "ACTION",
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: "string",
24
- customType: "table",
26
+ type: AutomationIOType.STRING,
27
+ customType: AutomationCustomIOType.TABLE,
25
28
  title: "Table",
26
29
  },
27
30
  id: {
28
- type: "string",
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: "object",
38
- customType: "row",
40
+ type: AutomationIOType.OBJECT,
41
+ customType: AutomationCustomIOType.ROW,
39
42
  description: "The deleted row",
40
43
  },
41
44
  response: {
42
- type: "object",
45
+ type: AutomationIOType.OBJECT,
43
46
  description: "The response from the table",
44
47
  },
45
48
  success: {
46
- type: "boolean",
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: "ACTION",
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: "string",
27
+ type: AutomationIOType.STRING,
26
28
  title: "Discord Webhook URL",
27
29
  },
28
30
  username: {
29
- type: "string",
31
+ type: AutomationIOType.STRING,
30
32
  title: "Bot Name",
31
33
  },
32
34
  avatar_url: {
33
- type: "string",
35
+ type: AutomationIOType.STRING,
34
36
  title: "Bot Avatar URL",
35
37
  },
36
38
  content: {
37
- type: "string",
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: "number",
48
+ type: AutomationIOType.NUMBER,
47
49
  description: "The HTTP status code of the request",
48
50
  },
49
51
  response: {
50
- type: "string",
52
+ type: AutomationIOType.STRING,
51
53
  description: "The response from the Discord Webhook",
52
54
  },
53
55
  success: {
54
- type: "boolean",
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
- AutomationStepSchema,
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: "ACTION",
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: "object",
26
+ type: AutomationIOType.OBJECT,
24
27
  properties: {
25
28
  queryId: {
26
- type: "string",
27
- customType: "query",
29
+ type: AutomationIOType.STRING,
30
+ customType: AutomationCustomIOType.QUERY,
28
31
  },
29
32
  },
30
- customType: "queryParams",
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: "object",
43
+ type: AutomationIOType.OBJECT,
41
44
  description: "The response from the datasource execution",
42
45
  },
43
46
  info: {
44
- type: "object",
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: "boolean",
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
- AutomationStepSchema,
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: "ACTION",
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: "string",
24
- customType: "code",
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: "string",
36
+ type: AutomationIOType.STRING,
34
37
  description: "The result of the return statement",
35
38
  },
36
39
  success: {
37
- type: "boolean",
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: "LOGIC",
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: "string",
39
+ type: AutomationIOType.STRING,
38
40
  title: "Reference Value",
39
41
  },
40
42
  condition: {
41
- type: "string",
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: "string",
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: "boolean",
58
+ type: AutomationIOType.BOOLEAN,
57
59
  description: "Whether the action was successful",
58
60
  },
59
61
  result: {
60
- type: "boolean",
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: "ACTION",
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: "string",
25
+ type: AutomationIOType.STRING,
24
26
  title: "Webhook URL",
25
27
  },
26
28
  value1: {
27
- type: "string",
29
+ type: AutomationIOType.STRING,
28
30
  title: "Input Value 1",
29
31
  },
30
32
  value2: {
31
- type: "string",
33
+ type: AutomationIOType.STRING,
32
34
  title: "Input Value 2",
33
35
  },
34
36
  value3: {
35
- type: "string",
37
+ type: AutomationIOType.STRING,
36
38
  title: "Input Value 3",
37
39
  },
38
40
  value4: {
39
- type: "string",
41
+ type: AutomationIOType.STRING,
40
42
  title: "Input Value 4",
41
43
  },
42
44
  value5: {
43
- type: "string",
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: "boolean",
54
+ type: AutomationIOType.BOOLEAN,
53
55
  description: "Whether call was successful",
54
56
  },
55
57
  httpStatus: {
56
- type: "number",
58
+ type: AutomationIOType.NUMBER,
57
59
  description: "The HTTP status code returned",
58
60
  },
59
61
  response: {
60
- type: "object",
62
+ type: AutomationIOType.OBJECT,
61
63
  description: "The webhook response - this can have properties",
62
64
  },
63
65
  },
@@ -1,4 +1,10 @@
1
- import { AutomationActionStepId, AutomationStepSchema } from "@budibase/types"
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: "loopOption",
21
+ customType: AutomationCustomIOType.LOOP_OPTION,
16
22
  title: "Input type",
17
23
  },
18
24
  binding: {
19
- type: "string",
25
+ type: AutomationIOType.STRING,
20
26
  title: "Binding / Value",
21
27
  },
22
28
  iterations: {
23
- type: "number",
29
+ type: AutomationIOType.NUMBER,
24
30
  title: "Max loop iterations",
25
31
  },
26
32
  failure: {
27
- type: "string",
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: "item",
42
+ customType: AutomationCustomIOType.ITEM,
37
43
  description: "The item currently being executed",
38
44
  },
39
45
  success: {
40
- type: "boolean",
46
+ type: AutomationIOType.BOOLEAN,
41
47
  description: "Whether the message loop was successfully",
42
48
  },
43
49
  iterations: {
44
- type: "number",
45
- descriptions: "The amount of times the block ran",
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: "LOGIC",
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
- AutomationStepSchema,
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: "ACTION",
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: "string",
46
+ type: AutomationIOType.STRING,
44
47
  enum: Object.values(RequestType),
45
48
  title: "Request method",
46
49
  },
47
50
  url: {
48
- type: "string",
51
+ type: AutomationIOType.STRING,
49
52
  title: "URL",
50
53
  },
51
54
  requestBody: {
52
- type: "string",
55
+ type: AutomationIOType.STRING,
53
56
  title: "JSON Body",
54
- customType: "wide",
57
+ customType: AutomationCustomIOType.WIDE,
55
58
  },
56
59
  headers: {
57
- type: "string",
60
+ type: AutomationIOType.STRING,
58
61
  title: "Headers",
59
- customType: "wide",
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: "object",
70
+ type: AutomationIOType.OBJECT,
68
71
  description: "The response from the webhook",
69
72
  },
70
73
  httpStatus: {
71
- type: "number",
74
+ type: AutomationIOType.NUMBER,
72
75
  description: "The HTTP status code returned",
73
76
  },
74
77
  success: {
75
- type: "boolean",
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
- AutomationStepSchema,
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: "ACTION",
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: "string",
48
- customType: "table",
50
+ type: AutomationIOType.STRING,
51
+ customType: AutomationCustomIOType.TABLE,
49
52
  title: "Table",
50
53
  },
51
54
  filters: {
52
- type: "object",
53
- customType: "filters",
55
+ type: AutomationIOType.OBJECT,
56
+ customType: AutomationCustomIOType.FILTERS,
54
57
  title: "Filtering",
55
58
  },
56
59
  sortColumn: {
57
- type: "string",
60
+ type: AutomationIOType.STRING,
58
61
  title: "Sort Column",
59
- customType: "column",
62
+ customType: AutomationCustomIOType.COLUMN,
60
63
  },
61
64
  sortOrder: {
62
- type: "string",
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: "number",
71
+ type: AutomationIOType.NUMBER,
69
72
  title: "Limit",
70
- customType: "queryLimit",
73
+ customType: AutomationCustomIOType.QUERY_LIMIT,
71
74
  },
72
75
  onEmptyFilter: {
73
76
  pretty: Object.values(EmptyFilterOptionPretty),
74
77
  enum: Object.values(EmptyFilterOption),
75
- type: "string",
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: "array",
85
- customType: "rows",
87
+ type: AutomationIOType.ARRAY,
88
+ customType: AutomationCustomIOType.ROWS,
86
89
  description: "The rows that were found",
87
90
  },
88
91
  success: {
89
- type: "boolean",
92
+ type: AutomationIOType.BOOLEAN,
90
93
  description: "Whether the query was successful",
91
94
  },
92
95
  },