@budibase/server 2.1.46-alpha.5 → 2.1.46-alpha.6

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 (346) hide show
  1. package/builder/assets/{index.7fd28099.js → index.c082f6df.js} +205 -205
  2. package/builder/index.html +1 -1
  3. package/coverage/clover.xml +2 -2
  4. package/coverage/lcov-report/index.html +1 -1
  5. package/coverage/lcov-report/src/api/controllers/analytics.ts.html +1 -1
  6. package/coverage/lcov-report/src/api/controllers/apikeys.ts.html +1 -1
  7. package/coverage/lcov-report/src/api/controllers/application.ts.html +1 -1
  8. package/coverage/lcov-report/src/api/controllers/auth.ts.html +1 -1
  9. package/coverage/lcov-report/src/api/controllers/automation.ts.html +1 -1
  10. package/coverage/lcov-report/src/api/controllers/backup.ts.html +1 -1
  11. package/coverage/lcov-report/src/api/controllers/cloud.ts.html +1 -1
  12. package/coverage/lcov-report/src/api/controllers/component.ts.html +1 -1
  13. package/coverage/lcov-report/src/api/controllers/datasource.ts.html +1 -1
  14. package/coverage/lcov-report/src/api/controllers/deploy/Deployment.ts.html +1 -1
  15. package/coverage/lcov-report/src/api/controllers/deploy/index.html +1 -1
  16. package/coverage/lcov-report/src/api/controllers/deploy/index.ts.html +1 -1
  17. package/coverage/lcov-report/src/api/controllers/dev.ts.html +1 -1
  18. package/coverage/lcov-report/src/api/controllers/index.html +1 -1
  19. package/coverage/lcov-report/src/api/controllers/integration.ts.html +1 -1
  20. package/coverage/lcov-report/src/api/controllers/layout.ts.html +1 -1
  21. package/coverage/lcov-report/src/api/controllers/metadata.ts.html +1 -1
  22. package/coverage/lcov-report/src/api/controllers/migrations.ts.html +1 -1
  23. package/coverage/lcov-report/src/api/controllers/permission.ts.html +1 -1
  24. package/coverage/lcov-report/src/api/controllers/plugin/file.ts.html +1 -1
  25. package/coverage/lcov-report/src/api/controllers/plugin/github.ts.html +1 -1
  26. package/coverage/lcov-report/src/api/controllers/plugin/index.html +1 -1
  27. package/coverage/lcov-report/src/api/controllers/plugin/index.ts.html +1 -1
  28. package/coverage/lcov-report/src/api/controllers/plugin/npm.ts.html +1 -1
  29. package/coverage/lcov-report/src/api/controllers/plugin/uploaders.ts.html +1 -1
  30. package/coverage/lcov-report/src/api/controllers/plugin/url.ts.html +1 -1
  31. package/coverage/lcov-report/src/api/controllers/plugin/utils.ts.html +1 -1
  32. package/coverage/lcov-report/src/api/controllers/public/applications.ts.html +1 -1
  33. package/coverage/lcov-report/src/api/controllers/public/index.html +1 -1
  34. package/coverage/lcov-report/src/api/controllers/public/mapping/applications.ts.html +1 -1
  35. package/coverage/lcov-report/src/api/controllers/public/mapping/index.html +1 -1
  36. package/coverage/lcov-report/src/api/controllers/public/mapping/index.ts.html +1 -1
  37. package/coverage/lcov-report/src/api/controllers/public/mapping/queries.ts.html +1 -1
  38. package/coverage/lcov-report/src/api/controllers/public/mapping/rows.ts.html +1 -1
  39. package/coverage/lcov-report/src/api/controllers/public/mapping/tables.ts.html +1 -1
  40. package/coverage/lcov-report/src/api/controllers/public/mapping/users.ts.html +1 -1
  41. package/coverage/lcov-report/src/api/controllers/public/queries.ts.html +1 -1
  42. package/coverage/lcov-report/src/api/controllers/public/rows.ts.html +1 -1
  43. package/coverage/lcov-report/src/api/controllers/public/tables.ts.html +1 -1
  44. package/coverage/lcov-report/src/api/controllers/public/users.ts.html +1 -1
  45. package/coverage/lcov-report/src/api/controllers/public/utils.ts.html +1 -1
  46. package/coverage/lcov-report/src/api/controllers/query/import/index.html +1 -1
  47. package/coverage/lcov-report/src/api/controllers/query/import/index.ts.html +1 -1
  48. package/coverage/lcov-report/src/api/controllers/query/import/sources/base/index.html +1 -1
  49. package/coverage/lcov-report/src/api/controllers/query/import/sources/base/index.ts.html +1 -1
  50. package/coverage/lcov-report/src/api/controllers/query/import/sources/base/openapi.ts.html +1 -1
  51. package/coverage/lcov-report/src/api/controllers/query/import/sources/curl.ts.html +1 -1
  52. package/coverage/lcov-report/src/api/controllers/query/import/sources/index.html +1 -1
  53. package/coverage/lcov-report/src/api/controllers/query/import/sources/openapi2.ts.html +1 -1
  54. package/coverage/lcov-report/src/api/controllers/query/import/sources/openapi3.ts.html +1 -1
  55. package/coverage/lcov-report/src/api/controllers/query/index.html +1 -1
  56. package/coverage/lcov-report/src/api/controllers/query/index.ts.html +1 -1
  57. package/coverage/lcov-report/src/api/controllers/query/validation.ts.html +1 -1
  58. package/coverage/lcov-report/src/api/controllers/role.ts.html +1 -1
  59. package/coverage/lcov-report/src/api/controllers/routing.ts.html +1 -1
  60. package/coverage/lcov-report/src/api/controllers/row/ExternalRequest.ts.html +1 -1
  61. package/coverage/lcov-report/src/api/controllers/row/external.ts.html +1 -1
  62. package/coverage/lcov-report/src/api/controllers/row/index.html +1 -1
  63. package/coverage/lcov-report/src/api/controllers/row/index.ts.html +1 -1
  64. package/coverage/lcov-report/src/api/controllers/row/internal.ts.html +1 -1
  65. package/coverage/lcov-report/src/api/controllers/row/internalSearch.ts.html +1 -1
  66. package/coverage/lcov-report/src/api/controllers/row/staticFormula.ts.html +1 -1
  67. package/coverage/lcov-report/src/api/controllers/row/utils.ts.html +1 -1
  68. package/coverage/lcov-report/src/api/controllers/screen.ts.html +1 -1
  69. package/coverage/lcov-report/src/api/controllers/script.ts.html +1 -1
  70. package/coverage/lcov-report/src/api/controllers/static/index.html +1 -1
  71. package/coverage/lcov-report/src/api/controllers/static/index.ts.html +1 -1
  72. package/coverage/lcov-report/src/api/controllers/table/bulkFormula.ts.html +1 -1
  73. package/coverage/lcov-report/src/api/controllers/table/external.ts.html +1 -1
  74. package/coverage/lcov-report/src/api/controllers/table/index.html +1 -1
  75. package/coverage/lcov-report/src/api/controllers/table/index.ts.html +1 -1
  76. package/coverage/lcov-report/src/api/controllers/table/internal.ts.html +1 -1
  77. package/coverage/lcov-report/src/api/controllers/table/utils.ts.html +1 -1
  78. package/coverage/lcov-report/src/api/controllers/templates.ts.html +1 -1
  79. package/coverage/lcov-report/src/api/controllers/user.ts.html +1 -1
  80. package/coverage/lcov-report/src/api/controllers/view/exporters.ts.html +1 -1
  81. package/coverage/lcov-report/src/api/controllers/view/index.html +1 -1
  82. package/coverage/lcov-report/src/api/controllers/view/index.ts.html +1 -1
  83. package/coverage/lcov-report/src/api/controllers/view/utils.ts.html +1 -1
  84. package/coverage/lcov-report/src/api/controllers/view/viewBuilder.ts.html +1 -1
  85. package/coverage/lcov-report/src/api/controllers/webhook.ts.html +1 -1
  86. package/coverage/lcov-report/src/api/index.html +1 -1
  87. package/coverage/lcov-report/src/api/index.ts.html +1 -1
  88. package/coverage/lcov-report/src/api/routes/analytics.ts.html +1 -1
  89. package/coverage/lcov-report/src/api/routes/apikeys.ts.html +1 -1
  90. package/coverage/lcov-report/src/api/routes/application.ts.html +1 -1
  91. package/coverage/lcov-report/src/api/routes/auth.ts.html +1 -1
  92. package/coverage/lcov-report/src/api/routes/automation.ts.html +1 -1
  93. package/coverage/lcov-report/src/api/routes/backup.ts.html +1 -1
  94. package/coverage/lcov-report/src/api/routes/cloud.ts.html +1 -1
  95. package/coverage/lcov-report/src/api/routes/component.ts.html +1 -1
  96. package/coverage/lcov-report/src/api/routes/datasource.ts.html +1 -1
  97. package/coverage/lcov-report/src/api/routes/deploy.ts.html +1 -1
  98. package/coverage/lcov-report/src/api/routes/dev.ts.html +1 -1
  99. package/coverage/lcov-report/src/api/routes/index.html +1 -1
  100. package/coverage/lcov-report/src/api/routes/index.ts.html +1 -1
  101. package/coverage/lcov-report/src/api/routes/integration.ts.html +1 -1
  102. package/coverage/lcov-report/src/api/routes/layout.ts.html +1 -1
  103. package/coverage/lcov-report/src/api/routes/metadata.ts.html +1 -1
  104. package/coverage/lcov-report/src/api/routes/migrations.ts.html +1 -1
  105. package/coverage/lcov-report/src/api/routes/permission.ts.html +1 -1
  106. package/coverage/lcov-report/src/api/routes/plugin.ts.html +1 -1
  107. package/coverage/lcov-report/src/api/routes/public/applications.ts.html +1 -1
  108. package/coverage/lcov-report/src/api/routes/public/index.html +1 -1
  109. package/coverage/lcov-report/src/api/routes/public/index.ts.html +1 -1
  110. package/coverage/lcov-report/src/api/routes/public/middleware/index.html +1 -1
  111. package/coverage/lcov-report/src/api/routes/public/middleware/mapper.ts.html +1 -1
  112. package/coverage/lcov-report/src/api/routes/public/queries.ts.html +1 -1
  113. package/coverage/lcov-report/src/api/routes/public/rows.ts.html +1 -1
  114. package/coverage/lcov-report/src/api/routes/public/tables.ts.html +1 -1
  115. package/coverage/lcov-report/src/api/routes/public/tests/index.html +1 -1
  116. package/coverage/lcov-report/src/api/routes/public/tests/utils.ts.html +1 -1
  117. package/coverage/lcov-report/src/api/routes/public/users.ts.html +1 -1
  118. package/coverage/lcov-report/src/api/routes/public/utils/Endpoint.ts.html +1 -1
  119. package/coverage/lcov-report/src/api/routes/public/utils/index.html +1 -1
  120. package/coverage/lcov-report/src/api/routes/query.ts.html +1 -1
  121. package/coverage/lcov-report/src/api/routes/role.ts.html +1 -1
  122. package/coverage/lcov-report/src/api/routes/routing.ts.html +1 -1
  123. package/coverage/lcov-report/src/api/routes/row.ts.html +1 -1
  124. package/coverage/lcov-report/src/api/routes/screen.ts.html +1 -1
  125. package/coverage/lcov-report/src/api/routes/script.ts.html +1 -1
  126. package/coverage/lcov-report/src/api/routes/static.ts.html +1 -1
  127. package/coverage/lcov-report/src/api/routes/table.ts.html +1 -1
  128. package/coverage/lcov-report/src/api/routes/templates.ts.html +1 -1
  129. package/coverage/lcov-report/src/api/routes/tests/utilities/TestFunctions.ts.html +1 -1
  130. package/coverage/lcov-report/src/api/routes/tests/utilities/index.html +1 -1
  131. package/coverage/lcov-report/src/api/routes/tests/utilities/index.ts.html +1 -1
  132. package/coverage/lcov-report/src/api/routes/user.ts.html +1 -1
  133. package/coverage/lcov-report/src/api/routes/utils/index.html +1 -1
  134. package/coverage/lcov-report/src/api/routes/utils/validators.ts.html +1 -1
  135. package/coverage/lcov-report/src/api/routes/view.ts.html +1 -1
  136. package/coverage/lcov-report/src/api/routes/webhook.ts.html +1 -1
  137. package/coverage/lcov-report/src/app.ts.html +1 -1
  138. package/coverage/lcov-report/src/automations/actions.ts.html +1 -1
  139. package/coverage/lcov-report/src/automations/automationUtils.ts.html +1 -1
  140. package/coverage/lcov-report/src/automations/bullboard.ts.html +1 -1
  141. package/coverage/lcov-report/src/automations/index.html +1 -1
  142. package/coverage/lcov-report/src/automations/index.ts.html +1 -1
  143. package/coverage/lcov-report/src/automations/logging/index.html +1 -1
  144. package/coverage/lcov-report/src/automations/logging/index.ts.html +1 -1
  145. package/coverage/lcov-report/src/automations/steps/bash.ts.html +1 -1
  146. package/coverage/lcov-report/src/automations/steps/createRow.ts.html +1 -1
  147. package/coverage/lcov-report/src/automations/steps/delay.ts.html +1 -1
  148. package/coverage/lcov-report/src/automations/steps/deleteRow.ts.html +1 -1
  149. package/coverage/lcov-report/src/automations/steps/discord.ts.html +1 -1
  150. package/coverage/lcov-report/src/automations/steps/executeQuery.ts.html +1 -1
  151. package/coverage/lcov-report/src/automations/steps/executeScript.ts.html +1 -1
  152. package/coverage/lcov-report/src/automations/steps/filter.ts.html +1 -1
  153. package/coverage/lcov-report/src/automations/steps/index.html +1 -1
  154. package/coverage/lcov-report/src/automations/steps/integromat.ts.html +1 -1
  155. package/coverage/lcov-report/src/automations/steps/loop.ts.html +1 -1
  156. package/coverage/lcov-report/src/automations/steps/outgoingWebhook.ts.html +1 -1
  157. package/coverage/lcov-report/src/automations/steps/queryRows.ts.html +1 -1
  158. package/coverage/lcov-report/src/automations/steps/sendSmtpEmail.ts.html +1 -1
  159. package/coverage/lcov-report/src/automations/steps/serverLog.ts.html +1 -1
  160. package/coverage/lcov-report/src/automations/steps/slack.ts.html +1 -1
  161. package/coverage/lcov-report/src/automations/steps/updateRow.ts.html +1 -1
  162. package/coverage/lcov-report/src/automations/steps/utils.ts.html +1 -1
  163. package/coverage/lcov-report/src/automations/steps/zapier.ts.html +1 -1
  164. package/coverage/lcov-report/src/automations/tests/utilities/index.html +1 -1
  165. package/coverage/lcov-report/src/automations/tests/utilities/index.ts.html +1 -1
  166. package/coverage/lcov-report/src/automations/triggerInfo/app.ts.html +1 -1
  167. package/coverage/lcov-report/src/automations/triggerInfo/cron.ts.html +1 -1
  168. package/coverage/lcov-report/src/automations/triggerInfo/index.html +1 -1
  169. package/coverage/lcov-report/src/automations/triggerInfo/index.ts.html +1 -1
  170. package/coverage/lcov-report/src/automations/triggerInfo/rowDeleted.ts.html +1 -1
  171. package/coverage/lcov-report/src/automations/triggerInfo/rowSaved.ts.html +1 -1
  172. package/coverage/lcov-report/src/automations/triggerInfo/rowUpdated.ts.html +1 -1
  173. package/coverage/lcov-report/src/automations/triggerInfo/webhook.ts.html +1 -1
  174. package/coverage/lcov-report/src/automations/triggers.ts.html +1 -1
  175. package/coverage/lcov-report/src/automations/utils.ts.html +1 -1
  176. package/coverage/lcov-report/src/constants/index.html +1 -1
  177. package/coverage/lcov-report/src/constants/index.ts.html +1 -1
  178. package/coverage/lcov-report/src/constants/layouts.ts.html +1 -1
  179. package/coverage/lcov-report/src/constants/screens.ts.html +1 -1
  180. package/coverage/lcov-report/src/db/defaultData/datasource_bb_default.ts.html +1 -1
  181. package/coverage/lcov-report/src/db/defaultData/employeeImport.ts.html +1 -1
  182. package/coverage/lcov-report/src/db/defaultData/expensesImport.ts.html +1 -1
  183. package/coverage/lcov-report/src/db/defaultData/index.html +1 -1
  184. package/coverage/lcov-report/src/db/defaultData/inventoryImport.ts.html +1 -1
  185. package/coverage/lcov-report/src/db/defaultData/jobsImport.ts.html +1 -1
  186. package/coverage/lcov-report/src/db/dynamoClient.ts.html +1 -1
  187. package/coverage/lcov-report/src/db/inMemoryView.ts.html +1 -1
  188. package/coverage/lcov-report/src/db/index.html +1 -1
  189. package/coverage/lcov-report/src/db/index.ts.html +1 -1
  190. package/coverage/lcov-report/src/db/linkedRows/LinkController.ts.html +1 -1
  191. package/coverage/lcov-report/src/db/linkedRows/LinkDocument.ts.html +1 -1
  192. package/coverage/lcov-report/src/db/linkedRows/index.html +1 -1
  193. package/coverage/lcov-report/src/db/linkedRows/index.ts.html +1 -1
  194. package/coverage/lcov-report/src/db/linkedRows/linkUtils.ts.html +1 -1
  195. package/coverage/lcov-report/src/db/newid.ts.html +1 -1
  196. package/coverage/lcov-report/src/db/utils.ts.html +1 -1
  197. package/coverage/lcov-report/src/definitions/automations.ts.html +1 -1
  198. package/coverage/lcov-report/src/definitions/datasource.ts.html +1 -1
  199. package/coverage/lcov-report/src/definitions/index.html +1 -1
  200. package/coverage/lcov-report/src/environment.ts.html +1 -1
  201. package/coverage/lcov-report/src/events/AutomationEmitter.ts.html +1 -1
  202. package/coverage/lcov-report/src/events/BudibaseEmitter.ts.html +1 -1
  203. package/coverage/lcov-report/src/events/index.html +1 -1
  204. package/coverage/lcov-report/src/events/index.ts.html +1 -1
  205. package/coverage/lcov-report/src/events/utils.ts.html +1 -1
  206. package/coverage/lcov-report/src/index.html +1 -1
  207. package/coverage/lcov-report/src/index.ts.html +1 -1
  208. package/coverage/lcov-report/src/integrations/airtable.ts.html +1 -1
  209. package/coverage/lcov-report/src/integrations/arangodb.ts.html +1 -1
  210. package/coverage/lcov-report/src/integrations/base/index.html +1 -1
  211. package/coverage/lcov-report/src/integrations/base/query.ts.html +1 -1
  212. package/coverage/lcov-report/src/integrations/base/sql.ts.html +1 -1
  213. package/coverage/lcov-report/src/integrations/base/sqlTable.ts.html +1 -1
  214. package/coverage/lcov-report/src/integrations/base/utils.ts.html +1 -1
  215. package/coverage/lcov-report/src/integrations/couchdb.ts.html +1 -1
  216. package/coverage/lcov-report/src/integrations/dynamodb.ts.html +1 -1
  217. package/coverage/lcov-report/src/integrations/elasticsearch.ts.html +1 -1
  218. package/coverage/lcov-report/src/integrations/firebase.ts.html +1 -1
  219. package/coverage/lcov-report/src/integrations/googlesheets.ts.html +1 -1
  220. package/coverage/lcov-report/src/integrations/index.html +1 -1
  221. package/coverage/lcov-report/src/integrations/index.ts.html +1 -1
  222. package/coverage/lcov-report/src/integrations/microsoftSqlServer.ts.html +1 -1
  223. package/coverage/lcov-report/src/integrations/mongodb.ts.html +1 -1
  224. package/coverage/lcov-report/src/integrations/mysql.ts.html +1 -1
  225. package/coverage/lcov-report/src/integrations/oracle.ts.html +1 -1
  226. package/coverage/lcov-report/src/integrations/postgres.ts.html +1 -1
  227. package/coverage/lcov-report/src/integrations/queries/index.html +1 -1
  228. package/coverage/lcov-report/src/integrations/queries/sql.ts.html +1 -1
  229. package/coverage/lcov-report/src/integrations/redis.ts.html +1 -1
  230. package/coverage/lcov-report/src/integrations/rest.ts.html +1 -1
  231. package/coverage/lcov-report/src/integrations/s3.ts.html +1 -1
  232. package/coverage/lcov-report/src/integrations/snowflake.ts.html +1 -1
  233. package/coverage/lcov-report/src/integrations/tests/TestConfiguration.js.html +1 -1
  234. package/coverage/lcov-report/src/integrations/tests/index.html +1 -1
  235. package/coverage/lcov-report/src/integrations/utils.ts.html +1 -1
  236. package/coverage/lcov-report/src/middleware/appInfo.ts.html +1 -1
  237. package/coverage/lcov-report/src/middleware/authorized.ts.html +1 -1
  238. package/coverage/lcov-report/src/middleware/builder.ts.html +1 -1
  239. package/coverage/lcov-report/src/middleware/currentapp.ts.html +1 -1
  240. package/coverage/lcov-report/src/middleware/index.html +1 -1
  241. package/coverage/lcov-report/src/middleware/joi-validator.ts.html +1 -1
  242. package/coverage/lcov-report/src/middleware/publicApi.ts.html +1 -1
  243. package/coverage/lcov-report/src/middleware/resourceId.ts.html +1 -1
  244. package/coverage/lcov-report/src/middleware/selfhost.ts.html +1 -1
  245. package/coverage/lcov-report/src/middleware/utils.ts.html +1 -1
  246. package/coverage/lcov-report/src/migrations/functions/appUrls.ts.html +1 -1
  247. package/coverage/lcov-report/src/migrations/functions/backfill/app/automations.ts.html +1 -1
  248. package/coverage/lcov-report/src/migrations/functions/backfill/app/datasources.ts.html +1 -1
  249. package/coverage/lcov-report/src/migrations/functions/backfill/app/index.html +1 -1
  250. package/coverage/lcov-report/src/migrations/functions/backfill/app/layouts.ts.html +1 -1
  251. package/coverage/lcov-report/src/migrations/functions/backfill/app/queries.ts.html +1 -1
  252. package/coverage/lcov-report/src/migrations/functions/backfill/app/roles.ts.html +1 -1
  253. package/coverage/lcov-report/src/migrations/functions/backfill/app/screens.ts.html +1 -1
  254. package/coverage/lcov-report/src/migrations/functions/backfill/app/tables.ts.html +1 -1
  255. package/coverage/lcov-report/src/migrations/functions/backfill/app.ts.html +1 -1
  256. package/coverage/lcov-report/src/migrations/functions/backfill/global/configs.ts.html +1 -1
  257. package/coverage/lcov-report/src/migrations/functions/backfill/global/index.html +1 -1
  258. package/coverage/lcov-report/src/migrations/functions/backfill/global/quotas.ts.html +1 -1
  259. package/coverage/lcov-report/src/migrations/functions/backfill/global/users.ts.html +1 -1
  260. package/coverage/lcov-report/src/migrations/functions/backfill/global.ts.html +1 -1
  261. package/coverage/lcov-report/src/migrations/functions/backfill/index.html +1 -1
  262. package/coverage/lcov-report/src/migrations/functions/backfill/index.ts.html +1 -1
  263. package/coverage/lcov-report/src/migrations/functions/backfill/installation.ts.html +1 -1
  264. package/coverage/lcov-report/src/migrations/functions/index.html +1 -1
  265. package/coverage/lcov-report/src/migrations/functions/syncQuotas.ts.html +1 -1
  266. package/coverage/lcov-report/src/migrations/functions/tableSettings.ts.html +1 -1
  267. package/coverage/lcov-report/src/migrations/functions/usageQuotas/index.html +1 -1
  268. package/coverage/lcov-report/src/migrations/functions/usageQuotas/index.ts.html +1 -1
  269. package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncApps.ts.html +1 -1
  270. package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncPlugins.ts.html +1 -1
  271. package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncRows.ts.html +1 -1
  272. package/coverage/lcov-report/src/migrations/functions/userEmailViewCasing.ts.html +1 -1
  273. package/coverage/lcov-report/src/migrations/index.html +1 -1
  274. package/coverage/lcov-report/src/migrations/index.ts.html +1 -1
  275. package/coverage/lcov-report/src/migrations/tests/helpers.ts.html +1 -1
  276. package/coverage/lcov-report/src/migrations/tests/index.html +1 -1
  277. package/coverage/lcov-report/src/migrations/tests/structures.ts.html +1 -1
  278. package/coverage/lcov-report/src/sdk/app/applications/index.html +1 -1
  279. package/coverage/lcov-report/src/sdk/app/applications/index.ts.html +1 -1
  280. package/coverage/lcov-report/src/sdk/app/applications/sync.ts.html +1 -1
  281. package/coverage/lcov-report/src/sdk/app/applications/utils.ts.html +1 -1
  282. package/coverage/lcov-report/src/sdk/app/automations/index.html +1 -1
  283. package/coverage/lcov-report/src/sdk/app/automations/index.ts.html +1 -1
  284. package/coverage/lcov-report/src/sdk/app/automations/webhook.ts.html +1 -1
  285. package/coverage/lcov-report/src/sdk/app/backups/constants.ts.html +1 -1
  286. package/coverage/lcov-report/src/sdk/app/backups/exports.ts.html +1 -1
  287. package/coverage/lcov-report/src/sdk/app/backups/imports.ts.html +1 -1
  288. package/coverage/lcov-report/src/sdk/app/backups/index.html +1 -1
  289. package/coverage/lcov-report/src/sdk/app/backups/index.ts.html +1 -1
  290. package/coverage/lcov-report/src/sdk/app/backups/statistics.ts.html +1 -1
  291. package/coverage/lcov-report/src/sdk/app/tables/index.html +1 -1
  292. package/coverage/lcov-report/src/sdk/app/tables/index.ts.html +1 -1
  293. package/coverage/lcov-report/src/sdk/index.html +1 -1
  294. package/coverage/lcov-report/src/sdk/index.ts.html +1 -1
  295. package/coverage/lcov-report/src/sdk/users/index.html +1 -1
  296. package/coverage/lcov-report/src/sdk/users/index.ts.html +1 -1
  297. package/coverage/lcov-report/src/sdk/users/utils.ts.html +1 -1
  298. package/coverage/lcov-report/src/startup.ts.html +1 -1
  299. package/coverage/lcov-report/src/tests/utilities/TestConfiguration.ts.html +1 -1
  300. package/coverage/lcov-report/src/tests/utilities/controllers.ts.html +1 -1
  301. package/coverage/lcov-report/src/tests/utilities/index.html +1 -1
  302. package/coverage/lcov-report/src/tests/utilities/index.ts.html +1 -1
  303. package/coverage/lcov-report/src/tests/utilities/structures.ts.html +1 -1
  304. package/coverage/lcov-report/src/threads/automation.ts.html +1 -1
  305. package/coverage/lcov-report/src/threads/index.html +1 -1
  306. package/coverage/lcov-report/src/threads/index.ts.html +1 -1
  307. package/coverage/lcov-report/src/threads/query.ts.html +1 -1
  308. package/coverage/lcov-report/src/threads/utils.ts.html +1 -1
  309. package/coverage/lcov-report/src/utilities/budibaseDir.ts.html +1 -1
  310. package/coverage/lcov-report/src/utilities/centralPath.ts.html +1 -1
  311. package/coverage/lcov-report/src/utilities/csvParser.ts.html +1 -1
  312. package/coverage/lcov-report/src/utilities/fileSystem/clientLibrary.ts.html +1 -1
  313. package/coverage/lcov-report/src/utilities/fileSystem/index.html +1 -1
  314. package/coverage/lcov-report/src/utilities/fileSystem/index.ts.html +1 -1
  315. package/coverage/lcov-report/src/utilities/fileSystem/processor.ts.html +1 -1
  316. package/coverage/lcov-report/src/utilities/global.ts.html +1 -1
  317. package/coverage/lcov-report/src/utilities/index.html +1 -1
  318. package/coverage/lcov-report/src/utilities/index.ts.html +1 -1
  319. package/coverage/lcov-report/src/utilities/plugins.ts.html +1 -1
  320. package/coverage/lcov-report/src/utilities/redis.ts.html +1 -1
  321. package/coverage/lcov-report/src/utilities/routing/index.html +1 -1
  322. package/coverage/lcov-report/src/utilities/routing/index.ts.html +1 -1
  323. package/coverage/lcov-report/src/utilities/rowProcessor/index.html +1 -1
  324. package/coverage/lcov-report/src/utilities/rowProcessor/index.ts.html +1 -1
  325. package/coverage/lcov-report/src/utilities/rowProcessor/map.ts.html +1 -1
  326. package/coverage/lcov-report/src/utilities/rowProcessor/utils.ts.html +1 -1
  327. package/coverage/lcov-report/src/utilities/scriptRunner.ts.html +1 -1
  328. package/coverage/lcov-report/src/utilities/security.ts.html +1 -1
  329. package/coverage/lcov-report/src/utilities/statusCodes.ts.html +1 -1
  330. package/coverage/lcov-report/src/utilities/usageQuota/index.html +1 -1
  331. package/coverage/lcov-report/src/utilities/usageQuota/rows.ts.html +1 -1
  332. package/coverage/lcov-report/src/utilities/usageQuota/usageQuoteReset.ts.html +1 -1
  333. package/coverage/lcov-report/src/utilities/users.ts.html +1 -1
  334. package/coverage/lcov-report/src/utilities/workerRequests.ts.html +1 -1
  335. package/coverage/lcov-report/src/watch.ts.html +1 -1
  336. package/coverage/lcov-report/src/websocket.ts.html +1 -1
  337. package/dist/package.json +6 -6
  338. package/dist/tsconfig.build.tsbuildinfo +1 -1
  339. package/package.json +7 -7
  340. package/tsconfig.build.json +2 -0
  341. package/dist/api/routes/tests/utilities/TestFunctions.js +0 -167
  342. package/dist/api/routes/tests/utilities/index.js +0 -131
  343. package/dist/automations/tests/utilities/index.js +0 -81
  344. package/dist/tests/utilities/TestConfiguration.js +0 -568
  345. package/dist/tests/utilities/controllers.js +0 -40
  346. package/dist/tests/utilities/structures.js +0 -168
