@geekmidas/events 9.0.2 → 10.0.0-alpha.1

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 (353) hide show
  1. package/dist/{PgBossConnection-B71ssr72.cjs → PgBossConnection-23soZ_aM.cjs} +2 -2
  2. package/dist/{PgBossConnection-B71ssr72.cjs.map → PgBossConnection-23soZ_aM.cjs.map} +1 -1
  3. package/dist/PgBossConnection-CCXhoNzb.cjs +4 -0
  4. package/dist/{PgBossConnection-Bj_Wo1lQ.mjs → PgBossConnection-DvNbd4Zk.mjs} +2 -2
  5. package/dist/{PgBossConnection-Bj_Wo1lQ.mjs.map → PgBossConnection-DvNbd4Zk.mjs.map} +1 -1
  6. package/dist/PgBossConnection-_gdM40JB.mjs +4 -0
  7. package/dist/{RabbitMQConnection-DmMMosT4.cjs → RabbitMQConnection-BKEdCUro.cjs} +2 -2
  8. package/dist/{RabbitMQConnection-DmMMosT4.cjs.map → RabbitMQConnection-BKEdCUro.cjs.map} +1 -1
  9. package/dist/RabbitMQConnection-CCOqDDnb.cjs +4 -0
  10. package/dist/RabbitMQConnection-DJEyM-Bu.mjs +4 -0
  11. package/dist/{RabbitMQConnection-BtKZjtZY.mjs → RabbitMQConnection-DJgUPc19.mjs} +2 -2
  12. package/dist/{RabbitMQConnection-BtKZjtZY.mjs.map → RabbitMQConnection-DJgUPc19.mjs.map} +1 -1
  13. package/dist/{SNSConnection-CAcbLQOy.cjs → SNSConnection-B2K86hpz.cjs} +7 -8
  14. package/dist/SNSConnection-B2K86hpz.cjs.map +1 -0
  15. package/dist/SNSConnection-BVo84FeW.mjs +5 -0
  16. package/dist/SNSConnection-DIHRjrQF.cjs +5 -0
  17. package/dist/{SNSConnection-CVjH93lb.mjs → SNSConnection-v9jjF99w.mjs} +7 -8
  18. package/dist/SNSConnection-v9jjF99w.mjs.map +1 -0
  19. package/dist/{SQSConnection-CT3S7_zP.mjs → SQSConnection-4tBMkVZE.mjs} +7 -8
  20. package/dist/SQSConnection-4tBMkVZE.mjs.map +1 -0
  21. package/dist/SQSConnection-BBLAvF-1.cjs +5 -0
  22. package/dist/{SQSConnection-Y0mdVTcB.cjs → SQSConnection-BaC7rGhI.cjs} +7 -8
  23. package/dist/SQSConnection-BaC7rGhI.cjs.map +1 -0
  24. package/dist/SQSConnection-DbavOq8_.mjs +5 -0
  25. package/dist/{SQSSubscriber-CQdSFzpe.mjs → SQSSubscriber-BMWZ3s5q.mjs} +1 -1
  26. package/dist/{SQSSubscriber-CQdSFzpe.mjs.map → SQSSubscriber-BMWZ3s5q.mjs.map} +1 -1
  27. package/dist/{SQSSubscriber-C4UA2hKq.cjs → SQSSubscriber-YXPlg2rm.cjs} +2 -2
  28. package/dist/{SQSSubscriber-C4UA2hKq.cjs.map → SQSSubscriber-YXPlg2rm.cjs.map} +1 -1
  29. package/dist/basic/index.cjs +71 -8
  30. package/dist/basic/index.cjs.map +1 -0
  31. package/dist/basic/index.d.cts +44 -5
  32. package/dist/basic/index.d.cts.map +1 -0
  33. package/dist/basic/index.d.mts +44 -5
  34. package/dist/basic/index.d.mts.map +1 -0
  35. package/dist/basic/index.mjs +67 -5
  36. package/dist/basic/index.mjs.map +1 -0
  37. package/dist/chunk-B9dir_RE.mjs +11 -0
  38. package/dist/{chunk-CUT6urMc.cjs → chunk-CsX-DzYB.cjs} +12 -0
  39. package/dist/index.cjs +189 -6
  40. package/dist/index.cjs.map +1 -0
  41. package/dist/index.d.cts +46 -5
  42. package/dist/index.d.cts.map +1 -0
  43. package/dist/index.d.mts +46 -5
  44. package/dist/index.d.mts.map +1 -0
  45. package/dist/index.mjs +188 -5
  46. package/dist/index.mjs.map +1 -0
  47. package/dist/pgboss/index.cjs +81 -5
  48. package/dist/pgboss/index.cjs.map +1 -0
  49. package/dist/pgboss/index.d.cts +65 -5
  50. package/dist/pgboss/index.d.cts.map +1 -0
  51. package/dist/pgboss/index.d.mts +65 -5
  52. package/dist/pgboss/index.d.mts.map +1 -0
  53. package/dist/pgboss/index.mjs +81 -5
  54. package/dist/pgboss/index.mjs.map +1 -0
  55. package/dist/rabbitmq/index.cjs +95 -5
  56. package/dist/rabbitmq/index.cjs.map +1 -0
  57. package/dist/rabbitmq/index.d.cts +83 -5
  58. package/dist/rabbitmq/index.d.cts.map +1 -0
  59. package/dist/rabbitmq/index.d.mts +83 -5
  60. package/dist/rabbitmq/index.d.mts.map +1 -0
  61. package/dist/rabbitmq/index.mjs +95 -5
  62. package/dist/rabbitmq/index.mjs.map +1 -0
  63. package/dist/sns/index.cjs +186 -7
  64. package/dist/sns/index.cjs.map +1 -0
  65. package/dist/sns/index.d.cts +109 -5
  66. package/dist/sns/index.d.cts.map +1 -0
  67. package/dist/sns/index.d.mts +109 -5
  68. package/dist/sns/index.d.mts.map +1 -0
  69. package/dist/sns/index.mjs +179 -7
  70. package/dist/sns/index.mjs.map +1 -0
  71. package/dist/sns/snsUrl.cjs +7 -0
  72. package/dist/sns/snsUrl.d.cts +2 -0
  73. package/dist/sns/snsUrl.d.mts +2 -0
  74. package/dist/sns/snsUrl.mjs +3 -0
  75. package/dist/snsUrl-ASdc0D1v.d.cts +61 -0
  76. package/dist/snsUrl-ASdc0D1v.d.cts.map +1 -0
  77. package/dist/snsUrl-CifYhPAa.mjs +79 -0
  78. package/dist/snsUrl-CifYhPAa.mjs.map +1 -0
  79. package/dist/snsUrl-FRbRcwF0.d.mts +61 -0
  80. package/dist/snsUrl-FRbRcwF0.d.mts.map +1 -0
  81. package/dist/snsUrl-f2gU3CzK.cjs +114 -0
  82. package/dist/snsUrl-f2gU3CzK.cjs.map +1 -0
  83. package/dist/sqs/index.cjs +67 -5
  84. package/dist/sqs/index.cjs.map +1 -0
  85. package/dist/sqs/index.d.cts +101 -5
  86. package/dist/sqs/index.d.cts.map +1 -0
  87. package/dist/sqs/index.d.mts +101 -5
  88. package/dist/sqs/index.d.mts.map +1 -0
  89. package/dist/sqs/index.mjs +60 -5
  90. package/dist/sqs/index.mjs.map +1 -0
  91. package/dist/sqs/sqsUrl.cjs +7 -0
  92. package/dist/sqs/sqsUrl.d.cts +2 -0
  93. package/dist/sqs/sqsUrl.d.mts +2 -0
  94. package/dist/sqs/sqsUrl.mjs +3 -0
  95. package/dist/sqsUrl-BV6zS-mi.d.mts +60 -0
  96. package/dist/sqsUrl-BV6zS-mi.d.mts.map +1 -0
  97. package/dist/sqsUrl-CbAsBFHI.mjs +80 -0
  98. package/dist/sqsUrl-CbAsBFHI.mjs.map +1 -0
  99. package/dist/sqsUrl-CdisN3GU.cjs +115 -0
  100. package/dist/sqsUrl-CdisN3GU.cjs.map +1 -0
  101. package/dist/sqsUrl-DZDPHxIk.d.cts +60 -0
  102. package/dist/sqsUrl-DZDPHxIk.d.cts.map +1 -0
  103. package/dist/{types-Dh9Jyinx.d.mts → types-BmixGrOD.d.cts} +1 -1
  104. package/dist/{types-Dh9Jyinx.d.mts.map → types-BmixGrOD.d.cts.map} +1 -1
  105. package/dist/{types-BrdcSEnd.mjs → types-CYDt-2RQ.mjs} +1 -1
  106. package/dist/{types-BrdcSEnd.mjs.map → types-CYDt-2RQ.mjs.map} +1 -1
  107. package/dist/{types-Dj23od3e.d.cts → types-DycjsYms.d.mts} +1 -1
  108. package/dist/{types-Dj23od3e.d.cts.map → types-DycjsYms.d.mts.map} +1 -1
  109. package/package.json +26 -3
  110. package/CHANGELOG.md +0 -109
  111. package/dist/BasicConnection-CQsJpx2J.d.cts +0 -27
  112. package/dist/BasicConnection-CQsJpx2J.d.cts.map +0 -1
  113. package/dist/BasicConnection-CxfNEvlb.cjs +0 -48
  114. package/dist/BasicConnection-CxfNEvlb.cjs.map +0 -1
  115. package/dist/BasicConnection-DcRelT64.d.mts +0 -27
  116. package/dist/BasicConnection-DcRelT64.d.mts.map +0 -1
  117. package/dist/BasicConnection-hl-Ogz3a.mjs +0 -42
  118. package/dist/BasicConnection-hl-Ogz3a.mjs.map +0 -1
  119. package/dist/BasicPublisher-C-hMX2Hy.d.mts +0 -14
  120. package/dist/BasicPublisher-C-hMX2Hy.d.mts.map +0 -1
  121. package/dist/BasicPublisher-CGMXg2I2.d.cts +0 -14
  122. package/dist/BasicPublisher-CGMXg2I2.d.cts.map +0 -1
  123. package/dist/BasicPublisher-CXAVKxgq.cjs +0 -20
  124. package/dist/BasicPublisher-CXAVKxgq.cjs.map +0 -1
  125. package/dist/BasicPublisher-DogbeHAH.mjs +0 -14
  126. package/dist/BasicPublisher-DogbeHAH.mjs.map +0 -1
  127. package/dist/BasicSubscriber-BJSZN22M.mjs +0 -16
  128. package/dist/BasicSubscriber-BJSZN22M.mjs.map +0 -1
  129. package/dist/BasicSubscriber-HzSJ_MbB.d.mts +0 -14
  130. package/dist/BasicSubscriber-HzSJ_MbB.d.mts.map +0 -1
  131. package/dist/BasicSubscriber-mVJRMXhZ.cjs +0 -22
  132. package/dist/BasicSubscriber-mVJRMXhZ.cjs.map +0 -1
  133. package/dist/BasicSubscriber-uW3IOyBj.d.cts +0 -14
  134. package/dist/BasicSubscriber-uW3IOyBj.d.cts.map +0 -1
  135. package/dist/EventConnection-4niMI6D8.d.mts +0 -13
  136. package/dist/EventConnection-4niMI6D8.d.mts.map +0 -1
  137. package/dist/EventConnection-BkA9FSVL.cjs +0 -45
  138. package/dist/EventConnection-BkA9FSVL.cjs.map +0 -1
  139. package/dist/EventConnection-Kr32GAzq.mjs +0 -40
  140. package/dist/EventConnection-Kr32GAzq.mjs.map +0 -1
  141. package/dist/EventConnection-dP42P87q.d.cts +0 -13
  142. package/dist/EventConnection-dP42P87q.d.cts.map +0 -1
  143. package/dist/EventConnection.cjs +0 -5
  144. package/dist/EventConnection.d.cts +0 -3
  145. package/dist/EventConnection.d.mts +0 -3
  146. package/dist/EventConnection.mjs +0 -4
  147. package/dist/PgBossConnection-DCfLGoHx.d.mts +0 -32
  148. package/dist/PgBossConnection-DCfLGoHx.d.mts.map +0 -1
  149. package/dist/PgBossConnection-oto_CAbP.d.cts +0 -32
  150. package/dist/PgBossConnection-oto_CAbP.d.cts.map +0 -1
  151. package/dist/PgBossPublisher-Bwo7qSoH.mjs +0 -35
  152. package/dist/PgBossPublisher-Bwo7qSoH.mjs.map +0 -1
  153. package/dist/PgBossPublisher-CqjigBVC.d.mts +0 -20
  154. package/dist/PgBossPublisher-CqjigBVC.d.mts.map +0 -1
  155. package/dist/PgBossPublisher-FTdYh58W.cjs +0 -41
  156. package/dist/PgBossPublisher-FTdYh58W.cjs.map +0 -1
  157. package/dist/PgBossPublisher-JIiB1zpA.d.cts +0 -20
  158. package/dist/PgBossPublisher-JIiB1zpA.d.cts.map +0 -1
  159. package/dist/PgBossSubscriber-BUiB1JKf.d.mts +0 -24
  160. package/dist/PgBossSubscriber-BUiB1JKf.d.mts.map +0 -1
  161. package/dist/PgBossSubscriber-BubVfuWm.cjs +0 -52
  162. package/dist/PgBossSubscriber-BubVfuWm.cjs.map +0 -1
  163. package/dist/PgBossSubscriber-Cozijfdj.d.cts +0 -24
  164. package/dist/PgBossSubscriber-Cozijfdj.d.cts.map +0 -1
  165. package/dist/PgBossSubscriber-DopATe80.mjs +0 -46
  166. package/dist/PgBossSubscriber-DopATe80.mjs.map +0 -1
  167. package/dist/Publisher-CKloIGh6.cjs +0 -79
  168. package/dist/Publisher-CKloIGh6.cjs.map +0 -1
  169. package/dist/Publisher-ChLTrUeP.mjs +0 -74
  170. package/dist/Publisher-ChLTrUeP.mjs.map +0 -1
  171. package/dist/Publisher-DDee6xau.d.cts +0 -21
  172. package/dist/Publisher-DDee6xau.d.cts.map +0 -1
  173. package/dist/Publisher-VHumMkrP.d.mts +0 -21
  174. package/dist/Publisher-VHumMkrP.d.mts.map +0 -1
  175. package/dist/Publisher.cjs +0 -4
  176. package/dist/Publisher.d.cts +0 -3
  177. package/dist/Publisher.d.mts +0 -3
  178. package/dist/Publisher.mjs +0 -4
  179. package/dist/RabbitMQConnection-DV9t3VYp.d.mts +0 -44
  180. package/dist/RabbitMQConnection-DV9t3VYp.d.mts.map +0 -1
  181. package/dist/RabbitMQConnection-jNME_eR7.d.cts +0 -44
  182. package/dist/RabbitMQConnection-jNME_eR7.d.cts.map +0 -1
  183. package/dist/RabbitMQPublisher-C94q6g8q.cjs +0 -45
  184. package/dist/RabbitMQPublisher-C94q6g8q.cjs.map +0 -1
  185. package/dist/RabbitMQPublisher-DKmgwqVj.d.mts +0 -25
  186. package/dist/RabbitMQPublisher-DKmgwqVj.d.mts.map +0 -1
  187. package/dist/RabbitMQPublisher-d257OHLa.d.cts +0 -25
  188. package/dist/RabbitMQPublisher-d257OHLa.d.cts.map +0 -1
  189. package/dist/RabbitMQPublisher-yUqWNq-P.mjs +0 -39
  190. package/dist/RabbitMQPublisher-yUqWNq-P.mjs.map +0 -1
  191. package/dist/RabbitMQSubscriber-BF7JGfYm.d.cts +0 -27
  192. package/dist/RabbitMQSubscriber-BF7JGfYm.d.cts.map +0 -1
  193. package/dist/RabbitMQSubscriber-BWniDtFs.mjs +0 -56
  194. package/dist/RabbitMQSubscriber-BWniDtFs.mjs.map +0 -1
  195. package/dist/RabbitMQSubscriber-CdbUy5mB.d.mts +0 -27
  196. package/dist/RabbitMQSubscriber-CdbUy5mB.d.mts.map +0 -1
  197. package/dist/RabbitMQSubscriber-DGEO-clQ.cjs +0 -62
  198. package/dist/RabbitMQSubscriber-DGEO-clQ.cjs.map +0 -1
  199. package/dist/SNSConnection-CAcbLQOy.cjs.map +0 -1
  200. package/dist/SNSConnection-CG4iEwA8.d.mts +0 -41
  201. package/dist/SNSConnection-CG4iEwA8.d.mts.map +0 -1
  202. package/dist/SNSConnection-CVjH93lb.mjs.map +0 -1
  203. package/dist/SNSConnection-Dol9FuxA.d.cts +0 -41
  204. package/dist/SNSConnection-Dol9FuxA.d.cts.map +0 -1
  205. package/dist/SNSPublisher-CjlMS3Z2.mjs +0 -41
  206. package/dist/SNSPublisher-CjlMS3Z2.mjs.map +0 -1
  207. package/dist/SNSPublisher-D50dPCEh.d.mts +0 -22
  208. package/dist/SNSPublisher-D50dPCEh.d.mts.map +0 -1
  209. package/dist/SNSPublisher-DQunY4NM.d.cts +0 -22
  210. package/dist/SNSPublisher-DQunY4NM.d.cts.map +0 -1
  211. package/dist/SNSPublisher-DV_8GGsi.cjs +0 -47
  212. package/dist/SNSPublisher-DV_8GGsi.cjs.map +0 -1
  213. package/dist/SNSSubscriber-BWaCQFl6.mjs +0 -139
  214. package/dist/SNSSubscriber-BWaCQFl6.mjs.map +0 -1
  215. package/dist/SNSSubscriber-CUgHK4W2.d.mts +0 -55
  216. package/dist/SNSSubscriber-CUgHK4W2.d.mts.map +0 -1
  217. package/dist/SNSSubscriber-ZE_-Hsps.cjs +0 -145
  218. package/dist/SNSSubscriber-ZE_-Hsps.cjs.map +0 -1
  219. package/dist/SNSSubscriber-ZGJjhXFQ.d.cts +0 -55
  220. package/dist/SNSSubscriber-ZGJjhXFQ.d.cts.map +0 -1
  221. package/dist/SQSConnection-BtEkDha8.d.cts +0 -41
  222. package/dist/SQSConnection-BtEkDha8.d.cts.map +0 -1
  223. package/dist/SQSConnection-CT3S7_zP.mjs.map +0 -1
  224. package/dist/SQSConnection-DVy43GCV.d.mts +0 -41
  225. package/dist/SQSConnection-DVy43GCV.d.mts.map +0 -1
  226. package/dist/SQSConnection-Y0mdVTcB.cjs.map +0 -1
  227. package/dist/SQSPublisher-B-32CC4G.mjs +0 -57
  228. package/dist/SQSPublisher-B-32CC4G.mjs.map +0 -1
  229. package/dist/SQSPublisher-CgUduk6H.cjs +0 -63
  230. package/dist/SQSPublisher-CgUduk6H.cjs.map +0 -1
  231. package/dist/SQSPublisher-kyl5HW3N.d.cts +0 -25
  232. package/dist/SQSPublisher-kyl5HW3N.d.cts.map +0 -1
  233. package/dist/SQSPublisher-qDE5Fp-N.d.mts +0 -25
  234. package/dist/SQSPublisher-qDE5Fp-N.d.mts.map +0 -1
  235. package/dist/SQSSubscriber-CDvaG4ij.d.cts +0 -44
  236. package/dist/SQSSubscriber-CDvaG4ij.d.cts.map +0 -1
  237. package/dist/SQSSubscriber-JfFuAAoP.d.mts +0 -44
  238. package/dist/SQSSubscriber-JfFuAAoP.d.mts.map +0 -1
  239. package/dist/Subscriber-CG_QUQZs.d.cts +0 -21
  240. package/dist/Subscriber-CG_QUQZs.d.cts.map +0 -1
  241. package/dist/Subscriber-CghW0A02.cjs +0 -88
  242. package/dist/Subscriber-CghW0A02.cjs.map +0 -1
  243. package/dist/Subscriber-DiYHmuF0.d.mts +0 -21
  244. package/dist/Subscriber-DiYHmuF0.d.mts.map +0 -1
  245. package/dist/Subscriber-bnkFtSvt.mjs +0 -83
  246. package/dist/Subscriber-bnkFtSvt.mjs.map +0 -1
  247. package/dist/Subscriber.cjs +0 -4
  248. package/dist/Subscriber.d.cts +0 -3
  249. package/dist/Subscriber.d.mts +0 -3
  250. package/dist/Subscriber.mjs +0 -4
  251. package/dist/basic/BasicConnection.cjs +0 -4
  252. package/dist/basic/BasicConnection.d.cts +0 -3
  253. package/dist/basic/BasicConnection.d.mts +0 -3
  254. package/dist/basic/BasicConnection.mjs +0 -4
  255. package/dist/basic/BasicPublisher.cjs +0 -3
  256. package/dist/basic/BasicPublisher.d.cts +0 -4
  257. package/dist/basic/BasicPublisher.d.mts +0 -4
  258. package/dist/basic/BasicPublisher.mjs +0 -3
  259. package/dist/basic/BasicSubscriber.cjs +0 -3
  260. package/dist/basic/BasicSubscriber.d.cts +0 -4
  261. package/dist/basic/BasicSubscriber.d.mts +0 -4
  262. package/dist/basic/BasicSubscriber.mjs +0 -3
  263. package/dist/pgboss/PgBossConnection.cjs +0 -4
  264. package/dist/pgboss/PgBossConnection.d.cts +0 -3
  265. package/dist/pgboss/PgBossConnection.d.mts +0 -3
  266. package/dist/pgboss/PgBossConnection.mjs +0 -4
  267. package/dist/pgboss/PgBossPublisher.cjs +0 -3
  268. package/dist/pgboss/PgBossPublisher.d.cts +0 -4
  269. package/dist/pgboss/PgBossPublisher.d.mts +0 -4
  270. package/dist/pgboss/PgBossPublisher.mjs +0 -3
  271. package/dist/pgboss/PgBossSubscriber.cjs +0 -3
  272. package/dist/pgboss/PgBossSubscriber.d.cts +0 -4
  273. package/dist/pgboss/PgBossSubscriber.d.mts +0 -4
  274. package/dist/pgboss/PgBossSubscriber.mjs +0 -3
  275. package/dist/rabbitmq/RabbitMQConnection.cjs +0 -4
  276. package/dist/rabbitmq/RabbitMQConnection.d.cts +0 -3
  277. package/dist/rabbitmq/RabbitMQConnection.d.mts +0 -3
  278. package/dist/rabbitmq/RabbitMQConnection.mjs +0 -4
  279. package/dist/rabbitmq/RabbitMQPublisher.cjs +0 -3
  280. package/dist/rabbitmq/RabbitMQPublisher.d.cts +0 -4
  281. package/dist/rabbitmq/RabbitMQPublisher.d.mts +0 -4
  282. package/dist/rabbitmq/RabbitMQPublisher.mjs +0 -3
  283. package/dist/rabbitmq/RabbitMQSubscriber.cjs +0 -3
  284. package/dist/rabbitmq/RabbitMQSubscriber.d.cts +0 -4
  285. package/dist/rabbitmq/RabbitMQSubscriber.d.mts +0 -4
  286. package/dist/rabbitmq/RabbitMQSubscriber.mjs +0 -3
  287. package/dist/sns/SNSConnection.cjs +0 -4
  288. package/dist/sns/SNSConnection.d.cts +0 -3
  289. package/dist/sns/SNSConnection.d.mts +0 -3
  290. package/dist/sns/SNSConnection.mjs +0 -4
  291. package/dist/sns/SNSPublisher.cjs +0 -3
  292. package/dist/sns/SNSPublisher.d.cts +0 -4
  293. package/dist/sns/SNSPublisher.d.mts +0 -4
  294. package/dist/sns/SNSPublisher.mjs +0 -3
  295. package/dist/sns/SNSSubscriber.cjs +0 -6
  296. package/dist/sns/SNSSubscriber.d.cts +0 -4
  297. package/dist/sns/SNSSubscriber.d.mts +0 -4
  298. package/dist/sns/SNSSubscriber.mjs +0 -6
  299. package/dist/sqs/SQSConnection.cjs +0 -4
  300. package/dist/sqs/SQSConnection.d.cts +0 -3
  301. package/dist/sqs/SQSConnection.d.mts +0 -3
  302. package/dist/sqs/SQSConnection.mjs +0 -4
  303. package/dist/sqs/SQSPublisher.cjs +0 -3
  304. package/dist/sqs/SQSPublisher.d.cts +0 -4
  305. package/dist/sqs/SQSPublisher.d.mts +0 -4
  306. package/dist/sqs/SQSPublisher.mjs +0 -3
  307. package/dist/sqs/SQSSubscriber.cjs +0 -3
  308. package/dist/sqs/SQSSubscriber.d.cts +0 -4
  309. package/dist/sqs/SQSSubscriber.d.mts +0 -4
  310. package/dist/sqs/SQSSubscriber.mjs +0 -3
  311. package/dist/types.cjs +0 -3
  312. package/dist/types.d.cts +0 -2
  313. package/dist/types.d.mts +0 -2
  314. package/dist/types.mjs +0 -3
  315. package/src/EventConnection.ts +0 -43
  316. package/src/Publisher.ts +0 -98
  317. package/src/Subscriber.ts +0 -113
  318. package/src/__tests__/EventConnection.spec.ts +0 -42
  319. package/src/__tests__/Publisher.spec.ts +0 -96
  320. package/src/__tests__/Subscriber.spec.ts +0 -109
  321. package/src/basic/BasicConnection.ts +0 -47
  322. package/src/basic/BasicPublisher.ts +0 -15
  323. package/src/basic/BasicSubscriber.ts +0 -21
  324. package/src/basic/__tests__/BasicSubscriber.spec.ts +0 -166
  325. package/src/basic/index.ts +0 -3
  326. package/src/index.ts +0 -25
  327. package/src/pgboss/PgBossConnection.ts +0 -91
  328. package/src/pgboss/PgBossPublisher.ts +0 -49
  329. package/src/pgboss/PgBossSubscriber.ts +0 -81
  330. package/src/pgboss/__tests__/pgboss.spec.ts +0 -196
  331. package/src/pgboss/__tests__/setup.ts +0 -21
  332. package/src/pgboss/index.ts +0 -5
  333. package/src/rabbitmq/RabbitMQConnection.ts +0 -148
  334. package/src/rabbitmq/RabbitMQPublisher.ts +0 -67
  335. package/src/rabbitmq/RabbitMQSubscriber.ts +0 -111
  336. package/src/rabbitmq/__tests__/RabbitMQPublisher.spec.ts +0 -378
  337. package/src/rabbitmq/__tests__/RabbitMQSubscriber.spec.ts +0 -292
  338. package/src/rabbitmq/index.ts +0 -6
  339. package/src/sns/SNSConnection.ts +0 -98
  340. package/src/sns/SNSPublisher.ts +0 -62
  341. package/src/sns/SNSSubscriber.ts +0 -218
  342. package/src/sns/__tests__/SNS-SQS-Integration.spec.ts +0 -389
  343. package/src/sns/__tests__/SNSPublisher.spec.ts +0 -449
  344. package/src/sns/__tests__/SNSSubscriber.spec.ts +0 -527
  345. package/src/sns/index.ts +0 -6
  346. package/src/sqs/SQSConnection.ts +0 -97
  347. package/src/sqs/SQSPublisher.ts +0 -105
  348. package/src/sqs/SQSSubscriber.ts +0 -181
  349. package/src/sqs/__tests__/SQSPublisher.spec.ts +0 -189
  350. package/src/sqs/index.ts +0 -6
  351. package/src/types.ts +0 -76
  352. package/tsconfig.json +0 -9
  353. package/tsdown.config.ts +0 -10
