@geekmidas/constructs 10.0.0-alpha.2 → 10.0.0-alpha.21
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 +46 -3
- package/dist/{Construct-Ct8nalEi.d.mts → Construct-DTqYvkPG.d.cts} +11 -13
- package/dist/Construct-DTqYvkPG.d.cts.map +1 -0
- package/dist/{Construct-BD5neF7w.mjs → Construct-Detz65RA.mjs} +31 -29
- package/dist/Construct-Detz65RA.mjs.map +1 -0
- package/dist/{Construct-C0ijr2qp.d.cts → Construct-pVadmURD.d.mts} +10 -12
- package/dist/Construct-pVadmURD.d.mts.map +1 -0
- package/dist/{Construct-CyS3RpTL.cjs → Construct-yG9Sw-5p.cjs} +51 -43
- package/dist/Construct-yG9Sw-5p.cjs.map +1 -0
- package/dist/{Cron-ByxdOfpE.d.mts → Cron-AYpQq725.d.mts} +13 -6
- package/dist/Cron-AYpQq725.d.mts.map +1 -0
- package/dist/{Cron-Wqh464aO.d.cts → Cron-Bdcg9OAL.d.cts} +12 -5
- package/dist/Cron-Bdcg9OAL.d.cts.map +1 -0
- package/dist/{CronBuilder-BL0AP6fs.d.mts → CronBuilder-DR21m9h2.d.cts} +7 -10
- package/dist/CronBuilder-DR21m9h2.d.cts.map +1 -0
- package/dist/{CronBuilder-BqpEzMPQ.d.cts → CronBuilder-DeBnPVIT.d.mts} +7 -10
- package/dist/CronBuilder-DeBnPVIT.d.mts.map +1 -0
- package/dist/{CronBuilder-BmABazzH.mjs → CronBuilder-vkjuo1UP.mjs} +23 -15
- package/dist/CronBuilder-vkjuo1UP.mjs.map +1 -0
- package/dist/{CronBuilder-CkXPJiGO.cjs → CronBuilder-zdTdaT-e.cjs} +33 -25
- package/dist/CronBuilder-zdTdaT-e.cjs.map +1 -0
- package/dist/{Endpoint-2Wg7T7Cq.d.mts → Endpoint-BxkRWQ8G.d.mts} +63 -84
- package/dist/Endpoint-BxkRWQ8G.d.mts.map +1 -0
- package/dist/{Endpoint-BiaaMEn_.cjs → Endpoint-CtiPUpRX.cjs} +145 -131
- package/dist/Endpoint-CtiPUpRX.cjs.map +1 -0
- package/dist/{Endpoint-VIOpSo0S.mjs → Endpoint-DCr5tlbJ.mjs} +117 -109
- package/dist/Endpoint-DCr5tlbJ.mjs.map +1 -0
- package/dist/{Endpoint-CH9Fn1AD.d.cts → Endpoint-DbYQJgb-.d.cts} +61 -82
- package/dist/Endpoint-DbYQJgb-.d.cts.map +1 -0
- package/dist/{EndpointFactory-DTTCkGEL.mjs → EndpointFactory-Bs8pu-yY.mjs} +20 -29
- package/dist/EndpointFactory-Bs8pu-yY.mjs.map +1 -0
- package/dist/{index-BxHDdy6a.d.mts → EndpointFactory-DE6nKtFZ.d.cts} +12 -92
- package/dist/EndpointFactory-DE6nKtFZ.d.cts.map +1 -0
- package/dist/{index-V2nksZIJ.d.cts → EndpointFactory-T06kTFHg.d.mts} +12 -92
- package/dist/EndpointFactory-T06kTFHg.d.mts.map +1 -0
- package/dist/{EndpointFactory-ChxLZllA.cjs → EndpointFactory-vE2C1NG1.cjs} +57 -66
- package/dist/EndpointFactory-vE2C1NG1.cjs.map +1 -0
- package/dist/{HonoEndpointAdaptor-NKQQQbBY.mjs → HonoEndpointAdaptor-Be6UdK0r.mjs} +40 -47
- package/dist/{HonoEndpointAdaptor-D233Jvpk.cjs.map → HonoEndpointAdaptor-Be6UdK0r.mjs.map} +1 -1
- package/dist/{HonoEndpointAdaptor-D233Jvpk.cjs → HonoEndpointAdaptor-C9aivwKl.cjs} +48 -52
- package/dist/HonoEndpointAdaptor-C9aivwKl.cjs.map +1 -0
- package/dist/{Queue-D7ZuwBhy.d.cts → Queue-Bhzi2WQC.d.cts} +8 -9
- package/dist/Queue-Bhzi2WQC.d.cts.map +1 -0
- package/dist/{Queue-gVGfi2Yk.d.mts → Queue-BoUA-e83.d.mts} +9 -10
- package/dist/Queue-BoUA-e83.d.mts.map +1 -0
- package/dist/{Subscriber-2mEi0ImH.d.cts → Subscriber-CIO3pwji.d.mts} +7 -8
- package/dist/Subscriber-CIO3pwji.d.mts.map +1 -0
- package/dist/{Subscriber-xTJ9ayPN.d.mts → Subscriber-DQCaiOXF.d.cts} +7 -8
- package/dist/Subscriber-DQCaiOXF.d.cts.map +1 -0
- package/dist/{SubscriberBuilder-BjkbeT9l.mjs → SubscriberBuilder-B4YRTBng.mjs} +16 -10
- package/dist/SubscriberBuilder-B4YRTBng.mjs.map +1 -0
- package/dist/{SubscriberBuilder-4OPehf2R.cjs → SubscriberBuilder-C2bCOuPT.cjs} +28 -23
- package/dist/SubscriberBuilder-C2bCOuPT.cjs.map +1 -0
- package/dist/{SubscriberBuilder-Dptmo-1A.d.mts → SubscriberBuilder-ChX5v948.d.cts} +8 -11
- package/dist/SubscriberBuilder-ChX5v948.d.cts.map +1 -0
- package/dist/{SubscriberBuilder-waNhzjSM.d.cts → SubscriberBuilder-Dbiaskfi.d.mts} +8 -11
- package/dist/SubscriberBuilder-Dbiaskfi.d.mts.map +1 -0
- package/dist/{Topic-19QeHBIR.d.cts → Topic-D6blllEn.d.cts} +5 -7
- package/dist/Topic-D6blllEn.d.cts.map +1 -0
- package/dist/{Topic-DuFeqkBh.d.mts → Topic-DVvheJ_-.d.mts} +6 -8
- package/dist/Topic-DVvheJ_-.d.mts.map +1 -0
- package/dist/adaptors/aws.cjs +87 -106
- package/dist/adaptors/aws.cjs.map +1 -1
- package/dist/adaptors/aws.d.cts +14 -27
- package/dist/adaptors/aws.d.cts.map +1 -1
- package/dist/adaptors/aws.d.mts +16 -29
- package/dist/adaptors/aws.d.mts.map +1 -1
- package/dist/adaptors/aws.mjs +60 -81
- package/dist/adaptors/aws.mjs.map +1 -1
- package/dist/adaptors/hono.cjs +3 -10
- package/dist/adaptors/hono.d.cts +5 -13
- package/dist/adaptors/hono.d.cts.map +1 -1
- package/dist/adaptors/hono.d.mts +7 -15
- package/dist/adaptors/hono.d.mts.map +1 -1
- package/dist/adaptors/hono.mjs +2 -10
- package/dist/adaptors/testing.cjs +271 -82
- package/dist/adaptors/testing.cjs.map +1 -1
- package/dist/adaptors/testing.d.cts +62 -33
- package/dist/adaptors/testing.d.cts.map +1 -1
- package/dist/adaptors/testing.d.mts +63 -34
- package/dist/adaptors/testing.d.mts.map +1 -1
- package/dist/adaptors/testing.mjs +249 -63
- package/dist/adaptors/testing.mjs.map +1 -1
- package/dist/auth-BlO8MUkR.d.cts +123 -0
- package/dist/auth-BlO8MUkR.d.cts.map +1 -0
- package/dist/auth-CHWIdcQO.d.mts +123 -0
- package/dist/auth-CHWIdcQO.d.mts.map +1 -0
- package/dist/auth.cjs +41 -16
- 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 +32 -8
- package/dist/auth.mjs.map +1 -1
- package/dist/{cache-BrRz3fEB.d.mts → cache-AgQUMma6.d.mts} +3 -6
- package/dist/cache-AgQUMma6.d.mts.map +1 -0
- package/dist/{cache-BtZY_tHe.d.cts → cache-obq0fOIM.d.cts} +3 -6
- package/dist/cache-obq0fOIM.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/{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-g5GM5pwR.d.mts → construct-interface-Clz7_BwB.d.mts} +15 -6
- package/dist/construct-interface-Clz7_BwB.d.mts.map +1 -0
- package/dist/{construct-interface-D9d4Gm4p.d.cts → construct-interface-DIaTNKax.d.cts} +15 -6
- package/dist/construct-interface-DIaTNKax.d.cts.map +1 -0
- package/dist/construct-interface.cjs +87 -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 +81 -2
- package/dist/construct-interface.mjs.map +1 -0
- package/dist/credential.cjs +43 -9
- package/dist/credential.cjs.map +1 -1
- package/dist/credential.d.cts +5 -8
- package/dist/credential.d.cts.map +1 -1
- package/dist/credential.d.mts +5 -8
- package/dist/credential.d.mts.map +1 -1
- package/dist/credential.mjs +36 -2
- package/dist/credential.mjs.map +1 -1
- package/dist/crons/index.cjs +68 -10
- package/dist/crons/index.cjs.map +1 -1
- package/dist/crons/index.d.cts +32 -14
- package/dist/crons/index.d.cts.map +1 -1
- package/dist/crons/index.d.mts +32 -14
- package/dist/crons/index.d.mts.map +1 -1
- package/dist/crons/index.mjs +66 -10
- package/dist/crons/index.mjs.map +1 -1
- package/dist/database/kysely.cjs +28 -14
- package/dist/database/kysely.cjs.map +1 -1
- package/dist/database/kysely.d.cts +2 -152
- package/dist/database/kysely.d.mts +2 -152
- package/dist/database/kysely.mjs +16 -4
- package/dist/database/kysely.mjs.map +1 -1
- 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/endpoints/index.cjs +7 -10
- package/dist/endpoints/index.d.cts +60 -7
- package/dist/endpoints/index.d.cts.map +1 -0
- package/dist/endpoints/index.d.mts +60 -7
- package/dist/endpoints/index.d.mts.map +1 -0
- package/dist/endpoints/index.mjs +5 -10
- 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 +2 -6
- package/dist/functions/index.d.cts +2 -4
- package/dist/functions/index.d.mts +2 -4
- package/dist/functions/index.mjs +2 -6
- package/dist/{functions-Bd3TPxid.cjs → functions-VnOTEp74.cjs} +309 -264
- package/dist/functions-VnOTEp74.cjs.map +1 -0
- package/dist/{functions-Cxbo-pEd.mjs → functions-faoJOUmr.mjs} +282 -234
- package/dist/functions-faoJOUmr.mjs.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-JSf9xNIJ.d.cts → index-DU3Twmwh.d.mts} +19 -24
- package/dist/index-DU3Twmwh.d.mts.map +1 -0
- package/dist/index-fnpjXiA-.d.mts +26 -0
- package/dist/index-fnpjXiA-.d.mts.map +1 -0
- package/dist/{index-CubPzHd9.d.mts → index-nBQT1tAh.d.cts} +19 -24
- package/dist/index-nBQT1tAh.d.cts.map +1 -0
- package/dist/index-tE_119SX.d.cts +26 -0
- package/dist/index-tE_119SX.d.cts.map +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +2 -3
- package/dist/kysely-CXi49zc2.d.cts +150 -0
- package/dist/kysely-CXi49zc2.d.cts.map +1 -0
- package/dist/kysely-D3-G5b0j.d.mts +150 -0
- package/dist/kysely-D3-G5b0j.d.mts.map +1 -0
- package/dist/{lazyAccessors-BoJN3SMd.mjs → lazyAccessors-BHtcqgz2.mjs} +22 -25
- package/dist/lazyAccessors-BHtcqgz2.mjs.map +1 -0
- package/dist/{lazyAccessors-e3j2oE2m.cjs → lazyAccessors-Dx9NLwJZ.cjs} +72 -76
- package/dist/lazyAccessors-Dx9NLwJZ.cjs.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 +25 -21
- package/dist/queue/index.cjs.map +1 -1
- package/dist/queue/index.d.cts +8 -15
- package/dist/queue/index.d.cts.map +1 -1
- package/dist/queue/index.d.mts +8 -15
- package/dist/queue/index.d.mts.map +1 -1
- package/dist/queue/index.mjs +15 -11
- package/dist/queue/index.mjs.map +1 -1
- package/dist/rest-api.cjs +88 -62
- package/dist/rest-api.cjs.map +1 -1
- package/dist/rest-api.d.cts +62 -60
- package/dist/rest-api.d.cts.map +1 -1
- package/dist/rest-api.d.mts +62 -60
- package/dist/rest-api.d.mts.map +1 -1
- package/dist/rest-api.mjs +80 -54
- package/dist/rest-api.mjs.map +1 -1
- package/dist/{chunk-DWy1uDak.cjs → rolldown-runtime-y5ARvAq5.cjs} +14 -18
- package/dist/site.cjs +33 -9
- package/dist/site.cjs.map +1 -1
- package/dist/site.d.cts +11 -22
- package/dist/site.d.cts.map +1 -1
- package/dist/site.d.mts +11 -22
- package/dist/site.d.mts.map +1 -1
- package/dist/site.mjs +29 -5
- package/dist/site.mjs.map +1 -1
- package/dist/subscribers/index.cjs +2 -11
- package/dist/subscribers/index.d.cts +3 -14
- package/dist/subscribers/index.d.mts +3 -14
- package/dist/subscribers/index.mjs +2 -11
- 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 +18 -20
- package/dist/topic/index.cjs.map +1 -1
- package/dist/topic/index.d.cts +3 -32
- package/dist/topic/index.d.mts +3 -32
- package/dist/topic/index.mjs +8 -10
- package/dist/topic/index.mjs.map +1 -1
- 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 +109 -35
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.d.cts +87 -42
- package/dist/worker.d.cts.map +1 -1
- package/dist/worker.d.mts +87 -42
- package/dist/worker.d.mts.map +1 -1
- package/dist/worker.mjs +104 -30
- package/dist/worker.mjs.map +1 -1
- package/package.json +59 -55
- package/dist/Construct-BD5neF7w.mjs.map +0 -1
- package/dist/Construct-C0ijr2qp.d.cts.map +0 -1
- package/dist/Construct-Ct8nalEi.d.mts.map +0 -1
- package/dist/Construct-CyS3RpTL.cjs.map +0 -1
- package/dist/Cron-ByxdOfpE.d.mts.map +0 -1
- package/dist/Cron-Wqh464aO.d.cts.map +0 -1
- package/dist/CronBuilder-BL0AP6fs.d.mts.map +0 -1
- package/dist/CronBuilder-BmABazzH.mjs.map +0 -1
- package/dist/CronBuilder-BqpEzMPQ.d.cts.map +0 -1
- package/dist/CronBuilder-CkXPJiGO.cjs.map +0 -1
- package/dist/Endpoint-2Wg7T7Cq.d.mts.map +0 -1
- package/dist/Endpoint-BiaaMEn_.cjs.map +0 -1
- package/dist/Endpoint-CH9Fn1AD.d.cts.map +0 -1
- package/dist/Endpoint-VIOpSo0S.mjs.map +0 -1
- package/dist/EndpointFactory-ChxLZllA.cjs.map +0 -1
- package/dist/EndpointFactory-DTTCkGEL.mjs.map +0 -1
- package/dist/HonoEndpointAdaptor-NKQQQbBY.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.map +0 -1
- package/dist/SubscriberBuilder-waNhzjSM.d.cts.map +0 -1
- package/dist/Topic-19QeHBIR.d.cts.map +0 -1
- 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.d.cts.map +0 -1
- package/dist/database/kysely.d.mts.map +0 -1
- package/dist/functions-Bd3TPxid.cjs.map +0 -1
- package/dist/functions-Cxbo-pEd.mjs.map +0 -1
- package/dist/index-BxHDdy6a.d.mts.map +0 -1
- package/dist/index-CubPzHd9.d.mts.map +0 -1
- package/dist/index-JSf9xNIJ.d.cts.map +0 -1
- package/dist/index-V2nksZIJ.d.cts.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/subscribers/index.cjs.map +0 -1
- package/dist/subscribers/index.d.cts.map +0 -1
- package/dist/subscribers/index.d.mts.map +0 -1
- package/dist/subscribers/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.d.cts.map +0 -1
- package/dist/topic/index.d.mts.map +0 -1
- package/dist/types-BlAkSuGI.d.cts.map +0 -1
- package/dist/types-aKksMEWL.d.mts.map +0 -1
package/dist/site.d.cts
CHANGED
|
@@ -1,29 +1,20 @@
|
|
|
1
|
-
import { Declarable } from "./construct-interface-
|
|
1
|
+
import { i as Declarable } from "./construct-interface-DIaTNKax.cjs";
|
|
2
2
|
import { ConstructName, Declaration, Dependency, SiteDeclaration } from "@geekmidas/manifest";
|
|
3
|
-
|
|
4
3
|
//#region src/site.d.ts
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
|
-
*
|
|
5
|
+
* Where a site's source lives, and the little else a layout can differ by.
|
|
8
6
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* and worth separating. A site *is* its app — there is nothing to separate it
|
|
12
|
-
* from, and `{ app: { path } }` would be a wrapper around the only thing in it.
|
|
13
|
-
*
|
|
14
|
-
* Every field is optional, so `new StaticSite('Web')` is a complete site.
|
|
7
|
+
* Only `path` is required: `new StaticSite('Web', { path: 'apps/web' })` is a
|
|
8
|
+
* complete site.
|
|
15
9
|
*/
|
|
16
|
-
interface StaticSiteConfig {
|
|
10
|
+
export interface StaticSiteConfig {
|
|
17
11
|
/**
|
|
18
|
-
* Where its source lives, relative to the workspace root
|
|
19
|
-
*
|
|
20
|
-
* Optional, and normally omitted: `apps/<kebab-id>` where that directory
|
|
21
|
-
* exists, and the workspace root otherwise. `StaticSite('Web')` means
|
|
22
|
-
* `apps/web`, which is the thing the id already said.
|
|
12
|
+
* Where its source lives, relative to the workspace root — `'apps/web'`.
|
|
23
13
|
*
|
|
24
|
-
*
|
|
14
|
+
* Required, the same field `RestApi` and `BetterAuth` take. It was
|
|
15
|
+
* inferred from the id, which made a site's home whatever was on disk.
|
|
25
16
|
*/
|
|
26
|
-
path
|
|
17
|
+
path: string;
|
|
27
18
|
/**
|
|
28
19
|
* The port it answers on locally.
|
|
29
20
|
*
|
|
@@ -60,7 +51,7 @@ interface StaticSiteConfig {
|
|
|
60
51
|
*/
|
|
61
52
|
variant?: SiteDeclaration['variant'];
|
|
62
53
|
}
|
|
63
|
-
declare class StaticSite<TName extends string = string> implements Declarable<TName> {
|
|
54
|
+
export declare class StaticSite<TName extends string = string> implements Declarable<TName> {
|
|
64
55
|
private readonly config;
|
|
65
56
|
/**
|
|
66
57
|
* Internal: how `.dependsOn()` carries edges into the copy it returns.
|
|
@@ -73,7 +64,7 @@ declare class StaticSite<TName extends string = string> implements Declarable<TN
|
|
|
73
64
|
readonly keys: {
|
|
74
65
|
url: string;
|
|
75
66
|
};
|
|
76
|
-
constructor(id: ConstructName<TName>, config
|
|
67
|
+
constructor(id: ConstructName<TName>, config: StaticSiteConfig,
|
|
77
68
|
/**
|
|
78
69
|
* Internal: how `.dependsOn()` carries edges into the copy it returns.
|
|
79
70
|
* Written as a parameter rather than a mutable field so the builder can
|
|
@@ -95,7 +86,5 @@ declare class StaticSite<TName extends string = string> implements Declarable<TN
|
|
|
95
86
|
dependsOn(constructs: readonly Declarable[]): StaticSite<TName>;
|
|
96
87
|
declare(): Declaration[];
|
|
97
88
|
}
|
|
98
|
-
//# sourceMappingURL=site.d.ts.map
|
|
99
89
|
//#endregion
|
|
100
|
-
export { StaticSite, StaticSiteConfig };
|
|
101
90
|
//# sourceMappingURL=site.d.cts.map
|
package/dist/site.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site.d.cts","names":[],"sources":["../src/site.ts"],"
|
|
1
|
+
{"version":3,"file":"site.d.cts","names":[],"sources":["../src/site.ts"],"mappings":";;;;;;;;;iBAwCiB;;;;;;;EAOhB;;;;;;;EAOA;;;;;;;EAOA;IAAW;IAAiB;;;;;;;;;;EAS5B;;;;;;;;;EASA,UAAU;;qBAGE,WAAW,0CACZ,WAAW;mBAOJ;;;;;;;mBAOA;WAZT,IAAI;WACJ;IAAQ;;EAEjB,YACC,IAAI,cAAc,QACD,QAAQ,kBAOR;;;;;;;EAAA,wBAAuB;;;;;;;;;;;;EAiBzC,UAAU,qBAAqB,eAAe,WAAW;EAOzD,WAAW"}
|
package/dist/site.d.mts
CHANGED
|
@@ -1,29 +1,20 @@
|
|
|
1
|
-
import { Declarable } from "./construct-interface-
|
|
1
|
+
import { i as Declarable } from "./construct-interface-Clz7_BwB.mjs";
|
|
2
2
|
import { ConstructName, Declaration, Dependency, SiteDeclaration } from "@geekmidas/manifest";
|
|
3
|
-
|
|
4
3
|
//#region src/site.d.ts
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
|
-
*
|
|
5
|
+
* Where a site's source lives, and the little else a layout can differ by.
|
|
8
6
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* and worth separating. A site *is* its app — there is nothing to separate it
|
|
12
|
-
* from, and `{ app: { path } }` would be a wrapper around the only thing in it.
|
|
13
|
-
*
|
|
14
|
-
* Every field is optional, so `new StaticSite('Web')` is a complete site.
|
|
7
|
+
* Only `path` is required: `new StaticSite('Web', { path: 'apps/web' })` is a
|
|
8
|
+
* complete site.
|
|
15
9
|
*/
|
|
16
|
-
interface StaticSiteConfig {
|
|
10
|
+
export interface StaticSiteConfig {
|
|
17
11
|
/**
|
|
18
|
-
* Where its source lives, relative to the workspace root
|
|
19
|
-
*
|
|
20
|
-
* Optional, and normally omitted: `apps/<kebab-id>` where that directory
|
|
21
|
-
* exists, and the workspace root otherwise. `StaticSite('Web')` means
|
|
22
|
-
* `apps/web`, which is the thing the id already said.
|
|
12
|
+
* Where its source lives, relative to the workspace root — `'apps/web'`.
|
|
23
13
|
*
|
|
24
|
-
*
|
|
14
|
+
* Required, the same field `RestApi` and `BetterAuth` take. It was
|
|
15
|
+
* inferred from the id, which made a site's home whatever was on disk.
|
|
25
16
|
*/
|
|
26
|
-
path
|
|
17
|
+
path: string;
|
|
27
18
|
/**
|
|
28
19
|
* The port it answers on locally.
|
|
29
20
|
*
|
|
@@ -60,7 +51,7 @@ interface StaticSiteConfig {
|
|
|
60
51
|
*/
|
|
61
52
|
variant?: SiteDeclaration['variant'];
|
|
62
53
|
}
|
|
63
|
-
declare class StaticSite<TName extends string = string> implements Declarable<TName> {
|
|
54
|
+
export declare class StaticSite<TName extends string = string> implements Declarable<TName> {
|
|
64
55
|
private readonly config;
|
|
65
56
|
/**
|
|
66
57
|
* Internal: how `.dependsOn()` carries edges into the copy it returns.
|
|
@@ -73,7 +64,7 @@ declare class StaticSite<TName extends string = string> implements Declarable<TN
|
|
|
73
64
|
readonly keys: {
|
|
74
65
|
url: string;
|
|
75
66
|
};
|
|
76
|
-
constructor(id: ConstructName<TName>, config
|
|
67
|
+
constructor(id: ConstructName<TName>, config: StaticSiteConfig,
|
|
77
68
|
/**
|
|
78
69
|
* Internal: how `.dependsOn()` carries edges into the copy it returns.
|
|
79
70
|
* Written as a parameter rather than a mutable field so the builder can
|
|
@@ -95,7 +86,5 @@ declare class StaticSite<TName extends string = string> implements Declarable<TN
|
|
|
95
86
|
dependsOn(constructs: readonly Declarable[]): StaticSite<TName>;
|
|
96
87
|
declare(): Declaration[];
|
|
97
88
|
}
|
|
98
|
-
//# sourceMappingURL=site.d.ts.map
|
|
99
89
|
//#endregion
|
|
100
|
-
export { StaticSite, StaticSiteConfig };
|
|
101
90
|
//# sourceMappingURL=site.d.mts.map
|
package/dist/site.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site.d.mts","names":[],"sources":["../src/site.ts"],"
|
|
1
|
+
{"version":3,"file":"site.d.mts","names":[],"sources":["../src/site.ts"],"mappings":";;;;;;;;;iBAwCiB;;;;;;;EAOhB;;;;;;;EAOA;;;;;;;EAOA;IAAW;IAAiB;;;;;;;;;;EAS5B;;;;;;;;;EASA,UAAU;;qBAGE,WAAW,0CACZ,WAAW;mBAOJ;;;;;;;mBAOA;WAZT,IAAI;WACJ;IAAQ;;EAEjB,YACC,IAAI,cAAc,QACD,QAAQ,kBAOR;;;;;;;EAAA,wBAAuB;;;;;;;;;;;;EAiBzC,UAAU,qBAAqB,eAAe,WAAW;EAOzD,WAAW"}
|
package/dist/site.mjs
CHANGED
|
@@ -1,11 +1,35 @@
|
|
|
1
|
-
import { edgeTo } from "./construct-interface
|
|
1
|
+
import { edgeTo } from "./construct-interface.mjs";
|
|
2
2
|
import { canonicalId, provideKey } from "@geekmidas/manifest";
|
|
3
|
-
|
|
4
3
|
//#region src/site.ts
|
|
4
|
+
/**
|
|
5
|
+
* `StaticSite` — a frontend, declared like anything else.
|
|
6
|
+
*
|
|
7
|
+
* The point is not that a site needs provisioning; it is that a site is the
|
|
8
|
+
* *consumer* whose edges make four hand-maintained lists derivable. Declaring it
|
|
9
|
+
* is what turns "which origins does the API allow" from something a person keeps
|
|
10
|
+
* in step into something the graph already knows.
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* export const console = new StaticSite('Console', { path: 'apps/console' })
|
|
14
|
+
* .dependsOn([api, auth]);
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* It has no `.service`. A site is not a process that registers clients — it is
|
|
18
|
+
* built, and the values it needs are inlined or fetched by its own framework —
|
|
19
|
+
* so the edge is {@link Declarable} rather than {@link Consumable}, and the
|
|
20
|
+
* asymmetry is the honest one: a site consumes addresses, not connections.
|
|
21
|
+
*
|
|
22
|
+
* Only the static variant ships. SSR deploy shapes are unstable and each one is
|
|
23
|
+
* its own maintenance, so they follow rather than arrive together; Expo and
|
|
24
|
+
* mobile are out of scope entirely, because an app store is not infrastructure
|
|
25
|
+
* and there is no URL to hand anyone.
|
|
26
|
+
*/
|
|
5
27
|
var StaticSite = class StaticSite {
|
|
28
|
+
config;
|
|
29
|
+
dependencies;
|
|
6
30
|
id;
|
|
7
31
|
keys;
|
|
8
|
-
constructor(id, config
|
|
32
|
+
constructor(id, config, dependencies = []) {
|
|
9
33
|
this.config = config;
|
|
10
34
|
this.dependencies = dependencies;
|
|
11
35
|
this.id = canonicalId(id);
|
|
@@ -31,7 +55,7 @@ var StaticSite = class StaticSite {
|
|
|
31
55
|
id: this.id,
|
|
32
56
|
variant: this.config.variant ?? "static",
|
|
33
57
|
app: {
|
|
34
|
-
|
|
58
|
+
path: this.config.path,
|
|
35
59
|
...this.config.port ? { port: this.config.port } : {},
|
|
36
60
|
...this.config.config ? { config: this.config.config } : {}
|
|
37
61
|
},
|
|
@@ -41,7 +65,7 @@ var StaticSite = class StaticSite {
|
|
|
41
65
|
}];
|
|
42
66
|
}
|
|
43
67
|
};
|
|
44
|
-
|
|
45
68
|
//#endregion
|
|
46
69
|
export { StaticSite };
|
|
70
|
+
|
|
47
71
|
//# sourceMappingURL=site.mjs.map
|
package/dist/site.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site.mjs","names":[
|
|
1
|
+
{"version":3,"file":"site.mjs","names":[],"sources":["../src/site.ts"],"sourcesContent":["/**\n * `StaticSite` — a frontend, declared like anything else.\n *\n * The point is not that a site needs provisioning; it is that a site is the\n * *consumer* whose edges make four hand-maintained lists derivable. Declaring it\n * is what turns \"which origins does the API allow\" from something a person keeps\n * in step into something the graph already knows.\n *\n * ```ts\n * export const console = new StaticSite('Console', { path: 'apps/console' })\n * .dependsOn([api, auth]);\n * ```\n *\n * It has no `.service`. A site is not a process that registers clients — it is\n * built, and the values it needs are inlined or fetched by its own framework —\n * so the edge is {@link Declarable} rather than {@link Consumable}, and the\n * asymmetry is the honest one: a site consumes addresses, not connections.\n *\n * Only the static variant ships. SSR deploy shapes are unstable and each one is\n * its own maintenance, so they follow rather than arrive together; Expo and\n * mobile are out of scope entirely, because an app store is not infrastructure\n * and there is no URL to hand anyone.\n */\n\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\ttype Dependency,\n\tprovideKey,\n\ttype SiteDeclaration,\n} from '@geekmidas/manifest';\nimport { type Declarable, edgeTo } from './construct-interface';\n\n/**\n * Where a site's source lives, and the little else a layout can differ by.\n *\n * Only `path` is required: `new StaticSite('Web', { path: 'apps/web' })` is a\n * complete site.\n */\nexport interface StaticSiteConfig {\n\t/**\n\t * Where its source lives, relative to the workspace root — `'apps/web'`.\n\t *\n\t * Required, the same field `RestApi` and `BetterAuth` take. It was\n\t * inferred from the id, which made a site's home whatever was on disk.\n\t */\n\tpath: string;\n\t/**\n\t * The port it answers on locally.\n\t *\n\t * Normally omitted: ports are assigned in a stable order, so adding a site\n\t * does not renumber the ones already running.\n\t */\n\tport?: number;\n\t/**\n\t * Modules to import when sniffing which env vars this site reads.\n\t *\n\t * A frontend's values are inlined at build time, so the build has to know\n\t * which ones it reads before it reads them.\n\t */\n\tconfig?: { client?: string; server?: string };\n\t/**\n\t * Whether the base domain points at this site.\n\t *\n\t * A project with one site needs this no more than a project with one\n\t * database needs to say which database. It matters when there are several\n\t * and none is called `web`: the base domain then belongs to whichever site\n\t * says so, rather than to whichever file the glob happened to reach first.\n\t */\n\troot?: boolean;\n\t/**\n\t * Which framework builds it.\n\t *\n\t * It selects how values are delivered — `VITE_`, `NEXT_PUBLIC_`, a fetched\n\t * `config.json` — and never which values there are. One neutral name from the\n\t * construct, one serialisation per framework, the same rule as everywhere\n\t * else.\n\t */\n\tvariant?: SiteDeclaration['variant'];\n}\n\nexport class StaticSite<TName extends string = string>\n\timplements Declarable<TName>\n{\n\treadonly id: TName;\n\treadonly keys: { url: string };\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly config: StaticSiteConfig,\n\t\t/**\n\t\t * Internal: how `.dependsOn()` carries edges into the copy it returns.\n\t\t * Written as a parameter rather than a mutable field so the builder can\n\t\t * stay immutable without a clone method, the same shape\n\t\t * `KyselyDatabase` uses for its derived forms.\n\t\t */\n\t\tprivate readonly dependencies: readonly Dependency[] = [],\n\t) {\n\t\tthis.id = canonicalId(id as string) as TName;\n\t\tthis.keys = { url: provideKey(this.id, 'url') };\n\t}\n\n\t/**\n\t * What this site calls.\n\t *\n\t * Immutable, like every other builder here: it returns a new site rather than\n\t * mutating this one, so a module that exports both a base and a variant of it\n\t * cannot have the second silently change the first.\n\t *\n\t * Takes {@link Declarable} rather than {@link Consumable} because a site's\n\t * edge is a build-time link and not a service injection — requiring a client\n\t * would exclude exactly the surfaces a frontend actually depends on.\n\t */\n\tdependsOn(constructs: readonly Declarable[]): StaticSite<TName> {\n\t\treturn new StaticSite<TName>(this.id as ConstructName<TName>, this.config, [\n\t\t\t...this.dependencies,\n\t\t\t...constructs.map(edgeTo),\n\t\t]);\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'site',\n\t\t\t\tid: this.id,\n\t\t\t\tvariant: this.config.variant ?? 'static',\n\t\t\t\tapp: {\n\t\t\t\t\tpath: this.config.path,\n\t\t\t\t\t...(this.config.port ? { port: this.config.port } : {}),\n\t\t\t\t\t...(this.config.config ? { config: this.config.config } : {}),\n\t\t\t\t},\n\t\t\t\t...(this.config.root ? { root: true } : {}),\n\t\t\t\tdependencies: this.dependencies,\n\t\t\t\tprovides: [this.keys.url],\n\t\t\t},\n\t\t];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAkFA,IAAa,aAAb,MAAa,WAEb;CAMmB;CAOA;CAZlB;CACA;CAEA,YACC,IACA,QAOA,eAAuD,CAAC,GACvD;EARgB,KAAA,SAAA;EAOA,KAAA,eAAA;EAEjB,KAAK,KAAK,YAAY,EAAY;EAClC,KAAK,OAAO,EAAE,KAAK,WAAW,KAAK,IAAI,KAAK,EAAE;CAC/C;;;;;;;;;;;;CAaA,UAAU,YAAsD;EAC/D,OAAO,IAAI,WAAkB,KAAK,IAA4B,KAAK,QAAQ,CAC1E,GAAG,KAAK,cACR,GAAG,WAAW,IAAI,MAAM,CACzB,CAAC;CACF;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,SAAS,KAAK,OAAO,WAAW;GAChC,KAAK;IACJ,MAAM,KAAK,OAAO;IAClB,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,OAAO,KAAK,IAAI,CAAC;IACrD,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAO,IAAI,CAAC;GAC5D;GACA,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;GACzC,cAAc,KAAK;GACnB,UAAU,CAAC,KAAK,KAAK,GAAG;EACzB,CACD;CACD;AACD"}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
require(
|
|
3
|
-
require('../clone-Dy0cR2SZ.cjs');
|
|
4
|
-
const require_SubscriberBuilder = require('../SubscriberBuilder-4OPehf2R.cjs');
|
|
5
|
-
|
|
6
|
-
//#region src/subscribers/index.ts
|
|
7
|
-
const s = new require_SubscriberBuilder.SubscriberBuilder();
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_SubscriberBuilder = require("../SubscriberBuilder-C2bCOuPT.cjs");
|
|
10
3
|
exports.Subscriber = require_SubscriberBuilder.Subscriber;
|
|
11
4
|
exports.SubscriberBuilder = require_SubscriberBuilder.SubscriberBuilder;
|
|
12
|
-
exports.s = s;
|
|
13
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../
|
|
3
|
-
|
|
4
|
-
import "../Topic-19QeHBIR.cjs";
|
|
5
|
-
import { SubscriberBuilder } from "../SubscriberBuilder-waNhzjSM.cjs";
|
|
6
|
-
import * as _geekmidas_logger24 from "@geekmidas/logger";
|
|
7
|
-
|
|
8
|
-
//#region src/subscribers/index.d.ts
|
|
9
|
-
declare const s: SubscriberBuilder<[], _geekmidas_logger24.Logger, undefined, undefined, string, []>;
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
11
|
-
|
|
12
|
-
//#endregion
|
|
13
|
-
export { Subscriber, SubscriberBuilder, s };
|
|
14
|
-
//# sourceMappingURL=index.d.cts.map
|
|
1
|
+
import { t as Subscriber } from "../Subscriber-DQCaiOXF.cjs";
|
|
2
|
+
import { t as SubscriberBuilder } from "../SubscriberBuilder-ChX5v948.cjs";
|
|
3
|
+
export { Subscriber, SubscriberBuilder };
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../
|
|
3
|
-
|
|
4
|
-
import "../Topic-DuFeqkBh.mjs";
|
|
5
|
-
import { SubscriberBuilder } from "../SubscriberBuilder-Dptmo-1A.mjs";
|
|
6
|
-
import * as _geekmidas_logger25 from "@geekmidas/logger";
|
|
7
|
-
|
|
8
|
-
//#region src/subscribers/index.d.ts
|
|
9
|
-
declare const s: SubscriberBuilder<[], _geekmidas_logger25.Logger, undefined, undefined, string, []>;
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
11
|
-
|
|
12
|
-
//#endregion
|
|
13
|
-
export { Subscriber, SubscriberBuilder, s };
|
|
14
|
-
//# sourceMappingURL=index.d.mts.map
|
|
1
|
+
import { t as Subscriber } from "../Subscriber-CIO3pwji.mjs";
|
|
2
|
+
import { t as SubscriberBuilder } from "../SubscriberBuilder-Dbiaskfi.mjs";
|
|
3
|
+
export { Subscriber, SubscriberBuilder };
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
|
|
3
|
-
import "../clone-DblgEZZa.mjs";
|
|
4
|
-
import { Subscriber, SubscriberBuilder } from "../SubscriberBuilder-BjkbeT9l.mjs";
|
|
5
|
-
|
|
6
|
-
//#region src/subscribers/index.ts
|
|
7
|
-
const s = new SubscriberBuilder();
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
export { Subscriber, SubscriberBuilder, s };
|
|
11
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
import { n as Subscriber, t as SubscriberBuilder } from "../SubscriberBuilder-B4YRTBng.mjs";
|
|
2
|
+
export { Subscriber, SubscriberBuilder };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
let _geekmidas_envkit = require("@geekmidas/envkit");
|
|
2
|
+
let _geekmidas_envkit_credentials = require("@geekmidas/envkit/credentials");
|
|
3
|
+
//#region src/endpoints/surfaceEnv.ts
|
|
4
|
+
/**
|
|
5
|
+
* The environment parser an endpoint runs with.
|
|
6
|
+
*
|
|
7
|
+
* Three facts, in order:
|
|
8
|
+
*
|
|
9
|
+
* 1. An endpoint built from a surface carries whatever parser that surface was
|
|
10
|
+
* given. This is the whole point of `api.get()` — the handler already has
|
|
11
|
+
* the thing, so nothing has to be named in config and nothing has to be
|
|
12
|
+
* printed into generated code.
|
|
13
|
+
* 2. A surface that named none gets this default, which is what every
|
|
14
|
+
* application's own `config/env.ts` was: `process.env` merged with the
|
|
15
|
+
* credentials `gkm dev`/`gkm exec` injected. It was boilerplate identical in
|
|
16
|
+
* every project, and mandatory, which is a poor combination.
|
|
17
|
+
* 3. An endpoint with no surface at all — a test, an MSW handler — gets the
|
|
18
|
+
* same default. Nothing has to opt in.
|
|
19
|
+
*
|
|
20
|
+
* Named a parser only when it is genuinely different: a merged secret source, a
|
|
21
|
+
* fixture, a parser that reads from somewhere other than the process.
|
|
22
|
+
*/
|
|
23
|
+
let fallback;
|
|
24
|
+
/**
|
|
25
|
+
* The default parser, built once.
|
|
26
|
+
*
|
|
27
|
+
* Once because `Credentials` resolves through `globalThis` and decryption is
|
|
28
|
+
* not free, and because two parsers over the same environment are two caches of
|
|
29
|
+
* the same answer.
|
|
30
|
+
*/
|
|
31
|
+
function defaultEnvParser() {
|
|
32
|
+
if (!fallback) fallback = new _geekmidas_envkit.EnvironmentParser({
|
|
33
|
+
...process.env,
|
|
34
|
+
..._geekmidas_envkit_credentials.Credentials
|
|
35
|
+
});
|
|
36
|
+
return fallback;
|
|
37
|
+
}
|
|
38
|
+
/** The parser for an endpoint, from its surface or the default. */
|
|
39
|
+
function envParserFor(surface) {
|
|
40
|
+
return surface?.envParser ?? defaultEnvParser();
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
Object.defineProperty(exports, "defaultEnvParser", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function() {
|
|
46
|
+
return defaultEnvParser;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "envParserFor", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function() {
|
|
52
|
+
return envParserFor;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=surfaceEnv-CNimK76p.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surfaceEnv-CNimK76p.cjs","names":["EnvironmentParser","Credentials"],"sources":["../src/endpoints/surfaceEnv.ts"],"sourcesContent":["/**\n * The environment parser an endpoint runs with.\n *\n * Three facts, in order:\n *\n * 1. An endpoint built from a surface carries whatever parser that surface was\n * given. This is the whole point of `api.get()` — the handler already has\n * the thing, so nothing has to be named in config and nothing has to be\n * printed into generated code.\n * 2. A surface that named none gets this default, which is what every\n * application's own `config/env.ts` was: `process.env` merged with the\n * credentials `gkm dev`/`gkm exec` injected. It was boilerplate identical in\n * every project, and mandatory, which is a poor combination.\n * 3. An endpoint with no surface at all — a test, an MSW handler — gets the\n * same default. Nothing has to opt in.\n *\n * Named a parser only when it is genuinely different: a merged secret source, a\n * fixture, a parser that reads from somewhere other than the process.\n */\n\nimport { EnvironmentParser } from '@geekmidas/envkit';\nimport { Credentials } from '@geekmidas/envkit/credentials';\nimport type { EndpointSurface } from './Endpoint';\n\nlet fallback: EnvironmentParser<{}> | undefined;\n\n/**\n * The default parser, built once.\n *\n * Once because `Credentials` resolves through `globalThis` and decryption is\n * not free, and because two parsers over the same environment are two caches of\n * the same answer.\n */\nexport function defaultEnvParser(): EnvironmentParser<{}> {\n\tif (!fallback) {\n\t\tfallback = new EnvironmentParser({ ...process.env, ...Credentials });\n\t}\n\n\treturn fallback;\n}\n\n/** The parser for an endpoint, from its surface or the default. */\nexport function envParserFor(\n\tsurface: EndpointSurface | undefined,\n): EnvironmentParser<{}> {\n\treturn surface?.envParser ?? defaultEnvParser();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAI;;;;;;;;AASJ,SAAgB,mBAA0C;CACzD,IAAI,CAAC,UACJ,WAAW,IAAIA,kBAAAA,kBAAkB;EAAE,GAAG,QAAQ;EAAK,GAAGC,8BAAAA;CAAY,CAAC;CAGpE,OAAO;AACR;;AAGA,SAAgB,aACf,SACwB;CACxB,OAAO,SAAS,aAAa,iBAAiB;AAC/C"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { EnvironmentParser } from "@geekmidas/envkit";
|
|
2
|
+
import { Credentials } from "@geekmidas/envkit/credentials";
|
|
3
|
+
//#region src/endpoints/surfaceEnv.ts
|
|
4
|
+
/**
|
|
5
|
+
* The environment parser an endpoint runs with.
|
|
6
|
+
*
|
|
7
|
+
* Three facts, in order:
|
|
8
|
+
*
|
|
9
|
+
* 1. An endpoint built from a surface carries whatever parser that surface was
|
|
10
|
+
* given. This is the whole point of `api.get()` — the handler already has
|
|
11
|
+
* the thing, so nothing has to be named in config and nothing has to be
|
|
12
|
+
* printed into generated code.
|
|
13
|
+
* 2. A surface that named none gets this default, which is what every
|
|
14
|
+
* application's own `config/env.ts` was: `process.env` merged with the
|
|
15
|
+
* credentials `gkm dev`/`gkm exec` injected. It was boilerplate identical in
|
|
16
|
+
* every project, and mandatory, which is a poor combination.
|
|
17
|
+
* 3. An endpoint with no surface at all — a test, an MSW handler — gets the
|
|
18
|
+
* same default. Nothing has to opt in.
|
|
19
|
+
*
|
|
20
|
+
* Named a parser only when it is genuinely different: a merged secret source, a
|
|
21
|
+
* fixture, a parser that reads from somewhere other than the process.
|
|
22
|
+
*/
|
|
23
|
+
let fallback;
|
|
24
|
+
/**
|
|
25
|
+
* The default parser, built once.
|
|
26
|
+
*
|
|
27
|
+
* Once because `Credentials` resolves through `globalThis` and decryption is
|
|
28
|
+
* not free, and because two parsers over the same environment are two caches of
|
|
29
|
+
* the same answer.
|
|
30
|
+
*/
|
|
31
|
+
function defaultEnvParser() {
|
|
32
|
+
if (!fallback) fallback = new EnvironmentParser({
|
|
33
|
+
...process.env,
|
|
34
|
+
...Credentials
|
|
35
|
+
});
|
|
36
|
+
return fallback;
|
|
37
|
+
}
|
|
38
|
+
/** The parser for an endpoint, from its surface or the default. */
|
|
39
|
+
function envParserFor(surface) {
|
|
40
|
+
return surface?.envParser ?? defaultEnvParser();
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { envParserFor as n, defaultEnvParser as t };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=surfaceEnv-wMT5QzgZ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surfaceEnv-wMT5QzgZ.mjs","names":[],"sources":["../src/endpoints/surfaceEnv.ts"],"sourcesContent":["/**\n * The environment parser an endpoint runs with.\n *\n * Three facts, in order:\n *\n * 1. An endpoint built from a surface carries whatever parser that surface was\n * given. This is the whole point of `api.get()` — the handler already has\n * the thing, so nothing has to be named in config and nothing has to be\n * printed into generated code.\n * 2. A surface that named none gets this default, which is what every\n * application's own `config/env.ts` was: `process.env` merged with the\n * credentials `gkm dev`/`gkm exec` injected. It was boilerplate identical in\n * every project, and mandatory, which is a poor combination.\n * 3. An endpoint with no surface at all — a test, an MSW handler — gets the\n * same default. Nothing has to opt in.\n *\n * Named a parser only when it is genuinely different: a merged secret source, a\n * fixture, a parser that reads from somewhere other than the process.\n */\n\nimport { EnvironmentParser } from '@geekmidas/envkit';\nimport { Credentials } from '@geekmidas/envkit/credentials';\nimport type { EndpointSurface } from './Endpoint';\n\nlet fallback: EnvironmentParser<{}> | undefined;\n\n/**\n * The default parser, built once.\n *\n * Once because `Credentials` resolves through `globalThis` and decryption is\n * not free, and because two parsers over the same environment are two caches of\n * the same answer.\n */\nexport function defaultEnvParser(): EnvironmentParser<{}> {\n\tif (!fallback) {\n\t\tfallback = new EnvironmentParser({ ...process.env, ...Credentials });\n\t}\n\n\treturn fallback;\n}\n\n/** The parser for an endpoint, from its surface or the default. */\nexport function envParserFor(\n\tsurface: EndpointSurface | undefined,\n): EnvironmentParser<{}> {\n\treturn surface?.envParser ?? defaultEnvParser();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAI;;;;;;;;AASJ,SAAgB,mBAA0C;CACzD,IAAI,CAAC,UACJ,WAAW,IAAI,kBAAkB;EAAE,GAAG,QAAQ;EAAK,GAAG;CAAY,CAAC;CAGpE,OAAO;AACR;;AAGA,SAAgB,aACf,SACwB;CACxB,OAAO,SAAS,aAAa,iBAAiB;AAC/C"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Context } from "aws-lambda";
|
|
2
|
-
|
|
3
2
|
//#region src/telemetry.d.ts
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* Context object returned by onRequestStart, passed to subsequent hooks
|
|
7
5
|
*/
|
|
@@ -89,7 +87,6 @@ interface Telemetry {
|
|
|
89
87
|
*/
|
|
90
88
|
onRequestError(ctx: TelemetryContext, error: Error): void;
|
|
91
89
|
}
|
|
92
|
-
//# sourceMappingURL=telemetry.d.ts.map
|
|
93
90
|
//#endregion
|
|
94
|
-
export {
|
|
95
|
-
//# sourceMappingURL=telemetry-
|
|
91
|
+
export { TelemetryResponse as i, TelemetryContext as n, TelemetryRequest as r, Telemetry as t };
|
|
92
|
+
//# sourceMappingURL=telemetry-DGcFlVpB.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-DGcFlVpB.d.cts","names":["LambdaContext"],"sources":["../src/telemetry.ts"],"mappings":";;;;;UAWiB;;;;GAIf;;;;;UAMe;;;;EAIhB;;;;EAKA,SAASA;;;;;UAMO;;;;EAIhB;;;;EAKA;;;;EAKA,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;UA4BM;;;;;;;EAOhB,eAAe,SAAS,mBAAmB;;;;;;;EAQ3C,aAAa,KAAK,kBAAkB,UAAU;;;;;;;EAQ9C,eAAe,KAAK,kBAAkB,OAAO"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Context } from "aws-lambda";
|
|
2
|
-
|
|
3
2
|
//#region src/telemetry.d.ts
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* Context object returned by onRequestStart, passed to subsequent hooks
|
|
7
5
|
*/
|
|
@@ -89,7 +87,6 @@ interface Telemetry {
|
|
|
89
87
|
*/
|
|
90
88
|
onRequestError(ctx: TelemetryContext, error: Error): void;
|
|
91
89
|
}
|
|
92
|
-
//# sourceMappingURL=telemetry.d.ts.map
|
|
93
90
|
//#endregion
|
|
94
|
-
export {
|
|
95
|
-
//# sourceMappingURL=telemetry-
|
|
91
|
+
export { TelemetryResponse as i, TelemetryContext as n, TelemetryRequest as r, Telemetry as t };
|
|
92
|
+
//# sourceMappingURL=telemetry-DGcFlVpB.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-DGcFlVpB.d.mts","names":["LambdaContext"],"sources":["../src/telemetry.ts"],"mappings":";;;;;UAWiB;;;;GAIf;;;;;UAMe;;;;EAIhB;;;;EAKA,SAASA;;;;;UAMO;;;;EAIhB;;;;EAKA;;;;EAKA,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;UA4BM;;;;;;;EAOhB,eAAe,SAAS,mBAAmB;;;;;;;EAQ3C,aAAa,KAAK,kBAAkB,UAAU;;;;;;;EAQ9C,eAAe,KAAK,kBAAkB,OAAO"}
|
package/dist/topic/index.cjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
const require_Construct = require(
|
|
3
|
-
const require_clone = require(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_Construct = require("../Construct-yG9Sw-5p.cjs");
|
|
3
|
+
const require_clone = require("../clone-UGJpvQnL.cjs");
|
|
4
|
+
let _geekmidas_manifest = require("@geekmidas/manifest");
|
|
5
|
+
let _geekmidas_logger_console = require("@geekmidas/logger/console");
|
|
6
|
+
let _geekmidas_events = require("@geekmidas/events");
|
|
8
7
|
//#region src/topic/Topic.ts
|
|
9
8
|
/**
|
|
10
9
|
* A topic — pub/sub fan-out. Unlike a `Queue` (point-to-point, one consumer), a
|
|
@@ -17,9 +16,11 @@ const __geekmidas_events = require_chunk.__toESM(require("@geekmidas/events"));
|
|
|
17
16
|
* from the declared event contract, the same way `Queue` derives its publisher.
|
|
18
17
|
*/
|
|
19
18
|
var Topic = class extends require_Construct.Construct {
|
|
19
|
+
name;
|
|
20
|
+
eventSchemas;
|
|
20
21
|
__IS_TOPIC__ = true;
|
|
21
22
|
static isTopic(obj) {
|
|
22
|
-
return Boolean(obj && obj.__IS_TOPIC__ === true && obj.type ===
|
|
23
|
+
return Boolean(obj && obj.__IS_TOPIC__ === true && obj.type === "dev.geekmidas.resource.topic");
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* The canonical id this topic is declared under.
|
|
@@ -33,12 +34,12 @@ var Topic = class extends require_Construct.Construct {
|
|
|
33
34
|
* {@link publisher} so the two cannot drift.
|
|
34
35
|
*/
|
|
35
36
|
connectionKey;
|
|
36
|
-
constructor(name, eventSchemas, logger =
|
|
37
|
-
super(
|
|
37
|
+
constructor(name, eventSchemas, logger = _geekmidas_logger_console.DEFAULT_LOGGER) {
|
|
38
|
+
super("dev.geekmidas.resource.topic", logger, [], []);
|
|
38
39
|
this.name = name;
|
|
39
40
|
this.eventSchemas = eventSchemas;
|
|
40
|
-
this.id = (0,
|
|
41
|
-
this.connectionKey = (0,
|
|
41
|
+
this.id = (0, _geekmidas_manifest.canonicalId)(name);
|
|
42
|
+
this.connectionKey = (0, _geekmidas_manifest.provideKey)(this.id, "publisherConnectionString");
|
|
42
43
|
}
|
|
43
44
|
/**
|
|
44
45
|
* What this topic is in the manifest.
|
|
@@ -82,7 +83,7 @@ var Topic = class extends require_Construct.Construct {
|
|
|
82
83
|
get service() {
|
|
83
84
|
const { register } = this.publisher;
|
|
84
85
|
return {
|
|
85
|
-
serviceName: (0,
|
|
86
|
+
serviceName: (0, _geekmidas_manifest.serviceKey)(this.id),
|
|
86
87
|
register
|
|
87
88
|
};
|
|
88
89
|
}
|
|
@@ -92,12 +93,11 @@ var Topic = class extends require_Construct.Construct {
|
|
|
92
93
|
serviceName: `${this.name}Publisher`,
|
|
93
94
|
async register({ envParser }) {
|
|
94
95
|
const { connectionString } = envParser.create((get) => ({ connectionString: get(envVar).string() })).parse();
|
|
95
|
-
return
|
|
96
|
+
return _geekmidas_events.Publisher.fromConnectionString(connectionString);
|
|
96
97
|
}
|
|
97
98
|
};
|
|
98
99
|
}
|
|
99
100
|
};
|
|
100
|
-
|
|
101
101
|
//#endregion
|
|
102
102
|
//#region src/topic/TopicBuilder.ts
|
|
103
103
|
/**
|
|
@@ -107,7 +107,7 @@ var Topic = class extends require_Construct.Construct {
|
|
|
107
107
|
*/
|
|
108
108
|
var TopicBuilder = class {
|
|
109
109
|
_name;
|
|
110
|
-
_logger =
|
|
110
|
+
_logger = _geekmidas_logger_console.DEFAULT_LOGGER;
|
|
111
111
|
/** The topic name — drives the infra topic and its `<NAME>_*` env vars. */
|
|
112
112
|
topic(name) {
|
|
113
113
|
return require_clone.cloneWith(this, { _name: name });
|
|
@@ -121,17 +121,15 @@ var TopicBuilder = class {
|
|
|
121
121
|
*/
|
|
122
122
|
events(events) {
|
|
123
123
|
if (!this._name) throw new Error("Topic requires a name — call .topic(name) before .events().");
|
|
124
|
-
|
|
125
|
-
return topic;
|
|
124
|
+
return new Topic(this._name, events, this._logger);
|
|
126
125
|
}
|
|
127
126
|
};
|
|
128
|
-
|
|
129
127
|
//#endregion
|
|
130
128
|
//#region src/topic/index.ts
|
|
131
129
|
const t = new TopicBuilder();
|
|
132
|
-
|
|
133
130
|
//#endregion
|
|
134
131
|
exports.Topic = Topic;
|
|
135
132
|
exports.TopicBuilder = TopicBuilder;
|
|
136
133
|
exports.t = t;
|
|
134
|
+
|
|
137
135
|
//# sourceMappingURL=index.cjs.map
|
package/dist/topic/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["Construct","
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["Construct","DEFAULT_LOGGER","canonicalId","provideKey","serviceKey","Publisher","DEFAULT_LOGGER","cloneWith"],"sources":["../../src/topic/Topic.ts","../../src/topic/TopicBuilder.ts","../../src/topic/index.ts"],"sourcesContent":["import {\n\ttype EventPublisher,\n\ttype EventPublisherConnectionString,\n\ttype PublishableMessage,\n\tPublisher,\n} from '@geekmidas/events';\nimport type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport {\n\tcanonicalId,\n\ttype Declaration,\n\tprovideKey,\n\tserviceKey,\n} from '@geekmidas/manifest';\nimport type { InferStandardSchema } from '@geekmidas/schema';\nimport type { Service } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport { Construct, ConstructType } from '../Construct';\n\n/** A topic's event contract — a map of event type → payload schema. */\nexport type TopicEvents = Record<string, StandardSchemaV1>;\n\n/**\n * The union of wire messages a topic carries, derived from its event map:\n * `{ type: 'user.created'; payload: … } | { type: 'user.updated'; payload: … }`.\n */\nexport type TopicMessage<TEvents extends TopicEvents> = {\n\t[K in keyof TEvents & string]: PublishableMessage<\n\t\tK,\n\t\tInferStandardSchema<TEvents[K]>\n\t>;\n}[keyof TEvents & string];\n\n/**\n * A topic — pub/sub fan-out. Unlike a `Queue` (point-to-point, one consumer), a\n * topic is a *resource* owned by no single handler: it declares the event\n * contract, derives a typed producer (`topic.publisher`), and any number of\n * subscribers (`s.topic(topic)`) bind to it. `gkm build` discovers it into the\n * manifest's `topics` field; infra provisions an SNS topic.\n *\n * This replaces hand-writing a publisher `Service`: the publisher is *derived*\n * from the declared event contract, the same way `Queue` derives its publisher.\n */\nexport class Topic<\n\tTName extends string = string,\n\tTEvents extends TopicEvents = TopicEvents,\n> extends Construct {\n\t__IS_TOPIC__ = true;\n\n\tstatic isTopic(obj: unknown): obj is Topic<string, TopicEvents> {\n\t\treturn Boolean(\n\t\t\tobj &&\n\t\t\t\t(obj as { __IS_TOPIC__?: boolean }).__IS_TOPIC__ === true &&\n\t\t\t\t(obj as Construct).type === ConstructType.Topic,\n\t\t);\n\t}\n\n\t/**\n\t * The canonical id this topic is declared under.\n\t *\n\t * Derived from the name, so `users` and `Users` are one topic. The name is\n\t * left alone: subscribers bind to it and it is what the broker routes on.\n\t */\n\treadonly id: string;\n\n\t/**\n\t * The producer's env key, read by both {@link declare} and\n\t * {@link publisher} so the two cannot drift.\n\t */\n\tprivate readonly connectionKey: string;\n\n\tconstructor(\n\t\tpublic readonly name: TName,\n\t\t/**\n\t\t * The event contract — a map of event type → payload schema. Named\n\t\t * `eventSchemas` (not `events`) to avoid clashing with `Construct.events`,\n\t\t * which is the array of `MappedEvent`s a construct *publishes*.\n\t\t */\n\t\tpublic readonly eventSchemas: TEvents,\n\t\tlogger: Logger = DEFAULT_LOGGER,\n\t) {\n\t\tsuper(ConstructType.Topic, logger, [], []);\n\n\t\tthis.id = canonicalId(name);\n\t\tthis.connectionKey = provideKey(this.id, 'publisherConnectionString');\n\t}\n\n\t/**\n\t * What this topic is in the manifest.\n\t *\n\t * Only the producer's key: a subscriber is *bound* to a topic rather than\n\t * depending on it, so the binding is an edge the deploy target reads and not\n\t * an env key anyone can hold. Locally both sides meet on the same broker.\n\t */\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'topic',\n\t\t\t\tid: this.id,\n\t\t\t\tprovides: [this.connectionKey],\n\t\t\t\t// The contract this topic carries. Structural: which events exist\n\t\t\t\t// is a fact about the application, and a subscriber binding to one\n\t\t\t\t// that does not is a mistake worth catching at build.\n\t\t\t\tevents: this.eventTypes,\n\t\t\t\t// Bound rather than declared here — a subscriber names the topic,\n\t\t\t\t// not the other way round — so the build fills these from what it\n\t\t\t\t// found. Nested when it does, because position is the trigger.\n\t\t\t\tsubscribers: [],\n\t\t\t},\n\t\t];\n\t}\n\n\t/** The event type names this topic carries. */\n\tget eventTypes(): (keyof TEvents & string)[] {\n\t\treturn Object.keys(this.eventSchemas) as (keyof TEvents & string)[];\n\t}\n\n\t/**\n\t * The producer side — a `Service` exposing an `EventPublisher` typed to the\n\t * union of this topic's events. Inject via `.publisher(topic.publisher)` (for\n\t * declarative `.event(...)`) or `.services([topic.publisher])` (to publish\n\t * imperatively). Reads `<NAME>_PUBLISHER_CONNECTION_STRING` and selects the\n\t * transport from the URL protocol — `pgboss://` locally, `sns://` deployed.\n\t *\n\t * Because it's a `Service`, the connection-string requirement is sniffed into\n\t * the manifest of whatever construct injects it (least-privilege linking).\n\t */\n\t/**\n\t * The topic as a dependency — what `.dependsOn([users])` dissolves into,\n\t * reachable as `services.users`.\n\t *\n\t * It is the producer, because publishing is the only thing depending on a\n\t * topic can mean: a subscriber *binds* with `s.topic(…)` instead, and is\n\t * deliberately never handed this. {@link publisher} is the same service\n\t * under its older `<name>Publisher` key.\n\t */\n\tget service(): Service<\n\t\tUncapitalize<TName>,\n\t\tEventPublisher<TopicMessage<TEvents>>\n\t> {\n\t\tconst { register } = this.publisher;\n\n\t\treturn {\n\t\t\tserviceName: serviceKey(this.id) as Uncapitalize<TName>,\n\t\t\tregister,\n\t\t};\n\t}\n\n\tget publisher(): Service<\n\t\t`${TName}Publisher`,\n\t\tEventPublisher<TopicMessage<TEvents>>\n\t> {\n\t\tconst envVar = this.connectionKey;\n\t\treturn {\n\t\t\tserviceName: `${this.name}Publisher`,\n\t\t\tasync register({ envParser }) {\n\t\t\t\tconst { connectionString } = envParser\n\t\t\t\t\t.create((get) => ({\n\t\t\t\t\t\tconnectionString: get(envVar).string(),\n\t\t\t\t\t}))\n\t\t\t\t\t.parse();\n\n\t\t\t\treturn Publisher.fromConnectionString<TopicMessage<TEvents>>(\n\t\t\t\t\tconnectionString as EventPublisherConnectionString,\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t}\n}\n","import type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport { cloneWith } from '../clone';\nimport { Topic, type TopicEvents } from './Topic';\n\n/**\n * Builds a {@link Topic} — `t.topic('users').events({ 'user.created': schema, … })`.\n * The event map is the topic's contract: it types the derived `topic.publisher`\n * and the subscribers that bind via `s.topic(topic)`.\n */\nexport class TopicBuilder<\n\tTName extends string = string,\n\tTEvents extends TopicEvents = TopicEvents,\n> {\n\tprivate _name?: string;\n\tprivate _logger: Logger = DEFAULT_LOGGER;\n\n\t/** The topic name — drives the infra topic and its `<NAME>_*` env vars. */\n\ttopic<T extends string>(name: T): TopicBuilder<T, TEvents> {\n\t\treturn cloneWith(this, { _name: name }) as unknown as TopicBuilder<\n\t\t\tT,\n\t\t\tTEvents\n\t\t>;\n\t}\n\n\tlogger(logger: Logger): this {\n\t\treturn cloneWith(this, { _logger: logger });\n\t}\n\n\t/**\n\t * The event contract — a map of event type → payload schema. Building the\n\t * topic requires this; it's what types the publisher and subscribers.\n\t */\n\tevents<T extends TopicEvents>(events: T): Topic<TName, T> {\n\t\tif (!this._name) {\n\t\t\tthrow new Error(\n\t\t\t\t'Topic requires a name — call .topic(name) before .events().',\n\t\t\t);\n\t\t}\n\n\t\tconst topic = new Topic<TName, T>(\n\t\t\tthis._name as TName,\n\t\t\tevents,\n\t\t\tthis._logger,\n\t\t);\n\n\t\t// No reset. `.events()` reads this builder and leaves it alone, so a\n\t\t// configured base stays usable for the next topic — and two chains off one\n\t\t// base cannot feed each other.\n\t\treturn topic;\n\t}\n}\n","export {\n\tTopic,\n\ttype TopicEvents,\n\ttype TopicMessage,\n} from './Topic';\n\nimport { TopicBuilder } from './TopicBuilder';\n\nexport { TopicBuilder } from './TopicBuilder';\n\nexport const t = new TopicBuilder();\n"],"mappings":";;;;;;;;;;;;;;;;;AA2CA,IAAa,QAAb,cAGUA,kBAAAA,UAAU;CA0BF;CAMA;CA/BjB,eAAe;CAEf,OAAO,QAAQ,KAAiD;EAC/D,OAAO,QACN,OACE,IAAmC,iBAAiB,QACpD,IAAkB,SAAA,8BACrB;CACD;;;;;;;CAQA;;;;;CAMA;CAEA,YACC,MAMA,cACA,SAAiBC,0BAAAA,gBAChB;EACD,MAAA,gCAA2B,QAAQ,CAAC,GAAG,CAAC,CAAC;EATzB,KAAA,OAAA;EAMA,KAAA,eAAA;EAKhB,KAAK,MAAA,GAAKC,oBAAAA,YAAAA,CAAY,IAAI;EAC1B,KAAK,iBAAA,GAAgBC,oBAAAA,WAAAA,CAAW,KAAK,IAAI,2BAA2B;CACrE;;;;;;;;CASA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,UAAU,CAAC,KAAK,aAAa;GAI7B,QAAQ,KAAK;GAIb,aAAa,CAAC;EACf,CACD;CACD;;CAGA,IAAI,aAAyC;EAC5C,OAAO,OAAO,KAAK,KAAK,YAAY;CACrC;;;;;;;;;;;;;;;;;;;;CAqBA,IAAI,UAGF;EACD,MAAM,EAAE,aAAa,KAAK;EAE1B,OAAO;GACN,cAAA,GAAaC,oBAAAA,WAAAA,CAAW,KAAK,EAAE;GAC/B;EACD;CACD;CAEA,IAAI,YAGF;EACD,MAAM,SAAS,KAAK;EACpB,OAAO;GACN,aAAa,GAAG,KAAK,KAAK;GAC1B,MAAM,SAAS,EAAE,aAAa;IAC7B,MAAM,EAAE,qBAAqB,UAC3B,QAAQ,SAAS,EACjB,kBAAkB,IAAI,MAAM,CAAC,CAAC,OAAO,EACtC,EAAE,CAAC,CACF,MAAM;IAER,OAAOC,kBAAAA,UAAU,qBAChB,gBACD;GACD;EACD;CACD;AACD;;;;;;;;AC9JA,IAAa,eAAb,MAGE;CACD;CACA,UAA0BC,0BAAAA;;CAG1B,MAAwB,MAAmC;EAC1D,OAAOC,cAAAA,UAAU,MAAM,EAAE,OAAO,KAAK,CAAC;CAIvC;CAEA,OAAO,QAAsB;EAC5B,OAAOA,cAAAA,UAAU,MAAM,EAAE,SAAS,OAAO,CAAC;CAC3C;;;;;CAMA,OAA8B,QAA4B;EACzD,IAAI,CAAC,KAAK,OACT,MAAM,IAAI,MACT,6DACD;EAYD,OAAO,IATW,MACjB,KAAK,OACL,QACA,KAAK,OAMK;CACZ;AACD;;;ACzCA,MAAa,IAAI,IAAI,aAAa"}
|