@forinda/kickjs 3.0.7 → 3.1.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-A1E1XBhE.d.mts → adapter-DjL8ql5d.d.mts} +21 -3
- package/dist/adapter-DjL8ql5d.d.mts.map +1 -0
- package/dist/{application-BwLUFfQy.mjs → application-DndmY_Qw.mjs} +5 -5
- package/dist/{application-BwLUFfQy.mjs.map → application-DndmY_Qw.mjs.map} +1 -1
- package/dist/{bootstrap-DV13o-cB.mjs → bootstrap-CXcE2wea.mjs} +6 -6
- package/dist/{bootstrap-DV13o-cB.mjs.map → bootstrap-CXcE2wea.mjs.map} +1 -1
- package/dist/{chunk-DXYGQY5w.mjs → chunk-C9ew9lwC.mjs} +1 -1
- package/dist/config/index.mjs +3 -3
- package/dist/{config-BizkbnKi.mjs → config-CD6z78Es.mjs} +3 -3
- package/dist/{config-BizkbnKi.mjs.map → config-CD6z78Es.mjs.map} +1 -1
- package/dist/{container-DrJQ6Zgx.mjs → container-DILIivpO.mjs} +3 -3
- package/dist/{container-DrJQ6Zgx.mjs.map → container-DILIivpO.mjs.map} +1 -1
- package/dist/core/adapter.d.mts +1 -1
- package/dist/core/adapter.mjs +1 -1
- package/dist/core/app-module.mjs +1 -1
- package/dist/core/cache.mjs +1 -1
- package/dist/core/container.mjs +2 -2
- package/dist/core/cron.mjs +2 -2
- package/dist/core/decorators.mjs +3 -3
- package/dist/core/errors.d.mts +1 -1
- package/dist/core/errors.mjs +33 -10
- package/dist/core/errors.mjs.map +1 -1
- package/dist/core/interfaces.mjs +1 -1
- package/dist/core/logger.mjs +1 -1
- package/dist/core/path.mjs +1 -1
- package/dist/core/plugin.d.mts +1 -1
- package/dist/core/plugin.mjs +1 -1
- package/dist/core/reactivity.mjs +1 -1
- package/dist/{core-DEFm-pvP.mjs → core-Bi6XNE_C.mjs} +4 -4
- package/dist/{core-DEFm-pvP.mjs.map → core-Bi6XNE_C.mjs.map} +1 -1
- package/dist/{env-BDN9v7Yx.mjs → env-hnrBl1G9.mjs} +4 -4
- package/dist/{env-BDN9v7Yx.mjs.map → env-hnrBl1G9.mjs.map} +1 -1
- package/dist/{errors-BX7Zosvv.d.mts → errors-BOUCRl-p.d.mts} +21 -8
- package/dist/errors-BOUCRl-p.d.mts.map +1 -0
- package/dist/http/application.d.mts +2 -2
- package/dist/http/application.mjs +2 -2
- package/dist/http/bootstrap.mjs +2 -2
- package/dist/http/context.mjs +2 -2
- package/dist/http/middleware/cors.mjs +1 -1
- package/dist/http/middleware/csrf.mjs +1 -1
- package/dist/http/middleware/error-handler.d.mts +10 -1
- package/dist/http/middleware/error-handler.d.mts.map +1 -1
- package/dist/http/middleware/error-handler.mjs +17 -5
- package/dist/http/middleware/error-handler.mjs.map +1 -1
- 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.mjs +1 -1
- package/dist/http/middleware/validate.d.mts +6 -1
- package/dist/http/middleware/validate.d.mts.map +1 -1
- package/dist/http/middleware/validate.mjs +21 -23
- 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.mjs +2 -2
- package/dist/http/router-builder.mjs +4 -4
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +9 -9
- package/dist/{metadata-CGOLNICI.mjs → metadata-BcaUHcSD.mjs} +2 -2
- package/dist/{metadata-CGOLNICI.mjs.map → metadata-BcaUHcSD.mjs.map} +1 -1
- package/dist/{plugin-DcDVlPTI.d.mts → plugin-Cvacmm7N.d.mts} +2 -2
- package/dist/{plugin-DcDVlPTI.d.mts.map → plugin-Cvacmm7N.d.mts.map} +1 -1
- package/dist/{query-Baxld1NB.mjs → query-BTaH2fIN.mjs} +2 -2
- package/dist/{query-Baxld1NB.mjs.map → query-BTaH2fIN.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/adapter-A1E1XBhE.d.mts.map +0 -1
- package/dist/errors-BX7Zosvv.d.mts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-BOUCRl-p.d.mts","names":[],"sources":["../src/core/errors.ts"],"mappings":";;;AAUA;;;;;;;;;cAAa,UAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;KAmCD,cAAA,WAAyB,UAAA,eAAyB,UAAA;;UAG7C,eAAA;EACf,KAAA;EACA,OAAA;EACA,IAAA;AAAA;;;AAeF;;;;;;;;;;cAAa,aAAA,SAAsB,KAAA;EAAA,SAEf,MAAA;EAAA,SAEA,OAAA;EAAA,SACA,OAAA,GAAU,MAAA;cAHV,MAAA,UAChB,OAAA,UACgB,OAAA,wBACA,OAAA,GAAU,MAAA;EAsDsD;EA/ClF,WAAA,CAAY,OAAA,EAAS,MAAA,mBAAyB,aAAA;EA0DuC;EAAA,OAlD9E,YAAA,CAAa,KAAA,OAAY,OAAA,YAAmB,aAAA;EAAA,OAc5C,UAAA,CAAW,OAAA,YAAuB,aAAA;EAAA,OAGlC,YAAA,CAAa,OAAA,WAA0B,eAAA,YAAwB,aAAA;EAAA,OAQ/D,SAAA,CAAU,OAAA,YAAqB,aAAA;EAAA,OAG/B,QAAA,CAAS,OAAA,YAAqB,aAAA;EAAA,OAG9B,gBAAA,CAAiB,cAAA,YAA0B,OAAA,YAA8B,aAAA;EAAA,OAKzE,QAAA,CAAS,OAAA,YAAoB,aAAA;EAAA,OAG7B,aAAA,CAAc,OAAA,WAAkC,OAAA,GAAU,eAAA,KAAiB,aAAA;EAAA,OAG3E,eAAA,CAAgB,OAAA,WAA+B,iBAAA,YAA0B,aAAA;EAAA,OAQzE,kBAAA,CAAmB,OAAA,WAAiC,iBAAA,YAA0B,aAAA;EAAA,OAQ9E,QAAA,CAAS,OAAA,YAAiC,aAAA;AAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { t as Container } from "../container-BJb34faa.mjs";
|
|
3
|
-
import { r as AppAdapter } from "../adapter-
|
|
3
|
+
import { r as AppAdapter } from "../adapter-DjL8ql5d.mjs";
|
|
4
4
|
import { n as AppModuleClass } from "../app-module-Cotu9TIC.mjs";
|
|
5
|
-
import { t as KickPlugin } from "../plugin-
|
|
5
|
+
import { t as KickPlugin } from "../plugin-Cvacmm7N.mjs";
|
|
6
6
|
import http from "node:http";
|
|
7
7
|
import { Express, RequestHandler } from "express";
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v3.0
|
|
2
|
+
* @forinda/kickjs v3.1.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 { t as Application } from "../application-
|
|
11
|
+
import { t as Application } from "../application-DndmY_Qw.mjs";
|
|
12
12
|
export { Application };
|
package/dist/http/bootstrap.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v3.0
|
|
2
|
+
* @forinda/kickjs v3.1.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 { t as bootstrap } from "../bootstrap-
|
|
11
|
+
import { t as bootstrap } from "../bootstrap-CXcE2wea.mjs";
|
|
12
12
|
export { bootstrap };
|
package/dist/http/context.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v3.0
|
|
2
|
+
* @forinda/kickjs v3.1.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
import { i as parseQuery } from "../query-
|
|
11
|
+
import { i as parseQuery } from "../query-BTaH2fIN.mjs";
|
|
12
12
|
//#region src/http/context.ts
|
|
13
13
|
/**
|
|
14
14
|
* Unified request/response abstraction passed to every controller method.
|
|
@@ -4,7 +4,16 @@ import { NextFunction, Request, Response } from "express";
|
|
|
4
4
|
//#region src/http/middleware/error-handler.d.ts
|
|
5
5
|
/** Catch-all for unmatched routes */
|
|
6
6
|
declare function notFoundHandler(): (_req: Request, res: Response, _next: NextFunction) => void;
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Global error handler.
|
|
9
|
+
*
|
|
10
|
+
* Default behavior strips error `details` from the response in production
|
|
11
|
+
* (NODE_ENV === 'production') so internal context (DB errors, validation
|
|
12
|
+
* issues, custom payloads) does not leak to clients. Apps that want to
|
|
13
|
+
* expose details in production — for client-facing field-level validation,
|
|
14
|
+
* for example — should pass their own `onError` to `bootstrap()` and decide
|
|
15
|
+
* the policy explicitly.
|
|
16
|
+
*/
|
|
8
17
|
declare function errorHandler(): (err: any, req: Request, res: Response, _next: NextFunction) => Response<any, Record<string, any>> | undefined;
|
|
9
18
|
//#endregion
|
|
10
19
|
export { errorHandler, notFoundHandler };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-handler.d.mts","names":[],"sources":["../../../src/http/middleware/error-handler.ts"],"mappings":";;;;;iBAMgB,eAAA,CAAA,IACN,IAAA,EAAM,OAAA,EAAS,GAAA,EAAK,QAAA,EAAU,KAAA,EAAO,YAAA;AAD/C
|
|
1
|
+
{"version":3,"file":"error-handler.d.mts","names":[],"sources":["../../../src/http/middleware/error-handler.ts"],"mappings":";;;;;iBAMgB,eAAA,CAAA,IACN,IAAA,EAAM,OAAA,EAAS,GAAA,EAAK,QAAA,EAAU,KAAA,EAAO,YAAA;AAD/C;;;;;;;;;;AAAA,iBAgBgB,YAAA,CAAA,IAEN,GAAA,OAAU,GAAA,EAAK,OAAA,EAAS,GAAA,EAAK,QAAA,EAAU,KAAA,EAAO,YAAA,KAAY,QAAA,MAAA,MAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v3.0
|
|
2
|
+
* @forinda/kickjs v3.1.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { createLogger } from "../../core/logger.mjs";
|
|
12
12
|
import { HttpException } from "../../core/errors.mjs";
|
|
13
|
-
import "../../core-
|
|
13
|
+
import "../../core-Bi6XNE_C.mjs";
|
|
14
14
|
//#region src/http/middleware/error-handler.ts
|
|
15
15
|
const log = createLogger("ErrorHandler");
|
|
16
16
|
/** Catch-all for unmatched routes */
|
|
@@ -19,8 +19,18 @@ function notFoundHandler() {
|
|
|
19
19
|
res.status(404).json({ message: "Not Found" });
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Global error handler.
|
|
24
|
+
*
|
|
25
|
+
* Default behavior strips error `details` from the response in production
|
|
26
|
+
* (NODE_ENV === 'production') so internal context (DB errors, validation
|
|
27
|
+
* issues, custom payloads) does not leak to clients. Apps that want to
|
|
28
|
+
* expose details in production — for client-facing field-level validation,
|
|
29
|
+
* for example — should pass their own `onError` to `bootstrap()` and decide
|
|
30
|
+
* the policy explicitly.
|
|
31
|
+
*/
|
|
23
32
|
function errorHandler() {
|
|
33
|
+
const isProduction = process.env.NODE_ENV === "production";
|
|
24
34
|
return (err, req, res, _next) => {
|
|
25
35
|
if (res.headersSent) {
|
|
26
36
|
log.warn(`Error after headers sent: ${err?.message || "Unknown"}`);
|
|
@@ -30,14 +40,16 @@ function errorHandler() {
|
|
|
30
40
|
const firstIssue = err.issues?.[0];
|
|
31
41
|
return res.status(422).json({
|
|
32
42
|
message: firstIssue?.message || "Validation failed",
|
|
33
|
-
errors: err.issues
|
|
43
|
+
...isProduction ? {} : { errors: err.issues }
|
|
34
44
|
});
|
|
35
45
|
}
|
|
36
46
|
if (err instanceof HttpException) {
|
|
37
47
|
if (err.status >= 500) log.error(err, err.message);
|
|
48
|
+
if (err.headers) for (const [k, v] of Object.entries(err.headers)) res.setHeader(k, v);
|
|
49
|
+
const exposeDetails = !isProduction && err.details !== void 0;
|
|
38
50
|
return res.status(err.status).json({
|
|
39
51
|
message: err.message,
|
|
40
|
-
...
|
|
52
|
+
...exposeDetails ? { errors: err.details } : {}
|
|
41
53
|
});
|
|
42
54
|
}
|
|
43
55
|
const status = err.status || err.statusCode || 500;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-handler.mjs","names":[],"sources":["../../../src/http/middleware/error-handler.ts"],"sourcesContent":["import type { Request, Response, NextFunction } from 'express'\nimport { HttpException, createLogger } from '../../core'\n\nconst log = createLogger('ErrorHandler')\n\n/** Catch-all for unmatched routes */\nexport function notFoundHandler() {\n return (_req: Request, res: Response, _next: NextFunction) => {\n res.status(404).json({ message: 'Not Found' })\n }\n}\n\n
|
|
1
|
+
{"version":3,"file":"error-handler.mjs","names":[],"sources":["../../../src/http/middleware/error-handler.ts"],"sourcesContent":["import type { Request, Response, NextFunction } from 'express'\nimport { HttpException, createLogger } from '../../core'\n\nconst log = createLogger('ErrorHandler')\n\n/** Catch-all for unmatched routes */\nexport function notFoundHandler() {\n return (_req: Request, res: Response, _next: NextFunction) => {\n res.status(404).json({ message: 'Not Found' })\n }\n}\n\n/**\n * Global error handler.\n *\n * Default behavior strips error `details` from the response in production\n * (NODE_ENV === 'production') so internal context (DB errors, validation\n * issues, custom payloads) does not leak to clients. Apps that want to\n * expose details in production — for client-facing field-level validation,\n * for example — should pass their own `onError` to `bootstrap()` and decide\n * the policy explicitly.\n */\nexport function errorHandler() {\n const isProduction = process.env.NODE_ENV === 'production'\n return (err: any, req: Request, res: Response, _next: NextFunction) => {\n // Don't write after headers are already sent\n if (res.headersSent) {\n log.warn(`Error after headers sent: ${err?.message || 'Unknown'}`)\n return\n }\n\n // Zod validation errors\n if (err?.name === 'ZodError') {\n const firstIssue = err.issues?.[0]\n return res.status(422).json({\n message: firstIssue?.message || 'Validation failed',\n ...(isProduction ? {} : { errors: err.issues }),\n })\n }\n\n // HttpException (expected application errors)\n if (err instanceof HttpException) {\n if (err.status >= 500) {\n log.error(err, err.message)\n }\n if (err.headers) {\n for (const [k, v] of Object.entries(err.headers)) {\n res.setHeader(k, v)\n }\n }\n const exposeDetails = !isProduction && err.details !== undefined\n return res.status(err.status).json({\n message: err.message,\n ...(exposeDetails ? { errors: err.details } : {}),\n })\n }\n\n // Unexpected errors — always log\n const status = err.status || err.statusCode || 500\n log.error(err, `${req.method} ${req.originalUrl} — ${err.message || 'Unhandled error'}`)\n const message = status === 500 ? 'Internal Server Error' : err.message || 'Error'\n res.status(status).json({ message })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,MAAM,MAAM,aAAa,eAAe;;AAGxC,SAAgB,kBAAkB;AAChC,SAAQ,MAAe,KAAe,UAAwB;AAC5D,MAAI,OAAO,IAAI,CAAC,KAAK,EAAE,SAAS,aAAa,CAAC;;;;;;;;;;;;;AAclD,SAAgB,eAAe;CAC7B,MAAM,eAAe,QAAQ,IAAI,aAAa;AAC9C,SAAQ,KAAU,KAAc,KAAe,UAAwB;AAErE,MAAI,IAAI,aAAa;AACnB,OAAI,KAAK,6BAA6B,KAAK,WAAW,YAAY;AAClE;;AAIF,MAAI,KAAK,SAAS,YAAY;GAC5B,MAAM,aAAa,IAAI,SAAS;AAChC,UAAO,IAAI,OAAO,IAAI,CAAC,KAAK;IAC1B,SAAS,YAAY,WAAW;IAChC,GAAI,eAAe,EAAE,GAAG,EAAE,QAAQ,IAAI,QAAQ;IAC/C,CAAC;;AAIJ,MAAI,eAAe,eAAe;AAChC,OAAI,IAAI,UAAU,IAChB,KAAI,MAAM,KAAK,IAAI,QAAQ;AAE7B,OAAI,IAAI,QACN,MAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,IAAI,QAAQ,CAC9C,KAAI,UAAU,GAAG,EAAE;GAGvB,MAAM,gBAAgB,CAAC,gBAAgB,IAAI,YAAY,KAAA;AACvD,UAAO,IAAI,OAAO,IAAI,OAAO,CAAC,KAAK;IACjC,SAAS,IAAI;IACb,GAAI,gBAAgB,EAAE,QAAQ,IAAI,SAAS,GAAG,EAAE;IACjD,CAAC;;EAIJ,MAAM,SAAS,IAAI,UAAU,IAAI,cAAc;AAC/C,MAAI,MAAM,KAAK,GAAG,IAAI,OAAO,GAAG,IAAI,YAAY,KAAK,IAAI,WAAW,oBAAoB;EACxF,MAAM,UAAU,WAAW,MAAM,0BAA0B,IAAI,WAAW;AAC1E,MAAI,OAAO,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v3.0
|
|
2
|
+
* @forinda/kickjs v3.1.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
11
|
import { createLogger } from "../../core/logger.mjs";
|
|
12
|
-
import "../../core-
|
|
12
|
+
import "../../core-Bi6XNE_C.mjs";
|
|
13
13
|
//#region src/http/middleware/request-logger.ts
|
|
14
14
|
/**
|
|
15
15
|
* Middleware that logs every request with method, URL, status, duration, and request ID.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v3.0
|
|
2
|
+
* @forinda/kickjs v3.1.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
import { t as __require } from "../../chunk-
|
|
11
|
+
import { t as __require } from "../../chunk-C9ew9lwC.mjs";
|
|
12
12
|
import { Logger } from "../../core/logger.mjs";
|
|
13
|
-
import "../../core-
|
|
13
|
+
import "../../core-Bi6XNE_C.mjs";
|
|
14
14
|
import { join, resolve } from "node:path";
|
|
15
15
|
import { existsSync, readFileSync } from "node:fs";
|
|
16
16
|
//#region src/http/middleware/spa.ts
|
|
@@ -11,8 +11,13 @@ interface ValidationSchema {
|
|
|
11
11
|
* Express middleware that validates request body/query/params against schemas.
|
|
12
12
|
* Works with any validation library that exposes `.safeParse(data)` returning
|
|
13
13
|
* `{ success: true, data }` or `{ success: false, error: { issues } }`.
|
|
14
|
+
*
|
|
15
|
+
* Validation failures are forwarded via `next(err)` as an `HttpException`, so
|
|
16
|
+
* they flow through the application's global error handler (`onError`) and
|
|
17
|
+
* produce a uniform response envelope. Apps that keep the built-in handler
|
|
18
|
+
* continue to see the same `{ message, errors: [{ field, message }] }` body.
|
|
14
19
|
*/
|
|
15
|
-
declare function validate(schema: ValidationSchema): (req: Request,
|
|
20
|
+
declare function validate(schema: ValidationSchema): (req: Request, _res: Response, next: NextFunction) => void;
|
|
16
21
|
//#endregion
|
|
17
22
|
export { ValidationSchema, validate };
|
|
18
23
|
//# sourceMappingURL=validate.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.mts","names":[],"sources":["../../../src/http/middleware/validate.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"validate.d.mts","names":[],"sources":["../../../src/http/middleware/validate.ts"],"mappings":";;;;UAGiB,gBAAA;EACf,IAAA;EACA,KAAA;EACA,MAAA;AAAA;;;;;;;AA2BF;;;;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.0
|
|
2
|
+
* @forinda/kickjs v3.1.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -8,46 +8,44 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
+
import { HttpException, HttpStatus } from "../../core/errors.mjs";
|
|
12
|
+
import "../../core-Bi6XNE_C.mjs";
|
|
11
13
|
//#region src/http/middleware/validate.ts
|
|
14
|
+
function toValidationException(error, message, useFirstIssueMessage) {
|
|
15
|
+
const issues = error.issues || [];
|
|
16
|
+
const details = issues.map((i) => ({
|
|
17
|
+
field: i.path?.join(".") ?? "",
|
|
18
|
+
message: i.message
|
|
19
|
+
}));
|
|
20
|
+
const finalMessage = useFirstIssueMessage ? issues[0]?.message ?? message : message;
|
|
21
|
+
return new HttpException(HttpStatus.UNPROCESSABLE_ENTITY, finalMessage, details);
|
|
22
|
+
}
|
|
12
23
|
/**
|
|
13
24
|
* Express middleware that validates request body/query/params against schemas.
|
|
14
25
|
* Works with any validation library that exposes `.safeParse(data)` returning
|
|
15
26
|
* `{ success: true, data }` or `{ success: false, error: { issues } }`.
|
|
27
|
+
*
|
|
28
|
+
* Validation failures are forwarded via `next(err)` as an `HttpException`, so
|
|
29
|
+
* they flow through the application's global error handler (`onError`) and
|
|
30
|
+
* produce a uniform response envelope. Apps that keep the built-in handler
|
|
31
|
+
* continue to see the same `{ message, errors: [{ field, message }] }` body.
|
|
16
32
|
*/
|
|
17
33
|
function validate(schema) {
|
|
18
|
-
return (req,
|
|
34
|
+
return (req, _res, next) => {
|
|
19
35
|
try {
|
|
20
36
|
if (schema.body) {
|
|
21
37
|
const result = schema.body.safeParse(req.body);
|
|
22
|
-
if (!result.success) return
|
|
23
|
-
message: result.error.issues[0]?.message || "Validation failed",
|
|
24
|
-
errors: result.error.issues.map((i) => ({
|
|
25
|
-
field: i.path.join("."),
|
|
26
|
-
message: i.message
|
|
27
|
-
}))
|
|
28
|
-
});
|
|
38
|
+
if (!result.success) return next(toValidationException(result.error, "Validation failed", true));
|
|
29
39
|
req.body = result.data;
|
|
30
40
|
}
|
|
31
41
|
if (schema.query) {
|
|
32
42
|
const result = schema.query.safeParse(req.query);
|
|
33
|
-
if (!result.success) return
|
|
34
|
-
message: "Invalid query parameters",
|
|
35
|
-
errors: result.error.issues.map((i) => ({
|
|
36
|
-
field: i.path.join("."),
|
|
37
|
-
message: i.message
|
|
38
|
-
}))
|
|
39
|
-
});
|
|
43
|
+
if (!result.success) return next(toValidationException(result.error, "Invalid query parameters", false));
|
|
40
44
|
req.query = result.data;
|
|
41
45
|
}
|
|
42
46
|
if (schema.params) {
|
|
43
47
|
const result = schema.params.safeParse(req.params);
|
|
44
|
-
if (!result.success) return
|
|
45
|
-
message: "Invalid path parameters",
|
|
46
|
-
errors: result.error.issues.map((i) => ({
|
|
47
|
-
field: i.path.join("."),
|
|
48
|
-
message: i.message
|
|
49
|
-
}))
|
|
50
|
-
});
|
|
48
|
+
if (!result.success) return next(toValidationException(result.error, "Invalid path parameters", false));
|
|
51
49
|
req.params = result.data;
|
|
52
50
|
}
|
|
53
51
|
next();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.mjs","names":[],"sources":["../../../src/http/middleware/validate.ts"],"sourcesContent":["import type { Request, Response, NextFunction } from 'express'\n\nexport interface ValidationSchema {\n body?: any\n query?: any\n params?: any\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 */\nexport function validate(schema: ValidationSchema) {\n return (req: Request,
|
|
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 ;(req as any).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 ;(req as any).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,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;AAEnF,QAAY,QAAQ,OAAO;;AAG/B,OAAI,OAAO,QAAQ;IACjB,MAAM,SAAS,OAAO,OAAO,UAAU,IAAI,OAAO;AAClD,QAAI,CAAC,OAAO,QACV,QAAO,KAAK,sBAAsB,OAAO,OAAO,2BAA2B,MAAM,CAAC;AAElF,QAAY,SAAS,OAAO;;AAGhC,SAAM;WACC,KAAK;AACZ,QAAK,IAAI"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v3.0
|
|
2
|
+
* @forinda/kickjs v3.1.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-Bi6XNE_C.mjs";
|
|
13
13
|
import { resolve } from "node:path";
|
|
14
14
|
//#region src/http/middleware/views.ts
|
|
15
15
|
const log = Logger.for("ViewEngine");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v3.0
|
|
2
|
+
* @forinda/kickjs v3.1.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-BTaH2fIN.mjs";
|
|
12
12
|
export { FILTER_OPERATORS, buildQueryParams, parseFilters, parsePagination, parseQuery, parseSearchQuery, parseSort };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v3.0
|
|
2
|
+
* @forinda/kickjs v3.1.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -9,9 +9,9 @@
|
|
|
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-
|
|
12
|
+
import { a as getMethodMeta, o as getMethodMetaOrUndefined, t as getClassMeta } from "../metadata-BcaUHcSD.mjs";
|
|
13
|
+
import { t as Container } from "../container-DILIivpO.mjs";
|
|
14
|
+
import "../core-Bi6XNE_C.mjs";
|
|
15
15
|
import { RequestContext } from "./context.mjs";
|
|
16
16
|
import { validate } from "./middleware/validate.mjs";
|
|
17
17
|
import { buildUploadMiddleware } from "./middleware/upload.mjs";
|
package/dist/index.d.mts
CHANGED
|
@@ -3,14 +3,14 @@ import { a as METADATA, c as Scope, i as Constructor, l as ServiceOptions, n as
|
|
|
3
3
|
import { C as Put, D as Value, E as Service, O as normalizeApiQueryParamsConfig, S as PostConstruct, T as RouteDefinition, _ as Injectable, a as Builder, b as Patch, c as Controller, d as EnvKey, f as FileTypeFilter, g as Inject, h as Get, i as BaseUploadOptions, l as Delete, m as FileUploadConfig, n as ApiQueryParamsConfig, o as ColumnApiQueryParamsConfig, p as FileUpload, r as Autowired, s as Component, t as ApiQueryParams, u as Env, v as Middleware, w as Repository, x as Post, y as MiddlewareHandler } from "./decorators-C9_SN7ge.mjs";
|
|
4
4
|
import { a as baseEnvSchema, c as loadEnv, l as reloadEnv, n as TypedConfigService, o as defineEnv, r as createConfigService, s as getEnv, t as ConfigService, u as resetEnvCache } from "./index-DNVfGjF9.mjs";
|
|
5
5
|
import { a as tokenName, c as createToken, i as KickJsRegistry, l as isInjectionToken, n as ContainerChangeEvent, o as INJECTION_TOKEN, r as ContainerChangeListener, s as InjectionToken, t as Container } from "./container-BJb34faa.mjs";
|
|
6
|
-
import { a as MiddlewarePhase, i as AppAdapterClass, n as AdapterMiddleware, r as AppAdapter, t as AdapterContext } from "./adapter-
|
|
6
|
+
import { a as MiddlewarePhase, i as AppAdapterClass, n as AdapterMiddleware, r as AppAdapter, t as AdapterContext } from "./adapter-DjL8ql5d.mjs";
|
|
7
7
|
import { n as AppModuleClass, r as ModuleRoutes, t as AppModule } from "./app-module-Cotu9TIC.mjs";
|
|
8
8
|
import { a as Cacheable, c as setCacheProvider, i as CacheProvider, n as CacheEvict, o as MemoryCacheProvider, r as CacheOptions, s as getCacheProvider } from "./cache-CcTzzNdr.mjs";
|
|
9
9
|
import { i as getCronJobs, n as Cron, r as CronJobMeta, t as CRON_META } from "./cron-H-IyLcOr.mjs";
|
|
10
|
-
import { i as ValidationError, n as HttpStatus, r as HttpStatusCode, t as HttpException } from "./errors-
|
|
10
|
+
import { i as ValidationError, n as HttpStatus, r as HttpStatusCode, t as HttpException } from "./errors-BOUCRl-p.mjs";
|
|
11
11
|
import { a as logger, i as createLogger, n as Logger, o as rootLogger, r as LoggerProvider, t as ConsoleLoggerProvider } from "./logger-CW6FHtvU.mjs";
|
|
12
12
|
import { n as normalizePath, t as joinPaths } from "./path-B4JcbwKX.mjs";
|
|
13
|
-
import { t as KickPlugin } from "./plugin-
|
|
13
|
+
import { t as KickPlugin } from "./plugin-Cvacmm7N.mjs";
|
|
14
14
|
import { a as isRef, c as toRefs, i as computed, l as unref, n as Ref, o as reactive, r as WatchOptions, s as ref, t as ComputedRef, u as watch } from "./reactivity-I8nDlg4c.mjs";
|
|
15
15
|
import { _ as setInMetaRecord, a as CircuitOpenError, c as getMetaMap, d as getMethodMetaOrUndefined, f as hasClassMeta, g as setInMetaMap, h as setClassMeta, i as CircuitBreakerStats, l as getMetaRecord, m as pushMethodMeta, n as CircuitBreakerOptions, o as getClassMeta, p as pushClassMeta, r as CircuitBreakerState, s as getClassMetaOrUndefined, t as CircuitBreaker, u as getMethodMeta, v as setMethodMeta } from "./index-CwqjAF6I.mjs";
|
|
16
16
|
import { Application, ApplicationOptions, MiddlewareEntry } from "./http/application.mjs";
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v3.0
|
|
2
|
+
* @forinda/kickjs v3.1.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -10,21 +10,21 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { METADATA, Scope } from "./core/interfaces.mjs";
|
|
12
12
|
import { ConsoleLoggerProvider, Logger, createLogger, logger, rootLogger } from "./core/logger.mjs";
|
|
13
|
-
import { a as getMethodMeta, c as pushClassMeta, d as setInMetaMap, f as setInMetaRecord, i as getMetaRecord, l as pushMethodMeta, n as getClassMetaOrUndefined, o as getMethodMetaOrUndefined, p as setMethodMeta, r as getMetaMap, s as hasClassMeta, t as getClassMeta, u as setClassMeta } from "./metadata-
|
|
14
|
-
import { a as isInjectionToken, i as createToken, n as tokenName, r as INJECTION_TOKEN, t as Container } from "./container-
|
|
13
|
+
import { a as getMethodMeta, c as pushClassMeta, d as setInMetaMap, f as setInMetaRecord, i as getMetaRecord, l as pushMethodMeta, n as getClassMetaOrUndefined, o as getMethodMetaOrUndefined, p as setMethodMeta, r as getMetaMap, s as hasClassMeta, t as getClassMeta, u as setClassMeta } from "./metadata-BcaUHcSD.mjs";
|
|
14
|
+
import { a as isInjectionToken, i as createToken, n as tokenName, r as INJECTION_TOKEN, t as Container } from "./container-DILIivpO.mjs";
|
|
15
15
|
import { ApiQueryParams, Autowired, Builder, Component, Controller, Delete, FileUpload, Get, Inject, Injectable, Middleware, Patch, Post, PostConstruct, Put, Repository, Service, Value, normalizeApiQueryParamsConfig } from "./core/decorators.mjs";
|
|
16
16
|
import { CRON_META, Cron, getCronJobs } from "./core/cron.mjs";
|
|
17
17
|
import { CacheEvict, Cacheable, MemoryCacheProvider, getCacheProvider, setCacheProvider } from "./core/cache.mjs";
|
|
18
18
|
import { HttpException, HttpStatus } from "./core/errors.mjs";
|
|
19
19
|
import { joinPaths, normalizePath } from "./core/path.mjs";
|
|
20
|
-
import { n as CircuitOpenError, t as CircuitBreaker } from "./core-
|
|
20
|
+
import { n as CircuitOpenError, t as CircuitBreaker } from "./core-Bi6XNE_C.mjs";
|
|
21
21
|
import { computed, isRef, reactive, ref, toRefs, unref, watch } from "./core/reactivity.mjs";
|
|
22
22
|
import { REQUEST_ID_HEADER, requestId } from "./http/middleware/request-id.mjs";
|
|
23
23
|
import { errorHandler, notFoundHandler } from "./http/middleware/error-handler.mjs";
|
|
24
|
-
import { i as requestStore, n as requestScopeMiddleware, r as getRequestStore, t as Application } from "./application-
|
|
25
|
-
import { a as reloadEnv, i as loadEnv, n as defineEnv, o as resetEnvCache, r as getEnv, t as baseEnvSchema } from "./env-
|
|
26
|
-
import { n as isClusterPrimary, t as bootstrap } from "./bootstrap-
|
|
27
|
-
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-
|
|
24
|
+
import { i as requestStore, n as requestScopeMiddleware, r as getRequestStore, t as Application } from "./application-DndmY_Qw.mjs";
|
|
25
|
+
import { a as reloadEnv, i as loadEnv, n as defineEnv, o as resetEnvCache, r as getEnv, t as baseEnvSchema } from "./env-hnrBl1G9.mjs";
|
|
26
|
+
import { n as isClusterPrimary, t as bootstrap } from "./bootstrap-CXcE2wea.mjs";
|
|
27
|
+
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-BTaH2fIN.mjs";
|
|
28
28
|
import { RequestContext } from "./http/context.mjs";
|
|
29
29
|
import { validate } from "./http/middleware/validate.mjs";
|
|
30
30
|
import { buildUploadMiddleware, cleanupFiles, resolveMimeTypes, upload } from "./http/middleware/upload.mjs";
|
|
@@ -37,7 +37,7 @@ import { rateLimit } from "./http/middleware/rate-limit.mjs";
|
|
|
37
37
|
import { session } from "./http/middleware/session.mjs";
|
|
38
38
|
import { ViewAdapter } from "./http/middleware/views.mjs";
|
|
39
39
|
import { SpaAdapter } from "./http/middleware/spa.mjs";
|
|
40
|
-
import { n as createConfigService, t as ConfigService } from "./config-
|
|
40
|
+
import { n as createConfigService, t as ConfigService } from "./config-CD6z78Es.mjs";
|
|
41
41
|
import crypto from "node:crypto";
|
|
42
42
|
//#region src/http/middleware/trace-context.ts
|
|
43
43
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v3.0
|
|
2
|
+
* @forinda/kickjs v3.1.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -73,4 +73,4 @@ function getMetaRecord(key, target) {
|
|
|
73
73
|
//#endregion
|
|
74
74
|
export { getMethodMeta as a, pushClassMeta as c, setInMetaMap as d, setInMetaRecord as f, getMetaRecord as i, pushMethodMeta as l, getClassMetaOrUndefined as n, getMethodMetaOrUndefined as o, setMethodMeta as p, getMetaMap as r, hasClassMeta as s, getClassMeta as t, setClassMeta as u };
|
|
75
75
|
|
|
76
|
-
//# sourceMappingURL=metadata-
|
|
76
|
+
//# sourceMappingURL=metadata-BcaUHcSD.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata-
|
|
1
|
+
{"version":3,"file":"metadata-BcaUHcSD.mjs","names":[],"sources":["../src/core/metadata.ts"],"sourcesContent":["import 'reflect-metadata'\nimport type { InjectionToken } from './token'\n\n/**\n * Typed utilities for reflect-metadata operations.\n *\n * Replaces scattered Reflect.defineMetadata/getMetadata calls with a single\n * source of truth. If we later move to Stage 3 decorators or a WeakMap-based\n * store, only this file changes — all 24+ consumer files stay untouched.\n *\n * Keys may be symbols, strings, or `InjectionToken<T>` objects produced by\n * `createToken()`. Using `createToken` is the preferred pattern because the\n * token's phantom type flows through the helpers, enabling type-safe reads.\n */\n\ntype MetaKey = symbol | string | InjectionToken<unknown>\n\n// ── Setters ─────────────────────────────────────────────────────\n\n/** Set metadata on a class (or prototype for property decorators) */\nexport function setClassMeta<T>(key: MetaKey, value: T, target: object): void {\n Reflect.defineMetadata(key, value, target)\n}\n\n/** Set metadata on a specific method */\nexport function setMethodMeta<T>(key: MetaKey, value: T, target: object, method: string): void {\n Reflect.defineMetadata(key, value, target, method)\n}\n\n// ── Getters ─────────────────────────────────────────────────────\n\n/** Get metadata from a class, returning `fallback` if not set */\nexport function getClassMeta<T>(key: MetaKey, target: object, fallback: T): T {\n return (Reflect.getMetadata(key, target) as T) ?? fallback\n}\n\n/** Get metadata from a specific method, returning `fallback` if not set */\nexport function getMethodMeta<T>(key: MetaKey, target: object, method: string, fallback: T): T {\n return (Reflect.getMetadata(key, target, method) as T) ?? fallback\n}\n\n/** Check if metadata exists on a class */\nexport function hasClassMeta(key: MetaKey, target: object): boolean {\n return Reflect.hasMetadata(key, target)\n}\n\n/** Get metadata from a class with no default (returns undefined if absent) */\nexport function getClassMetaOrUndefined<T>(key: MetaKey, target: object): T | undefined {\n return Reflect.getMetadata(key, target) as T | undefined\n}\n\n/** Get metadata from a method with no default (returns undefined if absent) */\nexport function getMethodMetaOrUndefined<T>(\n key: MetaKey,\n target: object,\n method: string,\n): T | undefined {\n return Reflect.getMetadata(key, target, method) as T | undefined\n}\n\n// ── Accumulate: Arrays ──────────────────────────────────────────\n\n/** Append items to an array stored in class metadata */\nexport function pushClassMeta<T>(key: MetaKey, target: object, ...items: T[]): void {\n const existing: T[] = Reflect.getOwnMetadata(key, target) ?? []\n Reflect.defineMetadata(key, [...existing, ...items], target)\n}\n\n/** Append items to an array stored in method metadata */\nexport function pushMethodMeta<T>(\n key: MetaKey,\n target: object,\n method: string,\n ...items: T[]\n): void {\n const existing: T[] = Reflect.getOwnMetadata(key, target, method) ?? []\n Reflect.defineMetadata(key, [...existing, ...items], target, method)\n}\n\n// ── Accumulate: Maps ────────────────────────────────────────────\n\n/** Set a key/value in a Map stored in class metadata */\nexport function setInMetaMap<K, V>(key: MetaKey, target: object, mapKey: K, mapValue: V): void {\n const inherited: Map<K, V> | undefined = Reflect.getOwnMetadata(key, target)\n const map = inherited ? new Map(inherited) : new Map<K, V>()\n map.set(mapKey, mapValue)\n Reflect.defineMetadata(key, map, target)\n}\n\n/** Get a Map from class metadata (returns empty Map if absent) */\nexport function getMetaMap<K, V>(key: MetaKey, target: object): Map<K, V> {\n return Reflect.getMetadata(key, target) ?? new Map()\n}\n\n// ── Accumulate: Records ─────────────────────────────────────────\n\n/** Set a key/value in a Record stored in class metadata */\nexport function setInMetaRecord<V>(\n key: MetaKey,\n target: object,\n recKey: string | number,\n recValue: V,\n): void {\n const inherited: Record<string | number, V> | undefined = Reflect.getOwnMetadata(key, target)\n const rec = inherited ? { ...inherited } : {}\n rec[recKey] = recValue\n Reflect.defineMetadata(key, rec, target)\n}\n\n/** Get a Record from class metadata (returns empty object if absent) */\nexport function getMetaRecord<V>(key: MetaKey, target: object): Record<string | number, V> {\n return Reflect.getMetadata(key, target) ?? {}\n}\n"],"mappings":";;;;;;;;;;;;;AAoBA,SAAgB,aAAgB,KAAc,OAAU,QAAsB;AAC5E,SAAQ,eAAe,KAAK,OAAO,OAAO;;;AAI5C,SAAgB,cAAiB,KAAc,OAAU,QAAgB,QAAsB;AAC7F,SAAQ,eAAe,KAAK,OAAO,QAAQ,OAAO;;;AAMpD,SAAgB,aAAgB,KAAc,QAAgB,UAAgB;AAC5E,QAAQ,QAAQ,YAAY,KAAK,OAAO,IAAU;;;AAIpD,SAAgB,cAAiB,KAAc,QAAgB,QAAgB,UAAgB;AAC7F,QAAQ,QAAQ,YAAY,KAAK,QAAQ,OAAO,IAAU;;;AAI5D,SAAgB,aAAa,KAAc,QAAyB;AAClE,QAAO,QAAQ,YAAY,KAAK,OAAO;;;AAIzC,SAAgB,wBAA2B,KAAc,QAA+B;AACtF,QAAO,QAAQ,YAAY,KAAK,OAAO;;;AAIzC,SAAgB,yBACd,KACA,QACA,QACe;AACf,QAAO,QAAQ,YAAY,KAAK,QAAQ,OAAO;;;AAMjD,SAAgB,cAAiB,KAAc,QAAgB,GAAG,OAAkB;CAClF,MAAM,WAAgB,QAAQ,eAAe,KAAK,OAAO,IAAI,EAAE;AAC/D,SAAQ,eAAe,KAAK,CAAC,GAAG,UAAU,GAAG,MAAM,EAAE,OAAO;;;AAI9D,SAAgB,eACd,KACA,QACA,QACA,GAAG,OACG;CACN,MAAM,WAAgB,QAAQ,eAAe,KAAK,QAAQ,OAAO,IAAI,EAAE;AACvE,SAAQ,eAAe,KAAK,CAAC,GAAG,UAAU,GAAG,MAAM,EAAE,QAAQ,OAAO;;;AAMtE,SAAgB,aAAmB,KAAc,QAAgB,QAAW,UAAmB;CAC7F,MAAM,YAAmC,QAAQ,eAAe,KAAK,OAAO;CAC5E,MAAM,MAAM,YAAY,IAAI,IAAI,UAAU,mBAAG,IAAI,KAAW;AAC5D,KAAI,IAAI,QAAQ,SAAS;AACzB,SAAQ,eAAe,KAAK,KAAK,OAAO;;;AAI1C,SAAgB,WAAiB,KAAc,QAA2B;AACxE,QAAO,QAAQ,YAAY,KAAK,OAAO,oBAAI,IAAI,KAAK;;;AAMtD,SAAgB,gBACd,KACA,QACA,QACA,UACM;CACN,MAAM,YAAoD,QAAQ,eAAe,KAAK,OAAO;CAC7F,MAAM,MAAM,YAAY,EAAE,GAAG,WAAW,GAAG,EAAE;AAC7C,KAAI,UAAU;AACd,SAAQ,eAAe,KAAK,KAAK,OAAO;;;AAI1C,SAAgB,cAAiB,KAAc,QAA4C;AACzF,QAAO,QAAQ,YAAY,KAAK,OAAO,IAAI,EAAE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { t as Container } from "./container-BJb34faa.mjs";
|
|
3
|
-
import { r as AppAdapter } from "./adapter-
|
|
3
|
+
import { r as AppAdapter } from "./adapter-DjL8ql5d.mjs";
|
|
4
4
|
import { n as AppModuleClass } from "./app-module-Cotu9TIC.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/core/plugin.d.ts
|
|
@@ -92,4 +92,4 @@ interface KickPlugin {
|
|
|
92
92
|
}
|
|
93
93
|
//#endregion
|
|
94
94
|
export { KickPlugin as t };
|
|
95
|
-
//# sourceMappingURL=plugin-
|
|
95
|
+
//# sourceMappingURL=plugin-Cvacmm7N.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-
|
|
1
|
+
{"version":3,"file":"plugin-Cvacmm7N.d.mts","names":[],"sources":["../src/core/plugin.ts"],"mappings":";;;;;;;;AAwDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAAiB,UAAA;;EAEf,IAAA;;;;;EAMA,QAAA,EAAU,SAAA,EAAW,SAAA;;;;;EAMrB,OAAA,KAAY,cAAA;;;;;EAMZ,QAAA,KAAa,UAAA;;;;;EAMb,UAAA;;;;;EAMA,OAAA,EAAS,SAAA,EAAW,SAAA,UAAmB,OAAA;;;;;EAMvC,QAAA,YAAoB,OAAA;AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v3.0
|
|
2
|
+
* @forinda/kickjs v3.1.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -161,4 +161,4 @@ function buildQueryParams(parsed) {
|
|
|
161
161
|
//#endregion
|
|
162
162
|
export { parseSearchQuery as a, parseQuery as i, parseFilters as n, parseSort as o, parsePagination as r, FILTER_OPERATORS as s, buildQueryParams as t };
|
|
163
163
|
|
|
164
|
-
//# sourceMappingURL=query-
|
|
164
|
+
//# sourceMappingURL=query-BTaH2fIN.mjs.map
|