@geekmidas/events 0.0.2 → 0.2.0

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 (215) hide show
  1. package/dist/{BasicConnection-C4_Y0nIj.d.mts → BasicConnection-BTRsXiuH.d.cts} +3 -2
  2. package/dist/BasicConnection-BTRsXiuH.d.cts.map +1 -0
  3. package/dist/BasicConnection-C-Cg2FJT.cjs.map +1 -1
  4. package/dist/BasicConnection-CpwybcC9.mjs.map +1 -1
  5. package/dist/{BasicConnection-CddnULuT.d.cts → BasicConnection-DIxtA7jK.d.mts} +3 -2
  6. package/dist/BasicConnection-DIxtA7jK.d.mts.map +1 -0
  7. package/dist/BasicPublisher-CXAVKxgq.cjs.map +1 -1
  8. package/dist/{BasicPublisher-DCBxaTwC.d.mts → BasicPublisher-CpJFK2oS.d.mts} +5 -3
  9. package/dist/BasicPublisher-CpJFK2oS.d.mts.map +1 -0
  10. package/dist/{BasicPublisher-V5hELHG9.d.cts → BasicPublisher-D1q0a2xp.d.cts} +5 -3
  11. package/dist/BasicPublisher-D1q0a2xp.d.cts.map +1 -0
  12. package/dist/BasicPublisher-DogbeHAH.mjs.map +1 -1
  13. package/dist/{BasicSubscriber-BB3aKeph.d.mts → BasicSubscriber-6w0Af4DD.d.mts} +5 -3
  14. package/dist/BasicSubscriber-6w0Af4DD.d.mts.map +1 -0
  15. package/dist/{BasicSubscriber-CCKfbRMo.mjs → BasicSubscriber-BJSZN22M.mjs} +2 -4
  16. package/dist/BasicSubscriber-BJSZN22M.mjs.map +1 -0
  17. package/dist/{BasicSubscriber-DOwgFw5j.d.cts → BasicSubscriber-DXxQewjc.d.cts} +5 -3
  18. package/dist/BasicSubscriber-DXxQewjc.d.cts.map +1 -0
  19. package/dist/{BasicSubscriber-BGqv3c8x.cjs → BasicSubscriber-mVJRMXhZ.cjs} +2 -4
  20. package/dist/BasicSubscriber-mVJRMXhZ.cjs.map +1 -0
  21. package/dist/{EventConnection-DZhn1Msl.d.cts → EventConnection-BaJRXdg7.d.cts} +2 -2
  22. package/dist/EventConnection-BaJRXdg7.d.cts.map +1 -0
  23. package/dist/EventConnection-ClLMoIUU.mjs.map +1 -1
  24. package/dist/EventConnection-F_N81SXu.cjs.map +1 -1
  25. package/dist/{EventConnection-DeXfLGom.d.mts → EventConnection-SOhtmxib.d.mts} +2 -2
  26. package/dist/EventConnection-SOhtmxib.d.mts.map +1 -0
  27. package/dist/EventConnection.d.cts +2 -2
  28. package/dist/EventConnection.d.mts +2 -2
  29. package/dist/{Publisher-C3m8JFXm.d.mts → Publisher-1CfcYRnm.d.mts} +4 -2
  30. package/dist/Publisher-1CfcYRnm.d.mts.map +1 -0
  31. package/dist/{Publisher-nXNVjL0e.d.cts → Publisher-BfNgvHwQ.d.cts} +4 -2
  32. package/dist/Publisher-BfNgvHwQ.d.cts.map +1 -0
  33. package/dist/Publisher-DS0aOh8r.mjs.map +1 -1
  34. package/dist/Publisher-ceu6OxCj.cjs.map +1 -1
  35. package/dist/Publisher.d.cts +2 -2
  36. package/dist/Publisher.d.mts +2 -2
  37. package/dist/{RabbitMQConnection-ungB0Zl6.cjs → RabbitMQConnection-Blj9Lo05.cjs} +2 -2
  38. package/dist/RabbitMQConnection-Blj9Lo05.cjs.map +1 -0
  39. package/dist/{RabbitMQConnection-7cWp_-_Q.d.cts → RabbitMQConnection-Bm8VCI2R.d.cts} +3 -2
  40. package/dist/RabbitMQConnection-Bm8VCI2R.d.cts.map +1 -0
  41. package/dist/{RabbitMQConnection-C2HC7J7K.d.mts → RabbitMQConnection-Ck-ktCp_.d.mts} +3 -2
  42. package/dist/RabbitMQConnection-Ck-ktCp_.d.mts.map +1 -0
  43. package/dist/{RabbitMQConnection-kU3MvN5P.mjs → RabbitMQConnection-Co7f5Xsx.mjs} +2 -2
  44. package/dist/RabbitMQConnection-Co7f5Xsx.mjs.map +1 -0
  45. package/dist/RabbitMQPublisher--DL6GM6g.cjs.map +1 -1
  46. package/dist/{RabbitMQPublisher-CpcbgrXj.d.cts → RabbitMQPublisher-COnxcWEZ.d.mts} +5 -3
  47. package/dist/RabbitMQPublisher-COnxcWEZ.d.mts.map +1 -0
  48. package/dist/RabbitMQPublisher-o_oVI3wr.mjs.map +1 -1
  49. package/dist/{RabbitMQPublisher-DDZi15Ro.d.mts → RabbitMQPublisher-qQT7-1-p.d.cts} +5 -3
  50. package/dist/RabbitMQPublisher-qQT7-1-p.d.cts.map +1 -0
  51. package/dist/{RabbitMQSubscriber-BplEJEk8.cjs → RabbitMQSubscriber-C8MYAihn.cjs} +2 -3
  52. package/dist/RabbitMQSubscriber-C8MYAihn.cjs.map +1 -0
  53. package/dist/{RabbitMQSubscriber-BJ9PTGny.d.cts → RabbitMQSubscriber-C_sZjDPU.d.mts} +5 -3
  54. package/dist/RabbitMQSubscriber-C_sZjDPU.d.mts.map +1 -0
  55. package/dist/{RabbitMQSubscriber-CIvIw8MG.d.mts → RabbitMQSubscriber-D12sssMb.d.cts} +5 -3
  56. package/dist/RabbitMQSubscriber-D12sssMb.d.cts.map +1 -0
  57. package/dist/{RabbitMQSubscriber-BaXqs5nO.mjs → RabbitMQSubscriber-DlGL0pC2.mjs} +2 -3
  58. package/dist/RabbitMQSubscriber-DlGL0pC2.mjs.map +1 -0
  59. package/dist/{SNSConnection-CAImaMM2.d.mts → SNSConnection-BDfQrVBO.d.cts} +3 -2
  60. package/dist/SNSConnection-BDfQrVBO.d.cts.map +1 -0
  61. package/dist/SNSConnection-D7wCf9Si.mjs.map +1 -1
  62. package/dist/SNSConnection-DVsC_pbB.cjs.map +1 -1
  63. package/dist/{SNSConnection-Cqbr7-Ho.d.cts → SNSConnection-mHb10nQ6.d.mts} +3 -2
  64. package/dist/SNSConnection-mHb10nQ6.d.mts.map +1 -0
  65. package/dist/{SNSPublisher-BZ6N3JI9.cjs → SNSPublisher-BoA8uLnw.cjs} +2 -3
  66. package/dist/SNSPublisher-BoA8uLnw.cjs.map +1 -0
  67. package/dist/{SNSPublisher-Dkhb4LU-.d.mts → SNSPublisher-CM7UAWtf.d.mts} +7 -6
  68. package/dist/SNSPublisher-CM7UAWtf.d.mts.map +1 -0
  69. package/dist/{SNSPublisher-BfWjzNiB.mjs → SNSPublisher-Drr4kHn6.mjs} +2 -3
  70. package/dist/SNSPublisher-Drr4kHn6.mjs.map +1 -0
  71. package/dist/{SNSPublisher-RVZFa7kL.d.cts → SNSPublisher-kpsSlGDn.d.cts} +7 -6
  72. package/dist/SNSPublisher-kpsSlGDn.d.cts.map +1 -0
  73. package/dist/{SNSSubscriber-C9YJWa7m.mjs → SNSSubscriber-CBIvQpqK.mjs} +4 -8
  74. package/dist/SNSSubscriber-CBIvQpqK.mjs.map +1 -0
  75. package/dist/{SNSSubscriber-UE0ia4XM.cjs → SNSSubscriber-CWiAJjpU.cjs} +4 -8
  76. package/dist/SNSSubscriber-CWiAJjpU.cjs.map +1 -0
  77. package/dist/{SNSSubscriber-B31JmkAE.d.mts → SNSSubscriber-DDB3--pm.d.cts} +4 -3
  78. package/dist/SNSSubscriber-DDB3--pm.d.cts.map +1 -0
  79. package/dist/{SNSSubscriber-k2UwKUxu.d.cts → SNSSubscriber-Dwo8391f.d.mts} +4 -3
  80. package/dist/SNSSubscriber-Dwo8391f.d.mts.map +1 -0
  81. package/dist/{SQSConnection-C5WFqZW7.d.mts → SQSConnection-B5Ep9Tma.d.cts} +3 -2
  82. package/dist/SQSConnection-B5Ep9Tma.d.cts.map +1 -0
  83. package/dist/{SQSConnection-geav2Rsn.d.cts → SQSConnection-BI_xOzyJ.d.mts} +3 -2
  84. package/dist/SQSConnection-BI_xOzyJ.d.mts.map +1 -0
  85. package/dist/SQSConnection-BwNjUPr4.cjs.map +1 -1
  86. package/dist/SQSConnection-Eleqqre3.mjs.map +1 -1
  87. package/dist/{SQSPublisher-CdsayOLV.d.mts → SQSPublisher-BN1ds6SN.d.mts} +5 -3
  88. package/dist/SQSPublisher-BN1ds6SN.d.mts.map +1 -0
  89. package/dist/{SQSPublisher-Utb_FTe5.d.cts → SQSPublisher-DFTqwzRW.d.cts} +5 -3
  90. package/dist/SQSPublisher-DFTqwzRW.d.cts.map +1 -0
  91. package/dist/SQSPublisher-DG9o4ME3.mjs.map +1 -1
  92. package/dist/SQSPublisher-Dq5353oZ.cjs.map +1 -1
  93. package/dist/{SQSSubscriber-DZDNgLE5.cjs → SQSSubscriber-B4sRXVl6.cjs} +5 -12
  94. package/dist/SQSSubscriber-B4sRXVl6.cjs.map +1 -0
  95. package/dist/{SQSSubscriber-B6iL1EnX.d.cts → SQSSubscriber-BO2me_gs.d.cts} +4 -3
  96. package/dist/SQSSubscriber-BO2me_gs.d.cts.map +1 -0
  97. package/dist/{SQSSubscriber-CD66P7hH.mjs → SQSSubscriber-CVGhZ8Nr.mjs} +5 -12
  98. package/dist/SQSSubscriber-CVGhZ8Nr.mjs.map +1 -0
  99. package/dist/{SQSSubscriber-DBeE4XAR.d.mts → SQSSubscriber-FyZFfr2-.d.mts} +4 -3
  100. package/dist/SQSSubscriber-FyZFfr2-.d.mts.map +1 -0
  101. package/dist/Subscriber-Bd9hb_jp.mjs.map +1 -1
  102. package/dist/{Subscriber-Cff9EIpv.d.mts → Subscriber-BxT-KzFJ.d.mts} +4 -2
  103. package/dist/Subscriber-BxT-KzFJ.d.mts.map +1 -0
  104. package/dist/{Subscriber-CpAwcUzb.d.cts → Subscriber-DDD_4Nlx.d.cts} +4 -2
  105. package/dist/Subscriber-DDD_4Nlx.d.cts.map +1 -0
  106. package/dist/Subscriber-saVOWuMq.cjs.map +1 -1
  107. package/dist/Subscriber.d.cts +2 -2
  108. package/dist/Subscriber.d.mts +2 -2
  109. package/dist/basic/BasicConnection.d.cts +2 -2
  110. package/dist/basic/BasicConnection.d.mts +2 -2
  111. package/dist/basic/BasicPublisher.d.cts +3 -3
  112. package/dist/basic/BasicPublisher.d.mts +3 -3
  113. package/dist/basic/BasicSubscriber.cjs +1 -1
  114. package/dist/basic/BasicSubscriber.d.cts +3 -3
  115. package/dist/basic/BasicSubscriber.d.mts +3 -3
  116. package/dist/basic/BasicSubscriber.mjs +1 -1
  117. package/dist/basic/index.cjs +1 -1
  118. package/dist/basic/index.d.cts +4 -4
  119. package/dist/basic/index.d.mts +4 -4
  120. package/dist/basic/index.mjs +1 -1
  121. package/dist/index.d.cts +4 -4
  122. package/dist/index.d.mts +4 -4
  123. package/dist/rabbitmq/RabbitMQConnection.cjs +1 -1
  124. package/dist/rabbitmq/RabbitMQConnection.d.cts +2 -2
  125. package/dist/rabbitmq/RabbitMQConnection.d.mts +2 -2
  126. package/dist/rabbitmq/RabbitMQConnection.mjs +1 -1
  127. package/dist/rabbitmq/RabbitMQPublisher.d.cts +3 -3
  128. package/dist/rabbitmq/RabbitMQPublisher.d.mts +3 -3
  129. package/dist/rabbitmq/RabbitMQSubscriber.cjs +1 -1
  130. package/dist/rabbitmq/RabbitMQSubscriber.d.cts +3 -3
  131. package/dist/rabbitmq/RabbitMQSubscriber.d.mts +3 -3
  132. package/dist/rabbitmq/RabbitMQSubscriber.mjs +1 -1
  133. package/dist/rabbitmq/index.cjs +2 -2
  134. package/dist/rabbitmq/index.d.cts +4 -4
  135. package/dist/rabbitmq/index.d.mts +4 -4
  136. package/dist/rabbitmq/index.mjs +2 -2
  137. package/dist/sns/SNSConnection.d.cts +2 -2
  138. package/dist/sns/SNSConnection.d.mts +2 -2
  139. package/dist/sns/SNSPublisher.cjs +1 -1
  140. package/dist/sns/SNSPublisher.d.cts +3 -3
  141. package/dist/sns/SNSPublisher.d.mts +3 -3
  142. package/dist/sns/SNSPublisher.mjs +1 -1
  143. package/dist/sns/SNSSubscriber.cjs +2 -2
  144. package/dist/sns/SNSSubscriber.d.cts +3 -3
  145. package/dist/sns/SNSSubscriber.d.mts +3 -3
  146. package/dist/sns/SNSSubscriber.mjs +2 -2
  147. package/dist/sns/index.cjs +3 -3
  148. package/dist/sns/index.d.cts +4 -4
  149. package/dist/sns/index.d.mts +4 -4
  150. package/dist/sns/index.mjs +3 -3
  151. package/dist/sqs/SQSConnection.d.cts +2 -2
  152. package/dist/sqs/SQSConnection.d.mts +2 -2
  153. package/dist/sqs/SQSPublisher.d.cts +3 -3
  154. package/dist/sqs/SQSPublisher.d.mts +3 -3
  155. package/dist/sqs/SQSSubscriber.cjs +1 -1
  156. package/dist/sqs/SQSSubscriber.d.cts +3 -3
  157. package/dist/sqs/SQSSubscriber.d.mts +3 -3
  158. package/dist/sqs/SQSSubscriber.mjs +1 -1
  159. package/dist/sqs/index.cjs +1 -1
  160. package/dist/sqs/index.d.cts +4 -4
  161. package/dist/sqs/index.d.mts +4 -4
  162. package/dist/sqs/index.mjs +1 -1
  163. package/dist/types-B63qHVOG.mjs.map +1 -1
  164. package/dist/types-CvSMEO5z.cjs.map +1 -1
  165. package/dist/{types-D0g-o6wX.d.mts → types-DSVsPgKd.d.mts} +2 -1
  166. package/dist/types-DSVsPgKd.d.mts.map +1 -0
  167. package/dist/{types-DEGUg5BA.d.cts → types-Dmbp1U-6.d.cts} +2 -1
  168. package/dist/types-Dmbp1U-6.d.cts.map +1 -0
  169. package/dist/types.d.cts +1 -1
  170. package/dist/types.d.mts +1 -1
  171. package/package.json +24 -5
  172. package/src/EventConnection.ts +31 -31
  173. package/src/Publisher.ts +78 -78
  174. package/src/Subscriber.ts +91 -91
  175. package/src/__tests__/EventConnection.spec.ts +42 -0
  176. package/src/__tests__/Publisher.spec.ts +96 -0
  177. package/src/__tests__/Subscriber.spec.ts +91 -23
  178. package/src/basic/BasicConnection.ts +35 -35
  179. package/src/basic/BasicPublisher.ts +8 -8
  180. package/src/basic/BasicSubscriber.ts +13 -16
  181. package/src/basic/__tests__/BasicSubscriber.spec.ts +116 -116
  182. package/src/index.ts +13 -13
  183. package/src/rabbitmq/RabbitMQConnection.ts +139 -139
  184. package/src/rabbitmq/RabbitMQPublisher.ts +48 -48
  185. package/src/rabbitmq/RabbitMQSubscriber.ts +100 -102
  186. package/src/rabbitmq/__tests__/RabbitMQPublisher.spec.ts +364 -364
  187. package/src/rabbitmq/__tests__/RabbitMQSubscriber.spec.ts +204 -204
  188. package/src/rabbitmq/index.ts +3 -3
  189. package/src/sns/SNSConnection.ts +76 -76
  190. package/src/sns/SNSPublisher.ts +54 -56
  191. package/src/sns/SNSSubscriber.ts +187 -191
  192. package/src/sns/__tests__/SNS-SQS-Integration.spec.ts +321 -321
  193. package/src/sns/__tests__/SNSPublisher.spec.ts +449 -0
  194. package/src/sns/__tests__/SNSSubscriber.spec.ts +527 -0
  195. package/src/sns/index.ts +3 -3
  196. package/src/sqs/SQSConnection.ts +75 -75
  197. package/src/sqs/SQSPublisher.ts +93 -93
  198. package/src/sqs/SQSSubscriber.ts +157 -165
  199. package/src/sqs/__tests__/SQSPublisher.spec.ts +178 -178
  200. package/src/sqs/index.ts +3 -3
  201. package/src/types.ts +28 -29
  202. package/tsconfig.json +9 -0
  203. package/tsdown.config.ts +1 -1
  204. package/dist/BasicSubscriber-BGqv3c8x.cjs.map +0 -1
  205. package/dist/BasicSubscriber-CCKfbRMo.mjs.map +0 -1
  206. package/dist/RabbitMQConnection-kU3MvN5P.mjs.map +0 -1
  207. package/dist/RabbitMQConnection-ungB0Zl6.cjs.map +0 -1
  208. package/dist/RabbitMQSubscriber-BaXqs5nO.mjs.map +0 -1
  209. package/dist/RabbitMQSubscriber-BplEJEk8.cjs.map +0 -1
  210. package/dist/SNSPublisher-BZ6N3JI9.cjs.map +0 -1
  211. package/dist/SNSPublisher-BfWjzNiB.mjs.map +0 -1
  212. package/dist/SNSSubscriber-C9YJWa7m.mjs.map +0 -1
  213. package/dist/SNSSubscriber-UE0ia4XM.cjs.map +0 -1
  214. package/dist/SQSSubscriber-CD66P7hH.mjs.map +0 -1
  215. package/dist/SQSSubscriber-DZDNgLE5.cjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { EventConnection, EventPublisherType } from "./types-D0g-o6wX.mjs";
