@forinda/kickjs 10.5.0 → 10.6.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/dist/{adapter-BZ1WzN1z.d.mts → adapter-9sPr_5xt.d.mts} +123 -35
- package/dist/adapter-9sPr_5xt.d.mts.map +1 -0
- package/dist/{allowed-hosts-D6qcuK5I.d.mts → allowed-hosts-BpKwviq5.d.mts} +3 -3
- package/dist/allowed-hosts-BpKwviq5.d.mts.map +1 -0
- package/dist/{application-D5Iiy7rt.d.mts → application-BD9LQ2s4.d.mts} +83 -43
- package/dist/application-BD9LQ2s4.d.mts.map +1 -0
- package/dist/application-DwYTFctU.mjs +14 -0
- package/dist/application-DwYTFctU.mjs.map +1 -0
- package/dist/background-DSztbyc4.mjs +12 -0
- package/dist/background-DSztbyc4.mjs.map +1 -0
- package/dist/bootstrap-DdTHtS8P.mjs +12 -0
- package/dist/{bootstrap-B_6QfzXV.mjs.map → bootstrap-DdTHtS8P.mjs.map} +1 -1
- package/dist/{bounded-counters-C8PHfWEu.mjs → bounded-counters-Bd7X3eI5.mjs} +2 -2
- package/dist/{bounded-counters-C8PHfWEu.mjs.map → bounded-counters-Bd7X3eI5.mjs.map} +1 -1
- package/dist/{breach-padding-C-Dnq8CS.d.mts → breach-padding-FBVGmcBb.d.mts} +3 -3
- package/dist/breach-padding-FBVGmcBb.d.mts.map +1 -0
- package/dist/{client-ip-kxT2SHut.mjs → client-ip-DxEVqZP-.mjs} +2 -2
- package/dist/{client-ip-kxT2SHut.mjs.map → client-ip-DxEVqZP-.mjs.map} +1 -1
- package/dist/config/index.mjs +2 -2
- package/dist/{config-Dz-HnO4c.mjs → config-_YTqZtnE.mjs} +3 -3
- package/dist/{config-Dz-HnO4c.mjs.map → config-_YTqZtnE.mjs.map} +1 -1
- package/dist/connect-BlIamapT.d.mts +41 -0
- package/dist/connect-BlIamapT.d.mts.map +1 -0
- package/dist/context-UaQ6cv0K.mjs +12 -0
- package/dist/context-UaQ6cv0K.mjs.map +1 -0
- package/dist/{context-errors-gitMJXxZ.mjs → context-errors-DcPmDybm.mjs} +2 -2
- package/dist/{context-errors-gitMJXxZ.mjs.map → context-errors-DcPmDybm.mjs.map} +1 -1
- package/dist/{contributor-runner-CDlPrzai.mjs → contributor-runner-BHjr6qSE.mjs} +3 -3
- package/dist/{contributor-runner-CDlPrzai.mjs.map → contributor-runner-BHjr6qSE.mjs.map} +1 -1
- package/dist/core/adapter.d.mts +1 -1
- package/dist/core/adapter.mjs +1 -1
- package/dist/core/app-module.mjs +1 -1
- package/dist/core/cache.mjs +1 -1
- package/dist/core/container.mjs +2 -2
- package/dist/core/cron.mjs +2 -2
- package/dist/core/decorators.mjs +2 -2
- package/dist/core/errors.mjs +1 -1
- package/dist/core/interfaces.mjs +1 -1
- package/dist/core/logger.mjs +1 -1
- package/dist/core/path.mjs +1 -1
- package/dist/core/plugin.d.mts +1 -1
- package/dist/core/plugin.mjs +1 -1
- package/dist/core/reactivity.mjs +1 -1
- package/dist/core-Ddq8b9hi.mjs +12 -0
- package/dist/{core-CSWR0hHJ.mjs.map → core-Ddq8b9hi.mjs.map} +1 -1
- package/dist/{cors-2Bwhyhpt.d.mts → cors-BlR_b0Qb.d.mts} +3 -3
- package/dist/cors-BlR_b0Qb.d.mts.map +1 -0
- package/dist/{csrf-BDAZK2mm.d.mts → csrf-ZFOrJZhJ.d.mts} +3 -3
- package/dist/csrf-ZFOrJZhJ.d.mts.map +1 -0
- package/dist/decorate-wrAUzCjW.mjs +13 -0
- package/dist/{decorate-D2oVJls5.mjs.map → decorate-wrAUzCjW.mjs.map} +1 -1
- package/dist/{define-adapter-oANmOi4a.mjs → define-adapter-Ce1FDvEo.mjs} +2 -2
- package/dist/{define-adapter-oANmOi4a.mjs.map → define-adapter-Ce1FDvEo.mjs.map} +1 -1
- package/dist/{di-hooks-HI14rSja.mjs → di-hooks-MFthA-Fs.mjs} +2 -2
- package/dist/{di-hooks-HI14rSja.mjs.map → di-hooks-MFthA-Fs.mjs.map} +1 -1
- package/dist/{disposables-CWNNe9HH.mjs → disposables-BgUIg4s1.mjs} +1 -1
- package/dist/{error-handler-CbP7hKdJ.d.mts → error-handler-CH4PPZCK.d.mts} +2 -2
- package/dist/{error-handler-CbP7hKdJ.d.mts.map → error-handler-CH4PPZCK.d.mts.map} +1 -1
- package/dist/express-BcfJgvBP.mjs +12 -0
- package/dist/express-BcfJgvBP.mjs.map +1 -0
- package/dist/express-lazy-DCYWtKZx.mjs +12 -0
- package/dist/express-lazy-DCYWtKZx.mjs.map +1 -0
- package/dist/handler-CS1BhG0C.mjs +12 -0
- package/dist/{handler-D23bJ6g1.mjs.map → handler-CS1BhG0C.mjs.map} +1 -1
- package/dist/{helmet-CEOmo516.d.mts → helmet-BVuVBl-D.d.mts} +3 -3
- package/dist/helmet-BVuVBl-D.d.mts.map +1 -0
- package/dist/{host-C2_vvcrO.mjs → host-lMSIGnh7.mjs} +2 -2
- package/dist/{host-C2_vvcrO.mjs.map → host-lMSIGnh7.mjs.map} +1 -1
- package/dist/http/application.d.mts +2 -2
- package/dist/http/application.mjs +2 -2
- package/dist/http/bootstrap.d.mts +1 -1
- package/dist/http/bootstrap.mjs +2 -2
- package/dist/http/context.d.mts +1 -1
- package/dist/http/context.mjs +2 -2
- package/dist/http/middleware/allowed-hosts.d.mts +1 -1
- package/dist/http/middleware/allowed-hosts.mjs +2 -2
- package/dist/http/middleware/allowed-hosts.mjs.map +1 -1
- package/dist/http/middleware/breach-padding.d.mts +1 -1
- package/dist/http/middleware/breach-padding.mjs +1 -1
- package/dist/http/middleware/breach-padding.mjs.map +1 -1
- package/dist/http/middleware/cors.d.mts +1 -1
- package/dist/http/middleware/cors.mjs +1 -1
- package/dist/http/middleware/cors.mjs.map +1 -1
- package/dist/http/middleware/csrf.d.mts +1 -1
- package/dist/http/middleware/csrf.mjs +2 -2
- package/dist/http/middleware/csrf.mjs.map +1 -1
- package/dist/http/middleware/error-handler.d.mts +1 -1
- package/dist/http/middleware/error-handler.mjs +2 -2
- package/dist/http/middleware/helmet.d.mts +1 -1
- package/dist/http/middleware/helmet.mjs +1 -1
- package/dist/http/middleware/helmet.mjs.map +1 -1
- package/dist/http/middleware/rate-limit.d.mts +1 -1
- package/dist/http/middleware/rate-limit.mjs +2 -2
- package/dist/http/middleware/rate-limit.mjs.map +1 -1
- package/dist/http/middleware/request-id.d.mts +1 -1
- package/dist/http/middleware/request-id.mjs +1 -1
- package/dist/http/middleware/request-id.mjs.map +1 -1
- package/dist/http/middleware/request-logger.mjs +2 -2
- package/dist/http/middleware/session.d.mts +1 -1
- package/dist/http/middleware/session.mjs +2 -2
- package/dist/http/middleware/session.mjs.map +1 -1
- package/dist/http/middleware/spa.d.mts +1 -1
- package/dist/http/middleware/spa.mjs +2 -2
- package/dist/http/middleware/upload.d.mts +3 -2
- package/dist/http/middleware/upload.mjs +2 -2
- package/dist/http/middleware/upload.mjs.map +1 -1
- package/dist/http/middleware/validate.d.mts +1 -1
- package/dist/http/middleware/validate.mjs +1 -1
- package/dist/http/middleware/validate.mjs.map +1 -1
- package/dist/http/middleware/views.d.mts +1 -1
- package/dist/http/middleware/views.mjs +2 -2
- package/dist/http/middleware/views.mjs.map +1 -1
- package/dist/http/query/index.mjs +2 -2
- package/dist/http/router-builder.d.mts +1 -1
- package/dist/http/router-builder.mjs +2 -2
- package/dist/http/runtimes/express.d.mts +47 -0
- package/dist/http/runtimes/express.d.mts.map +1 -0
- package/dist/http/runtimes/express.mjs +11 -0
- package/dist/http/runtimes/fastify.d.mts +1 -1
- package/dist/http/runtimes/fastify.mjs +2 -2
- package/dist/http/runtimes/fastify.mjs.map +1 -1
- package/dist/http/runtimes/h3-web.mjs +1 -1
- package/dist/http/runtimes/h3.d.mts +1 -1
- package/dist/http/runtimes/h3.mjs +2 -2
- package/dist/index.d.mts +17 -16
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/dist/{is-production-TSixl400.mjs → is-production-MYGnN2Nv.mjs} +2 -2
- package/dist/{is-production-TSixl400.mjs.map → is-production-MYGnN2Nv.mjs.map} +1 -1
- package/dist/{jobs-DIddIoQs.mjs → jobs-ANHUk_Ht.mjs} +3 -3
- package/dist/{jobs-DIddIoQs.mjs.map → jobs-ANHUk_Ht.mjs.map} +1 -1
- package/dist/{kv-stores-DXFBEYYu.d.mts → kv-stores-C1sQs2Rb.d.mts} +4 -4
- package/dist/{kv-stores-DXFBEYYu.d.mts.map → kv-stores-C1sQs2Rb.d.mts.map} +1 -1
- package/dist/{kv-stores-B9xLP0mg.mjs → kv-stores-Cro8JwAF.mjs} +3 -3
- package/dist/{kv-stores-B9xLP0mg.mjs.map → kv-stores-Cro8JwAF.mjs.map} +1 -1
- package/dist/lazy-serve-static-Zge6_pKo.mjs +12 -0
- package/dist/lazy-serve-static-Zge6_pKo.mjs.map +1 -0
- package/dist/{metadata-CJRJvpAK.mjs → metadata-_LqQme8p.mjs} +1 -1
- package/dist/{observers-DaIAahW4.mjs → observers-Oedvuzit.mjs} +2 -2
- package/dist/{observers-DaIAahW4.mjs.map → observers-Oedvuzit.mjs.map} +1 -1
- package/dist/precompressed-B6wz_5tz.mjs +12 -0
- package/dist/precompressed-B6wz_5tz.mjs.map +1 -0
- package/dist/{query-CUvSp-JT.mjs → query-KMR84Kwu.mjs} +2 -2
- package/dist/{query-CUvSp-JT.mjs.map → query-KMR84Kwu.mjs.map} +1 -1
- package/dist/{rate-limit-BgoeahE5.d.mts → rate-limit-DQDk6bAH.d.mts} +5 -5
- package/dist/rate-limit-DQDk6bAH.d.mts.map +1 -0
- package/dist/reply-BQTif5Iu.mjs +12 -0
- package/dist/reply-BQTif5Iu.mjs.map +1 -0
- package/dist/{request-id-CVzJ1uHD.d.mts → request-id-Dn64nEHK.d.mts} +3 -3
- package/dist/request-id-Dn64nEHK.d.mts.map +1 -0
- package/dist/request-scope-L71-nmRe.mjs +12 -0
- package/dist/request-scope-L71-nmRe.mjs.map +1 -0
- package/dist/{respond-Ius0bnxZ.mjs → respond-DR7zkOUf.mjs} +2 -2
- package/dist/{respond-Ius0bnxZ.mjs.map → respond-DR7zkOUf.mjs.map} +1 -1
- package/dist/rolldown-runtime-DouoOEDq.mjs +11 -0
- package/dist/{route-flag-BP_jbhNy.mjs → route-flag-DCOS_F5A.mjs} +3 -3
- package/dist/{route-flag-BP_jbhNy.mjs.map → route-flag-DCOS_F5A.mjs.map} +1 -1
- package/dist/{route-policy-BF1hOoUO.mjs → route-policy-Cy-oSUro.mjs} +2 -2
- package/dist/{route-policy-BF1hOoUO.mjs.map → route-policy-Cy-oSUro.mjs.map} +1 -1
- package/dist/{router-builder-BewIsj7V.d.mts → router-builder-BfbEdxew.d.mts} +2 -2
- package/dist/{router-builder-BewIsj7V.d.mts.map → router-builder-BfbEdxew.d.mts.map} +1 -1
- package/dist/{router-builder-CBjQNcUy.mjs → router-builder-U-kiHlqo.mjs} +3 -3
- package/dist/{router-builder-CBjQNcUy.mjs.map → router-builder-U-kiHlqo.mjs.map} +1 -1
- package/dist/{session-ChXx7jG5.d.mts → session-8uNRCplB.d.mts} +3 -3
- package/dist/session-8uNRCplB.d.mts.map +1 -0
- package/dist/{settings-DlZtVJ3I.mjs → settings-CrEgdXc0.mjs} +3 -3
- package/dist/{settings-DlZtVJ3I.mjs.map → settings-CrEgdXc0.mjs.map} +1 -1
- package/dist/{token-9VtCdkUp.mjs → token-B1FRPTVt.mjs} +1 -1
- package/dist/upload-Jgs9BFC4.d.mts +55 -0
- package/dist/upload-Jgs9BFC4.d.mts.map +1 -0
- package/dist/{upload-config-DYr3a8LW.mjs → upload-config-DEnNEwL4.mjs} +2 -2
- package/dist/upload-config-DEnNEwL4.mjs.map +1 -0
- package/dist/{url-for-Cci2zH9d.mjs → url-for-CLtZIeYd.mjs} +3 -3
- package/dist/{url-for-Cci2zH9d.mjs.map → url-for-CLtZIeYd.mjs.map} +1 -1
- package/dist/{validate-CzjCbRUn.d.mts → validate-D4Poe2EE.d.mts} +3 -3
- package/dist/validate-D4Poe2EE.d.mts.map +1 -0
- package/dist/{web-crypto-CWrgn2Yq.mjs → web-crypto-B6iM0yYx.mjs} +2 -2
- package/dist/{web-crypto-CWrgn2Yq.mjs.map → web-crypto-B6iM0yYx.mjs.map} +1 -1
- package/dist/web.d.mts +3 -3
- package/dist/web.mjs +2 -2
- package/dist/web.mjs.map +1 -1
- package/package.json +8 -1
- package/dist/adapter-BZ1WzN1z.d.mts.map +0 -1
- package/dist/allowed-hosts-D6qcuK5I.d.mts.map +0 -1
- package/dist/application-D5Iiy7rt.d.mts.map +0 -1
- package/dist/application-DtuQSky3.mjs +0 -14
- package/dist/application-DtuQSky3.mjs.map +0 -1
- package/dist/bootstrap-B_6QfzXV.mjs +0 -12
- package/dist/breach-padding-C-Dnq8CS.d.mts.map +0 -1
- package/dist/context-p-KpSsLy.mjs +0 -12
- package/dist/context-p-KpSsLy.mjs.map +0 -1
- package/dist/core-CSWR0hHJ.mjs +0 -12
- package/dist/cors-2Bwhyhpt.d.mts.map +0 -1
- package/dist/csrf-BDAZK2mm.d.mts.map +0 -1
- package/dist/decorate-D2oVJls5.mjs +0 -13
- package/dist/handler-D23bJ6g1.mjs +0 -12
- package/dist/helmet-CEOmo516.d.mts.map +0 -1
- package/dist/lazy-serve-static-BNM_5G_r.mjs +0 -12
- package/dist/lazy-serve-static-BNM_5G_r.mjs.map +0 -1
- package/dist/rate-limit-BgoeahE5.d.mts.map +0 -1
- package/dist/reply-C1CoxeQt.mjs +0 -12
- package/dist/reply-C1CoxeQt.mjs.map +0 -1
- package/dist/request-id-CVzJ1uHD.d.mts.map +0 -1
- package/dist/session-ChXx7jG5.d.mts.map +0 -1
- package/dist/upload-DkT2p1gd.d.mts +0 -104
- package/dist/upload-DkT2p1gd.d.mts.map +0 -1
- package/dist/upload-config-DYr3a8LW.mjs.map +0 -1
- package/dist/validate-CzjCbRUn.d.mts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v10.
|
|
2
|
+
* @forinda/kickjs v10.6.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
export{u as FILTER_OPERATORS,t as buildQueryParams,n as getQueryParsingDefaults,r as parseFilters,i as parsePagination,a as parseQuery,o as parseSearchQuery,s as parseSort,c as resetQueryParsingDefaults,l as setQueryParsingDefaults}from"../../query-
|
|
11
|
+
export{u as FILTER_OPERATORS,t as buildQueryParams,n as getQueryParsingDefaults,r as parseFilters,i as parsePagination,a as parseQuery,o as parseSearchQuery,s as parseSort,c as resetQueryParsingDefaults,l as setQueryParsingDefaults}from"../../query-KMR84Kwu.mjs";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
import { i as buildRouteTable, n as _setExternalContributorSources, r as assertRouteUnique, t as BuildRoutesOptions } from "../router-builder-
|
|
2
|
+
import { i as buildRouteTable, n as _setExternalContributorSources, r as assertRouteUnique, t as BuildRoutesOptions } from "../router-builder-BfbEdxew.mjs";
|
|
3
3
|
export { BuildRoutesOptions, _setExternalContributorSources, assertRouteUnique, buildRouteTable };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v10.
|
|
2
|
+
* @forinda/kickjs v10.6.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
export{t as _setExternalContributorSources,n as assertRouteUnique,r as buildRouteTable}from"../router-builder-
|
|
11
|
+
export{t as _setExternalContributorSources,n as assertRouteUnique,r as buildRouteTable}from"../router-builder-U-kiHlqo.mjs";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
import { d as HttpRuntime, h as RouteEntry } from "../../adapter-9sPr_5xt.mjs";
|
|
3
|
+
import { n as ConnectHandler } from "../../connect-BlIamapT.mjs";
|
|
4
|
+
import { t as BuildRoutesOptions } from "../../router-builder-BfbEdxew.mjs";
|
|
5
|
+
import { Express, Request, Response } from "express";
|
|
6
|
+
//#region src/http/runtimes/express.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Materialize a controller's {@link RouteEntry}[] onto a fresh `express.Router`.
|
|
9
|
+
* Reproduces the legacy handler ordering precisely: validation → upload →
|
|
10
|
+
* `(ctx, next)` middleware → contributor runner → terminal handler, with
|
|
11
|
+
* `beforeValidation` contributors ahead of validation. Each step
|
|
12
|
+
* constructs its own `RequestContext` over the same `req`/`res` — request-scoped
|
|
13
|
+
* state lives in the AsyncLocalStorage store, not on the ctx instance, so the
|
|
14
|
+
* per-step instances share state exactly as before.
|
|
15
|
+
*/
|
|
16
|
+
export declare function materializeRouter(entries: RouteEntry[]): ConnectHandler;
|
|
17
|
+
/**
|
|
18
|
+
* Build an Express Router from a controller class decorated with @Get, @Post,
|
|
19
|
+
* etc. The public, back-compatible entry point: a thin shim over
|
|
20
|
+
* {@link buildRouteTable} + {@link materializeRouter}. Returns an
|
|
21
|
+
* `express.Router` exactly as before — modules pass it to `app.use(path, router)`.
|
|
22
|
+
*
|
|
23
|
+
* @see buildRouteTable for the engine-neutral route-table form.
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildRoutes(controllerClass: any, options?: BuildRoutesOptions): ConnectHandler;
|
|
26
|
+
/**
|
|
27
|
+
* The default HTTP runtime. Express stays a peer dependency of `@forinda/kickjs`;
|
|
28
|
+
* apps that pass no `runtime` get this and behave exactly as before.
|
|
29
|
+
*/
|
|
30
|
+
export declare function expressRuntime(): HttpRuntime;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/http/runtimes/express-types.d.ts
|
|
33
|
+
/**
|
|
34
|
+
* The Express runtime's native types — what `AdapterContext.app` and
|
|
35
|
+
* `getRuntimeApp()` are typed as once `kick typegen` writes the
|
|
36
|
+
* `KickRuntimeRegister` augmentation for `runtime: 'express'`. Mirrors
|
|
37
|
+
* `FastifyRuntimeTypes` / `H3RuntimeTypes`; import it from
|
|
38
|
+
* `@forinda/kickjs/express`, which needs `@types/express`.
|
|
39
|
+
*/
|
|
40
|
+
interface ExpressRuntimeTypes {
|
|
41
|
+
request: Request;
|
|
42
|
+
response: Response;
|
|
43
|
+
app: Express;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export type { ExpressRuntimeTypes };
|
|
47
|
+
//# sourceMappingURL=express.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"express.d.mts","names":[],"sources":["../../../src/http/runtimes/express.ts","../../../src/http/runtimes/express-types.ts"],"mappings":";;;;;;;;;;;;;;;wBA6CgB,kBAAkB,SAAS,eAAe;;;;;;;;;wBAsF1C,YACd,sBACA,UAAS,qBACR;;;;;wBAQa,kBAAkB;;;;;;;;;;UCnIjB;EACf,SAAS;EACT,UAAU;EACV,KAAK"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @forinda/kickjs v10.6.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Felix Orinda
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
|
+
export{t as buildRoutes,n as expressRuntime,i as materializeRouter}from"../../express-BcfJgvBP.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v10.
|
|
2
|
+
* @forinda/kickjs v10.6.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
import{createLogger}from"../../core/logger.mjs";import{HttpException}from"../../core/errors.mjs";import{
|
|
11
|
+
import{createLogger}from"../../core/logger.mjs";import{HttpException}from"../../core/errors.mjs";import{n as applyHandlerResult,p as unsupportedMediaTypeError,u as parseForm}from"../../reply-BQTif5Iu.mjs";import{s as requestStore}from"../../background-DSztbyc4.mjs";import{n as disposeRequestStore,t as createRequestStore}from"../../request-scope-L71-nmRe.mjs";import{i as stringifyJson,r as publishMatchedRoute,t as RequestContext}from"../../context-UaQ6cv0K.mjs";import{validate}from"../middleware/validate.mjs";import{t as applyUploadConfig}from"../../upload-config-DEnNEwL4.mjs";import"../middleware/upload.mjs";import{t as lazyServeStatic}from"../../lazy-serve-static-Zge6_pKo.mjs";import Fastify from"fastify";const pluginOf=mod=>mod.default??mod,createFastify=Fastify,log=createLogger(`FastifyRuntime`),QUEUE=Symbol(`kickjs.fastify.connectQueue`),READY=Symbol(`kickjs.fastify.ready`),NEXT=Symbol(`kickjs.fastify.next`),NEEDS_MULTIPART=Symbol(`kickjs.fastify.needsMultipart`),NOOP_NEXT=()=>{};function settleOrFail(reply,returned){typeof returned?.then==`function`&&Promise.resolve(returned).then(void 0,()=>{!reply.sent&&!reply.raw.headersSent&&reply.code(500).send({message:`Internal Server Error`})})}const NO_FALLTHROUGH=Symbol(`kickjs.fastify.noFallthrough`);var FastifyReplyDriver=class{reply;constructor(reply){this.reply=reply}status(code){return this.reply.code(code),this}json(data){return this.reply.getHeader(`content-type`)||this.reply.type(`application/json; charset=utf-8`),this.reply.serializer(stringifyJson).send(data),this}send(data){return this.reply.send(data),this}type(contentType){return this.reply.type(contentType),this}getHeader(name){return this.reply.getHeader(name)}setHeader(name,value){return this.reply.removeHeader(name),this.reply.header(name,value),this}render(){throw Error(`ctx.render() is not supported on the Fastify runtime (no view engine).`)}writeHead(statusCode,headers){return this.reply.hijack(),this.reply.raw.writeHead(statusCode,headers),this}flushHeaders(){return this.reply.raw.flushHeaders?.(),this}write(chunk){return this.reply.raw.write(chunk)}end(data){return this.reply.raw.headersSent?this.reply.raw.end(data):this.reply.send(data??``),this}once(event,listener){return this.reply.raw.once(event,listener),this}get headersSent(){return this.reply.sent||this.reply.raw.headersSent}};function replyDriver(reply){return new FastifyReplyDriver(reply)}function routeHandler(entry){let validator=entry.meta.validation?validate(entry.meta.validation,{validationError:entry.validationError}):void 0;return async(request,reply)=>{let raw=request.raw;if(raw.body=request.body,raw.params=request.params,raw.query=request.query,entry.meta.upload&&entry.meta.upload.mode!==`none`){if(typeof request.parts!=`function`)throw Error(`@forinda/kickjs: @FileUpload on the Fastify runtime requires '@fastify/multipart'.
|
|
12
12
|
Install it as a peer dependency: pnpm add @fastify/multipart.`);let rawParts=[],fields={};for await(let part of request.parts())part.type===`file`&&part.toBuffer?rawParts.push({fieldname:part.fieldname,filename:part.filename??``,mimetype:part.mimetype??`application/octet-stream`,buffer:await part.toBuffer()}):fields[part.fieldname]=part.value;let{file,files}=applyUploadConfig(rawParts,entry.meta.upload);raw.file=file,raw.files=files,raw.body={...raw.body,...fields}}let headerId=raw.headers[`x-request-id`],requestId=raw.requestId||(Array.isArray(headerId)?headerId[0]:headerId),store=createRequestStore(requestId);raw.requestId=store.requestId,reply.getHeader(`x-request-id`)||reply.header(`x-request-id`,store.requestId),reply.raw.once(`close`,()=>disposeRequestStore(store)),await requestStore.run(store,async()=>{publishMatchedRoute(raw,entry);let ctx=new RequestContext(raw,reply,NOOP_NEXT,replyDriver(reply));if(entry.earlyContributorRunner&&(await entry.earlyContributorRunner(ctx),reply.sent))return;validator&&await new Promise((resolve,reject)=>{validator(raw,void 0,err=>err?reject(err):resolve())});for(let mw of entry.middlewares){let advanced=!1;if(await new Promise((resolve,reject)=>{Promise.resolve(mw(ctx,err=>{advanced=!0,err?reject(err):resolve()})).catch(reject)}),!advanced||reply.sent)return}if(entry.contributorRunner&&await entry.contributorRunner(ctx),reply.sent)return;let result=await entry.handler(ctx);!reply.sent&&!await applyHandlerResult(ctx,result)&&reply.callNotFound()})}}function hopTrust(hops){return(_ip,hopIndex)=>hopIndex<hops}function fastifyRuntime(){return{name:`fastify`,createApp(options={}){let app=createFastify({logger:!1,routerOptions:{ignoreTrailingSlash:!0},...options.bodyLimit===void 0?{}:{bodyLimit:options.bodyLimit},trustProxy:typeof options.trustProxy==`number`?hopTrust(options.trustProxy):options.trustProxy});app[QUEUE]=[];let addParser=app.addContentTypeParser?.bind(app);return addParser&&(addParser(/^application\/[\w.+-]+\+json$/,{parseAs:`string`},(_req,body,done)=>{if(body===``)return done(null,void 0);try{done(null,JSON.parse(body))}catch(err){done(HttpException.badRequest(err instanceof Error?err.message:`Request body could not be parsed`),void 0)}}),addParser(`application/x-www-form-urlencoded`,{parseAs:`string`},(_req,body,done)=>{done(null,parseForm(body))}),addParser(/^text\//,{parseAs:`string`},(_req,body,done)=>{done(null,body)}),addParser(`*`,{parseAs:`string`},(req,body,done)=>{if(!body)return done(null,void 0);done(unsupportedMediaTypeError(req.headers?.[`content-type`]),void 0)})),options.notFoundFallthrough===!1&&(app[NO_FALLTHROUGH]=!0),app},nodeHandler(app){let state=app;state[READY]||(state[READY]=(async()=>{if(state[NEEDS_MULTIPART]){let multipart=pluginOf(await import(`@fastify/multipart`));await app.register(multipart,{limits:{fileSize:2**53-1}})}let middie=pluginOf(await import(`@fastify/middie`));await app.register(middie);for(let{mw,opts}of state[QUEUE]??[])opts?.path===void 0?app.use(mw):app.use(opts.path,mw);await app.ready()})());let readyP=state[READY],ready=!1;return readyP.then(()=>ready=!0,()=>{}),(req,res,next)=>{next&&(req[NEXT]=next),ready?app.routing(req,res):readyP.then(()=>app.routing(req,res)).catch(err=>{if(next)return next(err);log.error(err,`Fastify failed to start`),res.statusCode=500,res.end(`Internal Server Error`)})}},mountRoutes(app,table){for(let{mountPath,routes}of table)for(let entry of routes){entry.meta.upload&&(app[NEEDS_MULTIPART]=!0);let url=joinPath(mountPath,entry.path);app.route({method:entry.method,url,handler:routeHandler(entry)})}},useConnect(app,mw,opts){app[QUEUE]?.push({mw,opts})},serveStatic(app,prefix,dir){this.useConnect(app,lazyServeStatic(dir),{path:prefix})},setNotFound(app,mw){app.setNotFoundHandler((request,reply)=>{let next=request.raw[NEXT];next&&!app[NO_FALLTHROUGH]?(reply.hijack(),next()):settleOrFail(reply,mw(request.raw,replyDriver(reply),NOOP_NEXT))})},setErrorHandler(app,mw){app.setErrorHandler((err,request,reply)=>{settleOrFail(reply,mw(err,request.raw,replyDriver(reply),NOOP_NEXT))})},close(app){return app.close()},capabilities:{render:!1,uploads:!0,connectMiddleware:!0,nativeBodyParsing:!0,http2:!0}}}function joinPath(mountPath,path){let a=mountPath.endsWith(`/`)?mountPath.slice(0,-1):mountPath;return path===`/`||path===``?a===``?`/`:a:`${a}${path.startsWith(`/`)?path:`/${path}`}`}export{fastifyRuntime};
|
|
13
13
|
//# sourceMappingURL=fastify.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastify.mjs","names":[],"sources":["../../../src/http/runtimes/fastify.ts"],"sourcesContent":["// The Fastify runtime — `@forinda/kickjs/fastify`.\n//\n// Implements the same HttpRuntime contract as expressRuntime, over Fastify 5.\n// KickJS still owns decorators → RouteTable, the contributor pipeline, and the\n// RequestContext surface; this runtime materializes routes as NATIVE Fastify\n// routes and wraps `reply` in a RuntimeResponse so `ctx.json` / `ctx.html` /\n// `ctx.sse` work unchanged.\n//\n// `fastify`, `@fastify/middie` are optional peers — install them alongside\n// `@forinda/kickjs` to use this subpath.\n//\n// Lifecycle note: Fastify registration (`register` / `use` / `route`) is\n// deferred until `ready()`. Connect middleware needs `@fastify/middie`\n// registered first, so `useConnect` only QUEUES middleware; `nodeHandler`\n// registers middie, then the queued middleware, then awaits `ready()`.\n\nimport type { IncomingMessage, ServerResponse } from 'node:http'\nimport Fastify from 'fastify'\n\nimport { HttpException } from '../../core/errors'\nimport { parseForm, unsupportedMediaTypeError } from '../body-policy'\nimport { RequestContext } from '../context'\nimport { publishMatchedRoute, stringifyJson } from '../runtime'\nimport { applyHandlerResult } from '../reply'\nimport { requestStore } from '../request-store'\nimport { createRequestStore, disposeRequestStore } from '../middleware/request-scope'\nimport { validate } from '../middleware/validate'\nimport { applyUploadConfig, type RawUploadPart } from '../middleware/upload'\nimport { lazyServeStatic } from './lazy-serve-static'\nimport { createLogger } from '../../core/logger'\nimport type {\n ConnectMiddleware,\n HttpRuntime,\n RouteEntry,\n RouteTable,\n RuntimeAppOptions,\n RuntimeResponse,\n UseConnectOptions,\n} from '../runtime'\n\n// The peers load through `import`, never `createRequire`: a bundler follows an\n// import, so `kick build:netlify|vercel` inlines them into the function. A\n// computed require is left for the platform to resolve, and the function has\n// no node_modules. `fastify` is static (this entry is the Fastify runtime);\n// the plugins are imported when first needed.\nconst pluginOf = (mod: { default?: unknown }): any => mod.default ?? mod\n// Typed structurally below (FastifyAppLike), as when this was required untyped.\nconst createFastify = Fastify as unknown as (options: object) => unknown\nconst log = createLogger('FastifyRuntime')\n\n// Minimal structural surface we use from Fastify — avoids a hard type dep so\n// the root package never needs `fastify` installed to typecheck.\ninterface FastifyReplyLike {\n code(statusCode: number): FastifyReplyLike\n send(payload?: unknown): FastifyReplyLike\n header(name: string, value: unknown): FastifyReplyLike\n removeHeader(name: string): FastifyReplyLike\n type(contentType: string): FastifyReplyLike\n serializer(fn: (payload: unknown) => string): FastifyReplyLike\n getHeader(name: string): unknown\n hijack(): void\n /** Hand the request to the not-found handler (Fastify 5). */\n callNotFound(): void\n readonly sent: boolean\n readonly raw: ServerResponse\n}\ninterface FastifyRequestLike {\n raw: IncomingMessage\n body?: unknown\n params?: unknown\n query?: unknown\n /** Request headers, as Fastify normalises them (lowercased keys). */\n headers?: Record<string, string | string[] | undefined>\n /** Present once @fastify/multipart is registered — async iterator of parts. */\n parts?: () => AsyncIterableIterator<MultipartPart>\n isMultipart?: () => boolean\n}\ntype FastifyHandler = (request: FastifyRequestLike, reply: FastifyReplyLike) => void | Promise<void>\ninterface FastifyAppLike {\n close(): Promise<void>\n register(plugin: unknown, opts?: unknown): Promise<void> | FastifyAppLike\n use(path: unknown, mw?: unknown): unknown\n route(opts: { method: string; url: string; handler: FastifyHandler }): unknown\n setNotFoundHandler(handler: FastifyHandler): unknown\n setErrorHandler(\n handler: (err: unknown, req: FastifyRequestLike, reply: FastifyReplyLike) => void,\n ): unknown\n ready(): Promise<void>\n routing(req: IncomingMessage, res: ServerResponse): void\n /**\n * Fastify's content-type parser registry. Typed here rather than reached for\n * with a cast so the callback shape is checked at the call site — these\n * parsers decide what `ctx.body` is on this runtime.\n */\n addContentTypeParser?(\n matcher: string | RegExp | string[],\n opts: { parseAs: 'string' | 'buffer' },\n parser: FastifyBodyParser,\n ): unknown\n}\n\n/** The `done` callback a Fastify content-type parser calls. */\ntype FastifyParserDone = (err: Error | null, body?: unknown) => void\n\n/** `done`-style callback Fastify hands a content-type parser. */\ntype FastifyBodyParser = (\n req: FastifyRequestLike,\n body: string | Buffer,\n done: (err: Error | null, body?: unknown) => void,\n) => void\n\nconst QUEUE = Symbol('kickjs.fastify.connectQueue')\nconst READY = Symbol('kickjs.fastify.ready')\nconst NEXT = Symbol('kickjs.fastify.next')\n// Set during mountRoutes when any route carries @FileUpload metadata, so\n// nodeHandler knows to register @fastify/multipart before ready().\nconst NEEDS_MULTIPART = Symbol('kickjs.fastify.needsMultipart')\nconst NOOP_NEXT = (): void => {}\n\n/**\n * An async error / not-found handler that rejects never answers; answer 500\n * so the request ends instead of hanging until the client gives up.\n */\nfunction settleOrFail(reply: FastifyReplyLike, returned: unknown): void {\n if (typeof (returned as PromiseLike<void> | undefined)?.then !== 'function') return\n Promise.resolve(returned).then(undefined, () => {\n if (!reply.sent && !reply.raw.headersSent) {\n // The 500 body every engine's built-in error handler starts from.\n reply.code(500).send({ message: 'Internal Server Error' })\n }\n })\n}\n/** `notFoundFallthrough: false` — answer unmatched requests instead of handing them back. */\nconst NO_FALLTHROUGH = Symbol('kickjs.fastify.noFallthrough')\n\n// A @fastify/multipart part as we consume it from `request.parts()`.\ninterface MultipartPart {\n type: 'file' | 'field'\n fieldname: string\n filename?: string\n mimetype?: string\n value?: unknown\n toBuffer?: () => Promise<Buffer>\n}\n\n/**\n * Wrap a Fastify reply so the RequestContext response helpers drive it.\n * A class so the ~12 driver methods live on a shared prototype — the previous\n * object-literal version re-allocated every method closure on each request.\n */\nclass FastifyReplyDriver implements RuntimeResponse {\n constructor(private readonly reply: FastifyReplyLike) {}\n status(code: number): this {\n this.reply.code(code)\n return this\n }\n json(data: unknown): this {\n // A custom serializer drops Fastify's default content-type; keep one the\n // caller chose (`application/problem+json`).\n if (!this.reply.getHeader('content-type')) this.reply.type('application/json; charset=utf-8')\n this.reply.serializer(stringifyJson).send(data)\n return this\n }\n send(data: unknown): this {\n this.reply.send(data)\n return this\n }\n type(contentType: string): this {\n this.reply.type(contentType)\n return this\n }\n getHeader(name: string): unknown {\n return this.reply.getHeader(name)\n }\n setHeader(name: string, value: unknown): this {\n // Replace, as node's `res.setHeader` and the web driver do. Fastify's\n // `header()` appends for `set-cookie`, so `setCookie()` — which passes the\n // whole list each time — sent the first cookie twice.\n this.reply.removeHeader(name)\n this.reply.header(name, value)\n return this\n }\n render(): never {\n throw new Error('ctx.render() is not supported on the Fastify runtime (no view engine).')\n }\n writeHead(statusCode: number, headers?: Record<string, string | number | string[]>): this {\n // Streaming / SSE: take over the raw socket so Fastify doesn't try to\n // serialize a reply we're writing by hand.\n this.reply.hijack()\n this.reply.raw.writeHead(statusCode, headers)\n return this\n }\n flushHeaders(): this {\n ;(this.reply.raw as ServerResponse & { flushHeaders?: () => void }).flushHeaders?.()\n return this\n }\n write(chunk: unknown): boolean {\n return this.reply.raw.write(chunk as never)\n }\n end(data?: unknown): this {\n // After writeHead (streaming, SSE) the reply is hijacked and the raw\n // socket is ours to finish. Otherwise finish through the reply, so the\n // status and headers set on it are sent — `ctx.redirect()` writes its\n // Location with setHeader() and then calls end().\n if (this.reply.raw.headersSent) this.reply.raw.end(data as never)\n else this.reply.send(data ?? '')\n return this\n }\n once(event: string, listener: (...args: unknown[]) => void): this {\n this.reply.raw.once(event, listener)\n return this\n }\n get headersSent(): boolean {\n return this.reply.sent || this.reply.raw.headersSent\n }\n}\n\nfunction replyDriver(reply: FastifyReplyLike): RuntimeResponse {\n return new FastifyReplyDriver(reply) as unknown as RuntimeResponse\n}\n\n/** Build the Fastify per-route handler that runs the kickjs pipeline. */\nfunction routeHandler(entry: RouteEntry): FastifyHandler {\n // Validation middleware is built ONCE per route (parity with the Express\n // materializer) — `validate()` constructs a fresh closure, so calling it\n // per request was pure allocation waste.\n const validator = entry.meta.validation\n ? validate(entry.meta.validation, { validationError: entry.validationError })\n : undefined\n return async (request, reply) => {\n // Fastify runs the route handler OUTSIDE the connect-middleware chain, so\n // (unlike Express) the requestScopeMiddleware ALS frame isn't active here.\n // Establish it around the pipeline so REQUEST-scoped DI, contributors, and\n // ctx.set/get work. Reuse the inbound x-request-id, or the id a connect\n // middleware (requestId / requestScope, run earlier via middie) already\n // stamped on the raw request, before generating a fresh one.\n // Use the raw node request as `ctx.req`: it natively provides the stream\n // events (`on('close')` / `once`) that SSE and `ctx.signal` need — Fastify's\n // request object doesn't. Copy Fastify's parsed body/params/query onto it so\n // `ctx.body` / `ctx.params` / `ctx.query` keep working.\n const raw = request.raw as IncomingMessage & {\n requestId?: string\n body?: unknown\n params?: unknown\n query?: unknown\n file?: unknown\n files?: unknown\n }\n raw.body = request.body\n raw.params = request.params\n raw.query = request.query\n\n // @FileUpload: buffer multipart parts into the multer-shaped file(s) that\n // `ctx.file` / `ctx.files` expose. Fastify doesn't parse multipart natively\n // — @fastify/multipart (registered in nodeHandler when any route needs it)\n // provides `request.parts()`. Non-file fields are merged onto `raw.body` so\n // validation / `ctx.body` see them, matching multer's req.body behavior.\n if (entry.meta.upload && entry.meta.upload.mode !== 'none') {\n if (typeof request.parts !== 'function') {\n throw new Error(\n \"@forinda/kickjs: @FileUpload on the Fastify runtime requires '@fastify/multipart'.\\n\" +\n 'Install it as a peer dependency: pnpm add @fastify/multipart.',\n )\n }\n const rawParts: RawUploadPart[] = []\n const fields: Record<string, unknown> = {}\n for await (const part of request.parts()) {\n if (part.type === 'file' && part.toBuffer) {\n rawParts.push({\n fieldname: part.fieldname,\n filename: part.filename ?? '',\n mimetype: part.mimetype ?? 'application/octet-stream',\n buffer: await part.toBuffer(),\n })\n } else {\n fields[part.fieldname] = part.value\n }\n }\n const { file, files } = applyUploadConfig(rawParts, entry.meta.upload)\n raw.file = file\n raw.files = files\n raw.body = { ...(raw.body as Record<string, unknown> | undefined), ...fields }\n }\n\n const headerId = raw.headers['x-request-id']\n // An id already assigned (requestId() middleware) wins over the header,\n // as on Express and h3.\n const requestId = raw.requestId || (Array.isArray(headerId) ? headerId[0] : headerId)\n const store = createRequestStore(requestId)\n // Propagate the resolved id back onto the raw request so anything reading\n // `req.requestId` inside the frame (e.g. request-logger) matches the store\n // and the X-Request-Id response header — parity with Express.\n raw.requestId = store.requestId\n if (!reply.getHeader('x-request-id')) reply.header('x-request-id', store.requestId)\n\n // @PreDestroy teardown for REQUEST-scoped instances once the response\n // closes (finished or aborted) — parity with requestScopeMiddleware.\n reply.raw.once('close', () => disposeRequestStore(store))\n\n await requestStore.run(store, async () => {\n publishMatchedRoute(raw, entry)\n const ctx = new RequestContext(raw as never, reply as never, NOOP_NEXT, replyDriver(reply))\n\n // `beforeValidation` contributors (#677) — ahead of validation and middleware.\n if (entry.earlyContributorRunner) {\n await entry.earlyContributorRunner(ctx)\n if (reply.sent) return\n }\n\n // Validation (from @Get(path, schema) / route.validation). `validator` is a\n // connect-style middleware built once at route registration; it mutates\n // req.body/query/params to the parsed value and calls next(err) on failure\n // — it never touches `res`, so it runs cleanly here. A rejection\n // propagates to the error handler (422).\n if (validator) {\n await new Promise<void>((resolve, reject) => {\n validator(raw as never, undefined as never, (err?: unknown) =>\n err ? reject(err) : resolve(),\n )\n })\n }\n\n // Class + method middleware — `(ctx, next)`; await each, stop if it ended\n // the response or called next(err).\n for (const mw of entry.middlewares) {\n let advanced = false\n await new Promise<void>((resolve, reject) => {\n const next = (err?: unknown): void => {\n advanced = true\n if (err) reject(err)\n else resolve()\n }\n Promise.resolve(mw(ctx, next)).catch(reject)\n })\n if (!advanced || reply.sent) return\n }\n\n if (entry.contributorRunner) await entry.contributorRunner(ctx)\n if (reply.sent) return\n const result = await entry.handler(ctx)\n // Return-value handlers (reply.ts): auto-send when nothing was written.\n // Nothing written and nothing returned falls through to the 404 handler,\n // as on Express and h3 — not Fastify's own empty 200.\n if (!reply.sent && !(await applyHandlerResult(ctx, result))) reply.callNotFound()\n })\n }\n}\n\n/** Express's `trust proxy` number: trust the first `hops` addresses from the socket. */\nfunction hopTrust(hops: number): (ip: string, hopIndex: number) => boolean {\n return (_ip, hopIndex) => hopIndex < hops\n}\n\n/**\n * The Fastify HTTP runtime. Pass to `bootstrap({ runtime: fastifyRuntime() })`.\n * Per spec §10: Fastify's built-in pino logger is disabled (`logger: false`) so\n * the kickjs `requestLogger` middleware stays the single log format.\n */\nexport function fastifyRuntime(): HttpRuntime<FastifyAppLike> {\n return {\n name: 'fastify',\n\n createApp(options: RuntimeAppOptions = {}): FastifyAppLike {\n const app = createFastify({\n logger: false,\n // Match Express / h3 routing leniency: `/api/v1/hello` and\n // `/api/v1/hello/` resolve to the same route. Without this, Fastify's\n // strict router 404s a trailing-slash request — e.g. a controller's\n // root `@Get('/')` (mounted at the prefix) misses `${prefix}/`. Set under\n // `routerOptions` (Fastify 5+; top-level `ignoreTrailingSlash` is\n // deprecated, removed in Fastify 6).\n routerOptions: { ignoreTrailingSlash: true },\n // `jsonLimit`, which Fastify otherwise ignores in favour of its own 1 MiB.\n ...(options.bodyLimit !== undefined ? { bodyLimit: options.bodyLimit } : {}),\n // Express semantics for every form. Fastify takes a predicate as-is,\n // but reads a hop count as \"trust nothing\", where Express trusts that\n // many hops from the socket.\n trustProxy:\n typeof options.trustProxy === 'number'\n ? hopTrust(options.trustProxy)\n : options.trustProxy,\n }) as FastifyAppLike & {\n [QUEUE]?: Array<{ mw: ConnectMiddleware; opts?: UseConnectOptions }>\n }\n app[QUEUE] = []\n\n // Fastify ships parsers for `application/json` and `text/plain` only, and\n // answers 415 for everything else. That made a form post work on Express\n // and h3 but fail on Fastify alone (#590). Register the rest of the\n // framework's supported set so all engines agree.\n //\n // Deliberately NOT a `'*'` catch-all: that would swallow multipart, and\n // `@fastify/multipart` is itself the multipart content-type parser,\n // registered conditionally in `nodeHandler` when a route needs it.\n const addParser = app.addContentTypeParser?.bind(app)\n if (addParser) {\n // `application/*+json` — RFC 6838 §4.2.8 guarantees the bytes are JSON.\n addParser(\n /^application\\/[\\w.+-]+\\+json$/,\n { parseAs: 'string' },\n (_req: FastifyRequestLike, body: string | Buffer, done: FastifyParserDone) => {\n if (body === '') return done(null, undefined)\n try {\n done(null, JSON.parse(body as string))\n } catch (err) {\n // A bare SyntaxError carries no status, so the shared error handler\n // would call it a 500 — Fastify's own JSON parser answers 400\n // (FST_ERR_CTP_INVALID_JSON_BODY), and so must this one.\n done(\n HttpException.badRequest(\n err instanceof Error ? err.message : 'Request body could not be parsed',\n ),\n undefined,\n )\n }\n },\n )\n addParser(\n 'application/x-www-form-urlencoded',\n { parseAs: 'string' },\n (_req: FastifyRequestLike, body: string | Buffer, done: FastifyParserDone) => {\n done(null, parseForm(body as string))\n },\n )\n // `text/*` beyond Fastify's built-in `text/plain`. Raw string, never\n // JSON: `text/plain` is CORS-safelisted, so parsing it as JSON would\n // re-open no-preflight CSRF against a JSON API.\n addParser(\n /^text\\//,\n { parseAs: 'string' },\n (_req: FastifyRequestLike, body: string | Buffer, done: FastifyParserDone) => {\n done(null, body)\n },\n )\n // Fastify already answers 415 for a type it has no parser for, but with\n // its own message and no `Accept`. `'*'` is Fastify's documented\n // fallback — consulted only when nothing more specific matches — so it\n // does not shadow the parsers above, nor `@fastify/multipart`, which\n // registers `multipart/form-data` when an upload route needs it.\n addParser(\n '*',\n { parseAs: 'string' },\n (req: FastifyRequestLike, body: string | Buffer, done: FastifyParserDone) => {\n // No body is not an unsupported body. Fastify calls the parser even\n // for an empty payload, so without this a bodyless POST carrying an\n // unrelated content type would be rejected.\n if (!body) return done(null, undefined)\n done(unsupportedMediaTypeError(req.headers?.['content-type']), undefined)\n },\n )\n }\n\n if (options.notFoundFallthrough === false) {\n ;(app as { [NO_FALLTHROUGH]?: boolean })[NO_FALLTHROUGH] = true\n }\n return app\n },\n\n nodeHandler(app) {\n // Register middie + queued connect middleware + finalize `ready()` exactly\n // ONCE per app, even though Application may call nodeHandler per request.\n const state = app as {\n [QUEUE]?: Array<{ mw: ConnectMiddleware; opts?: UseConnectOptions }>\n [READY]?: Promise<void>\n [NEEDS_MULTIPART]?: boolean\n }\n if (!state[READY]) {\n state[READY] = (async () => {\n // Register @fastify/multipart first when any route uses @FileUpload so\n // `request.parts()` is available. Our applyUploadConfig enforces the\n // real per-file maxSize, so give the plugin a generous fileSize ceiling\n // (its 1MB default would silently truncate larger uploads first).\n if (state[NEEDS_MULTIPART]) {\n const multipart = pluginOf(await import('@fastify/multipart'))\n await app.register(multipart, { limits: { fileSize: Number.MAX_SAFE_INTEGER } })\n }\n const middie = pluginOf(await import('@fastify/middie'))\n await app.register(middie)\n for (const { mw, opts } of state[QUEUE] ?? []) {\n if (opts?.path !== undefined)\n (app.use as (p: unknown, m: unknown) => void)(opts.path, mw)\n else (app.use as (m: unknown) => void)(mw)\n }\n await app.ready()\n })()\n }\n const readyP = state[READY]\n // Once ready, route synchronously — no promise hop per request.\n let ready = false\n readyP.then(\n () => (ready = true),\n () => {},\n )\n\n return (req: IncomingMessage, res: ServerResponse, next?: (err?: unknown) => void) => {\n if (next) (req as IncomingMessage & { [NEXT]?: (err?: unknown) => void })[NEXT] = next\n if (ready) {\n app.routing(req, res)\n return\n }\n readyP\n .then(() => app.routing(req, res))\n .catch((err) => {\n if (next) return next(err)\n // No host to hand the error to: answer rather than leave the request open.\n log.error(err, 'Fastify failed to start')\n res.statusCode = 500\n res.end('Internal Server Error')\n })\n }\n },\n\n mountRoutes(app, table: RouteTable) {\n for (const { mountPath, routes } of table) {\n for (const entry of routes) {\n if (entry.meta.upload) (app as { [NEEDS_MULTIPART]?: boolean })[NEEDS_MULTIPART] = true\n const url = joinPath(mountPath, entry.path)\n app.route({ method: entry.method, url, handler: routeHandler(entry) })\n }\n }\n },\n\n useConnect(app, mw: ConnectMiddleware, opts?: UseConnectOptions) {\n const queue = (\n app as { [QUEUE]?: Array<{ mw: ConnectMiddleware; opts?: UseConnectOptions }> }\n )[QUEUE]\n queue?.push({ mw, opts })\n },\n\n serveStatic(app, prefix, dir) {\n // Serve via `serve-static` (the standalone connect middleware behind\n // express.static) so the Fastify runtime carries no `express` dependency —\n // queued like any other connect middleware, bridged through middie.\n this.useConnect(app, lazyServeStatic(dir), { path: prefix })\n },\n\n setNotFound(app, mw: ConnectMiddleware) {\n app.setNotFoundHandler((request, reply) => {\n const next = (request.raw as IncomingMessage & { [NEXT]?: (err?: unknown) => void })[NEXT]\n if (next && !(app as { [NO_FALLTHROUGH]?: boolean })[NO_FALLTHROUGH]) {\n // Vite dev fall-through: hand the request back to the outer chain.\n reply.hijack()\n next()\n return\n }\n // Pass the reply DRIVER (not raw res) so the connect-style\n // notFoundHandler's `res.status().json()` lands on the Fastify reply.\n settleOrFail(\n reply,\n (mw as (req: unknown, res: unknown, next: () => void) => unknown)(\n request.raw,\n replyDriver(reply),\n NOOP_NEXT,\n ),\n )\n })\n },\n\n setErrorHandler(app, mw: ConnectMiddleware) {\n app.setErrorHandler((err, request, reply) => {\n // Reply driver (not raw res) so the connect-style errorHandler's\n // `res.status().json()` / `setHeader` land on the Fastify reply.\n settleOrFail(\n reply,\n (mw as (e: unknown, req: unknown, res: unknown, next: () => void) => unknown)(\n err,\n request.raw,\n replyDriver(reply),\n NOOP_NEXT,\n ),\n )\n })\n },\n\n close(app) {\n // Runs the instance's onClose hooks (plugins registered on it).\n return app.close()\n },\n\n capabilities: {\n render: false,\n uploads: true,\n connectMiddleware: true,\n nativeBodyParsing: true,\n http2: true,\n },\n }\n}\n\n/**\n * The Fastify runtime's engine-native types — what the runtime-typed escape\n * hatches resolve to once the `kick/runtime` typegen emits a `KickRuntimeRegister`\n * augmentation pointing here (spec §4.3b). `AdapterContext.app` / `getRuntimeApp()`\n * become `FastifyInstance`; `ctx.req` / `ctx.res` the Fastify request / reply.\n * Mirrors {@link import('../runtime').ExpressRuntimeTypes} for the default engine.\n */\nexport interface FastifyRuntimeTypes {\n request: import('fastify').FastifyRequest\n response: import('fastify').FastifyReply\n app: import('fastify').FastifyInstance\n}\n\n/** Join a mount prefix and a route path into one URL, collapsing slashes. */\nfunction joinPath(mountPath: string, path: string): string {\n const a = mountPath.endsWith('/') ? mountPath.slice(0, -1) : mountPath\n // A root route path ('/' or '') maps to the mount prefix itself — otherwise a\n // controller `@Post('/')` would register at `${prefix}/`, and a request to\n // `${prefix}` (no trailing slash) wouldn't match under Fastify's strict router.\n if (path === '/' || path === '') return a === '' ? '/' : a\n const b = path.startsWith('/') ? path : `/${path}`\n return `${a}${b}`\n}\n"],"mappings":";;;;;;;;;;mnBA6CA,MAAM,SAAY,KAAoC,IAAI,SAAW,IAE/D,cAAgB,QAChB,IAAM,aAAa,gBAAgB,EA+DnC,MAAQ,OAAO,6BAA6B,EAC5C,MAAQ,OAAO,sBAAsB,EACrC,KAAO,OAAO,qBAAqB,EAGnC,gBAAkB,OAAO,+BAA+B,EACxD,cAAwB,CAAC,EAM/B,SAAS,aAAa,MAAyB,SAAyB,CAClE,OAAQ,UAA4C,MAAS,YACjE,QAAQ,QAAQ,QAAQ,CAAC,CAAC,KAAK,IAAA,OAAiB,CAC1C,CAAC,MAAM,MAAQ,CAAC,MAAM,IAAI,aAE5B,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAE,QAAS,uBAAwB,CAAC,CAE7D,CAAC,CACH,CAEA,MAAM,eAAiB,OAAO,8BAA8B,EAiB5D,IAAM,mBAAN,KAAoD,CACrB,MAA7B,YAAY,MAA0C,CA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ACzD,IAAM,EAAI,UAAU,SAAS,GAAG,EAAI,UAAU,MAAM,EAAG,EAAE,EAAI,UAM7D,OAFI,OAAS,KAAO,OAAS,GAAW,IAAM,GAAK,IAAM,EAElD,GAAG,IADA,KAAK,WAAW,GAAG,EAAI,KAAO,IAAI,QAE9C"}
|
|
1
|
+
{"version":3,"file":"fastify.mjs","names":[],"sources":["../../../src/http/runtimes/fastify.ts"],"sourcesContent":["// The Fastify runtime — `@forinda/kickjs/fastify`.\n//\n// Implements the same HttpRuntime contract as expressRuntime, over Fastify 5.\n// KickJS still owns decorators → RouteTable, the contributor pipeline, and the\n// RequestContext surface; this runtime materializes routes as NATIVE Fastify\n// routes and wraps `reply` in a RuntimeResponse so `ctx.json` / `ctx.html` /\n// `ctx.sse` work unchanged.\n//\n// `fastify`, `@fastify/middie` are optional peers — install them alongside\n// `@forinda/kickjs` to use this subpath.\n//\n// Lifecycle note: Fastify registration (`register` / `use` / `route`) is\n// deferred until `ready()`. Connect middleware needs `@fastify/middie`\n// registered first, so `useConnect` only QUEUES middleware; `nodeHandler`\n// registers middie, then the queued middleware, then awaits `ready()`.\n\nimport type { IncomingMessage, ServerResponse } from 'node:http'\nimport Fastify from 'fastify'\n\nimport { HttpException } from '../../core/errors'\nimport { parseForm, unsupportedMediaTypeError } from '../body-policy'\nimport { RequestContext } from '../context'\nimport { publishMatchedRoute, stringifyJson } from '../runtime'\nimport { applyHandlerResult } from '../reply'\nimport { requestStore } from '../request-store'\nimport { createRequestStore, disposeRequestStore } from '../middleware/request-scope'\nimport { validate } from '../middleware/validate'\nimport { applyUploadConfig, type RawUploadPart } from '../middleware/upload'\nimport { lazyServeStatic } from './lazy-serve-static'\nimport { createLogger } from '../../core/logger'\nimport type {\n ConnectMiddleware,\n HttpRuntime,\n RouteEntry,\n RouteTable,\n RuntimeAppOptions,\n RuntimeResponse,\n UseConnectOptions,\n} from '../runtime'\n\n// The peers load through `import`, never `createRequire`: a bundler follows an\n// import, so `kick build:netlify|vercel` inlines them into the function. A\n// computed require is left for the platform to resolve, and the function has\n// no node_modules. `fastify` is static (this entry is the Fastify runtime);\n// the plugins are imported when first needed.\nconst pluginOf = (mod: { default?: unknown }): any => mod.default ?? mod\n// Typed structurally below (FastifyAppLike), as when this was required untyped.\nconst createFastify = Fastify as unknown as (options: object) => unknown\nconst log = createLogger('FastifyRuntime')\n\n// Minimal structural surface we use from Fastify — avoids a hard type dep so\n// the root package never needs `fastify` installed to typecheck.\ninterface FastifyReplyLike {\n code(statusCode: number): FastifyReplyLike\n send(payload?: unknown): FastifyReplyLike\n header(name: string, value: unknown): FastifyReplyLike\n removeHeader(name: string): FastifyReplyLike\n type(contentType: string): FastifyReplyLike\n serializer(fn: (payload: unknown) => string): FastifyReplyLike\n getHeader(name: string): unknown\n hijack(): void\n /** Hand the request to the not-found handler (Fastify 5). */\n callNotFound(): void\n readonly sent: boolean\n readonly raw: ServerResponse\n}\ninterface FastifyRequestLike {\n raw: IncomingMessage\n body?: unknown\n params?: unknown\n query?: unknown\n /** Request headers, as Fastify normalises them (lowercased keys). */\n headers?: Record<string, string | string[] | undefined>\n /** Present once @fastify/multipart is registered — async iterator of parts. */\n parts?: () => AsyncIterableIterator<MultipartPart>\n isMultipart?: () => boolean\n}\ntype FastifyHandler = (request: FastifyRequestLike, reply: FastifyReplyLike) => void | Promise<void>\ninterface FastifyAppLike {\n close(): Promise<void>\n register(plugin: unknown, opts?: unknown): Promise<void> | FastifyAppLike\n use(path: unknown, mw?: unknown): unknown\n route(opts: { method: string; url: string; handler: FastifyHandler }): unknown\n setNotFoundHandler(handler: FastifyHandler): unknown\n setErrorHandler(\n handler: (err: unknown, req: FastifyRequestLike, reply: FastifyReplyLike) => void,\n ): unknown\n ready(): Promise<void>\n routing(req: IncomingMessage, res: ServerResponse): void\n /**\n * Fastify's content-type parser registry. Typed here rather than reached for\n * with a cast so the callback shape is checked at the call site — these\n * parsers decide what `ctx.body` is on this runtime.\n */\n addContentTypeParser?(\n matcher: string | RegExp | string[],\n opts: { parseAs: 'string' | 'buffer' },\n parser: FastifyBodyParser,\n ): unknown\n}\n\n/** The `done` callback a Fastify content-type parser calls. */\ntype FastifyParserDone = (err: Error | null, body?: unknown) => void\n\n/** `done`-style callback Fastify hands a content-type parser. */\ntype FastifyBodyParser = (\n req: FastifyRequestLike,\n body: string | Buffer,\n done: (err: Error | null, body?: unknown) => void,\n) => void\n\nconst QUEUE = Symbol('kickjs.fastify.connectQueue')\nconst READY = Symbol('kickjs.fastify.ready')\nconst NEXT = Symbol('kickjs.fastify.next')\n// Set during mountRoutes when any route carries @FileUpload metadata, so\n// nodeHandler knows to register @fastify/multipart before ready().\nconst NEEDS_MULTIPART = Symbol('kickjs.fastify.needsMultipart')\nconst NOOP_NEXT = (): void => {}\n\n/**\n * An async error / not-found handler that rejects never answers; answer 500\n * so the request ends instead of hanging until the client gives up.\n */\nfunction settleOrFail(reply: FastifyReplyLike, returned: unknown): void {\n if (typeof (returned as PromiseLike<void> | undefined)?.then !== 'function') return\n Promise.resolve(returned).then(undefined, () => {\n if (!reply.sent && !reply.raw.headersSent) {\n // The 500 body every engine's built-in error handler starts from.\n reply.code(500).send({ message: 'Internal Server Error' })\n }\n })\n}\n/** `notFoundFallthrough: false` — answer unmatched requests instead of handing them back. */\nconst NO_FALLTHROUGH = Symbol('kickjs.fastify.noFallthrough')\n\n// A @fastify/multipart part as we consume it from `request.parts()`.\ninterface MultipartPart {\n type: 'file' | 'field'\n fieldname: string\n filename?: string\n mimetype?: string\n value?: unknown\n toBuffer?: () => Promise<Buffer>\n}\n\n/**\n * Wrap a Fastify reply so the RequestContext response helpers drive it.\n * A class so the ~12 driver methods live on a shared prototype — the previous\n * object-literal version re-allocated every method closure on each request.\n */\nclass FastifyReplyDriver implements RuntimeResponse {\n constructor(private readonly reply: FastifyReplyLike) {}\n status(code: number): this {\n this.reply.code(code)\n return this\n }\n json(data: unknown): this {\n // A custom serializer drops Fastify's default content-type; keep one the\n // caller chose (`application/problem+json`).\n if (!this.reply.getHeader('content-type')) this.reply.type('application/json; charset=utf-8')\n this.reply.serializer(stringifyJson).send(data)\n return this\n }\n send(data: unknown): this {\n this.reply.send(data)\n return this\n }\n type(contentType: string): this {\n this.reply.type(contentType)\n return this\n }\n getHeader(name: string): unknown {\n return this.reply.getHeader(name)\n }\n setHeader(name: string, value: unknown): this {\n // Replace, as node's `res.setHeader` and the web driver do. Fastify's\n // `header()` appends for `set-cookie`, so `setCookie()` — which passes the\n // whole list each time — sent the first cookie twice.\n this.reply.removeHeader(name)\n this.reply.header(name, value)\n return this\n }\n render(): never {\n throw new Error('ctx.render() is not supported on the Fastify runtime (no view engine).')\n }\n writeHead(statusCode: number, headers?: Record<string, string | number | string[]>): this {\n // Streaming / SSE: take over the raw socket so Fastify doesn't try to\n // serialize a reply we're writing by hand.\n this.reply.hijack()\n this.reply.raw.writeHead(statusCode, headers)\n return this\n }\n flushHeaders(): this {\n ;(this.reply.raw as ServerResponse & { flushHeaders?: () => void }).flushHeaders?.()\n return this\n }\n write(chunk: unknown): boolean {\n return this.reply.raw.write(chunk as never)\n }\n end(data?: unknown): this {\n // After writeHead (streaming, SSE) the reply is hijacked and the raw\n // socket is ours to finish. Otherwise finish through the reply, so the\n // status and headers set on it are sent — `ctx.redirect()` writes its\n // Location with setHeader() and then calls end().\n if (this.reply.raw.headersSent) this.reply.raw.end(data as never)\n else this.reply.send(data ?? '')\n return this\n }\n once(event: string, listener: (...args: unknown[]) => void): this {\n this.reply.raw.once(event, listener)\n return this\n }\n get headersSent(): boolean {\n return this.reply.sent || this.reply.raw.headersSent\n }\n}\n\nfunction replyDriver(reply: FastifyReplyLike): RuntimeResponse {\n return new FastifyReplyDriver(reply) as unknown as RuntimeResponse\n}\n\n/** Build the Fastify per-route handler that runs the kickjs pipeline. */\nfunction routeHandler(entry: RouteEntry): FastifyHandler {\n // Validation middleware is built ONCE per route (parity with the Express\n // materializer) — `validate()` constructs a fresh closure, so calling it\n // per request was pure allocation waste.\n const validator = entry.meta.validation\n ? validate(entry.meta.validation, { validationError: entry.validationError })\n : undefined\n return async (request, reply) => {\n // Fastify runs the route handler OUTSIDE the connect-middleware chain, so\n // (unlike Express) the requestScopeMiddleware ALS frame isn't active here.\n // Establish it around the pipeline so REQUEST-scoped DI, contributors, and\n // ctx.set/get work. Reuse the inbound x-request-id, or the id a connect\n // middleware (requestId / requestScope, run earlier via middie) already\n // stamped on the raw request, before generating a fresh one.\n // Use the raw node request as `ctx.req`: it natively provides the stream\n // events (`on('close')` / `once`) that SSE and `ctx.signal` need — Fastify's\n // request object doesn't. Copy Fastify's parsed body/params/query onto it so\n // `ctx.body` / `ctx.params` / `ctx.query` keep working.\n const raw = request.raw as IncomingMessage & {\n requestId?: string\n body?: unknown\n params?: unknown\n query?: unknown\n file?: unknown\n files?: unknown\n }\n raw.body = request.body\n raw.params = request.params\n raw.query = request.query\n\n // @FileUpload: buffer multipart parts into the multer-shaped file(s) that\n // `ctx.file` / `ctx.files` expose. Fastify doesn't parse multipart natively\n // — @fastify/multipart (registered in nodeHandler when any route needs it)\n // provides `request.parts()`. Non-file fields are merged onto `raw.body` so\n // validation / `ctx.body` see them, matching multer's req.body behavior.\n if (entry.meta.upload && entry.meta.upload.mode !== 'none') {\n if (typeof request.parts !== 'function') {\n throw new Error(\n \"@forinda/kickjs: @FileUpload on the Fastify runtime requires '@fastify/multipart'.\\n\" +\n 'Install it as a peer dependency: pnpm add @fastify/multipart.',\n )\n }\n const rawParts: RawUploadPart[] = []\n const fields: Record<string, unknown> = {}\n for await (const part of request.parts()) {\n if (part.type === 'file' && part.toBuffer) {\n rawParts.push({\n fieldname: part.fieldname,\n filename: part.filename ?? '',\n mimetype: part.mimetype ?? 'application/octet-stream',\n buffer: await part.toBuffer(),\n })\n } else {\n fields[part.fieldname] = part.value\n }\n }\n const { file, files } = applyUploadConfig(rawParts, entry.meta.upload)\n raw.file = file\n raw.files = files\n raw.body = { ...(raw.body as Record<string, unknown> | undefined), ...fields }\n }\n\n const headerId = raw.headers['x-request-id']\n // An id already assigned (requestId() middleware) wins over the header,\n // as on Express and h3.\n const requestId = raw.requestId || (Array.isArray(headerId) ? headerId[0] : headerId)\n const store = createRequestStore(requestId)\n // Propagate the resolved id back onto the raw request so anything reading\n // `req.requestId` inside the frame (e.g. request-logger) matches the store\n // and the X-Request-Id response header — parity with Express.\n raw.requestId = store.requestId\n if (!reply.getHeader('x-request-id')) reply.header('x-request-id', store.requestId)\n\n // @PreDestroy teardown for REQUEST-scoped instances once the response\n // closes (finished or aborted) — parity with requestScopeMiddleware.\n reply.raw.once('close', () => disposeRequestStore(store))\n\n await requestStore.run(store, async () => {\n publishMatchedRoute(raw, entry)\n const ctx = new RequestContext(raw as never, reply as never, NOOP_NEXT, replyDriver(reply))\n\n // `beforeValidation` contributors (#677) — ahead of validation and middleware.\n if (entry.earlyContributorRunner) {\n await entry.earlyContributorRunner(ctx)\n if (reply.sent) return\n }\n\n // Validation (from @Get(path, schema) / route.validation). `validator` is a\n // connect-style middleware built once at route registration; it mutates\n // req.body/query/params to the parsed value and calls next(err) on failure\n // — it never touches `res`, so it runs cleanly here. A rejection\n // propagates to the error handler (422).\n if (validator) {\n await new Promise<void>((resolve, reject) => {\n validator(raw as never, undefined as never, (err?: unknown) =>\n err ? reject(err) : resolve(),\n )\n })\n }\n\n // Class + method middleware — `(ctx, next)`; await each, stop if it ended\n // the response or called next(err).\n for (const mw of entry.middlewares) {\n let advanced = false\n await new Promise<void>((resolve, reject) => {\n const next = (err?: unknown): void => {\n advanced = true\n if (err) reject(err)\n else resolve()\n }\n Promise.resolve(mw(ctx, next)).catch(reject)\n })\n if (!advanced || reply.sent) return\n }\n\n if (entry.contributorRunner) await entry.contributorRunner(ctx)\n if (reply.sent) return\n const result = await entry.handler(ctx)\n // Return-value handlers (reply.ts): auto-send when nothing was written.\n // Nothing written and nothing returned falls through to the 404 handler,\n // as on Express and h3 — not Fastify's own empty 200.\n if (!reply.sent && !(await applyHandlerResult(ctx, result))) reply.callNotFound()\n })\n }\n}\n\n/** Express's `trust proxy` number: trust the first `hops` addresses from the socket. */\nfunction hopTrust(hops: number): (ip: string, hopIndex: number) => boolean {\n return (_ip, hopIndex) => hopIndex < hops\n}\n\n/**\n * The Fastify HTTP runtime. Pass to `bootstrap({ runtime: fastifyRuntime() })`.\n * Per spec §10: Fastify's built-in pino logger is disabled (`logger: false`) so\n * the kickjs `requestLogger` middleware stays the single log format.\n */\nexport function fastifyRuntime(): HttpRuntime<FastifyAppLike> {\n return {\n name: 'fastify',\n\n createApp(options: RuntimeAppOptions = {}): FastifyAppLike {\n const app = createFastify({\n logger: false,\n // Match Express / h3 routing leniency: `/api/v1/hello` and\n // `/api/v1/hello/` resolve to the same route. Without this, Fastify's\n // strict router 404s a trailing-slash request — e.g. a controller's\n // root `@Get('/')` (mounted at the prefix) misses `${prefix}/`. Set under\n // `routerOptions` (Fastify 5+; top-level `ignoreTrailingSlash` is\n // deprecated, removed in Fastify 6).\n routerOptions: { ignoreTrailingSlash: true },\n // `jsonLimit`, which Fastify otherwise ignores in favour of its own 1 MiB.\n ...(options.bodyLimit !== undefined ? { bodyLimit: options.bodyLimit } : {}),\n // Express semantics for every form. Fastify takes a predicate as-is,\n // but reads a hop count as \"trust nothing\", where Express trusts that\n // many hops from the socket.\n trustProxy:\n typeof options.trustProxy === 'number'\n ? hopTrust(options.trustProxy)\n : options.trustProxy,\n }) as FastifyAppLike & {\n [QUEUE]?: Array<{ mw: ConnectMiddleware; opts?: UseConnectOptions }>\n }\n app[QUEUE] = []\n\n // Fastify ships parsers for `application/json` and `text/plain` only, and\n // answers 415 for everything else. That made a form post work on Express\n // and h3 but fail on Fastify alone (#590). Register the rest of the\n // framework's supported set so all engines agree.\n //\n // Deliberately NOT a `'*'` catch-all: that would swallow multipart, and\n // `@fastify/multipart` is itself the multipart content-type parser,\n // registered conditionally in `nodeHandler` when a route needs it.\n const addParser = app.addContentTypeParser?.bind(app)\n if (addParser) {\n // `application/*+json` — RFC 6838 §4.2.8 guarantees the bytes are JSON.\n addParser(\n /^application\\/[\\w.+-]+\\+json$/,\n { parseAs: 'string' },\n (_req: FastifyRequestLike, body: string | Buffer, done: FastifyParserDone) => {\n if (body === '') return done(null, undefined)\n try {\n done(null, JSON.parse(body as string))\n } catch (err) {\n // A bare SyntaxError carries no status, so the shared error handler\n // would call it a 500 — Fastify's own JSON parser answers 400\n // (FST_ERR_CTP_INVALID_JSON_BODY), and so must this one.\n done(\n HttpException.badRequest(\n err instanceof Error ? err.message : 'Request body could not be parsed',\n ),\n undefined,\n )\n }\n },\n )\n addParser(\n 'application/x-www-form-urlencoded',\n { parseAs: 'string' },\n (_req: FastifyRequestLike, body: string | Buffer, done: FastifyParserDone) => {\n done(null, parseForm(body as string))\n },\n )\n // `text/*` beyond Fastify's built-in `text/plain`. Raw string, never\n // JSON: `text/plain` is CORS-safelisted, so parsing it as JSON would\n // re-open no-preflight CSRF against a JSON API.\n addParser(\n /^text\\//,\n { parseAs: 'string' },\n (_req: FastifyRequestLike, body: string | Buffer, done: FastifyParserDone) => {\n done(null, body)\n },\n )\n // Fastify already answers 415 for a type it has no parser for, but with\n // its own message and no `Accept`. `'*'` is Fastify's documented\n // fallback — consulted only when nothing more specific matches — so it\n // does not shadow the parsers above, nor `@fastify/multipart`, which\n // registers `multipart/form-data` when an upload route needs it.\n addParser(\n '*',\n { parseAs: 'string' },\n (req: FastifyRequestLike, body: string | Buffer, done: FastifyParserDone) => {\n // No body is not an unsupported body. Fastify calls the parser even\n // for an empty payload, so without this a bodyless POST carrying an\n // unrelated content type would be rejected.\n if (!body) return done(null, undefined)\n done(unsupportedMediaTypeError(req.headers?.['content-type']), undefined)\n },\n )\n }\n\n if (options.notFoundFallthrough === false) {\n ;(app as { [NO_FALLTHROUGH]?: boolean })[NO_FALLTHROUGH] = true\n }\n return app\n },\n\n nodeHandler(app) {\n // Register middie + queued connect middleware + finalize `ready()` exactly\n // ONCE per app, even though Application may call nodeHandler per request.\n const state = app as {\n [QUEUE]?: Array<{ mw: ConnectMiddleware; opts?: UseConnectOptions }>\n [READY]?: Promise<void>\n [NEEDS_MULTIPART]?: boolean\n }\n if (!state[READY]) {\n state[READY] = (async () => {\n // Register @fastify/multipart first when any route uses @FileUpload so\n // `request.parts()` is available. Our applyUploadConfig enforces the\n // real per-file maxSize, so give the plugin a generous fileSize ceiling\n // (its 1MB default would silently truncate larger uploads first).\n if (state[NEEDS_MULTIPART]) {\n const multipart = pluginOf(await import('@fastify/multipart'))\n await app.register(multipart, { limits: { fileSize: Number.MAX_SAFE_INTEGER } })\n }\n const middie = pluginOf(await import('@fastify/middie'))\n await app.register(middie)\n for (const { mw, opts } of state[QUEUE] ?? []) {\n if (opts?.path !== undefined)\n (app.use as (p: unknown, m: unknown) => void)(opts.path, mw)\n else (app.use as (m: unknown) => void)(mw)\n }\n await app.ready()\n })()\n }\n const readyP = state[READY]\n // Once ready, route synchronously — no promise hop per request.\n let ready = false\n readyP.then(\n () => (ready = true),\n () => {},\n )\n\n return (req: IncomingMessage, res: ServerResponse, next?: (err?: unknown) => void) => {\n if (next) (req as IncomingMessage & { [NEXT]?: (err?: unknown) => void })[NEXT] = next\n if (ready) {\n app.routing(req, res)\n return\n }\n readyP\n .then(() => app.routing(req, res))\n .catch((err) => {\n if (next) return next(err)\n // No host to hand the error to: answer rather than leave the request open.\n log.error(err, 'Fastify failed to start')\n res.statusCode = 500\n res.end('Internal Server Error')\n })\n }\n },\n\n mountRoutes(app, table: RouteTable) {\n for (const { mountPath, routes } of table) {\n for (const entry of routes) {\n if (entry.meta.upload) (app as { [NEEDS_MULTIPART]?: boolean })[NEEDS_MULTIPART] = true\n const url = joinPath(mountPath, entry.path)\n app.route({ method: entry.method, url, handler: routeHandler(entry) })\n }\n }\n },\n\n useConnect(app, mw: ConnectMiddleware, opts?: UseConnectOptions) {\n const queue = (\n app as { [QUEUE]?: Array<{ mw: ConnectMiddleware; opts?: UseConnectOptions }> }\n )[QUEUE]\n queue?.push({ mw, opts })\n },\n\n serveStatic(app, prefix, dir) {\n // Serve via `serve-static` (the standalone connect middleware behind\n // express.static) so the Fastify runtime carries no `express` dependency —\n // queued like any other connect middleware, bridged through middie.\n this.useConnect(app, lazyServeStatic(dir), { path: prefix })\n },\n\n setNotFound(app, mw: ConnectMiddleware) {\n app.setNotFoundHandler((request, reply) => {\n const next = (request.raw as IncomingMessage & { [NEXT]?: (err?: unknown) => void })[NEXT]\n if (next && !(app as { [NO_FALLTHROUGH]?: boolean })[NO_FALLTHROUGH]) {\n // Vite dev fall-through: hand the request back to the outer chain.\n reply.hijack()\n next()\n return\n }\n // Pass the reply DRIVER (not raw res) so the connect-style\n // notFoundHandler's `res.status().json()` lands on the Fastify reply.\n settleOrFail(\n reply,\n (mw as (req: unknown, res: unknown, next: () => void) => unknown)(\n request.raw,\n replyDriver(reply),\n NOOP_NEXT,\n ),\n )\n })\n },\n\n setErrorHandler(app, mw: ConnectMiddleware) {\n app.setErrorHandler((err, request, reply) => {\n // Reply driver (not raw res) so the connect-style errorHandler's\n // `res.status().json()` / `setHeader` land on the Fastify reply.\n settleOrFail(\n reply,\n (mw as (e: unknown, req: unknown, res: unknown, next: () => void) => unknown)(\n err,\n request.raw,\n replyDriver(reply),\n NOOP_NEXT,\n ),\n )\n })\n },\n\n close(app) {\n // Runs the instance's onClose hooks (plugins registered on it).\n return app.close()\n },\n\n capabilities: {\n render: false,\n uploads: true,\n connectMiddleware: true,\n nativeBodyParsing: true,\n http2: true,\n },\n }\n}\n\n/**\n * The Fastify runtime's engine-native types — what the runtime-typed escape\n * hatches resolve to once the `kick/runtime` typegen emits a `KickRuntimeRegister`\n * augmentation pointing here (spec §4.3b). `AdapterContext.app` / `getRuntimeApp()`\n * become `FastifyInstance`; `ctx.req` / `ctx.res` the Fastify request / reply.\n * Mirrors {@link import('../runtime').ExpressRuntimeTypes} for the default engine.\n */\nexport interface FastifyRuntimeTypes {\n request: import('fastify').FastifyRequest\n response: import('fastify').FastifyReply\n app: import('fastify').FastifyInstance\n}\n\n/** Join a mount prefix and a route path into one URL, collapsing slashes. */\nfunction joinPath(mountPath: string, path: string): string {\n const a = mountPath.endsWith('/') ? mountPath.slice(0, -1) : mountPath\n // A root route path ('/' or '') maps to the mount prefix itself — otherwise a\n // controller `@Post('/')` would register at `${prefix}/`, and a request to\n // `${prefix}` (no trailing slash) wouldn't match under Fastify's strict router.\n if (path === '/' || path === '') return a === '' ? '/' : a\n const b = path.startsWith('/') ? path : `/${path}`\n return `${a}${b}`\n}\n"],"mappings":";;;;;;;;;;4sBA6CA,MAAM,SAAY,KAAoC,IAAI,SAAW,IAE/D,cAAgB,QAChB,IAAM,aAAa,gBAAgB,EA+DnC,MAAQ,OAAO,6BAA6B,EAC5C,MAAQ,OAAO,sBAAsB,EACrC,KAAO,OAAO,qBAAqB,EAGnC,gBAAkB,OAAO,+BAA+B,EACxD,cAAwB,CAAC,EAM/B,SAAS,aAAa,MAAyB,SAAyB,CAClE,OAAQ,UAA4C,MAAS,YACjE,QAAQ,QAAQ,QAAQ,CAAC,CAAC,KAAK,IAAA,OAAiB,CAC1C,CAAC,MAAM,MAAQ,CAAC,MAAM,IAAI,aAE5B,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAE,QAAS,uBAAwB,CAAC,CAE7D,CAAC,CACH,CAEA,MAAM,eAAiB,OAAO,8BAA8B,EAiB5D,IAAM,mBAAN,KAAoD,CACrB,MAA7B,YAAY,MAA0C,CAAzB,KAAA,MAAA,KAA0B,CACvD,OAAO,KAAoB,CAEzB,OADA,KAAK,MAAM,KAAK,IAAI,EACb,IACT,CACA,KAAK,KAAqB,CAKxB,OAFK,KAAK,MAAM,UAAU,cAAc,GAAG,KAAK,MAAM,KAAK,iCAAiC,EAC5F,KAAK,MAAM,WAAW,aAAa,CAAC,CAAC,KAAK,IAAI,EACvC,IACT,CACA,KAAK,KAAqB,CAExB,OADA,KAAK,MAAM,KAAK,IAAI,EACb,IACT,CACA,KAAK,YAA2B,CAE9B,OADA,KAAK,MAAM,KAAK,WAAW,EACpB,I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+8,5 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
import{createLogger}from"../../core/logger.mjs";import{errorHandler,notFoundHandler}from"../middleware/error-handler.mjs";import{i as WebResponseDriver,n as readThrough,r as WebRequestShim,t as compileWebRoute}from"../../handler-
|
|
11
|
+
import{createLogger}from"../../core/logger.mjs";import{errorHandler,notFoundHandler}from"../middleware/error-handler.mjs";import{i as WebResponseDriver,n as readThrough,r as WebRequestShim,t as compileWebRoute}from"../../handler-CS1BhG0C.mjs";import{t as lazyServeStatic}from"../../lazy-serve-static-Zge6_pKo.mjs";import*as h3Peer from"h3";const builtInError=errorHandler(),builtInNotFound=notFoundHandler(),log=createLogger(`H3Runtime`),NOTFOUND_MW=Symbol(`kickjs.h3web.notFoundMw`),ERROR_MW=Symbol(`kickjs.h3web.errorMw`),ASSEMBLED=Symbol(`kickjs.h3web.assembled`),NOOP_NEXT=()=>{},NEXT=Symbol(`kickjs.h3web.next`),NO_FALLTHROUGH=Symbol(`kickjs.h3web.noFallthrough`),TRUST_PROXY=Symbol(`kickjs.h3.trustProxy`),BODY_LIMIT=Symbol(`kickjs.h3.bodyLimit`),H3_HANDLED=Symbol.for(`h3.handled`);function unwrapH3Module(mod){let m=mod;return m&&m.__esModule&&m.default?{...m.default,...m}:m}function loadH3v2(injected){let resolved=unwrapH3Module(injected??h3Peer);if(typeof resolved.H3!=`function`)throw Error(`@forinda/kickjs: h3Runtime() requires h3 v2, but the installed h3 has no H3 class — that is the v1 line, which this version of KickJS no longer supports. Upgrade h3 to ^2.`);return resolved}async function runConnectTerminal(mw,event,err){let shim=new WebRequestShim(event.req,event.url),carry=event.req.runtime?.node?.req??FETCH_CONNECT.get(event)?.req,req=carry?readThrough(shim,carry):shim,driver=new WebResponseDriver(event.req.signal),failure=err;if(mw){let returned=err===void 0?mw(req,driver,NOOP_NEXT):mw(err,req,driver,NOOP_NEXT);if(typeof returned?.then==`function`)try{await returned}catch(handlerErr){log.error(handlerErr,`h3: the ${err===void 0?`not-found`:`error`} handler failed`),failure??=handlerErr}}return driver.settled||(failure===void 0?builtInNotFound(req,driver,NOOP_NEXT):await builtInError(failure,req,driver,NOOP_NEXT)),driver.ready}const FETCH_CONNECT=/* @__PURE__ */ new WeakMap;function fetchConnectState(event){let state=FETCH_CONNECT.get(event);return state||(state={req:new WebRequestShim(event.req,event.url),headers:new Headers},FETCH_CONNECT.set(event,state)),state}function withConnectHeaders(event,response){let state=FETCH_CONNECT.get(event);if(!state)return response;let missing=[...state.headers].filter(([name])=>name===`set-cookie`||!response.headers.has(name));if(state.headers=new Headers,missing.length===0)return response;try{for(let[name,value]of missing)response.headers.append(name,value);return response}catch{let headers=new Headers(response.headers);for(let[name,value]of missing)headers.append(name,value);return new Response(response.body,{status:response.status,statusText:response.statusText,headers})}}var FetchConnectResponse=class extends WebResponseDriver{prepared;code=200;listeners=[];constructor(prepared,signal){super(signal),this.prepared=prepared}get statusCode(){return this.code}set statusCode(code){this.status(code)}status(code){return this.code=code,super.status(code)}writeHead(code,headers){return this.code=code,super.writeHead(code,headers)}setHeader(name,value){if(Array.isArray(value)){this.prepared.delete(name);for(let v of value)this.prepared.append(name,String(v))}else this.prepared.set(name,String(value));return this}getHeader(name){return this.prepared.get(name)??void 0}hasHeader(name){return this.prepared.has(name)}removeHeader(name){this.prepared.delete(name)}once(event,listener){return this.listeners.push([event,listener]),this}on(event,listener){return this.once(event,listener)}removeListener(event,listener){return this.listeners=this.listeners.filter(([e,l])=>e!==event||l!==listener),this}off(event,listener){return this.removeListener(event,listener)}done(){for(let event of[`finish`,`close`]){for(let[e,listener]of this.listeners)e===event&&listener();this.listeners=this.listeners.filter(([e])=>e!==event)}}};function runConnectOnFetch(mw,event,next){let state=fetchConnectState(event),res=new FetchConnectResponse(state.headers,event.req.signal);return new Promise((resolve,reject)=>{let respond=response=>{res.done(),resolve(withConnectHeaders(event,response))},fail=err=>{res.done(),reject(err)};res.ready.then(respond);let connectNext=err=>{if(err)return fail(err);if(res.settled)return;let id=state.req.requestId;if(id&&event.req.headers.get(`x-request-id`)!==id)try{event.req.headers.set(`x-request-id`,id)}catch{}let downstream;try{downstream=next()}catch(e){return fail(e)}Promise.resolve(downstream).then(value=>{if(value instanceof Response)return respond(value);res.done(),resolve(value)},fail)};try{mw(state.req,res,connectNext)}catch(err){fail(err)}})}function assembleCatchAll(app){let state=app;state[ASSEMBLED]||(state[ASSEMBLED]=!0,app.all(`/**`,event=>{let node=event.req.runtime?.node,next=node?.req?.[NEXT];if(node&&next&&!state[NO_FALLTHROUGH])return new Promise(resolve=>{let done=()=>resolve(H3_HANDLED);node.res.once(`finish`,done),node.res.once(`close`,done),next()});let mw=state[NOTFOUND_MW];return runConnectTerminal(mw,event)}))}function proxyTrust(option){if(option!==void 0&&option!==!1){if(option===!0)return()=>!0;if(typeof option==`number`)return(_address,hop)=>hop<option;if(typeof option==`function`)return option;log.warn(`h3: trustProxy as an address or subnet list is not supported; client IPs use the socket address. Use a hop count or a function instead.`)}}function forwardedClientIp(req,trust){let socket=req.socket?.remoteAddress;if(!socket)return;let header=req.headers[`x-forwarded-for`],chain=[socket,...(Array.isArray(header)?header.join(`,`):header??``).split(`,`).map(s=>s.trim()).filter(Boolean).toReversed()];for(let hop=0;hop<chain.length-1;hop++)if(!trust(chain[hop],hop))return chain[hop];return chain[chain.length-1]}function stripMountPrefix(path,mw){let prefix=path.endsWith(`/`)?path.slice(0,-1):path;return prefix===``?mw:((req,res,next)=>{let url=req.url??`/`,rest=url.startsWith(prefix)?url.slice(prefix.length):null;return rest===null||rest!==``&&rest[0]!==`/`&&rest[0]!==`?`?mw(req,res,next):(req.originalUrl??=url,req.url=rest.startsWith(`/`)?rest:`/${rest}`,mw(req,res,err=>{req.url=url,next(err)}))})}function h3Runtime(options={}){let{H3,toNodeHandler,fromNodeHandler}=loadH3v2(options.h3);return{name:`h3`,createApp(options={}){let holder={},app=new H3({onError:(error,event)=>{let mw=holder.app?.[ERROR_MW];return runConnectTerminal(mw,event,error).then(response=>withConnectHeaders(event,response))}});return holder.app=app,app[NO_FALLTHROUGH]=options.notFoundFallthrough===!1,app[TRUST_PROXY]=proxyTrust(options.trustProxy),app[BODY_LIMIT]=options.bodyLimit,app},nodeHandler(app){assembleCatchAll(app);let listener=toNodeHandler(app),trust=app[TRUST_PROXY];return(req,res,next)=>{if(next&&(req[NEXT]=next),trust&&!req.ip){let ip=forwardedClientIp(req,trust);ip&&(req.ip=ip)}res.setMaxListeners(0);try{let result=listener(req,res);result&&typeof result.then==`function`&&result.catch(err=>next?.(err))}catch(err){next?.(err)}}},mountRoutes(app,table){for(let{mountPath,routes}of table)for(let entry of routes){let url=joinPath(mountPath,entry.path),run=compileWebRoute(entry,{onError:async(err,req,driver)=>{let mw=app[ERROR_MW];if(mw)try{await mw(err,req,driver,NOOP_NEXT)}catch(handlerErr){log.error(handlerErr,`h3: the error handler failed`),driver.settled||await builtInError(err,req,driver,NOOP_NEXT)}}},{bodyLimit:app[BODY_LIMIT]});app.on(entry.method,url,event=>run({request:event.req,url:event.url,params:event.context.params??{},carry:event.req.runtime?.node?.req??FETCH_CONNECT.get(event)?.req}))}},useConnect(app,rawMw,opts){let path=opts?.path;if(Array.isArray(path)){for(let member of path)this.useConnect(app,rawMw,{path:member});return}let mw=typeof path==`string`?stripMountPrefix(path,rawMw):rawMw,viaNode=fromNodeHandler(mw),handler=(event,next)=>event.req.runtime?.node?.res?viaNode(event):runConnectOnFetch(mw,event,next);path instanceof RegExp?app.use((event,next)=>path.test(event.url.pathname)?handler(event,next):next()):typeof path==`string`?app.use(joinPath(path,`/**`),handler):app.use(handler)},serveStatic(app,prefix,dir){this.useConnect(app,lazyServeStatic(dir),{path:prefix})},setNotFound(app,mw){app[NOTFOUND_MW]=mw,assembleCatchAll(app)},setErrorHandler(app,mw){app[ERROR_MW]=mw},capabilities:{render:!1,uploads:!0,connectMiddleware:!0,nativeBodyParsing:!0,http2:!0}}}function joinPath(mountPath,path){let a=mountPath.endsWith(`/`)?mountPath.slice(0,-1):mountPath;return path===`/`||path===``?a===``?`/`:a:`${a}${path.startsWith(`/`)?path:`/${path}`}`}const h3WebRuntime=h3Runtime;export{h3Runtime,h3WebRuntime};
|
|
12
12
|
//# sourceMappingURL=h3.mjs.map
|
package/dist/index.d.mts
CHANGED
|
@@ -3,31 +3,32 @@ import { i as isInjectionToken, n as InjectionToken, r as createToken, t as INJE
|
|
|
3
3
|
import { a as SettingsOf, c as defineSettings, i as SettingsDeclaration, l as loadSettings, n as ProvidedSettings, o as ValueOrigin, r as Settings, s as VarOrigin, t as ConfigVar, u as originsOf } from "./settings-BnE75hnr.mjs";
|
|
4
4
|
import { A as Service, B as resolveAsset, C as Post, D as Put, F as ASSET_MANIFEST_VERSION, I as KickAssets, L as UnknownAssetError, M as normalizeApiQueryParamsConfig, N as withBuilder, O as Repository, P as ASSETS, R as assets, S as Patch, T as PreDestroy, V as useAssets, _ as Get, a as Autowired, b as Middleware, c as ColumnApiQueryParamsConfig, d as Delete, f as Env, g as FileUploadConfig, h as FileUpload, i as AssetKey, j as Value, k as RouteDefinition, l as Component, m as FileTypeFilter, n as ApiQueryParamsConfig, o as BaseUploadOptions, p as EnvKey, r as Asset, s as Builder, t as ApiQueryParams, u as Controller, v as Inject, w as PostConstruct, x as MiddlewareHandler, y as Injectable, z as clearAssetCache } from "./decorators-Dvy0JZ5L.mjs";
|
|
5
5
|
import { a as baseEnvSchema, c as loadEnv, d as resetEnvCache, f as withEnv, l as loadEnvFromSchema, n as TypedConfigService, o as defineEnv, r as createConfigService, s as getEnv, t as ConfigService, u as reloadEnv } from "./index-B4aOLoId.mjs";
|
|
6
|
-
import { $ as
|
|
6
|
+
import { $ as ContributorSource, At as MutableModuleRegistry, B as ROUTE_URLS, Bt as reportResponse, C as UseConnectOptions, Ct as BuildContext, D as RouteShape, Dt as definePlugin, E as RequestContext, Et as PluginFactory, Ft as IntrospectionSnapshot, G as AdapterAsyncOptions, Gt as onEnv, H as UrlBuilder, Ht as AdapterCondition, I as resolveMimeTypes, It as ErrorInfo, J as defineAdapter, K as AdapterFactory, Kt as onPackage, L as ConditionalOutcome, Lt as ErrorSource, M as UploadedFile, Mt as KickJsPluginRegistry, Nt as IntrospectFn, O as SseHandler, Ot as KickPlugin, Pt as IntrospectionKind, Q as ContributorPipeline, R as Validators, Rt as ResponseInfo, S as RuntimeTypeMap, St as defineModule, T as DeepReadonly, Tt as PluginAsyncOptions, U as UrlForArgs, Ut as ConditionOutcome, V as RouteName, Vt as FailureAdvice, W as UrlQuery, Wt as allOf, X as runContributors, Y as RunContributorsOptions, Z as BuildPipelineOptions, _ as RouteMethod, _t as registerDisposable, a as KickServer, at as getMetaRecord, b as RuntimeCapabilities, bt as DefineModuleOptions, c as ActiveRuntime, ct as hasClassMeta, d as HttpRuntime, dt as setClassMeta, et as SourcedRegistration, f as KickRuntimeRegister, ft as setInMetaMap, g as RouteMeta, gt as disposeAll, h as RouteEntry, ht as Disposable, i as AppAdapterClass, it as getMetaMap, j as UploadStorageEngine, jt as KickJsPluginName, kt as ModuleRegistry, l as AdapterHttp, lt as pushClassMeta, m as RouteContributor, mt as setMethodMeta, n as AdapterMiddleware, nt as getClassMeta, o as MiddlewarePath, ot as getMethodMeta, p as MatchedRoute, pt as setInMetaRecord, q as DefineAdapterOptions, r as AppAdapter, rt as getClassMetaOrUndefined, s as MiddlewarePhase, st as getMethodMetaOrUndefined, t as AdapterContext, tt as buildPipeline, u as CtxHandler, ut as pushMethodMeta, v as RouteTable, vt as ModuleList, w as Ctx, wt as DefinePluginOptions, x as RuntimeResponse, xt as ModuleFactory, y as RuntimeAppOptions, yt as defineModules, z as evaluatePreconditions, zt as reportError } from "./adapter-9sPr_5xt.mjs";
|
|
7
|
+
import { a as ConnectRequest, i as ConnectNext, n as ConnectHandler, o as ConnectResponse, r as ConnectMiddleware, t as ConnectErrorHandler } from "./connect-BlIamapT.mjs";
|
|
7
8
|
import { a as tokenName, i as KickJsRegistry, n as ContainerChangeEvent, r as ContainerChangeListener, t as Container } from "./container-4iJdDkRH.mjs";
|
|
8
9
|
import { _ as getRouteFlags, a as RouteFlagContext, c as RouteFlagName, d as RouteFlagTest, f as RouteFlagValue, g as defineRouteFlag, h as assertFlagTest, i as RouteFlag, l as RouteFlagPredicate, m as ValuedRouteFlag, n as KickRouteFlags, o as RouteFlagDeclaration, p as RouteFlags, r as NegatedRouteFlagName, s as RouteFlagDeclarations, t as BareRouteFlag, u as RouteFlagRecord, v as matchesFlagTest, y as resolveRouteFlags } from "./route-flag-B1lQht6v.mjs";
|
|
9
10
|
import { c as PostConstructStatus, i as Constructor, l as Scope, n as BuilderOf, o as METADATA, r as ClassKind, s as MaybePromise, t as Buildable, u as ServiceOptions } from "./interfaces-C6LHcYsg.mjs";
|
|
10
11
|
import { C as MetaValue, S as ExecutionContext, _ as ResolvedDeps, a as ModuleRoutes, b as ContextMeta, c as ContextDecorator, d as ContextDecoratorTarget, f as ContextDecoratorWithDefaults, g as MissingParamKeys, h as DepValue, l as ContextDecoratorRequiringParams, m as ContributorRegistrations, n as AppModuleClass, o as AnyContributorRegistration, p as ContributorRegistration, r as AppModuleEntry, s as CallSiteParams, t as AppModule, u as ContextDecoratorSpec, v as defineContextDecorator, x as ContextMetaKey, y as ContextKeys } from "./app-module-Cuu-Ma_E.mjs";
|
|
11
12
|
import { a as CronOptions, c as getCronJobs, d as runCronJob, f as runCronJobs, i as CronJobMeta, l as isCronJobEnabled, n as Cron, o as CronRun, r as CronJob, s as cronScheduleId, t as CRON_META, u as listCronJobs } from "./cron-BTGytNg-.mjs";
|
|
12
|
-
import { A as NoJobHandlerError, C as JOB_DISPATCHER, D as JobDispatcher, E as JobContextCarrier, F as registerJobContext, I as runJob, L as stampJobContext, M as ProcessDefinition, N as listJobHandlers, O as JobHandler, P as listJobQueues, S as JOB_CONTEXT_FIELD, T as Job, _ as Respondable, a as KvSessionStoreOptions, b as isRespondable, c as matchesBearer, d as waitUntil, f as InferHandlerResponse, g as ReplyOptions, h as ReplyHeaders, i as KvSessionStore, j as Process, k as JobLike, l as PlatformContext, m as Reply, n as KvRateLimitStore, o as RateLimitGuardOptions, p as RESPOND, r as KvRateLimitStoreOptions, s as rateLimitGuard, t as KvLike, u as settleBackgroundWork, v as applyHandlerResult, w as JOB_META, x as reply, y as isReply } from "./kv-stores-
|
|
13
|
+
import { A as NoJobHandlerError, C as JOB_DISPATCHER, D as JobDispatcher, E as JobContextCarrier, F as registerJobContext, I as runJob, L as stampJobContext, M as ProcessDefinition, N as listJobHandlers, O as JobHandler, P as listJobQueues, S as JOB_CONTEXT_FIELD, T as Job, _ as Respondable, a as KvSessionStoreOptions, b as isRespondable, c as matchesBearer, d as waitUntil, f as InferHandlerResponse, g as ReplyOptions, h as ReplyHeaders, i as KvSessionStore, j as Process, k as JobLike, l as PlatformContext, m as Reply, n as KvRateLimitStore, o as RateLimitGuardOptions, p as RESPOND, r as KvRateLimitStoreOptions, s as rateLimitGuard, t as KvLike, u as settleBackgroundWork, v as applyHandlerResult, w as JOB_META, x as reply, y as isReply } from "./kv-stores-C1sQs2Rb.mjs";
|
|
13
14
|
import { a as Cacheable, c as setCacheProvider, i as CacheProvider, n as CacheEvict, o as MemoryCacheProvider, r as CacheOptions, s as getCacheProvider } from "./cache-C0qL0NSD.mjs";
|
|
14
15
|
import { a as describeError, i as createLogger, n as Logger, r as LoggerProvider, t as ConsoleLoggerProvider } from "./logger-xE9qI_FS.mjs";
|
|
15
16
|
import { a as ProblemException, c as defaultProblemTitle, i as ProblemDetails, l as normalizeProblem, n as HttpStatus, o as Problems, r as HttpStatusCode, s as ValidationError, t as HttpException } from "./errors-By6UueCm.mjs";
|
|
16
|
-
import { $ as
|
|
17
|
+
import { $ as ERROR_CHANNEL, A as getRequestStore, At as MountSortItem, B as createSigner, Bt as CircuitOpenError, C as TRACEPARENT_HEADER, Ct as GroupAssetKeysResult, D as traceContext, Dt as MissingMountDepError, E as parseTraceparent, Et as DuplicateMountNameError, F as materializeRouter, Ft as MissingContributorError, G as hashPassword, H as PasswordCheck, Ht as KickError, I as SignedCheck, It as CircuitBreaker, J as ClusterOptions, K as verifyPassword, L as Signer, Lt as CircuitBreakerOptions, M as requestStore, Mt as ContributorCycleError, N as buildRoutes, Nt as DuplicateContributorError, O as requestScopeMiddleware, Ot as MountCycleError, P as expressRuntime, Pt as MissingContextValueError, Q as bootstrap, R as SignerOptions, Rt as CircuitBreakerState, St as GroupAssetKeysOptions, T as TraceContextOptions, Tt as stripExt, U as PasswordHashOptions, Ut as KickErrorInit, V as LegacyHasher, Vt as FormatKickErrorOptions, W as VerifyPasswordOptions, Wt as formatKickError, X as KickHandler, Y as isClusterPrimary, Z as createHandler, _ as SpaAdapter, _t as RoutePolicyTable, a as ConfigOrigins, at as KickCronAdapter, b as ViewAdapter, bt as AssetKeyPair, c as MountedRouteInfo, ct as RequestHistogram, d as HEALTH_PROBE, dt as CheckMessage, et as HANDLER_CHANNEL, f as HealthCheckResult, ft as StartupCheck, g as healthModule, gt as StartupTimelineSnapshot, h as HealthProbe, ht as StartupStep, i as ConfigDescription, it as CronAdapterOptions, j as getRequestValue, jt as mountSort, k as RequestStore, kt as MountKind, l as ServerOptions, lt as metricsAdapter, m as HealthModuleConfig, mt as defineCheck, n as Application, nt as RESPONSE_CHANNEL, o as ManagementOptions, ot as RAW_BODY, p as HealthController, pt as StartupCheckError, q as defineHttpContextDecorator, r as ApplicationOptions, rt as CRON_WORKER_ENV, s as MiddlewareEntry, st as MetricsOptions, t as APPLICATION, tt as HandlerTraceContext, ut as CheckContext, v as SpaAdapterOptions, vt as bindRoutePolicy, w as TraceContext, wt as groupAssetKeys, x as ViewAdapterOptions, xt as AssetKeyStrategy, yt as offerRoutePolicy, z as VerifyOptions, zt as CircuitBreakerStats } from "./application-BD9LQ2s4.mjs";
|
|
17
18
|
import { n as joinPaths, r as normalizePath, t as buildMountPath } from "./path-CMwIHsdv.mjs";
|
|
18
19
|
import { a as isRef, c as toRefs, i as computed, l as unref, n as Ref, o as reactive, r as WatchOptions, s as ref, t as ComputedRef, u as watch } from "./reactivity-BkMNA0kp.mjs";
|
|
19
|
-
import { a as SessionStore, i as SessionOptions, n as Session, o as session, r as SessionData } from "./session-
|
|
20
|
+
import { a as SessionStore, i as SessionOptions, n as Session, o as session, r as SessionData } from "./session-8uNRCplB.mjs";
|
|
20
21
|
import { A as TypedParsedQuery, C as PaginatedResponse, D as QueryFieldConfig, E as QueryBuilderAdapter, O as SortItem, S as FilterOperator, T as ParsedQuery, _ as CursorQuery, a as getQueryParsingDefaults, b as FieldsOf, c as parseQuery, d as resetQueryParsingDefaults, f as setQueryParsingDefaults, g as CursorPosition, h as CursorPaginatedResponse, i as buildQueryParams, l as parseSearchQuery, m as CursorPaginateOptions, n as QueryRejectReason, o as parseFilters, r as QueryRejection, s as parsePagination, t as ParseQueryOptions, u as parseSort, v as CursorValue, w as PaginationParams, x as FilterItem, y as FILTER_OPERATORS } from "./index-Blgka75E.mjs";
|
|
21
|
-
import { a as validate, i as defaultValidationError, n as ValidationFailure, t as ValidationErrorFactory } from "./validate-
|
|
22
|
-
import { n as allowedHosts, t as AllowedHostsOptions } from "./allowed-hosts-
|
|
23
|
-
import { i as buildRouteTable, t as BuildRoutesOptions } from "./router-builder-
|
|
24
|
-
import { n as requestId, t as REQUEST_ID_HEADER } from "./request-id-
|
|
25
|
-
import { n as errorHandler, r as notFoundHandler } from "./error-handler-
|
|
26
|
-
import { i as csrfGuard, n as CsrfOptions, r as csrf, t as CsrfGuardOptions } from "./csrf-
|
|
22
|
+
import { a as validate, i as defaultValidationError, n as ValidationFailure, t as ValidationErrorFactory } from "./validate-D4Poe2EE.mjs";
|
|
23
|
+
import { n as allowedHosts, t as AllowedHostsOptions } from "./allowed-hosts-BpKwviq5.mjs";
|
|
24
|
+
import { i as buildRouteTable, t as BuildRoutesOptions } from "./router-builder-BfbEdxew.mjs";
|
|
25
|
+
import { n as requestId, t as REQUEST_ID_HEADER } from "./request-id-Dn64nEHK.mjs";
|
|
26
|
+
import { n as errorHandler, r as notFoundHandler } from "./error-handler-CH4PPZCK.mjs";
|
|
27
|
+
import { i as csrfGuard, n as CsrfOptions, r as csrf, t as CsrfGuardOptions } from "./csrf-ZFOrJZhJ.mjs";
|
|
27
28
|
import { i as requestLogger, n as LoggedResponse, r as RequestLoggerOptions, t as LoggedRequest } from "./request-logger-TgcKRNDD.mjs";
|
|
28
|
-
import { n as HelmetOptions, r as helmet } from "./helmet-
|
|
29
|
-
import { n as breachPadding, t as BreachPaddingOptions } from "./breach-padding-
|
|
30
|
-
import { n as cors, t as CorsOptions } from "./cors-
|
|
31
|
-
import { i as rateLimit, n as RateLimitOptions, r as RateLimitStore } from "./rate-limit-
|
|
32
|
-
import { i as upload,
|
|
33
|
-
export { APPLICATION, ASSETS, ASSET_MANIFEST_VERSION, type ActiveRuntime, type AdapterAsyncOptions, type AdapterCondition, type AdapterContext, type AdapterFactory, type AdapterHttp, type AdapterMiddleware, type AllowedHostsOptions, type AnyContributorRegistration, ApiQueryParams, type ApiQueryParamsConfig, type ApiQueryParamsConfig as QueryParamsConfig, type AppAdapter, type AppAdapterClass, type AppModule, type AppModuleClass, type AppModuleEntry, Application, type ApplicationOptions, Asset, type AssetKey, type AssetKeyPair, type AssetKeyStrategy, Autowired, type BareRouteFlag, type BaseUploadOptions, type BreachPaddingOptions, type BuildContext, type BuildPipelineOptions, type BuildRoutesOptions, type Buildable, Builder, type BuilderOf, CRON_META, CRON_WORKER_ENV, CacheEvict, type CacheOptions, type CacheProvider, Cacheable, type CallSiteParams, type CheckContext, type CheckMessage, CircuitBreaker, type CircuitBreakerOptions, type CircuitBreakerState, type CircuitBreakerStats, CircuitOpenError, type ClassKind, type ClusterOptions, type ColumnApiQueryParamsConfig, Component, type ComputedRef, type ConditionOutcome, type ConditionalOutcome, type ConfigDescription, type ConfigOrigins, ConfigService, type ConfigVar, type ConnectMiddleware, ConsoleLoggerProvider, type Constructor, Container, type ContainerChangeEvent, type ContainerChangeListener, type ContextDecorator, type ContextDecoratorRequiringParams, type ContextDecoratorSpec, type ContextDecoratorTarget, type ContextDecoratorWithDefaults, type ContextKeys, type ContextMeta, type ContextMetaKey, ContributorCycleError, type ContributorPipeline, type ContributorRegistration, type ContributorRegistrations, type ContributorSource, Controller, type CorsOptions, Cron, type CronAdapterOptions, type CronJob, type CronJobMeta, type CronOptions, type CronRun, type CsrfGuardOptions, type CsrfOptions, type Ctx, type CtxHandler, type CursorPaginateOptions, type CursorPaginatedResponse, type CursorPosition, type CursorQuery, type CursorValue, type DeepReadonly, type DefineAdapterOptions, type DefineModuleOptions, type DefinePluginOptions, Delete, type DepValue, type Disposable, DuplicateContributorError, DuplicateMountNameError, ERROR_CHANNEL, type Env, type EnvKey, type ErrorInfo, type ErrorSource, type ExecutionContext,
|
|
29
|
+
import { n as HelmetOptions, r as helmet } from "./helmet-BVuVBl-D.mjs";
|
|
30
|
+
import { n as breachPadding, t as BreachPaddingOptions } from "./breach-padding-FBVGmcBb.mjs";
|
|
31
|
+
import { n as cors, t as CorsOptions } from "./cors-BlR_b0Qb.mjs";
|
|
32
|
+
import { i as rateLimit, n as RateLimitOptions, r as RateLimitStore } from "./rate-limit-DQDk6bAH.mjs";
|
|
33
|
+
import { i as upload, n as buildUploadMiddleware, r as cleanupFiles, t as UploadOptions } from "./upload-Jgs9BFC4.mjs";
|
|
34
|
+
export { APPLICATION, ASSETS, ASSET_MANIFEST_VERSION, type ActiveRuntime, type AdapterAsyncOptions, type AdapterCondition, type AdapterContext, type AdapterFactory, type AdapterHttp, type AdapterMiddleware, type AllowedHostsOptions, type AnyContributorRegistration, ApiQueryParams, type ApiQueryParamsConfig, type ApiQueryParamsConfig as QueryParamsConfig, type AppAdapter, type AppAdapterClass, type AppModule, type AppModuleClass, type AppModuleEntry, Application, type ApplicationOptions, Asset, type AssetKey, type AssetKeyPair, type AssetKeyStrategy, Autowired, type BareRouteFlag, type BaseUploadOptions, type BreachPaddingOptions, type BuildContext, type BuildPipelineOptions, type BuildRoutesOptions, type Buildable, Builder, type BuilderOf, CRON_META, CRON_WORKER_ENV, CacheEvict, type CacheOptions, type CacheProvider, Cacheable, type CallSiteParams, type CheckContext, type CheckMessage, CircuitBreaker, type CircuitBreakerOptions, type CircuitBreakerState, type CircuitBreakerStats, CircuitOpenError, type ClassKind, type ClusterOptions, type ColumnApiQueryParamsConfig, Component, type ComputedRef, type ConditionOutcome, type ConditionalOutcome, type ConfigDescription, type ConfigOrigins, ConfigService, type ConfigVar, type ConnectErrorHandler, type ConnectHandler, type ConnectMiddleware, type ConnectNext, type ConnectRequest, type ConnectResponse, ConsoleLoggerProvider, type Constructor, Container, type ContainerChangeEvent, type ContainerChangeListener, type ContextDecorator, type ContextDecoratorRequiringParams, type ContextDecoratorSpec, type ContextDecoratorTarget, type ContextDecoratorWithDefaults, type ContextKeys, type ContextMeta, type ContextMetaKey, ContributorCycleError, type ContributorPipeline, type ContributorRegistration, type ContributorRegistrations, type ContributorSource, Controller, type CorsOptions, Cron, type CronAdapterOptions, type CronJob, type CronJobMeta, type CronOptions, type CronRun, type CsrfGuardOptions, type CsrfOptions, type Ctx, type CtxHandler, type CursorPaginateOptions, type CursorPaginatedResponse, type CursorPosition, type CursorQuery, type CursorValue, type DeepReadonly, type DefineAdapterOptions, type DefineModuleOptions, type DefinePluginOptions, Delete, type DepValue, type Disposable, DuplicateContributorError, DuplicateMountNameError, ERROR_CHANNEL, type Env, type EnvKey, type ErrorInfo, type ErrorSource, type ExecutionContext, FILTER_OPERATORS, type FailureAdvice, type FieldsOf, type FileTypeFilter, FileUpload, type FileUploadConfig, type FilterItem, type FilterOperator, type FormatKickErrorOptions, Get, type GroupAssetKeysOptions, type GroupAssetKeysResult, HANDLER_CHANNEL, HEALTH_PROBE, type HandlerTraceContext, type HealthCheckResult, HealthController, type HealthModuleConfig, type HealthProbe, type HelmetOptions, HttpException, type HttpRuntime, HttpStatus, type HttpStatusCode, INJECTION_TOKEN, type InferHandlerResponse, Inject, Injectable, type InjectionToken, type IntrospectFn, type IntrospectionKind, type IntrospectionSnapshot, JOB_CONTEXT_FIELD, JOB_DISPATCHER, JOB_META, Job, type JobContextCarrier, type JobDispatcher, type JobHandler, type JobLike, type KickAssets, KickCronAdapter, KickError, type KickErrorInit, type KickHandler, type KickJsPluginName, type KickJsPluginRegistry, type KickJsRegistry, type KickPlugin, type KickRouteFlags, type KickRuntimeRegister, type KickServer, type KvLike, KvRateLimitStore, type KvRateLimitStoreOptions, KvSessionStore, type KvSessionStoreOptions, type LegacyHasher, type LoggedRequest, type LoggedResponse, Logger, type LoggerProvider, METADATA, type ManagementOptions, type MatchedRoute, type MaybePromise, MemoryCacheProvider, type MetaValue, type MetricsOptions, Middleware, type MiddlewareEntry, type MiddlewareHandler, type MiddlewarePath, type MiddlewarePhase, MissingContextValueError, MissingContributorError, MissingMountDepError, type MissingParamKeys, type ModuleFactory, ModuleList, type ModuleRegistry, type ModuleRoutes, MountCycleError, type MountKind, type MountSortItem, type MountedRouteInfo, MutableModuleRegistry, type NegatedRouteFlagName, NoJobHandlerError, type PaginatedResponse, type PaginationParams, type ParseQueryOptions, type ParsedQuery, type PasswordCheck, type PasswordHashOptions, Patch, type PlatformContext, type PluginAsyncOptions, type PluginFactory, Post, PostConstruct, type PostConstructStatus, PreDestroy, type ProblemDetails, ProblemException, Problems, Process, type ProcessDefinition, type ProvidedSettings, Put, type QueryBuilderAdapter, type QueryFieldConfig, type QueryRejectReason, type QueryRejection, RAW_BODY, REQUEST_ID_HEADER, RESPOND, RESPONSE_CHANNEL, ROUTE_URLS, type RateLimitGuardOptions, type RateLimitOptions, type RateLimitStore, type Ref, type Reply, type ReplyHeaders, type ReplyOptions, Repository, RequestContext, RequestHistogram, type RequestLoggerOptions, type RequestStore, type ResolvedDeps, type Respondable, type ResponseInfo, type RouteContributor, type RouteDefinition, type RouteEntry, type RouteFlag, type RouteFlagContext, type RouteFlagDeclaration, type RouteFlagDeclarations, type RouteFlagName, type RouteFlagPredicate, type RouteFlagRecord, type RouteFlagTest, type RouteFlagValue, type RouteFlags, type RouteMeta, type RouteMethod, type RouteName, RoutePolicyTable, type RouteShape, type RouteTable, type RunContributorsOptions, type RuntimeAppOptions, type RuntimeCapabilities, type RuntimeResponse, type RuntimeTypeMap, Scope, type ServerOptions, Service, type ServiceOptions, type Session, type SessionData, type SessionOptions, type SessionStore, type Settings, type SettingsDeclaration, type SettingsOf, type SignedCheck, type Signer, type SignerOptions, type SortItem, type SourcedRegistration, SpaAdapter, type SpaAdapterOptions, type SseHandler, type StartupCheck, StartupCheckError, type StartupStep, type StartupTimelineSnapshot, TRACEPARENT_HEADER, type TraceContext, type TraceContextOptions, type TypedConfigService, type TypedParsedQuery, UnknownAssetError, type UploadOptions, type UploadStorageEngine, type UploadedFile, type UrlBuilder, type UrlForArgs, type UrlQuery, type UseConnectOptions, type ValidationError, type ValidationErrorFactory, type ValidationFailure, type Validators, Value, type ValueOrigin, type ValuedRouteFlag, type VarOrigin, type VerifyOptions, type VerifyPasswordOptions, ViewAdapter, type ViewAdapterOptions, type WatchOptions, allOf, allowedHosts, applyHandlerResult, assertFlagTest, assets, baseEnvSchema, bindRoutePolicy, bootstrap, breachPadding, buildMountPath, buildPipeline, buildQueryParams, buildRouteTable, buildRoutes, buildUploadMiddleware, cleanupFiles, clearAssetCache, computed, cors, createConfigService, createHandler, createLogger, createSigner, createToken, cronScheduleId, csrf, csrfGuard, defaultProblemTitle, defaultValidationError, defineAdapter, defineCheck, defineContextDecorator, defineEnv, defineHttpContextDecorator, defineModule, defineModules, definePlugin, defineRouteFlag, defineSettings, describeError, disposeAll, errorHandler, evaluatePreconditions, expressRuntime, formatKickError, getCacheProvider, getClassMeta, getClassMetaOrUndefined, getCronJobs, getEnv, getMetaMap, getMetaRecord, getMethodMeta, getMethodMetaOrUndefined, getQueryParsingDefaults, getRequestStore, getRequestValue, getRouteFlags, groupAssetKeys, hasClassMeta, hashPassword, healthModule, helmet, isClusterPrimary, isCronJobEnabled, isInjectionToken, isRef, isReply, isRespondable, joinPaths, listCronJobs, listJobHandlers, listJobQueues, loadEnv, loadEnvFromSchema, loadSettings, matchesBearer, matchesFlagTest, materializeRouter, metricsAdapter, mountSort, normalizeApiQueryParamsConfig, normalizePath, normalizeProblem, notFoundHandler, offerRoutePolicy, onEnv, onPackage, originsOf, parseFilters, parsePagination, parseQuery, parseSearchQuery, parseSort, parseTraceparent, pushClassMeta, pushMethodMeta, rateLimit, rateLimitGuard, reactive, ref, registerDisposable, registerJobContext, reloadEnv, reply, reportError, reportResponse, requestId, requestLogger, requestScopeMiddleware, requestStore, resetEnvCache, resetQueryParsingDefaults, resolveAsset, resolveMimeTypes, resolveRouteFlags, runContributors, runCronJob, runCronJobs, runJob, session, setCacheProvider, setClassMeta, setInMetaMap, setInMetaRecord, setMethodMeta, setQueryParsingDefaults, settleBackgroundWork, stampJobContext, stripExt, toRefs, tokenName, traceContext, unref, upload, useAssets, validate, verifyPassword, waitUntil, watch, withBuilder, withEnv };
|