@budibase/backend-core 2.5.6-alpha.6 → 2.5.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 (396) hide show
  1. package/dist/package.json +10 -12
  2. package/dist/src/cache/writethrough.js +1 -1
  3. package/dist/src/cache/writethrough.js.map +1 -1
  4. package/dist/src/configs/configs.d.ts +1 -2
  5. package/dist/src/configs/configs.js +1 -9
  6. package/dist/src/configs/configs.js.map +1 -1
  7. package/dist/src/constants/misc.d.ts +2 -4
  8. package/dist/src/constants/misc.js +0 -2
  9. package/dist/src/constants/misc.js.map +1 -1
  10. package/dist/src/context/mainContext.d.ts +1 -4
  11. package/dist/src/context/mainContext.js +3 -20
  12. package/dist/src/context/mainContext.js.map +1 -1
  13. package/dist/src/context/types.d.ts +0 -1
  14. package/dist/src/db/conversions.js.map +1 -0
  15. package/dist/src/db/couch/DatabaseImpl.js +1 -1
  16. package/dist/src/db/couch/DatabaseImpl.js.map +1 -1
  17. package/dist/src/db/index.d.ts +1 -2
  18. package/dist/src/db/index.js +2 -15
  19. package/dist/src/db/index.js.map +1 -1
  20. package/dist/src/db/lucene.d.ts +14 -8
  21. package/dist/src/db/lucene.js +86 -152
  22. package/dist/src/db/lucene.js.map +1 -1
  23. package/dist/src/db/utils.d.ts +126 -5
  24. package/dist/src/db/utils.js +232 -20
  25. package/dist/src/db/utils.js.map +1 -1
  26. package/dist/src/db/views.js +1 -16
  27. package/dist/src/db/views.js.map +1 -1
  28. package/dist/src/environment.d.ts +2 -2
  29. package/dist/src/environment.js +2 -9
  30. package/dist/src/environment.js.map +1 -1
  31. package/dist/src/errors/errors.d.ts +0 -3
  32. package/dist/src/errors/errors.js +1 -8
  33. package/dist/src/errors/errors.js.map +1 -1
  34. package/dist/src/events/events.js +0 -9
  35. package/dist/src/events/events.js.map +1 -1
  36. package/dist/src/events/identification.js +0 -1
  37. package/dist/src/events/identification.js.map +1 -1
  38. package/dist/src/events/index.d.ts +0 -1
  39. package/dist/src/events/index.js +1 -3
  40. package/dist/src/events/index.js.map +1 -1
  41. package/dist/src/events/processors/LoggingProcessor.js +17 -3
  42. package/dist/src/events/processors/LoggingProcessor.js.map +1 -1
  43. package/dist/src/events/processors/Processors.js +3 -9
  44. package/dist/src/events/processors/Processors.js.map +1 -1
  45. package/dist/src/events/processors/types.d.ts +11 -1
  46. package/dist/src/events/processors/types.js +6 -0
  47. package/dist/src/events/processors/types.js.map +1 -1
  48. package/dist/src/events/publishers/group.js +0 -6
  49. package/dist/src/events/publishers/group.js.map +1 -1
  50. package/dist/src/events/publishers/user.js +0 -4
  51. package/dist/src/events/publishers/user.js.map +1 -1
  52. package/dist/src/index.d.ts +1 -5
  53. package/dist/src/index.js +1 -2
  54. package/dist/src/index.js.map +1 -1
  55. package/dist/src/{logging/alerts.d.ts → logging.d.ts} +5 -0
  56. package/dist/src/logging.js +56 -0
  57. package/dist/src/logging.js.map +1 -0
  58. package/dist/src/middleware/authenticated.js +2 -5
  59. package/dist/src/middleware/authenticated.js.map +1 -1
  60. package/dist/src/middleware/errorHandling.js +7 -5
  61. package/dist/src/middleware/errorHandling.js.map +1 -1
  62. package/dist/src/middleware/index.d.ts +1 -2
  63. package/dist/src/middleware/index.js +3 -5
  64. package/dist/src/middleware/index.js.map +1 -1
  65. package/dist/src/middleware/logging.d.ts +2 -0
  66. package/dist/src/middleware/logging.js +106 -0
  67. package/dist/src/middleware/logging.js.map +1 -0
  68. package/dist/src/middleware/passport/sso/oidc.js +5 -2
  69. package/dist/src/middleware/passport/sso/oidc.js.map +1 -1
  70. package/dist/src/migrations/migrations.js +4 -4
  71. package/dist/src/migrations/migrations.js.map +1 -1
  72. package/dist/src/newid.js.map +1 -0
  73. package/dist/src/objectStore/objectStore.js +3 -3
  74. package/dist/src/objectStore/objectStore.js.map +1 -1
  75. package/dist/src/plugin/utils.js +2 -53
  76. package/dist/src/plugin/utils.js.map +1 -1
  77. package/dist/src/queue/constants.d.ts +1 -2
  78. package/dist/src/queue/constants.js +0 -1
  79. package/dist/src/queue/constants.js.map +1 -1
  80. package/dist/src/security/encryption.d.ts +0 -1
  81. package/dist/src/security/encryption.js +1 -2
  82. package/dist/src/security/encryption.js.map +1 -1
  83. package/dist/src/security/permissions.d.ts +2 -35
  84. package/dist/src/security/permissions.js +6 -9
  85. package/dist/src/security/permissions.js.map +1 -1
  86. package/dist/src/tenancy/tenancy.js +5 -1
  87. package/dist/src/tenancy/tenancy.js.map +1 -1
  88. package/dist/src/users.d.ts +1 -10
  89. package/dist/src/users.js +1 -35
  90. package/dist/src/users.js.map +1 -1
  91. package/dist/src/utils/hashing.d.ts +1 -1
  92. package/dist/src/utils/hashing.js +1 -1
  93. package/dist/src/utils/hashing.js.map +1 -1
  94. package/dist/src/utils/index.d.ts +0 -1
  95. package/dist/src/utils/index.js +0 -1
  96. package/dist/src/utils/index.js.map +1 -1
  97. package/dist/tests/index.d.ts +1 -1
  98. package/dist/tests/index.js +1 -1
  99. package/dist/tests/index.js.map +1 -1
  100. package/dist/tests/jestEnv.js +1 -0
  101. package/dist/tests/jestEnv.js.map +1 -1
  102. package/dist/tests/jestSetup.d.ts +1 -1
  103. package/dist/tests/jestSetup.js +2 -2
  104. package/dist/tests/jestSetup.js.map +1 -1
  105. package/dist/tests/logging.js.map +1 -0
  106. package/dist/tests/{extra → utilities}/DBTestConfiguration.d.ts +1 -1
  107. package/dist/tests/{extra → utilities}/DBTestConfiguration.js +2 -2
  108. package/dist/tests/utilities/DBTestConfiguration.js.map +1 -0
  109. package/dist/tests/{core/utilities → utilities}/index.d.ts +2 -0
  110. package/dist/tests/{core/utilities → utilities}/index.js +7 -1
  111. package/dist/tests/utilities/index.js.map +1 -0
  112. package/dist/tests/utilities/jestUtils.js.map +1 -0
  113. package/dist/tests/utilities/mocks/date.js.map +1 -0
  114. package/dist/tests/utilities/mocks/events.d.ts +1 -0
  115. package/dist/tests/utilities/mocks/events.js +126 -0
  116. package/dist/tests/utilities/mocks/events.js.map +1 -0
  117. package/dist/tests/utilities/mocks/fetch.d.ts +31 -0
  118. package/dist/tests/utilities/mocks/fetch.js +8 -0
  119. package/dist/tests/utilities/mocks/fetch.js.map +1 -0
  120. package/dist/tests/{core/utilities → utilities}/mocks/index.d.ts +3 -4
  121. package/dist/tests/{core/utilities → utilities}/mocks/index.js +3 -7
  122. package/dist/tests/utilities/mocks/index.js.map +1 -0
  123. package/dist/tests/{core/utilities → utilities}/mocks/licenses.d.ts +0 -1
  124. package/dist/tests/{core/utilities → utilities}/mocks/licenses.js +1 -5
  125. package/dist/tests/utilities/mocks/licenses.js.map +1 -0
  126. package/dist/tests/utilities/mocks/posthog.js.map +1 -0
  127. package/dist/tests/{core/utilities → utilities}/structures/accounts.js +25 -2
  128. package/dist/tests/utilities/structures/accounts.js.map +1 -0
  129. package/dist/tests/{core/utilities → utilities}/structures/apps.js +1 -1
  130. package/dist/tests/utilities/structures/apps.js.map +1 -0
  131. package/dist/tests/utilities/structures/common.js.map +1 -0
  132. package/dist/tests/{core/utilities → utilities}/structures/db.js +1 -1
  133. package/dist/tests/utilities/structures/db.js.map +1 -0
  134. package/dist/tests/utilities/structures/generator.js.map +1 -0
  135. package/dist/tests/{core/utilities → utilities}/structures/index.d.ts +0 -1
  136. package/dist/tests/{core/utilities → utilities}/structures/index.js +1 -2
  137. package/dist/tests/utilities/structures/index.js.map +1 -0
  138. package/dist/tests/utilities/structures/koa.js.map +1 -0
  139. package/dist/tests/utilities/structures/licenses.js.map +1 -0
  140. package/dist/tests/utilities/structures/plugins.js.map +1 -0
  141. package/dist/tests/utilities/structures/shared.js.map +1 -0
  142. package/dist/tests/utilities/structures/sso.js.map +1 -0
  143. package/dist/tests/{core/utilities → utilities}/structures/tenants.js +1 -1
  144. package/dist/tests/utilities/structures/tenants.js.map +1 -0
  145. package/dist/tests/utilities/structures/userGroups.js.map +1 -0
  146. package/dist/tests/utilities/structures/users.js.map +1 -0
  147. package/dist/tests/utilities/testContainerUtils.js.map +1 -0
  148. package/dist/tests/{extra → utilities}/testEnv.js +1 -1
  149. package/dist/tests/utilities/testEnv.js.map +1 -0
  150. package/dist/tsconfig.build.tsbuildinfo +1 -1
  151. package/package.json +10 -12
  152. package/src/auth/tests/auth.spec.ts +1 -2
  153. package/src/cache/tests/writethrough.spec.ts +3 -4
  154. package/src/cache/writethrough.ts +2 -1
  155. package/src/configs/configs.ts +0 -9
  156. package/src/configs/tests/configs.spec.ts +6 -2
  157. package/src/constants/misc.ts +0 -2
  158. package/src/context/mainContext.ts +2 -19
  159. package/src/context/tests/index.spec.ts +3 -16
  160. package/src/context/types.ts +0 -1
  161. package/src/db/couch/DatabaseImpl.ts +1 -1
  162. package/src/db/index.ts +1 -2
  163. package/src/db/lucene.ts +88 -143
  164. package/src/db/tests/lucene.spec.ts +1 -101
  165. package/src/db/tests/utils.spec.ts +1 -1
  166. package/src/db/utils.ts +275 -7
  167. package/src/db/views.ts +2 -18
  168. package/src/environment.ts +2 -11
  169. package/src/errors/errors.ts +0 -8
  170. package/src/events/events.ts +1 -10
  171. package/src/events/identification.ts +0 -1
  172. package/src/events/index.ts +0 -2
  173. package/src/events/processors/LoggingProcessor.ts +22 -3
  174. package/src/events/processors/Processors.ts +3 -9
  175. package/src/events/processors/posthog/tests/PosthogProcessor.spec.ts +1 -1
  176. package/src/events/processors/types.ts +18 -1
  177. package/src/events/publishers/group.ts +1 -6
  178. package/src/events/publishers/user.ts +0 -4
  179. package/src/index.ts +0 -1
  180. package/src/logging.ts +60 -0
  181. package/src/middleware/authenticated.ts +2 -8
  182. package/src/middleware/errorHandling.ts +4 -4
  183. package/src/middleware/index.ts +1 -2
  184. package/src/middleware/logging.ts +90 -0
  185. package/src/middleware/passport/sso/oidc.ts +9 -2
  186. package/src/middleware/passport/sso/tests/sso.spec.ts +1 -2
  187. package/src/migrations/migrations.ts +8 -4
  188. package/src/migrations/tests/__snapshots__/migrations.spec.ts.snap +1 -1
  189. package/src/migrations/tests/migrations.spec.ts +1 -1
  190. package/src/objectStore/buckets/tests/app.spec.ts +1 -1
  191. package/src/objectStore/buckets/tests/global.spec.ts +1 -1
  192. package/src/objectStore/buckets/tests/plugins.spec.ts +1 -2
  193. package/src/objectStore/objectStore.ts +3 -3
  194. package/src/platform/tests/tenants.spec.ts +1 -2
  195. package/src/plugin/utils.ts +3 -63
  196. package/src/queue/constants.ts +0 -1
  197. package/src/security/encryption.ts +1 -1
  198. package/src/security/permissions.ts +5 -5
  199. package/src/tenancy/tenancy.ts +2 -2
  200. package/src/users.ts +1 -41
  201. package/src/utils/hashing.ts +1 -1
  202. package/src/utils/index.ts +0 -1
  203. package/src/utils/tests/utils.spec.ts +1 -2
  204. package/tests/index.ts +1 -1
  205. package/tests/jestEnv.ts +1 -0
  206. package/tests/jestSetup.ts +2 -2
  207. package/tests/{extra → utilities}/DBTestConfiguration.ts +2 -2
  208. package/tests/{core/utilities → utilities}/index.ts +3 -0
  209. package/tests/utilities/mocks/events.ts +122 -0
  210. package/tests/utilities/mocks/fetch.ts +10 -0
  211. package/tests/{core/utilities → utilities}/mocks/index.ts +3 -4
  212. package/tests/{core/utilities → utilities}/mocks/licenses.ts +0 -4
  213. package/tests/{core/utilities → utilities}/structures/accounts.ts +2 -2
  214. package/tests/{core/utilities → utilities}/structures/apps.ts +1 -1
  215. package/tests/{core/utilities → utilities}/structures/db.ts +1 -1
  216. package/tests/{core/utilities → utilities}/structures/index.ts +0 -1
  217. package/tests/{core/utilities → utilities}/structures/tenants.ts +1 -1
  218. package/tests/{extra → utilities}/testEnv.ts +1 -1
  219. package/dist/src/db/searchIndexes/index.d.ts +0 -1
  220. package/dist/src/db/searchIndexes/index.js +0 -18
  221. package/dist/src/db/searchIndexes/index.js.map +0 -1
  222. package/dist/src/db/searchIndexes/searchIndexes.d.ts +0 -1
  223. package/dist/src/db/searchIndexes/searchIndexes.js +0 -77
  224. package/dist/src/db/searchIndexes/searchIndexes.js.map +0 -1
  225. package/dist/src/docIds/conversions.js.map +0 -1
  226. package/dist/src/docIds/ids.d.ts +0 -53
  227. package/dist/src/docIds/ids.js +0 -101
  228. package/dist/src/docIds/ids.js.map +0 -1
  229. package/dist/src/docIds/index.d.ts +0 -2
  230. package/dist/src/docIds/index.js +0 -19
  231. package/dist/src/docIds/index.js.map +0 -1
  232. package/dist/src/docIds/newid.js.map +0 -1
  233. package/dist/src/docIds/params.d.ts +0 -69
  234. package/dist/src/docIds/params.js +0 -138
  235. package/dist/src/docIds/params.js.map +0 -1
  236. package/dist/src/docUpdates/index.d.ts +0 -2
  237. package/dist/src/docUpdates/index.js +0 -36
  238. package/dist/src/docUpdates/index.js.map +0 -1
  239. package/dist/src/events/asyncEvents/index.d.ts +0 -2
  240. package/dist/src/events/asyncEvents/index.js +0 -19
  241. package/dist/src/events/asyncEvents/index.js.map +0 -1
  242. package/dist/src/events/asyncEvents/publisher.d.ts +0 -2
  243. package/dist/src/events/asyncEvents/publisher.js +0 -27
  244. package/dist/src/events/asyncEvents/publisher.js.map +0 -1
  245. package/dist/src/events/asyncEvents/queue.d.ts +0 -11
  246. package/dist/src/events/asyncEvents/queue.js +0 -26
  247. package/dist/src/events/asyncEvents/queue.js.map +0 -1
  248. package/dist/src/events/documentId.d.ts +0 -2
  249. package/dist/src/events/documentId.js +0 -28
  250. package/dist/src/events/documentId.js.map +0 -1
  251. package/dist/src/events/processors/async/DocumentUpdateProcessor.d.ts +0 -13
  252. package/dist/src/events/processors/async/DocumentUpdateProcessor.js +0 -44
  253. package/dist/src/events/processors/async/DocumentUpdateProcessor.js.map +0 -1
  254. package/dist/src/logging/alerts.js +0 -24
  255. package/dist/src/logging/alerts.js.map +0 -1
  256. package/dist/src/logging/correlation/correlation.d.ts +0 -2
  257. package/dist/src/logging/correlation/correlation.js +0 -17
  258. package/dist/src/logging/correlation/correlation.js.map +0 -1
  259. package/dist/src/logging/correlation/index.d.ts +0 -1
  260. package/dist/src/logging/correlation/index.js +0 -18
  261. package/dist/src/logging/correlation/index.js.map +0 -1
  262. package/dist/src/logging/correlation/middleware.d.ts +0 -2
  263. package/dist/src/logging/correlation/middleware.js +0 -17
  264. package/dist/src/logging/correlation/middleware.js.map +0 -1
  265. package/dist/src/logging/index.d.ts +0 -4
  266. package/dist/src/logging/index.js +0 -37
  267. package/dist/src/logging/index.js.map +0 -1
  268. package/dist/src/logging/pino/logger.d.ts +0 -3
  269. package/dist/src/logging/pino/logger.js +0 -181
  270. package/dist/src/logging/pino/logger.js.map +0 -1
  271. package/dist/src/logging/pino/middleware.d.ts +0 -4
  272. package/dist/src/logging/pino/middleware.js +0 -47
  273. package/dist/src/logging/pino/middleware.js.map +0 -1
  274. package/dist/src/utils/stringUtils.d.ts +0 -1
  275. package/dist/src/utils/stringUtils.js +0 -9
  276. package/dist/src/utils/stringUtils.js.map +0 -1
  277. package/dist/tests/core/logging.js.map +0 -1
  278. package/dist/tests/core/utilities/index.js.map +0 -1
  279. package/dist/tests/core/utilities/jestUtils.js.map +0 -1
  280. package/dist/tests/core/utilities/mocks/alerts.d.ts +0 -3
  281. package/dist/tests/core/utilities/mocks/alerts.js +0 -30
  282. package/dist/tests/core/utilities/mocks/alerts.js.map +0 -1
  283. package/dist/tests/core/utilities/mocks/date.js.map +0 -1
  284. package/dist/tests/core/utilities/mocks/events.d.ts +0 -0
  285. package/dist/tests/core/utilities/mocks/events.js +0 -136
  286. package/dist/tests/core/utilities/mocks/events.js.map +0 -1
  287. package/dist/tests/core/utilities/mocks/fetch.d.ts +0 -33
  288. package/dist/tests/core/utilities/mocks/fetch.js +0 -15
  289. package/dist/tests/core/utilities/mocks/fetch.js.map +0 -1
  290. package/dist/tests/core/utilities/mocks/index.js.map +0 -1
  291. package/dist/tests/core/utilities/mocks/licenses.js.map +0 -1
  292. package/dist/tests/core/utilities/mocks/posthog.js.map +0 -1
  293. package/dist/tests/core/utilities/structures/accounts.js.map +0 -1
  294. package/dist/tests/core/utilities/structures/apps.js.map +0 -1
  295. package/dist/tests/core/utilities/structures/common.js.map +0 -1
  296. package/dist/tests/core/utilities/structures/db.js.map +0 -1
  297. package/dist/tests/core/utilities/structures/generator.js.map +0 -1
  298. package/dist/tests/core/utilities/structures/index.js.map +0 -1
  299. package/dist/tests/core/utilities/structures/koa.js.map +0 -1
  300. package/dist/tests/core/utilities/structures/licenses.js.map +0 -1
  301. package/dist/tests/core/utilities/structures/plugins.js.map +0 -1
  302. package/dist/tests/core/utilities/structures/scim.d.ts +0 -14
  303. package/dist/tests/core/utilities/structures/scim.js +0 -67
  304. package/dist/tests/core/utilities/structures/scim.js.map +0 -1
  305. package/dist/tests/core/utilities/structures/shared.js.map +0 -1
  306. package/dist/tests/core/utilities/structures/sso.js.map +0 -1
  307. package/dist/tests/core/utilities/structures/tenants.js.map +0 -1
  308. package/dist/tests/core/utilities/structures/userGroups.js.map +0 -1
  309. package/dist/tests/core/utilities/structures/users.js.map +0 -1
  310. package/dist/tests/core/utilities/testContainerUtils.js.map +0 -1
  311. package/dist/tests/extra/DBTestConfiguration.js.map +0 -1
  312. package/dist/tests/extra/index.d.ts +0 -2
  313. package/dist/tests/extra/index.js +0 -33
  314. package/dist/tests/extra/index.js.map +0 -1
  315. package/dist/tests/extra/testEnv.js.map +0 -1
  316. package/src/db/searchIndexes/index.ts +0 -1
  317. package/src/db/searchIndexes/searchIndexes.ts +0 -62
  318. package/src/docIds/ids.ts +0 -102
  319. package/src/docIds/index.ts +0 -2
  320. package/src/docIds/params.ts +0 -174
  321. package/src/docUpdates/index.ts +0 -29
  322. package/src/events/asyncEvents/index.ts +0 -2
  323. package/src/events/asyncEvents/publisher.ts +0 -12
  324. package/src/events/asyncEvents/queue.ts +0 -22
  325. package/src/events/documentId.ts +0 -56
  326. package/src/events/processors/async/DocumentUpdateProcessor.ts +0 -43
  327. package/src/logging/alerts.ts +0 -26
  328. package/src/logging/correlation/correlation.ts +0 -13
  329. package/src/logging/correlation/index.ts +0 -1
  330. package/src/logging/correlation/middleware.ts +0 -17
  331. package/src/logging/index.ts +0 -6
  332. package/src/logging/pino/logger.ts +0 -188
  333. package/src/logging/pino/middleware.ts +0 -45
  334. package/src/plugin/tests/validation.spec.ts +0 -83
  335. package/src/security/tests/encryption.spec.ts +0 -31
  336. package/src/security/tests/permissions.spec.ts +0 -145
  337. package/src/tenancy/tests/tenancy.spec.ts +0 -184
  338. package/src/utils/stringUtils.ts +0 -8
  339. package/tests/core/utilities/mocks/alerts.ts +0 -3
  340. package/tests/core/utilities/mocks/events.ts +0 -123
  341. package/tests/core/utilities/mocks/fetch.ts +0 -17
  342. package/tests/core/utilities/structures/scim.ts +0 -81
  343. package/tests/extra/index.ts +0 -2
  344. /package/dist/src/{docIds → db}/conversions.d.ts +0 -0
  345. /package/dist/src/{docIds → db}/conversions.js +0 -0
  346. /package/dist/src/{docIds/newid.d.ts → newid.d.ts} +0 -0
  347. /package/dist/src/{docIds/newid.js → newid.js} +0 -0
  348. /package/dist/tests/{core/logging.d.ts → logging.d.ts} +0 -0
  349. /package/dist/tests/{core/logging.js → logging.js} +0 -0
  350. /package/dist/tests/{core/utilities → utilities}/jestUtils.d.ts +0 -0
  351. /package/dist/tests/{core/utilities → utilities}/jestUtils.js +0 -0
  352. /package/dist/tests/{core/utilities → utilities}/mocks/date.d.ts +0 -0
  353. /package/dist/tests/{core/utilities → utilities}/mocks/date.js +0 -0
  354. /package/dist/tests/{core/utilities → utilities}/mocks/posthog.d.ts +0 -0
  355. /package/dist/tests/{core/utilities → utilities}/mocks/posthog.js +0 -0
  356. /package/dist/tests/{core/utilities → utilities}/structures/accounts.d.ts +0 -0
  357. /package/dist/tests/{core/utilities → utilities}/structures/apps.d.ts +0 -0
  358. /package/dist/tests/{core/utilities → utilities}/structures/common.d.ts +0 -0
  359. /package/dist/tests/{core/utilities → utilities}/structures/common.js +0 -0
  360. /package/dist/tests/{core/utilities → utilities}/structures/db.d.ts +0 -0
  361. /package/dist/tests/{core/utilities → utilities}/structures/generator.d.ts +0 -0
  362. /package/dist/tests/{core/utilities → utilities}/structures/generator.js +0 -0
  363. /package/dist/tests/{core/utilities → utilities}/structures/koa.d.ts +0 -0
  364. /package/dist/tests/{core/utilities → utilities}/structures/koa.js +0 -0
  365. /package/dist/tests/{core/utilities → utilities}/structures/licenses.d.ts +0 -0
  366. /package/dist/tests/{core/utilities → utilities}/structures/licenses.js +0 -0
  367. /package/dist/tests/{core/utilities → utilities}/structures/plugins.d.ts +0 -0
  368. /package/dist/tests/{core/utilities → utilities}/structures/plugins.js +0 -0
  369. /package/dist/tests/{core/utilities → utilities}/structures/shared.d.ts +0 -0
  370. /package/dist/tests/{core/utilities → utilities}/structures/shared.js +0 -0
  371. /package/dist/tests/{core/utilities → utilities}/structures/sso.d.ts +0 -0
  372. /package/dist/tests/{core/utilities → utilities}/structures/sso.js +0 -0
  373. /package/dist/tests/{core/utilities → utilities}/structures/tenants.d.ts +0 -0
  374. /package/dist/tests/{core/utilities → utilities}/structures/userGroups.d.ts +0 -0
  375. /package/dist/tests/{core/utilities → utilities}/structures/userGroups.js +0 -0
  376. /package/dist/tests/{core/utilities → utilities}/structures/users.d.ts +0 -0
  377. /package/dist/tests/{core/utilities → utilities}/structures/users.js +0 -0
  378. /package/dist/tests/{core/utilities → utilities}/testContainerUtils.d.ts +0 -0
  379. /package/dist/tests/{core/utilities → utilities}/testContainerUtils.js +0 -0
  380. /package/dist/tests/{extra → utilities}/testEnv.d.ts +0 -0
  381. /package/src/{docIds → db}/conversions.ts +0 -0
  382. /package/src/{docIds/newid.ts → newid.ts} +0 -0
  383. /package/tests/{core/logging.ts → logging.ts} +0 -0
  384. /package/tests/{core/utilities → utilities}/jestUtils.ts +0 -0
  385. /package/tests/{core/utilities → utilities}/mocks/date.ts +0 -0
  386. /package/tests/{core/utilities → utilities}/mocks/posthog.ts +0 -0
  387. /package/tests/{core/utilities → utilities}/structures/common.ts +0 -0
  388. /package/tests/{core/utilities → utilities}/structures/generator.ts +0 -0
  389. /package/tests/{core/utilities → utilities}/structures/koa.ts +0 -0
  390. /package/tests/{core/utilities → utilities}/structures/licenses.ts +0 -0
  391. /package/tests/{core/utilities → utilities}/structures/plugins.ts +0 -0
  392. /package/tests/{core/utilities → utilities}/structures/shared.ts +0 -0
  393. /package/tests/{core/utilities → utilities}/structures/sso.ts +0 -0
  394. /package/tests/{core/utilities → utilities}/structures/userGroups.ts +0 -0
  395. /package/tests/{core/utilities → utilities}/structures/users.ts +0 -0
  396. /package/tests/{core/utilities → utilities}/testContainerUtils.ts +0 -0
