@budibase/server 0.9.167-alpha.4 → 0.9.167-alpha.8

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 (178) hide show
  1. package/builder/assets/{index.60f832ce.js → index.553837db.js} +34 -34
  2. package/builder/assets/{index.18ad7651.css → index.c4a1fb7f.css} +1 -1
  3. package/builder/assets/{vendor.60887453.js → vendor.278a305c.js} +1 -1
  4. package/builder/index.html +3 -3
  5. package/coverage/clover.xml +273 -245
  6. package/coverage/coverage-final.json +9 -8
  7. package/coverage/lcov-report/api/controllers/analytics.js.html +1 -1
  8. package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
  9. package/coverage/lcov-report/api/controllers/application.js.html +1 -1
  10. package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
  11. package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
  12. package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
  13. package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
  14. package/coverage/lcov-report/api/controllers/component.js.html +1 -1
  15. package/coverage/lcov-report/api/controllers/datasource.js.html +1 -1
  16. package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
  17. package/coverage/lcov-report/api/controllers/hosting.js.html +1 -1
  18. package/coverage/lcov-report/api/controllers/index.html +26 -26
  19. package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
  20. package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
  21. package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
  22. package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
  23. package/coverage/lcov-report/api/controllers/query.js.html +129 -24
  24. package/coverage/lcov-report/api/controllers/role.js.html +1 -1
  25. package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
  26. package/coverage/lcov-report/api/controllers/row/external.js.html +1 -1
  27. package/coverage/lcov-report/api/controllers/row/index.html +1 -1
  28. package/coverage/lcov-report/api/controllers/row/index.js.html +1 -1
  29. package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
  30. package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1 -1
  31. package/coverage/lcov-report/api/controllers/row/utils.js.html +1 -1
  32. package/coverage/lcov-report/api/controllers/screen.js.html +1 -1
  33. package/coverage/lcov-report/api/controllers/script.js.html +12 -57
  34. package/coverage/lcov-report/api/controllers/table/index.html +10 -10
  35. package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
  36. package/coverage/lcov-report/api/controllers/table/utils.js.html +8 -38
  37. package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
  38. package/coverage/lcov-report/api/controllers/user.js.html +1 -1
  39. package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
  40. package/coverage/lcov-report/api/controllers/view/index.html +1 -1
  41. package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
  42. package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
  43. package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
  44. package/coverage/lcov-report/api/controllers/webhook.js.html +1 -1
  45. package/coverage/lcov-report/api/index.html +1 -1
  46. package/coverage/lcov-report/api/index.js.html +1 -1
  47. package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
  48. package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
  49. package/coverage/lcov-report/api/routes/application.js.html +1 -1
  50. package/coverage/lcov-report/api/routes/auth.js.html +1 -1
  51. package/coverage/lcov-report/api/routes/automation.js.html +1 -1
  52. package/coverage/lcov-report/api/routes/backup.js.html +1 -1
  53. package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
  54. package/coverage/lcov-report/api/routes/component.js.html +1 -1
  55. package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
  56. package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
  57. package/coverage/lcov-report/api/routes/dev.js.html +1 -1
  58. package/coverage/lcov-report/api/routes/hosting.js.html +1 -1
  59. package/coverage/lcov-report/api/routes/index.html +1 -1
  60. package/coverage/lcov-report/api/routes/index.js.html +1 -1
  61. package/coverage/lcov-report/api/routes/integration.js.html +1 -1
  62. package/coverage/lcov-report/api/routes/layout.js.html +1 -1
  63. package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
  64. package/coverage/lcov-report/api/routes/permission.js.html +1 -1
  65. package/coverage/lcov-report/api/routes/query.js.html +9 -3
  66. package/coverage/lcov-report/api/routes/role.js.html +1 -1
  67. package/coverage/lcov-report/api/routes/routing.js.html +1 -1
  68. package/coverage/lcov-report/api/routes/row.js.html +1 -1
  69. package/coverage/lcov-report/api/routes/screen.js.html +1 -1
  70. package/coverage/lcov-report/api/routes/script.js.html +1 -1
  71. package/coverage/lcov-report/api/routes/static.js.html +1 -1
  72. package/coverage/lcov-report/api/routes/table.js.html +1 -1
  73. package/coverage/lcov-report/api/routes/templates.js.html +1 -1
  74. package/coverage/lcov-report/api/routes/user.js.html +1 -1
  75. package/coverage/lcov-report/api/routes/view.js.html +1 -1
  76. package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
  77. package/coverage/lcov-report/automations/actions.js.html +31 -10
  78. package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
  79. package/coverage/lcov-report/automations/bullboard.js.html +1 -1
  80. package/coverage/lcov-report/automations/index.html +19 -19
  81. package/coverage/lcov-report/automations/index.js.html +1 -1
  82. package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
  83. package/coverage/lcov-report/automations/steps/createRow.js.html +1 -1
  84. package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
  85. package/coverage/lcov-report/automations/steps/deleteRow.js.html +1 -1
  86. package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
  87. package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
  88. package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
  89. package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
  90. package/coverage/lcov-report/automations/steps/index.html +1 -1
  91. package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
  92. package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
  93. package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
  94. package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
  95. package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
  96. package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
  97. package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
  98. package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
  99. package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
  100. package/coverage/lcov-report/automations/thread.js.html +54 -12
  101. package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
  102. package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
  103. package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
  104. package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
  105. package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
  106. package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
  107. package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
  108. package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
  109. package/coverage/lcov-report/automations/triggers.js.html +1 -1
  110. package/coverage/lcov-report/automations/utils.js.html +1 -1
  111. package/coverage/lcov-report/constants/index.html +1 -1
  112. package/coverage/lcov-report/constants/index.js.html +1 -1
  113. package/coverage/lcov-report/constants/layouts.js.html +1 -1
  114. package/coverage/lcov-report/constants/screens.js.html +1 -1
  115. package/coverage/lcov-report/db/client.js.html +1 -1
  116. package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
  117. package/coverage/lcov-report/db/index.html +1 -1
  118. package/coverage/lcov-report/db/index.js.html +1 -1
  119. package/coverage/lcov-report/db/linkedRows/LinkController.js.html +12 -12
  120. package/coverage/lcov-report/db/linkedRows/index.html +1 -1
  121. package/coverage/lcov-report/db/linkedRows/index.js.html +9 -9
  122. package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +1 -1
  123. package/coverage/lcov-report/db/newid.js.html +1 -1
  124. package/coverage/lcov-report/db/utils.js.html +1 -1
  125. package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
  126. package/coverage/lcov-report/events/index.html +1 -1
  127. package/coverage/lcov-report/events/index.js.html +1 -1
  128. package/coverage/lcov-report/events/utils.js.html +1 -1
  129. package/coverage/lcov-report/index.html +37 -37
  130. package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
  131. package/coverage/lcov-report/integrations/tests/index.html +1 -1
  132. package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
  133. package/coverage/lcov-report/middleware/authorized.js.html +1 -1
  134. package/coverage/lcov-report/middleware/builder.js.html +1 -1
  135. package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
  136. package/coverage/lcov-report/middleware/index.html +1 -1
  137. package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
  138. package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
  139. package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
  140. package/coverage/lcov-report/middleware/usageQuota.js.html +1 -1
  141. package/coverage/lcov-report/utilities/bcrypt.js.html +1 -1
  142. package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
  143. package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
  144. package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
  145. package/coverage/lcov-report/utilities/global.js.html +1 -1
  146. package/coverage/lcov-report/utilities/index.html +22 -7
  147. package/coverage/lcov-report/utilities/index.js.html +1 -1
  148. package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
  149. package/coverage/lcov-report/utilities/queue/index.html +1 -1
  150. package/coverage/lcov-report/utilities/routing/index.html +1 -1
  151. package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
  152. package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
  153. package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
  154. package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
  155. package/coverage/lcov-report/utilities/scriptRunner.js.html +143 -0
  156. package/coverage/lcov-report/utilities/security.js.html +1 -1
  157. package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
  158. package/coverage/lcov-report/utilities/users.js.html +1 -1
  159. package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
  160. package/coverage/lcov.info +450 -402
  161. package/dist/api/controllers/query.js +26 -8
  162. package/dist/api/controllers/script.js +4 -16
  163. package/dist/api/controllers/table/utils.js +2 -10
  164. package/dist/api/routes/query.js +3 -1
  165. package/dist/automations/actions.js +9 -3
  166. package/dist/automations/thread.js +14 -3
  167. package/dist/package.json +5 -4
  168. package/dist/tsconfig.tsbuildinfo +1 -1
  169. package/dist/utilities/scriptRunner.js +19 -0
  170. package/package.json +6 -5
  171. package/src/api/controllers/query.js +46 -11
  172. package/src/api/controllers/script.js +4 -19
  173. package/src/api/controllers/table/utils.js +2 -12
  174. package/src/api/routes/query.js +3 -1
  175. package/src/automations/actions.js +10 -3
  176. package/src/automations/thread.js +17 -3
  177. package/src/integrations/tests/mongo.spec.js +10 -6
  178. package/src/utilities/scriptRunner.js +21 -0