1
+ import { EventConnection, EventPublisherType } from "./types-Dmbp1U-6.cjs";
2
2
  import { EventEmitter } from "node:events";
3
3
 
4
4
  //#region src/basic/BasicConnection.d.ts
@@ -21,6 +21,7 @@ declare class BasicConnection implements EventConnection {
21
21
  */
22
22
  get eventEmitter(): EventEmitter;
23
23
  }
24
+ //# sourceMappingURL=BasicConnection.d.ts.map
24
25
  //#endregion
25
26
  export { BasicConnection };
26
- //# sourceMappingURL=BasicConnection-C4_Y0nIj.d.mts.map
27
+ //# sourceMappingURL=BasicConnection-BTRsXiuH.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BasicConnection-BTRsXiuH.d.cts","names":[],"sources":["../src/basic/BasicConnection.ts"],"sourcesContent":[],"mappings":";;;;cAIa,eAAA,YAA2B;EAA3B,SAAA,IAAA,GACC,kBAAA,CAAA,KAAA;EADe,QAAA,OAAA;EAAA,QACf,SAAA;EAAA,WAcF,CAAA;EAAe;;;;EAwBM,OAvCO,oBAAA,CAAA,iBAAA,EAAA,MAAA,CAAA,EAepC,OAfoC,CAe5B,eAf4B,CAAA;EAAe,OAAA,CAAA,CAAA,EAsBrC,OAtBqC,CAAA,IAAA,CAAA;WA0BvC;;;;;;sBAaK"}
@@ -1 +1 @@
1
- {"version":3,"file":"BasicConnection-C-Cg2FJT.cjs","names":["EventPublisherType","EventEmitter","_connectionString: string"],"sources":["../src/basic/BasicConnection.ts"],"sourcesContent":["import { EventEmitter } from 'node:events';\nimport type { EventConnection } from '../types';\nimport { EventPublisherType } from '../types';\n\nexport class BasicConnection implements EventConnection {\n readonly type = EventPublisherType.Basic;\n private emitter: EventEmitter;\n private connected = false;\n\n constructor() {\n this.emitter = new EventEmitter();\n }\n\n /**\n * Create a BasicConnection from a connection string\n * Format: basic://\n */\n static async fromConnectionString(\n _connectionString: string,\n ): Promise<BasicConnection> {\n // Basic connection doesn't need any configuration\n const connection = new BasicConnection();\n await connection.connect();\n return connection;\n }\n\n async connect(): Promise<void> {\n this.connected = true;\n }\n\n async close(): Promise<void> {\n this.emitter.removeAllListeners();\n this.connected = false;\n }\n\n isConnected(): boolean {\n return this.connected;\n }\n\n /**\n * Get the underlying EventEmitter\n * Used by BasicPublisher and BasicSubscriber\n */\n get eventEmitter(): EventEmitter {\n return this.emitter;\n }\n}\n"],"mappings":";;;;;AAIA,IAAa,kBAAb,MAAa,gBAA2C;CACtD,AAAS,OAAOA,iCAAmB;CACnC,AAAQ;CACR,AAAQ,YAAY;CAEpB,cAAc;AACZ,OAAK,UAAU,IAAIC;CACpB;;;;;CAMD,aAAa,qBACXC,mBAC0B;EAE1B,MAAM,aAAa,IAAI;AACvB,QAAM,WAAW,SAAS;AAC1B,SAAO;CACR;CAED,MAAM,UAAyB;AAC7B,OAAK,YAAY;CAClB;CAED,MAAM,QAAuB;AAC3B,OAAK,QAAQ,oBAAoB;AACjC,OAAK,YAAY;CAClB;CAED,cAAuB;AACrB,SAAO,KAAK;CACb;;;;;CAMD,IAAI,eAA6B;AAC/B,SAAO,KAAK;CACb;AACF"}
1
+ {"version":3,"file":"BasicConnection-C-Cg2FJT.cjs","names":["EventPublisherType","EventEmitter","_connectionString: string"],"sources":["../src/basic/BasicConnection.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"],"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"BasicConnection-CpwybcC9.mjs","names":["_connectionString: string"],"sources":["../src/basic/BasicConnection.ts"],"sourcesContent":["import { EventEmitter } from 'node:events';\nimport type { EventConnection } from '../types';\nimport { EventPublisherType } from '../types';\n\nexport class BasicConnection implements EventConnection {\n readonly type = EventPublisherType.Basic;\n private emitter: EventEmitter;\n private connected = false;\n\n constructor() {\n this.emitter = new EventEmitter();\n }\n\n /**\n * Create a BasicConnection from a connection string\n * Format: basic://\n */\n static async fromConnectionString(\n _connectionString: string,\n ): Promise<BasicConnection> {\n // Basic connection doesn't need any configuration\n const connection = new BasicConnection();\n await connection.connect();\n return connection;\n }\n\n async connect(): Promise<void> {\n this.connected = true;\n }\n\n async close(): Promise<void> {\n this.emitter.removeAllListeners();\n this.connected = false;\n }\n\n isConnected(): boolean {\n return this.connected;\n }\n\n /**\n * Get the underlying EventEmitter\n * Used by BasicPublisher and BasicSubscriber\n */\n get eventEmitter(): EventEmitter {\n return this.emitter;\n }\n}\n"],"mappings":";;;;AAIA,IAAa,kBAAb,MAAa,gBAA2C;CACtD,AAAS,OAAO,mBAAmB;CACnC,AAAQ;CACR,AAAQ,YAAY;CAEpB,cAAc;AACZ,OAAK,UAAU,IAAI;CACpB;;;;;CAMD,aAAa,qBACXA,mBAC0B;EAE1B,MAAM,aAAa,IAAI;AACvB,QAAM,WAAW,SAAS;AAC1B,SAAO;CACR;CAED,MAAM,UAAyB;AAC7B,OAAK,YAAY;CAClB;CAED,MAAM,QAAuB;AAC3B,OAAK,QAAQ,oBAAoB;AACjC,OAAK,YAAY;CAClB;CAED,cAAuB;AACrB,SAAO,KAAK;CACb;;;;;CAMD,IAAI,eAA6B;AAC/B,SAAO,KAAK;CACb;AACF"}
1
+ {"version":3,"file":"BasicConnection-CpwybcC9.mjs","names":["_connectionString: string"],"sources":["../src/basic/BasicConnection.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"],"mappings":";;;;AAIA,IAAa,kBAAb,MAAa,gBAA2C;CACvD,AAAS,OAAO,mBAAmB;CACnC,AAAQ;CACR,AAAQ,YAAY;CAEpB,cAAc;AACb,OAAK,UAAU,IAAI;CACnB;;;;;CAMD,aAAa,qBACZA,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"}
@@ -1,4 +1,4 @@
1
- import { EventConnection, EventPublisherType } from "./types-DEGUg5BA.cjs";
1
+ import { EventConnection, EventPublisherType } from "./types-DSVsPgKd.mjs";
2
2
  import { EventEmitter } from "node:events";
3
3
 
4
4
  //#region src/basic/BasicConnection.d.ts
@@ -21,6 +21,7 @@ declare class BasicConnection implements EventConnection {
21
21
  */
22
22
  get eventEmitter(): EventEmitter;
23
23
  }
24
+ //# sourceMappingURL=BasicConnection.d.ts.map
24
25
  //#endregion
25
26
  export { BasicConnection };
26
- //# sourceMappingURL=BasicConnection-CddnULuT.d.cts.map
27
+ //# sourceMappingURL=BasicConnection-DIxtA7jK.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BasicConnection-DIxtA7jK.d.mts","names":[],"sources":["../src/basic/BasicConnection.ts"],"sourcesContent":[],"mappings":";;;;cAIa,eAAA,YAA2B;EAA3B,SAAA,IAAA,GACC,kBAAA,CAAA,KAAA;EADe,QAAA,OAAA;EAAA,QACf,SAAA;EAAA,WAcF,CAAA;EAAe;;;;EAwBM,OAvCO,oBAAA,CAAA,iBAAA,EAAA,MAAA,CAAA,EAepC,OAfoC,CAe5B,eAf4B,CAAA;EAAe,OAAA,CAAA,CAAA,EAsBrC,OAtBqC,CAAA,IAAA,CAAA;WA0BvC;;;;;;sBAaK"}
@@ -1 +1 @@
1
- {"version":3,"file":"BasicPublisher-CXAVKxgq.cjs","names":["connection: BasicConnection","messages: TMessage[]"],"sources":["../src/basic/BasicPublisher.ts"],"sourcesContent":["import type { EventPublisher, PublishableMessage } from '../types';\nimport type { BasicConnection } from './BasicConnection';\n\nexport class BasicPublisher<TMessage extends PublishableMessage<string, any>>\n implements EventPublisher<TMessage>\n{\n constructor(private connection: BasicConnection) {}\n\n async publish(messages: TMessage[]) {\n const emitter = this.connection.eventEmitter;\n for (const message of messages) {\n emitter.emit(message.type, message);\n }\n }\n}\n"],"mappings":";;AAGA,IAAa,iBAAb,MAEA;CACE,YAAoBA,YAA6B;EAA7B;CAA+B;CAEnD,MAAM,QAAQC,UAAsB;EAClC,MAAM,UAAU,KAAK,WAAW;AAChC,OAAK,MAAM,WAAW,SACpB,SAAQ,KAAK,QAAQ,MAAM,QAAQ;CAEtC;AACF"}
1
+ {"version":3,"file":"BasicPublisher-CXAVKxgq.cjs","names":["connection: BasicConnection","messages: TMessage[]"],"sources":["../src/basic/BasicPublisher.ts"],"sourcesContent":["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"],"mappings":";;AAGA,IAAa,iBAAb,MAEA;CACC,YAAoBA,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"}
@@ -1,5 +1,5 @@
1
- import { EventPublisher, PublishableMessage } from "./types-D0g-o6wX.mjs";
2
- import { BasicConnection } from "./BasicConnection-C4_Y0nIj.mjs";
1
+ import { EventPublisher, PublishableMessage } from "./types-DSVsPgKd.mjs";
2
+ import { BasicConnection } from "./BasicConnection-DIxtA7jK.mjs";
3
3
 
4
4
  //#region src/basic/BasicPublisher.d.ts
5
5
  declare class BasicPublisher<TMessage extends PublishableMessage<string, any>> implements EventPublisher<TMessage> {
@@ -7,6 +7,8 @@ declare class BasicPublisher<TMessage extends PublishableMessage<string, any>> i
7
7
  constructor(connection: BasicConnection);
8
8
  publish(messages: TMessage[]): Promise<void>;
9
9
  }
10
+ //# sourceMappingURL=BasicPublisher.d.ts.map
11
+
10
12
  //#endregion
11
13
  export { BasicPublisher };
12
- //# sourceMappingURL=BasicPublisher-DCBxaTwC.d.mts.map
14
+ //# sourceMappingURL=BasicPublisher-CpJFK2oS.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BasicPublisher-CpJFK2oS.d.mts","names":[],"sources":["../src/basic/BasicPublisher.ts"],"sourcesContent":[],"mappings":";;;;cAGa,gCAAgC,4CACjC,eAAe;;EADd,WAAA,CAAA,UAAc,EAGM,eAHN;EAAA,OAAA,CAAA,QAAA,EAKF,QALE,EAAA,CAAA,EAKQ,OALR,CAAA,IAAA,CAAA"}
@@ -1,5 +1,5 @@
1
- import { EventPublisher, PublishableMessage } from "./types-DEGUg5BA.cjs";
2
- import { BasicConnection } from "./BasicConnection-CddnULuT.cjs";
1
+ import { EventPublisher, PublishableMessage } from "./types-Dmbp1U-6.cjs";
2
+ import { BasicConnection } from "./BasicConnection-BTRsXiuH.cjs";
3
3
 
4
4
  //#region src/basic/BasicPublisher.d.ts
5
5
  declare class BasicPublisher<TMessage extends PublishableMessage<string, any>> implements EventPublisher<TMessage> {
@@ -7,6 +7,8 @@ declare class BasicPublisher<TMessage extends PublishableMessage<string, any>> i
7
7
  constructor(connection: BasicConnection);
8
8
  publish(messages: TMessage[]): Promise<void>;
9
9
  }
10
+ //# sourceMappingURL=BasicPublisher.d.ts.map
11
+
10
12
  //#endregion
11
13
  export { BasicPublisher };
12
- //# sourceMappingURL=BasicPublisher-V5hELHG9.d.cts.map
14
+ //# sourceMappingURL=BasicPublisher-D1q0a2xp.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BasicPublisher-D1q0a2xp.d.cts","names":[],"sources":["../src/basic/BasicPublisher.ts"],"sourcesContent":[],"mappings":";;;;cAGa,gCAAgC,4CACjC,eAAe;;EADd,WAAA,CAAA,UAAc,EAGM,eAHN;EAAA,OAAA,CAAA,QAAA,EAKF,QALE,EAAA,CAAA,EAKQ,OALR,CAAA,IAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"BasicPublisher-DogbeHAH.mjs","names":["connection: BasicConnection","messages: TMessage[]"],"sources":["../src/basic/BasicPublisher.ts"],"sourcesContent":["import type { EventPublisher, PublishableMessage } from '../types';\nimport type { BasicConnection } from './BasicConnection';\n\nexport class BasicPublisher<TMessage extends PublishableMessage<string, any>>\n implements EventPublisher<TMessage>\n{\n constructor(private connection: BasicConnection) {}\n\n async publish(messages: TMessage[]) {\n const emitter = this.connection.eventEmitter;\n for (const message of messages) {\n emitter.emit(message.type, message);\n }\n }\n}\n"],"mappings":";AAGA,IAAa,iBAAb,MAEA;CACE,YAAoBA,YAA6B;EAA7B;CAA+B;CAEnD,MAAM,QAAQC,UAAsB;EAClC,MAAM,UAAU,KAAK,WAAW;AAChC,OAAK,MAAM,WAAW,SACpB,SAAQ,KAAK,QAAQ,MAAM,QAAQ;CAEtC;AACF"}
1
+ {"version":3,"file":"BasicPublisher-DogbeHAH.mjs","names":["connection: BasicConnection","messages: TMessage[]"],"sources":["../src/basic/BasicPublisher.ts"],"sourcesContent":["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"],"mappings":";AAGA,IAAa,iBAAb,MAEA;CACC,YAAoBA,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"}
@@ -1,5 +1,5 @@
1
- import { EventSubscriber, PublishableMessage } from "./types-D0g-o6wX.mjs";
2
- import { BasicConnection } from "./BasicConnection-C4_Y0nIj.mjs";
1
+ import { EventSubscriber, PublishableMessage } from "./types-DSVsPgKd.mjs";
2
+ import { BasicConnection } from "./BasicConnection-DIxtA7jK.mjs";
3
3
 
4
4
  //#region src/basic/BasicSubscriber.d.ts
5
5
  declare class BasicSubscriber<TMessage extends PublishableMessage<string, any>> implements EventSubscriber<TMessage> {
@@ -7,6 +7,8 @@ declare class BasicSubscriber<TMessage extends PublishableMessage<string, any>>
7
7
  constructor(connection: BasicConnection);
8
8
  subscribe(messages: TMessage['type'][], listener: (payload: TMessage) => Promise<void>): Promise<void>;
9
9
  }
10
+ //# sourceMappingURL=BasicSubscriber.d.ts.map
11
+
10
12
  //#endregion
11
13
  export { BasicSubscriber };
12
- //# sourceMappingURL=BasicSubscriber-BB3aKeph.d.mts.map
14
+ //# sourceMappingURL=BasicSubscriber-6w0Af4DD.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BasicSubscriber-6w0Af4DD.d.mts","names":[],"sources":["../src/basic/BasicSubscriber.ts"],"sourcesContent":[],"mappings":";;;;cAGa,iCAAiC,4CAClC,gBAAgB;;EADf,WAAA,CAAA,UAAe,EAGK,eAHL;EAAA,SAAA,CAAA,QAAA,EAMhB,QANgB,CAAA,MAAA,CAAA,EAAA,EAAA,QAAA,EAAA,CAAA,OAAA,EAON,QAPM,EAAA,GAOO,OAPP,CAAA,IAAA,CAAA,CAAA,EAQxB,OARwB,CAAA,IAAA,CAAA"}
@@ -6,13 +6,11 @@ var BasicSubscriber = class {
6
6
  async subscribe(messages, listener) {
7
7
  const emitter = this.connection.eventEmitter;
8
8
  for (const messageType of messages) emitter.on(messageType, (message) => {
9
- listener(message).catch((error) => {
10
- console.error(`Error processing message ${messageType}:`, error);
11
- });
9
+ listener(message).catch((_error) => {});
12
10
  });
13
11
  }
14
12
  };
15
13
 
16
14
  //#endregion
17
15
  export { BasicSubscriber };
18
- //# sourceMappingURL=BasicSubscriber-CCKfbRMo.mjs.map
16
+ //# sourceMappingURL=BasicSubscriber-BJSZN22M.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BasicSubscriber-BJSZN22M.mjs","names":["connection: BasicConnection","messages: TMessage['type'][]","listener: (payload: TMessage) => Promise<void>","message: TMessage"],"sources":["../src/basic/BasicSubscriber.ts"],"sourcesContent":["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":";AAGA,IAAa,kBAAb,MAEA;CACC,YAAoBA,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"}
@@ -1,5 +1,5 @@
1
- import { EventSubscriber, PublishableMessage } from "./types-DEGUg5BA.cjs";
2
- import { BasicConnection } from "./BasicConnection-CddnULuT.cjs";
1
+ import { EventSubscriber, PublishableMessage } from "./types-Dmbp1U-6.cjs";
2
+ import { BasicConnection } from "./BasicConnection-BTRsXiuH.cjs";
3
3
 
4
4
  //#region src/basic/BasicSubscriber.d.ts
5
5
  declare class BasicSubscriber<TMessage extends PublishableMessage<string, any>> implements EventSubscriber<TMessage> {
@@ -7,6 +7,8 @@ declare class BasicSubscriber<TMessage extends PublishableMessage<string, any>>
7
7
  constructor(connection: BasicConnection);
8
8
  subscribe(messages: TMessage['type'][], listener: (payload: TMessage) => Promise<void>): Promise<void>;
9
9
  }
10
+ //# sourceMappingURL=BasicSubscriber.d.ts.map
11
+
10
12
  //#endregion
11
13
  export { BasicSubscriber };
12
- //# sourceMappingURL=BasicSubscriber-DOwgFw5j.d.cts.map
14
+ //# sourceMappingURL=BasicSubscriber-DXxQewjc.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BasicSubscriber-DXxQewjc.d.cts","names":[],"sources":["../src/basic/BasicSubscriber.ts"],"sourcesContent":[],"mappings":";;;;cAGa,iCAAiC,4CAClC,gBAAgB;;EADf,WAAA,CAAA,UAAe,EAGK,eAHL;EAAA,SAAA,CAAA,QAAA,EAMhB,QANgB,CAAA,MAAA,CAAA,EAAA,EAAA,QAAA,EAAA,CAAA,OAAA,EAON,QAPM,EAAA,GAOO,OAPP,CAAA,IAAA,CAAA,CAAA,EAQxB,OARwB,CAAA,IAAA,CAAA"}
@@ -7,9 +7,7 @@ var BasicSubscriber = class {
7
7
  async subscribe(messages, listener) {
8
8
  const emitter = this.connection.eventEmitter;
9
9
  for (const messageType of messages) emitter.on(messageType, (message) => {
10
- listener(message).catch((error) => {
11
- console.error(`Error processing message ${messageType}:`, error);
12
- });
10
+ listener(message).catch((_error) => {});
13
11
  });
14
12
  }
15
13
  };
@@ -21,4 +19,4 @@ Object.defineProperty(exports, 'BasicSubscriber', {
21
19
  return BasicSubscriber;
22
20
  }
23
21
  });
24
- //# sourceMappingURL=BasicSubscriber-BGqv3c8x.cjs.map
22
+ //# sourceMappingURL=BasicSubscriber-mVJRMXhZ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BasicSubscriber-mVJRMXhZ.cjs","names":["connection: BasicConnection","messages: TMessage['type'][]","listener: (payload: TMessage) => Promise<void>","message: TMessage"],"sources":["../src/basic/BasicSubscriber.ts"],"sourcesContent":["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":";;AAGA,IAAa,kBAAb,MAEA;CACC,YAAoBA,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"}
@@ -1,4 +1,4 @@
1
- import { EventConnection } from "./types-DEGUg5BA.cjs";
1
+ import { EventConnection } from "./types-Dmbp1U-6.cjs";
2
2
 
3
3
  //#region src/EventConnection.d.ts
4
4
  declare class EventConnectionFactory {
@@ -10,4 +10,4 @@ declare class EventConnectionFactory {
10
10
  }
11
11
  //#endregion
12
12
  export { EventConnectionFactory };
13
- //# sourceMappingURL=EventConnection-DZhn1Msl.d.cts.map
13
+ //# sourceMappingURL=EventConnection-BaJRXdg7.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventConnection-BaJRXdg7.d.cts","names":[],"sources":["../src/EventConnection.ts"],"sourcesContent":[],"mappings":";;;cAGa,sBAAA;;AAAb;;;EAO2B,OAAvB,oBAAA,CAAA,aAAA,EAAA,MAAA,CAAA,EAAA,OAAA,CAAQ,eAAR,CAAA;AAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"EventConnection-ClLMoIUU.mjs","names":["connectionStr: string"],"sources":["../src/EventConnection.ts"],"sourcesContent":["import type { EventConnection } from './types';\nimport { EventPublisherType } from './types';\n\nexport class EventConnectionFactory {\n /**\n * Create an EventConnection from a connection string\n * Dynamically imports the appropriate connection implementation\n */\n static async fromConnectionString(\n connectionStr: string,\n ): Promise<EventConnection> {\n const url = new URL(connectionStr);\n const protocol = url.protocol.replace(':', '') as EventPublisherType;\n\n switch (protocol) {\n case EventPublisherType.Basic: {\n const { BasicConnection } = await import('./basic');\n return BasicConnection.fromConnectionString(connectionStr);\n }\n case EventPublisherType.RabbitMQ: {\n const { RabbitMQConnection } = await import('./rabbitmq');\n return RabbitMQConnection.fromConnectionString(connectionStr);\n }\n case EventPublisherType.SQS: {\n const { SQSConnection } = await import('./sqs');\n return SQSConnection.fromConnectionString(connectionStr);\n }\n case EventPublisherType.SNS: {\n const { SNSConnection } = await import('./sns');\n return SNSConnection.fromConnectionString(connectionStr);\n }\n default:\n throw new Error(`Unsupported connection type: ${protocol}`);\n }\n }\n}\n\nexport { EventPublisherType } from './types';\nexport type { EventConnection } from './types';\n"],"mappings":";;;AAGA,IAAa,yBAAb,MAAoC;;;;;CAKlC,aAAa,qBACXA,eAC0B;EAC1B,MAAM,MAAM,IAAI,IAAI;EACpB,MAAM,WAAW,IAAI,SAAS,QAAQ,KAAK,GAAG;AAE9C,UAAQ,UAAR;GACE,KAAK,mBAAmB,OAAO;IAC7B,MAAM,EAAE,iBAAiB,GAAG,MAAM,OAAO;AACzC,WAAO,gBAAgB,qBAAqB,cAAc;GAC3D;GACD,KAAK,mBAAmB,UAAU;IAChC,MAAM,EAAE,oBAAoB,GAAG,MAAM,OAAO;AAC5C,WAAO,mBAAmB,qBAAqB,cAAc;GAC9D;GACD,KAAK,mBAAmB,KAAK;IAC3B,MAAM,EAAE,eAAe,GAAG,MAAM,OAAO;AACvC,WAAO,cAAc,qBAAqB,cAAc;GACzD;GACD,KAAK,mBAAmB,KAAK;IAC3B,MAAM,EAAE,eAAe,GAAG,MAAM,OAAO;AACvC,WAAO,cAAc,qBAAqB,cAAc;GACzD;GACD,QACE,OAAM,IAAI,OAAO,+BAA+B,SAAS;EAC5D;CACF;AACF"}
1
+ {"version":3,"file":"EventConnection-ClLMoIUU.mjs","names":["connectionStr: string"],"sources":["../src/EventConnection.ts"],"sourcesContent":["import type { EventConnection } from './types';\nimport { EventPublisherType } from './types';\n\nexport class EventConnectionFactory {\n\t/**\n\t * Create an EventConnection from a connection string\n\t * Dynamically imports the appropriate connection implementation\n\t */\n\tstatic async fromConnectionString(\n\t\tconnectionStr: string,\n\t): Promise<EventConnection> {\n\t\tconst url = new URL(connectionStr);\n\t\tconst protocol = url.protocol.replace(':', '') as EventPublisherType;\n\n\t\tswitch (protocol) {\n\t\t\tcase EventPublisherType.Basic: {\n\t\t\t\tconst { BasicConnection } = await import('./basic');\n\t\t\t\treturn BasicConnection.fromConnectionString(connectionStr);\n\t\t\t}\n\t\t\tcase EventPublisherType.RabbitMQ: {\n\t\t\t\tconst { RabbitMQConnection } = await import('./rabbitmq');\n\t\t\t\treturn RabbitMQConnection.fromConnectionString(connectionStr);\n\t\t\t}\n\t\t\tcase EventPublisherType.SQS: {\n\t\t\t\tconst { SQSConnection } = await import('./sqs');\n\t\t\t\treturn SQSConnection.fromConnectionString(connectionStr);\n\t\t\t}\n\t\t\tcase EventPublisherType.SNS: {\n\t\t\t\tconst { SNSConnection } = await import('./sns');\n\t\t\t\treturn SNSConnection.fromConnectionString(connectionStr);\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unsupported connection type: ${protocol}`);\n\t\t}\n\t}\n}\n\nexport type { EventConnection } from './types';\nexport { EventPublisherType } from './types';\n"],"mappings":";;;AAGA,IAAa,yBAAb,MAAoC;;;;;CAKnC,aAAa,qBACZA,eAC2B;EAC3B,MAAM,MAAM,IAAI,IAAI;EACpB,MAAM,WAAW,IAAI,SAAS,QAAQ,KAAK,GAAG;AAE9C,UAAQ,UAAR;GACC,KAAK,mBAAmB,OAAO;IAC9B,MAAM,EAAE,iBAAiB,GAAG,MAAM,OAAO;AACzC,WAAO,gBAAgB,qBAAqB,cAAc;GAC1D;GACD,KAAK,mBAAmB,UAAU;IACjC,MAAM,EAAE,oBAAoB,GAAG,MAAM,OAAO;AAC5C,WAAO,mBAAmB,qBAAqB,cAAc;GAC7D;GACD,KAAK,mBAAmB,KAAK;IAC5B,MAAM,EAAE,eAAe,GAAG,MAAM,OAAO;AACvC,WAAO,cAAc,qBAAqB,cAAc;GACxD;GACD,KAAK,mBAAmB,KAAK;IAC5B,MAAM,EAAE,eAAe,GAAG,MAAM,OAAO;AACvC,WAAO,cAAc,qBAAqB,cAAc;GACxD;GACD,QACC,OAAM,IAAI,OAAO,+BAA+B,SAAS;EAC1D;CACD;AACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"EventConnection-F_N81SXu.cjs","names":["connectionStr: string","EventPublisherType"],"sources":["../src/EventConnection.ts"],"sourcesContent":["import type { EventConnection } from './types';\nimport { EventPublisherType } from './types';\n\nexport class EventConnectionFactory {\n /**\n * Create an EventConnection from a connection string\n * Dynamically imports the appropriate connection implementation\n */\n static async fromConnectionString(\n connectionStr: string,\n ): Promise<EventConnection> {\n const url = new URL(connectionStr);\n const protocol = url.protocol.replace(':', '') as EventPublisherType;\n\n switch (protocol) {\n case EventPublisherType.Basic: {\n const { BasicConnection } = await import('./basic');\n return BasicConnection.fromConnectionString(connectionStr);\n }\n case EventPublisherType.RabbitMQ: {\n const { RabbitMQConnection } = await import('./rabbitmq');\n return RabbitMQConnection.fromConnectionString(connectionStr);\n }\n case EventPublisherType.SQS: {\n const { SQSConnection } = await import('./sqs');\n return SQSConnection.fromConnectionString(connectionStr);\n }\n case EventPublisherType.SNS: {\n const { SNSConnection } = await import('./sns');\n return SNSConnection.fromConnectionString(connectionStr);\n }\n default:\n throw new Error(`Unsupported connection type: ${protocol}`);\n }\n }\n}\n\nexport { EventPublisherType } from './types';\nexport type { EventConnection } from './types';\n"],"mappings":";;;AAGA,IAAa,yBAAb,MAAoC;;;;;CAKlC,aAAa,qBACXA,eAC0B;EAC1B,MAAM,MAAM,IAAI,IAAI;EACpB,MAAM,WAAW,IAAI,SAAS,QAAQ,KAAK,GAAG;AAE9C,UAAQ,UAAR;GACE,KAAKC,iCAAmB,OAAO;IAC7B,MAAM,EAAE,iBAAiB,GAAG,2CAAM;AAClC,WAAO,gBAAgB,qBAAqB,cAAc;GAC3D;GACD,KAAKA,iCAAmB,UAAU;IAChC,MAAM,EAAE,oBAAoB,GAAG,2CAAM;AACrC,WAAO,mBAAmB,qBAAqB,cAAc;GAC9D;GACD,KAAKA,iCAAmB,KAAK;IAC3B,MAAM,EAAE,eAAe,GAAG,2CAAM;AAChC,WAAO,cAAc,qBAAqB,cAAc;GACzD;GACD,KAAKA,iCAAmB,KAAK;IAC3B,MAAM,EAAE,eAAe,GAAG,2CAAM;AAChC,WAAO,cAAc,qBAAqB,cAAc;GACzD;GACD,QACE,OAAM,IAAI,OAAO,+BAA+B,SAAS;EAC5D;CACF;AACF"}
1
+ {"version":3,"file":"EventConnection-F_N81SXu.cjs","names":["connectionStr: string","EventPublisherType"],"sources":["../src/EventConnection.ts"],"sourcesContent":["import type { EventConnection } from './types';\nimport { EventPublisherType } from './types';\n\nexport class EventConnectionFactory {\n\t/**\n\t * Create an EventConnection from a connection string\n\t * Dynamically imports the appropriate connection implementation\n\t */\n\tstatic async fromConnectionString(\n\t\tconnectionStr: string,\n\t): Promise<EventConnection> {\n\t\tconst url = new URL(connectionStr);\n\t\tconst protocol = url.protocol.replace(':', '') as EventPublisherType;\n\n\t\tswitch (protocol) {\n\t\t\tcase EventPublisherType.Basic: {\n\t\t\t\tconst { BasicConnection } = await import('./basic');\n\t\t\t\treturn BasicConnection.fromConnectionString(connectionStr);\n\t\t\t}\n\t\t\tcase EventPublisherType.RabbitMQ: {\n\t\t\t\tconst { RabbitMQConnection } = await import('./rabbitmq');\n\t\t\t\treturn RabbitMQConnection.fromConnectionString(connectionStr);\n\t\t\t}\n\t\t\tcase EventPublisherType.SQS: {\n\t\t\t\tconst { SQSConnection } = await import('./sqs');\n\t\t\t\treturn SQSConnection.fromConnectionString(connectionStr);\n\t\t\t}\n\t\t\tcase EventPublisherType.SNS: {\n\t\t\t\tconst { SNSConnection } = await import('./sns');\n\t\t\t\treturn SNSConnection.fromConnectionString(connectionStr);\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unsupported connection type: ${protocol}`);\n\t\t}\n\t}\n}\n\nexport type { EventConnection } from './types';\nexport { EventPublisherType } from './types';\n"],"mappings":";;;AAGA,IAAa,yBAAb,MAAoC;;;;;CAKnC,aAAa,qBACZA,eAC2B;EAC3B,MAAM,MAAM,IAAI,IAAI;EACpB,MAAM,WAAW,IAAI,SAAS,QAAQ,KAAK,GAAG;AAE9C,UAAQ,UAAR;GACC,KAAKC,iCAAmB,OAAO;IAC9B,MAAM,EAAE,iBAAiB,GAAG,2CAAM;AAClC,WAAO,gBAAgB,qBAAqB,cAAc;GAC1D;GACD,KAAKA,iCAAmB,UAAU;IACjC,MAAM,EAAE,oBAAoB,GAAG,2CAAM;AACrC,WAAO,mBAAmB,qBAAqB,cAAc;GAC7D;GACD,KAAKA,iCAAmB,KAAK;IAC5B,MAAM,EAAE,eAAe,GAAG,2CAAM;AAChC,WAAO,cAAc,qBAAqB,cAAc;GACxD;GACD,KAAKA,iCAAmB,KAAK;IAC5B,MAAM,EAAE,eAAe,GAAG,2CAAM;AAChC,WAAO,cAAc,qBAAqB,cAAc;GACxD;GACD,QACC,OAAM,IAAI,OAAO,+BAA+B,SAAS;EAC1D;CACD;AACD"}
@@ -1,4 +1,4 @@
1
- import { EventConnection } from "./types-D0g-o6wX.mjs";
1
+ import { EventConnection } from "./types-DSVsPgKd.mjs";
2
2
 
3
3
  //#region src/EventConnection.d.ts
4
4
  declare class EventConnectionFactory {
@@ -10,4 +10,4 @@ declare class EventConnectionFactory {
10
10
  }
11
11
  //#endregion
12
12
  export { EventConnectionFactory };
13
- //# sourceMappingURL=EventConnection-DeXfLGom.d.mts.map
13
+ //# sourceMappingURL=EventConnection-SOhtmxib.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventConnection-SOhtmxib.d.mts","names":[],"sources":["../src/EventConnection.ts"],"sourcesContent":[],"mappings":";;;cAGa,sBAAA;;AAAb;;;EAO2B,OAAvB,oBAAA,CAAA,aAAA,EAAA,MAAA,CAAA,EAAA,OAAA,CAAQ,eAAR,CAAA;AAAO"}
@@ -1,3 +1,3 @@
1
- import { EventConnection, EventPublisherType } from "./types-DEGUg5BA.cjs";
2
- import { EventConnectionFactory } from "./EventConnection-DZhn1Msl.cjs";
1
+ import { EventConnection, EventPublisherType } from "./types-Dmbp1U-6.cjs";
2
+ import { EventConnectionFactory } from "./EventConnection-BaJRXdg7.cjs";
3
3
  export { EventConnection, EventConnectionFactory, EventPublisherType };
@@ -1,3 +1,3 @@
1
- import { EventConnection, EventPublisherType } from "./types-D0g-o6wX.mjs";
2
- import { EventConnectionFactory } from "./EventConnection-DeXfLGom.mjs";
1
+ import { EventConnection, EventPublisherType } from "./types-DSVsPgKd.mjs";
2
+ import { EventConnectionFactory } from "./EventConnection-SOhtmxib.mjs";
3
3
  export { EventConnection, EventConnectionFactory, EventPublisherType };
@@ -1,4 +1,4 @@
1
- import { EventConnection, EventPublisher, EventPublisherType, PublishableMessage } from "./types-D0g-o6wX.mjs";
1
+ import { EventConnection, EventPublisher, EventPublisherType, PublishableMessage } from "./types-DSVsPgKd.mjs";
2
2
 
3
3
  //#region src/Publisher.d.ts
4
4
  declare class Publisher {
@@ -14,6 +14,8 @@ declare class Publisher {
14
14
  static fromConnection<TMessage extends PublishableMessage<string, any>>(connection: EventConnection): Promise<EventPublisher<TMessage>>;
15
15
  }
16
16
  type EventPublisherConnectionString = `${EventPublisherType}://${string}`;
17
+ //# sourceMappingURL=Publisher.d.ts.map
18
+
17
19
  //#endregion
18
20
  export { EventPublisherConnectionString, Publisher };
19
- //# sourceMappingURL=Publisher-C3m8JFXm.d.mts.map
21
+ //# sourceMappingURL=Publisher-1CfcYRnm.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Publisher-1CfcYRnm.d.mts","names":[],"sources":["../src/Publisher.ts"],"sourcesContent":[],"mappings":";;;cAOa,SAAA;EAAA;;;;EAQkC,OACpB,oBAAA,CAAA,iBAHR,kBAGQ,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,aAAA,EADV,8BACU,CAAA,EAAvB,OAAuB,CAAf,cAAe,CAAA,QAAA,CAAA,CAAA;EAAQ;;;;EAgCN,OACF,cAAA,CAAA,iBAFmB,kBAEnB,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,UAAA,EADb,eACa,CAAA,EAAvB,OAAuB,CAAf,cAAe,CAAA,QAAA,CAAA,CAAA;;AAAvB,KAoCQ,8BAAA,GApCR,GAqCA,kBArCA,MAAA,MAAA,EAAA;AAAO"}
@@ -1,4 +1,4 @@
1
- import { EventConnection, EventPublisher, EventPublisherType, PublishableMessage } from "./types-DEGUg5BA.cjs";
1
+ import { EventConnection, EventPublisher, EventPublisherType, PublishableMessage } from "./types-Dmbp1U-6.cjs";
2
2
 
3
3
  //#region src/Publisher.d.ts
4
4
  declare class Publisher {
@@ -14,6 +14,8 @@ declare class Publisher {
14
14
  static fromConnection<TMessage extends PublishableMessage<string, any>>(connection: EventConnection): Promise<EventPublisher<TMessage>>;
15
15
  }
16
16
  type EventPublisherConnectionString = `${EventPublisherType}://${string}`;
17
+ //# sourceMappingURL=Publisher.d.ts.map
18
+
17
19
  //#endregion
18
20
  export { EventPublisherConnectionString, Publisher };
19
- //# sourceMappingURL=Publisher-nXNVjL0e.d.cts.map
21
+ //# sourceMappingURL=Publisher-BfNgvHwQ.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Publisher-BfNgvHwQ.d.cts","names":[],"sources":["../src/Publisher.ts"],"sourcesContent":[],"mappings":";;;cAOa,SAAA;EAAA;;;;EAQkC,OACpB,oBAAA,CAAA,iBAHR,kBAGQ,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,aAAA,EADV,8BACU,CAAA,EAAvB,OAAuB,CAAf,cAAe,CAAA,QAAA,CAAA,CAAA;EAAQ;;;;EAgCN,OACF,cAAA,CAAA,iBAFmB,kBAEnB,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,UAAA,EADb,eACa,CAAA,EAAvB,OAAuB,CAAf,cAAe,CAAA,QAAA,CAAA,CAAA;;AAAvB,KAoCQ,8BAAA,GApCR,GAqCA,kBArCA,MAAA,MAAA,EAAA;AAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"Publisher-DS0aOh8r.mjs","names":["connectionStr: EventPublisherConnectionString","connection: EventConnection"],"sources":["../src/Publisher.ts"],"sourcesContent":["import type {\n EventConnection,\n EventPublisher,\n PublishableMessage,\n} from './types';\nimport { EventPublisherType } from './types';\n\nexport class Publisher {\n /**\n * Create a publisher from a connection string\n * This creates both a connection and a publisher\n */\n static async fromConnectionString<\n TMessage extends PublishableMessage<string, any>,\n >(\n connectionStr: EventPublisherConnectionString,\n ): Promise<EventPublisher<TMessage>> {\n const url = new URL(connectionStr);\n switch (url.protocol.replace(':', '')) {\n case EventPublisherType.Basic: {\n const { BasicConnection, BasicPublisher } = await import('./basic');\n const connection =\n await BasicConnection.fromConnectionString(connectionStr);\n return new BasicPublisher<TMessage>(connection);\n }\n case EventPublisherType.RabbitMQ: {\n const { RabbitMQPublisher } = await import('./rabbitmq');\n return RabbitMQPublisher.fromConnectionString<TMessage>(connectionStr);\n }\n case EventPublisherType.SQS: {\n const { SQSPublisher } = await import('./sqs');\n return SQSPublisher.fromConnectionString<TMessage>(connectionStr);\n }\n case EventPublisherType.SNS: {\n const { SNSPublisher } = await import('./sns');\n return SNSPublisher.fromConnectionString<TMessage>(connectionStr);\n }\n // Future implementations for EventBridge, Kafka, etc.\n default:\n throw new Error(`Unsupported event publisher type: ${url.protocol}`);\n }\n }\n\n /**\n * Create a publisher from an existing connection\n * This allows sharing connections between publishers and subscribers\n */\n static async fromConnection<TMessage extends PublishableMessage<string, any>>(\n connection: EventConnection,\n ): Promise<EventPublisher<TMessage>> {\n switch (connection.type) {\n case EventPublisherType.Basic: {\n const { BasicPublisher } = await import('./basic');\n const { BasicConnection } = await import('./basic');\n return new BasicPublisher<TMessage>(\n connection as InstanceType<typeof BasicConnection>,\n );\n }\n case EventPublisherType.RabbitMQ: {\n const { RabbitMQPublisher } = await import('./rabbitmq');\n const { RabbitMQConnection } = await import('./rabbitmq');\n return new RabbitMQPublisher<TMessage>(\n connection as InstanceType<typeof RabbitMQConnection>,\n );\n }\n case EventPublisherType.SQS: {\n const { SQSPublisher } = await import('./sqs');\n const { SQSConnection } = await import('./sqs');\n return new SQSPublisher<TMessage>(\n connection as InstanceType<typeof SQSConnection>,\n );\n }\n case EventPublisherType.SNS: {\n const { SNSPublisher } = await import('./sns');\n const { SNSConnection } = await import('./sns');\n return new SNSPublisher<TMessage>(\n connection as InstanceType<typeof SNSConnection>,\n );\n }\n default:\n throw new Error(`Unsupported connection type: ${connection.type}`);\n }\n }\n}\n\nexport type EventPublisherConnectionString =\n `${EventPublisherType}://${string}`;\n"],"mappings":";;;AAOA,IAAa,YAAb,MAAuB;;;;;CAKrB,aAAa,qBAGXA,eACmC;EACnC,MAAM,MAAM,IAAI,IAAI;AACpB,UAAQ,IAAI,SAAS,QAAQ,KAAK,GAAG,EAArC;GACE,KAAK,mBAAmB,OAAO;IAC7B,MAAM,EAAE,iBAAiB,gBAAgB,GAAG,MAAM,OAAO;IACzD,MAAM,aACJ,MAAM,gBAAgB,qBAAqB,cAAc;AAC3D,WAAO,IAAI,eAAyB;GACrC;GACD,KAAK,mBAAmB,UAAU;IAChC,MAAM,EAAE,mBAAmB,GAAG,MAAM,OAAO;AAC3C,WAAO,kBAAkB,qBAA+B,cAAc;GACvE;GACD,KAAK,mBAAmB,KAAK;IAC3B,MAAM,EAAE,cAAc,GAAG,MAAM,OAAO;AACtC,WAAO,aAAa,qBAA+B,cAAc;GAClE;GACD,KAAK,mBAAmB,KAAK;IAC3B,MAAM,EAAE,cAAc,GAAG,MAAM,OAAO;AACtC,WAAO,aAAa,qBAA+B,cAAc;GAClE;GAED,QACE,OAAM,IAAI,OAAO,oCAAoC,IAAI,SAAS;EACrE;CACF;;;;;CAMD,aAAa,eACXC,YACmC;AACnC,UAAQ,WAAW,MAAnB;GACE,KAAK,mBAAmB,OAAO;IAC7B,MAAM,EAAE,gBAAgB,GAAG,MAAM,OAAO;IACxC,MAAM,EAAE,iBAAiB,GAAG,MAAM,OAAO;AACzC,WAAO,IAAI,eACT;GAEH;GACD,KAAK,mBAAmB,UAAU;IAChC,MAAM,EAAE,mBAAmB,GAAG,MAAM,OAAO;IAC3C,MAAM,EAAE,oBAAoB,GAAG,MAAM,OAAO;AAC5C,WAAO,IAAI,kBACT;GAEH;GACD,KAAK,mBAAmB,KAAK;IAC3B,MAAM,EAAE,cAAc,GAAG,MAAM,OAAO;IACtC,MAAM,EAAE,eAAe,GAAG,MAAM,OAAO;AACvC,WAAO,IAAI,aACT;GAEH;GACD,KAAK,mBAAmB,KAAK;IAC3B,MAAM,EAAE,cAAc,GAAG,MAAM,OAAO;IACtC,MAAM,EAAE,eAAe,GAAG,MAAM,OAAO;AACvC,WAAO,IAAI,aACT;GAEH;GACD,QACE,OAAM,IAAI,OAAO,+BAA+B,WAAW,KAAK;EACnE;CACF;AACF"}
1
+ {"version":3,"file":"Publisher-DS0aOh8r.mjs","names":["connectionStr: EventPublisherConnectionString","connection: EventConnection"],"sources":["../src/Publisher.ts"],"sourcesContent":["import type {\n\tEventConnection,\n\tEventPublisher,\n\tPublishableMessage,\n} from './types';\nimport { EventPublisherType } from './types';\n\nexport class Publisher {\n\t/**\n\t * Create a publisher from a connection string\n\t * This creates both a connection and a publisher\n\t */\n\tstatic async fromConnectionString<\n\t\tTMessage extends PublishableMessage<string, any>,\n\t>(\n\t\tconnectionStr: EventPublisherConnectionString,\n\t): Promise<EventPublisher<TMessage>> {\n\t\tconst url = new URL(connectionStr);\n\t\tswitch (url.protocol.replace(':', '')) {\n\t\t\tcase EventPublisherType.Basic: {\n\t\t\t\tconst { BasicConnection, BasicPublisher } = await import('./basic');\n\t\t\t\tconst connection =\n\t\t\t\t\tawait BasicConnection.fromConnectionString(connectionStr);\n\t\t\t\treturn new BasicPublisher<TMessage>(connection);\n\t\t\t}\n\t\t\tcase EventPublisherType.RabbitMQ: {\n\t\t\t\tconst { RabbitMQPublisher } = await import('./rabbitmq');\n\t\t\t\treturn RabbitMQPublisher.fromConnectionString<TMessage>(connectionStr);\n\t\t\t}\n\t\t\tcase EventPublisherType.SQS: {\n\t\t\t\tconst { SQSPublisher } = await import('./sqs');\n\t\t\t\treturn SQSPublisher.fromConnectionString<TMessage>(connectionStr);\n\t\t\t}\n\t\t\tcase EventPublisherType.SNS: {\n\t\t\t\tconst { SNSPublisher } = await import('./sns');\n\t\t\t\treturn SNSPublisher.fromConnectionString<TMessage>(connectionStr);\n\t\t\t}\n\t\t\t// Future implementations for EventBridge, Kafka, etc.\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unsupported event publisher type: ${url.protocol}`);\n\t\t}\n\t}\n\n\t/**\n\t * Create a publisher from an existing connection\n\t * This allows sharing connections between publishers and subscribers\n\t */\n\tstatic async fromConnection<TMessage extends PublishableMessage<string, any>>(\n\t\tconnection: EventConnection,\n\t): Promise<EventPublisher<TMessage>> {\n\t\tswitch (connection.type) {\n\t\t\tcase EventPublisherType.Basic: {\n\t\t\t\tconst { BasicPublisher } = await import('./basic');\n\t\t\t\tconst { BasicConnection } = await import('./basic');\n\t\t\t\treturn new BasicPublisher<TMessage>(\n\t\t\t\t\tconnection as InstanceType<typeof BasicConnection>,\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase EventPublisherType.RabbitMQ: {\n\t\t\t\tconst { RabbitMQPublisher } = await import('./rabbitmq');\n\t\t\t\tconst { RabbitMQConnection } = await import('./rabbitmq');\n\t\t\t\treturn new RabbitMQPublisher<TMessage>(\n\t\t\t\t\tconnection as InstanceType<typeof RabbitMQConnection>,\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase EventPublisherType.SQS: {\n\t\t\t\tconst { SQSPublisher } = await import('./sqs');\n\t\t\t\tconst { SQSConnection } = await import('./sqs');\n\t\t\t\treturn new SQSPublisher<TMessage>(\n\t\t\t\t\tconnection as InstanceType<typeof SQSConnection>,\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase EventPublisherType.SNS: {\n\t\t\t\tconst { SNSPublisher } = await import('./sns');\n\t\t\t\tconst { SNSConnection } = await import('./sns');\n\t\t\t\treturn new SNSPublisher<TMessage>(\n\t\t\t\t\tconnection as InstanceType<typeof SNSConnection>,\n\t\t\t\t);\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unsupported connection type: ${connection.type}`);\n\t\t}\n\t}\n}\n\nexport type EventPublisherConnectionString =\n\t`${EventPublisherType}://${string}`;\n"],"mappings":";;;AAOA,IAAa,YAAb,MAAuB;;;;;CAKtB,aAAa,qBAGZA,eACoC;EACpC,MAAM,MAAM,IAAI,IAAI;AACpB,UAAQ,IAAI,SAAS,QAAQ,KAAK,GAAG,EAArC;GACC,KAAK,mBAAmB,OAAO;IAC9B,MAAM,EAAE,iBAAiB,gBAAgB,GAAG,MAAM,OAAO;IACzD,MAAM,aACL,MAAM,gBAAgB,qBAAqB,cAAc;AAC1D,WAAO,IAAI,eAAyB;GACpC;GACD,KAAK,mBAAmB,UAAU;IACjC,MAAM,EAAE,mBAAmB,GAAG,MAAM,OAAO;AAC3C,WAAO,kBAAkB,qBAA+B,cAAc;GACtE;GACD,KAAK,mBAAmB,KAAK;IAC5B,MAAM,EAAE,cAAc,GAAG,MAAM,OAAO;AACtC,WAAO,aAAa,qBAA+B,cAAc;GACjE;GACD,KAAK,mBAAmB,KAAK;IAC5B,MAAM,EAAE,cAAc,GAAG,MAAM,OAAO;AACtC,WAAO,aAAa,qBAA+B,cAAc;GACjE;GAED,QACC,OAAM,IAAI,OAAO,oCAAoC,IAAI,SAAS;EACnE;CACD;;;;;CAMD,aAAa,eACZC,YACoC;AACpC,UAAQ,WAAW,MAAnB;GACC,KAAK,mBAAmB,OAAO;IAC9B,MAAM,EAAE,gBAAgB,GAAG,MAAM,OAAO;IACxC,MAAM,EAAE,iBAAiB,GAAG,MAAM,OAAO;AACzC,WAAO,IAAI,eACV;GAED;GACD,KAAK,mBAAmB,UAAU;IACjC,MAAM,EAAE,mBAAmB,GAAG,MAAM,OAAO;IAC3C,MAAM,EAAE,oBAAoB,GAAG,MAAM,OAAO;AAC5C,WAAO,IAAI,kBACV;GAED;GACD,KAAK,mBAAmB,KAAK;IAC5B,MAAM,EAAE,cAAc,GAAG,MAAM,OAAO;IACtC,MAAM,EAAE,eAAe,GAAG,MAAM,OAAO;AACvC,WAAO,IAAI,aACV;GAED;GACD,KAAK,mBAAmB,KAAK;IAC5B,MAAM,EAAE,cAAc,GAAG,MAAM,OAAO;IACtC,MAAM,EAAE,eAAe,GAAG,MAAM,OAAO;AACvC,WAAO,IAAI,aACV;GAED;GACD,QACC,OAAM,IAAI,OAAO,+BAA+B,WAAW,KAAK;EACjE;CACD;AACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"Publisher-ceu6OxCj.cjs","names":["connectionStr: EventPublisherConnectionString","EventPublisherType","connection: EventConnection"],"sources":["../src/Publisher.ts"],"sourcesContent":["import type {\n EventConnection,\n EventPublisher,\n PublishableMessage,\n} from './types';\nimport { EventPublisherType } from './types';\n\nexport class Publisher {\n /**\n * Create a publisher from a connection string\n * This creates both a connection and a publisher\n */\n static async fromConnectionString<\n TMessage extends PublishableMessage<string, any>,\n >(\n connectionStr: EventPublisherConnectionString,\n ): Promise<EventPublisher<TMessage>> {\n const url = new URL(connectionStr);\n switch (url.protocol.replace(':', '')) {\n case EventPublisherType.Basic: {\n const { BasicConnection, BasicPublisher } = await import('./basic');\n const connection =\n await BasicConnection.fromConnectionString(connectionStr);\n return new BasicPublisher<TMessage>(connection);\n }\n case EventPublisherType.RabbitMQ: {\n const { RabbitMQPublisher } = await import('./rabbitmq');\n return RabbitMQPublisher.fromConnectionString<TMessage>(connectionStr);\n }\n case EventPublisherType.SQS: {\n const { SQSPublisher } = await import('./sqs');\n return SQSPublisher.fromConnectionString<TMessage>(connectionStr);\n }\n case EventPublisherType.SNS: {\n const { SNSPublisher } = await import('./sns');\n return SNSPublisher.fromConnectionString<TMessage>(connectionStr);\n }\n // Future implementations for EventBridge, Kafka, etc.\n default:\n throw new Error(`Unsupported event publisher type: ${url.protocol}`);\n }\n }\n\n /**\n * Create a publisher from an existing connection\n * This allows sharing connections between publishers and subscribers\n */\n static async fromConnection<TMessage extends PublishableMessage<string, any>>(\n connection: EventConnection,\n ): Promise<EventPublisher<TMessage>> {\n switch (connection.type) {\n case EventPublisherType.Basic: {\n const { BasicPublisher } = await import('./basic');\n const { BasicConnection } = await import('./basic');\n return new BasicPublisher<TMessage>(\n connection as InstanceType<typeof BasicConnection>,\n );\n }\n case EventPublisherType.RabbitMQ: {\n const { RabbitMQPublisher } = await import('./rabbitmq');\n const { RabbitMQConnection } = await import('./rabbitmq');\n return new RabbitMQPublisher<TMessage>(\n connection as InstanceType<typeof RabbitMQConnection>,\n );\n }\n case EventPublisherType.SQS: {\n const { SQSPublisher } = await import('./sqs');\n const { SQSConnection } = await import('./sqs');\n return new SQSPublisher<TMessage>(\n connection as InstanceType<typeof SQSConnection>,\n );\n }\n case EventPublisherType.SNS: {\n const { SNSPublisher } = await import('./sns');\n const { SNSConnection } = await import('./sns');\n return new SNSPublisher<TMessage>(\n connection as InstanceType<typeof SNSConnection>,\n );\n }\n default:\n throw new Error(`Unsupported connection type: ${connection.type}`);\n }\n }\n}\n\nexport type EventPublisherConnectionString =\n `${EventPublisherType}://${string}`;\n"],"mappings":";;;AAOA,IAAa,YAAb,MAAuB;;;;;CAKrB,aAAa,qBAGXA,eACmC;EACnC,MAAM,MAAM,IAAI,IAAI;AACpB,UAAQ,IAAI,SAAS,QAAQ,KAAK,GAAG,EAArC;GACE,KAAKC,iCAAmB,OAAO;IAC7B,MAAM,EAAE,iBAAiB,gBAAgB,GAAG,2CAAM;IAClD,MAAM,aACJ,MAAM,gBAAgB,qBAAqB,cAAc;AAC3D,WAAO,IAAI,eAAyB;GACrC;GACD,KAAKA,iCAAmB,UAAU;IAChC,MAAM,EAAE,mBAAmB,GAAG,2CAAM;AACpC,WAAO,kBAAkB,qBAA+B,cAAc;GACvE;GACD,KAAKA,iCAAmB,KAAK;IAC3B,MAAM,EAAE,cAAc,GAAG,2CAAM;AAC/B,WAAO,aAAa,qBAA+B,cAAc;GAClE;GACD,KAAKA,iCAAmB,KAAK;IAC3B,MAAM,EAAE,cAAc,GAAG,2CAAM;AAC/B,WAAO,aAAa,qBAA+B,cAAc;GAClE;GAED,QACE,OAAM,IAAI,OAAO,oCAAoC,IAAI,SAAS;EACrE;CACF;;;;;CAMD,aAAa,eACXC,YACmC;AACnC,UAAQ,WAAW,MAAnB;GACE,KAAKD,iCAAmB,OAAO;IAC7B,MAAM,EAAE,gBAAgB,GAAG,2CAAM;IACjC,MAAM,EAAE,iBAAiB,GAAG,2CAAM;AAClC,WAAO,IAAI,eACT;GAEH;GACD,KAAKA,iCAAmB,UAAU;IAChC,MAAM,EAAE,mBAAmB,GAAG,2CAAM;IACpC,MAAM,EAAE,oBAAoB,GAAG,2CAAM;AACrC,WAAO,IAAI,kBACT;GAEH;GACD,KAAKA,iCAAmB,KAAK;IAC3B,MAAM,EAAE,cAAc,GAAG,2CAAM;IAC/B,MAAM,EAAE,eAAe,GAAG,2CAAM;AAChC,WAAO,IAAI,aACT;GAEH;GACD,KAAKA,iCAAmB,KAAK;IAC3B,MAAM,EAAE,cAAc,GAAG,2CAAM;IAC/B,MAAM,EAAE,eAAe,GAAG,2CAAM;AAChC,WAAO,IAAI,aACT;GAEH;GACD,QACE,OAAM,IAAI,OAAO,+BAA+B,WAAW,KAAK;EACnE;CACF;AACF"}
1
+ {"version":3,"file":"Publisher-ceu6OxCj.cjs","names":["connectionStr: EventPublisherConnectionString","EventPublisherType","connection: EventConnection"],"sources":["../src/Publisher.ts"],"sourcesContent":["import type {\n\tEventConnection,\n\tEventPublisher,\n\tPublishableMessage,\n} from './types';\nimport { EventPublisherType } from './types';\n\nexport class Publisher {\n\t/**\n\t * Create a publisher from a connection string\n\t * This creates both a connection and a publisher\n\t */\n\tstatic async fromConnectionString<\n\t\tTMessage extends PublishableMessage<string, any>,\n\t>(\n\t\tconnectionStr: EventPublisherConnectionString,\n\t): Promise<EventPublisher<TMessage>> {\n\t\tconst url = new URL(connectionStr);\n\t\tswitch (url.protocol.replace(':', '')) {\n\t\t\tcase EventPublisherType.Basic: {\n\t\t\t\tconst { BasicConnection, BasicPublisher } = await import('./basic');\n\t\t\t\tconst connection =\n\t\t\t\t\tawait BasicConnection.fromConnectionString(connectionStr);\n\t\t\t\treturn new BasicPublisher<TMessage>(connection);\n\t\t\t}\n\t\t\tcase EventPublisherType.RabbitMQ: {\n\t\t\t\tconst { RabbitMQPublisher } = await import('./rabbitmq');\n\t\t\t\treturn RabbitMQPublisher.fromConnectionString<TMessage>(connectionStr);\n\t\t\t}\n\t\t\tcase EventPublisherType.SQS: {\n\t\t\t\tconst { SQSPublisher } = await import('./sqs');\n\t\t\t\treturn SQSPublisher.fromConnectionString<TMessage>(connectionStr);\n\t\t\t}\n\t\t\tcase EventPublisherType.SNS: {\n\t\t\t\tconst { SNSPublisher } = await import('./sns');\n\t\t\t\treturn SNSPublisher.fromConnectionString<TMessage>(connectionStr);\n\t\t\t}\n\t\t\t// Future implementations for EventBridge, Kafka, etc.\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unsupported event publisher type: ${url.protocol}`);\n\t\t}\n\t}\n\n\t/**\n\t * Create a publisher from an existing connection\n\t * This allows sharing connections between publishers and subscribers\n\t */\n\tstatic async fromConnection<TMessage extends PublishableMessage<string, any>>(\n\t\tconnection: EventConnection,\n\t): Promise<EventPublisher<TMessage>> {\n\t\tswitch (connection.type) {\n\t\t\tcase EventPublisherType.Basic: {\n\t\t\t\tconst { BasicPublisher } = await import('./basic');\n\t\t\t\tconst { BasicConnection } = await import('./basic');\n\t\t\t\treturn new BasicPublisher<TMessage>(\n\t\t\t\t\tconnection as InstanceType<typeof BasicConnection>,\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase EventPublisherType.RabbitMQ: {\n\t\t\t\tconst { RabbitMQPublisher } = await import('./rabbitmq');\n\t\t\t\tconst { RabbitMQConnection } = await import('./rabbitmq');\n\t\t\t\treturn new RabbitMQPublisher<TMessage>(\n\t\t\t\t\tconnection as InstanceType<typeof RabbitMQConnection>,\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase EventPublisherType.SQS: {\n\t\t\t\tconst { SQSPublisher } = await import('./sqs');\n\t\t\t\tconst { SQSConnection } = await import('./sqs');\n\t\t\t\treturn new SQSPublisher<TMessage>(\n\t\t\t\t\tconnection as InstanceType<typeof SQSConnection>,\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase EventPublisherType.SNS: {\n\t\t\t\tconst { SNSPublisher } = await import('./sns');\n\t\t\t\tconst { SNSConnection } = await import('./sns');\n\t\t\t\treturn new SNSPublisher<TMessage>(\n\t\t\t\t\tconnection as InstanceType<typeof SNSConnection>,\n\t\t\t\t);\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unsupported connection type: ${connection.type}`);\n\t\t}\n\t}\n}\n\nexport type EventPublisherConnectionString =\n\t`${EventPublisherType}://${string}`;\n"],"mappings":";;;AAOA,IAAa,YAAb,MAAuB;;;;;CAKtB,aAAa,qBAGZA,eACoC;EACpC,MAAM,MAAM,IAAI,IAAI;AACpB,UAAQ,IAAI,SAAS,QAAQ,KAAK,GAAG,EAArC;GACC,KAAKC,iCAAmB,OAAO;IAC9B,MAAM,EAAE,iBAAiB,gBAAgB,GAAG,2CAAM;IAClD,MAAM,aACL,MAAM,gBAAgB,qBAAqB,cAAc;AAC1D,WAAO,IAAI,eAAyB;GACpC;GACD,KAAKA,iCAAmB,UAAU;IACjC,MAAM,EAAE,mBAAmB,GAAG,2CAAM;AACpC,WAAO,kBAAkB,qBAA+B,cAAc;GACtE;GACD,KAAKA,iCAAmB,KAAK;IAC5B,MAAM,EAAE,cAAc,GAAG,2CAAM;AAC/B,WAAO,aAAa,qBAA+B,cAAc;GACjE;GACD,KAAKA,iCAAmB,KAAK;IAC5B,MAAM,EAAE,cAAc,GAAG,2CAAM;AAC/B,WAAO,aAAa,qBAA+B,cAAc;GACjE;GAED,QACC,OAAM,IAAI,OAAO,oCAAoC,IAAI,SAAS;EACnE;CACD;;;;;CAMD,aAAa,eACZC,YACoC;AACpC,UAAQ,WAAW,MAAnB;GACC,KAAKD,iCAAmB,OAAO;IAC9B,MAAM,EAAE,gBAAgB,GAAG,2CAAM;IACjC,MAAM,EAAE,iBAAiB,GAAG,2CAAM;AAClC,WAAO,IAAI,eACV;GAED;GACD,KAAKA,iCAAmB,UAAU;IACjC,MAAM,EAAE,mBAAmB,GAAG,2CAAM;IACpC,MAAM,EAAE,oBAAoB,GAAG,2CAAM;AACrC,WAAO,IAAI,kBACV;GAED;GACD,KAAKA,iCAAmB,KAAK;IAC5B,MAAM,EAAE,cAAc,GAAG,2CAAM;IAC/B,MAAM,EAAE,eAAe,GAAG,2CAAM;AAChC,WAAO,IAAI,aACV;GAED;GACD,KAAKA,iCAAmB,KAAK;IAC5B,MAAM,EAAE,cAAc,GAAG,2CAAM;IAC/B,MAAM,EAAE,eAAe,GAAG,2CAAM;AAChC,WAAO,IAAI,aACV;GAED;GACD,QACC,OAAM,IAAI,OAAO,+BAA+B,WAAW,KAAK;EACjE;CACD;AACD"}
@@ -1,3 +1,3 @@
1
- import "./types-DEGUg5BA.cjs";
2
- import { EventPublisherConnectionString, Publisher } from "./Publisher-nXNVjL0e.cjs";
1
+ import "./types-Dmbp1U-6.cjs";
2
+ import { EventPublisherConnectionString, Publisher } from "./Publisher-BfNgvHwQ.cjs";
3
3
  export { EventPublisherConnectionString, Publisher };
@@ -1,3 +1,3 @@
1
- import "./types-D0g-o6wX.mjs";
2
- import { EventPublisherConnectionString, Publisher } from "./Publisher-C3m8JFXm.mjs";
1
+ import "./types-DSVsPgKd.mjs";
2
+ import { EventPublisherConnectionString, Publisher } from "./Publisher-1CfcYRnm.mjs";
3
3
  export { EventPublisherConnectionString, Publisher };
@@ -71,7 +71,7 @@ var RabbitMQConnection = class RabbitMQConnection {
71
71
  try {
72
72
  await this.channel?.close();
73
73
  await this.connection?.close();
74
- } catch (error) {} finally {
74
+ } catch (_error) {} finally {
75
75
  this.cleanup();
76
76
  }
77
77
  }
@@ -110,4 +110,4 @@ Object.defineProperty(exports, 'RabbitMQConnection', {
110
110
  return RabbitMQConnection;
111
111
  }
112
112
  });
113
- //# sourceMappingURL=RabbitMQConnection-ungB0Zl6.cjs.map
113
+ //# sourceMappingURL=RabbitMQConnection-Blj9Lo05.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RabbitMQConnection-Blj9Lo05.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,4 +1,4 @@
1
- import { EventConnection, EventPublisherType } from "./types-DEGUg5BA.cjs";
1
+ import { EventConnection, EventPublisherType } from "./types-Dmbp1U-6.cjs";
2
2
  import amqplib from "amqplib";
3
3
 
4
4
  //#region src/rabbitmq/RabbitMQConnection.d.ts
@@ -38,6 +38,7 @@ declare class RabbitMQConnection implements EventConnection {
38
38
  */
39
39
  get exchangeType(): string;
40
40
  }
41
+ //# sourceMappingURL=RabbitMQConnection.d.ts.map
41
42
  //#endregion
42
43
  export { RabbitMQConnection, RabbitMQConnectionConfig };
43
- //# sourceMappingURL=RabbitMQConnection-7cWp_-_Q.d.cts.map
44
+ //# sourceMappingURL=RabbitMQConnection-Bm8VCI2R.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RabbitMQConnection-Bm8VCI2R.d.cts","names":[],"sources":["../src/rabbitmq/RabbitMQConnection.ts"],"sourcesContent":[],"mappings":";;;;UAIiB,wBAAA;EAAA,GAAA,EAAA,MAAA;EAQJ,QAAA,CAAA,EAAA,MAAA;EAAmB,YAAA,CAAA,EAAA,OAAA,GAAA,QAAA,GAAA,QAAA,GAAA,SAAA;EAAA,eAClB,CAAA,EALK,OAAA,CAAQ,OAAA,CAAQ,cAKrB;EAAA,OASO,CAAA,EAAA,MAAA;;AAmBjB,cA7BS,kBAAA,YAA8B,eA6BvC,CAAA;EAAO,SAoBO,IAAA,GAhDJ,kBAAA,CAAA,QAAA;EAgDW,QA6CT,UAAA;EAAO,QAwBH,OAAQ;EAAO,QAtHQ,UAAA;EAAe,QAAA,MAAA;sBAUrC;;;;;yDAmBjB,QAAQ;aAoBM;WA6CF;;;;;;qBAwBI,OAAA,CAAQ"}
@@ -1,4 +1,4 @@
1
- import { EventConnection, EventPublisherType } from "./types-D0g-o6wX.mjs";
1
+ import { EventConnection, EventPublisherType } from "./types-DSVsPgKd.mjs";
2
2
  import amqplib from "amqplib";
3
3
 
4
4
  //#region src/rabbitmq/RabbitMQConnection.d.ts
@@ -38,6 +38,7 @@ declare class RabbitMQConnection implements EventConnection {
38
38
  */
39
39
  get exchangeType(): string;
40
40
  }
41
+ //# sourceMappingURL=RabbitMQConnection.d.ts.map
41
42
  //#endregion
42
43
  export { RabbitMQConnection, RabbitMQConnectionConfig };
43
- //# sourceMappingURL=RabbitMQConnection-C2HC7J7K.d.mts.map
44
+ //# sourceMappingURL=RabbitMQConnection-Ck-ktCp_.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RabbitMQConnection-Ck-ktCp_.d.mts","names":[],"sources":["../src/rabbitmq/RabbitMQConnection.ts"],"sourcesContent":[],"mappings":";;;;UAIiB,wBAAA;EAAA,GAAA,EAAA,MAAA;EAQJ,QAAA,CAAA,EAAA,MAAA;EAAmB,YAAA,CAAA,EAAA,OAAA,GAAA,QAAA,GAAA,QAAA,GAAA,SAAA;EAAA,eAClB,CAAA,EALK,OAAA,CAAQ,OAAA,CAAQ,cAKrB;EAAA,OASO,CAAA,EAAA,MAAA;;AAmBjB,cA7BS,kBAAA,YAA8B,eA6BvC,CAAA;EAAO,SAoBO,IAAA,GAhDJ,kBAAA,CAAA,QAAA;EAgDW,QA6CT,UAAA;EAAO,QAwBH,OAAQ;EAAO,QAtHQ,UAAA;EAAe,QAAA,MAAA;sBAUrC;;;;;yDAmBjB,QAAQ;aAoBM;WA6CF;;;;;;qBAwBI,OAAA,CAAQ"}
@@ -70,7 +70,7 @@ var RabbitMQConnection = class RabbitMQConnection {
70
70
  try {
71
71
  await this.channel?.close();
72
72
  await this.connection?.close();
73
- } catch (error) {} finally {
73
+ } catch (_error) {} finally {
74
74
  this.cleanup();
75
75
  }
76
76
  }
@@ -104,4 +104,4 @@ var RabbitMQConnection = class RabbitMQConnection {
104
104
 
105
105
  //#endregion
106
106
  export { RabbitMQConnection };
107
- //# sourceMappingURL=RabbitMQConnection-kU3MvN5P.mjs.map
107
+ //# sourceMappingURL=RabbitMQConnection-Co7f5Xsx.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RabbitMQConnection-Co7f5Xsx.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 +1 @@
1
- {"version":3,"file":"RabbitMQPublisher--DL6GM6g.cjs","names":["connection: RabbitMQConnection","options: RabbitMQPublisherOptions","connectionString: string","messages: TMessage[]"],"sources":["../src/rabbitmq/RabbitMQPublisher.ts"],"sourcesContent":["import type amqplib from 'amqplib';\nimport type { EventPublisher, PublishableMessage } from '../types';\nimport type { RabbitMQConnection } from './RabbitMQConnection';\n\nexport interface RabbitMQPublisherOptions {\n publishOptions?: amqplib.Options.Publish;\n}\n\nexport class RabbitMQPublisher<TMessage extends PublishableMessage<string, any>>\n implements EventPublisher<TMessage>\n{\n constructor(\n private connection: RabbitMQConnection,\n private options: RabbitMQPublisherOptions = {},\n ) {}\n\n /**\n * Create a RabbitMQPublisher from a connection string\n * Format: rabbitmq://user:pass@host:port/vhost?exchange=name&type=topic&timeout=5000\n */\n static async fromConnectionString<\n TMessage extends PublishableMessage<string, any>,\n >(connectionString: string): Promise<RabbitMQPublisher<TMessage>> {\n const { RabbitMQConnection } = await import('./RabbitMQConnection');\n const connection =\n await RabbitMQConnection.fromConnectionString(connectionString);\n return new RabbitMQPublisher<TMessage>(connection);\n }\n\n async publish(messages: TMessage[]): Promise<void> {\n if (!this.connection.isConnected()) {\n await this.connection.connect();\n }\n\n const channel = this.connection.amqpChannel;\n if (!channel) {\n throw new Error('Channel not initialized');\n }\n\n const exchange = this.connection.exchangeName;\n\n for (const message of messages) {\n const content = Buffer.from(JSON.stringify(message.payload));\n\n // Use message type as routing key for topic exchanges\n const routingKey = message.type;\n\n const published = channel.publish(exchange, routingKey, content, {\n contentType: 'application/json',\n timestamp: Date.now(),\n type: message.type,\n persistent: true,\n ...this.options.publishOptions,\n });\n\n // Handle backpressure\n if (!published) {\n await new Promise((resolve) => channel.once('drain', resolve));\n }\n }\n }\n\n async close(): Promise<void> {\n // Publisher doesn't own the connection\n // Connection should be closed by whoever created it\n }\n}\n"],"mappings":";;AAQA,IAAa,oBAAb,MAAa,kBAEb;CACE,YACUA,YACAC,UAAoC,CAAE,GAC9C;EAFQ;EACA;CACN;;;;;CAMJ,aAAa,qBAEXC,kBAAgE;EAChE,MAAM,EAAE,oBAAoB,GAAG,2CAAM;EACrC,MAAM,aACJ,MAAM,mBAAmB,qBAAqB,iBAAiB;AACjE,SAAO,IAAI,kBAA4B;CACxC;CAED,MAAM,QAAQC,UAAqC;AACjD,OAAK,KAAK,WAAW,aAAa,CAChC,OAAM,KAAK,WAAW,SAAS;EAGjC,MAAM,UAAU,KAAK,WAAW;AAChC,OAAK,QACH,OAAM,IAAI,MAAM;EAGlB,MAAM,WAAW,KAAK,WAAW;AAEjC,OAAK,MAAM,WAAW,UAAU;GAC9B,MAAM,UAAU,OAAO,KAAK,KAAK,UAAU,QAAQ,QAAQ,CAAC;GAG5D,MAAM,aAAa,QAAQ;GAE3B,MAAM,YAAY,QAAQ,QAAQ,UAAU,YAAY,SAAS;IAC/D,aAAa;IACb,WAAW,KAAK,KAAK;IACrB,MAAM,QAAQ;IACd,YAAY;IACZ,GAAG,KAAK,QAAQ;GACjB,EAAC;AAGF,QAAK,UACH,OAAM,IAAI,QAAQ,CAAC,YAAY,QAAQ,KAAK,SAAS,QAAQ;EAEhE;CACF;CAED,MAAM,QAAuB,CAG5B;AACF"}
1
+ {"version":3,"file":"RabbitMQPublisher--DL6GM6g.cjs","names":["connection: RabbitMQConnection","options: RabbitMQPublisherOptions","connectionString: string","messages: TMessage[]"],"sources":["../src/rabbitmq/RabbitMQPublisher.ts"],"sourcesContent":["import type amqplib from 'amqplib';\nimport type { EventPublisher, PublishableMessage } from '../types';\nimport type { RabbitMQConnection } from './RabbitMQConnection';\n\nexport interface RabbitMQPublisherOptions {\n\tpublishOptions?: amqplib.Options.Publish;\n}\n\nexport class RabbitMQPublisher<TMessage extends PublishableMessage<string, any>>\n\timplements EventPublisher<TMessage>\n{\n\tconstructor(\n\t\tprivate connection: RabbitMQConnection,\n\t\tprivate options: RabbitMQPublisherOptions = {},\n\t) {}\n\n\t/**\n\t * Create a RabbitMQPublisher 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\tTMessage extends PublishableMessage<string, any>,\n\t>(connectionString: string): Promise<RabbitMQPublisher<TMessage>> {\n\t\tconst { RabbitMQConnection } = await import('./RabbitMQConnection');\n\t\tconst connection =\n\t\t\tawait RabbitMQConnection.fromConnectionString(connectionString);\n\t\treturn new RabbitMQPublisher<TMessage>(connection);\n\t}\n\n\tasync publish(messages: TMessage[]): Promise<void> {\n\t\tif (!this.connection.isConnected()) {\n\t\t\tawait this.connection.connect();\n\t\t}\n\n\t\tconst channel = this.connection.amqpChannel;\n\t\tif (!channel) {\n\t\t\tthrow new Error('Channel not initialized');\n\t\t}\n\n\t\tconst exchange = this.connection.exchangeName;\n\n\t\tfor (const message of messages) {\n\t\t\tconst content = Buffer.from(JSON.stringify(message.payload));\n\n\t\t\t// Use message type as routing key for topic exchanges\n\t\t\tconst routingKey = message.type;\n\n\t\t\tconst published = channel.publish(exchange, routingKey, content, {\n\t\t\t\tcontentType: 'application/json',\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t\ttype: message.type,\n\t\t\t\tpersistent: true,\n\t\t\t\t...this.options.publishOptions,\n\t\t\t});\n\n\t\t\t// Handle backpressure\n\t\t\tif (!published) {\n\t\t\t\tawait new Promise((resolve) => channel.once('drain', resolve));\n\t\t\t}\n\t\t}\n\t}\n\n\tasync close(): Promise<void> {\n\t\t// Publisher doesn't own the connection\n\t\t// Connection should be closed by whoever created it\n\t}\n}\n"],"mappings":";;AAQA,IAAa,oBAAb,MAAa,kBAEb;CACC,YACSA,YACAC,UAAoC,CAAE,GAC7C;EAFO;EACA;CACL;;;;;CAMJ,aAAa,qBAEXC,kBAAgE;EACjE,MAAM,EAAE,oBAAoB,GAAG,2CAAM;EACrC,MAAM,aACL,MAAM,mBAAmB,qBAAqB,iBAAiB;AAChE,SAAO,IAAI,kBAA4B;CACvC;CAED,MAAM,QAAQC,UAAqC;AAClD,OAAK,KAAK,WAAW,aAAa,CACjC,OAAM,KAAK,WAAW,SAAS;EAGhC,MAAM,UAAU,KAAK,WAAW;AAChC,OAAK,QACJ,OAAM,IAAI,MAAM;EAGjB,MAAM,WAAW,KAAK,WAAW;AAEjC,OAAK,MAAM,WAAW,UAAU;GAC/B,MAAM,UAAU,OAAO,KAAK,KAAK,UAAU,QAAQ,QAAQ,CAAC;GAG5D,MAAM,aAAa,QAAQ;GAE3B,MAAM,YAAY,QAAQ,QAAQ,UAAU,YAAY,SAAS;IAChE,aAAa;IACb,WAAW,KAAK,KAAK;IACrB,MAAM,QAAQ;IACd,YAAY;IACZ,GAAG,KAAK,QAAQ;GAChB,EAAC;AAGF,QAAK,UACJ,OAAM,IAAI,QAAQ,CAAC,YAAY,QAAQ,KAAK,SAAS,QAAQ;EAE9D;CACD;CAED,MAAM,QAAuB,CAG5B;AACD"}
@@ -1,5 +1,5 @@
1
- import { EventPublisher, PublishableMessage } from "./types-DEGUg5BA.cjs";
2
- import { RabbitMQConnection } from "./RabbitMQConnection-7cWp_-_Q.cjs";
1
+ import { EventPublisher, PublishableMessage } from "./types-DSVsPgKd.mjs";
2
+ import { RabbitMQConnection } from "./RabbitMQConnection-Ck-ktCp_.mjs";
3
3
  import amqplib from "amqplib";
4
4
 
5
5
  //#region src/rabbitmq/RabbitMQPublisher.d.ts
@@ -18,6 +18,8 @@ declare class RabbitMQPublisher<TMessage extends PublishableMessage<string, any>
18
18
  publish(messages: TMessage[]): Promise<void>;
19
19
  close(): Promise<void>;
20
20
  }
21
+ //# sourceMappingURL=RabbitMQPublisher.d.ts.map
22
+
21
23
  //#endregion
22
24
  export { RabbitMQPublisher, RabbitMQPublisherOptions };
23
- //# sourceMappingURL=RabbitMQPublisher-CpcbgrXj.d.cts.map
25
+ //# sourceMappingURL=RabbitMQPublisher-COnxcWEZ.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RabbitMQPublisher-COnxcWEZ.d.mts","names":[],"sources":["../src/rabbitmq/RabbitMQPublisher.ts"],"sourcesContent":[],"mappings":";;;;;UAIiB,wBAAA;mBACC,OAAA,CAAQ,OAAA,CAAQ;AADlC;AAIa,cAAA,iBAAiB,CAAA,iBAAkB,kBAAlB,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,YAClB,cADkB,CACH,QADG,CAAA,CAAA;EAAA,QAAA,UAAA;EAAA,QAAkB,OAAA;EAAkB,WACvC,CAAA,UAAA,EAGL,kBAHK,EAAA,OAAA,CAAA,EAIR,wBAJQ;EAAQ;;;;EAa6B,OAA1B,oBAAA,CAAA,iBADnB,kBACmB,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,gBAAA,EAAA,MAAA,CAAA,EAAR,OAAQ,CAAA,iBAAA,CAAkB,QAAlB,CAAA,CAAA;EAAiB,OAAzB,CAAA,QAAA,EAOL,QAPK,EAAA,CAAA,EAOQ,OAPR,CAAA,IAAA,CAAA;EAAO,KAOZ,CAAA,CAAA,EAiCT,OAjCS,CAAA,IAAA,CAAA"}