@budibase/server 1.0.219 → 1.0.220-alpha.0

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 (275) hide show
  1. package/__mocks__/node-fetch.ts +9 -0
  2. package/builder/assets/index.530f60fc.js +978 -0
  3. package/builder/assets/index.7786f497.css +6 -0
  4. package/builder/assets/{vendor.9bf2fcb4.js → vendor.001dcf8c.js} +163 -163
  5. package/builder/index.html +3 -3
  6. package/coverage/clover.xml +927 -832
  7. package/coverage/coverage-final.json +29 -29
  8. package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
  9. package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
  10. package/coverage/lcov-report/api/controllers/automation.js.html +111 -12
  11. package/coverage/lcov-report/api/controllers/backup.js.html +9 -6
  12. package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
  13. package/coverage/lcov-report/api/controllers/component.js.html +1 -1
  14. package/coverage/lcov-report/api/controllers/datasource.js.html +16 -16
  15. package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
  16. package/coverage/lcov-report/api/controllers/index.html +21 -21
  17. package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
  18. package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
  19. package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
  20. package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
  21. package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
  22. package/coverage/lcov-report/api/controllers/query/index.html +1 -1
  23. package/coverage/lcov-report/api/controllers/query/validation.js.html +1 -1
  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 +47 -17
  27. package/coverage/lcov-report/api/controllers/row/index.html +33 -33
  28. package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
  29. package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +159 -21
  30. package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
  31. package/coverage/lcov-report/api/controllers/row/utils.js.html +17 -8
  32. package/coverage/lcov-report/api/controllers/screen.js.html +1 -1
  33. package/coverage/lcov-report/api/controllers/script.js.html +1 -1
  34. package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
  35. package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
  36. package/coverage/lcov-report/api/controllers/table/index.html +1 -1
  37. package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
  38. package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
  39. package/coverage/lcov-report/api/controllers/user.js.html +1 -1
  40. package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
  41. package/coverage/lcov-report/api/controllers/view/index.html +1 -1
  42. package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
  43. package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
  44. package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
  45. package/coverage/lcov-report/api/controllers/webhook.js.html +1 -1
  46. package/coverage/lcov-report/api/index.html +15 -15
  47. package/coverage/lcov-report/api/index.js.html +22 -13
  48. package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
  49. package/coverage/lcov-report/api/routes/apikeys.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 +32 -2
  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/index.html +1 -1
  59. package/coverage/lcov-report/api/routes/integration.js.html +1 -1
  60. package/coverage/lcov-report/api/routes/layout.js.html +1 -1
  61. package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
  62. package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
  63. package/coverage/lcov-report/api/routes/permission.js.html +1 -1
  64. package/coverage/lcov-report/api/routes/query.js.html +1 -1
  65. package/coverage/lcov-report/api/routes/role.js.html +1 -1
  66. package/coverage/lcov-report/api/routes/routing.js.html +1 -1
  67. package/coverage/lcov-report/api/routes/screen.js.html +1 -1
  68. package/coverage/lcov-report/api/routes/script.js.html +1 -1
  69. package/coverage/lcov-report/api/routes/table.js.html +1 -1
  70. package/coverage/lcov-report/api/routes/templates.js.html +1 -1
  71. package/coverage/lcov-report/api/routes/user.js.html +1 -1
  72. package/coverage/lcov-report/api/routes/utils/index.html +1 -1
  73. package/coverage/lcov-report/api/routes/utils/validators.js.html +5 -2
  74. package/coverage/lcov-report/api/routes/view.js.html +1 -1
  75. package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
  76. package/coverage/lcov-report/automations/actions.js.html +1 -1
  77. package/coverage/lcov-report/automations/automationUtils.js.html +57 -12
  78. package/coverage/lcov-report/automations/bullboard.js.html +1 -1
  79. package/coverage/lcov-report/automations/index.html +17 -17
  80. package/coverage/lcov-report/automations/index.js.html +1 -1
  81. package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
  82. package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
  83. package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
  84. package/coverage/lcov-report/automations/steps/executeQuery.js.html +2 -2
  85. package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
  86. package/coverage/lcov-report/automations/steps/filter.js.html +58 -34
  87. package/coverage/lcov-report/automations/steps/index.html +11 -11
  88. package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
  89. package/coverage/lcov-report/automations/steps/loop.js.html +1 -1
  90. package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
  91. package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
  92. package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
  93. package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
  94. package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
  95. package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
  96. package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
  97. package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
  98. package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
  99. package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
  100. package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
  101. package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
  102. package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
  103. package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
  104. package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
  105. package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
  106. package/coverage/lcov-report/automations/triggers.js.html +4 -4
  107. package/coverage/lcov-report/constants/index.html +1 -1
  108. package/coverage/lcov-report/constants/index.js.html +1 -1
  109. package/coverage/lcov-report/constants/layouts.js.html +1 -1
  110. package/coverage/lcov-report/constants/screens.js.html +1 -1
  111. package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
  112. package/coverage/lcov-report/db/index.html +14 -14
  113. package/coverage/lcov-report/db/index.js.html +1 -1
  114. package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
  115. package/coverage/lcov-report/db/linkedRows/index.html +13 -13
  116. package/coverage/lcov-report/db/linkedRows/index.js.html +10 -7
  117. package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +1 -1
  118. package/coverage/lcov-report/db/newid.js.html +2 -2
  119. package/coverage/lcov-report/db/utils.js.html +27 -51
  120. package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
  121. package/coverage/lcov-report/events/index.html +1 -1
  122. package/coverage/lcov-report/events/index.js.html +1 -1
  123. package/coverage/lcov-report/events/utils.js.html +1 -1
  124. package/coverage/lcov-report/index.html +81 -81
  125. package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
  126. package/coverage/lcov-report/integrations/tests/index.html +1 -1
  127. package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
  128. package/coverage/lcov-report/middleware/builder.js.html +12 -12
  129. package/coverage/lcov-report/middleware/currentapp.js.html +33 -33
  130. package/coverage/lcov-report/middleware/index.html +1 -1
  131. package/coverage/lcov-report/middleware/joi-validator.js.html +10 -10
  132. package/coverage/lcov-report/middleware/publicApi.js.html +1 -1
  133. package/coverage/lcov-report/middleware/resourceId.js.html +7 -7
  134. package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
  135. package/coverage/lcov-report/middleware/utils.js.html +2 -2
  136. package/coverage/lcov-report/threads/automation.js.html +18 -9
  137. package/coverage/lcov-report/threads/index.html +25 -25
  138. package/coverage/lcov-report/threads/query.js.html +301 -79
  139. package/coverage/lcov-report/threads/utils.js.html +4 -4
  140. package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
  141. package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
  142. package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
  143. package/coverage/lcov-report/utilities/global.js.html +14 -14
  144. package/coverage/lcov-report/utilities/index.html +16 -16
  145. package/coverage/lcov-report/utilities/index.js.html +9 -9
  146. package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +2 -2
  147. package/coverage/lcov-report/utilities/queue/index.html +1 -1
  148. package/coverage/lcov-report/utilities/routing/index.html +1 -1
  149. package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
  150. package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
  151. package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
  152. package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
  153. package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
  154. package/coverage/lcov-report/utilities/security.js.html +2 -2
  155. package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
  156. package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
  157. package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
  158. package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
  159. package/coverage/lcov-report/utilities/users.js.html +1 -1
  160. package/coverage/lcov-report/utilities/workerRequests.js.html +57 -9
  161. package/coverage/lcov.info +1656 -1489
  162. package/dist/api/controllers/application.js +18 -15
  163. package/dist/api/controllers/automation.js +28 -2
  164. package/dist/api/controllers/backup.js +3 -2
  165. package/dist/api/controllers/public/applications.js +1 -1
  166. package/dist/api/controllers/public/utils.js +8 -1
  167. package/dist/api/controllers/query/index.js +31 -3
  168. package/dist/api/controllers/row/external.js +19 -7
  169. package/dist/api/controllers/row/internalSearch.js +47 -10
  170. package/dist/api/controllers/row/utils.js +3 -0
  171. package/dist/api/index.js +4 -1
  172. package/dist/api/routes/automation.js +2 -0
  173. package/dist/api/routes/public/rows.js +7 -2
  174. package/dist/api/routes/utils/validators.js +1 -0
  175. package/dist/app.js +20 -0
  176. package/dist/automations/automationUtils.js +16 -4
  177. package/dist/automations/logging/index.js +70 -0
  178. package/dist/automations/steps/executeQuery.js +1 -1
  179. package/dist/automations/steps/filter.js +38 -29
  180. package/dist/automations/triggers.js +1 -1
  181. package/dist/db/linkedRows/index.js +1 -0
  182. package/dist/db/utils.js +4 -31
  183. package/dist/definitions/datasource.js +1 -0
  184. package/dist/environment.js +3 -0
  185. package/dist/integrations/airtable.js +1 -0
  186. package/dist/integrations/arangodb.js +1 -0
  187. package/dist/integrations/base/sql.js +22 -3
  188. package/dist/integrations/couchdb.js +1 -0
  189. package/dist/integrations/dynamodb.js +1 -0
  190. package/dist/integrations/elasticsearch.js +1 -0
  191. package/dist/integrations/firebase.js +1 -0
  192. package/dist/integrations/googlesheets.js +1 -0
  193. package/dist/integrations/index.js +4 -0
  194. package/dist/integrations/microsoftSqlServer.js +2 -1
  195. package/dist/integrations/mongodb.js +1 -0
  196. package/dist/integrations/mysql.js +2 -1
  197. package/dist/integrations/oracle.js +1 -0
  198. package/dist/integrations/postgres.js +2 -1
  199. package/dist/integrations/queries/sql.js +3 -0
  200. package/dist/integrations/redis.js +1 -0
  201. package/dist/integrations/rest.js +2 -1
  202. package/dist/integrations/s3.js +1 -0
  203. package/dist/integrations/snowflake.js +102 -0
  204. package/dist/package.json +7 -6
  205. package/dist/tests/utilities/TestConfiguration.js +19 -6
  206. package/dist/threads/automation.js +6 -3
  207. package/dist/threads/index.js +15 -1
  208. package/dist/threads/query.js +65 -12
  209. package/dist/tsconfig.build.tsbuildinfo +1 -1
  210. package/dist/utilities/fileSystem/index.js +16 -6
  211. package/dist/utilities/workerRequests.js +8 -0
  212. package/package.json +8 -7
  213. package/scripts/dev/manage.js +2 -0
  214. package/scripts/integrations/oracle/instantclient/linux/arm64/basiclite-19.10.zip +0 -0
  215. package/scripts/integrations/oracle/instantclient/linux/arm64/install.sh +23 -0
  216. package/scripts/integrations/oracle/instantclient/linux/install.sh +10 -0
  217. package/specs/openapi.json +9 -5
  218. package/specs/openapi.yaml +10 -4
  219. package/src/api/controllers/application.ts +18 -14
  220. package/src/api/controllers/automation.js +35 -2
  221. package/src/api/controllers/backup.js +3 -2
  222. package/src/api/controllers/public/applications.ts +2 -2
  223. package/src/api/controllers/public/utils.ts +8 -1
  224. package/src/api/controllers/query/index.ts +40 -4
  225. package/src/api/controllers/row/external.js +19 -9
  226. package/src/api/controllers/row/internalSearch.js +55 -9
  227. package/src/api/controllers/row/utils.js +3 -0
  228. package/src/api/index.js +4 -1
  229. package/src/api/routes/automation.js +10 -0
  230. package/src/api/routes/public/rows.ts +7 -2
  231. package/src/api/routes/tests/query.spec.js +166 -1
  232. package/src/api/routes/utils/validators.js +1 -0
  233. package/src/app.ts +30 -1
  234. package/src/automations/automationUtils.js +19 -4
  235. package/src/automations/logging/index.ts +35 -0
  236. package/src/automations/steps/executeQuery.js +1 -1
  237. package/src/automations/steps/filter.js +36 -28
  238. package/src/automations/tests/filter.spec.js +2 -1
  239. package/src/automations/triggers.js +1 -1
  240. package/src/db/linkedRows/index.js +1 -0
  241. package/src/db/utils.js +5 -13
  242. package/src/definitions/common.ts +1 -0
  243. package/src/definitions/datasource.ts +2 -0
  244. package/src/definitions/openapi.ts +471 -469
  245. package/src/environment.js +3 -0
  246. package/src/integrations/airtable.ts +1 -0
  247. package/src/integrations/arangodb.ts +1 -0
  248. package/src/integrations/base/sql.ts +29 -11
  249. package/src/integrations/couchdb.ts +1 -0
  250. package/src/integrations/dynamodb.ts +1 -0
  251. package/src/integrations/elasticsearch.ts +1 -0
  252. package/src/integrations/firebase.ts +1 -0
  253. package/src/integrations/googlesheets.ts +1 -0
  254. package/src/integrations/index.ts +4 -0
  255. package/src/integrations/microsoftSqlServer.ts +2 -0
  256. package/src/integrations/mongodb.ts +1 -0
  257. package/src/integrations/mysql.ts +2 -0
  258. package/src/integrations/oracle.ts +1 -0
  259. package/src/integrations/postgres.ts +2 -0
  260. package/src/integrations/queries/sql.ts +3 -1
  261. package/src/integrations/redis.ts +1 -0
  262. package/src/integrations/rest.ts +2 -1
  263. package/src/integrations/s3.ts +1 -0
  264. package/src/integrations/snowflake.ts +99 -0
  265. package/src/integrations/tests/rest.spec.js +16 -1
  266. package/src/migrations/tests/index.spec.ts +18 -2
  267. package/src/module.d.ts +2 -0
  268. package/src/tests/utilities/TestConfiguration.js +22 -3
  269. package/src/threads/automation.js +6 -3
  270. package/src/threads/index.ts +5 -1
  271. package/src/threads/query.js +88 -14
  272. package/src/utilities/fileSystem/index.js +22 -8
  273. package/src/utilities/workerRequests.js +16 -0
  274. package/builder/assets/index.1c640a53.js +0 -1316
  275. package/builder/assets/index.24307ca0.css +0 -6