@@ -14,6 +14,7 @@ const { generateQueryID, getQueryParams } = require("../../db/utils");
14
14
  const { integrations } = require("../../integrations");
15
15
  const { BaseQueryVerbs } = require("../../constants");
16
16
  const env = require("../../environment");
17
+ const ScriptRunner = require("../../utilities/scriptRunner");
17
18
  // simple function to append "readable" to all read queries
18
19
  function enrichQueries(input) {
19
20
  const wasArray = Array.isArray(input);
@@ -35,11 +36,29 @@ function formatResponse(resp) {
35
36
  resp = { response: resp };
36
37
  }
37
38
  }
38
- if (!Array.isArray(resp)) {
39
- resp = [resp];
40
- }
41
39
  return resp;
42
40
  }
41
+ function runAndTransform(integration, queryVerb, enrichedQuery, transformer) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ let rows = formatResponse(yield integration[queryVerb](enrichedQuery));
44
+ // transform as required
45
+ if (transformer) {
46
+ const runner = new ScriptRunner(transformer, { data: rows });
47
+ rows = runner.execute();
48
+ }
49
+ // needs to an array for next step
50
+ if (!Array.isArray(rows)) {
51
+ rows = [rows];
52
+ }
53
+ // map into JSON if just raw primitive here
54
+ if (rows.find(row => typeof row !== "object")) {
55
+ rows = rows.map(value => ({ value }));
56
+ }
57
+ // get all the potential fields in the schema
58
+ let keys = rows.flatMap(Object.keys);
59
+ return { rows, keys };
60
+ });
61
+ }
43
62
  exports.fetch = function (ctx) {
44
63
  return __awaiter(this, void 0, void 0, function* () {
45
64
  const db = new CouchDB(ctx.appId);
@@ -119,12 +138,10 @@ exports.preview = function (ctx) {
119
138
  if (!Integration) {
120
139
  ctx.throw(400, "Integration type does not exist.");
121
140
  }
122
- const { fields, parameters, queryVerb } = ctx.request.body;
141
+ const { fields, parameters, queryVerb, transformer } = ctx.request.body;
123
142
  const enrichedQuery = yield enrichQueryFields(fields, parameters);
124
143
  const integration = new Integration(datasource.config);
125
- const rows = formatResponse(yield integration[queryVerb](enrichedQuery));
126
- // get all the potential fields in the schema
127
- const keys = rows.flatMap(Object.keys);
144
+ const { rows, keys } = yield runAndTransform(integration, queryVerb, enrichedQuery, transformer);
128
145
  ctx.body = {
129
146
  rows,
130
147
  schemaFields: [...new Set(keys)],
@@ -147,7 +164,8 @@ exports.execute = function (ctx) {
147
164
  const enrichedQuery = yield enrichQueryFields(query.fields, ctx.request.body.parameters);
148
165
  const integration = new Integration(datasource.config);
149
166
  // call the relevant CRUD method on the integration class
150
- ctx.body = formatResponse(yield integration[query.queryVerb](enrichedQuery));
167
+ const { rows } = yield runAndTransform(integration, query.queryVerb, enrichedQuery, query.transformer);
168
+ ctx.body = rows;
151
169
  // cleanup
152
170
  if (integration.end) {
153
171
  integration.end();
@@ -8,24 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- const fetch = require("node-fetch");
12
- const vm = require("vm");
13
- class ScriptExecutor {
14
- constructor(body) {
15
- const code = `let fn = () => {\n${body.script}\n}; out = fn();`;
16
- this.script = new vm.Script(code);
17
- this.context = vm.createContext(body.context);
18
- this.context.fetch = fetch;
19
- }
20
- execute() {
21
- this.script.runInContext(this.context);
22
- return this.context.out;
23
- }
24
- }
11
+ const ScriptRunner = require("../../utilities/scriptRunner");
25
12
  exports.execute = function (ctx) {
26
13
  return __awaiter(this, void 0, void 0, function* () {
27
- const executor = new ScriptExecutor(ctx.request.body);
28
- ctx.body = executor.execute();
14
+ const { script, context } = ctx.request.body;
15
+ const runner = new ScriptRunner(script, context);
16
+ ctx.body = runner.execute();
29
17
  });
30
18
  };
31
19
  exports.save = function (ctx) {
@@ -9,7 +9,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  const CouchDB = require("../../../db");
12
- const linkRows = require("../../../db/linkedRows");
13
12
  const csvParser = require("../../../utilities/csvParser");
14
13
  const { getRowParams, generateRowID, InternalTables, } = require("../../../db/utils");
15
14
  const { isEqual } = require("lodash/fp");
@@ -86,16 +85,9 @@ exports.handleDataImport = (appId, user, table, dataImport) => __awaiter(void 0,
86
85
  ];
87
86
  }
88
87
  }
89
- // make sure link rows are up to date
90
- finalData.push(linkRows.updateLinks({
91
- appId,
92
- eventType: linkRows.EventType.ROW_SAVE,
93
- row,
94
- tableId: row.tableId,
95
- table,
96
- }));
88
+ finalData.push(row);
97
89
  }
98
- yield db.bulkDocs(yield Promise.all(finalData));
90
+ yield db.bulkDocs(finalData);
99
91
  let response = yield db.put(table);
100
92
  table._rev = response._rev;
101
93
  }
@@ -22,7 +22,8 @@ function generateQueryValidation() {
22
22
  })),
23
23
  queryVerb: Joi.string().allow().required(),
24
24
  extra: Joi.object().optional(),
25
- schema: Joi.object({}).required().unknown(true)
25
+ schema: Joi.object({}).required().unknown(true),
26
+ transformer: Joi.string().optional(),
26
27
  }));
