@geekmidas/constructs 10.0.0-alpha.98 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +437 -0
- package/README.md +193 -285
- package/dist/AWSScheduledFunction-BzGCUbkk.d.mts +117 -0
- package/dist/AWSScheduledFunction-BzGCUbkk.d.mts.map +1 -0
- package/dist/AWSScheduledFunction-C42adp8A.cjs +266 -0
- package/dist/AWSScheduledFunction-C42adp8A.cjs.map +1 -0
- package/dist/AWSScheduledFunction-CsNJhXQj.d.cts +117 -0
- package/dist/AWSScheduledFunction-CsNJhXQj.d.cts.map +1 -0
- package/dist/AWSScheduledFunction-KP6lqbsW.mjs +254 -0
- package/dist/AWSScheduledFunction-KP6lqbsW.mjs.map +1 -0
- package/dist/{Construct-B1vGBPme.mjs → Construct-BWF5HxaM.mjs} +37 -47
- package/dist/Construct-BWF5HxaM.mjs.map +1 -0
- package/dist/Construct-JlyQkBkv.d.cts +117 -0
- package/dist/Construct-JlyQkBkv.d.cts.map +1 -0
- package/dist/{Construct-DUSXuTHP.cjs → Construct-TGIM_E4o.cjs} +88 -67
- package/dist/Construct-TGIM_E4o.cjs.map +1 -0
- package/dist/Construct-pxwC6fDD.d.mts +117 -0
- package/dist/Construct-pxwC6fDD.d.mts.map +1 -0
- package/dist/{Endpoint-Du-NwPX2.d.mts → Endpoint-B0P_pEMr.d.mts} +85 -126
- package/dist/Endpoint-B0P_pEMr.d.mts.map +1 -0
- package/dist/{Endpoint-aCvBMPoH.d.cts → Endpoint-BLZ7r67m.d.cts} +84 -125
- package/dist/Endpoint-BLZ7r67m.d.cts.map +1 -0
- package/dist/{HonoEndpointAdaptor-PtPlbeKY.mjs → HonoEndpointAdaptor-BMVwx2cz.mjs} +69 -81
- package/dist/HonoEndpointAdaptor-BMVwx2cz.mjs.map +1 -0
- package/dist/{HonoEndpointAdaptor-zVzVLJEO.cjs → HonoEndpointAdaptor-DPDsDi-D.cjs} +77 -92
- package/dist/HonoEndpointAdaptor-DPDsDi-D.cjs.map +1 -0
- package/dist/Queue-BL68oDJ-.d.mts +66 -0
- package/dist/Queue-BL68oDJ-.d.mts.map +1 -0
- package/dist/Queue-DxJ6btRE.d.cts +66 -0
- package/dist/Queue-DxJ6btRE.d.cts.map +1 -0
- package/dist/Subscriber-BpVhcGhX.d.cts +47 -0
- package/dist/Subscriber-BpVhcGhX.d.cts.map +1 -0
- package/dist/Subscriber-DF6xsBAJ.d.mts +47 -0
- package/dist/Subscriber-DF6xsBAJ.d.mts.map +1 -0
- package/dist/Topic-DJXoDeMP.d.cts +60 -0
- package/dist/Topic-DJXoDeMP.d.cts.map +1 -0
- package/dist/Topic-DxWQBgMN.d.mts +60 -0
- package/dist/Topic-DxWQBgMN.d.mts.map +1 -0
- package/dist/adaptors/aws.cjs +205 -355
- package/dist/adaptors/aws.cjs.map +1 -1
- package/dist/adaptors/aws.d.cts +48 -126
- package/dist/adaptors/aws.d.cts.map +1 -1
- package/dist/adaptors/aws.d.mts +49 -127
- package/dist/adaptors/aws.d.mts.map +1 -1
- package/dist/adaptors/aws.mjs +178 -325
- package/dist/adaptors/aws.mjs.map +1 -1
- package/dist/adaptors/hono.cjs +9 -3
- package/dist/adaptors/hono.d.cts +15 -7
- package/dist/adaptors/hono.d.cts.map +1 -1
- package/dist/adaptors/hono.d.mts +17 -9
- package/dist/adaptors/hono.d.mts.map +1 -1
- package/dist/adaptors/hono.mjs +9 -2
- package/dist/adaptors/testing.cjs +209 -831
- package/dist/adaptors/testing.cjs.map +1 -1
- package/dist/adaptors/testing.d.cts +55 -351
- package/dist/adaptors/testing.d.cts.map +1 -1
- package/dist/adaptors/testing.d.mts +53 -349
- package/dist/adaptors/testing.d.mts.map +1 -1
- package/dist/adaptors/testing.mjs +195 -798
- package/dist/adaptors/testing.mjs.map +1 -1
- package/dist/{clone-UGJpvQnL.cjs → clone-I_WIpiFf.cjs} +8 -7
- package/dist/clone-I_WIpiFf.cjs.map +1 -0
- package/dist/{clone-EKNovYHu.mjs → clone-pdXxc0t3.mjs} +3 -3
- package/dist/clone-pdXxc0t3.mjs.map +1 -0
- package/dist/crons/index.cjs +66 -190
- package/dist/crons/index.cjs.map +1 -1
- package/dist/crons/index.d.cts +35 -70
- package/dist/crons/index.d.cts.map +1 -1
- package/dist/crons/index.d.mts +32 -70
- package/dist/crons/index.d.mts.map +1 -1
- package/dist/crons/index.mjs +63 -184
- package/dist/crons/index.mjs.map +1 -1
- package/dist/endpoints/index.cjs +761 -19
- package/dist/endpoints/index.cjs.map +1 -0
- package/dist/endpoints/index.d.cts +322 -22
- package/dist/endpoints/index.d.cts.map +1 -1
- package/dist/endpoints/index.d.mts +321 -22
- package/dist/endpoints/index.d.mts.map +1 -1
- package/dist/endpoints/index.mjs +751 -6
- package/dist/endpoints/index.mjs.map +1 -0
- package/dist/functions/index.cjs +5 -2
- package/dist/functions/index.d.cts +3 -3
- package/dist/functions/index.d.mts +3 -3
- package/dist/functions/index.mjs +5 -2
- package/dist/{functions-BFizikJU.mjs → functions-EqTloHjo.mjs} +331 -425
- package/dist/functions-EqTloHjo.mjs.map +1 -0
- package/dist/{functions-CfzJG9hK.cjs → functions-SqtCDc9c.cjs} +370 -459
- package/dist/functions-SqtCDc9c.cjs.map +1 -0
- package/dist/index-C7iynzLI.d.mts +139 -0
- package/dist/index-C7iynzLI.d.mts.map +1 -0
- package/dist/index-D4dM_WDY.d.cts +142 -0
- package/dist/index-D4dM_WDY.d.cts.map +1 -0
- package/dist/index.cjs +3 -6
- package/dist/index.d.cts +4 -27
- package/dist/index.d.mts +4 -27
- package/dist/index.mjs +3 -3
- package/dist/{Endpoint-BG4UJ9oA.mjs → lazyAccessors-CCTK19xj.mjs} +1040 -914
- package/dist/lazyAccessors-CCTK19xj.mjs.map +1 -0
- package/dist/{Endpoint-BoUg8ocM.cjs → lazyAccessors-D04oftGw.cjs} +1127 -960
- package/dist/lazyAccessors-D04oftGw.cjs.map +1 -0
- package/dist/monitors/index.cjs +49 -0
- package/dist/monitors/index.cjs.map +1 -0
- package/dist/monitors/index.d.cts +45 -0
- package/dist/monitors/index.d.cts.map +1 -0
- package/dist/monitors/index.d.mts +45 -0
- package/dist/monitors/index.d.mts.map +1 -0
- package/dist/monitors/index.mjs +48 -0
- package/dist/monitors/index.mjs.map +1 -0
- package/dist/processAudits-BJZT5gmy.cjs +92 -0
- package/dist/processAudits-BJZT5gmy.cjs.map +1 -0
- package/dist/processAudits-CwyaaSQc.mjs +80 -0
- package/dist/processAudits-CwyaaSQc.mjs.map +1 -0
- package/dist/publisher-BZgcrVPy.cjs +53 -0
- package/dist/publisher-BZgcrVPy.cjs.map +1 -0
- package/dist/publisher-CnpeMv-r.mjs +41 -0
- package/dist/publisher-CnpeMv-r.mjs.map +1 -0
- package/dist/queue/index.cjs +114 -6
- package/dist/queue/index.cjs.map +1 -0
- package/dist/queue/index.d.cts +45 -3
- package/dist/queue/index.d.cts.map +1 -0
- package/dist/queue/index.d.mts +44 -3
- package/dist/queue/index.d.mts.map +1 -0
- package/dist/queue/index.mjs +112 -3
- package/dist/queue/index.mjs.map +1 -0
- package/dist/subscribers/index.cjs +80 -111
- package/dist/subscribers/index.cjs.map +1 -1
- package/dist/subscribers/index.d.cts +43 -46
- package/dist/subscribers/index.d.cts.map +1 -1
- package/dist/subscribers/index.d.mts +42 -46
- package/dist/subscribers/index.d.mts.map +1 -1
- package/dist/subscribers/index.mjs +78 -108
- package/dist/subscribers/index.mjs.map +1 -1
- package/dist/{lambdaTelemetry-8vnmVZQ5.d.cts → telemetry-C--EgYVr.d.mts} +7 -4
- package/dist/telemetry-C--EgYVr.d.mts.map +1 -0
- package/dist/{lambdaTelemetry-8vnmVZQ5.d.mts → telemetry-Dqx-D3F7.d.cts} +7 -4
- package/dist/telemetry-Dqx-D3F7.d.cts.map +1 -0
- package/dist/topic/index.cjs +91 -3
- package/dist/topic/index.cjs.map +1 -0
- package/dist/topic/index.d.cts +32 -2
- package/dist/topic/index.d.cts.map +1 -0
- package/dist/topic/index.d.mts +32 -2
- package/dist/topic/index.d.mts.map +1 -0
- package/dist/topic/index.mjs +89 -2
- package/dist/topic/index.mjs.map +1 -0
- package/dist/{types-DMuSQeLL.d.cts → types-BdAaYDvd.d.cts} +5 -3
- package/dist/types-BdAaYDvd.d.cts.map +1 -0
- package/dist/{types-DMuSQeLL.d.mts → types-DNngH0fX.d.mts} +5 -3
- package/dist/types-DNngH0fX.d.mts.map +1 -0
- package/dist/types.d.cts +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.mjs +0 -1
- package/package.json +55 -223
- package/src/Construct.ts +209 -0
- package/src/__benchmarks__/build-time-optimization.bench.ts +274 -0
- package/src/__benchmarks__/endpoint.bench.ts +494 -0
- package/src/__benchmarks__/fixtures.ts +241 -0
- package/src/__benchmarks__/hono-adaptor.bench.ts +533 -0
- package/src/__benchmarks__/hono-server.bench.ts +249 -0
- package/src/__benchmarks__/response-builder.bench.ts +428 -0
- package/src/__benchmarks__/strategies/strategy-a-lazy-services.ts +319 -0
- package/src/__benchmarks__/strategies/strategy-c-middleware.ts +530 -0
- package/src/__benchmarks__/strategies/strategy-d-opt-in-events.ts +567 -0
- package/src/__tests__/Construct.environment.spec.ts +704 -0
- package/src/__tests__/builder-reuse.spec.ts +587 -0
- package/src/__tests__/monitor.spec.ts +636 -0
- package/src/__tests__/publisher.setting.spec.ts +508 -0
- package/src/__tests__/publisher.spec.ts +452 -0
- package/src/adaptors/aws.ts +6 -0
- package/src/adaptors/hono.ts +1 -0
- package/src/adaptors/testing.ts +11 -0
- package/src/clone.ts +38 -0
- package/src/crons/AWSScheduledFunction.ts +73 -0
- package/src/crons/Cron.ts +149 -0
- package/src/crons/CronBuilder.ts +261 -0
- package/src/crons/__tests__/AWSScheduledFunction.spec.ts +152 -0
- package/src/crons/__tests__/Cron.spec.ts +472 -0
- package/src/crons/__tests__/CronBuilder.state-isolation.spec.ts +273 -0
- package/src/crons/index.ts +12 -0
- package/src/endpoints/AmazonApiGatewayEndpointAdaptor.ts +698 -0
- package/src/endpoints/AmazonApiGatewayV1EndpointAdaptor.ts +105 -0
- package/src/endpoints/AmazonApiGatewayV2EndpointAdaptor.ts +97 -0
- package/src/endpoints/Authorizer.ts +152 -0
- package/src/endpoints/Endpoint.ts +1287 -0
- package/src/endpoints/EndpointBuilder.ts +749 -0
- package/src/endpoints/EndpointFactory.ts +1179 -0
- package/src/endpoints/HonoEndpointAdaptor.ts +692 -0
- package/src/endpoints/MswEndpointAdaptor.ts +226 -0
- package/src/endpoints/TestEndpointAdaptor.ts +466 -0
- package/src/endpoints/__tests__/AmazonApiGatewayV1EndpointAdaptor.audits.spec.ts +499 -0
- package/src/endpoints/__tests__/AmazonApiGatewayV1EndpointAdaptor.events.spec.ts +560 -0
- package/src/endpoints/__tests__/AmazonApiGatewayV1EndpointAdaptor.spec.ts +1304 -0
- package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.audits.spec.ts +626 -0
- package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.events.spec.ts +732 -0
- package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.factory-publisher.spec.ts +296 -0
- package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.kysely-audit.integration.spec.ts +951 -0
- package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.responseType.spec.ts +111 -0
- package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.rls.spec.ts +307 -0
- package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.spec.ts +629 -0
- package/src/endpoints/__tests__/Authorizer.spec.ts +286 -0
- package/src/endpoints/__tests__/Endpoint.cookies.spec.ts +207 -0
- package/src/endpoints/__tests__/Endpoint.headers.spec.ts +187 -0
- package/src/endpoints/__tests__/Endpoint.manifest.spec.ts +175 -0
- package/src/endpoints/__tests__/Endpoint.spec.ts +857 -0
- package/src/endpoints/__tests__/EndpointBuilder.audit.spec.ts +451 -0
- package/src/endpoints/__tests__/EndpointBuilder.responseType.spec.ts +50 -0
- package/src/endpoints/__tests__/EndpointBuilder.spec.ts +531 -0
- package/src/endpoints/__tests__/EndpointFactory.authorizers.spec.ts +492 -0
- package/src/endpoints/__tests__/EndpointFactory.database-auditor.spec.ts +509 -0
- package/src/endpoints/__tests__/EndpointFactory.reference-audit.spec.ts +190 -0
- package/src/endpoints/__tests__/EndpointFactory.spec.ts +479 -0
- package/src/endpoints/__tests__/EndpointFactory.state-isolation.spec.ts +155 -0
- package/src/endpoints/__tests__/HonoEndpointAdaptor.audit-transactions.spec.ts +703 -0
- package/src/endpoints/__tests__/HonoEndpointAdaptor.audits.spec.ts +632 -0
- package/src/endpoints/__tests__/HonoEndpointAdaptor.events.spec.ts +577 -0
- package/src/endpoints/__tests__/HonoEndpointAdaptor.kysely-audit.integration.spec.ts +1067 -0
- package/src/endpoints/__tests__/HonoEndpointAdaptor.openapi.spec.ts +317 -0
- package/src/endpoints/__tests__/HonoEndpointAdaptor.pgboss-publisher.spec.ts +289 -0
- package/src/endpoints/__tests__/HonoEndpointAdaptor.responseType.spec.ts +128 -0
- package/src/endpoints/__tests__/HonoEndpointAdaptor.spec.ts +1207 -0
- package/src/endpoints/__tests__/MswEndpointAdaptor.spec.ts +211 -0
- package/src/endpoints/__tests__/ResponseBuilder.spec.ts +235 -0
- package/src/endpoints/__tests__/TestEndpointAdaptor.audits.spec.ts +602 -0
- package/src/endpoints/__tests__/TestEndpointAdaptor.spec.ts +1044 -0
- package/src/endpoints/__tests__/__snapshots__/HonoEndpointAdaptor.spec.ts.snap +54 -0
- package/src/endpoints/__tests__/endpoint-types.test.ts +88 -0
- package/src/endpoints/__tests__/helpers.spec.ts +37 -0
- package/src/endpoints/__tests__/lazyAccessors.spec.ts +330 -0
- package/src/endpoints/__tests__/processAudits.spec.ts +631 -0
- package/src/endpoints/audit.ts +87 -0
- package/src/endpoints/helpers.ts +98 -0
- package/src/endpoints/index.ts +42 -0
- package/src/endpoints/lazyAccessors.ts +241 -0
- package/src/endpoints/parseHonoQuery.ts +16 -0
- package/src/endpoints/parseQueryParams.ts +32 -0
- package/src/endpoints/processAudits.ts +371 -0
- package/src/endpoints/rls.ts +67 -0
- package/src/functions/AWSLambdaFunction.ts +374 -0
- package/src/functions/BaseFunctionBuilder.ts +212 -0
- package/src/functions/Function.ts +238 -0
- package/src/functions/FunctionBuilder.ts +381 -0
- package/src/functions/FunctionExecutionWrapper.ts +216 -0
- package/src/functions/TestFunctionAdaptor.ts +252 -0
- package/src/functions/__tests__/AWSLambdaFunctionAdaptor.spec.ts +513 -0
- package/src/functions/__tests__/Function.audits.spec.ts +393 -0
- package/src/functions/__tests__/Function.spec.ts +477 -0
- package/src/functions/__tests__/FunctionBuilder.state-isolation.spec.ts +250 -0
- package/src/functions/__tests__/TestFunctionAdaptor.spec.ts +480 -0
- package/src/functions/index.ts +12 -0
- package/src/index.ts +29 -0
- package/src/monitor.ts +145 -0
- package/src/monitors/heartbeat.ts +86 -0
- package/src/monitors/index.ts +6 -0
- package/src/publisher.ts +93 -0
- package/src/queue/AWSLambdaQueueAdaptor.ts +162 -0
- package/src/queue/Queue.ts +128 -0
- package/src/queue/QueueBuilder.ts +115 -0
- package/src/queue/TestQueueAdaptor.ts +63 -0
- package/src/queue/__tests__/QueueBuilder.spec.ts +137 -0
- package/src/queue/index.ts +12 -0
- package/src/subscribers/AWSLambdaSubscriberAdaptor.ts +342 -0
- package/src/subscribers/Subscriber.ts +117 -0
- package/src/subscribers/SubscriberBuilder.ts +183 -0
- package/src/subscribers/TestSubscriberAdaptor.ts +133 -0
- package/src/subscribers/__tests__/AWSLambdaSubscriberAdaptor.spec.ts +1018 -0
- package/src/subscribers/__tests__/Subscriber.spec.ts +430 -0
- package/src/subscribers/__tests__/TestSubscriberAdaptor.spec.ts +652 -0
- package/src/subscribers/index.ts +6 -0
- package/src/telemetry.ts +103 -0
- package/src/topic/Topic.ts +103 -0
- package/src/topic/TopicBuilder.ts +53 -0
- package/src/topic/__tests__/TopicBuilder.spec.ts +82 -0
- package/src/topic/index.ts +11 -0
- package/src/types.ts +13 -0
- package/test.ts +91 -0
- package/tsconfig.json +9 -0
- package/tsdown.config.ts +35 -0
- package/dist/Construct-B1vGBPme.mjs.map +0 -1
- package/dist/Construct-BQALFCh2.d.cts +0 -230
- package/dist/Construct-BQALFCh2.d.cts.map +0 -1
- package/dist/Construct-DUSXuTHP.cjs.map +0 -1
- package/dist/Construct-QXnl3VqT.d.mts +0 -230
- package/dist/Construct-QXnl3VqT.d.mts.map +0 -1
- package/dist/Cron-DI3nKoic.d.cts +0 -45
- package/dist/Cron-DI3nKoic.d.cts.map +0 -1
- package/dist/Cron-uYAHPnp7.d.mts +0 -45
- package/dist/Cron-uYAHPnp7.d.mts.map +0 -1
- package/dist/CronBuilder-C0Ek1-RA.cjs +0 -121
- package/dist/CronBuilder-C0Ek1-RA.cjs.map +0 -1
- package/dist/CronBuilder-DaSUm2Na.d.mts +0 -47
- package/dist/CronBuilder-DaSUm2Na.d.mts.map +0 -1
- package/dist/CronBuilder-Dmix_Pen.mjs +0 -109
- package/dist/CronBuilder-Dmix_Pen.mjs.map +0 -1
- package/dist/CronBuilder-g1lZLWyG.d.cts +0 -47
- package/dist/CronBuilder-g1lZLWyG.d.cts.map +0 -1
- package/dist/Endpoint-BG4UJ9oA.mjs.map +0 -1
- package/dist/Endpoint-BoUg8ocM.cjs.map +0 -1
- package/dist/Endpoint-Du-NwPX2.d.mts.map +0 -1
- package/dist/Endpoint-aCvBMPoH.d.cts.map +0 -1
- package/dist/EndpointFactory-BDtsrEvJ.mjs +0 -791
- package/dist/EndpointFactory-BDtsrEvJ.mjs.map +0 -1
- package/dist/EndpointFactory-DJ7gXLpR.cjs +0 -833
- package/dist/EndpointFactory-DJ7gXLpR.cjs.map +0 -1
- package/dist/EndpointFactory-DMYdJCOj.d.mts +0 -363
- package/dist/EndpointFactory-DMYdJCOj.d.mts.map +0 -1
- package/dist/EndpointFactory-I7s1co3Y.d.cts +0 -363
- package/dist/EndpointFactory-I7s1co3Y.d.cts.map +0 -1
- package/dist/Function-DuqGcbOI.d.mts +0 -76
- package/dist/Function-DuqGcbOI.d.mts.map +0 -1
- package/dist/Function-Pu-1kKZz.d.cts +0 -76
- package/dist/Function-Pu-1kKZz.d.cts.map +0 -1
- package/dist/HonoEndpointAdaptor-PtPlbeKY.mjs.map +0 -1
- package/dist/HonoEndpointAdaptor-zVzVLJEO.cjs.map +0 -1
- package/dist/Queue-A3wfD0it.cjs +0 -109
- package/dist/Queue-A3wfD0it.cjs.map +0 -1
- package/dist/Queue-D6USGS4q.mjs +0 -104
- package/dist/Queue-D6USGS4q.mjs.map +0 -1
- package/dist/Queue-DlsHRzUp.d.mts +0 -105
- package/dist/Queue-DlsHRzUp.d.mts.map +0 -1
- package/dist/Queue-HPyi0e1i.d.cts +0 -105
- package/dist/Queue-HPyi0e1i.d.cts.map +0 -1
- package/dist/QueueBuilder-BjuF0UBl.cjs +0 -135
- package/dist/QueueBuilder-BjuF0UBl.cjs.map +0 -1
- package/dist/QueueBuilder-Cue73M4t.mjs +0 -118
- package/dist/QueueBuilder-Cue73M4t.mjs.map +0 -1
- package/dist/QueueBuilder-OSi6LkV9.d.cts +0 -75
- package/dist/QueueBuilder-OSi6LkV9.d.cts.map +0 -1
- package/dist/QueueBuilder-QHsnVt1P.d.mts +0 -75
- package/dist/QueueBuilder-QHsnVt1P.d.mts.map +0 -1
- package/dist/Subscriber-Bpp02cGr.d.cts +0 -61
- package/dist/Subscriber-Bpp02cGr.d.cts.map +0 -1
- package/dist/Subscriber-CtN9R48-.d.mts +0 -61
- package/dist/Subscriber-CtN9R48-.d.mts.map +0 -1
- package/dist/SubscriberBuilder-CDy4nHCz.mjs +0 -134
- package/dist/SubscriberBuilder-CDy4nHCz.mjs.map +0 -1
- package/dist/SubscriberBuilder-CuCMFpYW.d.mts +0 -67
- package/dist/SubscriberBuilder-CuCMFpYW.d.mts.map +0 -1
- package/dist/SubscriberBuilder-D_owVoHo.cjs +0 -145
- package/dist/SubscriberBuilder-D_owVoHo.cjs.map +0 -1
- package/dist/SubscriberBuilder-g3fAVWgs.d.cts +0 -67
- package/dist/SubscriberBuilder-g3fAVWgs.d.cts.map +0 -1
- package/dist/Topic-D74b5cgs.mjs +0 -99
- package/dist/Topic-D74b5cgs.mjs.map +0 -1
- package/dist/Topic-GHxcU8AG.cjs +0 -104
- package/dist/Topic-GHxcU8AG.cjs.map +0 -1
- package/dist/auth-BMCJN30Y.d.cts +0 -268
- package/dist/auth-BMCJN30Y.d.cts.map +0 -1
- package/dist/auth-CcuceLYo.d.mts +0 -268
- package/dist/auth-CcuceLYo.d.mts.map +0 -1
- package/dist/auth.cjs +0 -433
- package/dist/auth.cjs.map +0 -1
- package/dist/auth.d.cts +0 -2
- package/dist/auth.d.mts +0 -2
- package/dist/auth.mjs +0 -426
- package/dist/auth.mjs.map +0 -1
- package/dist/cache-CXh6GIgb.d.mts +0 -44
- package/dist/cache-CXh6GIgb.d.mts.map +0 -1
- package/dist/cache-DnGDGly3.d.cts +0 -44
- package/dist/cache-DnGDGly3.d.cts.map +0 -1
- package/dist/cache.cjs +0 -69
- package/dist/cache.cjs.map +0 -1
- package/dist/cache.d.cts +0 -2
- package/dist/cache.d.mts +0 -2
- package/dist/cache.mjs +0 -68
- package/dist/cache.mjs.map +0 -1
- package/dist/cipher-C1lEFX63.mjs +0 -225
- package/dist/cipher-C1lEFX63.mjs.map +0 -1
- package/dist/cipher-CVxfwLjk.cjs +0 -332
- package/dist/cipher-CVxfwLjk.cjs.map +0 -1
- package/dist/clone-EKNovYHu.mjs.map +0 -1
- package/dist/clone-UGJpvQnL.cjs.map +0 -1
- package/dist/construct-interface-B1AfqRl4.d.cts +0 -162
- package/dist/construct-interface-B1AfqRl4.d.cts.map +0 -1
- package/dist/construct-interface-DluK3_da.d.mts +0 -162
- package/dist/construct-interface-DluK3_da.d.mts.map +0 -1
- package/dist/construct-interface.cjs +0 -114
- package/dist/construct-interface.cjs.map +0 -1
- package/dist/construct-interface.d.cts +0 -2
- package/dist/construct-interface.d.mts +0 -2
- package/dist/construct-interface.mjs +0 -107
- package/dist/construct-interface.mjs.map +0 -1
- package/dist/credential.cjs +0 -156
- package/dist/credential.cjs.map +0 -1
- package/dist/credential.d.cts +0 -86
- package/dist/credential.d.cts.map +0 -1
- package/dist/credential.d.mts +0 -86
- package/dist/credential.d.mts.map +0 -1
- package/dist/credential.mjs +0 -152
- package/dist/credential.mjs.map +0 -1
- package/dist/database/kysely.cjs +0 -4
- package/dist/database/kysely.d.cts +0 -2
- package/dist/database/kysely.d.mts +0 -2
- package/dist/database/kysely.mjs +0 -2
- package/dist/email.cjs +0 -72
- package/dist/email.cjs.map +0 -1
- package/dist/email.d.cts +0 -46
- package/dist/email.d.cts.map +0 -1
- package/dist/email.d.mts +0 -46
- package/dist/email.d.mts.map +0 -1
- package/dist/email.mjs +0 -71
- package/dist/email.mjs.map +0 -1
- package/dist/encryption.cjs +0 -96
- package/dist/encryption.cjs.map +0 -1
- package/dist/encryption.d.cts +0 -117
- package/dist/encryption.d.cts.map +0 -1
- package/dist/encryption.d.mts +0 -117
- package/dist/encryption.d.mts.map +0 -1
- package/dist/encryption.mjs +0 -83
- package/dist/encryption.mjs.map +0 -1
- package/dist/external-api-MJ8id87V.d.mts +0 -105
- package/dist/external-api-MJ8id87V.d.mts.map +0 -1
- package/dist/external-api-O107yzZJ.d.cts +0 -105
- package/dist/external-api-O107yzZJ.d.cts.map +0 -1
- package/dist/external-api.cjs +0 -142
- package/dist/external-api.cjs.map +0 -1
- package/dist/external-api.d.cts +0 -2
- package/dist/external-api.d.mts +0 -2
- package/dist/external-api.mjs +0 -139
- package/dist/external-api.mjs.map +0 -1
- package/dist/file-server.cjs +0 -186
- package/dist/file-server.cjs.map +0 -1
- package/dist/file-server.d.cts +0 -152
- package/dist/file-server.d.cts.map +0 -1
- package/dist/file-server.d.mts +0 -152
- package/dist/file-server.d.mts.map +0 -1
- package/dist/file-server.mjs +0 -184
- package/dist/file-server.mjs.map +0 -1
- package/dist/functions-BFizikJU.mjs.map +0 -1
- package/dist/functions-CfzJG9hK.cjs.map +0 -1
- package/dist/index-BuzRvKOQ.d.cts +0 -115
- package/dist/index-BuzRvKOQ.d.cts.map +0 -1
- package/dist/index-CTkKOer4.d.mts +0 -115
- package/dist/index-CTkKOer4.d.mts.map +0 -1
- package/dist/index-CeEtxDmK.d.cts +0 -79
- package/dist/index-CeEtxDmK.d.cts.map +0 -1
- package/dist/index-CeEtxDmK.d.mts +0 -79
- package/dist/index-CeEtxDmK.d.mts.map +0 -1
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/kms-B-Hm3d5r.cjs +0 -85
- package/dist/kms-B-Hm3d5r.cjs.map +0 -1
- package/dist/kms-BdUlMJEZ.mjs +0 -85
- package/dist/kms-BdUlMJEZ.mjs.map +0 -1
- package/dist/kysely-Bii4l6eP.mjs +0 -370
- package/dist/kysely-Bii4l6eP.mjs.map +0 -1
- package/dist/kysely-CO_Dk43W.cjs +0 -383
- package/dist/kysely-CO_Dk43W.cjs.map +0 -1
- package/dist/kysely-D0bpzgPs.d.cts +0 -175
- package/dist/kysely-D0bpzgPs.d.cts.map +0 -1
- package/dist/kysely-DUqC3Ie0.d.mts +0 -175
- package/dist/kysely-DUqC3Ie0.d.mts.map +0 -1
- package/dist/lambdaTelemetry-8vnmVZQ5.d.cts.map +0 -1
- package/dist/lambdaTelemetry-8vnmVZQ5.d.mts.map +0 -1
- package/dist/lazyAccessors-CFanua0O.mjs +0 -174
- package/dist/lazyAccessors-CFanua0O.mjs.map +0 -1
- package/dist/lazyAccessors-hJKGv8Ay.cjs +0 -221
- package/dist/lazyAccessors-hJKGv8Ay.cjs.map +0 -1
- package/dist/mobile-app.cjs +0 -73
- package/dist/mobile-app.cjs.map +0 -1
- package/dist/mobile-app.d.cts +0 -61
- package/dist/mobile-app.d.cts.map +0 -1
- package/dist/mobile-app.d.mts +0 -61
- package/dist/mobile-app.d.mts.map +0 -1
- package/dist/mobile-app.mjs +0 -72
- package/dist/mobile-app.mjs.map +0 -1
- package/dist/object-storage.cjs +0 -56
- package/dist/object-storage.cjs.map +0 -1
- package/dist/object-storage.d.cts +0 -32
- package/dist/object-storage.d.cts.map +0 -1
- package/dist/object-storage.d.mts +0 -32
- package/dist/object-storage.d.mts.map +0 -1
- package/dist/object-storage.mjs +0 -55
- package/dist/object-storage.mjs.map +0 -1
- package/dist/processAudits-BRRVVHUB.mjs +0 -131
- package/dist/processAudits-BRRVVHUB.mjs.map +0 -1
- package/dist/processAudits-DasOZjPl.cjs +0 -154
- package/dist/processAudits-DasOZjPl.cjs.map +0 -1
- package/dist/rest-api.cjs +0 -216
- package/dist/rest-api.cjs.map +0 -1
- package/dist/rest-api.d.cts +0 -241
- package/dist/rest-api.d.cts.map +0 -1
- package/dist/rest-api.d.mts +0 -241
- package/dist/rest-api.d.mts.map +0 -1
- package/dist/rest-api.mjs +0 -215
- package/dist/rest-api.mjs.map +0 -1
- package/dist/rolldown-runtime-y5ARvAq5.cjs +0 -35
- package/dist/runSubscriber-BHvJ8POr.mjs +0 -109
- package/dist/runSubscriber-BHvJ8POr.mjs.map +0 -1
- package/dist/runSubscriber-D8nLXIv1.cjs +0 -126
- package/dist/runSubscriber-D8nLXIv1.cjs.map +0 -1
- package/dist/shutdown-BMJmAhSt.cjs +0 -38
- package/dist/shutdown-BMJmAhSt.cjs.map +0 -1
- package/dist/shutdown-C7xa8x9S.mjs +0 -27
- package/dist/shutdown-C7xa8x9S.mjs.map +0 -1
- package/dist/site.cjs +0 -74
- package/dist/site.cjs.map +0 -1
- package/dist/site.d.cts +0 -104
- package/dist/site.d.cts.map +0 -1
- package/dist/site.d.mts +0 -104
- package/dist/site.d.mts.map +0 -1
- package/dist/site.mjs +0 -73
- package/dist/site.mjs.map +0 -1
- package/dist/stages-BSCF19o2.d.cts +0 -56
- package/dist/stages-BSCF19o2.d.cts.map +0 -1
- package/dist/stages-BSCF19o2.d.mts +0 -56
- package/dist/stages-BSCF19o2.d.mts.map +0 -1
- package/dist/surfaceEnv-CNimK76p.cjs +0 -56
- package/dist/surfaceEnv-CNimK76p.cjs.map +0 -1
- package/dist/surfaceEnv-wMT5QzgZ.mjs +0 -45
- package/dist/surfaceEnv-wMT5QzgZ.mjs.map +0 -1
- package/dist/telemetry-B48RLjyk.d.cts +0 -40
- package/dist/telemetry-B48RLjyk.d.cts.map +0 -1
- package/dist/telemetry-DRtT1_0A.d.mts +0 -40
- package/dist/telemetry-DRtT1_0A.d.mts.map +0 -1
- package/dist/telemetry.cjs +0 -56
- package/dist/telemetry.cjs.map +0 -1
- package/dist/telemetry.d.cts +0 -2
- package/dist/telemetry.d.mts +0 -2
- package/dist/telemetry.mjs +0 -55
- package/dist/telemetry.mjs.map +0 -1
- package/dist/tracing-CxaZ98IB.mjs +0 -110
- package/dist/tracing-CxaZ98IB.mjs.map +0 -1
- package/dist/tracing-DPMidF_r.cjs +0 -127
- package/dist/tracing-DPMidF_r.cjs.map +0 -1
- package/dist/types-DMuSQeLL.d.cts.map +0 -1
- package/dist/types-DMuSQeLL.d.mts.map +0 -1
- package/dist/worker.cjs +0 -191
- package/dist/worker.cjs.map +0 -1
- package/dist/worker.d.cts +0 -171
- package/dist/worker.d.cts.map +0 -1
- package/dist/worker.d.mts +0 -171
- package/dist/worker.d.mts.map +0 -1
- package/dist/worker.mjs +0 -190
- package/dist/worker.mjs.map +0 -1
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import { n as Construct } from "./construct-interface-DluK3_da.mjs";
|
|
2
|
-
import { t as Cache } from "./cache-CXh6GIgb.mjs";
|
|
3
|
-
import { ConstructName, Declaration, PostgresVersion } from "@geekmidas/manifest";
|
|
4
|
-
import { Kysely, KyselyConfig } from "kysely";
|
|
5
|
-
import { Service } from "@geekmidas/services";
|
|
6
|
-
import pg from "pg";
|
|
7
|
-
//#region src/database/pool.d.ts
|
|
8
|
-
/**
|
|
9
|
-
* End every pool opened, waiting for checked-out connections to come back.
|
|
10
|
-
* For a server's shutdown, after it has stopped taking requests.
|
|
11
|
-
*/
|
|
12
|
-
declare function closeDatabasePools(): Promise<void>;
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/database/kysely.d.ts
|
|
15
|
-
/**
|
|
16
|
-
* Everything Kysely takes, plus what this construct declares.
|
|
17
|
-
*
|
|
18
|
-
* `dialect` is omitted because the construct owns it — it is built from the one
|
|
19
|
-
* URL the adapter supplied, which is the whole point of the construct. The rest
|
|
20
|
-
* of `KyselyConfig` (`plugins`, `log`) is the app's business and passes
|
|
21
|
-
* straight through, so anything Kysely adds later arrives without being
|
|
22
|
-
* tracked here.
|
|
23
|
-
*/
|
|
24
|
-
interface KyselyDatabaseOptions extends Omit<KyselyConfig, 'dialect'> {
|
|
25
|
-
/**
|
|
26
|
-
* The schema, pinned on both roles' `search_path`.
|
|
27
|
-
*
|
|
28
|
-
* Defaults to `app` — the role the schema plays, rather than a restatement
|
|
29
|
-
* of the database's own name, which reads correctly beside `auth` and
|
|
30
|
-
* `pgboss` and keeps the application off `public`.
|
|
31
|
-
*/
|
|
32
|
-
schema?: string;
|
|
33
|
-
/**
|
|
34
|
-
* Provision the owner/runtime role split. Defaults to on.
|
|
35
|
-
*
|
|
36
|
-
* Off falls back to the cluster's master credential in both URLs, giving up
|
|
37
|
-
* the DDL/DML split and putting credentials that can drop a table into the
|
|
38
|
-
* function's environment. A deliberate downgrade, not a default.
|
|
39
|
-
*/
|
|
40
|
-
roles?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* The Postgres major version to provision.
|
|
43
|
-
*
|
|
44
|
-
* Declared here so one statement reaches both targets. It was previously
|
|
45
|
-
* set in two unrelated places — a container tag locally, nothing at all on
|
|
46
|
-
* AWS (so Aurora chose) — which is how local came to run 18 while deployed
|
|
47
|
-
* ran 17.7 with nothing recording the difference.
|
|
48
|
-
*
|
|
49
|
-
* Defaults to {@link DEFAULT_POSTGRES_VERSION}.
|
|
50
|
-
*/
|
|
51
|
-
version?: PostgresVersion;
|
|
52
|
-
/**
|
|
53
|
-
* End each query run inside a request with a comment naming what ran it —
|
|
54
|
-
* `/*operation='POST /orders',request_id='…'*\/` — so `pg_stat_activity`
|
|
55
|
-
* and the server's logs can tie a query to its endpoint — and, inside a
|
|
56
|
-
* trace, with the query span's `traceparent='00-…'` (sqlcommenter), so
|
|
57
|
-
* they can tie it to the trace too. Defaults to on.
|
|
58
|
-
*/
|
|
59
|
-
queryTags?: boolean;
|
|
60
|
-
}
|
|
61
|
-
/** What makes a construct derived rather than a database in its own right. */
|
|
62
|
-
interface DerivedFrom {
|
|
63
|
-
kind: 'database-reader' | 'database-schema';
|
|
64
|
-
of: string;
|
|
65
|
-
schema?: string;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* @typeParam DB - the database's schema.
|
|
69
|
-
* @typeParam TName - the canonical id. TypeScript has no partial
|
|
70
|
-
* type-argument inference, so `new KyselyDatabase<OrdersDB>('orders')` leaves
|
|
71
|
-
* this at its default and the service key widens to `string`. `db` still types
|
|
72
|
-
* through `.database()`, which infers from the service.
|
|
73
|
-
*/
|
|
74
|
-
declare class KyselyDatabase<DB = unknown, TName extends string = string> implements Construct<TName, Kysely<DB>> {
|
|
75
|
-
private readonly options;
|
|
76
|
-
readonly id: TName;
|
|
77
|
-
readonly service: Service<Uncapitalize<TName>, Kysely<DB>>;
|
|
78
|
-
/**
|
|
79
|
-
* Declared once and read by both `declare()` and `connect()`, so the key the
|
|
80
|
-
* build publishes and the key the client reads cannot drift.
|
|
81
|
-
*/
|
|
82
|
-
private readonly config;
|
|
83
|
-
private readonly schemaName;
|
|
84
|
-
private readonly roles;
|
|
85
|
-
private readonly version;
|
|
86
|
-
private readonly derivedFrom?;
|
|
87
|
-
constructor(id: ConstructName<TName>, options?: KyselyDatabaseOptions, derivedFrom?: DerivedFrom);
|
|
88
|
-
declare(): Declaration[];
|
|
89
|
-
/**
|
|
90
|
-
* A read-only endpoint on this database.
|
|
91
|
-
*
|
|
92
|
-
* Read-only is enforced by the reader role's grants rather than by which
|
|
93
|
-
* endpoint it resolves to, so falling back to the writer where no replica
|
|
94
|
-
* exists is safe rather than a silently writable connection behind a name
|
|
95
|
-
* that says reader. There is no `writer()`: the database *is* the writer, so
|
|
96
|
-
* a replica can never be reached by accident.
|
|
97
|
-
*
|
|
98
|
-
* The return type is narrower than this class on purpose — see
|
|
99
|
-
* {@link ReadOnlyDatabase}.
|
|
100
|
-
*/
|
|
101
|
-
reader(): ReadOnlyDatabase<DB, `${TName}Reader`>;
|
|
102
|
-
/**
|
|
103
|
-
* A cache that lives in this database.
|
|
104
|
-
*
|
|
105
|
-
* The same strengthening `schema()` is over a second database: `new
|
|
106
|
-
* Cache('Sessions')` says the app caches and leaves where to the deployment,
|
|
107
|
-
* while this says it caches *here* — which is a fact about the application
|
|
108
|
-
* and so belongs in its code.
|
|
109
|
-
*
|
|
110
|
-
* What it buys beyond being explicit: the table's schema and the role that
|
|
111
|
-
* reaches it come from this database rather than from a second convention,
|
|
112
|
-
* and the backend no longer has to guess which database "the database" meant
|
|
113
|
-
* when an app declares two.
|
|
114
|
-
*
|
|
115
|
-
* A cache is not a `KyselyDatabase`, so this returns a `Cache` — the client
|
|
116
|
-
* is a key/value store, not a query builder, and typing it as the parent
|
|
117
|
-
* would be a convenience that lies.
|
|
118
|
-
*/
|
|
119
|
-
cache<TCache extends string = `${TName}Cache`>(id?: ConstructName<TCache>, options?: {
|
|
120
|
-
table?: string;
|
|
121
|
-
}): Cache<TCache>;
|
|
122
|
-
/**
|
|
123
|
-
* A second schema in this database, with its own role(s) and its own URL —
|
|
124
|
-
* so this database's role holds no grant on those tables at all.
|
|
125
|
-
*
|
|
126
|
-
* Typed separately because a tenant has its own tables: the point is that
|
|
127
|
-
* `auth.selectFrom('sessions')` type-checks and
|
|
128
|
-
* `orders.selectFrom('sessions')` does not.
|
|
129
|
-
*/
|
|
130
|
-
schema<TenantDB, TTenant extends string>(id: ConstructName<TTenant>, options?: KyselyDatabaseOptions): KyselyDatabase<TenantDB, TTenant>;
|
|
131
|
-
/**
|
|
132
|
-
* A connection as the *owner* role — the one that may create, alter and drop.
|
|
133
|
-
*
|
|
134
|
-
* A `Service` rather than part of the construct, and deliberately so: a
|
|
135
|
-
* construct is what `.dependsOn()` accepts, and nothing should be able to
|
|
136
|
-
* depend on this. A migrator asks for it by name; a handler cannot ask at
|
|
137
|
-
* all, which is the security property the role split exists for.
|
|
138
|
-
*
|
|
139
|
-
* Falls back to the runtime URL where no owner URL was published — the
|
|
140
|
-
* `roles: false` downgrade, where there is only one credential and it is the
|
|
141
|
-
* cluster master's.
|
|
142
|
-
*/
|
|
143
|
-
get owner(): Service<`${Uncapitalize<TName>}Owner`, Kysely<DB>>;
|
|
144
|
-
/**
|
|
145
|
-
* What this database's clients are built with besides a dialect — the
|
|
146
|
-
* plugins and logging it was declared with.
|
|
147
|
-
*
|
|
148
|
-
* Public so that whatever opens a connection to it outside \`connect()\` —
|
|
149
|
-
* a test's transaction — builds the same client. A test that dropped the
|
|
150
|
-
* plugins would write \`createdAt\` where production writes \`created_at\`.
|
|
151
|
-
*/
|
|
152
|
-
get clientConfig(): Omit<KyselyConfig, 'dialect'>;
|
|
153
|
-
private connect;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* A database you may read through, and derive nothing from.
|
|
157
|
-
*
|
|
158
|
-
* A reader is terminal in the graph, and this is that fact in the type system.
|
|
159
|
-
* `DERIVES_FROM` gives `cache` and `database-schema` no `database-reader`
|
|
160
|
-
* parent, and there is no reader of a reader — so `orders.reader().cache(…)`
|
|
161
|
-
* has always been illegal, but it type-checked and failed later at
|
|
162
|
-
* `assertDerivations`. That is a long way round to learn that a read-only
|
|
163
|
-
* endpoint cannot own a table something writes to.
|
|
164
|
-
*
|
|
165
|
-
* Omitting the three deriving methods rather than making them throw keeps the
|
|
166
|
-
* failure where it costs least: the editor, on the line that wrote it.
|
|
167
|
-
*
|
|
168
|
-
* The result is deliberately not assignable back to `KyselyDatabase` — a
|
|
169
|
-
* reader is not one, and anything that genuinely needs the writer should say
|
|
170
|
-
* so.
|
|
171
|
-
*/
|
|
172
|
-
type ReadOnlyDatabase<DB, TName extends string> = Omit<KyselyDatabase<DB, TName>, 'reader' | 'cache' | 'schema'>;
|
|
173
|
-
//#endregion
|
|
174
|
-
export { closeDatabasePools as i, KyselyDatabaseOptions as n, ReadOnlyDatabase as r, KyselyDatabase as t };
|
|
175
|
-
//# sourceMappingURL=kysely-DUqC3Ie0.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kysely-DUqC3Ie0.d.mts","names":[],"sources":["../src/database/pool.ts","../src/database/kysely.ts"],"mappings":";;;;;;;;;;;iBAwGsB,sBAAsB;;;;;;;;;;;;UChE3B,8BAA8B,KAAK;;;;;;;;EAQnD;;;;;;;;EAQA;;;;;;;;;;;EAWA,UAAU;;;;;;;;EAQV;;;UAIS;EACT;EACA;EACA;;;;;;;;;cAUY,eAAe,cAAc,0CAC9B,UAAU,OAAO,OAAO;mBAiBjB;WAfT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ,OAAO;;;;;mBAMrC;mBACA;mBACA;mBACA;mBACA;EAEjB,YACC,IAAI,cAAc,QACD,UAAS,uBAC1B,cAAc;EAyBf,WAAW;;;;;;;;;;;;;EAqDX,UAAU,iBAAiB,OAAO;;;;;;;;;;;;;;;;;;EAyBlC,MAAM,2BAA2B,cAChC,KAAI,cAAc,SAClB;IAAW;MACT,MAAM;;;;;;;;;EAeT,OAAO,UAAU,wBAChB,IAAI,cAAc,UAClB,UAAS,wBACP,eAAe,UAAU;;;;;;;;;;;;;MAoBxB,SAAS,WAAW,aAAa,eAAe,OAAO;;;;;;;;;MAgBvD,gBAAgB,KAAK;UAcX;;;;;;;;;;;;;;;;;;;KAuCH,iBAAiB,IAAI,wBAAwB,KACxD,eAAe,IAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lambdaTelemetry-8vnmVZQ5.d.cts","names":["LambdaContext"],"sources":["../src/endpoints/lambdaTelemetry.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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lambdaTelemetry-8vnmVZQ5.d.mts","names":["LambdaContext"],"sources":["../src/endpoints/lambdaTelemetry.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,174 +0,0 @@
|
|
|
1
|
-
import { getCookie } from "hono/cookie";
|
|
2
|
-
//#region src/endpoints/lazyAccessors.ts
|
|
3
|
-
/**
|
|
4
|
-
* Create a lazy header accessor for Hono.
|
|
5
|
-
* Uses `c.req.header(name)` for single lookups (native, case-insensitive).
|
|
6
|
-
* Only calls `c.req.header()` to get all headers when needed.
|
|
7
|
-
*/
|
|
8
|
-
function createHonoHeaders(c) {
|
|
9
|
-
let allHeaders = null;
|
|
10
|
-
return ((key) => {
|
|
11
|
-
if (key !== void 0) return c.req.header(key);
|
|
12
|
-
if (!allHeaders) allHeaders = c.req.header();
|
|
13
|
-
return allHeaders;
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Create a lazy cookie accessor for Hono.
|
|
18
|
-
* Uses `getCookie(c, name)` for single lookups (native).
|
|
19
|
-
* Only parses the cookie header when all cookies are requested.
|
|
20
|
-
*/
|
|
21
|
-
function createHonoCookies(c) {
|
|
22
|
-
let allCookies = null;
|
|
23
|
-
return ((name) => {
|
|
24
|
-
if (name !== void 0) return getCookie(c, name);
|
|
25
|
-
if (!allCookies) {
|
|
26
|
-
allCookies = {};
|
|
27
|
-
const cookieHeader = c.req.header("cookie");
|
|
28
|
-
if (cookieHeader) for (const part of cookieHeader.split(";")) {
|
|
29
|
-
const trimmed = part.trim();
|
|
30
|
-
const eqIndex = trimmed.indexOf("=");
|
|
31
|
-
if (eqIndex > 0) {
|
|
32
|
-
const key = trimmed.slice(0, eqIndex);
|
|
33
|
-
const value = trimmed.slice(eqIndex + 1);
|
|
34
|
-
allCookies[key] = value;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return allCookies;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Create a lazy header accessor for API Gateway events.
|
|
43
|
-
* Handles case-insensitive lookups.
|
|
44
|
-
*/
|
|
45
|
-
function createApiGatewayHeaders(headers) {
|
|
46
|
-
let normalizedHeaders = null;
|
|
47
|
-
const normalize = () => {
|
|
48
|
-
if (!normalizedHeaders) {
|
|
49
|
-
normalizedHeaders = {};
|
|
50
|
-
if (headers) {
|
|
51
|
-
for (const [k, v] of Object.entries(headers)) if (v !== void 0) normalizedHeaders[k.toLowerCase()] = v;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return normalizedHeaders;
|
|
55
|
-
};
|
|
56
|
-
return ((key) => {
|
|
57
|
-
if (key !== void 0) {
|
|
58
|
-
if (headers) {
|
|
59
|
-
const direct = headers[key] ?? headers[key.toLowerCase()];
|
|
60
|
-
if (direct !== void 0) return direct;
|
|
61
|
-
return normalize()[key.toLowerCase()];
|
|
62
|
-
}
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
return normalize();
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Create a lazy cookie accessor for API Gateway events.
|
|
70
|
-
* Decodes URL-encoded values to match browser behavior.
|
|
71
|
-
*/
|
|
72
|
-
function createApiGatewayCookies(cookies, cookieHeader) {
|
|
73
|
-
let parsed = null;
|
|
74
|
-
const parse = () => {
|
|
75
|
-
if (!parsed) {
|
|
76
|
-
parsed = {};
|
|
77
|
-
if (cookies) for (const cookie of cookies) {
|
|
78
|
-
const eqIndex = cookie.indexOf("=");
|
|
79
|
-
if (eqIndex > 0) {
|
|
80
|
-
const key = cookie.slice(0, eqIndex);
|
|
81
|
-
const value = cookie.slice(eqIndex + 1);
|
|
82
|
-
parsed[key] = decodeURIComponent(value);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
else if (cookieHeader) for (const part of cookieHeader.split(";")) {
|
|
86
|
-
const trimmed = part.trim();
|
|
87
|
-
const eqIndex = trimmed.indexOf("=");
|
|
88
|
-
if (eqIndex > 0) {
|
|
89
|
-
const key = trimmed.slice(0, eqIndex);
|
|
90
|
-
const value = trimmed.slice(eqIndex + 1);
|
|
91
|
-
parsed[key] = decodeURIComponent(value);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return parsed;
|
|
96
|
-
};
|
|
97
|
-
return ((name) => {
|
|
98
|
-
if (name !== void 0) return parse()[name];
|
|
99
|
-
return parse();
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Create a lazy header accessor for plain object headers (test adaptor, etc).
|
|
104
|
-
* Headers are already available as an object, just provide lazy access.
|
|
105
|
-
*/
|
|
106
|
-
function createObjectHeaders(headers) {
|
|
107
|
-
let normalized = null;
|
|
108
|
-
return ((key) => {
|
|
109
|
-
if (key !== void 0) {
|
|
110
|
-
if (headers) {
|
|
111
|
-
const direct = headers[key] ?? headers[key.toLowerCase()];
|
|
112
|
-
if (direct !== void 0) return direct;
|
|
113
|
-
}
|
|
114
|
-
if (!normalized && headers) {
|
|
115
|
-
normalized = {};
|
|
116
|
-
for (const [k, v] of Object.entries(headers)) normalized[k.toLowerCase()] = v;
|
|
117
|
-
}
|
|
118
|
-
return normalized?.[key.toLowerCase()];
|
|
119
|
-
}
|
|
120
|
-
if (!normalized && headers) {
|
|
121
|
-
normalized = {};
|
|
122
|
-
for (const [k, v] of Object.entries(headers)) normalized[k.toLowerCase()] = v;
|
|
123
|
-
}
|
|
124
|
-
return normalized ?? {};
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Create a lazy cookie accessor from a cookie header string.
|
|
129
|
-
* Decodes URL-encoded values to match browser behavior.
|
|
130
|
-
*/
|
|
131
|
-
function createCookieHeaderAccessor(cookieHeader) {
|
|
132
|
-
let parsed = null;
|
|
133
|
-
const parse = () => {
|
|
134
|
-
if (!parsed) {
|
|
135
|
-
parsed = {};
|
|
136
|
-
if (cookieHeader) for (const part of cookieHeader.split(";")) {
|
|
137
|
-
const trimmed = part.trim();
|
|
138
|
-
const eqIndex = trimmed.indexOf("=");
|
|
139
|
-
if (eqIndex > 0) {
|
|
140
|
-
const key = trimmed.slice(0, eqIndex);
|
|
141
|
-
const value = trimmed.slice(eqIndex + 1);
|
|
142
|
-
parsed[key] = decodeURIComponent(value);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return parsed;
|
|
147
|
-
};
|
|
148
|
-
return ((name) => {
|
|
149
|
-
if (name !== void 0) return parse()[name];
|
|
150
|
-
return parse();
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Create a no-op header accessor (for minimal endpoints that don't use headers).
|
|
155
|
-
*/
|
|
156
|
-
function createNoopHeaders() {
|
|
157
|
-
return ((key) => {
|
|
158
|
-
if (key !== void 0) return void 0;
|
|
159
|
-
return {};
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Create a no-op cookie accessor (for minimal endpoints that don't use cookies).
|
|
164
|
-
*/
|
|
165
|
-
function createNoopCookies() {
|
|
166
|
-
return ((name) => {
|
|
167
|
-
if (name !== void 0) return void 0;
|
|
168
|
-
return {};
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
//#endregion
|
|
172
|
-
export { createHonoHeaders as a, createObjectHeaders as c, createHonoCookies as i, createApiGatewayHeaders as n, createNoopCookies as o, createCookieHeaderAccessor as r, createNoopHeaders as s, createApiGatewayCookies as t };
|
|
173
|
-
|
|
174
|
-
//# sourceMappingURL=lazyAccessors-CFanua0O.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lazyAccessors-CFanua0O.mjs","names":[],"sources":["../src/endpoints/lazyAccessors.ts"],"sourcesContent":["/**\n * Lazy header and cookie accessors for different adaptors.\n *\n * Instead of parsing all headers/cookies upfront, these accessors\n * use native adaptor methods for single lookups and only parse\n * everything when `header()` or `cookie()` is called without arguments.\n */\nimport type { Context } from 'hono';\nimport { getCookie } from 'hono/cookie';\nimport type { CookieFn, HeaderFn } from './Endpoint';\n\n/**\n * Create a lazy header accessor for Hono.\n * Uses `c.req.header(name)` for single lookups (native, case-insensitive).\n * Only calls `c.req.header()` to get all headers when needed.\n */\nexport function createHonoHeaders(c: Context): HeaderFn {\n\tlet allHeaders: Record<string, string> | null = null;\n\n\treturn ((key?: string) => {\n\t\tif (key !== undefined) {\n\t\t\t// Single header lookup - use native Hono method (case-insensitive)\n\t\t\treturn c.req.header(key);\n\t\t}\n\t\t// Get all headers - cache the result\n\t\tif (!allHeaders) {\n\t\t\tallHeaders = c.req.header();\n\t\t}\n\t\treturn allHeaders;\n\t}) as HeaderFn;\n}\n\n/**\n * Create a lazy cookie accessor for Hono.\n * Uses `getCookie(c, name)` for single lookups (native).\n * Only parses the cookie header when all cookies are requested.\n */\nexport function createHonoCookies(c: Context): CookieFn {\n\tlet allCookies: Record<string, string> | null = null;\n\n\treturn ((name?: string) => {\n\t\tif (name !== undefined) {\n\t\t\t// Single cookie lookup - use native Hono method\n\t\t\treturn getCookie(c, name);\n\t\t}\n\t\t// Get all cookies - parse and cache\n\t\tif (!allCookies) {\n\t\t\tallCookies = {};\n\t\t\tconst cookieHeader = c.req.header('cookie');\n\t\t\tif (cookieHeader) {\n\t\t\t\tfor (const part of cookieHeader.split(';')) {\n\t\t\t\t\tconst trimmed = part.trim();\n\t\t\t\t\tconst eqIndex = trimmed.indexOf('=');\n\t\t\t\t\tif (eqIndex > 0) {\n\t\t\t\t\t\tconst key = trimmed.slice(0, eqIndex);\n\t\t\t\t\t\tconst value = trimmed.slice(eqIndex + 1);\n\t\t\t\t\t\tallCookies[key] = value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn allCookies;\n\t}) as CookieFn;\n}\n\n/**\n * Create a lazy header accessor for API Gateway events.\n * Handles case-insensitive lookups.\n */\nexport function createApiGatewayHeaders(\n\theaders: Record<string, string | undefined> | null | undefined,\n): HeaderFn {\n\tlet normalizedHeaders: Record<string, string> | null = null;\n\n\tconst normalize = () => {\n\t\tif (!normalizedHeaders) {\n\t\t\tnormalizedHeaders = {};\n\t\t\tif (headers) {\n\t\t\t\tfor (const [k, v] of Object.entries(headers)) {\n\t\t\t\t\tif (v !== undefined) {\n\t\t\t\t\t\tnormalizedHeaders[k.toLowerCase()] = v;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn normalizedHeaders;\n\t};\n\n\treturn ((key?: string) => {\n\t\tif (key !== undefined) {\n\t\t\t// Try direct lookup first (common case: headers already lowercase)\n\t\t\tif (headers) {\n\t\t\t\tconst direct = headers[key] ?? headers[key.toLowerCase()];\n\t\t\t\tif (direct !== undefined) return direct;\n\t\t\t\t// Fall back to normalized lookup\n\t\t\t\treturn normalize()[key.toLowerCase()];\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}\n\t\treturn normalize();\n\t}) as HeaderFn;\n}\n\n/**\n * Create a lazy cookie accessor for API Gateway events.\n * Decodes URL-encoded values to match browser behavior.\n */\nexport function createApiGatewayCookies(\n\tcookies: string[] | undefined,\n\tcookieHeader: string | undefined,\n): CookieFn {\n\tlet parsed: Record<string, string> | null = null;\n\n\tconst parse = () => {\n\t\tif (!parsed) {\n\t\t\tparsed = {};\n\t\t\t// API Gateway v2 provides cookies as array\n\t\t\tif (cookies) {\n\t\t\t\tfor (const cookie of cookies) {\n\t\t\t\t\tconst eqIndex = cookie.indexOf('=');\n\t\t\t\t\tif (eqIndex > 0) {\n\t\t\t\t\t\tconst key = cookie.slice(0, eqIndex);\n\t\t\t\t\t\tconst value = cookie.slice(eqIndex + 1);\n\t\t\t\t\t\tparsed[key] = decodeURIComponent(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (cookieHeader) {\n\t\t\t\t// Fall back to parsing cookie header\n\t\t\t\tfor (const part of cookieHeader.split(';')) {\n\t\t\t\t\tconst trimmed = part.trim();\n\t\t\t\t\tconst eqIndex = trimmed.indexOf('=');\n\t\t\t\t\tif (eqIndex > 0) {\n\t\t\t\t\t\tconst key = trimmed.slice(0, eqIndex);\n\t\t\t\t\t\tconst value = trimmed.slice(eqIndex + 1);\n\t\t\t\t\t\tparsed[key] = decodeURIComponent(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn parsed;\n\t};\n\n\treturn ((name?: string) => {\n\t\tif (name !== undefined) {\n\t\t\treturn parse()[name];\n\t\t}\n\t\treturn parse();\n\t}) as CookieFn;\n}\n\n/**\n * Create a lazy header accessor for plain object headers (test adaptor, etc).\n * Headers are already available as an object, just provide lazy access.\n */\nexport function createObjectHeaders(\n\theaders: Record<string, string> | undefined,\n): HeaderFn {\n\tlet normalized: Record<string, string> | null = null;\n\n\treturn ((key?: string) => {\n\t\tif (key !== undefined) {\n\t\t\t// Try direct lookup first (common case)\n\t\t\tif (headers) {\n\t\t\t\tconst direct = headers[key] ?? headers[key.toLowerCase()];\n\t\t\t\tif (direct !== undefined) return direct;\n\t\t\t}\n\t\t\t// Fall back to normalized lookup for case-insensitivity\n\t\t\tif (!normalized && headers) {\n\t\t\t\tnormalized = {};\n\t\t\t\tfor (const [k, v] of Object.entries(headers)) {\n\t\t\t\t\tnormalized[k.toLowerCase()] = v;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn normalized?.[key.toLowerCase()];\n\t\t}\n\t\t// Return all headers\n\t\tif (!normalized && headers) {\n\t\t\tnormalized = {};\n\t\t\tfor (const [k, v] of Object.entries(headers)) {\n\t\t\t\tnormalized[k.toLowerCase()] = v;\n\t\t\t}\n\t\t}\n\t\treturn normalized ?? {};\n\t}) as HeaderFn;\n}\n\n/**\n * Create a lazy cookie accessor from a cookie header string.\n * Decodes URL-encoded values to match browser behavior.\n */\nexport function createCookieHeaderAccessor(\n\tcookieHeader: string | undefined,\n): CookieFn {\n\tlet parsed: Record<string, string> | null = null;\n\n\tconst parse = () => {\n\t\tif (!parsed) {\n\t\t\tparsed = {};\n\t\t\tif (cookieHeader) {\n\t\t\t\tfor (const part of cookieHeader.split(';')) {\n\t\t\t\t\tconst trimmed = part.trim();\n\t\t\t\t\tconst eqIndex = trimmed.indexOf('=');\n\t\t\t\t\tif (eqIndex > 0) {\n\t\t\t\t\t\tconst key = trimmed.slice(0, eqIndex);\n\t\t\t\t\t\tconst value = trimmed.slice(eqIndex + 1);\n\t\t\t\t\t\t// Decode URL-encoded values to match Endpoint.createCookies behavior\n\t\t\t\t\t\tparsed[key] = decodeURIComponent(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn parsed;\n\t};\n\n\treturn ((name?: string) => {\n\t\tif (name !== undefined) {\n\t\t\treturn parse()[name];\n\t\t}\n\t\treturn parse();\n\t}) as CookieFn;\n}\n\n/**\n * Create a no-op header accessor (for minimal endpoints that don't use headers).\n */\nexport function createNoopHeaders(): HeaderFn {\n\treturn ((key?: string) => {\n\t\tif (key !== undefined) return undefined;\n\t\treturn {};\n\t}) as HeaderFn;\n}\n\n/**\n * Create a no-op cookie accessor (for minimal endpoints that don't use cookies).\n */\nexport function createNoopCookies(): CookieFn {\n\treturn ((name?: string) => {\n\t\tif (name !== undefined) return undefined;\n\t\treturn {};\n\t}) as CookieFn;\n}\n"],"mappings":"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"}
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
let hono_cookie = require("hono/cookie");
|
|
2
|
-
//#region src/endpoints/lazyAccessors.ts
|
|
3
|
-
/**
|
|
4
|
-
* Create a lazy header accessor for Hono.
|
|
5
|
-
* Uses `c.req.header(name)` for single lookups (native, case-insensitive).
|
|
6
|
-
* Only calls `c.req.header()` to get all headers when needed.
|
|
7
|
-
*/
|
|
8
|
-
function createHonoHeaders(c) {
|
|
9
|
-
let allHeaders = null;
|
|
10
|
-
return ((key) => {
|
|
11
|
-
if (key !== void 0) return c.req.header(key);
|
|
12
|
-
if (!allHeaders) allHeaders = c.req.header();
|
|
13
|
-
return allHeaders;
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Create a lazy cookie accessor for Hono.
|
|
18
|
-
* Uses `getCookie(c, name)` for single lookups (native).
|
|
19
|
-
* Only parses the cookie header when all cookies are requested.
|
|
20
|
-
*/
|
|
21
|
-
function createHonoCookies(c) {
|
|
22
|
-
let allCookies = null;
|
|
23
|
-
return ((name) => {
|
|
24
|
-
if (name !== void 0) return (0, hono_cookie.getCookie)(c, name);
|
|
25
|
-
if (!allCookies) {
|
|
26
|
-
allCookies = {};
|
|
27
|
-
const cookieHeader = c.req.header("cookie");
|
|
28
|
-
if (cookieHeader) for (const part of cookieHeader.split(";")) {
|
|
29
|
-
const trimmed = part.trim();
|
|
30
|
-
const eqIndex = trimmed.indexOf("=");
|
|
31
|
-
if (eqIndex > 0) {
|
|
32
|
-
const key = trimmed.slice(0, eqIndex);
|
|
33
|
-
const value = trimmed.slice(eqIndex + 1);
|
|
34
|
-
allCookies[key] = value;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return allCookies;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Create a lazy header accessor for API Gateway events.
|
|
43
|
-
* Handles case-insensitive lookups.
|
|
44
|
-
*/
|
|
45
|
-
function createApiGatewayHeaders(headers) {
|
|
46
|
-
let normalizedHeaders = null;
|
|
47
|
-
const normalize = () => {
|
|
48
|
-
if (!normalizedHeaders) {
|
|
49
|
-
normalizedHeaders = {};
|
|
50
|
-
if (headers) {
|
|
51
|
-
for (const [k, v] of Object.entries(headers)) if (v !== void 0) normalizedHeaders[k.toLowerCase()] = v;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return normalizedHeaders;
|
|
55
|
-
};
|
|
56
|
-
return ((key) => {
|
|
57
|
-
if (key !== void 0) {
|
|
58
|
-
if (headers) {
|
|
59
|
-
const direct = headers[key] ?? headers[key.toLowerCase()];
|
|
60
|
-
if (direct !== void 0) return direct;
|
|
61
|
-
return normalize()[key.toLowerCase()];
|
|
62
|
-
}
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
return normalize();
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Create a lazy cookie accessor for API Gateway events.
|
|
70
|
-
* Decodes URL-encoded values to match browser behavior.
|
|
71
|
-
*/
|
|
72
|
-
function createApiGatewayCookies(cookies, cookieHeader) {
|
|
73
|
-
let parsed = null;
|
|
74
|
-
const parse = () => {
|
|
75
|
-
if (!parsed) {
|
|
76
|
-
parsed = {};
|
|
77
|
-
if (cookies) for (const cookie of cookies) {
|
|
78
|
-
const eqIndex = cookie.indexOf("=");
|
|
79
|
-
if (eqIndex > 0) {
|
|
80
|
-
const key = cookie.slice(0, eqIndex);
|
|
81
|
-
const value = cookie.slice(eqIndex + 1);
|
|
82
|
-
parsed[key] = decodeURIComponent(value);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
else if (cookieHeader) for (const part of cookieHeader.split(";")) {
|
|
86
|
-
const trimmed = part.trim();
|
|
87
|
-
const eqIndex = trimmed.indexOf("=");
|
|
88
|
-
if (eqIndex > 0) {
|
|
89
|
-
const key = trimmed.slice(0, eqIndex);
|
|
90
|
-
const value = trimmed.slice(eqIndex + 1);
|
|
91
|
-
parsed[key] = decodeURIComponent(value);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return parsed;
|
|
96
|
-
};
|
|
97
|
-
return ((name) => {
|
|
98
|
-
if (name !== void 0) return parse()[name];
|
|
99
|
-
return parse();
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Create a lazy header accessor for plain object headers (test adaptor, etc).
|
|
104
|
-
* Headers are already available as an object, just provide lazy access.
|
|
105
|
-
*/
|
|
106
|
-
function createObjectHeaders(headers) {
|
|
107
|
-
let normalized = null;
|
|
108
|
-
return ((key) => {
|
|
109
|
-
if (key !== void 0) {
|
|
110
|
-
if (headers) {
|
|
111
|
-
const direct = headers[key] ?? headers[key.toLowerCase()];
|
|
112
|
-
if (direct !== void 0) return direct;
|
|
113
|
-
}
|
|
114
|
-
if (!normalized && headers) {
|
|
115
|
-
normalized = {};
|
|
116
|
-
for (const [k, v] of Object.entries(headers)) normalized[k.toLowerCase()] = v;
|
|
117
|
-
}
|
|
118
|
-
return normalized?.[key.toLowerCase()];
|
|
119
|
-
}
|
|
120
|
-
if (!normalized && headers) {
|
|
121
|
-
normalized = {};
|
|
122
|
-
for (const [k, v] of Object.entries(headers)) normalized[k.toLowerCase()] = v;
|
|
123
|
-
}
|
|
124
|
-
return normalized ?? {};
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Create a lazy cookie accessor from a cookie header string.
|
|
129
|
-
* Decodes URL-encoded values to match browser behavior.
|
|
130
|
-
*/
|
|
131
|
-
function createCookieHeaderAccessor(cookieHeader) {
|
|
132
|
-
let parsed = null;
|
|
133
|
-
const parse = () => {
|
|
134
|
-
if (!parsed) {
|
|
135
|
-
parsed = {};
|
|
136
|
-
if (cookieHeader) for (const part of cookieHeader.split(";")) {
|
|
137
|
-
const trimmed = part.trim();
|
|
138
|
-
const eqIndex = trimmed.indexOf("=");
|
|
139
|
-
if (eqIndex > 0) {
|
|
140
|
-
const key = trimmed.slice(0, eqIndex);
|
|
141
|
-
const value = trimmed.slice(eqIndex + 1);
|
|
142
|
-
parsed[key] = decodeURIComponent(value);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return parsed;
|
|
147
|
-
};
|
|
148
|
-
return ((name) => {
|
|
149
|
-
if (name !== void 0) return parse()[name];
|
|
150
|
-
return parse();
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Create a no-op header accessor (for minimal endpoints that don't use headers).
|
|
155
|
-
*/
|
|
156
|
-
function createNoopHeaders() {
|
|
157
|
-
return ((key) => {
|
|
158
|
-
if (key !== void 0) return void 0;
|
|
159
|
-
return {};
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Create a no-op cookie accessor (for minimal endpoints that don't use cookies).
|
|
164
|
-
*/
|
|
165
|
-
function createNoopCookies() {
|
|
166
|
-
return ((name) => {
|
|
167
|
-
if (name !== void 0) return void 0;
|
|
168
|
-
return {};
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
//#endregion
|
|
172
|
-
Object.defineProperty(exports, "createApiGatewayCookies", {
|
|
173
|
-
enumerable: true,
|
|
174
|
-
get: function() {
|
|
175
|
-
return createApiGatewayCookies;
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
Object.defineProperty(exports, "createApiGatewayHeaders", {
|
|
179
|
-
enumerable: true,
|
|
180
|
-
get: function() {
|
|
181
|
-
return createApiGatewayHeaders;
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
Object.defineProperty(exports, "createCookieHeaderAccessor", {
|
|
185
|
-
enumerable: true,
|
|
186
|
-
get: function() {
|
|
187
|
-
return createCookieHeaderAccessor;
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
Object.defineProperty(exports, "createHonoCookies", {
|
|
191
|
-
enumerable: true,
|
|
192
|
-
get: function() {
|
|
193
|
-
return createHonoCookies;
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
Object.defineProperty(exports, "createHonoHeaders", {
|
|
197
|
-
enumerable: true,
|
|
198
|
-
get: function() {
|
|
199
|
-
return createHonoHeaders;
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
Object.defineProperty(exports, "createNoopCookies", {
|
|
203
|
-
enumerable: true,
|
|
204
|
-
get: function() {
|
|
205
|
-
return createNoopCookies;
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
Object.defineProperty(exports, "createNoopHeaders", {
|
|
209
|
-
enumerable: true,
|
|
210
|
-
get: function() {
|
|
211
|
-
return createNoopHeaders;
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
Object.defineProperty(exports, "createObjectHeaders", {
|
|
215
|
-
enumerable: true,
|
|
216
|
-
get: function() {
|
|
217
|
-
return createObjectHeaders;
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
//# sourceMappingURL=lazyAccessors-hJKGv8Ay.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lazyAccessors-hJKGv8Ay.cjs","names":["getCookie"],"sources":["../src/endpoints/lazyAccessors.ts"],"sourcesContent":["/**\n * Lazy header and cookie accessors for different adaptors.\n *\n * Instead of parsing all headers/cookies upfront, these accessors\n * use native adaptor methods for single lookups and only parse\n * everything when `header()` or `cookie()` is called without arguments.\n */\nimport type { Context } from 'hono';\nimport { getCookie } from 'hono/cookie';\nimport type { CookieFn, HeaderFn } from './Endpoint';\n\n/**\n * Create a lazy header accessor for Hono.\n * Uses `c.req.header(name)` for single lookups (native, case-insensitive).\n * Only calls `c.req.header()` to get all headers when needed.\n */\nexport function createHonoHeaders(c: Context): HeaderFn {\n\tlet allHeaders: Record<string, string> | null = null;\n\n\treturn ((key?: string) => {\n\t\tif (key !== undefined) {\n\t\t\t// Single header lookup - use native Hono method (case-insensitive)\n\t\t\treturn c.req.header(key);\n\t\t}\n\t\t// Get all headers - cache the result\n\t\tif (!allHeaders) {\n\t\t\tallHeaders = c.req.header();\n\t\t}\n\t\treturn allHeaders;\n\t}) as HeaderFn;\n}\n\n/**\n * Create a lazy cookie accessor for Hono.\n * Uses `getCookie(c, name)` for single lookups (native).\n * Only parses the cookie header when all cookies are requested.\n */\nexport function createHonoCookies(c: Context): CookieFn {\n\tlet allCookies: Record<string, string> | null = null;\n\n\treturn ((name?: string) => {\n\t\tif (name !== undefined) {\n\t\t\t// Single cookie lookup - use native Hono method\n\t\t\treturn getCookie(c, name);\n\t\t}\n\t\t// Get all cookies - parse and cache\n\t\tif (!allCookies) {\n\t\t\tallCookies = {};\n\t\t\tconst cookieHeader = c.req.header('cookie');\n\t\t\tif (cookieHeader) {\n\t\t\t\tfor (const part of cookieHeader.split(';')) {\n\t\t\t\t\tconst trimmed = part.trim();\n\t\t\t\t\tconst eqIndex = trimmed.indexOf('=');\n\t\t\t\t\tif (eqIndex > 0) {\n\t\t\t\t\t\tconst key = trimmed.slice(0, eqIndex);\n\t\t\t\t\t\tconst value = trimmed.slice(eqIndex + 1);\n\t\t\t\t\t\tallCookies[key] = value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn allCookies;\n\t}) as CookieFn;\n}\n\n/**\n * Create a lazy header accessor for API Gateway events.\n * Handles case-insensitive lookups.\n */\nexport function createApiGatewayHeaders(\n\theaders: Record<string, string | undefined> | null | undefined,\n): HeaderFn {\n\tlet normalizedHeaders: Record<string, string> | null = null;\n\n\tconst normalize = () => {\n\t\tif (!normalizedHeaders) {\n\t\t\tnormalizedHeaders = {};\n\t\t\tif (headers) {\n\t\t\t\tfor (const [k, v] of Object.entries(headers)) {\n\t\t\t\t\tif (v !== undefined) {\n\t\t\t\t\t\tnormalizedHeaders[k.toLowerCase()] = v;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn normalizedHeaders;\n\t};\n\n\treturn ((key?: string) => {\n\t\tif (key !== undefined) {\n\t\t\t// Try direct lookup first (common case: headers already lowercase)\n\t\t\tif (headers) {\n\t\t\t\tconst direct = headers[key] ?? headers[key.toLowerCase()];\n\t\t\t\tif (direct !== undefined) return direct;\n\t\t\t\t// Fall back to normalized lookup\n\t\t\t\treturn normalize()[key.toLowerCase()];\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}\n\t\treturn normalize();\n\t}) as HeaderFn;\n}\n\n/**\n * Create a lazy cookie accessor for API Gateway events.\n * Decodes URL-encoded values to match browser behavior.\n */\nexport function createApiGatewayCookies(\n\tcookies: string[] | undefined,\n\tcookieHeader: string | undefined,\n): CookieFn {\n\tlet parsed: Record<string, string> | null = null;\n\n\tconst parse = () => {\n\t\tif (!parsed) {\n\t\t\tparsed = {};\n\t\t\t// API Gateway v2 provides cookies as array\n\t\t\tif (cookies) {\n\t\t\t\tfor (const cookie of cookies) {\n\t\t\t\t\tconst eqIndex = cookie.indexOf('=');\n\t\t\t\t\tif (eqIndex > 0) {\n\t\t\t\t\t\tconst key = cookie.slice(0, eqIndex);\n\t\t\t\t\t\tconst value = cookie.slice(eqIndex + 1);\n\t\t\t\t\t\tparsed[key] = decodeURIComponent(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (cookieHeader) {\n\t\t\t\t// Fall back to parsing cookie header\n\t\t\t\tfor (const part of cookieHeader.split(';')) {\n\t\t\t\t\tconst trimmed = part.trim();\n\t\t\t\t\tconst eqIndex = trimmed.indexOf('=');\n\t\t\t\t\tif (eqIndex > 0) {\n\t\t\t\t\t\tconst key = trimmed.slice(0, eqIndex);\n\t\t\t\t\t\tconst value = trimmed.slice(eqIndex + 1);\n\t\t\t\t\t\tparsed[key] = decodeURIComponent(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn parsed;\n\t};\n\n\treturn ((name?: string) => {\n\t\tif (name !== undefined) {\n\t\t\treturn parse()[name];\n\t\t}\n\t\treturn parse();\n\t}) as CookieFn;\n}\n\n/**\n * Create a lazy header accessor for plain object headers (test adaptor, etc).\n * Headers are already available as an object, just provide lazy access.\n */\nexport function createObjectHeaders(\n\theaders: Record<string, string> | undefined,\n): HeaderFn {\n\tlet normalized: Record<string, string> | null = null;\n\n\treturn ((key?: string) => {\n\t\tif (key !== undefined) {\n\t\t\t// Try direct lookup first (common case)\n\t\t\tif (headers) {\n\t\t\t\tconst direct = headers[key] ?? headers[key.toLowerCase()];\n\t\t\t\tif (direct !== undefined) return direct;\n\t\t\t}\n\t\t\t// Fall back to normalized lookup for case-insensitivity\n\t\t\tif (!normalized && headers) {\n\t\t\t\tnormalized = {};\n\t\t\t\tfor (const [k, v] of Object.entries(headers)) {\n\t\t\t\t\tnormalized[k.toLowerCase()] = v;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn normalized?.[key.toLowerCase()];\n\t\t}\n\t\t// Return all headers\n\t\tif (!normalized && headers) {\n\t\t\tnormalized = {};\n\t\t\tfor (const [k, v] of Object.entries(headers)) {\n\t\t\t\tnormalized[k.toLowerCase()] = v;\n\t\t\t}\n\t\t}\n\t\treturn normalized ?? {};\n\t}) as HeaderFn;\n}\n\n/**\n * Create a lazy cookie accessor from a cookie header string.\n * Decodes URL-encoded values to match browser behavior.\n */\nexport function createCookieHeaderAccessor(\n\tcookieHeader: string | undefined,\n): CookieFn {\n\tlet parsed: Record<string, string> | null = null;\n\n\tconst parse = () => {\n\t\tif (!parsed) {\n\t\t\tparsed = {};\n\t\t\tif (cookieHeader) {\n\t\t\t\tfor (const part of cookieHeader.split(';')) {\n\t\t\t\t\tconst trimmed = part.trim();\n\t\t\t\t\tconst eqIndex = trimmed.indexOf('=');\n\t\t\t\t\tif (eqIndex > 0) {\n\t\t\t\t\t\tconst key = trimmed.slice(0, eqIndex);\n\t\t\t\t\t\tconst value = trimmed.slice(eqIndex + 1);\n\t\t\t\t\t\t// Decode URL-encoded values to match Endpoint.createCookies behavior\n\t\t\t\t\t\tparsed[key] = decodeURIComponent(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn parsed;\n\t};\n\n\treturn ((name?: string) => {\n\t\tif (name !== undefined) {\n\t\t\treturn parse()[name];\n\t\t}\n\t\treturn parse();\n\t}) as CookieFn;\n}\n\n/**\n * Create a no-op header accessor (for minimal endpoints that don't use headers).\n */\nexport function createNoopHeaders(): HeaderFn {\n\treturn ((key?: string) => {\n\t\tif (key !== undefined) return undefined;\n\t\treturn {};\n\t}) as HeaderFn;\n}\n\n/**\n * Create a no-op cookie accessor (for minimal endpoints that don't use cookies).\n */\nexport function createNoopCookies(): CookieFn {\n\treturn ((name?: string) => {\n\t\tif (name !== undefined) return undefined;\n\t\treturn {};\n\t}) as CookieFn;\n}\n"],"mappings":"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"}
|