@budibase/backend-core 2.9.16 → 2.9.17

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 (435) hide show
  1. package/dist/index.js +12544 -0
  2. package/dist/index.js.map +7 -0
  3. package/dist/index.js.meta.json +1 -0
  4. package/dist/package.json +5 -5
  5. package/dist/plugins.js +288 -16
  6. package/dist/plugins.js.map +7 -1
  7. package/dist/plugins.js.meta.json +1 -0
  8. package/dist/tests.js +8476 -0
  9. package/dist/tests.js.map +7 -0
  10. package/dist/tests.js.meta.json +1 -0
  11. package/dist/tsconfig.build.tsbuildinfo +1 -1
  12. package/package.json +5 -5
  13. package/scripts/build.js +6 -0
  14. package/tsconfig.build.json +5 -1
  15. package/tsconfig.json +0 -8
  16. package/dist/jest.config.js +0 -25
  17. package/dist/jest.config.js.map +0 -1
  18. package/dist/plugins.d.ts +0 -1
  19. package/dist/src/accounts/accounts.js +0 -83
  20. package/dist/src/accounts/accounts.js.map +0 -1
  21. package/dist/src/accounts/api.js +0 -92
  22. package/dist/src/accounts/api.js.map +0 -1
  23. package/dist/src/accounts/index.js +0 -18
  24. package/dist/src/accounts/index.js.map +0 -1
  25. package/dist/src/auth/auth.js +0 -189
  26. package/dist/src/auth/auth.js.map +0 -1
  27. package/dist/src/auth/index.js +0 -18
  28. package/dist/src/auth/index.js.map +0 -1
  29. package/dist/src/blacklist/blacklist.js +0 -76
  30. package/dist/src/blacklist/blacklist.js.map +0 -1
  31. package/dist/src/blacklist/index.js +0 -18
  32. package/dist/src/blacklist/index.js.map +0 -1
  33. package/dist/src/cache/appMetadata.js +0 -96
  34. package/dist/src/cache/appMetadata.js.map +0 -1
  35. package/dist/src/cache/base/index.js +0 -120
  36. package/dist/src/cache/base/index.js.map +0 -1
  37. package/dist/src/cache/generic.js +0 -31
  38. package/dist/src/cache/generic.js.map +0 -1
  39. package/dist/src/cache/index.js +0 -35
  40. package/dist/src/cache/index.js.map +0 -1
  41. package/dist/src/cache/user.js +0 -108
  42. package/dist/src/cache/user.js.map +0 -1
  43. package/dist/src/cache/writethrough.js +0 -159
  44. package/dist/src/cache/writethrough.js.map +0 -1
  45. package/dist/src/configs/configs.js +0 -278
  46. package/dist/src/configs/configs.js.map +0 -1
  47. package/dist/src/configs/index.js +0 -18
  48. package/dist/src/configs/index.js.map +0 -1
  49. package/dist/src/constants/db.js +0 -67
  50. package/dist/src/constants/db.js.map +0 -1
  51. package/dist/src/constants/index.js +0 -19
  52. package/dist/src/constants/index.js.map +0 -1
  53. package/dist/src/constants/misc.js +0 -54
  54. package/dist/src/constants/misc.js.map +0 -1
  55. package/dist/src/context/Context.js +0 -14
  56. package/dist/src/context/Context.js.map +0 -1
  57. package/dist/src/context/identity.js +0 -72
  58. package/dist/src/context/identity.js.map +0 -1
  59. package/dist/src/context/index.js +0 -34
  60. package/dist/src/context/index.js.map +0 -1
  61. package/dist/src/context/mainContext.js +0 -331
  62. package/dist/src/context/mainContext.js.map +0 -1
  63. package/dist/src/context/types.js +0 -3
  64. package/dist/src/context/types.js.map +0 -1
  65. package/dist/src/db/Replication.js +0 -85
  66. package/dist/src/db/Replication.js.map +0 -1
  67. package/dist/src/db/constants.js +0 -13
  68. package/dist/src/db/constants.js.map +0 -1
  69. package/dist/src/db/couch/DatabaseImpl.js +0 -248
  70. package/dist/src/db/couch/DatabaseImpl.js.map +0 -1
  71. package/dist/src/db/couch/connections.js +0 -88
  72. package/dist/src/db/couch/connections.js.map +0 -1
  73. package/dist/src/db/couch/index.js +0 -27
  74. package/dist/src/db/couch/index.js.map +0 -1
  75. package/dist/src/db/couch/pouchDB.js +0 -108
  76. package/dist/src/db/couch/pouchDB.js.map +0 -1
  77. package/dist/src/db/couch/pouchDump.js +0 -2
  78. package/dist/src/db/couch/pouchDump.js.map +0 -1
  79. package/dist/src/db/couch/utils.js +0 -55
  80. package/dist/src/db/couch/utils.js.map +0 -1
  81. package/dist/src/db/db.js +0 -59
  82. package/dist/src/db/db.js.map +0 -1
  83. package/dist/src/db/errors.js +0 -22
  84. package/dist/src/db/errors.js.map +0 -1
  85. package/dist/src/db/index.js +0 -48
  86. package/dist/src/db/index.js.map +0 -1
  87. package/dist/src/db/lucene.js +0 -650
  88. package/dist/src/db/lucene.js.map +0 -1
  89. package/dist/src/db/searchIndexes/index.js +0 -18
  90. package/dist/src/db/searchIndexes/index.js.map +0 -1
  91. package/dist/src/db/searchIndexes/searchIndexes.js +0 -77
  92. package/dist/src/db/searchIndexes/searchIndexes.js.map +0 -1
  93. package/dist/src/db/utils.js +0 -213
  94. package/dist/src/db/utils.js.map +0 -1
  95. package/dist/src/db/views.js +0 -219
  96. package/dist/src/db/views.js.map +0 -1
  97. package/dist/src/docIds/conversions.js +0 -62
  98. package/dist/src/docIds/conversions.js.map +0 -1
  99. package/dist/src/docIds/ids.js +0 -112
  100. package/dist/src/docIds/ids.js.map +0 -1
  101. package/dist/src/docIds/index.js +0 -19
  102. package/dist/src/docIds/index.js.map +0 -1
  103. package/dist/src/docIds/newid.js +0 -9
  104. package/dist/src/docIds/newid.js.map +0 -1
  105. package/dist/src/docIds/params.js +0 -138
  106. package/dist/src/docIds/params.js.map +0 -1
  107. package/dist/src/docUpdates/index.js +0 -36
  108. package/dist/src/docUpdates/index.js.map +0 -1
  109. package/dist/src/environment.js +0 -110
  110. package/dist/src/environment.js.map +0 -1
  111. package/dist/src/errors/errors.js +0 -97
  112. package/dist/src/errors/errors.js.map +0 -1
  113. package/dist/src/errors/index.js +0 -18
  114. package/dist/src/errors/index.js.map +0 -1
  115. package/dist/src/events/analytics.js +0 -42
  116. package/dist/src/events/analytics.js.map +0 -1
  117. package/dist/src/events/asyncEvents/index.js +0 -19
  118. package/dist/src/events/asyncEvents/index.js.map +0 -1
  119. package/dist/src/events/asyncEvents/publisher.js +0 -27
  120. package/dist/src/events/asyncEvents/publisher.js.map +0 -1
  121. package/dist/src/events/asyncEvents/queue.js +0 -26
  122. package/dist/src/events/asyncEvents/queue.js.map +0 -1
  123. package/dist/src/events/backfill.js +0 -179
  124. package/dist/src/events/backfill.js.map +0 -1
  125. package/dist/src/events/documentId.js +0 -28
  126. package/dist/src/events/documentId.js.map +0 -1
  127. package/dist/src/events/events.js +0 -73
  128. package/dist/src/events/events.js.map +0 -1
  129. package/dist/src/events/identification.js +0 -300
  130. package/dist/src/events/identification.js.map +0 -1
  131. package/dist/src/events/index.js +0 -47
  132. package/dist/src/events/index.js.map +0 -1
  133. package/dist/src/events/processors/AnalyticsProcessor.js +0 -93
  134. package/dist/src/events/processors/AnalyticsProcessor.js.map +0 -1
  135. package/dist/src/events/processors/AuditLogsProcessor.js +0 -86
  136. package/dist/src/events/processors/AuditLogsProcessor.js.map +0 -1
  137. package/dist/src/events/processors/LoggingProcessor.js +0 -47
  138. package/dist/src/events/processors/LoggingProcessor.js.map +0 -1
  139. package/dist/src/events/processors/Processors.js +0 -52
  140. package/dist/src/events/processors/Processors.js.map +0 -1
  141. package/dist/src/events/processors/async/DocumentUpdateProcessor.js +0 -44
  142. package/dist/src/events/processors/async/DocumentUpdateProcessor.js.map +0 -1
  143. package/dist/src/events/processors/index.js +0 -23
  144. package/dist/src/events/processors/index.js.map +0 -1
  145. package/dist/src/events/processors/posthog/PosthogProcessor.js +0 -139
  146. package/dist/src/events/processors/posthog/PosthogProcessor.js.map +0 -1
  147. package/dist/src/events/processors/posthog/index.js +0 -8
  148. package/dist/src/events/processors/posthog/index.js.map +0 -1
  149. package/dist/src/events/processors/posthog/rateLimiting.js +0 -119
  150. package/dist/src/events/processors/posthog/rateLimiting.js.map +0 -1
  151. package/dist/src/events/processors/types.js +0 -3
  152. package/dist/src/events/processors/types.js.map +0 -1
  153. package/dist/src/events/publishers/account.js +0 -43
  154. package/dist/src/events/publishers/account.js.map +0 -1
  155. package/dist/src/events/publishers/app.js +0 -153
  156. package/dist/src/events/publishers/app.js.map +0 -1
  157. package/dist/src/events/publishers/auditLog.js +0 -34
  158. package/dist/src/events/publishers/auditLog.js.map +0 -1
  159. package/dist/src/events/publishers/auth.js +0 -80
  160. package/dist/src/events/publishers/auth.js.map +0 -1
  161. package/dist/src/events/publishers/automation.js +0 -117
  162. package/dist/src/events/publishers/automation.js.map +0 -1
  163. package/dist/src/events/publishers/backfill.js +0 -85
  164. package/dist/src/events/publishers/backfill.js.map +0 -1
  165. package/dist/src/events/publishers/backup.js +0 -41
  166. package/dist/src/events/publishers/backup.js.map +0 -1
  167. package/dist/src/events/publishers/datasource.js +0 -54
  168. package/dist/src/events/publishers/datasource.js.map +0 -1
  169. package/dist/src/events/publishers/email.js +0 -30
  170. package/dist/src/events/publishers/email.js.map +0 -1
  171. package/dist/src/events/publishers/environmentVariable.js +0 -44
  172. package/dist/src/events/publishers/environmentVariable.js.map +0 -1
  173. package/dist/src/events/publishers/group.js +0 -107
  174. package/dist/src/events/publishers/group.js.map +0 -1
  175. package/dist/src/events/publishers/index.js +0 -55
  176. package/dist/src/events/publishers/index.js.map +0 -1
  177. package/dist/src/events/publishers/installation.js +0 -52
  178. package/dist/src/events/publishers/installation.js.map +0 -1
  179. package/dist/src/events/publishers/layout.js +0 -34
  180. package/dist/src/events/publishers/layout.js.map +0 -1
  181. package/dist/src/events/publishers/license.js +0 -77
  182. package/dist/src/events/publishers/license.js.map +0 -1
  183. package/dist/src/events/publishers/org.js +0 -52
  184. package/dist/src/events/publishers/org.js.map +0 -1
  185. package/dist/src/events/publishers/plugin.js +0 -55
  186. package/dist/src/events/publishers/plugin.js.map +0 -1
  187. package/dist/src/events/publishers/query.js +0 -74
  188. package/dist/src/events/publishers/query.js.map +0 -1
  189. package/dist/src/events/publishers/role.js +0 -69
  190. package/dist/src/events/publishers/role.js.map +0 -1
  191. package/dist/src/events/publishers/rows.js +0 -32
  192. package/dist/src/events/publishers/rows.js.map +0 -1
  193. package/dist/src/events/publishers/screen.js +0 -46
  194. package/dist/src/events/publishers/screen.js.map +0 -1
  195. package/dist/src/events/publishers/serve.js +0 -47
  196. package/dist/src/events/publishers/serve.js.map +0 -1
  197. package/dist/src/events/publishers/table.js +0 -77
  198. package/dist/src/events/publishers/table.js.map +0 -1
  199. package/dist/src/events/publishers/user.js +0 -202
  200. package/dist/src/events/publishers/user.js.map +0 -1
  201. package/dist/src/events/publishers/view.js +0 -111
  202. package/dist/src/events/publishers/view.js.map +0 -1
  203. package/dist/src/featureFlags/index.js +0 -96
  204. package/dist/src/featureFlags/index.js.map +0 -1
  205. package/dist/src/helpers.js +0 -14
  206. package/dist/src/helpers.js.map +0 -1
  207. package/dist/src/index.js +0 -82
  208. package/dist/src/index.js.map +0 -1
  209. package/dist/src/installation.js +0 -138
  210. package/dist/src/installation.js.map +0 -1
  211. package/dist/src/logging/alerts.js +0 -24
  212. package/dist/src/logging/alerts.js.map +0 -1
  213. package/dist/src/logging/correlation/correlation.js +0 -17
  214. package/dist/src/logging/correlation/correlation.js.map +0 -1
  215. package/dist/src/logging/correlation/index.js +0 -18
  216. package/dist/src/logging/correlation/index.js.map +0 -1
  217. package/dist/src/logging/correlation/middleware.js +0 -17
  218. package/dist/src/logging/correlation/middleware.js.map +0 -1
  219. package/dist/src/logging/index.js +0 -35
  220. package/dist/src/logging/index.js.map +0 -1
  221. package/dist/src/logging/pino/logger.js +0 -218
  222. package/dist/src/logging/pino/logger.js.map +0 -1
  223. package/dist/src/logging/pino/middleware.js +0 -47
  224. package/dist/src/logging/pino/middleware.js.map +0 -1
  225. package/dist/src/logging/system.js +0 -101
  226. package/dist/src/logging/system.js.map +0 -1
  227. package/dist/src/middleware/adminOnly.js +0 -19
  228. package/dist/src/middleware/adminOnly.js.map +0 -1
  229. package/dist/src/middleware/auditLog.js +0 -16
  230. package/dist/src/middleware/auditLog.js.map +0 -1
  231. package/dist/src/middleware/authenticated.js +0 -204
  232. package/dist/src/middleware/authenticated.js.map +0 -1
  233. package/dist/src/middleware/builderOnly.js +0 -33
  234. package/dist/src/middleware/builderOnly.js.map +0 -1
  235. package/dist/src/middleware/builderOrAdmin.js +0 -33
  236. package/dist/src/middleware/builderOrAdmin.js.map +0 -1
  237. package/dist/src/middleware/csrf.js +0 -81
  238. package/dist/src/middleware/csrf.js.map +0 -1
  239. package/dist/src/middleware/errorHandling.js +0 -64
  240. package/dist/src/middleware/errorHandling.js.map +0 -1
  241. package/dist/src/middleware/index.js +0 -65
  242. package/dist/src/middleware/index.js.map +0 -1
  243. package/dist/src/middleware/internalApi.js +0 -30
  244. package/dist/src/middleware/internalApi.js.map +0 -1
  245. package/dist/src/middleware/joi-validator.js +0 -47
  246. package/dist/src/middleware/joi-validator.js.map +0 -1
  247. package/dist/src/middleware/matchers.js +0 -43
  248. package/dist/src/middleware/matchers.js.map +0 -1
  249. package/dist/src/middleware/passport/datasource/google.js +0 -95
  250. package/dist/src/middleware/passport/datasource/google.js.map +0 -1
  251. package/dist/src/middleware/passport/local.js +0 -81
  252. package/dist/src/middleware/passport/local.js.map +0 -1
  253. package/dist/src/middleware/passport/sso/google.js +0 -90
  254. package/dist/src/middleware/passport/sso/google.js.map +0 -1
  255. package/dist/src/middleware/passport/sso/oidc.js +0 -151
  256. package/dist/src/middleware/passport/sso/oidc.js.map +0 -1
  257. package/dist/src/middleware/passport/sso/sso.js +0 -165
  258. package/dist/src/middleware/passport/sso/sso.js.map +0 -1
  259. package/dist/src/middleware/passport/utils.js +0 -66
  260. package/dist/src/middleware/passport/utils.js.map +0 -1
  261. package/dist/src/middleware/querystringToBody.js +0 -29
  262. package/dist/src/middleware/querystringToBody.js.map +0 -1
  263. package/dist/src/middleware/tenancy.js +0 -37
  264. package/dist/src/middleware/tenancy.js.map +0 -1
  265. package/dist/src/migrations/definitions.js +0 -39
  266. package/dist/src/migrations/definitions.js.map +0 -1
  267. package/dist/src/migrations/index.js +0 -19
  268. package/dist/src/migrations/index.js.map +0 -1
  269. package/dist/src/migrations/migrations.js +0 -198
  270. package/dist/src/migrations/migrations.js.map +0 -1
  271. package/dist/src/objectStore/buckets/app.js +0 -73
  272. package/dist/src/objectStore/buckets/app.js.map +0 -1
  273. package/dist/src/objectStore/buckets/global.js +0 -58
  274. package/dist/src/objectStore/buckets/global.js.map +0 -1
  275. package/dist/src/objectStore/buckets/index.js +0 -20
  276. package/dist/src/objectStore/buckets/index.js.map +0 -1
  277. package/dist/src/objectStore/buckets/plugins.js +0 -95
  278. package/dist/src/objectStore/buckets/plugins.js.map +0 -1
  279. package/dist/src/objectStore/cloudfront.js +0 -40
  280. package/dist/src/objectStore/cloudfront.js.map +0 -1
  281. package/dist/src/objectStore/index.js +0 -20
  282. package/dist/src/objectStore/index.js.map +0 -1
  283. package/dist/src/objectStore/objectStore.js +0 -382
  284. package/dist/src/objectStore/objectStore.js.map +0 -1
  285. package/dist/src/objectStore/utils.js +0 -32
  286. package/dist/src/objectStore/utils.js.map +0 -1
  287. package/dist/src/platform/index.js +0 -33
  288. package/dist/src/platform/index.js.map +0 -1
  289. package/dist/src/platform/platformDb.js +0 -10
  290. package/dist/src/platform/platformDb.js.map +0 -1
  291. package/dist/src/platform/tenants.js +0 -139
  292. package/dist/src/platform/tenants.js.map +0 -1
  293. package/dist/src/platform/users.js +0 -96
  294. package/dist/src/platform/users.js.map +0 -1
  295. package/dist/src/plugin/index.js +0 -18
  296. package/dist/src/plugin/index.js.map +0 -1
  297. package/dist/src/plugin/utils.js +0 -145
  298. package/dist/src/plugin/utils.js.map +0 -1
  299. package/dist/src/queue/constants.js +0 -11
  300. package/dist/src/queue/constants.js.map +0 -1
  301. package/dist/src/queue/inMemoryQueue.js +0 -145
  302. package/dist/src/queue/inMemoryQueue.js.map +0 -1
  303. package/dist/src/queue/index.js +0 -19
  304. package/dist/src/queue/index.js.map +0 -1
  305. package/dist/src/queue/listeners.js +0 -186
  306. package/dist/src/queue/listeners.js.map +0 -1
  307. package/dist/src/queue/queue.js +0 -92
  308. package/dist/src/queue/queue.js.map +0 -1
  309. package/dist/src/redis/index.js +0 -37
  310. package/dist/src/redis/index.js.map +0 -1
  311. package/dist/src/redis/init.js +0 -138
  312. package/dist/src/redis/init.js.map +0 -1
  313. package/dist/src/redis/redis.js +0 -335
  314. package/dist/src/redis/redis.js.map +0 -1
  315. package/dist/src/redis/redlockImpl.js +0 -162
  316. package/dist/src/redis/redlockImpl.js.map +0 -1
  317. package/dist/src/redis/utils.js +0 -123
  318. package/dist/src/redis/utils.js.map +0 -1
  319. package/dist/src/security/encryption.js +0 -163
  320. package/dist/src/security/encryption.js.map +0 -1
  321. package/dist/src/security/permissions.js +0 -151
  322. package/dist/src/security/permissions.js.map +0 -1
  323. package/dist/src/security/roles.js +0 -388
  324. package/dist/src/security/roles.js.map +0 -1
  325. package/dist/src/security/sessions.js +0 -121
  326. package/dist/src/security/sessions.js.map +0 -1
  327. package/dist/src/tenancy/db.js +0 -10
  328. package/dist/src/tenancy/db.js.map +0 -1
  329. package/dist/src/tenancy/index.js +0 -19
  330. package/dist/src/tenancy/index.js.map +0 -1
  331. package/dist/src/tenancy/tenancy.js +0 -116
  332. package/dist/src/tenancy/tenancy.js.map +0 -1
  333. package/dist/src/timers/index.js +0 -18
  334. package/dist/src/timers/index.js.map +0 -1
  335. package/dist/src/timers/timers.js +0 -26
  336. package/dist/src/timers/timers.js.map +0 -1
  337. package/dist/src/users/db.js +0 -407
  338. package/dist/src/users/db.js.map +0 -1
  339. package/dist/src/users/events.js +0 -169
  340. package/dist/src/users/events.js.map +0 -1
  341. package/dist/src/users/index.js +0 -23
  342. package/dist/src/users/index.js.map +0 -1
  343. package/dist/src/users/lookup.js +0 -112
  344. package/dist/src/users/lookup.js.map +0 -1
  345. package/dist/src/users/users.js +0 -261
  346. package/dist/src/users/users.js.map +0 -1
  347. package/dist/src/users/utils.js +0 -92
  348. package/dist/src/users/utils.js.map +0 -1
  349. package/dist/src/utils/hashing.js +0 -47
  350. package/dist/src/utils/hashing.js.map +0 -1
  351. package/dist/src/utils/index.js +0 -20
  352. package/dist/src/utils/index.js.map +0 -1
  353. package/dist/src/utils/stringUtils.js +0 -9
  354. package/dist/src/utils/stringUtils.js.map +0 -1
  355. package/dist/src/utils/utils.js +0 -247
  356. package/dist/src/utils/utils.js.map +0 -1
  357. package/dist/tests/core/logging.js +0 -33
  358. package/dist/tests/core/logging.js.map +0 -1
  359. package/dist/tests/core/utilities/index.js +0 -37
  360. package/dist/tests/core/utilities/index.js.map +0 -1
  361. package/dist/tests/core/utilities/jestUtils.js +0 -21
  362. package/dist/tests/core/utilities/jestUtils.js.map +0 -1
  363. package/dist/tests/core/utilities/mocks/alerts.js +0 -30
  364. package/dist/tests/core/utilities/mocks/alerts.js.map +0 -1
  365. package/dist/tests/core/utilities/mocks/date.js +0 -6
  366. package/dist/tests/core/utilities/mocks/date.js.map +0 -1
  367. package/dist/tests/core/utilities/mocks/events.js +0 -143
  368. package/dist/tests/core/utilities/mocks/events.js.map +0 -1
  369. package/dist/tests/core/utilities/mocks/fetch.js +0 -15
  370. package/dist/tests/core/utilities/mocks/fetch.js.map +0 -1
  371. package/dist/tests/core/utilities/mocks/index.js +0 -43
  372. package/dist/tests/core/utilities/mocks/index.js.map +0 -1
  373. package/dist/tests/core/utilities/mocks/licenses.js +0 -97
  374. package/dist/tests/core/utilities/mocks/licenses.js.map +0 -1
  375. package/dist/tests/core/utilities/mocks/posthog.js +0 -9
  376. package/dist/tests/core/utilities/mocks/posthog.js.map +0 -1
  377. package/dist/tests/core/utilities/structures/Chance.js +0 -21
  378. package/dist/tests/core/utilities/structures/Chance.js.map +0 -1
  379. package/dist/tests/core/utilities/structures/accounts.js +0 -78
  380. package/dist/tests/core/utilities/structures/accounts.js.map +0 -1
  381. package/dist/tests/core/utilities/structures/apps.js +0 -24
  382. package/dist/tests/core/utilities/structures/apps.js.map +0 -1
  383. package/dist/tests/core/utilities/structures/common.js +0 -11
  384. package/dist/tests/core/utilities/structures/common.js.map +0 -1
  385. package/dist/tests/core/utilities/structures/db.js +0 -16
  386. package/dist/tests/core/utilities/structures/db.js.map +0 -1
  387. package/dist/tests/core/utilities/structures/documents/index.js +0 -18
  388. package/dist/tests/core/utilities/structures/documents/index.js.map +0 -1
  389. package/dist/tests/core/utilities/structures/documents/platform/index.js +0 -28
  390. package/dist/tests/core/utilities/structures/documents/platform/index.js.map +0 -1
  391. package/dist/tests/core/utilities/structures/documents/platform/installation.js +0 -38
  392. package/dist/tests/core/utilities/structures/documents/platform/installation.js.map +0 -1
  393. package/dist/tests/core/utilities/structures/generator.js +0 -9
  394. package/dist/tests/core/utilities/structures/generator.js.map +0 -1
  395. package/dist/tests/core/utilities/structures/index.js +0 -46
  396. package/dist/tests/core/utilities/structures/index.js.map +0 -1
  397. package/dist/tests/core/utilities/structures/koa.js +0 -10
  398. package/dist/tests/core/utilities/structures/koa.js.map +0 -1
  399. package/dist/tests/core/utilities/structures/licenses.js +0 -140
  400. package/dist/tests/core/utilities/structures/licenses.js.map +0 -1
  401. package/dist/tests/core/utilities/structures/plugins.js +0 -23
  402. package/dist/tests/core/utilities/structures/plugins.js.map +0 -1
  403. package/dist/tests/core/utilities/structures/quotas.js +0 -71
  404. package/dist/tests/core/utilities/structures/quotas.js.map +0 -1
  405. package/dist/tests/core/utilities/structures/scim.js +0 -63
  406. package/dist/tests/core/utilities/structures/scim.js.map +0 -1
  407. package/dist/tests/core/utilities/structures/shared.js +0 -14
  408. package/dist/tests/core/utilities/structures/shared.js.map +0 -1
  409. package/dist/tests/core/utilities/structures/sso.js +0 -132
  410. package/dist/tests/core/utilities/structures/sso.js.map +0 -1
  411. package/dist/tests/core/utilities/structures/tenants.js +0 -9
  412. package/dist/tests/core/utilities/structures/tenants.js.map +0 -1
  413. package/dist/tests/core/utilities/structures/userGroups.js +0 -13
  414. package/dist/tests/core/utilities/structures/userGroups.js.map +0 -1
  415. package/dist/tests/core/utilities/structures/users.js +0 -48
  416. package/dist/tests/core/utilities/structures/users.js.map +0 -1
  417. package/dist/tests/core/utilities/testContainerUtils.js +0 -84
  418. package/dist/tests/core/utilities/testContainerUtils.js.map +0 -1
  419. package/dist/tests/core/utilities/utils/index.js +0 -28
  420. package/dist/tests/core/utilities/utils/index.js.map +0 -1
  421. package/dist/tests/core/utilities/utils/time.js +0 -8
  422. package/dist/tests/core/utilities/utils/time.js.map +0 -1
  423. package/dist/tests/extra/DBTestConfiguration.js +0 -55
  424. package/dist/tests/extra/DBTestConfiguration.js.map +0 -1
  425. package/dist/tests/extra/index.js +0 -33
  426. package/dist/tests/extra/index.js.map +0 -1
  427. package/dist/tests/extra/testEnv.js +0 -127
  428. package/dist/tests/extra/testEnv.js.map +0 -1
  429. package/dist/tests/index.js +0 -18
  430. package/dist/tests/index.js.map +0 -1
  431. package/dist/tests/jestEnv.js +0 -8
  432. package/dist/tests/jestEnv.js.map +0 -1
  433. package/dist/tests/jestSetup.js +0 -28
  434. package/dist/tests/jestSetup.js.map +0 -1
  435. package/plugins.ts +0 -1