@@ -33,7 +33,8 @@ const { getTenantId, isMultiTenant } = require("@budibase/backend-core/tenancy")
33
33
  const user_1 = require("./user");
34
34
  const { app: appCache } = require("@budibase/backend-core/cache");
35
35
  const utils_2 = require("../../automations/utils");
36
- const { getAppDB, getProdAppDB, updateAppId, } = require("@budibase/backend-core/context");
36
+ const logging_1 = require("../../automations/logging");
37
+ const { getAppDB, getProdAppDB, updateAppId, doInAppContext, } = require("@budibase/backend-core/context");
37
38
  const rows_1 = require("../../utilities/usageQuota/rows");
38
39
  const pro_1 = require("@budibase/pro");
39
40
  const backend_core_1 = require("@budibase/backend-core");
@@ -159,7 +160,7 @@ const fetch = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
159
160
  }
160
161
  }
161
162
  }
162
- ctx.body = apps;
163
+ ctx.body = yield (0, logging_1.checkAppMetadata)(apps);
163
164
  });
164
165
  exports.fetch = fetch;
165
166
  const fetchAppDefinition = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
@@ -486,19 +487,21 @@ const sync = (ctx, next) => __awaiter(void 0, void 0, void 0, function* () {
486
487
  });
487
488
  exports.sync = sync;
