@geekmidas/events 10.0.0-alpha.99 → 10.0.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.
- package/CHANGELOG.md +116 -0
- package/README.md +1 -46
- package/dist/BasicConnection-CQsJpx2J.d.cts +27 -0
- package/dist/BasicConnection-CQsJpx2J.d.cts.map +1 -0
- package/dist/BasicConnection-CxfNEvlb.cjs +48 -0
- package/dist/BasicConnection-CxfNEvlb.cjs.map +1 -0
- package/dist/BasicConnection-DcRelT64.d.mts +27 -0
- package/dist/BasicConnection-DcRelT64.d.mts.map +1 -0
- package/dist/BasicConnection-hl-Ogz3a.mjs +42 -0
- package/dist/BasicConnection-hl-Ogz3a.mjs.map +1 -0
- package/dist/BasicPublisher-C-hMX2Hy.d.mts +14 -0
- package/dist/BasicPublisher-C-hMX2Hy.d.mts.map +1 -0
- package/dist/BasicPublisher-CGMXg2I2.d.cts +14 -0
- package/dist/BasicPublisher-CGMXg2I2.d.cts.map +1 -0
- package/dist/BasicPublisher-CXAVKxgq.cjs +20 -0
- package/dist/BasicPublisher-CXAVKxgq.cjs.map +1 -0
- package/dist/BasicPublisher-DogbeHAH.mjs +14 -0
- package/dist/BasicPublisher-DogbeHAH.mjs.map +1 -0
- package/dist/BasicSubscriber-BJSZN22M.mjs +16 -0
- package/dist/BasicSubscriber-BJSZN22M.mjs.map +1 -0
- package/dist/BasicSubscriber-HzSJ_MbB.d.mts +14 -0
- package/dist/BasicSubscriber-HzSJ_MbB.d.mts.map +1 -0
- package/dist/BasicSubscriber-mVJRMXhZ.cjs +22 -0
- package/dist/BasicSubscriber-mVJRMXhZ.cjs.map +1 -0
- package/dist/BasicSubscriber-uW3IOyBj.d.cts +14 -0
- package/dist/BasicSubscriber-uW3IOyBj.d.cts.map +1 -0
- package/dist/EventConnection-4niMI6D8.d.mts +13 -0
- package/dist/EventConnection-4niMI6D8.d.mts.map +1 -0
- package/dist/EventConnection-BkA9FSVL.cjs +45 -0
- package/dist/EventConnection-BkA9FSVL.cjs.map +1 -0
- package/dist/EventConnection-Kr32GAzq.mjs +40 -0
- package/dist/EventConnection-Kr32GAzq.mjs.map +1 -0
- package/dist/EventConnection-dP42P87q.d.cts +13 -0
- package/dist/EventConnection-dP42P87q.d.cts.map +1 -0
- package/dist/EventConnection.cjs +5 -0
- package/dist/EventConnection.d.cts +3 -0
- package/dist/EventConnection.d.mts +3 -0
- package/dist/EventConnection.mjs +4 -0
- package/dist/PgBossConnection-B71ssr72.cjs +80 -0
- package/dist/PgBossConnection-B71ssr72.cjs.map +1 -0
- package/dist/PgBossConnection-Bj_Wo1lQ.mjs +74 -0
- package/dist/PgBossConnection-Bj_Wo1lQ.mjs.map +1 -0
- package/dist/PgBossConnection-DCfLGoHx.d.mts +32 -0
- package/dist/PgBossConnection-DCfLGoHx.d.mts.map +1 -0
- package/dist/PgBossConnection-oto_CAbP.d.cts +32 -0
- package/dist/PgBossConnection-oto_CAbP.d.cts.map +1 -0
- package/dist/PgBossPublisher-Bwo7qSoH.mjs +35 -0
- package/dist/PgBossPublisher-Bwo7qSoH.mjs.map +1 -0
- package/dist/PgBossPublisher-CqjigBVC.d.mts +20 -0
- package/dist/PgBossPublisher-CqjigBVC.d.mts.map +1 -0
- package/dist/PgBossPublisher-FTdYh58W.cjs +41 -0
- package/dist/PgBossPublisher-FTdYh58W.cjs.map +1 -0
- package/dist/PgBossPublisher-JIiB1zpA.d.cts +20 -0
- package/dist/PgBossPublisher-JIiB1zpA.d.cts.map +1 -0
- package/dist/PgBossSubscriber-BUiB1JKf.d.mts +24 -0
- package/dist/PgBossSubscriber-BUiB1JKf.d.mts.map +1 -0
- package/dist/PgBossSubscriber-BubVfuWm.cjs +52 -0
- package/dist/PgBossSubscriber-BubVfuWm.cjs.map +1 -0
- package/dist/PgBossSubscriber-Cozijfdj.d.cts +24 -0
- package/dist/PgBossSubscriber-Cozijfdj.d.cts.map +1 -0
- package/dist/PgBossSubscriber-DopATe80.mjs +46 -0
- package/dist/PgBossSubscriber-DopATe80.mjs.map +1 -0
- package/dist/Publisher-CKloIGh6.cjs +79 -0
- package/dist/Publisher-CKloIGh6.cjs.map +1 -0
- package/dist/Publisher-ChLTrUeP.mjs +74 -0
- package/dist/Publisher-ChLTrUeP.mjs.map +1 -0
- package/dist/Publisher-DDee6xau.d.cts +21 -0
- package/dist/Publisher-DDee6xau.d.cts.map +1 -0
- package/dist/Publisher-VHumMkrP.d.mts +21 -0
- package/dist/Publisher-VHumMkrP.d.mts.map +1 -0
- package/dist/Publisher.cjs +4 -0
- package/dist/Publisher.d.cts +3 -0
- package/dist/Publisher.d.mts +3 -0
- package/dist/Publisher.mjs +4 -0
- package/dist/RabbitMQConnection-BtKZjtZY.mjs +107 -0
- package/dist/RabbitMQConnection-BtKZjtZY.mjs.map +1 -0
- package/dist/RabbitMQConnection-DV9t3VYp.d.mts +44 -0
- package/dist/RabbitMQConnection-DV9t3VYp.d.mts.map +1 -0
- package/dist/RabbitMQConnection-DmMMosT4.cjs +113 -0
- package/dist/RabbitMQConnection-DmMMosT4.cjs.map +1 -0
- package/dist/RabbitMQConnection-jNME_eR7.d.cts +44 -0
- package/dist/RabbitMQConnection-jNME_eR7.d.cts.map +1 -0
- package/dist/RabbitMQPublisher-C94q6g8q.cjs +45 -0
- package/dist/RabbitMQPublisher-C94q6g8q.cjs.map +1 -0
- package/dist/RabbitMQPublisher-DKmgwqVj.d.mts +25 -0
- package/dist/RabbitMQPublisher-DKmgwqVj.d.mts.map +1 -0
- package/dist/RabbitMQPublisher-d257OHLa.d.cts +25 -0
- package/dist/RabbitMQPublisher-d257OHLa.d.cts.map +1 -0
- package/dist/RabbitMQPublisher-yUqWNq-P.mjs +39 -0
- package/dist/RabbitMQPublisher-yUqWNq-P.mjs.map +1 -0
- package/dist/RabbitMQSubscriber-BF7JGfYm.d.cts +27 -0
- package/dist/RabbitMQSubscriber-BF7JGfYm.d.cts.map +1 -0
- package/dist/RabbitMQSubscriber-BWniDtFs.mjs +56 -0
- package/dist/RabbitMQSubscriber-BWniDtFs.mjs.map +1 -0
- package/dist/RabbitMQSubscriber-CdbUy5mB.d.mts +27 -0
- package/dist/RabbitMQSubscriber-CdbUy5mB.d.mts.map +1 -0
- package/dist/RabbitMQSubscriber-DGEO-clQ.cjs +62 -0
- package/dist/RabbitMQSubscriber-DGEO-clQ.cjs.map +1 -0
- package/dist/SNSConnection-CAcbLQOy.cjs +76 -0
- package/dist/SNSConnection-CAcbLQOy.cjs.map +1 -0
- package/dist/SNSConnection-CG4iEwA8.d.mts +41 -0
- package/dist/SNSConnection-CG4iEwA8.d.mts.map +1 -0
- package/dist/SNSConnection-CVjH93lb.mjs +70 -0
- package/dist/SNSConnection-CVjH93lb.mjs.map +1 -0
- package/dist/SNSConnection-Dol9FuxA.d.cts +41 -0
- package/dist/SNSConnection-Dol9FuxA.d.cts.map +1 -0
- package/dist/SNSPublisher-CjlMS3Z2.mjs +41 -0
- package/dist/SNSPublisher-CjlMS3Z2.mjs.map +1 -0
- package/dist/SNSPublisher-D50dPCEh.d.mts +22 -0
- package/dist/SNSPublisher-D50dPCEh.d.mts.map +1 -0
- package/dist/SNSPublisher-DQunY4NM.d.cts +22 -0
- package/dist/SNSPublisher-DQunY4NM.d.cts.map +1 -0
- package/dist/SNSPublisher-DV_8GGsi.cjs +47 -0
- package/dist/SNSPublisher-DV_8GGsi.cjs.map +1 -0
- package/dist/SNSSubscriber-BWaCQFl6.mjs +139 -0
- package/dist/SNSSubscriber-BWaCQFl6.mjs.map +1 -0
- package/dist/SNSSubscriber-CUgHK4W2.d.mts +55 -0
- package/dist/SNSSubscriber-CUgHK4W2.d.mts.map +1 -0
- package/dist/SNSSubscriber-ZE_-Hsps.cjs +145 -0
- package/dist/SNSSubscriber-ZE_-Hsps.cjs.map +1 -0
- package/dist/SNSSubscriber-ZGJjhXFQ.d.cts +55 -0
- package/dist/SNSSubscriber-ZGJjhXFQ.d.cts.map +1 -0
- package/dist/SQSConnection-BtEkDha8.d.cts +41 -0
- package/dist/SQSConnection-BtEkDha8.d.cts.map +1 -0
- package/dist/SQSConnection-CT3S7_zP.mjs +70 -0
- package/dist/SQSConnection-CT3S7_zP.mjs.map +1 -0
- package/dist/SQSConnection-DVy43GCV.d.mts +41 -0
- package/dist/SQSConnection-DVy43GCV.d.mts.map +1 -0
- package/dist/SQSConnection-Y0mdVTcB.cjs +76 -0
- package/dist/SQSConnection-Y0mdVTcB.cjs.map +1 -0
- package/dist/SQSPublisher-B-32CC4G.mjs +57 -0
- package/dist/SQSPublisher-B-32CC4G.mjs.map +1 -0
- package/dist/SQSPublisher-CgUduk6H.cjs +63 -0
- package/dist/SQSPublisher-CgUduk6H.cjs.map +1 -0
- package/dist/SQSPublisher-kyl5HW3N.d.cts +25 -0
- package/dist/SQSPublisher-kyl5HW3N.d.cts.map +1 -0
- package/dist/SQSPublisher-qDE5Fp-N.d.mts +25 -0
- package/dist/SQSPublisher-qDE5Fp-N.d.mts.map +1 -0
- package/dist/SQSSubscriber-C4UA2hKq.cjs +120 -0
- package/dist/SQSSubscriber-C4UA2hKq.cjs.map +1 -0
- package/dist/SQSSubscriber-CDvaG4ij.d.cts +44 -0
- package/dist/SQSSubscriber-CDvaG4ij.d.cts.map +1 -0
- package/dist/SQSSubscriber-CQdSFzpe.mjs +114 -0
- package/dist/SQSSubscriber-CQdSFzpe.mjs.map +1 -0
- package/dist/SQSSubscriber-JfFuAAoP.d.mts +44 -0
- package/dist/SQSSubscriber-JfFuAAoP.d.mts.map +1 -0
- package/dist/Subscriber-CG_QUQZs.d.cts +21 -0
- package/dist/Subscriber-CG_QUQZs.d.cts.map +1 -0
- package/dist/Subscriber-CghW0A02.cjs +88 -0
- package/dist/Subscriber-CghW0A02.cjs.map +1 -0
- package/dist/Subscriber-DiYHmuF0.d.mts +21 -0
- package/dist/Subscriber-DiYHmuF0.d.mts.map +1 -0
- package/dist/Subscriber-bnkFtSvt.mjs +83 -0
- package/dist/Subscriber-bnkFtSvt.mjs.map +1 -0
- package/dist/Subscriber.cjs +4 -0
- package/dist/Subscriber.d.cts +3 -0
- package/dist/Subscriber.d.mts +3 -0
- package/dist/Subscriber.mjs +4 -0
- package/dist/basic/BasicConnection.cjs +4 -0
- package/dist/basic/BasicConnection.d.cts +3 -0
- package/dist/basic/BasicConnection.d.mts +3 -0
- package/dist/basic/BasicConnection.mjs +4 -0
- package/dist/basic/BasicPublisher.cjs +3 -0
- package/dist/basic/BasicPublisher.d.cts +4 -0
- package/dist/basic/BasicPublisher.d.mts +4 -0
- package/dist/basic/BasicPublisher.mjs +3 -0
- package/dist/basic/BasicSubscriber.cjs +3 -0
- package/dist/basic/BasicSubscriber.d.cts +4 -0
- package/dist/basic/BasicSubscriber.d.mts +4 -0
- package/dist/basic/BasicSubscriber.mjs +3 -0
- package/dist/basic/index.cjs +7 -100
- package/dist/basic/index.d.cts +5 -45
- package/dist/basic/index.d.mts +5 -45
- package/dist/basic/index.mjs +5 -96
- package/dist/{rolldown-runtime-C0BPl7ul.cjs → chunk-CUT6urMc.cjs} +10 -23
- package/dist/index.cjs +8 -87
- package/dist/index.d.cts +5 -102
- package/dist/index.d.mts +5 -102
- package/dist/index.mjs +5 -71
- package/dist/pgboss/PgBossConnection.cjs +4 -0
- package/dist/pgboss/PgBossConnection.d.cts +3 -0
- package/dist/pgboss/PgBossConnection.d.mts +3 -0
- package/dist/pgboss/PgBossConnection.mjs +4 -0
- package/dist/pgboss/PgBossPublisher.cjs +3 -0
- package/dist/pgboss/PgBossPublisher.d.cts +4 -0
- package/dist/pgboss/PgBossPublisher.d.mts +4 -0
- package/dist/pgboss/PgBossPublisher.mjs +3 -0
- package/dist/pgboss/PgBossSubscriber.cjs +3 -0
- package/dist/pgboss/PgBossSubscriber.d.cts +4 -0
- package/dist/pgboss/PgBossSubscriber.d.mts +4 -0
- package/dist/pgboss/PgBossSubscriber.mjs +3 -0
- package/dist/pgboss/index.cjs +7 -247
- package/dist/pgboss/index.d.cts +5 -107
- package/dist/pgboss/index.d.mts +5 -107
- package/dist/pgboss/index.mjs +5 -240
- package/dist/rabbitmq/RabbitMQConnection.cjs +4 -0
- package/dist/rabbitmq/RabbitMQConnection.d.cts +3 -0
- package/dist/rabbitmq/RabbitMQConnection.d.mts +3 -0
- package/dist/rabbitmq/RabbitMQConnection.mjs +4 -0
- package/dist/rabbitmq/RabbitMQPublisher.cjs +3 -0
- package/dist/rabbitmq/RabbitMQPublisher.d.cts +4 -0
- package/dist/rabbitmq/RabbitMQPublisher.d.mts +4 -0
- package/dist/rabbitmq/RabbitMQPublisher.mjs +3 -0
- package/dist/rabbitmq/RabbitMQSubscriber.cjs +3 -0
- package/dist/rabbitmq/RabbitMQSubscriber.d.cts +4 -0
- package/dist/rabbitmq/RabbitMQSubscriber.d.mts +4 -0
- package/dist/rabbitmq/RabbitMQSubscriber.mjs +3 -0
- package/dist/rabbitmq/index.cjs +7 -243
- package/dist/rabbitmq/index.d.cts +5 -92
- package/dist/rabbitmq/index.d.mts +5 -92
- package/dist/rabbitmq/index.mjs +5 -237
- package/dist/sns/SNSConnection.cjs +4 -0
- package/dist/sns/SNSConnection.d.cts +3 -0
- package/dist/sns/SNSConnection.d.mts +3 -0
- package/dist/sns/SNSConnection.mjs +4 -0
- package/dist/sns/SNSPublisher.cjs +3 -0
- package/dist/sns/SNSPublisher.d.cts +4 -0
- package/dist/sns/SNSPublisher.d.mts +4 -0
- package/dist/sns/SNSPublisher.mjs +3 -0
- package/dist/sns/SNSSubscriber.cjs +6 -0
- package/dist/sns/SNSSubscriber.d.cts +4 -0
- package/dist/sns/SNSSubscriber.d.mts +4 -0
- package/dist/sns/SNSSubscriber.mjs +6 -0
- package/dist/sns/index.cjs +9 -551
- package/dist/sns/index.d.cts +5 -273
- package/dist/sns/index.d.mts +5 -273
- package/dist/sns/index.mjs +7 -527
- package/dist/sqs/SQSConnection.cjs +4 -0
- package/dist/sqs/SQSConnection.d.cts +3 -0
- package/dist/sqs/SQSConnection.d.mts +3 -0
- package/dist/sqs/SQSConnection.mjs +4 -0
- package/dist/sqs/SQSPublisher.cjs +3 -0
- package/dist/sqs/SQSPublisher.d.cts +4 -0
- package/dist/sqs/SQSPublisher.d.mts +4 -0
- package/dist/sqs/SQSPublisher.mjs +3 -0
- package/dist/sqs/SQSSubscriber.cjs +3 -0
- package/dist/sqs/SQSSubscriber.d.cts +4 -0
- package/dist/sqs/SQSSubscriber.d.mts +4 -0
- package/dist/sqs/SQSSubscriber.mjs +3 -0
- package/dist/sqs/index.cjs +7 -35
- package/dist/sqs/index.d.cts +5 -118
- package/dist/sqs/index.d.mts +5 -118
- package/dist/sqs/index.mjs +5 -24
- package/dist/types-BrdcSEnd.mjs +18 -0
- package/dist/types-BrdcSEnd.mjs.map +1 -0
- package/dist/types-Byv8N9ma.cjs +24 -0
- package/dist/types-Byv8N9ma.cjs.map +1 -0
- package/dist/types-Dh9Jyinx.d.mts +67 -0
- package/dist/types-Dh9Jyinx.d.mts.map +1 -0
- package/dist/types-Dj23od3e.d.cts +67 -0
- package/dist/types-Dj23od3e.d.cts.map +1 -0
- package/dist/types.cjs +3 -0
- package/dist/types.d.cts +2 -0
- package/dist/types.d.mts +2 -0
- package/dist/types.mjs +3 -0
- package/package.json +12 -40
- package/src/EventConnection.ts +43 -0
- package/src/Publisher.ts +98 -0
- package/src/Subscriber.ts +113 -0
- package/src/__tests__/EventConnection.spec.ts +42 -0
- package/src/__tests__/Publisher.spec.ts +96 -0
- package/src/__tests__/Subscriber.spec.ts +109 -0
- package/src/basic/BasicConnection.ts +47 -0
- package/src/basic/BasicPublisher.ts +15 -0
- package/src/basic/BasicSubscriber.ts +21 -0
- package/src/basic/__tests__/BasicSubscriber.spec.ts +166 -0
- package/src/basic/index.ts +3 -0
- package/src/index.ts +25 -0
- package/src/pgboss/PgBossConnection.ts +91 -0
- package/src/pgboss/PgBossPublisher.ts +49 -0
- package/src/pgboss/PgBossSubscriber.ts +81 -0
- package/src/pgboss/__tests__/pgboss.spec.ts +196 -0
- package/src/pgboss/__tests__/setup.ts +21 -0
- package/src/pgboss/index.ts +5 -0
- package/src/rabbitmq/RabbitMQConnection.ts +148 -0
- package/src/rabbitmq/RabbitMQPublisher.ts +67 -0
- package/src/rabbitmq/RabbitMQSubscriber.ts +111 -0
- package/src/rabbitmq/__tests__/RabbitMQPublisher.spec.ts +378 -0
- package/src/rabbitmq/__tests__/RabbitMQSubscriber.spec.ts +292 -0
- package/src/rabbitmq/index.ts +6 -0
- package/src/sns/SNSConnection.ts +98 -0
- package/src/sns/SNSPublisher.ts +62 -0
- package/src/sns/SNSSubscriber.ts +218 -0
- package/src/sns/__tests__/SNS-SQS-Integration.spec.ts +389 -0
- package/src/sns/__tests__/SNSPublisher.spec.ts +449 -0
- package/src/sns/__tests__/SNSSubscriber.spec.ts +527 -0
- package/src/sns/index.ts +6 -0
- package/src/sqs/SQSConnection.ts +97 -0
- package/src/sqs/SQSPublisher.ts +105 -0
- package/src/sqs/SQSSubscriber.ts +181 -0
- package/src/sqs/__tests__/SQSPublisher.spec.ts +189 -0
- package/src/sqs/index.ts +6 -0
- package/src/types.ts +76 -0
- package/tsconfig.json +9 -0
- package/tsdown.config.ts +10 -0
- package/dist/SQSSubscriber-BEJBfNTe.mjs +0 -264
- package/dist/SQSSubscriber-BEJBfNTe.mjs.map +0 -1
- package/dist/SQSSubscriber-COTqWvOk.cjs +0 -288
- package/dist/SQSSubscriber-COTqWvOk.cjs.map +0 -1
- package/dist/basic/index.cjs.map +0 -1
- package/dist/basic/index.d.cts.map +0 -1
- package/dist/basic/index.d.mts.map +0 -1
- package/dist/basic/index.mjs.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/pgboss/index.cjs.map +0 -1
- package/dist/pgboss/index.d.cts.map +0 -1
- package/dist/pgboss/index.d.mts.map +0 -1
- package/dist/pgboss/index.mjs.map +0 -1
- package/dist/rabbitmq/index.cjs.map +0 -1
- package/dist/rabbitmq/index.d.cts.map +0 -1
- package/dist/rabbitmq/index.d.mts.map +0 -1
- package/dist/rabbitmq/index.mjs.map +0 -1
- package/dist/registry-DIx25Q5s.d.cts +0 -255
- package/dist/registry-DIx25Q5s.d.cts.map +0 -1
- package/dist/registry-DIx25Q5s.d.mts +0 -255
- package/dist/registry-DIx25Q5s.d.mts.map +0 -1
- package/dist/registry-DXLY1Xf6.mjs +0 -99
- package/dist/registry-DXLY1Xf6.mjs.map +0 -1
- package/dist/registry-DlT36229.cjs +0 -122
- package/dist/registry-DlT36229.cjs.map +0 -1
- package/dist/rolldown-runtime-D7D4PA-g.mjs +0 -13
- package/dist/sns/index.cjs.map +0 -1
- package/dist/sns/index.d.cts.map +0 -1
- package/dist/sns/index.d.mts.map +0 -1
- package/dist/sns/index.mjs.map +0 -1
- package/dist/sns/snsUrl.cjs +0 -92
- package/dist/sns/snsUrl.cjs.map +0 -1
- package/dist/sns/snsUrl.d.cts +0 -57
- package/dist/sns/snsUrl.d.cts.map +0 -1
- package/dist/sns/snsUrl.d.mts +0 -57
- package/dist/sns/snsUrl.d.mts.map +0 -1
- package/dist/sns/snsUrl.mjs +0 -82
- package/dist/sns/snsUrl.mjs.map +0 -1
- package/dist/sqs/index.cjs.map +0 -1
- package/dist/sqs/index.d.cts.map +0 -1
- package/dist/sqs/index.d.mts.map +0 -1
- package/dist/sqs/index.mjs.map +0 -1
- package/dist/sqs/sqsUrl.cjs +0 -93
- package/dist/sqs/sqsUrl.cjs.map +0 -1
- package/dist/sqs/sqsUrl.d.cts +0 -56
- package/dist/sqs/sqsUrl.d.cts.map +0 -1
- package/dist/sqs/sqsUrl.d.mts +0 -56
- package/dist/sqs/sqsUrl.d.mts.map +0 -1
- package/dist/sqs/sqsUrl.mjs +0 -83
- package/dist/sqs/sqsUrl.mjs.map +0 -1
- package/dist/telemetry-DG3l807O.cjs +0 -309
- package/dist/telemetry-DG3l807O.cjs.map +0 -1
- package/dist/telemetry-DjjgJMul.mjs +0 -244
- package/dist/telemetry-DjjgJMul.mjs.map +0 -1
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import { InferStandardSchema } from "@geekmidas/schema";
|
|
2
|
-
//#region ../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts
|
|
3
|
-
/** The Standard Typed interface. This is a base type extended by other specs. */
|
|
4
|
-
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
5
|
-
/** The Standard properties. */
|
|
6
|
-
readonly "~standard": StandardTypedV1.Props<Input, Output>;
|
|
7
|
-
}
|
|
8
|
-
declare namespace StandardTypedV1 {
|
|
9
|
-
/** The Standard Typed properties interface. */
|
|
10
|
-
interface Props<Input = unknown, Output = Input> {
|
|
11
|
-
/** The version number of the standard. */
|
|
12
|
-
readonly version: 1;
|
|
13
|
-
/** The vendor name of the schema library. */
|
|
14
|
-
readonly vendor: string;
|
|
15
|
-
/** Inferred types associated with the schema. */
|
|
16
|
-
readonly types?: Types<Input, Output> | undefined;
|
|
17
|
-
}
|
|
18
|
-
/** The Standard Typed types interface. */
|
|
19
|
-
interface Types<Input = unknown, Output = Input> {
|
|
20
|
-
/** The input type of the schema. */
|
|
21
|
-
readonly input: Input;
|
|
22
|
-
/** The output type of the schema. */
|
|
23
|
-
readonly output: Output;
|
|
24
|
-
}
|
|
25
|
-
/** Infers the input type of a Standard Typed. */
|
|
26
|
-
type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
27
|
-
/** Infers the output type of a Standard Typed. */
|
|
28
|
-
type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
29
|
-
}
|
|
30
|
-
/** The Standard Schema interface. */
|
|
31
|
-
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
32
|
-
/** The Standard Schema properties. */
|
|
33
|
-
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
34
|
-
}
|
|
35
|
-
declare namespace StandardSchemaV1 {
|
|
36
|
-
/** The Standard Schema properties interface. */
|
|
37
|
-
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
38
|
-
/** Validates unknown input values. */
|
|
39
|
-
readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
|
|
40
|
-
}
|
|
41
|
-
/** The result interface of the validate function. */
|
|
42
|
-
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
43
|
-
/** The result interface if validation succeeds. */
|
|
44
|
-
interface SuccessResult<Output> {
|
|
45
|
-
/** The typed output value. */
|
|
46
|
-
readonly value: Output;
|
|
47
|
-
/** A falsy value for `issues` indicates success. */
|
|
48
|
-
readonly issues?: undefined;
|
|
49
|
-
}
|
|
50
|
-
interface Options {
|
|
51
|
-
/** Explicit support for additional vendor-specific parameters, if needed. */
|
|
52
|
-
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
53
|
-
}
|
|
54
|
-
/** The result interface if validation fails. */
|
|
55
|
-
interface FailureResult {
|
|
56
|
-
/** The issues of failed validation. */
|
|
57
|
-
readonly issues: ReadonlyArray<Issue>;
|
|
58
|
-
}
|
|
59
|
-
/** The issue interface of the failure output. */
|
|
60
|
-
interface Issue {
|
|
61
|
-
/** The error message of the issue. */
|
|
62
|
-
readonly message: string;
|
|
63
|
-
/** The path of the issue, if any. */
|
|
64
|
-
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
65
|
-
}
|
|
66
|
-
/** The path segment interface of the issue. */
|
|
67
|
-
interface PathSegment {
|
|
68
|
-
/** The key representing a path segment. */
|
|
69
|
-
readonly key: PropertyKey;
|
|
70
|
-
}
|
|
71
|
-
/** The Standard types interface. */
|
|
72
|
-
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
|
|
73
|
-
/** Infers the input type of a Standard. */
|
|
74
|
-
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
75
|
-
/** Infers the output type of a Standard. */
|
|
76
|
-
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
77
|
-
}
|
|
78
|
-
//#endregion
|
|
79
|
-
//#region src/types.d.ts
|
|
80
|
-
/**
|
|
81
|
-
* Represents a publishable event message with a type and payload.
|
|
82
|
-
*
|
|
83
|
-
* @template TType - The event type/name (e.g., 'user.created')
|
|
84
|
-
* @template TPayload - The event payload data
|
|
85
|
-
*/
|
|
86
|
-
type PublishableMessage<TType extends string, TPayload> = {
|
|
87
|
-
type: TType;
|
|
88
|
-
payload: TPayload;
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* Event publisher/subscriber types
|
|
92
|
-
*/
|
|
93
|
-
declare enum EventPublisherType {
|
|
94
|
-
Basic = "basic",
|
|
95
|
-
EventBridge = "eventbridge",
|
|
96
|
-
SQS = "sqs",
|
|
97
|
-
SNS = "sns",
|
|
98
|
-
Kafka = "kafka",
|
|
99
|
-
RabbitMQ = "rabbitmq",
|
|
100
|
-
PgBoss = "pgboss"
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* A connection string or connection whose transport nothing here implements —
|
|
104
|
-
* a typo'd scheme, or one of the listed-but-unbuilt ones (EventBridge, Kafka).
|
|
105
|
-
*/
|
|
106
|
-
declare class UnsupportedEventTransport extends Error {
|
|
107
|
-
readonly transport: string;
|
|
108
|
-
readonly role: 'publisher' | 'subscriber' | 'connection';
|
|
109
|
-
constructor(transport: string, role: 'publisher' | 'subscriber' | 'connection');
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Base interface for event connections
|
|
113
|
-
* Connections manage the underlying transport (RabbitMQ channel, SQS client, etc.)
|
|
114
|
-
*/
|
|
115
|
-
interface EventConnection {
|
|
116
|
-
readonly type: EventPublisherType;
|
|
117
|
-
connect(): Promise<void>;
|
|
118
|
-
close(): Promise<void>;
|
|
119
|
-
isConnected(): boolean;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Interface for event publishers that handle the actual publishing of events.
|
|
123
|
-
* Implementations can send to EventBridge, SQS, Kafka, or any other event system.
|
|
124
|
-
*
|
|
125
|
-
* @template TMessage - The union type of all publishable messages
|
|
126
|
-
*/
|
|
127
|
-
type EventPublisher<TMessage extends PublishableMessage<string, any>> = {
|
|
128
|
-
publish: (message: TMessage[]) => Promise<void>;
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* Interface for event subscribers that handle receiving and processing events.
|
|
132
|
-
*
|
|
133
|
-
* @template TMessage - The union type of all publishable messages
|
|
134
|
-
*/
|
|
135
|
-
type EventSubscriber<TMessage extends PublishableMessage<string, any>> = {
|
|
136
|
-
subscribe: (messages: TMessage['type'][], listener: (payload: TMessage) => Promise<void>) => Promise<void>;
|
|
137
|
-
};
|
|
138
|
-
/**
|
|
139
|
-
* Utility type to extract the message from EventPublisher
|
|
140
|
-
*/
|
|
141
|
-
type ExtractPublisherMessage<T> = T extends EventPublisher<infer M> ? M : never;
|
|
142
|
-
type MappedEvent<T extends EventPublisher<any> | undefined, OutSchema extends StandardSchemaV1 | undefined = undefined> = {
|
|
143
|
-
type: ExtractPublisherMessage<T>['type'];
|
|
144
|
-
payload: (ctx: InferStandardSchema<OutSchema>) => ExtractPublisherMessage<T>['payload'];
|
|
145
|
-
when?: (ctx: InferStandardSchema<OutSchema>) => boolean;
|
|
146
|
-
};
|
|
147
|
-
//#endregion
|
|
148
|
-
//#region src/Publisher.d.ts
|
|
149
|
-
/** How a publisher is used, beyond the address it reaches. */
|
|
150
|
-
interface PublisherOptions {
|
|
151
|
-
/**
|
|
152
|
-
* The topic this publisher fans out to. SNS and RabbitMQ name the topic in
|
|
153
|
-
* their address already; pg-boss has one address for every topic and queue,
|
|
154
|
-
* so it is told here that a message goes to every subscriber rather than to
|
|
155
|
-
* one queue.
|
|
156
|
-
*/
|
|
157
|
-
topic?: string;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Publishers for a connection string or a connection, through whichever
|
|
161
|
-
* driver is registered for its scheme — see `registerEventsDriver`.
|
|
162
|
-
*/
|
|
163
|
-
declare class Publisher {
|
|
164
|
-
/**
|
|
165
|
-
* Create a publisher from a connection string
|
|
166
|
-
* This creates both a connection and a publisher
|
|
167
|
-
*
|
|
168
|
-
* @throws {UnregisteredEventsScheme} when the broker's driver is not
|
|
169
|
-
* registered.
|
|
170
|
-
*/
|
|
171
|
-
static fromConnectionString<TMessage extends PublishableMessage<string, any>>(connectionStr: EventPublisherConnectionString, options?: PublisherOptions): Promise<EventPublisher<TMessage>>;
|
|
172
|
-
/**
|
|
173
|
-
* Create a publisher from an existing connection
|
|
174
|
-
* This allows sharing connections between publishers and subscribers
|
|
175
|
-
*/
|
|
176
|
-
static fromConnection<TMessage extends PublishableMessage<string, any>>(connection: EventConnection, options?: PublisherOptions): Promise<EventPublisher<TMessage>>;
|
|
177
|
-
}
|
|
178
|
-
type EventPublisherConnectionString = `${EventPublisherType}://${string}`;
|
|
179
|
-
//#endregion
|
|
180
|
-
//#region src/registry.d.ts
|
|
181
|
-
type AnyMessage = PublishableMessage<string, any>;
|
|
182
|
-
/** How a subscriber built from a connection is used, beyond its address. */
|
|
183
|
-
interface SubscriberOptions {
|
|
184
|
-
/**
|
|
185
|
-
* The topic subscribed to. pg-boss needs it, with {@link subscription}, to
|
|
186
|
-
* give each subscriber a queue of its own; the other brokers carry the topic
|
|
187
|
-
* in their address and ignore it.
|
|
188
|
-
*/
|
|
189
|
-
topic?: string;
|
|
190
|
-
/** The subscriber's name — its own queue on pg-boss. */
|
|
191
|
-
subscription?: string;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* One broker: the connections, publishers and subscribers for its scheme.
|
|
195
|
-
*
|
|
196
|
-
* A driver owns parsing — the shape of an `sns://` string is SNS's business —
|
|
197
|
-
* and is the only module that imports its broker's client library.
|
|
198
|
-
*/
|
|
199
|
-
interface EventsDriver {
|
|
200
|
-
/**
|
|
201
|
-
* The scheme this driver handles, without the colon — `'pgboss'`, `'sns'`.
|
|
202
|
-
* It is also the `type` of every connection the driver builds, which is how
|
|
203
|
-
* a connection finds its way back here.
|
|
204
|
-
*/
|
|
205
|
-
readonly scheme: `${EventPublisherType}`;
|
|
206
|
-
/** A connection, connected, for a connection string. */
|
|
207
|
-
connect(connectionString: string): Promise<EventConnection>;
|
|
208
|
-
/** A publisher, with a connection of its own, for a connection string. */
|
|
209
|
-
publisher<TMessage extends AnyMessage>(connectionString: string, options: PublisherOptions): Promise<EventPublisher<TMessage>>;
|
|
210
|
-
/** A publisher on a connection this driver built. */
|
|
211
|
-
publisherFor<TMessage extends AnyMessage>(connection: EventConnection, options: PublisherOptions): EventPublisher<TMessage>;
|
|
212
|
-
/** A subscriber, with a connection of its own, for a connection string. */
|
|
213
|
-
subscriber<TMessage extends AnyMessage>(connectionString: string): Promise<EventSubscriber<TMessage>>;
|
|
214
|
-
/** A subscriber on a connection this driver built. */
|
|
215
|
-
subscriberFor<TMessage extends AnyMessage>(connection: EventConnection, options: SubscriberOptions): EventSubscriber<TMessage>;
|
|
216
|
-
}
|
|
217
|
-
/** Make a driver available to `Publisher`, `Subscriber` and friends. Idempotent. */
|
|
218
|
-
declare function registerEventsDriver(driver: EventsDriver): void;
|
|
219
|
-
/** Which schemes are currently registered — the useful half of a failure. */
|
|
220
|
-
declare function registeredEventsSchemes(): string[];
|
|
221
|
-
/**
|
|
222
|
-
* The driver for a scheme — `'pgboss'`, `'pgboss:'`, or a whole connection
|
|
223
|
-
* string, whichever the caller has.
|
|
224
|
-
*
|
|
225
|
-
* @throws {UnregisteredEventsScheme} when the scheme is a broker this package
|
|
226
|
-
* implements but nothing registered its driver.
|
|
227
|
-
* @throws {UnsupportedEventTransport} when no broker here has that scheme.
|
|
228
|
-
*/
|
|
229
|
-
declare function eventsDriverFor(scheme: string, role?: 'publisher' | 'subscriber' | 'connection'): EventsDriver;
|
|
230
|
-
/**
|
|
231
|
-
* A connection string for a broker whose driver nothing registered.
|
|
232
|
-
*
|
|
233
|
-
* The broker exists — this is not a typo'd scheme — but the process was never
|
|
234
|
-
* told about it. Usually a script building its own publisher, or a build that
|
|
235
|
-
* registered the drivers for a different target than the one that composed
|
|
236
|
-
* the connection string.
|
|
237
|
-
*/
|
|
238
|
-
declare class UnregisteredEventsScheme extends Error {
|
|
239
|
-
/** The scheme with no driver, without the colon — `'pgboss'`. */
|
|
240
|
-
readonly scheme: string;
|
|
241
|
-
/** What is registered, so the caller can see what was chosen instead. */
|
|
242
|
-
readonly registered: readonly string[];
|
|
243
|
-
/** The subpath that exports the missing driver. */
|
|
244
|
-
readonly subpath: string;
|
|
245
|
-
/** The driver's export name. */
|
|
246
|
-
readonly driver: string;
|
|
247
|
-
constructor(
|
|
248
|
-
/** The scheme with no driver, without the colon — `'pgboss'`. */
|
|
249
|
-
scheme: string,
|
|
250
|
-
/** What is registered, so the caller can see what was chosen instead. */
|
|
251
|
-
registered: readonly string[]);
|
|
252
|
-
}
|
|
253
|
-
//#endregion
|
|
254
|
-
export { UnsupportedEventTransport as _, registerEventsDriver as a, Publisher as c, EventPublisher as d, EventPublisherType as f, PublishableMessage as g, MappedEvent as h, eventsDriverFor as i, PublisherOptions as l, ExtractPublisherMessage as m, SubscriberOptions as n, registeredEventsSchemes as o, EventSubscriber as p, UnregisteredEventsScheme as r, EventPublisherConnectionString as s, EventsDriver as t, EventConnection as u };
|
|
255
|
-
//# sourceMappingURL=registry-DIx25Q5s.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry-DIx25Q5s.d.mts","names":[],"sources":["../../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts","../src/types.ts","../src/Publisher.ts","../src/registry.ts"],"x_google_ignoreList":[0],"mappings":";;;UACU,gBAAgB,iBAAiB,SAAS;;WAEvC,aAAa,gBAAgB,MAAM,OAAO;;kBAErC;;YAEJ,MAAM,iBAAiB,SAAS;;aAE7B;;aAEA;;aAEA,QAA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C,qBACZ,iBAAiB,iCAEjB,eAAe,gCACf,UAAS,mBACP,QAAQ,eAAe;;;;;SAYb,eAAe,iBAAiB,iCAC5C,YAAY,iBACZ,UAAS,mBACP,QAAQ,eAAe;;KAQf,oCACR;;;KCrCC,aAAa;;UAGD;;;;;;EAMhB;;EAEA;;;;;;;;UASgB;;;;;;WAMP,WAAW;;EAEpB,QAAQ,2BAA2B,QAAQ;;EAE3C,UAAU,iBAAiB,YAC1B,0BACA,SAAS,mBACP,QAAQ,eAAe;;EAE1B,aAAa,iBAAiB,YAC7B,YAAY,iBACZ,SAAS,mBACP,eAAe;;EAElB,WAAW,iBAAiB,YAC3B,2BACE,QAAQ,gBAAgB;;EAE3B,cAAc,iBAAiB,YAC9B,YAAY,iBACZ,SAAS,oBACP,gBAAgB;;;iBA6CJ,qBAAqB,QAAQ;;iBAK7B;;;;;;;;;iBAYA,gBACf,gBACA,mDACE;;;;;;;;;cAyBU,iCAAiC;;WAQnC;;WAEA;;WARD;;WAEA;EAET,YAEU;;EAAA,gBAEA;;EAAA"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { d as UnsupportedEventTransport } from "./telemetry-DjjgJMul.mjs";
|
|
2
|
-
//#region src/registry.ts
|
|
3
|
-
/**
|
|
4
|
-
* Where each built-in driver lives, so a missing one can be named exactly —
|
|
5
|
-
* the subpath to import and the export to register.
|
|
6
|
-
*/
|
|
7
|
-
const BUILT_IN = {
|
|
8
|
-
["basic"]: {
|
|
9
|
-
subpath: "@geekmidas/events/basic",
|
|
10
|
-
driver: "basicEventsDriver"
|
|
11
|
-
},
|
|
12
|
-
["pgboss"]: {
|
|
13
|
-
subpath: "@geekmidas/events/pgboss",
|
|
14
|
-
driver: "pgbossEventsDriver"
|
|
15
|
-
},
|
|
16
|
-
["sns"]: {
|
|
17
|
-
subpath: "@geekmidas/events/sns",
|
|
18
|
-
driver: "snsEventsDriver"
|
|
19
|
-
},
|
|
20
|
-
["sqs"]: {
|
|
21
|
-
subpath: "@geekmidas/events/sqs",
|
|
22
|
-
driver: "sqsEventsDriver"
|
|
23
|
-
},
|
|
24
|
-
["rabbitmq"]: {
|
|
25
|
-
subpath: "@geekmidas/events/rabbitmq",
|
|
26
|
-
driver: "rabbitmqEventsDriver"
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* The registry lives on `globalThis`, so one registration is seen by every
|
|
31
|
-
* copy of this module — the ESM and the CJS build of one install, which a
|
|
32
|
-
* process can load side by side, as `Credentials` already has to allow for.
|
|
33
|
-
*/
|
|
34
|
-
const REGISTRY = Symbol.for("@geekmidas/events/drivers");
|
|
35
|
-
function drivers() {
|
|
36
|
-
const global = globalThis;
|
|
37
|
-
global[REGISTRY] ??= /* @__PURE__ */ new Map();
|
|
38
|
-
return global[REGISTRY];
|
|
39
|
-
}
|
|
40
|
-
/** Make a driver available to `Publisher`, `Subscriber` and friends. Idempotent. */
|
|
41
|
-
function registerEventsDriver(driver) {
|
|
42
|
-
drivers().set(driver.scheme, driver);
|
|
43
|
-
}
|
|
44
|
-
/** Which schemes are currently registered — the useful half of a failure. */
|
|
45
|
-
function registeredEventsSchemes() {
|
|
46
|
-
return [...drivers().keys()].sort();
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* The driver for a scheme — `'pgboss'`, `'pgboss:'`, or a whole connection
|
|
50
|
-
* string, whichever the caller has.
|
|
51
|
-
*
|
|
52
|
-
* @throws {UnregisteredEventsScheme} when the scheme is a broker this package
|
|
53
|
-
* implements but nothing registered its driver.
|
|
54
|
-
* @throws {UnsupportedEventTransport} when no broker here has that scheme.
|
|
55
|
-
*/
|
|
56
|
-
function eventsDriverFor(scheme, role = "connection") {
|
|
57
|
-
const name = schemeOf(scheme);
|
|
58
|
-
const driver = drivers().get(name);
|
|
59
|
-
if (driver) return driver;
|
|
60
|
-
if (BUILT_IN[name]) throw new UnregisteredEventsScheme(name, registeredEventsSchemes());
|
|
61
|
-
throw new UnsupportedEventTransport(name, role);
|
|
62
|
-
}
|
|
63
|
-
/** `pgboss` from `pgboss`, `pgboss:` or `pgboss://…`. */
|
|
64
|
-
function schemeOf(value) {
|
|
65
|
-
const separator = value.indexOf(":");
|
|
66
|
-
return separator === -1 ? value : value.slice(0, separator);
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* A connection string for a broker whose driver nothing registered.
|
|
70
|
-
*
|
|
71
|
-
* The broker exists — this is not a typo'd scheme — but the process was never
|
|
72
|
-
* told about it. Usually a script building its own publisher, or a build that
|
|
73
|
-
* registered the drivers for a different target than the one that composed
|
|
74
|
-
* the connection string.
|
|
75
|
-
*/
|
|
76
|
-
var UnregisteredEventsScheme = class extends Error {
|
|
77
|
-
scheme;
|
|
78
|
-
registered;
|
|
79
|
-
/** The subpath that exports the missing driver. */
|
|
80
|
-
subpath;
|
|
81
|
-
/** The driver's export name. */
|
|
82
|
-
driver;
|
|
83
|
-
constructor(scheme, registered) {
|
|
84
|
-
const { subpath, driver } = BUILT_IN[scheme] ?? {
|
|
85
|
-
subpath: `@geekmidas/events/${scheme}`,
|
|
86
|
-
driver: `${scheme}EventsDriver`
|
|
87
|
-
};
|
|
88
|
-
super(`No events driver is registered for '${scheme}://'. ` + (registered.length ? `Registered: ${registered.join(", ")}. ` : "Nothing is registered. ") + `Register it once where the process starts: import { registerEventsDriver } from '@geekmidas/events'; import { ${driver} } from '${subpath}'; registerEventsDriver(${driver});`);
|
|
89
|
-
this.scheme = scheme;
|
|
90
|
-
this.registered = registered;
|
|
91
|
-
this.name = "UnregisteredEventsScheme";
|
|
92
|
-
this.subpath = subpath;
|
|
93
|
-
this.driver = driver;
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
//#endregion
|
|
97
|
-
export { registeredEventsSchemes as i, eventsDriverFor as n, registerEventsDriver as r, UnregisteredEventsScheme as t };
|
|
98
|
-
|
|
99
|
-
//# sourceMappingURL=registry-DXLY1Xf6.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry-DXLY1Xf6.mjs","names":[],"sources":["../src/registry.ts"],"sourcesContent":["/**\n * Events drivers, keyed by connection-string scheme.\n *\n * The same shape `@geekmidas/storage` and `@geekmidas/cache` use, for the same\n * reason: a topic or a queue is handed one connection string, and the scheme in\n * it (`pgboss://`, `sns://`, …) picks the broker. Which brokers exist is the\n * entry point's decision — a generated server registering pg-boss, a Lambda\n * registering SNS and SQS — so a bundle only ever contains the broker its\n * target uses, and never resolves the others' optional peer dependencies.\n *\n * Registration is explicit rather than an import side effect, because a\n * side-effecting module is exactly what a bundler is entitled to drop.\n */\n\nimport type { PublisherOptions } from './Publisher';\nimport type {\n\tEventConnection,\n\tEventPublisher,\n\tEventSubscriber,\n\tPublishableMessage,\n} from './types';\nimport { EventPublisherType, UnsupportedEventTransport } from './types';\n\ntype AnyMessage = PublishableMessage<string, any>;\n\n/** How a subscriber built from a connection is used, beyond its address. */\nexport interface SubscriberOptions {\n\t/**\n\t * The topic subscribed to. pg-boss needs it, with {@link subscription}, to\n\t * give each subscriber a queue of its own; the other brokers carry the topic\n\t * in their address and ignore it.\n\t */\n\ttopic?: string;\n\t/** The subscriber's name — its own queue on pg-boss. */\n\tsubscription?: string;\n}\n\n/**\n * One broker: the connections, publishers and subscribers for its scheme.\n *\n * A driver owns parsing — the shape of an `sns://` string is SNS's business —\n * and is the only module that imports its broker's client library.\n */\nexport interface EventsDriver {\n\t/**\n\t * The scheme this driver handles, without the colon — `'pgboss'`, `'sns'`.\n\t * It is also the `type` of every connection the driver builds, which is how\n\t * a connection finds its way back here.\n\t */\n\treadonly scheme: `${EventPublisherType}`;\n\t/** A connection, connected, for a connection string. */\n\tconnect(connectionString: string): Promise<EventConnection>;\n\t/** A publisher, with a connection of its own, for a connection string. */\n\tpublisher<TMessage extends AnyMessage>(\n\t\tconnectionString: string,\n\t\toptions: PublisherOptions,\n\t): Promise<EventPublisher<TMessage>>;\n\t/** A publisher on a connection this driver built. */\n\tpublisherFor<TMessage extends AnyMessage>(\n\t\tconnection: EventConnection,\n\t\toptions: PublisherOptions,\n\t): EventPublisher<TMessage>;\n\t/** A subscriber, with a connection of its own, for a connection string. */\n\tsubscriber<TMessage extends AnyMessage>(\n\t\tconnectionString: string,\n\t): Promise<EventSubscriber<TMessage>>;\n\t/** A subscriber on a connection this driver built. */\n\tsubscriberFor<TMessage extends AnyMessage>(\n\t\tconnection: EventConnection,\n\t\toptions: SubscriberOptions,\n\t): EventSubscriber<TMessage>;\n}\n\n/**\n * Where each built-in driver lives, so a missing one can be named exactly —\n * the subpath to import and the export to register.\n */\nconst BUILT_IN: Readonly<Record<string, { subpath: string; driver: string }>> =\n\t{\n\t\t[EventPublisherType.Basic]: {\n\t\t\tsubpath: '@geekmidas/events/basic',\n\t\t\tdriver: 'basicEventsDriver',\n\t\t},\n\t\t[EventPublisherType.PgBoss]: {\n\t\t\tsubpath: '@geekmidas/events/pgboss',\n\t\t\tdriver: 'pgbossEventsDriver',\n\t\t},\n\t\t[EventPublisherType.SNS]: {\n\t\t\tsubpath: '@geekmidas/events/sns',\n\t\t\tdriver: 'snsEventsDriver',\n\t\t},\n\t\t[EventPublisherType.SQS]: {\n\t\t\tsubpath: '@geekmidas/events/sqs',\n\t\t\tdriver: 'sqsEventsDriver',\n\t\t},\n\t\t[EventPublisherType.RabbitMQ]: {\n\t\t\tsubpath: '@geekmidas/events/rabbitmq',\n\t\t\tdriver: 'rabbitmqEventsDriver',\n\t\t},\n\t};\n\n/**\n * The registry lives on `globalThis`, so one registration is seen by every\n * copy of this module — the ESM and the CJS build of one install, which a\n * process can load side by side, as `Credentials` already has to allow for.\n */\nconst REGISTRY = Symbol.for('@geekmidas/events/drivers');\n\nfunction drivers(): Map<string, EventsDriver> {\n\tconst global = globalThis as { [REGISTRY]?: Map<string, EventsDriver> };\n\tglobal[REGISTRY] ??= new Map();\n\treturn global[REGISTRY];\n}\n\n/** Make a driver available to `Publisher`, `Subscriber` and friends. Idempotent. */\nexport function registerEventsDriver(driver: EventsDriver): void {\n\tdrivers().set(driver.scheme, driver);\n}\n\n/** Which schemes are currently registered — the useful half of a failure. */\nexport function registeredEventsSchemes(): string[] {\n\treturn [...drivers().keys()].sort();\n}\n\n/**\n * The driver for a scheme — `'pgboss'`, `'pgboss:'`, or a whole connection\n * string, whichever the caller has.\n *\n * @throws {UnregisteredEventsScheme} when the scheme is a broker this package\n * implements but nothing registered its driver.\n * @throws {UnsupportedEventTransport} when no broker here has that scheme.\n */\nexport function eventsDriverFor(\n\tscheme: string,\n\trole: 'publisher' | 'subscriber' | 'connection' = 'connection',\n): EventsDriver {\n\tconst name = schemeOf(scheme);\n\tconst driver = drivers().get(name);\n\tif (driver) return driver;\n\n\tif (BUILT_IN[name]) {\n\t\tthrow new UnregisteredEventsScheme(name, registeredEventsSchemes());\n\t}\n\tthrow new UnsupportedEventTransport(name, role);\n}\n\n/** `pgboss` from `pgboss`, `pgboss:` or `pgboss://…`. */\nfunction schemeOf(value: string): string {\n\tconst separator = value.indexOf(':');\n\treturn separator === -1 ? value : value.slice(0, separator);\n}\n\n/**\n * A connection string for a broker whose driver nothing registered.\n *\n * The broker exists — this is not a typo'd scheme — but the process was never\n * told about it. Usually a script building its own publisher, or a build that\n * registered the drivers for a different target than the one that composed\n * the connection string.\n */\nexport class UnregisteredEventsScheme extends Error {\n\t/** The subpath that exports the missing driver. */\n\treadonly subpath: string;\n\t/** The driver's export name. */\n\treadonly driver: string;\n\n\tconstructor(\n\t\t/** The scheme with no driver, without the colon — `'pgboss'`. */\n\t\treadonly scheme: string,\n\t\t/** What is registered, so the caller can see what was chosen instead. */\n\t\treadonly registered: readonly string[],\n\t) {\n\t\tconst { subpath, driver } = BUILT_IN[scheme] ?? {\n\t\t\tsubpath: `@geekmidas/events/${scheme}`,\n\t\t\tdriver: `${scheme}EventsDriver`,\n\t\t};\n\t\tsuper(\n\t\t\t`No events driver is registered for '${scheme}://'. ` +\n\t\t\t\t(registered.length\n\t\t\t\t\t? `Registered: ${registered.join(', ')}. `\n\t\t\t\t\t: 'Nothing is registered. ') +\n\t\t\t\t`Register it once where the process starts: ` +\n\t\t\t\t`import { registerEventsDriver } from '@geekmidas/events'; ` +\n\t\t\t\t`import { ${driver} } from '${subpath}'; ` +\n\t\t\t\t`registerEventsDriver(${driver});`,\n\t\t);\n\t\tthis.name = 'UnregisteredEventsScheme';\n\t\tthis.subpath = subpath;\n\t\tthis.driver = driver;\n\t}\n}\n"],"mappings":";;;;;;AA6EA,MAAM,WACL;EAC6B,UAAA;EAC3B,SAAS;EACT,QAAQ;CACT;EAC6B,WAAA;EAC5B,SAAS;EACT,QAAQ;CACT;EAC0B,QAAA;EACzB,SAAS;EACT,QAAQ;CACT;EAC0B,QAAA;EACzB,SAAS;EACT,QAAQ;CACT;EAC+B,aAAA;EAC9B,SAAS;EACT,QAAQ;CACT;AACD;;;;;;AAOD,MAAM,WAAW,OAAO,IAAI,2BAA2B;AAEvD,SAAS,UAAqC;CAC7C,MAAM,SAAS;CACf,OAAO,8BAAc,IAAI,IAAI;CAC7B,OAAO,OAAO;AACf;;AAGA,SAAgB,qBAAqB,QAA4B;CAChE,QAAQ,CAAC,CAAC,IAAI,OAAO,QAAQ,MAAM;AACpC;;AAGA,SAAgB,0BAAoC;CACnD,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK;AACnC;;;;;;;;;AAUA,SAAgB,gBACf,QACA,OAAkD,cACnC;CACf,MAAM,OAAO,SAAS,MAAM;CAC5B,MAAM,SAAS,QAAQ,CAAC,CAAC,IAAI,IAAI;CACjC,IAAI,QAAQ,OAAO;CAEnB,IAAI,SAAS,OACZ,MAAM,IAAI,yBAAyB,MAAM,wBAAwB,CAAC;CAEnE,MAAM,IAAI,0BAA0B,MAAM,IAAI;AAC/C;;AAGA,SAAS,SAAS,OAAuB;CACxC,MAAM,YAAY,MAAM,QAAQ,GAAG;CACnC,OAAO,cAAc,KAAK,QAAQ,MAAM,MAAM,GAAG,SAAS;AAC3D;;;;;;;;;AAUA,IAAa,2BAAb,cAA8C,MAAM;CAQzC;CAEA;;CARV;;CAEA;CAEA,YAEC,QAEA,YACC;EACD,MAAM,EAAE,SAAS,WAAW,SAAS,WAAW;GAC/C,SAAS,qBAAqB;GAC9B,QAAQ,GAAG,OAAO;EACnB;EACA,MACC,uCAAuC,OAAO,WAC5C,WAAW,SACT,eAAe,WAAW,KAAK,IAAI,EAAE,MACrC,6BACH,iHAEY,OAAO,WAAW,QAAQ,0BACd,OAAO,GACjC;EAjBS,KAAA,SAAA;EAEA,KAAA,aAAA;EAgBT,KAAK,OAAO;EACZ,KAAK,UAAU;EACf,KAAK,SAAS;CACf;AACD"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
const require_telemetry = require("./telemetry-DG3l807O.cjs");
|
|
2
|
-
//#region src/registry.ts
|
|
3
|
-
/**
|
|
4
|
-
* Where each built-in driver lives, so a missing one can be named exactly —
|
|
5
|
-
* the subpath to import and the export to register.
|
|
6
|
-
*/
|
|
7
|
-
const BUILT_IN = {
|
|
8
|
-
["basic"]: {
|
|
9
|
-
subpath: "@geekmidas/events/basic",
|
|
10
|
-
driver: "basicEventsDriver"
|
|
11
|
-
},
|
|
12
|
-
["pgboss"]: {
|
|
13
|
-
subpath: "@geekmidas/events/pgboss",
|
|
14
|
-
driver: "pgbossEventsDriver"
|
|
15
|
-
},
|
|
16
|
-
["sns"]: {
|
|
17
|
-
subpath: "@geekmidas/events/sns",
|
|
18
|
-
driver: "snsEventsDriver"
|
|
19
|
-
},
|
|
20
|
-
["sqs"]: {
|
|
21
|
-
subpath: "@geekmidas/events/sqs",
|
|
22
|
-
driver: "sqsEventsDriver"
|
|
23
|
-
},
|
|
24
|
-
["rabbitmq"]: {
|
|
25
|
-
subpath: "@geekmidas/events/rabbitmq",
|
|
26
|
-
driver: "rabbitmqEventsDriver"
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* The registry lives on `globalThis`, so one registration is seen by every
|
|
31
|
-
* copy of this module — the ESM and the CJS build of one install, which a
|
|
32
|
-
* process can load side by side, as `Credentials` already has to allow for.
|
|
33
|
-
*/
|
|
34
|
-
const REGISTRY = Symbol.for("@geekmidas/events/drivers");
|
|
35
|
-
function drivers() {
|
|
36
|
-
const global = globalThis;
|
|
37
|
-
global[REGISTRY] ??= /* @__PURE__ */ new Map();
|
|
38
|
-
return global[REGISTRY];
|
|
39
|
-
}
|
|
40
|
-
/** Make a driver available to `Publisher`, `Subscriber` and friends. Idempotent. */
|
|
41
|
-
function registerEventsDriver(driver) {
|
|
42
|
-
drivers().set(driver.scheme, driver);
|
|
43
|
-
}
|
|
44
|
-
/** Which schemes are currently registered — the useful half of a failure. */
|
|
45
|
-
function registeredEventsSchemes() {
|
|
46
|
-
return [...drivers().keys()].sort();
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* The driver for a scheme — `'pgboss'`, `'pgboss:'`, or a whole connection
|
|
50
|
-
* string, whichever the caller has.
|
|
51
|
-
*
|
|
52
|
-
* @throws {UnregisteredEventsScheme} when the scheme is a broker this package
|
|
53
|
-
* implements but nothing registered its driver.
|
|
54
|
-
* @throws {UnsupportedEventTransport} when no broker here has that scheme.
|
|
55
|
-
*/
|
|
56
|
-
function eventsDriverFor(scheme, role = "connection") {
|
|
57
|
-
const name = schemeOf(scheme);
|
|
58
|
-
const driver = drivers().get(name);
|
|
59
|
-
if (driver) return driver;
|
|
60
|
-
if (BUILT_IN[name]) throw new UnregisteredEventsScheme(name, registeredEventsSchemes());
|
|
61
|
-
throw new require_telemetry.UnsupportedEventTransport(name, role);
|
|
62
|
-
}
|
|
63
|
-
/** `pgboss` from `pgboss`, `pgboss:` or `pgboss://…`. */
|
|
64
|
-
function schemeOf(value) {
|
|
65
|
-
const separator = value.indexOf(":");
|
|
66
|
-
return separator === -1 ? value : value.slice(0, separator);
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* A connection string for a broker whose driver nothing registered.
|
|
70
|
-
*
|
|
71
|
-
* The broker exists — this is not a typo'd scheme — but the process was never
|
|
72
|
-
* told about it. Usually a script building its own publisher, or a build that
|
|
73
|
-
* registered the drivers for a different target than the one that composed
|
|
74
|
-
* the connection string.
|
|
75
|
-
*/
|
|
76
|
-
var UnregisteredEventsScheme = class extends Error {
|
|
77
|
-
scheme;
|
|
78
|
-
registered;
|
|
79
|
-
/** The subpath that exports the missing driver. */
|
|
80
|
-
subpath;
|
|
81
|
-
/** The driver's export name. */
|
|
82
|
-
driver;
|
|
83
|
-
constructor(scheme, registered) {
|
|
84
|
-
const { subpath, driver } = BUILT_IN[scheme] ?? {
|
|
85
|
-
subpath: `@geekmidas/events/${scheme}`,
|
|
86
|
-
driver: `${scheme}EventsDriver`
|
|
87
|
-
};
|
|
88
|
-
super(`No events driver is registered for '${scheme}://'. ` + (registered.length ? `Registered: ${registered.join(", ")}. ` : "Nothing is registered. ") + `Register it once where the process starts: import { registerEventsDriver } from '@geekmidas/events'; import { ${driver} } from '${subpath}'; registerEventsDriver(${driver});`);
|
|
89
|
-
this.scheme = scheme;
|
|
90
|
-
this.registered = registered;
|
|
91
|
-
this.name = "UnregisteredEventsScheme";
|
|
92
|
-
this.subpath = subpath;
|
|
93
|
-
this.driver = driver;
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
//#endregion
|
|
97
|
-
Object.defineProperty(exports, "UnregisteredEventsScheme", {
|
|
98
|
-
enumerable: true,
|
|
99
|
-
get: function() {
|
|
100
|
-
return UnregisteredEventsScheme;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
Object.defineProperty(exports, "eventsDriverFor", {
|
|
104
|
-
enumerable: true,
|
|
105
|
-
get: function() {
|
|
106
|
-
return eventsDriverFor;
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
Object.defineProperty(exports, "registerEventsDriver", {
|
|
110
|
-
enumerable: true,
|
|
111
|
-
get: function() {
|
|
112
|
-
return registerEventsDriver;
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
Object.defineProperty(exports, "registeredEventsSchemes", {
|
|
116
|
-
enumerable: true,
|
|
117
|
-
get: function() {
|
|
118
|
-
return registeredEventsSchemes;
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
//# sourceMappingURL=registry-DlT36229.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry-DlT36229.cjs","names":["UnsupportedEventTransport"],"sources":["../src/registry.ts"],"sourcesContent":["/**\n * Events drivers, keyed by connection-string scheme.\n *\n * The same shape `@geekmidas/storage` and `@geekmidas/cache` use, for the same\n * reason: a topic or a queue is handed one connection string, and the scheme in\n * it (`pgboss://`, `sns://`, …) picks the broker. Which brokers exist is the\n * entry point's decision — a generated server registering pg-boss, a Lambda\n * registering SNS and SQS — so a bundle only ever contains the broker its\n * target uses, and never resolves the others' optional peer dependencies.\n *\n * Registration is explicit rather than an import side effect, because a\n * side-effecting module is exactly what a bundler is entitled to drop.\n */\n\nimport type { PublisherOptions } from './Publisher';\nimport type {\n\tEventConnection,\n\tEventPublisher,\n\tEventSubscriber,\n\tPublishableMessage,\n} from './types';\nimport { EventPublisherType, UnsupportedEventTransport } from './types';\n\ntype AnyMessage = PublishableMessage<string, any>;\n\n/** How a subscriber built from a connection is used, beyond its address. */\nexport interface SubscriberOptions {\n\t/**\n\t * The topic subscribed to. pg-boss needs it, with {@link subscription}, to\n\t * give each subscriber a queue of its own; the other brokers carry the topic\n\t * in their address and ignore it.\n\t */\n\ttopic?: string;\n\t/** The subscriber's name — its own queue on pg-boss. */\n\tsubscription?: string;\n}\n\n/**\n * One broker: the connections, publishers and subscribers for its scheme.\n *\n * A driver owns parsing — the shape of an `sns://` string is SNS's business —\n * and is the only module that imports its broker's client library.\n */\nexport interface EventsDriver {\n\t/**\n\t * The scheme this driver handles, without the colon — `'pgboss'`, `'sns'`.\n\t * It is also the `type` of every connection the driver builds, which is how\n\t * a connection finds its way back here.\n\t */\n\treadonly scheme: `${EventPublisherType}`;\n\t/** A connection, connected, for a connection string. */\n\tconnect(connectionString: string): Promise<EventConnection>;\n\t/** A publisher, with a connection of its own, for a connection string. */\n\tpublisher<TMessage extends AnyMessage>(\n\t\tconnectionString: string,\n\t\toptions: PublisherOptions,\n\t): Promise<EventPublisher<TMessage>>;\n\t/** A publisher on a connection this driver built. */\n\tpublisherFor<TMessage extends AnyMessage>(\n\t\tconnection: EventConnection,\n\t\toptions: PublisherOptions,\n\t): EventPublisher<TMessage>;\n\t/** A subscriber, with a connection of its own, for a connection string. */\n\tsubscriber<TMessage extends AnyMessage>(\n\t\tconnectionString: string,\n\t): Promise<EventSubscriber<TMessage>>;\n\t/** A subscriber on a connection this driver built. */\n\tsubscriberFor<TMessage extends AnyMessage>(\n\t\tconnection: EventConnection,\n\t\toptions: SubscriberOptions,\n\t): EventSubscriber<TMessage>;\n}\n\n/**\n * Where each built-in driver lives, so a missing one can be named exactly —\n * the subpath to import and the export to register.\n */\nconst BUILT_IN: Readonly<Record<string, { subpath: string; driver: string }>> =\n\t{\n\t\t[EventPublisherType.Basic]: {\n\t\t\tsubpath: '@geekmidas/events/basic',\n\t\t\tdriver: 'basicEventsDriver',\n\t\t},\n\t\t[EventPublisherType.PgBoss]: {\n\t\t\tsubpath: '@geekmidas/events/pgboss',\n\t\t\tdriver: 'pgbossEventsDriver',\n\t\t},\n\t\t[EventPublisherType.SNS]: {\n\t\t\tsubpath: '@geekmidas/events/sns',\n\t\t\tdriver: 'snsEventsDriver',\n\t\t},\n\t\t[EventPublisherType.SQS]: {\n\t\t\tsubpath: '@geekmidas/events/sqs',\n\t\t\tdriver: 'sqsEventsDriver',\n\t\t},\n\t\t[EventPublisherType.RabbitMQ]: {\n\t\t\tsubpath: '@geekmidas/events/rabbitmq',\n\t\t\tdriver: 'rabbitmqEventsDriver',\n\t\t},\n\t};\n\n/**\n * The registry lives on `globalThis`, so one registration is seen by every\n * copy of this module — the ESM and the CJS build of one install, which a\n * process can load side by side, as `Credentials` already has to allow for.\n */\nconst REGISTRY = Symbol.for('@geekmidas/events/drivers');\n\nfunction drivers(): Map<string, EventsDriver> {\n\tconst global = globalThis as { [REGISTRY]?: Map<string, EventsDriver> };\n\tglobal[REGISTRY] ??= new Map();\n\treturn global[REGISTRY];\n}\n\n/** Make a driver available to `Publisher`, `Subscriber` and friends. Idempotent. */\nexport function registerEventsDriver(driver: EventsDriver): void {\n\tdrivers().set(driver.scheme, driver);\n}\n\n/** Which schemes are currently registered — the useful half of a failure. */\nexport function registeredEventsSchemes(): string[] {\n\treturn [...drivers().keys()].sort();\n}\n\n/**\n * The driver for a scheme — `'pgboss'`, `'pgboss:'`, or a whole connection\n * string, whichever the caller has.\n *\n * @throws {UnregisteredEventsScheme} when the scheme is a broker this package\n * implements but nothing registered its driver.\n * @throws {UnsupportedEventTransport} when no broker here has that scheme.\n */\nexport function eventsDriverFor(\n\tscheme: string,\n\trole: 'publisher' | 'subscriber' | 'connection' = 'connection',\n): EventsDriver {\n\tconst name = schemeOf(scheme);\n\tconst driver = drivers().get(name);\n\tif (driver) return driver;\n\n\tif (BUILT_IN[name]) {\n\t\tthrow new UnregisteredEventsScheme(name, registeredEventsSchemes());\n\t}\n\tthrow new UnsupportedEventTransport(name, role);\n}\n\n/** `pgboss` from `pgboss`, `pgboss:` or `pgboss://…`. */\nfunction schemeOf(value: string): string {\n\tconst separator = value.indexOf(':');\n\treturn separator === -1 ? value : value.slice(0, separator);\n}\n\n/**\n * A connection string for a broker whose driver nothing registered.\n *\n * The broker exists — this is not a typo'd scheme — but the process was never\n * told about it. Usually a script building its own publisher, or a build that\n * registered the drivers for a different target than the one that composed\n * the connection string.\n */\nexport class UnregisteredEventsScheme extends Error {\n\t/** The subpath that exports the missing driver. */\n\treadonly subpath: string;\n\t/** The driver's export name. */\n\treadonly driver: string;\n\n\tconstructor(\n\t\t/** The scheme with no driver, without the colon — `'pgboss'`. */\n\t\treadonly scheme: string,\n\t\t/** What is registered, so the caller can see what was chosen instead. */\n\t\treadonly registered: readonly string[],\n\t) {\n\t\tconst { subpath, driver } = BUILT_IN[scheme] ?? {\n\t\t\tsubpath: `@geekmidas/events/${scheme}`,\n\t\t\tdriver: `${scheme}EventsDriver`,\n\t\t};\n\t\tsuper(\n\t\t\t`No events driver is registered for '${scheme}://'. ` +\n\t\t\t\t(registered.length\n\t\t\t\t\t? `Registered: ${registered.join(', ')}. `\n\t\t\t\t\t: 'Nothing is registered. ') +\n\t\t\t\t`Register it once where the process starts: ` +\n\t\t\t\t`import { registerEventsDriver } from '@geekmidas/events'; ` +\n\t\t\t\t`import { ${driver} } from '${subpath}'; ` +\n\t\t\t\t`registerEventsDriver(${driver});`,\n\t\t);\n\t\tthis.name = 'UnregisteredEventsScheme';\n\t\tthis.subpath = subpath;\n\t\tthis.driver = driver;\n\t}\n}\n"],"mappings":";;;;;;AA6EA,MAAM,WACL;EAC6B,UAAA;EAC3B,SAAS;EACT,QAAQ;CACT;EAC6B,WAAA;EAC5B,SAAS;EACT,QAAQ;CACT;EAC0B,QAAA;EACzB,SAAS;EACT,QAAQ;CACT;EAC0B,QAAA;EACzB,SAAS;EACT,QAAQ;CACT;EAC+B,aAAA;EAC9B,SAAS;EACT,QAAQ;CACT;AACD;;;;;;AAOD,MAAM,WAAW,OAAO,IAAI,2BAA2B;AAEvD,SAAS,UAAqC;CAC7C,MAAM,SAAS;CACf,OAAO,8BAAc,IAAI,IAAI;CAC7B,OAAO,OAAO;AACf;;AAGA,SAAgB,qBAAqB,QAA4B;CAChE,QAAQ,CAAC,CAAC,IAAI,OAAO,QAAQ,MAAM;AACpC;;AAGA,SAAgB,0BAAoC;CACnD,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK;AACnC;;;;;;;;;AAUA,SAAgB,gBACf,QACA,OAAkD,cACnC;CACf,MAAM,OAAO,SAAS,MAAM;CAC5B,MAAM,SAAS,QAAQ,CAAC,CAAC,IAAI,IAAI;CACjC,IAAI,QAAQ,OAAO;CAEnB,IAAI,SAAS,OACZ,MAAM,IAAI,yBAAyB,MAAM,wBAAwB,CAAC;CAEnE,MAAM,IAAIA,kBAAAA,0BAA0B,MAAM,IAAI;AAC/C;;AAGA,SAAS,SAAS,OAAuB;CACxC,MAAM,YAAY,MAAM,QAAQ,GAAG;CACnC,OAAO,cAAc,KAAK,QAAQ,MAAM,MAAM,GAAG,SAAS;AAC3D;;;;;;;;;AAUA,IAAa,2BAAb,cAA8C,MAAM;CAQzC;CAEA;;CARV;;CAEA;CAEA,YAEC,QAEA,YACC;EACD,MAAM,EAAE,SAAS,WAAW,SAAS,WAAW;GAC/C,SAAS,qBAAqB;GAC9B,QAAQ,GAAG,OAAO;EACnB;EACA,MACC,uCAAuC,OAAO,WAC5C,WAAW,SACT,eAAe,WAAW,KAAK,IAAI,EAAE,MACrC,6BACH,iHAEY,OAAO,WAAW,QAAQ,0BACd,OAAO,GACjC;EAjBS,KAAA,SAAA;EAEA,KAAA,aAAA;EAgBT,KAAK,OAAO;EACZ,KAAK,UAAU;EACf,KAAK,SAAS;CACf;AACD"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __exportAll = (all, no_symbols) => {
|
|
4
|
-
let target = {};
|
|
5
|
-
for (var name in all) __defProp(target, name, {
|
|
6
|
-
get: all[name],
|
|
7
|
-
enumerable: true
|
|
8
|
-
});
|
|
9
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
-
return target;
|
|
11
|
-
};
|
|
12
|
-
//#endregion
|
|
13
|
-
export { __exportAll as t };
|
package/dist/sns/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["SNSClient","publishTraced","PublishCommand","carrierAsAttributes","SQSClient","SQSConnection","SQSSubscriber","UnsubscribeCommand","DeleteQueueCommand","CreateQueueCommand","GetQueueAttributesCommand","SetQueueAttributesCommand","SubscribeCommand","createVerify","GetSubscriptionAttributesCommand","UnsubscribeCommand","SetSubscriptionAttributesCommand","SubscribeCommand","ListSubscriptionsByTopicCommand"],"sources":["../../src/sns/SNSConnection.ts","../../src/sns/SNSPublisher.ts","../../src/sns/SNSSubscriber.ts","../../src/sns/driver.ts","../../src/sns/push.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®ion=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","import { PublishCommand } from '@aws-sdk/client-sns';\nimport { carrierAsAttributes, publishTraced } from '../telemetry';\nimport type { EventPublisher, PublishableMessage } from '../types';\nimport type { SNSConnection } from './SNSConnection';\n\nexport type SNSPublisherOptions = {};\n\nexport class SNSPublisher<TMessage extends PublishableMessage<string, any>>\n\timplements EventPublisher<TMessage>\n{\n\tconstructor(\n\t\tprivate connection: SNSConnection,\n\t\t_options: SNSPublisherOptions = {},\n\t) {}\n\n\t/**\n\t * Create an SNSPublisher from a connection string\n\t * Format: sns://?topicArn=arn:aws:sns:region:account:topic®ion=us-east-1&endpoint=http://localhost:4566\n\t */\n\tstatic async fromConnectionString<\n\t\tTMessage extends PublishableMessage<string, any>,\n\t>(connectionString: string): Promise<SNSPublisher<TMessage>> {\n\t\tconst { SNSConnection } = await import('./SNSConnection');\n\t\tconst connection =\n\t\t\tawait SNSConnection.fromConnectionString(connectionString);\n\n\t\treturn new SNSPublisher<TMessage>(connection);\n\t}\n\n\tasync publish(messages: TMessage[]): Promise<void> {\n\t\tif (messages.length === 0) return;\n\n\t\tif (!this.connection.isConnected()) {\n\t\t\tawait this.connection.connect();\n\t\t}\n\n\t\tconst topicArn = this.connection.topicArn;\n\t\tconst destination = topicArn.split(':').pop() ?? topicArn;\n\t\tawait publishTraced(\n\t\t\tmessages,\n\t\t\t(message) => ({ system: 'aws_sns', destination, type: message.type }),\n\t\t\t(carriers) =>\n\t\t\t\tPromise.all(\n\t\t\t\t\tmessages.map((message, i) =>\n\t\t\t\t\t\tthis.publishMessage(message, carriers[i]),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t}\n\n\tprivate async publishMessage(\n\t\tmessage: TMessage,\n\t\tcarrier: Record<string, string> | undefined,\n\t): Promise<void> {\n\t\tconst command = new PublishCommand({\n\t\t\tTopicArn: this.connection.topicArn,\n\t\t\tMessage: JSON.stringify({\n\t\t\t\ttype: message.type,\n\t\t\t\tpayload: message.payload,\n\t\t\t}),\n\t\t\tMessageAttributes: {\n\t\t\t\ttype: {\n\t\t\t\t\tDataType: 'String',\n\t\t\t\t\tStringValue: message.type,\n\t\t\t\t},\n\t\t\t\t// The trace context as message attributes: SNS hands them on to\n\t\t\t\t// an SQS subscription's envelope, an HTTP push and a Lambda record.\n\t\t\t\t...carrierAsAttributes(carrier),\n\t\t\t},\n\t\t});\n\n\t\tawait this.connection.snsClient.send(command);\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","import { SubscribeCommand, UnsubscribeCommand } from '@aws-sdk/client-sns';\nimport {\n\tCreateQueueCommand,\n\tDeleteQueueCommand,\n\tGetQueueAttributesCommand,\n\tSetQueueAttributesCommand,\n\tSQSClient,\n} from '@aws-sdk/client-sqs';\nimport { SQSConnection } from '../sqs/SQSConnection';\nimport { SQSSubscriber } from '../sqs/SQSSubscriber';\nimport type { EventSubscriber, PublishableMessage } from '../types';\nimport type { SNSConnection } from './SNSConnection';\n\nexport interface SNSSubscriberOptions {\n\tqueueName?: string; // Optional queue name (defaults to auto-generated)\n\tcreateQueue?: boolean; // Auto-create SQS queue (default: true)\n\tdeleteQueueOnClose?: boolean; // Delete queue when subscriber closes (default: false for named queues, true for auto-generated)\n\twaitTimeSeconds?: number; // SQS long polling (default: 20)\n\tmaxMessages?: number; // Max messages per poll (default: 10)\n}\n\n/**\n * SNS Subscriber - receives push-based messages from SNS via SQS queue\n *\n * Architecture:\n * SNS Topic → (push) → SQS Queue → Subscriber\n *\n * This subscriber automatically:\n * 1. Creates an SQS queue (or uses existing one)\n * 2. Subscribes the queue to the SNS topic\n * 3. Receives messages pushed from SNS to the queue\n * 4. Filters messages by topic ARN and message type\n * 5. Processes and acknowledges messages\n *\n * Note: While SQS long-polling is used internally to receive messages,\n * this is an implementation detail of the SNS push delivery mechanism.\n * Messages are pushed from SNS to SQS, and we receive those pushed messages.\n */\nexport class SNSSubscriber<TMessage extends PublishableMessage<string, any>>\n\timplements EventSubscriber<TMessage>\n{\n\tprivate sqsClient: SQSClient;\n\tprivate queueUrl?: string;\n\tprivate queueArn?: string;\n\tprivate subscriptionArn?: string;\n\tprivate sqsSubscriber?: SQSSubscriber<TMessage>;\n\tprivate options: Required<SNSSubscriberOptions>;\n\n\tconstructor(\n\t\tprivate connection: SNSConnection,\n\t\toptions: SNSSubscriberOptions = {},\n\t) {\n\t\tthis.options = {\n\t\t\tqueueName:\n\t\t\t\toptions.queueName ||\n\t\t\t\t`sns-sub-${Date.now()}-${Math.random().toString(36).substring(7)}`,\n\t\t\tcreateQueue: options.createQueue ?? true,\n\t\t\tdeleteQueueOnClose: options.deleteQueueOnClose ?? !options.queueName, // Delete auto-generated queues\n\t\t\twaitTimeSeconds: options.waitTimeSeconds ?? 20,\n\t\t\tmaxMessages: options.maxMessages ?? 10,\n\t\t};\n\n\t\t// Create SQS client with same config as SNS\n\t\tthis.sqsClient = new SQSClient({\n\t\t\tregion: (this.connection as any).config.region,\n\t\t\tendpoint: (this.connection as any).config.endpoint,\n\t\t\tcredentials: (this.connection as any).config.credentials,\n\t\t});\n\t}\n\n\t/**\n\t * Create an SNSSubscriber from a connection string\n\t * Format: sns://?topicArn=...&queueName=myqueue®ion=us-east-1\n\t */\n\tstatic async fromConnectionString<\n\t\tTMessage extends PublishableMessage<string, any>,\n\t>(connectionString: string): Promise<SNSSubscriber<TMessage>> {\n\t\tconst url = new URL(connectionString);\n\t\tconst params = url.searchParams;\n\n\t\tconst { SNSConnection } = await import('./SNSConnection');\n\t\tconst connection =\n\t\t\tawait SNSConnection.fromConnectionString(connectionString);\n\n\t\tconst options: SNSSubscriberOptions = {\n\t\t\tqueueName: params.get('queueName') || undefined,\n\t\t\tcreateQueue: params.get('createQueue') !== 'false',\n\t\t\tdeleteQueueOnClose: params.get('deleteQueueOnClose') === 'true',\n\t\t\twaitTimeSeconds: params.get('waitTimeSeconds')\n\t\t\t\t? Number.parseInt(params.get('waitTimeSeconds')!, 10)\n\t\t\t\t: undefined,\n\t\t};\n\n\t\treturn new SNSSubscriber<TMessage>(connection, options);\n\t}\n\n\tasync subscribe(\n\t\tmessages: TMessage['type'][],\n\t\tlistener: (payload: TMessage) => Promise<void>,\n\t): Promise<void> {\n\t\t// Setup SQS queue and SNS subscription\n\t\tawait this.setupQueue();\n\t\tawait this.subscribeToTopic();\n\n\t\t// Create SQS connection for the subscriber\n\t\tconst sqsConnection = new SQSConnection({\n\t\t\tqueueUrl: this.queueUrl!,\n\t\t\tregion: (this.connection as any).config.region,\n\t\t\tendpoint: (this.connection as any).config.endpoint,\n\t\t\tcredentials: (this.connection as any).config.credentials,\n\t\t});\n\t\tawait sqsConnection.connect();\n\n\t\t// Use SQSSubscriber to receive messages, with topic filtering\n\t\tthis.sqsSubscriber = new SQSSubscriber<TMessage>(sqsConnection, {\n\t\t\twaitTimeSeconds: this.options.waitTimeSeconds,\n\t\t\tmaxMessages: this.options.maxMessages,\n\t\t\texpectedTopicArn: this.connection.topicArn,\n\t\t});\n\n\t\tawait this.sqsSubscriber.subscribe(messages, listener);\n\t}\n\n\t/**\n\t * Stop receiving messages and clean up resources\n\t */\n\tasync stop(): Promise<void> {\n\t\t// Stop SQS subscriber\n\t\tif (this.sqsSubscriber) {\n\t\t\tthis.sqsSubscriber.stop();\n\t\t}\n\n\t\t// Unsubscribe from topic\n\t\tif (this.subscriptionArn) {\n\t\t\ttry {\n\t\t\t\tconst command = new UnsubscribeCommand({\n\t\t\t\t\tSubscriptionArn: this.subscriptionArn,\n\t\t\t\t});\n\t\t\t\tawait this.connection.snsClient.send(command);\n\t\t\t} catch (_error) {}\n\t\t}\n\n\t\t// Delete queue if configured\n\t\tif (this.queueUrl && this.options.deleteQueueOnClose) {\n\t\t\ttry {\n\t\t\t\tconst command = new DeleteQueueCommand({\n\t\t\t\t\tQueueUrl: this.queueUrl,\n\t\t\t\t});\n\t\t\t\tawait this.sqsClient.send(command);\n\t\t\t} catch (_error) {}\n\t\t}\n\n\t\tthis.sqsClient.destroy();\n\t}\n\n\tprivate async setupQueue(): Promise<void> {\n\t\tif (this.options.createQueue) {\n\t\t\t// Create queue\n\t\t\tconst createCommand = new CreateQueueCommand({\n\t\t\t\tQueueName: this.options.queueName,\n\t\t\t});\n\t\t\tconst response = await this.sqsClient.send(createCommand);\n\t\t\tthis.queueUrl = response.QueueUrl!;\n\t\t} else {\n\t\t\tthrow new SnsQueueMissing(this.options.queueName);\n\t\t}\n\n\t\t// Get queue ARN\n\t\tconst attrsCommand = new GetQueueAttributesCommand({\n\t\t\tQueueUrl: this.queueUrl,\n\t\t\tAttributeNames: ['QueueArn'],\n\t\t});\n\t\tconst attrsResponse = await this.sqsClient.send(attrsCommand);\n\t\tthis.queueArn = attrsResponse.Attributes?.QueueArn!;\n\n\t\t// Set queue policy to allow SNS\n\t\tawait this.setQueuePolicy();\n\t}\n\n\tprivate async setQueuePolicy(): Promise<void> {\n\t\tconst policy = {\n\t\t\tVersion: '2012-10-17',\n\t\t\tStatement: [\n\t\t\t\t{\n\t\t\t\t\tEffect: 'Allow',\n\t\t\t\t\tPrincipal: '*',\n\t\t\t\t\tAction: 'SQS:SendMessage',\n\t\t\t\t\tResource: this.queueArn,\n\t\t\t\t\tCondition: {\n\t\t\t\t\t\tArnEquals: {\n\t\t\t\t\t\t\t'aws:SourceArn': this.connection.topicArn,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\n\t\tconst command = new SetQueueAttributesCommand({\n\t\t\tQueueUrl: this.queueUrl,\n\t\t\tAttributes: {\n\t\t\t\tPolicy: JSON.stringify(policy),\n\t\t\t},\n\t\t});\n\n\t\tawait this.sqsClient.send(command);\n\t}\n\n\tprivate async subscribeToTopic(): Promise<void> {\n\t\tconst command = new SubscribeCommand({\n\t\t\tTopicArn: this.connection.topicArn,\n\t\t\tProtocol: 'sqs',\n\t\t\tEndpoint: this.queueArn,\n\t\t});\n\n\t\tconst response = await this.connection.snsClient.send(command);\n\t\tthis.subscriptionArn = response.SubscriptionArn!;\n\t}\n}\n\n/**\n * A subscriber asked to use a queue it may not create. The SQS queue behind an\n * SNS subscription has to exist first, or `createQueue` has to allow it.\n */\nexport class SnsQueueMissing extends Error {\n\tconstructor(readonly queueName: string | undefined) {\n\t\tsuper(\n\t\t\t`The SNS subscriber's queue${queueName ? ` \"${queueName}\"` : ''} is not created here: pass createQueue: true, or create the queue first.`,\n\t\t);\n\t\tthis.name = 'SnsQueueMissing';\n\t}\n}\n","import type { EventsDriver } from '../registry';\nimport { EventPublisherType } from '../types';\nimport { SNSConnection } from './SNSConnection';\nimport { SNSPublisher } from './SNSPublisher';\nimport { SNSSubscriber } from './SNSSubscriber';\n\n/**\n * `sns://` — an SNS topic, consumed through an SQS queue subscribed to it.\n * Register it with `registerEventsDriver(snsEventsDriver)`; an AWS entry\n * registers `sqsEventsDriver` beside it.\n */\nexport const snsEventsDriver: EventsDriver = {\n\tscheme: EventPublisherType.SNS,\n\tconnect: (url) => SNSConnection.fromConnectionString(url),\n\tpublisher: (url) => SNSPublisher.fromConnectionString(url),\n\tpublisherFor: (connection) => new SNSPublisher(connection as SNSConnection),\n\tsubscriber: (url) => SNSSubscriber.fromConnectionString(url),\n\tsubscriberFor: (connection) => new SNSSubscriber(connection as SNSConnection),\n};\n","import { createVerify } from 'node:crypto';\nimport {\n\tGetSubscriptionAttributesCommand,\n\tListSubscriptionsByTopicCommand,\n\tSetSubscriptionAttributesCommand,\n\tSubscribeCommand,\n\ttype SubscribeCommandInput,\n\tUnsubscribeCommand,\n} from '@aws-sdk/client-sns';\nimport type { SNSConnection } from './SNSConnection';\n\n/**\n * SNS delivering to an HTTP(S) endpoint, rather than to a queue that is polled.\n *\n * SNS POSTs each message to the subscribed URL as JSON. That is the whole\n * transport: no queue in between, no poller, and the endpoint is handed the\n * same envelope a Lambda subscription receives inside `Records[].Sns` — so the\n * handler that runs deployed can be the one that runs here.\n *\n * The endpoint is public, so a message is trusted only once its signature\n * checks out against a certificate SNS itself serves. Anything else that POSTs\n * there is somebody's guess at the shape.\n */\n\n/** A message SNS POSTs to a subscribed HTTP endpoint. */\nexport interface SnsHttpMessage {\n\tType: 'Notification' | 'SubscriptionConfirmation' | 'UnsubscribeConfirmation';\n\tMessageId: string;\n\tTopicArn: string;\n\tMessage: string;\n\tTimestamp: string;\n\tSignatureVersion: string;\n\tSignature: string;\n\tSigningCertURL: string;\n\tSubject?: string;\n\t/** Confirmation messages only. */\n\tToken?: string;\n\t/** Confirmation messages only: GET it to confirm. */\n\tSubscribeURL?: string;\n\t/** Notifications only. */\n\tUnsubscribeURL?: string;\n\tMessageAttributes?: Record<string, { Type: string; Value: string }>;\n}\n\n/** The fields signed, in the order SNS signs them, per message type. */\nconst SIGNED_FIELDS: Record<SnsHttpMessage['Type'], (keyof SnsHttpMessage)[]> =\n\t{\n\t\tNotification: [\n\t\t\t'Message',\n\t\t\t'MessageId',\n\t\t\t'Subject',\n\t\t\t'Timestamp',\n\t\t\t'TopicArn',\n\t\t\t'Type',\n\t\t],\n\t\tSubscriptionConfirmation: [\n\t\t\t'Message',\n\t\t\t'MessageId',\n\t\t\t'SubscribeURL',\n\t\t\t'Timestamp',\n\t\t\t'Token',\n\t\t\t'TopicArn',\n\t\t\t'Type',\n\t\t],\n\t\tUnsubscribeConfirmation: [\n\t\t\t'Message',\n\t\t\t'MessageId',\n\t\t\t'SubscribeURL',\n\t\t\t'Timestamp',\n\t\t\t'Token',\n\t\t\t'TopicArn',\n\t\t\t'Type',\n\t\t],\n\t};\n\n/**\n * Where SNS serves its signing certificates. Anywhere else is a certificate\n * the sender chose, which would let the sender sign its own forgeries.\n */\nconst SNS_CERTIFICATE_HOST = /^sns\\.[a-z0-9-]+\\.amazonaws\\.com(\\.cn)?$/;\n\nexport interface VerifySnsMessageOptions {\n\t/**\n\t * Fetch the PEM at a certificate URL. `fetch` by default; replaceable so a\n\t * test signs with its own key instead of SNS's.\n\t */\n\tfetchCertificate?: (url: string) => Promise<string>;\n}\n\nconst certificates = new Map<string, Promise<string>>();\n\nasync function defaultFetchCertificate(url: string): Promise<string> {\n\tconst response = await fetch(url);\n\tif (!response.ok) throw new SnsCertificateUnavailable(url, response.status);\n\treturn response.text();\n}\n\n/**\n * A URL, or undefined for a value that is not one at all — what an emulator\n * sends — so it is untrusted rather than a crash. (`URL.parse` is Node 22.1+.)\n */\nfunction parseUrl(value: unknown): URL | undefined {\n\ttry {\n\t\treturn new URL(String(value));\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/** The string SNS signed for this message. */\nexport function snsStringToSign(message: SnsHttpMessage): string {\n\tconst fields = SIGNED_FIELDS[message.Type];\n\tif (!fields) throw new SnsMessageTypeUnknown(String(message.Type));\n\n\treturn fields\n\t\t.filter((field) => message[field] !== undefined)\n\t\t.map((field) => `${field}\\n${message[field]}\\n`)\n\t\t.join('');\n}\n\n/**\n * Check that SNS sent this message: the certificate is SNS's own, and the\n * signature over the message's signed fields verifies against it.\n *\n * Throws rather than returning false, so a caller cannot forget to look.\n */\nexport async function verifySnsMessage(\n\tmessage: SnsHttpMessage,\n\toptions: VerifySnsMessageOptions = {},\n): Promise<void> {\n\tconst url = parseUrl(message.SigningCertURL);\n\tif (url?.protocol !== 'https:' || !SNS_CERTIFICATE_HOST.test(url.hostname)) {\n\t\tthrow new SnsCertificateUntrusted(message.SigningCertURL);\n\t}\n\n\tconst algorithm =\n\t\tmessage.SignatureVersion === '1'\n\t\t\t? 'RSA-SHA1'\n\t\t\t: message.SignatureVersion === '2'\n\t\t\t\t? 'RSA-SHA256'\n\t\t\t\t: undefined;\n\tif (!algorithm) {\n\t\tthrow new SnsSignatureVersionUnknown(message.SignatureVersion);\n\t}\n\n\tconst fetchCertificate = options.fetchCertificate ?? defaultFetchCertificate;\n\tlet certificate = certificates.get(message.SigningCertURL);\n\tif (!certificate || options.fetchCertificate) {\n\t\tcertificate = fetchCertificate(message.SigningCertURL);\n\t\t// Only SNS's real fetch is cached: a test's key belongs to that test.\n\t\tif (!options.fetchCertificate) {\n\t\t\tcertificates.set(message.SigningCertURL, certificate);\n\t\t\tcertificate.catch(() => certificates.delete(message.SigningCertURL));\n\t\t}\n\t}\n\n\tconst verifier = createVerify(algorithm);\n\tverifier.update(snsStringToSign(message), 'utf8');\n\tif (!verifier.verify(await certificate, message.Signature, 'base64')) {\n\t\tthrow new SnsSignatureInvalid(message.MessageId, message.TopicArn);\n\t}\n}\n\n/**\n * Confirm a subscription by visiting the URL SNS sent. Until this happens SNS\n * delivers nothing to the endpoint.\n */\nexport async function confirmSnsSubscription(\n\tmessage: SnsHttpMessage,\n\trequest: (url: string) => Promise<{ ok: boolean; status: number }> = fetch,\n): Promise<void> {\n\tif (message.Type !== 'SubscriptionConfirmation' || !message.SubscribeURL) {\n\t\tthrow new SnsNotAConfirmation(message.Type);\n\t}\n\n\tconst response = await request(message.SubscribeURL);\n\tif (!response.ok) {\n\t\tthrow new SnsConfirmationFailed(message.TopicArn, response.status);\n\t}\n}\n\nexport interface SubscribeHttpEndpointOptions {\n\t/** The URL SNS POSTs to — `http:` or `https:`, which picks the protocol. */\n\tendpoint: string;\n\t/**\n\t * The event types this endpoint takes. Becomes the subscription's filter\n\t * policy on the `type` attribute `SNSPublisher` sets, so SNS sends nothing\n\t * else — fan-out to every subscriber, each seeing only what it named.\n\t */\n\tevents: readonly string[];\n\t/**\n\t * An SQS queue's ARN for what SNS gives up delivering. SNS retries an HTTP\n\t * endpoint for a limited time and then drops the message, so without one an\n\t * outage longer than that loses events.\n\t */\n\tdeadLetterQueueArn?: string;\n}\n\n/**\n * Subscribe an HTTP endpoint to the connection's topic, converging on one\n * confirmed subscription with the filter asked for — so it is safe on every\n * start:\n *\n * - **none yet** — subscribed; SNS sends a confirmation to the endpoint.\n * - **confirmed** — its filter and dead-letter queue are brought up to date.\n * Subscribing again with different attributes is an error on SNS, and the\n * events a subscriber names change.\n * - **stuck pending** — a confirmation that never landed (the endpoint was\n * down, or answered wrong). Subscribing the same endpoint again is a no-op\n * on an emulator, so it is dropped and subscribed afresh, which sends a new\n * confirmation.\n */\nexport async function subscribeHttpEndpoint(\n\tconnection: SNSConnection,\n\toptions: SubscribeHttpEndpointOptions,\n): Promise<string | undefined> {\n\tconst protocol = new URL(options.endpoint).protocol.replace(':', '');\n\tif (protocol !== 'http' && protocol !== 'https') {\n\t\tthrow new SnsEndpointNotHttp(options.endpoint);\n\t}\n\n\tconst attributes: Record<string, string> = {\n\t\tFilterPolicyScope: 'MessageAttributes',\n\t\tFilterPolicy: JSON.stringify({ type: [...options.events] }),\n\t};\n\tif (options.deadLetterQueueArn) {\n\t\tattributes.RedrivePolicy = JSON.stringify({\n\t\t\tdeadLetterTargetArn: options.deadLetterQueueArn,\n\t\t});\n\t}\n\n\tconst client = connection.snsClient;\n\tconst existing = await existingSubscription(connection, options.endpoint);\n\tif (existing) {\n\t\tconst { Attributes = {} } = await client.send(\n\t\t\tnew GetSubscriptionAttributesCommand({ SubscriptionArn: existing }),\n\t\t);\n\t\tif (Attributes.PendingConfirmation === 'true') {\n\t\t\tawait client.send(new UnsubscribeCommand({ SubscriptionArn: existing }));\n\t\t} else {\n\t\t\tfor (const [name, value] of Object.entries(attributes)) {\n\t\t\t\tif (Attributes[name] === value) continue;\n\t\t\t\tawait client.send(\n\t\t\t\t\tnew SetSubscriptionAttributesCommand({\n\t\t\t\t\t\tSubscriptionArn: existing,\n\t\t\t\t\t\tAttributeName: name,\n\t\t\t\t\t\tAttributeValue: value,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn existing;\n\t\t}\n\t}\n\n\tconst { SubscriptionArn } = await client.send(\n\t\tnew SubscribeCommand({\n\t\t\tTopicArn: connection.topicArn,\n\t\t\tProtocol: protocol,\n\t\t\tEndpoint: options.endpoint,\n\t\t\tAttributes: attributes as SubscribeCommandInput['Attributes'],\n\t\t\tReturnSubscriptionArn: true,\n\t\t}),\n\t);\n\treturn SubscriptionArn;\n}\n\n/**\n * The ARN of the endpoint's subscription to the topic, if it has one SNS will\n * name. (Real SNS lists a pending one as `PendingConfirmation`, with no ARN to\n * act on — and resends its confirmation on a new Subscribe anyway.)\n */\nasync function existingSubscription(\n\tconnection: SNSConnection,\n\tendpoint: string,\n): Promise<string | undefined> {\n\tlet NextToken: string | undefined;\n\tdo {\n\t\tconst page = await connection.snsClient.send(\n\t\t\tnew ListSubscriptionsByTopicCommand({\n\t\t\t\tTopicArn: connection.topicArn,\n\t\t\t\tNextToken,\n\t\t\t}),\n\t\t);\n\t\tconst match = page.Subscriptions?.find(\n\t\t\t(s) => s.Endpoint === endpoint && s.SubscriptionArn?.startsWith('arn:'),\n\t\t);\n\t\tif (match) return match.SubscriptionArn;\n\t\tNextToken = page.NextToken;\n\t} while (NextToken);\n\treturn undefined;\n}\n\n/**\n * A pushed notification as the Lambda event SNS would have invoked a function\n * with, so it can be handed to the same adaptor.\n */\nexport function toSnsEvent(message: SnsHttpMessage, subscriptionArn = '') {\n\treturn {\n\t\tRecords: [\n\t\t\t{\n\t\t\t\tEventSource: 'aws:sns',\n\t\t\t\tEventVersion: '1.0',\n\t\t\t\tEventSubscriptionArn: subscriptionArn,\n\t\t\t\tSns: {\n\t\t\t\t\tType: message.Type,\n\t\t\t\t\tMessageId: message.MessageId,\n\t\t\t\t\tTopicArn: message.TopicArn,\n\t\t\t\t\tSubject: message.Subject ?? null,\n\t\t\t\t\tMessage: message.Message,\n\t\t\t\t\tTimestamp: message.Timestamp,\n\t\t\t\t\tSignatureVersion: message.SignatureVersion,\n\t\t\t\t\tSignature: message.Signature,\n\t\t\t\t\t// Lambda spells these two differently from the HTTP envelope.\n\t\t\t\t\tSigningCertUrl: message.SigningCertURL,\n\t\t\t\t\tUnsubscribeUrl: message.UnsubscribeURL ?? '',\n\t\t\t\t\tMessageAttributes: message.MessageAttributes ?? {},\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t};\n}\n\nexport class SnsCertificateUntrusted extends Error {\n\tconstructor(readonly url: string) {\n\t\tsuper(\n\t\t\t`The SNS message names a signing certificate at '${url}', which is not ` +\n\t\t\t\t'an https URL on sns.<region>.amazonaws.com. Only SNS can send to ' +\n\t\t\t\t'this endpoint; reject the request.',\n\t\t);\n\t\tthis.name = 'SnsCertificateUntrusted';\n\t}\n}\n\nexport class SnsCertificateUnavailable extends Error {\n\tconstructor(\n\t\treadonly url: string,\n\t\treadonly status: number,\n\t) {\n\t\tsuper(\n\t\t\t`Fetching the SNS signing certificate at '${url}' answered ${status}. ` +\n\t\t\t\t'The message cannot be verified, so it is not handled; SNS will retry.',\n\t\t);\n\t\tthis.name = 'SnsCertificateUnavailable';\n\t}\n}\n\nexport class SnsSignatureVersionUnknown extends Error {\n\tconstructor(readonly version: string) {\n\t\tsuper(\n\t\t\t`SNS signature version '${version}' is not one this endpoint verifies ` +\n\t\t\t\t\"(it knows '1' and '2'). Reject the request.\",\n\t\t);\n\t\tthis.name = 'SnsSignatureVersionUnknown';\n\t}\n}\n\nexport class SnsSignatureInvalid extends Error {\n\tconstructor(\n\t\treadonly messageId: string,\n\t\treadonly topicArn: string,\n\t) {\n\t\tsuper(\n\t\t\t`SNS message '${messageId}' from '${topicArn}' does not verify against ` +\n\t\t\t\t'its signing certificate. It was not sent by SNS, or was altered ' +\n\t\t\t\t'on the way; reject it.',\n\t\t);\n\t\tthis.name = 'SnsSignatureInvalid';\n\t}\n}\n\nexport class SnsMessageTypeUnknown extends Error {\n\tconstructor(readonly type: string) {\n\t\tsuper(\n\t\t\t`'${type}' is not an SNS message type (Notification, ` +\n\t\t\t\t'SubscriptionConfirmation, UnsubscribeConfirmation). Reject it.',\n\t\t);\n\t\tthis.name = 'SnsMessageTypeUnknown';\n\t}\n}\n\nexport class SnsNotAConfirmation extends Error {\n\tconstructor(readonly type: string) {\n\t\tsuper(\n\t\t\t`Only a SubscriptionConfirmation carries a URL to confirm; this is a ` +\n\t\t\t\t`'${type}'.`,\n\t\t);\n\t\tthis.name = 'SnsNotAConfirmation';\n\t}\n}\n\nexport class SnsConfirmationFailed extends Error {\n\tconstructor(\n\t\treadonly topicArn: string,\n\t\treadonly status: number,\n\t) {\n\t\tsuper(\n\t\t\t`Confirming the subscription to '${topicArn}' answered ${status}. ` +\n\t\t\t\t'SNS will deliver nothing until it is confirmed; it resends the ' +\n\t\t\t\t'confirmation, or subscribe the endpoint again.',\n\t\t);\n\t\tthis.name = 'SnsConfirmationFailed';\n\t}\n}\n\nexport class SnsEndpointNotHttp extends Error {\n\tconstructor(readonly endpoint: string) {\n\t\tsuper(\n\t\t\t`'${endpoint}' is not an http(s) URL. SNS pushes to an HTTP endpoint; ` +\n\t\t\t\t'subscribe a queue for anything else.',\n\t\t);\n\t\tthis.name = 'SnsEndpointNotHttp';\n\t}\n}\n"],"mappings":";;;;;;;;;;AAgBA,IAAa,gBAAb,MAAa,cAAyC;CACrD,OAAS;CACT;CACA,YAAoB;CACpB;CAEA,YAAY,QAA6B;EACxC,KAAK,SAAS;E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EACK,KAAK,GACX;EAJoB,KAAA,OAAA;EAKpB,KAAK,OAAO;CACb;AACD;AAEA,IAAa,wBAAb,cAA2C,MAAM;CAEtC;CACA;CAFV,YACC,UACA,QACC;EACD,MACC,mCAAmC,SAAS,aAAa,OAAO,gHAGjE;EAPS,KAAA,WAAA;EACA,KAAA,SAAA;EAOT,KAAK,OAAO;CACb;AACD;AAEA,IAAa,qBAAb,cAAwC,MAAM;CACxB;CAArB,YAAY,UAA2B;EACtC,MACC,IAAI,SAAS,8FAEd;EAJoB,KAAA,WAAA;EAKpB,KAAK,OAAO;CACb;AACD"}
|
package/dist/sns/index.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/sns/driver.ts","../../src/sns/SNSConnection.ts","../../src/sns/push.ts","../../src/sns/SNSPublisher.ts","../../src/sns/SNSSubscriber.ts"],"mappings":";;;;;;;;;qBAWa,iBAAiB;;;UCNb;EAChB;EACA;EACA;EACA;IACC;IACA;IACA;;;qBAIW,yBAAyB;WAC5B,OAAI,mBAAA;UACL;UACA;UACA;EAER,YAAY,QAAQ;;;;;SAgBP,qBACZ,2BACE,QAAQ;EA8BL,WAAW;EAKX,SAAS;EAKf;;;;MAOI,aAAa;;;;MAOb;;;;;;;;;;;;;;;;;UCrEY;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;EACA,oBAAoB;IAAiB;IAAc;;;UAwCnC;;;;;EAKhB,oBAAoB,gBAAgB;;;wBAwBrB,gBAAgB,SAAS;;;;;;;wBAgBnB,iBACrB,SAAS,gBACT,UAAS,0BACP;;;;;wBAsCmB,uBACrB,SAAS,gBACT,WAAU,gBAAgB;EAAU;EAAa;KAC/C;UAWc;;EAEhB;;;;;;EAMA;;;;;;EAMA;;;;;;;;;;;;;;;;wBAiBqB,sBACrB,YAAY,eACZ,SAAS,+BACP;;;;;wBAiFa,WAAW,SAAS,gBAAgB;;;;;;MAQ/C;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MAEA;MACA;MACA,mBAAiB;QAlRsB;QAAe;;;;;qBAyR9C,gCAAgC;WACvB;EAArB,YAAqB;;qBAUT,kCAAkC;WAEpC;WACA;EAFV,YACU,aACA;;qBAUE,mCAAmC;WAC1B;EAArB,YAAqB;;qBAST,4BAA4B;WAE9B;WACA;EAFV,YACU,mBACA;;qBAWE,8BAA8B;WACrB;EAArB,YAAqB;;qBAST,4BAA4B;WACnB;EAArB,YAAqB;;qBAST,8BAA8B;WAEhC;WACA;EAFV,YACU,kBACA;;qBAWE,2BAA2B;WAClB;EAArB,YAAqB;;;;KChZV;qBAEC,aAAa,iBAAiB,4CAC/B,eAAe;UAGjB;EADT,YACS,YAAY,eACpB,WAAU;;;;;SAOE,qBACZ,iBAAiB,iCAChB,2BAA2B,QAAQ,aAAa;EAQ5C,QAAQ,UAAU,aAAa;UAqBvB;EAwBR,SAAS;;;;UC7DC;EAChB;EACA;EACA;EACA;EACA;;;;;;;;;;;;;;;;;;;qBAoBY,cAAc,iBAAiB,4CAChC,gBAAgB;UAUlB;UARD;UACA;UACA;UACA;UACA;UACA;EAER,YACS,YAAY,eACpB,UAAS;;;;;SAwBG,qBACZ,iBAAiB,iCAChB,2BAA2B,QAAQ,cAAc;EAoB7C,UACL,UAAU,oBACV,WAAW,SAAS,aAAa,gBAC/B;;;;EA2BG,QAAQ;UA6BA;UAwBA;UA4BA;;;;;;qBAgBF,wBAAwB;WACf;EAArB,YAAqB"}
|
package/dist/sns/index.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/sns/driver.ts","../../src/sns/SNSConnection.ts","../../src/sns/push.ts","../../src/sns/SNSPublisher.ts","../../src/sns/SNSSubscriber.ts"],"mappings":";;;;;;;;;qBAWa,iBAAiB;;;UCNb;EAChB;EACA;EACA;EACA;IACC;IACA;IACA;;;qBAIW,yBAAyB;WAC5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