@forinda/kickjs 6.5.0 → 6.5.1

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.
Files changed (208) hide show
  1. package/dist/{adapter-CEt1MEdF.d.mts → adapter-CbMq-NBf.d.mts} +25 -381
  2. package/dist/adapter-CbMq-NBf.d.mts.map +1 -0
  3. package/dist/{app-module-BSpHKlhE.d.mts → app-module-DtoySG6l.d.mts} +6 -5
  4. package/dist/app-module-DtoySG6l.d.mts.map +1 -0
  5. package/dist/application-Cl0JlmNY.mjs +12 -0
  6. package/dist/application-Cl0JlmNY.mjs.map +1 -0
  7. package/dist/{application-Bzdzl5wP.d.mts → application-zlzYGgKD.d.mts} +6 -6
  8. package/dist/application-zlzYGgKD.d.mts.map +1 -0
  9. package/dist/{bootstrap-C1VGQQVF.mjs → bootstrap-DzyWLYpU.mjs} +3 -3
  10. package/dist/{bootstrap-C1VGQQVF.mjs.map → bootstrap-DzyWLYpU.mjs.map} +1 -1
  11. package/dist/{bootstrap-DYexY169.d.mts → bootstrap-Nzgi7K2d.d.mts} +2 -3
  12. package/dist/bootstrap-Nzgi7K2d.d.mts.map +1 -0
  13. package/dist/{cache-CwZzIH0D.d.mts → cache-C0qL0NSD.d.mts} +2 -1
  14. package/dist/cache-C0qL0NSD.d.mts.map +1 -0
  15. package/dist/config/index.d.mts +1 -1
  16. package/dist/config/index.mjs +2 -2
  17. package/dist/{config-BeIZJBXA.mjs → config-CwFPFwsN.mjs} +3 -3
  18. package/dist/{config-BeIZJBXA.mjs.map → config-CwFPFwsN.mjs.map} +1 -1
  19. package/dist/{container-iED1swkd.d.mts → container-BW_MlgLj.d.mts} +3 -2
  20. package/dist/container-BW_MlgLj.d.mts.map +1 -0
  21. package/dist/{container-CBaL5lus.mjs → container-C7kmdVwh.mjs} +3 -3
  22. package/dist/{container-CBaL5lus.mjs.map → container-C7kmdVwh.mjs.map} +1 -1
  23. package/dist/{context-BS5o1IuU.mjs → context-DQaUwwQM.mjs} +3 -3
  24. package/dist/{context-BS5o1IuU.mjs.map → context-DQaUwwQM.mjs.map} +1 -1
  25. package/dist/{context-errors-CwD27Vbj.mjs → context-errors-97x9siRx.mjs} +2 -2
  26. package/dist/{context-errors-CwD27Vbj.mjs.map → context-errors-97x9siRx.mjs.map} +1 -1
  27. package/dist/core/adapter.d.mts +1 -1
  28. package/dist/core/adapter.mjs +1 -1
  29. package/dist/core/app-module.d.mts +1 -1
  30. package/dist/core/app-module.mjs +1 -1
  31. package/dist/core/cache.d.mts +1 -1
  32. package/dist/core/cache.mjs +1 -1
  33. package/dist/core/container.d.mts +1 -1
  34. package/dist/core/container.mjs +2 -2
  35. package/dist/core/cron.mjs +2 -2
  36. package/dist/core/decorators.d.mts +1 -1
  37. package/dist/core/decorators.mjs +2 -2
  38. package/dist/core/errors.d.mts +1 -1
  39. package/dist/core/errors.mjs +1 -1
  40. package/dist/core/interfaces.d.mts +1 -1
  41. package/dist/core/interfaces.mjs +1 -1
  42. package/dist/core/logger.mjs +1 -1
  43. package/dist/core/path.mjs +1 -1
  44. package/dist/core/plugin.d.mts +1 -1
  45. package/dist/core/plugin.mjs +1 -1
  46. package/dist/core/reactivity.d.mts +1 -1
  47. package/dist/core/reactivity.mjs +1 -1
  48. package/dist/core-CLmwVWlw.mjs +12 -0
  49. package/dist/core-CLmwVWlw.mjs.map +1 -0
  50. package/dist/{cors-C4aSCD3J.d.mts → cors-BuDU9CpA.d.mts} +1 -2
  51. package/dist/cors-BuDU9CpA.d.mts.map +1 -0
  52. package/dist/cron-DOOtTY4q.d.mts.map +1 -1
  53. package/dist/{csrf-DNh_7aOk.mjs → csrf-BsrsObK-.mjs} +2 -2
  54. package/dist/{csrf-DNh_7aOk.mjs.map → csrf-BsrsObK-.mjs.map} +1 -1
  55. package/dist/{csrf-7nUXGTuz.d.mts → csrf-vR23CJas.d.mts} +1 -2
  56. package/dist/csrf-vR23CJas.d.mts.map +1 -0
  57. package/dist/{decorators-wEJBqXHg.d.mts → decorators-Bks7cgBJ.d.mts} +12 -7
  58. package/dist/decorators-Bks7cgBJ.d.mts.map +1 -0
  59. package/dist/{disposables-mnjJuaVx.mjs → disposables-D46xX96x.mjs} +2 -2
  60. package/dist/{disposables-mnjJuaVx.mjs.map → disposables-D46xX96x.mjs.map} +1 -1
  61. package/dist/env-Biq_60jq.mjs +13 -0
  62. package/dist/{env-Dgtjncd5.mjs.map → env-Biq_60jq.mjs.map} +1 -1
  63. package/dist/{error-handler-DR01K_rI.d.mts → error-handler-Cr6Yt9as.d.mts} +1 -2
  64. package/dist/error-handler-Cr6Yt9as.d.mts.map +1 -0
  65. package/dist/{errors-n0H96eEz.d.mts → errors-By6UueCm.d.mts} +18 -9
  66. package/dist/errors-By6UueCm.d.mts.map +1 -0
  67. package/dist/{handler-UvmjQGYc.mjs → handler-Ci1NMv-9.mjs} +3 -3
  68. package/dist/{handler-UvmjQGYc.mjs.map → handler-Ci1NMv-9.mjs.map} +1 -1
  69. package/dist/{helmet-CKzZzeNl.d.mts → helmet-CFQUTVig.d.mts} +1 -2
  70. package/dist/helmet-CFQUTVig.d.mts.map +1 -0
  71. package/dist/http/application.d.mts +1 -1
  72. package/dist/http/application.mjs +2 -2
  73. package/dist/http/bootstrap.d.mts +1 -1
  74. package/dist/http/bootstrap.mjs +2 -2
  75. package/dist/http/context.d.mts +2 -2
  76. package/dist/http/context.mjs +2 -2
  77. package/dist/http/middleware/cors.d.mts +1 -1
  78. package/dist/http/middleware/cors.mjs +1 -1
  79. package/dist/http/middleware/csrf.d.mts +1 -1
  80. package/dist/http/middleware/csrf.mjs +2 -2
  81. package/dist/http/middleware/error-handler.d.mts +1 -1
  82. package/dist/http/middleware/error-handler.mjs +2 -2
  83. package/dist/http/middleware/helmet.d.mts +1 -1
  84. package/dist/http/middleware/helmet.mjs +1 -1
  85. package/dist/http/middleware/rate-limit.d.mts +1 -1
  86. package/dist/http/middleware/rate-limit.mjs +2 -2
  87. package/dist/http/middleware/request-id.d.mts +1 -1
  88. package/dist/http/middleware/request-id.mjs +1 -1
  89. package/dist/http/middleware/request-logger.d.mts +1 -1
  90. package/dist/http/middleware/request-logger.mjs +2 -2
  91. package/dist/http/middleware/session.d.mts +1 -1
  92. package/dist/http/middleware/session.mjs +2 -2
  93. package/dist/http/middleware/spa.d.mts +1 -1
  94. package/dist/http/middleware/spa.mjs +2 -2
  95. package/dist/http/middleware/spa.mjs.map +1 -1
  96. package/dist/http/middleware/upload.d.mts +1 -1
  97. package/dist/http/middleware/upload.mjs +2 -2
  98. package/dist/http/middleware/upload.mjs.map +1 -1
  99. package/dist/http/middleware/validate.d.mts +1 -1
  100. package/dist/http/middleware/validate.mjs +1 -1
  101. package/dist/http/middleware/views.d.mts +1 -1
  102. package/dist/http/middleware/views.mjs +2 -3
  103. package/dist/http/query/index.d.mts +1 -1
  104. package/dist/http/query/index.mjs +2 -2
  105. package/dist/http/router-builder.d.mts +1 -1
  106. package/dist/http/router-builder.mjs +2 -3
  107. package/dist/http/runtimes/fastify.d.mts +1 -2
  108. package/dist/http/runtimes/fastify.d.mts.map +1 -1
  109. package/dist/http/runtimes/fastify.mjs +3 -3
  110. package/dist/http/runtimes/fastify.mjs.map +1 -1
  111. package/dist/http/runtimes/h3-web.d.mts +1 -2
  112. package/dist/http/runtimes/h3-web.d.mts.map +1 -1
  113. package/dist/http/runtimes/h3-web.mjs +2 -2
  114. package/dist/http/runtimes/h3.d.mts +1 -2
  115. package/dist/http/runtimes/h3.d.mts.map +1 -1
  116. package/dist/http/runtimes/h3.mjs +2 -2
  117. package/dist/{index-BtWJ9SLP.d.mts → index-BfT5KZ-M.d.mts} +2 -2
  118. package/dist/index-BfT5KZ-M.d.mts.map +1 -0
  119. package/dist/{index-D98NLfS5.d.mts → index-M6TF75MS.d.mts} +2 -3
  120. package/dist/index-M6TF75MS.d.mts.map +1 -0
  121. package/dist/index.d.mts +26 -26
  122. package/dist/index.mjs +2 -2
  123. package/dist/index.mjs.map +1 -1
  124. package/dist/{interfaces-CayXPOAf.d.mts → interfaces-BTTBdkvG.d.mts} +3 -2
  125. package/dist/interfaces-BTTBdkvG.d.mts.map +1 -0
  126. package/dist/{kv-stores-O8HUSwpv.mjs → kv-stores-BLJdf3Fn.mjs} +2 -2
  127. package/dist/{kv-stores-O8HUSwpv.mjs.map → kv-stores-BLJdf3Fn.mjs.map} +1 -1
  128. package/dist/{kv-stores-duYHIEr1.d.mts → kv-stores-CHowq8VP.d.mts} +5 -6
  129. package/dist/kv-stores-CHowq8VP.d.mts.map +1 -0
  130. package/dist/logger-DA43DvNY.d.mts.map +1 -1
  131. package/dist/{metadata-CUDfhy4e.mjs → metadata-DUBbuHqY.mjs} +2 -2
  132. package/dist/{metadata-CUDfhy4e.mjs.map → metadata-DUBbuHqY.mjs.map} +1 -1
  133. package/dist/{module-registry-Mv5FqVlq.mjs → module-registry-aIt66if2.mjs} +2 -2
  134. package/dist/{module-registry-Mv5FqVlq.mjs.map → module-registry-aIt66if2.mjs.map} +1 -1
  135. package/dist/path-BVA9MfN1.d.mts.map +1 -1
  136. package/dist/query-CXN52dzy.mjs +12 -0
  137. package/dist/{query-gMAVXzx2.mjs.map → query-CXN52dzy.mjs.map} +1 -1
  138. package/dist/{rate-limit-oLL5EPUf.d.mts → rate-limit-Dme747JJ.d.mts} +1 -2
  139. package/dist/rate-limit-Dme747JJ.d.mts.map +1 -0
  140. package/dist/{reactivity-XL0fFDvG.d.mts → reactivity-BkMNA0kp.d.mts} +2 -2
  141. package/dist/reactivity-BkMNA0kp.d.mts.map +1 -0
  142. package/dist/{reply-BMBvs-FB.mjs → reply-C1ljl6xS.mjs} +3 -3
  143. package/dist/{reply-BMBvs-FB.mjs.map → reply-C1ljl6xS.mjs.map} +1 -1
  144. package/dist/{request-id-IDobbxU-.d.mts → request-id-CVzJ1uHD.d.mts} +1 -2
  145. package/dist/request-id-CVzJ1uHD.d.mts.map +1 -0
  146. package/dist/{request-logger-DZVW6VNI.d.mts → request-logger-BU4ulKLp.d.mts} +1 -2
  147. package/dist/request-logger-BU4ulKLp.d.mts.map +1 -0
  148. package/dist/router-builder-BbgVXuy3.mjs +12 -0
  149. package/dist/router-builder-BbgVXuy3.mjs.map +1 -0
  150. package/dist/{router-builder-GWgxoOdC.d.mts → router-builder-CMGhEBU2.d.mts} +2 -3
  151. package/dist/router-builder-CMGhEBU2.d.mts.map +1 -0
  152. package/dist/{session-DSRA-PUX.d.mts → session-z9iewOXA.d.mts} +1 -2
  153. package/dist/session-z9iewOXA.d.mts.map +1 -0
  154. package/dist/{spa-DWzSWAzx.d.mts → spa-DsRUrm69.d.mts} +4 -9
  155. package/dist/spa-DsRUrm69.d.mts.map +1 -0
  156. package/dist/{upload-CIZc803m.d.mts → upload-XVTyQcNN.d.mts} +3 -3
  157. package/dist/upload-XVTyQcNN.d.mts.map +1 -0
  158. package/dist/{upload-config-CFfHvoHF.mjs → upload-config-Dd_QvlpC.mjs} +2 -2
  159. package/dist/{upload-config-CFfHvoHF.mjs.map → upload-config-Dd_QvlpC.mjs.map} +1 -1
  160. package/dist/{validate-DoZDOhCi.d.mts → validate-DMYpUnrf.d.mts} +1 -2
  161. package/dist/validate-DMYpUnrf.d.mts.map +1 -0
  162. package/dist/views-Dj6XFaca.mjs +12 -0
  163. package/dist/views-Dj6XFaca.mjs.map +1 -0
  164. package/dist/views-DsfBT1fR.d.mts +659 -0
  165. package/dist/views-DsfBT1fR.d.mts.map +1 -0
  166. package/dist/web.d.mts +4 -5
  167. package/dist/web.d.mts.map +1 -1
  168. package/dist/web.mjs +2 -2
  169. package/dist/web.mjs.map +1 -1
  170. package/package.json +10 -10
  171. package/dist/adapter-CEt1MEdF.d.mts.map +0 -1
  172. package/dist/app-module-BSpHKlhE.d.mts.map +0 -1
  173. package/dist/application-Bzdzl5wP.d.mts.map +0 -1
  174. package/dist/application-C-r79XqD.mjs +0 -12
  175. package/dist/application-C-r79XqD.mjs.map +0 -1
  176. package/dist/bootstrap-DYexY169.d.mts.map +0 -1
  177. package/dist/cache-CwZzIH0D.d.mts.map +0 -1
  178. package/dist/container-iED1swkd.d.mts.map +0 -1
  179. package/dist/contributor-runner-Cu13cDQp.mjs +0 -12
  180. package/dist/contributor-runner-Cu13cDQp.mjs.map +0 -1
  181. package/dist/core-TDR0XGzO.mjs +0 -12
  182. package/dist/core-TDR0XGzO.mjs.map +0 -1
  183. package/dist/cors-C4aSCD3J.d.mts.map +0 -1
  184. package/dist/csrf-7nUXGTuz.d.mts.map +0 -1
  185. package/dist/decorators-wEJBqXHg.d.mts.map +0 -1
  186. package/dist/env-Dgtjncd5.mjs +0 -13
  187. package/dist/error-handler-DR01K_rI.d.mts.map +0 -1
  188. package/dist/errors-n0H96eEz.d.mts.map +0 -1
  189. package/dist/helmet-CKzZzeNl.d.mts.map +0 -1
  190. package/dist/http/middleware/views.mjs.map +0 -1
  191. package/dist/http/router-builder.mjs.map +0 -1
  192. package/dist/index-BtWJ9SLP.d.mts.map +0 -1
  193. package/dist/index-D98NLfS5.d.mts.map +0 -1
  194. package/dist/interfaces-CayXPOAf.d.mts.map +0 -1
  195. package/dist/kv-stores-duYHIEr1.d.mts.map +0 -1
  196. package/dist/query-gMAVXzx2.mjs +0 -12
  197. package/dist/rate-limit-oLL5EPUf.d.mts.map +0 -1
  198. package/dist/reactivity-XL0fFDvG.d.mts.map +0 -1
  199. package/dist/request-id-IDobbxU-.d.mts.map +0 -1
  200. package/dist/request-logger-DZVW6VNI.d.mts.map +0 -1
  201. package/dist/rolldown-runtime-CuwksmWW.mjs +0 -11
  202. package/dist/router-builder-GWgxoOdC.d.mts.map +0 -1
  203. package/dist/session-DSRA-PUX.d.mts.map +0 -1
  204. package/dist/spa-DWzSWAzx.d.mts.map +0 -1
  205. package/dist/upload-CIZc803m.d.mts.map +0 -1
  206. package/dist/validate-DoZDOhCi.d.mts.map +0 -1
  207. package/dist/views-Kp8Z3AO1.d.mts +0 -275
  208. package/dist/views-Kp8Z3AO1.d.mts.map +0 -1