27
28
  }
28
29
  function generateQueryPreviewValidation() {
@@ -32,6 +33,7 @@ function generateQueryPreviewValidation() {
32
33
  queryVerb: Joi.string().allow().required(),
33
34
  extra: Joi.object().optional(),
34
35
  datasourceId: Joi.string().required(),
36
+ transformer: Joi.string().optional(),
35
37
  parameters: Joi.object({}).required().unknown(true)
36
38
  }));
37
39
  }
@@ -13,7 +13,6 @@ const createRow = require("./steps/createRow");
13
13
  const updateRow = require("./steps/updateRow");
14
14
  const deleteRow = require("./steps/deleteRow");
15
15
  const executeScript = require("./steps/executeScript");
16
- const bash = require("./steps/bash");
17
16
  const executeQuery = require("./steps/executeQuery");
18
17
  const outgoingWebhook = require("./steps/outgoingWebhook");
19
18
  const serverLog = require("./steps/serverLog");
@@ -24,6 +23,7 @@ const integromat = require("./steps/integromat");
24
23
  let filter = require("./steps/filter");
25
24
  let delay = require("./steps/delay");
26
25
  let queryRow = require("./steps/queryRows");
26
+ const env = require("../environment");
27
27
  const ACTION_IMPLS = {
28
28
  SEND_EMAIL_SMTP: sendSmtpEmail.run,
29
29
  CREATE_ROW: createRow.run,
@@ -31,7 +31,6 @@ const ACTION_IMPLS = {
31
31
  DELETE_ROW: deleteRow.run,
32
32
  OUTGOING_WEBHOOK: outgoingWebhook.run,
33
33
  EXECUTE_SCRIPT: executeScript.run,
34
- EXECUTE_BASH: bash.run,
35
34
  EXECUTE_QUERY: executeQuery.run,
36
35
  SERVER_LOG: serverLog.run,
37
36
  DELAY: delay.run,
@@ -51,7 +50,6 @@ const ACTION_DEFINITIONS = {
51
50
  OUTGOING_WEBHOOK: outgoingWebhook.definition,
52
51
  EXECUTE_SCRIPT: executeScript.definition,
53
52
  EXECUTE_QUERY: executeQuery.definition,
54
- EXECUTE_BASH: bash.definition,
55
53
  SERVER_LOG: serverLog.definition,
56
54
  DELAY: delay.definition,
57
55
  FILTER: filter.definition,
@@ -62,6 +60,14 @@ const ACTION_DEFINITIONS = {
62
60
  zapier: zapier.definition,
63
61
  integromat: integromat.definition,
64
62
  };
63
+ // don't add the bash script/definitions unless in self host
64
+ // the fact this isn't included in any definitions means it cannot be
65
+ // ran at all
66
+ if (env.SELF_HOSTED) {
67
+ const bash = require("./steps/bash");
68
+ ACTION_IMPLS["EXECUTE_BASH"] = bash.run;
69
+ ACTION_DEFINITIONS["EXECUTE_BASH"] = bash.definition;
70
+ }
65
71
  /* istanbul ignore next */
66
72
  exports.getAction = function (actionName) {
67
73
  return __awaiter(this, void 0, void 0, function* () {
@@ -19,6 +19,7 @@ const { doInTenant } = require("@budibase/auth/tenancy");
19
19
  const env = require("../environment");
20
20
  const usage = require("../utilities/usageQuota");
21
21
  const FILTER_STEP_ID = actions.ACTION_DEFINITIONS.FILTER.stepId;
22
+ const STOPPED_STATUS = { success: false, status: "STOPPED" };
22
23
  /**
23
24
  * The automation orchestrator is a class responsible for executing automations.
24
25
  * It handles the context of the automation and makes sure each step gets the correct
@@ -77,7 +78,13 @@ class Orchestrator {
77
78
  return __awaiter(this, void 0, void 0, function* () {
78
79
  let automation = this._automation;
79
80
  const app = yield this.getApp();
81
+ let stopped = false;
80
82
  for (let step of automation.definition.steps) {
83
+ // execution stopped, record state for that
84
+ if (stopped) {
85
+ this.updateExecutionOutput(step.id, step.stepId, {}, STOPPED_STATUS);
86
+ continue;
87
+ }
81
88
  let stepFn = yield this.getStepFunctionality(step.stepId);
82
89
  step.inputs = yield processObject(step.inputs, this._context);
83
90
  step.inputs = automationUtils.cleanInputValues(step.inputs, step.schema.inputs);
@@ -92,10 +99,14 @@ class Orchestrator {
92
99
  context: this._context,
93
100
  });
94
101
  });
102
+ this._context.steps.push(outputs);
103
+ // if filter causes us to stop execution don't break the loop, set a var
104
+ // so that we can finish iterating through the steps and record that it stopped
95
105
  if (step.stepId === FILTER_STEP_ID && !outputs.success) {
96
- break;
106
+ stopped = true;
107
+ this.updateExecutionOutput(step.id, step.stepId, step.inputs, Object.assign(Object.assign({}, outputs), STOPPED_STATUS));
108
+ continue;
97
109
  }
98
- this._context.steps.push(outputs);
99
110
  this.updateExecutionOutput(step.id, step.stepId, step.inputs, outputs);
100
111
  }
101
112
  catch (err) {
@@ -105,7 +116,7 @@ class Orchestrator {
105
116
  }
106
117
  // Increment quota for automation runs
107
118
  if (!env.SELF_HOSTED && !isDevAppID(this._appId)) {
108
- usage.update(usage.Properties.AUTOMATION, 1);
119
+ yield usage.update(usage.Properties.AUTOMATION, 1);
109
120
  }
110
121
  return this.executionOutput;
111
122
  });
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/server",
3
3
  "email": "hi@budibase.com",
4
- "version": "0.9.167-alpha.3",
4
+ "version": "0.9.167-alpha.7",
5
5
  "description": "Budibase Web Server",
6
6
  "main": "src/index.js",
7
7
  "repository": {
@@ -68,9 +68,9 @@
68
68
  "author": "Budibase",
69
69
  "license": "AGPL-3.0-or-later",
70
70
  "dependencies": {
71
- "@budibase/auth": "^0.9.167-alpha.3",
72
- "@budibase/client": "^0.9.167-alpha.3",
73
- "@budibase/string-templates": "^0.9.167-alpha.3",
71
+ "@budibase/auth": "^0.9.167-alpha.7",
72
+ "@budibase/client": "^0.9.167-alpha.7",
73
+ "@budibase/string-templates": "^0.9.167-alpha.7",
74
74
  "@elastic/elasticsearch": "7.10.0",
75
75
  "@koa/router": "8.0.0",
76
76
  "@sendgrid/mail": "7.1.1",
@@ -119,6 +119,7 @@
119
119
  "to-json-schema": "0.2.5",
120
120
  "uuid": "3.3.2",
121
121
  "validate.js": "0.13.1",
122
+ "vm2": "^3.9.3",
122
123
  "yargs": "13.2.4",
123
124
  "zlib": "1.0.5"
124
125
  },