@geekmidas/constructs 10.0.0-alpha.99 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +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
package/dist/site.cjs
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_construct_interface = require("./construct-interface.cjs");
|
|
3
|
-
let _geekmidas_manifest = require("@geekmidas/manifest");
|
|
4
|
-
//#region src/site.ts
|
|
5
|
-
/**
|
|
6
|
-
* `StaticSite` — a frontend, declared like anything else.
|
|
7
|
-
*
|
|
8
|
-
* The point is not that a site needs provisioning; it is that a site is the
|
|
9
|
-
* *consumer* whose edges make four hand-maintained lists derivable. Declaring it
|
|
10
|
-
* is what turns "which origins does the API allow" from something a person keeps
|
|
11
|
-
* in step into something the graph already knows.
|
|
12
|
-
*
|
|
13
|
-
* ```ts
|
|
14
|
-
* export const console = new StaticSite('Console', { path: 'apps/console' })
|
|
15
|
-
* .dependsOn([api, auth]);
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* It has no `.service`. A site is not a process that registers clients — it is
|
|
19
|
-
* built, and the values it needs are inlined or fetched by its own framework —
|
|
20
|
-
* so the edge is {@link Declarable} rather than {@link Consumable}, and the
|
|
21
|
-
* asymmetry is the honest one: a site consumes addresses, not connections.
|
|
22
|
-
*
|
|
23
|
-
* Only the static variant ships. SSR deploy shapes are unstable and each one is
|
|
24
|
-
* its own maintenance, so they follow rather than arrive together. A mobile app
|
|
25
|
-
* is not a site — it is reached by a scheme, not a URL — and is its own
|
|
26
|
-
* construct: see `MobileApp`.
|
|
27
|
-
*/
|
|
28
|
-
var StaticSite = class StaticSite {
|
|
29
|
-
config;
|
|
30
|
-
dependencies;
|
|
31
|
-
id;
|
|
32
|
-
keys;
|
|
33
|
-
constructor(id, config, dependencies = []) {
|
|
34
|
-
this.config = config;
|
|
35
|
-
this.dependencies = dependencies;
|
|
36
|
-
this.id = (0, _geekmidas_manifest.canonicalId)(id);
|
|
37
|
-
this.keys = { url: (0, _geekmidas_manifest.provideKey)(this.id, "url") };
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* What this site calls.
|
|
41
|
-
*
|
|
42
|
-
* Immutable, like every other builder here: it returns a new site rather than
|
|
43
|
-
* mutating this one, so a module that exports both a base and a variant of it
|
|
44
|
-
* cannot have the second silently change the first.
|
|
45
|
-
*
|
|
46
|
-
* Takes {@link Declarable} rather than {@link Consumable} because a site's
|
|
47
|
-
* edge is a build-time link and not a service injection — requiring a client
|
|
48
|
-
* would exclude exactly the surfaces a frontend actually depends on.
|
|
49
|
-
*/
|
|
50
|
-
dependsOn(constructs) {
|
|
51
|
-
return new StaticSite(this.id, this.config, [...this.dependencies, ...constructs.map(require_construct_interface.edgeTo)]);
|
|
52
|
-
}
|
|
53
|
-
declare() {
|
|
54
|
-
return [{
|
|
55
|
-
kind: "site",
|
|
56
|
-
id: this.id,
|
|
57
|
-
variant: this.config.variant ?? "static",
|
|
58
|
-
...this.config.subdomain ? { subdomain: this.config.subdomain } : {},
|
|
59
|
-
app: {
|
|
60
|
-
path: this.config.path,
|
|
61
|
-
...this.config.port ? { port: this.config.port } : {},
|
|
62
|
-
...this.config.config ? { config: this.config.config } : {}
|
|
63
|
-
},
|
|
64
|
-
...this.config.root ? { root: true } : {},
|
|
65
|
-
dependencies: this.dependencies,
|
|
66
|
-
...this.config.telemetry ? { telemetry: this.config.telemetry.id } : {},
|
|
67
|
-
provides: [this.keys.url]
|
|
68
|
-
}];
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
//#endregion
|
|
72
|
-
exports.StaticSite = StaticSite;
|
|
73
|
-
|
|
74
|
-
//# sourceMappingURL=site.cjs.map
|
package/dist/site.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"site.cjs","names":["canonicalId","provideKey","edgeTo"],"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. A mobile app\n * is not a site — it is reached by a scheme, not a URL — and is its own\n * construct: see `MobileApp`.\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';\nimport type { Telemetry } from './telemetry';\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 label it answers on under a stage's domain — `api` for\n\t * `api.myapp.com`, from `domains` — and under the project locally,\n\t * `api.myapp.localhost`. Absent, its id kebab-cased.\n\t */\n\tsubdomain?: 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\t/**\n\t * What the site emits — the `Telemetry` construct. An edge to the node and\n\t * nothing more for now: a site is handed none of its server keys, and the\n\t * browser half (propagation from the generated client, then a browser SDK\n\t * exporting through the API) builds on this edge.\n\t */\n\ttelemetry?: Telemetry;\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\t...(this.config.subdomain ? { subdomain: this.config.subdomain } : {}),\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\t...(this.config.telemetry\n\t\t\t\t\t? { telemetry: this.config.telemetry.id }\n\t\t\t\t\t: {}),\n\t\t\t\tprovides: [this.keys.url],\n\t\t\t},\n\t\t];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,IAAa,aAAb,MAAa,WAEb;CAMmB;CAOA;CAZlB;CACA;CAEA,YACC,IACA,QAOA,eAAuD,CAAC,GACvD;EARgB,KAAA,SAAA;EAOA,KAAA,eAAA;EAEjB,KAAK,MAAA,GAAKA,oBAAAA,YAAAA,CAAY,EAAY;EAClC,KAAK,OAAO,EAAE,MAAA,GAAKC,oBAAAA,WAAAA,CAAW,KAAK,IAAI,KAAK,EAAE;CAC/C;;;;;;;;;;;;CAaA,UAAU,YAAsD;EAC/D,OAAO,IAAI,WAAkB,KAAK,IAA4B,KAAK,QAAQ,CAC1E,GAAG,KAAK,cACR,GAAG,WAAW,IAAIC,4BAAAA,MAAM,CACzB,CAAC;CACF;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,SAAS,KAAK,OAAO,WAAW;GAChC,GAAI,KAAK,OAAO,YAAY,EAAE,WAAW,KAAK,OAAO,UAAU,IAAI,CAAC;GACpE,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,GAAI,KAAK,OAAO,YACb,EAAE,WAAW,KAAK,OAAO,UAAU,GAAG,IACtC,CAAC;GACJ,UAAU,CAAC,KAAK,KAAK,GAAG;EACzB,CACD;CACD;AACD"}
|
package/dist/site.d.cts
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { i as Declarable } from "./construct-interface-B1AfqRl4.cjs";
|
|
2
|
-
import { n as Telemetry } from "./telemetry-B48RLjyk.cjs";
|
|
3
|
-
import { ConstructName, Declaration, Dependency, SiteDeclaration } from "@geekmidas/manifest";
|
|
4
|
-
//#region src/site.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Where a site's source lives, and the little else a layout can differ by.
|
|
7
|
-
*
|
|
8
|
-
* Only `path` is required: `new StaticSite('Web', { path: 'apps/web' })` is a
|
|
9
|
-
* complete site.
|
|
10
|
-
*/
|
|
11
|
-
export interface StaticSiteConfig {
|
|
12
|
-
/**
|
|
13
|
-
* Where its source lives, relative to the workspace root — `'apps/web'`.
|
|
14
|
-
*
|
|
15
|
-
* Required, the same field `RestApi` and `BetterAuth` take. It was
|
|
16
|
-
* inferred from the id, which made a site's home whatever was on disk.
|
|
17
|
-
*/
|
|
18
|
-
path: string;
|
|
19
|
-
/**
|
|
20
|
-
* The label it answers on under a stage's domain — `api` for
|
|
21
|
-
* `api.myapp.com`, from `domains` — and under the project locally,
|
|
22
|
-
* `api.myapp.localhost`. Absent, its id kebab-cased.
|
|
23
|
-
*/
|
|
24
|
-
subdomain?: string;
|
|
25
|
-
/**
|
|
26
|
-
* The port it answers on locally.
|
|
27
|
-
*
|
|
28
|
-
* Normally omitted: ports are assigned in a stable order, so adding a site
|
|
29
|
-
* does not renumber the ones already running.
|
|
30
|
-
*/
|
|
31
|
-
port?: number;
|
|
32
|
-
/**
|
|
33
|
-
* Modules to import when sniffing which env vars this site reads.
|
|
34
|
-
*
|
|
35
|
-
* A frontend's values are inlined at build time, so the build has to know
|
|
36
|
-
* which ones it reads before it reads them.
|
|
37
|
-
*/
|
|
38
|
-
config?: {
|
|
39
|
-
client?: string;
|
|
40
|
-
server?: string;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Whether the base domain points at this site.
|
|
44
|
-
*
|
|
45
|
-
* A project with one site needs this no more than a project with one
|
|
46
|
-
* database needs to say which database. It matters when there are several
|
|
47
|
-
* and none is called `web`: the base domain then belongs to whichever site
|
|
48
|
-
* says so, rather than to whichever file the glob happened to reach first.
|
|
49
|
-
*/
|
|
50
|
-
root?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Which framework builds it.
|
|
53
|
-
*
|
|
54
|
-
* It selects how values are delivered — `VITE_`, `NEXT_PUBLIC_`, a fetched
|
|
55
|
-
* `config.json` — and never which values there are. One neutral name from the
|
|
56
|
-
* construct, one serialisation per framework, the same rule as everywhere
|
|
57
|
-
* else.
|
|
58
|
-
*/
|
|
59
|
-
variant?: SiteDeclaration['variant'];
|
|
60
|
-
/**
|
|
61
|
-
* What the site emits — the `Telemetry` construct. An edge to the node and
|
|
62
|
-
* nothing more for now: a site is handed none of its server keys, and the
|
|
63
|
-
* browser half (propagation from the generated client, then a browser SDK
|
|
64
|
-
* exporting through the API) builds on this edge.
|
|
65
|
-
*/
|
|
66
|
-
telemetry?: Telemetry;
|
|
67
|
-
}
|
|
68
|
-
export declare class StaticSite<TName extends string = string> implements Declarable<TName> {
|
|
69
|
-
private readonly config;
|
|
70
|
-
/**
|
|
71
|
-
* Internal: how `.dependsOn()` carries edges into the copy it returns.
|
|
72
|
-
* Written as a parameter rather than a mutable field so the builder can
|
|
73
|
-
* stay immutable without a clone method, the same shape
|
|
74
|
-
* `KyselyDatabase` uses for its derived forms.
|
|
75
|
-
*/
|
|
76
|
-
private readonly dependencies;
|
|
77
|
-
readonly id: TName;
|
|
78
|
-
readonly keys: {
|
|
79
|
-
url: string;
|
|
80
|
-
};
|
|
81
|
-
constructor(id: ConstructName<TName>, config: StaticSiteConfig,
|
|
82
|
-
/**
|
|
83
|
-
* Internal: how `.dependsOn()` carries edges into the copy it returns.
|
|
84
|
-
* Written as a parameter rather than a mutable field so the builder can
|
|
85
|
-
* stay immutable without a clone method, the same shape
|
|
86
|
-
* `KyselyDatabase` uses for its derived forms.
|
|
87
|
-
*/
|
|
88
|
-
dependencies?: readonly Dependency[]);
|
|
89
|
-
/**
|
|
90
|
-
* What this site calls.
|
|
91
|
-
*
|
|
92
|
-
* Immutable, like every other builder here: it returns a new site rather than
|
|
93
|
-
* mutating this one, so a module that exports both a base and a variant of it
|
|
94
|
-
* cannot have the second silently change the first.
|
|
95
|
-
*
|
|
96
|
-
* Takes {@link Declarable} rather than {@link Consumable} because a site's
|
|
97
|
-
* edge is a build-time link and not a service injection — requiring a client
|
|
98
|
-
* would exclude exactly the surfaces a frontend actually depends on.
|
|
99
|
-
*/
|
|
100
|
-
dependsOn(constructs: readonly Declarable[]): StaticSite<TName>;
|
|
101
|
-
declare(): Declaration[];
|
|
102
|
-
}
|
|
103
|
-
//#endregion
|
|
104
|
-
//# sourceMappingURL=site.d.cts.map
|
package/dist/site.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"site.d.cts","names":[],"sources":["../src/site.ts"],"mappings":";;;;;;;;;;iBAyCiB;;;;;;;EAOhB;;;;;;EAMA;;;;;;;EAOA;;;;;;;EAOA;IAAW;IAAiB;;;;;;;;;;EAS5B;;;;;;;;;EASA,UAAU;;;;;;;EAOV,YAAY;;qBAGA,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
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { i as Declarable } from "./construct-interface-DluK3_da.mjs";
|
|
2
|
-
import { n as Telemetry } from "./telemetry-DRtT1_0A.mjs";
|
|
3
|
-
import { ConstructName, Declaration, Dependency, SiteDeclaration } from "@geekmidas/manifest";
|
|
4
|
-
//#region src/site.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Where a site's source lives, and the little else a layout can differ by.
|
|
7
|
-
*
|
|
8
|
-
* Only `path` is required: `new StaticSite('Web', { path: 'apps/web' })` is a
|
|
9
|
-
* complete site.
|
|
10
|
-
*/
|
|
11
|
-
export interface StaticSiteConfig {
|
|
12
|
-
/**
|
|
13
|
-
* Where its source lives, relative to the workspace root — `'apps/web'`.
|
|
14
|
-
*
|
|
15
|
-
* Required, the same field `RestApi` and `BetterAuth` take. It was
|
|
16
|
-
* inferred from the id, which made a site's home whatever was on disk.
|
|
17
|
-
*/
|
|
18
|
-
path: string;
|
|
19
|
-
/**
|
|
20
|
-
* The label it answers on under a stage's domain — `api` for
|
|
21
|
-
* `api.myapp.com`, from `domains` — and under the project locally,
|
|
22
|
-
* `api.myapp.localhost`. Absent, its id kebab-cased.
|
|
23
|
-
*/
|
|
24
|
-
subdomain?: string;
|
|
25
|
-
/**
|
|
26
|
-
* The port it answers on locally.
|
|
27
|
-
*
|
|
28
|
-
* Normally omitted: ports are assigned in a stable order, so adding a site
|
|
29
|
-
* does not renumber the ones already running.
|
|
30
|
-
*/
|
|
31
|
-
port?: number;
|
|
32
|
-
/**
|
|
33
|
-
* Modules to import when sniffing which env vars this site reads.
|
|
34
|
-
*
|
|
35
|
-
* A frontend's values are inlined at build time, so the build has to know
|
|
36
|
-
* which ones it reads before it reads them.
|
|
37
|
-
*/
|
|
38
|
-
config?: {
|
|
39
|
-
client?: string;
|
|
40
|
-
server?: string;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Whether the base domain points at this site.
|
|
44
|
-
*
|
|
45
|
-
* A project with one site needs this no more than a project with one
|
|
46
|
-
* database needs to say which database. It matters when there are several
|
|
47
|
-
* and none is called `web`: the base domain then belongs to whichever site
|
|
48
|
-
* says so, rather than to whichever file the glob happened to reach first.
|
|
49
|
-
*/
|
|
50
|
-
root?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Which framework builds it.
|
|
53
|
-
*
|
|
54
|
-
* It selects how values are delivered — `VITE_`, `NEXT_PUBLIC_`, a fetched
|
|
55
|
-
* `config.json` — and never which values there are. One neutral name from the
|
|
56
|
-
* construct, one serialisation per framework, the same rule as everywhere
|
|
57
|
-
* else.
|
|
58
|
-
*/
|
|
59
|
-
variant?: SiteDeclaration['variant'];
|
|
60
|
-
/**
|
|
61
|
-
* What the site emits — the `Telemetry` construct. An edge to the node and
|
|
62
|
-
* nothing more for now: a site is handed none of its server keys, and the
|
|
63
|
-
* browser half (propagation from the generated client, then a browser SDK
|
|
64
|
-
* exporting through the API) builds on this edge.
|
|
65
|
-
*/
|
|
66
|
-
telemetry?: Telemetry;
|
|
67
|
-
}
|
|
68
|
-
export declare class StaticSite<TName extends string = string> implements Declarable<TName> {
|
|
69
|
-
private readonly config;
|
|
70
|
-
/**
|
|
71
|
-
* Internal: how `.dependsOn()` carries edges into the copy it returns.
|
|
72
|
-
* Written as a parameter rather than a mutable field so the builder can
|
|
73
|
-
* stay immutable without a clone method, the same shape
|
|
74
|
-
* `KyselyDatabase` uses for its derived forms.
|
|
75
|
-
*/
|
|
76
|
-
private readonly dependencies;
|
|
77
|
-
readonly id: TName;
|
|
78
|
-
readonly keys: {
|
|
79
|
-
url: string;
|
|
80
|
-
};
|
|
81
|
-
constructor(id: ConstructName<TName>, config: StaticSiteConfig,
|
|
82
|
-
/**
|
|
83
|
-
* Internal: how `.dependsOn()` carries edges into the copy it returns.
|
|
84
|
-
* Written as a parameter rather than a mutable field so the builder can
|
|
85
|
-
* stay immutable without a clone method, the same shape
|
|
86
|
-
* `KyselyDatabase` uses for its derived forms.
|
|
87
|
-
*/
|
|
88
|
-
dependencies?: readonly Dependency[]);
|
|
89
|
-
/**
|
|
90
|
-
* What this site calls.
|
|
91
|
-
*
|
|
92
|
-
* Immutable, like every other builder here: it returns a new site rather than
|
|
93
|
-
* mutating this one, so a module that exports both a base and a variant of it
|
|
94
|
-
* cannot have the second silently change the first.
|
|
95
|
-
*
|
|
96
|
-
* Takes {@link Declarable} rather than {@link Consumable} because a site's
|
|
97
|
-
* edge is a build-time link and not a service injection — requiring a client
|
|
98
|
-
* would exclude exactly the surfaces a frontend actually depends on.
|
|
99
|
-
*/
|
|
100
|
-
dependsOn(constructs: readonly Declarable[]): StaticSite<TName>;
|
|
101
|
-
declare(): Declaration[];
|
|
102
|
-
}
|
|
103
|
-
//#endregion
|
|
104
|
-
//# sourceMappingURL=site.d.mts.map
|
package/dist/site.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"site.d.mts","names":[],"sources":["../src/site.ts"],"mappings":";;;;;;;;;;iBAyCiB;;;;;;;EAOhB;;;;;;EAMA;;;;;;;EAOA;;;;;;;EAOA;IAAW;IAAiB;;;;;;;;;;EAS5B;;;;;;;;;EASA,UAAU;;;;;;;EAOV,YAAY;;qBAGA,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
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { edgeTo } from "./construct-interface.mjs";
|
|
2
|
-
import { canonicalId, provideKey } from "@geekmidas/manifest";
|
|
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. A mobile app
|
|
24
|
-
* is not a site — it is reached by a scheme, not a URL — and is its own
|
|
25
|
-
* construct: see `MobileApp`.
|
|
26
|
-
*/
|
|
27
|
-
var StaticSite = class StaticSite {
|
|
28
|
-
config;
|
|
29
|
-
dependencies;
|
|
30
|
-
id;
|
|
31
|
-
keys;
|
|
32
|
-
constructor(id, config, dependencies = []) {
|
|
33
|
-
this.config = config;
|
|
34
|
-
this.dependencies = dependencies;
|
|
35
|
-
this.id = canonicalId(id);
|
|
36
|
-
this.keys = { url: provideKey(this.id, "url") };
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* What this site calls.
|
|
40
|
-
*
|
|
41
|
-
* Immutable, like every other builder here: it returns a new site rather than
|
|
42
|
-
* mutating this one, so a module that exports both a base and a variant of it
|
|
43
|
-
* cannot have the second silently change the first.
|
|
44
|
-
*
|
|
45
|
-
* Takes {@link Declarable} rather than {@link Consumable} because a site's
|
|
46
|
-
* edge is a build-time link and not a service injection — requiring a client
|
|
47
|
-
* would exclude exactly the surfaces a frontend actually depends on.
|
|
48
|
-
*/
|
|
49
|
-
dependsOn(constructs) {
|
|
50
|
-
return new StaticSite(this.id, this.config, [...this.dependencies, ...constructs.map(edgeTo)]);
|
|
51
|
-
}
|
|
52
|
-
declare() {
|
|
53
|
-
return [{
|
|
54
|
-
kind: "site",
|
|
55
|
-
id: this.id,
|
|
56
|
-
variant: this.config.variant ?? "static",
|
|
57
|
-
...this.config.subdomain ? { subdomain: this.config.subdomain } : {},
|
|
58
|
-
app: {
|
|
59
|
-
path: this.config.path,
|
|
60
|
-
...this.config.port ? { port: this.config.port } : {},
|
|
61
|
-
...this.config.config ? { config: this.config.config } : {}
|
|
62
|
-
},
|
|
63
|
-
...this.config.root ? { root: true } : {},
|
|
64
|
-
dependencies: this.dependencies,
|
|
65
|
-
...this.config.telemetry ? { telemetry: this.config.telemetry.id } : {},
|
|
66
|
-
provides: [this.keys.url]
|
|
67
|
-
}];
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
//#endregion
|
|
71
|
-
export { StaticSite };
|
|
72
|
-
|
|
73
|
-
//# sourceMappingURL=site.mjs.map
|
package/dist/site.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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. A mobile app\n * is not a site — it is reached by a scheme, not a URL — and is its own\n * construct: see `MobileApp`.\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';\nimport type { Telemetry } from './telemetry';\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 label it answers on under a stage's domain — `api` for\n\t * `api.myapp.com`, from `domains` — and under the project locally,\n\t * `api.myapp.localhost`. Absent, its id kebab-cased.\n\t */\n\tsubdomain?: 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\t/**\n\t * What the site emits — the `Telemetry` construct. An edge to the node and\n\t * nothing more for now: a site is handed none of its server keys, and the\n\t * browser half (propagation from the generated client, then a browser SDK\n\t * exporting through the API) builds on this edge.\n\t */\n\ttelemetry?: Telemetry;\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\t...(this.config.subdomain ? { subdomain: this.config.subdomain } : {}),\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\t...(this.config.telemetry\n\t\t\t\t\t? { telemetry: this.config.telemetry.id }\n\t\t\t\t\t: {}),\n\t\t\t\tprovides: [this.keys.url],\n\t\t\t},\n\t\t];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,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,GAAI,KAAK,OAAO,YAAY,EAAE,WAAW,KAAK,OAAO,UAAU,IAAI,CAAC;GACpE,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,GAAI,KAAK,OAAO,YACb,EAAE,WAAW,KAAK,OAAO,UAAU,GAAG,IACtC,CAAC;GACJ,UAAU,CAAC,KAAK,KAAK,GAAG;EACzB,CACD;CACD;AACD"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
//#region src/stages.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* The project's stage names, as types.
|
|
4
|
-
*
|
|
5
|
-
* `gkm.config.ts` declares the stages — `stages: { local: 'dev', deployed:
|
|
6
|
-
* ['staging', 'prod'] }` — but constructs and application code cannot import
|
|
7
|
-
* the config, so a stage name written anywhere else was a bare `string`: a
|
|
8
|
-
* typo'd key in an `ExternalApi`'s `url` map was silently never read, and a
|
|
9
|
-
* seed's `stage === 'prodution'` branch silently never ran.
|
|
10
|
-
*
|
|
11
|
-
* `gkm dev`, `gkm build` and `gkm test --prepare` write `.gkm/stages.d.ts`,
|
|
12
|
-
* which fills this interface in from the loaded workspace:
|
|
13
|
-
*
|
|
14
|
-
* ```ts
|
|
15
|
-
* declare module '@geekmidas/constructs' {
|
|
16
|
-
* interface Stages { local: 'dev'; deployed: 'staging' | 'prod' }
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* Until that file exists — a fresh clone, before the first run — the interface
|
|
21
|
-
* is empty and every stage type below is `string`, so nothing fails to compile
|
|
22
|
-
* for want of a generated file.
|
|
23
|
-
*/
|
|
24
|
-
interface Stages {}
|
|
25
|
-
/** What `Stages` says under `key`, or `string` while it says nothing. */
|
|
26
|
-
type Declared<TKey extends string> = Stages extends { [K in TKey]: infer TStage extends string; } ? TStage : string;
|
|
27
|
-
/** The stage `gkm dev`, `exec`, `setup` and `test` run as: `stages.local`. */
|
|
28
|
-
type LocalStage = Declared<'local'>;
|
|
29
|
-
/** A stage `gkm deploy --stage` accepts: one of `stages.deployed`. */
|
|
30
|
-
type DeployedStage = Declared<'deployed'>;
|
|
31
|
-
/** What `gkm test` runs as. The CLI's own; no project stage may take it. */
|
|
32
|
-
type TestStage = 'test';
|
|
33
|
-
/** Any stage the project's code can find itself running as. */
|
|
34
|
-
type AnyStage = LocalStage | TestStage | DeployedStage;
|
|
35
|
-
/**
|
|
36
|
-
* What a seed is handed beside its database.
|
|
37
|
-
*
|
|
38
|
-
* Seeds run on every stage, production included, so a seed that should write
|
|
39
|
-
* something only somewhere — a demo tenant on the local stage, never on a
|
|
40
|
-
* deployed one — decides by the stage it is given:
|
|
41
|
-
*
|
|
42
|
-
* ```ts
|
|
43
|
-
* import type { SeedContext } from '@geekmidas/constructs';
|
|
44
|
-
*
|
|
45
|
-
* export async function seed(db: Kysely<Database>, { stage }: SeedContext) {
|
|
46
|
-
* if (stage === 'dev') await insertDemoTenant(db);
|
|
47
|
-
* }
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
interface SeedContext {
|
|
51
|
-
/** The stage being seeded: the local one, `test`, or a deployed one. */
|
|
52
|
-
stage: AnyStage;
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
export { Stages as a, SeedContext as i, DeployedStage as n, TestStage as o, LocalStage as r, AnyStage as t };
|
|
56
|
-
//# sourceMappingURL=stages-BSCF19o2.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stages-BSCF19o2.d.cts","names":[],"sources":["../src/stages.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;UAuBiB;;KAGZ,SAAS,uBAAuB,kBACnC,KAAK,aAAa,2BAEjB;;KAIS,aAAa;;KAGb,gBAAgB;;KAGhB;;KAGA,WAAW,aAAa,YAAY;;;;;;;;;;;;;;;;UAiB/B;;EAEhB,OAAO"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
//#region src/stages.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* The project's stage names, as types.
|
|
4
|
-
*
|
|
5
|
-
* `gkm.config.ts` declares the stages — `stages: { local: 'dev', deployed:
|
|
6
|
-
* ['staging', 'prod'] }` — but constructs and application code cannot import
|
|
7
|
-
* the config, so a stage name written anywhere else was a bare `string`: a
|
|
8
|
-
* typo'd key in an `ExternalApi`'s `url` map was silently never read, and a
|
|
9
|
-
* seed's `stage === 'prodution'` branch silently never ran.
|
|
10
|
-
*
|
|
11
|
-
* `gkm dev`, `gkm build` and `gkm test --prepare` write `.gkm/stages.d.ts`,
|
|
12
|
-
* which fills this interface in from the loaded workspace:
|
|
13
|
-
*
|
|
14
|
-
* ```ts
|
|
15
|
-
* declare module '@geekmidas/constructs' {
|
|
16
|
-
* interface Stages { local: 'dev'; deployed: 'staging' | 'prod' }
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* Until that file exists — a fresh clone, before the first run — the interface
|
|
21
|
-
* is empty and every stage type below is `string`, so nothing fails to compile
|
|
22
|
-
* for want of a generated file.
|
|
23
|
-
*/
|
|
24
|
-
interface Stages {}
|
|
25
|
-
/** What `Stages` says under `key`, or `string` while it says nothing. */
|
|
26
|
-
type Declared<TKey extends string> = Stages extends { [K in TKey]: infer TStage extends string; } ? TStage : string;
|
|
27
|
-
/** The stage `gkm dev`, `exec`, `setup` and `test` run as: `stages.local`. */
|
|
28
|
-
type LocalStage = Declared<'local'>;
|
|
29
|
-
/** A stage `gkm deploy --stage` accepts: one of `stages.deployed`. */
|
|
30
|
-
type DeployedStage = Declared<'deployed'>;
|
|
31
|
-
/** What `gkm test` runs as. The CLI's own; no project stage may take it. */
|
|
32
|
-
type TestStage = 'test';
|
|
33
|
-
/** Any stage the project's code can find itself running as. */
|
|
34
|
-
type AnyStage = LocalStage | TestStage | DeployedStage;
|
|
35
|
-
/**
|
|
36
|
-
* What a seed is handed beside its database.
|
|
37
|
-
*
|
|
38
|
-
* Seeds run on every stage, production included, so a seed that should write
|
|
39
|
-
* something only somewhere — a demo tenant on the local stage, never on a
|
|
40
|
-
* deployed one — decides by the stage it is given:
|
|
41
|
-
*
|
|
42
|
-
* ```ts
|
|
43
|
-
* import type { SeedContext } from '@geekmidas/constructs';
|
|
44
|
-
*
|
|
45
|
-
* export async function seed(db: Kysely<Database>, { stage }: SeedContext) {
|
|
46
|
-
* if (stage === 'dev') await insertDemoTenant(db);
|
|
47
|
-
* }
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
interface SeedContext {
|
|
51
|
-
/** The stage being seeded: the local one, `test`, or a deployed one. */
|
|
52
|
-
stage: AnyStage;
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
export { Stages as a, SeedContext as i, DeployedStage as n, TestStage as o, LocalStage as r, AnyStage as t };
|
|
56
|
-
//# sourceMappingURL=stages-BSCF19o2.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stages-BSCF19o2.d.mts","names":[],"sources":["../src/stages.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;UAuBiB;;KAGZ,SAAS,uBAAuB,kBACnC,KAAK,aAAa,2BAEjB;;KAIS,aAAa;;KAGb,gBAAgB;;KAGhB;;KAGA,WAAW,aAAa,YAAY;;;;;;;;;;;;;;;;UAiB/B;;EAEhB,OAAO"}
|
|
@@ -1,56 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,45 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|