@geekmidas/constructs 10.0.0-alpha.6 → 10.0.0-alpha.61
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/README.md +223 -158
- package/dist/{Construct-BD5neF7w.mjs → Construct-BO1X-kt9.mjs} +32 -33
- package/dist/Construct-BO1X-kt9.mjs.map +1 -0
- package/dist/Construct-BQALFCh2.d.cts +230 -0
- package/dist/Construct-BQALFCh2.d.cts.map +1 -0
- package/dist/{Construct-CyS3RpTL.cjs → Construct-DmvXceVY.cjs} +52 -47
- package/dist/Construct-DmvXceVY.cjs.map +1 -0
- package/dist/Construct-QXnl3VqT.d.mts +230 -0
- package/dist/Construct-QXnl3VqT.d.mts.map +1 -0
- package/dist/{Cron-DmQ8vQ4b.d.cts → Cron-DI3nKoic.d.cts} +15 -9
- package/dist/Cron-DI3nKoic.d.cts.map +1 -0
- package/dist/{Cron-dh4rUgib.d.mts → Cron-uYAHPnp7.d.mts} +15 -9
- package/dist/Cron-uYAHPnp7.d.mts.map +1 -0
- package/dist/{CronBuilder-Da0C0edR.cjs → CronBuilder-BoHzlWU_.cjs} +47 -31
- package/dist/CronBuilder-BoHzlWU_.cjs.map +1 -0
- package/dist/{CronBuilder-CYKT5RiO.mjs → CronBuilder-CCgt0wCE.mjs} +37 -21
- package/dist/CronBuilder-CCgt0wCE.mjs.map +1 -0
- package/dist/CronBuilder-DaSUm2Na.d.mts +47 -0
- package/dist/CronBuilder-DaSUm2Na.d.mts.map +1 -0
- package/dist/CronBuilder-g1lZLWyG.d.cts +47 -0
- package/dist/CronBuilder-g1lZLWyG.d.cts.map +1 -0
- package/dist/{Endpoint-BjWKinFA.d.mts → Endpoint-BJDBZBZu.d.mts} +75 -91
- package/dist/Endpoint-BJDBZBZu.d.mts.map +1 -0
- package/dist/{Endpoint-DCQPMdUX.mjs → Endpoint-CMWWrQ7u.mjs} +140 -109
- package/dist/Endpoint-CMWWrQ7u.mjs.map +1 -0
- package/dist/{Endpoint-dav89W6-.d.cts → Endpoint-DV3jK5sP.d.cts} +74 -90
- package/dist/Endpoint-DV3jK5sP.d.cts.map +1 -0
- package/dist/{Endpoint-DcWXE-SZ.cjs → Endpoint-DfiXTm_v.cjs} +168 -131
- package/dist/Endpoint-DfiXTm_v.cjs.map +1 -0
- package/dist/{EndpointFactory-CjV8F_lJ.mjs → EndpointFactory-7g4Dg6cW.mjs} +41 -75
- package/dist/EndpointFactory-7g4Dg6cW.mjs.map +1 -0
- package/dist/{EndpointFactory-CdWB7wPw.cjs → EndpointFactory-CLxrcS0O.cjs} +77 -111
- package/dist/EndpointFactory-CLxrcS0O.cjs.map +1 -0
- package/dist/{index-Bd5FqCoe.d.cts → EndpointFactory-CLzCLkLt.d.cts} +64 -133
- package/dist/EndpointFactory-CLzCLkLt.d.cts.map +1 -0
- package/dist/{index-lAO9egTb.d.mts → EndpointFactory-gaF4yRpP.d.mts} +65 -134
- package/dist/EndpointFactory-gaF4yRpP.d.mts.map +1 -0
- package/dist/Function-DuqGcbOI.d.mts +76 -0
- package/dist/Function-DuqGcbOI.d.mts.map +1 -0
- package/dist/Function-Pu-1kKZz.d.cts +76 -0
- package/dist/Function-Pu-1kKZz.d.cts.map +1 -0
- package/dist/{HonoEndpointAdaptor-DtL9j19R.cjs → HonoEndpointAdaptor-B22boEAR.cjs} +52 -54
- package/dist/HonoEndpointAdaptor-B22boEAR.cjs.map +1 -0
- package/dist/{HonoEndpointAdaptor-P1ahhZHu.mjs → HonoEndpointAdaptor-vY4JKG8i.mjs} +42 -47
- package/dist/HonoEndpointAdaptor-vY4JKG8i.mjs.map +1 -0
- package/dist/Queue-D5jcw0mu.cjs +109 -0
- package/dist/Queue-D5jcw0mu.cjs.map +1 -0
- package/dist/{Queue-D7ZuwBhy.d.cts → Queue-DlsHRzUp.d.mts} +48 -48
- package/dist/Queue-DlsHRzUp.d.mts.map +1 -0
- package/dist/{Queue-gVGfi2Yk.d.mts → Queue-HPyi0e1i.d.cts} +49 -49
- package/dist/Queue-HPyi0e1i.d.cts.map +1 -0
- package/dist/Queue-hwPN-t31.mjs +104 -0
- package/dist/Queue-hwPN-t31.mjs.map +1 -0
- package/dist/QueueBuilder-BFQn3OzZ.cjs +135 -0
- package/dist/QueueBuilder-BFQn3OzZ.cjs.map +1 -0
- package/dist/QueueBuilder-DCuYdjMw.mjs +118 -0
- package/dist/QueueBuilder-DCuYdjMw.mjs.map +1 -0
- package/dist/QueueBuilder-OSi6LkV9.d.cts +75 -0
- package/dist/QueueBuilder-OSi6LkV9.d.cts.map +1 -0
- package/dist/QueueBuilder-QHsnVt1P.d.mts +75 -0
- package/dist/QueueBuilder-QHsnVt1P.d.mts.map +1 -0
- package/dist/{Subscriber-2mEi0ImH.d.cts → Subscriber-Bpp02cGr.d.cts} +29 -20
- package/dist/Subscriber-Bpp02cGr.d.cts.map +1 -0
- package/dist/{Subscriber-xTJ9ayPN.d.mts → Subscriber-CtN9R48-.d.mts} +29 -20
- package/dist/Subscriber-CtN9R48-.d.mts.map +1 -0
- package/dist/{SubscriberBuilder-4OPehf2R.cjs → SubscriberBuilder-C2PwqwIl.cjs} +61 -36
- package/dist/SubscriberBuilder-C2PwqwIl.cjs.map +1 -0
- package/dist/SubscriberBuilder-CuCMFpYW.d.mts +67 -0
- package/dist/SubscriberBuilder-CuCMFpYW.d.mts.map +1 -0
- package/dist/{SubscriberBuilder-BjkbeT9l.mjs → SubscriberBuilder-DMFk_Ap1.mjs} +50 -24
- package/dist/SubscriberBuilder-DMFk_Ap1.mjs.map +1 -0
- package/dist/SubscriberBuilder-g3fAVWgs.d.cts +67 -0
- package/dist/SubscriberBuilder-g3fAVWgs.d.cts.map +1 -0
- package/dist/Topic-CkxOTrMv.cjs +104 -0
- package/dist/Topic-CkxOTrMv.cjs.map +1 -0
- package/dist/Topic-hPffOsot.mjs +99 -0
- package/dist/Topic-hPffOsot.mjs.map +1 -0
- package/dist/adaptors/aws.cjs +118 -216
- package/dist/adaptors/aws.cjs.map +1 -1
- package/dist/adaptors/aws.d.cts +34 -53
- package/dist/adaptors/aws.d.cts.map +1 -1
- package/dist/adaptors/aws.d.mts +35 -54
- package/dist/adaptors/aws.d.mts.map +1 -1
- package/dist/adaptors/aws.mjs +91 -191
- package/dist/adaptors/aws.mjs.map +1 -1
- package/dist/adaptors/hono.cjs +3 -10
- package/dist/adaptors/hono.d.cts +7 -16
- package/dist/adaptors/hono.d.cts.map +1 -1
- package/dist/adaptors/hono.d.mts +8 -17
- package/dist/adaptors/hono.d.mts.map +1 -1
- package/dist/adaptors/hono.mjs +2 -10
- package/dist/adaptors/testing.cjs +711 -89
- package/dist/adaptors/testing.cjs.map +1 -1
- package/dist/adaptors/testing.d.cts +325 -54
- package/dist/adaptors/testing.d.cts.map +1 -1
- package/dist/adaptors/testing.d.mts +325 -54
- package/dist/adaptors/testing.d.mts.map +1 -1
- package/dist/adaptors/testing.mjs +676 -70
- package/dist/adaptors/testing.mjs.map +1 -1
- package/dist/auth-CIFXNuDk.d.cts +194 -0
- package/dist/auth-CIFXNuDk.d.cts.map +1 -0
- package/dist/auth-CJ9Ff6Lu.d.mts +194 -0
- package/dist/auth-CJ9Ff6Lu.d.mts.map +1 -0
- package/dist/auth.cjs +172 -31
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +2 -108
- package/dist/auth.d.mts +2 -108
- package/dist/auth.mjs +161 -24
- package/dist/auth.mjs.map +1 -1
- package/dist/{cache-BrRz3fEB.d.mts → cache-CXh6GIgb.d.mts} +3 -6
- package/dist/cache-CXh6GIgb.d.mts.map +1 -0
- package/dist/{cache-BtZY_tHe.d.cts → cache-DnGDGly3.d.cts} +3 -6
- package/dist/cache-DnGDGly3.d.cts.map +1 -0
- package/dist/cache.cjs +68 -2
- package/dist/cache.cjs.map +1 -0
- package/dist/cache.d.cts +1 -2
- package/dist/cache.d.mts +1 -2
- package/dist/cache.mjs +67 -2
- package/dist/cache.mjs.map +1 -0
- package/dist/cipher-C1lEFX63.mjs +225 -0
- package/dist/cipher-C1lEFX63.mjs.map +1 -0
- package/dist/cipher-CVxfwLjk.cjs +332 -0
- package/dist/cipher-CVxfwLjk.cjs.map +1 -0
- package/dist/{clone-DblgEZZa.mjs → clone-EKNovYHu.mjs} +3 -3
- package/dist/clone-EKNovYHu.mjs.map +1 -0
- package/dist/{clone-Dy0cR2SZ.cjs → clone-UGJpvQnL.cjs} +7 -8
- package/dist/clone-UGJpvQnL.cjs.map +1 -0
- package/dist/{construct-interface-D9d4Gm4p.d.cts → construct-interface-B1AfqRl4.d.cts} +42 -11
- package/dist/construct-interface-B1AfqRl4.d.cts.map +1 -0
- package/dist/{construct-interface-g5GM5pwR.d.mts → construct-interface-DluK3_da.d.mts} +42 -11
- package/dist/construct-interface-DluK3_da.d.mts.map +1 -0
- package/dist/construct-interface.cjs +113 -7
- package/dist/construct-interface.cjs.map +1 -0
- package/dist/construct-interface.d.cts +2 -2
- package/dist/construct-interface.d.mts +2 -2
- package/dist/construct-interface.mjs +106 -2
- package/dist/construct-interface.mjs.map +1 -0
- package/dist/credential.cjs +63 -16
- package/dist/credential.cjs.map +1 -1
- package/dist/credential.d.cts +16 -9
- package/dist/credential.d.cts.map +1 -1
- package/dist/credential.d.mts +16 -9
- package/dist/credential.d.mts.map +1 -1
- package/dist/credential.mjs +58 -12
- package/dist/credential.mjs.map +1 -1
- package/dist/crons/index.cjs +105 -7
- package/dist/crons/index.cjs.map +1 -1
- package/dist/crons/index.d.cts +40 -11
- package/dist/crons/index.d.cts.map +1 -1
- package/dist/crons/index.d.mts +40 -11
- package/dist/crons/index.d.mts.map +1 -1
- package/dist/crons/index.mjs +103 -8
- package/dist/crons/index.mjs.map +1 -1
- package/dist/database/kysely.cjs +4 -181
- package/dist/database/kysely.d.cts +2 -152
- package/dist/database/kysely.d.mts +2 -152
- package/dist/database/kysely.mjs +2 -180
- package/dist/email.cjs +25 -12
- package/dist/email.cjs.map +1 -1
- package/dist/email.d.cts +3 -7
- package/dist/email.d.cts.map +1 -1
- package/dist/email.d.mts +3 -7
- package/dist/email.d.mts.map +1 -1
- package/dist/email.mjs +16 -3
- package/dist/email.mjs.map +1 -1
- package/dist/encryption.cjs +96 -0
- package/dist/encryption.cjs.map +1 -0
- package/dist/encryption.d.cts +117 -0
- package/dist/encryption.d.cts.map +1 -0
- package/dist/encryption.d.mts +117 -0
- package/dist/encryption.d.mts.map +1 -0
- package/dist/encryption.mjs +83 -0
- package/dist/encryption.mjs.map +1 -0
- package/dist/endpoints/index.cjs +8 -10
- package/dist/endpoints/index.d.cts +51 -7
- package/dist/endpoints/index.d.cts.map +1 -0
- package/dist/endpoints/index.d.mts +51 -7
- package/dist/endpoints/index.d.mts.map +1 -0
- package/dist/endpoints/index.mjs +6 -10
- package/dist/external-api-CWY9orcO.d.mts +86 -0
- package/dist/external-api-CWY9orcO.d.mts.map +1 -0
- package/dist/external-api-D-5WB-sr.d.cts +86 -0
- package/dist/external-api-D-5WB-sr.d.cts.map +1 -0
- package/dist/external-api.cjs +124 -0
- package/dist/external-api.cjs.map +1 -0
- package/dist/external-api.d.cts +2 -0
- package/dist/external-api.d.mts +2 -0
- package/dist/external-api.mjs +121 -0
- package/dist/external-api.mjs.map +1 -0
- package/dist/file-server.cjs +42 -10
- package/dist/file-server.cjs.map +1 -1
- package/dist/file-server.d.cts +6 -10
- package/dist/file-server.d.cts.map +1 -1
- package/dist/file-server.d.mts +6 -10
- package/dist/file-server.d.mts.map +1 -1
- package/dist/file-server.mjs +34 -2
- package/dist/file-server.mjs.map +1 -1
- package/dist/functions/index.cjs +3 -6
- package/dist/functions/index.d.cts +3 -4
- package/dist/functions/index.d.mts +3 -4
- package/dist/functions/index.mjs +2 -6
- package/dist/{functions-i_la-N5r.cjs → functions-CbP5ZKma.cjs} +414 -264
- package/dist/functions-CbP5ZKma.cjs.map +1 -0
- package/dist/{functions-14lpEFL4.mjs → functions-Di6n5ltG.mjs} +376 -238
- package/dist/{functions-14lpEFL4.mjs.map → functions-Di6n5ltG.mjs.map} +1 -1
- package/dist/index-BuzRvKOQ.d.cts +115 -0
- package/dist/index-BuzRvKOQ.d.cts.map +1 -0
- package/dist/index-CTkKOer4.d.mts +115 -0
- package/dist/index-CTkKOer4.d.mts.map +1 -0
- package/dist/index-CeEtxDmK.d.cts +79 -0
- package/dist/index-CeEtxDmK.d.cts.map +1 -0
- package/dist/index-CeEtxDmK.d.mts +79 -0
- package/dist/index-CeEtxDmK.d.mts.map +1 -0
- package/dist/index.cjs +6 -3
- package/dist/index.d.cts +26 -4
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +26 -4
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -3
- package/dist/kms-B-Hm3d5r.cjs +85 -0
- package/dist/kms-B-Hm3d5r.cjs.map +1 -0
- package/dist/kms-BdUlMJEZ.mjs +85 -0
- package/dist/kms-BdUlMJEZ.mjs.map +1 -0
- package/dist/kysely-BEm5sDlU.d.cts +173 -0
- package/dist/kysely-BEm5sDlU.d.cts.map +1 -0
- package/dist/kysely-BRzzawr2.cjs +301 -0
- package/dist/kysely-BRzzawr2.cjs.map +1 -0
- package/dist/kysely-BYfM6Zby.mjs +288 -0
- package/dist/kysely-BYfM6Zby.mjs.map +1 -0
- package/dist/kysely-CjuvdXEV.d.mts +173 -0
- package/dist/kysely-CjuvdXEV.d.mts.map +1 -0
- package/dist/{lazyAccessors-BoJN3SMd.mjs → lazyAccessors-CFanua0O.mjs} +20 -60
- package/dist/lazyAccessors-CFanua0O.mjs.map +1 -0
- package/dist/{lazyAccessors-e3j2oE2m.cjs → lazyAccessors-hJKGv8Ay.cjs} +60 -113
- package/dist/lazyAccessors-hJKGv8Ay.cjs.map +1 -0
- package/dist/mobile-app.cjs +73 -0
- package/dist/mobile-app.cjs.map +1 -0
- package/dist/mobile-app.d.cts +61 -0
- package/dist/mobile-app.d.cts.map +1 -0
- package/dist/mobile-app.d.mts +61 -0
- package/dist/mobile-app.d.mts.map +1 -0
- package/dist/mobile-app.mjs +72 -0
- package/dist/mobile-app.mjs.map +1 -0
- package/dist/object-storage.cjs +18 -10
- package/dist/object-storage.cjs.map +1 -1
- package/dist/object-storage.d.cts +3 -7
- package/dist/object-storage.d.cts.map +1 -1
- package/dist/object-storage.d.mts +3 -7
- package/dist/object-storage.d.mts.map +1 -1
- package/dist/object-storage.mjs +11 -3
- package/dist/object-storage.mjs.map +1 -1
- package/dist/{processAudits-Dmts9H_b.mjs → processAudits-BpRlPQMW.mjs} +16 -19
- package/dist/processAudits-BpRlPQMW.mjs.map +1 -0
- package/dist/{processAudits-CGqttuXm.cjs → processAudits-D_2W5x8k.cjs} +26 -30
- package/dist/processAudits-D_2W5x8k.cjs.map +1 -0
- package/dist/queue/index.cjs +6 -189
- package/dist/queue/index.d.cts +3 -60
- package/dist/queue/index.d.mts +3 -60
- package/dist/queue/index.mjs +3 -186
- package/dist/rest-api.cjs +88 -63
- package/dist/rest-api.cjs.map +1 -1
- package/dist/rest-api.d.cts +68 -61
- package/dist/rest-api.d.cts.map +1 -1
- package/dist/rest-api.d.mts +68 -61
- package/dist/rest-api.d.mts.map +1 -1
- package/dist/rest-api.mjs +80 -55
- package/dist/rest-api.mjs.map +1 -1
- package/dist/{chunk-DWy1uDak.cjs → rolldown-runtime-y5ARvAq5.cjs} +14 -18
- package/dist/runSubscriber-BRp9a_qi.cjs +126 -0
- package/dist/runSubscriber-BRp9a_qi.cjs.map +1 -0
- package/dist/runSubscriber-BYEY_bfA.mjs +109 -0
- package/dist/runSubscriber-BYEY_bfA.mjs.map +1 -0
- package/dist/shutdown-BMJmAhSt.cjs +38 -0
- package/dist/shutdown-BMJmAhSt.cjs.map +1 -0
- package/dist/shutdown-C7xa8x9S.mjs +27 -0
- package/dist/shutdown-C7xa8x9S.mjs.map +1 -0
- package/dist/site.cjs +34 -9
- package/dist/site.cjs.map +1 -1
- package/dist/site.d.cts +17 -22
- package/dist/site.d.cts.map +1 -1
- package/dist/site.d.mts +17 -22
- package/dist/site.d.mts.map +1 -1
- package/dist/site.mjs +30 -5
- package/dist/site.mjs.map +1 -1
- package/dist/subscribers/index.cjs +111 -6
- package/dist/subscribers/index.cjs.map +1 -0
- package/dist/subscribers/index.d.cts +50 -6
- package/dist/subscribers/index.d.cts.map +1 -0
- package/dist/subscribers/index.d.mts +50 -6
- package/dist/subscribers/index.d.mts.map +1 -0
- package/dist/subscribers/index.mjs +108 -5
- package/dist/subscribers/index.mjs.map +1 -0
- package/dist/surfaceEnv-CNimK76p.cjs +56 -0
- package/dist/surfaceEnv-CNimK76p.cjs.map +1 -0
- package/dist/surfaceEnv-wMT5QzgZ.mjs +45 -0
- package/dist/surfaceEnv-wMT5QzgZ.mjs.map +1 -0
- package/dist/{telemetry-C3L0iS28.d.cts → telemetry-DGcFlVpB.d.cts} +2 -5
- package/dist/telemetry-DGcFlVpB.d.cts.map +1 -0
- package/dist/{telemetry-D7bVFLGi.d.mts → telemetry-DGcFlVpB.d.mts} +2 -5
- package/dist/telemetry-DGcFlVpB.d.mts.map +1 -0
- package/dist/topic/index.cjs +3 -137
- package/dist/topic/index.d.cts +2 -4
- package/dist/topic/index.d.mts +2 -4
- package/dist/topic/index.mjs +2 -134
- package/dist/{types-BlAkSuGI.d.cts → types-DMuSQeLL.d.cts} +3 -5
- package/dist/types-DMuSQeLL.d.cts.map +1 -0
- package/dist/{types-aKksMEWL.d.mts → types-DMuSQeLL.d.mts} +3 -5
- package/dist/types-DMuSQeLL.d.mts.map +1 -0
- package/dist/types.d.cts +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.mjs +1 -0
- package/dist/worker.cjs +58 -34
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.d.cts +63 -45
- package/dist/worker.d.cts.map +1 -1
- package/dist/worker.d.mts +63 -44
- package/dist/worker.d.mts.map +1 -1
- package/dist/worker.mjs +53 -29
- package/dist/worker.mjs.map +1 -1
- package/package.json +82 -41
- package/dist/Construct-BD5neF7w.mjs.map +0 -1
- package/dist/Construct-C0ijr2qp.d.cts +0 -117
- package/dist/Construct-C0ijr2qp.d.cts.map +0 -1
- package/dist/Construct-Ct8nalEi.d.mts +0 -117
- package/dist/Construct-Ct8nalEi.d.mts.map +0 -1
- package/dist/Construct-CyS3RpTL.cjs.map +0 -1
- package/dist/Cron-DmQ8vQ4b.d.cts.map +0 -1
- package/dist/Cron-dh4rUgib.d.mts.map +0 -1
- package/dist/CronBuilder-BquXDbDI.d.cts +0 -44
- package/dist/CronBuilder-BquXDbDI.d.cts.map +0 -1
- package/dist/CronBuilder-CGgY2080.d.mts +0 -44
- package/dist/CronBuilder-CGgY2080.d.mts.map +0 -1
- package/dist/CronBuilder-CYKT5RiO.mjs.map +0 -1
- package/dist/CronBuilder-Da0C0edR.cjs.map +0 -1
- package/dist/Endpoint-BjWKinFA.d.mts.map +0 -1
- package/dist/Endpoint-DCQPMdUX.mjs.map +0 -1
- package/dist/Endpoint-DcWXE-SZ.cjs.map +0 -1
- package/dist/Endpoint-dav89W6-.d.cts.map +0 -1
- package/dist/EndpointFactory-CdWB7wPw.cjs.map +0 -1
- package/dist/EndpointFactory-CjV8F_lJ.mjs.map +0 -1
- package/dist/HonoEndpointAdaptor-DtL9j19R.cjs.map +0 -1
- package/dist/HonoEndpointAdaptor-P1ahhZHu.mjs.map +0 -1
- package/dist/Queue-D7ZuwBhy.d.cts.map +0 -1
- package/dist/Queue-gVGfi2Yk.d.mts.map +0 -1
- package/dist/Subscriber-2mEi0ImH.d.cts.map +0 -1
- package/dist/Subscriber-xTJ9ayPN.d.mts.map +0 -1
- package/dist/SubscriberBuilder-4OPehf2R.cjs.map +0 -1
- package/dist/SubscriberBuilder-BjkbeT9l.mjs.map +0 -1
- package/dist/SubscriberBuilder-Dptmo-1A.d.mts +0 -62
- package/dist/SubscriberBuilder-Dptmo-1A.d.mts.map +0 -1
- package/dist/SubscriberBuilder-waNhzjSM.d.cts +0 -62
- package/dist/SubscriberBuilder-waNhzjSM.d.cts.map +0 -1
- package/dist/Topic-19QeHBIR.d.cts +0 -91
- package/dist/Topic-19QeHBIR.d.cts.map +0 -1
- package/dist/Topic-DuFeqkBh.d.mts +0 -91
- package/dist/Topic-DuFeqkBh.d.mts.map +0 -1
- package/dist/auth.d.cts.map +0 -1
- package/dist/auth.d.mts.map +0 -1
- package/dist/cache-0ANvRQnD.mjs +0 -51
- package/dist/cache-0ANvRQnD.mjs.map +0 -1
- package/dist/cache-3WSvAulx.cjs +0 -57
- package/dist/cache-3WSvAulx.cjs.map +0 -1
- package/dist/cache-BrRz3fEB.d.mts.map +0 -1
- package/dist/cache-BtZY_tHe.d.cts.map +0 -1
- package/dist/clone-DblgEZZa.mjs.map +0 -1
- package/dist/clone-Dy0cR2SZ.cjs.map +0 -1
- package/dist/construct-interface-BfjcOD_E.cjs +0 -117
- package/dist/construct-interface-BfjcOD_E.cjs.map +0 -1
- package/dist/construct-interface-D9d4Gm4p.d.cts.map +0 -1
- package/dist/construct-interface-Z4CpS8tK.mjs +0 -81
- package/dist/construct-interface-Z4CpS8tK.mjs.map +0 -1
- package/dist/construct-interface-g5GM5pwR.d.mts.map +0 -1
- package/dist/database/kysely.cjs.map +0 -1
- package/dist/database/kysely.d.cts.map +0 -1
- package/dist/database/kysely.d.mts.map +0 -1
- package/dist/database/kysely.mjs.map +0 -1
- package/dist/functions-i_la-N5r.cjs.map +0 -1
- package/dist/index-Bd5FqCoe.d.cts.map +0 -1
- package/dist/index-BknhM6Ux.d.mts +0 -31
- package/dist/index-BknhM6Ux.d.mts.map +0 -1
- package/dist/index-CBSfrowv.d.cts +0 -31
- package/dist/index-CBSfrowv.d.cts.map +0 -1
- package/dist/index-D24Xm79M.d.cts +0 -171
- package/dist/index-D24Xm79M.d.cts.map +0 -1
- package/dist/index-_ajboYxK.d.mts +0 -171
- package/dist/index-_ajboYxK.d.mts.map +0 -1
- package/dist/index-lAO9egTb.d.mts.map +0 -1
- package/dist/lazyAccessors-BoJN3SMd.mjs.map +0 -1
- package/dist/lazyAccessors-e3j2oE2m.cjs.map +0 -1
- package/dist/processAudits-CGqttuXm.cjs.map +0 -1
- package/dist/processAudits-Dmts9H_b.mjs.map +0 -1
- package/dist/queue/index.cjs.map +0 -1
- package/dist/queue/index.d.cts.map +0 -1
- package/dist/queue/index.d.mts.map +0 -1
- package/dist/queue/index.mjs.map +0 -1
- package/dist/surfaceEnv-BFXEms2f.cjs +0 -39
- package/dist/surfaceEnv-BFXEms2f.cjs.map +0 -1
- package/dist/surfaceEnv-C3Ktahea.mjs +0 -27
- package/dist/surfaceEnv-C3Ktahea.mjs.map +0 -1
- package/dist/telemetry-C3L0iS28.d.cts.map +0 -1
- package/dist/telemetry-D7bVFLGi.d.mts.map +0 -1
- package/dist/topic/index.cjs.map +0 -1
- package/dist/topic/index.mjs.map +0 -1
- package/dist/types-BlAkSuGI.d.cts.map +0 -1
- package/dist/types-aKksMEWL.d.mts.map +0 -1
package/dist/adaptors/aws.cjs
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
require(
|
|
3
|
-
require(
|
|
4
|
-
const
|
|
5
|
-
require(
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_rolldown_runtime = require("../rolldown-runtime-y5ARvAq5.cjs");
|
|
3
|
+
const require_functions = require("../functions-CbP5ZKma.cjs");
|
|
4
|
+
const require_Endpoint = require("../Endpoint-DfiXTm_v.cjs");
|
|
5
|
+
const require_surfaceEnv = require("../surfaceEnv-CNimK76p.cjs");
|
|
6
|
+
const require_lazyAccessors = require("../lazyAccessors-hJKGv8Ay.cjs");
|
|
7
|
+
const require_runSubscriber = require("../runSubscriber-BRp9a_qi.cjs");
|
|
8
|
+
const require_processAudits = require("../processAudits-D_2W5x8k.cjs");
|
|
9
|
+
let _geekmidas_errors = require("@geekmidas/errors");
|
|
10
|
+
let _geekmidas_services = require("@geekmidas/services");
|
|
11
|
+
let _geekmidas_db_rls = require("@geekmidas/db/rls");
|
|
12
|
+
let qs = require("qs");
|
|
13
|
+
qs = require_rolldown_runtime.__toESM(qs, 1);
|
|
14
|
+
let _geekmidas_audit = require("@geekmidas/audit");
|
|
15
|
+
let _middy_core = require("@middy/core");
|
|
16
|
+
_middy_core = require_rolldown_runtime.__toESM(_middy_core, 1);
|
|
17
|
+
let _geekmidas_audit_kysely = require("@geekmidas/audit/kysely");
|
|
18
18
|
//#region src/functions/FunctionExecutionWrapper.ts
|
|
19
19
|
var FunctionExecutionWrapper = class {
|
|
20
|
+
envParser;
|
|
21
|
+
fn;
|
|
20
22
|
constructor(envParser, fn) {
|
|
21
23
|
this.envParser = envParser;
|
|
22
24
|
this.fn = fn;
|
|
@@ -26,25 +28,22 @@ var FunctionExecutionWrapper = class {
|
|
|
26
28
|
return this._logger || this.fn.logger;
|
|
27
29
|
}
|
|
28
30
|
get serviceDiscovery() {
|
|
29
|
-
|
|
30
|
-
return serviceDiscovery;
|
|
31
|
+
return _geekmidas_services.ServiceDiscovery.getInstance(this.envParser);
|
|
31
32
|
}
|
|
32
33
|
getServices() {
|
|
33
34
|
return this.serviceDiscovery.register(this.fn.services);
|
|
34
35
|
}
|
|
35
36
|
async getDatabase() {
|
|
36
|
-
if (!this.fn.databaseService) return
|
|
37
|
-
|
|
38
|
-
return services[this.fn.databaseService.serviceName];
|
|
37
|
+
if (!this.fn.databaseService) return;
|
|
38
|
+
return (await this.serviceDiscovery.register([this.fn.databaseService]))[this.fn.databaseService.serviceName];
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Get the audit storage service if configured.
|
|
42
42
|
* Returns undefined if no auditor storage is configured.
|
|
43
43
|
*/
|
|
44
44
|
async getAuditStorage() {
|
|
45
|
-
if (!this.fn.auditorStorageService) return
|
|
46
|
-
|
|
47
|
-
return services[this.fn.auditorStorageService.serviceName];
|
|
45
|
+
if (!this.fn.auditorStorageService) return;
|
|
46
|
+
return (await this.serviceDiscovery.register([this.fn.auditorStorageService]))[this.fn.auditorStorageService.serviceName];
|
|
48
47
|
}
|
|
49
48
|
/**
|
|
50
49
|
* Create an auditor instance for the function.
|
|
@@ -52,8 +51,8 @@ var FunctionExecutionWrapper = class {
|
|
|
52
51
|
*/
|
|
53
52
|
async createAuditor() {
|
|
54
53
|
const storage = await this.getAuditStorage();
|
|
55
|
-
if (!storage) return
|
|
56
|
-
return new
|
|
54
|
+
if (!storage) return;
|
|
55
|
+
return new _geekmidas_audit.DefaultAuditor({
|
|
57
56
|
actor: {
|
|
58
57
|
id: "system",
|
|
59
58
|
type: "system"
|
|
@@ -73,52 +72,45 @@ var FunctionExecutionWrapper = class {
|
|
|
73
72
|
async executeWithAudit(handler) {
|
|
74
73
|
const auditor = await this.createAuditor();
|
|
75
74
|
const storage = await this.getAuditStorage();
|
|
76
|
-
if (!auditor || !storage) {
|
|
77
|
-
const db$1 = await this.getDatabase();
|
|
78
|
-
return handler({ db: db$1 });
|
|
79
|
-
}
|
|
75
|
+
if (!auditor || !storage) return handler({ db: await this.getDatabase() });
|
|
80
76
|
const storageDb = storage.getDatabase?.();
|
|
81
77
|
const databaseServiceName = this.fn.databaseService?.serviceName;
|
|
82
78
|
const auditDbServiceName = this.fn.auditorStorageService?.serviceName;
|
|
83
|
-
if (storageDb && databaseServiceName && auditDbServiceName) return (0,
|
|
84
|
-
|
|
79
|
+
if (storageDb && databaseServiceName && auditDbServiceName) return (0, _geekmidas_audit_kysely.withAuditableTransaction)(storageDb, auditor, async (trx) => {
|
|
80
|
+
return await handler({
|
|
85
81
|
auditor,
|
|
86
82
|
db: trx
|
|
87
83
|
});
|
|
88
|
-
return response$1;
|
|
89
84
|
});
|
|
90
|
-
const db = await this.getDatabase();
|
|
91
85
|
const response = await handler({
|
|
92
86
|
auditor,
|
|
93
|
-
db
|
|
87
|
+
db: await this.getDatabase()
|
|
94
88
|
});
|
|
95
89
|
await auditor.flush();
|
|
96
90
|
return response;
|
|
97
91
|
}
|
|
98
92
|
async getFunctionInput(event) {
|
|
99
|
-
|
|
100
|
-
return parsedInput;
|
|
93
|
+
return await require_functions.FunctionBuilder.parseComposableStandardSchema(event, this.fn.input);
|
|
101
94
|
}
|
|
102
95
|
async publishEvents(response) {
|
|
103
|
-
await
|
|
96
|
+
await require_functions.publishEvents(this.logger, this.serviceDiscovery, this.fn.events, response);
|
|
104
97
|
}
|
|
105
98
|
async parseComposableStandardSchema(data, schema) {
|
|
106
99
|
return require_functions.FunctionBuilder.parseComposableStandardSchema(data, schema);
|
|
107
100
|
}
|
|
108
101
|
};
|
|
109
|
-
|
|
110
102
|
//#endregion
|
|
111
103
|
//#region src/functions/AWSLambdaFunction.ts
|
|
112
104
|
var AWSLambdaFunction = class extends FunctionExecutionWrapper {
|
|
105
|
+
fn;
|
|
113
106
|
constructor(envParser, fn) {
|
|
114
107
|
super(envParser, fn);
|
|
115
108
|
this.fn = fn;
|
|
116
109
|
}
|
|
117
110
|
error() {
|
|
118
111
|
return { onError: (req) => {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
throw (0, __geekmidas_errors.wrapError)(req.error);
|
|
112
|
+
(req.event?.logger || this.fn.logger).error(req.error || {}, "Error processing function");
|
|
113
|
+
throw (0, _geekmidas_errors.wrapError)(req.error);
|
|
122
114
|
} };
|
|
123
115
|
}
|
|
124
116
|
baseInput() {
|
|
@@ -193,26 +185,25 @@ var AWSLambdaFunction = class extends FunctionExecutionWrapper {
|
|
|
193
185
|
db: event.db,
|
|
194
186
|
auditor: event.auditor
|
|
195
187
|
});
|
|
196
|
-
|
|
197
|
-
return output;
|
|
188
|
+
return await this.fn.parseOutput(result);
|
|
198
189
|
}
|
|
199
190
|
get handler() {
|
|
200
191
|
const handler = this._handler.bind(this);
|
|
201
|
-
const chain = (0,
|
|
192
|
+
const chain = (0, _middy_core.default)(handler).use(this.loggerMiddleware()).use(this.baseInput()).use(this.error()).use(this.services()).use(this.database()).use(this.auditor()).use(this.input()).use(this.events());
|
|
202
193
|
const wrappedHandler = async (event, context) => {
|
|
203
194
|
const startTime = Date.now();
|
|
204
195
|
const requestId = context.awsRequestId;
|
|
205
196
|
const logger = this.fn.logger.child({ requestId });
|
|
206
|
-
return (0,
|
|
197
|
+
return (0, _geekmidas_services.runWithRequestContext)({
|
|
207
198
|
logger,
|
|
208
199
|
requestId,
|
|
209
|
-
startTime
|
|
200
|
+
startTime,
|
|
201
|
+
operation: context.functionName
|
|
210
202
|
}, () => chain(event, context));
|
|
211
203
|
};
|
|
212
204
|
return wrappedHandler;
|
|
213
205
|
}
|
|
214
206
|
};
|
|
215
|
-
|
|
216
207
|
//#endregion
|
|
217
208
|
//#region src/crons/AWSScheduledFunction.ts
|
|
218
209
|
/**
|
|
@@ -246,11 +237,11 @@ var AWSScheduledFunction = class extends AWSLambdaFunction {
|
|
|
246
237
|
super(envParser, cron);
|
|
247
238
|
}
|
|
248
239
|
};
|
|
249
|
-
|
|
250
240
|
//#endregion
|
|
251
241
|
//#region src/endpoints/AmazonApiGatewayEndpointAdaptor.ts
|
|
252
|
-
var
|
|
242
|
+
var import_lodash_set = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_Endpoint.require_lodash_set(), 1);
|
|
253
243
|
var AmazonApiGatewayEndpoint = class {
|
|
244
|
+
endpoint;
|
|
254
245
|
options;
|
|
255
246
|
/**
|
|
256
247
|
* The parser this adaptor discovers services with.
|
|
@@ -270,7 +261,7 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
270
261
|
error() {
|
|
271
262
|
return { onError: (req) => {
|
|
272
263
|
(req.event.logger || this.endpoint.logger).error(req.error || {}, "Error processing request");
|
|
273
|
-
const wrappedError = (0,
|
|
264
|
+
const wrappedError = (0, _geekmidas_errors.wrapError)(req.error);
|
|
274
265
|
req.response = {
|
|
275
266
|
statusCode: wrappedError.statusCode,
|
|
276
267
|
body: wrappedError.body
|
|
@@ -288,8 +279,7 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
288
279
|
static decodeBody(body, isBase64Encoded, contentType) {
|
|
289
280
|
if (!body) return void 0;
|
|
290
281
|
const raw = isBase64Encoded ? Buffer.from(body, "base64").toString("utf-8") : body;
|
|
291
|
-
|
|
292
|
-
if (isJson) return JSON.parse(raw);
|
|
282
|
+
if (!contentType || contentType.toLowerCase().includes("application/json")) return JSON.parse(raw);
|
|
293
283
|
return raw;
|
|
294
284
|
}
|
|
295
285
|
getCookies(e) {
|
|
@@ -303,13 +293,13 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
303
293
|
const headers = req.event.headers;
|
|
304
294
|
const header = require_Endpoint.Endpoint.createHeaders(headers);
|
|
305
295
|
const cookie = this.getCookies(req.event);
|
|
306
|
-
(0,
|
|
307
|
-
(0,
|
|
308
|
-
(0,
|
|
309
|
-
(0,
|
|
310
|
-
(0,
|
|
296
|
+
(0, import_lodash_set.default)(req.event, "body", await this.endpoint.parseInput(body, "body"));
|
|
297
|
+
(0, import_lodash_set.default)(req.event, "query", await this.endpoint.parseInput(query, "query"));
|
|
298
|
+
(0, import_lodash_set.default)(req.event, "params", await this.endpoint.parseInput(params, "params"));
|
|
299
|
+
(0, import_lodash_set.default)(req.event, "header", header);
|
|
300
|
+
(0, import_lodash_set.default)(req.event, "cookie", cookie);
|
|
311
301
|
} catch (error) {
|
|
312
|
-
if (error && typeof error === "object" && Array.isArray(error)) throw new
|
|
302
|
+
if (error && typeof error === "object" && Array.isArray(error)) throw new _geekmidas_errors.UnprocessableEntityError("Validation failed", error);
|
|
313
303
|
throw error;
|
|
314
304
|
}
|
|
315
305
|
} };
|
|
@@ -326,9 +316,8 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
326
316
|
}
|
|
327
317
|
services() {
|
|
328
318
|
return { before: async (req) => {
|
|
329
|
-
|
|
330
|
-
const
|
|
331
|
-
const services = await serviceDiscovery.register(this.endpoint.services);
|
|
319
|
+
req.event.logger;
|
|
320
|
+
const services = await _geekmidas_services.ServiceDiscovery.getInstance(this.envParser).register(this.endpoint.services);
|
|
332
321
|
req.event.services = services;
|
|
333
322
|
} };
|
|
334
323
|
}
|
|
@@ -339,7 +328,7 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
339
328
|
const header = req.event.header;
|
|
340
329
|
const cookie = req.event.cookie;
|
|
341
330
|
const session = req.event.session;
|
|
342
|
-
|
|
331
|
+
if (!await this.endpoint.authorize({
|
|
343
332
|
header,
|
|
344
333
|
cookie,
|
|
345
334
|
services,
|
|
@@ -349,19 +338,17 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
349
338
|
body: req.event.body,
|
|
350
339
|
query: req.event.query,
|
|
351
340
|
params: req.event.params
|
|
352
|
-
})
|
|
353
|
-
if (!isAuthorized) {
|
|
341
|
+
})) {
|
|
354
342
|
logger.warn("Forbidden access attempt");
|
|
355
|
-
throw new
|
|
343
|
+
throw new _geekmidas_errors.ForbiddenError("Forbidden access to the endpoint", "You do not have permission to access this resource.");
|
|
356
344
|
}
|
|
357
345
|
} };
|
|
358
346
|
}
|
|
359
347
|
database() {
|
|
360
348
|
return { before: async (req) => {
|
|
361
349
|
if (!this.endpoint.databaseService) return;
|
|
362
|
-
|
|
363
|
-
const
|
|
364
|
-
const db = await serviceDiscovery.register([this.endpoint.databaseService]).then((s) => s[this.endpoint.databaseService?.serviceName]);
|
|
350
|
+
req.event.logger;
|
|
351
|
+
const db = await _geekmidas_services.ServiceDiscovery.getInstance(this.envParser).register([this.endpoint.databaseService]).then((s) => s[this.endpoint.databaseService?.serviceName]);
|
|
365
352
|
req.event.db = db;
|
|
366
353
|
} };
|
|
367
354
|
}
|
|
@@ -386,15 +373,15 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
386
373
|
const statusCode = req.response?.statusCode ?? this.endpoint.status;
|
|
387
374
|
if (require_Endpoint.Endpoint.isSuccessStatus(statusCode)) {
|
|
388
375
|
const logger = event.logger;
|
|
389
|
-
const serviceDiscovery =
|
|
390
|
-
await
|
|
376
|
+
const serviceDiscovery = _geekmidas_services.ServiceDiscovery.getInstance(this.envParser);
|
|
377
|
+
await require_functions.publishConstructEvents(this.endpoint, response, serviceDiscovery, logger);
|
|
391
378
|
}
|
|
392
379
|
} };
|
|
393
380
|
}
|
|
394
381
|
async _handler(event) {
|
|
395
382
|
const input = this.endpoint.refineInput(event);
|
|
396
383
|
const logger = event.logger;
|
|
397
|
-
const serviceDiscovery =
|
|
384
|
+
const serviceDiscovery = _geekmidas_services.ServiceDiscovery.getInstance(this.envParser);
|
|
398
385
|
const auditContext = await require_processAudits.createAuditContext(this.endpoint, serviceDiscovery, logger, {
|
|
399
386
|
session: event.session,
|
|
400
387
|
header: event.header,
|
|
@@ -412,9 +399,8 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
412
399
|
cookie: event.cookie,
|
|
413
400
|
logger
|
|
414
401
|
}) : void 0;
|
|
415
|
-
const
|
|
416
|
-
const
|
|
417
|
-
const baseDb = sameDatabase ? auditor?.getTransaction?.() ?? rawDb : rawDb;
|
|
402
|
+
const { output, metadata } = await require_processAudits.executeWithAuditTransaction(auditContext, async (auditor) => {
|
|
403
|
+
const baseDb = auditContext?.storage?.databaseServiceName && auditContext.storage.databaseServiceName === this.endpoint.databaseService?.serviceName ? auditor?.getTransaction?.() ?? rawDb : rawDb;
|
|
418
404
|
const executeHandler = async (db) => {
|
|
419
405
|
const responseBuilder = new require_Endpoint.ResponseBuilder();
|
|
420
406
|
const response = await this.endpoint.handler({
|
|
@@ -428,33 +414,31 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
428
414
|
...input
|
|
429
415
|
}, responseBuilder);
|
|
430
416
|
let data = response;
|
|
431
|
-
let metadata
|
|
417
|
+
let metadata = responseBuilder.getMetadata();
|
|
432
418
|
if (require_Endpoint.Endpoint.hasMetadata(response)) {
|
|
433
419
|
data = response.data;
|
|
434
|
-
metadata
|
|
420
|
+
metadata = response.metadata;
|
|
435
421
|
}
|
|
436
|
-
const output$1 = this.endpoint.outputSchema ? await this.endpoint.parseOutput(data) : void 0;
|
|
437
422
|
return {
|
|
438
|
-
output:
|
|
439
|
-
metadata
|
|
423
|
+
output: this.endpoint.outputSchema ? await this.endpoint.parseOutput(data) : void 0,
|
|
424
|
+
metadata,
|
|
440
425
|
responseBuilder
|
|
441
426
|
};
|
|
442
427
|
};
|
|
443
|
-
if (rlsActive && rlsContext && baseDb) return (0,
|
|
428
|
+
if (rlsActive && rlsContext && baseDb) return (0, _geekmidas_db_rls.withRlsContext)(baseDb, rlsContext, async (trx) => executeHandler(trx), { prefix: this.endpoint.rlsConfig?.prefix });
|
|
444
429
|
return executeHandler(baseDb);
|
|
445
|
-
}, async (result
|
|
430
|
+
}, async (result, auditor) => {
|
|
446
431
|
if (!audits?.length) return;
|
|
447
432
|
for (const audit of audits) {
|
|
448
|
-
if (audit.when && !audit.when(result
|
|
449
|
-
const payload = audit.payload(result
|
|
450
|
-
const entityId = audit.entityId?.(result
|
|
433
|
+
if (audit.when && !audit.when(result.output)) continue;
|
|
434
|
+
const payload = audit.payload(result.output);
|
|
435
|
+
const entityId = audit.entityId?.(result.output);
|
|
451
436
|
auditor.audit(audit.type, payload, {
|
|
452
437
|
table: audit.table,
|
|
453
438
|
entityId
|
|
454
439
|
});
|
|
455
440
|
}
|
|
456
441
|
}, { db: rawDb });
|
|
457
|
-
const { output, metadata } = result;
|
|
458
442
|
const isJsonResponse = this.endpoint.responseType === "application/json";
|
|
459
443
|
const body = output === void 0 ? void 0 : isJsonResponse ? JSON.stringify(output) : typeof output === "string" ? output : String(output);
|
|
460
444
|
event.__response = output;
|
|
@@ -505,7 +489,7 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
505
489
|
}
|
|
506
490
|
get handler() {
|
|
507
491
|
const handler = this._handler.bind(this);
|
|
508
|
-
let chain = (0,
|
|
492
|
+
let chain = (0, _middy_core.default)(handler).use(this.logger()).use(this.error()).use(this.services()).use(this.input()).use(this.database()).use(this.session()).use(this.authorize()).use(this.events());
|
|
509
493
|
const telemetryMiddleware = this.telemetry();
|
|
510
494
|
if (telemetryMiddleware) chain = chain.use(telemetryMiddleware);
|
|
511
495
|
if (this.options.telescope?.middleware) chain = chain.use(this.options.telescope.middleware);
|
|
@@ -513,16 +497,17 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
513
497
|
const startTime = Date.now();
|
|
514
498
|
const requestId = context.awsRequestId;
|
|
515
499
|
const logger = this.endpoint.logger.child({ requestId });
|
|
516
|
-
|
|
500
|
+
const operation = `${this.endpoint.method} ${this.endpoint.route}`;
|
|
501
|
+
return (0, _geekmidas_services.runWithRequestContext)({
|
|
517
502
|
logger,
|
|
518
503
|
requestId,
|
|
519
|
-
startTime
|
|
504
|
+
startTime,
|
|
505
|
+
operation
|
|
520
506
|
}, () => chain(event, context));
|
|
521
507
|
};
|
|
522
508
|
return wrappedHandler;
|
|
523
509
|
}
|
|
524
510
|
};
|
|
525
|
-
|
|
526
511
|
//#endregion
|
|
527
512
|
//#region src/endpoints/parseQueryParams.ts
|
|
528
513
|
/**
|
|
@@ -543,10 +528,10 @@ function parseQueryParams(queryParams) {
|
|
|
543
528
|
}
|
|
544
529
|
return qs.default.parse(parts.join("&"));
|
|
545
530
|
}
|
|
546
|
-
|
|
547
531
|
//#endregion
|
|
548
532
|
//#region src/endpoints/AmazonApiGatewayV1EndpointAdaptor.ts
|
|
549
533
|
var AmazonApiGatewayV1Endpoint = class extends AmazonApiGatewayEndpoint {
|
|
534
|
+
endpoint;
|
|
550
535
|
getInput(e) {
|
|
551
536
|
const multiValueParams = e.multiValueQueryStringParameters || {};
|
|
552
537
|
const singleValueParams = e.queryStringParameters || {};
|
|
@@ -579,17 +564,16 @@ var AmazonApiGatewayV1Endpoint = class extends AmazonApiGatewayEndpoint {
|
|
|
579
564
|
this.endpoint = endpoint;
|
|
580
565
|
}
|
|
581
566
|
};
|
|
582
|
-
|
|
583
567
|
//#endregion
|
|
584
568
|
//#region src/endpoints/AmazonApiGatewayV2EndpointAdaptor.ts
|
|
585
569
|
var AmazonApiGatewayV2Endpoint = class extends AmazonApiGatewayEndpoint {
|
|
570
|
+
endpoint;
|
|
586
571
|
getCookies(e) {
|
|
587
572
|
return require_lazyAccessors.createApiGatewayCookies(e.cookies, e.headers?.cookie);
|
|
588
573
|
}
|
|
589
574
|
getInput(e) {
|
|
590
|
-
const raw = AmazonApiGatewayEndpoint.decodeBody(e.body, e.isBase64Encoded, e.headers?.["content-type"]);
|
|
591
575
|
return {
|
|
592
|
-
body:
|
|
576
|
+
body: AmazonApiGatewayEndpoint.decodeBody(e.body, e.isBase64Encoded, e.headers?.["content-type"]),
|
|
593
577
|
query: qs.default.parse(e.rawQueryString),
|
|
594
578
|
params: e.pathParameters || {}
|
|
595
579
|
};
|
|
@@ -614,7 +598,6 @@ var AmazonApiGatewayV2Endpoint = class extends AmazonApiGatewayEndpoint {
|
|
|
614
598
|
this.endpoint = endpoint;
|
|
615
599
|
}
|
|
616
600
|
};
|
|
617
|
-
|
|
618
601
|
//#endregion
|
|
619
602
|
//#region src/queue/AWSLambdaQueueAdaptor.ts
|
|
620
603
|
/**
|
|
@@ -629,6 +612,8 @@ var AmazonApiGatewayV2Endpoint = class extends AmazonApiGatewayEndpoint {
|
|
|
629
612
|
* retries only those records.
|
|
630
613
|
*/
|
|
631
614
|
var AWSLambdaQueue = class {
|
|
615
|
+
envParser;
|
|
616
|
+
queue;
|
|
632
617
|
_services;
|
|
633
618
|
constructor(envParser, queue) {
|
|
634
619
|
this.envParser = envParser;
|
|
@@ -639,10 +624,16 @@ var AWSLambdaQueue = class {
|
|
|
639
624
|
}
|
|
640
625
|
async getServices() {
|
|
641
626
|
if (this._services) return this._services;
|
|
642
|
-
const serviceDiscovery =
|
|
627
|
+
const serviceDiscovery = _geekmidas_services.ServiceDiscovery.getInstance(this.envParser);
|
|
643
628
|
this._services = this.queue.services.length > 0 ? await serviceDiscovery.register(this.queue.services) : {};
|
|
644
629
|
return this._services;
|
|
645
630
|
}
|
|
631
|
+
/** The queue's database, registered as functions register theirs. */
|
|
632
|
+
async getDatabase() {
|
|
633
|
+
const service = this.queue.databaseService;
|
|
634
|
+
if (!service) return void 0;
|
|
635
|
+
return (await _geekmidas_services.ServiceDiscovery.getInstance(this.envParser).register([service]))[service.serviceName];
|
|
636
|
+
}
|
|
646
637
|
safeJsonParse(value) {
|
|
647
638
|
try {
|
|
648
639
|
return JSON.parse(value);
|
|
@@ -668,6 +659,7 @@ var AWSLambdaQueue = class {
|
|
|
668
659
|
req: { id: context.awsRequestId }
|
|
669
660
|
});
|
|
670
661
|
const services = await this.getServices();
|
|
662
|
+
const db = await this.getDatabase();
|
|
671
663
|
const schema = this.queue.messageSchema;
|
|
672
664
|
const batchItemFailures = [];
|
|
673
665
|
const messages = [];
|
|
@@ -695,34 +687,36 @@ var AWSLambdaQueue = class {
|
|
|
695
687
|
await this.queue.handler({
|
|
696
688
|
messages,
|
|
697
689
|
services,
|
|
698
|
-
logger
|
|
690
|
+
logger,
|
|
691
|
+
db
|
|
699
692
|
});
|
|
700
693
|
} catch (error) {
|
|
701
|
-
logger.error((0,
|
|
694
|
+
logger.error((0, _geekmidas_errors.wrapError)(error), "Queue handler failed; retrying batch");
|
|
702
695
|
for (const record of event.Records) if (!batchItemFailures.some((f) => f.itemIdentifier === record.messageId)) batchItemFailures.push({ itemIdentifier: record.messageId });
|
|
703
696
|
}
|
|
704
697
|
return { batchItemFailures };
|
|
705
698
|
}
|
|
706
699
|
get handler() {
|
|
707
700
|
const handler = this._handler.bind(this);
|
|
708
|
-
return async (event, context) => {
|
|
701
|
+
return (async (event, context) => {
|
|
709
702
|
const startTime = Date.now();
|
|
710
703
|
const requestId = context.awsRequestId;
|
|
711
704
|
const logger = this.queue.logger.child({ requestId });
|
|
712
|
-
return (0,
|
|
705
|
+
return (0, _geekmidas_services.runWithRequestContext)({
|
|
713
706
|
logger,
|
|
714
707
|
requestId,
|
|
715
|
-
startTime
|
|
708
|
+
startTime,
|
|
709
|
+
operation: `queue ${this.queue.name}`
|
|
716
710
|
}, () => handler(event, context));
|
|
717
|
-
};
|
|
711
|
+
});
|
|
718
712
|
}
|
|
719
713
|
};
|
|
720
|
-
|
|
721
714
|
//#endregion
|
|
722
715
|
//#region src/subscribers/AWSLambdaSubscriberAdaptor.ts
|
|
723
716
|
var AWSLambdaSubscriber = class {
|
|
717
|
+
envParser;
|
|
718
|
+
subscriber;
|
|
724
719
|
_logger;
|
|
725
|
-
_services;
|
|
726
720
|
constructor(envParser, subscriber) {
|
|
727
721
|
this.envParser = envParser;
|
|
728
722
|
this.subscriber = subscriber;
|
|
@@ -731,20 +725,10 @@ var AWSLambdaSubscriber = class {
|
|
|
731
725
|
get logger() {
|
|
732
726
|
return this._logger;
|
|
733
727
|
}
|
|
734
|
-
async getServices() {
|
|
735
|
-
if (this._services) return this._services;
|
|
736
|
-
const serviceDiscovery = __geekmidas_services.ServiceDiscovery.getInstance(this.envParser);
|
|
737
|
-
if (this.subscriber.services.length > 0) {
|
|
738
|
-
const registered = await serviceDiscovery.register(this.subscriber.services);
|
|
739
|
-
this._services = registered;
|
|
740
|
-
} else this._services = {};
|
|
741
|
-
return this._services;
|
|
742
|
-
}
|
|
743
728
|
error() {
|
|
744
729
|
return { onError: (req) => {
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
throw (0, __geekmidas_errors.wrapError)(req.error);
|
|
730
|
+
(req.event?.logger || this.subscriber.logger).error(req.error || {}, "Error processing subscriber");
|
|
731
|
+
throw (0, _geekmidas_errors.wrapError)(req.error);
|
|
748
732
|
} };
|
|
749
733
|
}
|
|
750
734
|
loggerMiddleware() {
|
|
@@ -762,128 +746,45 @@ var AWSLambdaSubscriber = class {
|
|
|
762
746
|
}
|
|
763
747
|
services() {
|
|
764
748
|
return { before: async (req) => {
|
|
765
|
-
|
|
749
|
+
const { services, db } = await require_runSubscriber.subscriberContext(this.subscriber, this.envParser);
|
|
750
|
+
req.event.services = services;
|
|
751
|
+
req.event.db = db;
|
|
766
752
|
} };
|
|
767
753
|
}
|
|
768
754
|
parseEvents() {
|
|
769
755
|
return { before: async (req) => {
|
|
770
|
-
const { logger
|
|
771
|
-
const rawEvent = e;
|
|
756
|
+
const { logger, ...rawEvent } = req.event;
|
|
772
757
|
logger.info({ rawEvent });
|
|
773
|
-
|
|
774
|
-
if ("Records" in rawEvent) {
|
|
775
|
-
if (this.isSQSEvent(rawEvent)) for (const record of rawEvent.Records) try {
|
|
776
|
-
const event = this.parseSQSRecord(record);
|
|
777
|
-
if (this.shouldIncludeEvent(event)) events.push(event);
|
|
778
|
-
} catch (error) {
|
|
779
|
-
this.logger.error({
|
|
780
|
-
error,
|
|
781
|
-
record
|
|
782
|
-
}, "Failed to parse SQS record");
|
|
783
|
-
}
|
|
784
|
-
else if (this.isSNSEvent(rawEvent)) for (const record of rawEvent.Records) try {
|
|
785
|
-
const event = this.parseSNSRecord(record);
|
|
786
|
-
if (this.shouldIncludeEvent(event)) events.push(event);
|
|
787
|
-
} catch (error) {
|
|
788
|
-
this.logger.error({
|
|
789
|
-
error,
|
|
790
|
-
record
|
|
791
|
-
}, "Failed to parse SNS record");
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
req.event.events = events;
|
|
758
|
+
req.event.events = require_runSubscriber.subscribedEvents(this.subscriber, rawEvent, this.logger);
|
|
795
759
|
} };
|
|
796
760
|
}
|
|
797
|
-
isSQSEvent(event) {
|
|
798
|
-
const firstRecord = event.Records[0];
|
|
799
|
-
return "Records" in event && event.Records.length > 0 && firstRecord !== void 0 && "eventSource" in firstRecord && firstRecord.eventSource === "aws:sqs";
|
|
800
|
-
}
|
|
801
|
-
isSNSEvent(event) {
|
|
802
|
-
const firstRecord = event.Records[0];
|
|
803
|
-
return "Records" in event && event.Records.length > 0 && firstRecord !== void 0 && "EventSource" in firstRecord && firstRecord.EventSource === "aws:sns";
|
|
804
|
-
}
|
|
805
|
-
parseSNSRecord(record) {
|
|
806
|
-
const message = this.safeJsonParse(record.Sns.Message);
|
|
807
|
-
const messageType = record.Sns.MessageAttributes?.type?.Value;
|
|
808
|
-
if (message === null) return messageType ? {
|
|
809
|
-
type: messageType,
|
|
810
|
-
payload: record.Sns.Message
|
|
811
|
-
} : record.Sns.Message;
|
|
812
|
-
const resolvedType = messageType ?? message.type;
|
|
813
|
-
if (message.type) return message;
|
|
814
|
-
return resolvedType ? {
|
|
815
|
-
type: resolvedType,
|
|
816
|
-
payload: message
|
|
817
|
-
} : message;
|
|
818
|
-
}
|
|
819
|
-
parseSQSRecord(record) {
|
|
820
|
-
const body = this.safeJsonParse(record.body);
|
|
821
|
-
if (body === null) return record.body;
|
|
822
|
-
if (body.Type === "Notification" && body.Message) {
|
|
823
|
-
const snsMessage = this.safeJsonParse(body.Message);
|
|
824
|
-
const messageType = body.MessageAttributes?.type?.Value;
|
|
825
|
-
if (snsMessage === null) return messageType ? {
|
|
826
|
-
type: messageType,
|
|
827
|
-
payload: body.Message
|
|
828
|
-
} : body.Message;
|
|
829
|
-
if (snsMessage.type) return snsMessage;
|
|
830
|
-
const resolvedType = messageType ?? snsMessage.type;
|
|
831
|
-
return resolvedType ? {
|
|
832
|
-
type: resolvedType,
|
|
833
|
-
payload: snsMessage
|
|
834
|
-
} : snsMessage;
|
|
835
|
-
}
|
|
836
|
-
return body;
|
|
837
|
-
}
|
|
838
|
-
safeJsonParse(value) {
|
|
839
|
-
try {
|
|
840
|
-
return JSON.parse(value);
|
|
841
|
-
} catch {
|
|
842
|
-
return null;
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
shouldIncludeEvent(event) {
|
|
846
|
-
if (typeof event !== "object" || !event?.type) return true;
|
|
847
|
-
if (!this.subscriber.subscribedEvents) return true;
|
|
848
|
-
return this.subscriber.subscribedEvents.includes(event.type);
|
|
849
|
-
}
|
|
850
761
|
async _handler(event) {
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
services: event.services,
|
|
858
|
-
logger: event.logger
|
|
762
|
+
const { events, services, logger, db } = event;
|
|
763
|
+
return require_runSubscriber.runSubscriber(this.subscriber, {
|
|
764
|
+
events,
|
|
765
|
+
services,
|
|
766
|
+
logger,
|
|
767
|
+
db
|
|
859
768
|
});
|
|
860
|
-
if (this.subscriber.outputSchema && result) {
|
|
861
|
-
const validationResult = await this.subscriber.outputSchema["~standard"].validate(result);
|
|
862
|
-
if (validationResult.issues) {
|
|
863
|
-
this.logger.error({ issues: validationResult.issues }, "Subscriber output validation failed");
|
|
864
|
-
throw new Error("Subscriber output validation failed");
|
|
865
|
-
}
|
|
866
|
-
return validationResult.value;
|
|
867
|
-
}
|
|
868
|
-
return result;
|
|
869
769
|
}
|
|
870
770
|
get handler() {
|
|
871
771
|
const handler = this._handler.bind(this);
|
|
872
|
-
const chain = (0,
|
|
772
|
+
const chain = (0, _middy_core.default)(handler).use(this.loggerMiddleware()).use(this.parseEvents()).use(this.error()).use(this.services());
|
|
873
773
|
const wrappedHandler = async (event, context) => {
|
|
874
774
|
const startTime = Date.now();
|
|
875
775
|
const requestId = context.awsRequestId;
|
|
876
776
|
const logger = this.subscriber.logger.child({ requestId });
|
|
877
|
-
|
|
777
|
+
const operation = `subscriber ${this.subscriber.topicName ?? context.functionName}`;
|
|
778
|
+
return (0, _geekmidas_services.runWithRequestContext)({
|
|
878
779
|
logger,
|
|
879
780
|
requestId,
|
|
880
|
-
startTime
|
|
781
|
+
startTime,
|
|
782
|
+
operation
|
|
881
783
|
}, () => chain(event, context));
|
|
882
784
|
};
|
|
883
785
|
return wrappedHandler;
|
|
884
786
|
}
|
|
885
787
|
};
|
|
886
|
-
|
|
887
788
|
//#endregion
|
|
888
789
|
exports.AWSLambdaFunction = AWSLambdaFunction;
|
|
889
790
|
exports.AWSLambdaQueue = AWSLambdaQueue;
|
|
@@ -891,4 +792,5 @@ exports.AWSLambdaSubscriber = AWSLambdaSubscriber;
|
|
|
891
792
|
exports.AWSScheduledFunction = AWSScheduledFunction;
|
|
892
793
|
exports.AmazonApiGatewayV1Endpoint = AmazonApiGatewayV1Endpoint;
|
|
893
794
|
exports.AmazonApiGatewayV2Endpoint = AmazonApiGatewayV2Endpoint;
|
|
795
|
+
|
|
894
796
|
//# sourceMappingURL=aws.cjs.map
|