@@ -1,4 +1,4 @@
1
- const require_chunk = require('./chunk-CUT6urMc.cjs');
1
+ const require_chunk = require('./chunk-CsX-DzYB.cjs');
2
2
  const require_types = require('./types-Byv8N9ma.cjs');
3
3
  const pg_boss = require_chunk.__toESM(require("pg-boss"));
4
4
 
@@ -77,4 +77,4 @@ Object.defineProperty(exports, 'PgBossConnection', {
77
77
  return PgBossConnection;
78
78
  }
79
79
  });
80
- //# sourceMappingURL=PgBossConnection-B71ssr72.cjs.map
80
+ //# sourceMappingURL=PgBossConnection-23soZ_aM.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PgBossConnection-B71ssr72.cjs","names":["EventPublisherType","config: PgBossConnectionConfig","connectionString: string","PgBoss"],"sources":["../src/pgboss/PgBossConnection.ts"],"sourcesContent":["import { PgBoss } from 'pg-boss';\nimport type { EventConnection } from '../types';\nimport { EventPublisherType } from '../types';\n\nexport interface PgBossConnectionConfig {\n\tconnectionString: string;\n\tschema?: string;\n}\n\nexport class PgBossConnection implements EventConnection {\n\treadonly type = EventPublisherType.PgBoss;\n\tprivate boss?: PgBoss;\n\tprivate connecting?: Promise<void>;\n\n\tconstructor(private config: PgBossConnectionConfig) {}\n\n\t/**\n\t * Create a PgBossConnection from a connection string.\n\t * Format: pgboss://user:pass@host:5432/database?schema=pgboss\n\t */\n\tstatic async fromConnectionString(\n\t\tconnectionString: string,\n\t): Promise<PgBossConnection> {\n\t\tconst url = new URL(connectionString);\n\t\tconst params = url.searchParams;\n\n\t\tconst postgresUrl = `postgres://${url.username ? `${url.username}:${url.password}@` : ''}${url.host}${url.pathname}`;\n\n\t\tconst config: PgBossConnectionConfig = {\n\t\t\tconnectionString: postgresUrl,\n\t\t\tschema: params.get('schema') || undefined,\n\t\t};\n\n\t\tconst connection = new PgBossConnection(config);\n\t\tawait connection.connect();\n\t\treturn connection;\n\t}\n\n\tasync connect(): Promise<void> {\n\t\tif (this.boss) return;\n\n\t\tif (this.connecting) {\n\t\t\tawait this.connecting;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.connecting = (async () => {\n\t\t\ttry {\n\t\t\t\tconst boss = new PgBoss({\n\t\t\t\t\tconnectionString: this.config.connectionString,\n\t\t\t\t\t...(this.config.schema && { schema: this.config.schema }),\n\t\t\t\t});\n\n\t\t\t\tawait boss.start();\n\t\t\t\tthis.boss = boss;\n\t\t\t} catch (error) {\n\t\t\t\tthis.cleanup();\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t})();\n\n\t\tawait this.connecting;\n\t\tthis.connecting = undefined;\n\t}\n\n\tasync close(): Promise<void> {\n\t\ttry {\n\t\t\tawait this.boss?.stop({ graceful: true });\n\t\t} catch {\n\t\t\t// Ignore errors during close\n\t\t} finally {\n\t\t\tthis.cleanup();\n\t\t}\n\t}\n\n\tisConnected(): boolean {\n\t\treturn !!this.boss;\n\t}\n\n\tprivate cleanup(): void {\n\t\tthis.boss = undefined;\n\t\tthis.connecting = undefined;\n\t}\n\n\t/**\n\t * Get the underlying pg-boss instance for publishing/subscribing\n\t */\n\tget instance(): PgBoss | undefined {\n\t\treturn this.boss;\n\t}\n}\n"],"mappings":";;;;;AASA,IAAa,mBAAb,MAAa,iBAA4C;CACxD,AAAS,OAAOA,iCAAmB;CACnC,AAAQ;CACR,AAAQ;CAER,YAAoBC,QAAgC;EAAhC;CAAkC;;;;;CAMtD,aAAa,qBACZC,kBAC4B;EAC5B,MAAM,MAAM,IAAI,IAAI;EACpB,MAAM,SAAS,IAAI;EAEnB,MAAM,eAAe,aAAa,IAAI,YAAY,EAAE,IAAI,SAAS,GAAG,IAAI,SAAS,KAAK,GAAG,EAAE,IAAI,KAAK,EAAE,IAAI,SAAS;EAEnH,MAAMD,SAAiC;GACtC,kBAAkB;GAClB,QAAQ,OAAO,IAAI,SAAS;EAC5B;EAED,MAAM,aAAa,IAAI,iBAAiB;AACxC,QAAM,WAAW,SAAS;AAC1B,SAAO;CACP;CAED,MAAM,UAAyB;AAC9B,MAAI,KAAK,KAAM;AAEf,MAAI,KAAK,YAAY;AACpB,SAAM,KAAK;AACX;EACA;AAED,OAAK,aAAa,CAAC,YAAY;AAC9B,OAAI;IACH,MAAM,OAAO,IAAIE,eAAO;KACvB,kBAAkB,KAAK,OAAO;KAC9B,GAAI,KAAK,OAAO,UAAU,EAAE,QAAQ,KAAK,OAAO,OAAQ;IACxD;AAED,UAAM,KAAK,OAAO;AAClB,SAAK,OAAO;GACZ,SAAQ,OAAO;AACf,SAAK,SAAS;AACd,UAAM;GACN;EACD,IAAG;AAEJ,QAAM,KAAK;AACX,OAAK;CACL;CAED,MAAM,QAAuB;AAC5B,MAAI;AACH,SAAM,KAAK,MAAM,KAAK,EAAE,UAAU,KAAM,EAAC;EACzC,QAAO,CAEP,UAAS;AACT,QAAK,SAAS;EACd;CACD;CAED,cAAuB;AACtB,WAAS,KAAK;CACd;CAED,AAAQ,UAAgB;AACvB,OAAK;AACL,OAAK;CACL;;;;CAKD,IAAI,WAA+B;AAClC,SAAO,KAAK;CACZ;AACD"}
1
+ {"version":3,"file":"PgBossConnection-23soZ_aM.cjs","names":["EventPublisherType","config: PgBossConnectionConfig","connectionString: string","PgBoss"],"sources":["../src/pgboss/PgBossConnection.ts"],"sourcesContent":["import { PgBoss } from 'pg-boss';\nimport type { EventConnection } from '../types';\nimport { EventPublisherType } from '../types';\n\nexport interface PgBossConnectionConfig {\n\tconnectionString: string;\n\tschema?: string;\n}\n\nexport class PgBossConnection implements EventConnection {\n\treadonly type = EventPublisherType.PgBoss;\n\tprivate boss?: PgBoss;\n\tprivate connecting?: Promise<void>;\n\n\tconstructor(private config: PgBossConnectionConfig) {}\n\n\t/**\n\t * Create a PgBossConnection from a connection string.\n\t * Format: pgboss://user:pass@host:5432/database?schema=pgboss\n\t */\n\tstatic async fromConnectionString(\n\t\tconnectionString: string,\n\t): Promise<PgBossConnection> {\n\t\tconst url = new URL(connectionString);\n\t\tconst params = url.searchParams;\n\n\t\tconst postgresUrl = `postgres://${url.username ? `${url.username}:${url.password}@` : ''}${url.host}${url.pathname}`;\n\n\t\tconst config: PgBossConnectionConfig = {\n\t\t\tconnectionString: postgresUrl,\n\t\t\tschema: params.get('schema') || undefined,\n\t\t};\n\n\t\tconst connection = new PgBossConnection(config);\n\t\tawait connection.connect();\n\t\treturn connection;\n\t}\n\n\tasync connect(): Promise<void> {\n\t\tif (this.boss) return;\n\n\t\tif (this.connecting) {\n\t\t\tawait this.connecting;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.connecting = (async () => {\n\t\t\ttry {\n\t\t\t\tconst boss = new PgBoss({\n\t\t\t\t\tconnectionString: this.config.connectionString,\n\t\t\t\t\t...(this.config.schema && { schema: this.config.schema }),\n\t\t\t\t});\n\n\t\t\t\tawait boss.start();\n\t\t\t\tthis.boss = boss;\n\t\t\t} catch (error) {\n\t\t\t\tthis.cleanup();\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t})();\n\n\t\tawait this.connecting;\n\t\tthis.connecting = undefined;\n\t}\n\n\tasync close(): Promise<void> {\n\t\ttry {\n\t\t\tawait this.boss?.stop({ graceful: true });\n\t\t} catch {\n\t\t\t// Ignore errors during close\n\t\t} finally {\n\t\t\tthis.cleanup();\n\t\t}\n\t}\n\n\tisConnected(): boolean {\n\t\treturn !!this.boss;\n\t}\n\n\tprivate cleanup(): void {\n\t\tthis.boss = undefined;\n\t\tthis.connecting = undefined;\n\t}\n\n\t/**\n\t * Get the underlying pg-boss instance for publishing/subscribing\n\t */\n\tget instance(): PgBoss | undefined {\n\t\treturn this.boss;\n\t}\n}\n"],"mappings":";;;;;AASA,IAAa,mBAAb,MAAa,iBAA4C;CACxD,AAAS,OAAOA,iCAAmB;CACnC,AAAQ;CACR,AAAQ;CAER,YAAoBC,QAAgC;EAAhC;CAAkC;;;;;CAMtD,aAAa,qBACZC,kBAC4B;EAC5B,MAAM,MAAM,IAAI,IAAI;EACpB,MAAM,SAAS,IAAI;EAEnB,MAAM,eAAe,aAAa,IAAI,YAAY,EAAE,IAAI,SAAS,GAAG,IAAI,SAAS,KAAK,GAAG,EAAE,IAAI,KAAK,EAAE,IAAI,SAAS;EAEnH,MAAMD,SAAiC;GACtC,kBAAkB;GAClB,QAAQ,OAAO,IAAI,SAAS;EAC5B;EAED,MAAM,aAAa,IAAI,iBAAiB;AACxC,QAAM,WAAW,SAAS;AAC1B,SAAO;CACP;CAED,MAAM,UAAyB;AAC9B,MAAI,KAAK,KAAM;AAEf,MAAI,KAAK,YAAY;AACpB,SAAM,KAAK;AACX;EACA;AAED,OAAK,aAAa,CAAC,YAAY;AAC9B,OAAI;IACH,MAAM,OAAO,IAAIE,eAAO;KACvB,kBAAkB,KAAK,OAAO;KAC9B,GAAI,KAAK,OAAO,UAAU,EAAE,QAAQ,KAAK,OAAO,OAAQ;IACxD;AAED,UAAM,KAAK,OAAO;AAClB,SAAK,OAAO;GACZ,SAAQ,OAAO;AACf,SAAK,SAAS;AACd,UAAM;GACN;EACD,IAAG;AAEJ,QAAM,KAAK;AACX,OAAK;CACL;CAED,MAAM,QAAuB;AAC5B,MAAI;AACH,SAAM,KAAK,MAAM,KAAK,EAAE,UAAU,KAAM,EAAC;EACzC,QAAO,CAEP,UAAS;AACT,QAAK,SAAS;EACd;CACD;CAED,cAAuB;AACtB,WAAS,KAAK;CACd;CAED,AAAQ,UAAgB;AACvB,OAAK;AACL,OAAK;CACL;;;;CAKD,IAAI,WAA+B;AAClC,SAAO,KAAK;CACZ;AACD"}
@@ -0,0 +1,4 @@
1
+ require('./types-Byv8N9ma.cjs');
2
+ const require_PgBossConnection = require('./PgBossConnection-23soZ_aM.cjs');
3
+
4
+ exports.PgBossConnection = require_PgBossConnection.PgBossConnection;
@@ -1,4 +1,4 @@
1
- import { EventPublisherType } from "./types-BrdcSEnd.mjs";
1
+ import { EventPublisherType } from "./types-CYDt-2RQ.mjs";
2
2
  import { PgBoss } from "pg-boss";
3
3
 
4
4
  //#region src/pgboss/PgBossConnection.ts
