@forinda/kickjs 5.13.1 → 5.14.0-alpha.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-D1NzavIt.d.mts → adapter-EaDb0yXA.d.mts} +4 -4
- package/dist/{adapter-D1NzavIt.d.mts.map → adapter-EaDb0yXA.d.mts.map} +1 -1
- package/dist/{app-module-iAA20Cc6.d.mts → app-module-CFhn1C8b.d.mts} +3 -3
- package/dist/{app-module-iAA20Cc6.d.mts.map → app-module-CFhn1C8b.d.mts.map} +1 -1
- package/dist/{application-ChL6ufgq.d.mts → application-BEGxObrr.d.mts} +6 -6
- package/dist/{application-ChL6ufgq.d.mts.map → application-BEGxObrr.d.mts.map} +1 -1
- package/dist/{application-BTlWEKp2.mjs → application-BXWBAef4.mjs} +3 -3
- package/dist/{application-BTlWEKp2.mjs.map → application-BXWBAef4.mjs.map} +1 -1
- package/dist/{bootstrap-Cgt_j-0Q.d.mts → bootstrap-Cdofwou7.d.mts} +2 -2
- package/dist/{bootstrap-Cgt_j-0Q.d.mts.map → bootstrap-Cdofwou7.d.mts.map} +1 -1
- package/dist/{bootstrap-DoEPezno.mjs → bootstrap-Doj2e6IT.mjs} +3 -3
- package/dist/{bootstrap-DoEPezno.mjs.map → bootstrap-Doj2e6IT.mjs.map} +1 -1
- package/dist/{cache-XrNWj1KQ.d.mts → cache-BSFDtsEG.d.mts} +1 -1
- package/dist/{cache-XrNWj1KQ.d.mts.map → cache-BSFDtsEG.d.mts.map} +1 -1
- package/dist/config/index.d.mts +2 -2
- package/dist/config/index.mjs +2 -2
- package/dist/{config-Bbk1PLGo.mjs → config-DEB5UewY.mjs} +3 -3
- package/dist/{config-Bbk1PLGo.mjs.map → config-DEB5UewY.mjs.map} +1 -1
- package/dist/{container-B51bkskE.d.mts → container-TWOUyR_0.d.mts} +2 -2
- package/dist/container-TWOUyR_0.d.mts.map +1 -0
- package/dist/{container-Bq8VjG_Y.mjs → container-rkINSNRc.mjs} +3 -3
- package/dist/{container-Bq8VjG_Y.mjs.map → container-rkINSNRc.mjs.map} +1 -1
- package/dist/{context-D7sGbb8E.d.mts → context-BqxbiEPD.d.mts} +4 -4
- package/dist/context-BqxbiEPD.d.mts.map +1 -0
- package/dist/{context-CnyTYykn.mjs → context-Dn4pSsZM.mjs} +3 -3
- package/dist/{context-CnyTYykn.mjs.map → context-Dn4pSsZM.mjs.map} +1 -1
- package/dist/{context-decorator-BzcOhlej.d.mts → context-decorator--tgS3nKW.d.mts} +55 -21
- package/dist/{context-decorator-BzcOhlej.d.mts.map → context-decorator--tgS3nKW.d.mts.map} +1 -1
- 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 +2 -2
- 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 +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-CGEbLIPv.mjs → core-BiOTZWZk.mjs} +4 -4
- package/dist/core-BiOTZWZk.mjs.map +1 -0
- package/dist/{cors-BfgqfLPd.d.mts → cors-C4aSCD3J.d.mts} +1 -1
- package/dist/{cors-BfgqfLPd.d.mts.map → cors-C4aSCD3J.d.mts.map} +1 -1
- package/dist/{cron-GNoYydfg.d.mts → cron-DOOtTY4q.d.mts} +1 -1
- package/dist/{cron-GNoYydfg.d.mts.map → cron-DOOtTY4q.d.mts.map} +1 -1
- package/dist/{csrf-DiK9zept.d.mts → csrf-7nUXGTuz.d.mts} +1 -1
- package/dist/{csrf-DiK9zept.d.mts.map → csrf-7nUXGTuz.d.mts.map} +1 -1
- package/dist/{decorators-KbaPUBXd.d.mts → decorators-ejABLo9H.d.mts} +3 -3
- package/dist/decorators-ejABLo9H.d.mts.map +1 -0
- package/dist/env-B6aaB6dr.mjs +13 -0
- package/dist/env-B6aaB6dr.mjs.map +1 -0
- package/dist/{error-handler-C4SG5o_i.d.mts → error-handler-3ih4E-QZ.d.mts} +1 -1
- package/dist/error-handler-3ih4E-QZ.d.mts.map +1 -0
- package/dist/{errors-DytV77Hb.d.mts → errors-CRCTjEUK.d.mts} +1 -1
- package/dist/{errors-DytV77Hb.d.mts.map → errors-CRCTjEUK.d.mts.map} +1 -1
- package/dist/{execution-context-DKnt61pY.d.mts → execution-context-J97mWtz4.d.mts} +1 -1
- package/dist/{execution-context-DKnt61pY.d.mts.map → execution-context-J97mWtz4.d.mts.map} +1 -1
- package/dist/{helmet-CaMbjzBG.d.mts → helmet-CKzZzeNl.d.mts} +1 -1
- package/dist/{helmet-CaMbjzBG.d.mts.map → helmet-CKzZzeNl.d.mts.map} +1 -1
- package/dist/http/application.d.mts +1 -1
- package/dist/http/application.mjs +2 -2
- package/dist/http/bootstrap.d.mts +1 -1
- package/dist/http/bootstrap.mjs +2 -2
- package/dist/http/context.d.mts +3 -3
- package/dist/http/context.mjs +2 -2
- package/dist/http/middleware/cors.d.mts +1 -1
- package/dist/http/middleware/cors.mjs +1 -1
- package/dist/http/middleware/csrf.d.mts +1 -1
- package/dist/http/middleware/csrf.mjs +1 -1
- package/dist/http/middleware/error-handler.d.mts +1 -1
- package/dist/http/middleware/error-handler.mjs +2 -2
- package/dist/http/middleware/helmet.d.mts +1 -1
- package/dist/http/middleware/helmet.mjs +1 -1
- package/dist/http/middleware/rate-limit.d.mts +1 -1
- package/dist/http/middleware/rate-limit.mjs +1 -1
- package/dist/http/middleware/request-id.d.mts +1 -1
- package/dist/http/middleware/request-id.mjs +1 -1
- package/dist/http/middleware/request-logger.d.mts +1 -1
- package/dist/http/middleware/request-logger.mjs +2 -2
- package/dist/http/middleware/session.d.mts +1 -1
- package/dist/http/middleware/session.mjs +1 -1
- package/dist/http/middleware/spa.d.mts +1 -1
- package/dist/http/middleware/spa.mjs +2 -2
- package/dist/http/middleware/upload.d.mts +1 -1
- package/dist/http/middleware/upload.mjs +1 -1
- package/dist/http/middleware/validate.d.mts +1 -1
- package/dist/http/middleware/validate.mjs +2 -2
- 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 +2 -2
- package/dist/http/query/index.mjs +2 -2
- package/dist/http/router-builder.d.mts +1 -1
- package/dist/http/router-builder.mjs +2 -2
- package/dist/{index-BM32LMqZ.d.mts → index-CFM7HDaD.d.mts} +38 -3
- package/dist/index-CFM7HDaD.d.mts.map +1 -0
- package/dist/{index-BYLVLFA8.d.mts → index-UpQwKBR3.d.mts} +7 -7
- package/dist/index-UpQwKBR3.d.mts.map +1 -0
- package/dist/{index-B9cyOQAe.d.mts → index-kEmG8nWU.d.mts} +1 -1
- package/dist/{index-B9cyOQAe.d.mts.map → index-kEmG8nWU.d.mts.map} +1 -1
- package/dist/index.d.mts +34 -34
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/{interfaces-ClcFeDhd.d.mts → interfaces-DbTyKGdS.d.mts} +1 -1
- package/dist/{interfaces-ClcFeDhd.d.mts.map → interfaces-DbTyKGdS.d.mts.map} +1 -1
- package/dist/{logger-DyTCk-v1.d.mts → logger-BnBVjmDa.d.mts} +1 -1
- package/dist/{logger-DyTCk-v1.d.mts.map → logger-BnBVjmDa.d.mts.map} +1 -1
- package/dist/{metadata-pbYET01G.mjs → metadata-BQx4Gd9H.mjs} +2 -2
- package/dist/{metadata-pbYET01G.mjs.map → metadata-BQx4Gd9H.mjs.map} +1 -1
- package/dist/{path-Diviu6hv.d.mts → path-BVA9MfN1.d.mts} +1 -1
- package/dist/path-BVA9MfN1.d.mts.map +1 -0
- package/dist/{plugin-DG_jFA6h.d.mts → plugin-DEKMU50e.d.mts} +5 -5
- package/dist/{plugin-DG_jFA6h.d.mts.map → plugin-DEKMU50e.d.mts.map} +1 -1
- package/dist/{query-NrahUI9e.mjs → query-qSXmpuBe.mjs} +2 -2
- package/dist/{query-NrahUI9e.mjs.map → query-qSXmpuBe.mjs.map} +1 -1
- package/dist/{rate-limit-DUwoICtI.d.mts → rate-limit-oLL5EPUf.d.mts} +1 -1
- package/dist/{rate-limit-DUwoICtI.d.mts.map → rate-limit-oLL5EPUf.d.mts.map} +1 -1
- package/dist/{reactivity-BRvj7bdG.d.mts → reactivity-DWmLcN0A.d.mts} +1 -1
- package/dist/reactivity-DWmLcN0A.d.mts.map +1 -0
- package/dist/{request-id-BgglvZHN.d.mts → request-id-IDobbxU-.d.mts} +1 -1
- package/dist/request-id-IDobbxU-.d.mts.map +1 -0
- package/dist/{request-logger-CWHbAzTE.d.mts → request-logger-DZVW6VNI.d.mts} +1 -1
- package/dist/{request-logger-CWHbAzTE.d.mts.map → request-logger-DZVW6VNI.d.mts.map} +1 -1
- package/dist/{router-builder-CSAOc9MR.d.mts → router-builder-YUcLLArX.d.mts} +2 -2
- package/dist/{router-builder-CSAOc9MR.d.mts.map → router-builder-YUcLLArX.d.mts.map} +1 -1
- package/dist/{session-N0hActOO.d.mts → session-DSRA-PUX.d.mts} +1 -1
- package/dist/{session-N0hActOO.d.mts.map → session-DSRA-PUX.d.mts.map} +1 -1
- package/dist/{spa-DNOAvuFy.d.mts → spa-Cf2c2g7x.d.mts} +2 -2
- package/dist/{spa-DNOAvuFy.d.mts.map → spa-Cf2c2g7x.d.mts.map} +1 -1
- package/dist/{upload-7RRWSKkI.d.mts → upload-D6edAELH.d.mts} +2 -2
- package/dist/{upload-7RRWSKkI.d.mts.map → upload-D6edAELH.d.mts.map} +1 -1
- package/dist/{validate-HwAyWTwH.d.mts → validate-DoZDOhCi.d.mts} +8 -5
- package/dist/validate-DoZDOhCi.d.mts.map +1 -0
- package/dist/{views-srW0E4Ll.d.mts → views-D8Awr9tc.d.mts} +38 -6
- package/dist/views-D8Awr9tc.d.mts.map +1 -0
- package/package.json +10 -6
- package/dist/container-B51bkskE.d.mts.map +0 -1
- package/dist/context-D7sGbb8E.d.mts.map +0 -1
- package/dist/core-CGEbLIPv.mjs.map +0 -1
- package/dist/decorators-KbaPUBXd.d.mts.map +0 -1
- package/dist/env-BvCyDZYf.mjs +0 -12
- package/dist/env-BvCyDZYf.mjs.map +0 -1
- package/dist/error-handler-C4SG5o_i.d.mts.map +0 -1
- package/dist/index-BM32LMqZ.d.mts.map +0 -1
- package/dist/index-BYLVLFA8.d.mts.map +0 -1
- package/dist/path-Diviu6hv.d.mts.map +0 -1
- package/dist/reactivity-BRvj7bdG.d.mts.map +0 -1
- package/dist/request-id-BgglvZHN.d.mts.map +0 -1
- package/dist/validate-HwAyWTwH.d.mts.map +0 -1
- package/dist/views-srW0E4Ll.d.mts.map +0 -1
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/http/define-http-context-decorator.ts","../src/http/middleware/trace-context.ts"],"sourcesContent":["/**\n * HTTP-flavoured wrapper around {@link defineContextDecorator}.\n *\n * The core factory leaves `Ctx` defaulted to {@link ExecutionContext} so the\n * Context Contributor pipeline stays transport-agnostic — future WebSocket,\n * queue, and cron contexts share the same primitive. The cost is that the\n * vast majority of contributors (which are HTTP) have to spell the fourth\n * generic by hand to get `ctx.req` / `ctx.headers` typing:\n *\n * ```ts\n * // Verbose: spell every generic, including the params shape `P`.\n * defineContextDecorator<'tenant', Record<string, never>, Record<string, never>, RequestContext>({\n * key: 'tenant',\n * resolve: (ctx) => ({ id: ctx.req.headers['x-tenant-id'] as string }),\n * })\n * ```\n *\n * `defineHttpContextDecorator` removes that ceremony — the spec is typed\n * against `RequestContext` from the start, so resolvers can read `ctx.req`,\n * `ctx.headers`, `ctx.params`, etc. without a cast or generic dance:\n *\n * ```ts\n * import { defineHttpContextDecorator } from '@forinda/kickjs'\n *\n * const LoadTenant = defineHttpContextDecorator({\n * key: 'tenant',\n * resolve: (ctx) => ({ id: ctx.req.headers['x-tenant-id'] as string }),\n * })\n *\n * // Parameterised: the third generic carries the per-call params shape.\n * const LoadTenantParameterised = defineHttpContextDecorator<\n * 'tenant',\n * Record<string, never>,\n * { source: 'header' | 'subdomain' }\n * >({\n * key: 'tenant',\n * paramDefaults: { source: 'header' },\n * resolve: (ctx, _deps, params) => {\n * // params.source narrows inside `if` branches.\n * },\n * })\n * ```\n *\n * Use {@link defineContextDecorator} directly when authoring contributors\n * for non-HTTP transports or when you want to share one contributor across\n * HTTP + WS + queue (the resolver then has to stick to the\n * `ExecutionContext` surface — `ctx.get` / `ctx.set` / `ctx.requestId`).\n */\n\nimport {\n defineContextDecorator,\n type ContextDecorator,\n type ContextDecoratorSpec,\n type DepValue,\n} from '../core/context-decorator'\nimport type { RequestContext } from './context'\n\nexport function defineHttpContextDecorator<\n K extends string,\n D extends Record<string, DepValue> = Record<string, never>,\n P extends Record<string, unknown> = Record<string, never>,\n>(spec: ContextDecoratorSpec<K, D, P, RequestContext>): ContextDecorator<K, D, P, RequestContext> {\n return defineContextDecorator<K, D, P, RequestContext>(spec)\n}\n","import crypto from 'node:crypto'\nimport type { Request, Response, NextFunction } from 'express'\nimport { requestStore } from '../request-store'\n\n/**\n * W3C Trace Context header name.\n * @see https://www.w3.org/TR/trace-context/#traceparent-header\n */\nexport const TRACEPARENT_HEADER = 'traceparent'\n\n/** Regex for a valid W3C traceparent: {version}-{trace-id}-{parent-id}-{flags} */\nconst TRACEPARENT_RE = /^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/\n\nexport interface TraceContextOptions {\n /**\n * When true, respond with a `traceresponse` header containing the trace ID.\n * Useful for debugging. Default: false.\n */\n propagateResponse?: boolean\n}\n\n/**\n * Parsed W3C trace context fields.\n */\nexport interface TraceContext {\n /** W3C traceparent version (usually '00') */\n version: string\n /** 32-hex-char distributed trace ID */\n traceId: string\n /** 16-hex-char parent span ID */\n parentSpanId: string\n /** 2-hex-char trace flags */\n flags: string\n}\n\n/**\n * Generate a random 32-hex-character trace ID.\n */\nfunction generateTraceId(): string {\n return crypto.randomBytes(16).toString('hex')\n}\n\n/**\n * Generate a random 16-hex-character span ID.\n */\nfunction generateSpanId(): string {\n return crypto.randomBytes(8).toString('hex')\n}\n\n/**\n * Parse a W3C traceparent header value.\n * Returns null if the format is invalid.\n */\nexport function parseTraceparent(header: string): TraceContext | null {\n const match = TRACEPARENT_RE.exec(header.trim().toLowerCase())\n if (!match) return null\n\n const version = match[1]\n const traceId = match[2]\n const parentSpanId = match[3]\n const flags = match[4]\n\n // W3C spec: version ff is invalid, all-zero trace-id and parent-id are invalid\n if (\n version === 'ff' ||\n traceId === '00000000000000000000000000000000' ||\n parentSpanId === '0000000000000000'\n ) {\n return null\n }\n\n return { version, traceId, parentSpanId, flags }\n}\n\n/**\n * Middleware that extracts W3C `traceparent` header and stores trace context\n * in the request's AsyncLocalStorage store.\n *\n * If no valid `traceparent` header is present, a new traceId is generated\n * so that every request always has a trace ID available for correlation.\n *\n * Must be mounted **after** `requestScopeMiddleware()` (which creates the store).\n *\n * @example\n * ```ts\n * bootstrap({\n * middleware: [\n * requestScopeMiddleware(),\n * traceContext(), // extracts or generates traceId\n * requestLogger(),\n * express.json(),\n * ],\n * })\n * ```\n */\nexport function traceContext(options: TraceContextOptions = {}) {\n return (req: Request, res: Response, next: NextFunction) => {\n const store = requestStore.getStore()\n\n const traceparentHeader = req.headers[TRACEPARENT_HEADER]\n const raw = Array.isArray(traceparentHeader) ? traceparentHeader[0] : traceparentHeader\n const parsed = raw ? parseTraceparent(raw) : null\n\n const traceId = parsed?.traceId ?? generateTraceId()\n const spanId = generateSpanId()\n\n // Attach to the request store so logger + downstream code can access it\n if (store) {\n store.values.set('traceId', traceId)\n store.values.set('spanId', spanId)\n if (parsed) {\n store.values.set('parentSpanId', parsed.parentSpanId)\n store.values.set('traceFlags', parsed.flags)\n store.values.set('traceVersion', parsed.version)\n }\n }\n\n // Also expose on req for convenience\n ;(req as any).traceId = traceId\n ;(req as any).spanId = spanId\n\n if (options.propagateResponse) {\n res.setHeader('traceresponse', traceId)\n }\n\n next()\n }\n}\n"],"mappings":";;;;;;;;;;0vGAyDA,SAAgB,2BAId,KAAgG,CAChG,OAAO,uBAAgD,IAAI,CAC7D,CCvDA,MAAa,mBAAqB,cAG5B,eAAiB,8DA2BvB,SAAS,iBAA0B,CACjC,OAAO,OAAO,YAAY,EAAE,EAAE,SAAS,KAAK,CAC9C,CAKA,SAAS,gBAAyB,CAChC,OAAO,OAAO,YAAY,CAAC,EAAE,SAAS,KAAK,CAC7C,CAMA,SAAgB,iBAAiB,OAAqC,CACpE,IAAM,MAAQ,eAAe,KAAK,OAAO,KAAK,EAAE,YAAY,CAAC,EAC7D,GAAI,CAAC,MAAO,OAAO,KAEnB,IAAM,QAAU,MAAM,GAChB,QAAU,MAAM,GAChB,aAAe,MAAM,GACrB,MAAQ,MAAM,GAWpB,OAPE,UAAY,MACZ,UAAY,oCACZ,eAAiB,mBAEV,KAGF,CAAE,QAAS,QAAS,aAAc,KAAM,CACjD,CAuBA,SAAgB,aAAa,QAA+B,CAAC,EAAG,CAC9D,OAAQ,IAAc,IAAe,OAAuB,CAC1D,IAAM,MAAQ,aAAa,SAAS,EAE9B,kBAAoB,IAAI,QAAQ,oBAChC,IAAM,MAAM,QAAQ,iBAAiB,EAAI,kBAAkB,GAAK,kBAChE,OAAS,IAAM,iBAAiB,GAAG,EAAI,KAEvC,QAAU,QAAQ,SAAW,gBAAgB,EAC7C,OAAS,eAAe,EAG1B,QACF,MAAM,OAAO,IAAI,UAAW,OAAO,EACnC,MAAM,OAAO,IAAI,SAAU,MAAM,EAC7B,SACF,MAAM,OAAO,IAAI,eAAgB,OAAO,YAAY,EACpD,MAAM,OAAO,IAAI,aAAc,OAAO,KAAK,EAC3C,MAAM,OAAO,IAAI,eAAgB,OAAO,OAAO,IAKlD,IAAa,QAAU,QACvB,IAAa,OAAS,OAEnB,QAAQ,mBACV,IAAI,UAAU,gBAAiB,OAAO,EAGxC,KAAK,CACP,CACF"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/http/define-http-context-decorator.ts","../src/http/middleware/trace-context.ts"],"sourcesContent":["/**\n * HTTP-flavoured wrapper around {@link defineContextDecorator}.\n *\n * The core factory leaves `Ctx` defaulted to {@link ExecutionContext} so the\n * Context Contributor pipeline stays transport-agnostic — future WebSocket,\n * queue, and cron contexts share the same primitive. The cost is that the\n * vast majority of contributors (which are HTTP) have to spell the fourth\n * generic by hand to get `ctx.req` / `ctx.headers` typing:\n *\n * ```ts\n * // Verbose: spell every generic, including the params shape `P`.\n * defineContextDecorator<'tenant', Record<string, never>, Record<string, never>, RequestContext>({\n * key: 'tenant',\n * resolve: (ctx) => ({ id: ctx.req.headers['x-tenant-id'] as string }),\n * })\n * ```\n *\n * `defineHttpContextDecorator` removes that ceremony — the spec is typed\n * against `RequestContext` from the start, so resolvers can read `ctx.req`,\n * `ctx.headers`, `ctx.params`, etc. without a cast or generic dance:\n *\n * ```ts\n * import { defineHttpContextDecorator } from '@forinda/kickjs'\n *\n * const LoadTenant = defineHttpContextDecorator({\n * key: 'tenant',\n * resolve: (ctx) => ({ id: ctx.req.headers['x-tenant-id'] as string }),\n * })\n *\n * // Parameterised — the positional form forces you to also spell `K`\n * // and `D`, which loses automatic `deps` inference. Prefer the curried\n * // `.withParams<P>()` entry point below.\n * const LoadTenantParameterised = defineHttpContextDecorator<\n * 'tenant',\n * Record<string, never>,\n * { source: 'header' | 'subdomain' }\n * >({\n * key: 'tenant',\n * paramDefaults: { source: 'header' },\n * resolve: (ctx, _deps, params) => {\n * // params.source narrows inside `if` branches.\n * },\n * })\n *\n * // Parameterised + deps — only `P` is spelled; `K` and `D` infer from\n * // the spec, so `deps.repo` is fully typed in the resolver.\n * const LoadTenantWithRepo = defineHttpContextDecorator.withParams<{\n * source: 'header' | 'subdomain'\n * }>()({\n * key: 'tenant',\n * deps: { repo: TENANT_REPO },\n * paramDefaults: { source: 'header' },\n * resolve: (ctx, { repo }, params) =>\n * repo.findFor(ctx.req.headers['x-tenant-id'] as string, params.source),\n * })\n * ```\n *\n * Use {@link defineContextDecorator} directly when authoring contributors\n * for non-HTTP transports or when you want to share one contributor across\n * HTTP + WS + queue (the resolver then has to stick to the\n * `ExecutionContext` surface — `ctx.get` / `ctx.set` / `ctx.requestId`).\n */\n\nimport {\n defineContextDecorator,\n type ContextDecorator,\n type ContextDecoratorSpec,\n type DepValue,\n} from '../core/context-decorator'\nimport type { RequestContext } from './context'\n\n/**\n * Curried form returned by {@link DefineHttpContextDecoratorFn.withParams}.\n * Spell only the per-call params shape `P`; `K` and `D` are inferred\n * from the spec, and `Ctx` is locked to `RequestContext`.\n */\nexport interface DefineHttpContextDecoratorWithParams<P extends Record<string, unknown>> {\n <K extends string, D extends Record<string, DepValue> = Record<string, never>>(\n spec: ContextDecoratorSpec<K, D, P, RequestContext>,\n ): ContextDecorator<K, D, P, RequestContext>\n}\n\n/**\n * Public shape of {@link defineHttpContextDecorator} — the positional\n * call signature plus the curried `.withParams<P>()` helper that fixes\n * partial-inference for the parameterised case.\n */\nexport interface DefineHttpContextDecoratorFn {\n <\n K extends string,\n D extends Record<string, DepValue> = Record<string, never>,\n P extends Record<string, unknown> = Record<string, never>,\n >(\n spec: ContextDecoratorSpec<K, D, P, RequestContext>,\n ): ContextDecorator<K, D, P, RequestContext>\n\n /**\n * Curried entry point. Spell only `P`; `K` and `D` infer from the\n * spec. `Ctx` is locked to `RequestContext`.\n *\n * ```ts\n * const LoadTenant = defineHttpContextDecorator.withParams<{\n * source: 'header' | 'subdomain'\n * }>()({\n * key: 'tenant',\n * deps: { repo: TENANT_REPO }, // D inferred\n * paramDefaults: { source: 'header' },\n * resolve: (ctx, { repo }, params) => repo.findFor(ctx, params),\n * })\n * ```\n */\n withParams<P extends Record<string, unknown>>(): DefineHttpContextDecoratorWithParams<P>\n}\n\nfunction defineHttpContextDecoratorImpl<\n K extends string,\n D extends Record<string, DepValue> = Record<string, never>,\n P extends Record<string, unknown> = Record<string, never>,\n>(spec: ContextDecoratorSpec<K, D, P, RequestContext>): ContextDecorator<K, D, P, RequestContext> {\n return defineContextDecorator<K, D, P, RequestContext>(spec)\n}\n\nexport const defineHttpContextDecorator: DefineHttpContextDecoratorFn = Object.freeze(\n Object.assign(defineHttpContextDecoratorImpl, {\n withParams: <P extends Record<string, unknown>>(): DefineHttpContextDecoratorWithParams<P> => {\n return <K extends string, D extends Record<string, DepValue> = Record<string, never>>(\n spec: ContextDecoratorSpec<K, D, P, RequestContext>,\n ): ContextDecorator<K, D, P, RequestContext> => defineHttpContextDecoratorImpl<K, D, P>(spec)\n },\n }),\n) as DefineHttpContextDecoratorFn\n","import crypto from 'node:crypto'\nimport type { Request, Response, NextFunction } from 'express'\nimport { requestStore } from '../request-store'\n\n/**\n * W3C Trace Context header name.\n * @see https://www.w3.org/TR/trace-context/#traceparent-header\n */\nexport const TRACEPARENT_HEADER = 'traceparent'\n\n/** Regex for a valid W3C traceparent: {version}-{trace-id}-{parent-id}-{flags} */\nconst TRACEPARENT_RE = /^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/\n\nexport interface TraceContextOptions {\n /**\n * When true, respond with a `traceresponse` header containing the trace ID.\n * Useful for debugging. Default: false.\n */\n propagateResponse?: boolean\n}\n\n/**\n * Parsed W3C trace context fields.\n */\nexport interface TraceContext {\n /** W3C traceparent version (usually '00') */\n version: string\n /** 32-hex-char distributed trace ID */\n traceId: string\n /** 16-hex-char parent span ID */\n parentSpanId: string\n /** 2-hex-char trace flags */\n flags: string\n}\n\n/**\n * Generate a random 32-hex-character trace ID.\n */\nfunction generateTraceId(): string {\n return crypto.randomBytes(16).toString('hex')\n}\n\n/**\n * Generate a random 16-hex-character span ID.\n */\nfunction generateSpanId(): string {\n return crypto.randomBytes(8).toString('hex')\n}\n\n/**\n * Parse a W3C traceparent header value.\n * Returns null if the format is invalid.\n */\nexport function parseTraceparent(header: string): TraceContext | null {\n const match = TRACEPARENT_RE.exec(header.trim().toLowerCase())\n if (!match) return null\n\n const version = match[1]\n const traceId = match[2]\n const parentSpanId = match[3]\n const flags = match[4]\n\n // W3C spec: version ff is invalid, all-zero trace-id and parent-id are invalid\n if (\n version === 'ff' ||\n traceId === '00000000000000000000000000000000' ||\n parentSpanId === '0000000000000000'\n ) {\n return null\n }\n\n return { version, traceId, parentSpanId, flags }\n}\n\n/**\n * Middleware that extracts W3C `traceparent` header and stores trace context\n * in the request's AsyncLocalStorage store.\n *\n * If no valid `traceparent` header is present, a new traceId is generated\n * so that every request always has a trace ID available for correlation.\n *\n * Must be mounted **after** `requestScopeMiddleware()` (which creates the store).\n *\n * @example\n * ```ts\n * bootstrap({\n * middleware: [\n * requestScopeMiddleware(),\n * traceContext(), // extracts or generates traceId\n * requestLogger(),\n * express.json(),\n * ],\n * })\n * ```\n */\nexport function traceContext(options: TraceContextOptions = {}) {\n return (req: Request, res: Response, next: NextFunction) => {\n const store = requestStore.getStore()\n\n const traceparentHeader = req.headers[TRACEPARENT_HEADER]\n const raw = Array.isArray(traceparentHeader) ? traceparentHeader[0] : traceparentHeader\n const parsed = raw ? parseTraceparent(raw) : null\n\n const traceId = parsed?.traceId ?? generateTraceId()\n const spanId = generateSpanId()\n\n // Attach to the request store so logger + downstream code can access it\n if (store) {\n store.values.set('traceId', traceId)\n store.values.set('spanId', spanId)\n if (parsed) {\n store.values.set('parentSpanId', parsed.parentSpanId)\n store.values.set('traceFlags', parsed.flags)\n store.values.set('traceVersion', parsed.version)\n }\n }\n\n // Also expose on req for convenience\n ;(req as any).traceId = traceId\n ;(req as any).spanId = spanId\n\n if (options.propagateResponse) {\n res.setHeader('traceresponse', traceId)\n }\n\n next()\n }\n}\n"],"mappings":";;;;;;;;;;ixGAkHA,SAAS,+BAIP,KAAgG,CAChG,OAAO,uBAAgD,IAAI,CAC7D,CAEA,MAAa,2BAA2D,OAAO,OAC7E,OAAO,OAAO,+BAAgC,CAC5C,eAEI,MAC8C,+BAAwC,IAAI,CAEhG,CAAC,CACH,EC1Ha,mBAAqB,cAG5B,eAAiB,8DA2BvB,SAAS,iBAA0B,CACjC,OAAO,OAAO,YAAY,EAAE,EAAE,SAAS,KAAK,CAC9C,CAKA,SAAS,gBAAyB,CAChC,OAAO,OAAO,YAAY,CAAC,EAAE,SAAS,KAAK,CAC7C,CAMA,SAAgB,iBAAiB,OAAqC,CACpE,IAAM,MAAQ,eAAe,KAAK,OAAO,KAAK,EAAE,YAAY,CAAC,EAC7D,GAAI,CAAC,MAAO,OAAO,KAEnB,IAAM,QAAU,MAAM,GAChB,QAAU,MAAM,GAChB,aAAe,MAAM,GACrB,MAAQ,MAAM,GAWpB,OAPE,UAAY,MACZ,UAAY,oCACZ,eAAiB,mBAEV,KAGF,CAAE,QAAS,QAAS,aAAc,KAAM,CACjD,CAuBA,SAAgB,aAAa,QAA+B,CAAC,EAAG,CAC9D,OAAQ,IAAc,IAAe,OAAuB,CAC1D,IAAM,MAAQ,aAAa,SAAS,EAE9B,kBAAoB,IAAI,QAAQ,oBAChC,IAAM,MAAM,QAAQ,iBAAiB,EAAI,kBAAkB,GAAK,kBAChE,OAAS,IAAM,iBAAiB,GAAG,EAAI,KAEvC,QAAU,QAAQ,SAAW,gBAAgB,EAC7C,OAAS,eAAe,EAG1B,QACF,MAAM,OAAO,IAAI,UAAW,OAAO,EACnC,MAAM,OAAO,IAAI,SAAU,MAAM,EAC7B,SACF,MAAM,OAAO,IAAI,eAAgB,OAAO,YAAY,EACpD,MAAM,OAAO,IAAI,aAAc,OAAO,KAAK,EAC3C,MAAM,OAAO,IAAI,eAAgB,OAAO,OAAO,IAKlD,IAAa,QAAU,QACvB,IAAa,OAAS,OAEnB,QAAQ,mBACV,IAAI,UAAU,gBAAiB,OAAO,EAGxC,KAAK,CACP,CACF"}
|
|
@@ -68,4 +68,4 @@ declare const METADATA: {
|
|
|
68
68
|
};
|
|
69
69
|
//#endregion
|
|
70
70
|
export { METADATA as a, Scope as c, Constructor as i, ServiceOptions as l, BuilderOf as n, MaybePromise as o, ClassKind as r, PostConstructStatus as s, Buildable as t };
|
|
71
|
-
//# sourceMappingURL=interfaces-
|
|
71
|
+
//# sourceMappingURL=interfaces-DbTyKGdS.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces-
|
|
1
|
+
{"version":3,"file":"interfaces-DbTyKGdS.d.mts","names":[],"sources":["../src/core/interfaces.ts"],"mappings":";;;aAGY,KAAA;EACV,SAAA;EACA,SAAA;;EAEA,OAAA;AAAA;;KAIU,WAAA,oBAA+B,IAAA,YAAgB,CAAC;;KAGhD,YAAA,aAAyB,CAAA,GAAI,OAAA,CAAQ,CAAA;AAHjD;AAAA,UAMiB,cAAA;EACf,KAAA,GAAQ,KAAK;AAAA;;KAIH,SAAA,oBACE,CAAA,IAAK,CAAA,CAAE,CAAA,UAAW,QAAA,WAAmB,CAAA,MAAO,KAAA,EAAO,CAAA,CAAE,CAAA,MAAO,SAAA,CAAU,CAAA;EAC9E,KAAA,IAAS,CAAA;AAAA;;UAGE,SAAA;EACf,OAAA,IAAW,SAAS,CAAC,CAAA;AAAA;;KAIX,SAAA;;KAWA,mBAAA;;;;;AA7BsC;AAGlD;;;;AACe;AAIf;;;;;;;;cAyCa,QAAA;EAAA,SACX,UAAA;EAAA,SACA,KAAA;EAAA,SACA,UAAA;EAAA,SACA,SAAA;EAAA,SACA,MAAA;EAAA,SACA,cAAA;EAAA,SACA,OAAA;EAAA,SACA,YAAA;EAAA,SACA,MAAA;EAAA,SACA,iBAAA;EAAA,SACA,kBAAA;EAAA,SACA,kBAAA;EAAA,SACA,mBAAA;EAAA,SACA,WAAA;EAAA,SACA,KAAA;EAAA,SACA,KAAA;EAAA,SAEA,WAAA;EAAA,SACA,aAAA;EAAA,SACA,WAAA;AAAA"}
|
|
@@ -129,4 +129,4 @@ declare class Logger {
|
|
|
129
129
|
declare function createLogger(name: string): Logger;
|
|
130
130
|
//#endregion
|
|
131
131
|
export { createLogger as i, Logger as n, LoggerProvider as r, ConsoleLoggerProvider as t };
|
|
132
|
-
//# sourceMappingURL=logger-
|
|
132
|
+
//# sourceMappingURL=logger-BnBVjmDa.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger-
|
|
1
|
+
{"version":3,"file":"logger-BnBVjmDa.d.mts","names":[],"sources":["../src/core/logger.ts"],"mappings":";;;AA+BA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQwD;UARvC,cAAA;EACf,IAAA,CAAK,GAAA,aAAgB,IAAA;EACrB,IAAA,CAAK,GAAA,aAAgB,IAAA;EACrB,KAAA,CAAM,GAAA,aAAgB,IAAA;EACtB,KAAA,CAAM,GAAA,aAAgB,IAAA;EACtB,KAAA,EAAO,GAAA,aAAgB,IAAA;EACvB,KAAA,EAAO,GAAA,aAAgB,IAAA;EAkBvB;EAhBA,KAAA,CAAM,QAAA;IAAY,SAAA;EAAA,IAAsB,cAAc;AAAA;;;;;;;;cAY3C,qBAAA,YAAiC,cAAc;EAAA,QAClD,MAAA;EAAA,QACA,QAAA;EAER,WAAA,CAAY,MAAA;EAAA,QAMJ,GAAA;EAQR,IAAA,CAAK,GAAA,aAAgB,IAAA;EAGrB,IAAA,CAAK,GAAA,aAAgB,IAAA;EAGrB,KAAA,CAAM,GAAA,aAAgB,IAAA;EAGtB,KAAA,CAAM,GAAA,aAAgB,IAAA;EAGtB,KAAA,CAAM,GAAA,aAAgB,IAAA;EAGtB,KAAA,CAAM,GAAA,aAAgB,IAAA;EAGtB,KAAA,CAAM,QAAA;IAAY,SAAA;EAAA,IAAsB,cAAA;AAAA;AAoC1C;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAa,MAAA;EAAA,QACH,SAAA;EAAA,QACA,gBAAA;EAAA,QACA,KAAA;EAkER;EAAA,eA/De,gBAAA;EAEf,WAAA,CAAY,IAAA;EAiEZ;EAAA,YA1DY,QAAA;EA0DS;;;;;;;;;;EAAA,OAxCd,WAAA,CAAY,QAAA,EAAU,cAAA;EA+D7B;EAAA,OAxDO,WAAA,IAAe,cAAA;EAwDA;;AAAI;AAO5B;EAPwB,OAhDf,aAAA;;SAOA,GAAA,CAAI,IAAA,WAAe,MAAA;EAgDsB;EAtChD,KAAA,CAAM,IAAA,WAAe,MAAA;EAIrB,IAAA,CAAK,GAAA,aAAgB,IAAA;EAIrB,IAAA,CAAK,GAAA,aAAgB,IAAA;EAIrB,KAAA,CAAM,QAAA,OAAe,GAAA,cAAiB,IAAA;EAUtC,KAAA,CAAM,GAAA,aAAgB,IAAA;EAItB,KAAA,CAAM,GAAA,aAAgB,IAAA;EAKtB,KAAA,CAAM,GAAA,aAAgB,IAAA;AAAA;;iBAOR,YAAA,CAAa,IAAA,WAAe,MAAM"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v5.
|
|
2
|
+
* @forinda/kickjs v5.14.0-alpha.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
11
|
import"reflect-metadata";function setClassMeta(key,value,target){Reflect.defineMetadata(key,value,target)}function setMethodMeta(key,value,target,method){Reflect.defineMetadata(key,value,target,method)}function getClassMeta(key,target,fallback){return Reflect.getMetadata(key,target)??fallback}function getMethodMeta(key,target,method,fallback){return Reflect.getMetadata(key,target,method)??fallback}function hasClassMeta(key,target){return Reflect.hasMetadata(key,target)}function getClassMetaOrUndefined(key,target){return Reflect.getMetadata(key,target)}function getMethodMetaOrUndefined(key,target,method){return Reflect.getMetadata(key,target,method)}function pushClassMeta(key,target,...items){let existing=Reflect.getOwnMetadata(key,target)??[];Reflect.defineMetadata(key,[...existing,...items],target)}function pushMethodMeta(key,target,method,...items){let existing=Reflect.getOwnMetadata(key,target,method)??[];Reflect.defineMetadata(key,[...existing,...items],target,method)}function setInMetaMap(key,target,mapKey,mapValue){let inherited=Reflect.getOwnMetadata(key,target),map=inherited?new Map(inherited):new Map;map.set(mapKey,mapValue),Reflect.defineMetadata(key,map,target)}function getMetaMap(key,target){return Reflect.getMetadata(key,target)??new Map}function setInMetaRecord(key,target,recKey,recValue){let inherited=Reflect.getOwnMetadata(key,target),rec=inherited?{...inherited}:{};rec[recKey]=recValue,Reflect.defineMetadata(key,rec,target)}function getMetaRecord(key,target){return Reflect.getMetadata(key,target)??{}}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};
|
|
12
|
-
//# sourceMappingURL=metadata-
|
|
12
|
+
//# sourceMappingURL=metadata-BQx4Gd9H.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata-
|
|
1
|
+
{"version":3,"file":"metadata-BQx4Gd9H.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":";;;;;;;;;;yBAoBA,SAAgB,aAAgB,IAAc,MAAU,OAAsB,CAC5E,QAAQ,eAAe,IAAK,MAAO,MAAM,CAC3C,CAGA,SAAgB,cAAiB,IAAc,MAAU,OAAgB,OAAsB,CAC7F,QAAQ,eAAe,IAAK,MAAO,OAAQ,MAAM,CACnD,CAKA,SAAgB,aAAgB,IAAc,OAAgB,SAAgB,CAC5E,OAAQ,QAAQ,YAAY,IAAK,MAAM,GAAW,QACpD,CAGA,SAAgB,cAAiB,IAAc,OAAgB,OAAgB,SAAgB,CAC7F,OAAQ,QAAQ,YAAY,IAAK,OAAQ,MAAM,GAAW,QAC5D,CAGA,SAAgB,aAAa,IAAc,OAAyB,CAClE,OAAO,QAAQ,YAAY,IAAK,MAAM,CACxC,CAGA,SAAgB,wBAA2B,IAAc,OAA+B,CACtF,OAAO,QAAQ,YAAY,IAAK,MAAM,CACxC,CAGA,SAAgB,yBACd,IACA,OACA,OACe,CACf,OAAO,QAAQ,YAAY,IAAK,OAAQ,MAAM,CAChD,CAKA,SAAgB,cAAiB,IAAc,OAAgB,GAAG,MAAkB,CAClF,IAAM,SAAgB,QAAQ,eAAe,IAAK,MAAM,GAAK,CAAC,EAC9D,QAAQ,eAAe,IAAK,CAAC,GAAG,SAAU,GAAG,KAAK,EAAG,MAAM,CAC7D,CAGA,SAAgB,eACd,IACA,OACA,OACA,GAAG,MACG,CACN,IAAM,SAAgB,QAAQ,eAAe,IAAK,OAAQ,MAAM,GAAK,CAAC,EACtE,QAAQ,eAAe,IAAK,CAAC,GAAG,SAAU,GAAG,KAAK,EAAG,OAAQ,MAAM,CACrE,CAKA,SAAgB,aAAmB,IAAc,OAAgB,OAAW,SAAmB,CAC7F,IAAM,UAAmC,QAAQ,eAAe,IAAK,MAAM,EACrE,IAAM,UAAY,IAAI,IAAI,SAAS,EAAI,IAAI,IACjD,IAAI,IAAI,OAAQ,QAAQ,EACxB,QAAQ,eAAe,IAAK,IAAK,MAAM,CACzC,CAGA,SAAgB,WAAiB,IAAc,OAA2B,CACxE,OAAO,QAAQ,YAAY,IAAK,MAAM,GAAK,IAAI,GACjD,CAKA,SAAgB,gBACd,IACA,OACA,OACA,SACM,CACN,IAAM,UAAoD,QAAQ,eAAe,IAAK,MAAM,EACtF,IAAM,UAAY,CAAE,GAAG,SAAU,EAAI,CAAC,EAC5C,IAAI,QAAU,SACd,QAAQ,eAAe,IAAK,IAAK,MAAM,CACzC,CAGA,SAAgB,cAAiB,IAAc,OAA4C,CACzF,OAAO,QAAQ,YAAY,IAAK,MAAM,GAAK,CAAC,CAC9C"}
|
|
@@ -22,4 +22,4 @@ declare function normalizePath(path?: string): string;
|
|
|
22
22
|
declare function joinPaths(...segments: (string | undefined)[]): string;
|
|
23
23
|
//#endregion
|
|
24
24
|
export { normalizePath as n, joinPaths as t };
|
|
25
|
-
//# sourceMappingURL=path-
|
|
25
|
+
//# sourceMappingURL=path-BVA9MfN1.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-BVA9MfN1.d.mts","names":[],"sources":["../src/core/path.ts"],"mappings":";;;AAOA;;;;AAA2C;AAsB3C;iBAtBgB,aAAA,CAAc,IAAa;;;AAsBN;;;;;;;;;iBAArB,SAAA,IAAa,QAAQ"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { t as Container } from "./container-
|
|
3
|
-
import { s as ContributorRegistrations } from "./context-decorator
|
|
4
|
-
import { c as KickJsPluginName, p as IntrospectionSnapshot, r as AppAdapter } from "./adapter-
|
|
5
|
-
import { r as AppModuleEntry } from "./app-module-
|
|
2
|
+
import { t as Container } from "./container-TWOUyR_0.mjs";
|
|
3
|
+
import { s as ContributorRegistrations } from "./context-decorator--tgS3nKW.mjs";
|
|
4
|
+
import { c as KickJsPluginName, p as IntrospectionSnapshot, r as AppAdapter } from "./adapter-EaDb0yXA.mjs";
|
|
5
|
+
import { r as AppModuleEntry } from "./app-module-CFhn1C8b.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/core/module-registry.d.ts
|
|
8
8
|
/**
|
|
@@ -257,4 +257,4 @@ interface KickPlugin {
|
|
|
257
257
|
}
|
|
258
258
|
//#endregion
|
|
259
259
|
export { ModuleRegistry as n, MutableModuleRegistry as r, KickPlugin as t };
|
|
260
|
-
//# sourceMappingURL=plugin-
|
|
260
|
+
//# sourceMappingURL=plugin-DEKMU50e.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-
|
|
1
|
+
{"version":3,"file":"plugin-DEKMU50e.d.mts","names":[],"sources":["../src/core/module-registry.ts","../src/core/plugin.ts"],"mappings":";;;;;;;;;;;;AAiCA;;;;;;;;AAW8B;AAY9B;;;;;;;;;;;;;;;AAG8B;;UA1Bb,cAAA;;AC2BjB;;;;;;;;;EDhBE,KAAA,CAAM,MAAA,EAAQ,cAAc;AAAA;;;;;;;;;;cAYjB,qBAAA,YAAiC,cAAA;EAAA,SACnC,OAAA,EAAS,cAAA;EAElB,KAAA,CAAM,MAAA,EAAQ,cAAA;AAAA;;;;;;;;;;AAfc;AAY9B;;;;;;;;;;;;;;;AAG8B;;;;ACC9B;;;;;;;;;;;;;;;;;;;;;;;;;UAAiB,UAAA;EAsEE;EApEjB,IAAA;EA0EA;;;;;;;;;;;;;;;;;AAwEY;EA9HZ,SAAA,YAAqB,gBAAA;;;;;EAMrB,QAAA,EAAU,SAAA,EAAW,SAAA;;;;;;;;;;;;;;EAerB,OAAA,KAAY,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BZ,KAAA,EAAO,QAAA,EAAU,cAAA;;;;;EAMjB,QAAA,KAAa,UAAA;;;;;EAMb,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCA,YAAA,KAAiB,wBAAA;;;;;EAMjB,OAAA,EAAS,SAAA,EAAW,SAAA,UAAmB,OAAA;;;;;EAMvC,QAAA,YAAoB,OAAA;;;;;;;;;;;;;;EAepB,UAAA,KAAe,qBAAA,GAAwB,OAAA,CAAQ,qBAAA;;;;;;EAO/C,YAAA;AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs v5.
|
|
2
|
+
* @forinda/kickjs v5.14.0-alpha.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
11
|
const FILTER_OPERATORS=new Set([`eq`,`neq`,`gt`,`gte`,`lt`,`lte`,`between`,`in`,`contains`,`starts`,`ends`]);function parseFilters(filterParam,allowedFields){if(!filterParam)return[];let items=Array.isArray(filterParam)?filterParam:[filterParam],results=[],allowed=allowedFields?new Set(allowedFields):null;for(let item of items){let firstColon=item.indexOf(`:`);if(firstColon===-1)continue;let secondColon=item.indexOf(`:`,firstColon+1);if(secondColon===-1)continue;let field=item.slice(0,firstColon),operator=item.slice(firstColon+1,secondColon),value=item.slice(secondColon+1);!field||!value||FILTER_OPERATORS.has(operator)&&(allowed&&!allowed.has(field)||results.push({field,operator,value}))}return results}function parseSort(sortParam,allowedFields){if(!sortParam)return[];let items=Array.isArray(sortParam)?sortParam:[sortParam],results=[],allowed=allowedFields?new Set(allowedFields):null;for(let item of items){let lastColon=item.lastIndexOf(`:`);if(lastColon===-1)continue;let field=item.slice(0,lastColon),dir=item.slice(lastColon+1).toLowerCase();field&&(dir!==`asc`&&dir!==`desc`||allowed&&!allowed.has(field)||results.push({field,direction:dir}))}return results}function parsePagination(params){let page=typeof params.page==`string`?Number.parseInt(params.page,10):params.page??1,limit=typeof params.limit==`string`?Number.parseInt(params.limit,10):params.limit??20;return(Number.isNaN(page)||page<1)&&(page=1),(Number.isNaN(limit)||limit<1)&&(limit=20),limit>100&&(limit=100),{page,limit,offset:(page-1)*limit}}function parseSearchQuery(q){return q?q.trim().slice(0,200):``}function normalizeFieldConfig(config){if(config)return`columns`in config&&config.columns&&typeof config.columns==`object`?{filterable:Object.keys(config.columns),sortable:config.sortable?Object.keys(config.sortable):void 0,searchable:void 0}:config}function parseQuery(query,fieldConfig){let normalized=normalizeFieldConfig(fieldConfig);return{filters:parseFilters(query.filter,normalized?.filterable),sort:parseSort(query.sort,normalized?.sortable),pagination:parsePagination({page:query.page,limit:query.limit}),search:parseSearchQuery(query.q)}}function buildQueryParams(parsed){let params={};return parsed.filters?.length&&(params.filter=parsed.filters.map(f=>`${f.field}:${f.operator}:${f.value}`)),parsed.sort?.length&&(params.sort=parsed.sort.map(s=>`${s.field}:${s.direction}`)),parsed.pagination&&(params.page=parsed.pagination.page,params.limit=parsed.pagination.limit),parsed.search&&(params.q=parsed.search),params}export{parseSearchQuery as a,parseQuery as i,parseFilters as n,parseSort as o,parsePagination as r,FILTER_OPERATORS as s,buildQueryParams as t};
|
|
12
|
-
//# sourceMappingURL=query-
|
|
12
|
+
//# sourceMappingURL=query-qSXmpuBe.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-NrahUI9e.mjs","names":[],"sources":["../src/http/query/types.ts","../src/http/query/parse-query.ts"],"sourcesContent":["/** Supported filter operators for query string parsing */\nexport type FilterOperator =\n | 'eq'\n | 'neq'\n | 'gt'\n | 'gte'\n | 'lt'\n | 'lte'\n | 'between'\n | 'in'\n | 'contains'\n | 'starts'\n | 'ends'\n\nexport const FILTER_OPERATORS = new Set<string>([\n 'eq',\n 'neq',\n 'gt',\n 'gte',\n 'lt',\n 'lte',\n 'between',\n 'in',\n 'contains',\n 'starts',\n 'ends',\n])\n\nexport interface FilterItem {\n field: string\n operator: FilterOperator\n value: string\n}\n\nexport interface SortItem {\n field: string\n direction: 'asc' | 'desc'\n}\n\nexport interface PaginationParams {\n page: number\n limit: number\n offset: number\n}\n\n/**\n * The result of parsing a query string. ORM-agnostic — pass this to\n * a query builder adapter (Drizzle, Prisma, Sequelize, etc.) to produce\n * database-specific query objects.\n */\nexport interface ParsedQuery {\n filters: FilterItem[]\n sort: SortItem[]\n pagination: PaginationParams\n search: string\n}\n\n/**\n * Helper that extracts the literal field union from a `QueryFieldConfig`\n * key. When the user passes `{ filterable: ['status', 'category'] } as const`,\n * `FieldsOf<typeof config, 'filterable'>` resolves to `'status' | 'category'`.\n *\n * Without `as const`, the arrays widen to `string[]` and the union falls\n * back to `string`. This is the documented escape hatch.\n */\nexport type FieldsOf<\n TConfig extends QueryFieldConfig | undefined,\n K extends 'filterable' | 'sortable' | 'searchable',\n> = TConfig extends { readonly [P in K]: readonly (infer F)[] }\n ? F extends string\n ? F\n : string\n : TConfig extends { columns: infer C }\n ? K extends 'filterable'\n ? keyof C & string\n : string\n : string\n\n/**\n * Narrowed `ParsedQuery` whose `filters[].field` and `sort[].field`\n * unions are constrained to the literal whitelist passed to\n * `ctx.qs()` / `parseQuery()`. Extends `ParsedQuery`, so any function\n * accepting `ParsedQuery` accepts a `TypedParsedQuery<X>` automatically\n * (subtype assignment, no codegen, backward compatible).\n *\n * @example\n * ```ts\n * const parsed = ctx.qs({\n * filterable: ['status', 'priority'],\n * sortable: ['createdAt'],\n * } as const)\n * parsed.filters[0]?.field // 'status' | 'priority'\n * parsed.sort[0]?.field // 'createdAt'\n * ```\n */\nexport interface TypedParsedQuery<\n TConfig extends QueryFieldConfig | undefined,\n> extends ParsedQuery {\n filters: Array<FilterItem & { field: FieldsOf<TConfig, 'filterable'> }>\n sort: Array<SortItem & { field: FieldsOf<TConfig, 'sortable'> }>\n}\n\n/**\n * Restrict which fields can be filtered, sorted, or searched.\n * Fields not in the allow-list are silently ignored.\n *\n * Accepts two forms:\n * 1. **String arrays** (standard): `{ filterable: ['name', 'status'], sortable: ['createdAt'] }`\n * 2. **Column-object maps** (Drizzle-style): `{ columns: { name: col, status: col }, sortable: { createdAt: col } }`\n *\n * When column-object maps are provided, `Object.keys()` is used to derive the field names.\n */\nexport type QueryFieldConfig = StringQueryFieldConfig | ColumnQueryFieldConfig\n\nexport interface StringQueryFieldConfig {\n filterable?: string[]\n sortable?: string[]\n searchable?: string[]\n}\n\n/**\n * Column-object-based field config (e.g., from DrizzleQueryParamsConfig).\n * Keys are the field names used in query strings; values are ORM column references.\n */\nexport interface ColumnQueryFieldConfig {\n columns: Record<string, any>\n sortable?: Record<string, any>\n searchColumns?: any[]\n [key: string]: any\n}\n\n/** Standardized paginated response shape */\nexport interface PaginatedResponse<T = any> {\n data: T[]\n meta: {\n page: number\n limit: number\n total: number\n totalPages: number\n hasNext: boolean\n hasPrev: boolean\n }\n}\n\n/**\n * Interface for ORM-specific query builder adapters.\n * Implement this to translate a `ParsedQuery` into your ORM's query format.\n *\n * @example\n * ```ts\n * // Drizzle adapter\n * class DrizzleQueryAdapter implements QueryBuilderAdapter<DrizzleQueryResult> {\n * build(parsed: ParsedQuery, config: DrizzleConfig): DrizzleQueryResult {\n * // Convert filters → Drizzle SQL conditions\n * // Convert sort → Drizzle orderBy\n * return { where, orderBy, limit, offset }\n * }\n * }\n *\n * // Prisma adapter\n * class PrismaQueryAdapter implements QueryBuilderAdapter<PrismaQueryResult> {\n * build(parsed: ParsedQuery, config: PrismaConfig): PrismaQueryResult {\n * return { where, orderBy, skip, take }\n * }\n * }\n * ```\n */\nexport interface QueryBuilderAdapter<TResult = any, TConfig = any> {\n /** Human-readable name for debugging */\n readonly name: string\n\n /**\n * Convert a ParsedQuery into an ORM-specific query object.\n * @param parsed - The ORM-agnostic parsed query\n * @param config - ORM-specific configuration (column maps, search columns, etc.)\n */\n build(parsed: ParsedQuery, config: TConfig): TResult\n}\n","import {\n FILTER_OPERATORS,\n type FilterItem,\n type FilterOperator,\n type SortItem,\n type PaginationParams,\n type ParsedQuery,\n type QueryFieldConfig,\n type StringQueryFieldConfig,\n type TypedParsedQuery,\n} from './types'\n\nconst MAX_SEARCH_LENGTH = 200\nconst DEFAULT_PAGE = 1\nconst DEFAULT_LIMIT = 20\nconst MAX_LIMIT = 100\n\n// ── Individual parsers ──────────────────────────────────────────────────\n\n/** Parse filter strings like \"status:eq:active\" into structured objects */\nexport function parseFilters(\n filterParam: string | string[] | undefined,\n allowedFields?: string[],\n): FilterItem[] {\n if (!filterParam) return []\n\n const items = Array.isArray(filterParam) ? filterParam : [filterParam]\n const results: FilterItem[] = []\n const allowed = allowedFields ? new Set(allowedFields) : null\n\n for (const item of items) {\n // Split on first two colons only — value may contain colons (e.g. timestamps)\n const firstColon = item.indexOf(':')\n if (firstColon === -1) continue\n\n const secondColon = item.indexOf(':', firstColon + 1)\n if (secondColon === -1) continue\n\n const field = item.slice(0, firstColon)\n const operator = item.slice(firstColon + 1, secondColon)\n const value = item.slice(secondColon + 1)\n\n if (!field || !value) continue\n if (!FILTER_OPERATORS.has(operator)) continue\n if (allowed && !allowed.has(field)) continue\n\n results.push({ field, operator: operator as FilterOperator, value })\n }\n\n return results\n}\n\n/** Parse sort strings like \"firstName:asc\" into structured objects */\nexport function parseSort(\n sortParam: string | string[] | undefined,\n allowedFields?: string[],\n): SortItem[] {\n if (!sortParam) return []\n\n const items = Array.isArray(sortParam) ? sortParam : [sortParam]\n const results: SortItem[] = []\n const allowed = allowedFields ? new Set(allowedFields) : null\n\n for (const item of items) {\n // Split on last colon so field names with colons work\n const lastColon = item.lastIndexOf(':')\n if (lastColon === -1) continue\n\n const field = item.slice(0, lastColon)\n const dir = item.slice(lastColon + 1).toLowerCase()\n\n if (!field) continue\n if (dir !== 'asc' && dir !== 'desc') continue\n if (allowed && !allowed.has(field)) continue\n\n results.push({ field, direction: dir })\n }\n\n return results\n}\n\n/** Parse page/limit into pagination with computed offset */\nexport function parsePagination(params: {\n page?: string | number\n limit?: string | number\n}): PaginationParams {\n let page =\n typeof params.page === 'string'\n ? Number.parseInt(params.page, 10)\n : (params.page ?? DEFAULT_PAGE)\n let limit =\n typeof params.limit === 'string'\n ? Number.parseInt(params.limit, 10)\n : (params.limit ?? DEFAULT_LIMIT)\n\n if (Number.isNaN(page) || page < 1) page = DEFAULT_PAGE\n if (Number.isNaN(limit) || limit < 1) limit = DEFAULT_LIMIT\n if (limit > MAX_LIMIT) limit = MAX_LIMIT\n\n return { page, limit, offset: (page - 1) * limit }\n}\n\n/** Sanitize and truncate search query */\nexport function parseSearchQuery(q: string | undefined): string {\n if (!q) return ''\n return q.trim().slice(0, MAX_SEARCH_LENGTH)\n}\n\n// ── Config normalizer ───────────────────────────────────────────────────\n\n/**\n * Normalize a QueryFieldConfig into the string-based form.\n * Detects column-object-based configs (DrizzleQueryParamsConfig) by checking\n * for a `columns` property and extracts `Object.keys()`.\n */\nfunction normalizeFieldConfig(config?: QueryFieldConfig): StringQueryFieldConfig | undefined {\n if (!config) return undefined\n\n // Column-object-based config (e.g., DrizzleQueryParamsConfig)\n if ('columns' in config && config.columns && typeof config.columns === 'object') {\n return {\n filterable: Object.keys(config.columns),\n sortable: config.sortable ? Object.keys(config.sortable) : undefined,\n searchable: undefined, // searchColumns are Column objects, not used for string filtering\n }\n }\n\n // Already string-based\n return config as StringQueryFieldConfig\n}\n\n// ── Combined parser ─────────────────────────────────────────────────────\n\n/**\n * Parse a raw Express query object into a structured, ORM-agnostic ParsedQuery.\n *\n * @param query - Raw query string object from `req.query` or Zod-validated object\n * @param fieldConfig - Optional field restrictions (whitelist filterable/sortable/searchable).\n * Accepts both string-based configs (`{ filterable, sortable, searchable }`) and\n * column-object configs (`{ columns, sortable, searchColumns }`).\n *\n * @example\n * ```ts\n * // String-based config\n * const parsed = parseQuery(ctx.query, {\n * filterable: ['status', 'priority'],\n * sortable: ['createdAt', 'title'],\n * })\n *\n * // Column-object config (DrizzleQueryParamsConfig)\n * const parsed = parseQuery(ctx.query, TASK_QUERY_CONFIG)\n * ```\n *\n * Query string format:\n * - Filters: `?filter=field:operator:value` (repeatable)\n * - Sort: `?sort=field:asc|desc` (repeatable)\n * - Pagination: `?page=1&limit=20`\n * - Search: `?q=search+term`\n *\n * Filter operators: eq, neq, gt, gte, lt, lte, between, in, contains, starts, ends\n */\nexport function parseQuery<TConfig extends QueryFieldConfig | undefined = undefined>(\n query: Record<string, any>,\n fieldConfig?: TConfig,\n): TypedParsedQuery<TConfig> {\n const normalized = normalizeFieldConfig(fieldConfig)\n return {\n filters: parseFilters(query.filter, normalized?.filterable),\n sort: parseSort(query.sort, normalized?.sortable),\n pagination: parsePagination({ page: query.page, limit: query.limit }),\n search: parseSearchQuery(query.q),\n } as TypedParsedQuery<TConfig>\n}\n\n// ── Query URL builder (for client-side or testing) ──────────────────────\n\n/** Convert ParsedQuery back into query string parameters */\nexport function buildQueryParams(\n parsed: Partial<ParsedQuery>,\n): Record<string, string | string[] | number> {\n const params: Record<string, string | string[] | number> = {}\n\n if (parsed.filters?.length) {\n params.filter = parsed.filters.map((f) => `${f.field}:${f.operator}:${f.value}`)\n }\n\n if (parsed.sort?.length) {\n params.sort = parsed.sort.map((s) => `${s.field}:${s.direction}`)\n }\n\n if (parsed.pagination) {\n params.page = parsed.pagination.page\n params.limit = parsed.pagination.limit\n }\n\n if (parsed.search) {\n params.q = parsed.search\n }\n\n return params\n}\n"],"mappings":";;;;;;;;;;AAcA,MAAa,iBAAmB,IAAI,IAAY,CAC9C,KACA,MACA,KACA,MACA,KACA,MACA,UACA,KACA,WACA,SACA,MACF,CAAC,ECND,SAAgB,aACd,YACA,cACc,CACd,GAAI,CAAC,YAAa,MAAO,CAAC,EAE1B,IAAM,MAAQ,MAAM,QAAQ,WAAW,EAAI,YAAc,CAAC,WAAW,EAC/D,QAAwB,CAAC,EACzB,QAAU,cAAgB,IAAI,IAAI,aAAa,EAAI,KAEzD,IAAK,IAAM,QAAQ,MAAO,CAExB,IAAM,WAAa,KAAK,QAAQ,GAAG,EACnC,GAAI,aAAe,GAAI,SAEvB,IAAM,YAAc,KAAK,QAAQ,IAAK,WAAa,CAAC,EACpD,GAAI,cAAgB,GAAI,SAExB,IAAM,MAAQ,KAAK,MAAM,EAAG,UAAU,EAChC,SAAW,KAAK,MAAM,WAAa,EAAG,WAAW,EACjD,MAAQ,KAAK,MAAM,YAAc,CAAC,EAEpC,CAAC,OAAS,CAAC,OACV,iBAAiB,IAAI,QAAQ,IAC9B,SAAW,CAAC,QAAQ,IAAI,KAAK,GAEjC,QAAQ,KAAK,CAAE,MAAiB,SAA4B,KAAM,CAAC,EACrE,CAEA,OAAO,OACT,CAGA,SAAgB,UACd,UACA,cACY,CACZ,GAAI,CAAC,UAAW,MAAO,CAAC,EAExB,IAAM,MAAQ,MAAM,QAAQ,SAAS,EAAI,UAAY,CAAC,SAAS,EACzD,QAAsB,CAAC,EACvB,QAAU,cAAgB,IAAI,IAAI,aAAa,EAAI,KAEzD,IAAK,IAAM,QAAQ,MAAO,CAExB,IAAM,UAAY,KAAK,YAAY,GAAG,EACtC,GAAI,YAAc,GAAI,SAEtB,IAAM,MAAQ,KAAK,MAAM,EAAG,SAAS,EAC/B,IAAM,KAAK,MAAM,UAAY,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AClB,OAAO,OAAS,OAAO,QAAQ,IAAK,GAAM,GAAG,EAAE,MAAM,GAAG,EAAE,SAAS,GAAG,EAAE,OAAO,GAG7E,OAAO,MAAM,SACf,OAAO,KAAO,OAAO,KAAK,IAAK,GAAM,GAAG,EAAE,MAAM,GAAG,EAAE,WAAW,GAG9D,OAAO,aACT,OAAO,KAAO,OAAO,WAAW,KAChC,OAAO,MAAQ,OAAO,WAAW,OAG/B,OAAO,SACT,OAAO,EAAI,OAAO,QAGb,MACT"}
|
|
1
|
+
{"version":3,"file":"query-qSXmpuBe.mjs","names":[],"sources":["../src/http/query/types.ts","../src/http/query/parse-query.ts"],"sourcesContent":["/** Supported filter operators for query string parsing */\nexport type FilterOperator =\n | 'eq'\n | 'neq'\n | 'gt'\n | 'gte'\n | 'lt'\n | 'lte'\n | 'between'\n | 'in'\n | 'contains'\n | 'starts'\n | 'ends'\n\nexport const FILTER_OPERATORS = new Set<string>([\n 'eq',\n 'neq',\n 'gt',\n 'gte',\n 'lt',\n 'lte',\n 'between',\n 'in',\n 'contains',\n 'starts',\n 'ends',\n])\n\nexport interface FilterItem {\n field: string\n operator: FilterOperator\n value: string\n}\n\nexport interface SortItem {\n field: string\n direction: 'asc' | 'desc'\n}\n\nexport interface PaginationParams {\n page: number\n limit: number\n offset: number\n}\n\n/**\n * The result of parsing a query string. ORM-agnostic — pass this to\n * a query builder adapter (Drizzle, Prisma, Sequelize, etc.) to produce\n * database-specific query objects.\n */\nexport interface ParsedQuery {\n filters: FilterItem[]\n sort: SortItem[]\n pagination: PaginationParams\n search: string\n}\n\n/**\n * Helper that extracts the literal field union from a `QueryFieldConfig`\n * key. When the user passes `{ filterable: ['status', 'category'] } as const`,\n * `FieldsOf<typeof config, 'filterable'>` resolves to `'status' | 'category'`.\n *\n * Without `as const`, the arrays widen to `string[]` and the union falls\n * back to `string`. This is the documented escape hatch.\n */\nexport type FieldsOf<\n TConfig extends QueryFieldConfig | undefined,\n K extends 'filterable' | 'sortable' | 'searchable',\n> = TConfig extends { readonly [P in K]: readonly (infer F)[] }\n ? F extends string\n ? F\n : string\n : TConfig extends { columns: infer C }\n ? K extends 'filterable'\n ? keyof C & string\n : string\n : string\n\n/**\n * Narrowed `ParsedQuery` whose `filters[].field` and `sort[].field`\n * unions are constrained to the literal whitelist passed to\n * `ctx.qs()` / `parseQuery()`. Extends `ParsedQuery`, so any function\n * accepting `ParsedQuery` accepts a `TypedParsedQuery<X>` automatically\n * (subtype assignment, no codegen, backward compatible).\n *\n * @example\n * ```ts\n * const parsed = ctx.qs({\n * filterable: ['status', 'priority'],\n * sortable: ['createdAt'],\n * } as const)\n * parsed.filters[0]?.field // 'status' | 'priority'\n * parsed.sort[0]?.field // 'createdAt'\n * ```\n */\nexport interface TypedParsedQuery<\n TConfig extends QueryFieldConfig | undefined,\n> extends ParsedQuery {\n filters: Array<FilterItem & { field: FieldsOf<TConfig, 'filterable'> }>\n sort: Array<SortItem & { field: FieldsOf<TConfig, 'sortable'> }>\n}\n\n/**\n * Restrict which fields can be filtered, sorted, or searched.\n * Fields not in the allow-list are silently ignored.\n *\n * Accepts two forms:\n * 1. **String arrays** (standard): `{ filterable: ['name', 'status'], sortable: ['createdAt'] }`\n * 2. **Column-object maps** (Drizzle-style): `{ columns: { name: col, status: col }, sortable: { createdAt: col } }`\n *\n * When column-object maps are provided, `Object.keys()` is used to derive the field names.\n */\nexport type QueryFieldConfig = StringQueryFieldConfig | ColumnQueryFieldConfig\n\nexport interface StringQueryFieldConfig {\n filterable?: string[]\n sortable?: string[]\n searchable?: string[]\n}\n\n/**\n * Column-object-based field config (e.g., from DrizzleQueryParamsConfig).\n * Keys are the field names used in query strings; values are ORM column references.\n */\nexport interface ColumnQueryFieldConfig {\n columns: Record<string, any>\n sortable?: Record<string, any>\n searchColumns?: any[]\n [key: string]: any\n}\n\n/** Standardized paginated response shape */\nexport interface PaginatedResponse<T = any> {\n data: T[]\n meta: {\n page: number\n limit: number\n total: number\n totalPages: number\n hasNext: boolean\n hasPrev: boolean\n }\n}\n\n/**\n * Interface for ORM-specific query builder adapters.\n * Implement this to translate a `ParsedQuery` into your ORM's query format.\n *\n * @example\n * ```ts\n * // Drizzle adapter\n * class DrizzleQueryAdapter implements QueryBuilderAdapter<DrizzleQueryResult> {\n * build(parsed: ParsedQuery, config: DrizzleConfig): DrizzleQueryResult {\n * // Convert filters → Drizzle SQL conditions\n * // Convert sort → Drizzle orderBy\n * return { where, orderBy, limit, offset }\n * }\n * }\n *\n * // Prisma adapter\n * class PrismaQueryAdapter implements QueryBuilderAdapter<PrismaQueryResult> {\n * build(parsed: ParsedQuery, config: PrismaConfig): PrismaQueryResult {\n * return { where, orderBy, skip, take }\n * }\n * }\n * ```\n */\nexport interface QueryBuilderAdapter<TResult = any, TConfig = any> {\n /** Human-readable name for debugging */\n readonly name: string\n\n /**\n * Convert a ParsedQuery into an ORM-specific query object.\n * @param parsed - The ORM-agnostic parsed query\n * @param config - ORM-specific configuration (column maps, search columns, etc.)\n */\n build(parsed: ParsedQuery, config: TConfig): TResult\n}\n","import {\n FILTER_OPERATORS,\n type FilterItem,\n type FilterOperator,\n type SortItem,\n type PaginationParams,\n type ParsedQuery,\n type QueryFieldConfig,\n type StringQueryFieldConfig,\n type TypedParsedQuery,\n} from './types'\n\nconst MAX_SEARCH_LENGTH = 200\nconst DEFAULT_PAGE = 1\nconst DEFAULT_LIMIT = 20\nconst MAX_LIMIT = 100\n\n// ── Individual parsers ──────────────────────────────────────────────────\n\n/** Parse filter strings like \"status:eq:active\" into structured objects */\nexport function parseFilters(\n filterParam: string | string[] | undefined,\n allowedFields?: string[],\n): FilterItem[] {\n if (!filterParam) return []\n\n const items = Array.isArray(filterParam) ? filterParam : [filterParam]\n const results: FilterItem[] = []\n const allowed = allowedFields ? new Set(allowedFields) : null\n\n for (const item of items) {\n // Split on first two colons only — value may contain colons (e.g. timestamps)\n const firstColon = item.indexOf(':')\n if (firstColon === -1) continue\n\n const secondColon = item.indexOf(':', firstColon + 1)\n if (secondColon === -1) continue\n\n const field = item.slice(0, firstColon)\n const operator = item.slice(firstColon + 1, secondColon)\n const value = item.slice(secondColon + 1)\n\n if (!field || !value) continue\n if (!FILTER_OPERATORS.has(operator)) continue\n if (allowed && !allowed.has(field)) continue\n\n results.push({ field, operator: operator as FilterOperator, value })\n }\n\n return results\n}\n\n/** Parse sort strings like \"firstName:asc\" into structured objects */\nexport function parseSort(\n sortParam: string | string[] | undefined,\n allowedFields?: string[],\n): SortItem[] {\n if (!sortParam) return []\n\n const items = Array.isArray(sortParam) ? sortParam : [sortParam]\n const results: SortItem[] = []\n const allowed = allowedFields ? new Set(allowedFields) : null\n\n for (const item of items) {\n // Split on last colon so field names with colons work\n const lastColon = item.lastIndexOf(':')\n if (lastColon === -1) continue\n\n const field = item.slice(0, lastColon)\n const dir = item.slice(lastColon + 1).toLowerCase()\n\n if (!field) continue\n if (dir !== 'asc' && dir !== 'desc') continue\n if (allowed && !allowed.has(field)) continue\n\n results.push({ field, direction: dir })\n }\n\n return results\n}\n\n/** Parse page/limit into pagination with computed offset */\nexport function parsePagination(params: {\n page?: string | number\n limit?: string | number\n}): PaginationParams {\n let page =\n typeof params.page === 'string'\n ? Number.parseInt(params.page, 10)\n : (params.page ?? DEFAULT_PAGE)\n let limit =\n typeof params.limit === 'string'\n ? Number.parseInt(params.limit, 10)\n : (params.limit ?? DEFAULT_LIMIT)\n\n if (Number.isNaN(page) || page < 1) page = DEFAULT_PAGE\n if (Number.isNaN(limit) || limit < 1) limit = DEFAULT_LIMIT\n if (limit > MAX_LIMIT) limit = MAX_LIMIT\n\n return { page, limit, offset: (page - 1) * limit }\n}\n\n/** Sanitize and truncate search query */\nexport function parseSearchQuery(q: string | undefined): string {\n if (!q) return ''\n return q.trim().slice(0, MAX_SEARCH_LENGTH)\n}\n\n// ── Config normalizer ───────────────────────────────────────────────────\n\n/**\n * Normalize a QueryFieldConfig into the string-based form.\n * Detects column-object-based configs (DrizzleQueryParamsConfig) by checking\n * for a `columns` property and extracts `Object.keys()`.\n */\nfunction normalizeFieldConfig(config?: QueryFieldConfig): StringQueryFieldConfig | undefined {\n if (!config) return undefined\n\n // Column-object-based config (e.g., DrizzleQueryParamsConfig)\n if ('columns' in config && config.columns && typeof config.columns === 'object') {\n return {\n filterable: Object.keys(config.columns),\n sortable: config.sortable ? Object.keys(config.sortable) : undefined,\n searchable: undefined, // searchColumns are Column objects, not used for string filtering\n }\n }\n\n // Already string-based\n return config as StringQueryFieldConfig\n}\n\n// ── Combined parser ─────────────────────────────────────────────────────\n\n/**\n * Parse a raw Express query object into a structured, ORM-agnostic ParsedQuery.\n *\n * @param query - Raw query string object from `req.query` or Zod-validated object\n * @param fieldConfig - Optional field restrictions (whitelist filterable/sortable/searchable).\n * Accepts both string-based configs (`{ filterable, sortable, searchable }`) and\n * column-object configs (`{ columns, sortable, searchColumns }`).\n *\n * @example\n * ```ts\n * // String-based config\n * const parsed = parseQuery(ctx.query, {\n * filterable: ['status', 'priority'],\n * sortable: ['createdAt', 'title'],\n * })\n *\n * // Column-object config (DrizzleQueryParamsConfig)\n * const parsed = parseQuery(ctx.query, TASK_QUERY_CONFIG)\n * ```\n *\n * Query string format:\n * - Filters: `?filter=field:operator:value` (repeatable)\n * - Sort: `?sort=field:asc|desc` (repeatable)\n * - Pagination: `?page=1&limit=20`\n * - Search: `?q=search+term`\n *\n * Filter operators: eq, neq, gt, gte, lt, lte, between, in, contains, starts, ends\n */\nexport function parseQuery<TConfig extends QueryFieldConfig | undefined = undefined>(\n query: Record<string, any>,\n fieldConfig?: TConfig,\n): TypedParsedQuery<TConfig> {\n const normalized = normalizeFieldConfig(fieldConfig)\n return {\n filters: parseFilters(query.filter, normalized?.filterable),\n sort: parseSort(query.sort, normalized?.sortable),\n pagination: parsePagination({ page: query.page, limit: query.limit }),\n search: parseSearchQuery(query.q),\n } as TypedParsedQuery<TConfig>\n}\n\n// ── Query URL builder (for client-side or testing) ──────────────────────\n\n/** Convert ParsedQuery back into query string parameters */\nexport function buildQueryParams(\n parsed: Partial<ParsedQuery>,\n): Record<string, string | string[] | number> {\n const params: Record<string, string | string[] | number> = {}\n\n if (parsed.filters?.length) {\n params.filter = parsed.filters.map((f) => `${f.field}:${f.operator}:${f.value}`)\n }\n\n if (parsed.sort?.length) {\n params.sort = parsed.sort.map((s) => `${s.field}:${s.direction}`)\n }\n\n if (parsed.pagination) {\n params.page = parsed.pagination.page\n params.limit = parsed.pagination.limit\n }\n\n if (parsed.search) {\n params.q = parsed.search\n }\n\n return params\n}\n"],"mappings":";;;;;;;;;;AAcA,MAAa,iBAAmB,IAAI,IAAY,CAC9C,KACA,MACA,KACA,MACA,KACA,MACA,UACA,KACA,WACA,SACA,MACF,CAAC,ECND,SAAgB,aACd,YACA,cACc,CACd,GAAI,CAAC,YAAa,MAAO,CAAC,EAE1B,IAAM,MAAQ,MAAM,QAAQ,WAAW,EAAI,YAAc,CAAC,WAAW,EAC/D,QAAwB,CAAC,EACzB,QAAU,cAAgB,IAAI,IAAI,aAAa,EAAI,KAEzD,IAAK,IAAM,QAAQ,MAAO,CAExB,IAAM,WAAa,KAAK,QAAQ,GAAG,EACnC,GAAI,aAAe,GAAI,SAEvB,IAAM,YAAc,KAAK,QAAQ,IAAK,WAAa,CAAC,EACpD,GAAI,cAAgB,GAAI,SAExB,IAAM,MAAQ,KAAK,MAAM,EAAG,UAAU,EAChC,SAAW,KAAK,MAAM,WAAa,EAAG,WAAW,EACjD,MAAQ,KAAK,MAAM,YAAc,CAAC,EAEpC,CAAC,OAAS,CAAC,OACV,iBAAiB,IAAI,QAAQ,IAC9B,SAAW,CAAC,QAAQ,IAAI,KAAK,GAEjC,QAAQ,KAAK,CAAE,MAAiB,SAA4B,KAAM,CAAC,EACrE,CAEA,OAAO,OACT,CAGA,SAAgB,UACd,UACA,cACY,CACZ,GAAI,CAAC,UAAW,MAAO,CAAC,EAExB,IAAM,MAAQ,MAAM,QAAQ,SAAS,EAAI,UAAY,CAAC,SAAS,EACzD,QAAsB,CAAC,EACvB,QAA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QAAQ,EAChD,WAAY,gBAAgB,CAAE,KAAM,MAAM,KAAM,MAAO,MAAM,KAAM,CAAC,EACpE,OAAQ,iBAAiB,MAAM,CAAC,CAClC,CACF,CAKA,SAAgB,iBACd,OAC4C,CAC5C,IAAM,OAAqD,CAAC,EAmB5D,OAjBI,OAAO,SAAS,SAClB,OAAO,OAAS,OAAO,QAAQ,IAAK,GAAM,GAAG,EAAE,MAAM,GAAG,EAAE,SAAS,GAAG,EAAE,OAAO,GAG7E,OAAO,MAAM,SACf,OAAO,KAAO,OAAO,KAAK,IAAK,GAAM,GAAG,EAAE,MAAM,GAAG,EAAE,WAAW,GAG9D,OAAO,aACT,OAAO,KAAO,OAAO,WAAW,KAChC,OAAO,MAAQ,OAAO,WAAW,OAG/B,OAAO,SACT,OAAO,EAAI,OAAO,QAGb,MACT"}
|
|
@@ -53,4 +53,4 @@ interface RateLimitOptions {
|
|
|
53
53
|
declare function rateLimit(options?: RateLimitOptions): (req: Request, res: Response, next: NextFunction) => Promise<void | Response<any, Record<string, any>>>;
|
|
54
54
|
//#endregion
|
|
55
55
|
export { RateLimitStore as n, rateLimit as r, RateLimitOptions as t };
|
|
56
|
-
//# sourceMappingURL=rate-limit-
|
|
56
|
+
//# sourceMappingURL=rate-limit-oLL5EPUf.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate-limit-
|
|
1
|
+
{"version":3,"file":"rate-limit-oLL5EPUf.d.mts","names":[],"sources":["../src/http/middleware/rate-limit.ts"],"mappings":";;;;UAEiB,cAAA;EACf,SAAA,CAAU,GAAA,WAAc,OAAA;IAAU,SAAA;IAAmB,SAAA,EAAW,IAAA;EAAA;EAChE,SAAA,CAAU,GAAA,WAAc,OAAA;EACxB,KAAA,CAAM,GAAA,WAAc,OAAA;AAAA;AAAA,UAGL,gBAAA;EAHY;EAK3B,GAAA;EAPA;EASA,QAAA;EATwB;EAWxB,OAAA;EAXqD;EAarD,UAAA;EAZA;EAcA,YAAA,IAAgB,GAAA,EAAK,OAAA;EAdG;EAgBxB,OAAA;EAfM;EAiBN,KAAA,GAAQ,cAAA;EAjBmB;EAmB3B,IAAA,IAAQ,GAAA,EAAK,OAAA;EAhBE;EAkBf,SAAA;AAAA;;;;;;;;;;;;;;;;;;;;;iBA4Ec,SAAA,CAAU,OAAA,GAAS,gBAAA,IAAqB,GAAA,EAWnC,OAAA,EAAO,GAAA,EAAO,QAAA,EAAQ,IAAA,EAAQ,YAAA,KAAY,OAAA,QAAA,QAAA,MAAA,MAAA"}
|
|
@@ -94,4 +94,4 @@ declare function unref<T>(value: Ref<T> | T): T;
|
|
|
94
94
|
declare function toRefs<T extends Record<string, any>>(obj: T): { [K in keyof T]: Ref<T[K]> };
|
|
95
95
|
//#endregion
|
|
96
96
|
export { isRef as a, toRefs as c, computed as i, unref as l, Ref as n, reactive as o, WatchOptions as r, ref as s, ComputedRef as t, watch as u };
|
|
97
|
-
//# sourceMappingURL=reactivity-
|
|
97
|
+
//# sourceMappingURL=reactivity-DWmLcN0A.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactivity-DWmLcN0A.d.mts","names":[],"sources":["../src/core/reactivity.ts"],"mappings":";;;AAuCA;;;;UAAiB,GAAA;EACf,KAAA,EAAO,CAAA;EASG;EAPV,SAAA,CAAU,EAAA,GAAK,QAAA,EAAU,CAAA,EAAG,QAAA,EAAU,CAAA;EAO3B;;;;;;EAAX,MAAA,IAAU,CAAA;AAAA;;;;;;AAAC;AAab;;;;iBAAgB,GAAA,IAAO,YAAA,EAAc,CAAA,GAAI,GAAA,CAAI,CAAA;AAAA,UAuC5B,WAAA;EAAA,SACN,KAAA,EAAO,CAAA;EAxC0B;;;;;EA8C1C,MAAA,IAAU,CAAC;AAAA;AA9CiC;AAuC9C;;;;;;;;;;AAOa;AA9CiC,iBA6D9B,QAAA,IAAY,MAAA,QAAc,CAAA,GAAI,WAAA,CAAY,CAAA;AAAA,UAgDzC,YAAA;EAhDO;EAkDtB,SAAS;AAAA;AAAA,KAGN,WAAA,MAAiB,GAAA,CAAI,CAAA,IAAK,WAAA,CAAY,CAAA,WAAY,CAAA;;;;;;;;;AArDI;AAgD3D;;;;AAEW;iBAmBK,KAAA,IACd,MAAA,EAAQ,WAAA,CAAY,CAAA,GACpB,QAAA,GAAW,QAAA,EAAU,CAAA,EAAG,QAAA,EAAU,CAAA,WAClC,OAAA,GAAU,YAAA;;;;;;;;;;;;;;;;iBAmDI,QAAA,WAAmB,MAAA,eAAqB,MAAA,EAAQ,CAAA,GAAI,CAAA;AAtEZ;AAAA,iBAgGxC,KAAA,CAAM,KAAA,QAAa,KAAA,IAAS,GAAG;;iBAK/B,KAAA,IAAS,KAAA,EAAO,GAAA,CAAI,CAAA,IAAK,CAAA,GAAI,CAAA;;iBAK7B,MAAA,WAAiB,MAAA,eAAqB,GAAA,EAAK,CAAA,iBAAkB,CAAA,GAAI,GAAA,CAAI,CAAA,CAAE,CAAA"}
|
|
@@ -16,4 +16,4 @@ declare const REQUEST_ID_HEADER = "x-request-id";
|
|
|
16
16
|
declare function requestId(): (req: Request, res: Response, next: NextFunction) => void;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { requestId as n, REQUEST_ID_HEADER as t };
|
|
19
|
-
//# sourceMappingURL=request-id-
|
|
19
|
+
//# sourceMappingURL=request-id-IDobbxU-.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-id-IDobbxU-.d.mts","names":[],"sources":["../src/http/middleware/request-id.ts"],"mappings":";;;;cAGa,iBAAA;;AAAb;;;;AAA8B;AAY9B;;;;iBAAgB,SAAA,KAAS,GAAA,EACV,OAAA,EAAO,GAAA,EAAO,QAAA,EAAQ,IAAA,EAAQ,YAAA"}
|
|
@@ -29,4 +29,4 @@ interface RequestLoggerOptions {
|
|
|
29
29
|
declare function requestLogger(options?: RequestLoggerOptions): (req: Request, res: Response, next: NextFunction) => void;
|
|
30
30
|
//#endregion
|
|
31
31
|
export { requestLogger as n, RequestLoggerOptions as t };
|
|
32
|
-
//# sourceMappingURL=request-logger-
|
|
32
|
+
//# sourceMappingURL=request-logger-DZVW6VNI.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-logger-
|
|
1
|
+
{"version":3,"file":"request-logger-DZVW6VNI.d.mts","names":[],"sources":["../src/http/middleware/request-logger.ts"],"mappings":";;;;UAGiB,oBAAA;;EAEf,IAAA;EAFmC;EAInC,KAAA;EAJmC;EAMnC,IAAA;AAAA;;;AAAI;AAmBN;;;;;;;;;;;;;iBAAgB,aAAA,CAAc,OAAA,GAAS,oBAAA,IAAyB,GAAA,EAKjD,OAAA,EAAO,GAAA,EAAO,QAAA,EAAQ,IAAA,EAAQ,YAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { S as SourcedRegistration } from "./index-
|
|
2
|
+
import { S as SourcedRegistration } from "./index-UpQwKBR3.mjs";
|
|
3
3
|
import { Router } from "express";
|
|
4
4
|
|
|
5
5
|
//#region src/http/router-builder.d.ts
|
|
@@ -28,4 +28,4 @@ interface BuildRoutesOptions {
|
|
|
28
28
|
declare function buildRoutes(controllerClass: any, options?: BuildRoutesOptions): Router;
|
|
29
29
|
//#endregion
|
|
30
30
|
export { _setExternalContributorSources as n, buildRoutes as r, BuildRoutesOptions as t };
|
|
31
|
-
//# sourceMappingURL=router-builder-
|
|
31
|
+
//# sourceMappingURL=router-builder-YUcLLArX.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-builder-
|
|
1
|
+
{"version":3,"file":"router-builder-YUcLLArX.d.mts","names":[],"sources":["../src/http/router-builder.ts"],"mappings":";;;;;;iBAmCgB,8BAAA,CAA+B,OAAuC,WAArB,mBAAmB;AAAA,UAInE,kBAAA;EAJ6B;;;AAAwC;AAItF;;EAOE,eAAA,YAA2B,mBAAmB;AAAA;AAAA;AAchD;;;;;;;;;AAA2F;AAd3C,iBAchC,WAAA,CAAY,eAAA,OAAsB,OAAA,GAAS,kBAAA,GAA0B,MAAM"}
|
|
@@ -67,4 +67,4 @@ interface SessionOptions {
|
|
|
67
67
|
declare function session(options: SessionOptions): (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
68
68
|
//#endregion
|
|
69
69
|
export { session as a, SessionStore as i, SessionData as n, SessionOptions as r, Session as t };
|
|
70
|
-
//# sourceMappingURL=session-
|
|
70
|
+
//# sourceMappingURL=session-DSRA-PUX.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-
|
|
1
|
+
{"version":3,"file":"session-DSRA-PUX.d.mts","names":[],"sources":["../src/http/middleware/session.ts"],"mappings":";;;;UAGiB,WAAA;EAAA,CACd,GAAW;AAAA;AAAA,UAGG,YAAA;EACf,GAAA,CAAI,GAAA,WAAc,OAAA,CAAQ,WAAA;EAC1B,GAAA,CAAI,GAAA,UAAa,IAAA,EAAM,WAAA,EAAa,MAAA,WAAiB,OAAA;EACrD,OAAA,CAAQ,GAAA,WAAc,OAAA;EACtB,KAAA,EAAO,GAAA,UAAa,MAAA,WAAiB,OAAA;AAAA;AAAA,UAGtB,OAAA;EACf,EAAA;EACA,IAAA,EAAM,WAAA;EACN,UAAA,IAAc,OAAA;EACd,OAAA,IAAW,OAAA;EACX,IAAA,IAAQ,OAAA;AAAA;AAAA,UAGO,cAAA;EAX6B;EAa5C,MAAA;EAhBI;EAkBJ,UAAA;EAlB0B;EAoB1B,MAAA;EAnBI;EAqBJ,OAAA;EArBiB;EAuBjB,iBAAA;EAvBqD;EAyBrD,MAAA;IACE,QAAA;IACA,MAAA;IACA,QAAA;IACA,IAAA;IACA,MAAA;EAAA;EA5B0C;EA+B5C,KAAA,GAAQ,YAAY;AAAA;;;;;;;;;;;;;;;;;;;AAvBL;AAGjB;;;;;iBAiJgB,OAAA,CAAQ,OAAA,EAAS,cAAA,IAAc,GAAA,EAoB1B,OAAA,EAAO,GAAA,EAAO,QAAA,EAAQ,IAAA,EAAQ,YAAA,KAAY,OAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { r as AppAdapter, t as AdapterContext } from "./adapter-
|
|
2
|
+
import { r as AppAdapter, t as AdapterContext } from "./adapter-EaDb0yXA.mjs";
|
|
3
3
|
//#region src/http/middleware/spa.d.ts
|
|
4
4
|
interface SpaAdapterOptions {
|
|
5
5
|
/**
|
|
@@ -98,4 +98,4 @@ declare class SpaAdapter implements AppAdapter {
|
|
|
98
98
|
}
|
|
99
99
|
//#endregion
|
|
100
100
|
export { SpaAdapterOptions as n, SpaAdapter as t };
|
|
101
|
-
//# sourceMappingURL=spa-
|
|
101
|
+
//# sourceMappingURL=spa-Cf2c2g7x.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spa-
|
|
1
|
+
{"version":3,"file":"spa-Cf2c2g7x.d.mts","names":[],"sources":["../src/http/middleware/spa.ts"],"mappings":";;;UAMiB,iBAAA;;;AAAjB;;;;;;;;;;AAiDmB;EAnCjB,SAAA;EAqEsB;;;;;;;;;;EAzDtB,SAAA;EAkEoB;;;;;;;;;EAvDpB,OAAA;EAuDoB;;;;EAjDpB,YAAA;EAoGA;;;;EA9FA,iBAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkCW,UAAA,YAAsB,UAAA;EAAA,QASb,OAAA;EARpB,IAAA;EAAA,QACQ,SAAA;EAAA,QACA,WAAA;EAAA,QACA,YAAA;EAAA,QACA,YAAA;EAAA,QACA,iBAAA;EAAA,QACA,SAAA;EAER,WAAA,CAAoB,OAAA,GAAS,iBAAA;EAU7B,WAAA;IAAc;EAAA,GAAO,cAAA;EAyCrB,WAAA;IAAc;EAAA,GAAO,cAAA;AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { g as FileUploadConfig, o as BaseUploadOptions } from "./decorators-
|
|
2
|
+
import { g as FileUploadConfig, o as BaseUploadOptions } from "./decorators-ejABLo9H.mjs";
|
|
3
3
|
import { NextFunction, Request, RequestHandler, Response } from "express";
|
|
4
4
|
import { Options } from "multer";
|
|
5
5
|
|
|
@@ -76,4 +76,4 @@ declare const upload: {
|
|
|
76
76
|
};
|
|
77
77
|
//#endregion
|
|
78
78
|
export { upload as a, resolveMimeTypes as i, buildUploadMiddleware as n, cleanupFiles as r, UploadOptions as t };
|
|
79
|
-
//# sourceMappingURL=upload-
|
|
79
|
+
//# sourceMappingURL=upload-D6edAELH.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-
|
|
1
|
+
{"version":3,"file":"upload-D6edAELH.d.mts","names":[],"sources":["../src/http/middleware/upload.ts"],"mappings":";;;;;;;;;AAiGA;;;;AAAgD;AAYhD;;iBAZgB,gBAAA,CAAiB,KAAe;;;;;;UAY/B,aAAA,SAAsB,iBAAiB;EAIlD;EAFJ,OAAA,GAAU,OAAA;EAmEG;EAjEb,IAAA;AAAA;;;;;;AAiE6E;AAAA;;;;;;iBAAtE,MAAA,CAAO,SAAA,UAAmB,OAAA,GAAS,aAAA,GAAqB,cAAc;;;;iBAQtE,KAAA,CAAM,SAAA,UAAmB,QAAA,WAAe,OAAA,GAAS,aAAA,GAAqB,cAAc;AAAA;;;AAAA,iBAQpF,IAAA,CAAK,OAAA,GAAS,aAAA,GAAqB,cAAc;;;;;AAAA;AAmB1D;;;;;;;;;iBAAgB,YAAA,KAAY,GAAA,EACb,OAAA,EAAO,GAAA,EAAO,QAAA,EAAQ,IAAA,EAAQ,YAAA;;;;;;iBA+B7B,qBAAA,CAAsB,MAAA,EAAQ,gBAAA,GAAmB,cAAc;AAA/E;AAAA,cAmBa,MAAA"}
|
|
@@ -9,15 +9,18 @@ interface ValidationSchema {
|
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Express middleware that validates request body/query/params against schemas.
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
*
|
|
13
|
+
* Accepts any schema supported by `@forinda/kickjs-schema`:
|
|
14
|
+
* - Zod schemas (auto-detected)
|
|
15
|
+
* - Standard Schema v1 objects
|
|
16
|
+
* - KickSchema instances (from adapters like fromZod, fromValibot, etc.)
|
|
17
|
+
* - Plain validator functions
|
|
14
18
|
*
|
|
15
19
|
* Validation failures are forwarded via `next(err)` as an `HttpException`, so
|
|
16
20
|
* they flow through the application's global error handler (`onError`) and
|
|
17
|
-
* produce a uniform response envelope.
|
|
18
|
-
* continue to see the same `{ message, errors: [{ field, message }] }` body.
|
|
21
|
+
* produce a uniform response envelope.
|
|
19
22
|
*/
|
|
20
23
|
declare function validate(schema: ValidationSchema): (req: Request, _res: Response, next: NextFunction) => void;
|
|
21
24
|
//#endregion
|
|
22
25
|
export { validate as n, ValidationSchema as t };
|
|
23
|
-
//# sourceMappingURL=validate-
|
|
26
|
+
//# sourceMappingURL=validate-DoZDOhCi.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-DoZDOhCi.d.mts","names":[],"sources":["../src/http/middleware/validate.ts"],"mappings":";;;;UAIiB,gBAAA;EACf,IAAA;EACA,KAAA;EACA,MAAA;AAAA;;;;;;AAAM;AAgDR;;;;;;;iBAAgB,QAAA,CAAS,MAAA,EAAQ,gBAAA,IAAgB,GAAA,EAClC,OAAA,EAAO,IAAA,EAAQ,QAAA,EAAQ,IAAA,EAAQ,YAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { r as MetaValue } from "./execution-context-
|
|
3
|
-
import { c as DepValue, n as ContextDecorator, r as ContextDecoratorSpec } from "./context-decorator
|
|
4
|
-
import { c as AdapterFactory } from "./index-
|
|
5
|
-
import { r as RequestContext } from "./context-
|
|
2
|
+
import { r as MetaValue } from "./execution-context-J97mWtz4.mjs";
|
|
3
|
+
import { c as DepValue, n as ContextDecorator, r as ContextDecoratorSpec } from "./context-decorator--tgS3nKW.mjs";
|
|
4
|
+
import { c as AdapterFactory } from "./index-UpQwKBR3.mjs";
|
|
5
|
+
import { r as RequestContext } from "./context-BqxbiEPD.mjs";
|
|
6
6
|
import { NextFunction, Request, Response } from "express";
|
|
7
7
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
8
8
|
|
|
@@ -23,7 +23,39 @@ interface ClusterOptions {
|
|
|
23
23
|
declare function isClusterPrimary(): boolean;
|
|
24
24
|
//#endregion
|
|
25
25
|
//#region src/http/define-http-context-decorator.d.ts
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Curried form returned by {@link DefineHttpContextDecoratorFn.withParams}.
|
|
28
|
+
* Spell only the per-call params shape `P`; `K` and `D` are inferred
|
|
29
|
+
* from the spec, and `Ctx` is locked to `RequestContext`.
|
|
30
|
+
*/
|
|
31
|
+
interface DefineHttpContextDecoratorWithParams<P extends Record<string, unknown>> {
|
|
32
|
+
<K extends string, D extends Record<string, DepValue> = Record<string, never>>(spec: ContextDecoratorSpec<K, D, P, RequestContext>): ContextDecorator<K, D, P, RequestContext>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Public shape of {@link defineHttpContextDecorator} — the positional
|
|
36
|
+
* call signature plus the curried `.withParams<P>()` helper that fixes
|
|
37
|
+
* partial-inference for the parameterised case.
|
|
38
|
+
*/
|
|
39
|
+
interface DefineHttpContextDecoratorFn {
|
|
40
|
+
<K extends string, D extends Record<string, DepValue> = Record<string, never>, P extends Record<string, unknown> = Record<string, never>>(spec: ContextDecoratorSpec<K, D, P, RequestContext>): ContextDecorator<K, D, P, RequestContext>;
|
|
41
|
+
/**
|
|
42
|
+
* Curried entry point. Spell only `P`; `K` and `D` infer from the
|
|
43
|
+
* spec. `Ctx` is locked to `RequestContext`.
|
|
44
|
+
*
|
|
45
|
+
* ```ts
|
|
46
|
+
* const LoadTenant = defineHttpContextDecorator.withParams<{
|
|
47
|
+
* source: 'header' | 'subdomain'
|
|
48
|
+
* }>()({
|
|
49
|
+
* key: 'tenant',
|
|
50
|
+
* deps: { repo: TENANT_REPO }, // D inferred
|
|
51
|
+
* paramDefaults: { source: 'header' },
|
|
52
|
+
* resolve: (ctx, { repo }, params) => repo.findFor(ctx, params),
|
|
53
|
+
* })
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
withParams<P extends Record<string, unknown>>(): DefineHttpContextDecoratorWithParams<P>;
|
|
57
|
+
}
|
|
58
|
+
declare const defineHttpContextDecorator: DefineHttpContextDecoratorFn;
|
|
27
59
|
//#endregion
|
|
28
60
|
//#region src/http/request-store.d.ts
|
|
29
61
|
/** Per-request storage for REQUEST-scoped DI and request context propagation */
|
|
@@ -214,4 +246,4 @@ interface ViewAdapterOptions {
|
|
|
214
246
|
declare const ViewAdapter: AdapterFactory<ViewAdapterOptions, unknown>;
|
|
215
247
|
//#endregion
|
|
216
248
|
export { TraceContextOptions as a, requestScopeMiddleware as c, getRequestValue as d, requestStore as f, isClusterPrimary as h, TraceContext as i, RequestStore as l, ClusterOptions as m, ViewAdapterOptions as n, parseTraceparent as o, defineHttpContextDecorator as p, TRACEPARENT_HEADER as r, traceContext as s, ViewAdapter as t, getRequestStore as u };
|
|
217
|
-
//# sourceMappingURL=views-
|
|
249
|
+
//# sourceMappingURL=views-D8Awr9tc.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"views-D8Awr9tc.d.mts","names":[],"sources":["../src/http/cluster.ts","../src/http/define-http-context-decorator.ts","../src/http/request-store.ts","../src/http/middleware/request-scope.ts","../src/http/middleware/trace-context.ts","../src/http/middleware/views.ts"],"mappings":";;;;;;;;;UAOiB,cAAA;;EAEf,OAAA;;EAEA,uBAAA;;EAEA,YAAA;;EAEA,WAAA;;EAEA,aAAA;AAAA;;iBAIc,gBAAA;;;;;;;;UCuDC,oCAAA,WAA+C,MAAA;EAAA,6BACjC,MAAA,SAAe,QAAA,IAAY,MAAA,iBACtD,IAAA,EAAM,oBAAA,CAAqB,CAAA,EAAG,CAAA,EAAG,CAAA,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UC3F5B,kBAAA;;;;;;;;;;;;;;;EAef,MAAA;;EAGA,GAAA;;EAGA,QAAA;;EAGA,MAAA;AAAA;ALtBF;;;;;;;;;;AAUe;AAIf;;;;AAAgC;;;;ACuDhC;;;;;;;;;;ADrEA,cKsDa,WAAA,EAAW,cAAA,CAAA,kBAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forinda/kickjs",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.14.0-alpha.0",
|
|
4
4
|
"description": "A production-grade, decorator-driven Node.js framework built on Express 5 and TypeScript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kickjs",
|
|
@@ -107,11 +107,15 @@
|
|
|
107
107
|
],
|
|
108
108
|
"output": [
|
|
109
109
|
"dist/**"
|
|
110
|
+
],
|
|
111
|
+
"dependencies": [
|
|
112
|
+
"../schema:build"
|
|
110
113
|
]
|
|
111
114
|
}
|
|
112
115
|
},
|
|
113
116
|
"dependencies": {
|
|
114
|
-
"reflect-metadata": "^0.2.2"
|
|
117
|
+
"reflect-metadata": "^0.2.2",
|
|
118
|
+
"@forinda/kickjs-schema": "0.1.0-alpha.0"
|
|
115
119
|
},
|
|
116
120
|
"peerDependencies": {
|
|
117
121
|
"dotenv": "^17.0.0",
|
|
@@ -128,14 +132,14 @@
|
|
|
128
132
|
}
|
|
129
133
|
},
|
|
130
134
|
"devDependencies": {
|
|
131
|
-
"@swc/core": "^1.15.
|
|
135
|
+
"@swc/core": "^1.15.40",
|
|
132
136
|
"@types/express": "^5.0.6",
|
|
133
137
|
"@types/multer": "^2.1.0",
|
|
134
|
-
"@types/node": "^25.
|
|
138
|
+
"@types/node": "^25.9.1",
|
|
135
139
|
"multer": "^2.1.1",
|
|
136
140
|
"typescript": "^6.0.3",
|
|
137
|
-
"vite": "^8.0.
|
|
138
|
-
"vitest": "^4.1.
|
|
141
|
+
"vite": "^8.0.14",
|
|
142
|
+
"vitest": "^4.1.7",
|
|
139
143
|
"zod": "^4.4.3"
|
|
140
144
|
},
|
|
141
145
|
"publishConfig": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"container-B51bkskE.d.mts","names":[],"sources":["../src/core/token.ts","../src/core/container.ts"],"mappings":";;;;;;;AAmDA;;;;AAA2F;AAW3F;;;;;;;;;;AAKoB;AAUpB;;;;;;;;;AAA8D;AAQ9D;;;;;;;;AAAyE;;;;AC5BzE;;;;AAAoC;AAqBpC;;;AArBA,cDNa,eAAA;;;;;;;AC+BF;AAIX;;UDxBiB,cAAA;EAAA,UACL,eAAA;ECuB0D;EAAA,SDrB3D,IAAA;ECwCoB;EAAA,SDtCpB,KAAA,GAAQ,CAAC;AAAA;ACsCW;AA+B/B;;;;;;AA/B+B,iBD5Bf,WAAA,GAAA,CAAe,IAAA,WAAe,cAAc,CAAC,CAAA;;iBAQ7C,gBAAA,CAAiB,KAAA,YAAiB,KAAA,IAAS,cAAc;;;;iBC5BzD,SAAA,CAAU,KAAU;;UAqBnB,oBAAA;EACf,KAAA;EACA,KAAA;EACA,IAAA,GAAO,SAAS;EAChB,SAAA;AAAA;;KAIU,uBAAA,IAA2B,OAA+B,EAAtB,oBAAoB;;;;;;ADnBhD;AAUpB;;;;;;;;;AAA8D;AAQ9D;UCoBiB,cAAA;;;;;;ADpBwD;;;;AC5BzE;;cA+Ea,SAAA;EAAA,eACI,QAAA;EAAA,QACP,aAAA;EAAA,QACA,SAAA;EAAA,QAGA,eAAA;EAAA,QACA,cAAA;EAAA,QACA,WAAA;EAAA,wBACgB,WAAA;EAjExB;EAAA,OAoEO,QAAA,IAAY,SAAA,EAAW,SAAA;EAnEvB;EAAA,OAqEA,QAAA,IAAY,SAAA,EAAW,SAAA;EApErB;AAAA;AAIX;;;EAJW,OA0EF,YAAA,IAAgB,GAAA;EAtE6C;AAmBtE;;;;AAA+B;EAnBuC,OA6E7D,qBAAA;IACM,SAAA,EAAW,GAAA;IAAe,MAAA,EA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