488
489
  const updateAppPackage = (appPackage, appId) => __awaiter(void 0, void 0, void 0, function* () {
489
- const db = getAppDB();
490
- const application = yield db.get(utils_1.DocumentTypes.APP_METADATA);
491
- const newAppPackage = Object.assign(Object.assign({}, application), appPackage);
492
- if (appPackage._rev !== application._rev) {
493
- newAppPackage._rev = application._rev;
494
- }
495
- // the locked by property is attached by server but generated from
496
- // Redis, shouldn't ever store it
497
- delete newAppPackage.lockedBy;
498
- yield db.put(newAppPackage);
499
- // remove any cached metadata, so that it will be updated
500
- yield appCache.invalidateAppMetadata(appId);
501
- return newAppPackage;
490
+ return doInAppContext(appId, () => __awaiter(void 0, void 0, void 0, function* () {
491
+ const db = getAppDB();
492
+ const application = yield db.get(utils_1.DocumentTypes.APP_METADATA);
493
+ const newAppPackage = Object.assign(Object.assign({}, application), appPackage);
494
+ if (appPackage._rev !== application._rev) {
495
+ newAppPackage._rev = application._rev;
496
+ }
497
+ // the locked by property is attached by server but generated from
498
+ // Redis, shouldn't ever store it
499
+ delete newAppPackage.lockedBy;
500
+ yield db.put(newAppPackage);
501
+ // remove any cached metadata, so that it will be updated
502
+ yield appCache.invalidateAppMetadata(appId);
503
+ return newAppPackage;
504
+ }));
502
505
  });