@@ -71,4 +71,4 @@ var PgBossConnection = class PgBossConnection {
71
71
 
72
72
  //#endregion
73
73
  export { PgBossConnection };
74
- //# sourceMappingURL=PgBossConnection-Bj_Wo1lQ.mjs.map
74
+ //# sourceMappingURL=PgBossConnection-DvNbd4Zk.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PgBossConnection-Bj_Wo1lQ.mjs","names":["config: PgBossConnectionConfig","connectionString: string"],"sources":["../src/pgboss/PgBossConnection.ts"],"sourcesContent":["import { PgBoss } from 'pg-boss';\nimport type { EventConnection } from '../types';\nimport { EventPublisherType } from '../types';\n\nexport interface PgBossConnectionConfig {\n\tconnectionString: string;\n\tschema?: string;\n}\n\nexport class PgBossConnection implements EventConnection {\n\treadonly type = EventPublisherType.PgBoss;\n\tprivate boss?: PgBoss;\n\tprivate connecting?: Promise<void>;\n\n\tconstructor(private config: PgBossConnectionConfig) {}\n\n\t/**\n\t * Create a PgBossConnection from a connection string.\n\t * Format: pgboss://user:pass@host:5432/database?schema=pgboss\n\t */\n\tstatic async fromConnectionString(\n\t\tconnectionString: string,\n\t): Promise<PgBossConnection> {\n\t\tconst url = new URL(connectionString);\n\t\tconst params = url.searchParams;\n\n\t\tconst postgresUrl = `postgres://${url.username ? `${url.username}:${url.password}@` : ''}${url.host}${url.pathname}`;\n\n\t\tconst config: PgBossConnectionConfig = {\n\t\t\tconnectionString: postgresUrl,\n\t\t\tschema: params.get('schema') || undefined,\n\t\t};\n\n\t\tconst connection = new PgBossConnection(config);\n\t\tawait connection.connect();\n\t\treturn connection;\n\t}\n\n\tasync connect(): Promise<void> {\n\t\tif (this.boss) return;\n\n\t\tif (this.connecting) {\n\t\t\tawait this.connecting;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.connecting = (async () => {\n\t\t\ttry {\n\t\t\t\tconst boss = new PgBoss({\n\t\t\t\t\tconnectionString: this.config.connectionString,\n\t\t\t\t\t...(this.config.schema && { schema: this.config.schema }),\n\t\t\t\t});\n\n\t\t\t\tawait boss.start();\n\t\t\t\tthis.boss = boss;\n\t\t\t} catch (error) {\n\t\t\t\tthis.cleanup();\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t})();\n\n\t\tawait this.connecting;\n\t\tthis.connecting = undefined;\n\t}\n\n\tasync close(): Promise<void> {\n\t\ttry {\n\t\t\tawait this.boss?.stop({ graceful: true });\n\t\t} catch {\n\t\t\t// Ignore errors during close\n\t\t} finally {\n\t\t\tthis.cleanup();\n\t\t}\n\t}\n\n\tisConnected(): boolean {\n\t\treturn !!this.boss;\n\t}\n\n\tprivate cleanup(): void {\n\t\tthis.boss = undefined;\n\t\tthis.connecting = undefined;\n\t}\n\n\t/**\n\t * Get the underlying pg-boss instance for publishing/subscribing\n\t */\n\tget instance(): PgBoss | undefined {\n\t\treturn this.boss;\n\t}\n}\n"],"mappings":";;;;AASA,IAAa,mBAAb,MAAa,iBAA4C;CACxD,AAAS,OAAO,mBAAmB;CACnC,AAAQ;CACR,AAAQ;CAER,YAAoBA,QAAgC;EAAhC;CAAkC;;;;;CAMtD,aAAa,qBACZC,kBAC4B;EAC5B,MAAM,MAAM,IAAI,IAAI;EACpB,MAAM,SAAS,IAAI;EAEnB,MAAM,eAAe,aAAa,IAAI,YAAY,EAAE,IAAI,SAAS,GAAG,IAAI,SAAS,KAAK,GAAG,EAAE,IAAI,KAAK,EAAE,IAAI,SAAS;EAEnH,MAAMD,SAAiC;GACtC,kBAAkB;GAClB,QAAQ,OAAO,IAAI,SAAS;EAC5B;EAED,MAAM,aAAa,IAAI,iBAAiB;AACxC,QAAM,WAAW,SAAS;AAC1B,SAAO;CACP;CAED,MAAM,UAAyB;AAC9B,MAAI,KAAK,KAAM;AAEf,MAAI,KAAK,YAAY;AACpB,SAAM,KAAK;AACX;EACA;AAED,OAAK,aAAa,CAAC,YAAY;AAC9B,OAAI;IACH,MAAM,OAAO,IAAI,OAAO;KACvB,kBAAkB,KAAK,OAAO;KAC9B,GAAI,KAAK,OAAO,UAAU,EAAE,QAAQ,KAAK,OAAO,OAAQ;IACxD;AAED,UAAM,KAAK,OAAO;AAClB,SAAK,OAAO;GACZ,SAAQ,OAAO;AACf,SAAK,SAAS;AACd,UAAM;GACN;EACD,IAAG;AAEJ,QAAM,KAAK;AACX,OAAK;CACL;CAED,MAAM,QAAuB;AAC5B,MAAI;AACH,SAAM,KAAK,MAAM,KAAK,EAAE,UAAU,KAAM,EAAC;EACzC,QAAO,CAEP,UAAS;AACT,QAAK,SAAS;EACd;CACD;CAED,cAAuB;AACtB,WAAS,KAAK;CACd;CAED,AAAQ,UAAgB;AACvB,OAAK;AACL,OAAK;CACL;;;;CAKD,IAAI,WAA+B;AAClC,SAAO,KAAK;CACZ;AACD"}
1
+ {"version":3,"file":"PgBossConnection-DvNbd4Zk.mjs","names":["config: PgBossConnectionConfig","connectionString: string"],"sources":["../src/pgboss/PgBossConnection.ts"],"sourcesContent":["import { PgBoss } from 'pg-boss';\nimport type { EventConnection } from '../types';\nimport { EventPublisherType } from '../types';\n\nexport interface PgBossConnectionConfig {\n\tconnectionString: string;\n\tschema?: string;\n}\n\nexport class PgBossConnection implements EventConnection {\n\treadonly type = EventPublisherType.PgBoss;\n\tprivate boss?: PgBoss;\n\tprivate connecting?: Promise<void>;\n\n\tconstructor(private config: PgBossConnectionConfig) {}\n\n\t/**\n\t * Create a PgBossConnection from a connection string.\n\t * Format: pgboss://user:pass@host:5432/database?schema=pgboss\n\t */\n\tstatic async fromConnectionString(\n\t\tconnectionString: string,\n\t): Promise<PgBossConnection> {\n\t\tconst url = new URL(connectionString);\n\t\tconst params = url.searchParams;\n\n\t\tconst postgresUrl = `postgres://${url.username ? `${url.username}:${url.password}@` : ''}${url.host}${url.pathname}`;\n\n\t\tconst config: PgBossConnectionConfig = {\n\t\t\tconnectionString: postgresUrl,\n\t\t\tschema: params.get('schema') || undefined,\n\t\t};\n\n\t\tconst connection = new PgBossConnection(config);\n\t\tawait connection.connect();\n\t\treturn connection;\n\t}\n\n\tasync connect(): Promise<void> {\n\t\tif (this.boss) return;\n\n\t\tif (this.connecting) {\n\t\t\tawait this.connecting;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.connecting = (async () => {\n\t\t\ttry {\n\t\t\t\tconst boss = new PgBoss({\n\t\t\t\t\tconnectionString: this.config.connectionString,\n\t\t\t\t\t...(this.config.schema && { schema: this.config.schema }),\n\t\t\t\t});\n\n\t\t\t\tawait boss.start();\n\t\t\t\tthis.boss = boss;\n\t\t\t} catch (error) {\n\t\t\t\tthis.cleanup();\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t})();\n\n\t\tawait this.connecting;\n\t\tthis.connecting = undefined;\n\t}\n\n\tasync close(): Promise<void> {\n\t\ttry {\n\t\t\tawait this.boss?.stop({ graceful: true });\n\t\t} catch {\n\t\t\t// Ignore errors during close\n\t\t} finally {\n\t\t\tthis.cleanup();\n\t\t}\n\t}\n\n\tisConnected(): boolean {\n\t\treturn !!this.boss;\n\t}\n\n\tprivate cleanup(): void {\n\t\tthis.boss = undefined;\n\t\tthis.connecting = undefined;\n\t}\n\n\t/**\n\t * Get the underlying pg-boss instance for publishing/subscribing\n\t */\n\tget instance(): PgBoss | undefined {\n\t\treturn this.boss;\n\t}\n}\n"],"mappings":";;;;AASA,IAAa,mBAAb,MAAa,iBAA4C;CACxD,AAAS,OAAO,mBAAmB;CACnC,AAAQ;CACR,AAAQ;CAER,YAAoBA,QAAgC;EAAhC;CAAkC;;;;;CAMtD,aAAa,qBACZC,kBAC4B;EAC5B,MAAM,MAAM,IAAI,IAAI;EACpB,MAAM,SAAS,IAAI;EAEnB,MAAM,eAAe,aAAa,IAAI,YAAY,EAAE,IAAI,SAAS,GAAG,IAAI,SAAS,KAAK,GAAG,EAAE,IAAI,KAAK,EAAE,IAAI,SAAS;EAEnH,MAAMD,SAAiC;GACtC,kBAAkB;GAClB,QAAQ,OAAO,IAAI,SAAS;EAC5B;EAED,MAAM,aAAa,IAAI,iBAAiB;AACxC,QAAM,WAAW,SAAS;AAC1B,SAAO;CACP;CAED,MAAM,UAAyB;AAC9B,MAAI,KAAK,KAAM;AAEf,MAAI,KAAK,YAAY;AACpB,SAAM,KAAK;AACX;EACA;AAED,OAAK,aAAa,CAAC,YAAY;AAC9B,OAAI;IACH,MAAM,OAAO,IAAI,OAAO;KACvB,kBAAkB,KAAK,OAAO;KAC9B,GAAI,KAAK,OAAO,UAAU,EAAE,QAAQ,KAAK,OAAO,OAAQ;IACxD;AAED,UAAM,KAAK,OAAO;AAClB,SAAK,OAAO;GACZ,SAAQ,OAAO;AACf,SAAK,SAAS;AACd,UAAM;GACN;EACD,IAAG;AAEJ,QAAM,KAAK;AACX,OAAK;CACL;CAED,MAAM,QAAuB;AAC5B,MAAI;AACH,SAAM,KAAK,MAAM,KAAK,EAAE,UAAU,KAAM,EAAC;EACzC,QAAO,CAEP,UAAS;AACT,QAAK,SAAS;EACd;CACD;CAED,cAAuB;AACtB,WAAS,KAAK;CACd;CAED,AAAQ,UAAgB;AACvB,OAAK;AACL,OAAK;CACL;;;;CAKD,IAAI,WAA+B;AAClC,SAAO,KAAK;CACZ;AACD"}
@@ -0,0 +1,4 @@
1
+ import "./types-CYDt-2RQ.mjs";
2
+ import { PgBossConnection } from "./PgBossConnection-DvNbd4Zk.mjs";
3
+
4
+ export { PgBossConnection };
@@ -1,4 +1,4 @@
1
- const require_chunk = require('./chunk-CUT6urMc.cjs');
1
+ const require_chunk = require('./chunk-CsX-DzYB.cjs');
2
2
  const require_types = require('./types-Byv8N9ma.cjs');
3
3
  const amqplib = require_chunk.__toESM(require("amqplib"));
4
4
 
@@ -110,4 +110,4 @@ Object.defineProperty(exports, 'RabbitMQConnection', {
110
110
  return RabbitMQConnection;
111
111
  }
112
112
  });
113
- //# sourceMappingURL=RabbitMQConnection-DmMMosT4.cjs.map
113
+ //# sourceMappingURL=RabbitMQConnection-BKEdCUro.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"RabbitMQConnection-DmMMosT4.cjs","names":["EventPublisherType","config: RabbitMQConnectionConfig","connectionString: string","_err: Error"],"sources":["../src/rabbitmq/RabbitMQConnection.ts"],"sourcesContent":["import amqplib from 'amqplib';\nimport type { EventConnection } from '../types';\nimport { EventPublisherType } from '../types';\n\nexport interface RabbitMQConnectionConfig {\n\turl: string;\n\texchange?: string;\n\texchangeType?: 'topic' | 'direct' | 'fanout' | 'headers';\n\texchangeOptions?: amqplib.Options.AssertExchange;\n\ttimeout?: number; // Connection timeout in milliseconds (default: 5000)\n}\n\nexport class RabbitMQConnection implements EventConnection {\n\treadonly type = EventPublisherType.RabbitMQ;\n\tprivate connection?: amqplib.ChannelModel;\n\tprivate channel?: amqplib.Channel;\n\tprivate connecting?: Promise<void>;\n\tprivate config: Required<\n\t\tPick<RabbitMQConnectionConfig, 'exchange' | 'exchangeType' | 'timeout'>\n\t> &\n\t\tRabbitMQConnectionConfig;\n\n\tconstructor(config: RabbitMQConnectionConfig) {\n\t\tthis.config = {\n\t\t\t...config,\n\t\t\texchange: config.exchange || 'geekmidas.events',\n\t\t\texchangeType: config.exchangeType || 'topic',\n\t\t\ttimeout: config.timeout ?? 5000,\n\t\t\texchangeOptions: {\n\t\t\t\tdurable: true,\n\t\t\t\t...config.exchangeOptions,\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * Create a RabbitMQConnection from a connection string\n\t * Format: rabbitmq://user:pass@host:port/vhost?exchange=name&type=topic&timeout=5000\n\t */\n\tstatic async fromConnectionString(\n\t\tconnectionString: string,\n\t): Promise<RabbitMQConnection> {\n\t\tconst url = new URL(connectionString);\n\t\tconst params = url.searchParams;\n\n\t\t// Extract connection URL without query params\n\t\tconst baseUrl = `amqp://${url.username ? `${url.username}:${url.password}@` : ''}${url.host}${url.pathname}`;\n\n\t\tconst timeoutParam = params.get('timeout');\n\t\tconst config: RabbitMQConnectionConfig = {\n\t\t\turl: baseUrl,\n\t\t\texchange: params.get('exchange') || 'geekmidas.events',\n\t\t\texchangeType: (params.get('type') as any) || 'topic',\n\t\t\ttimeout: timeoutParam ? Number.parseInt(timeoutParam, 10) : undefined,\n\t\t};\n\n\t\tconst connection = new RabbitMQConnection(config);\n\t\tawait connection.connect();\n\t\treturn connection;\n\t}\n\n\tasync connect(): Promise<void> {\n\t\tif (this.channel) return;\n\n\t\t// Prevent multiple simultaneous connection attempts\n\t\tif (this.connecting) {\n\t\t\tawait this.connecting;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.connecting = (async () => {\n\t\t\ttry {\n\t\t\t\tconst connection = await amqplib.connect(this.config.url, {\n\t\t\t\t\ttimeout: this.config.timeout,\n\t\t\t\t});\n\t\t\t\tconst channel = await connection.createChannel();\n\n\t\t\t\t// Assert the exchange exists\n\t\t\t\tawait channel.assertExchange(\n\t\t\t\t\tthis.config.exchange!,\n\t\t\t\t\tthis.config.exchangeType!,\n\t\t\t\t\tthis.config.exchangeOptions,\n\t\t\t\t);\n\n\t\t\t\t// Handle connection errors\n\t\t\t\tconnection.on('error', (_err: Error) => {\n\t\t\t\t\tthis.cleanup();\n\t\t\t\t});\n\n\t\t\t\tconnection.on('close', () => {\n\t\t\t\t\tthis.cleanup();\n\t\t\t\t});\n\n\t\t\t\t// Only set after successful setup\n\t\t\t\tthis.connection = connection;\n\t\t\t\tthis.channel = channel;\n\t\t\t} catch (error) {\n\t\t\t\tthis.cleanup();\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t})();\n\n\t\tawait this.connecting;\n\t\tthis.connecting = undefined;\n\t}\n\n\tasync close(): Promise<void> {\n\t\ttry {\n\t\t\tawait this.channel?.close();\n\t\t\tawait this.connection?.close();\n\t\t} catch (_error) {\n\t\t\t// Ignore errors during close\n\t\t} finally {\n\t\t\tthis.cleanup();\n\t\t}\n\t}\n\n\tisConnected(): boolean {\n\t\treturn !!this.channel;\n\t}\n\n\tprivate cleanup(): void {\n\t\tthis.channel = undefined;\n\t\tthis.connection = undefined;\n\t\tthis.connecting = undefined;\n\t}\n\n\t/**\n\t * Get the underlying channel for publishing/subscribing\n\t */\n\tget amqpChannel(): amqplib.Channel | undefined {\n\t\treturn this.channel;\n\t}\n\n\t/**\n\t * Get the exchange name for this connection\n\t */\n\tget exchangeName(): string {\n\t\treturn this.config.exchange;\n\t}\n\n\t/**\n\t * Get the exchange type for this connection\n\t */\n\tget exchangeType(): string {\n\t\treturn this.config.exchangeType;\n\t}\n}\n"],"mappings":";;;;;AAYA,IAAa,qBAAb,MAAa,mBAA8C;CAC1D,AAAS,OAAOA,iCAAmB;CACnC,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CAKR,YAAYC,QAAkC;AAC7C,OAAK,SAAS;GACb,GAAG;GACH,UAAU,OAAO,YAAY;GAC7B,cAAc,OAAO,gBAAgB;GACrC,SAAS,OAAO,WAAW;GAC3B,iBAAiB;IAChB,SAAS;IACT,GAAG,OAAO;GACV;EACD;CACD;;;;;CAMD,aAAa,qBACZC,kBAC8B;EAC9B,MAAM,MAAM,IAAI,IAAI;EACpB,MAAM,SAAS,IAAI;EAGnB,MAAM,WAAW,SAAS,IAAI,YAAY,EAAE,IAAI,SAAS,GAAG,IAAI,SAAS,KAAK,GAAG,EAAE,IAAI,KAAK,EAAE,IAAI,SAAS;EAE3G,MAAM,eAAe,OAAO,IAAI,UAAU;EAC1C,MAAMD,SAAmC;GACxC,KAAK;GACL,UAAU,OAAO,IAAI,WAAW,IAAI;GACpC,cAAe,OAAO,IAAI,OAAO,IAAY;GAC7C,SAAS,eAAe,OAAO,SAAS,cAAc,GAAG;EACzD;EAED,MAAM,aAAa,IAAI,mBAAmB;AAC1C,QAAM,WAAW,SAAS;AAC1B,SAAO;CACP;CAED,MAAM,UAAyB;AAC9B,MAAI,KAAK,QAAS;AAGlB,MAAI,KAAK,YAAY;AACpB,SAAM,KAAK;AACX;EACA;AAED,OAAK,aAAa,CAAC,YAAY;AAC9B,OAAI;IACH,MAAM,aAAa,MAAM,gBAAQ,QAAQ,KAAK,OAAO,KAAK,EACzD,SAAS,KAAK,OAAO,QACrB,EAAC;IACF,MAAM,UAAU,MAAM,WAAW,eAAe;AAGhD,UAAM,QAAQ,eACb,KAAK,OAAO,UACZ,KAAK,OAAO,cACZ,KAAK,OAAO,gBACZ;AAGD,eAAW,GAAG,SAAS,CAACE,SAAgB;AACvC,UAAK,SAAS;IACd,EAAC;AAEF,eAAW,GAAG,SAAS,MAAM;AAC5B,UAAK,SAAS;IACd,EAAC;AAGF,SAAK,aAAa;AAClB,SAAK,UAAU;GACf,SAAQ,OAAO;AACf,SAAK,SAAS;AACd,UAAM;GACN;EACD,IAAG;AAEJ,QAAM,KAAK;AACX,OAAK;CACL;CAED,MAAM,QAAuB;AAC5B,MAAI;AACH,SAAM,KAAK,SAAS,OAAO;AAC3B,SAAM,KAAK,YAAY,OAAO;EAC9B,SAAQ,QAAQ,CAEhB,UAAS;AACT,QAAK,SAAS;EACd;CACD;CAED,cAAuB;AACtB,WAAS,KAAK;CACd;CAED,AAAQ,UAAgB;AACvB,OAAK;AACL,OAAK;AACL,OAAK;CACL;;;;CAKD,IAAI,cAA2C;AAC9C,SAAO,KAAK;CACZ;;;;CAKD,IAAI,eAAuB;AAC1B,SAAO,KAAK,OAAO;CACnB;;;;CAKD,IAAI,eAAuB;AAC1B,SAAO,KAAK,OAAO;CACnB;AACD"}
1
+ {"version":3,"file":"RabbitMQConnection-BKEdCUro.cjs","names":["EventPublisherType","config: RabbitMQConnectionConfig","connectionString: string","_err: Error"],"sources":["../src/rabbitmq/RabbitMQConnection.ts"],"sourcesContent":["import amqplib from 'amqplib';\nimport type { EventConnection } from '../types';\nimport { EventPublisherType } from '../types';\n\nexport interface RabbitMQConnectionConfig {\n\turl: string;\n\texchange?: string;\n\texchangeType?: 'topic' | 'direct' | 'fanout' | 'headers';\n\texchangeOptions?: amqplib.Options.AssertExchange;\n\ttimeout?: number; // Connection timeout in milliseconds (default: 5000)\n}\n\nexport class RabbitMQConnection implements EventConnection {\n\treadonly type = EventPublisherType.RabbitMQ;\n\tprivate connection?: amqplib.ChannelModel;\n\tprivate channel?: amqplib.Channel;\n\tprivate connecting?: Promise<void>;\n\tprivate config: Required<\n\t\tPick<RabbitMQConnectionConfig, 'exchange' | 'exchangeType' | 'timeout'>\n\t> &\n\t\tRabbitMQConnectionConfig;\n\n\tconstructor(config: RabbitMQConnectionConfig) {\n\t\tthis.config = {\n\t\t\t...config,\n\t\t\texchange: config.exchange || 'geekmidas.events',\n\t\t\texchangeType: config.exchangeType || 'topic',\n\t\t\ttimeout: config.timeout ?? 5000,\n\t\t\texchangeOptions: {\n\t\t\t\tdurable: true,\n\t\t\t\t...config.exchangeOptions,\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * Create a RabbitMQConnection from a connection string\n\t * Format: rabbitmq://user:pass@host:port/vhost?exchange=name&type=topic&timeout=5000\n\t */\n\tstatic async fromConnectionString(\n\t\tconnectionString: string,\n\t): Promise<RabbitMQConnection> {\n\t\tconst url = new URL(connectionString);\n\t\tconst params = url.searchParams;\n\n\t\t// Extract connection URL without query params\n\t\tconst baseUrl = `amqp://${url.username ? `${url.username}:${url.password}@` : ''}${url.host}${url.pathname}`;\n\n\t\tconst timeoutParam = params.get('timeout');\n\t\tconst config: RabbitMQConnectionConfig = {\n\t\t\turl: baseUrl,\n\t\t\texchange: params.get('exchange') || 'geekmidas.events',\n\t\t\texchangeType: (params.get('type') as any) || 'topic',\n\t\t\ttimeout: timeoutParam ? Number.parseInt(timeoutParam, 10) : undefined,\n\t\t};\n\n\t\tconst connection = new RabbitMQConnection(config);\n\t\tawait connection.connect();\n\t\treturn connection;\n\t}\n\n\tasync connect(): Promise<void> {\n\t\tif (this.channel) return;\n\n\t\t// Prevent multiple simultaneous connection attempts\n\t\tif (this.connecting) {\n\t\t\tawait this.connecting;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.connecting = (async () => {\n\t\t\ttry {\n\t\t\t\tconst connection = await amqplib.connect(this.config.url, {\n\t\t\t\t\ttimeout: this.config.timeout,\n\t\t\t\t});\n\t\t\t\tconst channel = await connection.createChannel();\n\n\t\t\t\t// Assert the exchange exists\n\t\t\t\tawait channel.assertExchange(\n\t\t\t\t\tthis.config.exchange!,\n\t\t\t\t\tthis.config.exchangeType!,\n\t\t\t\t\tthis.config.exchangeOptions,\n\t\t\t\t);\n\n\t\t\t\t// Handle connection errors\n\t\t\t\tconnection.on('error', (_err: Error) => {\n\t\t\t\t\tthis.cleanup();\n\t\t\t\t});\n\n\t\t\t\tconnection.on('close', () => {\n\t\t\t\t\tthis.cleanup();\n\t\t\t\t});\n\n\t\t\t\t// Only set after successful setup\n\t\t\t\tthis.connection = connection;\n\t\t\t\tthis.channel = channel;\n\t\t\t} catch (error) {\n\t\t\t\tthis.cleanup();\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t})();\n\n\t\tawait this.connecting;\n\t\tthis.connecting = undefined;\n\t}\n\n\tasync close(): Promise<void> {\n\t\ttry {\n\t\t\tawait this.channel?.close();\n\t\t\tawait this.connection?.close();\n\t\t} catch (_error) {\n\t\t\t// Ignore errors during close\n\t\t} finally {\n\t\t\tthis.cleanup();\n\t\t}\n\t}\n\n\tisConnected(): boolean {\n\t\treturn !!this.channel;\n\t}\n\n\tprivate cleanup(): void {\n\t\tthis.channel = undefined;\n\t\tthis.connection = undefined;\n\t\tthis.connecting = undefined;\n\t}\n\n\t/**\n\t * Get the underlying channel for publishing/subscribing\n\t */\n\tget amqpChannel(): amqplib.Channel | undefined {\n\t\treturn this.channel;\n\t}\n\n\t/**\n\t * Get the exchange name for this connection\n\t */\n\tget exchangeName(): string {\n\t\treturn this.config.exchange;\n\t}\n\n\t/**\n\t * Get the exchange type for this connection\n\t */\n\tget exchangeType(): string {\n\t\treturn this.config.exchangeType;\n\t}\n}\n"],"mappings":";;;;;AAYA,IAAa,qBAAb,MAAa,mBAA8C;CAC1D,AAAS,OAAOA,iCAAmB;CACnC,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CAKR,YAAYC,QAAkC;AAC7C,OAAK,SAAS;GACb,GAAG;GACH,UAAU,OAAO,YAAY;GAC7B,cAAc,OAAO,gBAAgB;GACrC,SAAS,OAAO,WAAW;GAC3B,iBAAiB;IAChB,SAAS;IACT,GAAG,OAAO;GACV;EACD;CACD;;;;;CAMD,aAAa,qBACZC,kBAC8B;EAC9B,MAAM,MAAM,IAAI,IAAI;EACpB,MAAM,SAAS,IAAI;EAGnB,MAAM,WAAW,SAAS,IAAI,YAAY,EAAE,IAAI,SAAS,GAAG,IAAI,SAAS,KAAK,GAAG,EAAE,IAAI,KAAK,EAAE,IAAI,SAAS;EAE3G,MAAM,eAAe,OAAO,IAAI,UAAU;EAC1C,MAAMD,SAAmC;GACxC,KAAK;GACL,UAAU,OAAO,IAAI,WAAW,IAAI;GACpC,cAAe,OAAO,IAAI,OAAO,IAAY;GAC7C,SAAS,eAAe,OAAO,SAAS,cAAc,GAAG;EACzD;EAED,MAAM,aAAa,IAAI,mBAAmB;AAC1C,QAAM,WAAW,SAAS;AAC1B,SAAO;CACP;CAED,MAAM,UAAyB;AAC9B,MAAI,KAAK,QAAS;AAGlB,MAAI,KAAK,YAAY;AACpB,SAAM,KAAK;AACX;EACA;AAED,OAAK,aAAa,CAAC,YAAY;AAC9B,OAAI;IACH,MAAM,aAAa,MAAM,gBAAQ,QAAQ,KAAK,OAAO,KAAK,EACzD,SAAS,KAAK,OAAO,QACrB,EAAC;IACF,MAAM,UAAU,MAAM,WAAW,eAAe;AAGhD,UAAM,QAAQ,eACb,KAAK,OAAO,UACZ,KAAK,OAAO,cACZ,KAAK,OAAO,gBACZ;AAGD,eAAW,GAAG,SAAS,CAACE,SAAgB;AACvC,UAAK,SAAS;IACd,EAAC;AAEF,eAAW,GAAG,SAAS,MAAM;AAC5B,UAAK,SAAS;IACd,EAAC;AAGF,SAAK,aAAa;AAClB,SAAK,UAAU;GACf,SAAQ,OAAO;AACf,SAAK,SAAS;AACd,UAAM;GACN;EACD,IAAG;AAEJ,QAAM,KAAK;AACX,OAAK;CACL;CAED,MAAM,QAAuB;AAC5B,MAAI;AACH,SAAM,KAAK,SAAS,OAAO;AAC3B,SAAM,KAAK,YAAY,OAAO;EAC9B,SAAQ,QAAQ,CAEhB,UAAS;AACT,QAAK,SAAS;EACd;CACD;CAED,cAAuB;AACtB,WAAS,KAAK;CACd;CAED,AAAQ,UAAgB;AACvB,OAAK;AACL,OAAK;AACL,OAAK;CACL;;;;CAKD,IAAI,cAA2C;AAC9C,SAAO,KAAK;CACZ;;;;CAKD,IAAI,eAAuB;AAC1B,SAAO,KAAK,OAAO;CACnB;;;;CAKD,IAAI,eAAuB;AAC1B,SAAO,KAAK,OAAO;CACnB;AACD"}
@@ -0,0 +1,4 @@
1
+ require('./types-Byv8N9ma.cjs');
2
+ const require_RabbitMQConnection = require('./RabbitMQConnection-BKEdCUro.cjs');
3
+
4
+ exports.RabbitMQConnection = require_RabbitMQConnection.RabbitMQConnection;
@@ -0,0 +1,4 @@
1
+ import "./types-CYDt-2RQ.mjs";
2
+ import { RabbitMQConnection } from "./RabbitMQConnection-DJgUPc19.mjs";
3
+
4
+ export { RabbitMQConnection };
@@ -1,4 +1,4 @@
1
- import { EventPublisherType } from "./types-BrdcSEnd.mjs";
1
+ import { EventPublisherType } from "./types-CYDt-2RQ.mjs";
2
2
  import amqplib from "amqplib";
