@forinda/kickjs 5.0.2 → 5.2.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.
Files changed (104) hide show
  1. package/dist/{adapter-6Pp4kFdM.d.mts → adapter-C1w_xt08.d.mts} +3 -3
  2. package/dist/{adapter-6Pp4kFdM.d.mts.map → adapter-C1w_xt08.d.mts.map} +1 -1
  3. package/dist/{app-module-Blgz4Rti.d.mts → app-module-D6zL_V5S.d.mts} +3 -3
  4. package/dist/{app-module-Blgz4Rti.d.mts.map → app-module-D6zL_V5S.d.mts.map} +1 -1
  5. package/dist/{application-CHvMXqbO.d.mts → application-BTRI4aBd.d.mts} +23 -6
  6. package/dist/application-BTRI4aBd.d.mts.map +1 -0
  7. package/dist/{application-BmCrQdPG.mjs → application-Bw87drVl.mjs} +39 -7
  8. package/dist/application-Bw87drVl.mjs.map +1 -0
  9. package/dist/{bootstrap-C6GpMEpX.d.mts → bootstrap-B4YrBipl.d.mts} +2 -2
  10. package/dist/{bootstrap-C6GpMEpX.d.mts.map → bootstrap-B4YrBipl.d.mts.map} +1 -1
  11. package/dist/{bootstrap-CUf7KAK-.mjs → bootstrap-CsQ7LE-W.mjs} +6 -6
  12. package/dist/{bootstrap-CUf7KAK-.mjs.map → bootstrap-CsQ7LE-W.mjs.map} +1 -1
  13. package/dist/config/index.d.mts +1 -1
  14. package/dist/config/index.mjs +3 -3
  15. package/dist/{config-B6z2ri6d.mjs → config-DKRN5fqC.mjs} +3 -3
  16. package/dist/{config-B6z2ri6d.mjs.map → config-DKRN5fqC.mjs.map} +1 -1
  17. package/dist/{container-CnWDsxi-.d.mts → container-BZKeHc5X.d.mts} +11 -2
  18. package/dist/{container-CnWDsxi-.d.mts.map → container-BZKeHc5X.d.mts.map} +1 -1
  19. package/dist/{container-Dn3ENJgH.mjs → container-C0FlgLNH.mjs} +104 -18
  20. package/dist/container-C0FlgLNH.mjs.map +1 -0
  21. package/dist/{context-kfiZcP7J.mjs → context-CDFiXWcV.mjs} +3 -3
  22. package/dist/{context-kfiZcP7J.mjs.map → context-CDFiXWcV.mjs.map} +1 -1
  23. package/dist/{context-decorator-DrPvQ9Ag.d.mts → context-decorator-Bca_BoRK.d.mts} +140 -15
  24. package/dist/context-decorator-Bca_BoRK.d.mts.map +1 -0
  25. package/dist/core/adapter.d.mts +1 -1
  26. package/dist/core/adapter.mjs +1 -1
  27. package/dist/core/app-module.d.mts +1 -1
  28. package/dist/core/app-module.mjs +1 -1
  29. package/dist/core/cache.mjs +1 -1
  30. package/dist/core/container.d.mts +1 -1
  31. package/dist/core/container.mjs +2 -2
  32. package/dist/core/cron.mjs +2 -2
  33. package/dist/core/decorators.d.mts +1 -1
  34. package/dist/core/decorators.mjs +3 -3
  35. package/dist/core/decorators.mjs.map +1 -1
  36. package/dist/core/errors.mjs +1 -1
  37. package/dist/core/interfaces.mjs +1 -1
  38. package/dist/core/logger.mjs +5 -3
  39. package/dist/core/logger.mjs.map +1 -1
  40. package/dist/core/path.mjs +1 -1
  41. package/dist/core/plugin.d.mts +1 -1
  42. package/dist/core/plugin.mjs +1 -1
  43. package/dist/core/reactivity.mjs +1 -1
  44. package/dist/{core-CLCy-u2-.mjs → core-K0J8AH_4.mjs} +111 -23
  45. package/dist/core-K0J8AH_4.mjs.map +1 -0
  46. package/dist/{decorators-BMvaLliz.d.mts → decorators-CRmHuzxz.d.mts} +2 -2
  47. package/dist/{decorators-BMvaLliz.d.mts.map → decorators-CRmHuzxz.d.mts.map} +1 -1
  48. package/dist/{env-B4asq48l.mjs → env-CDMCT10_.mjs} +11 -5
  49. package/dist/env-CDMCT10_.mjs.map +1 -0
  50. package/dist/http/application.d.mts +1 -1
  51. package/dist/http/application.mjs +2 -2
  52. package/dist/http/bootstrap.d.mts +1 -1
  53. package/dist/http/bootstrap.mjs +2 -2
  54. package/dist/http/context.mjs +2 -2
  55. package/dist/http/middleware/cors.mjs +1 -1
  56. package/dist/http/middleware/csrf.mjs +1 -1
  57. package/dist/http/middleware/error-handler.mjs +2 -2
  58. package/dist/http/middleware/helmet.mjs +1 -1
  59. package/dist/http/middleware/rate-limit.mjs +1 -1
  60. package/dist/http/middleware/request-id.mjs +1 -1
  61. package/dist/http/middleware/request-logger.mjs +2 -2
  62. package/dist/http/middleware/session.mjs +1 -1
  63. package/dist/http/middleware/spa.d.mts +1 -1
  64. package/dist/http/middleware/spa.mjs +3 -3
  65. package/dist/http/middleware/upload.d.mts +1 -1
  66. package/dist/http/middleware/upload.mjs +1 -1
  67. package/dist/http/middleware/validate.mjs +2 -2
  68. package/dist/http/middleware/views.d.mts +1 -1
  69. package/dist/http/middleware/views.mjs +2 -2
  70. package/dist/http/query/index.mjs +2 -2
  71. package/dist/http/router-builder.d.mts +1 -1
  72. package/dist/http/router-builder.mjs +5 -5
  73. package/dist/{index-D-qhXg9M.d.mts → index-DhNglXyS.d.mts} +2 -2
  74. package/dist/index-DhNglXyS.d.mts.map +1 -0
  75. package/dist/{index-Yhs9sTMW.d.mts → index-DvZfBNIf.d.mts} +60 -9
  76. package/dist/index-DvZfBNIf.d.mts.map +1 -0
  77. package/dist/index.d.mts +15 -15
  78. package/dist/index.mjs +30 -13
  79. package/dist/index.mjs.map +1 -1
  80. package/dist/logger-CLVRZf2N.d.mts.map +1 -1
  81. package/dist/{metadata-BqhX5q4E.mjs → metadata-DPLdmj1w.mjs} +2 -2
  82. package/dist/{metadata-BqhX5q4E.mjs.map → metadata-DPLdmj1w.mjs.map} +1 -1
  83. package/dist/{plugin-DDjoN4XI.d.mts → plugin-DF8Xfv9Z.d.mts} +5 -5
  84. package/dist/{plugin-DDjoN4XI.d.mts.map → plugin-DF8Xfv9Z.d.mts.map} +1 -1
  85. package/dist/{query-IvtMtXoI.mjs → query-CD0AMqxx.mjs} +2 -2
  86. package/dist/{query-IvtMtXoI.mjs.map → query-CD0AMqxx.mjs.map} +1 -1
  87. package/dist/{router-builder-zsX4Oq7c.d.mts → router-builder-C7sXk_FG.d.mts} +2 -2
  88. package/dist/{router-builder-zsX4Oq7c.d.mts.map → router-builder-C7sXk_FG.d.mts.map} +1 -1
  89. package/dist/{spa-CwIbdvPc.d.mts → spa-e4FIS2RB.d.mts} +2 -2
  90. package/dist/{spa-CwIbdvPc.d.mts.map → spa-e4FIS2RB.d.mts.map} +1 -1
  91. package/dist/{upload-BueOnnLw.d.mts → upload-BM9uyR6Y.d.mts} +2 -2
  92. package/dist/{upload-BueOnnLw.d.mts.map → upload-BM9uyR6Y.d.mts.map} +1 -1
  93. package/dist/{views-DhuvHYPA.d.mts → views-DkNp9JJs.d.mts} +4 -4
  94. package/dist/views-DkNp9JJs.d.mts.map +1 -0
  95. package/package.json +1 -1
  96. package/dist/application-BmCrQdPG.mjs.map +0 -1
  97. package/dist/application-CHvMXqbO.d.mts.map +0 -1
  98. package/dist/container-Dn3ENJgH.mjs.map +0 -1
  99. package/dist/context-decorator-DrPvQ9Ag.d.mts.map +0 -1
  100. package/dist/core-CLCy-u2-.mjs.map +0 -1
  101. package/dist/env-B4asq48l.mjs.map +0 -1
  102. package/dist/index-D-qhXg9M.d.mts.map +0 -1
  103. package/dist/index-Yhs9sTMW.d.mts.map +0 -1
  104. package/dist/views-DhuvHYPA.d.mts.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs v5.0.2
2
+ * @forinda/kickjs v5.2.0
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,9 +8,9 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import { p as __require } from "../../container-Dn3ENJgH.mjs";
11
+ import { h as __require } from "../../container-C0FlgLNH.mjs";
12
12
  import { Logger } from "../../core/logger.mjs";
13
- import "../../core-CLCy-u2-.mjs";
13
+ import "../../core-K0J8AH_4.mjs";
14
14
  import { existsSync, readFileSync } from "node:fs";
15
15
  import { join, resolve } from "node:path";
16
16
  //#region src/http/middleware/spa.ts
@@ -1,3 +1,3 @@
1
1
 
2
- import { a as upload, i as resolveMimeTypes, n as buildUploadMiddleware, r as cleanupFiles, t as UploadOptions } from "../../upload-BueOnnLw.mjs";
2
+ import { a as upload, i as resolveMimeTypes, n as buildUploadMiddleware, r as cleanupFiles, t as UploadOptions } from "../../upload-BM9uyR6Y.mjs";
3
3
  export { UploadOptions, buildUploadMiddleware, cleanupFiles, resolveMimeTypes, upload };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs v5.0.2
2
+ * @forinda/kickjs v5.2.0
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs v5.0.2
2
+ * @forinda/kickjs v5.2.0
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -9,7 +9,7 @@
9
9
  * @license MIT
10
10
  */
11
11
  import { HttpException, HttpStatus } from "../../core/errors.mjs";
12
- import "../../core-CLCy-u2-.mjs";
12
+ import "../../core-K0J8AH_4.mjs";
13
13
  //#region src/http/middleware/validate.ts
