@budibase/server 1.0.49-alpha.1 → 1.0.49-alpha.5

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 (222) hide show
  1. package/__mocks__/arangojs.ts +1 -1
  2. package/__mocks__/aws-sdk.ts +4 -4
  3. package/__mocks__/mongodb.ts +4 -5
  4. package/__mocks__/mssql.ts +3 -3
  5. package/__mocks__/node-fetch.ts +2 -1
  6. package/__mocks__/pg.ts +3 -5
  7. package/builder/assets/{index.ba78c49d.css → index.83c0944f.css} +1 -1
  8. package/builder/assets/{index.ed1cf508.js → index.8f94a789.js} +149 -149
  9. package/builder/index.html +2 -2
  10. package/coverage/clover.xml +989 -1020
  11. package/coverage/coverage-final.json +90 -91
  12. package/coverage/lcov-report/api/controllers/analytics.js.html +1 -1
  13. package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
  14. package/coverage/lcov-report/api/controllers/application.js.html +106 -106
  15. package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
  16. package/coverage/lcov-report/api/controllers/automation.js.html +21 -21
  17. package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
  18. package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
  19. package/coverage/lcov-report/api/controllers/component.js.html +1 -1
  20. package/coverage/lcov-report/api/controllers/datasource.js.html +16 -16
  21. package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
  22. package/coverage/lcov-report/api/controllers/index.html +27 -12
  23. package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
  24. package/coverage/lcov-report/api/controllers/layout.js.html +6 -6
  25. package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
  26. package/coverage/lcov-report/{migrations/usageQuotas/syncApps.js.html → api/controllers/migrations.js.html} +30 -45
  27. package/coverage/lcov-report/api/controllers/permission.js.html +15 -15
  28. package/coverage/lcov-report/api/controllers/query/index.html +1 -1
  29. package/coverage/lcov-report/api/controllers/query/index.js.html +19 -19
  30. package/coverage/lcov-report/api/controllers/query/validation.js.html +6 -6
  31. package/coverage/lcov-report/api/controllers/role.js.html +9 -9
  32. package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
  33. package/coverage/lcov-report/api/controllers/row/external.js.html +16 -16
  34. package/coverage/lcov-report/api/controllers/row/index.html +1 -1
  35. package/coverage/lcov-report/api/controllers/row/index.js.html +13 -13
  36. package/coverage/lcov-report/api/controllers/row/internal.js.html +26 -26
  37. package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +8 -8
  38. package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +10 -10
  39. package/coverage/lcov-report/api/controllers/row/utils.js.html +13 -13
  40. package/coverage/lcov-report/api/controllers/screen.js.html +7 -7
  41. package/coverage/lcov-report/api/controllers/script.js.html +4 -4
  42. package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +9 -9
  43. package/coverage/lcov-report/api/controllers/table/external.js.html +12 -12
  44. package/coverage/lcov-report/api/controllers/table/index.html +1 -1
  45. package/coverage/lcov-report/api/controllers/table/index.js.html +14 -14
  46. package/coverage/lcov-report/api/controllers/table/internal.js.html +12 -12
  47. package/coverage/lcov-report/api/controllers/table/utils.js.html +30 -30
  48. package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
  49. package/coverage/lcov-report/api/controllers/user.js.html +20 -20
  50. package/coverage/lcov-report/api/controllers/view/exporters.js.html +4 -4
  51. package/coverage/lcov-report/api/controllers/view/index.html +1 -1
  52. package/coverage/lcov-report/api/controllers/view/index.js.html +14 -14
  53. package/coverage/lcov-report/api/controllers/view/utils.js.html +11 -11
  54. package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +7 -7
  55. package/coverage/lcov-report/api/controllers/webhook.js.html +15 -15
  56. package/coverage/lcov-report/api/index.html +1 -1
  57. package/coverage/lcov-report/api/index.js.html +3 -3
  58. package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
  59. package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
  60. package/coverage/lcov-report/api/routes/application.js.html +1 -1
  61. package/coverage/lcov-report/api/routes/auth.js.html +1 -1
  62. package/coverage/lcov-report/api/routes/automation.js.html +1 -1
  63. package/coverage/lcov-report/api/routes/backup.js.html +1 -1
  64. package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
  65. package/coverage/lcov-report/api/routes/component.js.html +1 -1
  66. package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
  67. package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
  68. package/coverage/lcov-report/api/routes/dev.js.html +1 -1
  69. package/coverage/lcov-report/api/routes/index.html +22 -7
  70. package/coverage/lcov-report/api/routes/index.js.html +10 -4
  71. package/coverage/lcov-report/api/routes/integration.js.html +1 -1
  72. package/coverage/lcov-report/api/routes/layout.js.html +1 -1
  73. package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
  74. package/coverage/lcov-report/{migrations/usageQuotas/index.js.html → api/routes/migrations.js.html} +25 -55
  75. package/coverage/lcov-report/api/routes/permission.js.html +1 -1
  76. package/coverage/lcov-report/api/routes/query.js.html +1 -1
  77. package/coverage/lcov-report/api/routes/role.js.html +1 -1
  78. package/coverage/lcov-report/api/routes/routing.js.html +1 -1
  79. package/coverage/lcov-report/api/routes/row.js.html +1 -1
  80. package/coverage/lcov-report/api/routes/screen.js.html +1 -1
  81. package/coverage/lcov-report/api/routes/script.js.html +1 -1
  82. package/coverage/lcov-report/api/routes/static.js.html +1 -1
  83. package/coverage/lcov-report/api/routes/table.js.html +1 -1
  84. package/coverage/lcov-report/api/routes/templates.js.html +1 -1
  85. package/coverage/lcov-report/api/routes/user.js.html +1 -1
  86. package/coverage/lcov-report/api/routes/view.js.html +1 -1
  87. package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
  88. package/coverage/lcov-report/automations/actions.js.html +24 -24
  89. package/coverage/lcov-report/automations/automationUtils.js.html +5 -5
  90. package/coverage/lcov-report/automations/bullboard.js.html +16 -16
  91. package/coverage/lcov-report/automations/index.html +1 -1
  92. package/coverage/lcov-report/automations/index.js.html +1 -1
  93. package/coverage/lcov-report/automations/steps/bash.js.html +6 -6
  94. package/coverage/lcov-report/automations/steps/createRow.js.html +7 -7
  95. package/coverage/lcov-report/automations/steps/delay.js.html +4 -4
  96. package/coverage/lcov-report/automations/steps/deleteRow.js.html +7 -7
  97. package/coverage/lcov-report/automations/steps/discord.js.html +7 -7
  98. package/coverage/lcov-report/automations/steps/executeQuery.js.html +6 -6
  99. package/coverage/lcov-report/automations/steps/executeScript.js.html +6 -6
  100. package/coverage/lcov-report/automations/steps/filter.js.html +7 -7
  101. package/coverage/lcov-report/automations/steps/index.html +1 -1
  102. package/coverage/lcov-report/automations/steps/integromat.js.html +5 -5
  103. package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +8 -8
  104. package/coverage/lcov-report/automations/steps/queryRows.js.html +10 -10
  105. package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +5 -5
  106. package/coverage/lcov-report/automations/steps/serverLog.js.html +3 -3
  107. package/coverage/lcov-report/automations/steps/slack.js.html +5 -5
  108. package/coverage/lcov-report/automations/steps/updateRow.js.html +6 -6
  109. package/coverage/lcov-report/automations/steps/utils.js.html +3 -3
  110. package/coverage/lcov-report/automations/steps/zapier.js.html +5 -5
  111. package/coverage/lcov-report/automations/triggerInfo/app.js.html +2 -2
  112. package/coverage/lcov-report/automations/triggerInfo/cron.js.html +2 -2
  113. package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
  114. package/coverage/lcov-report/automations/triggerInfo/index.js.html +8 -8
  115. package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +2 -2
  116. package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +2 -2
  117. package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +2 -2
  118. package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +2 -2
  119. package/coverage/lcov-report/automations/triggers.js.html +18 -18
  120. package/coverage/lcov-report/automations/utils.js.html +32 -32
  121. package/coverage/lcov-report/constants/index.html +1 -1
  122. package/coverage/lcov-report/constants/index.js.html +26 -26
  123. package/coverage/lcov-report/constants/layouts.js.html +5 -5
  124. package/coverage/lcov-report/constants/screens.js.html +4 -4
  125. package/coverage/lcov-report/db/client.js.html +18 -18
  126. package/coverage/lcov-report/db/inMemoryView.js.html +7 -7
  127. package/coverage/lcov-report/db/index.html +1 -1
  128. package/coverage/lcov-report/db/index.js.html +3 -3
  129. package/coverage/lcov-report/db/linkedRows/LinkController.js.html +7 -7
  130. package/coverage/lcov-report/db/linkedRows/index.html +1 -1
  131. package/coverage/lcov-report/db/linkedRows/index.js.html +18 -18
  132. package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +13 -13
  133. package/coverage/lcov-report/db/newid.js.html +4 -4
  134. package/coverage/lcov-report/db/utils.js.html +70 -70
  135. package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
  136. package/coverage/lcov-report/events/index.html +1 -1
  137. package/coverage/lcov-report/events/index.js.html +5 -5
  138. package/coverage/lcov-report/events/utils.js.html +3 -3
  139. package/coverage/lcov-report/index.html +26 -41
  140. package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
  141. package/coverage/lcov-report/integrations/tests/index.html +1 -1
  142. package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
  143. package/coverage/lcov-report/middleware/authorized.js.html +1 -1
  144. package/coverage/lcov-report/middleware/builder.js.html +1 -1
  145. package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
  146. package/coverage/lcov-report/middleware/index.html +11 -11
  147. package/coverage/lcov-report/middleware/joi-validator.js.html +3 -3
  148. package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
  149. package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
  150. package/coverage/lcov-report/middleware/usageQuota.js.html +6 -12
  151. package/coverage/lcov-report/middleware/utils.js.html +1 -1
  152. package/coverage/lcov-report/threads/automation.js.html +1 -1
  153. package/coverage/lcov-report/threads/index.html +1 -1
  154. package/coverage/lcov-report/threads/index.js.html +10 -10
  155. package/coverage/lcov-report/threads/query.js.html +1 -1
  156. package/coverage/lcov-report/threads/utils.js.html +14 -14
  157. package/coverage/lcov-report/utilities/bcrypt.js.html +1 -1
  158. package/coverage/lcov-report/utilities/budibaseDir.js.html +7 -7
  159. package/coverage/lcov-report/utilities/centralPath.js.html +4 -4
  160. package/coverage/lcov-report/utilities/csvParser.js.html +6 -6
  161. package/coverage/lcov-report/utilities/global.js.html +14 -14
  162. package/coverage/lcov-report/utilities/index.html +1 -1
  163. package/coverage/lcov-report/utilities/index.js.html +24 -24
  164. package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +8 -8
  165. package/coverage/lcov-report/utilities/queue/index.html +1 -1
  166. package/coverage/lcov-report/utilities/routing/index.html +1 -1
  167. package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
  168. package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
  169. package/coverage/lcov-report/utilities/rowProcessor/index.js.html +18 -18
  170. package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +4 -4
  171. package/coverage/lcov-report/utilities/scriptRunner.js.html +5 -5
  172. package/coverage/lcov-report/utilities/security.js.html +8 -8
  173. package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
  174. package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
  175. package/coverage/lcov-report/utilities/usageQuota/index.js.html +10 -10
  176. package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
  177. package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
  178. package/coverage/lcov-report/utilities/users.js.html +5 -5
  179. package/coverage/lcov-report/utilities/workerRequests.js.html +12 -12
  180. package/coverage/lcov.info +1128 -1176
  181. package/dist/api/controllers/application.js +18 -20
  182. package/dist/api/controllers/migrations.js +21 -0
  183. package/dist/api/routes/index.js +2 -0
  184. package/dist/api/routes/migrations.js +9 -0
  185. package/dist/app.js +35 -5
  186. package/dist/environment.js +1 -0
  187. package/dist/middleware/usageQuota.js +0 -2
  188. package/dist/migrations/functions/appUrls.js +46 -0
  189. package/dist/migrations/functions/quotas1.js +50 -0
  190. package/dist/migrations/{usageQuotas → functions/usageQuotas}/index.js +6 -10
  191. package/dist/migrations/{usageQuotas → functions/usageQuotas}/syncApps.js +11 -5
  192. package/dist/migrations/{usageQuotas → functions/usageQuotas}/syncRows.js +14 -8
  193. package/dist/migrations/functions/userEmailViewCasing.js +24 -0
  194. package/dist/migrations/index.js +62 -0
  195. package/dist/package.json +4 -4
  196. package/dist/tests/utilities/TestConfiguration.js +3 -0
  197. package/dist/tsconfig.tsbuildinfo +1 -1
  198. package/package.json +5 -5
  199. package/scripts/likeCypress.ts +1 -1
  200. package/src/api/controllers/application.js +3 -3
  201. package/src/api/controllers/migrations.js +13 -0
  202. package/src/api/routes/index.js +2 -0
  203. package/src/api/routes/migrations.js +14 -0
  204. package/src/app.ts +18 -5
  205. package/src/environment.js +1 -0
  206. package/src/middleware/usageQuota.js +0 -2
  207. package/src/migrations/functions/appUrls.ts +34 -0
  208. package/src/migrations/functions/quotas1.ts +20 -0
  209. package/src/migrations/functions/tests/appUrls.spec.js +29 -0
  210. package/src/migrations/{tests/usageQuotas/index.spec.js → functions/tests/quotas1.spec.js} +5 -5
  211. package/src/migrations/functions/tests/userEmailViewCasing.spec.js +25 -0
  212. package/src/migrations/functions/usageQuotas/index.ts +8 -0
  213. package/src/migrations/{usageQuotas/syncApps.js → functions/usageQuotas/syncApps.ts} +3 -3
  214. package/src/migrations/{usageQuotas/syncRows.js → functions/usageQuotas/syncRows.ts} +5 -5
  215. package/src/migrations/{tests/usageQuotas → functions/usageQuotas/tests}/syncApps.spec.js +4 -4
  216. package/src/migrations/{tests/usageQuotas → functions/usageQuotas/tests}/syncRows.spec.js +4 -4
  217. package/src/migrations/functions/userEmailViewCasing.ts +13 -0
  218. package/src/migrations/index.ts +56 -0
  219. package/src/tests/utilities/TestConfiguration.js +4 -0
  220. package/coverage/lcov-report/migrations/usageQuotas/index.html +0 -141
  221. package/coverage/lcov-report/migrations/usageQuotas/syncRows.js.html +0 -143
  222. package/src/migrations/usageQuotas/index.js +0 -24
