@forinda/kickjs 5.3.0 → 5.5.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 (122) hide show
  1. package/dist/{adapter-C1w_xt08.d.mts → adapter-0r2uRCD3.d.mts} +2 -2
  2. package/dist/{adapter-C1w_xt08.d.mts.map → adapter-0r2uRCD3.d.mts.map} +1 -1
  3. package/dist/app-module-CzlIIjO3.d.mts +92 -0
  4. package/dist/app-module-CzlIIjO3.d.mts.map +1 -0
  5. package/dist/{application-BTRI4aBd.d.mts → application-CaEYca9E.d.mts} +34 -7
  6. package/dist/application-CaEYca9E.d.mts.map +1 -0
  7. package/dist/application-Zt956jNS.mjs +12 -0
  8. package/dist/application-Zt956jNS.mjs.map +1 -0
  9. package/dist/bootstrap-CmFQq1ar.mjs +12 -0
  10. package/dist/{bootstrap-kPcmbbWe.mjs.map → bootstrap-CmFQq1ar.mjs.map} +1 -1
  11. package/dist/{bootstrap-B4YrBipl.d.mts → bootstrap-Db8k2-21.d.mts} +2 -2
  12. package/dist/{bootstrap-B4YrBipl.d.mts.map → bootstrap-Db8k2-21.d.mts.map} +1 -1
  13. package/dist/config/index.mjs +2 -4
  14. package/dist/config-DDz5LuWw.mjs +12 -0
  15. package/dist/{config-DxEREQmR.mjs.map → config-DDz5LuWw.mjs.map} +1 -1
  16. package/dist/container-DrioVLNv.mjs +12 -0
  17. package/dist/{container-SMnB5yeT.mjs.map → container-DrioVLNv.mjs.map} +1 -1
  18. package/dist/context-B4BeGq1B.mjs +12 -0
  19. package/dist/context-B4BeGq1B.mjs.map +1 -0
  20. package/dist/{context-Ymvv-85x.d.mts → context-BAdAV-zO.d.mts} +48 -11
  21. package/dist/context-BAdAV-zO.d.mts.map +1 -0
  22. package/dist/{context-decorator-Bca_BoRK.d.mts → context-decorator-BgdDd-6X.d.mts} +19 -4
  23. package/dist/{context-decorator-Bca_BoRK.d.mts.map → context-decorator-BgdDd-6X.d.mts.map} +1 -1
  24. package/dist/core/adapter.d.mts +1 -1
  25. package/dist/core/adapter.mjs +2 -2
  26. package/dist/core/app-module.d.mts +2 -2
  27. package/dist/core/app-module.mjs +2 -2
  28. package/dist/core/cache.mjs +2 -103
  29. package/dist/core/cache.mjs.map +1 -1
  30. package/dist/core/container.mjs +2 -3
  31. package/dist/core/cron.mjs +2 -32
  32. package/dist/core/cron.mjs.map +1 -1
  33. package/dist/core/decorators.mjs +2 -285
  34. package/dist/core/decorators.mjs.map +1 -1
  35. package/dist/core/errors.mjs +2 -110
  36. package/dist/core/errors.mjs.map +1 -1
  37. package/dist/core/interfaces.mjs +2 -53
  38. package/dist/core/interfaces.mjs.map +1 -1
  39. package/dist/core/logger.mjs +2 -207
  40. package/dist/core/logger.mjs.map +1 -1
  41. package/dist/core/path.mjs +2 -35
  42. package/dist/core/path.mjs.map +1 -1
  43. package/dist/core/plugin.d.mts +1 -1
  44. package/dist/core/plugin.mjs +2 -2
  45. package/dist/core/reactivity.mjs +2 -179
  46. package/dist/core/reactivity.mjs.map +1 -1
  47. package/dist/core-MvABl8Cl.mjs +13 -0
  48. package/dist/core-MvABl8Cl.mjs.map +1 -0
  49. package/dist/env-CObTuGZ3.mjs +12 -0
  50. package/dist/{env-C4Yr6nN8.mjs.map → env-CObTuGZ3.mjs.map} +1 -1
  51. package/dist/http/application.d.mts +1 -1
  52. package/dist/http/application.mjs +2 -3
  53. package/dist/http/bootstrap.d.mts +1 -1
  54. package/dist/http/bootstrap.mjs +2 -3
  55. package/dist/http/context.d.mts +2 -2
  56. package/dist/http/context.mjs +2 -3
  57. package/dist/http/middleware/cors.mjs +2 -73
  58. package/dist/http/middleware/cors.mjs.map +1 -1
  59. package/dist/http/middleware/csrf.mjs +2 -62
  60. package/dist/http/middleware/csrf.mjs.map +1 -1
  61. package/dist/http/middleware/error-handler.mjs +2 -54
  62. package/dist/http/middleware/error-handler.mjs.map +1 -1
  63. package/dist/http/middleware/helmet.mjs +2 -41
  64. package/dist/http/middleware/helmet.mjs.map +1 -1
  65. package/dist/http/middleware/rate-limit.mjs +2 -91
  66. package/dist/http/middleware/rate-limit.mjs.map +1 -1
  67. package/dist/http/middleware/request-id.mjs +2 -25
  68. package/dist/http/middleware/request-id.mjs.map +1 -1
  69. package/dist/http/middleware/request-logger.mjs +2 -39
  70. package/dist/http/middleware/request-logger.mjs.map +1 -1
  71. package/dist/http/middleware/session.mjs +2 -167
  72. package/dist/http/middleware/session.mjs.map +1 -1
  73. package/dist/http/middleware/spa.d.mts +1 -1
  74. package/dist/http/middleware/spa.mjs +2 -98
  75. package/dist/http/middleware/spa.mjs.map +1 -1
  76. package/dist/http/middleware/upload.mjs +2 -181
  77. package/dist/http/middleware/upload.mjs.map +1 -1
  78. package/dist/http/middleware/validate.mjs +2 -68
  79. package/dist/http/middleware/validate.mjs.map +1 -1
  80. package/dist/http/middleware/views.d.mts +1 -1
  81. package/dist/http/middleware/views.mjs +2 -56
  82. package/dist/http/middleware/views.mjs.map +1 -1
  83. package/dist/http/query/index.mjs +2 -3
  84. package/dist/http/router-builder.d.mts +1 -1
  85. package/dist/http/router-builder.mjs +2 -105
  86. package/dist/http/router-builder.mjs.map +1 -1
  87. package/dist/{index-DvZfBNIf.d.mts → index-D-Wb23e6.d.mts} +264 -86
  88. package/dist/index-D-Wb23e6.d.mts.map +1 -0
  89. package/dist/index.d.mts +12 -12
  90. package/dist/index.mjs +2 -171
  91. package/dist/index.mjs.map +1 -1
  92. package/dist/metadata-WTmSU6Sf.mjs +12 -0
  93. package/dist/{metadata-CdYaU-XM.mjs.map → metadata-WTmSU6Sf.mjs.map} +1 -1
  94. package/dist/{plugin-DF8Xfv9Z.d.mts → plugin-JMkG7soG.d.mts} +102 -8
  95. package/dist/plugin-JMkG7soG.d.mts.map +1 -0
  96. package/dist/query-BmO0aBf6.mjs +12 -0
  97. package/dist/{query-nAYUgagU.mjs.map → query-BmO0aBf6.mjs.map} +1 -1
  98. package/dist/{router-builder-C7sXk_FG.d.mts → router-builder-CaQ629tw.d.mts} +2 -2
  99. package/dist/{router-builder-C7sXk_FG.d.mts.map → router-builder-CaQ629tw.d.mts.map} +1 -1
  100. package/dist/{spa-e4FIS2RB.d.mts → spa-CreyQc4N.d.mts} +2 -2
  101. package/dist/{spa-e4FIS2RB.d.mts.map → spa-CreyQc4N.d.mts.map} +1 -1
  102. package/dist/{views-DkNp9JJs.d.mts → views-1e3jQr5C.d.mts} +4 -4
  103. package/dist/{views-DkNp9JJs.d.mts.map → views-1e3jQr5C.d.mts.map} +1 -1
  104. package/package.json +2 -2
  105. package/dist/app-module-D6zL_V5S.d.mts +0 -50
  106. package/dist/app-module-D6zL_V5S.d.mts.map +0 -1
  107. package/dist/application-BTRI4aBd.d.mts.map +0 -1
  108. package/dist/application-Cna_2gex.mjs +0 -574
  109. package/dist/application-Cna_2gex.mjs.map +0 -1
  110. package/dist/bootstrap-kPcmbbWe.mjs +0 -195
  111. package/dist/config-DxEREQmR.mjs +0 -135
  112. package/dist/container-SMnB5yeT.mjs +0 -897
  113. package/dist/context-B0B3WQft.mjs +0 -348
  114. package/dist/context-B0B3WQft.mjs.map +0 -1
  115. package/dist/context-Ymvv-85x.d.mts.map +0 -1
  116. package/dist/core--a4XflX7.mjs +0 -820
  117. package/dist/core--a4XflX7.mjs.map +0 -1
  118. package/dist/env-C4Yr6nN8.mjs +0 -137
  119. package/dist/index-DvZfBNIf.d.mts.map +0 -1
  120. package/dist/metadata-CdYaU-XM.mjs +0 -76
  121. package/dist/plugin-DF8Xfv9Z.d.mts.map +0 -1
  122. package/dist/query-nAYUgagU.mjs +0 -164
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs v5.3.0
2
+ * @forinda/kickjs v5.5.0
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,59 +8,5 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import { Logger } from "../../core/logger.mjs";
12
- import { n as defineAdapter } from "../../core--a4XflX7.mjs";
13
- import { resolve } from "node:path";
14
- //#region src/http/middleware/views.ts
15
- const log = Logger.for("ViewEngine");
16
- /**
17
- * View/template adapter — pluggable template engine support for KickJS.
18
- *
19
- * Registers an Express view engine and sets the views directory.
20
- * Use `ctx.render()` in controllers to render templates.
21
- *
22
- * Migrated to the `defineAdapter()` factory in v4 — call without `new`.
23
- * The pre-v4 `new ViewAdapter({...})` form is gone; see
24
- * `docs/guide/migration-v3-to-v4.md` for the rename.
25
- *
26
- * @example
27
- * ```ts
28
- * import ejs from 'ejs'
29
- * import { ViewAdapter } from '@forinda/kickjs'
30
- *
31
- * bootstrap({
32
- * modules,
33
- * adapters: [
34
- * ViewAdapter({ engine: ejs, ext: 'ejs', viewsDir: 'src/views' }),
35
- * ],
36
- * })
37
- *
38
- * // In a controller:
39
- * @Get('/dashboard')
40
- * async dashboard(ctx: RequestContext) {
41
- * ctx.render('dashboard', { user: currentUser, title: 'Dashboard' })
42
- * }
43
- * ```
44
- */
45
- const ViewAdapter = defineAdapter({
46
- name: "ViewAdapter",
47
- build: (options) => ({ beforeMount({ app }) {
48
- const { engine, ext, viewsDir = "src/views" } = options;
49
- if (engine.__express) app.engine(ext, engine.__express);
50
- else if (typeof engine.renderFile === "function") app.engine(ext, (path, opts, callback) => {
51
- engine.renderFile(path, opts, callback);
52
- });
53
- else if (typeof engine === "function") app.engine(ext, engine);
54
- else {
55
- log.warn(`Engine for .${ext} does not have __express or renderFile. Trying as-is.`);
56
- app.engine(ext, engine);
57
- }
58
- app.set("view engine", ext);
59
- app.set("views", resolve(viewsDir));
60
- log.debug(`View engine: ${ext} (${resolve(viewsDir)})`);
61
- } })
62
- });
63
- //#endregion
64
- export { ViewAdapter };
65
-
11
+ import{Logger}from"../../core/logger.mjs";import{n as defineAdapter}from"../../core-MvABl8Cl.mjs";import{resolve}from"node:path";const log=Logger.for(`ViewEngine`),ViewAdapter=defineAdapter({name:`ViewAdapter`,build:options=>({beforeMount({app}){let{engine,ext,viewsDir=`src/views`}=options;engine.__express?app.engine(ext,engine.__express):typeof engine.renderFile==`function`?app.engine(ext,(path,opts,callback)=>{engine.renderFile(path,opts,callback)}):(typeof engine==`function`||log.warn(`Engine for .${ext} does not have __express or renderFile. Trying as-is.`),app.engine(ext,engine)),app.set(`view engine`,ext),app.set(`views`,resolve(viewsDir)),log.debug(`View engine: ${ext} (${resolve(viewsDir)})`)}})});export{ViewAdapter};
66
12
  //# sourceMappingURL=views.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"views.mjs","names":[],"sources":["../../../src/http/middleware/views.ts"],"sourcesContent":["import { resolve } from 'node:path'\nimport { Logger, defineAdapter } from '../../core'\n\nconst log = Logger.for('ViewEngine')\n\nexport interface ViewAdapterOptions {\n /**\n * Template engine — pass the engine module or a render function.\n * Supported engines: ejs, pug, handlebars, nunjucks, or any\n * Express-compatible engine with a __express property.\n *\n * @example\n * ```ts\n * import ejs from 'ejs'\n * ViewAdapter({ engine: ejs, ext: 'ejs' })\n *\n * import pug from 'pug'\n * ViewAdapter({ engine: pug, ext: 'pug' })\n * ```\n */\n engine: any\n\n /** File extension for templates (e.g., 'ejs', 'pug', 'hbs') */\n ext: string\n\n /** Directory containing template files (default: 'src/views') */\n viewsDir?: string\n\n /** Default layout template (optional — depends on engine) */\n layout?: string\n}\n\n/**\n * View/template adapter — pluggable template engine support for KickJS.\n *\n * Registers an Express view engine and sets the views directory.\n * Use `ctx.render()` in controllers to render templates.\n *\n * Migrated to the `defineAdapter()` factory in v4 — call without `new`.\n * The pre-v4 `new ViewAdapter({...})` form is gone; see\n * `docs/guide/migration-v3-to-v4.md` for the rename.\n *\n * @example\n * ```ts\n * import ejs from 'ejs'\n * import { ViewAdapter } from '@forinda/kickjs'\n *\n * bootstrap({\n * modules,\n * adapters: [\n * ViewAdapter({ engine: ejs, ext: 'ejs', viewsDir: 'src/views' }),\n * ],\n * })\n *\n * // In a controller:\n * @Get('/dashboard')\n * async dashboard(ctx: RequestContext) {\n * ctx.render('dashboard', { user: currentUser, title: 'Dashboard' })\n * }\n * ```\n */\nexport const ViewAdapter = defineAdapter<ViewAdapterOptions>({\n name: 'ViewAdapter',\n build: (options) => ({\n beforeMount({ app }) {\n const { engine, ext, viewsDir = 'src/views' } = options\n\n // Register the engine. Three resolution paths cover every\n // mainstream template engine + a fall-through for custom ones.\n if (engine.__express) {\n // EJS, Pug — have __express method\n app.engine(ext, engine.__express)\n } else if (typeof engine.renderFile === 'function') {\n // Engines with renderFile (nunjucks-style)\n app.engine(\n ext,\n (path: string, opts: any, callback: (err: Error | null, html?: string) => void) => {\n engine.renderFile(path, opts, callback)\n },\n )\n } else if (typeof engine === 'function') {\n // Custom render function: (path, options, callback) => void\n app.engine(ext, engine)\n } else {\n log.warn(`Engine for .${ext} does not have __express or renderFile. Trying as-is.`)\n app.engine(ext, engine)\n }\n\n app.set('view engine', ext)\n app.set('views', resolve(viewsDir))\n\n log.debug(`View engine: ${ext} (${resolve(viewsDir)})`)\n },\n }),\n})\n"],"mappings":";;;;;;;;;;;;;;AAGA,MAAM,MAAM,OAAO,IAAI,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DpC,MAAa,cAAc,cAAkC;CAC3D,MAAM;CACN,QAAQ,aAAa,EACnB,YAAY,EAAE,OAAO;EACnB,MAAM,EAAE,QAAQ,KAAK,WAAW,gBAAgB;AAIhD,MAAI,OAAO,UAET,KAAI,OAAO,KAAK,OAAO,UAAU;WACxB,OAAO,OAAO,eAAe,WAEtC,KAAI,OACF,MACC,MAAc,MAAW,aAAyD;AACjF,UAAO,WAAW,MAAM,MAAM,SAAS;IAE1C;WACQ,OAAO,WAAW,WAE3B,KAAI,OAAO,KAAK,OAAO;OAClB;AACL,OAAI,KAAK,eAAe,IAAI,uDAAuD;AACnF,OAAI,OAAO,KAAK,OAAO;;AAGzB,MAAI,IAAI,eAAe,IAAI;AAC3B,MAAI,IAAI,SAAS,QAAQ,SAAS,CAAC;AAEnC,MAAI,MAAM,gBAAgB,IAAI,IAAI,QAAQ,SAAS,CAAC,GAAG;IAE1D;CACF,CAAC"}