14
14
  function toValidationException(error, message, useFirstIssueMessage) {
15
15
  const issues = error.issues || [];
@@ -1,3 +1,3 @@
1
1
 
2
- import { n as ViewAdapterOptions, t as ViewAdapter } from "../../views-DhuvHYPA.mjs";
2
+ import { n as ViewAdapterOptions, t as ViewAdapter } from "../../views-DkNp9JJs.mjs";
3
3
  export { ViewAdapter, ViewAdapterOptions };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs v5.0.2
2
+ * @forinda/kickjs v5.2.0
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -9,7 +9,7 @@
9
9
  * @license MIT
10
10
  */
11
11
  import { Logger } from "../../core/logger.mjs";
12
- import { n as defineAdapter } from "../../core-CLCy-u2-.mjs";
12
+ import { n as defineAdapter } from "../../core-K0J8AH_4.mjs";
13
13
  import { resolve } from "node:path";
14
14
  //#region src/http/middleware/views.ts
15
15
  const log = Logger.for("ViewEngine");
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs v5.0.2
2
+ * @forinda/kickjs v5.2.0
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,5 +8,5 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import { a as parseSearchQuery, i as parseQuery, n as parseFilters, o as parseSort, r as parsePagination, s as FILTER_OPERATORS, t as buildQueryParams } from "../../query-IvtMtXoI.mjs";
11
+ import { a as parseSearchQuery, i as parseQuery, n as parseFilters, o as parseSort, r as parsePagination, s as FILTER_OPERATORS, t as buildQueryParams } from "../../query-CD0AMqxx.mjs";
12
12
  export { FILTER_OPERATORS, buildQueryParams, parseFilters, parsePagination, parseQuery, parseSearchQuery, parseSort };
@@ -1,3 +1,3 @@
1
1
 
2
- import { n as _setExternalContributorSources, r as buildRoutes, t as BuildRoutesOptions } from "../router-builder-zsX4Oq7c.mjs";
2
+ import { n as _setExternalContributorSources, r as buildRoutes, t as BuildRoutesOptions } from "../router-builder-C7sXk_FG.mjs";
3
3
  export { BuildRoutesOptions, _setExternalContributorSources, buildRoutes };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs v5.0.2
2
+ * @forinda/kickjs v5.2.0
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,11 +8,11 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import { t as Container } from "../container-Dn3ENJgH.mjs";
11
+ import { t as Container } from "../container-C0FlgLNH.mjs";
12
12
  import { METADATA } from "../core/interfaces.mjs";
13
- import { a as getMethodMeta, o as getMethodMetaOrUndefined, t as getClassMeta } from "../metadata-BqhX5q4E.mjs";
14
- import { c as runContributors, l as buildPipeline } from "../core-CLCy-u2-.mjs";
15
- import { t as RequestContext } from "../context-kfiZcP7J.mjs";
13
+ import { a as getMethodMeta, o as getMethodMetaOrUndefined, t as getClassMeta } from "../metadata-DPLdmj1w.mjs";
14
+ import { c as runContributors, l as buildPipeline } from "../core-K0J8AH_4.mjs";
15
+ import { t as RequestContext } from "../context-CDFiXWcV.mjs";
16
16
  import { validate } from "./middleware/validate.mjs";
17
17
  import { buildUploadMiddleware } from "./middleware/upload.mjs";
18
18
  import { Router } from "express";
@@ -1,5 +1,5 @@
1
1
 
2
- import { p as EnvKey } from "./decorators-BMvaLliz.mjs";
2
+ import { p as EnvKey } from "./decorators-CRmHuzxz.mjs";
3
3
  import { z } from "zod";
4
4
 
5
5
  //#region src/config/env.d.ts
@@ -242,4 +242,4 @@ declare function createConfigService<T extends z.ZodObject<any>>(schema: T): {
242
242
  };
243
243
  //#endregion
244
244
  export { baseEnvSchema as a, loadEnv as c, Env as i, reloadEnv as l, TypedConfigService as n, defineEnv as o, createConfigService as r, getEnv as s, ConfigService as t, resetEnvCache as u };
245
- //# sourceMappingURL=index-D-qhXg9M.d.mts.map
245
+ //# sourceMappingURL=index-DhNglXyS.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-DhNglXyS.d.mts","names":[],"sources":["../src/config/env.ts","../src/config/config-service.ts"],"mappings":";;;;;;;AAsCA;;cAAa,aAAA,EAAa,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyC1B;;;iBAAgB,SAAA,WAAoB,CAAA,CAAE,WAAA,CAAA,CACpC,MAAA,GAAS,IAAA,SAAa,aAAA,KAAkB,CAAA,CAAE,SAAA,CAAU,CAAA,IACnD,CAAA,CAAE,SAAA,QAAiB,aAAA,CAAc,KAAA,GAAQ,CAAA;;;;;;;;;;;;;;;;;;;;;;;;iBA+B5B,OAAA,WAAkB,CAAA,CAAE,SAAA,MAAA,CAAgB,MAAA,EAAQ,CAAA,GAAI,CAAA,CAAE,KAAA,CAAM,CAAA;AAAA,iBACxD,OAAA,CAAA,IAAY,MAAA,oBAA0B,GAAA,GAAM,OAAA;;;;;;;;;;;;;;;;;;;AAA5D;;;iBAqCgB,MAAA,WAAiB,MAAA,CAAA,CAAQ,GAAA,EAAK,CAAA,GAAI,OAAA,CAAQ,CAAA;AAAA,i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CAAA,CAAA;AAAA"}
@@ -1,9 +1,9 @@
1
1
 
2
- import { s as InjectionToken, t as Container } from "./container-CnWDsxi-.mjs";
2
+ import { s as InjectionToken, t as Container } from "./container-BZKeHc5X.mjs";
3
3
  import { n as ExecutionContext } from "./execution-context-DKnt61pY.mjs";
4
- import { a as ContributorRegistration } from "./context-decorator-DrPvQ9Ag.mjs";
5
- import { r as AppAdapter } from "./adapter-6Pp4kFdM.mjs";
6
- import { t as KickPlugin } from "./plugin-DDjoN4XI.mjs";
4
+ import { t as AnyContributorRegistration } from "./context-decorator-Bca_BoRK.mjs";
5
+ import { r as AppAdapter } from "./adapter-C1w_xt08.mjs";
6
+ import { t as KickPlugin } from "./plugin-DF8Xfv9Z.mjs";
7
7
  //#region src/core/metadata.d.ts
8
8
  /**
9
9
  * Typed utilities for reflect-metadata operations.
@@ -193,9 +193,17 @@ type ContributorSource = 'method' | 'class' | 'module' | 'adapter' | 'global';
193
193
  * Input row to {@link buildPipeline}. Pairs a registration with its origin
194
194
  * so dedup can apply the precedence rule and diagnostic errors can name
195
195
  * the offending site.
196
+ *
197
+ * `registration` is the type-erased {@link AnyContributorRegistration}
198
+ * — the runner doesn't care about each registration's narrow `D` /
199
+ * `Ctx` shape, and adopters frequently mix HTTP / transport-agnostic
200
+ * contributors in the same `externalSources` / `contributors()`
201
+ * array. The narrow generics from `defineContextDecorator` survive
202
+ * at the *definition* site (where `resolve` is typed); they're erased
203
+ * here so collections compose without `as any` casts.
196
204
  */
197
205
  interface SourcedRegistration {
198
- registration: ContributorRegistration;
206
+ registration: AnyContributorRegistration;
199
207
  source: ContributorSource;
200
208
  /** Human label surfaced in DuplicateContributorError messages. */
201
209
  label?: string;
@@ -209,7 +217,7 @@ interface SourcedRegistration {
209
217
  * builder uses it for missing-dep validation.
210
218
  */
211
219
  interface ContributorPipeline {
212
- readonly contributors: readonly ContributorRegistration[];
220
+ readonly contributors: readonly AnyContributorRegistration[];
213
221
  readonly keys: ReadonlySet<string>;
214
222
  }
215
223
  interface BuildPipelineOptions {
@@ -268,7 +276,7 @@ interface RunContributorsOptions {
268
276
  *
269
277
  * Container.resolve() throwing while building `deps` is treated as a
270
278
  * resolve-side throw and flows through the same matrix — adopters who
271
- * need different behaviour for missing-DI vs. data-fetch failures can
279
+ * need different behaviour for missing-DI vs. data-lookup failures can
272
280
  * wrap the container access inside their own `resolve()`.
273
281
  */
274
282
  declare function runContributors(options: RunContributorsOptions): Promise<void>;
@@ -507,5 +515,48 @@ interface AdapterFactory<TConfig, TExtra = unknown> {
507
515
  */
508
516
  declare function defineAdapter<TConfig = Record<string, unknown>, TExtra = unknown>(options: DefineAdapterOptions<TConfig, TExtra>): AdapterFactory<TConfig, TExtra>;
509
517
  //#endregion
510
- export { CircuitOpenError as A, setClassMeta as B, ContributorCycleError as C, CircuitBreakerOptions as D, CircuitBreaker as E, getMethodMeta as F, setInMetaRecord as H, getMethodMetaOrUndefined as I, hasClassMeta as L, getClassMetaOrUndefined as M, getMetaMap as N, CircuitBreakerState as O, getMetaRecord as P, pushClassMeta as R, buildPipeline as S, MissingContributorError as T, setMethodMeta as U, setInMetaMap as V, runContributors as _, BuildContext as a, ContributorSource as b, PluginFactory as c, MissingMountDepError as d, MountCycleError as f, RunContributorsOptions as g, mountSort as h, defineAdapter as i, getClassMeta as j, CircuitBreakerStats as k, definePlugin as l, MountSortItem as m, AdapterFactory as n, DefinePluginOptions as o, MountKind as p, DefineAdapterOptions as r, PluginAsyncOptions as s, AdapterAsyncOptions as t, DuplicateMountNameError as u, BuildPipelineOptions as v, DuplicateContributorError as w, SourcedRegistration as x, ContributorPipeline as y, pushMethodMeta as z };
511
- //# sourceMappingURL=index-Yhs9sTMW.d.mts.map
518
+ //#region src/core/asset-keys.d.ts
519
+ type AssetKeyStrategy = 'auto' | 'strip' | 'with-extension';
520
+ interface AssetKeyPair {
521
+ /** Source-relative path the file was discovered at. */
522
+ rel: string;
523
+ /** Final logical key for the manifest, including the namespace prefix. */
524
+ key: string;
525
+ }
526
+ interface GroupAssetKeysOptions {
527
+ /**
528
+ * Strategy applied to this namespace. Default `'auto'`.
529
+ *
530
+ * Adopters override per-namespace via `assetMap.<ns>.keys` in
531
+ * kick.config.ts when they want uniform behaviour (e.g. always
532
+ * include the extension regardless of collisions).
533
+ */
534
+ strategy?: AssetKeyStrategy;
535
+ }
536
+ interface GroupAssetKeysResult {
537
+ pairs: AssetKeyPair[];
538
+ /**
539
+ * Number of collision groups resolved by keeping extensions.
540
+ * Surfaces as an informational log ("auto-resolved N collisions")
541
+ * so adopters know whether they're relying on auto-mode or not.
542
+ * Always 0 for `'strip'` (overwrites) and `'with-extension'`
543
+ * (extensions always preserved, no collision possible).
544
+ */
545
+ collisionGroupsResolved: number;
546
+ }
547
+ /**
548
+ * Compute final manifest keys for a namespace's discovered paths,
549
+ * given the chosen strategy. Pure function — no fs / config / globals
550
+ * involved.
551
+ *
552
+ * @param namespace assetMap key — e.g. `'mails'`, `'pages'`.
553
+ * @param paths source-relative file paths (POSIX separators) discovered
554
+ * under the namespace's `src` directory.
555
+ * @param opts grouping options.
556
+ */
557
+ declare function groupAssetKeys(namespace: string, paths: readonly string[], opts?: GroupAssetKeysOptions): GroupAssetKeysResult;
558
+ /** Strip the final extension from a path. `'mails/welcome.ejs'` → `'mails/welcome'`. */
559
+ declare function stripExt(path: string): string;
560
+ //#endregion
561
+ export { DuplicateContributorError as A, getMetaRecord as B, runContributors as C, SourcedRegistration as D, ContributorSource as E, CircuitBreakerStats as F, pushMethodMeta as G, getMethodMetaOrUndefined as H, CircuitOpenError as I, setInMetaRecord as J, setClassMeta as K, getClassMeta as L, CircuitBreaker as M, CircuitBreakerOptions as N, buildPipeline as O, CircuitBreakerState as P, getClassMetaOrUndefined as R, RunContributorsOptions as S, ContributorPipeline as T, hasClassMeta as U, getMethodMeta as V, pushClassMeta as W, setMethodMeta as Y, MissingMountDepError as _, groupAssetKeys as a, MountSortItem as b, AdapterFactory as c, BuildContext as d, DefinePluginOptions as f, DuplicateMountNameError as g, definePlugin as h, GroupAssetKeysResult as i, MissingContributorError as j, ContributorCycleError as k, DefineAdapterOptions as l, PluginFactory as m, AssetKeyStrategy as n, stripExt as o, PluginAsyncOptions as p, setInMetaMap as q, GroupAssetKeysOptions as r, AdapterAsyncOptions as s, AssetKeyPair as t, defineAdapter as u, MountCycleError as v, BuildPipelineOptions as w, mountSort as x, MountKind as y, getMetaMap as z };
562
+ //# sourceMappingURL=index-DvZfBNIf.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-DvZfBNIf.d.mts","names":[],"sources":["../src/core/metadata.ts","../src/core/circuit-breaker.ts","../src/core/context-errors.ts","../src/core/contributor-pipeline.ts","../src/core/contributor-runner.ts","../src/core/mount-sort.ts","../src/core/define-plugin.ts","../src/core/define-adapter.ts","../src/core/asset-keys.ts"],"mappings":";;;;;;;;;;;;;;;;;;KAeK,OAAA,qBAA4B,cAAA;;iBAKjB,YAAA,GAAA,CAAgB,GAAA,EAAK,OAAA,EAAS,KAAA,EAAO,CAAA,EAAG,MAAA;;iBAKxC,aAAA,GAAA,CAAiB,GAAA,EAAK,OAAA,EAAS,KAAA,EAAO,CAAA,EAAG,MAAA,UAAgB,MAAA;AALzE;AAAA,iBAYgB,YAAA,GAAA,CAAgB,GAAA,EAAK,OAAA,EAAS,MAAA,UAAgB,QAAA,EAAU,CAAA,GAAI,CAAA;;iBAK5D,aAAA,GAAA,CAAiB,GAAA,EAAK,OAAA,EAAS,MAAA,UAAgB,MAAA,UAAgB,QAAA,EAAU,CAAA,GAAI,CAAA;;iBAK7E,YAAA,CAAa,GAAA,EAAK,OAAA,EAAS,MAAA;;iBAK3B,uBAAA,GAAA,CAA2B,GAAA,EAAK,OAAA,EAAS,MAAA,WAAiB,CAAA;;iBAK1D,wBAAA,GAAA,CACd,GAAA,EAAK,OAAA,EACL,MAAA,UACA,MAAA,WACC,CAAA;;iBAOa,aAAA,GAAA,CAAiB,GAAA,EAAK,OAAA,EAAS,MAAA,aAAmB,KAA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22 @@
1
1
 
2
2
  import { a as METADATA, c as Scope, i as Constructor, l as ServiceOptions, n as BuilderOf, o as MaybePromise, r as ClassKind, s as PostConstructStatus, t as Buildable } from "./interfaces-B50n7dwl.mjs";
3
- import { a as tokenName, c as createToken, i as KickJsRegistry, l as isInjectionToken, n as ContainerChangeEvent, o as INJECTION_TOKEN, r as ContainerChangeListener, s as InjectionToken, t as Container } from "./container-CnWDsxi-.mjs";
4
- import { A as normalizeApiQueryParamsConfig, C as Post, D as RouteDefinition, E as Repository, F as assets, I as clearAssetCache, L as resolveAsset, M as ASSET_MANIFEST_VERSION, N as KickAssets, O as Service, P as UnknownAssetError, R as useAssets, S as Patch, T as Put, _ 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 ASSETS, k as Value, 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 } from "./decorators-BMvaLliz.mjs";
5
- import { a as baseEnvSchema, c as loadEnv, l as reloadEnv, n as TypedConfigService, o as defineEnv, r as createConfigService, s as getEnv, t as ConfigService, u as resetEnvCache } from "./index-D-qhXg9M.mjs";
3
+ import { a as tokenName, c as createToken, i as KickJsRegistry, l as isInjectionToken, n as ContainerChangeEvent, o as INJECTION_TOKEN, r as ContainerChangeListener, s as InjectionToken, t as Container } from "./container-BZKeHc5X.mjs";
4
+ import { A as normalizeApiQueryParamsConfig, C as Post, D as RouteDefinition, E as Repository, F as assets, I as clearAssetCache, L as resolveAsset, M as ASSET_MANIFEST_VERSION, N as KickAssets, O as Service, P as UnknownAssetError, R as useAssets, S as Patch, T as Put, _ 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 ASSETS, k as Value, 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 } from "./decorators-CRmHuzxz.mjs";
5
+ import { a as baseEnvSchema, c as loadEnv, l as reloadEnv, n as TypedConfigService, o as defineEnv, r as createConfigService, s as getEnv, t as ConfigService, u as resetEnvCache } from "./index-DhNglXyS.mjs";
6
6
  import { n as ExecutionContext, r as MetaValue, t as ContextMeta } from "./execution-context-DKnt61pY.mjs";
7
- import { a as ContributorRegistration, c as ResolvedDeps, i as ContextMetaKey, l as defineContextDecorator, n as ContextDecorator, o as ContributorRegistrations, r as ContextDecoratorSpec, s as DepValue, t as AnyContributorRegistration } from "./context-decorator-DrPvQ9Ag.mjs";
8
- import { a as MiddlewarePhase, c as KickJsPluginRegistry, i as AppAdapterClass, l as defineAugmentation, n as AdapterMiddleware, o as AugmentationMeta, r as AppAdapter, s as KickJsPluginName, t as AdapterContext } from "./adapter-6Pp4kFdM.mjs";
9
- import { n as AppModuleClass, r as ModuleRoutes, t as AppModule } from "./app-module-Blgz4Rti.mjs";
7
+ import { a as ContributorRegistration, c as ResolvedDeps, i as ContextMetaKey, l as defineContextDecorator, n as ContextDecorator, o as ContributorRegistrations, r as ContextDecoratorSpec, s as DepValue, t as AnyContributorRegistration } from "./context-decorator-Bca_BoRK.mjs";
8
+ import { a as MiddlewarePhase, c as KickJsPluginRegistry, i as AppAdapterClass, l as defineAugmentation, n as AdapterMiddleware, o as AugmentationMeta, r as AppAdapter, s as KickJsPluginName, t as AdapterContext } from "./adapter-C1w_xt08.mjs";
9
+ import { n as AppModuleClass, r as ModuleRoutes, t as AppModule } from "./app-module-D6zL_V5S.mjs";
10
10
  import { a as Cacheable, c as setCacheProvider, i as CacheProvider, n as CacheEvict, o as MemoryCacheProvider, r as CacheOptions, s as getCacheProvider } from "./cache-XrNWj1KQ.mjs";
11
11
  import { i as getCronJobs, n as Cron, r as CronJobMeta, t as CRON_META } from "./cron-GNoYydfg.mjs";
12
12
  import { i as ValidationError, n as HttpStatus, r as HttpStatusCode, t as HttpException } from "./errors-uaHCeXRz.mjs";
13
13
  import { a as rootLogger, i as createLogger, n as Logger, r as LoggerProvider, t as ConsoleLoggerProvider } from "./logger-CLVRZf2N.mjs";
14
14
  import { n as normalizePath, t as joinPaths } from "./path-Diviu6hv.mjs";
15
- import { t as KickPlugin } from "./plugin-DDjoN4XI.mjs";
15
+ import { t as KickPlugin } from "./plugin-DF8Xfv9Z.mjs";
16
16
  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-CfJceo4H.mjs";
17
- import { A as CircuitOpenError, B as setClassMeta, C as ContributorCycleError, D as CircuitBreakerOptions, E as CircuitBreaker, F as getMethodMeta, H as setInMetaRecord, I as getMethodMetaOrUndefined, L as hasClassMeta, M as getClassMetaOrUndefined, N as getMetaMap, O as CircuitBreakerState, P as getMetaRecord, R as pushClassMeta, S as buildPipeline, T as MissingContributorError, U as setMethodMeta, V as setInMetaMap, _ as runContributors, a as BuildContext, b as ContributorSource, c as PluginFactory, d as MissingMountDepError, f as MountCycleError, g as RunContributorsOptions, h as mountSort, i as defineAdapter, j as getClassMeta, k as CircuitBreakerStats, l as definePlugin, m as MountSortItem, n as AdapterFactory, o as DefinePluginOptions, p as MountKind, r as DefineAdapterOptions, s as PluginAsyncOptions, t as AdapterAsyncOptions, u as DuplicateMountNameError, v as BuildPipelineOptions, w as DuplicateContributorError, x as SourcedRegistration, y as ContributorPipeline, z as pushMethodMeta } from "./index-Yhs9sTMW.mjs";
18
- import { n as ApplicationOptions, r as MiddlewareEntry, t as Application } from "./application-CHvMXqbO.mjs";
19
- import { t as bootstrap } from "./bootstrap-C6GpMEpX.mjs";
17
+ import { A as DuplicateContributorError, B as getMetaRecord, C as runContributors, D as SourcedRegistration, E as ContributorSource, F as CircuitBreakerStats, G as pushMethodMeta, H as getMethodMetaOrUndefined, I as CircuitOpenError, J as setInMetaRecord, K as setClassMeta, L as getClassMeta, M as CircuitBreaker, N as CircuitBreakerOptions, O as buildPipeline, P as CircuitBreakerState, R as getClassMetaOrUndefined, S as RunContributorsOptions, T as ContributorPipeline, U as hasClassMeta, V as getMethodMeta, W as pushClassMeta, Y as setMethodMeta, _ as MissingMountDepError, a as groupAssetKeys, b as MountSortItem, c as AdapterFactory, d as BuildContext, f as DefinePluginOptions, g as DuplicateMountNameError, h as definePlugin, i as GroupAssetKeysResult, j as MissingContributorError, k as ContributorCycleError, l as DefineAdapterOptions, m as PluginFactory, n as AssetKeyStrategy, o as stripExt, p as PluginAsyncOptions, q as setInMetaMap, r as GroupAssetKeysOptions, s as AdapterAsyncOptions, t as AssetKeyPair, u as defineAdapter, v as MountCycleError, w as BuildPipelineOptions, x as mountSort, y as MountKind, z as getMetaMap } from "./index-DvZfBNIf.mjs";
18
+ import { n as ApplicationOptions, r as MiddlewareEntry, t as Application } from "./application-BTRI4aBd.mjs";
19
+ import { t as bootstrap } from "./bootstrap-B4YrBipl.mjs";
20
20
  import { _ as SortItem, a as parseSearchQuery, c as FILTER_OPERATORS, d as FilterOperator, f as PaginatedResponse, g as QueryFieldConfig, h as QueryBuilderAdapter, i as parseQuery, l as FieldsOf, m as ParsedQuery, n as parseFilters, o as parseSort, p as PaginationParams, r as parsePagination, t as buildQueryParams, u as FilterItem, y as TypedParsedQuery } from "./index-B9cyOQAe.mjs";
21
21
  import { n as RequestContext, r as RouteShape, t as Ctx } from "./context-Ymvv-85x.mjs";
22
22
  import { n as cors, t as CorsOptions } from "./cors-BfgqfLPd.mjs";
@@ -27,9 +27,9 @@ import { n as RateLimitStore, r as rateLimit, t as RateLimitOptions } from "./ra
27
27
  import { n as requestId, t as REQUEST_ID_HEADER } from "./request-id-BgglvZHN.mjs";
28
28
  import { n as requestLogger, t as RequestLoggerOptions } from "./request-logger-CWHbAzTE.mjs";
29
29
  import { a as session, i as SessionStore, n as SessionData, r as SessionOptions, t as Session } from "./session-N0hActOO.mjs";
30
- import { n as SpaAdapterOptions, t as SpaAdapter } from "./spa-CwIbdvPc.mjs";
31
- import { a as upload, i as resolveMimeTypes, n as buildUploadMiddleware, r as cleanupFiles, t as UploadOptions } from "./upload-BueOnnLw.mjs";
30
+ import { n as SpaAdapterOptions, t as SpaAdapter } from "./spa-e4FIS2RB.mjs";
31
+ import { a as upload, i as resolveMimeTypes, n as buildUploadMiddleware, r as cleanupFiles, t as UploadOptions } from "./upload-BM9uyR6Y.mjs";
32
32
  import { n as validate } from "./validate-HwAyWTwH.mjs";
33
- import { a as TraceContextOptions, c as requestScopeMiddleware, d as getRequestValue, f as requestStore, h as isClusterPrimary, i as TraceContext, l as RequestStore, m as ClusterOptions, n as ViewAdapterOptions, o as parseTraceparent, p as defineHttpContextDecorator, r as TRACEPARENT_HEADER, s as traceContext, t as ViewAdapter, u as getRequestStore } from "./views-DhuvHYPA.mjs";
34
- import { r as buildRoutes } from "./router-builder-zsX4Oq7c.mjs";
35
- export { ASSETS, ASSET_MANIFEST_VERSION, AdapterAsyncOptions, AdapterContext, AdapterFactory, AdapterMiddleware, AnyContributorRegistration, ApiQueryParams, ApiQueryParamsConfig, ApiQueryParamsConfig as QueryParamsConfig, AppAdapter, AppAdapterClass, AppModule, AppModuleClass, Application, ApplicationOptions, Asset, AssetKey, AugmentationMeta, Autowired, BaseUploadOptions, BuildContext, BuildPipelineOptions, Buildable, Builder, BuilderOf, CRON_META, CacheEvict, CacheOptions, CacheProvider, Cacheable, CircuitBreaker, CircuitBreakerOptions, CircuitBreakerState, CircuitBreakerStats, CircuitOpenError, ClassKind, ClusterOptions, ColumnApiQueryParamsConfig, Component, ComputedRef, ConfigService, ConsoleLoggerProvider, Constructor, Container, ContainerChangeEvent, ContainerChangeListener, ContextDecorator, ContextDecoratorSpec, ContextMeta, ContextMetaKey, ContributorCycleError, ContributorPipeline, ContributorRegistration, ContributorRegistrations, ContributorSource, Controller, CorsOptions, Cron, CronJobMeta, CsrfOptions, Ctx, DefineAdapterOptions, DefinePluginOptions, Delete, DepValue, DuplicateContributorError, DuplicateMountNameError, Env, EnvKey, ExecutionContext, FILTER_OPERATORS, FieldsOf, FileTypeFilter, FileUpload, FileUploadConfig, FilterItem, FilterOperator, Get, HelmetOptions, HttpException, HttpStatus, HttpStatusCode, INJECTION_TOKEN, Inject, Injectable, InjectionToken, KickAssets, KickJsPluginName, KickJsPluginRegistry, KickJsRegistry, KickPlugin, Logger, LoggerProvider, METADATA, MaybePromise, MemoryCacheProvider, MetaValue, Middleware, MiddlewareEntry, MiddlewareHandler, MiddlewarePhase, MissingContributorError, MissingMountDepError, ModuleRoutes, MountCycleError, MountKind, MountSortItem, PaginatedResponse, PaginationParams, ParsedQuery, Patch, PluginAsyncOptions, PluginFactory, Post, PostConstruct, PostConstructStatus, Put, QueryBuilderAdapter, QueryFieldConfig, REQUEST_ID_HEADER, RateLimitOptions, RateLimitStore, Ref, Repository, RequestContext, RequestLoggerOptions, RequestStore, ResolvedDeps, RouteDefinition, RouteShape, RunContributorsOptions, Scope, Service, ServiceOptions, Session, SessionData, SessionOptions, SessionStore, SortItem, SourcedRegistration, SpaAdapter, SpaAdapterOptions, TRACEPARENT_HEADER, TraceContext, TraceContextOptions, TypedConfigService, TypedParsedQuery, UnknownAssetError, UploadOptions, ValidationError, Value, ViewAdapter, ViewAdapterOptions, WatchOptions, assets, baseEnvSchema, bootstrap, buildPipeline, buildQueryParams, buildRoutes, buildUploadMiddleware, cleanupFiles, clearAssetCache, computed, cors, createConfigService, createLogger, createToken, csrf, defineAdapter, defineAugmentation, defineContextDecorator, defineEnv, defineHttpContextDecorator, definePlugin, errorHandler, getCacheProvider, getClassMeta, getClassMetaOrUndefined, getCronJobs, getEnv, getMetaMap, getMetaRecord, getMethodMeta, getMethodMetaOrUndefined, getRequestStore, getRequestValue, hasClassMeta, helmet, isClusterPrimary, isInjectionToken, isRef, joinPaths, loadEnv, mountSort, normalizeApiQueryParamsConfig, normalizePath, notFoundHandler, parseFilters, parsePagination, parseQuery, parseSearchQuery, parseSort, parseTraceparent, pushClassMeta, pushMethodMeta, rateLimit, reactive, ref, reloadEnv, requestId, requestLogger, requestScopeMiddleware, requestStore, resetEnvCache, resolveAsset, resolveMimeTypes, rootLogger, runContributors, session, setCacheProvider, setClassMeta, setInMetaMap, setInMetaRecord, setMethodMeta, toRefs, tokenName, traceContext, unref, upload, useAssets, validate, watch };
33
+ import { a as TraceContextOptions, c as requestScopeMiddleware, d as getRequestValue, f as requestStore, h as isClusterPrimary, i as TraceContext, l as RequestStore, m as ClusterOptions, n as ViewAdapterOptions, o as parseTraceparent, p as defineHttpContextDecorator, r as TRACEPARENT_HEADER, s as traceContext, t as ViewAdapter, u as getRequestStore } from "./views-DkNp9JJs.mjs";
34
+ import { r as buildRoutes } from "./router-builder-C7sXk_FG.mjs";
35
+ export { ASSETS, ASSET_MANIFEST_VERSION, AdapterAsyncOptions, AdapterContext, AdapterFactory, AdapterMiddleware, AnyContributorRegistration, ApiQueryParams, ApiQueryParamsConfig, ApiQueryParamsConfig as QueryParamsConfig, AppAdapter, AppAdapterClass, AppModule, AppModuleClass, Application, ApplicationOptions, Asset, AssetKey, AssetKeyPair, AssetKeyStrategy, AugmentationMeta, Autowired, BaseUploadOptions, BuildContext, BuildPipelineOptions, Buildable, Builder, BuilderOf, CRON_META, CacheEvict, CacheOptions, CacheProvider, Cacheable, CircuitBreaker, CircuitBreakerOptions, CircuitBreakerState, CircuitBreakerStats, CircuitOpenError, ClassKind, ClusterOptions, ColumnApiQueryParamsConfig, Component, ComputedRef, ConfigService, ConsoleLoggerProvider, Constructor, Container, ContainerChangeEvent, ContainerChangeListener, ContextDecorator, ContextDecoratorSpec, ContextMeta, ContextMetaKey, ContributorCycleError, ContributorPipeline, ContributorRegistration, ContributorRegistrations, ContributorSource, Controller, CorsOptions, Cron, CronJobMeta, CsrfOptions, Ctx, DefineAdapterOptions, DefinePluginOptions, Delete, DepValue, DuplicateContributorError, DuplicateMountNameError, Env, EnvKey, ExecutionContext, FILTER_OPERATORS, FieldsOf, FileTypeFilter, FileUpload, FileUploadConfig, FilterItem, FilterOperator, Get, GroupAssetKeysOptions, GroupAssetKeysResult, HelmetOptions, HttpException, HttpStatus, HttpStatusCode, INJECTION_TOKEN, Inject, Injectable, InjectionToken, KickAssets, KickJsPluginName, KickJsPluginRegistry, KickJsRegistry, KickPlugin, Logger, LoggerProvider, METADATA, MaybePromise, MemoryCacheProvider, MetaValue, Middleware, MiddlewareEntry, MiddlewareHandler, MiddlewarePhase, MissingContributorError, MissingMountDepError, ModuleRoutes, MountCycleError, MountKind, MountSortItem, PaginatedResponse, PaginationParams, ParsedQuery, Patch, PluginAsyncOptions, PluginFactory, Post, PostConstruct, PostConstructStatus, Put, QueryBuilderAdapter, QueryFieldConfig, REQUEST_ID_HEADER, RateLimitOptions, RateLimitStore, Ref, Repository, RequestContext, RequestLoggerOptions, RequestStore, ResolvedDeps, RouteDefinition, RouteShape, RunContributorsOptions, Scope, Service, ServiceOptions, Session, SessionData, SessionOptions, SessionStore, SortItem, SourcedRegistration, SpaAdapter, SpaAdapterOptions, TRACEPARENT_HEADER, TraceContext, TraceContextOptions, TypedConfigService, TypedParsedQuery, UnknownAssetError, UploadOptions, ValidationError, Value, ViewAdapter, ViewAdapterOptions, WatchOptions, assets, baseEnvSchema, bootstrap, buildPipeline, buildQueryParams, buildRoutes, buildUploadMiddleware, cleanupFiles, clearAssetCache, computed, cors, createConfigService, createLogger, createToken, csrf, defineAdapter, defineAugmentation, defineContextDecorator, defineEnv, defineHttpContextDecorator, definePlugin, errorHandler, getCacheProvider, getClassMeta, getClassMetaOrUndefined, getCronJobs, getEnv, getMetaMap, getMetaRecord, getMethodMeta, getMethodMetaOrUndefined, getRequestStore, getRequestValue, groupAssetKeys, hasClassMeta, helmet, isClusterPrimary, isInjectionToken, isRef, joinPaths, loadEnv, mountSort, normalizeApiQueryParamsConfig, normalizePath, notFoundHandler, parseFilters, parsePagination, parseQuery, parseSearchQuery, parseSort, parseTraceparent, pushClassMeta, pushMethodMeta, rateLimit, reactive, ref, reloadEnv, requestId, requestLogger, requestScopeMiddleware, requestStore, resetEnvCache, resolveAsset, resolveMimeTypes, rootLogger, runContributors, session, setCacheProvider, setClassMeta, setInMetaMap, setInMetaRecord, setMethodMeta, stripExt, toRefs, tokenName, traceContext, unref, upload, useAssets, validate, watch };
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs v5.0.2
2
+ * @forinda/kickjs v5.2.0
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,27 +8,27 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import { a as UnknownAssetError, c as resolveAsset, d as createToken, f as isInjectionToken, i as ASSET_MANIFEST_VERSION, l as useAssets, n as tokenName, o as assets, r as ASSETS, s as clearAssetCache, t as Container, u as INJECTION_TOKEN } from "./container-Dn3ENJgH.mjs";
11
+ import { a as UnknownAssetError, c as resolveAsset, d as stripExt, f as INJECTION_TOKEN, i as ASSET_MANIFEST_VERSION, l as useAssets, m as isInjectionToken, n as tokenName, o as assets, p as createToken, r as ASSETS, s as clearAssetCache, t as Container, u as groupAssetKeys } from "./container-C0FlgLNH.mjs";
12
12
  import { METADATA, Scope } from "./core/interfaces.mjs";
13
13
  import { ConsoleLoggerProvider, Logger, createLogger, rootLogger } from "./core/logger.mjs";
14
- import { a as getMethodMeta, c as pushClassMeta, d as setInMetaMap, f as setInMetaRecord, i as getMetaRecord, l as pushMethodMeta, n as getClassMetaOrUndefined, o as getMethodMetaOrUndefined, p as setMethodMeta, r as getMetaMap, s as hasClassMeta, t as getClassMeta, u as setClassMeta } from "./metadata-BqhX5q4E.mjs";
14
+ import { a as getMethodMeta, c as pushClassMeta, d as setInMetaMap, f as setInMetaRecord, i as getMetaRecord, l as pushMethodMeta, n as getClassMetaOrUndefined, o as getMethodMetaOrUndefined, p as setMethodMeta, r as getMetaMap, s as hasClassMeta, t as getClassMeta, u as setClassMeta } from "./metadata-DPLdmj1w.mjs";
15
15
  import { ApiQueryParams, Asset, Autowired, Builder, Component, Controller, Delete, FileUpload, Get, Inject, Injectable, Middleware, Patch, Post, PostConstruct, Put, Repository, Service, Value, normalizeApiQueryParamsConfig } from "./core/decorators.mjs";
16
16
  import { CRON_META, Cron, getCronJobs } from "./core/cron.mjs";
17
17
  import { CacheEvict, Cacheable, MemoryCacheProvider, getCacheProvider, setCacheProvider } from "./core/cache.mjs";
18
18
  import { HttpException, HttpStatus } from "./core/errors.mjs";
19
19
  import { joinPaths, normalizePath } from "./core/path.mjs";
20
- import { a as MissingMountDepError, c as runContributors, d as DuplicateContributorError, f as MissingContributorError, h as CircuitOpenError, i as DuplicateMountNameError, l as buildPipeline, m as CircuitBreaker, n as defineAdapter, o as MountCycleError, p as defineContextDecorator, r as definePlugin, s as mountSort, t as defineAugmentation, u as ContributorCycleError } from "./core-CLCy-u2-.mjs";
20
+ import { a as MissingMountDepError, c as runContributors, d as DuplicateContributorError, f as MissingContributorError, h as CircuitOpenError, i as DuplicateMountNameError, l as buildPipeline, m as CircuitBreaker, n as defineAdapter, o as MountCycleError, p as defineContextDecorator, r as definePlugin, s as mountSort, t as defineAugmentation, u as ContributorCycleError } from "./core-K0J8AH_4.mjs";
21
21
  import { computed, isRef, reactive, ref, toRefs, unref, watch } from "./core/reactivity.mjs";
22
22
  import { REQUEST_ID_HEADER, requestId } from "./http/middleware/request-id.mjs";
23
23
  import { errorHandler, notFoundHandler } from "./http/middleware/error-handler.mjs";
24
- import { i as requestStore, n as getRequestStore, r as getRequestValue, t as RequestContext } from "./context-kfiZcP7J.mjs";
25
- import { n as requestScopeMiddleware, t as Application } from "./application-BmCrQdPG.mjs";
26
- import { a as parseSearchQuery, i as parseQuery, n as parseFilters, o as parseSort, r as parsePagination, s as FILTER_OPERATORS, t as buildQueryParams } from "./query-IvtMtXoI.mjs";
24
+ import { i as requestStore, n as getRequestStore, r as getRequestValue, t as RequestContext } from "./context-CDFiXWcV.mjs";
25
+ import { n as requestScopeMiddleware, t as Application } from "./application-Bw87drVl.mjs";
26
+ import { a as parseSearchQuery, i as parseQuery, n as parseFilters, o as parseSort, r as parsePagination, s as FILTER_OPERATORS, t as buildQueryParams } from "./query-CD0AMqxx.mjs";
27
27
  import { validate } from "./http/middleware/validate.mjs";
28
28
  import { buildUploadMiddleware, cleanupFiles, resolveMimeTypes, upload } from "./http/middleware/upload.mjs";
29
29
  import { buildRoutes } from "./http/router-builder.mjs";
30
- import { a as reloadEnv, i as loadEnv, n as defineEnv, o as resetEnvCache, r as getEnv, t as baseEnvSchema } from "./env-B4asq48l.mjs";
31
- import { n as isClusterPrimary, t as bootstrap } from "./bootstrap-CUf7KAK-.mjs";
30
+ import { a as reloadEnv, i as loadEnv, n as defineEnv, o as resetEnvCache, r as getEnv, t as baseEnvSchema } from "./env-CDMCT10_.mjs";
31
+ import { n as isClusterPrimary, t as bootstrap } from "./bootstrap-CsQ7LE-W.mjs";
32
32
  import { csrf } from "./http/middleware/csrf.mjs";
33
33
  import { requestLogger } from "./http/middleware/request-logger.mjs";
34
34
  import { helmet } from "./http/middleware/helmet.mjs";
@@ -37,7 +37,7 @@ import { rateLimit } from "./http/middleware/rate-limit.mjs";
37
37
  import { session } from "./http/middleware/session.mjs";
38
38
  import { ViewAdapter } from "./http/middleware/views.mjs";
39
39
  import { SpaAdapter } from "./http/middleware/spa.mjs";
40
- import { n as createConfigService, t as ConfigService } from "./config-B6z2ri6d.mjs";
40
+ import { n as createConfigService, t as ConfigService } from "./config-DKRN5fqC.mjs";
41
41
  import crypto from "node:crypto";
42
42
  //#region src/http/define-http-context-decorator.ts
43
43
  /**
@@ -46,11 +46,15 @@ import crypto from "node:crypto";
46
46
  * The core factory leaves `Ctx` defaulted to {@link ExecutionContext} so the
47
47
  * Context Contributor pipeline stays transport-agnostic — future WebSocket,
48
48
  * queue, and cron contexts share the same primitive. The cost is that the
49
- * vast majority of contributors (which are HTTP) have to spell the third
49
+ * vast majority of contributors (which are HTTP) have to spell the fourth
50
50
  * generic by hand to get `ctx.req` / `ctx.headers` typing:
51
51
  *
52
52
  * ```ts
53
- * defineContextDecorator<'tenant', Record<string, never>, RequestContext>({ ... })
53
+ * // Verbose: spell every generic, including the params shape `P`.
54
+ * defineContextDecorator<'tenant', Record<string, never>, Record<string, never>, RequestContext>({
55
+ * key: 'tenant',
56
+ * resolve: (ctx) => ({ id: ctx.req.headers['x-tenant-id'] as string }),
57
+ * })
54
58
  * ```
55
59
  *
56
60
  * `defineHttpContextDecorator` removes that ceremony — the spec is typed
@@ -64,6 +68,19 @@ import crypto from "node:crypto";
64
68
  * key: 'tenant',
65
69
  * resolve: (ctx) => ({ id: ctx.req.headers['x-tenant-id'] as string }),
66
70
  * })
71
+ *
72
+ * // Parameterised: the third generic carries the per-call params shape.
73
+ * const LoadTenantParameterised = defineHttpContextDecorator<
74
+ * 'tenant',
75
+ * Record<string, never>,
76
+ * { source: 'header' | 'subdomain' }
77
+ * >({
78
+ * key: 'tenant',
79
+ * paramDefaults: { source: 'header' },
80
+ * resolve: (ctx, _deps, params) => {
81
+ * // params.source narrows inside `if` branches.
82
+ * },
83
+ * })
67
84
  * ```
68
85
  *
69
86
  * Use {@link defineContextDecorator} directly when authoring contributors
@@ -159,6 +176,6 @@ function traceContext(options = {}) {
159
176
  };
160
177
  }
161
178
  //#endregion
162
- export { ASSETS, ASSET_MANIFEST_VERSION, ApiQueryParams, Application, Asset, Autowired, Builder, CRON_META, CacheEvict, Cacheable, CircuitBreaker, CircuitOpenError, Component, ConfigService, ConsoleLoggerProvider, Container, ContributorCycleError, Controller, Cron, Delete, DuplicateContributorError, DuplicateMountNameError, FILTER_OPERATORS, FileUpload, Get, HttpException, HttpStatus, INJECTION_TOKEN, Inject, Injectable, Logger, METADATA, MemoryCacheProvider, Middleware, MissingContributorError, MissingMountDepError, MountCycleError, Patch, Post, PostConstruct, Put, REQUEST_ID_HEADER, Repository, RequestContext, Scope, Service, SpaAdapter, TRACEPARENT_HEADER, UnknownAssetError, Value, ViewAdapter, assets, baseEnvSchema, bootstrap, buildPipeline, buildQueryParams, buildRoutes, buildUploadMiddleware, cleanupFiles, clearAssetCache, computed, cors, createConfigService, createLogger, createToken, csrf, defineAdapter, defineAugmentation, defineContextDecorator, defineEnv, defineHttpContextDecorator, definePlugin, errorHandler, getCacheProvider, getClassMeta, getClassMetaOrUndefined, getCronJobs, getEnv, getMetaMap, getMetaRecord, getMethodMeta, getMethodMetaOrUndefined, getRequestStore, getRequestValue, hasClassMeta, helmet, isClusterPrimary, isInjectionToken, isRef, joinPaths, loadEnv, mountSort, normalizeApiQueryParamsConfig, normalizePath, notFoundHandler, parseFilters, parsePagination, parseQuery, parseSearchQuery, parseSort, parseTraceparent, pushClassMeta, pushMethodMeta, rateLimit, reactive, ref, reloadEnv, requestId, requestLogger, requestScopeMiddleware, requestStore, resetEnvCache, resolveAsset, resolveMimeTypes, rootLogger, runContributors, session, setCacheProvider, setClassMeta, setInMetaMap, setInMetaRecord, setMethodMeta, toRefs, tokenName, traceContext, unref, upload, useAssets, validate, watch };
179
+ export { ASSETS, ASSET_MANIFEST_VERSION, ApiQueryParams, Application, Asset, Autowired, Builder, CRON_META, CacheEvict, Cacheable, CircuitBreaker, CircuitOpenError, Component, ConfigService, ConsoleLoggerProvider, Container, ContributorCycleError, Controller, Cron, Delete, DuplicateContributorError, DuplicateMountNameError, FILTER_OPERATORS, FileUpload, Get, HttpException, HttpStatus, INJECTION_TOKEN, Inject, Injectable, Logger, METADATA, MemoryCacheProvider, Middleware, MissingContributorError, MissingMountDepError, MountCycleError, Patch, Post, PostConstruct, Put, REQUEST_ID_HEADER, Repository, RequestContext, Scope, Service, SpaAdapter, TRACEPARENT_HEADER, UnknownAssetError, Value, ViewAdapter, assets, baseEnvSchema, bootstrap, buildPipeline, buildQueryParams, buildRoutes, buildUploadMiddleware, cleanupFiles, clearAssetCache, computed, cors, createConfigService, createLogger, createToken, csrf, defineAdapter, defineAugmentation, defineContextDecorator, defineEnv, defineHttpContextDecorator, definePlugin, errorHandler, getCacheProvider, getClassMeta, getClassMetaOrUndefined, getCronJobs, getEnv, getMetaMap, getMetaRecord, getMethodMeta, getMethodMetaOrUndefined, getRequestStore, getRequestValue, groupAssetKeys, hasClassMeta, helmet, isClusterPrimary, isInjectionToken, isRef, joinPaths, loadEnv, mountSort, normalizeApiQueryParamsConfig, normalizePath, notFoundHandler, parseFilters, parsePagination, parseQuery, parseSearchQuery, parseSort, parseTraceparent, pushClassMeta, pushMethodMeta, rateLimit, reactive, ref, reloadEnv, requestId, requestLogger, requestScopeMiddleware, requestStore, resetEnvCache, resolveAsset, resolveMimeTypes, rootLogger, runContributors, session, setCacheProvider, setClassMeta, setInMetaMap, setInMetaRecord, setMethodMeta, stripExt, toRefs, tokenName, traceContext, unref, upload, useAssets, validate, watch };
163
180
 
164
181
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/http/define-http-context-decorator.ts","../src/http/middleware/trace-context.ts"],"sourcesContent":["/**\n * HTTP-flavoured wrapper around {@link defineContextDecorator}.\n *\n * The core factory leaves `Ctx` defaulted to {@link ExecutionContext} so the\n * Context Contributor pipeline stays transport-agnostic — future WebSocket,\n * queue, and cron contexts share the same primitive. The cost is that the\n * vast majority of contributors (which are HTTP) have to spell the third\n * generic by hand to get `ctx.req` / `ctx.headers` typing:\n *\n * ```ts\n * defineContextDecorator<'tenant', Record<string, never>, RequestContext>({ ... })\n * ```\n *\n * `defineHttpContextDecorator` removes that ceremony — the spec is typed\n * against `RequestContext` from the start, so resolvers can read `ctx.req`,\n * `ctx.headers`, `ctx.params`, etc. without a cast or generic dance:\n *\n * ```ts\n * import { defineHttpContextDecorator } from '@forinda/kickjs'\n *\n * const LoadTenant = defineHttpContextDecorator({\n * key: 'tenant',\n * resolve: (ctx) => ({ id: ctx.req.headers['x-tenant-id'] as string }),\n * })\n * ```\n *\n * Use {@link defineContextDecorator} directly when authoring contributors\n * for non-HTTP transports or when you want to share one contributor across\n * HTTP + WS + queue (the resolver then has to stick to the\n * `ExecutionContext` surface — `ctx.get` / `ctx.set` / `ctx.requestId`).\n */\n\nimport {\n defineContextDecorator,\n type ContextDecorator,\n type ContextDecoratorSpec,\n type DepValue,\n} from '../core/context-decorator'\nimport type { RequestContext } from './context'\n\nexport function defineHttpContextDecorator<\n K extends string,\n D extends Record<string, DepValue> = Record<string, never>,\n>(spec: ContextDecoratorSpec<K, D, RequestContext>): ContextDecorator<K, D, RequestContext> {\n return defineContextDecorator<K, D, RequestContext>(spec)\n}\n","import crypto from 'node:crypto'\nimport type { Request, Response, NextFunction } from 'express'\nimport { requestStore } from '../request-store'\n\n/**\n * W3C Trace Context header name.\n * @see https://www.w3.org/TR/trace-context/#traceparent-header\n */\nexport const TRACEPARENT_HEADER = 'traceparent'\n\n/** Regex for a valid W3C traceparent: {version}-{trace-id}-{parent-id}-{flags} */\nconst TRACEPARENT_RE = /^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/\n\nexport interface TraceContextOptions {\n /**\n * When true, respond with a `traceresponse` header containing the trace ID.\n * Useful for debugging. Default: false.\n */\n propagateResponse?: boolean\n}\n\n/**\n * Parsed W3C trace context fields.\n */\nexport interface TraceContext {\n /** W3C traceparent version (usually '00') */\n version: string\n /** 32-hex-char distributed trace ID */\n traceId: string\n /** 16-hex-char parent span ID */\n parentSpanId: string\n /** 2-hex-char trace flags */\n flags: string\n}\n\n/**\n * Generate a random 32-hex-character trace ID.\n */\nfunction generateTraceId(): string {\n return crypto.randomBytes(16).toString('hex')\n}\n\n/**\n * Generate a random 16-hex-character span ID.\n */\nfunction generateSpanId(): string {\n return crypto.randomBytes(8).toString('hex')\n}\n\n/**\n * Parse a W3C traceparent header value.\n * Returns null if the format is invalid.\n */\nexport function parseTraceparent(header: string): TraceContext | null {\n const match = TRACEPARENT_RE.exec(header.trim().toLowerCase())\n if (!match) return null\n\n const version = match[1]\n const traceId = match[2]\n const parentSpanId = match[3]\n const flags = match[4]\n\n // W3C spec: version ff is invalid, all-zero trace-id and parent-id are invalid\n if (\n version === 'ff' ||\n traceId === '00000000000000000000000000000000' ||\n parentSpanId === '0000000000000000'\n ) {\n return null\n }\n\n return { version, traceId, parentSpanId, flags }\n}\n\n/**\n * Middleware that extracts W3C `traceparent` header and stores trace context\n * in the request's AsyncLocalStorage store.\n *\n * If no valid `traceparent` header is present, a new traceId is generated\n * so that every request always has a trace ID available for correlation.\n *\n * Must be mounted **after** `requestScopeMiddleware()` (which creates the store).\n *\n * @example\n * ```ts\n * bootstrap({\n * middleware: [\n * requestScopeMiddleware(),\n * traceContext(), // extracts or generates traceId\n * requestLogger(),\n * express.json(),\n * ],\n * })\n * ```\n */\nexport function traceContext(options: TraceContextOptions = {}) {\n return (req: Request, res: Response, next: NextFunction) => {\n const store = requestStore.getStore()\n\n const traceparentHeader = req.headers[TRACEPARENT_HEADER]\n const raw = Array.isArray(traceparentHeader) ? traceparentHeader[0] : traceparentHeader\n const parsed = raw ? parseTraceparent(raw) : null\n\n const traceId = parsed?.traceId ?? generateTraceId()\n const spanId = generateSpanId()\n\n // Attach to the request store so logger + downstream code can access it\n if (store) {\n store.values.set('traceId', traceId)\n store.values.set('spanId', spanId)\n if (parsed) {\n store.values.set('parentSpanId', parsed.parentSpanId)\n store.values.set('traceFlags', parsed.flags)\n store.values.set('traceVersion', parsed.version)\n }\n }\n\n // Also expose on req for convenience\n ;(req as any).traceId = traceId\n ;(req as any).spanId = spanId\n\n if (options.propagateResponse) {\n res.setHeader('traceresponse', traceId)\n }\n\n next()\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAgB,2BAGd,MAA0F;AAC1F,QAAO,uBAA6C,KAAK;;;;;;;;ACpC3D,MAAa,qBAAqB;;AAGlC,MAAM,iBAAiB;;;;A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ware/trace-context.ts"],"sourcesContent":["/**\n * HTTP-flavoured wrapper around {@link defineContextDecorator}.\n *\n * The core factory leaves `Ctx` defaulted to {@link ExecutionContext} so the\n * Context Contributor pipeline stays transport-agnostic — future WebSocket,\n * queue, and cron contexts share the same primitive. The cost is that the\n * vast majority of contributors (which are HTTP) have to spell the fourth\n * generic by hand to get `ctx.req` / `ctx.headers` typing:\n *\n * ```ts\n * // Verbose: spell every generic, including the params shape `P`.\n * defineContextDecorator<'tenant', Record<string, never>, Record<string, never>, RequestContext>({\n * key: 'tenant',\n * resolve: (ctx) => ({ id: ctx.req.headers['x-tenant-id'] as string }),\n * })\n * ```\n *\n * `defineHttpContextDecorator` removes that ceremony — the spec is typed\n * against `RequestContext` from the start, so resolvers can read `ctx.req`,\n * `ctx.headers`, `ctx.params`, etc. without a cast or generic dance:\n *\n * ```ts\n * import { defineHttpContextDecorator } from '@forinda/kickjs'\n *\n * const LoadTenant = defineHttpContextDecorator({\n * key: 'tenant',\n * resolve: (ctx) => ({ id: ctx.req.headers['x-tenant-id'] as string }),\n * })\n *\n * // Parameterised: the third generic carries the per-call params shape.\n * const LoadTenantParameterised = defineHttpContextDecorator<\n * 'tenant',\n * Record<string, never>,\n * { source: 'header' | 'subdomain' }\n * >({\n * key: 'tenant',\n * paramDefaults: { source: 'header' },\n * resolve: (ctx, _deps, params) => {\n * // params.source narrows inside `if` branches.\n * },\n * })\n * ```\n *\n * Use {@link defineContextDecorator} directly when authoring contributors\n * for non-HTTP transports or when you want to share one contributor across\n * HTTP + WS + queue (the resolver then has to stick to the\n * `ExecutionContext` surface — `ctx.get` / `ctx.set` / `ctx.requestId`).\n */\n\nimport {\n defineContextDecorator,\n type ContextDecorator,\n type ContextDecoratorSpec,\n type DepValue,\n} from '../core/context-decorator'\nimport type { RequestContext } from './context'\n\nexport function defineHttpContextDecorator<\n K extends string,\n D extends Record<string, DepValue> = Record<string, never>,\n P extends Record<string, unknown> = Record<string, never>,\n>(spec: ContextDecoratorSpec<K, D, P, RequestContext>): ContextDecorator<K, D, P, RequestContext> {\n return defineContextDecorator<K, D, P, RequestContext>(spec)\n}\n","import crypto from 'node:crypto'\nimport type { Request, Response, NextFunction } from 'express'\nimport { requestStore } from '../request-store'\n\n/**\n * W3C Trace Context header name.\n * @see https://www.w3.org/TR/trace-context/#traceparent-header\n */\nexport const TRACEPARENT_HEADER = 'traceparent'\n\n/** Regex for a valid W3C traceparent: {version}-{trace-id}-{parent-id}-{flags} */\nconst TRACEPARENT_RE = /^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/\n\nexport interface TraceContextOptions {\n /**\n * When true, respond with a `traceresponse` header containing the trace ID.\n * Useful for debugging. Default: false.\n */\n propagateResponse?: boolean\n}\n\n/**\n * Parsed W3C trace context fields.\n */\nexport interface TraceContext {\n /** W3C traceparent version (usually '00') */\n version: string\n /** 32-hex-char distributed trace ID */\n traceId: string\n /** 16-hex-char parent span ID */\n parentSpanId: string\n /** 2-hex-char trace flags */\n flags: string\n}\n\n/**\n * Generate a random 32-hex-character trace ID.\n */\nfunction generateTraceId(): string {\n return crypto.randomBytes(16).toString('hex')\n}\n\n/**\n * Generate a random 16-hex-character span ID.\n */\nfunction generateSpanId(): string {\n return crypto.randomBytes(8).toString('hex')\n}\n\n/**\n * Parse a W3C traceparent header value.\n * Returns null if the format is invalid.\n */\nexport function parseTraceparent(header: string): TraceContext | null {\n const match = TRACEPARENT_RE.exec(header.trim().toLowerCase())\n if (!match) return null\n\n const version = match[1]\n const traceId = match[2]\n const parentSpanId = match[3]\n const flags = match[4]\n\n // W3C spec: version ff is invalid, all-zero trace-id and parent-id are invalid\n if (\n version === 'ff' ||\n traceId === '00000000000000000000000000000000' ||\n parentSpanId === '0000000000000000'\n ) {\n return null\n }\n\n return { version, traceId, parentSpanId, flags }\n}\n\n/**\n * Middleware that extracts W3C `traceparent` header and stores trace context\n * in the request's AsyncLocalStorage store.\n *\n * If no valid `traceparent` header is present, a new traceId is generated\n * so that every request always has a trace ID available for correlation.\n *\n * Must be mounted **after** `requestScopeMiddleware()` (which creates the store).\n *\n * @example\n * ```ts\n * bootstrap({\n * middleware: [\n * requestScopeMiddleware(),\n * traceContext(), // extracts or generates traceId\n * requestLogger(),\n * express.json(),\n * ],\n * })\n * ```\n */\nexport function traceContext(options: TraceContextOptions = {}) {\n return (req: Request, res: Response, next: NextFunction) => {\n const store = requestStore.getStore()\n\n const traceparentHeader = req.headers[TRACEPARENT_HEADER]\n const raw = Array.isArray(traceparentHeader) ? traceparentHeader[0] : traceparentHeader\n const parsed = raw ? parseTraceparent(raw) : null\n\n const traceId = parsed?.traceId ?? generateTraceId()\n const spanId = generateSpanId()\n\n // Attach to the request store so logger + downstream code can access it\n if (store) {\n store.values.set('traceId', traceId)\n store.values.set('spanId', spanId)\n if (parsed) {\n store.values.set('parentSpanId', parsed.parentSpanId)\n store.values.set('traceFlags', parsed.flags)\n store.values.set('traceVersion', parsed.version)\n }\n }\n\n // Also expose on req for convenience\n ;(req as any).traceId = traceId\n ;(req as any).spanId = spanId\n\n if (options.propagateResponse) {\n res.setHeader('traceresponse', traceId)\n }\n\n next()\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,SAAgB,2BAId,MAAgG;AAChG,QAAO,uBAAgD,KAAK;;;;;;;;ACtD9D,MAAa,qBAAqB;;AAGlC,MAAM,iBAAiB;;;;AA2BvB,SAAS,kBAA0B;AACjC,QAAO,OAAO,YAAY,GAAG,CAAC,SAAS,MAAM;;;;;AAM/C,SAAS,iBAAyB;AAChC,QAAO,OAAO,YAAY,EAAE,CAAC,SAAS,MAAM;;;;;;AAO9C,SAAgB,iBAAiB,QAAqC;CACpE,MAAM,QAAQ,eAAe,KAAK,OAAO,MAAM,CAAC,aAAa,CAAC;AAC9D,KAAI,CAAC,MAAO,QAAO;CAEnB,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AI,IAAA,WAAe,MAAA;EAUpB;EAAN,KAAA,CAAM,IAAA,WAAe,MAAA;EAKb;EAAA,QAAA,GAAA;EAIR,IAAA,CAAK,GAAA,aAAgB,IAAA;EAIrB,IAAA,CAAK,GAAA,aAAgB,IAAA;EAIrB,KAAA,CAAM,QAAA,OAAe,GAAA,cAAiB,IAAA;EAUtC,KAAA,CAAM,GAAA,aAAgB,IAAA;EAItB,KAAA,CAAM,GAAA,aAAgB,IAAA;EAKtB,KAAA,CAAM,GAAA,aAAgB,IAAA;AAAA;;iBAOR,YAAA,CAAa,IAAA,WAAe,MAAA"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs v5.0.2
2
+ * @forinda/kickjs v5.2.0
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -73,4 +73,4 @@ function getMetaRecord(key, target) {
73
73
  //#endregion
74
74
  export { getMethodMeta as a, pushClassMeta as c, setInMetaMap as d, setInMetaRecord as f, getMetaRecord as i, pushMethodMeta as l, getClassMetaOrUndefined as n, getMethodMetaOrUndefined as o, setMethodMeta as p, getMetaMap as r, hasClassMeta as s, getClassMeta as t, setClassMeta as u };
75
75
 
76
- //# sourceMappingURL=metadata-BqhX5q4E.mjs.map
76
+ //# sourceMappingURL=metadata-DPLdmj1w.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"metadata-BqhX5q4E.mjs","names":[],"sources":["../src/core/metadata.ts"],"sourcesContent":["import 'reflect-metadata'\nimport type { InjectionToken } from './token'\n\n/**\n * Typed utilities for reflect-metadata operations.\n *\n * Replaces scattered Reflect.defineMetadata/getMetadata calls with a single\n * source of truth. If we later move to Stage 3 decorators or a WeakMap-based\n * store, only this file changes — all 24+ consumer files stay untouched.\n *\n * Keys may be symbols, strings, or `InjectionToken<T>` objects produced by\n * `createToken()`. Using `createToken` is the preferred pattern because the\n * token's phantom type flows through the helpers, enabling type-safe reads.\n */\n\ntype MetaKey = symbol | string | InjectionToken<unknown>\n\n// ── Setters ─────────────────────────────────────────────────────\n\n/** Set metadata on a class (or prototype for property decorators) */\nexport function setClassMeta<T>(key: MetaKey, value: T, target: object): void {\n Reflect.defineMetadata(key, value, target)\n}\n\n/** Set metadata on a specific method */\nexport function setMethodMeta<T>(key: MetaKey, value: T, target: object, method: string): void {\n Reflect.defineMetadata(key, value, target, method)\n}\n\n// ── Getters ─────────────────────────────────────────────────────\n\n/** Get metadata from a class, returning `fallback` if not set */\nexport function getClassMeta<T>(key: MetaKey, target: object, fallback: T): T {\n return (Reflect.getMetadata(key, target) as T) ?? fallback\n}\n\n/** Get metadata from a specific method, returning `fallback` if not set */\nexport function getMethodMeta<T>(key: MetaKey, target: object, method: string, fallback: T): T {\n return (Reflect.getMetadata(key, target, method) as T) ?? fallback\n}\n\n/** Check if metadata exists on a class */\nexport function hasClassMeta(key: MetaKey, target: object): boolean {\n return Reflect.hasMetadata(key, target)\n}\n\n/** Get metadata from a class with no default (returns undefined if absent) */\nexport function getClassMetaOrUndefined<T>(key: MetaKey, target: object): T | undefined {\n return Reflect.getMetadata(key, target) as T | undefined\n}\n\n/** Get metadata from a method with no default (returns undefined if absent) */\nexport function getMethodMetaOrUndefined<T>(\n key: MetaKey,\n target: object,\n method: string,\n): T | undefined {\n return Reflect.getMetadata(key, target, method) as T | undefined\n}\n\n// ── Accumulate: Arrays ──────────────────────────────────────────\n\n/** Append items to an array stored in class metadata */\nexport function pushClassMeta<T>(key: MetaKey, target: object, ...items: T[]): void {\n const existing: T[] = Reflect.getOwnMetadata(key, target) ?? []\n Reflect.defineMetadata(key, [...existing, ...items], target)\n}\n\n/** Append items to an array stored in method metadata */\nexport function pushMethodMeta<T>(\n key: MetaKey,\n target: object,\n method: string,\n ...items: T[]\n): void {\n const existing: T[] = Reflect.getOwnMetadata(key, target, method) ?? []\n Reflect.defineMetadata(key, [...existing, ...items], target, method)\n}\n\n// ── Accumulate: Maps ────────────────────────────────────────────\n\n/** Set a key/value in a Map stored in class metadata */\nexport function setInMetaMap<K, V>(key: MetaKey, target: object, mapKey: K, mapValue: V): void {\n const inherited: Map<K, V> | undefined = Reflect.getOwnMetadata(key, target)\n const map = inherited ? new Map(inherited) : new Map<K, V>()\n map.set(mapKey, mapValue)\n Reflect.defineMetadata(key, map, target)\n}\n\n/** Get a Map from class metadata (returns empty Map if absent) */\nexport function getMetaMap<K, V>(key: MetaKey, target: object): Map<K, V> {\n return Reflect.getMetadata(key, target) ?? new Map()\n}\n\n// ── Accumulate: Records ─────────────────────────────────────────\n\n/** Set a key/value in a Record stored in class metadata */\nexport function setInMetaRecord<V>(\n key: MetaKey,\n target: object,\n recKey: string | number,\n recValue: V,\n): void {\n const inherited: Record<string | number, V> | undefined = Reflect.getOwnMetadata(key, target)\n const rec = inherited ? { ...inherited } : {}\n rec[recKey] = recValue\n Reflect.defineMetadata(key, rec, target)\n}\n\n/** Get a Record from class metadata (returns empty object if absent) */\nexport function getMetaRecord<V>(key: MetaKey, target: object): Record<string | number, V> {\n return Reflect.getMetadata(key, target) ?? {}\n}\n"],"mappings":";;;;;;;;;;;;;AAoBA,SAAgB,aAAgB,KAAc,OAAU,QAAsB;AAC5E,SAAQ,eAAe,KAAK,OAAO,OAAO;;;AAI5C,SAAgB,cAAiB,KAAc,OAAU,QAAgB,QAAsB;AAC7F,SAAQ,eAAe,KAAK,OAAO,QAAQ,OAAO;;;AAMpD,SAAgB,aAAgB,KAAc,QAAgB,UAAgB;AAC5E,QAAQ,QAAQ,YAAY,KAAK,OAAO,IAAU;;;AAIpD,SAAgB,cAAiB,KAAc,QAAgB,QAAgB,UAAgB;AAC7F,QAAQ,QAAQ,YAAY,KAAK,QAAQ,OAAO,IAAU;;;AAI5D,SAAgB,aAAa,KAAc,QAAyB;AAClE,QAAO,QAAQ,YAAY,KAAK,OAAO;;;AAIzC,SAAgB,wBAA2B,KAAc,QAA+B;AACtF,QAAO,QAAQ,YAAY,KAAK,OAAO;;;AAIzC,SAAgB,yBACd,KACA,QACA,QACe;AACf,QAAO,QAAQ,YAAY,KAAK,QAAQ,OAAO;;;AAMjD,SAAgB,cAAiB,KAAc,QAAgB,GAAG,OAAkB;CAClF,MAAM,WAAgB,QAAQ,eAAe,KAAK,OAAO,IAAI,EAAE;AAC/D,SAAQ,eAAe,KAAK,CAAC,GAAG,UAAU,GAAG,MAAM,EAAE,OAAO;;;AAI9D,SAAgB,eACd,KACA,QACA,QACA,GAAG,OACG;CACN,MAAM,WAAgB,QAAQ,eAAe,KAAK,QAAQ,OAAO,IAAI,EAAE;AACvE,SAAQ,eAAe,KAAK,CAAC,GAAG,UAAU,GAAG,MAAM,EAAE,QAAQ,OAAO;;;AAMtE,SAAgB,aAAmB,KAAc,QAAgB,QAAW,UAAmB;CAC7F,MAAM,YAAmC,QAAQ,eAAe,KAAK,OAAO;CAC5E,MAAM,MAAM,YAAY,IAAI,IAAI,UAAU,mBAAG,IAAI,KAAW;AAC5D,KAAI,IAAI,QAAQ,SAAS;AACzB,SAAQ,eAAe,KAAK,KAAK,OAAO;;;AAI1C,SAAgB,WAAiB,KAAc,QAA2B;AACxE,QAAO,QAAQ,YAAY,KAAK,OAAO,oBAAI,IAAI,KAAK;;;AAMtD,SAAgB,gBACd,KACA,QACA,QACA,UACM;CACN,MAAM,YAAoD,QAAQ,eAAe,KAAK,OAAO;CAC7F,MAAM,MAAM,YAAY,EAAE,GAAG,WAAW,GAAG,EAAE;AAC7C,KAAI,UAAU;AACd,SAAQ,eAAe,KAAK,KAAK,OAAO;;;AAI1C,SAAgB,cAAiB,KAAc,QAA4C;AACzF,QAAO,QAAQ,YAAY,KAAK,OAAO,IAAI,EAAE"}
1
+ {"version":3,"file":"metadata-DPLdmj1w.mjs","names":[],"sources":["../src/core/metadata.ts"],"sourcesContent":["import 'reflect-metadata'\nimport type { InjectionToken } from './token'\n\n/**\n * Typed utilities for reflect-metadata operations.\n *\n * Replaces scattered Reflect.defineMetadata/getMetadata calls with a single\n * source of truth. If we later move to Stage 3 decorators or a WeakMap-based\n * store, only this file changes — all 24+ consumer files stay untouched.\n *\n * Keys may be symbols, strings, or `InjectionToken<T>` objects produced by\n * `createToken()`. Using `createToken` is the preferred pattern because the\n * token's phantom type flows through the helpers, enabling type-safe reads.\n */\n\ntype MetaKey = symbol | string | InjectionToken<unknown>\n\n// ── Setters ─────────────────────────────────────────────────────\n\n/** Set metadata on a class (or prototype for property decorators) */\nexport function setClassMeta<T>(key: MetaKey, value: T, target: object): void {\n Reflect.defineMetadata(key, value, target)\n}\n\n/** Set metadata on a specific method */\nexport function setMethodMeta<T>(key: MetaKey, value: T, target: object, method: string): void {\n Reflect.defineMetadata(key, value, target, method)\n}\n\n// ── Getters ─────────────────────────────────────────────────────\n\n/** Get metadata from a class, returning `fallback` if not set */\nexport function getClassMeta<T>(key: MetaKey, target: object, fallback: T): T {\n return (Reflect.getMetadata(key, target) as T) ?? fallback\n}\n\n/** Get metadata from a specific method, returning `fallback` if not set */\nexport function getMethodMeta<T>(key: MetaKey, target: object, method: string, fallback: T): T {\n return (Reflect.getMetadata(key, target, method) as T) ?? fallback\n}\n\n/** Check if metadata exists on a class */\nexport function hasClassMeta(key: MetaKey, target: object): boolean {\n return Reflect.hasMetadata(key, target)\n}\n\n/** Get metadata from a class with no default (returns undefined if absent) */\nexport function getClassMetaOrUndefined<T>(key: MetaKey, target: object): T | undefined {\n return Reflect.getMetadata(key, target) as T | undefined\n}\n\n/** Get metadata from a method with no default (returns undefined if absent) */\nexport function getMethodMetaOrUndefined<T>(\n key: MetaKey,\n target: object,\n method: string,\n): T | undefined {\n return Reflect.getMetadata(key, target, method) as T | undefined\n}\n\n// ── Accumulate: Arrays ──────────────────────────────────────────\n\n/** Append items to an array stored in class metadata */\nexport function pushClassMeta<T>(key: MetaKey, target: object, ...items: T[]): void {\n const existing: T[] = Reflect.getOwnMetadata(key, target) ?? []\n Reflect.defineMetadata(key, [...existing, ...items], target)\n}\n\n/** Append items to an array stored in method metadata */\nexport function pushMethodMeta<T>(\n key: MetaKey,\n target: object,\n method: string,\n ...items: T[]\n): void {\n const existing: T[] = Reflect.getOwnMetadata(key, target, method) ?? []\n Reflect.defineMetadata(key, [...existing, ...items], target, method)\n}\n\n// ── Accumulate: Maps ────────────────────────────────────────────\n\n/** Set a key/value in a Map stored in class metadata */\nexport function setInMetaMap<K, V>(key: MetaKey, target: object, mapKey: K, mapValue: V): void {\n const inherited: Map<K, V> | undefined = Reflect.getOwnMetadata(key, target)\n const map = inherited ? new Map(inherited) : new Map<K, V>()\n map.set(mapKey, mapValue)\n Reflect.defineMetadata(key, map, target)\n}\n\n/** Get a Map from class metadata (returns empty Map if absent) */\nexport function getMetaMap<K, V>(key: MetaKey, target: object): Map<K, V> {\n return Reflect.getMetadata(key, target) ?? new Map()\n}\n\n// ── Accumulate: Records ─────────────────────────────────────────\n\n/** Set a key/value in a Record stored in class metadata */\nexport function setInMetaRecord<V>(\n key: MetaKey,\n target: object,\n recKey: string | number,\n recValue: V,\n): void {\n const inherited: Record<string | number, V> | undefined = Reflect.getOwnMetadata(key, target)\n const rec = inherited ? { ...inherited } : {}\n rec[recKey] = recValue\n Reflect.defineMetadata(key, rec, target)\n}\n\n/** Get a Record from class metadata (returns empty object if absent) */\nexport function getMetaRecord<V>(key: MetaKey, target: object): Record<string | number, V> {\n return Reflect.getMetadata(key, target) ?? {}\n}\n"],"mappings":";;;;;;;;;;;;;AAoBA,SAAgB,aAAgB,KAAc,OAAU,QAAsB;AAC5E,SAAQ,eAAe,KAAK,OAAO,OAAO;;;AAI5C,SAAgB,cAAiB,KAAc,OAAU,QAAgB,QAAsB;AAC7F,SAAQ,eAAe,KAAK,OAAO,QAAQ,OAAO;;;AAMpD,SAAgB,aAAgB,KAAc,QAAgB,UAAgB;AAC5E,QAAQ,QAAQ,YAAY,KAAK,OAAO,IAAU;;;AAIpD,SAAgB,cAAiB,KAAc,QAAgB,QAAgB,UAAgB;AAC7F,QAAQ,QAAQ,YAAY,KAAK,QAAQ,OAAO,IAAU;;;AAI5D,SAAgB,aAAa,KAAc,QAAyB;AA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orRegistrations } from "./context-decorator-DrPvQ9Ag.mjs";
4
- import { r as AppAdapter, s as KickJsPluginName } from "./adapter-6Pp4kFdM.mjs";
5
- import { n as AppModuleClass } from "./app-module-Blgz4Rti.mjs";
2
+ import { t as Container } from "./container-BZKeHc5X.mjs";
3
+ import { o as ContributorRegistrations } from "./context-decorator-Bca_BoRK.mjs";
4
+ import { r as AppAdapter, s as KickJsPluginName } from "./adapter-C1w_xt08.mjs";
5
+ import { n as AppModuleClass } from "./app-module-D6zL_V5S.mjs";
6
6
 
7
7
  //#region src/core/plugin.d.ts
8
8
  /**
@@ -162,4 +162,4 @@ interface KickPlugin {
162
162
  }
163
163
  //#endregion
164
164
  export { KickPlugin as t };
165
- //# sourceMappingURL=plugin-DDjoN4XI.d.mts.map
165
+ //# sourceMappingURL=plugin-DF8Xfv9Z.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-DDjoN4XI.d.mts","names":[],"sources":["../src/core/plugin.ts"],"mappings":";;;;;;;;AA0DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAAiB,UAAA;;EAEf,IAAA;;;;;;;;;;;;;;;;;;;EAoBA,SAAA,YAAqB,gBAAA;;;;;EAMrB,QAAA,EAAU,SAAA,EAAW,SAAA;;;;;EAMrB,OAAA,KAAY,cAAA;;;;;EAMZ,QAAA,KAAa,UAAA;;;;;EAMb,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCA,YAAA,KAAiB,wBAAA;;;;;EAMjB,OAAA,EAAS,SAAA,EAAW,SAAA,UAAmB,OAAA;;;;;EAMvC,QAAA,YAAoB,OAAA;;;;;;;;;;;;;EAcpB,UAAA,eAAyB,OAAA;;;;;;EAOzB,YAAA;AAAA"}
1
+ {"version":3,"file":"plugin-DF8Xfv9Z.d.mts","names":[],"sources":["../src/core/plugin.ts"],"mappings":";;;;;;;;AA0DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAAiB,UAAA;;EAEf,IAAA;;;;;;;;;;;;;;;;;;;EAoBA,SAAA,YAAqB,gBAAA;;;;;EAMrB,QAAA,EAAU,SAAA,EAAW,SAAA;;;;;EAMrB,OAAA,KAAY,cAAA;;;;;EAMZ,QAAA,KAAa,UAAA;;;;;EAMb,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCA,YAAA,KAAiB,wBAAA;;;;;EAMjB,OAAA,EAAS,SAAA,EAAW,SAAA,UAAmB,OAAA;;;;;EAMvC,QAAA,YAAoB,OAAA;;;;;;;;;;;;;EAcpB,UAAA,eAAyB,OAAA;;;;;;EAOzB,YAAA;AAAA"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs v5.0.2
2
+ * @forinda/kickjs v5.2.0
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -161,4 +161,4 @@ function buildQueryParams(parsed) {
161
161
  //#endregion
162
162
  export { parseSearchQuery as a, parseQuery as i, parseFilters as n, parseSort as o, parsePagination as r, FILTER_OPERATORS as s, buildQueryParams as t };
163
163
 
164
- //# sourceMappingURL=query-IvtMtXoI.mjs.map
164
+ //# sourceMappingURL=query-CD0AMqxx.mjs.map