503
506
  const createEmptyAppPackage = (ctx, app) => __awaiter(void 0, void 0, void 0, function* () {
504
507
  const db = getAppDB();
@@ -10,13 +10,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  const actions = require("../../automations/actions");
12
12
  const triggers = require("../../automations/triggers");
13
- const { getAutomationParams, generateAutomationID } = require("../../db/utils");
13
+ const { getAutomationParams, generateAutomationID, DocumentTypes, } = require("../../db/utils");
14
14
  const { checkForWebhooks, updateTestHistory, removeDeprecated, } = require("../../automations/utils");
15
15
  const { deleteEntityMetadata } = require("../../utilities");
16
16
  const { MetadataTypes } = require("../../constants");
17
17
  const { setTestFlag, clearTestFlag } = require("../../utilities/redis");
18
- const { getAppDB } = require("@budibase/backend-core/context");
18
+ const { getAppDB, getProdAppDB, doInAppContext, } = require("@budibase/backend-core/context");
19
19
  const { events } = require("@budibase/backend-core");
20
+ const { app } = require("@budibase/backend-core/cache");
21
+ const { automations } = require("@budibase/pro");
20
22
  const ACTION_DEFS = removeDeprecated(actions.ACTION_DEFINITIONS);
21
23
  const TRIGGER_DEFS = removeDeprecated(triggers.TRIGGER_DEFINITIONS);
22
24
  /*************************
@@ -162,6 +164,30 @@ exports.destroy = function (ctx) {
162
164
  yield events.automation.deleted(oldAutomation);
163
165
  });
164
166
  };
167
+ exports.logSearch = function (ctx) {
168
+ return __awaiter(this, void 0, void 0, function* () {
169
+ ctx.body = yield automations.logs.logSearch(ctx.request.body);
170
+ });
171
+ };
172
+ exports.clearLogError = function (ctx) {
173
+ return __awaiter(this, void 0, void 0, function* () {
174
+ const { automationId, appId } = ctx.request.body;
175
+ yield doInAppContext(appId, () => __awaiter(this, void 0, void 0, function* () {
176
+ const db = getProdAppDB();
177
+ const metadata = yield db.get(DocumentTypes.APP_METADATA);
178
+ if (!automationId) {
179
+ delete metadata.automationErrors;
180
+ }
181
+ else if (metadata.automationErrors &&
182
+ metadata.automationErrors[automationId]) {
183
+ delete metadata.automationErrors[automationId];
184
+ }
185
+ yield db.put(metadata);
186
+ yield app.invalidateAppMetadata(metadata.appId, metadata);
187
+ ctx.body = { message: `Error logs cleared.` };
188
+ }));
189
+ });
190
+ };
165
191
  exports.getActionList = function (ctx) {
166
192
  return __awaiter(this, void 0, void 0, function* () {
167
193
  ctx.body = ACTION_DEFS;
@@ -13,11 +13,12 @@ const { events, context } = require("@budibase/backend-core");
13
13
  const { DocumentTypes } = require("../../db/utils");
14
14
  exports.exportAppDump = function (ctx) {
15
15
  return __awaiter(this, void 0, void 0, function* () {
16
- const { appId } = ctx.query;
16
+ let { appId, excludeRows } = ctx.query;
17
17
  const appName = decodeURI(ctx.query.appname);
18
+ excludeRows = excludeRows === "true";
18
19
  const backupIdentifier = `${appName}-export-${new Date().getTime()}.txt`;
19
20
  ctx.attachment(backupIdentifier);
20
- ctx.body = yield streamBackup(appId);
21
+ ctx.body = yield streamBackup(appId, excludeRows);
21
22
  yield context.doInAppContext(appId, () => __awaiter(this, void 0, void 0, function* () {
22
23
  const appDb = context.getAppDB();
23
24
  const app = yield appDb.get(DocumentTypes.APP_METADATA);
@@ -84,7 +84,7 @@ function read(ctx, next) {
84
84
  exports.read = read;
85
85
  function update(ctx, next) {
86
86
  return __awaiter(this, void 0, void 0, function* () {
87
- ctx.request.body = fixAppID(ctx.request.body, ctx.params);
87
+ ctx.request.body = yield (0, utils_1.addRev)(fixAppID(ctx.request.body, ctx.params));
88
88
  updateAppId(ctx.params.appId);
89
89
  yield controller.update(ctx);
90
90
  yield setResponseApp(ctx);
@@ -12,14 +12,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.search = exports.addRev = void 0;
13
13
  const { getAppDB } = require("@budibase/backend-core/context");
14
14
  const utils_1 = require("../../../integrations/utils");
15
+ const utils_2 = require("../../../db/utils");
15
16
  function addRev(body, tableId) {
16
17
  return __awaiter(this, void 0, void 0, function* () {
17
18
  if (!body._id || (tableId && (0, utils_1.isExternalTable)(tableId))) {
18
19
  return body;
19
20
  }
21
+ let id = body._id;
22
+ if (body._id.startsWith(utils_2.APP_PREFIX)) {
23
+ id = utils_2.DocumentTypes.APP_METADATA;
24
+ }
20
25
  const db = getAppDB();
21
- const dbDoc = yield db.get(body._id);
26
+ const dbDoc = yield db.get(id);
22
27
  body._rev = dbDoc._rev;
28
+ // update ID in case it is an app ID
29
+ body._id = id;
23
30
  return body;
24
31
  });
25
32
  }
@@ -20,6 +20,8 @@ const environment_1 = require("../../../environment");
20
20
  const context_1 = require("@budibase/backend-core/context");
21
21
  const pro_1 = require("@budibase/pro");
22
22
  const backend_core_1 = require("@budibase/backend-core");
23
+ const utils_3 = require("@budibase/backend-core/utils");
24
+ const constants_2 = require("@budibase/backend-core/constants");
23
25
  const Runner = new threads_1.Thread(threads_1.ThreadType.QUERY, {
24
26
  timeoutMs: environment_1.QUERY_THREAD_TIMEOUT || 10000,
25
27
  });
@@ -111,6 +113,19 @@ function find(ctx) {
111
113
  });
112
114
  }
113
115
  exports.find = find;
116
+ //Required to discern between OIDC OAuth config entries
117
+ function getOAuthConfigCookieId(ctx) {
118
+ if (ctx.user.providerType === constants_2.Configs.OIDC) {
119
+ return (0, utils_3.getCookie)(ctx, constants_2.Cookies.OIDC_CONFIG);
120
+ }
121
+ }
122
+ function getAuthConfig(ctx) {
123
+ const authCookie = (0, utils_3.getCookie)(ctx, constants_2.Cookies.Auth);
124
+ let authConfigCtx = {};
125
+ authConfigCtx["configId"] = getOAuthConfigCookieId(ctx);
126
+ authConfigCtx["sessionId"] = authCookie ? authCookie.sessionId : null;
127
+ return authConfigCtx;
128
+ }
114
129
  function preview(ctx) {
115
130
  return __awaiter(this, void 0, void 0, function* () {
116
131
  const db = (0, context_1.getAppDB)();
@@ -119,6 +134,7 @@ function preview(ctx) {
119
134
  // preview may not have a queryId as it hasn't been saved, but if it does
120
135
  // this stops dynamic variables from calling the same query
121
136
  const { fields, parameters, queryVerb, transformer, queryId } = query;
137
+ const authConfigCtx = getAuthConfig(ctx);
122
138
  try {
123
139
  const runFn = () => Runner.run({
124
140
  appId: ctx.appId,
@@ -128,6 +144,10 @@ function preview(ctx) {
128
144
  parameters,
129
145
  transformer,
130
146
  queryId,
147
+ ctx: {
148
+ user: ctx.user,
149
+ auth: Object.assign({}, authConfigCtx),
150
+ },
131
151
  });
132
152
  const { rows, keys, info, extra } = yield pro_1.quotas.addQuery(runFn);
133
153
  yield backend_core_1.events.query.previewed(datasource, query);
@@ -144,11 +164,15 @@ function preview(ctx) {
144
164
  });
145
165
  }
146
166
  exports.preview = preview;
147
- function execute(ctx, opts = { rowsOnly: false }) {
167
+ function execute(ctx, opts = { rowsOnly: false, isAutomation: false }) {
148
168
  return __awaiter(this, void 0, void 0, function* () {
149
169
  const db = (0, context_1.getAppDB)();
150
170
  const query = yield db.get(ctx.params.queryId);
151
171
  const datasource = yield db.get(query.datasourceId);
172
+ let authConfigCtx = {};
173
+ if (!opts.isAutomation) {
174
+ authConfigCtx = getAuthConfig(ctx);
175
+ }
152
176
  const enrichedParameters = ctx.request.body.parameters || {};
153
177
  // make sure parameters are fully enriched with defaults
154
178
  if (query && query.parameters) {
@@ -169,6 +193,10 @@ function execute(ctx, opts = { rowsOnly: false }) {
169
193
  parameters: enrichedParameters,
170
194
  transformer: query.transformer,
171
195
  queryId: ctx.params.queryId,
196
+ ctx: {
197
+ user: ctx.user,
198
+ auth: Object.assign({}, authConfigCtx),
199
+ },
172
200
  });
173
201
  const { rows, pagination, extra } = yield pro_1.quotas.addQuery(runFn);
174
202
  if (opts && opts.rowsOnly) {
@@ -189,9 +217,9 @@ function executeV1(ctx) {
189
217
  });
190
218
  }
191
219
  exports.executeV1 = executeV1;
192
- function executeV2(ctx) {
220
+ function executeV2(ctx, { isAutomation } = {}) {
193
221
  return __awaiter(this, void 0, void 0, function* () {
194
- return execute(ctx, { rowsOnly: false });
222
+ return execute(ctx, { rowsOnly: false, isAutomation });
195
223
  });
196
224
  }
197
225
  exports.executeV2 = executeV2;
@@ -155,29 +155,41 @@ exports.validate = () => __awaiter(void 0, void 0, void 0, function* () {
155
155
  return { valid: true };
156
156
  });
157
157
  exports.exportRows = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
158
- const { datasourceId, tableName } = breakExternalTableId(ctx.params.tableId);
158
+ const { datasourceId } = breakExternalTableId(ctx.params.tableId);
159
159
  const db = getAppDB();
160
- let format = ctx.query.format;
160
+ const format = ctx.query.format;
161
+ const { columns } = ctx.request.body;
161
162
  const datasource = yield db.get(datasourceId);
162
163
  if (!datasource || !datasource.entities) {
163
164
  ctx.throw(400, "Datasource has not been configured for plus API.");
164
165
  }
165
- const tables = datasource.entities;
166
- const table = tables[tableName];
167
166
  ctx.request.body = {
168
167
  query: {
169
168
  oneOf: {
170
- [table.primaryDisplay]: ctx.request.body.rows.map(id => breakRowIdField(id)[0]),
169
+ _id: ctx.request.body.rows.map(row => JSON.parse(decodeURI(row))[0]),
171
170
  },
172
171
  },
173
172
  };
174
173
  let result = yield exports.search(ctx);
175
- let headers = Object.keys(result.rows[0]);
174
+ let rows = [];
175
+ // Filter data to only specified columns if required
176
+ if (columns && columns.length) {
177
+ for (let i = 0; i < result.rows.length; i++) {
178
+ rows[i] = {};
179
+ for (let column of columns) {
180
+ rows[i][column] = result.rows[i][column];
181
+ }
182
+ }
183
+ }
184
+ else {
185
+ rows = result.rows;
186
+ }
187
+ let headers = Object.keys(rows[0]);
176
188
  const exporter = exporters[format];
177
189
  const filename = `export.${format}`;
178
190
  // send down the file
179
191
  ctx.attachment(filename);
180
- return apiFileReturn(exporter(headers, result.rows));
192
+ return apiFileReturn(exporter(headers, rows));
181
193
  });
182
194
  exports.fetchEnrichedRow = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
183
195
  const id = ctx.params.rowId;
@@ -18,7 +18,7 @@ const { getAppId } = require("@budibase/backend-core/context");
18
18
  */
19
19
  class QueryBuilder {
20
20
  constructor(base) {
21
- this.query = Object.assign({ string: {}, fuzzy: {}, range: {}, equal: {}, notEqual: {}, empty: {}, notEmpty: {} }, base);
21
+ this.query = Object.assign({ allOr: false, string: {}, fuzzy: {}, range: {}, equal: {}, notEqual: {}, empty: {}, notEmpty: {}, oneOf: {} }, base);
22
22
  this.limit = 50;
23
23
  this.sortOrder = "ascending";
24
24
  this.sortType = "string";
@@ -96,6 +96,10 @@ class QueryBuilder {
96
96
  this.query.notEmpty[key] = value;
97
97
  return this;
98
98
  }
99
+ addOneOf(key, value) {
100
+ this.query.oneOf[key] = value;
101
+ return this;
102
+ }
99
103
  /**
100
104
  * Preprocesses a value before going into a lucene search.
101
105
  * Transforms strings to lowercase and wraps strings and bools in quotes.
@@ -123,8 +127,21 @@ class QueryBuilder {
123
127
  }
124
128
  buildSearchQuery() {
125
129
  const builder = this;
126
- let query = "*:*";
130
+ let allOr = this.query && this.query.allOr;
131
+ let query = allOr ? "" : "*:*";
127
132
  const allPreProcessingOpts = { escape: true, lowercase: true, wrap: true };
133
+ let tableId;
134
+ if (this.query.equal.tableId) {
135
+ tableId = this.query.equal.tableId;
136
+ delete this.query.equal.tableId;
137
+ }
138
+ const equal = (key, value) => {
139
+ // 0 evaluates to false, which means we would return all rows if we don't check it
140
+ if (!value && value !== 0) {
141
+ return null;
142
+ }
143
+ return `${key}:${builder.preprocess(value, allPreProcessingOpts)}`;
144
+ };
128
145
  function build(structure, queryFn) {
129
146
  for (let [key, value] of Object.entries(structure)) {
130
147
  key = builder.preprocess(key.replace(/ /g, "_"), {
@@ -134,7 +151,10 @@ class QueryBuilder {
134
151
  if (expression == null) {
135
152
  continue;
136
153
  }
137
- query += ` AND ${expression}`;
154
+ if (query.length > 0) {
155
+ query += ` ${allOr ? "OR" : "AND"} `;
156
+ }
157
+ query += expression;
138
158
  }
139
159
  }
140
160
  // Construct the actual lucene search query string from JSON structure
@@ -179,13 +199,7 @@ class QueryBuilder {
179
199
  });
180
200
  }
181
201
  if (this.query.equal) {
182
- build(this.query.equal, (key, value) => {
183
- // 0 evaluates to false, which means we would return all rows if we don't check it
184
- if (!value && value !== 0) {
185
- return null;
186
- }
187
- return `${key}:${builder.preprocess(value, allPreProcessingOpts)}`;
188
- });
202
+ build(this.query.equal, equal);
189
203
  }
190
204
  if (this.query.notEqual) {
191
205
  build(this.query.notEqual, (key, value) => {
@@ -201,6 +215,29 @@ class QueryBuilder {
201
215
  if (this.query.notEmpty) {
202
216
  build(this.query.notEmpty, key => `${key}:["" TO *]`);
203
217
  }
218
+ if (this.query.oneOf) {
219
+ build(this.query.oneOf, (key, value) => {
220
+ if (!Array.isArray(value)) {
221
+ if (typeof value === "string") {
222
+ value = value.split(",");
223
+ }
224
+ else {
225
+ return "";
226
+ }
227
+ }
228
+ let orStatement = `${builder.preprocess(value[0], allPreProcessingOpts)}`;
229
+ for (let i = 1; i < value.length; i++) {
230
+ orStatement += ` OR ${builder.preprocess(value[i], allPreProcessingOpts)}`;
231
+ }
232
+ return `${key}:(${orStatement})`;
233
+ });
234
+ }
235
+ // make sure table ID is always added as an AND
236
+ if (tableId) {
237
+ query = `(${query})`;
238
+ allOr = false;
239
+ build({ tableId }, equal);
240
+ }
204
241
  return query;
205
242
  }
206
243
  buildSearchBody() {
@@ -70,6 +70,9 @@ exports.validate = ({ tableId, row, table }) => __awaiter(void 0, void 0, void 0
70
70
  // Validate.js doesn't seem to handle array
71
71
  if (type === FieldTypes.ARRAY && row[fieldName]) {
72
72
  if (row[fieldName].length) {
73
+ if (!Array.isArray(row[fieldName])) {
74
+ row[fieldName] = row[fieldName].split(",");
75
+ }
73
76
  row[fieldName].map(val => {
74
77
  if (!constraints.inclusion.includes(val) &&
75
78
  constraints.inclusion.length !== 0) {
package/dist/api/index.js CHANGED
@@ -69,7 +69,10 @@ router.use((ctx, next) => __awaiter(void 0, void 0, void 0, function* () {
69
69
  error,
70
70
  };
71
71
  ctx.log.error(err);
72
- console.trace(err);
72
+ // unauthorised errors don't provide a useful trace
73
+ if (!env.isTest()) {
74
+ console.trace(err);
75
+ }
73
76
  }
74
77
  }));
75
78
  // authenticated routes
@@ -15,6 +15,8 @@ router
15
15
  .get("/api/automations/:id", paramResource("id"), authorized(BUILDER), controller.find)
16
16
  .put("/api/automations", bodyResource("_id"), authorized(BUILDER), automationValidator(true), controller.update)
17
17
  .post("/api/automations", authorized(BUILDER), automationValidator(false), controller.create)
18
+ .post("/api/automations/logs/search", authorized(BUILDER), controller.logSearch)
19
+ .delete("/api/automations/logs", authorized(BUILDER), controller.clearLogError)
18
20
  .delete("/api/automations/:id/:rev", paramResource("id"), authorized(BUILDER), controller.destroy)
19
21
  .post("/api/automations/:id/trigger", appInfoMiddleware({ appType: AppType.PROD }), paramResource("id"), authorized(PermissionTypes.AUTOMATION, PermissionLevels.EXECUTE), controller.trigger)
20
22
  .post("/api/automations/:id/test", appInfoMiddleware({ appType: AppType.DEV }), paramResource("id"), authorized(PermissionTypes.AUTOMATION, PermissionLevels.EXECUTE), controller.test);
@@ -144,6 +144,11 @@ read.push(new Endpoint_1.default("get", "/tables/:tableId/rows/:rowId", rows_1.d
144
144
  * query:
145
145
  * type: object
146
146
  * properties:
147
+ * allOr:
148
+ * type: boolean
149
+ * description: Specifies that a row should be returned if it satisfies
150
+ * any of the specified options, rather than requiring it to fulfill all
151
+ * the search parameters. This defaults to false, meaning AND logic will be used.
147
152
  * string:
148
153
  * type: object
149
154
  * example:
@@ -161,9 +166,9 @@ read.push(new Endpoint_1.default("get", "/tables/:tableId/rows/:rowId", rows_1.d
161
166
  * range:
162
167
  * type: object
163
168
  * description: Searches within a range, the format of this must be
164
- * columnName -> [low, high].
169
+ * in the format of an object with a "low" and "high" property.
165
170
  * example:
166
- * columnName1: [10, 20]
171
+ * columnName1: { low: 10, high: 20 }
167
172
  * equal:
168
173
  * type: object
169
174
  * description: Searches for rows that have a column value that is
@@ -51,6 +51,7 @@ function filterObject() {
51
51
  oneOf: Joi.object().optional(),
52
52
  contains: Joi.object().optional(),
53
53
  notContains: Joi.object().optional(),
54
+ allOr: Joi.boolean().optional(),
54
55
  }).unknown(true);
55
56
  }
56
57
  exports.internalSearchValidator = () => {
package/dist/app.js CHANGED
@@ -54,6 +54,7 @@ const { Thread } = require("./threads");
54
54
  const redis_1 = __importDefault(require("./utilities/redis"));
55
55
  const migrations = __importStar(require("./migrations"));
56
56
  const backend_core_1 = require("@budibase/backend-core");
57
+ const workerRequests_1 = require("./utilities/workerRequests");
57
58
  const app = new Koa();
58
59
  // set up top level koa middleware
59
60
  app.use(koaBody({
@@ -112,6 +113,7 @@ server.on("close", () => __awaiter(void 0, void 0, void 0, function* () {
112
113
  }
113
114
  }));
114
115
  module.exports = server.listen(env.PORT || 0, () => __awaiter(void 0, void 0, void 0, function* () {
116
+ var _a;
115
117
  console.log(`Budibase running on ${JSON.stringify(server.address())}`);
116
118
  env._set("PORT", server.address().port);
117
119
  eventEmitter.emitPort(env.PORT);
@@ -128,6 +130,24 @@ module.exports = server.listen(env.PORT || 0, () => __awaiter(void 0, void 0, vo
128
130
  shutdown();
129
131
  }
130
132
  }
133
+ // check and create admin user if required
134
+ if (env.SELF_HOSTED &&
135
+ !env.MULTI_TENANCY &&
136
+ env.BB_ADMIN_USER_EMAIL &&
137
+ env.BB_ADMIN_USER_PASSWORD) {
138
+ const checklist = yield (0, workerRequests_1.getChecklist)();
139
+ if (!((_a = checklist === null || checklist === void 0 ? void 0 : checklist.adminUser) === null || _a === void 0 ? void 0 : _a.checked)) {
140
+ try {
141
+ const tenantId = backend_core_1.tenancy.getTenantId();
142
+ yield (0, workerRequests_1.createAdminUser)(env.BB_ADMIN_USER_EMAIL, env.BB_ADMIN_USER_PASSWORD, tenantId);
143
+ console.log("Admin account automatically created for", env.BB_ADMIN_USER_EMAIL);
144
+ }
145
+ catch (e) {
146
+ logAlert("Error creating initial admin user. Exiting.", e);
147
+ shutdown();
148
+ }
149
+ }
150
+ }
131
151
  // check for version updates
132
152
  yield backend_core_1.installation.checkInstallVersion();
133
153
  // done last - this will never complete
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  const { getTable } = require("../api/controllers/table/utils");
12
- const { findHBSBlocks } = require("@budibase/string-templates");
12
+ const { findHBSBlocks, decodeJSBinding, isJSBinding, encodeJSBinding, } = require("@budibase/string-templates");
13
13
  /**
14
14
  * When values are input to the system generally they will be of type string as this is required for template strings.
15
15
  * This can generate some odd scenarios as the Schema of the automation requires a number but the builder might supply
@@ -81,11 +81,23 @@ exports.getError = err => {
81
81
  return typeof err !== "string" ? err.toString() : err;
82
82
  };
83
83
  exports.substituteLoopStep = (hbsString, substitute) => {
84
- let blocks = findHBSBlocks(hbsString);
84
+ let blocks = [];
85
+ let checkForJS = isJSBinding(hbsString);
86
+ if (checkForJS) {
87
+ hbsString = decodeJSBinding(hbsString);
88
+ blocks.push(hbsString);
89
+ }
90
+ else {
91
+ blocks = findHBSBlocks(hbsString);
92
+ }
85
93
  for (let block of blocks) {
86
- let oldBlock = block;
87
94
  block = block.replace(/loop/, substitute);
88
- hbsString = hbsString.replace(new RegExp(oldBlock, "g"), block);
95
+ if (checkForJS) {
96
+ hbsString = encodeJSBinding(block);
97
+ }
98
+ else {
99
+ hbsString = block;
100
+ }
89
101
  }
90
102
  return hbsString;
91
103
  };
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ exports.checkAppMetadata = exports.storeLog = void 0;
36
+ const env = __importStar(require("../../environment"));
37
+ const pro_1 = require("@budibase/pro");
38
+ const backend_core_1 = require("@budibase/backend-core");
39
+ function storeLog(automation, results) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ // can disable this if un-needed in self-host, also only do this for prod apps
42
+ if (env.DISABLE_AUTOMATION_LOGS) {
43
+ return;
44
+ }
45
+ yield pro_1.automations.logs.storeLog(automation, results);
46
+ });
47
+ }
48
+ exports.storeLog = storeLog;
49
+ function checkAppMetadata(apps) {
50
+ return __awaiter(this, void 0, void 0, function* () {
51
+ const maxStartDate = yield pro_1.automations.logs.oldestLogDate();
52
+ for (let metadata of apps) {
53
+ if (!metadata.automationErrors) {
54
+ continue;
55
+ }
56
+ for (let [key, errors] of Object.entries(metadata.automationErrors)) {
57
+ const updated = [];
58
+ for (let error of errors) {
59
+ const startDate = error.split(backend_core_1.db.SEPARATOR)[2];
60
+ if (startDate > maxStartDate) {
61
+ updated.push(error);
62
+ }
63
+ }
64
+ metadata.automationErrors[key] = updated;
65
+ }
66
+ }
67
+ return apps;
68
+ });
69
+ }
70
+ exports.checkAppMetadata = checkAppMetadata;
@@ -88,7 +88,7 @@ exports.run = function ({ inputs, appId, emitter }) {
88
88
  },
89
89
  });
90
90
  try {
91
- yield queryController.executeV2(ctx);
91
+ yield queryController.executeV2(ctx, { isAutomation: true });
92
92
  const _b = ctx.body, { data } = _b, rest = __rest(_b, ["data"]);
93
93
  return {
94
94
  response: data,