@budibase/server 0.9.169-alpha.9 → 0.9.172

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 (227) hide show
  1. package/builder/assets/{index.aafb155b.js → index.9ab01cd4.js} +34 -34
  2. package/builder/assets/{index.0ea76a5c.css → index.dbc6728e.css} +2 -2
  3. package/builder/assets/{vendor.2053eff2.js → vendor.54435e8f.js} +2 -2
  4. package/builder/index.html +3 -3
  5. package/coverage/clover.xml +517 -609
  6. package/coverage/coverage-final.json +31 -32
  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 +9 -6
  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 +17 -41
  17. package/coverage/lcov-report/api/controllers/hosting.js.html +1 -1
  18. package/coverage/lcov-report/api/controllers/index.html +45 -45
  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 +4 -7
  23. package/coverage/lcov-report/api/controllers/query.js.html +24 -129
  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 +5 -5
  28. package/coverage/lcov-report/api/controllers/row/index.js.html +15 -15
  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 +57 -12
  34. package/coverage/lcov-report/api/controllers/table/index.html +28 -28
  35. package/coverage/lcov-report/api/controllers/table/index.js.html +37 -16
  36. package/coverage/lcov-report/api/controllers/table/utils.js.html +33 -279
  37. package/coverage/lcov-report/api/controllers/templates.js.html +13 -49
  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 +8 -8
  43. package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +6 -6
  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 +11 -26
  58. package/coverage/lcov-report/api/routes/hosting.js.html +1 -1
  59. package/coverage/lcov-report/api/routes/index.html +9 -9
  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 +3 -9
  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 +10 -31
  78. package/coverage/lcov-report/automations/automationUtils.js.html +86 -14
  79. package/coverage/lcov-report/automations/bullboard.js.html +1 -1
  80. package/coverage/lcov-report/automations/index.html +25 -25
  81. package/coverage/lcov-report/automations/index.js.html +1 -1
  82. package/coverage/lcov-report/automations/steps/bash.js.html +7 -10
  83. package/coverage/lcov-report/automations/steps/createRow.js.html +2 -2
  84. package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
  85. package/coverage/lcov-report/automations/steps/deleteRow.js.html +5 -8
  86. package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
  87. package/coverage/lcov-report/automations/steps/executeQuery.js.html +7 -10
  88. package/coverage/lcov-report/automations/steps/executeScript.js.html +7 -10
  89. package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
  90. package/coverage/lcov-report/automations/steps/index.html +57 -57
  91. package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
  92. package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +7 -10
  93. package/coverage/lcov-report/automations/steps/queryRows.js.html +7 -10
  94. package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +7 -10
  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 +14 -14
  98. package/coverage/lcov-report/automations/steps/utils.js.html +10 -10
  99. package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
  100. package/coverage/lcov-report/automations/thread.js.html +12 -54
  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 +2 -5
  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 +69 -69
  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 +2 -2
  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 +2 -2
  146. package/coverage/lcov-report/utilities/index.html +7 -22
  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 +14 -14
  153. package/coverage/lcov-report/utilities/rowProcessor/index.js.html +8 -38
  154. package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
  155. package/coverage/lcov-report/utilities/security.js.html +1 -1
  156. package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
  157. package/coverage/lcov-report/utilities/users.js.html +1 -1
  158. package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
  159. package/coverage/lcov.info +848 -1026
  160. package/dist/api/controllers/backup.js +4 -4
  161. package/dist/api/controllers/dev.js +11 -17
  162. package/dist/api/controllers/permission.js +0 -1
  163. package/dist/api/controllers/query.js +8 -26
  164. package/dist/api/controllers/row/ExternalRequest.js +5 -46
  165. package/dist/api/controllers/script.js +16 -4
  166. package/dist/api/controllers/table/index.js +10 -5
  167. package/dist/api/controllers/table/utils.js +10 -83
  168. package/dist/api/controllers/templates.js +3 -18
  169. package/dist/api/routes/dev.js +4 -8
  170. package/dist/api/routes/query.js +1 -3
  171. package/dist/automations/actions.js +3 -9
  172. package/dist/automations/automationUtils.js +29 -8
  173. package/dist/automations/steps/bash.js +1 -2
  174. package/dist/automations/steps/createRow.js +1 -1
  175. package/dist/automations/steps/deleteRow.js +1 -2
  176. package/dist/automations/steps/executeQuery.js +1 -2
  177. package/dist/automations/steps/executeScript.js +1 -2
  178. package/dist/automations/steps/outgoingWebhook.js +1 -2
  179. package/dist/automations/steps/queryRows.js +1 -2
  180. package/dist/automations/steps/sendSmtpEmail.js +1 -2
  181. package/dist/automations/steps/updateRow.js +2 -6
  182. package/dist/automations/thread.js +3 -14
  183. package/dist/constants/index.js +0 -1
  184. package/dist/integrations/base/sql.js +4 -4
  185. package/dist/integrations/utils.js +1 -16
  186. package/dist/middleware/currentapp.js +1 -1
  187. package/dist/package.json +5 -6
  188. package/dist/tsconfig.tsbuildinfo +1 -1
  189. package/dist/utilities/fileSystem/index.js +33 -49
  190. package/dist/utilities/global.js +1 -1
  191. package/dist/utilities/rowProcessor/index.js +0 -8
  192. package/package.json +6 -7
  193. package/src/api/controllers/backup.js +5 -4
  194. package/src/api/controllers/dev.js +8 -16
  195. package/src/api/controllers/permission.js +0 -1
  196. package/src/api/controllers/query.js +11 -46
  197. package/src/api/controllers/row/ExternalRequest.ts +4 -49
  198. package/src/api/controllers/script.js +19 -4
  199. package/src/api/controllers/table/index.js +12 -5
  200. package/src/api/controllers/table/utils.js +12 -94
  201. package/src/api/controllers/templates.js +5 -17
  202. package/src/api/routes/dev.js +4 -9
  203. package/src/api/routes/query.js +1 -3
  204. package/src/automations/actions.js +3 -10
  205. package/src/automations/automationUtils.js +31 -7
  206. package/src/automations/steps/bash.js +1 -2
  207. package/src/automations/steps/createRow.js +1 -1
  208. package/src/automations/steps/deleteRow.js +1 -2
  209. package/src/automations/steps/executeQuery.js +1 -2
  210. package/src/automations/steps/executeScript.js +1 -2
  211. package/src/automations/steps/outgoingWebhook.js +1 -2
  212. package/src/automations/steps/queryRows.js +1 -2
  213. package/src/automations/steps/sendSmtpEmail.js +1 -2
  214. package/src/automations/steps/updateRow.js +6 -6
  215. package/src/automations/thread.js +3 -17
  216. package/src/constants/index.js +0 -1
  217. package/src/integrations/base/sql.ts +3 -5
  218. package/src/integrations/tests/mongo.spec.js +6 -10
  219. package/src/integrations/utils.ts +0 -15
  220. package/src/middleware/currentapp.js +1 -1
  221. package/src/middleware/tests/currentapp.spec.js +3 -3
  222. package/src/utilities/fileSystem/index.js +43 -65
  223. package/src/utilities/global.js +1 -1
  224. package/src/utilities/rowProcessor/index.js +0 -10
  225. package/coverage/lcov-report/utilities/scriptRunner.js.html +0 -143
  226. package/dist/utilities/scriptRunner.js +0 -19
  227. package/src/utilities/scriptRunner.js +0 -21
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  const scriptController = require("../../api/controllers/script");
12
12
  const { buildCtx } = require("./utils");
