@budibase/backend-core 2.9.16 → 2.9.18

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,18 +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("./errors"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/errors/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB"}
@@ -1,42 +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
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.enabled = void 0;
36
- const configs = __importStar(require("../configs"));
37
- // wrapper utility function
38
- const enabled = () => __awaiter(void 0, void 0, void 0, function* () {
39
- return configs.analyticsEnabled();
40
- });
41
- exports.enabled = enabled;
42
- //# sourceMappingURL=analytics.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../../src/events/analytics.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAqC;AAErC,2BAA2B;AACpB,MAAM,OAAO,GAAG,GAAS,EAAE;IAChC,OAAO,OAAO,CAAC,gBAAgB,EAAE,CAAA;AACnC,CAAC,CAAA,CAAA;AAFY,QAAA,OAAO,WAEnB"}
@@ -1,19 +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("./queue"), exports);
18
- __exportStar(require("./publisher"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/events/asyncEvents/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,8CAA2B"}
@@ -1,27 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.publishAsyncEvent = void 0;
13
- const types_1 = require("@budibase/types");
14
- const queue_1 = require("./queue");
15
- function publishAsyncEvent(payload) {
16
- return __awaiter(this, void 0, void 0, function* () {
17
- if (!queue_1.asyncEventQueue) {
18
- (0, queue_1.init)();
19
- }
20
- const { event, identity } = payload;
21
- if (types_1.AsyncEvents.indexOf(event) !== -1 && identity.tenantId) {
22
- yield queue_1.asyncEventQueue.add(payload);
23
- }
24
- });
25
- }
26
- exports.publishAsyncEvent = publishAsyncEvent;
27
- //# sourceMappingURL=publisher.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"publisher.js","sourceRoot":"","sources":["../../../../src/events/asyncEvents/publisher.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA6C;AAC7C,mCAA6D;AAE7D,SAAsB,iBAAiB,CAAC,OAAqB;;QAC3D,IAAI,CAAC,uBAAe,EAAE;YACpB,IAAA,YAAI,GAAE,CAAA;SACP;QACD,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;QACnC,IAAI,mBAAW,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,QAAQ,CAAC,QAAQ,EAAE;YAC1D,MAAM,uBAAe,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;SACnC;IACH,CAAC;CAAA;AARD,8CAQC"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.shutdown = exports.init = exports.asyncEventQueue = void 0;
13
- const queue_1 = require("../../queue");
14
- function init() {
15
- exports.asyncEventQueue = (0, queue_1.createQueue)(queue_1.JobQueue.SYSTEM_EVENT_QUEUE);
16
- }
17
- exports.init = init;
18
- function shutdown() {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- if (exports.asyncEventQueue) {
21
- yield exports.asyncEventQueue.close();
22
- }
23
- });
24
- }
25
- exports.shutdown = shutdown;
26
- //# sourceMappingURL=queue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queue.js","sourceRoot":"","sources":["../../../../src/events/asyncEvents/queue.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,uCAAmD;AAYnD,SAAgB,IAAI;IAClB,uBAAe,GAAG,IAAA,mBAAW,EAAe,gBAAQ,CAAC,kBAAkB,CAAC,CAAA;AAC1E,CAAC;AAFD,oBAEC;AAED,SAAsB,QAAQ;;QAC5B,IAAI,uBAAe,EAAE;YACnB,MAAM,uBAAe,CAAC,KAAK,EAAE,CAAA;SAC9B;IACH,CAAC;CAAA;AAJD,4BAIC"}
@@ -1,179 +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
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.isAlreadySent = exports.isBackfillingEvent = exports.end = exports.recordEvent = exports.start = void 0;
36
- const types_1 = require("@budibase/types");
37
- const context = __importStar(require("../context"));
38
- const generic_1 = require("../cache/generic");
39
- const cache = __importStar(require("../cache/generic"));
40
- // LIFECYCLE
41
- const start = (events) => __awaiter(void 0, void 0, void 0, function* () {
42
- const metadata = {
43
- eventWhitelist: events,
44
- };
45
- return saveBackfillMetadata(metadata);
46
- });
47
- exports.start = start;
48
- const recordEvent = (event, properties) => __awaiter(void 0, void 0, void 0, function* () {
49
- const eventKey = getEventKey(event, properties);
50
- // don't use a ttl - cleaned up by migration
51
- // don't use tenancy - already in the key
52
- yield cache.store(eventKey, properties, undefined, { useTenancy: false });
53
- });
54
- exports.recordEvent = recordEvent;
55
- const end = () => __awaiter(void 0, void 0, void 0, function* () {
56
- yield deleteBackfillMetadata();
57
- yield clearEvents();
58
- });
59
- exports.end = end;
60
- // CRUD
61
- const getBackfillMetadata = () => __awaiter(void 0, void 0, void 0, function* () {
62
- return cache.get(generic_1.CacheKey.BACKFILL_METADATA);
63
- });
64
- const saveBackfillMetadata = (backfill) => __awaiter(void 0, void 0, void 0, function* () {
65
- // no TTL - deleted by backfill
66
- return cache.store(generic_1.CacheKey.BACKFILL_METADATA, backfill);
67
- });
68
- const deleteBackfillMetadata = () => __awaiter(void 0, void 0, void 0, function* () {
69
- yield cache.destroy(generic_1.CacheKey.BACKFILL_METADATA);
70
- });
71
- const clearEvents = () => __awaiter(void 0, void 0, void 0, function* () {
72
- // wildcard
73
- const pattern = getEventKey();
74
- const keys = yield cache.keys(pattern);
75
- for (const key of keys) {
76
- // delete each key
77
- // don't use tenancy, already in the key
78
- yield cache.destroy(key, { useTenancy: false });
79
- }
80
- });
81
- // HELPERS
82
- const isBackfillingEvent = (event) => __awaiter(void 0, void 0, void 0, function* () {
83
- const backfill = yield getBackfillMetadata();
84
- const events = backfill === null || backfill === void 0 ? void 0 : backfill.eventWhitelist;
85
- if (events && events.includes(event)) {
86
- return true;
87
- }
88
- else {
89
- return false;
90
- }
91
- });
92
- exports.isBackfillingEvent = isBackfillingEvent;
93
- const isAlreadySent = (event, properties) => __awaiter(void 0, void 0, void 0, function* () {
94
- const eventKey = getEventKey(event, properties);
95
- const cachedEvent = yield cache.get(eventKey, {
96
- useTenancy: false,
97
- });
98
- return !!cachedEvent;
99
- });
100
- exports.isAlreadySent = isAlreadySent;
101
- const CUSTOM_PROPERTY_SUFFIX = {
102
- // APP EVENTS
103
- [types_1.Event.AUTOMATION_CREATED]: (properties) => {
104
- return properties.automationId;
105
- },
106
- [types_1.Event.AUTOMATION_STEP_CREATED]: (properties) => {
107
- return properties.stepId;
108
- },
109
- [types_1.Event.DATASOURCE_CREATED]: (properties) => {
110
- return properties.datasourceId;
111
- },
112
- [types_1.Event.LAYOUT_CREATED]: (properties) => {
113
- return properties.layoutId;
114
- },
115
- [types_1.Event.QUERY_CREATED]: (properties) => {
116
- return properties.queryId;
117
- },
118
- [types_1.Event.ROLE_CREATED]: (properties) => {
119
- return properties.roleId;
120
- },
121
- [types_1.Event.SCREEN_CREATED]: (properties) => {
122
- return properties.screenId;
123
- },
124
- [types_1.Event.TABLE_CREATED]: (properties) => {
125
- return properties.tableId;
126
- },
127
- [types_1.Event.VIEW_CREATED]: (properties) => {
128
- return properties.tableId; // best uniqueness
129
- },
130
- [types_1.Event.VIEW_CALCULATION_CREATED]: (properties) => {
131
- return properties.tableId; // best uniqueness
132
- },
133
- [types_1.Event.VIEW_FILTER_CREATED]: (properties) => {
134
- return properties.tableId; // best uniqueness
135
- },
136
- [types_1.Event.APP_CREATED]: (properties) => {
137
- return properties.appId; // best uniqueness
138
- },
139
- [types_1.Event.APP_PUBLISHED]: (properties) => {
140
- return properties.appId; // best uniqueness
141
- },
142
- // GLOBAL EVENTS
143
- [types_1.Event.AUTH_SSO_CREATED]: (properties) => {
144
- return properties.type;
145
- },
146
- [types_1.Event.AUTH_SSO_ACTIVATED]: (properties) => {
147
- return properties.type;
148
- },
149
- [types_1.Event.USER_CREATED]: (properties) => {
150
- return properties.userId;
151
- },
152
- [types_1.Event.USER_PERMISSION_ADMIN_ASSIGNED]: (properties) => {
153
- return properties.userId;
154
- },
155
- [types_1.Event.USER_PERMISSION_BUILDER_ASSIGNED]: (properties) => {
156
- return properties.userId;
157
- },
158
- [types_1.Event.ROLE_ASSIGNED]: (properties) => {
159
- return `${properties.roleId}-${properties.userId}`;
160
- },
161
- };
162
- const getEventKey = (event, properties) => {
163
- let eventKey;
164
- const tenantId = context.getTenantId();
165
- if (event) {
166
- eventKey = `${generic_1.CacheKey.EVENTS}:${tenantId}:${event}`;
167
- // use some properties to make the key more unique
168
- const custom = CUSTOM_PROPERTY_SUFFIX[event];
169
- const suffix = custom ? custom(properties) : undefined;
170
- if (suffix) {
171
- eventKey = `${eventKey}:${suffix}`;
172
- }
173
- }
174
- else {
175
- eventKey = `${generic_1.CacheKey.EVENTS}:${tenantId}:*`;
176
- }
177
- return eventKey;
178
- };
179
- //# sourceMappingURL=backfill.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"backfill.js","sourceRoot":"","sources":["../../../src/events/backfill.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAqBwB;AACxB,oDAAqC;AACrC,8CAA2C;AAC3C,wDAAyC;AAEzC,YAAY;A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C,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACtD,IAAI,MAAM,EAAE;YACV,QAAQ,GAAG,GAAG,QAAQ,IAAI,MAAM,EAAE,CAAA;SACnC;KACF;SAAM;QACL,QAAQ,GAAG,GAAG,kBAAQ,CAAC,MAAM,IAAI,QAAQ,IAAI,CAAA;KAC9C;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDocumentId = void 0;
4
- const types_1 = require("@budibase/types");
5
- const getEventProperties = {
6
- [types_1.Event.USER_CREATED]: (properties) => properties.userId,
7
- [types_1.Event.USER_UPDATED]: (properties) => properties.userId,
8
- [types_1.Event.USER_DELETED]: (properties) => properties.userId,
9
- [types_1.Event.USER_PERMISSION_ADMIN_ASSIGNED]: (properties) => properties.userId,
10
- [types_1.Event.USER_PERMISSION_ADMIN_REMOVED]: (properties) => properties.userId,
11
- [types_1.Event.USER_PERMISSION_BUILDER_ASSIGNED]: (properties) => properties.userId,
12
- [types_1.Event.USER_PERMISSION_BUILDER_REMOVED]: (properties) => properties.userId,
13
- [types_1.Event.USER_GROUP_CREATED]: (properties) => properties.groupId,
14
- [types_1.Event.USER_GROUP_UPDATED]: (properties) => properties.groupId,
15
- [types_1.Event.USER_GROUP_DELETED]: (properties) => properties.groupId,
16
- [types_1.Event.USER_GROUP_USERS_ADDED]: (properties) => properties.groupId,
17
- [types_1.Event.USER_GROUP_USERS_REMOVED]: (properties) => properties.groupId,
18
- [types_1.Event.USER_GROUP_PERMISSIONS_EDITED]: (properties) => properties.groupId,
19
- };
20
- function getDocumentId(event, properties) {
21
- const extractor = getEventProperties[event];
22
- if (!extractor) {
23
- throw new Error("Event does not have a method of document ID extraction");
24
- }
25
- return extractor(properties);
26
- }
27
- exports.getDocumentId = getDocumentId;
28
- //# sourceMappingURL=documentId.js.map
@@ -1 +0,0 @@
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O;IACpB,CAAC,aAAK,CAAC,6BAA6B,CAAC,EAAE,CACrC,UAAuC,EACvC,EAAE,CAAC,UAAU,CAAC,OAAO;CACxB,CAAA;AAED,SAAgB,aAAa,CAAC,KAAY,EAAE,UAAe;IACzD,MAAM,SAAS,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAA;IAC3C,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;KAC1E;IACD,OAAO,SAAS,CAAC,UAAU,CAAC,CAAA;AAC9B,CAAC;AAND,sCAMC"}
@@ -1,73 +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.publishEvent = void 0;
39
- const processors_1 = require("./processors");
40
- const identification_1 = __importDefault(require("./identification"));
41
- const backfill = __importStar(require("./backfill"));
42
- const asyncEvents_1 = require("./asyncEvents");
43
- const publishEvent = (event, properties, timestamp) => __awaiter(void 0, void 0, void 0, function* () {
44
- // in future this should use async events via a distributed queue.
45
- const identity = yield identification_1.default.getCurrentIdentity();
46
- const backfilling = yield backfill.isBackfillingEvent(event);
47
- // no backfill - send the event and exit
48
- if (!backfilling) {
49
- // send off async events if required
50
- yield (0, asyncEvents_1.publishAsyncEvent)({
51
- event,
52
- identity,
53
- properties,
54
- timestamp,
55
- });
56
- // now handle the main sync event processing pipeline
57
- yield processors_1.processors.processEvent(event, identity, properties, timestamp);
58
- return;
59
- }
60
- // backfill active - check if the event has been sent already
61
- const alreadySent = yield backfill.isAlreadySent(event, properties);
62
- if (alreadySent) {
63
- // do nothing
64
- return;
65
- }
66
- else {
67
- // send and record the event
68
- yield processors_1.processors.processEvent(event, identity, properties, timestamp);
69
- yield backfill.recordEvent(event, properties);
70
- }
71
- });
72
- exports.publishEvent = publishEvent;
73
- //# sourceMappingURL=events.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/events/events.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAAyC;AACzC,sEAA6C;AAC7C,qDAAsC;AACtC,+CAAiD;AAE1C,MAAM,YAAY,GAAG,CAC1B,KAAY,EACZ,UAAe,EACf,SAA2B,EAC3B,EAAE;IACF,kEAAkE;IAClE,MAAM,QAAQ,GAAG,MAAM,wBAAc,CAAC,kBAAkB,EAAE,CAAA;IAE1D,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;IAC5D,wCAAwC;IACxC,IAAI,CAAC,WAAW,EAAE;QAChB,oCAAoC;QACpC,MAAM,IAAA,+BAAiB,EAAC;YACtB,KAAK;YACL,QAAQ;YACR,UAAU;YACV,SAAS;SACV,CAAC,CAAA;QACF,qDAAqD;QACrD,MAAM,uBAAU,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC,CAAA;QACrE,OAAM;KACP;IAED,6DAA6D;IAC7D,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;IACnE,IAAI,WAAW,EAAE;QACf,aAAa;QACb,OAAM;KACP;SAAM;QACL,4BAA4B;QAC5B,MAAM,uBAAU,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC,CAAA;QACrE,MAAM,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;KAC9C;AACH,CAAC,CAAA,CAAA;AAjCY,QAAA,YAAY,gBAiCxB"}