@forinda/kickjs 3.1.2 → 3.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.
- package/dist/{adapter-DjL8ql5d.d.mts → adapter-DLEHb0K6.d.mts} +14 -3
- package/dist/adapter-DLEHb0K6.d.mts.map +1 -0
- package/dist/{app-module-Cotu9TIC.d.mts → app-module-ERR9jhow.d.mts} +12 -2
- package/dist/app-module-ERR9jhow.d.mts.map +1 -0
- package/dist/{application-M8SEljFB.mjs → application-x8CXLOlv.mjs} +92 -22
- package/dist/application-x8CXLOlv.mjs.map +1 -0
- package/dist/{bootstrap-DdAhHgVG.mjs → bootstrap-CYnxozL_.mjs} +6 -6
- package/dist/{bootstrap-DdAhHgVG.mjs.map → bootstrap-CYnxozL_.mjs.map} +1 -1
- package/dist/{cache-CcTzzNdr.d.mts → cache-V91BNTIM.d.mts} +1 -1
- package/dist/{cache-CcTzzNdr.d.mts.map → cache-V91BNTIM.d.mts.map} +1 -1
- package/dist/{chunk-BfOl01nR.mjs → chunk-Bt-rz0Tp.mjs} +1 -1
- package/dist/config/index.d.mts +1 -1
- package/dist/config/index.mjs +3 -3
- package/dist/{config-rspGiIN-.mjs → config-aWxKLk4A.mjs} +3 -3
- package/dist/{config-rspGiIN-.mjs.map → config-aWxKLk4A.mjs.map} +1 -1
- package/dist/{container-BQ-X3dXH.mjs → container-Dnk43k54.mjs} +3 -3
- package/dist/{container-BQ-X3dXH.mjs.map → container-Dnk43k54.mjs.map} +1 -1
- package/dist/{container-BJb34faa.d.mts → container-fIS1uLx-.d.mts} +2 -2
- package/dist/{container-BJb34faa.d.mts.map → container-fIS1uLx-.d.mts.map} +1 -1
- package/dist/context-OktlOQBQ.mjs +327 -0
- package/dist/context-OktlOQBQ.mjs.map +1 -0
- package/dist/context-decorator-GA8-hDLe.d.mts +111 -0
- package/dist/context-decorator-GA8-hDLe.d.mts.map +1 -0
- package/dist/core/adapter.d.mts +1 -1
- package/dist/core/adapter.mjs +1 -1
- package/dist/core/app-module.d.mts +1 -1
- package/dist/core/app-module.mjs +1 -1
- package/dist/core/cache.d.mts +1 -1
- package/dist/core/cache.mjs +1 -1
- package/dist/core/container.d.mts +1 -1
- package/dist/core/container.mjs +2 -2
- package/dist/core/cron.d.mts +1 -1
- package/dist/core/cron.mjs +2 -2
- package/dist/core/decorators.d.mts +1 -1
- package/dist/core/decorators.mjs +3 -3
- package/dist/core/errors.d.mts +1 -1
- package/dist/core/errors.mjs +1 -1
- package/dist/core/interfaces.d.mts +1 -1
- package/dist/core/interfaces.mjs +3 -1
- package/dist/core/interfaces.mjs.map +1 -1
- package/dist/core/logger.d.mts +1 -1
- package/dist/core/logger.mjs +1 -1
- package/dist/core/path.d.mts +1 -1
- package/dist/core/path.mjs +1 -1
- package/dist/core/plugin.d.mts +1 -1
- package/dist/core/plugin.mjs +1 -1
- package/dist/core/reactivity.d.mts +1 -1
- package/dist/core/reactivity.mjs +1 -1
- package/dist/core-DANnH5-e.mjs +435 -0
- package/dist/core-DANnH5-e.mjs.map +1 -0
- package/dist/{cron-H-IyLcOr.d.mts → cron-CfsPdi7R.d.mts} +1 -1
- package/dist/{cron-H-IyLcOr.d.mts.map → cron-CfsPdi7R.d.mts.map} +1 -1
- package/dist/{decorators-C9_SN7ge.d.mts → decorators-H42oPg0m.d.mts} +2 -2
- package/dist/{decorators-C9_SN7ge.d.mts.map → decorators-H42oPg0m.d.mts.map} +1 -1
- package/dist/{env-C_0nE69f.mjs → env-Cs8Wt8A_.mjs} +4 -4
- package/dist/{env-C_0nE69f.mjs.map → env-Cs8Wt8A_.mjs.map} +1 -1
- package/dist/{errors-BOUCRl-p.d.mts → errors-D_CWI7Bl.d.mts} +1 -1
- package/dist/{errors-BOUCRl-p.d.mts.map → errors-D_CWI7Bl.d.mts.map} +1 -1
- package/dist/execution-context-Dl2CKqSo.d.mts +57 -0
- package/dist/execution-context-Dl2CKqSo.d.mts.map +1 -0
- package/dist/http/application.d.mts +60 -6
- package/dist/http/application.d.mts.map +1 -1
- package/dist/http/application.mjs +2 -2
- package/dist/http/bootstrap.mjs +2 -2
- package/dist/http/context.d.mts +21 -32
- package/dist/http/context.d.mts.map +1 -1
- package/dist/http/context.mjs +2 -271
- package/dist/http/middleware/cors.mjs +1 -1
- package/dist/http/middleware/csrf.mjs +1 -1
- package/dist/http/middleware/error-handler.mjs +2 -2
- package/dist/http/middleware/helmet.mjs +1 -1
- package/dist/http/middleware/rate-limit.mjs +1 -1
- package/dist/http/middleware/request-id.mjs +1 -1
- package/dist/http/middleware/request-logger.mjs +2 -2
- package/dist/http/middleware/session.mjs +1 -1
- package/dist/http/middleware/spa.d.mts +1 -1
- package/dist/http/middleware/spa.mjs +3 -3
- package/dist/http/middleware/upload.d.mts +1 -1
- package/dist/http/middleware/upload.mjs +1 -1
- package/dist/http/middleware/validate.d.mts.map +1 -1
- package/dist/http/middleware/validate.mjs +22 -4
- package/dist/http/middleware/validate.mjs.map +1 -1
- package/dist/http/middleware/views.d.mts +1 -1
- package/dist/http/middleware/views.mjs +2 -2
- package/dist/http/query/index.d.mts +1 -1
- package/dist/http/query/index.mjs +2 -2
- package/dist/http/router-builder.d.mts +14 -2
- package/dist/http/router-builder.d.mts.map +1 -1
- package/dist/http/router-builder.mjs +59 -7
- package/dist/http/router-builder.mjs.map +1 -1
- package/dist/index-BQM9pJrV.d.mts +275 -0
- package/dist/index-BQM9pJrV.d.mts.map +1 -0
- package/dist/{index-DNVfGjF9.d.mts → index-Cf-MGrqT.d.mts} +2 -2
- package/dist/{index-DNVfGjF9.d.mts.map → index-Cf-MGrqT.d.mts.map} +1 -1
- package/dist/{index-Co7a3Zat.d.mts → index-RNK41JPE.d.mts} +1 -1
- package/dist/{index-Co7a3Zat.d.mts.map → index-RNK41JPE.d.mts.map} +1 -1
- package/dist/index.d.mts +38 -19
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +11 -11
- package/dist/{interfaces-DXjE8Re1.d.mts → interfaces-CwcdqfNq.d.mts} +3 -1
- package/dist/{interfaces-DXjE8Re1.d.mts.map → interfaces-CwcdqfNq.d.mts.map} +1 -1
- package/dist/{logger-CW6FHtvU.d.mts → logger-GK8yT0BD.d.mts} +1 -1
- package/dist/{logger-CW6FHtvU.d.mts.map → logger-GK8yT0BD.d.mts.map} +1 -1
- package/dist/{metadata-Dp3Ozdr5.mjs → metadata-BFuoSEX6.mjs} +2 -2
- package/dist/{metadata-Dp3Ozdr5.mjs.map → metadata-BFuoSEX6.mjs.map} +1 -1
- package/dist/{path-B4JcbwKX.d.mts → path-Bj3vZMUY.d.mts} +1 -1
- package/dist/path-Bj3vZMUY.d.mts.map +1 -0
- package/dist/{plugin-Cvacmm7N.d.mts → plugin-3rKA0Loy.d.mts} +36 -4
- package/dist/plugin-3rKA0Loy.d.mts.map +1 -0
- package/dist/{query-o6_fDG4v.mjs → query-BcYEjYyX.mjs} +2 -2
- package/dist/{query-o6_fDG4v.mjs.map → query-BcYEjYyX.mjs.map} +1 -1
- package/dist/{reactivity-I8nDlg4c.d.mts → reactivity-CczHu3R-.d.mts} +1 -1
- package/dist/{reactivity-I8nDlg4c.d.mts.map → reactivity-CczHu3R-.d.mts.map} +1 -1
- package/package.json +1 -1
- package/dist/adapter-DjL8ql5d.d.mts.map +0 -1
- package/dist/app-module-Cotu9TIC.d.mts.map +0 -1
- package/dist/application-M8SEljFB.mjs.map +0 -1
- package/dist/core-NDLlQziD.mjs +0 -121
- package/dist/core-NDLlQziD.mjs.map +0 -1
- package/dist/http/context.mjs.map +0 -1
- package/dist/index-CwqjAF6I.d.mts +0 -112
- package/dist/index-CwqjAF6I.d.mts.map +0 -1
- package/dist/path-B4JcbwKX.d.mts.map +0 -1
- package/dist/plugin-Cvacmm7N.d.mts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { i as BaseUploadOptions, m as FileUploadConfig } from "../../decorators-
|
|
2
|
+
import { i as BaseUploadOptions, m as FileUploadConfig } from "../../decorators-H42oPg0m.mjs";
|
|
3
3
|
import { NextFunction, Request, RequestHandler, Response } from "express";
|
|
4
4
|
import { Options } from "multer";
|
|
5
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.mts","names":[],"sources":["../../../src/http/middleware/validate.ts"],"mappings":";;;;UAGiB,gBAAA;EACf,IAAA;EACA,KAAA;EACA,MAAA;AAAA;;;;;;;
|
|
1
|
+
{"version":3,"file":"validate.d.mts","names":[],"sources":["../../../src/http/middleware/validate.ts"],"mappings":";;;;UAGiB,gBAAA;EACf,IAAA;EACA,KAAA;EACA,MAAA;AAAA;;;;;;;AA8CF;;;;iBAAgB,QAAA,CAAS,MAAA,EAAQ,gBAAA,IACvB,GAAA,EAAK,OAAA,EAAS,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,YAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v3.
|
|
2
|
+
* @forinda/kickjs v3.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-
|
|
12
|
+
import "../../core-DANnH5-e.mjs";
|
|
13
13
|
//#region src/http/middleware/validate.ts
|
|
14
14
|
function toValidationException(error, message, useFirstIssueMessage) {
|
|
15
15
|
const issues = error.issues || [];
|
|
@@ -21,6 +21,24 @@ function toValidationException(error, message, useFirstIssueMessage) {
|
|
|
21
21
|
return new HttpException(HttpStatus.UNPROCESSABLE_ENTITY, finalMessage, details);
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
+
* Express 5 installs `req.query` as a getter-only property (so pluggable
|
|
25
|
+
* `query parser` functions can run lazily). Direct assignment throws in
|
|
26
|
+
* strict mode: `Cannot set property query of #<IncomingMessage> which
|
|
27
|
+
* has only a getter`. `Object.defineProperty` replaces the getter with
|
|
28
|
+
* a plain value slot and sidesteps the throw. Used for `query` and
|
|
29
|
+
* defensively for `params` too — Express 5 currently leaves `params`
|
|
30
|
+
* writable, but swapping the descriptor costs the same and future-proofs
|
|
31
|
+
* against upstream changes.
|
|
32
|
+
*/
|
|
33
|
+
function assignReqProperty(req, key, value) {
|
|
34
|
+
Object.defineProperty(req, key, {
|
|
35
|
+
value,
|
|
36
|
+
writable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
enumerable: true
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
24
42
|
* Express middleware that validates request body/query/params against schemas.
|
|
25
43
|
* Works with any validation library that exposes `.safeParse(data)` returning
|
|
26
44
|
* `{ success: true, data }` or `{ success: false, error: { issues } }`.
|
|
@@ -41,12 +59,12 @@ function validate(schema) {
|
|
|
41
59
|
if (schema.query) {
|
|
42
60
|
const result = schema.query.safeParse(req.query);
|
|
43
61
|
if (!result.success) return next(toValidationException(result.error, "Invalid query parameters", false));
|
|
44
|
-
req
|
|
62
|
+
assignReqProperty(req, "query", result.data);
|
|
45
63
|
}
|
|
46
64
|
if (schema.params) {
|
|
47
65
|
const result = schema.params.safeParse(req.params);
|
|
48
66
|
if (!result.success) return next(toValidationException(result.error, "Invalid path parameters", false));
|
|
49
|
-
req
|
|
67
|
+
assignReqProperty(req, "params", result.data);
|
|
50
68
|
}
|
|
51
69
|
next();
|
|
52
70
|
} catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.mjs","names":[],"sources":["../../../src/http/middleware/validate.ts"],"sourcesContent":["import type { Request, Response, NextFunction } from 'express'\nimport { HttpException, HttpStatus } from '../../core'\n\nexport interface ValidationSchema {\n body?: any\n query?: any\n params?: any\n}\n\nfunction toValidationException(\n error: any,\n message: string,\n useFirstIssueMessage: boolean,\n): HttpException {\n const issues = error.issues || []\n const details = issues.map((i: any) => ({\n field: i.path?.join('.') ?? '',\n message: i.message,\n }))\n const finalMessage = useFirstIssueMessage ? (issues[0]?.message ?? message) : message\n return new HttpException(HttpStatus.UNPROCESSABLE_ENTITY, finalMessage, details)\n}\n\n/**\n * Express middleware that validates request body/query/params against schemas.\n * Works with any validation library that exposes `.safeParse(data)` returning\n * `{ success: true, data }` or `{ success: false, error: { issues } }`.\n *\n * Validation failures are forwarded via `next(err)` as an `HttpException`, so\n * they flow through the application's global error handler (`onError`) and\n * produce a uniform response envelope. Apps that keep the built-in handler\n * continue to see the same `{ message, errors: [{ field, message }] }` body.\n */\nexport function validate(schema: ValidationSchema) {\n return (req: Request, _res: Response, next: NextFunction) => {\n try {\n if (schema.body) {\n const result = schema.body.safeParse(req.body)\n if (!result.success) {\n return next(toValidationException(result.error, 'Validation failed', true))\n }\n req.body = result.data\n }\n\n if (schema.query) {\n const result = schema.query.safeParse(req.query)\n if (!result.success) {\n return next(toValidationException(result.error, 'Invalid query parameters', false))\n }\n
|
|
1
|
+
{"version":3,"file":"validate.mjs","names":[],"sources":["../../../src/http/middleware/validate.ts"],"sourcesContent":["import type { Request, Response, NextFunction } from 'express'\nimport { HttpException, HttpStatus } from '../../core'\n\nexport interface ValidationSchema {\n body?: any\n query?: any\n params?: any\n}\n\nfunction toValidationException(\n error: any,\n message: string,\n useFirstIssueMessage: boolean,\n): HttpException {\n const issues = error.issues || []\n const details = issues.map((i: any) => ({\n field: i.path?.join('.') ?? '',\n message: i.message,\n }))\n const finalMessage = useFirstIssueMessage ? (issues[0]?.message ?? message) : message\n return new HttpException(HttpStatus.UNPROCESSABLE_ENTITY, finalMessage, details)\n}\n\n/**\n * Express 5 installs `req.query` as a getter-only property (so pluggable\n * `query parser` functions can run lazily). Direct assignment throws in\n * strict mode: `Cannot set property query of #<IncomingMessage> which\n * has only a getter`. `Object.defineProperty` replaces the getter with\n * a plain value slot and sidesteps the throw. Used for `query` and\n * defensively for `params` too — Express 5 currently leaves `params`\n * writable, but swapping the descriptor costs the same and future-proofs\n * against upstream changes.\n */\nfunction assignReqProperty(req: Request, key: 'query' | 'params', value: unknown): void {\n Object.defineProperty(req, key, {\n value,\n writable: true,\n configurable: true,\n enumerable: true,\n })\n}\n\n/**\n * Express middleware that validates request body/query/params against schemas.\n * Works with any validation library that exposes `.safeParse(data)` returning\n * `{ success: true, data }` or `{ success: false, error: { issues } }`.\n *\n * Validation failures are forwarded via `next(err)` as an `HttpException`, so\n * they flow through the application's global error handler (`onError`) and\n * produce a uniform response envelope. Apps that keep the built-in handler\n * continue to see the same `{ message, errors: [{ field, message }] }` body.\n */\nexport function validate(schema: ValidationSchema) {\n return (req: Request, _res: Response, next: NextFunction) => {\n try {\n if (schema.body) {\n const result = schema.body.safeParse(req.body)\n if (!result.success) {\n return next(toValidationException(result.error, 'Validation failed', true))\n }\n req.body = result.data\n }\n\n if (schema.query) {\n const result = schema.query.safeParse(req.query)\n if (!result.success) {\n return next(toValidationException(result.error, 'Invalid query parameters', false))\n }\n assignReqProperty(req, 'query', result.data)\n }\n\n if (schema.params) {\n const result = schema.params.safeParse(req.params)\n if (!result.success) {\n return next(toValidationException(result.error, 'Invalid path parameters', false))\n }\n assignReqProperty(req, 'params', result.data)\n }\n\n next()\n } catch (err) {\n next(err)\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;AASA,SAAS,sBACP,OACA,SACA,sBACe;CACf,MAAM,SAAS,MAAM,UAAU,EAAE;CACjC,MAAM,UAAU,OAAO,KAAK,OAAY;EACtC,OAAO,EAAE,MAAM,KAAK,IAAI,IAAI;EAC5B,SAAS,EAAE;EACZ,EAAE;CACH,MAAM,eAAe,uBAAwB,OAAO,IAAI,WAAW,UAAW;AAC9E,QAAO,IAAI,cAAc,WAAW,sBAAsB,cAAc,QAAQ;;;;;;;;;;;;AAalF,SAAS,kBAAkB,KAAc,KAAyB,OAAsB;AACtF,QAAO,eAAe,KAAK,KAAK;EAC9B;EACA,UAAU;EACV,cAAc;EACd,YAAY;EACb,CAAC;;;;;;;;;;;;AAaJ,SAAgB,SAAS,QAA0B;AACjD,SAAQ,KAAc,MAAgB,SAAuB;AAC3D,MAAI;AACF,OAAI,OAAO,MAAM;IACf,MAAM,SAAS,OAAO,KAAK,UAAU,IAAI,KAAK;AAC9C,QAAI,CAAC,OAAO,QACV,QAAO,KAAK,sBAAsB,OAAO,OAAO,qBAAqB,KAAK,CAAC;AAE7E,QAAI,OAAO,OAAO;;AAGpB,OAAI,OAAO,OAAO;IAChB,MAAM,SAAS,OAAO,MAAM,UAAU,IAAI,MAAM;AAChD,QAAI,CAAC,OAAO,QACV,QAAO,KAAK,sBAAsB,OAAO,OAAO,4BAA4B,MAAM,CAAC;AAErF,sBAAkB,KAAK,SAAS,OAAO,KAAK;;AAG9C,OAAI,OAAO,QAAQ;IACjB,MAAM,SAAS,OAAO,OAAO,UAAU,IAAI,OAAO;AAClD,QAAI,CAAC,OAAO,QACV,QAAO,KAAK,sBAAsB,OAAO,OAAO,2BAA2B,MAAM,CAAC;AAEpF,sBAAkB,KAAK,UAAU,OAAO,KAAK;;AAG/C,SAAM;WACC,KAAK;AACZ,QAAK,IAAI"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v3.
|
|
2
|
+
* @forinda/kickjs v3.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 "../../core-
|
|
12
|
+
import "../../core-DANnH5-e.mjs";
|
|
13
13
|
import { resolve } from "node:path";
|
|
14
14
|
//#region src/http/middleware/views.ts
|
|
15
15
|
const log = Logger.for("ViewEngine");
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
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, s as ColumnQueryFieldConfig, t as buildQueryParams, u as FilterItem, v as StringQueryFieldConfig, y as TypedParsedQuery } from "../../index-
|
|
2
|
+
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, s as ColumnQueryFieldConfig, t as buildQueryParams, u as FilterItem, v as StringQueryFieldConfig, y as TypedParsedQuery } from "../../index-RNK41JPE.mjs";
|
|
3
3
|
export { ColumnQueryFieldConfig, FILTER_OPERATORS, FieldsOf, FilterItem, FilterOperator, PaginatedResponse, PaginationParams, ParsedQuery, QueryBuilderAdapter, QueryFieldConfig, SortItem, StringQueryFieldConfig, TypedParsedQuery, buildQueryParams, parseFilters, parsePagination, parseQuery, parseSearchQuery, parseSort };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v3.
|
|
2
|
+
* @forinda/kickjs v3.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-
|
|
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-BcYEjYyX.mjs";
|
|
12
12
|
export { FILTER_OPERATORS, buildQueryParams, parseFilters, parsePagination, parseQuery, parseSearchQuery, parseSort };
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
|
|
2
|
+
import { o as SourcedRegistration } from "../index-BQM9pJrV.mjs";
|
|
2
3
|
import { Router } from "express";
|
|
3
4
|
|
|
4
5
|
//#region src/http/router-builder.d.ts
|
|
5
6
|
/** Get the controller path set by @Controller('/path') */
|
|
6
7
|
declare function getControllerPath(controllerClass: any): string;
|
|
8
|
+
/** @internal — set by Application.setup() before each `mod.routes()` call. */
|
|
9
|
+
declare function _setExternalContributorSources(sources: readonly SourcedRegistration[]): void;
|
|
10
|
+
interface BuildRoutesOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Extra contributors to merge into the per-route pipeline at their declared
|
|
13
|
+
* precedence levels. Pass explicitly when calling buildRoutes outside the
|
|
14
|
+
* Application route-mount loop (typically in tests). When omitted, falls
|
|
15
|
+
* back to the slot set by Application.setup().
|
|
16
|
+
*/
|
|
17
|
+
externalSources?: readonly SourcedRegistration[];
|
|
18
|
+
}
|
|
7
19
|
/**
|
|
8
20
|
* Build an Express Router from a controller class decorated with @Get, @Post, etc.
|
|
9
21
|
* Resolves the controller from the DI container, wraps handlers in RequestContext,
|
|
@@ -15,7 +27,7 @@ declare function getControllerPath(controllerClass: any): string;
|
|
|
15
27
|
* The module's routes().path is the single source of truth for the mount prefix,
|
|
16
28
|
* which avoids path doubling when both the module and controller specify the same path.
|
|
17
29
|
*/
|
|
18
|
-
declare function buildRoutes(controllerClass: any): Router;
|
|
30
|
+
declare function buildRoutes(controllerClass: any, options?: BuildRoutesOptions): Router;
|
|
19
31
|
//#endregion
|
|
20
|
-
export { buildRoutes, getControllerPath };
|
|
32
|
+
export { BuildRoutesOptions, _setExternalContributorSources, buildRoutes, getControllerPath };
|
|
21
33
|
//# sourceMappingURL=router-builder.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-builder.d.mts","names":[],"sources":["../../src/http/router-builder.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"router-builder.d.mts","names":[],"sources":["../../src/http/router-builder.ts"],"mappings":";;;;;;iBAkBgB,iBAAA,CAAkB,eAAA;AAAlC;AAAA,iBAuBgB,8BAAA,CAA+B,OAAA,WAAkB,mBAAA;AAAA,UAIhD,kBAAA;EA3BiB;;AAuBlC;;;;EAWE,eAAA,YAA2B,mBAAA;AAAA;;;;;AAc7B;;;;;;;iBAAgB,WAAA,CAAY,eAAA,OAAsB,OAAA,GAAS,kBAAA,GAA0B,MAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v3.
|
|
2
|
+
* @forinda/kickjs v3.2.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
11
|
import { METADATA } from "../core/interfaces.mjs";
|
|
12
|
-
import { a as getMethodMeta, o as getMethodMetaOrUndefined, t as getClassMeta } from "../metadata-
|
|
13
|
-
import { t as Container } from "../container-
|
|
14
|
-
import "../core-
|
|
15
|
-
import { RequestContext } from "
|
|
12
|
+
import { a as getMethodMeta, o as getMethodMetaOrUndefined, t as getClassMeta } from "../metadata-BFuoSEX6.mjs";
|
|
13
|
+
import { t as Container } from "../container-Dnk43k54.mjs";
|
|
14
|
+
import { n as buildPipeline, t as runContributors } from "../core-DANnH5-e.mjs";
|
|
15
|
+
import { t as RequestContext } from "../context-OktlOQBQ.mjs";
|
|
16
16
|
import { validate } from "./middleware/validate.mjs";
|
|
17
17
|
import { buildUploadMiddleware } from "./middleware/upload.mjs";
|
|
18
18
|
import { Router } from "express";
|
|
@@ -22,6 +22,27 @@ function getControllerPath(controllerClass) {
|
|
|
22
22
|
return getClassMeta(METADATA.CONTROLLER_PATH, controllerClass, "/");
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
+
* Per-module SourcedRegistration[] threaded through the route-mount loop by
|
|
26
|
+
* Application.setup(). Carries module + adapter + global contributors so
|
|
27
|
+
* buildRoutes() can merge them with class + method ones into a single pipeline.
|
|
28
|
+
*
|
|
29
|
+
* Module setup is sequential, so this slot is race-free. Cleared in a finally
|
|
30
|
+
* block after each module mounts. Outside of Application setup the slot is
|
|
31
|
+
* empty — direct buildRoutes() callers (mostly tests) see only class + method
|
|
32
|
+
* contributors unless they pass `externalSources` explicitly.
|
|
33
|
+
*
|
|
34
|
+
* Same idiom as `Container._requestStoreProvider` and `Logger._contextProvider`:
|
|
35
|
+
* an internal escape hatch for cross-module wiring without inversion-of-control
|
|
36
|
+
* gymnastics.
|
|
37
|
+
*
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
let _externalContributorSources = [];
|
|
41
|
+
/** @internal — set by Application.setup() before each `mod.routes()` call. */
|
|
42
|
+
function _setExternalContributorSources(sources) {
|
|
43
|
+
_externalContributorSources = sources;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
25
46
|
* Build an Express Router from a controller class decorated with @Get, @Post, etc.
|
|
26
47
|
* Resolves the controller from the DI container, wraps handlers in RequestContext,
|
|
27
48
|
* and applies class-level and method-level middleware.
|
|
@@ -32,11 +53,13 @@ function getControllerPath(controllerClass) {
|
|
|
32
53
|
* The module's routes().path is the single source of truth for the mount prefix,
|
|
33
54
|
* which avoids path doubling when both the module and controller specify the same path.
|
|
34
55
|
*/
|
|
35
|
-
function buildRoutes(controllerClass) {
|
|
56
|
+
function buildRoutes(controllerClass, options = {}) {
|
|
36
57
|
const router = Router();
|
|
37
58
|
const container = Container.getInstance();
|
|
59
|
+
const externalSources = options.externalSources ?? _externalContributorSources;
|
|
38
60
|
const routes = getClassMeta(METADATA.ROUTES, controllerClass, []);
|
|
39
61
|
const classMiddlewares = getClassMeta(METADATA.CLASS_MIDDLEWARES, controllerClass, []);
|
|
62
|
+
const classContributors = getClassMeta(METADATA.CLASS_CONTRIBUTORS, controllerClass, []);
|
|
40
63
|
for (const route of routes) {
|
|
41
64
|
const method = route.method.toLowerCase();
|
|
42
65
|
const fullPath = route.path || "/";
|
|
@@ -49,6 +72,35 @@ function buildRoutes(controllerClass) {
|
|
|
49
72
|
const ctx = new RequestContext(req, res, next);
|
|
50
73
|
Promise.resolve(mw(ctx, next)).catch(next);
|
|
51
74
|
});
|
|
75
|
+
const methodContributors = getMethodMeta(METADATA.METHOD_CONTRIBUTORS, controllerClass, route.handlerName, []);
|
|
76
|
+
if (classContributors.length > 0 || methodContributors.length > 0 || externalSources.length > 0) {
|
|
77
|
+
const pipeline = buildPipeline([
|
|
78
|
+
...methodContributors.map((registration) => ({
|
|
79
|
+
source: "method",
|
|
80
|
+
registration,
|
|
81
|
+
label: `${controllerClass.name}.${String(route.handlerName)}`
|
|
82
|
+
})),
|
|
83
|
+
...classContributors.map((registration) => ({
|
|
84
|
+
source: "class",
|
|
85
|
+
registration,
|
|
86
|
+
label: `${controllerClass.name}.@class`
|
|
87
|
+
})),
|
|
88
|
+
...externalSources
|
|
89
|
+
], { route: `${route.method.toUpperCase()} ${fullPath}` });
|
|
90
|
+
handlers.push(async (req, res, next) => {
|
|
91
|
+
const ctx = new RequestContext(req, res, next);
|
|
92
|
+
try {
|
|
93
|
+
await runContributors({
|
|
94
|
+
pipeline,
|
|
95
|
+
ctx,
|
|
96
|
+
container
|
|
97
|
+
});
|
|
98
|
+
next();
|
|
99
|
+
} catch (err) {
|
|
100
|
+
next(err);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
52
104
|
handlers.push(async (req, res, next) => {
|
|
53
105
|
const ctx = new RequestContext(req, res, next);
|
|
54
106
|
try {
|
|
@@ -62,6 +114,6 @@ function buildRoutes(controllerClass) {
|
|
|
62
114
|
return router;
|
|
63
115
|
}
|
|
64
116
|
//#endregion
|
|
65
|
-
export { buildRoutes, getControllerPath };
|
|
117
|
+
export { _setExternalContributorSources, buildRoutes, getControllerPath };
|
|
66
118
|
|
|
67
119
|
//# 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 Container,\n METADATA,\n type
|
|
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/** Get the controller path set by @Controller('/path') */\nexport function getControllerPath(controllerClass: any): string {\n return getClassMeta<string>(METADATA.CONTROLLER_PATH, controllerClass, '/')\n}\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 const sources: SourcedRegistration[] = [\n ...methodContributors.map(\n (registration): SourcedRegistration => ({\n source: 'method',\n registration,\n label: `${controllerClass.name}.${String(route.handlerName)}`,\n }),\n ),\n ...classContributors.map(\n (registration): SourcedRegistration => ({\n source: 'class',\n registration,\n label: `${controllerClass.name}.@class`,\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":";;;;;;;;;;;;;;;;;;;;AAkBA,SAAgB,kBAAkB,iBAA8B;AAC9D,QAAO,aAAqB,SAAS,iBAAiB,iBAAiB,IAAI;;;;;;;;;;;;;;;;;;AAmB7E,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,Q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S,KAAK,OAAO,KAAc,KAAe,SAAuB;IACvE,MAAM,MAAM,IAAI,eAAe,KAAK,KAAK,KAAK;AAC9C,QAAI;AACF,WAAM,gBAAgB;MAAE;MAAU;MAAK;MAAW,CAAC;AACnD,WAAM;aACC,KAAK;AACZ,UAAK,IAAI;;KAEX;;AAIJ,WAAS,KAAK,OAAO,KAAc,KAAe,SAAuB;GACvE,MAAM,MAAM,IAAI,eAAe,KAAK,KAAK,KAAK;AAC9C,OAAI;AAEF,UADmB,UAAU,QAAQ,gBAAgB,CACpC,MAAM,aAAa,IAAI;YACjC,KAAU;AACjB,SAAK,IAAI;;IAEX;AACA,SAAe,QAAQ,UAAU,GAAG,SAAS;;AAGjD,QAAO"}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
|
|
2
|
+
import { s as InjectionToken, t as Container } from "./container-fIS1uLx-.mjs";
|
|
3
|
+
import { n as ExecutionContext } from "./execution-context-Dl2CKqSo.mjs";
|
|
4
|
+
import { r as ContributorRegistration } from "./context-decorator-GA8-hDLe.mjs";
|
|
5
|
+
//#region src/core/metadata.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Typed utilities for reflect-metadata operations.
|
|
8
|
+
*
|
|
9
|
+
* Replaces scattered Reflect.defineMetadata/getMetadata calls with a single
|
|
10
|
+
* source of truth. If we later move to Stage 3 decorators or a WeakMap-based
|
|
11
|
+
* store, only this file changes — all 24+ consumer files stay untouched.
|
|
12
|
+
*
|
|
13
|
+
* Keys may be symbols, strings, or `InjectionToken<T>` objects produced by
|
|
14
|
+
* `createToken()`. Using `createToken` is the preferred pattern because the
|
|
15
|
+
* token's phantom type flows through the helpers, enabling type-safe reads.
|
|
16
|
+
*/
|
|
17
|
+
type MetaKey = symbol | string | InjectionToken<unknown>;
|
|
18
|
+
/** Set metadata on a class (or prototype for property decorators) */
|
|
19
|
+
declare function setClassMeta<T>(key: MetaKey, value: T, target: object): void;
|
|
20
|
+
/** Set metadata on a specific method */
|
|
21
|
+
declare function setMethodMeta<T>(key: MetaKey, value: T, target: object, method: string): void;
|
|
22
|
+
/** Get metadata from a class, returning `fallback` if not set */
|
|
23
|
+
declare function getClassMeta<T>(key: MetaKey, target: object, fallback: T): T;
|
|
24
|
+
/** Get metadata from a specific method, returning `fallback` if not set */
|
|
25
|
+
declare function getMethodMeta<T>(key: MetaKey, target: object, method: string, fallback: T): T;
|
|
26
|
+
/** Check if metadata exists on a class */
|
|
27
|
+
declare function hasClassMeta(key: MetaKey, target: object): boolean;
|
|
28
|
+
/** Get metadata from a class with no default (returns undefined if absent) */
|
|
29
|
+
declare function getClassMetaOrUndefined<T>(key: MetaKey, target: object): T | undefined;
|
|
30
|
+
/** Get metadata from a method with no default (returns undefined if absent) */
|
|
31
|
+
declare function getMethodMetaOrUndefined<T>(key: MetaKey, target: object, method: string): T | undefined;
|
|
32
|
+
/** Append items to an array stored in class metadata */
|
|
33
|
+
declare function pushClassMeta<T>(key: MetaKey, target: object, ...items: T[]): void;
|
|
34
|
+
/** Append items to an array stored in method metadata */
|
|
35
|
+
declare function pushMethodMeta<T>(key: MetaKey, target: object, method: string, ...items: T[]): void;
|
|
36
|
+
/** Set a key/value in a Map stored in class metadata */
|
|
37
|
+
declare function setInMetaMap<K, V>(key: MetaKey, target: object, mapKey: K, mapValue: V): void;
|
|
38
|
+
/** Get a Map from class metadata (returns empty Map if absent) */
|
|
39
|
+
declare function getMetaMap<K, V>(key: MetaKey, target: object): Map<K, V>;
|
|
40
|
+
/** Set a key/value in a Record stored in class metadata */
|
|
41
|
+
declare function setInMetaRecord<V>(key: MetaKey, target: object, recKey: string | number, recValue: V): void;
|
|
42
|
+
/** Get a Record from class metadata (returns empty object if absent) */
|
|
43
|
+
declare function getMetaRecord<V>(key: MetaKey, target: object): Record<string | number, V>;
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/core/circuit-breaker.d.ts
|
|
46
|
+
/**
|
|
47
|
+
* Circuit Breaker pattern for external service calls.
|
|
48
|
+
*
|
|
49
|
+
* Protects your application from cascading failures when downstream
|
|
50
|
+
* services are unhealthy by short-circuiting requests after a
|
|
51
|
+
* configurable failure threshold.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const breaker = new CircuitBreaker('payment-api', {
|
|
56
|
+
* failureThreshold: 5,
|
|
57
|
+
* resetTimeout: 30_000,
|
|
58
|
+
* })
|
|
59
|
+
*
|
|
60
|
+
* const result = await breaker.execute(() => fetch('https://payment.example.com/charge'))
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
type CircuitBreakerState = 'closed' | 'open' | 'half_open';
|
|
64
|
+
interface CircuitBreakerOptions {
|
|
65
|
+
/** Number of consecutive failures before the circuit opens. */
|
|
66
|
+
failureThreshold: number;
|
|
67
|
+
/** Milliseconds to wait before transitioning from OPEN to HALF_OPEN. */
|
|
68
|
+
resetTimeout: number;
|
|
69
|
+
/** Max requests allowed in HALF_OPEN state before deciding (default 1). */
|
|
70
|
+
halfOpenMax?: number;
|
|
71
|
+
}
|
|
72
|
+
interface CircuitBreakerStats {
|
|
73
|
+
failures: number;
|
|
74
|
+
successes: number;
|
|
75
|
+
state: CircuitBreakerState;
|
|
76
|
+
lastFailure?: Date;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Error thrown when the circuit is open and calls are being rejected.
|
|
80
|
+
*/
|
|
81
|
+
declare class CircuitOpenError extends Error {
|
|
82
|
+
readonly breakerName: string;
|
|
83
|
+
constructor(breakerName: string);
|
|
84
|
+
}
|
|
85
|
+
declare class CircuitBreaker {
|
|
86
|
+
readonly name: string;
|
|
87
|
+
private state;
|
|
88
|
+
private failures;
|
|
89
|
+
private successes;
|
|
90
|
+
private halfOpenAttempts;
|
|
91
|
+
private lastFailure?;
|
|
92
|
+
private openedAt?;
|
|
93
|
+
private readonly failureThreshold;
|
|
94
|
+
private readonly resetTimeout;
|
|
95
|
+
private readonly halfOpenMax;
|
|
96
|
+
constructor(name: string, options: CircuitBreakerOptions);
|
|
97
|
+
/**
|
|
98
|
+
* Execute an async function through the circuit breaker.
|
|
99
|
+
* Throws `CircuitOpenError` if the circuit is open.
|
|
100
|
+
*/
|
|
101
|
+
execute<T>(fn: () => Promise<T>): Promise<T>;
|
|
102
|
+
/** Returns the current circuit state. */
|
|
103
|
+
getState(): CircuitBreakerState;
|
|
104
|
+
/** Returns current statistics. */
|
|
105
|
+
getStats(): CircuitBreakerStats;
|
|
106
|
+
/** Manually reset the circuit breaker to CLOSED state. */
|
|
107
|
+
reset(): void;
|
|
108
|
+
private onSuccess;
|
|
109
|
+
private onFailure;
|
|
110
|
+
private maybeTransitionToHalfOpen;
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/core/context-errors.d.ts
|
|
114
|
+
/**
|
|
115
|
+
* Errors thrown by the Context Contributor pipeline.
|
|
116
|
+
*
|
|
117
|
+
* All three are startup-time errors raised during pipeline build (topo-sort
|
|
118
|
+
* + validation), not per-request — a misconfigured app fails to boot rather
|
|
119
|
+
* than fails a request. Per the locked design in `architecture.md` §20.4,
|
|
120
|
+
* the pipeline is validated once when each route is mounted and the
|
|
121
|
+
* resolved order is cached on the route.
|
|
122
|
+
*/
|
|
123
|
+
/**
|
|
124
|
+
* A contributor declared `dependsOn: ['<key>']` but no other contributor
|
|
125
|
+
* (at any precedence level) produces that key for the same route.
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```text
|
|
129
|
+
* MissingContributorError: Missing context contributor 'tenant' required by 'project' on route GET /projects/:id
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
declare class MissingContributorError extends Error {
|
|
133
|
+
readonly key: string;
|
|
134
|
+
readonly dependent: string;
|
|
135
|
+
readonly route?: string;
|
|
136
|
+
constructor(key: string, dependent: string, route?: string);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Topo-sort detected a cycle in `dependsOn` declarations. The `cycle` field
|
|
140
|
+
* lists the keys in the order they form the loop, with the first key
|
|
141
|
+
* repeated at the end so the path reads naturally.
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```text
|
|
145
|
+
* ContributorCycleError: Cycle in context contributors on route GET /projects/:id: tenant → project → tenant
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
declare class ContributorCycleError extends Error {
|
|
149
|
+
readonly cycle: readonly string[];
|
|
150
|
+
readonly route?: string;
|
|
151
|
+
constructor(cycle: readonly string[], route?: string);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Two contributors at the same precedence level both produce the same key
|
|
155
|
+
* for the same route. Precedence resolution (method > class > module >
|
|
156
|
+
* adapter > global, per architecture.md §20.4) silently drops
|
|
157
|
+
* lower-precedence duplicates; this error fires only when ties occur
|
|
158
|
+
* within a single level — e.g., two method-level decorators declaring
|
|
159
|
+
* `key: 'tenant'`.
|
|
160
|
+
*
|
|
161
|
+
* `sources` is best-effort identifying labels for each conflicting
|
|
162
|
+
* registration (typically the decorator's call site or registering
|
|
163
|
+
* module/adapter name).
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```text
|
|
167
|
+
* DuplicateContributorError: Duplicate context contributor for key 'tenant' at the same precedence level. Sources: LoadTenantFromHeader, LoadTenantFromSubdomain
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
declare class DuplicateContributorError extends Error {
|
|
171
|
+
readonly key: string;
|
|
172
|
+
readonly sources: readonly string[];
|
|
173
|
+
constructor(key: string, sources: readonly string[]);
|
|
174
|
+
}
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/core/contributor-pipeline.d.ts
|
|
177
|
+
/**
|
|
178
|
+
* Where a contributor was registered, ordered by precedence
|
|
179
|
+
* (lower index wins). Mirrors `architecture.md` §20.4.
|
|
180
|
+
*
|
|
181
|
+
* Levels (highest → lowest precedence):
|
|
182
|
+
* - `'method'` — `@LoadX` on a controller method.
|
|
183
|
+
* - `'class'` — `@LoadX` on a controller class.
|
|
184
|
+
* - `'module'` — returned by `AppModule.contributors?()`. Per-module scope.
|
|
185
|
+
* - `'adapter'` — returned by `AppAdapter.contributors?()`. Cross-cutting, applies
|
|
186
|
+
* to every module's routes.
|
|
187
|
+
* - `'global'` — `ApplicationOptions.contributors`. App-wide default.
|
|
188
|
+
*/
|
|
189
|
+
type ContributorSource = 'method' | 'class' | 'module' | 'adapter' | 'global';
|
|
190
|
+
/**
|
|
191
|
+
* Input row to {@link buildPipeline}. Pairs a registration with its origin
|
|
192
|
+
* so dedup can apply the precedence rule and diagnostic errors can name
|
|
193
|
+
* the offending site.
|
|
194
|
+
*/
|
|
195
|
+
interface SourcedRegistration {
|
|
196
|
+
registration: ContributorRegistration;
|
|
197
|
+
source: ContributorSource;
|
|
198
|
+
/** Human label surfaced in DuplicateContributorError messages. */
|
|
199
|
+
label?: string;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Resolved, validated, topo-sorted pipeline ready for execution.
|
|
203
|
+
*
|
|
204
|
+
* `contributors` is in execution order — every entry's `dependsOn`
|
|
205
|
+
* keys appear earlier. `keys` is the set of all keys this pipeline
|
|
206
|
+
* produces; the runner uses it for fast existence checks and the
|
|
207
|
+
* builder uses it for missing-dep validation.
|
|
208
|
+
*/
|
|
209
|
+
interface ContributorPipeline {
|
|
210
|
+
readonly contributors: readonly ContributorRegistration[];
|
|
211
|
+
readonly keys: ReadonlySet<string>;
|
|
212
|
+
}
|
|
213
|
+
interface BuildPipelineOptions {
|
|
214
|
+
/** Optional route identifier surfaced in diagnostic errors (e.g., 'GET /projects/:id'). */
|
|
215
|
+
route?: string;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Build, validate, and topo-sort a contributor pipeline.
|
|
219
|
+
*
|
|
220
|
+
* Pipeline:
|
|
221
|
+
*
|
|
222
|
+
* 1. Group sources by precedence (method > class > module > adapter > global).
|
|
223
|
+
* 2. Within each precedence level, two contributors with the same `key`
|
|
224
|
+
* raise {@link DuplicateContributorError}.
|
|
225
|
+
* 3. Across levels, the highest-precedence contributor wins each key
|
|
226
|
+
* (lower-precedence duplicates are silently dropped — that is the
|
|
227
|
+
* documented override mechanism, not an error).
|
|
228
|
+
* 4. Every key referenced by `dependsOn` must be produced by the
|
|
229
|
+
* surviving set, otherwise {@link MissingContributorError}.
|
|
230
|
+
* 5. Kahn's algorithm topo-sorts the survivors. Any nodes left after
|
|
231
|
+
* the queue drains form a cycle → {@link ContributorCycleError}
|
|
232
|
+
* with a reconstructed path.
|
|
233
|
+
*
|
|
234
|
+
* Pure function — no DI, no I/O. Safe to call once at startup per
|
|
235
|
+
* route and cache the result.
|
|
236
|
+
*/
|
|
237
|
+
declare function buildPipeline(sources: readonly SourcedRegistration[], options?: BuildPipelineOptions): ContributorPipeline;
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/core/contributor-runner.d.ts
|
|
240
|
+
interface RunContributorsOptions {
|
|
241
|
+
/** Pre-built, validated, topo-sorted pipeline. */
|
|
242
|
+
pipeline: ContributorPipeline;
|
|
243
|
+
/** The execution context contributors read from and write into. */
|
|
244
|
+
ctx: ExecutionContext;
|
|
245
|
+
/** DI container used to resolve declared `deps`. */
|
|
246
|
+
container: Container;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Execute a built {@link ContributorPipeline} against an {@link ExecutionContext}.
|
|
250
|
+
*
|
|
251
|
+
* Sequential — one contributor at a time, in the topo order chosen at
|
|
252
|
+
* pipeline-build time. Per `architecture.md` §20.10, V1 does not run
|
|
253
|
+
* contributors in parallel even within the same topo level; that is a
|
|
254
|
+
* V2 follow-up gated on profiling.
|
|
255
|
+
*
|
|
256
|
+
* ## Error matrix (architecture.md §20.9)
|
|
257
|
+
*
|
|
258
|
+
* | resolve outcome | optional | onError defined | runner behaviour |
|
|
259
|
+
* |-----------------|----------|-----------------|--------------------------------------------------|
|
|
260
|
+
* | throws | true | — | skip; `ctx.get(key)` remains undefined |
|
|
261
|
+
* | throws | false | yes | call hook; returned value (if any) stored |
|
|
262
|
+
* | throws | false | no | propagate the original error |
|
|
263
|
+
* | hook throws | — | yes | propagate the new error |
|
|
264
|
+
* | hook returns | — | yes | undefined/void → skip; value → `ctx.set(key, v)` |
|
|
265
|
+
* | resolves | — | — | `ctx.set(key, value)` |
|
|
266
|
+
*
|
|
267
|
+
* Container.resolve() throwing while building `deps` is treated as a
|
|
268
|
+
* resolve-side throw and flows through the same matrix — adopters who
|
|
269
|
+
* need different behaviour for missing-DI vs. data-fetch failures can
|
|
270
|
+
* wrap the container access inside their own `resolve()`.
|
|
271
|
+
*/
|
|
272
|
+
declare function runContributors(options: RunContributorsOptions): Promise<void>;
|
|
273
|
+
//#endregion
|
|
274
|
+
export { pushClassMeta as C, setInMetaRecord as D, setInMetaMap as E, setMethodMeta as O, hasClassMeta as S, setClassMeta as T, getClassMetaOrUndefined as _, ContributorSource as a, getMethodMeta as b, ContributorCycleError as c, CircuitBreaker as d, CircuitBreakerOptions as f, getClassMeta as g, CircuitOpenError as h, ContributorPipeline as i, DuplicateContributorError as l, CircuitBreakerStats as m, runContributors as n, SourcedRegistration as o, CircuitBreakerState as p, BuildPipelineOptions as r, buildPipeline as s, RunContributorsOptions as t, MissingContributorError as u, getMetaMap as v, pushMethodMeta as w, getMethodMetaOrUndefined as x, getMetaRecord as y };
|
|
275
|
+
//# sourceMappingURL=index-BQM9pJrV.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BQM9pJrV.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"],"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,EA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gC7C,KAAA;AAAA;;;AHzBF;;;;;;;;;;;;;;;;;AAKA;iBG2CgB,aAAA,CACd,OAAA,WAAkB,mBAAA,IAClB,OAAA,GAAS,oBAAA,GACR,mBAAA;;;UC9Ec,sBAAA;;EAEf,QAAA,EAAU,mBAAA;;EAEV,GAAA,EAAK,gBAAA;;EAEL,SAAA,EAAW,SAAA;AAAA;;;AJVgC;;;;;AAmB7C;;;;;;;;;;;;AAKA;;;;;iBIasB,eAAA,CAAgB,OAAA,EAAS,sBAAA,GAAyB,OAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { d as EnvKey } from "./decorators-
|
|
2
|
+
import { d as EnvKey } from "./decorators-H42oPg0m.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-
|
|
245
|
+
//# sourceMappingURL=index-Cf-MGrqT.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-Cf-MGrqT.d.mts","names":[],"sources":["../src/config/env.ts","../src/config/config-service.ts"],"mappings":";;;;;;;AAmCA;;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,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,GAAA,0BAA6B,IAAA,EAAM,GAAA,EAAK,CAAA,GAAI,IAAA,CAAK,CAAA;EACjD,MAAA,IAAU,QAAA,CAAS,IAAA;EACnB,MAAA;EACA,YAAA;EACA,aAAA;EACA,MAAA;AAAA;;;;;;;;;;;;;AD8BF;;;;;;;;;;;;;;;;iBCCgB,mBAAA,WAA8B,CAAA,CAAE,SAAA,MAAA,CAAgB,MAAA,EAAQ,CAAA;EAAA,QAqC5D,kBAAA,CAAkB,CAAA,CAAA,IAAA,CAAA,MAAA,CAAA,CAAA;AAAA"}
|
|
@@ -181,4 +181,4 @@ declare function parseQuery<TConfig extends QueryFieldConfig | undefined = undef
|
|
|
181
181
|
declare function buildQueryParams(parsed: Partial<ParsedQuery>): Record<string, string | string[] | number>;
|
|
182
182
|
//#endregion
|
|
183
183
|
export { SortItem as _, parseSearchQuery as a, FILTER_OPERATORS as c, FilterOperator as d, PaginatedResponse as f, QueryFieldConfig as g, QueryBuilderAdapter as h, parseQuery as i, FieldsOf as l, ParsedQuery as m, parseFilters as n, parseSort as o, PaginationParams as p, parsePagination as r, ColumnQueryFieldConfig as s, buildQueryParams as t, FilterItem as u, StringQueryFieldConfig as v, TypedParsedQuery as y };
|
|
184
|
-
//# sourceMappingURL=index-
|
|
184
|
+
//# sourceMappingURL=index-RNK41JPE.d.mts.map
|