13
- const automationUtils = require("../automationUtils");
14
13
  exports.definition = {
15
14
  name: "JS Scripting",
16
15
  tagline: "Execute JavaScript Code",
@@ -72,7 +71,7 @@ exports.run = function ({ inputs, appId, context, emitter }) {
72
71
  catch (err) {
73
72
  return {
74
73
  success: false,
75
- response: automationUtils.getError(err),
74
+ response: err,
76
75
  };
77
76
  }
78
77
  });
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  const fetch = require("node-fetch");
12
12
  const { getFetchResponse } = require("./utils");
13
- const automationUtils = require("../automationUtils");
14
13
  const RequestType = {
15
14
  POST: "POST",
16
15
  GET: "GET",
@@ -131,7 +130,7 @@ exports.run = function ({ inputs }) {
131
130
  /* istanbul ignore next */
132
131
  return {
133
132
  success: false,
134
- response: automationUtils.getError(err),
133
+ response: err,
135
134
  };
136
135
  }
137
136
  });
@@ -12,7 +12,6 @@ const rowController = require("../../api/controllers/row");
12
12
  const tableController = require("../../api/controllers/table");
13
13
  const { FieldTypes } = require("../../constants");
14
14
  const { buildCtx } = require("./utils");
15
- const automationUtils = require("../automationUtils");
16
15
  const SortOrders = {
17
16
  ASCENDING: "ascending",
18
17
  DESCENDING: "descending",
@@ -120,7 +119,7 @@ exports.run = function ({ inputs, appId }) {
120
119
  catch (err) {
121
120
  return {
122
121
  success: false,
123
- response: automationUtils.getError(err),
122
+ response: err,
124
123
  };
125
124
  }
126
125
  });
