@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
package/dist/sns/index.d.cts
CHANGED
|
@@ -1,273 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* `sns://` — an SNS topic, consumed through an SQS queue subscribed to it.
|
|
7
|
-
* Register it with `registerEventsDriver(snsEventsDriver)`; an AWS entry
|
|
8
|
-
* registers `sqsEventsDriver` beside it.
|
|
9
|
-
*/
|
|
10
|
-
export declare const snsEventsDriver: EventsDriver;
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/sns/SNSConnection.d.ts
|
|
13
|
-
interface SNSConnectionConfig {
|
|
14
|
-
topicArn: string;
|
|
15
|
-
region?: string;
|
|
16
|
-
endpoint?: string;
|
|
17
|
-
credentials?: {
|
|
18
|
-
accessKeyId: string;
|
|
19
|
-
secretAccessKey: string;
|
|
20
|
-
sessionToken?: string;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export declare class SNSConnection implements EventConnection {
|
|
24
|
-
readonly type = EventPublisherType.SNS;
|
|
25
|
-
private client;
|
|
26
|
-
private connected;
|
|
27
|
-
private config;
|
|
28
|
-
constructor(config: SNSConnectionConfig);
|
|
29
|
-
/**
|
|
30
|
-
* Create an SNSConnection from a connection string
|
|
31
|
-
* Format: sns://?topicArn=arn:aws:sns:region:account:topic®ion=us-east-1&endpoint=http://localhost:4566
|
|
32
|
-
*/
|
|
33
|
-
static fromConnectionString(connectionString: string): Promise<SNSConnection>;
|
|
34
|
-
connect(): Promise<void>;
|
|
35
|
-
close(): Promise<void>;
|
|
36
|
-
isConnected(): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Get the underlying SNS client
|
|
39
|
-
*/
|
|
40
|
-
get snsClient(): SNSClient;
|
|
41
|
-
/**
|
|
42
|
-
* Get the topic ARN for this connection
|
|
43
|
-
*/
|
|
44
|
-
get topicArn(): string;
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
//#region src/sns/push.d.ts
|
|
48
|
-
/**
|
|
49
|
-
* SNS delivering to an HTTP(S) endpoint, rather than to a queue that is polled.
|
|
50
|
-
*
|
|
51
|
-
* SNS POSTs each message to the subscribed URL as JSON. That is the whole
|
|
52
|
-
* transport: no queue in between, no poller, and the endpoint is handed the
|
|
53
|
-
* same envelope a Lambda subscription receives inside `Records[].Sns` — so the
|
|
54
|
-
* handler that runs deployed can be the one that runs here.
|
|
55
|
-
*
|
|
56
|
-
* The endpoint is public, so a message is trusted only once its signature
|
|
57
|
-
* checks out against a certificate SNS itself serves. Anything else that POSTs
|
|
58
|
-
* there is somebody's guess at the shape.
|
|
59
|
-
*/
|
|
60
|
-
/** A message SNS POSTs to a subscribed HTTP endpoint. */
|
|
61
|
-
interface SnsHttpMessage {
|
|
62
|
-
Type: 'Notification' | 'SubscriptionConfirmation' | 'UnsubscribeConfirmation';
|
|
63
|
-
MessageId: string;
|
|
64
|
-
TopicArn: string;
|
|
65
|
-
Message: string;
|
|
66
|
-
Timestamp: string;
|
|
67
|
-
SignatureVersion: string;
|
|
68
|
-
Signature: string;
|
|
69
|
-
SigningCertURL: string;
|
|
70
|
-
Subject?: string;
|
|
71
|
-
/** Confirmation messages only. */
|
|
72
|
-
Token?: string;
|
|
73
|
-
/** Confirmation messages only: GET it to confirm. */
|
|
74
|
-
SubscribeURL?: string;
|
|
75
|
-
/** Notifications only. */
|
|
76
|
-
UnsubscribeURL?: string;
|
|
77
|
-
MessageAttributes?: Record<string, {
|
|
78
|
-
Type: string;
|
|
79
|
-
Value: string;
|
|
80
|
-
}>;
|
|
81
|
-
}
|
|
82
|
-
interface VerifySnsMessageOptions {
|
|
83
|
-
/**
|
|
84
|
-
* Fetch the PEM at a certificate URL. `fetch` by default; replaceable so a
|
|
85
|
-
* test signs with its own key instead of SNS's.
|
|
86
|
-
*/
|
|
87
|
-
fetchCertificate?: (url: string) => Promise<string>;
|
|
88
|
-
}
|
|
89
|
-
/** The string SNS signed for this message. */
|
|
90
|
-
export declare function snsStringToSign(message: SnsHttpMessage): string;
|
|
91
|
-
/**
|
|
92
|
-
* Check that SNS sent this message: the certificate is SNS's own, and the
|
|
93
|
-
* signature over the message's signed fields verifies against it.
|
|
94
|
-
*
|
|
95
|
-
* Throws rather than returning false, so a caller cannot forget to look.
|
|
96
|
-
*/
|
|
97
|
-
export declare function verifySnsMessage(message: SnsHttpMessage, options?: VerifySnsMessageOptions): Promise<void>;
|
|
98
|
-
/**
|
|
99
|
-
* Confirm a subscription by visiting the URL SNS sent. Until this happens SNS
|
|
100
|
-
* delivers nothing to the endpoint.
|
|
101
|
-
*/
|
|
102
|
-
export declare function confirmSnsSubscription(message: SnsHttpMessage, request?: (url: string) => Promise<{
|
|
103
|
-
ok: boolean;
|
|
104
|
-
status: number;
|
|
105
|
-
}>): Promise<void>;
|
|
106
|
-
interface SubscribeHttpEndpointOptions {
|
|
107
|
-
/** The URL SNS POSTs to — `http:` or `https:`, which picks the protocol. */
|
|
108
|
-
endpoint: string;
|
|
109
|
-
/**
|
|
110
|
-
* The event types this endpoint takes. Becomes the subscription's filter
|
|
111
|
-
* policy on the `type` attribute `SNSPublisher` sets, so SNS sends nothing
|
|
112
|
-
* else — fan-out to every subscriber, each seeing only what it named.
|
|
113
|
-
*/
|
|
114
|
-
events: readonly string[];
|
|
115
|
-
/**
|
|
116
|
-
* An SQS queue's ARN for what SNS gives up delivering. SNS retries an HTTP
|
|
117
|
-
* endpoint for a limited time and then drops the message, so without one an
|
|
118
|
-
* outage longer than that loses events.
|
|
119
|
-
*/
|
|
120
|
-
deadLetterQueueArn?: string;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Subscribe an HTTP endpoint to the connection's topic, converging on one
|
|
124
|
-
* confirmed subscription with the filter asked for — so it is safe on every
|
|
125
|
-
* start:
|
|
126
|
-
*
|
|
127
|
-
* - **none yet** — subscribed; SNS sends a confirmation to the endpoint.
|
|
128
|
-
* - **confirmed** — its filter and dead-letter queue are brought up to date.
|
|
129
|
-
* Subscribing again with different attributes is an error on SNS, and the
|
|
130
|
-
* events a subscriber names change.
|
|
131
|
-
* - **stuck pending** — a confirmation that never landed (the endpoint was
|
|
132
|
-
* down, or answered wrong). Subscribing the same endpoint again is a no-op
|
|
133
|
-
* on an emulator, so it is dropped and subscribed afresh, which sends a new
|
|
134
|
-
* confirmation.
|
|
135
|
-
*/
|
|
136
|
-
export declare function subscribeHttpEndpoint(connection: SNSConnection, options: SubscribeHttpEndpointOptions): Promise<string | undefined>;
|
|
137
|
-
/**
|
|
138
|
-
* A pushed notification as the Lambda event SNS would have invoked a function
|
|
139
|
-
* with, so it can be handed to the same adaptor.
|
|
140
|
-
*/
|
|
141
|
-
export declare function toSnsEvent(message: SnsHttpMessage, subscriptionArn?: string): {
|
|
142
|
-
Records: {
|
|
143
|
-
EventSource: string;
|
|
144
|
-
EventVersion: string;
|
|
145
|
-
EventSubscriptionArn: string;
|
|
146
|
-
Sns: {
|
|
147
|
-
Type: "Notification" | "SubscriptionConfirmation" | "UnsubscribeConfirmation";
|
|
148
|
-
MessageId: string;
|
|
149
|
-
TopicArn: string;
|
|
150
|
-
Subject: string | null;
|
|
151
|
-
Message: string;
|
|
152
|
-
Timestamp: string;
|
|
153
|
-
SignatureVersion: string;
|
|
154
|
-
Signature: string;
|
|
155
|
-
SigningCertUrl: string;
|
|
156
|
-
UnsubscribeUrl: string;
|
|
157
|
-
MessageAttributes: Record<string, {
|
|
158
|
-
Type: string;
|
|
159
|
-
Value: string;
|
|
160
|
-
}>;
|
|
161
|
-
};
|
|
162
|
-
}[];
|
|
163
|
-
};
|
|
164
|
-
export declare class SnsCertificateUntrusted extends Error {
|
|
165
|
-
readonly url: string;
|
|
166
|
-
constructor(url: string);
|
|
167
|
-
}
|
|
168
|
-
export declare class SnsCertificateUnavailable extends Error {
|
|
169
|
-
readonly url: string;
|
|
170
|
-
readonly status: number;
|
|
171
|
-
constructor(url: string, status: number);
|
|
172
|
-
}
|
|
173
|
-
export declare class SnsSignatureVersionUnknown extends Error {
|
|
174
|
-
readonly version: string;
|
|
175
|
-
constructor(version: string);
|
|
176
|
-
}
|
|
177
|
-
export declare class SnsSignatureInvalid extends Error {
|
|
178
|
-
readonly messageId: string;
|
|
179
|
-
readonly topicArn: string;
|
|
180
|
-
constructor(messageId: string, topicArn: string);
|
|
181
|
-
}
|
|
182
|
-
export declare class SnsMessageTypeUnknown extends Error {
|
|
183
|
-
readonly type: string;
|
|
184
|
-
constructor(type: string);
|
|
185
|
-
}
|
|
186
|
-
export declare class SnsNotAConfirmation extends Error {
|
|
187
|
-
readonly type: string;
|
|
188
|
-
constructor(type: string);
|
|
189
|
-
}
|
|
190
|
-
export declare class SnsConfirmationFailed extends Error {
|
|
191
|
-
readonly topicArn: string;
|
|
192
|
-
readonly status: number;
|
|
193
|
-
constructor(topicArn: string, status: number);
|
|
194
|
-
}
|
|
195
|
-
export declare class SnsEndpointNotHttp extends Error {
|
|
196
|
-
readonly endpoint: string;
|
|
197
|
-
constructor(endpoint: string);
|
|
198
|
-
}
|
|
199
|
-
//#endregion
|
|
200
|
-
//#region src/sns/SNSPublisher.d.ts
|
|
201
|
-
type SNSPublisherOptions = {};
|
|
202
|
-
export declare class SNSPublisher<TMessage extends PublishableMessage<string, any>> implements EventPublisher<TMessage> {
|
|
203
|
-
private connection;
|
|
204
|
-
constructor(connection: SNSConnection, _options?: SNSPublisherOptions);
|
|
205
|
-
/**
|
|
206
|
-
* Create an SNSPublisher from a connection string
|
|
207
|
-
* Format: sns://?topicArn=arn:aws:sns:region:account:topic®ion=us-east-1&endpoint=http://localhost:4566
|
|
208
|
-
*/
|
|
209
|
-
static fromConnectionString<TMessage extends PublishableMessage<string, any>>(connectionString: string): Promise<SNSPublisher<TMessage>>;
|
|
210
|
-
publish(messages: TMessage[]): Promise<void>;
|
|
211
|
-
private publishMessage;
|
|
212
|
-
close(): Promise<void>;
|
|
213
|
-
}
|
|
214
|
-
//#endregion
|
|
215
|
-
//#region src/sns/SNSSubscriber.d.ts
|
|
216
|
-
interface SNSSubscriberOptions {
|
|
217
|
-
queueName?: string;
|
|
218
|
-
createQueue?: boolean;
|
|
219
|
-
deleteQueueOnClose?: boolean;
|
|
220
|
-
waitTimeSeconds?: number;
|
|
221
|
-
maxMessages?: number;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* SNS Subscriber - receives push-based messages from SNS via SQS queue
|
|
225
|
-
*
|
|
226
|
-
* Architecture:
|
|
227
|
-
* SNS Topic → (push) → SQS Queue → Subscriber
|
|
228
|
-
*
|
|
229
|
-
* This subscriber automatically:
|
|
230
|
-
* 1. Creates an SQS queue (or uses existing one)
|
|
231
|
-
* 2. Subscribes the queue to the SNS topic
|
|
232
|
-
* 3. Receives messages pushed from SNS to the queue
|
|
233
|
-
* 4. Filters messages by topic ARN and message type
|
|
234
|
-
* 5. Processes and acknowledges messages
|
|
235
|
-
*
|
|
236
|
-
* Note: While SQS long-polling is used internally to receive messages,
|
|
237
|
-
* this is an implementation detail of the SNS push delivery mechanism.
|
|
238
|
-
* Messages are pushed from SNS to SQS, and we receive those pushed messages.
|
|
239
|
-
*/
|
|
240
|
-
export declare class SNSSubscriber<TMessage extends PublishableMessage<string, any>> implements EventSubscriber<TMessage> {
|
|
241
|
-
private connection;
|
|
242
|
-
private sqsClient;
|
|
243
|
-
private queueUrl?;
|
|
244
|
-
private queueArn?;
|
|
245
|
-
private subscriptionArn?;
|
|
246
|
-
private sqsSubscriber?;
|
|
247
|
-
private options;
|
|
248
|
-
constructor(connection: SNSConnection, options?: SNSSubscriberOptions);
|
|
249
|
-
/**
|
|
250
|
-
* Create an SNSSubscriber from a connection string
|
|
251
|
-
* Format: sns://?topicArn=...&queueName=myqueue®ion=us-east-1
|
|
252
|
-
*/
|
|
253
|
-
static fromConnectionString<TMessage extends PublishableMessage<string, any>>(connectionString: string): Promise<SNSSubscriber<TMessage>>;
|
|
254
|
-
subscribe(messages: TMessage['type'][], listener: (payload: TMessage) => Promise<void>): Promise<void>;
|
|
255
|
-
/**
|
|
256
|
-
* Stop receiving messages and clean up resources
|
|
257
|
-
*/
|
|
258
|
-
stop(): Promise<void>;
|
|
259
|
-
private setupQueue;
|
|
260
|
-
private setQueuePolicy;
|
|
261
|
-
private subscribeToTopic;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* A subscriber asked to use a queue it may not create. The SQS queue behind an
|
|
265
|
-
* SNS subscription has to exist first, or `createQueue` has to allow it.
|
|
266
|
-
*/
|
|
267
|
-
export declare class SnsQueueMissing extends Error {
|
|
268
|
-
readonly queueName: string | undefined;
|
|
269
|
-
constructor(queueName: string | undefined);
|
|
270
|
-
}
|
|
271
|
-
//#endregion
|
|
272
|
-
export { type SNSConnectionConfig, type SNSPublisherOptions, type SNSSubscriberOptions, type SnsAddress, type SnsHttpMessage, type SubscribeHttpEndpointOptions, type VerifySnsMessageOptions, snsUrl_d_exports as snsUrl };
|
|
273
|
-
//# sourceMappingURL=index.d.cts.map
|
|
1
|
+
import "../types-Dj23od3e.cjs";
|
|
2
|
+
import { SNSConnection, SNSConnectionConfig } from "../SNSConnection-Dol9FuxA.cjs";
|
|
3
|
+
import { SNSPublisher, SNSPublisherOptions } from "../SNSPublisher-DQunY4NM.cjs";
|
|
4
|
+
import { SNSSubscriber, SNSSubscriberOptions } from "../SNSSubscriber-ZGJjhXFQ.cjs";
|
|
5
|
+
export { SNSConnection, SNSConnectionConfig, SNSPublisher, SNSPublisherOptions, SNSSubscriber, SNSSubscriberOptions };
|
package/dist/sns/index.d.mts
CHANGED
|
@@ -1,273 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* `sns://` — an SNS topic, consumed through an SQS queue subscribed to it.
|
|
7
|
-
* Register it with `registerEventsDriver(snsEventsDriver)`; an AWS entry
|
|
8
|
-
* registers `sqsEventsDriver` beside it.
|
|
9
|
-
*/
|
|
10
|
-
export declare const snsEventsDriver: EventsDriver;
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/sns/SNSConnection.d.ts
|
|
13
|
-
interface SNSConnectionConfig {
|
|
14
|
-
topicArn: string;
|
|
15
|
-
region?: string;
|
|
16
|
-
endpoint?: string;
|
|
17
|
-
credentials?: {
|
|
18
|
-
accessKeyId: string;
|
|
19
|
-
secretAccessKey: string;
|
|
20
|
-
sessionToken?: string;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export declare class SNSConnection implements EventConnection {
|
|
24
|
-
readonly type = EventPublisherType.SNS;
|
|
25
|
-
private client;
|
|
26
|
-
private connected;
|
|
27
|
-
private config;
|
|
28
|
-
constructor(config: SNSConnectionConfig);
|
|
29
|
-
/**
|
|
30
|
-
* Create an SNSConnection from a connection string
|
|
31
|
-
* Format: sns://?topicArn=arn:aws:sns:region:account:topic®ion=us-east-1&endpoint=http://localhost:4566
|
|
32
|
-
*/
|
|
33
|
-
static fromConnectionString(connectionString: string): Promise<SNSConnection>;
|
|
34
|
-
connect(): Promise<void>;
|
|
35
|
-
close(): Promise<void>;
|
|
36
|
-
isConnected(): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Get the underlying SNS client
|
|
39
|
-
*/
|
|
40
|
-
get snsClient(): SNSClient;
|
|
41
|
-
/**
|
|
42
|
-
* Get the topic ARN for this connection
|
|
43
|
-
*/
|
|
44
|
-
get topicArn(): string;
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
//#region src/sns/push.d.ts
|
|
48
|
-
/**
|
|
49
|
-
* SNS delivering to an HTTP(S) endpoint, rather than to a queue that is polled.
|
|
50
|
-
*
|
|
51
|
-
* SNS POSTs each message to the subscribed URL as JSON. That is the whole
|
|
52
|
-
* transport: no queue in between, no poller, and the endpoint is handed the
|
|
53
|
-
* same envelope a Lambda subscription receives inside `Records[].Sns` — so the
|
|
54
|
-
* handler that runs deployed can be the one that runs here.
|
|
55
|
-
*
|
|
56
|
-
* The endpoint is public, so a message is trusted only once its signature
|
|
57
|
-
* checks out against a certificate SNS itself serves. Anything else that POSTs
|
|
58
|
-
* there is somebody's guess at the shape.
|
|
59
|
-
*/
|
|
60
|
-
/** A message SNS POSTs to a subscribed HTTP endpoint. */
|
|
61
|
-
interface SnsHttpMessage {
|
|
62
|
-
Type: 'Notification' | 'SubscriptionConfirmation' | 'UnsubscribeConfirmation';
|
|
63
|
-
MessageId: string;
|
|
64
|
-
TopicArn: string;
|
|
65
|
-
Message: string;
|
|
66
|
-
Timestamp: string;
|
|
67
|
-
SignatureVersion: string;
|
|
68
|
-
Signature: string;
|
|
69
|
-
SigningCertURL: string;
|
|
70
|
-
Subject?: string;
|
|
71
|
-
/** Confirmation messages only. */
|
|
72
|
-
Token?: string;
|
|
73
|
-
/** Confirmation messages only: GET it to confirm. */
|
|
74
|
-
SubscribeURL?: string;
|
|
75
|
-
/** Notifications only. */
|
|
76
|
-
UnsubscribeURL?: string;
|
|
77
|
-
MessageAttributes?: Record<string, {
|
|
78
|
-
Type: string;
|
|
79
|
-
Value: string;
|
|
80
|
-
}>;
|
|
81
|
-
}
|
|
82
|
-
interface VerifySnsMessageOptions {
|
|
83
|
-
/**
|
|
84
|
-
* Fetch the PEM at a certificate URL. `fetch` by default; replaceable so a
|
|
85
|
-
* test signs with its own key instead of SNS's.
|
|
86
|
-
*/
|
|
87
|
-
fetchCertificate?: (url: string) => Promise<string>;
|
|
88
|
-
}
|
|
89
|
-
/** The string SNS signed for this message. */
|
|
90
|
-
export declare function snsStringToSign(message: SnsHttpMessage): string;
|
|
91
|
-
/**
|
|
92
|
-
* Check that SNS sent this message: the certificate is SNS's own, and the
|
|
93
|
-
* signature over the message's signed fields verifies against it.
|
|
94
|
-
*
|
|
95
|
-
* Throws rather than returning false, so a caller cannot forget to look.
|
|
96
|
-
*/
|
|
97
|
-
export declare function verifySnsMessage(message: SnsHttpMessage, options?: VerifySnsMessageOptions): Promise<void>;
|
|
98
|
-
/**
|
|
99
|
-
* Confirm a subscription by visiting the URL SNS sent. Until this happens SNS
|
|
100
|
-
* delivers nothing to the endpoint.
|
|
101
|
-
*/
|
|
102
|
-
export declare function confirmSnsSubscription(message: SnsHttpMessage, request?: (url: string) => Promise<{
|
|
103
|
-
ok: boolean;
|
|
104
|
-
status: number;
|
|
105
|
-
}>): Promise<void>;
|
|
106
|
-
interface SubscribeHttpEndpointOptions {
|
|
107
|
-
/** The URL SNS POSTs to — `http:` or `https:`, which picks the protocol. */
|
|
108
|
-
endpoint: string;
|
|
109
|
-
/**
|
|
110
|
-
* The event types this endpoint takes. Becomes the subscription's filter
|
|
111
|
-
* policy on the `type` attribute `SNSPublisher` sets, so SNS sends nothing
|
|
112
|
-
* else — fan-out to every subscriber, each seeing only what it named.
|
|
113
|
-
*/
|
|
114
|
-
events: readonly string[];
|
|
115
|
-
/**
|
|
116
|
-
* An SQS queue's ARN for what SNS gives up delivering. SNS retries an HTTP
|
|
117
|
-
* endpoint for a limited time and then drops the message, so without one an
|
|
118
|
-
* outage longer than that loses events.
|
|
119
|
-
*/
|
|
120
|
-
deadLetterQueueArn?: string;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Subscribe an HTTP endpoint to the connection's topic, converging on one
|
|
124
|
-
* confirmed subscription with the filter asked for — so it is safe on every
|
|
125
|
-
* start:
|
|
126
|
-
*
|
|
127
|
-
* - **none yet** — subscribed; SNS sends a confirmation to the endpoint.
|
|
128
|
-
* - **confirmed** — its filter and dead-letter queue are brought up to date.
|
|
129
|
-
* Subscribing again with different attributes is an error on SNS, and the
|
|
130
|
-
* events a subscriber names change.
|
|
131
|
-
* - **stuck pending** — a confirmation that never landed (the endpoint was
|
|
132
|
-
* down, or answered wrong). Subscribing the same endpoint again is a no-op
|
|
133
|
-
* on an emulator, so it is dropped and subscribed afresh, which sends a new
|
|
134
|
-
* confirmation.
|
|
135
|
-
*/
|
|
136
|
-
export declare function subscribeHttpEndpoint(connection: SNSConnection, options: SubscribeHttpEndpointOptions): Promise<string | undefined>;
|
|
137
|
-
/**
|
|
138
|
-
* A pushed notification as the Lambda event SNS would have invoked a function
|
|
139
|
-
* with, so it can be handed to the same adaptor.
|
|
140
|
-
*/
|
|
141
|
-
export declare function toSnsEvent(message: SnsHttpMessage, subscriptionArn?: string): {
|
|
142
|
-
Records: {
|
|
143
|
-
EventSource: string;
|
|
144
|
-
EventVersion: string;
|
|
145
|
-
EventSubscriptionArn: string;
|
|
146
|
-
Sns: {
|
|
147
|
-
Type: "Notification" | "SubscriptionConfirmation" | "UnsubscribeConfirmation";
|
|
148
|
-
MessageId: string;
|
|
149
|
-
TopicArn: string;
|
|
150
|
-
Subject: string | null;
|
|
151
|
-
Message: string;
|
|
152
|
-
Timestamp: string;
|
|
153
|
-
SignatureVersion: string;
|
|
154
|
-
Signature: string;
|
|
155
|
-
SigningCertUrl: string;
|
|
156
|
-
UnsubscribeUrl: string;
|
|
157
|
-
MessageAttributes: Record<string, {
|
|
158
|
-
Type: string;
|
|
159
|
-
Value: string;
|
|
160
|
-
}>;
|
|
161
|
-
};
|
|
162
|
-
}[];
|
|
163
|
-
};
|
|
164
|
-
export declare class SnsCertificateUntrusted extends Error {
|
|
165
|
-
readonly url: string;
|
|
166
|
-
constructor(url: string);
|
|
167
|
-
}
|
|
168
|
-
export declare class SnsCertificateUnavailable extends Error {
|
|
169
|
-
readonly url: string;
|
|
170
|
-
readonly status: number;
|
|
171
|
-
constructor(url: string, status: number);
|
|
172
|
-
}
|
|
173
|
-
export declare class SnsSignatureVersionUnknown extends Error {
|
|
174
|
-
readonly version: string;
|
|
175
|
-
constructor(version: string);
|
|
176
|
-
}
|
|
177
|
-
export declare class SnsSignatureInvalid extends Error {
|
|
178
|
-
readonly messageId: string;
|
|
179
|
-
readonly topicArn: string;
|
|
180
|
-
constructor(messageId: string, topicArn: string);
|
|
181
|
-
}
|
|
182
|
-
export declare class SnsMessageTypeUnknown extends Error {
|
|
183
|
-
readonly type: string;
|
|
184
|
-
constructor(type: string);
|
|
185
|
-
}
|
|
186
|
-
export declare class SnsNotAConfirmation extends Error {
|
|
187
|
-
readonly type: string;
|
|
188
|
-
constructor(type: string);
|
|
189
|
-
}
|
|
190
|
-
export declare class SnsConfirmationFailed extends Error {
|
|
191
|
-
readonly topicArn: string;
|
|
192
|
-
readonly status: number;
|
|
193
|
-
constructor(topicArn: string, status: number);
|
|
194
|
-
}
|
|
195
|
-
export declare class SnsEndpointNotHttp extends Error {
|
|
196
|
-
readonly endpoint: string;
|
|
197
|
-
constructor(endpoint: string);
|
|
198
|
-
}
|
|
199
|
-
//#endregion
|
|
200
|
-
//#region src/sns/SNSPublisher.d.ts
|
|
201
|
-
type SNSPublisherOptions = {};
|
|
202
|
-
export declare class SNSPublisher<TMessage extends PublishableMessage<string, any>> implements EventPublisher<TMessage> {
|
|
203
|
-
private connection;
|
|
204
|
-
constructor(connection: SNSConnection, _options?: SNSPublisherOptions);
|
|
205
|
-
/**
|
|
206
|
-
* Create an SNSPublisher from a connection string
|
|
207
|
-
* Format: sns://?topicArn=arn:aws:sns:region:account:topic®ion=us-east-1&endpoint=http://localhost:4566
|
|
208
|
-
*/
|
|
209
|
-
static fromConnectionString<TMessage extends PublishableMessage<string, any>>(connectionString: string): Promise<SNSPublisher<TMessage>>;
|
|
210
|
-
publish(messages: TMessage[]): Promise<void>;
|
|
211
|
-
private publishMessage;
|
|
212
|
-
close(): Promise<void>;
|
|
213
|
-
}
|
|
214
|
-
//#endregion
|
|
215
|
-
//#region src/sns/SNSSubscriber.d.ts
|
|
216
|
-
interface SNSSubscriberOptions {
|
|
217
|
-
queueName?: string;
|
|
218
|
-
createQueue?: boolean;
|
|
219
|
-
deleteQueueOnClose?: boolean;
|
|
220
|
-
waitTimeSeconds?: number;
|
|
221
|
-
maxMessages?: number;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* SNS Subscriber - receives push-based messages from SNS via SQS queue
|
|
225
|
-
*
|
|
226
|
-
* Architecture:
|
|
227
|
-
* SNS Topic → (push) → SQS Queue → Subscriber
|
|
228
|
-
*
|
|
229
|
-
* This subscriber automatically:
|
|
230
|
-
* 1. Creates an SQS queue (or uses existing one)
|
|
231
|
-
* 2. Subscribes the queue to the SNS topic
|
|
232
|
-
* 3. Receives messages pushed from SNS to the queue
|
|
233
|
-
* 4. Filters messages by topic ARN and message type
|
|
234
|
-
* 5. Processes and acknowledges messages
|
|
235
|
-
*
|
|
236
|
-
* Note: While SQS long-polling is used internally to receive messages,
|
|
237
|
-
* this is an implementation detail of the SNS push delivery mechanism.
|
|
238
|
-
* Messages are pushed from SNS to SQS, and we receive those pushed messages.
|
|
239
|
-
*/
|
|
240
|
-
export declare class SNSSubscriber<TMessage extends PublishableMessage<string, any>> implements EventSubscriber<TMessage> {
|
|
241
|
-
private connection;
|
|
242
|
-
private sqsClient;
|
|
243
|
-
private queueUrl?;
|
|
244
|
-
private queueArn?;
|
|
245
|
-
private subscriptionArn?;
|
|
246
|
-
private sqsSubscriber?;
|
|
247
|
-
private options;
|
|
248
|
-
constructor(connection: SNSConnection, options?: SNSSubscriberOptions);
|
|
249
|
-
/**
|
|
250
|
-
* Create an SNSSubscriber from a connection string
|
|
251
|
-
* Format: sns://?topicArn=...&queueName=myqueue®ion=us-east-1
|
|
252
|
-
*/
|
|
253
|
-
static fromConnectionString<TMessage extends PublishableMessage<string, any>>(connectionString: string): Promise<SNSSubscriber<TMessage>>;
|
|
254
|
-
subscribe(messages: TMessage['type'][], listener: (payload: TMessage) => Promise<void>): Promise<void>;
|
|
255
|
-
/**
|
|
256
|
-
* Stop receiving messages and clean up resources
|
|
257
|
-
*/
|
|
258
|
-
stop(): Promise<void>;
|
|
259
|
-
private setupQueue;
|
|
260
|
-
private setQueuePolicy;
|
|
261
|
-
private subscribeToTopic;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* A subscriber asked to use a queue it may not create. The SQS queue behind an
|
|
265
|
-
* SNS subscription has to exist first, or `createQueue` has to allow it.
|
|
266
|
-
*/
|
|
267
|
-
export declare class SnsQueueMissing extends Error {
|
|
268
|
-
readonly queueName: string | undefined;
|
|
269
|
-
constructor(queueName: string | undefined);
|
|
270
|
-
}
|
|
271
|
-
//#endregion
|
|
272
|
-
export { type SNSConnectionConfig, type SNSPublisherOptions, type SNSSubscriberOptions, type SnsAddress, type SnsHttpMessage, type SubscribeHttpEndpointOptions, type VerifySnsMessageOptions, snsUrl_d_exports as snsUrl };
|
|
273
|
-
//# sourceMappingURL=index.d.mts.map
|
|
1
|
+
import "../types-Dh9Jyinx.mjs";
|
|
2
|
+
import { SNSConnection, SNSConnectionConfig } from "../SNSConnection-CG4iEwA8.mjs";
|
|
3
|
+
import { SNSPublisher, SNSPublisherOptions } from "../SNSPublisher-D50dPCEh.mjs";
|
|
4
|
+
import { SNSSubscriber, SNSSubscriberOptions } from "../SNSSubscriber-CUgHK4W2.mjs";
|
|
5
|
+
export { SNSConnection, SNSConnectionConfig, SNSPublisher, SNSPublisherOptions, SNSSubscriber, SNSSubscriberOptions };
|