@@ -1,275 +0,0 @@
1
-
2
- import { f as DepValue, o as ContextDecorator, s as ContextDecoratorSpec, v as MetaValue } from "./app-module-BSpHKlhE.mjs";
3
- import { F as AdapterFactory, T as RequestContext, f as HttpRuntime, m as RouteEntry } from "./adapter-CEt1MEdF.mjs";
4
- import { t as BuildRoutesOptions } from "./router-builder-GWgxoOdC.mjs";
5
- import { Express, NextFunction, Request, Response, Router } from "express";
6
- import { AsyncLocalStorage } from "node:async_hooks";
7
-
8
- //#region src/http/cluster.d.ts
9
- interface ClusterOptions {
10
- /** Number of worker processes (default: os.cpus().length) */
11
- workers?: number;
12
- /** Delay before forcefully killing a worker during shutdown (ms), default: 5000 */
13
- gracefulShutdownTimeout?: number;
14
- /** Delay between worker restarts (ms), default: 1000 */
15
- restartDelay?: number;
16
- /** Max failures in restartWindow before refusing to restart, default: 5 */
17
- maxFailures?: number;
18
- /** Time window for counting failures (ms), default: 30000 */
19
- restartWindow?: number;
20
- }
21
- /** Returns true if the current process is the cluster primary */
22
- declare function isClusterPrimary(): boolean;
23
- //#endregion
24
- //#region src/http/define-http-context-decorator.d.ts
25
- /**
26
- * Curried form returned by {@link DefineHttpContextDecoratorFn.withParams}.
27
- * Spell only the per-call params shape `P`; `K` and `D` are inferred
28
- * from the spec, and `Ctx` is locked to `RequestContext`.
29
- */
30
- interface DefineHttpContextDecoratorWithParams<P extends Record<string, unknown>> {
31
- <K extends string, D extends Record<string, DepValue> = Record<string, never>>(spec: ContextDecoratorSpec<K, D, P, RequestContext>): ContextDecorator<K, D, P, RequestContext>;
32
- }
33
- /**
34
- * Public shape of {@link defineHttpContextDecorator} — the positional
35
- * call signature plus the curried `.withParams<P>()` helper that fixes
36
- * partial-inference for the parameterised case.
37
- */
38
- interface DefineHttpContextDecoratorFn {
39
- <K extends string, D extends Record<string, DepValue> = Record<string, never>, P extends Record<string, unknown> = Record<string, never>>(spec: ContextDecoratorSpec<K, D, P, RequestContext>): ContextDecorator<K, D, P, RequestContext>;
40
- /**
41
- * Curried entry point. Spell only `P`; `K` and `D` infer from the
42
- * spec. `Ctx` is locked to `RequestContext`.
43
- *
44
- * ```ts
45
- * const LoadTenant = defineHttpContextDecorator.withParams<{
46
- * source: 'header' | 'subdomain'
47
- * }>()({
48
- * key: 'tenant',
49
- * deps: { repo: TENANT_REPO }, // D inferred
50
- * paramDefaults: { source: 'header' },
51
- * resolve: (ctx, { repo }, params) => repo.findFor(ctx, params),
52
- * })
53
- * ```
54
- */
55
- withParams<P extends Record<string, unknown>>(): DefineHttpContextDecoratorWithParams<P>;
56
- }
57
- declare const defineHttpContextDecorator: DefineHttpContextDecoratorFn;
58
- //#endregion
59
- //#region src/http/runtimes/express.d.ts
60
- /**
61
- * Materialize a controller's {@link RouteEntry}[] onto a fresh `express.Router`.
62
- * Reproduces the legacy handler ordering precisely: validation → upload →
63
- * `(ctx, next)` middleware → contributor runner → terminal handler. Each step
64
- * constructs its own `RequestContext` over the same `req`/`res` — request-scoped
65
- * state lives in the AsyncLocalStorage store, not on the ctx instance, so the
66
- * per-step instances share state exactly as before.
67
- */
68
- declare function materializeRouter(entries: RouteEntry[]): Router;
69
- /**
70
- * Build an Express Router from a controller class decorated with @Get, @Post,
71
- * etc. The public, back-compatible entry point: a thin shim over
72
- * {@link buildRouteTable} + {@link materializeRouter}. Returns an
73
- * `express.Router` exactly as before — modules pass it to `app.use(path, router)`.
74
- *
75
- * @see buildRouteTable for the engine-neutral route-table form.
76
- */
77
- declare function buildRoutes(controllerClass: any, options?: BuildRoutesOptions): Router;
78
- /**
79
- * The default HTTP runtime. Express stays a peer dependency of `@forinda/kickjs`;
80
- * apps that pass no `runtime` get this and behave exactly as before.
81
- */
82
- declare function expressRuntime(): HttpRuntime<Express>;
83
- //#endregion
84
- //#region src/http/request-store.d.ts
85
- /** Per-request storage for REQUEST-scoped DI and request context propagation */
86
- interface RequestStore {
87
- /** Unique request identifier */
88
- requestId: string;
89
- /**
90
- * Per-request singleton cache for REQUEST-scoped services. Keys are
91
- * heterogeneous (class constructors, `InjectionToken` objects, raw
92
- * strings), so the map type stays `Map<any, any>`.
93
- */
94
- instances: Map<any, any>;
95
- /**
96
- * Per-request key/value bag. Canonical backing store for
97
- * `RequestContext.set/get` and the Context Contributor pipeline (#107)
98
- * since Phase 3. Anything written here is visible to every concrete
99
- * execution context constructed for the same request, regardless of
100
- * which middleware/contributor wrote it.
101
- *
102
- * Keys are constrained to `string` per the locked decision in
103
- * `architecture.md` §20.12 (#4); the value type is `unknown` because
104
- * the concrete shape at each key is determined by the consumer's
105
- * `ContextMeta` augmentation, not by the store itself.
106
- *
107
- * Prefer the {@link getRequestValue} helper over reaching into this
108
- * map directly — it threads the augmented `ContextMeta` shape through
109
- * `MetaValue<K>` so consumers get typed reads without an `as` cast.
110
- * Writes should flow through `ctx.set(key, value)` or a Context
111
- * Contributor's return value — see the `setRequestValue` note below
112
- * for why this package intentionally does NOT ship a service-level
113
- * write helper.
114
- */
115
- values: Map<string, unknown>;
116
- /** Set once {@link disposeRequestStore} has run — guards double-dispose. */
117
- disposed?: boolean;
118
- }
119
- /** AsyncLocalStorage instance shared across the framework */
120
- declare const requestStore: AsyncLocalStorage<RequestStore>;
121
- /**
122
- * Get the current request store. Throws if called outside a request context.
123
- * Used by the Container to resolve REQUEST-scoped dependencies.
124
- */
125
- declare function getRequestStore(): RequestStore;
126
- /**
127
- * Read a per-request `ContextMeta`-keyed value from outside a controller
128
- * (services, repositories, anywhere with no `ctx` reference). Returns
129
- * the augmented type for the key — `MetaValue<K>` — so consumers get the
130
- * same static safety as `ctx.get(key)` without holding the context.
131
- *
132
- * Returns `undefined` outside an active request frame (background jobs,
133
- * startup code, tests without `requestScopeMiddleware()`) — the helper
134
- * is intentionally null-tolerant so calling it from a service that
135
- * runs in both request and non-request paths doesn't throw.
136
- *
137
- * @example
138
- * ```ts
139
- * declare module '@forinda/kickjs' {
140
- * interface ContextMeta { tenant: { id: string; name: string } }
141
- * }
142
- *
143
- * @Service()
144
- * class AuditService {
145
- * log(action: string) {
146
- * const tenant = getRequestValue('tenant') // typed: { id; name } | undefined
147
- * db.audit.insert({ action, tenantId: tenant?.id })
148
- * }
149
- * }
150
- * ```
151
- */
152
- declare function getRequestValue<K extends string>(key: K): MetaValue<K> | undefined;
153
- //#endregion
154
- //#region src/http/middleware/request-scope.d.ts
155
- /**
156
- * Wraps each request in an AsyncLocalStorage context.
157
- * Enables REQUEST-scoped DI and automatic requestId propagation to logs.
158
- *
159
- * Should be mounted early in the middleware pipeline (before route handlers).
160
- * `Application` mounts this automatically unless `contextStore: 'manual'` is set
161
- * or the user already includes one in their middleware list.
162
- */
163
- declare function requestScopeMiddleware(): (req: Request, res: Response, next: NextFunction) => void;
164
- //#endregion
165
- //#region src/http/middleware/trace-context.d.ts
166
- /**
167
- * W3C Trace Context header name.
168
- * @see https://www.w3.org/TR/trace-context/#traceparent-header
169
- */
170
- declare const TRACEPARENT_HEADER = "traceparent";
171
- interface TraceContextOptions {
172
- /**
173
- * When true, respond with a `traceresponse` header containing the trace ID.
174
- * Useful for debugging. Default: false.
175
- */
176
- propagateResponse?: boolean;
177
- }
178
- /**
179
- * Parsed W3C trace context fields.
180
- */
181
- interface TraceContext {
182
- /** W3C traceparent version (usually '00') */
183
- version: string;
184
- /** 32-hex-char distributed trace ID */
185
- traceId: string;
186
- /** 16-hex-char parent span ID */
187
- parentSpanId: string;
188
- /** 2-hex-char trace flags */
189
- flags: string;
190
- }
191
- /**
192
- * Parse a W3C traceparent header value.
193
- * Returns null if the format is invalid.
194
- */
195
- declare function parseTraceparent(header: string): TraceContext | null;
196
- /**
197
- * Middleware that extracts W3C `traceparent` header and stores trace context
198
- * in the request's AsyncLocalStorage store.
199
- *
200
- * If no valid `traceparent` header is present, a new traceId is generated
201
- * so that every request always has a trace ID available for correlation.
202
- *
203
- * Must be mounted **after** `requestScopeMiddleware()` (which creates the store).
204
- *
205
- * @example
206
- * ```ts
207
- * bootstrap({
208
- * middleware: [
209
- * requestScopeMiddleware(),
210
- * traceContext(), // extracts or generates traceId
211
- * requestLogger(),
212
- * express.json(),
213
- * ],
214
- * })
215
- * ```
216
- */
217
- declare function traceContext(options?: TraceContextOptions): (req: Request, res: Response, next: NextFunction) => void;
218
- //#endregion
219
- //#region src/http/middleware/views.d.ts
220
- interface ViewAdapterOptions {
221
- /**
222
- * Template engine — pass the engine module or a render function.
223
- * Supported engines: ejs, pug, handlebars, nunjucks, or any
224
- * Express-compatible engine with a __express property.
225
- *
226
- * @example
227
- * ```ts
228
- * import ejs from 'ejs'
229
- * ViewAdapter({ engine: ejs, ext: 'ejs' })
230
- *
231
- * import pug from 'pug'
232
- * ViewAdapter({ engine: pug, ext: 'pug' })
233
- * ```
234
- */
235
- engine: any;
236
- /** File extension for templates (e.g., 'ejs', 'pug', 'hbs') */
237
- ext: string;
238
- /** Directory containing template files (default: 'src/views') */
239
- viewsDir?: string;
240
- /** Default layout template (optional — depends on engine) */
241
- layout?: string;
242
- }
243
- /**
244
- * View/template adapter — pluggable template engine support for KickJS.
245
- *
246
- * Registers an Express view engine and sets the views directory.
247
- * Use `ctx.render()` in controllers to render templates.
248
- *
249
- * Migrated to the `defineAdapter()` factory in v4 — call without `new`.
250
- * The pre-v4 `new ViewAdapter({...})` form is gone; see
251
- * `docs/guide/migration-v3-to-v4.md` for the rename.
252
- *
253
- * @example
254
- * ```ts
255
- * import ejs from 'ejs'
256
- * import { ViewAdapter } from '@forinda/kickjs'
257
- *
258
- * bootstrap({
259
- * modules,
260
- * adapters: [
261
- * ViewAdapter({ engine: ejs, ext: 'ejs', viewsDir: 'src/views' }),
262
- * ],
263
- * })
264
- *
265
- * // In a controller:
266
- * @Get('/dashboard')
267
- * async dashboard(ctx: RequestContext) {
268
- * ctx.render('dashboard', { user: currentUser, title: 'Dashboard' })
269
- * }
270
- * ```
271
- */
272
- declare const ViewAdapter: AdapterFactory<ViewAdapterOptions, unknown>;
273
- //#endregion
274
- export { ClusterOptions as _, TraceContextOptions as a, requestScopeMiddleware as c, getRequestValue as d, requestStore as f, defineHttpContextDecorator as g, materializeRouter as h, TraceContext as i, RequestStore as l, expressRuntime as m, ViewAdapterOptions as n, parseTraceparent as o, buildRoutes as p, TRACEPARENT_HEADER as r, traceContext as s, ViewAdapter as t, getRequestStore as u, isClusterPrimary as v };
275
- //# sourceMappingURL=views-Kp8Z3AO1.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"views-Kp8Z3AO1.d.mts","names":[],"sources":["../src/http/cluster.ts","../src/http/define-http-context-decorator.ts","../src/http/runtimes/express.ts","../src/http/request-store.ts","../src/http/middleware/request-scope.ts","../src/http/middleware/trace-context.ts","../src/http/middleware/views.ts"],"mappings":";;;;;;;;UAOiB,cAAA;;EAEf,OAAA;;EAEA,uBAAA;;EAEA,YAAA;;EAEA,WAAA;;EAEA,aAAA;AAAA;;iBAIc,gBAAA;;;;;;;;UCuDC,oCAAA,WAA+C,MAAA;EAAA,6BACjC,MAAA,SAAe,QAAA,IAAY,MAAA,iBACtD,IAAA,EAAM,oBAAA,CAAqB,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,cAAA,IACnC,gBAAA,CAAiB,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,cAAA;AAAA;;;;;;UAQd,4BAAA;EAAA,6BAGH,MAAA,SAAe,QAAA,IAAY,MAAA,2BAC3B,MAAA,oBAA0B,MAAA,iBAEpC,IAAA,EAAM,oBAAA,CAAqB,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,cAAA,IACnC,gBAAA,CAAiB,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,cAAA;EAfc;AAQ7C;;;;;;;;;;;;;;EAwBE,UAAA,WAAqB,MAAA,sBAA4B,oCAAA,CAAqC,CAAA;AAAA;AAAA,cAW3E,0BAAA,EAA4B,4BAQR;;;;;;;;;;;iBC3FjB,iBAAA,CAAkB,OAAA,EAAS,UAAA,KAAe,MAAM;;;;;;;;;iBAiEhD,WAAA,CAAY,eAAA,OAAsB,OAAA,GAAS,kBAAA,GAA0B,MAAM;;AFjG3F;;;iBEyGgB,cAAA,IAAkB,WAAW,CAAC,OAAA;;;;UC5G7B,YAAA;;EAEf,SAAA;;;;;;EAMA,SAAA,EAAW,GAAA;;;;;;;;;;;AHLb;;;;;;;;;;EG0BE,MAAA,EAAQ,GAAG;EHZG;EGcd,QAAA;AAAA;;cAIW,YAAA,EAAY,iBAAA,CAAA,YAAA;;;;AFqCzB;iBE/BgB,eAAA,IAAmB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoC/B,eAAA,mBAAkC,GAAA,EAAK,CAAA,GAAI,SAAA,CAAU,CAAA;;;;;AH1ErE;;;;;;iBIyFgB,sBAAA,KAAsB,GAAA,EACnB,OAAA,EAAO,GAAA,EAAO,QAAA,EAAQ,IAAA,EAAQ,YAAA;;;;;;;cCxFpC,kBAAA;AAAA,UAKI,mBAAA;;;;;EAKf,iBAAiB;AAAA;;;;UAMF,YAAA;;EAEf,OAAA;;EAEA,OAAA;;EAEA,YAAA;ELxB6B;EK0B7B,KAAA;AAAA;;;;;iBAqBc,gBAAA,CAAiB,MAAA,WAAiB,YAAY;;ALrC/C;AAIf;;;;AAAgC;;;;ACuDhC;;;;;;;;;;;iBIoBgB,YAAA,CAAa,OAAA,GAAS,mBAAA,IAAwB,GAAA,EAC/C,OAAA,EAAO,GAAA,EAAO,QAAA,EAAQ,IAAA,EAAQ,YAAA;;;UC5F5B,kBAAA;;;;;;;;;;;;;;;EAef,MAAA;;EAGA,GAAA;;EAGA,QAAA;;EAGA,MAAA;AAAA;;;;;;;;;;ANZa;AAIf;;;;AAAgC;;;;ACuDhC;;;;;;;;;;;cKfa,WAAA,EAAW,cAAA,CAAA,kBAAA"}