@@ -9,7 +9,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  const { sendSmtpEmail } = require("../../utilities/workerRequests");
12
- const automationUtils = require("../automationUtils");
13
12
  exports.definition = {
14
13
  description: "Send an email using SMTP",
15
14
  tagline: "Send SMTP email to {{inputs.to}}",
@@ -72,7 +71,7 @@ exports.run = function ({ inputs }) {
72
71
  catch (err) {
73
72
  return {
74
73
  success: false,
75
- response: automationUtils.getError(err),
74
+ response: err,
76
75
  };
77
76
  }
78
77
  });
@@ -73,7 +73,6 @@ exports.run = function ({ inputs, appId, emitter }) {
73
73
  },
74
74
  };
75
75
  }
76
- const tableId = inputs.row.tableId;
77
76
  // clear any falsy properties so that they aren't updated
78
77
  for (let propKey of Object.keys(inputs.row)) {
79
78
  if (!inputs.row[propKey] || inputs.row[propKey] === "") {
@@ -85,13 +84,10 @@ exports.run = function ({ inputs, appId, emitter }) {
85
84
  body: Object.assign(Object.assign({}, inputs.row), { _id: inputs.rowId }),
86
85
  params: {
87
86
  rowId: inputs.rowId,
88
- tableId: tableId,
89
87
  },
90
88
  });
91
89
  try {
92
- if (tableId) {
93
- inputs.row = yield automationUtils.cleanUpRow(appId, tableId, inputs.row);
94
- }
90
+ inputs.row = yield automationUtils.cleanUpRowById(appId, inputs.rowId, inputs.row);
95
91
  yield rowController.patch(ctx);
96
92
  return {
97
93
  row: ctx.body,
@@ -104,7 +100,7 @@ exports.run = function ({ inputs, appId, emitter }) {
104
100
  catch (err) {
105
101
  return {
106
102
  success: false,
107
- response: automationUtils.getError(err),
103
+ response: err,
108
104
  };
109
105
  }
110
106
  });
@@ -19,7 +19,6 @@ 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" };
23
22
  /**
24
23
  * The automation orchestrator is a class responsible for executing automations.
25
24
  * It handles the context of the automation and makes sure each step gets the correct
@@ -78,13 +77,7 @@ class Orchestrator {
78
77
  return __awaiter(this, void 0, void 0, function* () {
79
78
  let automation = this._automation;
80
79
  const app = yield this.getApp();
81
- let stopped = false;
82
80
  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
- }
88
81
  let stepFn = yield this.getStepFunctionality(step.stepId);
89
82
  step.inputs = yield processObject(step.inputs, this._context);
90
83
  step.inputs = automationUtils.cleanInputValues(step.inputs, step.schema.inputs);
@@ -99,14 +92,10 @@ class Orchestrator {
99
92
  context: this._context,
100
93
  });
101
94
  });
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
105
95
  if (step.stepId === FILTER_STEP_ID && !outputs.success) {
106
- stopped = true;
107
- this.updateExecutionOutput(step.id, step.stepId, step.inputs, Object.assign(Object.assign({}, outputs), STOPPED_STATUS));
108
- continue;
96
+ break;
109
97
  }
98
+ this._context.steps.push(outputs);
110
99
  this.updateExecutionOutput(step.id, step.stepId, step.inputs, outputs);
111
100
  }
112
101
  catch (err) {
@@ -116,7 +105,7 @@ class Orchestrator {
116
105
  }
117
106
  // Increment quota for automation runs
118
107
  if (!env.SELF_HOSTED && !isDevAppID(this._appId)) {
119
- yield usage.update(usage.Properties.AUTOMATION, 1);
108
+ usage.update(usage.Properties.AUTOMATION, 1);
120
109
  }
121
110
  return this.executionOutput;
122
111
  });
@@ -39,7 +39,6 @@ exports.FieldTypes = {
39
39
  FORMULA: "formula",
40
40
  AUTO: "auto",
41
41
  JSON: "json",
42
- INTERNAL: "internal",
43
42
  };
44
43
  exports.RelationshipTypes = {
45
44
  ONE_TO_MANY: "one-to-many",
@@ -80,7 +80,7 @@ function addFilters(tableName, query, filters) {
80
80
  }
81
81
  return query;
82
82
  }
83
- function addRelationships(knex, query, fields, fromTable, relationships) {
83
+ function addRelationships(query, fromTable, relationships) {
84
84
  if (!relationships) {
85
85
  return query;
86
86
  }
@@ -88,7 +88,7 @@ function addRelationships(knex, query, fields, fromTable, relationships) {
88
88
  const from = relationship.from, to = relationship.to, toTable = relationship.tableName;
89
89
  if (!relationship.through) {
90
90
  // @ts-ignore
91
- query = query.leftJoin(toTable, `${fromTable}.${from}`, `${toTable}.${to}`);
91
+ query = query.leftJoin(toTable, `${fromTable}.${from}`, `${relationship.tableName}.${to}`);
92
92
  }
93
93
  else {
94
94
  const throughTable = relationship.through;
@@ -100,7 +100,7 @@ function addRelationships(knex, query, fields, fromTable, relationships) {
100
100
  .leftJoin(toTable, `${toTable}.${toPrimary}`, `${throughTable}.${to}`);
101
101
  }
102
102
  }
103
- return query.limit(BASE_LIMIT);
103
+ return query;
104
104
  }
105
105
  function buildCreate(knex, json, opts) {
106
106
  const { endpoint, body } = json;
@@ -165,7 +165,7 @@ function buildRead(knex, json, limit) {
165
165
  [tableName]: query,
166
166
  }).select(selectStatement);
167
167
  // handle joins
168
- return addRelationships(knex, preQuery, selectStatement, tableName, relationships);
168
+ return addRelationships(preQuery, tableName, relationships);
169
169
  }
170
170
  function buildUpdate(knex, json, opts) {
171
171
  const { endpoint, body, filters } = json;
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.copyExistingPropsOver = exports.isIsoDateString = exports.isSQL = exports.getSqlQuery = exports.convertType = exports.breakRowIdField = exports.convertRowId = exports.isRowId = exports.generateRowIdField = exports.breakExternalTableId = exports.buildExternalTableId = exports.isExternalTable = void 0;
3
+ exports.copyExistingPropsOver = exports.isIsoDateString = exports.isSQL = exports.getSqlQuery = exports.convertType = exports.breakRowIdField = exports.generateRowIdField = exports.breakExternalTableId = exports.buildExternalTableId = exports.isExternalTable = void 0;
4
4
  const datasource_1 = require("../definitions/datasource");
5
5
  const { DocumentTypes, SEPARATOR } = require("../db/utils");
6
6
  const { FieldTypes } = require("../constants");
7
7
  const DOUBLE_SEPARATOR = `${SEPARATOR}${SEPARATOR}`;
8
- const ROW_ID_REGEX = /^\[.*]$/g;
9
8
  function isExternalTable(tableId) {
10
9
  return tableId.includes(DocumentTypes.DATASOURCE);
11
10
  }
@@ -32,20 +31,6 @@ function generateRowIdField(keyProps = []) {
32
31
  return encodeURIComponent(JSON.stringify(keyProps).replace(/"/g, "'"));
33
32
  }
34
33
  exports.generateRowIdField = generateRowIdField;
35
- function isRowId(field) {
36
- return Array.isArray(field) || (typeof field === "string" && field.match(ROW_ID_REGEX) != null);
37
- }
38
- exports.isRowId = isRowId;
39
- function convertRowId(field) {
40
- if (Array.isArray(field)) {
41
- return field[0];
42
- }
43
- if (typeof field === "string" && field.match(ROW_ID_REGEX) != null) {
44
- return field.substring(1, field.length - 1);
45
- }
46
- return field;
47
- }
48
- exports.convertRowId = convertRowId;
49
34
  // should always return an array
50
35
  function breakRowIdField(_id) {
51
36
  if (!_id) {
@@ -53,7 +53,7 @@ module.exports = (ctx, next) => __awaiter(void 0, void 0, void 0, function* () {
53
53
  const globalUser = yield getCachedSelf(ctx, requestAppId);
54
54
  appId = requestAppId;
55
55
  // retrieving global user gets the right role
56
- roleId = globalUser.roleId || roleId;
56
+ roleId = globalUser.roleId || BUILTIN_ROLE_IDS.BASIC;
57
57
  }
58
58
  // nothing more to do
59
59
  if (!appId) {
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.169-alpha.8",
4
+ "version": "0.9.171",
5
5
  "description": "Budibase Web Server",
6
6
  "main": "src/index.js",
7
7
  "repository": {
@@ -68,13 +68,13 @@
68
68
  "author": "Budibase",
69
69
  "license": "AGPL-3.0-or-later",
70
70
  "dependencies": {
71
- "@budibase/auth": "^0.9.169-alpha.8",
72
- "@budibase/client": "^0.9.169-alpha.8",
73
- "@budibase/string-templates": "^0.9.169-alpha.8",
71
+ "@budibase/auth": "^0.9.171",
72
+ "@budibase/client": "^0.9.171",
73
+ "@budibase/string-templates": "^0.9.171",
74
74
  "@elastic/elasticsearch": "7.10.0",
75
75
  "@koa/router": "8.0.0",
76
76
  "@sendgrid/mail": "7.1.1",
77
- "@sentry/node": "^6.0.0",
77
+ "@sentry/node": "5.19.2",
78
78
  "airtable": "0.10.1",
79
79
  "arangojs": "7.2.0",
80
80
  "aws-sdk": "^2.767.0",
@@ -119,7 +119,6 @@
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",
123
122
  "yargs": "13.2.4",
124
123
  "zlib": "1.0.5"
125
124
  },