@@ -1,568 +0,0 @@
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
35
- return (mod && mod.__esModule) ? mod : { "default": mod };
36
- };
37
- const tests_1 = require("@budibase/backend-core/tests");
38
- // init the licensing mock
39
- const pro = __importStar(require("@budibase/pro"));
40
- tests_1.mocks.licenses.init(pro);
41
- // use unlimited license by default
42
- tests_1.mocks.licenses.useUnlimited();
43
- const db_1 = require("../../db");
44
- (0, db_1.init)();
45
- const environment_1 = __importDefault(require("../../environment"));
46
- const structures_1 = require("./structures");
47
- const backend_core_1 = require("@budibase/backend-core");
48
- const controllers = __importStar(require("./controllers"));
49
- const fileSystem_1 = require("../../utilities/fileSystem");
50
- const newid_1 = __importDefault(require("../../db/newid"));
51
- const utils_1 = require("../../db/utils");
52
- const startup_1 = require("../../startup");
53
- const supertest = require("supertest");
54
- const GLOBAL_USER_ID = "us_uuid1";
55
- const EMAIL = "babs@babs.com";
56
- const FIRSTNAME = "Barbara";
57
- const LASTNAME = "Barbington";
58
- const CSRF_TOKEN = "e3727778-7af0-4226-b5eb-f43cbe60a306";
59
- class TestConfiguration {
60
- constructor(openServer = true) {
61
- if (openServer) {
62
- // use a random port because it doesn't matter
63
- environment_1.default.PORT = "0";
64
- this.server = require("../../app");
65
- // we need the request for logging in, involves cookies, hard to fake
66
- this.request = supertest(this.server);
67
- this.started = true;
68
- }
69
- else {
70
- this.started = false;
71
- }
72
- this.appId = null;
73
- this.allApps = [];
74
- }
75
- getRequest() {
76
- return this.request;
77
- }
78
- getApp() {
79
- return this.app;
80
- }
81
- getProdApp() {
82
- return this.prodApp;
83
- }
84
- getAppId() {
85
- return this.appId;
86
- }
87
- getProdAppId() {
88
- return this.prodAppId;
89
- }
90
- getUserDetails() {
91
- return {
92
- globalId: GLOBAL_USER_ID,
93
- email: EMAIL,
94
- firstName: FIRSTNAME,
95
- lastName: LASTNAME,
96
- };
97
- }
98
- doInContext(appId, task) {
99
- return __awaiter(this, void 0, void 0, function* () {
100
- if (!appId) {
101
- appId = this.appId;
102
- }
103
- return backend_core_1.tenancy.doInTenant(structures_1.TENANT_ID, () => {
104
- // check if already in a context
105
- if (backend_core_1.context.getAppId() == null && appId !== null) {
106
- return backend_core_1.context.doInAppContext(appId, () => __awaiter(this, void 0, void 0, function* () {
107
- return task();
108
- }));
109
- }
110
- else {
111
- return task();
112
- }
113
- });
114
- });
115
- }
116
- // SETUP / TEARDOWN
117
- // use a new id as the name to avoid name collisions
118
- init(appName = (0, newid_1.default)()) {
119
- return __awaiter(this, void 0, void 0, function* () {
120
- if (!this.started) {
121
- yield (0, startup_1.startup)();
122
- }
123
- this.user = yield this.globalUser();
124
- this.globalUserId = this.user._id;
125
- this.userMetadataId = (0, utils_1.generateUserMetadataID)(this.globalUserId);
126
- return this.createApp(appName);
127
- });
128
- }
129
- end() {
130
- if (!this) {
131
- return;
132
- }
133
- if (this.server) {
134
- this.server.close();
135
- }
136
- if (this.allApps) {
137
- (0, fileSystem_1.cleanup)(this.allApps.map(app => app.appId));
138
- }
139
- }
140
- // UTILS
141
- _req(body, params, controlFunc) {
142
- return __awaiter(this, void 0, void 0, function* () {
143
- // create a fake request ctx
144
- const request = {};
145
- const appId = this.appId;
146
- request.appId = appId;
147
- // fake cookies, we don't need them
148
- request.cookies = { set: () => { }, get: () => { } };
149
- request.config = { jwtSecret: environment_1.default.JWT_SECRET };
150
- request.user = { appId, tenantId: structures_1.TENANT_ID };
151
- request.query = {};
152
- request.request = {
153
- body,
154
- };
155
- if (params) {
156
- request.params = params;
157
- }
158
- return this.doInContext(appId, () => __awaiter(this, void 0, void 0, function* () {
159
- yield controlFunc(request);
160
- return request.body;
161
- }));
162
- });
163
- }
164
- // USER / AUTH
165
- globalUser({ id = GLOBAL_USER_ID, firstName = FIRSTNAME, lastName = LASTNAME, builder = true, admin = false, email = EMAIL, roles, } = {}) {
166
- return __awaiter(this, void 0, void 0, function* () {
167
- return backend_core_1.tenancy.doWithGlobalDB(structures_1.TENANT_ID, (db) => __awaiter(this, void 0, void 0, function* () {
168
- let existing;
169
- try {
170
- existing = yield db.get(id);
171
- }
172
- catch (err) {
173
- existing = { email };
174
- }
175
- const user = Object.assign(Object.assign({ _id: id }, existing), { roles: roles || {}, tenantId: structures_1.TENANT_ID, firstName,
176
- lastName });
177
- yield backend_core_1.sessions.createASession(id, {
178
- sessionId: "sessionid",
179
- tenantId: structures_1.TENANT_ID,
180
- csrfToken: CSRF_TOKEN,
181
- });
182
- if (builder) {
183
- user.builder = { global: true };
184
- }
185
- else {
186
- user.builder = { global: false };
187
- }
188
- if (admin) {
189
- user.admin = { global: true };
190
- }
191
- else {
192
- user.admin = { global: false };
193
- }
194
- const resp = yield db.put(user);
195
- return Object.assign({ _rev: resp._rev }, user);
196
- }));
197
- });
198
- }
199
- createUser(id = null, firstName = FIRSTNAME, lastName = LASTNAME, email = EMAIL, builder = true, admin = false, roles = {}) {
200
- return __awaiter(this, void 0, void 0, function* () {
201
- const globalId = !id ? `us_${Math.random()}` : `us_${id}`;
202
- const resp = yield this.globalUser({
203
- id: globalId,
204
- firstName,
205
- lastName,
206
- email,
207
- builder,
208
- admin,
209
- roles,
210
- });
211
- yield backend_core_1.cache.user.invalidateUser(globalId);
212
- return Object.assign(Object.assign({}, resp), { globalId });
213
- });
214
- }
215
- login({ roleId, userId, builder, prodApp = false } = {}) {
216
- return __awaiter(this, void 0, void 0, function* () {
217
- const appId = prodApp ? this.prodAppId : this.appId;
218
- return backend_core_1.context.doInAppContext(appId, () => __awaiter(this, void 0, void 0, function* () {
219
- userId = !userId ? `us_uuid1` : userId;
220
- if (!this.request) {
221
- throw "Server has not been opened, cannot login.";
222
- }
223
- // make sure the user exists in the global DB
224
- if (roleId !== backend_core_1.roles.BUILTIN_ROLE_IDS.PUBLIC) {
225
- yield this.globalUser({
226
- id: userId,
227
- builder,
228
- roles: { [this.prodAppId]: roleId },
229
- });
230
- }
231
- yield backend_core_1.sessions.createASession(userId, {
232
- sessionId: "sessionid",
233
- tenantId: structures_1.TENANT_ID,
234
- });
235
- // have to fake this
236
- const authObj = {
237
- userId,
238
- sessionId: "sessionid",
239
- tenantId: structures_1.TENANT_ID,
240
- };
241
- const app = {
242
- roleId: roleId,
243
- appId,
244
- };
245
- const authToken = backend_core_1.auth.jwt.sign(authObj, environment_1.default.JWT_SECRET);
246
- const appToken = backend_core_1.auth.jwt.sign(app, environment_1.default.JWT_SECRET);
247
- // returning necessary request headers
248
- yield backend_core_1.cache.user.invalidateUser(userId);
249
- return {
250
- Accept: "application/json",
251
- Cookie: [
252
- `${backend_core_1.constants.Cookie.Auth}=${authToken}`,
253
- `${backend_core_1.constants.Cookie.CurrentApp}=${appToken}`,
254
- ],
255
- [backend_core_1.constants.Header.APP_ID]: appId,
256
- };
257
- }));
258
- });
259
- }
260
- defaultHeaders(extras = {}) {
261
- const authObj = {
262
- userId: GLOBAL_USER_ID,
263
- sessionId: "sessionid",
264
- tenantId: structures_1.TENANT_ID,
265
- };
266
- const app = {
267
- roleId: backend_core_1.roles.BUILTIN_ROLE_IDS.ADMIN,
268
- appId: this.appId,
269
- };
270
- const authToken = backend_core_1.auth.jwt.sign(authObj, environment_1.default.JWT_SECRET);
271
- const appToken = backend_core_1.auth.jwt.sign(app, environment_1.default.JWT_SECRET);
272
- const headers = Object.assign({ Accept: "application/json", Cookie: [
273
- `${backend_core_1.constants.Cookie.Auth}=${authToken}`,
274
- `${backend_core_1.constants.Cookie.CurrentApp}=${appToken}`,
275
- ], [backend_core_1.constants.Header.CSRF_TOKEN]: CSRF_TOKEN }, extras);
276
- if (this.appId) {
277
- headers[backend_core_1.constants.Header.APP_ID] = this.appId;
278
- }
279
- return headers;
280
- }
281
- publicHeaders({ prodApp = true } = {}) {
282
- const appId = prodApp ? this.prodAppId : this.appId;
283
- const headers = {
284
- Accept: "application/json",
285
- };
286
- if (appId) {
287
- headers[backend_core_1.constants.Header.APP_ID] = appId;
288
- }
289
- return headers;
290
- }
291
- roleHeaders({ email = EMAIL, roleId = backend_core_1.roles.BUILTIN_ROLE_IDS.ADMIN, builder = false, prodApp = true, } = {}) {
292
- return __awaiter(this, void 0, void 0, function* () {
293
- return this.login({ email, roleId, builder, prodApp });
294
- });
295
- }
296
- // API
297
- generateApiKey(userId = GLOBAL_USER_ID) {
298
- return __awaiter(this, void 0, void 0, function* () {
299
- return backend_core_1.tenancy.doWithGlobalDB(structures_1.TENANT_ID, (db) => __awaiter(this, void 0, void 0, function* () {
300
- const id = backend_core_1.db.generateDevInfoID(userId);
301
- let devInfo;
302
- try {
303
- devInfo = yield db.get(id);
304
- }
305
- catch (err) {
306
- devInfo = { _id: id, userId };
307
- }
308
- devInfo.apiKey = backend_core_1.encryption.encrypt(`${structures_1.TENANT_ID}${backend_core_1.db.SEPARATOR}${(0, newid_1.default)()}`);
309
- yield db.put(devInfo);
310
- return devInfo.apiKey;
311
- }));
312
- });
313
- }
314
- // APP
315
- createApp(appName) {
316
- return __awaiter(this, void 0, void 0, function* () {
317
- // create dev app
318
- // clear any old app
319
- this.appId = null;
320
- // @ts-ignore
321
- yield backend_core_1.context.updateAppId(null);
322
- this.app = yield this._req({ name: appName }, null, controllers.app.create);
323
- this.appId = this.app.appId;
324
- // @ts-ignore
325
- yield backend_core_1.context.updateAppId(this.appId);
326
- // create production app
327
- this.prodApp = yield this.deploy();
328
- this.allApps.push(this.prodApp);
329
- this.allApps.push(this.app);
330
- return this.app;
331
- });
332
- }
333
- deploy() {
334
- return __awaiter(this, void 0, void 0, function* () {
335
- yield this._req(null, null, controllers.deploy.deployApp);
336
- // @ts-ignore
337
- const prodAppId = this.getAppId().replace("_dev", "");
338
- this.prodAppId = prodAppId;
339
- return backend_core_1.context.doInAppContext(prodAppId, () => __awaiter(this, void 0, void 0, function* () {
340
- const db = backend_core_1.context.getProdAppDB();
341
- return yield db.get(backend_core_1.db.DocumentType.APP_METADATA);
342
- }));
343
- });
344
- }
345
- // TABLE
346
- updateTable(config) {
347
- return __awaiter(this, void 0, void 0, function* () {
348
- config = config || (0, structures_1.basicTable)();
349
- this.table = yield this._req(config, null, controllers.table.save);
350
- return this.table;
351
- });
352
- }
353
- createTable(config) {
354
- return __awaiter(this, void 0, void 0, function* () {
355
- if (config != null && config._id) {
356
- delete config._id;
357
- }
358
- return this.updateTable(config);
359
- });
360
- }
361
- getTable(tableId) {
362
- return __awaiter(this, void 0, void 0, function* () {
363
- tableId = tableId || this.table._id;
364
- return this._req(null, { tableId }, controllers.table.find);
365
- });
366
- }
367
- createLinkedTable(relationshipType, links = ["link"]) {
368
- return __awaiter(this, void 0, void 0, function* () {
369
- if (!this.table) {
370
- throw "Must have created a table first.";
371
- }
372
- const tableConfig = (0, structures_1.basicTable)();
373
- tableConfig.primaryDisplay = "name";
374
- for (let link of links) {
375
- tableConfig.schema[link] = {
376
- type: "link",
377
- fieldName: link,
378
- tableId: this.table._id,
379
- name: link,
380
- };
381
- if (relationshipType) {
382
- tableConfig.schema[link].relationshipType = relationshipType;
383
- }
384
- }
385
- const linkedTable = yield this.createTable(tableConfig);
386
- this.linkedTable = linkedTable;
387
- return linkedTable;
388
- });
389
- }
390
- createAttachmentTable() {
391
- return __awaiter(this, void 0, void 0, function* () {
392
- const table = (0, structures_1.basicTable)();
393
- table.schema.attachment = {
394
- type: "attachment",
395
- };
396
- return this.createTable(table);
397
- });
398
- }
399
- // ROW
400
- createRow(config = null) {
401
- return __awaiter(this, void 0, void 0, function* () {
402
- if (!this.table) {
403
- throw "Test requires table to be configured.";
404
- }
405
- const tableId = (config && config.tableId) || this.table._id;
406
- config = config || (0, structures_1.basicRow)(tableId);
407
- return this._req(config, { tableId }, controllers.row.save);
408
- });
409
- }
410
- getRow(tableId, rowId) {
411
- return __awaiter(this, void 0, void 0, function* () {
412
- return this._req(null, { tableId, rowId }, controllers.row.find);
413
- });
414
- }
415
- getRows(tableId) {
416
- return __awaiter(this, void 0, void 0, function* () {
417
- if (!tableId && this.table) {
418
- tableId = this.table._id;
419
- }
420
- return this._req(null, { tableId }, controllers.row.fetch);
421
- });
422
- }
423
- // ROLE
424
- createRole(config) {
425
- return __awaiter(this, void 0, void 0, function* () {
426
- config = config || (0, structures_1.basicRole)();
427
- return this._req(config, null, controllers.role.save);
428
- });
429
- }
430
- addPermission(roleId, resourceId, level = "read") {
431
- return __awaiter(this, void 0, void 0, function* () {
432
- return this._req(null, {
433
- roleId,
434
- resourceId,
435
- level,
436
- }, controllers.perms.addPermission);
437
- });
438
- }
439
- // VIEW
440
- createView(config) {
441
- return __awaiter(this, void 0, void 0, function* () {
442
- if (!this.table) {
443
- throw "Test requires table to be configured.";
444
- }
445
- const view = config || {
446
- tableId: this.table._id,
447
- name: "ViewTest",
448
- };
449
- return this._req(view, null, controllers.view.save);
450
- });
451
- }
452
- // AUTOMATION
453
- createAutomation(config) {
454
- return __awaiter(this, void 0, void 0, function* () {
455
- config = config || (0, structures_1.basicAutomation)();
456
- if (config._rev) {
457
- delete config._rev;
458
- }
459
- this.automation = (yield this._req(config, null, controllers.automation.create)).automation;
460
- return this.automation;
461
- });
462
- }
463
- getAllAutomations() {
464
- return __awaiter(this, void 0, void 0, function* () {
465
- return this._req(null, null, controllers.automation.fetch);
466
- });
467
- }
468
- deleteAutomation(automation) {
469
- return __awaiter(this, void 0, void 0, function* () {
470
- automation = automation || this.automation;
471
- if (!automation) {
472
- return;
473
- }
474
- return this._req(null, { id: automation._id, rev: automation._rev }, controllers.automation.destroy);
475
- });
476
- }
477
- createWebhook(config) {
478
- return __awaiter(this, void 0, void 0, function* () {
479
- if (!this.automation) {
480
- throw "Must create an automation before creating webhook.";
481
- }
482
- config = config || (0, structures_1.basicWebhook)(this.automation._id);
483
- return (yield this._req(config, null, controllers.webhook.save)).webhook;
484
- });
485
- }
486
- // DATASOURCE
487
- createDatasource(config) {
488
- return __awaiter(this, void 0, void 0, function* () {
489
- config = config || (0, structures_1.basicDatasource)();
490
- const response = yield this._req(config, null, controllers.datasource.save);
491
- this.datasource = response.datasource;
492
- return this.datasource;
493
- });
494
- }
495
- updateDatasource(datasource) {
496
- return __awaiter(this, void 0, void 0, function* () {
497
- const response = yield this._req(datasource, { datasourceId: datasource._id }, controllers.datasource.update);
498
- this.datasource = response.datasource;
499
- return this.datasource;
500
- });
501
- }
502
- restDatasource(cfg) {
503
- return __awaiter(this, void 0, void 0, function* () {
504
- return this.createDatasource({
505
- datasource: Object.assign(Object.assign({}, (0, structures_1.basicDatasource)().datasource), { source: "REST", config: cfg || {} }),
506
- });
507
- });
508
- }
509
- dynamicVariableDatasource() {
510
- return __awaiter(this, void 0, void 0, function* () {
511
- let datasource = yield this.restDatasource();
512
- const basedOnQuery = yield this.createQuery(Object.assign(Object.assign({}, (0, structures_1.basicQuery)(datasource._id)), { fields: {
513
- path: "www.google.com",
514
- } }));
515
- datasource = yield this.updateDatasource(Object.assign(Object.assign({}, datasource), { config: {
516
- dynamicVariables: [
517
- {
518
- queryId: basedOnQuery._id,
519
- name: "variable3",
520
- value: "{{ data.0.[value] }}",
521
- },
522
- ],
523
- } }));
524
- return { datasource, query: basedOnQuery };
525
- });
526
- }
527
- // QUERY
528
- previewQuery(request, config, datasource, fields, params, verb) {
529
- return __awaiter(this, void 0, void 0, function* () {
530
- return request
531
- .post(`/api/queries/preview`)
532
- .send({
533
- datasourceId: datasource._id,
534
- parameters: params || {},
535
- fields,
536
- queryVerb: verb || "read",
537
- name: datasource.name,
538
- })
539
- .set(config.defaultHeaders())
540
- .expect("Content-Type", /json/)
541
- .expect(200);
542
- });
543
- }
544
- createQuery(config) {
545
- return __awaiter(this, void 0, void 0, function* () {
546
- if (!this.datasource && !config) {
547
- throw "No datasource created for query.";
548
- }
549
- config = config || (0, structures_1.basicQuery)(this.datasource._id);
550
- return this._req(config, null, controllers.query.save);
551
- });
552
- }
553
- // SCREEN
554
- createScreen(config) {
555
- return __awaiter(this, void 0, void 0, function* () {
556
- config = config || (0, structures_1.basicScreen)();
557
- return this._req(config, null, controllers.screen.save);
558
- });
559
- }
560
- // LAYOUT
561
- createLayout(config) {
562
- return __awaiter(this, void 0, void 0, function* () {
563
- config = config || (0, structures_1.basicLayout)();
564
- return yield this._req(config, null, controllers.layout.save);
565
- });
566
- }
567
- }
568
- module.exports = TestConfiguration;
@@ -1,40 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.deploy = exports.layout = exports.webhook = exports.screen = exports.query = exports.datasource = exports.automation = exports.user = exports.app = exports.view = exports.perms = exports.role = exports.row = exports.table = void 0;
27
- exports.table = __importStar(require("../../api/controllers/table"));
28
- exports.row = __importStar(require("../../api/controllers/row"));
29
- exports.role = __importStar(require("../../api/controllers/role"));
30
- exports.perms = __importStar(require("../../api/controllers/permission"));
31
- exports.view = __importStar(require("../../api/controllers/view"));
32
- exports.app = __importStar(require("../../api/controllers/application"));
33
- exports.user = __importStar(require("../../api/controllers/user"));
34
- exports.automation = __importStar(require("../../api/controllers/automation"));
35
- exports.datasource = __importStar(require("../../api/controllers/datasource"));
36
- exports.query = __importStar(require("../../api/controllers/query"));
37
- exports.screen = __importStar(require("../../api/controllers/screen"));
38
- exports.webhook = __importStar(require("../../api/controllers/webhook"));
39
- exports.layout = __importStar(require("../../api/controllers/layout"));
40
- exports.deploy = __importStar(require("../../api/controllers/deploy"));