@tachybase/plugin-adapter-bullmq 1.3.17 → 1.3.19

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 (347) hide show
  1. package/dist/externalVersion.js +2 -2
  2. package/dist/node_modules/@bull-board/api/dist/src/handlers/error.d.ts +4 -2
  3. package/dist/node_modules/@bull-board/api/dist/src/handlers/error.js +2 -2
  4. package/dist/node_modules/@bull-board/api/dist/src/handlers/pauseAll.d.ts +4 -0
  5. package/dist/node_modules/@bull-board/api/dist/src/handlers/pauseAll.js +15 -0
  6. package/dist/node_modules/@bull-board/api/dist/src/handlers/queues.js +4 -0
  7. package/dist/node_modules/@bull-board/api/dist/src/handlers/resumeAll.d.ts +4 -0
  8. package/dist/node_modules/@bull-board/api/dist/src/handlers/resumeAll.js +15 -0
  9. package/dist/node_modules/@bull-board/api/dist/src/index.js +1 -1
  10. package/dist/node_modules/@bull-board/api/dist/src/queueAdapters/base.d.ts +4 -0
  11. package/dist/node_modules/@bull-board/api/dist/src/queueAdapters/base.js +6 -0
  12. package/dist/node_modules/@bull-board/api/dist/src/queueAdapters/bull.js +6 -4
  13. package/dist/node_modules/@bull-board/api/dist/src/routes.js +4 -0
  14. package/dist/node_modules/@bull-board/api/dist/typings/app.d.ts +22 -2
  15. package/dist/node_modules/@bull-board/api/package.json +1 -1
  16. package/dist/node_modules/@bull-board/koa/dist/KoaAdapter.js +1 -1
  17. package/dist/node_modules/@bull-board/koa/dist/index.js +6 -6
  18. package/dist/node_modules/@bull-board/koa/package.json +1 -1
  19. package/dist/node_modules/bullmq/dist/cjs/classes/backoffs.js +18 -5
  20. package/dist/node_modules/bullmq/dist/cjs/classes/child-pool.js +7 -2
  21. package/dist/node_modules/bullmq/dist/cjs/classes/child-processor.js +59 -5
  22. package/dist/node_modules/bullmq/dist/cjs/classes/child.js +3 -1
  23. package/dist/node_modules/bullmq/dist/cjs/classes/errors/index.js +2 -1
  24. package/dist/node_modules/bullmq/dist/cjs/classes/errors/waiting-error.js +19 -0
  25. package/dist/node_modules/bullmq/dist/cjs/classes/flow-producer.js +21 -5
  26. package/dist/node_modules/bullmq/dist/cjs/classes/index.js +1 -0
  27. package/dist/node_modules/bullmq/dist/cjs/classes/job-scheduler.js +88 -62
  28. package/dist/node_modules/bullmq/dist/cjs/classes/job.js +216 -109
  29. package/dist/node_modules/bullmq/dist/cjs/classes/main-base.js +1 -1
  30. package/dist/node_modules/bullmq/dist/cjs/classes/queue-base.js +10 -9
  31. package/dist/node_modules/bullmq/dist/cjs/classes/queue-getters.js +34 -14
  32. package/dist/node_modules/bullmq/dist/cjs/classes/queue.js +19 -13
  33. package/dist/node_modules/bullmq/dist/cjs/classes/redis-connection.js +16 -9
  34. package/dist/node_modules/bullmq/dist/cjs/classes/repeat.js +1 -1
  35. package/dist/node_modules/bullmq/dist/cjs/classes/sandbox.js +54 -28
  36. package/dist/node_modules/bullmq/dist/cjs/classes/scripts.js +141 -39
  37. package/dist/node_modules/bullmq/dist/cjs/classes/worker.js +191 -182
  38. package/dist/node_modules/bullmq/dist/cjs/commands/addDelayedJob-6.lua +6 -17
  39. package/dist/node_modules/bullmq/dist/cjs/commands/addJobScheduler-11.lua +123 -0
  40. package/dist/node_modules/bullmq/dist/{esm/commands/addParentJob-4.lua → cjs/commands/addParentJob-5.lua} +7 -6
  41. package/dist/node_modules/bullmq/dist/cjs/commands/{addPrioritizedJob-8.lua → addPrioritizedJob-9.lua} +11 -10
  42. package/dist/node_modules/bullmq/dist/cjs/commands/addRepeatableJob-2.lua +2 -2
  43. package/dist/node_modules/bullmq/dist/{esm/commands/addStandardJob-8.lua → cjs/commands/addStandardJob-9.lua} +9 -8
  44. package/dist/node_modules/bullmq/dist/cjs/commands/cleanJobsInSet-3.lua +9 -5
  45. package/dist/node_modules/bullmq/dist/cjs/commands/drain-5.lua +16 -16
  46. package/dist/node_modules/bullmq/dist/cjs/commands/getDependencyCounts-4.lua +31 -0
  47. package/dist/node_modules/bullmq/dist/cjs/commands/getState-8.lua +5 -5
  48. package/dist/node_modules/bullmq/dist/cjs/commands/getStateV2-8.lua +8 -8
  49. package/dist/node_modules/bullmq/dist/cjs/commands/includes/addDelayedJob.lua +23 -0
  50. package/dist/node_modules/bullmq/dist/cjs/commands/includes/addJobFromScheduler.lua +37 -0
  51. package/dist/node_modules/bullmq/dist/cjs/commands/includes/addJobWithPriority.lua +2 -2
  52. package/dist/node_modules/bullmq/dist/cjs/commands/includes/cleanList.lua +4 -2
  53. package/dist/node_modules/bullmq/dist/cjs/commands/includes/cleanSet.lua +3 -11
  54. package/dist/node_modules/bullmq/dist/cjs/commands/includes/collectMetrics.lua +1 -1
  55. package/dist/node_modules/bullmq/dist/cjs/commands/includes/deduplicateJob.lua +63 -18
  56. package/dist/node_modules/bullmq/dist/cjs/commands/includes/filterOutJobsToIgnore.lua +14 -0
  57. package/dist/node_modules/bullmq/dist/cjs/commands/includes/getNextDelayedTimestamp.lua +1 -1
  58. package/dist/node_modules/bullmq/dist/cjs/commands/includes/getOrSetMaxEvents.lua +6 -6
  59. package/dist/node_modules/bullmq/dist/cjs/commands/includes/getPriorityScore.lua +8 -0
  60. package/dist/node_modules/bullmq/dist/cjs/commands/includes/isJobSchedulerJob.lua +15 -0
  61. package/dist/node_modules/bullmq/dist/cjs/commands/includes/isLocked.lua +1 -0
  62. package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveChildFromDependenciesIfNeeded.lua +77 -0
  63. package/dist/node_modules/bullmq/dist/cjs/commands/includes/{moveJobFromPriorityToActive.lua → moveJobFromPrioritizedToActive.lua} +1 -1
  64. package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveParentToWait.lua +45 -0
  65. package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveParentToWaitIfNeeded.lua +9 -50
  66. package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveParentToWaitIfNoPendingDependencies.lua +13 -0
  67. package/dist/node_modules/bullmq/dist/cjs/commands/includes/prepareJobForProcessing.lua +2 -1
  68. package/dist/node_modules/bullmq/dist/cjs/commands/includes/promoteDelayedJobs.lua +7 -3
  69. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeDeduplicationKeyIfNeededOnFinalization.lua +23 -0
  70. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeDeduplicationKeyIfNeededOnRemoval.lua +16 -0
  71. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeJob.lua +2 -2
  72. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeJobKeys.lua +2 -2
  73. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeJobWithChildren.lua +95 -0
  74. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeListJobs.lua +7 -1
  75. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeParentDependencyKey.lua +5 -5
  76. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeZSetJobs.lua +2 -8
  77. package/dist/node_modules/bullmq/dist/cjs/commands/includes/storeJob.lua +2 -2
  78. package/dist/node_modules/bullmq/dist/cjs/commands/includes/storeJobScheduler.lua +52 -0
  79. package/dist/node_modules/bullmq/dist/cjs/commands/includes/trimEvents.lua +1 -1
  80. package/dist/node_modules/bullmq/dist/cjs/commands/includes/updateExistingJobsParent.lua +1 -1
  81. package/dist/node_modules/bullmq/dist/cjs/commands/includes/updateJobFields.lua +5 -5
  82. package/dist/node_modules/bullmq/dist/cjs/commands/includes/updateParentDepsIfNeeded.lua +2 -2
  83. package/dist/node_modules/bullmq/dist/cjs/commands/isFinished-3.lua +2 -2
  84. package/dist/node_modules/bullmq/dist/cjs/commands/moveJobFromActiveToWait-9.lua +63 -0
  85. package/dist/node_modules/bullmq/dist/cjs/commands/moveStalledJobsToWait-8.lua +109 -0
  86. package/dist/node_modules/bullmq/dist/cjs/commands/moveToActive-11.lua +3 -2
  87. package/dist/node_modules/bullmq/dist/cjs/commands/moveToFinished-14.lua +52 -52
  88. package/dist/node_modules/bullmq/dist/cjs/commands/moveToWaitingChildren-8.lua +106 -0
  89. package/dist/node_modules/bullmq/dist/cjs/commands/removeJob-2.lua +18 -66
  90. package/dist/node_modules/bullmq/dist/cjs/commands/removeJobScheduler-3.lua +1 -1
  91. package/dist/node_modules/bullmq/dist/cjs/commands/removeUnprocessedChildren-2.lua +31 -0
  92. package/dist/node_modules/bullmq/dist/cjs/commands/retryJob-11.lua +11 -5
  93. package/dist/node_modules/bullmq/dist/cjs/commands/updateJobScheduler-12.lua +90 -0
  94. package/dist/node_modules/bullmq/dist/cjs/commands/updateRepeatableJobMillis-1.lua +1 -1
  95. package/dist/node_modules/bullmq/dist/cjs/enums/child-command.js +2 -0
  96. package/dist/node_modules/bullmq/dist/cjs/enums/error-code.js +2 -1
  97. package/dist/node_modules/bullmq/dist/cjs/enums/parent-command.js +5 -2
  98. package/dist/node_modules/bullmq/dist/cjs/index.js +1 -1
  99. package/dist/node_modules/bullmq/dist/cjs/interfaces/index.js +2 -1
  100. package/dist/node_modules/bullmq/dist/cjs/interfaces/{debounce-options.js → parent-options.js} +1 -1
  101. package/dist/node_modules/bullmq/dist/cjs/interfaces/receiver.js +3 -0
  102. package/dist/node_modules/bullmq/dist/cjs/scripts/addDelayedJob-6.js +163 -84
  103. package/dist/node_modules/bullmq/dist/cjs/scripts/addJobScheduler-11.js +465 -0
  104. package/dist/node_modules/bullmq/dist/cjs/scripts/{addParentJob-4.js → addParentJob-5.js} +147 -75
  105. package/dist/node_modules/bullmq/dist/cjs/scripts/{addPrioritizedJob-8.js → addPrioritizedJob-9.js} +151 -79
  106. package/dist/node_modules/bullmq/dist/cjs/scripts/addRepeatableJob-2.js +18 -13
  107. package/dist/node_modules/bullmq/dist/cjs/scripts/{addStandardJob-8.js → addStandardJob-9.js} +149 -77
  108. package/dist/node_modules/bullmq/dist/cjs/scripts/changeDelay-4.js +7 -7
  109. package/dist/node_modules/bullmq/dist/cjs/scripts/changePriority-7.js +8 -2
  110. package/dist/node_modules/bullmq/dist/cjs/scripts/cleanJobsInSet-3.js +45 -29
  111. package/dist/node_modules/bullmq/dist/cjs/scripts/drain-5.js +49 -35
  112. package/dist/node_modules/bullmq/dist/cjs/scripts/getDependencyCounts-4.js +37 -0
  113. package/dist/node_modules/bullmq/dist/cjs/scripts/getState-8.js +5 -5
  114. package/dist/node_modules/bullmq/dist/cjs/scripts/getStateV2-8.js +8 -8
  115. package/dist/node_modules/bullmq/dist/cjs/scripts/index.js +10 -7
  116. package/dist/node_modules/bullmq/dist/cjs/scripts/isFinished-3.js +2 -2
  117. package/dist/node_modules/bullmq/dist/cjs/scripts/{moveJobFromActiveToWait-10.js → moveJobFromActiveToWait-9.js} +57 -37
  118. package/dist/node_modules/bullmq/dist/cjs/scripts/moveJobsToWait-8.js +6 -6
  119. package/dist/node_modules/bullmq/dist/cjs/scripts/moveStalledJobsToWait-8.js +171 -0
  120. package/dist/node_modules/bullmq/dist/cjs/scripts/moveToActive-11.js +18 -8
  121. package/dist/node_modules/bullmq/dist/cjs/scripts/moveToDelayed-8.js +12 -12
  122. package/dist/node_modules/bullmq/dist/cjs/scripts/moveToFinished-14.js +218 -155
  123. package/dist/node_modules/bullmq/dist/cjs/scripts/moveToWaitingChildren-8.js +529 -0
  124. package/dist/node_modules/bullmq/dist/cjs/scripts/obliterate-2.js +33 -20
  125. package/dist/node_modules/bullmq/dist/cjs/scripts/pause-7.js +1 -1
  126. package/dist/node_modules/bullmq/dist/cjs/scripts/promote-9.js +8 -2
  127. package/dist/node_modules/bullmq/dist/cjs/scripts/removeChildDependency-1.js +7 -7
  128. package/dist/node_modules/bullmq/dist/cjs/scripts/removeJob-2.js +120 -63
  129. package/dist/node_modules/bullmq/dist/cjs/scripts/removeJobScheduler-3.js +3 -3
  130. package/dist/node_modules/bullmq/dist/cjs/scripts/removeRepeatable-3.js +2 -2
  131. package/dist/node_modules/bullmq/dist/cjs/scripts/removeUnprocessedChildren-2.js +339 -0
  132. package/dist/node_modules/bullmq/dist/cjs/scripts/reprocessJob-8.js +6 -6
  133. package/dist/node_modules/bullmq/dist/cjs/scripts/retryJob-11.js +47 -26
  134. package/dist/node_modules/bullmq/dist/cjs/scripts/updateJobScheduler-12.js +274 -0
  135. package/dist/node_modules/bullmq/dist/cjs/scripts/updateProgress-3.js +6 -6
  136. package/dist/node_modules/bullmq/dist/cjs/scripts/updateRepeatableJobMillis-1.js +1 -1
  137. package/dist/node_modules/bullmq/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  138. package/dist/node_modules/bullmq/dist/cjs/types/deduplication-options.js +3 -0
  139. package/dist/node_modules/bullmq/dist/cjs/types/index.js +3 -0
  140. package/dist/node_modules/bullmq/dist/cjs/types/job-progress.js +3 -0
  141. package/dist/node_modules/bullmq/dist/cjs/types/script-queue-context.js +3 -0
  142. package/dist/node_modules/bullmq/dist/cjs/utils.js +29 -1
  143. package/dist/node_modules/bullmq/dist/cjs/version.js +1 -1
  144. package/dist/node_modules/bullmq/dist/esm/classes/backoffs.d.ts +1 -1
  145. package/dist/node_modules/bullmq/dist/esm/classes/backoffs.js +18 -5
  146. package/dist/node_modules/bullmq/dist/esm/classes/child-pool.d.ts +1 -1
  147. package/dist/node_modules/bullmq/dist/esm/classes/child-pool.js +7 -2
  148. package/dist/node_modules/bullmq/dist/esm/classes/child-processor.d.ts +3 -2
  149. package/dist/node_modules/bullmq/dist/esm/classes/child-processor.js +59 -5
  150. package/dist/node_modules/bullmq/dist/esm/classes/child.js +3 -1
  151. package/dist/node_modules/bullmq/dist/esm/classes/errors/index.d.ts +2 -1
  152. package/dist/node_modules/bullmq/dist/esm/classes/errors/index.js +2 -1
  153. package/dist/node_modules/bullmq/dist/esm/classes/errors/waiting-error.d.ts +10 -0
  154. package/dist/node_modules/bullmq/dist/esm/classes/errors/waiting-error.js +15 -0
  155. package/dist/node_modules/bullmq/dist/esm/classes/flow-producer.d.ts +3 -9
  156. package/dist/node_modules/bullmq/dist/esm/classes/flow-producer.js +21 -5
  157. package/dist/node_modules/bullmq/dist/esm/classes/index.d.ts +1 -0
  158. package/dist/node_modules/bullmq/dist/esm/classes/index.js +1 -0
  159. package/dist/node_modules/bullmq/dist/esm/classes/job-scheduler.d.ts +2 -2
  160. package/dist/node_modules/bullmq/dist/esm/classes/job-scheduler.js +88 -62
  161. package/dist/node_modules/bullmq/dist/esm/classes/job.d.ts +69 -19
  162. package/dist/node_modules/bullmq/dist/esm/classes/job.js +217 -110
  163. package/dist/node_modules/bullmq/dist/esm/classes/main-base.d.ts +2 -3
  164. package/dist/node_modules/bullmq/dist/esm/classes/main-base.js +1 -1
  165. package/dist/node_modules/bullmq/dist/esm/classes/queue-base.d.ts +2 -5
  166. package/dist/node_modules/bullmq/dist/esm/classes/queue-base.js +11 -10
  167. package/dist/node_modules/bullmq/dist/esm/classes/queue-events-producer.d.ts +2 -2
  168. package/dist/node_modules/bullmq/dist/esm/classes/queue-events.d.ts +118 -29
  169. package/dist/node_modules/bullmq/dist/esm/classes/queue-getters.d.ts +20 -13
  170. package/dist/node_modules/bullmq/dist/esm/classes/queue-getters.js +34 -14
  171. package/dist/node_modules/bullmq/dist/esm/classes/queue.d.ts +19 -16
  172. package/dist/node_modules/bullmq/dist/esm/classes/queue.js +19 -13
  173. package/dist/node_modules/bullmq/dist/esm/classes/redis-connection.d.ts +7 -3
  174. package/dist/node_modules/bullmq/dist/esm/classes/redis-connection.js +16 -9
  175. package/dist/node_modules/bullmq/dist/esm/classes/repeat.js +1 -1
  176. package/dist/node_modules/bullmq/dist/esm/classes/sandbox.js +54 -28
  177. package/dist/node_modules/bullmq/dist/esm/classes/scripts.d.ts +20 -13
  178. package/dist/node_modules/bullmq/dist/esm/classes/scripts.js +141 -39
  179. package/dist/node_modules/bullmq/dist/esm/classes/worker.d.ts +28 -7
  180. package/dist/node_modules/bullmq/dist/esm/classes/worker.js +192 -183
  181. package/dist/node_modules/bullmq/dist/esm/commands/addDelayedJob-6.lua +6 -17
  182. package/dist/node_modules/bullmq/dist/esm/commands/addJobScheduler-11.lua +123 -0
  183. package/dist/node_modules/bullmq/dist/{cjs/commands/addParentJob-4.lua → esm/commands/addParentJob-5.lua} +7 -6
  184. package/dist/node_modules/bullmq/dist/esm/commands/{addPrioritizedJob-8.lua → addPrioritizedJob-9.lua} +11 -10
  185. package/dist/node_modules/bullmq/dist/esm/commands/addRepeatableJob-2.lua +2 -2
  186. package/dist/node_modules/bullmq/dist/{cjs/commands/addStandardJob-8.lua → esm/commands/addStandardJob-9.lua} +9 -8
  187. package/dist/node_modules/bullmq/dist/esm/commands/cleanJobsInSet-3.lua +9 -5
  188. package/dist/node_modules/bullmq/dist/esm/commands/drain-5.lua +16 -16
  189. package/dist/node_modules/bullmq/dist/esm/commands/getDependencyCounts-4.lua +31 -0
  190. package/dist/node_modules/bullmq/dist/esm/commands/getState-8.lua +5 -5
  191. package/dist/node_modules/bullmq/dist/esm/commands/getStateV2-8.lua +8 -8
  192. package/dist/node_modules/bullmq/dist/esm/commands/includes/addDelayedJob.lua +23 -0
  193. package/dist/node_modules/bullmq/dist/esm/commands/includes/addJobFromScheduler.lua +37 -0
  194. package/dist/node_modules/bullmq/dist/esm/commands/includes/addJobWithPriority.lua +2 -2
  195. package/dist/node_modules/bullmq/dist/esm/commands/includes/cleanList.lua +4 -2
  196. package/dist/node_modules/bullmq/dist/esm/commands/includes/cleanSet.lua +3 -11
  197. package/dist/node_modules/bullmq/dist/esm/commands/includes/collectMetrics.lua +1 -1
  198. package/dist/node_modules/bullmq/dist/esm/commands/includes/deduplicateJob.lua +63 -18
  199. package/dist/node_modules/bullmq/dist/esm/commands/includes/filterOutJobsToIgnore.lua +14 -0
  200. package/dist/node_modules/bullmq/dist/esm/commands/includes/getNextDelayedTimestamp.lua +1 -1
  201. package/dist/node_modules/bullmq/dist/esm/commands/includes/getOrSetMaxEvents.lua +6 -6
  202. package/dist/node_modules/bullmq/dist/esm/commands/includes/getPriorityScore.lua +8 -0
  203. package/dist/node_modules/bullmq/dist/esm/commands/includes/isJobSchedulerJob.lua +15 -0
  204. package/dist/node_modules/bullmq/dist/esm/commands/includes/isLocked.lua +1 -0
  205. package/dist/node_modules/bullmq/dist/esm/commands/includes/moveChildFromDependenciesIfNeeded.lua +77 -0
  206. package/dist/node_modules/bullmq/dist/esm/commands/includes/{moveJobFromPriorityToActive.lua → moveJobFromPrioritizedToActive.lua} +1 -1
  207. package/dist/node_modules/bullmq/dist/esm/commands/includes/moveParentToWait.lua +45 -0
  208. package/dist/node_modules/bullmq/dist/esm/commands/includes/moveParentToWaitIfNeeded.lua +9 -50
  209. package/dist/node_modules/bullmq/dist/esm/commands/includes/moveParentToWaitIfNoPendingDependencies.lua +13 -0
  210. package/dist/node_modules/bullmq/dist/esm/commands/includes/prepareJobForProcessing.lua +2 -1
  211. package/dist/node_modules/bullmq/dist/esm/commands/includes/promoteDelayedJobs.lua +7 -3
  212. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeDeduplicationKeyIfNeededOnFinalization.lua +23 -0
  213. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeDeduplicationKeyIfNeededOnRemoval.lua +16 -0
  214. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeJob.lua +2 -2
  215. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeJobKeys.lua +2 -2
  216. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeJobWithChildren.lua +95 -0
  217. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeListJobs.lua +7 -1
  218. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeParentDependencyKey.lua +5 -5
  219. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeZSetJobs.lua +2 -8
  220. package/dist/node_modules/bullmq/dist/esm/commands/includes/storeJob.lua +2 -2
  221. package/dist/node_modules/bullmq/dist/esm/commands/includes/storeJobScheduler.lua +52 -0
  222. package/dist/node_modules/bullmq/dist/esm/commands/includes/trimEvents.lua +1 -1
  223. package/dist/node_modules/bullmq/dist/esm/commands/includes/updateExistingJobsParent.lua +1 -1
  224. package/dist/node_modules/bullmq/dist/esm/commands/includes/updateJobFields.lua +5 -5
  225. package/dist/node_modules/bullmq/dist/esm/commands/includes/updateParentDepsIfNeeded.lua +2 -2
  226. package/dist/node_modules/bullmq/dist/esm/commands/isFinished-3.lua +2 -2
  227. package/dist/node_modules/bullmq/dist/esm/commands/moveJobFromActiveToWait-9.lua +63 -0
  228. package/dist/node_modules/bullmq/dist/esm/commands/moveStalledJobsToWait-8.lua +109 -0
  229. package/dist/node_modules/bullmq/dist/esm/commands/moveToActive-11.lua +3 -2
  230. package/dist/node_modules/bullmq/dist/esm/commands/moveToFinished-14.lua +52 -52
  231. package/dist/node_modules/bullmq/dist/esm/commands/moveToWaitingChildren-8.lua +106 -0
  232. package/dist/node_modules/bullmq/dist/esm/commands/removeJob-2.lua +18 -66
  233. package/dist/node_modules/bullmq/dist/esm/commands/removeJobScheduler-3.lua +1 -1
  234. package/dist/node_modules/bullmq/dist/esm/commands/removeUnprocessedChildren-2.lua +31 -0
  235. package/dist/node_modules/bullmq/dist/esm/commands/retryJob-11.lua +11 -5
  236. package/dist/node_modules/bullmq/dist/esm/commands/updateJobScheduler-12.lua +90 -0
  237. package/dist/node_modules/bullmq/dist/esm/commands/updateRepeatableJobMillis-1.lua +1 -1
  238. package/dist/node_modules/bullmq/dist/esm/enums/child-command.d.ts +3 -1
  239. package/dist/node_modules/bullmq/dist/esm/enums/child-command.js +2 -0
  240. package/dist/node_modules/bullmq/dist/esm/enums/error-code.d.ts +3 -2
  241. package/dist/node_modules/bullmq/dist/esm/enums/error-code.js +2 -1
  242. package/dist/node_modules/bullmq/dist/esm/enums/parent-command.d.ts +5 -2
  243. package/dist/node_modules/bullmq/dist/esm/enums/parent-command.js +5 -2
  244. package/dist/node_modules/bullmq/dist/esm/interfaces/backoff-options.d.ts +5 -0
  245. package/dist/node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts +3 -9
  246. package/dist/node_modules/bullmq/dist/esm/interfaces/child-message.d.ts +1 -0
  247. package/dist/node_modules/bullmq/dist/esm/interfaces/index.d.ts +2 -1
  248. package/dist/node_modules/bullmq/dist/esm/interfaces/index.js +2 -1
  249. package/dist/node_modules/bullmq/dist/esm/interfaces/job-json.d.ts +6 -2
  250. package/dist/node_modules/bullmq/dist/esm/interfaces/job-scheduler-json.d.ts +7 -4
  251. package/dist/node_modules/bullmq/dist/esm/interfaces/minimal-job.d.ts +34 -15
  252. package/dist/node_modules/bullmq/dist/esm/interfaces/parent-options.d.ts +11 -0
  253. package/dist/node_modules/bullmq/dist/esm/interfaces/parent-options.js +2 -0
  254. package/dist/node_modules/bullmq/dist/esm/interfaces/parent.d.ts +6 -2
  255. package/dist/node_modules/bullmq/dist/esm/interfaces/queue-options.d.ts +15 -6
  256. package/dist/node_modules/bullmq/dist/esm/interfaces/receiver.d.ts +4 -0
  257. package/dist/node_modules/bullmq/dist/esm/interfaces/receiver.js +2 -0
  258. package/dist/node_modules/bullmq/dist/esm/interfaces/repeat-options.d.ts +1 -2
  259. package/dist/node_modules/bullmq/dist/esm/interfaces/repeatable-options.d.ts +2 -0
  260. package/dist/node_modules/bullmq/dist/esm/interfaces/sandboxed-job.d.ts +3 -2
  261. package/dist/node_modules/bullmq/dist/esm/interfaces/sandboxed-options.d.ts +1 -1
  262. package/dist/node_modules/bullmq/dist/esm/interfaces/telemetry.d.ts +18 -15
  263. package/dist/node_modules/bullmq/dist/esm/interfaces/worker-options.d.ts +10 -10
  264. package/dist/node_modules/bullmq/dist/esm/scripts/addDelayedJob-6.js +163 -84
  265. package/dist/node_modules/bullmq/dist/esm/scripts/addJobScheduler-11.js +462 -0
  266. package/dist/node_modules/bullmq/dist/esm/scripts/{addParentJob-4.js → addParentJob-5.js} +147 -75
  267. package/dist/node_modules/bullmq/dist/esm/scripts/{addPrioritizedJob-8.js → addPrioritizedJob-9.js} +151 -79
  268. package/dist/node_modules/bullmq/dist/esm/scripts/addRepeatableJob-2.js +18 -13
  269. package/dist/node_modules/bullmq/dist/esm/scripts/{addStandardJob-8.js → addStandardJob-9.js} +149 -77
  270. package/dist/node_modules/bullmq/dist/esm/scripts/changeDelay-4.js +7 -7
  271. package/dist/node_modules/bullmq/dist/esm/scripts/changePriority-7.js +8 -2
  272. package/dist/node_modules/bullmq/dist/esm/scripts/cleanJobsInSet-3.js +45 -29
  273. package/dist/node_modules/bullmq/dist/esm/scripts/drain-5.js +49 -35
  274. package/dist/node_modules/bullmq/dist/esm/scripts/getDependencyCounts-4.d.ts +5 -0
  275. package/dist/node_modules/bullmq/dist/esm/scripts/getDependencyCounts-4.js +34 -0
  276. package/dist/node_modules/bullmq/dist/esm/scripts/getState-8.js +5 -5
  277. package/dist/node_modules/bullmq/dist/esm/scripts/getStateV2-8.js +8 -8
  278. package/dist/node_modules/bullmq/dist/esm/scripts/index.d.ts +10 -7
  279. package/dist/node_modules/bullmq/dist/esm/scripts/index.js +10 -7
  280. package/dist/node_modules/bullmq/dist/esm/scripts/isFinished-3.js +2 -2
  281. package/dist/node_modules/bullmq/dist/esm/scripts/{moveJobFromActiveToWait-10.js → moveJobFromActiveToWait-9.js} +57 -37
  282. package/dist/node_modules/bullmq/dist/esm/scripts/moveJobsToWait-8.js +6 -6
  283. package/dist/node_modules/bullmq/dist/esm/scripts/moveStalledJobsToWait-8.js +168 -0
  284. package/dist/node_modules/bullmq/dist/esm/scripts/moveToActive-11.js +18 -8
  285. package/dist/node_modules/bullmq/dist/esm/scripts/moveToDelayed-8.js +12 -12
  286. package/dist/node_modules/bullmq/dist/esm/scripts/moveToFinished-14.js +218 -155
  287. package/dist/node_modules/bullmq/dist/esm/scripts/moveToWaitingChildren-8.js +526 -0
  288. package/dist/node_modules/bullmq/dist/esm/scripts/obliterate-2.js +33 -20
  289. package/dist/node_modules/bullmq/dist/esm/scripts/pause-7.js +1 -1
  290. package/dist/node_modules/bullmq/dist/esm/scripts/promote-9.js +8 -2
  291. package/dist/node_modules/bullmq/dist/esm/scripts/removeChildDependency-1.js +7 -7
  292. package/dist/node_modules/bullmq/dist/esm/scripts/removeJob-2.js +120 -63
  293. package/dist/node_modules/bullmq/dist/esm/scripts/removeJobScheduler-3.js +3 -3
  294. package/dist/node_modules/bullmq/dist/esm/scripts/removeRepeatable-3.js +2 -2
  295. package/dist/node_modules/bullmq/dist/esm/scripts/removeUnprocessedChildren-2.d.ts +5 -0
  296. package/dist/node_modules/bullmq/dist/esm/scripts/removeUnprocessedChildren-2.js +336 -0
  297. package/dist/node_modules/bullmq/dist/esm/scripts/reprocessJob-8.js +6 -6
  298. package/dist/node_modules/bullmq/dist/esm/scripts/retryJob-11.js +47 -26
  299. package/dist/node_modules/bullmq/dist/esm/scripts/updateJobScheduler-12.d.ts +5 -0
  300. package/dist/node_modules/bullmq/dist/esm/scripts/updateJobScheduler-12.js +271 -0
  301. package/dist/node_modules/bullmq/dist/esm/scripts/updateProgress-3.js +6 -6
  302. package/dist/node_modules/bullmq/dist/esm/scripts/updateRepeatableJobMillis-1.js +1 -1
  303. package/dist/node_modules/bullmq/dist/esm/tsconfig.tsbuildinfo +1 -1
  304. package/dist/node_modules/bullmq/dist/esm/types/deduplication-options.d.ts +22 -0
  305. package/dist/node_modules/bullmq/dist/esm/types/deduplication-options.js +2 -0
  306. package/dist/node_modules/bullmq/dist/esm/types/index.d.ts +3 -0
  307. package/dist/node_modules/bullmq/dist/esm/types/index.js +3 -0
  308. package/dist/node_modules/bullmq/dist/esm/types/job-options.d.ts +19 -8
  309. package/dist/node_modules/bullmq/dist/esm/types/job-progress.d.ts +1 -0
  310. package/dist/node_modules/bullmq/dist/esm/types/job-progress.js +2 -0
  311. package/dist/node_modules/bullmq/dist/esm/types/script-queue-context.d.ts +2 -0
  312. package/dist/node_modules/bullmq/dist/esm/types/script-queue-context.js +2 -0
  313. package/dist/node_modules/bullmq/dist/esm/utils.d.ts +25 -5
  314. package/dist/node_modules/bullmq/dist/esm/utils.js +27 -0
  315. package/dist/node_modules/bullmq/dist/esm/version.d.ts +1 -1
  316. package/dist/node_modules/bullmq/dist/esm/version.js +1 -1
  317. package/dist/node_modules/bullmq/package.json +1 -1
  318. package/package.json +7 -7
  319. package/dist/node_modules/bullmq/dist/cjs/commands/addJobScheduler-2.lua +0 -91
  320. package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveParentFromWaitingChildrenToFailed.lua +0 -53
  321. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeDeduplicationKey.lua +0 -11
  322. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeDeduplicationKeyIfNeeded.lua +0 -14
  323. package/dist/node_modules/bullmq/dist/cjs/commands/moveJobFromActiveToWait-10.lua +0 -60
  324. package/dist/node_modules/bullmq/dist/cjs/commands/moveStalledJobsToWait-9.lua +0 -156
  325. package/dist/node_modules/bullmq/dist/cjs/commands/moveToWaitingChildren-5.lua +0 -68
  326. package/dist/node_modules/bullmq/dist/cjs/scripts/addJobScheduler-2.js +0 -237
  327. package/dist/node_modules/bullmq/dist/cjs/scripts/moveStalledJobsToWait-9.js +0 -529
  328. package/dist/node_modules/bullmq/dist/cjs/scripts/moveToWaitingChildren-5.js +0 -83
  329. package/dist/node_modules/bullmq/dist/esm/commands/addJobScheduler-2.lua +0 -91
  330. package/dist/node_modules/bullmq/dist/esm/commands/includes/moveParentFromWaitingChildrenToFailed.lua +0 -53
  331. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeDeduplicationKey.lua +0 -11
  332. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeDeduplicationKeyIfNeeded.lua +0 -14
  333. package/dist/node_modules/bullmq/dist/esm/commands/moveJobFromActiveToWait-10.lua +0 -60
  334. package/dist/node_modules/bullmq/dist/esm/commands/moveStalledJobsToWait-9.lua +0 -156
  335. package/dist/node_modules/bullmq/dist/esm/commands/moveToWaitingChildren-5.lua +0 -68
  336. package/dist/node_modules/bullmq/dist/esm/interfaces/debounce-options.d.ts +0 -13
  337. package/dist/node_modules/bullmq/dist/esm/interfaces/debounce-options.js +0 -2
  338. package/dist/node_modules/bullmq/dist/esm/scripts/addJobScheduler-2.js +0 -234
  339. package/dist/node_modules/bullmq/dist/esm/scripts/moveStalledJobsToWait-9.js +0 -526
  340. package/dist/node_modules/bullmq/dist/esm/scripts/moveToWaitingChildren-5.js +0 -80
  341. /package/dist/node_modules/bullmq/dist/esm/scripts/{addJobScheduler-2.d.ts → addJobScheduler-11.d.ts} +0 -0
  342. /package/dist/node_modules/bullmq/dist/esm/scripts/{addParentJob-4.d.ts → addParentJob-5.d.ts} +0 -0
  343. /package/dist/node_modules/bullmq/dist/esm/scripts/{addPrioritizedJob-8.d.ts → addPrioritizedJob-9.d.ts} +0 -0
  344. /package/dist/node_modules/bullmq/dist/esm/scripts/{addStandardJob-8.d.ts → addStandardJob-9.d.ts} +0 -0
  345. /package/dist/node_modules/bullmq/dist/esm/scripts/{moveJobFromActiveToWait-10.d.ts → moveJobFromActiveToWait-9.d.ts} +0 -0
  346. /package/dist/node_modules/bullmq/dist/esm/scripts/{moveStalledJobsToWait-9.d.ts → moveStalledJobsToWait-8.d.ts} +0 -0
  347. /package/dist/node_modules/bullmq/dist/esm/scripts/{moveToWaitingChildren-5.d.ts → moveToWaitingChildren-8.d.ts} +0 -0