@@ -1,92 +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
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.getAccountHolderFromUserIds = exports.validateUniqueUser = exports.hasAppBuilderPermissions = exports.hasBuilderPermissions = exports.hasAdminPermissions = exports.isAdminOrBuilder = exports.isGlobalBuilder = exports.isAdmin = exports.isBuilder = void 0;
39
- const accountSdk = __importStar(require("../accounts"));
40
- const environment_1 = __importDefault(require("../environment"));
41
- const lookup_1 = require("./lookup");
42
- const errors_1 = require("../errors");
43
- const context_1 = require("../context");
44
- const shared_core_1 = require("@budibase/shared-core");
45
- const accounts_1 = require("../accounts");
46
- // extract from shared-core to make easily accessible from backend-core
47
- exports.isBuilder = shared_core_1.sdk.users.isBuilder;
48
- exports.isAdmin = shared_core_1.sdk.users.isAdmin;
49
- exports.isGlobalBuilder = shared_core_1.sdk.users.isGlobalBuilder;
50
- exports.isAdminOrBuilder = shared_core_1.sdk.users.isAdminOrBuilder;
51
- exports.hasAdminPermissions = shared_core_1.sdk.users.hasAdminPermissions;
52
- exports.hasBuilderPermissions = shared_core_1.sdk.users.hasBuilderPermissions;
53
- exports.hasAppBuilderPermissions = shared_core_1.sdk.users.hasAppBuilderPermissions;
54
- function validateUniqueUser(email, tenantId) {
55
- return __awaiter(this, void 0, void 0, function* () {
56
- // check budibase users in other tenants
57
- if (environment_1.default.MULTI_TENANCY) {
58
- const tenantUser = yield (0, lookup_1.getPlatformUser)(email);
59
- if (tenantUser != null && tenantUser.tenantId !== tenantId) {
60
- throw new errors_1.EmailUnavailableError(email);
61
- }
62
- }
63
- // check root account users in account portal
64
- if (!environment_1.default.SELF_HOSTED && !environment_1.default.DISABLE_ACCOUNT_PORTAL) {
65
- const account = yield accountSdk.getAccount(email);
66
- if (account && account.verified && account.tenantId !== tenantId) {
67
- throw new errors_1.EmailUnavailableError(email);
68
- }
69
- }
70
- });
71
- }
72
- exports.validateUniqueUser = validateUniqueUser;
73
- /**
74
- * For the given user id's, return the account holder if it is in the ids.
75
- */
76
- function getAccountHolderFromUserIds(userIds) {
77
- return __awaiter(this, void 0, void 0, function* () {
78
- if (!environment_1.default.SELF_HOSTED && !environment_1.default.DISABLE_ACCOUNT_PORTAL) {
79
- const tenantId = (0, context_1.getTenantId)();
80
- const account = yield (0, accounts_1.getAccountByTenantId)(tenantId);
81
- if (!account) {
82
- throw new Error(`Account not found for tenantId=${tenantId}`);
83
- }
84
- const budibaseUserId = account.budibaseUserId;
85
- if (userIds.includes(budibaseUserId)) {
86
- return account;
87
- }
88
- }
89
- });
90
- }
91
- exports.getAccountHolderFromUserIds = getAccountHolderFromUserIds;
92
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/users/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wDAAyC;AACzC,iEAAgC;AAChC,qCAA0C;AAC1C,sCAAiD;AACjD,wCAAwC;AACxC,uDAA2C;AAC3C,0CAAkD;AAElD,uEAAuE;AAC1D,QAAA,SAAS,GAAG,iBAAG,CAAC,KAAK,CAAC,SAAS,CAAA;AAC/B,QAAA,OAAO,GAAG,iBAAG,CAAC,KAAK,CAAC,OAAO,CAAA;AAC3B,QAAA,eAAe,GAAG,iBAAG,CAAC,KAAK,CAAC,eAAe,CAAA;AAC3C,QAAA,gBAAgB,GAAG,iBAAG,CAAC,KAAK,CAAC,gBAAgB,CAAA;AAC7C,QAAA,mBAAmB,GAAG,iBAAG,CAAC,KAAK,CAAC,mBAAmB,CAAA;AACnD,QAAA,qBAAqB,GAAG,iBA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AA;aACf;SACF;IACH,CAAC;CAAA;AAfD,kEAeC"}
@@ -1,47 +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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
- return new (P || (P = Promise))(function (resolve, reject) {
19
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
- step((generator = generator.apply(thisArg, _arguments || [])).next());
23
- });
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.compare = exports.hash = void 0;
30
- const environment_1 = __importDefault(require("../environment"));
31
- __exportStar(require("../docIds/newid"), exports);
32
- const bcrypt = environment_1.default.JS_BCRYPT ? require("bcryptjs") : require("bcrypt");
33
- const SALT_ROUNDS = environment_1.default.SALT_ROUNDS || 10;
34
- function hash(data) {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- const salt = yield bcrypt.genSalt(SALT_ROUNDS);
37
- return bcrypt.hash(data, salt);
38
- });
39
- }
40
- exports.hash = hash;
41
- function compare(data, encrypted) {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- return bcrypt.compare(data, encrypted);
44
- });
45
- }
46
- exports.compare = compare;
47
- //# sourceMappingURL=hashing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hashing.js","sourceRoot":"","sources":["../../../src/utils/hashing.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAgC;AAChC,kDAA+B;AAC/B,MAAM,MAAM,GAAG,qBAAG,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEtE,MAAM,WAAW,GAAG,qBAAG,CAAC,WAAW,IAAI,EAAE,CAAA;AAEzC,SAAsB,IAAI,CAAC,IAAY;;QACrC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;QAC9C,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAChC,CAAC;CAAA;AAHD,oBAGC;AAED,SAAsB,OAAO,CAAC,IAAY,EAAE,SAAiB;;QAC3D,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;IACxC,CAAC;CAAA;AAFD,0BAEC"}
@@ -1,20 +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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./hashing"), exports);
18
- __exportStar(require("./utils"), exports);
19
- __exportStar(require("./stringUtils"), exports);
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,0CAAuB;AACvB,gDAA6B"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validEmail = void 0;
4
- function validEmail(value) {
5
- return (value &&
6
- !!value.match(/^(([^<>()[\]\\.,;:\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,}))$/));
7
- }
8
- exports.validEmail = validEmail;
9
- //# sourceMappingURL=stringUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stringUtils.js","sourceRoot":"","sources":["../../../src/utils/stringUtils.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU,CAAC,KAAa;IACtC,OAAO,CACL,KAAK;QACL,CAAC,CAAC,KAAK,CAAC,KAAK,CACX,sJAAsJ,CACvJ,CACF,CAAA;AACH,CAAC;AAPD,gCAOC"}
@@ -1,247 +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
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.isAudited = exports.timeout = exports.isClient = exports.clearCookie = exports.setCookie = exports.getCookie = exports.isValidInternalAPIKey = exports.openJwt = exports.getAppIdFromCtx = exports.isPublicApiRequest = exports.isServingBuilderPreview = exports.isServingBuilder = exports.isServingApp = exports.resolveAppUrl = void 0;
39
- const db_1 = require("../db");
40
- const constants_1 = require("../constants");
41
- const environment_1 = __importDefault(require("../environment"));
42
- const tenancy = __importStar(require("../tenancy"));
43
- const context = __importStar(require("../context"));
44
- const types_1 = require("@budibase/types");
45
- const jwt = require("jsonwebtoken");
46
- const APP_PREFIX = constants_1.DocumentType.APP + constants_1.SEPARATOR;
47
- const PROD_APP_PREFIX = "/app/";
48
- const BUILDER_PREVIEW_PATH = "/app/preview";
49
- const BUILDER_PREFIX = "/builder";
50
- const BUILDER_APP_PREFIX = `${BUILDER_PREFIX}/app/`;
51
- const PUBLIC_API_PREFIX = "/api/public/v";
52
- function confirmAppId(possibleAppId) {
53
- return possibleAppId && possibleAppId.startsWith(APP_PREFIX)
54
- ? possibleAppId
55
- : undefined;
56
- }
57
- function resolveAppUrl(ctx) {
58
- return __awaiter(this, void 0, void 0, function* () {
59
- const appUrl = ctx.path.split("/")[2];
60
- let possibleAppUrl = `/${appUrl.toLowerCase()}`;
61
- let tenantId = context.getTenantId();
62
- if (environment_1.default.MULTI_TENANCY) {
63
- // always use the tenant id from the subdomain in multi tenancy
64
- // this ensures the logged-in user tenant id doesn't overwrite
65
- // e.g. in the case of viewing a public app while already logged-in to another tenant
66
- tenantId = tenancy.getTenantIDFromCtx(ctx, {
67
- includeStrategies: [types_1.TenantResolutionStrategy.SUBDOMAIN],
68
- });
69
- }
70
- // search prod apps for a url that matches
71
- const apps = yield context.doInTenant(tenantId, () => (0, db_1.getAllApps)({ dev: false }));
72
- const app = apps.filter(a => a.url && a.url.toLowerCase() === possibleAppUrl)[0];
73
- return app && app.appId ? app.appId : undefined;
74
- });
75
- }
76
- exports.resolveAppUrl = resolveAppUrl;
77
- function isServingApp(ctx) {
78
- // dev app
79
- if (ctx.path.startsWith(`/${APP_PREFIX}`)) {
80
- return true;
81
- }
82
- // prod app
83
- if (ctx.path.startsWith(PROD_APP_PREFIX)) {
84
- return true;
85
- }
86
- return false;
87
- }
88
- exports.isServingApp = isServingApp;
89
- function isServingBuilder(ctx) {
90
- return ctx.path.startsWith(BUILDER_APP_PREFIX);
91
- }
92
- exports.isServingBuilder = isServingBuilder;
93
- function isServingBuilderPreview(ctx) {
94
- return ctx.path.startsWith(BUILDER_PREVIEW_PATH);
95
- }
96
- exports.isServingBuilderPreview = isServingBuilderPreview;
97
- function isPublicApiRequest(ctx) {
98
- return ctx.path.startsWith(PUBLIC_API_PREFIX);
99
- }
100
- exports.isPublicApiRequest = isPublicApiRequest;
101
- /**
102
- * Given a request tries to find the appId, which can be located in various places
103
- * @param {object} ctx The main request body to look through.
104
- * @returns {string|undefined} If an appId was found it will be returned.
105
- */
106
- function getAppIdFromCtx(ctx) {
107
- return __awaiter(this, void 0, void 0, function* () {
108
- // look in headers
109
- const options = [ctx.request.headers[constants_1.Header.APP_ID]];
110
- let appId;
111
- for (let option of options) {
112
- appId = confirmAppId(option);
113
- if (appId) {
114
- break;
115
- }
116
- }
117
- // look in body
118
- if (!appId && ctx.request.body && ctx.request.body.appId) {
119
- appId = confirmAppId(ctx.request.body.appId);
120
- }
121
- // look in the path
122
- const pathId = parseAppIdFromUrl(ctx.path);
123
- if (!appId && pathId) {
124
- appId = confirmAppId(pathId);
125
- }
126
- // lookup using custom url - prod apps only
127
- // filter out the builder preview path which collides with the prod app path
128
- // to ensure we don't load all apps excessively
129
- const isBuilderPreview = ctx.path.startsWith(BUILDER_PREVIEW_PATH);
130
- const isViewingProdApp = ctx.path.startsWith(PROD_APP_PREFIX) && !isBuilderPreview;
131
- if (!appId && isViewingProdApp) {
132
- appId = confirmAppId(yield resolveAppUrl(ctx));
133
- }
134
- // look in the referer - builder only
135
- // make sure this is performed after prod app url resolution, in case the
136
- // referer header is present from a builder redirect
137
- const referer = ctx.request.headers.referer;
138
- if (!appId && (referer === null || referer === void 0 ? void 0 : referer.includes(BUILDER_APP_PREFIX))) {
139
- const refererId = parseAppIdFromUrl(ctx.request.headers.referer);
140
- appId = confirmAppId(refererId);
141
- }
142
- return appId;
143
- });
144
- }
145
- exports.getAppIdFromCtx = getAppIdFromCtx;
146
- function parseAppIdFromUrl(url) {
147
- if (!url) {
148
- return;
149
- }
150
- return url.split("/").find(subPath => subPath.startsWith(APP_PREFIX));
151
- }
152
- /**
153
- * opens the contents of the specified encrypted JWT.
154
- * @return {object} the contents of the token.
155
- */
156
- function openJwt(token) {
157
- if (!token) {
158
- return token;
159
- }
160
- try {
161
- return jwt.verify(token, environment_1.default.JWT_SECRET);
162
- }
163
- catch (e) {
164
- if (environment_1.default.JWT_SECRET_FALLBACK) {
165
- // fallback to enable rotation
166
- return jwt.verify(token, environment_1.default.JWT_SECRET_FALLBACK);
167
- }
168
- else {
169
- throw e;
170
- }
171
- }
172
- }
173
- exports.openJwt = openJwt;
174
- function isValidInternalAPIKey(apiKey) {
175
- if (environment_1.default.INTERNAL_API_KEY && environment_1.default.INTERNAL_API_KEY === apiKey) {
176
- return true;
177
- }
178
- // fallback to enable rotation
179
- if (environment_1.default.INTERNAL_API_KEY_FALLBACK &&
180
- environment_1.default.INTERNAL_API_KEY_FALLBACK === apiKey) {
181
- return true;
182
- }
183
- return false;
184
- }
185
- exports.isValidInternalAPIKey = isValidInternalAPIKey;
186
- /**
187
- * Get a cookie from context, and decrypt if necessary.
188
- * @param {object} ctx The request which is to be manipulated.
189
- * @param {string} name The name of the cookie to get.
190
- */
191
- function getCookie(ctx, name) {
192
- const cookie = ctx.cookies.get(name);
193
- if (!cookie) {
194
- return cookie;
195
- }
196
- return openJwt(cookie);
197
- }
198
- exports.getCookie = getCookie;
199
- /**
200
- * Store a cookie for the request - it will not expire.
201
- * @param {object} ctx The request which is to be manipulated.
202
- * @param {string} name The name of the cookie to set.
203
- * @param {string|object} value The value of cookie which will be set.
204
- * @param {object} opts options like whether to sign.
205
- */
206
- function setCookie(ctx, value, name = "builder", opts = { sign: true }) {
207
- if (value && opts && opts.sign) {
208
- value = jwt.sign(value, environment_1.default.JWT_SECRET);
209
- }
210
- const config = {
211
- expires: constants_1.MAX_VALID_DATE,
212
- path: "/",
213
- httpOnly: false,
214
- overwrite: true,
215
- };
216
- if (environment_1.default.COOKIE_DOMAIN) {
217
- config.domain = environment_1.default.COOKIE_DOMAIN;
218
- }
219
- ctx.cookies.set(name, value, config);
220
- }
221
- exports.setCookie = setCookie;
222
- /**
223
- * Utility function, simply calls setCookie with an empty string for value
224
- */
225
- function clearCookie(ctx, name) {
226
- setCookie(ctx, null, name);
227
- }
228
- exports.clearCookie = clearCookie;
229
- /**
230
- * Checks if the API call being made (based on the provided ctx object) is from the client. If
231
- * the call is not from a client app then it is from the builder.
232
- * @param {object} ctx The koa context object to be tested.
233
- * @return {boolean} returns true if the call is from the client lib (a built app rather than the builder).
234
- */
235
- function isClient(ctx) {
236
- return ctx.headers[constants_1.Header.TYPE] === "client";
237
- }
238
- exports.isClient = isClient;
239
- function timeout(timeMs) {
240
- return new Promise(resolve => setTimeout(resolve, timeMs));
241
- }
242
- exports.timeout = timeout;
243
- function isAudited(event) {
244
- return !!types_1.AuditedEventFriendlyName[event];
245
- }
246
- exports.isAudited = isAudited;
247
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAAkC;AAClC,4CAA8E;AAC9E,iEAAgC;AAChC,oDAAqC;AACrC,oDAAqC;AACrC,2CAMwB;AAExB,MAAM,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;AAEnC,MAAM,UAAU,GAAG,wBAAY,CAAC,GAAG,GAAG,qBAAS,CAAA;AAC/C,MAAM,eAAe,GAAG,OAAO,CAAA;AAE/B,MAAM,oBAAoB,GAAG,cAAc,CAAA;AAC3C,MAAM,cAAc,GAAG,UAAU,CAAA;AACjC,MAAM,kBAAkB,GAAG,GAAG,cAAc,OAAO,CAAA;AACnD,MAAM,iBAAiB,GAAG,eAAe,CAAA;AAEzC,SAAS,YAAY,CAAC,aAAiC;IACrD,OAAO,aAAa,IAAI,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC;QAC1D,CAAC,CAAC,aAAa;QACf,CAAC,CAAC,SAAS,CAAA;AACf,CAAC;AAED,SAAsB,aAAa,CAAC,GAAQ;;QAC1C,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;QACrC,IAAI,cAA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,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAC5B,CAAC;AAFD,kCAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,GAAQ;IAC/B,OAAO,GAAG,CAAC,OAAO,CAAC,kBAAM,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAA;AAC9C,CAAC;AAFD,4BAEC;AAED,SAAgB,OAAO,CAAC,MAAc;IACpC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAA;AAC5D,CAAC;AAFD,0BAEC;AAED,SAAgB,SAAS,CAAC,KAAY;IACpC,OAAO,CAAC,CAAC,gCAAwB,CAAC,KAAK,CAAC,CAAA;AAC1C,CAAC;AAFD,8BAEC"}
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogLevel = void 0;
4
- var LogLevel;
5
- (function (LogLevel) {
6
- LogLevel["TRACE"] = "trace";
7
- LogLevel["DEBUG"] = "debug";
8
- LogLevel["INFO"] = "info";
9
- LogLevel["WARN"] = "warn";
10
- LogLevel["ERROR"] = "error";
11
- })(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
12
- const LOG_INDEX = {
13
- [LogLevel.TRACE]: 1,
14
- [LogLevel.DEBUG]: 2,
15
- [LogLevel.INFO]: 3,
16
- [LogLevel.WARN]: 4,
17
- [LogLevel.ERROR]: 5,
18
- };
19
- const setIndex = LOG_INDEX[process.env.LOG_LEVEL];
20
- if (setIndex > LOG_INDEX.trace) {
21
- global.console.trace = jest.fn();
22
- }
23
- if (setIndex > LOG_INDEX.debug) {
24
- global.console.debug = jest.fn();
25
- }
26
- if (setIndex > LOG_INDEX.info) {
27
- global.console.info = jest.fn();
28
- global.console.log = jest.fn();
29
- }
30
- if (setIndex > LOG_INDEX.warn) {
31
- global.console.warn = jest.fn();
32
- }
33
- //# sourceMappingURL=logging.js.map
@@ -1 +0,0 @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
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
26
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.utils = exports.testContainerUtils = exports.generator = exports.structures = exports.mocks = void 0;
30
- exports.mocks = __importStar(require("./mocks"));
31
- exports.structures = __importStar(require("./structures"));
32
- var structures_1 = require("./structures");
33
- Object.defineProperty(exports, "generator", { enumerable: true, get: function () { return structures_1.generator; } });
34
- exports.testContainerUtils = __importStar(require("./testContainerUtils"));
35
- exports.utils = __importStar(require("./utils"));
36
- __exportStar(require("./jestUtils"), exports);
37
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../tests/core/utilities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAgC;AAChC,2DAA0C;AAC1C,2CAAwC;AAA/B,uGAAA,SAAS,OAAA;AAClB,2EAA0D;AAC1D,iDAAgC;AAChC,8CAA2B"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.expectAnyExternalColsAttributes = exports.expectAnyInternalColsAttributes = exports.expectFunctionWasCalledTimesWith = void 0;
4
- function expectFunctionWasCalledTimesWith(jestFunction, times, argument) {
5
- expect(jestFunction.mock.calls.filter((call) => call[0] === argument).length).toBe(times);
6
- }
7
- exports.expectFunctionWasCalledTimesWith = expectFunctionWasCalledTimesWith;
8
- exports.expectAnyInternalColsAttributes = {
9
- tableId: expect.anything(),
10
- type: expect.anything(),
11
- _id: expect.anything(),
12
- _rev: expect.anything(),
13
- createdAt: expect.anything(),
14
- updatedAt: expect.anything(),
15
- };
16
- exports.expectAnyExternalColsAttributes = {
17
- tableId: expect.anything(),
18
- _id: expect.anything(),
19
- _rev: expect.anything(),
20
- };
21
- //# sourceMappingURL=jestUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jestUtils.js","sourceRoot":"","sources":["../../../../tests/core/utilities/jestUtils.ts"],"names":[],"mappings":";;;AAEA,SAAgB,gCAAgC,CAC9C,YAAiB,EACjB,KAAa,EACb,QAAa;IAEb,MAAM,CACJ,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,MAAM,CAC3E,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACf,CAAC;AARD,4EAQC;AAEY,QAAA,+BAA+B,GAExC;IACF,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE;IAC1B,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE;IACvB,GAAG,EAAE,MAAM,CAAC,QAAQ,EAAE;IACtB,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE;IACvB,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE;IAC5B,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE;CAC7B,CAAA;AAEY,QAAA,+BAA+B,GAExC;IACF,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE;IAC1B,GAAG,EAAE,MAAM,CAAC,QAAQ,EAAE;IACtB,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE;CACxB,CAAA"}
@@ -1,30 +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.alerts = void 0;
27
- jest.mock("../../../../src/logging/alerts");
28
- const _alerts = __importStar(require("../../../../src/logging/alerts"));
29
- exports.alerts = jest.mocked(_alerts);
30
- //# sourceMappingURL=alerts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alerts.js","sourceRoot":"","sources":["../../../../../tests/core/utilities/mocks/alerts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAI,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAA;AAC3C,wEAAyD;AAC5C,QAAA,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MOCK_DATE_TIMESTAMP = exports.MOCK_DATE = void 0;
4
- exports.MOCK_DATE = new Date("2020-01-01T00:00:00.000Z");
5
- exports.MOCK_DATE_TIMESTAMP = 1577836800000;
6
- //# sourceMappingURL=date.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"date.js","sourceRoot":"","sources":["../../../../../tests/core/utilities/mocks/date.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,IAAI,IAAI,CAAC,0BAA0B,CAAC,CAAA;AAChD,QAAA,mBAAmB,GAAG,aAAa,CAAA"}