1
+ {"version":3,"file":"views.mjs","names":[],"sources":["../../../src/http/middleware/views.ts"],"sourcesContent":["import { resolve } from 'node:path'\nimport { Logger, defineAdapter } from '../../core'\n\nconst log = Logger.for('ViewEngine')\n\nexport interface ViewAdapterOptions {\n /**\n * Template engine — pass the engine module or a render function.\n * Supported engines: ejs, pug, handlebars, nunjucks, or any\n * Express-compatible engine with a __express property.\n *\n * @example\n * ```ts\n * import ejs from 'ejs'\n * ViewAdapter({ engine: ejs, ext: 'ejs' })\n *\n * import pug from 'pug'\n * ViewAdapter({ engine: pug, ext: 'pug' })\n * ```\n */\n engine: any\n\n /** File extension for templates (e.g., 'ejs', 'pug', 'hbs') */\n ext: string\n\n /** Directory containing template files (default: 'src/views') */\n viewsDir?: string\n\n /** Default layout template (optional — depends on engine) */\n layout?: string\n}\n\n/**\n * View/template adapter — pluggable template engine support for KickJS.\n *\n * Registers an Express view engine and sets the views directory.\n * Use `ctx.render()` in controllers to render templates.\n *\n * Migrated to the `defineAdapter()` factory in v4 — call without `new`.\n * The pre-v4 `new ViewAdapter({...})` form is gone; see\n * `docs/guide/migration-v3-to-v4.md` for the rename.\n *\n * @example\n * ```ts\n * import ejs from 'ejs'\n * import { ViewAdapter } from '@forinda/kickjs'\n *\n * bootstrap({\n * modules,\n * adapters: [\n * ViewAdapter({ engine: ejs, ext: 'ejs', viewsDir: 'src/views' }),\n * ],\n * })\n *\n * // In a controller:\n * @Get('/dashboard')\n * async dashboard(ctx: RequestContext) {\n * ctx.render('dashboard', { user: currentUser, title: 'Dashboard' })\n * }\n * ```\n */\nexport const ViewAdapter = defineAdapter<ViewAdapterOptions>({\n name: 'ViewAdapter',\n build: (options) => ({\n beforeMount({ app }) {\n const { engine, ext, viewsDir = 'src/views' } = options\n\n // Register the engine. Three resolution paths cover every\n // mainstream template engine + a fall-through for custom ones.\n if (engine.__express) {\n // EJS, Pug — have __express method\n app.engine(ext, engine.__express)\n } else if (typeof engine.renderFile === 'function') {\n // Engines with renderFile (nunjucks-style)\n app.engine(\n ext,\n (path: string, opts: any, callback: (err: Error | null, html?: string) => void) => {\n engine.renderFile(path, opts, callback)\n },\n )\n } else if (typeof engine === 'function') {\n // Custom render function: (path, options, callback) => void\n app.engine(ext, engine)\n } else {\n log.warn(`Engine for .${ext} does not have __express or renderFile. Trying as-is.`)\n app.engine(ext, engine)\n }\n\n app.set('view engine', ext)\n app.set('views', resolve(viewsDir))\n\n log.debug(`View engine: ${ext} (${resolve(viewsDir)})`)\n },\n }),\n})\n"],"mappings":";;;;;;;;;;iIAGA,MAAM,IAAM,OAAO,IAAI,aAAa,CA0DvB,YAAc,cAAkC,CAC3D,KAAM,cACN,MAAQ,UAAa,CACnB,YAAY,CAAE,KAAO,CACnB,GAAM,CAAE,OAAQ,IAAK,SAAW,aAAgB,QAI5C,OAAO,UAET,IAAI,OAAO,IAAK,OAAO,UAAU,CACxB,OAAO,OAAO,YAAe,WAEtC,IAAI,OACF,KACC,KAAc,KAAW,WAAyD,CACjF,OAAO,WAAW,KAAM,KAAM,SAAS,EAE1C,EACQ,OAAO,QAAW,YAI3B,IAAI,KAAK,eAAe,IAAI,uDAAuD,CAFnF,IAAI,OAAO,IAAK,OAAO,EAMzB,IAAI,IAAI,cAAe,IAAI,CAC3B,IAAI,IAAI,QAAS,QAAQ,SAAS,CAAC,CAEnC,IAAI,MAAM,gBAAgB,IAAI,IAAI,QAAQ,SAAS,CAAC,GAAG,EAE1D,EACF,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs v5.3.0
2
+ * @forinda/kickjs v5.5.0
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,5 +8,4 @@
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-nAYUgagU.mjs";
12
- export { FILTER_OPERATORS, buildQueryParams, parseFilters, parsePagination, parseQuery, parseSearchQuery, parseSort };
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-BmO0aBf6.mjs";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-C7sXk_FG.mjs";
2
+ import { n as _setExternalContributorSources, r as buildRoutes, t as BuildRoutesOptions } from "../router-builder-CaQ629tw.mjs";
3
3
  export { BuildRoutesOptions, _setExternalContributorSources, buildRoutes };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs v5.3.0
2
+ * @forinda/kickjs v5.5.0
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,108 +8,5 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import { t as Container } from "../container-SMnB5yeT.mjs";
12
- import { METADATA } from "../core/interfaces.mjs";
13
- import { a as getMethodMeta, o as getMethodMetaOrUndefined, t as getClassMeta } from "../metadata-CdYaU-XM.mjs";
14
- import { c as runContributors, l as buildPipeline } from "../core--a4XflX7.mjs";
15
- import { t as RequestContext } from "../context-B0B3WQft.mjs";
16
- import { validate } from "./middleware/validate.mjs";
17
- import { buildUploadMiddleware } from "./middleware/upload.mjs";
18
- import { Router } from "express";
19
- //#region src/http/router-builder.ts
20
- /**
21
- * Per-module SourcedRegistration[] threaded through the route-mount loop by
22
- * Application.setup(). Carries module + adapter + global contributors so
23
- * buildRoutes() can merge them with class + method ones into a single pipeline.
24
- *
25
- * Module setup is sequential, so this slot is race-free. Cleared in a finally
26
- * block after each module mounts. Outside of Application setup the slot is
27
- * empty — direct buildRoutes() callers (mostly tests) see only class + method
28
- * contributors unless they pass `externalSources` explicitly.
29
- *
30
- * Same idiom as `Container._requestStoreProvider` and `Logger._contextProvider`:
31
- * an internal escape hatch for cross-module wiring without inversion-of-control
32
- * gymnastics.
33
- *
34
- * @internal
35
- */
36
- let _externalContributorSources = [];
37
- /** @internal — set by Application.setup() before each `mod.routes()` call. */
38
- function _setExternalContributorSources(sources) {
39
- _externalContributorSources = sources;
40
- }
41
- /**
42
- * Build an Express Router from a controller class decorated with @Get, @Post, etc.
43
- * Resolves the controller from the DI container, wraps handlers in RequestContext,
44
- * and applies class-level and method-level middleware.
45
- *
46
- * Routes are registered using only the method-level decorator paths (e.g. @Get('/me') → '/me').
47
- * The @Controller path is NOT baked into the router — it serves as metadata only
48
- * (used by Swagger and other adapters for introspection).
49
- * The module's routes().path is the single source of truth for the mount prefix,
50
- * which avoids path doubling when both the module and controller specify the same path.
51
- */
52
- function buildRoutes(controllerClass, options = {}) {
53
- const router = Router();
54
- const container = Container.getInstance();
55
- const externalSources = options.externalSources ?? _externalContributorSources;
56
- const routes = getClassMeta(METADATA.ROUTES, controllerClass, []);
57
- const classMiddlewares = getClassMeta(METADATA.CLASS_MIDDLEWARES, controllerClass, []);
58
- const classContributors = getClassMeta(METADATA.CLASS_CONTRIBUTORS, controllerClass, []);
59
- for (const route of routes) {
60
- const method = route.method.toLowerCase();
61
- const fullPath = route.path || "/";
62
- const methodMiddlewares = getMethodMeta(METADATA.METHOD_MIDDLEWARES, controllerClass, route.handlerName, []);
63
- const handlers = [];
64
- if (route.validation) handlers.push(validate(route.validation));
65
- const fileUploadConfig = getMethodMetaOrUndefined(METADATA.FILE_UPLOAD, controllerClass, route.handlerName);
66
- if (fileUploadConfig) handlers.push(buildUploadMiddleware(fileUploadConfig));
67
- for (const mw of [...classMiddlewares, ...methodMiddlewares]) handlers.push((req, res, next) => {
68
- const ctx = new RequestContext(req, res, next);
69
- Promise.resolve(mw(ctx, next)).catch(next);
70
- });
71
- const methodContributors = getMethodMeta(METADATA.METHOD_CONTRIBUTORS, controllerClass, route.handlerName, []);
72
- if (classContributors.length > 0 || methodContributors.length > 0 || externalSources.length > 0) {
73
- const pipeline = buildPipeline([
74
- ...methodContributors.map((registration, i) => ({
75
- source: "method",
76
- registration,
77
- label: `${controllerClass.name}.${String(route.handlerName)}#${i}(${registration.key})`
78
- })),
79
- ...classContributors.map((registration, i) => ({
80
- source: "class",
81
- registration,
82
- label: `${controllerClass.name}.@class#${i}(${registration.key})`
83
- })),
84
- ...externalSources
85
- ], { route: `${route.method.toUpperCase()} ${fullPath}` });
86
- handlers.push(async (req, res, next) => {
87
- const ctx = new RequestContext(req, res, next);
88
- try {
89
- await runContributors({
90
- pipeline,
91
- ctx,
92
- container
93
- });
94
- next();
95
- } catch (err) {
96
- next(err);
97
- }
98
- });
99
- }
100
- handlers.push(async (req, res, next) => {
101
- const ctx = new RequestContext(req, res, next);
102
- try {
103
- await container.resolve(controllerClass)[route.handlerName](ctx);
104
- } catch (err) {
105
- next(err);
106
- }
107
- });
108
- router[method](fullPath, ...handlers);
109
- }
110
- return router;
111
- }
112
- //#endregion
113
- export { _setExternalContributorSources, buildRoutes };
114
-
11
+ import{t as Container}from"../container-DrioVLNv.mjs";import{METADATA}from"../core/interfaces.mjs";import{a as getMethodMeta,o as getMethodMetaOrUndefined,t as getClassMeta}from"../metadata-WTmSU6Sf.mjs";import{c as runContributors,l as buildPipeline}from"../core-MvABl8Cl.mjs";import{t as RequestContext}from"../context-B4BeGq1B.mjs";import{validate}from"./middleware/validate.mjs";import{buildUploadMiddleware}from"./middleware/upload.mjs";import{Router}from"express";let _externalContributorSources=[];function _setExternalContributorSources(sources){_externalContributorSources=sources}function buildRoutes(controllerClass,options={}){let router=Router(),container=Container.getInstance(),externalSources=options.externalSources??_externalContributorSources,routes=getClassMeta(METADATA.ROUTES,controllerClass,[]),classMiddlewares=getClassMeta(METADATA.CLASS_MIDDLEWARES,controllerClass,[]),classContributors=getClassMeta(METADATA.CLASS_CONTRIBUTORS,controllerClass,[]);for(let route of routes){let method=route.method.toLowerCase(),fullPath=route.path||`/`,methodMiddlewares=getMethodMeta(METADATA.METHOD_MIDDLEWARES,controllerClass,route.handlerName,[]),handlers=[];route.validation&&handlers.push(validate(route.validation));let fileUploadConfig=getMethodMetaOrUndefined(METADATA.FILE_UPLOAD,controllerClass,route.handlerName);fileUploadConfig&&handlers.push(buildUploadMiddleware(fileUploadConfig));for(let mw of[...classMiddlewares,...methodMiddlewares])handlers.push((req,res,next)=>{let ctx=new RequestContext(req,res,next);Promise.resolve(mw(ctx,next)).catch(next)});let methodContributors=getMethodMeta(METADATA.METHOD_CONTRIBUTORS,controllerClass,route.handlerName,[]);if(classContributors.length>0||methodContributors.length>0||externalSources.length>0){let pipeline=buildPipeline([...methodContributors.map((registration,i)=>({source:`method`,registration,label:`${controllerClass.name}.${String(route.handlerName)}#${i}(${registration.key})`})),...classContributors.map((registration,i)=>({source:`class`,registration,label:`${controllerClass.name}.@class#${i}(${registration.key})`})),...externalSources],{route:`${route.method.toUpperCase()} ${fullPath}`});handlers.push(async(req,res,next)=>{let ctx=new RequestContext(req,res,next);try{await runContributors({pipeline,ctx,container}),next()}catch(err){next(err)}})}handlers.push(async(req,res,next)=>{let ctx=new RequestContext(req,res,next);try{await container.resolve(controllerClass)[route.handlerName](ctx)}catch(err){next(err)}}),router[method](fullPath,...handlers)}return router}export{_setExternalContributorSources,buildRoutes};
115
12
  //# sourceMappingURL=router-builder.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"router-builder.mjs","names":[],"sources":["../../src/http/router-builder.ts"],"sourcesContent":["import { Router, type Request, type Response, type NextFunction } from 'express'\nimport {\n buildPipeline,\n Container,\n METADATA,\n runContributors,\n type ContributorRegistration,\n type FileUploadConfig,\n type MiddlewareHandler,\n type RouteDefinition,\n type SourcedRegistration,\n} from '../core'\nimport { getClassMeta, getMethodMeta, getMethodMetaOrUndefined } from '../core/metadata'\nimport { RequestContext } from './context'\nimport { validate } from './middleware/validate'\nimport { buildUploadMiddleware } from './middleware/upload'\n\n/**\n * Per-module SourcedRegistration[] threaded through the route-mount loop by\n * Application.setup(). Carries module + adapter + global contributors so\n * buildRoutes() can merge them with class + method ones into a single pipeline.\n *\n * Module setup is sequential, so this slot is race-free. Cleared in a finally\n * block after each module mounts. Outside of Application setup the slot is\n * empty — direct buildRoutes() callers (mostly tests) see only class + method\n * contributors unless they pass `externalSources` explicitly.\n *\n * Same idiom as `Container._requestStoreProvider` and `Logger._contextProvider`:\n * an internal escape hatch for cross-module wiring without inversion-of-control\n * gymnastics.\n *\n * @internal\n */\nlet _externalContributorSources: readonly SourcedRegistration[] = []\n\n/** @internal — set by Application.setup() before each `mod.routes()` call. */\nexport function _setExternalContributorSources(sources: readonly SourcedRegistration[]): void {\n _externalContributorSources = sources\n}\n\nexport interface BuildRoutesOptions {\n /**\n * Extra contributors to merge into the per-route pipeline at their declared\n * precedence levels. Pass explicitly when calling buildRoutes outside the\n * Application route-mount loop (typically in tests). When omitted, falls\n * back to the slot set by Application.setup().\n */\n externalSources?: readonly SourcedRegistration[]\n}\n\n/**\n * Build an Express Router from a controller class decorated with @Get, @Post, etc.\n * Resolves the controller from the DI container, wraps handlers in RequestContext,\n * and applies class-level and method-level middleware.\n *\n * Routes are registered using only the method-level decorator paths (e.g. @Get('/me') → '/me').\n * The @Controller path is NOT baked into the router — it serves as metadata only\n * (used by Swagger and other adapters for introspection).\n * The module's routes().path is the single source of truth for the mount prefix,\n * which avoids path doubling when both the module and controller specify the same path.\n */\nexport function buildRoutes(controllerClass: any, options: BuildRoutesOptions = {}): Router {\n const router = Router()\n const container = Container.getInstance()\n const externalSources = options.externalSources ?? _externalContributorSources\n const routes: RouteDefinition[] = getClassMeta<RouteDefinition[]>(\n METADATA.ROUTES,\n controllerClass,\n [],\n )\n\n // Class-level middleware\n const classMiddlewares: MiddlewareHandler[] = getClassMeta<MiddlewareHandler[]>(\n METADATA.CLASS_MIDDLEWARES,\n controllerClass,\n [],\n )\n\n // Class-level Context Contributors (#107) — applied to every method on the\n // controller. Method-level contributors are added per-route below.\n const classContributors: ContributorRegistration[] = getClassMeta<ContributorRegistration[]>(\n METADATA.CLASS_CONTRIBUTORS,\n controllerClass,\n [],\n )\n\n for (const route of routes) {\n const method = route.method.toLowerCase() as 'get' | 'post' | 'put' | 'delete' | 'patch'\n const fullPath = route.path || '/'\n\n // Method-level middleware\n const methodMiddlewares: MiddlewareHandler[] = getMethodMeta<MiddlewareHandler[]>(\n METADATA.METHOD_MIDDLEWARES,\n controllerClass,\n route.handlerName,\n [],\n )\n\n // Build handler chain\n const handlers: any[] = []\n\n // Validation middleware (shared with standalone validate() export)\n if (route.validation) {\n handlers.push(validate(route.validation))\n }\n\n // @FileUpload decorator — auto-attach upload middleware from metadata\n const fileUploadConfig = getMethodMetaOrUndefined<FileUploadConfig>(\n METADATA.FILE_UPLOAD,\n controllerClass,\n route.handlerName,\n )\n if (fileUploadConfig) {\n handlers.push(buildUploadMiddleware(fileUploadConfig))\n }\n\n // Class + method middleware (wrapped as Express middleware with error catching)\n for (const mw of [...classMiddlewares, ...methodMiddlewares]) {\n handlers.push((req: Request, res: Response, next: NextFunction) => {\n const ctx = new RequestContext(req, res, next)\n Promise.resolve(mw(ctx, next)).catch(next)\n })\n }\n\n // Context Contributor pipeline (#107) — class + method contributors,\n // built once at mount time so cycle/missing-dep failures abort boot.\n const methodContributors: ContributorRegistration[] = getMethodMeta<ContributorRegistration[]>(\n METADATA.METHOD_CONTRIBUTORS,\n controllerClass,\n route.handlerName,\n [],\n )\n\n if (\n classContributors.length > 0 ||\n methodContributors.length > 0 ||\n externalSources.length > 0\n ) {\n // Labels are surfaced in DuplicateContributorError messages — include\n // the registration's key + the original index so a same-key collision\n // at one precedence level points at the conflicting decorator slot,\n // not just the host method/class.\n const sources: SourcedRegistration[] = [\n ...methodContributors.map(\n (registration, i): SourcedRegistration => ({\n source: 'method',\n registration,\n label: `${controllerClass.name}.${String(route.handlerName)}#${i}(${registration.key})`,\n }),\n ),\n ...classContributors.map(\n (registration, i): SourcedRegistration => ({\n source: 'class',\n registration,\n label: `${controllerClass.name}.@class#${i}(${registration.key})`,\n }),\n ),\n ...externalSources,\n ]\n const pipeline = buildPipeline(sources, {\n route: `${route.method.toUpperCase()} ${fullPath}`,\n })\n\n handlers.push(async (req: Request, res: Response, next: NextFunction) => {\n const ctx = new RequestContext(req, res, next)\n try {\n await runContributors({ pipeline, ctx, container })\n next()\n } catch (err) {\n next(err)\n }\n })\n }\n\n // Main handler — resolve controller per-request to respect DI scoping\n handlers.push(async (req: Request, res: Response, next: NextFunction) => {\n const ctx = new RequestContext(req, res, next)\n try {\n const controller = container.resolve(controllerClass)\n await controller[route.handlerName](ctx)\n } catch (err: any) {\n next(err)\n }\n })\n ;(router as any)[method](fullPath, ...handlers)\n }\n\n return router\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,IAAI,8BAA8D,EAAE;;AAGpE,SAAgB,+BAA+B,SAA+C;AAC5F,+BAA8B;;;;;;;;;;;;;AAwBhC,SAAgB,YAAY,iBAAsB,UAA8B,EAAE,EAAU;CAC1F,MAAM,SAAS,QAAQ;CACvB,MAAM,YAAY,UAAU,aAAa;CACzC,MAAM,kBAAkB,QAAQ,mBAAmB;CACnD,MAAM,SAA4B,aAChC,SAAS,QACT,iBACA,EAAE,CACH;CAGD,MAAM,mBAAwC,aAC5C,SAAS,mBACT,iBACA,EAAE,CACH;CAID,MAAM,oBAA+C,aACnD,SAAS,oBACT,iBACA,EAAE,CACH;AAED,MAAK,MAAM,SAAS,QAAQ;EAC1B,MAAM,SAAS,MAAM,OAAO,aAAa;EACzC,MAAM,WAAW,MAAM,QAAQ;EAG/B,MAAM,oBAAyC,cAC7C,SAAS,oBACT,iBACA,MAAM,aACN,EAAE,CACH;EAGD,MAAM,WAAkB,EAAE;AAG1B,MAAI,MAAM,WACR,UAAS,KAAK,SAAS,MAAM,WAAW,CAAC;EAI3C,MAAM,mBAAmB,yBACvB,SAAS,aACT,iBACA,MAAM,YACP;AACD,MAAI,iBACF,UAAS,KAAK,sBAAsB,iBAAiB,CAAC;AAIx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.mjs","names":[],"sources":["../../src/http/router-builder.ts"],"sourcesContent":["import { Router, type Request, type Response, type NextFunction } from 'express'\nimport {\n buildPipeline,\n Container,\n METADATA,\n runContributors,\n type ContributorRegistration,\n type FileUploadConfig,\n type MiddlewareHandler,\n type RouteDefinition,\n type SourcedRegistration,\n} from '../core'\nimport { getClassMeta, getMethodMeta, getMethodMetaOrUndefined } from '../core/metadata'\nimport { RequestContext } from './context'\nimport { validate } from './middleware/validate'\nimport { buildUploadMiddleware } from './middleware/upload'\n\n/**\n * Per-module SourcedRegistration[] threaded through the route-mount loop by\n * Application.setup(). Carries module + adapter + global contributors so\n * buildRoutes() can merge them with class + method ones into a single pipeline.\n *\n * Module setup is sequential, so this slot is race-free. Cleared in a finally\n * block after each module mounts. Outside of Application setup the slot is\n * empty — direct buildRoutes() callers (mostly tests) see only class + method\n * contributors unless they pass `externalSources` explicitly.\n *\n * Same idiom as `Container._requestStoreProvider` and `Logger._contextProvider`:\n * an internal escape hatch for cross-module wiring without inversion-of-control\n * gymnastics.\n *\n * @internal\n */\nlet _externalContributorSources: readonly SourcedRegistration[] = []\n\n/** @internal — set by Application.setup() before each `mod.routes()` call. */\nexport function _setExternalContributorSources(sources: readonly SourcedRegistration[]): void {\n _externalContributorSources = sources\n}\n\nexport interface BuildRoutesOptions {\n /**\n * Extra contributors to merge into the per-route pipeline at their declared\n * precedence levels. Pass explicitly when calling buildRoutes outside the\n * Application route-mount loop (typically in tests). When omitted, falls\n * back to the slot set by Application.setup().\n */\n externalSources?: readonly SourcedRegistration[]\n}\n\n/**\n * Build an Express Router from a controller class decorated with @Get, @Post, etc.\n * Resolves the controller from the DI container, wraps handlers in RequestContext,\n * and applies class-level and method-level middleware.\n *\n * Routes are registered using only the method-level decorator paths (e.g. @Get('/me') → '/me').\n * The @Controller path is NOT baked into the router — it serves as metadata only\n * (used by Swagger and other adapters for introspection).\n * The module's routes().path is the single source of truth for the mount prefix,\n * which avoids path doubling when both the module and controller specify the same path.\n */\nexport function buildRoutes(controllerClass: any, options: BuildRoutesOptions = {}): Router {\n const router = Router()\n const container = Container.getInstance()\n const externalSources = options.externalSources ?? _externalContributorSources\n const routes: RouteDefinition[] = getClassMeta<RouteDefinition[]>(\n METADATA.ROUTES,\n controllerClass,\n [],\n )\n\n // Class-level middleware\n const classMiddlewares: MiddlewareHandler[] = getClassMeta<MiddlewareHandler[]>(\n METADATA.CLASS_MIDDLEWARES,\n controllerClass,\n [],\n )\n\n // Class-level Context Contributors (#107) — applied to every method on the\n // controller. Method-level contributors are added per-route below.\n const classContributors: ContributorRegistration[] = getClassMeta<ContributorRegistration[]>(\n METADATA.CLASS_CONTRIBUTORS,\n controllerClass,\n [],\n )\n\n for (const route of routes) {\n const method = route.method.toLowerCase() as 'get' | 'post' | 'put' | 'delete' | 'patch'\n const fullPath = route.path || '/'\n\n // Method-level middleware\n const methodMiddlewares: MiddlewareHandler[] = getMethodMeta<MiddlewareHandler[]>(\n METADATA.METHOD_MIDDLEWARES,\n controllerClass,\n route.handlerName,\n [],\n )\n\n // Build handler chain\n const handlers: any[] = []\n\n // Validation middleware (shared with standalone validate() export)\n if (route.validation) {\n handlers.push(validate(route.validation))\n }\n\n // @FileUpload decorator — auto-attach upload middleware from metadata\n const fileUploadConfig = getMethodMetaOrUndefined<FileUploadConfig>(\n METADATA.FILE_UPLOAD,\n controllerClass,\n route.handlerName,\n )\n if (fileUploadConfig) {\n handlers.push(buildUploadMiddleware(fileUploadConfig))\n }\n\n // Class + method middleware (wrapped as Express middleware with error catching)\n for (const mw of [...classMiddlewares, ...methodMiddlewares]) {\n handlers.push((req: Request, res: Response, next: NextFunction) => {\n const ctx = new RequestContext(req, res, next)\n Promise.resolve(mw(ctx, next)).catch(next)\n })\n }\n\n // Context Contributor pipeline (#107) — class + method contributors,\n // built once at mount time so cycle/missing-dep failures abort boot.\n const methodContributors: ContributorRegistration[] = getMethodMeta<ContributorRegistration[]>(\n METADATA.METHOD_CONTRIBUTORS,\n controllerClass,\n route.handlerName,\n [],\n )\n\n if (\n classContributors.length > 0 ||\n methodContributors.length > 0 ||\n externalSources.length > 0\n ) {\n // Labels are surfaced in DuplicateContributorError messages — include\n // the registration's key + the original index so a same-key collision\n // at one precedence level points at the conflicting decorator slot,\n // not just the host method/class.\n const sources: SourcedRegistration[] = [\n ...methodContributors.map(\n (registration, i): SourcedRegistration => ({\n source: 'method',\n registration,\n label: `${controllerClass.name}.${String(route.handlerName)}#${i}(${registration.key})`,\n }),\n ),\n ...classContributors.map(\n (registration, i): SourcedRegistration => ({\n source: 'class',\n registration,\n label: `${controllerClass.name}.@class#${i}(${registration.key})`,\n }),\n ),\n ...externalSources,\n ]\n const pipeline = buildPipeline(sources, {\n route: `${route.method.toUpperCase()} ${fullPath}`,\n })\n\n handlers.push(async (req: Request, res: Response, next: NextFunction) => {\n const ctx = new RequestContext(req, res, next)\n try {\n await runContributors({ pipeline, ctx, container })\n next()\n } catch (err) {\n next(err)\n }\n })\n }\n\n // Main handler — resolve controller per-request to respect DI scoping\n handlers.push(async (req: Request, res: Response, next: NextFunction) => {\n const ctx = new RequestContext(req, res, next)\n try {\n const controller = container.resolve(controllerClass)\n await controller[route.handlerName](ctx)\n } catch (err: any) {\n next(err)\n }\n })\n ;(router as any)[method](fullPath, ...handlers)\n }\n\n return router\n}\n"],"mappings":";;;;;;;;;;sdAiCA,IAAI,4BAA8D,EAAE,CAGpE,SAAgB,+BAA+B,QAA+C,CAC5F,4BAA8B,QAwBhC,SAAgB,YAAY,gBAAsB,QAA8B,EAAE,CAAU,CAC1F,IAAM,OAAS,QAAQ,CACjB,UAAY,UAAU,aAAa,CACnC,gBAAkB,QAAQ,iBAAmB,4BAC7C,OAA4B,aAChC,SAAS,OACT,gBACA,EAAE,CACH,CAGK,iBAAwC,aAC5C,SAAS,kBACT,gBACA,EAAE,CACH,CAIK,kBAA+C,aACnD,SAAS,mBACT,gBACA,EAAE,CACH,CAED,IAAK,IAAM,SAAS,OAAQ,CAC1B,IAAM,OAAS,MAAM,O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