@@ -96,15 +96,9 @@ export default function (
96
96
  }
97
97
  try {
98
98
  // check the actual user is authenticated first, try header or cookie
99
- let headerToken = ctx.request.headers[Header.TOKEN]
100
-
99
+ const headerToken = ctx.request.headers[Header.TOKEN]
101
100
  const authCookie = getCookie(ctx, Cookie.Auth) || openJwt(headerToken)
102
- let apiKey = ctx.request.headers[Header.API_KEY]
103
-
104
- if (!apiKey && ctx.request.headers[Header.AUTHORIZATION]) {
105
- apiKey = ctx.request.headers[Header.AUTHORIZATION].split(" ")[1]
106
- }
107
-
101
+ const apiKey = ctx.request.headers[Header.API_KEY]
108
102
  const tenantId = ctx.request.headers[Header.TENANT_ID]
109
103
  let authenticated = false,
110
104
  user = null,
@@ -1,5 +1,6 @@
1
1
  import { APIError } from "@budibase/types"
2
2
  import * as errors from "../errors"
3
+ import env from "../environment"
3
4
 
4
5
  export async function errorHandling(ctx: any, next: any) {
5
6
  try {
@@ -8,10 +9,9 @@ export async function errorHandling(ctx: any, next: any) {
8
9
  const status = err.status || err.statusCode || 500
9
10
  ctx.status = status
10
11
 
11
- if (status >= 400 && status < 500) {
12
- console.warn(err)
13
- } else {
14
- console.error(err)
12
+ if (status > 499 || env.ENABLE_4XX_HTTP_LOGGING) {
13
+ ctx.log.error(err)
14
+ console.trace(err)
15
15
  }
16
16
 
17
17
  const error = errors.getPublicError(err)
@@ -14,8 +14,7 @@ export { default as csrf } from "./csrf"
14
14
  export { default as adminOnly } from "./adminOnly"
15
15
  export { default as builderOrAdmin } from "./builderOrAdmin"
16
16
  export { default as builderOnly } from "./builderOnly"
17
- export { default as pino } from "../logging/pino/middleware"
18
- export { default as correlation } from "../logging/correlation/middleware"
17
+ export { default as logging } from "./logging"
19
18
  export { default as errorHandling } from "./errorHandling"
20
19
  export { default as querystringToBody } from "./querystringToBody"
21
20
  export * as joiValidator from "./joi-validator"
@@ -0,0 +1,90 @@
1
+ const correlator = require("correlation-id")
2
+ import { Header } from "../constants"
3
+ import { v4 as uuid } from "uuid"
4
+ import * as context from "../context"
5
+
6
+ const debug = console.warn
7
+ const trace = console.trace
8
+ const log = console.log
9
+ const info = console.info
10
+ const warn = console.warn
11
+ const error = console.error
12
+
13
+ const getTenantId = () => {
14
+ let tenantId
15
+ try {
16
+ tenantId = context.getTenantId()
17
+ } catch (e: any) {
18
+ // do nothing
19
+ }
20
+ return tenantId
21
+ }
22
+
23
+ const getAppId = () => {
24
+ let appId
25
+ try {
26
+ appId = context.getAppId()
27
+ } catch (e) {
28
+ // do nothing
29
+ }
30
+ return appId
31
+ }
32
+
33
+ const getIdentityId = () => {
34
+ let identityId
35
+ try {
36
+ const identity = context.getIdentity()
37
+ identityId = identity?._id
38
+ } catch (e) {
39
+ // do nothing
40
+ }
41
+ return identityId
42
+ }
43
+
44
+ const print = (fn: any, data: any[]) => {
45
+ let message = ""
46
+
47
+ const correlationId = correlator.getId()
48
+ if (correlationId) {
49
+ message = message + `[correlationId=${correlator.getId()}]`
50
+ }
51
+
52
+ const tenantId = getTenantId()
53
+ if (tenantId) {
54
+ message = message + ` [tenantId=${tenantId}]`
55
+ }
56
+
57
+ const appId = getAppId()
58
+ if (appId) {
59
+ message = message + ` [appId=${appId}]`
60
+ }
61
+
62
+ const identityId = getIdentityId()
63
+ if (identityId) {
64
+ message = message + ` [identityId=${identityId}]`
65
+ }
66
+
67
+ if (!process.env.CI) {
68
+ fn(message, data)
69
+ }
70
+ }
71
+
72
+ const logging = (ctx: any, next: any) => {
73
+ // use the provided correlation id header if present
74
+ let correlationId = ctx.headers[Header.CORRELATION_ID]
75
+ if (!correlationId) {
76
+ correlationId = uuid()
77
+ }
78
+
79
+ return correlator.withId(correlationId, () => {
80
+ console.debug = data => print(debug, data)
81
+ console.trace = data => print(trace, data)
82
+ console.log = data => print(log, data)
83
+ console.info = data => print(info, data)
84
+ console.warn = data => print(warn, data)
85
+ console.error = data => print(error, data)
86
+ return next()
87
+ })
88
+ }
89
+
90
+ export default logging
@@ -1,7 +1,6 @@
1
1
  import fetch from "node-fetch"
2
2
  import * as sso from "./sso"
3
3
  import { ssoCallbackUrl } from "../utils"
4
- import { validEmail } from "../../../utils"
5
4
  import {
6
5
  ConfigType,
7
6
  OIDCInnerConfig,
@@ -12,7 +11,6 @@ import {
12
11
  JwtClaims,
13
12
  SaveSSOUserFunction,
14
13
  } from "@budibase/types"
15
-
16
14
  const OIDCStrategy = require("@techpass/passport-openidconnect").Strategy
17
15
 
18
16
  export function buildVerifyFn(saveUserFn: SaveSSOUserFunction) {
@@ -88,6 +86,15 @@ function getEmail(profile: SSOProfile, jwtClaims: JwtClaims) {
88
86
  )
89
87
  }
90
88
 
89
+ function validEmail(value: string) {
90
+ return (
91
+ value &&
92
+ !!value.match(
93
+ /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
94
+ )
95
+ )
96
+ }
97
+
91
98
  /**
92
99
  * Create an instance of the oidc passport strategy. This wrapper fetches the configuration
93
100
  * from couchDB rather than environment variables, using this factory is necessary for dynamically configuring passport.
@@ -1,5 +1,4 @@
1
- import { structures, mocks } from "../../../../../tests"
2
- import { testEnv } from "../../../../../tests/extra"
1
+ import { structures, testEnv, mocks } from "../../../../../tests"
3
2
  import { SSOAuthDetails, User } from "@budibase/types"
4
3
 
5
4
  import { HTTPError } from "../../../../errors"
@@ -99,7 +99,9 @@ export const runMigration = async (
99
99
  options.force[migrationType] &&
100
100
  options.force[migrationType].includes(migrationName)
101
101
  ) {
102
- log(`[Migration: ${migrationName}] [DB: ${dbName}] Forcing`)
102
+ log(
103
+ `[Tenant: ${tenantId}] [Migration: ${migrationName}] [DB: ${dbName}] Forcing`
104
+ )
103
105
  } else {
104
106
  // no force, exit
105
107
  return
@@ -109,7 +111,7 @@ export const runMigration = async (
109
111
  // check if the migration is not a no-op
110
112
  if (!options.noOp) {
111
113
  log(
112
- `[Migration: ${migrationName}] [DB: ${dbName}] Running ${lengthStatement}`
114
+ `[Tenant: ${tenantId}] [Migration: ${migrationName}] [DB: ${dbName}] Running ${lengthStatement}`
113
115
  )
114
116
 
115
117
  if (migration.preventRetry) {
@@ -129,7 +131,9 @@ export const runMigration = async (
129
131
  await migration.fn(db)
130
132
  }
131
133
 
132
- log(`[Migration: ${migrationName}] [DB: ${dbName}] Complete`)
134
+ log(
135
+ `[Tenant: ${tenantId}] [Migration: ${migrationName}] [DB: ${dbName}] Complete`
136
+ )
133
137
  }
134
138
 
135
139
  // mark as complete
@@ -137,7 +141,7 @@ export const runMigration = async (
137
141
  await db.put(doc)
138
142
  } catch (err) {
139
143
  console.error(
140
- `[Migration: ${migrationName}] [DB: ${dbName}] Error: `,
144
+ `[Tenant: ${tenantId}] [Migration: ${migrationName}] [DB: ${dbName}] Error: `,
141
145
  err
142
146
  )
143
147
  throw err
@@ -1,7 +1,7 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`migrations should match snapshot 1`] = `
4
- {
4
+ Object {
5
5
  "_id": "migrations",
6
6
  "_rev": "1-2f64479842a0513aa8b97f356b0b9127",
7
7
  "createdAt": "2020-01-01T00:00:00.000Z",
@@ -1,4 +1,4 @@
1
- import { testEnv, DBTestConfiguration } from "../../../tests/extra"
1
+ import { testEnv, DBTestConfiguration } from "../../../tests"
2
2
  import * as migrations from "../index"
3
3
  import * as context from "../../context"
4
4
  import { MigrationType } from "@budibase/types"
@@ -1,6 +1,6 @@
1
1
  import * as app from "../app"
2
2
  import { getAppFileUrl } from "../app"
3
- import { testEnv } from "../../../../tests/extra"
3
+ import { testEnv } from "../../../../tests"
4
4
 
5
5
  describe("app", () => {
6
6
  beforeEach(() => {
@@ -1,5 +1,5 @@
1
1
  import * as global from "../global"
2
- import { testEnv } from "../../../../tests/extra"
2
+ import { testEnv } from "../../../../tests"
3
3
 
4
4
  describe("global", () => {
5
5
  describe("getGlobalFileUrl", () => {
@@ -1,6 +1,5 @@
1
1
  import * as plugins from "../plugins"
2
- import { structures } from "../../../../tests"
3
- import { testEnv } from "../../../../tests/extra"
2
+ import { structures, testEnv } from "../../../../tests"
4
3
 
5
4
  describe("plugins", () => {
6
5
  describe("enrichPluginURLs", () => {
@@ -3,7 +3,7 @@ import AWS from "aws-sdk"
3
3
  import stream from "stream"
4
4
  import fetch from "node-fetch"
5
5
  import tar from "tar-fs"
6
- import zlib from "zlib"
6
+ const zlib = require("zlib")
7
7
  import { promisify } from "util"
8
8
  import { join } from "path"
9
9
  import fs from "fs"
@@ -415,7 +415,7 @@ export const downloadTarballDirect = async (
415
415
  throw new Error(`unexpected response ${response.statusText}`)
416
416
  }
417
417
 
418
- await streamPipeline(response.body, zlib.createUnzip(), tar.extract(path))
418
+ await streamPipeline(response.body, zlib.Unzip(), tar.extract(path))
419
419
  }
420
420
 
421
421
  export const downloadTarball = async (
@@ -431,7 +431,7 @@ export const downloadTarball = async (
431
431
  }
432
432
 
433
433
  const tmpPath = join(budibaseTempDir(), path)
434
- await streamPipeline(response.body, zlib.createUnzip(), tar.extract(tmpPath))
434
+ await streamPipeline(response.body, zlib.Unzip(), tar.extract(tmpPath))
435
435
  if (!env.isTest() && env.SELF_HOSTED) {
436
436
  await uploadDirectory(bucketName, tmpPath, path)
437
437
  }
@@ -1,5 +1,4 @@
1
- import { structures } from "../../../tests"
2
- import { DBTestConfiguration } from "../../../tests/extra"
1
+ import { DBTestConfiguration, structures } from "../../../tests"
3
2
  import * as tenants from "../tenants"
4
3
 
5
4
  describe("tenants", () => {
@@ -1,12 +1,4 @@
1
- import {
2
- DatasourceFieldType,
3
- QueryType,
4
- PluginType,
5
- AutomationStepType,
6
- AutomationStepIdArray,
7
- AutomationIOType,
8
- AutomationCustomIOType,
9
- } from "@budibase/types"
1
+ import { DatasourceFieldType, QueryType, PluginType } from "@budibase/types"
10
2
  import joi from "joi"
11
3
 
12
4
  const DATASOURCE_TYPES = [
@@ -27,7 +19,7 @@ function runJoi(validator: joi.Schema, schema: any) {
27
19
 
28
20
  function validateComponent(schema: any) {
29
21
  const validator = joi.object({
30
- type: joi.string().allow(PluginType.COMPONENT).required(),
22
+ type: joi.string().allow("component").required(),
31
23
  metadata: joi.object().unknown(true).required(),
32
24
  hash: joi.string().optional(),
33
25
  version: joi.string().optional(),
@@ -61,7 +53,7 @@ function validateDatasource(schema: any) {
61
53
  .required()
62
54
 
63
55
  const validator = joi.object({
64
- type: joi.string().allow(PluginType.DATASOURCE).required(),
56
+ type: joi.string().allow("datasource").required(),
65
57
  metadata: joi.object().unknown(true).required(),
66
58
  hash: joi.string().optional(),
67
59
  version: joi.string().optional(),
@@ -90,55 +82,6 @@ function validateDatasource(schema: any) {
90
82
  runJoi(validator, schema)
91
83
  }
92
84
 
93
- function validateAutomation(schema: any) {
94
- const basePropsValidator = joi.object().pattern(joi.string(), {
95
- type: joi
96
- .string()
97
- .allow(...Object.values(AutomationIOType))
98
- .required(),
99
- customType: joi.string().allow(...Object.values(AutomationCustomIOType)),
100
- title: joi.string(),
101
- description: joi.string(),
102
- enum: joi.array().items(joi.string()),
103
- pretty: joi.array().items(joi.string()),
104
- })
105
- const stepSchemaValidator = joi
106
- .object({
107
- properties: basePropsValidator,
108
- required: joi.array().items(joi.string()),
109
- })
110
- .concat(basePropsValidator)
111
- .required()
112
- const validator = joi.object({
113
- type: joi.string().allow(PluginType.AUTOMATION).required(),
114
- metadata: joi.object().unknown(true).required(),
115
- hash: joi.string().optional(),
116
- version: joi.string().optional(),
117
- schema: joi.object({
118
- name: joi.string().required(),
119
- tagline: joi.string().required(),
120
- icon: joi.string().required(),
121
- description: joi.string().required(),
122
- type: joi
123
- .string()
124
- .allow(AutomationStepType.ACTION, AutomationStepType.LOGIC)
125
- .required(),
126
- stepId: joi
127
- .string()
128
- .disallow(...AutomationStepIdArray)
129
- .required(),
130
- inputs: joi.object().optional(),
131
- schema: joi
132
- .object({
133
- inputs: stepSchemaValidator,
134
- outputs: stepSchemaValidator,
135
- })
136
- .required(),
137
- }),
138
- })
139
- runJoi(validator, schema)
140
- }
141
-
142
85
  export function validate(schema: any) {
143
86
  switch (schema?.type) {
144
87
  case PluginType.COMPONENT:
@@ -147,9 +90,6 @@ export function validate(schema: any) {
147
90
  case PluginType.DATASOURCE:
148
91
  validateDatasource(schema)
149
92
  break
150
- case PluginType.AUTOMATION:
151
- validateAutomation(schema)
152
- break
153
93
  default:
154
94
  throw new Error(`Unknown plugin type - check schema.json: ${schema.type}`)
155
95
  }
@@ -2,5 +2,4 @@ export enum JobQueue {
2
2
  AUTOMATION = "automationQueue",
3
3
  APP_BACKUP = "appBackupQueue",
4
4
  AUDIT_LOG = "auditLogQueue",
5
- SYSTEM_EVENT_QUEUE = "systemEventQueue",
6
5
  }
@@ -12,7 +12,7 @@ export enum SecretOption {
12
12
  ENCRYPTION = "encryption",
13
13
  }
14
14
 
15
- export function getSecret(secretOption: SecretOption): string {
15
+ function getSecret(secretOption: SecretOption): string {
16
16
  let secret, secretName
17
17
  switch (secretOption) {
18
18
  case SecretOption.ENCRYPTION:
@@ -24,7 +24,7 @@ export enum PermissionType {
24
24
  QUERY = "query",
25
25
  }
26
26
 
27
- export class Permission {
27
+ class Permission {
28
28
  type: PermissionType
29
29
  level: PermissionLevel
30
30
 
@@ -34,7 +34,7 @@ export class Permission {
34
34
  }
35
35
  }
36
36
 
37
- export function levelToNumber(perm: PermissionLevel) {
37
+ function levelToNumber(perm: PermissionLevel) {
38
38
  switch (perm) {
39
39
  // not everything has execute privileges
40
40
  case PermissionLevel.EXECUTE:
@@ -55,7 +55,7 @@ export function levelToNumber(perm: PermissionLevel) {
55
55
  * @param {string} userPermLevel The permission level of the user.
56
56
  * @return {string[]} All the permission levels this user is allowed to carry out.
57
57
  */
58
- export function getAllowedLevels(userPermLevel: PermissionLevel): string[] {
58
+ function getAllowedLevels(userPermLevel: PermissionLevel) {
59
59
  switch (userPermLevel) {
60
60
  case PermissionLevel.EXECUTE:
61
61
  return [PermissionLevel.EXECUTE]
@@ -64,9 +64,9 @@ export function getAllowedLevels(userPermLevel: PermissionLevel): string[] {
64
64
  case PermissionLevel.WRITE:
65
65
  case PermissionLevel.ADMIN:
66
66
  return [
67
- PermissionLevel.EXECUTE,
68
67
  PermissionLevel.READ,
69
68
  PermissionLevel.WRITE,
69
+ PermissionLevel.EXECUTE,
70
70
  ]
71
71
  default:
72
72
  return []
@@ -81,7 +81,7 @@ export enum BuiltinPermissionID {
81
81
  POWER = "power",
82
82
  }
83
83
 
84
- export const BUILTIN_PERMISSIONS = {
84
+ const BUILTIN_PERMISSIONS = {
85
85
  PUBLIC: {
86
86
  _id: BuiltinPermissionID.PUBLIC,
87
87
  name: "Public",
@@ -3,8 +3,8 @@ import {
3
3
  getTenantId,
4
4
  getTenantIDFromAppID,
5
5
  isMultiTenant,
6
- getPlatformURL,
7
6
  } from "../context"
7
+ import env from "../environment"
8
8
  import {
9
9
  BBContext,
10
10
  TenantResolutionStrategy,
@@ -93,7 +93,7 @@ export const getTenantIDFromCtx = (
93
93
  // subdomain
94
94
  if (isAllowed(TenantResolutionStrategy.SUBDOMAIN)) {
95
95
  // e.g. budibase.app or local.com:10000
96
- const platformHost = new URL(getPlatformURL()).host.split(":")[0]
96
+ const platformHost = new URL(env.PLATFORM_URL).host.split(":")[0]
97
97
  // e.g. tenant.budibase.app or tenant.local.com
98
98
  const requestHost = ctx.host
99
99
  // parse the tenant id from the difference
package/src/users.ts CHANGED
@@ -8,10 +8,8 @@ import {
8
8
  DocumentType,
9
9
  SEPARATOR,
10
10
  directCouchFind,
11
- getGlobalUserParams,
12
- pagination,
13
11
  } from "./db"
14
- import { BulkDocsResponse, SearchUsersRequest, User } from "@budibase/types"
12
+ import { BulkDocsResponse, User } from "@budibase/types"
15
13
  import { getGlobalDB } from "./context"
16
14
  import * as context from "./context"
17
15
 
@@ -201,41 +199,3 @@ export const searchGlobalUsersByEmail = async (
201
199
  }
202
200
  return users
203
201
  }
204
-
205
- const PAGE_LIMIT = 8
206
- export const paginatedUsers = async ({
207
- page,
208
- email,
209
- appId,
210
- }: SearchUsersRequest = {}) => {
211
- const db = getGlobalDB()
212
- // get one extra document, to have the next page
213
- const opts: any = {
214
- include_docs: true,
215
- limit: PAGE_LIMIT + 1,
216
- }
217
- // add a startkey if the page was specified (anchor)
218
- if (page) {
219
- opts.startkey = page
220
- }
221
- // property specifies what to use for the page/anchor
222
- let userList: User[],
223
- property = "_id",
224
- getKey
225
- if (appId) {
226
- userList = await searchGlobalUsersByApp(appId, opts)
227
- getKey = (doc: any) => getGlobalUserByAppPage(appId, doc)
228
- } else if (email) {
229
- userList = await searchGlobalUsersByEmail(email, opts)
230
- property = "email"
231
- } else {
232
- // no search, query allDocs
233
- const response = await db.allDocs(getGlobalUserParams(null, opts))
234
- userList = response.rows.map((row: any) => row.doc)
235
- }
236
- return pagination(userList, PAGE_LIMIT, {
237
- paginate: true,
238
- property,
239
- getKey,
240
- })
241
- }
@@ -1,5 +1,5 @@
1
1
  import env from "../environment"
2
- export * from "../docIds/newid"
2
+ export * from "../newid"
3
3
  const bcrypt = env.JS_BCRYPT ? require("bcryptjs") : require("bcrypt")
4
4
 
5
5
  const SALT_ROUNDS = env.SALT_ROUNDS || 10
@@ -1,3 +1,2 @@
1
1
  export * from "./hashing"
2
2
  export * from "./utils"
3
- export * from "./stringUtils"
@@ -1,5 +1,4 @@
1
- import { structures } from "../../../tests"
2
- import { DBTestConfiguration } from "../../../tests/extra"
1
+ import { structures, DBTestConfiguration } from "../../../tests"
3
2
  import * as utils from "../../utils"
4
3
  import * as db from "../../db"
5
4
  import { Header } from "../../constants"
package/tests/index.ts CHANGED
@@ -1 +1 @@
1
- export * from "./core/utilities"
1
+ export * from "./utilities"
package/tests/jestEnv.ts CHANGED
@@ -3,4 +3,5 @@ process.env.MULTI_TENANCY = "1"
3
3
  process.env.NODE_ENV = "jest"
4
4
  process.env.MOCK_REDIS = "1"
5
5
  process.env.LOG_LEVEL = process.env.LOG_LEVEL || "error"
6
+ process.env.ENABLE_4XX_HTTP_LOGGING = "0"
6
7
  process.env.REDIS_PASSWORD = "budibase"
@@ -1,7 +1,7 @@
1
- import "./core/logging"
1
+ import "./logging"
2
2
  import env from "../src/environment"
3
3
  import { cleanup } from "../src/timers"
4
- import { mocks, testContainerUtils } from "./core/utilities"
4
+ import { mocks, testContainerUtils } from "./utilities"
5
5
 
6
6
  // must explicitly enable fetch mock
7
7
  mocks.fetch.enable()
@@ -1,5 +1,5 @@
1
- import "../core/utilities/mocks"
2
- import * as structures from "../core/utilities/structures"
1
+ import "./mocks"
2
+ import * as structures from "./structures"
3
3
  import * as testEnv from "./testEnv"
4
4
  import * as context from "../../src/context"
5
5
 
@@ -1,6 +1,9 @@
1
1
  export * as mocks from "./mocks"
2
2
  export * as structures from "./structures"
3
3
  export { generator } from "./structures"
4
+ export * as testEnv from "./testEnv"
4
5
  export * as testContainerUtils from "./testContainerUtils"
5
6
 
6
7
  export * from "./jestUtils"
8
+
9
+ export { default as DBTestConfiguration } from "./DBTestConfiguration"