@@ -9,7 +9,7 @@ module ArangoMock {
9
9
  this.close = jest.fn()
10
10
  }
11
11
 
12
- // @ts-ignore
12
+ // @ts-ignore
13
13
  arangodb.aql = (strings, ...args) => {
14
14
  let str = strings.join("{}")
15
15
 
@@ -1,7 +1,7 @@
1
1
  module AwsMock {
2
2
  const aws: any = {}
3
3
 
4
- const response = (body: any) => () => ({promise: () => body})
4
+ const response = (body: any) => () => ({ promise: () => body })
5
5
 
6
6
  function DocumentClient() {
7
7
  // @ts-ignore
@@ -39,9 +39,9 @@ module AwsMock {
39
39
  )
40
40
  }
41
41
 
42
- aws.DynamoDB = {DocumentClient}
42
+ aws.DynamoDB = { DocumentClient }
43
43
  aws.S3 = S3
44
- aws.config = {update: jest.fn()}
44
+ aws.config = { update: jest.fn() }
45
45
 
46
46
  module.exports = aws
47
- }
47
+ }
@@ -5,15 +5,14 @@ module MongoMock {
5
5
  this.connect = jest.fn()
6
6
  this.close = jest.fn()
7
7
  this.insertOne = jest.fn()
8
- this.insertMany = jest.fn(() => ({toArray: () => []}))
9
- this.find = jest.fn(() => ({toArray: () => []}))
8
+ this.insertMany = jest.fn(() => ({ toArray: () => [] }))
9
+ this.find = jest.fn(() => ({ toArray: () => [] }))
10
10
  this.findOne = jest.fn()
11
11
  this.count = jest.fn()
12
12
  this.deleteOne = jest.fn()
13
- this.deleteMany = jest.fn(() => ({toArray: () => []}))
13
+ this.deleteMany = jest.fn(() => ({ toArray: () => [] }))
14
14
  this.updateOne = jest.fn()
15
- this.updateMany = jest.fn(() => ({toArray: () => []}))
16
-
15
+ this.updateMany = jest.fn(() => ({ toArray: () => [] }))
17
16
 
18
17
  this.collection = jest.fn(() => ({
19
18
  insertOne: this.insertOne,
@@ -10,15 +10,15 @@ module MsSqlMock {
10
10
  ],
11
11
  }))
12
12
 
13
- // mssql.connect = jest.fn(() => ({ recordset: [] }))
13
+ // mssql.connect = jest.fn(() => ({ recordset: [] }))
14
14
 
15
15
  mssql.ConnectionPool = jest.fn(() => ({
16
16
  connect: jest.fn(() => ({
17
17
  request: jest.fn(() => ({
18
- query: jest.fn(sql => ({ recordset: [ sql ] })),
18
+ query: jest.fn(sql => ({ recordset: [sql] })),
19
19
  })),
20
20
  })),
21
21
  }))
22
22
 
23
23
  module.exports = mssql
24
- }
24
+ }
@@ -62,7 +62,8 @@ module FetchMock {
62
62
  return json({
63
63
  url,
64
64
  opts,
65
- value: "<!doctype html><html itemscope=\"\" itemtype=\"http://schema.org/WebPage\" lang=\"en-GB\"></html>",
65
+ value:
66
+ '<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en-GB"></html>',
66
67
  })
67
68
  } else if (url.includes("failonce.com")) {
68
69
  failCount++
package/__mocks__/pg.ts CHANGED
@@ -10,16 +10,14 @@ module PgMock {
10
10
  ],
11
11
  }))
12
12
 
13
- // constructor
14
- function Client() {
15
- }
13
+ // constructor
14
+ function Client() {}
16
15
 
17
16
  Client.prototype.query = query
18
17
  Client.prototype.connect = jest.fn()
19
18
  Client.prototype.release = jest.fn()
20
19
 
21
- function Pool() {
22
- }
20
+ function Pool() {}
23
21
 
24
22
  const on = jest.fn()
25
23
  Pool.prototype.query = query