3
3
 
4
4
  //#region src/rabbitmq/RabbitMQConnection.ts
@@ -104,4 +104,4 @@ var RabbitMQConnection = class RabbitMQConnection {
104
104
 
105
105
  //#endregion
106
106
  export { RabbitMQConnection };
107
- //# sourceMappingURL=RabbitMQConnection-BtKZjtZY.mjs.map
107
+ //# sourceMappingURL=RabbitMQConnection-DJgUPc19.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"RabbitMQConnection-BtKZjtZY.mjs","names":["config: RabbitMQConnectionConfig","connectionString: string","_err: Error"],"sources":["../src/rabbitmq/RabbitMQConnection.ts"],"sourcesContent":["import amqplib from 'amqplib';\nimport type { EventConnection } from '../types';\nimport { EventPublisherType } from '../types';\n\nexport interface RabbitMQConnectionConfig {\n\turl: string;\n\texchange?: string;\n\texchangeType?: 'topic' | 'direct' | 'fanout' | 'headers';\n\texchangeOptions?: amqplib.Options.AssertExchange;\n\ttimeout?: number; // Connection timeout in milliseconds (default: 5000)\n}\n\nexport class RabbitMQConnection implements EventConnection {\n\treadonly type = EventPublisherType.RabbitMQ;\n\tprivate connection?: amqplib.ChannelModel;\n\tprivate channel?: amqplib.Channel;\n\tprivate connecting?: Promise<void>;\n\tprivate config: Required<\n\t\tPick<RabbitMQConnectionConfig, 'exchange' | 'exchangeType' | 'timeout'>\n\t> &\n\t\tRabbitMQConnectionConfig;\n\n\tconstructor(config: RabbitMQConnectionConfig) {\n\t\tthis.config = {\n\t\t\t...config,\n\t\t\texchange: config.exchange || 'geekmidas.events',\n\t\t\texchangeType: config.exchangeType || 'topic',\n\t\t\ttimeout: config.timeout ?? 5000,\n\t\t\texchangeOptions: {\n\t\t\t\tdurable: true,\n\t\t\t\t...config.exchangeOptions,\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * Create a RabbitMQConnection from a connection string\n\t * Format: rabbitmq://user:pass@host:port/vhost?exchange=name&type=topic&timeout=5000\n\t */\n\tstatic async fromConnectionString(\n\t\tconnectionString: string,\n\t): Promise<RabbitMQConnection> {\n\t\tconst url = new URL(connectionString);\n\t\tconst params = url.searchParams;\n\n\t\t// Extract connection URL without query params\n\t\tconst baseUrl = `amqp://${url.username ? `${url.username}:${url.password}@` : ''}${url.host}${url.pathname}`;\n\n\t\tconst timeoutParam = params.get('timeout');\n\t\tconst config: RabbitMQConnectionConfig = {\n\t\t\turl: baseUrl,\n\t\t\texchange: params.get('exchange') || 'geekmidas.events',\n\t\t\texchangeType: (params.get('type') as any) || 'topic',\n\t\t\ttimeout: timeoutParam ? Number.parseInt(timeoutParam, 10) : undefined,\n\t\t};\n\n\t\tconst connection = new RabbitMQConnection(config);\n\t\tawait connection.connect();\n\t\treturn connection;\n\t}\n\n\tasync connect(): Promise<void> {\n\t\tif (this.channel) return;\n\n\t\t// Prevent multiple simultaneous connection attempts\n\t\tif (this.connecting) {\n\t\t\tawait this.connecting;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.connecting = (async () => {\n\t\t\ttry {\n\t\t\t\tconst connection = await amqplib.connect(this.config.url, {\n\t\t\t\t\ttimeout: this.config.timeout,\n\t\t\t\t});\n\t\t\t\tconst channel = await connection.createChannel();\n\n\t\t\t\t// Assert the exchange exists\n\t\t\t\tawait channel.assertExchange(\n\t\t\t\t\tthis.config.exchange!,\n\t\t\t\t\tthis.config.exchangeType!,\n\t\t\t\t\tthis.config.exchangeOptions,\n\t\t\t\t);\n\n\t\t\t\t// Handle connection errors\n\t\t\t\tconnection.on('error', (_err: Error) => {\n\t\t\t\t\tthis.cleanup();\n\t\t\t\t});\n\n\t\t\t\tconnection.on('close', () => {\n\t\t\t\t\tthis.cleanup();\n\t\t\t\t});\n\n\t\t\t\t// Only set after successful setup\n\t\t\t\tthis.connection = connection;\n\t\t\t\tthis.channel = channel;\n\t\t\t} catch (error) {\n\t\t\t\tthis.cleanup();\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t})();\n\n\t\tawait this.connecting;\n\t\tthis.connecting = undefined;\n\t}\n\n\tasync close(): Promise<void> {\n\t\ttry {\n\t\t\tawait this.channel?.close();\n\t\t\tawait this.connection?.close();\n\t\t} catch (_error) {\n\t\t\t// Ignore errors during close\n\t\t} finally {\n\t\t\tthis.cleanup();\n\t\t}\n\t}\n\n\tisConnected(): boolean {\n\t\treturn !!this.channel;\n\t}\n\n\tprivate cleanup(): void {\n\t\tthis.channel = undefined;\n\t\tthis.connection = undefined;\n\t\tthis.connecting = undefined;\n\t}\n\n\t/**\n\t * Get the underlying channel for publishing/subscribing\n\t */\n\tget amqpChannel(): amqplib.Channel | undefined {\n\t\treturn this.channel;\n\t}\n\n\t/**\n\t * Get the exchange name for this connection\n\t */\n\tget exchangeName(): string {\n\t\treturn this.config.exchange;\n\t}\n\n\t/**\n\t * Get the exchange type for this connection\n\t */\n\tget exchangeType(): string {\n\t\treturn this.config.exchangeType;\n\t}\n}\n"],"mappings":";;;;AAYA,IAAa,qBAAb,MAAa,mBAA8C;CAC1D,AAAS,OAAO,mBAAmB;CACnC,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CAKR,YAAYA,QAAkC;AAC7C,OAAK,SAAS;GACb,GAAG;GACH,UAAU,OAAO,YAAY;GAC7B,cAAc,OAAO,gBAAgB;GACrC,SAAS,OAAO,WAAW;GAC3B,iBAAiB;IAChB,SAAS;IACT,GAAG,OAAO;GACV;EACD;CACD;;;;;CAMD,aAAa,qBACZC,kBAC8B;EAC9B,MAAM,MAAM,IAAI,IAAI;EACpB,MAAM,SAAS,IAAI;EAGnB,MAAM,WAAW,SAAS,IAAI,YAAY,EAAE,IAAI,SAAS,GAAG,IAAI,SAAS,KAAK,GAAG,EAAE,IAAI,KAAK,EAAE,IAAI,SAAS;EAE3G,MAAM,eAAe,OAAO,IAAI,UAAU;EAC1C,MAAMD,SAAmC;GACxC,KAAK;GACL,UAAU,OAAO,IAAI,WAAW,IAAI;GACpC,cAAe,OAAO,IAAI,OAAO,IAAY;GAC7C,SAAS,eAAe,OAAO,SAAS,cAAc,GAAG;EACzD;EAED,MAAM,aAAa,IAAI,mBAAmB;AAC1C,QAAM,WAAW,SAAS;AAC1B,SAAO;CACP;CAED,MAAM,UAAyB;AAC9B,MAAI,KAAK,QAAS;AAGlB,MAAI,KAAK,YAAY;AACpB,SAAM,KAAK;AACX;EACA;AAED,OAAK,aAAa,CAAC,YAAY;AAC9B,OAAI;IACH,MAAM,aAAa,MAAM,QAAQ,QAAQ,KAAK,OAAO,KAAK,EACzD,SAAS,KAAK,OAAO,QACrB,EAAC;IACF,MAAM,UAAU,MAAM,WAAW,eAAe;AAGhD,UAAM,QAAQ,eACb,KAAK,OAAO,UACZ,KAAK,OAAO,cACZ,KAAK,OAAO,gBACZ;AAGD,eAAW,GAAG,SAAS,CAACE,SAAgB;AACvC,UAAK,SAAS;IACd,EAAC;AAEF,eAAW,GAAG,SAAS,MAAM;AAC5B,UAAK,SAAS;IACd,EAAC;AAGF,SAAK,aAAa;AAClB,SAAK,UAAU;GACf,SAAQ,OAAO;AACf,SAAK,SAAS;AACd,UAAM;GACN;EACD,IAAG;AAEJ,QAAM,KAAK;AACX,OAAK;CACL;CAED,MAAM,QAAuB;AAC5B,MAAI;AACH,SAAM,KAAK,SAAS,OAAO;AAC3B,SAAM,KAAK,YAAY,OAAO;EAC9B,SAAQ,QAAQ,CAEhB,UAAS;AACT,QAAK,SAAS;EACd;CACD;CAED,cAAuB;AACtB,WAAS,KAAK;CACd;CAED,AAAQ,UAAgB;AACvB,OAAK;AACL,OAAK;AACL,OAAK;CACL;;;;CAKD,IAAI,cAA2C;AAC9C,SAAO,KAAK;CACZ;;;;CAKD,IAAI,eAAuB;AAC1B,SAAO,KAAK,OAAO;CACnB;;;;CAKD,IAAI,eAAuB;AAC1B,SAAO,KAAK,OAAO;CACnB;AACD"}
1
+ {"version":3,"file":"RabbitMQConnection-DJgUPc19.mjs","names":["config: RabbitMQConnectionConfig","connectionString: string","_err: Error"],"sources":["../src/rabbitmq/RabbitMQConnection.ts"],"sourcesContent":["import amqplib from 'amqplib';\nimport type { EventConnection } from '../types';\nimport { EventPublisherType } from '../types';\n\nexport interface RabbitMQConnectionConfig {\n\turl: string;\n\texchange?: string;\n\texchangeType?: 'topic' | 'direct' | 'fanout' | 'headers';\n\texchangeOptions?: amqplib.Options.AssertExchange;\n\ttimeout?: number; // Connection timeout in milliseconds (default: 5000)\n}\n\nexport class RabbitMQConnection implements EventConnection {\n\treadonly type = EventPublisherType.RabbitMQ;\n\tprivate connection?: amqplib.ChannelModel;\n\tprivate channel?: amqplib.Channel;\n\tprivate connecting?: Promise<void>;\n\tprivate config: Required<\n\t\tPick<RabbitMQConnectionConfig, 'exchange' | 'exchangeType' | 'timeout'>\n\t> &\n\t\tRabbitMQConnectionConfig;\n\n\tconstructor(config: RabbitMQConnectionConfig) {\n\t\tthis.config = {\n\t\t\t...config,\n\t\t\texchange: config.exchange || 'geekmidas.events',\n\t\t\texchangeType: config.exchangeType || 'topic',\n\t\t\ttimeout: config.timeout ?? 5000,\n\t\t\texchangeOptions: {\n\t\t\t\tdurable: true,\n\t\t\t\t...config.exchangeOptions,\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * Create a RabbitMQConnection from a connection string\n\t * Format: rabbitmq://user:pass@host:port/vhost?exchange=name&type=topic&timeout=5000\n\t */\n\tstatic async fromConnectionString(\n\t\tconnectionString: string,\n\t): Promise<RabbitMQConnection> {\n\t\tconst url = new URL(connectionString);\n\t\tconst params = url.searchParams;\n\n\t\t// Extract connection URL without query params\n\t\tconst baseUrl = `amqp://${url.username ? `${url.username}:${url.password}@` : ''}${url.host}${url.pathname}`;\n\n\t\tconst timeoutParam = params.get('timeout');\n\t\tconst config: RabbitMQConnectionConfig = {\n\t\t\turl: baseUrl,\n\t\t\texchange: params.get('exchange') || 'geekmidas.events',\n\t\t\texchangeType: (params.get('type') as any) || 'topic',\n\t\t\ttimeout: timeoutParam ? Number.parseInt(timeoutParam, 10) : undefined,\n\t\t};\n\n\t\tconst connection = new RabbitMQConnection(config);\n\t\tawait connection.connect();\n\t\treturn connection;\n\t}\n\n\tasync connect(): Promise<void> {\n\t\tif (this.channel) return;\n\n\t\t// Prevent multiple simultaneous connection attempts\n\t\tif (this.connecting) {\n\t\t\tawait this.connecting;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.connecting = (async () => {\n\t\t\ttry {\n\t\t\t\tconst connection = await amqplib.connect(this.config.url, {\n\t\t\t\t\ttimeout: this.config.timeout,\n\t\t\t\t});\n\t\t\t\tconst channel = await connection.createChannel();\n\n\t\t\t\t// Assert the exchange exists\n\t\t\t\tawait channel.assertExchange(\n\t\t\t\t\tthis.config.exchange!,\n\t\t\t\t\tthis.config.exchangeType!,\n\t\t\t\t\tthis.config.exchangeOptions,\n\t\t\t\t);\n\n\t\t\t\t// Handle connection errors\n\t\t\t\tconnection.on('error', (_err: Error) => {\n\t\t\t\t\tthis.cleanup();\n\t\t\t\t});\n\n\t\t\t\tconnection.on('close', () => {\n\t\t\t\t\tthis.cleanup();\n\t\t\t\t});\n\n\t\t\t\t// Only set after successful setup\n\t\t\t\tthis.connection = connection;\n\t\t\t\tthis.channel = channel;\n\t\t\t} catch (error) {\n\t\t\t\tthis.cleanup();\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t})();\n\n\t\tawait this.connecting;\n\t\tthis.connecting = undefined;\n\t}\n\n\tasync close(): Promise<void> {\n\t\ttry {\n\t\t\tawait this.channel?.close();\n\t\t\tawait this.connection?.close();\n\t\t} catch (_error) {\n\t\t\t// Ignore errors during close\n\t\t} finally {\n\t\t\tthis.cleanup();\n\t\t}\n\t}\n\n\tisConnected(): boolean {\n\t\treturn !!this.channel;\n\t}\n\n\tprivate cleanup(): void {\n\t\tthis.channel = undefined;\n\t\tthis.connection = undefined;\n\t\tthis.connecting = undefined;\n\t}\n\n\t/**\n\t * Get the underlying channel for publishing/subscribing\n\t */\n\tget amqpChannel(): amqplib.Channel | undefined {\n\t\treturn this.channel;\n\t}\n\n\t/**\n\t * Get the exchange name for this connection\n\t */\n\tget exchangeName(): string {\n\t\treturn this.config.exchange;\n\t}\n\n\t/**\n\t * Get the exchange type for this connection\n\t */\n\tget exchangeType(): string {\n\t\treturn this.config.exchangeType;\n\t}\n}\n"],"mappings":";;;;AAYA,IAAa,qBAAb,MAAa,mBAA8C;CAC1D,AAAS,OAAO,mBAAmB;CACnC,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CAKR,YAAYA,QAAkC;AAC7C,OAAK,SAAS;GACb,GAAG;GACH,UAAU,OAAO,YAAY;GAC7B,cAAc,OAAO,gBAAgB;GACrC,SAAS,OAAO,WAAW;GAC3B,iBAAiB;IAChB,SAAS;IACT,GAAG,OAAO;GACV;EACD;CACD;;;;;CAMD,aAAa,qBACZC,kBAC8B;EAC9B,MAAM,MAAM,IAAI,IAAI;EACpB,MAAM,SAAS,IAAI;EAGnB,MAAM,WAAW,SAAS,IAAI,YAAY,EAAE,IAAI,SAAS,GAAG,IAAI,SAAS,KAAK,GAAG,EAAE,IAAI,KAAK,EAAE,IAAI,SAAS;EAE3G,MAAM,eAAe,OAAO,IAAI,UAAU;EAC1C,MAAMD,SAAmC;GACxC,KAAK;GACL,UAAU,OAAO,IAAI,WAAW,IAAI;GACpC,cAAe,OAAO,IAAI,OAAO,IAAY;GAC7C,SAAS,eAAe,OAAO,SAAS,cAAc,GAAG;EACzD;EAED,MAAM,aAAa,IAAI,mBAAmB;AAC1C,QAAM,WAAW,SAAS;AAC1B,SAAO;CACP;CAED,MAAM,UAAyB;AAC9B,MAAI,KAAK,QAAS;AAGlB,MAAI,KAAK,YAAY;AACpB,SAAM,KAAK;AACX;EACA;AAED,OAAK,aAAa,CAAC,YAAY;AAC9B,OAAI;IACH,MAAM,aAAa,MAAM,QAAQ,QAAQ,KAAK,OAAO,KAAK,EACzD,SAAS,KAAK,OAAO,QACrB,EAAC;IACF,MAAM,UAAU,MAAM,WAAW,eAAe;AAGhD,UAAM,QAAQ,eACb,KAAK,OAAO,UACZ,KAAK,OAAO,cACZ,KAAK,OAAO,gBACZ;AAGD,eAAW,GAAG,SAAS,CAACE,SAAgB;AACvC,UAAK,SAAS;IACd,EAAC;AAEF,eAAW,GAAG,SAAS,MAAM;AAC5B,UAAK,SAAS;IACd,EAAC;AAGF,SAAK,aAAa;AAClB,SAAK,UAAU;GACf,SAAQ,OAAO;AACf,SAAK,SAAS;AACd,UAAM;GACN;EACD,IAAG;AAEJ,QAAM,KAAK;AACX,OAAK;CACL;CAED,MAAM,QAAuB;AAC5B,MAAI;AACH,SAAM,KAAK,SAAS,OAAO;AAC3B,SAAM,KAAK,YAAY,OAAO;EAC9B,SAAQ,QAAQ,CAEhB,UAAS;AACT,QAAK,SAAS;EACd;CACD;CAED,cAAuB;AACtB,WAAS,KAAK;CACd;CAED,AAAQ,UAAgB;AACvB,OAAK;AACL,OAAK;AACL,OAAK;CACL;;;;CAKD,IAAI,cAA2C;AAC9C,SAAO,KAAK;CACZ;;;;CAKD,IAAI,eAAuB;AAC1B,SAAO,KAAK,OAAO;CACnB;;;;CAKD,IAAI,eAAuB;AAC1B,SAAO,KAAK,OAAO;CACnB;AACD"}
@@ -1,5 +1,6 @@
1
- const require_chunk = require('./chunk-CUT6urMc.cjs');
1
+ const require_chunk = require('./chunk-CsX-DzYB.cjs');
2
2
  const require_types = require('./types-Byv8N9ma.cjs');
3
+ const require_snsUrl = require('./snsUrl-f2gU3CzK.cjs');
3
4
  const __aws_sdk_client_sns = require_chunk.__toESM(require("@aws-sdk/client-sns"));
4
5
 
5
6
  //#region src/sns/SNSConnection.ts
@@ -22,14 +23,12 @@ var SNSConnection = class SNSConnection {
22
23
  * Format: sns://?topicArn=arn:aws:sns:region:account:topic&region=us-east-1&endpoint=http://localhost:4566
23
24
  */
24
25
  static async fromConnectionString(connectionString) {
25
- const url = new URL(connectionString);
26
- const params = url.searchParams;
27
- const topicArn = params.get("topicArn");
28
- if (!topicArn) throw new Error("topicArn parameter is required in connection string");
26
+ const { topicArn, region, endpoint } = require_snsUrl.parse(connectionString);
27
+ const params = new URL(connectionString).searchParams;
29
28
  const config = {
30
29
  topicArn,
31
- region: params.get("region") || void 0,
32
- endpoint: params.get("endpoint") || void 0
30
+ region,
31
+ endpoint
33
32
  };
34
33
  const accessKeyId = params.get("accessKeyId");
35
34
  const secretAccessKey = params.get("secretAccessKey");
@@ -73,4 +72,4 @@ Object.defineProperty(exports, 'SNSConnection', {
73
72
  return SNSConnection;
74
73
  }
75
74
  });
76
- //# sourceMappingURL=SNSConnection-CAcbLQOy.cjs.map
75
+ //# sourceMappingURL=SNSConnection-B2K86hpz.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SNSConnection-B2K86hpz.cjs","names":["EventPublisherType","config: SNSConnectionConfig","clientConfig: SNSClientConfig","SNSClient","connectionString: string"],"sources":["../src/sns/SNSConnection.ts"],"sourcesContent":["import { SNSClient, type SNSClientConfig } from '@aws-sdk/client-sns';\nimport type { EventConnection } from '../types';\nimport { EventPublisherType } from '../types';\nimport * as snsUrl from './snsUrl';\n\nexport interface SNSConnectionConfig {\n\ttopicArn: string;\n\tregion?: string;\n\tendpoint?: string; // Custom endpoint (e.g., for LocalStack)\n\tcredentials?: {\n\t\taccessKeyId: string;\n\t\tsecretAccessKey: string;\n\t\tsessionToken?: string;\n\t};\n}\n\nexport class SNSConnection implements EventConnection {\n\treadonly type = EventPublisherType.SNS;\n\tprivate client: SNSClient;\n\tprivate connected = false;\n\tprivate config: SNSConnectionConfig;\n\n\tconstructor(config: SNSConnectionConfig) {\n\t\tthis.config = config;\n\n\t\tconst clientConfig: SNSClientConfig = {\n\t\t\tregion: config.region,\n\t\t\tendpoint: config.endpoint,\n\t\t\tcredentials: config.credentials,\n\t\t};\n\n\t\tthis.client = new SNSClient(clientConfig);\n\t}\n\n\t/**\n\t * Create an SNSConnection from a connection string\n\t * Format: sns://?topicArn=arn:aws:sns:region:account:topic&region=us-east-1&endpoint=http://localhost:4566\n\t */\n\tstatic async fromConnectionString(\n\t\tconnectionString: string,\n\t): Promise<SNSConnection> {\n\t\t// Through the codec, not a second hand-rolled parse: the deploy target\n\t\t// composes these with `snsUrl.build`, and a string it cannot read back is\n\t\t// exactly the drift one shared module rules out.\n\t\tconst { topicArn, region, endpoint } = snsUrl.parse(connectionString);\n\t\tconst params = new URL(connectionString).searchParams;\n\n\t\tconst config: SNSConnectionConfig = {\n\t\t\ttopicArn,\n\t\t\tregion,\n\t\t\tendpoint,\n\t\t};\n\n\t\t// Credentials are not part of the address — see `snsUrl` — but a caller\n\t\t// may still pin them here, so they are read beside it rather than in it.\n\t\tconst accessKeyId = params.get('accessKeyId');\n\t\tconst secretAccessKey = params.get('secretAccessKey');\n\t\tif (accessKeyId && secretAccessKey) {\n\t\t\tconfig.credentials = {\n\t\t\t\taccessKeyId,\n\t\t\t\tsecretAccessKey,\n\t\t\t\tsessionToken: params.get('sessionToken') || undefined,\n\t\t\t};\n\t\t}\n\n\t\tconst connection = new SNSConnection(config);\n\t\tawait connection.connect();\n\t\treturn connection;\n\t}\n\n\tasync connect(): Promise<void> {\n\t\t// SNS doesn't have a traditional connection, but we mark as connected\n\t\tthis.connected = true;\n\t}\n\n\tasync close(): Promise<void> {\n\t\tthis.client.destroy();\n\t\tthis.connected = false;\n\t}\n\n\tisConnected(): boolean {\n\t\treturn this.connected;\n\t}\n\n\t/**\n\t * Get the underlying SNS client\n\t */\n\tget snsClient(): SNSClient {\n\t\treturn this.client;\n\t}\n\n\t/**\n\t * Get the topic ARN for this connection\n\t */\n\tget topicArn(): string {\n\t\treturn this.config.topicArn;\n\t}\n}\n"],"mappings":";;;;;;AAgBA,IAAa,gBAAb,MAAa,cAAyC;CACrD,AAAS,OAAOA,iCAAmB;CACnC,AAAQ;CACR,AAAQ,YAAY;CACpB,AAAQ;CAER,YAAYC,QAA6B;AACxC,OAAK,SAAS;EAEd,MAAMC,eAAgC;GACrC,QAAQ,OAAO;GACf,UAAU,OAAO;GACjB,aAAa,OAAO;EACpB;AAED,OAAK,SAAS,IAAIC,+BAAU;CAC5B;;;;;CAMD,aAAa,qBACZC,kBACyB;EAIzB,MAAM,EAAE,UAAU,QAAQ,UAAU,GAAG,qBAAa,iBAAiB;EACrE,MAAM,SAAS,IAAI,IAAI,kBAAkB;EAEzC,MAAMH,SAA8B;GACnC;GACA;GACA;EACA;EAID,MAAM,cAAc,OAAO,IAAI,cAAc;EAC7C,MAAM,kBAAkB,OAAO,IAAI,kBAAkB;AACrD,MAAI,eAAe,gBAClB,QAAO,cAAc;GACpB;GACA;GACA,cAAc,OAAO,IAAI,eAAe;EACxC;EAGF,MAAM,aAAa,IAAI,cAAc;AACrC,QAAM,WAAW,SAAS;AAC1B,SAAO;CACP;CAED,MAAM,UAAyB;AAE9B,OAAK,YAAY;CACjB;CAED,MAAM,QAAuB;AAC5B,OAAK,OAAO,SAAS;AACrB,OAAK,YAAY;CACjB;CAED,cAAuB;AACtB,SAAO,KAAK;CACZ;;;;CAKD,IAAI,YAAuB;AAC1B,SAAO,KAAK;CACZ;;;;CAKD,IAAI,WAAmB;AACtB,SAAO,KAAK,OAAO;CACnB;AACD"}
@@ -0,0 +1,5 @@
1
+ import "./types-CYDt-2RQ.mjs";
2
+ import "./snsUrl-CifYhPAa.mjs";
3
+ import { SNSConnection } from "./SNSConnection-v9jjF99w.mjs";
4
+
5
+ export { SNSConnection };
@@ -0,0 +1,5 @@
1
+ require('./types-Byv8N9ma.cjs');
2
+ require('./snsUrl-f2gU3CzK.cjs');
3
+ const require_SNSConnection = require('./SNSConnection-B2K86hpz.cjs');
4
+
5
+ exports.SNSConnection = require_SNSConnection.SNSConnection;
@@ -1,4 +1,5 @@
1
- import { EventPublisherType } from "./types-BrdcSEnd.mjs";
1
+ import { EventPublisherType } from "./types-CYDt-2RQ.mjs";
2
+ import { parse } from "./snsUrl-CifYhPAa.mjs";
2
3
  import { SNSClient } from "@aws-sdk/client-sns";
3
4
 
4
5
  //#region src/sns/SNSConnection.ts
@@ -21,14 +22,12 @@ var SNSConnection = class SNSConnection {
21
22
  * Format: sns://?topicArn=arn:aws:sns:region:account:topic&region=us-east-1&endpoint=http://localhost:4566
22
23
  */
23
24
  static async fromConnectionString(connectionString) {
24
- const url = new URL(connectionString);
25
- const params = url.searchParams;
26
- const topicArn = params.get("topicArn");
27
- if (!topicArn) throw new Error("topicArn parameter is required in connection string");
25
+ const { topicArn, region, endpoint } = parse(connectionString);
26
+ const params = new URL(connectionString).searchParams;
28
27
  const config = {
29
28
  topicArn,
30
- region: params.get("region") || void 0,
31
- endpoint: params.get("endpoint") || void 0
29
+ region,
30
+ endpoint
32
31
  };
33
32
  const accessKeyId = params.get("accessKeyId");
34
33
  const secretAccessKey = params.get("secretAccessKey");
@@ -67,4 +66,4 @@ var SNSConnection = class SNSConnection {
67
66
 
68
67
  //#endregion
69
68
  export { SNSConnection };
70
- //# sourceMappingURL=SNSConnection-CVjH93lb.mjs.map
69
+ //# sourceMappingURL=SNSConnection-v9jjF99w.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SNSConnection-v9jjF99w.mjs","names":["config: SNSConnectionConfig","clientConfig: SNSClientConfig","connectionString: string"],"sources":["../src/sns/SNSConnection.ts"],"sourcesContent":["import { SNSClient, type SNSClientConfig } from '@aws-sdk/client-sns';\nimport type { EventConnection } from '../types';\nimport { EventPublisherType } from '../types';\nimport * as snsUrl from './snsUrl';\n\nexport interface SNSConnectionConfig {\n\ttopicArn: string;\n\tregion?: string;\n\tendpoint?: string; // Custom endpoint (e.g., for LocalStack)\n\tcredentials?: {\n\t\taccessKeyId: string;\n\t\tsecretAccessKey: string;\n\t\tsessionToken?: string;\n\t};\n}\n\nexport class SNSConnection implements EventConnection {\n\treadonly type = EventPublisherType.SNS;\n\tprivate client: SNSClient;\n\tprivate connected = false;\n\tprivate config: SNSConnectionConfig;\n\n\tconstructor(config: SNSConnectionConfig) {\n\t\tthis.config = config;\n\n\t\tconst clientConfig: SNSClientConfig = {\n\t\t\tregion: config.region,\n\t\t\tendpoint: config.endpoint,\n\t\t\tcredentials: config.credentials,\n\t\t};\n\n\t\tthis.client = new SNSClient(clientConfig);\n\t}\n\n\t/**\n\t * Create an SNSConnection from a connection string\n\t * Format: sns://?topicArn=arn:aws:sns:region:account:topic&region=us-east-1&endpoint=http://localhost:4566\n\t */\n\tstatic async fromConnectionString(\n\t\tconnectionString: string,\n\t): Promise<SNSConnection> {\n\t\t// Through the codec, not a second hand-rolled parse: the deploy target\n\t\t// composes these with `snsUrl.build`, and a string it cannot read back is\n\t\t// exactly the drift one shared module rules out.\n\t\tconst { topicArn, region, endpoint } = snsUrl.parse(connectionString);\n\t\tconst params = new URL(connectionString).searchParams;\n\n\t\tconst config: SNSConnectionConfig = {\n\t\t\ttopicArn,\n\t\t\tregion,\n\t\t\tendpoint,\n\t\t};\n\n\t\t// Credentials are not part of the address — see `snsUrl` — but a caller\n\t\t// may still pin them here, so they are read beside it rather than in it.\n\t\tconst accessKeyId = params.get('accessKeyId');\n\t\tconst secretAccessKey = params.get('secretAccessKey');\n\t\tif (accessKeyId && secretAccessKey) {\n\t\t\tconfig.credentials = {\n\t\t\t\taccessKeyId,\n\t\t\t\tsecretAccessKey,\n\t\t\t\tsessionToken: params.get('sessionToken') || undefined,\n\t\t\t};\n\t\t}\n\n\t\tconst connection = new SNSConnection(config);\n\t\tawait connection.connect();\n\t\treturn connection;\n\t}\n\n\tasync connect(): Promise<void> {\n\t\t// SNS doesn't have a traditional connection, but we mark as connected\n\t\tthis.connected = true;\n\t}\n\n\tasync close(): Promise<void> {\n\t\tthis.client.destroy();\n\t\tthis.connected = false;\n\t}\n\n\tisConnected(): boolean {\n\t\treturn this.connected;\n\t}\n\n\t/**\n\t * Get the underlying SNS client\n\t */\n\tget snsClient(): SNSClient {\n\t\treturn this.client;\n\t}\n\n\t/**\n\t * Get the topic ARN for this connection\n\t */\n\tget topicArn(): string {\n\t\treturn this.config.topicArn;\n\t}\n}\n"],"mappings":";;;;;AAgBA,IAAa,gBAAb,MAAa,cAAyC;CACrD,AAAS,OAAO,mBAAmB;CACnC,AAAQ;CACR,AAAQ,YAAY;CACpB,AAAQ;CAER,YAAYA,QAA6B;AACxC,OAAK,SAAS;EAEd,MAAMC,eAAgC;GACrC,QAAQ,OAAO;GACf,UAAU,OAAO;GACjB,aAAa,OAAO;EACpB;AAED,OAAK,SAAS,IAAI,UAAU;CAC5B;;;;;CAMD,aAAa,qBACZC,kBACyB;EAIzB,MAAM,EAAE,UAAU,QAAQ,UAAU,GAAG,MAAa,iBAAiB;EACrE,MAAM,SAAS,IAAI,IAAI,kBAAkB;EAEzC,MAAMF,SAA8B;GACnC;GACA;GACA;EACA;EAID,MAAM,cAAc,OAAO,IAAI,cAAc;EAC7C,MAAM,kBAAkB,OAAO,IAAI,kBAAkB;AACrD,MAAI,eAAe,gBAClB,QAAO,cAAc;GACpB;GACA;GACA,cAAc,OAAO,IAAI,eAAe;EACxC;EAGF,MAAM,aAAa,IAAI,cAAc;AACrC,QAAM,WAAW,SAAS;AAC1B,SAAO;CACP;CAED,MAAM,UAAyB;AAE9B,OAAK,YAAY;CACjB;CAED,MAAM,QAAuB;AAC5B,OAAK,OAAO,SAAS;AACrB,OAAK,YAAY;CACjB;CAED,cAAuB;AACtB,SAAO,KAAK;CACZ;;;;CAKD,IAAI,YAAuB;AAC1B,SAAO,KAAK;CACZ;;;;CAKD,IAAI,WAAmB;AACtB,SAAO,KAAK,OAAO;CACnB;AACD"}
@@ -1,4 +1,5 @@
1
- import { EventPublisherType } from "./types-BrdcSEnd.mjs";
1
+ import { EventPublisherType } from "./types-CYDt-2RQ.mjs";
2
+ import { parse } from "./sqsUrl-CbAsBFHI.mjs";
2
3
  import { SQSClient } from "@aws-sdk/client-sqs";
3
4
 
4
5
  //#region src/sqs/SQSConnection.ts
@@ -21,14 +22,12 @@ var SQSConnection = class SQSConnection {
21
22
  * Format: sqs://?queueUrl=https://sqs.region.amazonaws.com/accountId/queueName&region=us-east-1&endpoint=http://localhost:4566
22
23
  */
23
24
  static async fromConnectionString(connectionString) {
24
- const url = new URL(connectionString);
25
- const params = url.searchParams;
26
- const queueUrl = params.get("queueUrl");
27
- if (!queueUrl) throw new Error("queueUrl parameter is required in connection string");
25
+ const { queueUrl, region, endpoint } = parse(connectionString);
26
+ const params = new URL(connectionString).searchParams;
28
27
  const config = {
29
28
  queueUrl,
30
- region: params.get("region") || void 0,
31
- endpoint: params.get("endpoint") || void 0
29
+ region,
30
+ endpoint
32
31
  };
33
32
  const accessKeyId = params.get("accessKeyId");
34
33
  const secretAccessKey = params.get("secretAccessKey");
@@ -67,4 +66,4 @@ var SQSConnection = class SQSConnection {
67
66
 
68
67
  //#endregion
69
68
  export { SQSConnection };
70
- //# sourceMappingURL=SQSConnection-CT3S7_zP.mjs.map
69
+ //# sourceMappingURL=SQSConnection-4tBMkVZE.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SQSConnection-4tBMkVZE.mjs","names":["config: SQSConnectionConfig","clientConfig: SQSClientConfig","connectionString: string"],"sources":["../src/sqs/SQSConnection.ts"],"sourcesContent":["import { SQSClient, type SQSClientConfig } from '@aws-sdk/client-sqs';\nimport type { EventConnection } from '../types';\nimport { EventPublisherType } from '../types';\nimport * as sqsUrl from './sqsUrl';\n\nexport interface SQSConnectionConfig {\n\tqueueUrl: string;\n\tregion?: string;\n\tendpoint?: string; // Custom endpoint (e.g., for LocalStack)\n\tcredentials?: {\n\t\taccessKeyId: string;\n\t\tsecretAccessKey: string;\n\t\tsessionToken?: string;\n\t};\n}\n\nexport class SQSConnection implements EventConnection {\n\treadonly type = EventPublisherType.SQS;\n\tprivate client: SQSClient;\n\tprivate connected = false;\n\n\tconstructor(readonly config: SQSConnectionConfig) {\n\t\tthis.config = config;\n\n\t\tconst clientConfig: SQSClientConfig = {\n\t\t\tregion: config.region,\n\t\t\tendpoint: config.endpoint,\n\t\t\tcredentials: config.credentials,\n\t\t};\n\n\t\tthis.client = new SQSClient(clientConfig);\n\t}\n\n\t/**\n\t * Create an SQSConnection from a connection string\n\t * Format: sqs://?queueUrl=https://sqs.region.amazonaws.com/accountId/queueName&region=us-east-1&endpoint=http://localhost:4566\n\t */\n\tstatic async fromConnectionString(\n\t\tconnectionString: string,\n\t): Promise<SQSConnection> {\n\t\t// Through the codec, not a second hand-rolled parse: the deploy target\n\t\t// composes these with `sqsUrl.build`, and a string it cannot read back is\n\t\t// exactly the drift one shared module rules out.\n\t\tconst { queueUrl, region, endpoint } = sqsUrl.parse(connectionString);\n\t\tconst params = new URL(connectionString).searchParams;\n\n\t\tconst config: SQSConnectionConfig = {\n\t\t\tqueueUrl,\n\t\t\tregion,\n\t\t\tendpoint,\n\t\t};\n\n\t\t// Credentials are not part of the address — see `sqsUrl` — but a caller\n\t\t// may still pin them here, so they are read beside it rather than in it.\n\t\tconst accessKeyId = params.get('accessKeyId');\n\t\tconst secretAccessKey = params.get('secretAccessKey');\n\t\tif (accessKeyId && secretAccessKey) {\n\t\t\tconfig.credentials = {\n\t\t\t\taccessKeyId,\n\t\t\t\tsecretAccessKey,\n\t\t\t\tsessionToken: params.get('sessionToken') || undefined,\n\t\t\t};\n\t\t}\n\n\t\tconst connection = new SQSConnection(config);\n\t\tawait connection.connect();\n\t\treturn connection;\n\t}\n\n\tasync connect(): Promise<void> {\n\t\t// SQS doesn't have a traditional connection, but we mark as connected\n\t\tthis.connected = true;\n\t}\n\n\tasync close(): Promise<void> {\n\t\tthis.client.destroy();\n\t\tthis.connected = false;\n\t}\n\n\tisConnected(): boolean {\n\t\treturn this.connected;\n\t}\n\n\t/**\n\t * Get the underlying SQS client\n\t */\n\tget sqsClient(): SQSClient {\n\t\treturn this.client;\n\t}\n\n\t/**\n\t * Get the queue URL for this connection\n\t */\n\tget queueUrl(): string {\n\t\treturn this.config.queueUrl;\n\t}\n}\n"],"mappings":";;;;;AAgBA,IAAa,gBAAb,MAAa,cAAyC;CACrD,AAAS,OAAO,mBAAmB;CACnC,AAAQ;CACR,AAAQ,YAAY;CAEpB,YAAqBA,QAA6B;EAA7B;AACpB,OAAK,SAAS;EAEd,MAAMC,eAAgC;GACrC,QAAQ,OAAO;GACf,UAAU,OAAO;GACjB,aAAa,OAAO;EACpB;AAED,OAAK,SAAS,IAAI,UAAU;CAC5B;;;;;CAMD,aAAa,qBACZC,kBACyB;EAIzB,MAAM,EAAE,UAAU,QAAQ,UAAU,GAAG,MAAa,iBAAiB;EACrE,MAAM,SAAS,IAAI,IAAI,kBAAkB;EAEzC,MAAMF,SAA8B;GACnC;GACA;GACA;EACA;EAID,MAAM,cAAc,OAAO,IAAI,cAAc;EAC7C,MAAM,kBAAkB,OAAO,IAAI,kBAAkB;AACrD,MAAI,eAAe,gBAClB,QAAO,cAAc;GACpB;GACA;GACA,cAAc,OAAO,IAAI,eAAe;EACxC;EAGF,MAAM,aAAa,IAAI,cAAc;AACrC,QAAM,WAAW,SAAS;AAC1B,SAAO;CACP;CAED,MAAM,UAAyB;AAE9B,OAAK,YAAY;CACjB;CAED,MAAM,QAAuB;AAC5B,OAAK,OAAO,SAAS;AACrB,OAAK,YAAY;CACjB;CAED,cAAuB;AACtB,SAAO,KAAK;CACZ;;;;CAKD,IAAI,YAAuB;AAC1B,SAAO,KAAK;CACZ;;;;CAKD,IAAI,WAAmB;AACtB,SAAO,KAAK,OAAO;CACnB;AACD"}
@@ -0,0 +1,5 @@
1
+ require('./types-Byv8N9ma.cjs');
2
+ require('./sqsUrl-CdisN3GU.cjs');
3
+ const require_SQSConnection = require('./SQSConnection-BaC7rGhI.cjs');
4
+
5
+ exports.SQSConnection = require_SQSConnection.SQSConnection;
@@ -1,5 +1,6 @@
1
- const require_chunk = require('./chunk-CUT6urMc.cjs');
1
+ const require_chunk = require('./chunk-CsX-DzYB.cjs');
2
2
  const require_types = require('./types-Byv8N9ma.cjs');
3
+ const require_sqsUrl = require('./sqsUrl-CdisN3GU.cjs');
3
4
  const __aws_sdk_client_sqs = require_chunk.__toESM(require("@aws-sdk/client-sqs"));
4
5
 
5
6
  //#region src/sqs/SQSConnection.ts
@@ -22,14 +23,12 @@ var SQSConnection = class SQSConnection {
22
23
  * Format: sqs://?queueUrl=https://sqs.region.amazonaws.com/accountId/queueName&region=us-east-1&endpoint=http://localhost:4566
23
24
  */
24
25
  static async fromConnectionString(connectionString) {
25
- const url = new URL(connectionString);
26
- const params = url.searchParams;
27
- const queueUrl = params.get("queueUrl");
28
- if (!queueUrl) throw new Error("queueUrl parameter is required in connection string");
26
+ const { queueUrl, region, endpoint } = require_sqsUrl.parse(connectionString);
27
+ const params = new URL(connectionString).searchParams;
29
28
  const config = {
30
29
  queueUrl,
31
- region: params.get("region") || void 0,
32
- endpoint: params.get("endpoint") || void 0
30
+ region,
31
+ endpoint
33
32
  };
34
33
  const accessKeyId = params.get("accessKeyId");
35
34
  const secretAccessKey = params.get("secretAccessKey");
@@ -73,4 +72,4 @@ Object.defineProperty(exports, 'SQSConnection', {
73
72
  return SQSConnection;
74
73
  }
75
74
  });
76
- //# sourceMappingURL=SQSConnection-Y0mdVTcB.cjs.map
75
+ //# sourceMappingURL=SQSConnection-BaC7rGhI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SQSConnection-BaC7rGhI.cjs","names":["EventPublisherType","config: SQSConnectionConfig","clientConfig: SQSClientConfig","SQSClient","connectionString: string"],"sources":["../src/sqs/SQSConnection.ts"],"sourcesContent":["import { SQSClient, type SQSClientConfig } from '@aws-sdk/client-sqs';\nimport type { EventConnection } from '../types';\nimport { EventPublisherType } from '../types';\nimport * as sqsUrl from './sqsUrl';\n\nexport interface SQSConnectionConfig {\n\tqueueUrl: string;\n\tregion?: string;\n\tendpoint?: string; // Custom endpoint (e.g., for LocalStack)\n\tcredentials?: {\n\t\taccessKeyId: string;\n\t\tsecretAccessKey: string;\n\t\tsessionToken?: string;\n\t};\n}\n\nexport class SQSConnection implements EventConnection {\n\treadonly type = EventPublisherType.SQS;\n\tprivate client: SQSClient;\n\tprivate connected = false;\n\n\tconstructor(readonly config: SQSConnectionConfig) {\n\t\tthis.config = config;\n\n\t\tconst clientConfig: SQSClientConfig = {\n\t\t\tregion: config.region,\n\t\t\tendpoint: config.endpoint,\n\t\t\tcredentials: config.credentials,\n\t\t};\n\n\t\tthis.client = new SQSClient(clientConfig);\n\t}\n\n\t/**\n\t * Create an SQSConnection from a connection string\n\t * Format: sqs://?queueUrl=https://sqs.region.amazonaws.com/accountId/queueName&region=us-east-1&endpoint=http://localhost:4566\n\t */\n\tstatic async fromConnectionString(\n\t\tconnectionString: string,\n\t): Promise<SQSConnection> {\n\t\t// Through the codec, not a second hand-rolled parse: the deploy target\n\t\t// composes these with `sqsUrl.build`, and a string it cannot read back is\n\t\t// exactly the drift one shared module rules out.\n\t\tconst { queueUrl, region, endpoint } = sqsUrl.parse(connectionString);\n\t\tconst params = new URL(connectionString).searchParams;\n\n\t\tconst config: SQSConnectionConfig = {\n\t\t\tqueueUrl,\n\t\t\tregion,\n\t\t\tendpoint,\n\t\t};\n\n\t\t// Credentials are not part of the address — see `sqsUrl` — but a caller\n\t\t// may still pin them here, so they are read beside it rather than in it.\n\t\tconst accessKeyId = params.get('accessKeyId');\n\t\tconst secretAccessKey = params.get('secretAccessKey');\n\t\tif (accessKeyId && secretAccessKey) {\n\t\t\tconfig.credentials = {\n\t\t\t\taccessKeyId,\n\t\t\t\tsecretAccessKey,\n\t\t\t\tsessionToken: params.get('sessionToken') || undefined,\n\t\t\t};\n\t\t}\n\n\t\tconst connection = new SQSConnection(config);\n\t\tawait connection.connect();\n\t\treturn connection;\n\t}\n\n\tasync connect(): Promise<void> {\n\t\t// SQS doesn't have a traditional connection, but we mark as connected\n\t\tthis.connected = true;\n\t}\n\n\tasync close(): Promise<void> {\n\t\tthis.client.destroy();\n\t\tthis.connected = false;\n\t}\n\n\tisConnected(): boolean {\n\t\treturn this.connected;\n\t}\n\n\t/**\n\t * Get the underlying SQS client\n\t */\n\tget sqsClient(): SQSClient {\n\t\treturn this.client;\n\t}\n\n\t/**\n\t * Get the queue URL for this connection\n\t */\n\tget queueUrl(): string {\n\t\treturn this.config.queueUrl;\n\t}\n}\n"],"mappings":";;;;;;AAgBA,IAAa,gBAAb,MAAa,cAAyC;CACrD,AAAS,OAAOA,iCAAmB;CACnC,AAAQ;CACR,AAAQ,YAAY;CAEpB,YAAqBC,QAA6B;EAA7B;AACpB,OAAK,SAAS;EAEd,MAAMC,eAAgC;GACrC,QAAQ,OAAO;GACf,UAAU,OAAO;GACjB,aAAa,OAAO;EACpB;AAED,OAAK,SAAS,IAAIC,+BAAU;CAC5B;;;;;CAMD,aAAa,qBACZC,kBACyB;EAIzB,MAAM,EAAE,UAAU,QAAQ,UAAU,GAAG,qBAAa,iBAAiB;EACrE,MAAM,SAAS,IAAI,IAAI,kBAAkB;EAEzC,MAAMH,SAA8B;GACnC;GACA;GACA;EACA;EAID,MAAM,cAAc,OAAO,IAAI,cAAc;EAC7C,MAAM,kBAAkB,OAAO,IAAI,kBAAkB;AACrD,MAAI,eAAe,gBAClB,QAAO,cAAc;GACpB;GACA;GACA,cAAc,OAAO,IAAI,eAAe;EACxC;EAGF,MAAM,aAAa,IAAI,cAAc;AACrC,QAAM,WAAW,SAAS;AAC1B,SAAO;CACP;CAED,MAAM,UAAyB;AAE9B,OAAK,YAAY;CACjB;CAED,MAAM,QAAuB;AAC5B,OAAK,OAAO,SAAS;AACrB,OAAK,YAAY;CACjB;CAED,cAAuB;AACtB,SAAO,KAAK;CACZ;;;;CAKD,IAAI,YAAuB;AAC1B,SAAO,KAAK;CACZ;;;;CAKD,IAAI,WAAmB;AACtB,SAAO,KAAK,OAAO;CACnB;AACD"}
@@ -0,0 +1,5 @@
1
+ import "./types-CYDt-2RQ.mjs";
2
+ import "./sqsUrl-CbAsBFHI.mjs";
3
+ import { SQSConnection } from "./SQSConnection-4tBMkVZE.mjs";
4
+
5
+ export { SQSConnection };
@@ -111,4 +111,4 @@ var SQSSubscriber = class {
111
111
 
112
112
  //#endregion
113
113
  export { SQSSubscriber };
114
- //# sourceMappingURL=SQSSubscriber-CQdSFzpe.mjs.map
114
+ //# sourceMappingURL=SQSSubscriber-BMWZ3s5q.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SQSSubscriber-CQdSFzpe.mjs","names":["connection: SQSConnection","options: SQSSubscriberOptions","messages: TMessage['type'][]","listener: (payload: TMessage) => Promise<void>","messages: Message[]","body: string","receiptHandle: string","ms: number"],"sources":["../src/sqs/SQSSubscriber.ts"],"sourcesContent":["import {\n\tDeleteMessageCommand,\n\ttype Message,\n\tReceiveMessageCommand,\n} from '@aws-sdk/client-sqs';\nimport type { EventSubscriber, PublishableMessage } from '../types';\nimport type { SQSConnection } from './SQSConnection';\n\nexport interface SQSSubscriberOptions {\n\twaitTimeSeconds?: number; // SQS long polling (default: 20)\n\tmaxMessages?: number; // Max messages per poll (default: 10)\n\texpectedTopicArn?: string; // Optional: verify messages are from specific SNS topic\n}\n\n/**\n * SQS Subscriber - receives messages from an SQS queue\n *\n * This subscriber can receive:\n * 1. Direct SQS messages\n * 2. SNS messages that were pushed to the queue (SNS → SQS pattern)\n *\n * When receiving SNS messages, it:\n * - Automatically detects and parses the SNS wrapper format\n * - Filters by TopicArn (if expectedTopicArn is provided)\n * - Filters by message type\n * - Processes the actual message payload\n */\nexport class SQSSubscriber<TMessage extends PublishableMessage<string, any>>\n\timplements EventSubscriber<TMessage>\n{\n\tprivate polling = false;\n\tprivate messageTypes: Set<TMessage['type']> = new Set();\n\tprivate listener?: (payload: TMessage) => Promise<void>;\n\tprivate options: Required<SQSSubscriberOptions>;\n\n\tconstructor(\n\t\tprivate connection: SQSConnection,\n\t\toptions: SQSSubscriberOptions = {},\n\t) {\n\t\tthis.options = {\n\t\t\twaitTimeSeconds: options.waitTimeSeconds ?? 20,\n\t\t\tmaxMessages: options.maxMessages ?? 10,\n\t\t\texpectedTopicArn: options.expectedTopicArn ?? '',\n\t\t};\n\t}\n\n\tasync subscribe(\n\t\tmessages: TMessage['type'][],\n\t\tlistener: (payload: TMessage) => Promise<void>,\n\t): Promise<void> {\n\t\tthis.messageTypes = new Set(messages);\n\t\tthis.listener = listener;\n\n\t\tif (!this.connection.isConnected()) {\n\t\t\tawait this.connection.connect();\n\t\t}\n\n\t\tthis.polling = true;\n\t\tthis.poll();\n\t}\n\n\tstop(): void {\n\t\tthis.polling = false;\n\t}\n\n\tprivate async poll(): Promise<void> {\n\t\twhile (this.polling) {\n\t\t\ttry {\n\t\t\t\tconst command = new ReceiveMessageCommand({\n\t\t\t\t\tQueueUrl: this.connection.queueUrl,\n\t\t\t\t\tMaxNumberOfMessages: this.options.maxMessages,\n\t\t\t\t\tWaitTimeSeconds: this.options.waitTimeSeconds,\n\t\t\t\t\tMessageAttributeNames: ['All'],\n\t\t\t\t});\n\n\t\t\t\tconst response = await this.connection.sqsClient.send(command);\n\n\t\t\t\tif (response.Messages && response.Messages.length > 0) {\n\t\t\t\t\tawait this.processMessages(response.Messages);\n\t\t\t\t}\n\t\t\t} catch (_error) {\n\t\t\t\tawait this.sleep(1000);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate async processMessages(messages: Message[]): Promise<void> {\n\t\tfor (const message of messages) {\n\t\t\ttry {\n\t\t\t\tif (!message.Body) continue;\n\n\t\t\t\t// Try to parse as SNS message first\n\t\t\t\tconst parsedMessage = this.parseMessage(message.Body);\n\n\t\t\t\tif (!parsedMessage) {\n\t\t\t\t\t// Not a valid message format\n\t\t\t\t\tawait this.deleteMessage(message.ReceiptHandle!);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst { payload, messageType, topicArn } = parsedMessage;\n\n\t\t\t\t// If expectedTopicArn is set, verify the message is from that topic\n\t\t\t\tif (this.options.expectedTopicArn && topicArn) {\n\t\t\t\t\tif (topicArn !== this.options.expectedTopicArn) {\n\t\t\t\t\t\tawait this.deleteMessage(message.ReceiptHandle!);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Check if we're subscribed to this message type\n\t\t\t\tif (\n\t\t\t\t\tmessageType &&\n\t\t\t\t\tthis.messageTypes.has(messageType as TMessage['type'])\n\t\t\t\t) {\n\t\t\t\t\t// Call listener\n\t\t\t\t\tif (this.listener) {\n\t\t\t\t\t\tawait this.listener(payload as TMessage);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Delete message after successful processing\n\t\t\t\t\tawait this.deleteMessage(message.ReceiptHandle!);\n\t\t\t\t} else {\n\t\t\t\t\t// Delete messages we're not subscribed to\n\t\t\t\t\tawait this.deleteMessage(message.ReceiptHandle!);\n\t\t\t\t}\n\t\t\t} catch (_error) {\n\t\t\t\t// Message will become visible again\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Parse message body - handles both direct SQS messages and SNS-wrapped messages\n\t */\n\tprivate parseMessage(body: string): {\n\t\tpayload: unknown;\n\t\tmessageType: string | undefined;\n\t\ttopicArn?: string;\n\t} | null {\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(body);\n\n\t\t\t// Check if this is an SNS notification wrapper\n\t\t\tif (parsed.Type === 'Notification' && parsed.Message) {\n\t\t\t\t// This is an SNS message\n\t\t\t\tconst snsMessage = JSON.parse(parsed.Message);\n\t\t\t\tconst messageType =\n\t\t\t\t\tparsed.MessageAttributes?.type?.Value || snsMessage.type;\n\n\t\t\t\treturn {\n\t\t\t\t\tpayload: snsMessage,\n\t\t\t\t\tmessageType,\n\t\t\t\t\ttopicArn: parsed.TopicArn,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// This is a direct SQS message\n\t\t\treturn {\n\t\t\t\tpayload: parsed,\n\t\t\t\tmessageType: parsed.type,\n\t\t\t};\n\t\t} catch (_error) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate async deleteMessage(receiptHandle: string): Promise<void> {\n\t\ttry {\n\t\t\tconst command = new DeleteMessageCommand({\n\t\t\t\tQueueUrl: this.connection.queueUrl,\n\t\t\t\tReceiptHandle: receiptHandle,\n\t\t\t});\n\t\t\tawait this.connection.sqsClient.send(command);\n\t\t} catch (_error) {}\n\t}\n\n\tprivate sleep(ms: number): Promise<void> {\n\t\treturn new Promise((resolve) => setTimeout(resolve, ms));\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA2BA,IAAa,gBAAb,MAEA;CACC,AAAQ,UAAU;CAClB,AAAQ,+BAAsC,IAAI;CAClD,AAAQ;CACR,AAAQ;CAER,YACSA,YACRC,UAAgC,CAAE,GACjC;EAFO;AAGR,OAAK,UAAU;GACd,iBAAiB,QAAQ,mBAAmB;GAC5C,aAAa,QAAQ,eAAe;GACpC,kBAAkB,QAAQ,oBAAoB;EAC9C;CACD;CAED,MAAM,UACLC,UACAC,UACgB;AAChB,OAAK,eAAe,IAAI,IAAI;AAC5B,OAAK,WAAW;AAEhB,OAAK,KAAK,WAAW,aAAa,CACjC,OAAM,KAAK,WAAW,SAAS;AAGhC,OAAK,UAAU;AACf,OAAK,MAAM;CACX;CAED,OAAa;AACZ,OAAK,UAAU;CACf;CAED,MAAc,OAAsB;AACnC,SAAO,KAAK,QACX,KAAI;GACH,MAAM,UAAU,IAAI,sBAAsB;IACzC,UAAU,KAAK,WAAW;IAC1B,qBAAqB,KAAK,QAAQ;IAClC,iBAAiB,KAAK,QAAQ;IAC9B,uBAAuB,CAAC,KAAM;GAC9B;GAED,MAAM,WAAW,MAAM,KAAK,WAAW,UAAU,KAAK,QAAQ;AAE9D,OAAI,SAAS,YAAY,SAAS,SAAS,SAAS,EACnD,OAAM,KAAK,gBAAgB,SAAS,SAAS;EAE9C,SAAQ,QAAQ;AAChB,SAAM,KAAK,MAAM,IAAK;EACtB;CAEF;CAED,MAAc,gBAAgBC,UAAoC;AACjE,OAAK,MAAM,WAAW,SACrB,KAAI;AACH,QAAK,QAAQ,KAAM;GAGnB,MAAM,gBAAgB,KAAK,aAAa,QAAQ,KAAK;AAErD,QAAK,eAAe;AAEnB,UAAM,KAAK,cAAc,QAAQ,cAAe;AAChD;GACA;GAED,MAAM,EAAE,SAAS,aAAa,UAAU,GAAG;AAG3C,OAAI,KAAK,QAAQ,oBAAoB,UACpC;QAAI,aAAa,KAAK,QAAQ,kBAAkB;AAC/C,WAAM,KAAK,cAAc,QAAQ,cAAe;AAChD;IACA;;AAIF,OACC,eACA,KAAK,aAAa,IAAI,YAAgC,EACrD;AAED,QAAI,KAAK,SACR,OAAM,KAAK,SAAS,QAAoB;AAIzC,UAAM,KAAK,cAAc,QAAQ,cAAe;GAChD,MAEA,OAAM,KAAK,cAAc,QAAQ,cAAe;EAEjD,SAAQ,QAAQ,CAEhB;CAEF;;;;CAKD,AAAQ,aAAaC,MAIZ;AACR,MAAI;GACH,MAAM,SAAS,KAAK,MAAM,KAAK;AAG/B,OAAI,OAAO,SAAS,kBAAkB,OAAO,SAAS;IAErD,MAAM,aAAa,KAAK,MAAM,OAAO,QAAQ;IAC7C,MAAM,cACL,OAAO,mBAAmB,MAAM,SAAS,WAAW;AAErD,WAAO;KACN,SAAS;KACT;KACA,UAAU,OAAO;IACjB;GACD;AAGD,UAAO;IACN,SAAS;IACT,aAAa,OAAO;GACpB;EACD,SAAQ,QAAQ;AAChB,UAAO;EACP;CACD;CAED,MAAc,cAAcC,eAAsC;AACjE,MAAI;GACH,MAAM,UAAU,IAAI,qBAAqB;IACxC,UAAU,KAAK,WAAW;IAC1B,eAAe;GACf;AACD,SAAM,KAAK,WAAW,UAAU,KAAK,QAAQ;EAC7C,SAAQ,QAAQ,CAAE;CACnB;CAED,AAAQ,MAAMC,IAA2B;AACxC,SAAO,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,GAAG;CACvD;AACD"}
1
+ {"version":3,"file":"SQSSubscriber-BMWZ3s5q.mjs","names":["connection: SQSConnection","options: SQSSubscriberOptions","messages: TMessage['type'][]","listener: (payload: TMessage) => Promise<void>","messages: Message[]","body: string","receiptHandle: string","ms: number"],"sources":["../src/sqs/SQSSubscriber.ts"],"sourcesContent":["import {\n\tDeleteMessageCommand,\n\ttype Message,\n\tReceiveMessageCommand,\n} from '@aws-sdk/client-sqs';\nimport type { EventSubscriber, PublishableMessage } from '../types';\nimport type { SQSConnection } from './SQSConnection';\n\nexport interface SQSSubscriberOptions {\n\twaitTimeSeconds?: number; // SQS long polling (default: 20)\n\tmaxMessages?: number; // Max messages per poll (default: 10)\n\texpectedTopicArn?: string; // Optional: verify messages are from specific SNS topic\n}\n\n/**\n * SQS Subscriber - receives messages from an SQS queue\n *\n * This subscriber can receive:\n * 1. Direct SQS messages\n * 2. SNS messages that were pushed to the queue (SNS → SQS pattern)\n *\n * When receiving SNS messages, it:\n * - Automatically detects and parses the SNS wrapper format\n * - Filters by TopicArn (if expectedTopicArn is provided)\n * - Filters by message type\n * - Processes the actual message payload\n */\nexport class SQSSubscriber<TMessage extends PublishableMessage<string, any>>\n\timplements EventSubscriber<TMessage>\n{\n\tprivate polling = false;\n\tprivate messageTypes: Set<TMessage['type']> = new Set();\n\tprivate listener?: (payload: TMessage) => Promise<void>;\n\tprivate options: Required<SQSSubscriberOptions>;\n\n\tconstructor(\n\t\tprivate connection: SQSConnection,\n\t\toptions: SQSSubscriberOptions = {},\n\t) {\n\t\tthis.options = {\n\t\t\twaitTimeSeconds: options.waitTimeSeconds ?? 20,\n\t\t\tmaxMessages: options.maxMessages ?? 10,\n\t\t\texpectedTopicArn: options.expectedTopicArn ?? '',\n\t\t};\n\t}\n\n\tasync subscribe(\n\t\tmessages: TMessage['type'][],\n\t\tlistener: (payload: TMessage) => Promise<void>,\n\t): Promise<void> {\n\t\tthis.messageTypes = new Set(messages);\n\t\tthis.listener = listener;\n\n\t\tif (!this.connection.isConnected()) {\n\t\t\tawait this.connection.connect();\n\t\t}\n\n\t\tthis.polling = true;\n\t\tthis.poll();\n\t}\n\n\tstop(): void {\n\t\tthis.polling = false;\n\t}\n\n\tprivate async poll(): Promise<void> {\n\t\twhile (this.polling) {\n\t\t\ttry {\n\t\t\t\tconst command = new ReceiveMessageCommand({\n\t\t\t\t\tQueueUrl: this.connection.queueUrl,\n\t\t\t\t\tMaxNumberOfMessages: this.options.maxMessages,\n\t\t\t\t\tWaitTimeSeconds: this.options.waitTimeSeconds,\n\t\t\t\t\tMessageAttributeNames: ['All'],\n\t\t\t\t});\n\n\t\t\t\tconst response = await this.connection.sqsClient.send(command);\n\n\t\t\t\tif (response.Messages && response.Messages.length > 0) {\n\t\t\t\t\tawait this.processMessages(response.Messages);\n\t\t\t\t}\n\t\t\t} catch (_error) {\n\t\t\t\tawait this.sleep(1000);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate async processMessages(messages: Message[]): Promise<void> {\n\t\tfor (const message of messages) {\n\t\t\ttry {\n\t\t\t\tif (!message.Body) continue;\n\n\t\t\t\t// Try to parse as SNS message first\n\t\t\t\tconst parsedMessage = this.parseMessage(message.Body);\n\n\t\t\t\tif (!parsedMessage) {\n\t\t\t\t\t// Not a valid message format\n\t\t\t\t\tawait this.deleteMessage(message.ReceiptHandle!);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst { payload, messageType, topicArn } = parsedMessage;\n\n\t\t\t\t// If expectedTopicArn is set, verify the message is from that topic\n\t\t\t\tif (this.options.expectedTopicArn && topicArn) {\n\t\t\t\t\tif (topicArn !== this.options.expectedTopicArn) {\n\t\t\t\t\t\tawait this.deleteMessage(message.ReceiptHandle!);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Check if we're subscribed to this message type\n\t\t\t\tif (\n\t\t\t\t\tmessageType &&\n\t\t\t\t\tthis.messageTypes.has(messageType as TMessage['type'])\n\t\t\t\t) {\n\t\t\t\t\t// Call listener\n\t\t\t\t\tif (this.listener) {\n\t\t\t\t\t\tawait this.listener(payload as TMessage);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Delete message after successful processing\n\t\t\t\t\tawait this.deleteMessage(message.ReceiptHandle!);\n\t\t\t\t} else {\n\t\t\t\t\t// Delete messages we're not subscribed to\n\t\t\t\t\tawait this.deleteMessage(message.ReceiptHandle!);\n\t\t\t\t}\n\t\t\t} catch (_error) {\n\t\t\t\t// Message will become visible again\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Parse message body - handles both direct SQS messages and SNS-wrapped messages\n\t */\n\tprivate parseMessage(body: string): {\n\t\tpayload: unknown;\n\t\tmessageType: string | undefined;\n\t\ttopicArn?: string;\n\t} | null {\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(body);\n\n\t\t\t// Check if this is an SNS notification wrapper\n\t\t\tif (parsed.Type === 'Notification' && parsed.Message) {\n\t\t\t\t// This is an SNS message\n\t\t\t\tconst snsMessage = JSON.parse(parsed.Message);\n\t\t\t\tconst messageType =\n\t\t\t\t\tparsed.MessageAttributes?.type?.Value || snsMessage.type;\n\n\t\t\t\treturn {\n\t\t\t\t\tpayload: snsMessage,\n\t\t\t\t\tmessageType,\n\t\t\t\t\ttopicArn: parsed.TopicArn,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// This is a direct SQS message\n\t\t\treturn {\n\t\t\t\tpayload: parsed,\n\t\t\t\tmessageType: parsed.type,\n\t\t\t};\n\t\t} catch (_error) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate async deleteMessage(receiptHandle: string): Promise<void> {\n\t\ttry {\n\t\t\tconst command = new DeleteMessageCommand({\n\t\t\t\tQueueUrl: this.connection.queueUrl,\n\t\t\t\tReceiptHandle: receiptHandle,\n\t\t\t});\n\t\t\tawait this.connection.sqsClient.send(command);\n\t\t} catch (_error) {}\n\t}\n\n\tprivate sleep(ms: number): Promise<void> {\n\t\treturn new Promise((resolve) => setTimeout(resolve, ms));\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA2BA,IAAa,gBAAb,MAEA;CACC,AAAQ,UAAU;CAClB,AAAQ,+BAAsC,IAAI;CAClD,AAAQ;CACR,AAAQ;CAER,YACSA,YACRC,UAAgC,CAAE,GACjC;EAFO;AAGR,OAAK,UAAU;GACd,iBAAiB,QAAQ,mBAAmB;GAC5C,aAAa,QAAQ,eAAe;GACpC,kBAAkB,QAAQ,oBAAoB;EAC9C;CACD;CAED,MAAM,UACLC,UACAC,UACgB;AAChB,OAAK,eAAe,IAAI,IAAI;AAC5B,OAAK,WAAW;AAEhB,OAAK,KAAK,WAAW,aAAa,CACjC,OAAM,KAAK,WAAW,SAAS;AAGhC,OAAK,UAAU;AACf,OAAK,MAAM;CACX;CAED,OAAa;AACZ,OAAK,UAAU;CACf;CAED,MAAc,OAAsB;AACnC,SAAO,KAAK,QACX,KAAI;GACH,MAAM,UAAU,IAAI,sBAAsB;IACzC,UAAU,KAAK,WAAW;IAC1B,qBAAqB,KAAK,QAAQ;IAClC,iBAAiB,KAAK,QAAQ;IAC9B,uBAAuB,CAAC,KAAM;GAC9B;GAED,MAAM,WAAW,MAAM,KAAK,WAAW,UAAU,KAAK,QAAQ;AAE9D,OAAI,SAAS,YAAY,SAAS,SAAS,SAAS,EACnD,OAAM,KAAK,gBAAgB,SAAS,SAAS;EAE9C,SAAQ,QAAQ;AAChB,SAAM,KAAK,MAAM,IAAK;EACtB;CAEF;CAED,MAAc,gBAAgBC,UAAoC;AACjE,OAAK,MAAM,WAAW,SACrB,KAAI;AACH,QAAK,QAAQ,KAAM;GAGnB,MAAM,gBAAgB,KAAK,aAAa,QAAQ,KAAK;AAErD,QAAK,eAAe;AAEnB,UAAM,KAAK,cAAc,QAAQ,cAAe;AAChD;GACA;GAED,MAAM,EAAE,SAAS,aAAa,UAAU,GAAG;AAG3C,OAAI,KAAK,QAAQ,oBAAoB,UACpC;QAAI,aAAa,KAAK,QAAQ,kBAAkB;AAC/C,WAAM,KAAK,cAAc,QAAQ,cAAe;AAChD;IACA;;AAIF,OACC,eACA,KAAK,aAAa,IAAI,YAAgC,EACrD;AAED,QAAI,KAAK,SACR,OAAM,KAAK,SAAS,QAAoB;AAIzC,UAAM,KAAK,cAAc,QAAQ,cAAe;GAChD,MAEA,OAAM,KAAK,cAAc,QAAQ,cAAe;EAEjD,SAAQ,QAAQ,CAEhB;CAEF;;;;CAKD,AAAQ,aAAaC,MAIZ;AACR,MAAI;GACH,MAAM,SAAS,KAAK,MAAM,KAAK;AAG/B,OAAI,OAAO,SAAS,kBAAkB,OAAO,SAAS;IAErD,MAAM,aAAa,KAAK,MAAM,OAAO,QAAQ;IAC7C,MAAM,cACL,OAAO,mBAAmB,MAAM,SAAS,WAAW;AAErD,WAAO;KACN,SAAS;KACT;KACA,UAAU,OAAO;IACjB;GACD;AAGD,UAAO;IACN,SAAS;IACT,aAAa,OAAO;GACpB;EACD,SAAQ,QAAQ;AAChB,UAAO;EACP;CACD;CAED,MAAc,cAAcC,eAAsC;AACjE,MAAI;GACH,MAAM,UAAU,IAAI,qBAAqB;IACxC,UAAU,KAAK,WAAW;IAC1B,eAAe;GACf;AACD,SAAM,KAAK,WAAW,UAAU,KAAK,QAAQ;EAC7C,SAAQ,QAAQ,CAAE;CACnB;CAED,AAAQ,MAAMC,IAA2B;AACxC,SAAO,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,GAAG;CACvD;AACD"}
@@ -1,4 +1,4 @@
1
- const require_chunk = require('./chunk-CUT6urMc.cjs');
1
+ const require_chunk = require('./chunk-CsX-DzYB.cjs');
2
2
  const __aws_sdk_client_sqs = require_chunk.__toESM(require("@aws-sdk/client-sqs"));
3
3
 
4
4
  //#region src/sqs/SQSSubscriber.ts
@@ -117,4 +117,4 @@ Object.defineProperty(exports, 'SQSSubscriber', {
117
117
  return SQSSubscriber;
118
118
  }
119
119
  });
120
- //# sourceMappingURL=SQSSubscriber-C4UA2hKq.cjs.map
120
+ //# sourceMappingURL=SQSSubscriber-YXPlg2rm.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SQSSubscriber-C4UA2hKq.cjs","names":["connection: SQSConnection","options: SQSSubscriberOptions","messages: TMessage['type'][]","listener: (payload: TMessage) => Promise<void>","ReceiveMessageCommand","messages: Message[]","body: string","receiptHandle: string","DeleteMessageCommand","ms: number"],"sources":["../src/sqs/SQSSubscriber.ts"],"sourcesContent":["import {\n\tDeleteMessageCommand,\n\ttype Message,\n\tReceiveMessageCommand,\n} from '@aws-sdk/client-sqs';\nimport type { EventSubscriber, PublishableMessage } from '../types';\nimport type { SQSConnection } from './SQSConnection';\n\nexport interface SQSSubscriberOptions {\n\twaitTimeSeconds?: number; // SQS long polling (default: 20)\n\tmaxMessages?: number; // Max messages per poll (default: 10)\n\texpectedTopicArn?: string; // Optional: verify messages are from specific SNS topic\n}\n\n/**\n * SQS Subscriber - receives messages from an SQS queue\n *\n * This subscriber can receive:\n * 1. Direct SQS messages\n * 2. SNS messages that were pushed to the queue (SNS → SQS pattern)\n *\n * When receiving SNS messages, it:\n * - Automatically detects and parses the SNS wrapper format\n * - Filters by TopicArn (if expectedTopicArn is provided)\n * - Filters by message type\n * - Processes the actual message payload\n */\nexport class SQSSubscriber<TMessage extends PublishableMessage<string, any>>\n\timplements EventSubscriber<TMessage>\n{\n\tprivate polling = false;\n\tprivate messageTypes: Set<TMessage['type']> = new Set();\n\tprivate listener?: (payload: TMessage) => Promise<void>;\n\tprivate options: Required<SQSSubscriberOptions>;\n\n\tconstructor(\n\t\tprivate connection: SQSConnection,\n\t\toptions: SQSSubscriberOptions = {},\n\t) {\n\t\tthis.options = {\n\t\t\twaitTimeSeconds: options.waitTimeSeconds ?? 20,\n\t\t\tmaxMessages: options.maxMessages ?? 10,\n\t\t\texpectedTopicArn: options.expectedTopicArn ?? '',\n\t\t};\n\t}\n\n\tasync subscribe(\n\t\tmessages: TMessage['type'][],\n\t\tlistener: (payload: TMessage) => Promise<void>,\n\t): Promise<void> {\n\t\tthis.messageTypes = new Set(messages);\n\t\tthis.listener = listener;\n\n\t\tif (!this.connection.isConnected()) {\n\t\t\tawait this.connection.connect();\n\t\t}\n\n\t\tthis.polling = true;\n\t\tthis.poll();\n\t}\n\n\tstop(): void {\n\t\tthis.polling = false;\n\t}\n\n\tprivate async poll(): Promise<void> {\n\t\twhile (this.polling) {\n\t\t\ttry {\n\t\t\t\tconst command = new ReceiveMessageCommand({\n\t\t\t\t\tQueueUrl: this.connection.queueUrl,\n\t\t\t\t\tMaxNumberOfMessages: this.options.maxMessages,\n\t\t\t\t\tWaitTimeSeconds: this.options.waitTimeSeconds,\n\t\t\t\t\tMessageAttributeNames: ['All'],\n\t\t\t\t});\n\n\t\t\t\tconst response = await this.connection.sqsClient.send(command);\n\n\t\t\t\tif (response.Messages && response.Messages.length > 0) {\n\t\t\t\t\tawait this.processMessages(response.Messages);\n\t\t\t\t}\n\t\t\t} catch (_error) {\n\t\t\t\tawait this.sleep(1000);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate async processMessages(messages: Message[]): Promise<void> {\n\t\tfor (const message of messages) {\n\t\t\ttry {\n\t\t\t\tif (!message.Body) continue;\n\n\t\t\t\t// Try to parse as SNS message first\n\t\t\t\tconst parsedMessage = this.parseMessage(message.Body);\n\n\t\t\t\tif (!parsedMessage) {\n\t\t\t\t\t// Not a valid message format\n\t\t\t\t\tawait this.deleteMessage(message.ReceiptHandle!);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst { payload, messageType, topicArn } = parsedMessage;\n\n\t\t\t\t// If expectedTopicArn is set, verify the message is from that topic\n\t\t\t\tif (this.options.expectedTopicArn && topicArn) {\n\t\t\t\t\tif (topicArn !== this.options.expectedTopicArn) {\n\t\t\t\t\t\tawait this.deleteMessage(message.ReceiptHandle!);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Check if we're subscribed to this message type\n\t\t\t\tif (\n\t\t\t\t\tmessageType &&\n\t\t\t\t\tthis.messageTypes.has(messageType as TMessage['type'])\n\t\t\t\t) {\n\t\t\t\t\t// Call listener\n\t\t\t\t\tif (this.listener) {\n\t\t\t\t\t\tawait this.listener(payload as TMessage);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Delete message after successful processing\n\t\t\t\t\tawait this.deleteMessage(message.ReceiptHandle!);\n\t\t\t\t} else {\n\t\t\t\t\t// Delete messages we're not subscribed to\n\t\t\t\t\tawait this.deleteMessage(message.ReceiptHandle!);\n\t\t\t\t}\n\t\t\t} catch (_error) {\n\t\t\t\t// Message will become visible again\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Parse message body - handles both direct SQS messages and SNS-wrapped messages\n\t */\n\tprivate parseMessage(body: string): {\n\t\tpayload: unknown;\n\t\tmessageType: string | undefined;\n\t\ttopicArn?: string;\n\t} | null {\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(body);\n\n\t\t\t// Check if this is an SNS notification wrapper\n\t\t\tif (parsed.Type === 'Notification' && parsed.Message) {\n\t\t\t\t// This is an SNS message\n\t\t\t\tconst snsMessage = JSON.parse(parsed.Message);\n\t\t\t\tconst messageType =\n\t\t\t\t\tparsed.MessageAttributes?.type?.Value || snsMessage.type;\n\n\t\t\t\treturn {\n\t\t\t\t\tpayload: snsMessage,\n\t\t\t\t\tmessageType,\n\t\t\t\t\ttopicArn: parsed.TopicArn,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// This is a direct SQS message\n\t\t\treturn {\n\t\t\t\tpayload: parsed,\n\t\t\t\tmessageType: parsed.type,\n\t\t\t};\n\t\t} catch (_error) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate async deleteMessage(receiptHandle: string): Promise<void> {\n\t\ttry {\n\t\t\tconst command = new DeleteMessageCommand({\n\t\t\t\tQueueUrl: this.connection.queueUrl,\n\t\t\t\tReceiptHandle: receiptHandle,\n\t\t\t});\n\t\t\tawait this.connection.sqsClient.send(command);\n\t\t} catch (_error) {}\n\t}\n\n\tprivate sleep(ms: number): Promise<void> {\n\t\treturn new Promise((resolve) => setTimeout(resolve, ms));\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA2BA,IAAa,gBAAb,MAEA;CACC,AAAQ,UAAU;CAClB,AAAQ,+BAAsC,IAAI;CAClD,AAAQ;CACR,AAAQ;CAER,YACSA,YACRC,UAAgC,CAAE,GACjC;EAFO;AAGR,OAAK,UAAU;GACd,iBAAiB,QAAQ,mBAAmB;GAC5C,aAAa,QAAQ,eAAe;GACpC,kBAAkB,QAAQ,oBAAoB;EAC9C;CACD;CAED,MAAM,UACLC,UACAC,UACgB;AAChB,OAAK,eAAe,IAAI,IAAI;AAC5B,OAAK,WAAW;AAEhB,OAAK,KAAK,WAAW,aAAa,CACjC,OAAM,KAAK,WAAW,SAAS;AAGhC,OAAK,UAAU;AACf,OAAK,MAAM;CACX;CAED,OAAa;AACZ,OAAK,UAAU;CACf;CAED,MAAc,OAAsB;AACnC,SAAO,KAAK,QACX,KAAI;GACH,MAAM,UAAU,IAAIC,2CAAsB;IACzC,UAAU,KAAK,WAAW;IAC1B,qBAAqB,KAAK,QAAQ;IAClC,iBAAiB,KAAK,QAAQ;IAC9B,uBAAuB,CAAC,KAAM;GAC9B;GAED,MAAM,WAAW,MAAM,KAAK,WAAW,UAAU,KAAK,QAAQ;AAE9D,OAAI,SAAS,YAAY,SAAS,SAAS,SAAS,EACnD,OAAM,KAAK,gBAAgB,SAAS,SAAS;EAE9C,SAAQ,QAAQ;AAChB,SAAM,KAAK,MAAM,IAAK;EACtB;CAEF;CAED,MAAc,gBAAgBC,UAAoC;AACjE,OAAK,MAAM,WAAW,SACrB,KAAI;AACH,QAAK,QAAQ,KAAM;GAGnB,MAAM,gBAAgB,KAAK,aAAa,QAAQ,KAAK;AAErD,QAAK,eAAe;AAEnB,UAAM,KAAK,cAAc,QAAQ,cAAe;AAChD;GACA;GAED,MAAM,EAAE,SAAS,aAAa,UAAU,GAAG;AAG3C,OAAI,KAAK,QAAQ,oBAAoB,UACpC;QAAI,aAAa,KAAK,QAAQ,kBAAkB;AAC/C,WAAM,KAAK,cAAc,QAAQ,cAAe;AAChD;IACA;;AAIF,OACC,eACA,KAAK,aAAa,IAAI,YAAgC,EACrD;AAED,QAAI,KAAK,SACR,OAAM,KAAK,SAAS,QAAoB;AAIzC,UAAM,KAAK,cAAc,QAAQ,cAAe;GAChD,MAEA,OAAM,KAAK,cAAc,QAAQ,cAAe;EAEjD,SAAQ,QAAQ,CAEhB;CAEF;;;;CAKD,AAAQ,aAAaC,MAIZ;AACR,MAAI;GACH,MAAM,SAAS,KAAK,MAAM,KAAK;AAG/B,OAAI,OAAO,SAAS,kBAAkB,OAAO,SAAS;IAErD,MAAM,aAAa,KAAK,MAAM,OAAO,QAAQ;IAC7C,MAAM,cACL,OAAO,mBAAmB,MAAM,SAAS,WAAW;AAErD,WAAO;KACN,SAAS;KACT;KACA,UAAU,OAAO;IACjB;GACD;AAGD,UAAO;IACN,SAAS;IACT,aAAa,OAAO;GACpB;EACD,SAAQ,QAAQ;AAChB,UAAO;EACP;CACD;CAED,MAAc,cAAcC,eAAsC;AACjE,MAAI;GACH,MAAM,UAAU,IAAIC,0CAAqB;IACxC,UAAU,KAAK,WAAW;IAC1B,eAAe;GACf;AACD,SAAM,KAAK,WAAW,UAAU,KAAK,QAAQ;EAC7C,SAAQ,QAAQ,CAAE;CACnB;CAED,AAAQ,MAAMC,IAA2B;AACxC,SAAO,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,GAAG;CACvD;AACD"}
1
+ {"version":3,"file":"SQSSubscriber-YXPlg2rm.cjs","names":["connection: SQSConnection","options: SQSSubscriberOptions","messages: TMessage['type'][]","listener: (payload: TMessage) => Promise<void>","ReceiveMessageCommand","messages: Message[]","body: string","receiptHandle: string","DeleteMessageCommand","ms: number"],"sources":["../src/sqs/SQSSubscriber.ts"],"sourcesContent":["import {\n\tDeleteMessageCommand,\n\ttype Message,\n\tReceiveMessageCommand,\n} from '@aws-sdk/client-sqs';\nimport type { EventSubscriber, PublishableMessage } from '../types';\nimport type { SQSConnection } from './SQSConnection';\n\nexport interface SQSSubscriberOptions {\n\twaitTimeSeconds?: number; // SQS long polling (default: 20)\n\tmaxMessages?: number; // Max messages per poll (default: 10)\n\texpectedTopicArn?: string; // Optional: verify messages are from specific SNS topic\n}\n\n/**\n * SQS Subscriber - receives messages from an SQS queue\n *\n * This subscriber can receive:\n * 1. Direct SQS messages\n * 2. SNS messages that were pushed to the queue (SNS → SQS pattern)\n *\n * When receiving SNS messages, it:\n * - Automatically detects and parses the SNS wrapper format\n * - Filters by TopicArn (if expectedTopicArn is provided)\n * - Filters by message type\n * - Processes the actual message payload\n */\nexport class SQSSubscriber<TMessage extends PublishableMessage<string, any>>\n\timplements EventSubscriber<TMessage>\n{\n\tprivate polling = false;\n\tprivate messageTypes: Set<TMessage['type']> = new Set();\n\tprivate listener?: (payload: TMessage) => Promise<void>;\n\tprivate options: Required<SQSSubscriberOptions>;\n\n\tconstructor(\n\t\tprivate connection: SQSConnection,\n\t\toptions: SQSSubscriberOptions = {},\n\t) {\n\t\tthis.options = {\n\t\t\twaitTimeSeconds: options.waitTimeSeconds ?? 20,\n\t\t\tmaxMessages: options.maxMessages ?? 10,\n\t\t\texpectedTopicArn: options.expectedTopicArn ?? '',\n\t\t};\n\t}\n\n\tasync subscribe(\n\t\tmessages: TMessage['type'][],\n\t\tlistener: (payload: TMessage) => Promise<void>,\n\t): Promise<void> {\n\t\tthis.messageTypes = new Set(messages);\n\t\tthis.listener = listener;\n\n\t\tif (!this.connection.isConnected()) {\n\t\t\tawait this.connection.connect();\n\t\t}\n\n\t\tthis.polling = true;\n\t\tthis.poll();\n\t}\n\n\tstop(): void {\n\t\tthis.polling = false;\n\t}\n\n\tprivate async poll(): Promise<void> {\n\t\twhile (this.polling) {\n\t\t\ttry {\n\t\t\t\tconst command = new ReceiveMessageCommand({\n\t\t\t\t\tQueueUrl: this.connection.queueUrl,\n\t\t\t\t\tMaxNumberOfMessages: this.options.maxMessages,\n\t\t\t\t\tWaitTimeSeconds: this.options.waitTimeSeconds,\n\t\t\t\t\tMessageAttributeNames: ['All'],\n\t\t\t\t});\n\n\t\t\t\tconst response = await this.connection.sqsClient.send(command);\n\n\t\t\t\tif (response.Messages && response.Messages.length > 0) {\n\t\t\t\t\tawait this.processMessages(response.Messages);\n\t\t\t\t}\n\t\t\t} catch (_error) {\n\t\t\t\tawait this.sleep(1000);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate async processMessages(messages: Message[]): Promise<void> {\n\t\tfor (const message of messages) {\n\t\t\ttry {\n\t\t\t\tif (!message.Body) continue;\n\n\t\t\t\t// Try to parse as SNS message first\n\t\t\t\tconst parsedMessage = this.parseMessage(message.Body);\n\n\t\t\t\tif (!parsedMessage) {\n\t\t\t\t\t// Not a valid message format\n\t\t\t\t\tawait this.deleteMessage(message.ReceiptHandle!);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst { payload, messageType, topicArn } = parsedMessage;\n\n\t\t\t\t// If expectedTopicArn is set, verify the message is from that topic\n\t\t\t\tif (this.options.expectedTopicArn && topicArn) {\n\t\t\t\t\tif (topicArn !== this.options.expectedTopicArn) {\n\t\t\t\t\t\tawait this.deleteMessage(message.ReceiptHandle!);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Check if we're subscribed to this message type\n\t\t\t\tif (\n\t\t\t\t\tmessageType &&\n\t\t\t\t\tthis.messageTypes.has(messageType as TMessage['type'])\n\t\t\t\t) {\n\t\t\t\t\t// Call listener\n\t\t\t\t\tif (this.listener) {\n\t\t\t\t\t\tawait this.listener(payload as TMessage);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Delete message after successful processing\n\t\t\t\t\tawait this.deleteMessage(message.ReceiptHandle!);\n\t\t\t\t} else {\n\t\t\t\t\t// Delete messages we're not subscribed to\n\t\t\t\t\tawait this.deleteMessage(message.ReceiptHandle!);\n\t\t\t\t}\n\t\t\t} catch (_error) {\n\t\t\t\t// Message will become visible again\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Parse message body - handles both direct SQS messages and SNS-wrapped messages\n\t */\n\tprivate parseMessage(body: string): {\n\t\tpayload: unknown;\n\t\tmessageType: string | undefined;\n\t\ttopicArn?: string;\n\t} | null {\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(body);\n\n\t\t\t// Check if this is an SNS notification wrapper\n\t\t\tif (parsed.Type === 'Notification' && parsed.Message) {\n\t\t\t\t// This is an SNS message\n\t\t\t\tconst snsMessage = JSON.parse(parsed.Message);\n\t\t\t\tconst messageType =\n\t\t\t\t\tparsed.MessageAttributes?.type?.Value || snsMessage.type;\n\n\t\t\t\treturn {\n\t\t\t\t\tpayload: snsMessage,\n\t\t\t\t\tmessageType,\n\t\t\t\t\ttopicArn: parsed.TopicArn,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// This is a direct SQS message\n\t\t\treturn {\n\t\t\t\tpayload: parsed,\n\t\t\t\tmessageType: parsed.type,\n\t\t\t};\n\t\t} catch (_error) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate async deleteMessage(receiptHandle: string): Promise<void> {\n\t\ttry {\n\t\t\tconst command = new DeleteMessageCommand({\n\t\t\t\tQueueUrl: this.connection.queueUrl,\n\t\t\t\tReceiptHandle: receiptHandle,\n\t\t\t});\n\t\t\tawait this.connection.sqsClient.send(command);\n\t\t} catch (_error) {}\n\t}\n\n\tprivate sleep(ms: number): Promise<void> {\n\t\treturn new Promise((resolve) => setTimeout(resolve, ms));\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA2BA,IAAa,gBAAb,MAEA;CACC,AAAQ,UAAU;CAClB,AAAQ,+BAAsC,IAAI;CAClD,AAAQ;CACR,AAAQ;CAER,YACSA,YACRC,UAAgC,CAAE,GACjC;EAFO;AAGR,OAAK,UAAU;GACd,iBAAiB,QAAQ,mBAAmB;GAC5C,aAAa,QAAQ,eAAe;GACpC,kBAAkB,QAAQ,oBAAoB;EAC9C;CACD;CAED,MAAM,UACLC,UACAC,UACgB;AAChB,OAAK,eAAe,IAAI,IAAI;AAC5B,OAAK,WAAW;AAEhB,OAAK,KAAK,WAAW,aAAa,CACjC,OAAM,KAAK,WAAW,SAAS;AAGhC,OAAK,UAAU;AACf,OAAK,MAAM;CACX;CAED,OAAa;AACZ,OAAK,UAAU;CACf;CAED,MAAc,OAAsB;AACnC,SAAO,KAAK,QACX,KAAI;GACH,MAAM,UAAU,IAAIC,2CAAsB;IACzC,UAAU,KAAK,WAAW;IAC1B,qBAAqB,KAAK,QAAQ;IAClC,iBAAiB,KAAK,QAAQ;IAC9B,uBAAuB,CAAC,KAAM;GAC9B;GAED,MAAM,WAAW,MAAM,KAAK,WAAW,UAAU,KAAK,QAAQ;AAE9D,OAAI,SAAS,YAAY,SAAS,SAAS,SAAS,EACnD,OAAM,KAAK,gBAAgB,SAAS,SAAS;EAE9C,SAAQ,QAAQ;AAChB,SAAM,KAAK,MAAM,IAAK;EACtB;CAEF;CAED,MAAc,gBAAgBC,UAAoC;AACjE,OAAK,MAAM,WAAW,SACrB,KAAI;AACH,QAAK,QAAQ,KAAM;GAGnB,MAAM,gBAAgB,KAAK,aAAa,QAAQ,KAAK;AAErD,QAAK,eAAe;AAEnB,UAAM,KAAK,cAAc,QAAQ,cAAe;AAChD;GACA;GAED,MAAM,EAAE,SAAS,aAAa,UAAU,GAAG;AAG3C,OAAI,KAAK,QAAQ,oBAAoB,UACpC;QAAI,aAAa,KAAK,QAAQ,kBAAkB;AAC/C,WAAM,KAAK,cAAc,QAAQ,cAAe;AAChD;IACA;;AAIF,OACC,eACA,KAAK,aAAa,IAAI,YAAgC,EACrD;AAED,QAAI,KAAK,SACR,OAAM,KAAK,SAAS,QAAoB;AAIzC,UAAM,KAAK,cAAc,QAAQ,cAAe;GAChD,MAEA,OAAM,KAAK,cAAc,QAAQ,cAAe;EAEjD,SAAQ,QAAQ,CAEhB;CAEF;;;;CAKD,AAAQ,aAAaC,MAIZ;AACR,MAAI;GACH,MAAM,SAAS,KAAK,MAAM,KAAK;AAG/B,OAAI,OAAO,SAAS,kBAAkB,OAAO,SAAS;IAErD,MAAM,aAAa,KAAK,MAAM,OAAO,QAAQ;IAC7C,MAAM,cACL,OAAO,mBAAmB,MAAM,SAAS,WAAW;AAErD,WAAO;KACN,SAAS;KACT;KACA,UAAU,OAAO;IACjB;GACD;AAGD,UAAO;IACN,SAAS;IACT,aAAa,OAAO;GACpB;EACD,SAAQ,QAAQ;AAChB,UAAO;EACP;CACD;CAED,MAAc,cAAcC,eAAsC;AACjE,MAAI;GACH,MAAM,UAAU,IAAIC,0CAAqB;IACxC,UAAU,KAAK,WAAW;IAC1B,eAAe;GACf;AACD,SAAM,KAAK,WAAW,UAAU,KAAK,QAAQ;EAC7C,SAAQ,QAAQ,CAAE;CACnB;CAED,AAAQ,MAAMC,IAA2B;AACxC,SAAO,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,GAAG;CACvD;AACD"}
@@ -1,8 +1,71 @@
1
- require('../types-Byv8N9ma.cjs');
2
- const require_BasicConnection = require('../BasicConnection-CxfNEvlb.cjs');
3
- const require_BasicPublisher = require('../BasicPublisher-CXAVKxgq.cjs');
4
- const require_BasicSubscriber = require('../BasicSubscriber-mVJRMXhZ.cjs');
5
-
6
- exports.BasicConnection = require_BasicConnection.BasicConnection;
7
- exports.BasicPublisher = require_BasicPublisher.BasicPublisher;
8
- exports.BasicSubscriber = require_BasicSubscriber.BasicSubscriber;
1
+ const require_chunk = require('../chunk-CsX-DzYB.cjs');
2
+ const require_types = require('../types-Byv8N9ma.cjs');
3
+ const node_events = require_chunk.__toESM(require("node:events"));
4
+
5
+ //#region src/basic/BasicConnection.ts
6
+ var BasicConnection = class BasicConnection {
7
+ type = require_types.EventPublisherType.Basic;
8
+ emitter;
9
+ connected = false;
10
+ constructor() {
11
+ this.emitter = new node_events.EventEmitter();
12
+ }
13
+ /**
14
+ * Create a BasicConnection from a connection string
15
+ * Format: basic://
16
+ */
17
+ static async fromConnectionString(_connectionString) {
18
+ const connection = new BasicConnection();
19
+ await connection.connect();
20
+ return connection;
21
+ }
22
+ async connect() {
23
+ this.connected = true;
24
+ }
25
+ async close() {
26
+ this.emitter.removeAllListeners();
27
+ this.connected = false;
28
+ }
29
+ isConnected() {
30
+ return this.connected;
31
+ }
32
+ /**
33
+ * Get the underlying EventEmitter
34
+ * Used by BasicPublisher and BasicSubscriber
35
+ */
36
+ get eventEmitter() {
37
+ return this.emitter;
38
+ }
39
+ };
40
+
41
+ //#endregion
42
+ //#region src/basic/BasicPublisher.ts
43
+ var BasicPublisher = class {
44
+ constructor(connection) {
45
+ this.connection = connection;
46
+ }
47
+ async publish(messages) {
48
+ const emitter = this.connection.eventEmitter;
49
+ for (const message of messages) emitter.emit(message.type, message);
50
+ }
51
+ };
52
+
53
+ //#endregion
54
+ //#region src/basic/BasicSubscriber.ts
55
+ var BasicSubscriber = class {
56
+ constructor(connection) {
57
+ this.connection = connection;
58
+ }
59
+ async subscribe(messages, listener) {
60
+ const emitter = this.connection.eventEmitter;
61
+ for (const messageType of messages) emitter.on(messageType, (message) => {
62
+ listener(message).catch((_error) => {});
63
+ });
64
+ }
65
+ };
66
+
67
+ //#endregion
68
+ exports.BasicConnection = BasicConnection;
69
+ exports.BasicPublisher = BasicPublisher;
70
+ exports.BasicSubscriber = BasicSubscriber;
71
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["EventPublisherType","EventEmitter","_connectionString: string","connection: BasicConnection","messages: TMessage[]","connection: BasicConnection","messages: TMessage['type'][]","listener: (payload: TMessage) => Promise<void>","message: TMessage"],"sources":["../../src/basic/BasicConnection.ts","../../src/basic/BasicPublisher.ts","../../src/basic/BasicSubscriber.ts"],"sourcesContent":["import { EventEmitter } from 'node:events';\nimport type { EventConnection } from '../types';\nimport { EventPublisherType } from '../types';\n\nexport class BasicConnection implements EventConnection {\n\treadonly type = EventPublisherType.Basic;\n\tprivate emitter: EventEmitter;\n\tprivate connected = false;\n\n\tconstructor() {\n\t\tthis.emitter = new EventEmitter();\n\t}\n\n\t/**\n\t * Create a BasicConnection from a connection string\n\t * Format: basic://\n\t */\n\tstatic async fromConnectionString(\n\t\t_connectionString: string,\n\t): Promise<BasicConnection> {\n\t\t// Basic connection doesn't need any configuration\n\t\tconst connection = new BasicConnection();\n\t\tawait connection.connect();\n\t\treturn connection;\n\t}\n\n\tasync connect(): Promise<void> {\n\t\tthis.connected = true;\n\t}\n\n\tasync close(): Promise<void> {\n\t\tthis.emitter.removeAllListeners();\n\t\tthis.connected = false;\n\t}\n\n\tisConnected(): boolean {\n\t\treturn this.connected;\n\t}\n\n\t/**\n\t * Get the underlying EventEmitter\n\t * Used by BasicPublisher and BasicSubscriber\n\t */\n\tget eventEmitter(): EventEmitter {\n\t\treturn this.emitter;\n\t}\n}\n","import type { EventPublisher, PublishableMessage } from '../types';\nimport type { BasicConnection } from './BasicConnection';\n\nexport class BasicPublisher<TMessage extends PublishableMessage<string, any>>\n\timplements EventPublisher<TMessage>\n{\n\tconstructor(private connection: BasicConnection) {}\n\n\tasync publish(messages: TMessage[]) {\n\t\tconst emitter = this.connection.eventEmitter;\n\t\tfor (const message of messages) {\n\t\t\temitter.emit(message.type, message);\n\t\t}\n\t}\n}\n","import type { EventSubscriber, PublishableMessage } from '../types';\nimport type { BasicConnection } from './BasicConnection';\n\nexport class BasicSubscriber<TMessage extends PublishableMessage<string, any>>\n\timplements EventSubscriber<TMessage>\n{\n\tconstructor(private connection: BasicConnection) {}\n\n\tasync subscribe(\n\t\tmessages: TMessage['type'][],\n\t\tlistener: (payload: TMessage) => Promise<void>,\n\t): Promise<void> {\n\t\tconst emitter = this.connection.eventEmitter;\n\n\t\tfor (const messageType of messages) {\n\t\t\temitter.on(messageType, (message: TMessage) => {\n\t\t\t\tlistener(message).catch((_error) => {});\n\t\t\t});\n\t\t}\n\t}\n}\n"],"mappings":";;;;;AAIA,IAAa,kBAAb,MAAa,gBAA2C;CACvD,AAAS,OAAOA,iCAAmB;CACnC,AAAQ;CACR,AAAQ,YAAY;CAEpB,cAAc;AACb,OAAK,UAAU,IAAIC;CACnB;;;;;CAMD,aAAa,qBACZC,mBAC2B;EAE3B,MAAM,aAAa,IAAI;AACvB,QAAM,WAAW,SAAS;AAC1B,SAAO;CACP;CAED,MAAM,UAAyB;AAC9B,OAAK,YAAY;CACjB;CAED,MAAM,QAAuB;AAC5B,OAAK,QAAQ,oBAAoB;AACjC,OAAK,YAAY;CACjB;CAED,cAAuB;AACtB,SAAO,KAAK;CACZ;;;;;CAMD,IAAI,eAA6B;AAChC,SAAO,KAAK;CACZ;AACD;;;;AC3CD,IAAa,iBAAb,MAEA;CACC,YAAoBC,YAA6B;EAA7B;CAA+B;CAEnD,MAAM,QAAQC,UAAsB;EACnC,MAAM,UAAU,KAAK,WAAW;AAChC,OAAK,MAAM,WAAW,SACrB,SAAQ,KAAK,QAAQ,MAAM,QAAQ;CAEpC;AACD;;;;ACXD,IAAa,kBAAb,MAEA;CACC,YAAoBC,YAA6B;EAA7B;CAA+B;CAEnD,MAAM,UACLC,UACAC,UACgB;EAChB,MAAM,UAAU,KAAK,WAAW;AAEhC,OAAK,MAAM,eAAe,SACzB,SAAQ,GAAG,aAAa,CAACC,YAAsB;AAC9C,YAAS,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAE,EAAC;EACvC,EAAC;CAEH;AACD"}