@@ -1,3 +1,4 @@
1
+ import { JobProgress } from '../types';
1
2
  import { IoredisListener, QueueEventsOptions } from '../interfaces';
2
3
  import { QueueBase } from './queue-base';
3
4
  import { RedisConnection } from './redis-connection';
@@ -5,7 +6,13 @@ export interface QueueEventsListener extends IoredisListener {
5
6
  /**
6
7
  * Listen to 'active' event.
7
8
  *
8
- * This event is triggered when a job enters the 'active' state.
9
+ * This event is triggered when a job enters the 'active' state, meaning it is being processed.
10
+ *
11
+ * @param args - An object containing details about the job that became active.
12
+ * - `jobId`: The unique identifier of the job that entered the active state.
13
+ * - `prev`: The previous state of the job before it became active (e.g., 'waiting'), if applicable.
14
+ *
15
+ * @param id - The identifier of the event.
9
16
  */
10
17
  active: (args: {
11
18
  jobId: string;
@@ -14,7 +21,12 @@ export interface QueueEventsListener extends IoredisListener {
14
21
  /**
15
22
  * Listen to 'added' event.
16
23
  *
17
- * This event is triggered when a job is created.
24
+ * This event is triggered when a job is created and added to the queue.
25
+ *
26
+ * @param args - An object containing details about the newly added job.
27
+ * - `jobId` - The unique identifier of the job that was added.
28
+ * - `name` - The name of the job, typically indicating its type or purpose.
29
+ * @param id - The identifier of the event.
18
30
  */
19
31
  added: (args: {
20
32
  jobId: string;
@@ -23,7 +35,11 @@ export interface QueueEventsListener extends IoredisListener {
23
35
  /**
24
36
  * Listen to 'cleaned' event.
25
37
  *
26
- * This event is triggered when a cleaned method is triggered.
38
+ * This event is triggered when jobs are cleaned (e.g., removed) from the queue, typically via a cleanup method.
39
+ *
40
+ * @param args - An object containing the count of cleaned jobs.
41
+ * - `count` - The number of jobs that were cleaned, represented as a string due to Redis serialization.
42
+ * @param id - The identifier of the event.
27
43
  */
28
44
  cleaned: (args: {
29
45
  count: string;
@@ -31,7 +47,13 @@ export interface QueueEventsListener extends IoredisListener {
31
47
  /**
32
48
  * Listen to 'completed' event.
33
49
  *
34
- * This event is triggered when a job has successfully completed.
50
+ * This event is triggered when a job has successfully completed its execution.
51
+ *
52
+ * @param args - An object containing details about the completed job.
53
+ * - `jobId` - The unique identifier of the job that completed.
54
+ * - `returnvalue` - The return value of the job, serialized as a string.
55
+ * - `prev` - The previous state of the job before completion (e.g., 'active'), if applicable.
56
+ * @param id - The identifier of the event.
35
57
  */
36
58
  completed: (args: {
37
59
  jobId: string;
@@ -40,9 +62,15 @@ export interface QueueEventsListener extends IoredisListener {
40
62
  }, id: string) => void;
41
63
  /**
42
64
  * Listen to 'debounced' event.
43
- * @deprecated use deduplicated event
44
65
  *
45
- * This event is triggered when a job is debounced because debounceId still existed.
66
+ * @deprecated Use the 'deduplicated' event instead.
67
+ *
68
+ * This event is triggered when a job is debounced because a job with the same debounceId still exists.
69
+ *
70
+ * @param args - An object containing details about the debounced job.
71
+ * - `jobId` - The unique identifier of the job that was debounced.
72
+ * - `debounceId` - The identifier used to debounce the job, preventing duplicate processing.
73
+ * @param id - The identifier of the event.
46
74
  */
47
75
  debounced: (args: {
48
76
  jobId: string;
@@ -51,16 +79,29 @@ export interface QueueEventsListener extends IoredisListener {
51
79
  /**
52
80
  * Listen to 'deduplicated' event.
53
81
  *
54
- * This event is triggered when a job is deduplicated because deduplicatedId still existed.
82
+ * This event is triggered when a job is not added to the queue because a job with the same deduplicationId
83
+ * already exists.
84
+ *
85
+ * @param args - An object containing details about the deduplicated job.
86
+ * - `jobId` - The unique identifier of the job that was attempted to be added.
87
+ * - `deduplicationId` - The deduplication identifier that caused the job to be deduplicated.
88
+ * - `deduplicatedJobId` - The unique identifier of the existing job that caused the deduplication.
89
+ * @param id - The identifier of the event.
55
90
  */
56
91
  deduplicated: (args: {
57
92
  jobId: string;
58
93
  deduplicationId: string;
94
+ deduplicatedJobId: string;
59
95
  }, id: string) => void;
60
96
  /**
61
97
  * Listen to 'delayed' event.
62
98
  *
63
- * This event is triggered when a job is delayed.
99
+ * This event is triggered when a job is scheduled with a delay before it becomes active.
100
+ *
101
+ * @param args - An object containing details about the delayed job.
102
+ * - `jobId` - The unique identifier of the job that was delayed.
103
+ * - `delay` - The delay duration in milliseconds before the job becomes active.
104
+ * @param id - The identifier of the event.
64
105
  */
65
106
  delayed: (args: {
66
107
  jobId: string;
@@ -69,15 +110,22 @@ export interface QueueEventsListener extends IoredisListener {
69
110
  /**
70
111
  * Listen to 'drained' event.
71
112
  *
72
- * This event is triggered when the queue has drained the waiting list.
113
+ * This event is triggered when the queue has drained its waiting list, meaning there are no jobs
114
+ * in the 'waiting' state.
73
115
  * Note that there could still be delayed jobs waiting their timers to expire
74
116
  * and this event will still be triggered as long as the waiting list has emptied.
117
+ *
118
+ * @param id - The identifier of the event.
75
119
  */
76
120
  drained: (id: string) => void;
77
121
  /**
78
122
  * Listen to 'duplicated' event.
79
123
  *
80
- * This event is triggered when a job is not created because it already exist.
124
+ * This event is triggered when a job is not created because a job with the same identifier already exists.
125
+ *
126
+ * @param args - An object containing the job identifier.
127
+ * - `jobId` - The unique identifier of the job that was attempted to be added.
128
+ * @param id - The identifier of the event.
81
129
  */
82
130
  duplicated: (args: {
83
131
  jobId: string;
@@ -85,13 +133,19 @@ export interface QueueEventsListener extends IoredisListener {
85
133
  /**
86
134
  * Listen to 'error' event.
87
135
  *
88
- * This event is triggered when an exception is thrown.
136
+ * This event is triggered when an error in the Redis backend is thrown.
89
137
  */
90
138
  error: (args: Error) => void;
91
139
  /**
92
140
  * Listen to 'failed' event.
93
141
  *
94
- * This event is triggered when a job has thrown an exception.
142
+ * This event is triggered when a job fails by throwing an exception during execution.
143
+ *
144
+ * @param args - An object containing details about the failed job.
145
+ * - `jobId` - The unique identifier of the job that failed.
146
+ * - `failedReason` - The reason or message describing why the job failed.
147
+ * - `prev` - The previous state of the job before failure (e.g., 'active'), if applicable.
148
+ * @param id - The identifier of the event.
95
149
  */
96
150
  failed: (args: {
97
151
  jobId: string;
@@ -101,26 +155,36 @@ export interface QueueEventsListener extends IoredisListener {
101
155
  /**
102
156
  * Listen to 'paused' event.
103
157
  *
104
- * This event is triggered when a queue is paused.
158
+ * This event is triggered when the queue is paused, halting the processing of new jobs.
159
+ *
160
+ * @param args - An empty object (no additional data provided).
161
+ * @param id - The identifier of the event.
105
162
  */
106
- paused: (args: {}, id: string) => void;
163
+ paused: (args: object, id: string) => void;
107
164
  /**
108
165
  * Listen to 'progress' event.
109
166
  *
110
- * This event is triggered when a job updates it progress, i.e. the
111
- * Job##updateProgress() method is called. This is useful to notify
112
- * progress or any other data from within a processor to the rest of the
113
- * world.
167
+ * This event is triggered when a job updates its progress via the `Job#updateProgress()` method, allowing
168
+ * progress or custom data to be communicated externally.
169
+ *
170
+ * @param args - An object containing the job identifier and progress data.
171
+ * - `jobId` - The unique identifier of the job reporting progress.
172
+ * - `data` - The progress data, which can be a number (e.g., percentage) or an object with custom data.
173
+ * @param id - The identifier of the event.
114
174
  */
115
175
  progress: (args: {
116
176
  jobId: string;
117
- data: number | object;
177
+ data: JobProgress;
118
178
  }, id: string) => void;
119
179
  /**
120
180
  * Listen to 'removed' event.
121
181
  *
122
- * This event is triggered when a job has been manually
123
- * removed from the queue.
182
+ * This event is triggered when a job is manually removed from the queue.
183
+ *
184
+ * @param args - An object containing details about the removed job.
185
+ * - `jobId` - The unique identifier of the job that was removed.
186
+ * - `prev` - The previous state of the job before removal (e.g., 'active' or 'waiting').
187
+ * @param id - The identifier of the event.
124
188
  */
125
189
  removed: (args: {
126
190
  jobId: string;
@@ -129,13 +193,22 @@ export interface QueueEventsListener extends IoredisListener {
129
193
  /**
130
194
  * Listen to 'resumed' event.
131
195
  *
132
- * This event is triggered when a queue is resumed.
196
+ * This event is triggered when the queue is resumed, allowing job processing to continue.
197
+ *
198
+ * @param args - An empty object (no additional data provided).
199
+ * @param id - The identifier of the event.
133
200
  */
134
- resumed: (args: {}, id: string) => void;
201
+ resumed: (args: object, id: string) => void;
135
202
  /**
136
203
  * Listen to 'retries-exhausted' event.
137
204
  *
138
- * This event is triggered when a job has retried the maximum attempts.
205
+ * This event is triggered when a job has exhausted its maximum retry attempts after repeated failures.
206
+ *
207
+ * @param args - An object containing details about the job that exhausted retries.
208
+ * - `jobId` - The unique identifier of the job that exhausted its retries.
209
+ * - `attemptsMade` - The number of retry attempts made, represented as a string
210
+ * (due to Redis serialization).
211
+ * @param id - The identifier of the event.
139
212
  */
140
213
  'retries-exhausted': (args: {
141
214
  jobId: string;
@@ -144,9 +217,13 @@ export interface QueueEventsListener extends IoredisListener {
144
217
  /**
145
218
  * Listen to 'stalled' event.
146
219
  *
147
- * This event is triggered when a job has been moved from 'active' back
148
- * to 'waiting'/'failed' due to the processor not being able to renew
149
- * the lock on the said job.
220
+ * This event is triggered when a job moves from 'active' back to 'waiting' or
221
+ * 'failed' because the processor could not renew its lock, indicating a
222
+ * potential processing issue.
223
+ *
224
+ * @param args - An object containing the job identifier.
225
+ * - `jobId` - The unique identifier of the job that stalled.
226
+ * @param id - The identifier of the event.
150
227
  */
151
228
  stalled: (args: {
152
229
  jobId: string;
@@ -154,7 +231,14 @@ export interface QueueEventsListener extends IoredisListener {
154
231
  /**
155
232
  * Listen to 'waiting' event.
156
233
  *
157
- * This event is triggered when a job enters the 'waiting' state.
234
+ * This event is triggered when a job enters the 'waiting' state, indicating it is queued and
235
+ * awaiting processing.
236
+ *
237
+ * @param args - An object containing details about the job in the waiting state.
238
+ * - `jobId` - The unique identifier of the job that is waiting.
239
+ * - `prev` - The previous state of the job before entering 'waiting' (e.g., 'stalled'),
240
+ * if applicable.
241
+ * @param id - The identifier of the event.
158
242
  */
159
243
  waiting: (args: {
160
244
  jobId: string;
@@ -163,7 +247,12 @@ export interface QueueEventsListener extends IoredisListener {
163
247
  /**
164
248
  * Listen to 'waiting-children' event.
165
249
  *
166
- * This event is triggered when a job enters the 'waiting-children' state.
250
+ * This event is triggered when a job enters the 'waiting-children' state, indicating it is
251
+ * waiting for its child jobs to complete.
252
+ *
253
+ * @param args - An object containing the job identifier.
254
+ * - `jobId` - The unique identifier of the job waiting for its children.
255
+ * @param id - The identifier of the event.
167
256
  */
168
257
  'waiting-children': (args: {
169
258
  jobId: string;
@@ -3,11 +3,7 @@ import { Job } from './job';
3
3
  import { JobState, JobType } from '../types';
4
4
  import { JobJsonRaw, Metrics } from '../interfaces';
5
5
  /**
6
- *
7
- * @class QueueGetters
8
- * @extends QueueBase
9
- *
10
- * @description Provides different getters for different aspects of a queue.
6
+ * Provides different getters for different aspects of a queue.
11
7
  */
12
8
  export declare class QueueGetters<JobBase extends Job = Job> extends QueueBase {
13
9
  getJob(jobId: string): Promise<JobBase | undefined>;
@@ -43,10 +39,10 @@ export declare class QueueGetters<JobBase extends Job = Job> extends QueueBase {
43
39
  /**
44
40
  * Job counts by type
45
41
  *
46
- * Queue#getJobCountByTypes('completed') => completed count
47
- * Queue#getJobCountByTypes('completed,failed') => completed + failed count
48
- * Queue#getJobCountByTypes('completed', 'failed') => completed + failed count
49
- * Queue#getJobCountByTypes('completed', 'waiting', 'failed') => completed + waiting + failed count
42
+ * Queue#getJobCountByTypes('completed') =\> completed count
43
+ * Queue#getJobCountByTypes('completed,failed') =\> completed + failed count
44
+ * Queue#getJobCountByTypes('completed', 'failed') =\> completed + failed count
45
+ * Queue#getJobCountByTypes('completed', 'waiting', 'failed') =\> completed + waiting + failed count
50
46
  */
51
47
  getJobCountByTypes(...types: JobType[]): Promise<number>;
52
48
  /**
@@ -152,11 +148,12 @@ export declare class QueueGetters<JobBase extends Job = Job> extends QueueBase {
152
148
  * A qualified job id is a string representing the job id in a given queue,
153
149
  * for example: "bull:myqueue:jobid".
154
150
  *
155
- * @param parentId The id of the parent job
156
- * @param type "processed" | "pending"
157
- * @param opts
151
+ * @param parentId - The id of the parent job
152
+ * @param type - "processed" | "pending"
153
+ * @param opts - Options for the query.
158
154
  *
159
- * @returns { items: { id: string, v?: any, err?: string } [], jobs: JobJsonRaw[], total: number}
155
+ * @returns an object with the following shape:
156
+ * `{ items: { id: string, v?: any, err?: string } [], jobs: JobJsonRaw[], total: number}`
160
157
  */
161
158
  getDependencies(parentId: string, type: 'processed' | 'pending', start: number, end: number): Promise<{
162
159
  items: {
@@ -232,4 +229,14 @@ export declare class QueueGetters<JobBase extends Job = Job> extends QueueBase {
232
229
  */
233
230
  getMetrics(type: 'completed' | 'failed', start?: number, end?: number): Promise<Metrics>;
234
231
  private parseClientList;
232
+ /**
233
+ * Export the metrics for the queue in the Prometheus format.
234
+ * Automatically exports all the counts returned by getJobCounts().
235
+ *
236
+ * @returns - Returns a string with the metrics in the Prometheus format.
237
+ *
238
+ * @see {@link https://prometheus.io/docs/instrumenting/exposition_formats/}
239
+ *
240
+ **/
241
+ exportPrometheusMetrics(globalVariables?: Record<string, string>): Promise<string>;
235
242
  }
@@ -3,11 +3,7 @@
3
3
  import { QueueBase } from './queue-base';
4
4
  import { clientCommandMessageReg, QUEUE_EVENT_SUFFIX } from '../utils';
5
5
  /**
6
- *
7
- * @class QueueGetters
8
- * @extends QueueBase
9
- *
10
- * @description Provides different getters for different aspects of a queue.
6
+ * Provides different getters for different aspects of a queue.
11
7
  */
12
8
  export class QueueGetters extends QueueBase {
13
9
  getJob(jobId) {
@@ -93,10 +89,10 @@ export class QueueGetters extends QueueBase {
93
89
  /**
94
90
  * Job counts by type
95
91
  *
96
- * Queue#getJobCountByTypes('completed') => completed count
97
- * Queue#getJobCountByTypes('completed,failed') => completed + failed count
98
- * Queue#getJobCountByTypes('completed', 'failed') => completed + failed count
99
- * Queue#getJobCountByTypes('completed', 'waiting', 'failed') => completed + waiting + failed count
92
+ * Queue#getJobCountByTypes('completed') =\> completed count
93
+ * Queue#getJobCountByTypes('completed,failed') =\> completed + failed count
94
+ * Queue#getJobCountByTypes('completed', 'failed') =\> completed + failed count
95
+ * Queue#getJobCountByTypes('completed', 'waiting', 'failed') =\> completed + waiting + failed count
100
96
  */
101
97
  async getJobCountByTypes(...types) {
102
98
  const result = await this.getJobCounts(...types);
@@ -247,11 +243,12 @@ export class QueueGetters extends QueueBase {
247
243
  * A qualified job id is a string representing the job id in a given queue,
248
244
  * for example: "bull:myqueue:jobid".
249
245
  *
250
- * @param parentId The id of the parent job
251
- * @param type "processed" | "pending"
252
- * @param opts
246
+ * @param parentId - The id of the parent job
247
+ * @param type - "processed" | "pending"
248
+ * @param opts - Options for the query.
253
249
  *
254
- * @returns { items: { id: string, v?: any, err?: string } [], jobs: JobJsonRaw[], total: number}
250
+ * @returns an object with the following shape:
251
+ * `{ items: { id: string, v?: any, err?: string } [], jobs: JobJsonRaw[], total: number}`
255
252
  */
256
253
  async getDependencies(parentId, type, start, end) {
257
254
  const key = this.toKey(type == 'processed'
@@ -423,7 +420,7 @@ export class QueueGetters extends QueueBase {
423
420
  };
424
421
  }
425
422
  parseClientList(list, matcher) {
426
- const lines = list.split('\n');
423
+ const lines = list.split(/\r?\n/);
427
424
  const clients = [];
428
425
  lines.forEach((line) => {
429
426
  const client = {};
@@ -443,5 +440,28 @@ export class QueueGetters extends QueueBase {
443
440
  });
444
441
  return clients;
445
442
  }
443
+ /**
444
+ * Export the metrics for the queue in the Prometheus format.
445
+ * Automatically exports all the counts returned by getJobCounts().
446
+ *
447
+ * @returns - Returns a string with the metrics in the Prometheus format.
448
+ *
449
+ * @see {@link https://prometheus.io/docs/instrumenting/exposition_formats/}
450
+ *
451
+ **/
452
+ async exportPrometheusMetrics(globalVariables) {
453
+ const counts = await this.getJobCounts();
454
+ const metrics = [];
455
+ // Match the test's expected HELP text
456
+ metrics.push('# HELP bullmq_job_count Number of jobs in the queue by state');
457
+ metrics.push('# TYPE bullmq_job_count gauge');
458
+ const variables = !globalVariables
459
+ ? ''
460
+ : Object.keys(globalVariables).reduce((acc, curr) => `${acc}, ${curr}="${globalVariables[curr]}"`, '');
461
+ for (const [state, count] of Object.entries(counts)) {
462
+ metrics.push(`bullmq_job_count{queue="${this.name}", state="${state}"${variables}} ${count}`);
463
+ }
464
+ return metrics.join('\n');
465
+ }
446
466
  }
447
467
  //# sourceMappingURL=queue-getters.js.map
@@ -1,5 +1,5 @@
1
1
  import { BaseJobOptions, BulkJobOptions, IoredisListener, JobSchedulerJson, QueueOptions, RepeatableJob, RepeatOptions } from '../interfaces';
2
- import { FinishedStatus, JobsOptions, JobSchedulerTemplateOptions } from '../types';
2
+ import { FinishedStatus, JobsOptions, JobSchedulerTemplateOptions, JobProgress } from '../types';
3
3
  import { Job } from './job';
4
4
  import { QueueGetters } from './queue-getters';
5
5
  import { Repeat } from './repeat';
@@ -71,9 +71,9 @@ type ExtractNameType<DataTypeOrJob, Default extends string> = DataTypeOrJob exte
71
71
  * This class provides methods to add jobs to a queue and some other high-level
72
72
  * administration such as pausing or deleting queues.
73
73
  *
74
- * @template DataType - The type of the data that the job will process.
75
- * @template ResultType - The type of the result of the job.
76
- * @template NameType - The type of the name of the job.
74
+ * @typeParam DataType - The type of the data that the job will process.
75
+ * @typeParam ResultType - The type of the result of the job.
76
+ * @typeParam NameType - The type of the name of the job.
77
77
  *
78
78
  * @example
79
79
  *
@@ -96,7 +96,7 @@ export declare class Queue<DataTypeOrJob = any, DefaultResultType = any, Default
96
96
  jobsOpts: BaseJobOptions;
97
97
  opts: QueueOptions;
98
98
  protected libName: string;
99
- private _repeat?;
99
+ protected _repeat?: Repeat;
100
100
  protected _jobScheduler?: JobScheduler;
101
101
  constructor(name: string, opts?: QueueOptions, Connection?: typeof RedisConnection);
102
102
  emit<U extends keyof QueueListener<JobBase<DataType, ResultType, NameType>>>(event: U, ...args: Parameters<QueueListener<JobBase<DataType, ResultType, NameType>>[U]>): boolean;
@@ -129,6 +129,10 @@ export declare class Queue<DataTypeOrJob = any, DefaultResultType = any, Default
129
129
  * restriction on the number of concurrent jobs.
130
130
  */
131
131
  setGlobalConcurrency(concurrency: number): Promise<number>;
132
+ /**
133
+ * Remove global concurrency value.
134
+ */
135
+ removeGlobalConcurrency(): Promise<number>;
132
136
  /**
133
137
  * Adds a new job to the queue.
134
138
  *
@@ -141,9 +145,9 @@ export declare class Queue<DataTypeOrJob = any, DefaultResultType = any, Default
141
145
  * addJob is a telemetry free version of the add method, useful in order to wrap it
142
146
  * with custom telemetry on subclasses.
143
147
  *
144
- * @param name
145
- * @param data
146
- * @param opts
148
+ * @param name - Name of the job to be added to the queue.
149
+ * @param data - Arbitrary data to append to the job.
150
+ * @param opts - Job options that affects how the job is going to be processed.
147
151
  *
148
152
  * @returns Job
149
153
  */
@@ -220,7 +224,6 @@ export declare class Queue<DataTypeOrJob = any, DefaultResultType = any, Default
220
224
  /**
221
225
  * Get all repeatable meta jobs.
222
226
  *
223
- *
224
227
  * @deprecated This method is deprecated and will be removed in v6. Use getJobSchedulers instead.
225
228
  *
226
229
  * @param start - Offset of first job to return.
@@ -262,8 +265,8 @@ export declare class Queue<DataTypeOrJob = any, DefaultResultType = any, Default
262
265
  * @see removeRepeatableByKey
263
266
  *
264
267
  * @param name - Job name
265
- * @param repeatOpts -
266
- * @param jobId -
268
+ * @param repeatOpts - Repeat options
269
+ * @param jobId - Job id to remove. If not provided, all jobs with the same repeatOpts
267
270
  * @returns
268
271
  */
269
272
  removeRepeatable(name: NameType, repeatOpts: RepeatOptions, jobId?: string): Promise<boolean>;
@@ -271,7 +274,7 @@ export declare class Queue<DataTypeOrJob = any, DefaultResultType = any, Default
271
274
  *
272
275
  * Removes a job scheduler.
273
276
  *
274
- * @param jobSchedulerId
277
+ * @param jobSchedulerId - identifier of the job scheduler.
275
278
  *
276
279
  * @returns
277
280
  */
@@ -280,7 +283,7 @@ export declare class Queue<DataTypeOrJob = any, DefaultResultType = any, Default
280
283
  * Removes a debounce key.
281
284
  * @deprecated use removeDeduplicationKey
282
285
  *
283
- * @param id - identifier
286
+ * @param id - debounce identifier
284
287
  */
285
288
  removeDebounceKey(id: string): Promise<number>;
286
289
  /**
@@ -324,7 +327,7 @@ export declare class Queue<DataTypeOrJob = any, DefaultResultType = any, Default
324
327
  * @param jobId - The id of the job to update
325
328
  * @param progress - Number or object to be saved as progress.
326
329
  */
327
- updateJobProgress(jobId: string, progress: number | object): Promise<void>;
330
+ updateJobProgress(jobId: string, progress: JobProgress): Promise<void>;
328
331
  /**
329
332
  * Logs one row of job's log data.
330
333
  *
@@ -369,7 +372,7 @@ export declare class Queue<DataTypeOrJob = any, DefaultResultType = any, Default
369
372
  /**
370
373
  * Retry all the failed or completed jobs.
371
374
  *
372
- * @param opts: { count: number; state: FinishedStatus; timestamp: number}
375
+ * @param opts - An object with the following properties:
373
376
  * - count number to limit how many jobs will be moved to wait status per iteration,
374
377
  * - state failed by default or completed.
375
378
  * - timestamp from which timestamp to start moving jobs to wait status, default Date.now().
@@ -384,7 +387,7 @@ export declare class Queue<DataTypeOrJob = any, DefaultResultType = any, Default
384
387
  /**
385
388
  * Promote all the delayed jobs.
386
389
  *
387
- * @param opts: { count: number }
390
+ * @param opts - An object with the following properties:
388
391
  * - count number to limit how many jobs will be moved to wait status per iteration
389
392
  *
390
393
  * @returns
@@ -11,9 +11,9 @@ import { version } from '../version';
11
11
  * This class provides methods to add jobs to a queue and some other high-level
12
12
  * administration such as pausing or deleting queues.
13
13
  *
14
- * @template DataType - The type of the data that the job will process.
15
- * @template ResultType - The type of the result of the job.
16
- * @template NameType - The type of the name of the job.
14
+ * @typeParam DataType - The type of the data that the job will process.
15
+ * @typeParam ResultType - The type of the result of the job.
16
+ * @typeParam NameType - The type of the name of the job.
17
17
  *
18
18
  * @example
19
19
  *
@@ -127,6 +127,13 @@ export class Queue extends QueueGetters {
127
127
  const client = await this.client;
128
128
  return client.hset(this.keys.meta, 'concurrency', concurrency);
129
129
  }
130
+ /**
131
+ * Remove global concurrency value.
132
+ */
133
+ async removeGlobalConcurrency() {
134
+ const client = await this.client;
135
+ return client.hdel(this.keys.meta, 'concurrency');
136
+ }
130
137
  /**
131
138
  * Adds a new job to the queue.
132
139
  *
@@ -155,9 +162,9 @@ export class Queue extends QueueGetters {
155
162
  * addJob is a telemetry free version of the add method, useful in order to wrap it
156
163
  * with custom telemetry on subclasses.
157
164
  *
158
- * @param name
159
- * @param data
160
- * @param opts
165
+ * @param name - Name of the job to be added to the queue.
166
+ * @param data - Arbitrary data to append to the job.
167
+ * @param opts - Job options that affects how the job is going to be processed.
161
168
  *
162
169
  * @returns Job
163
170
  */
@@ -313,7 +320,6 @@ export class Queue extends QueueGetters {
313
320
  /**
314
321
  * Get all repeatable meta jobs.
315
322
  *
316
- *
317
323
  * @deprecated This method is deprecated and will be removed in v6. Use getJobSchedulers instead.
318
324
  *
319
325
  * @param start - Offset of first job to return.
@@ -363,8 +369,8 @@ export class Queue extends QueueGetters {
363
369
  * @see removeRepeatableByKey
364
370
  *
365
371
  * @param name - Job name
366
- * @param repeatOpts -
367
- * @param jobId -
372
+ * @param repeatOpts - Repeat options
373
+ * @param jobId - Job id to remove. If not provided, all jobs with the same repeatOpts
368
374
  * @returns
369
375
  */
370
376
  async removeRepeatable(name, repeatOpts, jobId) {
@@ -382,7 +388,7 @@ export class Queue extends QueueGetters {
382
388
  *
383
389
  * Removes a job scheduler.
384
390
  *
385
- * @param jobSchedulerId
391
+ * @param jobSchedulerId - identifier of the job scheduler.
386
392
  *
387
393
  * @returns
388
394
  */
@@ -395,7 +401,7 @@ export class Queue extends QueueGetters {
395
401
  * Removes a debounce key.
396
402
  * @deprecated use removeDeduplicationKey
397
403
  *
398
- * @param id - identifier
404
+ * @param id - debounce identifier
399
405
  */
400
406
  async removeDebounceKey(id) {
401
407
  return this.trace(SpanKind.INTERNAL, 'removeDebounceKey', `${this.name}`, async (span) => {
@@ -569,7 +575,7 @@ export class Queue extends QueueGetters {
569
575
  /**
570
576
  * Retry all the failed or completed jobs.
571
577
  *
572
- * @param opts: { count: number; state: FinishedStatus; timestamp: number}
578
+ * @param opts - An object with the following properties:
573
579
  * - count number to limit how many jobs will be moved to wait status per iteration,
574
580
  * - state failed by default or completed.
575
581
  * - timestamp from which timestamp to start moving jobs to wait status, default Date.now().
@@ -590,7 +596,7 @@ export class Queue extends QueueGetters {
590
596
  /**
591
597
  * Promote all the delayed jobs.
592
598
  *
593
- * @param opts: { count: number }
599
+ * @param opts - An object with the following properties:
594
600
  * - count number to limit how many jobs will be moved to wait status per iteration
595
601
  *
596
602
  * @returns
@@ -11,8 +11,7 @@ export interface RawCommand {
11
11
  keys: number;
12
12
  }
13
13
  export declare class RedisConnection extends EventEmitter {
14
- private readonly shared;
15
- private readonly blocking;
14
+ private readonly extraOptions?;
16
15
  static minimumVersion: string;
17
16
  static recommendedMinimumVersion: string;
18
17
  closing: boolean;
@@ -27,7 +26,12 @@ export declare class RedisConnection extends EventEmitter {
27
26
  private handleClientError;
28
27
  private handleClientClose;
29
28
  private handleClientReady;
30
- constructor(opts?: ConnectionOptions, shared?: boolean, blocking?: boolean, skipVersionCheck?: boolean);
29
+ constructor(opts: ConnectionOptions, extraOptions?: {
30
+ shared?: boolean;
31
+ blocking?: boolean;
32
+ skipVersionCheck?: boolean;
33
+ skipWaitingForReady?: boolean;
34
+ });
31
35
  private checkBlockingOptions;
32
36
  /**
33
37
  * Waits for a redis client to be ready.