@forinda/kickjs 5.3.0 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/{adapter-C1w_xt08.d.mts → adapter-0r2uRCD3.d.mts} +2 -2
  2. package/dist/{adapter-C1w_xt08.d.mts.map → adapter-0r2uRCD3.d.mts.map} +1 -1
  3. package/dist/app-module-CzlIIjO3.d.mts +92 -0
  4. package/dist/app-module-CzlIIjO3.d.mts.map +1 -0
  5. package/dist/{application-BTRI4aBd.d.mts → application-CaEYca9E.d.mts} +34 -7
  6. package/dist/application-CaEYca9E.d.mts.map +1 -0
  7. package/dist/application-Zt956jNS.mjs +12 -0
  8. package/dist/application-Zt956jNS.mjs.map +1 -0
  9. package/dist/bootstrap-CmFQq1ar.mjs +12 -0
  10. package/dist/{bootstrap-kPcmbbWe.mjs.map → bootstrap-CmFQq1ar.mjs.map} +1 -1
  11. package/dist/{bootstrap-B4YrBipl.d.mts → bootstrap-Db8k2-21.d.mts} +2 -2
  12. package/dist/{bootstrap-B4YrBipl.d.mts.map → bootstrap-Db8k2-21.d.mts.map} +1 -1
  13. package/dist/config/index.mjs +2 -4
  14. package/dist/config-DDz5LuWw.mjs +12 -0
  15. package/dist/{config-DxEREQmR.mjs.map → config-DDz5LuWw.mjs.map} +1 -1
  16. package/dist/container-DrioVLNv.mjs +12 -0
  17. package/dist/{container-SMnB5yeT.mjs.map → container-DrioVLNv.mjs.map} +1 -1
  18. package/dist/context-B4BeGq1B.mjs +12 -0
  19. package/dist/context-B4BeGq1B.mjs.map +1 -0
  20. package/dist/{context-Ymvv-85x.d.mts → context-BAdAV-zO.d.mts} +48 -11
  21. package/dist/context-BAdAV-zO.d.mts.map +1 -0
  22. package/dist/{context-decorator-Bca_BoRK.d.mts → context-decorator-BgdDd-6X.d.mts} +19 -4
  23. package/dist/{context-decorator-Bca_BoRK.d.mts.map → context-decorator-BgdDd-6X.d.mts.map} +1 -1
  24. package/dist/core/adapter.d.mts +1 -1
  25. package/dist/core/adapter.mjs +2 -2
  26. package/dist/core/app-module.d.mts +2 -2
  27. package/dist/core/app-module.mjs +2 -2
  28. package/dist/core/cache.mjs +2 -103
  29. package/dist/core/cache.mjs.map +1 -1
  30. package/dist/core/container.mjs +2 -3
  31. package/dist/core/cron.mjs +2 -32
  32. package/dist/core/cron.mjs.map +1 -1
  33. package/dist/core/decorators.mjs +2 -285
  34. package/dist/core/decorators.mjs.map +1 -1
  35. package/dist/core/errors.mjs +2 -110
  36. package/dist/core/errors.mjs.map +1 -1
  37. package/dist/core/interfaces.mjs +2 -53
  38. package/dist/core/interfaces.mjs.map +1 -1
  39. package/dist/core/logger.mjs +2 -207
  40. package/dist/core/logger.mjs.map +1 -1
  41. package/dist/core/path.mjs +2 -35
  42. package/dist/core/path.mjs.map +1 -1
  43. package/dist/core/plugin.d.mts +1 -1
  44. package/dist/core/plugin.mjs +2 -2
  45. package/dist/core/reactivity.mjs +2 -179
  46. package/dist/core/reactivity.mjs.map +1 -1
  47. package/dist/core-MvABl8Cl.mjs +13 -0
  48. package/dist/core-MvABl8Cl.mjs.map +1 -0
  49. package/dist/env-CObTuGZ3.mjs +12 -0
  50. package/dist/{env-C4Yr6nN8.mjs.map → env-CObTuGZ3.mjs.map} +1 -1
  51. package/dist/http/application.d.mts +1 -1
  52. package/dist/http/application.mjs +2 -3
  53. package/dist/http/bootstrap.d.mts +1 -1
  54. package/dist/http/bootstrap.mjs +2 -3
  55. package/dist/http/context.d.mts +2 -2
  56. package/dist/http/context.mjs +2 -3
  57. package/dist/http/middleware/cors.mjs +2 -73
  58. package/dist/http/middleware/cors.mjs.map +1 -1
  59. package/dist/http/middleware/csrf.mjs +2 -62
  60. package/dist/http/middleware/csrf.mjs.map +1 -1
  61. package/dist/http/middleware/error-handler.mjs +2 -54
  62. package/dist/http/middleware/error-handler.mjs.map +1 -1
  63. package/dist/http/middleware/helmet.mjs +2 -41
  64. package/dist/http/middleware/helmet.mjs.map +1 -1
  65. package/dist/http/middleware/rate-limit.mjs +2 -91
  66. package/dist/http/middleware/rate-limit.mjs.map +1 -1
  67. package/dist/http/middleware/request-id.mjs +2 -25
  68. package/dist/http/middleware/request-id.mjs.map +1 -1
  69. package/dist/http/middleware/request-logger.mjs +2 -39
  70. package/dist/http/middleware/request-logger.mjs.map +1 -1
  71. package/dist/http/middleware/session.mjs +2 -167
  72. package/dist/http/middleware/session.mjs.map +1 -1
  73. package/dist/http/middleware/spa.d.mts +1 -1
  74. package/dist/http/middleware/spa.mjs +2 -98
  75. package/dist/http/middleware/spa.mjs.map +1 -1
  76. package/dist/http/middleware/upload.mjs +2 -181
  77. package/dist/http/middleware/upload.mjs.map +1 -1
  78. package/dist/http/middleware/validate.mjs +2 -68
  79. package/dist/http/middleware/validate.mjs.map +1 -1
  80. package/dist/http/middleware/views.d.mts +1 -1
  81. package/dist/http/middleware/views.mjs +2 -56
  82. package/dist/http/middleware/views.mjs.map +1 -1
  83. package/dist/http/query/index.mjs +2 -3
  84. package/dist/http/router-builder.d.mts +1 -1
  85. package/dist/http/router-builder.mjs +2 -105
  86. package/dist/http/router-builder.mjs.map +1 -1
  87. package/dist/{index-DvZfBNIf.d.mts → index-D-Wb23e6.d.mts} +264 -86
  88. package/dist/index-D-Wb23e6.d.mts.map +1 -0
  89. package/dist/index.d.mts +12 -12
  90. package/dist/index.mjs +2 -171
  91. package/dist/index.mjs.map +1 -1
  92. package/dist/metadata-WTmSU6Sf.mjs +12 -0
  93. package/dist/{metadata-CdYaU-XM.mjs.map → metadata-WTmSU6Sf.mjs.map} +1 -1
  94. package/dist/{plugin-DF8Xfv9Z.d.mts → plugin-JMkG7soG.d.mts} +102 -8
  95. package/dist/plugin-JMkG7soG.d.mts.map +1 -0
  96. package/dist/query-BmO0aBf6.mjs +12 -0
  97. package/dist/{query-nAYUgagU.mjs.map → query-BmO0aBf6.mjs.map} +1 -1
  98. package/dist/{router-builder-C7sXk_FG.d.mts → router-builder-CaQ629tw.d.mts} +2 -2
  99. package/dist/{router-builder-C7sXk_FG.d.mts.map → router-builder-CaQ629tw.d.mts.map} +1 -1
  100. package/dist/{spa-e4FIS2RB.d.mts → spa-CreyQc4N.d.mts} +2 -2
  101. package/dist/{spa-e4FIS2RB.d.mts.map → spa-CreyQc4N.d.mts.map} +1 -1
  102. package/dist/{views-DkNp9JJs.d.mts → views-1e3jQr5C.d.mts} +4 -4
  103. package/dist/{views-DkNp9JJs.d.mts.map → views-1e3jQr5C.d.mts.map} +1 -1
  104. package/package.json +2 -2
  105. package/dist/app-module-D6zL_V5S.d.mts +0 -50
  106. package/dist/app-module-D6zL_V5S.d.mts.map +0 -1
  107. package/dist/application-BTRI4aBd.d.mts.map +0 -1
  108. package/dist/application-Cna_2gex.mjs +0 -574
  109. package/dist/application-Cna_2gex.mjs.map +0 -1
  110. package/dist/bootstrap-kPcmbbWe.mjs +0 -195
  111. package/dist/config-DxEREQmR.mjs +0 -135
  112. package/dist/container-SMnB5yeT.mjs +0 -897
  113. package/dist/context-B0B3WQft.mjs +0 -348
  114. package/dist/context-B0B3WQft.mjs.map +0 -1
  115. package/dist/context-Ymvv-85x.d.mts.map +0 -1
  116. package/dist/core--a4XflX7.mjs +0 -820
  117. package/dist/core--a4XflX7.mjs.map +0 -1
  118. package/dist/env-C4Yr6nN8.mjs +0 -137
  119. package/dist/index-DvZfBNIf.d.mts.map +0 -1
  120. package/dist/metadata-CdYaU-XM.mjs +0 -76
  121. package/dist/plugin-DF8Xfv9Z.d.mts.map +0 -1
  122. package/dist/query-nAYUgagU.mjs +0 -164
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs v5.3.0
2
+ * @forinda/kickjs v5.5.0
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,174 +8,5 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import { a as UnknownAssetError, c as resolveAsset, d as stripExt, f as INJECTION_TOKEN, i as ASSET_MANIFEST_VERSION, l as useAssets, m as isInjectionToken, n as tokenName, o as assets, p as createToken, r as ASSETS, s as clearAssetCache, t as Container, u as groupAssetKeys } from "./container-SMnB5yeT.mjs";
12
- import { METADATA, Scope } from "./core/interfaces.mjs";
13
- import { ConsoleLoggerProvider, Logger, createLogger, rootLogger } from "./core/logger.mjs";
14
- import { a as getMethodMeta, c as pushClassMeta, d as setInMetaMap, f as setInMetaRecord, i as getMetaRecord, l as pushMethodMeta, n as getClassMetaOrUndefined, o as getMethodMetaOrUndefined, p as setMethodMeta, r as getMetaMap, s as hasClassMeta, t as getClassMeta, u as setClassMeta } from "./metadata-CdYaU-XM.mjs";
15
- import { ApiQueryParams, Asset, Autowired, Builder, Component, Controller, Delete, FileUpload, Get, Inject, Injectable, Middleware, Patch, Post, PostConstruct, Put, Repository, Service, Value, normalizeApiQueryParamsConfig, withBuilder } from "./core/decorators.mjs";
16
- import { CRON_META, Cron, getCronJobs } from "./core/cron.mjs";
17
- import { CacheEvict, Cacheable, MemoryCacheProvider, getCacheProvider, setCacheProvider } from "./core/cache.mjs";
18
- import { HttpException, HttpStatus } from "./core/errors.mjs";
19
- import { joinPaths, normalizePath } from "./core/path.mjs";
20
- import { a as MissingMountDepError, c as runContributors, d as DuplicateContributorError, f as MissingContributorError, h as CircuitOpenError, i as DuplicateMountNameError, l as buildPipeline, m as CircuitBreaker, n as defineAdapter, o as MountCycleError, p as defineContextDecorator, r as definePlugin, s as mountSort, t as defineAugmentation, u as ContributorCycleError } from "./core--a4XflX7.mjs";
21
- import { computed, isRef, reactive, ref, toRefs, unref, watch } from "./core/reactivity.mjs";
22
- import { REQUEST_ID_HEADER, requestId } from "./http/middleware/request-id.mjs";
23
- import { errorHandler, notFoundHandler } from "./http/middleware/error-handler.mjs";
24
- import { i as requestStore, n as getRequestStore, r as getRequestValue, t as RequestContext } from "./context-B0B3WQft.mjs";
25
- import { n as requestScopeMiddleware, t as Application } from "./application-Cna_2gex.mjs";
26
- import { a as parseSearchQuery, i as parseQuery, n as parseFilters, o as parseSort, r as parsePagination, s as FILTER_OPERATORS, t as buildQueryParams } from "./query-nAYUgagU.mjs";
27
- import { validate } from "./http/middleware/validate.mjs";
28
- import { buildUploadMiddleware, cleanupFiles, resolveMimeTypes, upload } from "./http/middleware/upload.mjs";
29
- import { buildRoutes } from "./http/router-builder.mjs";
30
- import { a as reloadEnv, i as loadEnv, n as defineEnv, o as resetEnvCache, r as getEnv, t as baseEnvSchema } from "./env-C4Yr6nN8.mjs";
31
- import { n as isClusterPrimary, t as bootstrap } from "./bootstrap-kPcmbbWe.mjs";
32
- import { csrf } from "./http/middleware/csrf.mjs";
33
- import { requestLogger } from "./http/middleware/request-logger.mjs";
34
- import { helmet } from "./http/middleware/helmet.mjs";
35
- import { cors } from "./http/middleware/cors.mjs";
36
- import { rateLimit } from "./http/middleware/rate-limit.mjs";
37
- import { session } from "./http/middleware/session.mjs";
38
- import { ViewAdapter } from "./http/middleware/views.mjs";
39
- import { SpaAdapter } from "./http/middleware/spa.mjs";
40
- import { n as createConfigService, t as ConfigService } from "./config-DxEREQmR.mjs";
41
- import crypto from "node:crypto";
42
- //#region src/http/define-http-context-decorator.ts
43
- /**
44
- * HTTP-flavoured wrapper around {@link defineContextDecorator}.
45
- *
46
- * The core factory leaves `Ctx` defaulted to {@link ExecutionContext} so the
47
- * Context Contributor pipeline stays transport-agnostic — future WebSocket,
48
- * queue, and cron contexts share the same primitive. The cost is that the
49
- * vast majority of contributors (which are HTTP) have to spell the fourth
50
- * generic by hand to get `ctx.req` / `ctx.headers` typing:
51
- *
52
- * ```ts
53
- * // Verbose: spell every generic, including the params shape `P`.
54
- * defineContextDecorator<'tenant', Record<string, never>, Record<string, never>, RequestContext>({
55
- * key: 'tenant',
56
- * resolve: (ctx) => ({ id: ctx.req.headers['x-tenant-id'] as string }),
57
- * })
58
- * ```
59
- *
60
- * `defineHttpContextDecorator` removes that ceremony — the spec is typed
61
- * against `RequestContext` from the start, so resolvers can read `ctx.req`,
62
- * `ctx.headers`, `ctx.params`, etc. without a cast or generic dance:
63
- *
64
- * ```ts
65
- * import { defineHttpContextDecorator } from '@forinda/kickjs'
66
- *
67
- * const LoadTenant = defineHttpContextDecorator({
68
- * key: 'tenant',
69
- * resolve: (ctx) => ({ id: ctx.req.headers['x-tenant-id'] as string }),
70
- * })
71
- *
72
- * // Parameterised: the third generic carries the per-call params shape.
73
- * const LoadTenantParameterised = defineHttpContextDecorator<
74
- * 'tenant',
75
- * Record<string, never>,
76
- * { source: 'header' | 'subdomain' }
77
- * >({
78
- * key: 'tenant',
79
- * paramDefaults: { source: 'header' },
80
- * resolve: (ctx, _deps, params) => {
81
- * // params.source narrows inside `if` branches.
82
- * },
83
- * })
84
- * ```
85
- *
86
- * Use {@link defineContextDecorator} directly when authoring contributors
87
- * for non-HTTP transports or when you want to share one contributor across
88
- * HTTP + WS + queue (the resolver then has to stick to the
89
- * `ExecutionContext` surface — `ctx.get` / `ctx.set` / `ctx.requestId`).
90
- */
91
- function defineHttpContextDecorator(spec) {
92
- return defineContextDecorator(spec);
93
- }
94
- //#endregion
95
- //#region src/http/middleware/trace-context.ts
96
- /**
97
- * W3C Trace Context header name.
98
- * @see https://www.w3.org/TR/trace-context/#traceparent-header
99
- */
100
- const TRACEPARENT_HEADER = "traceparent";
101
- /** Regex for a valid W3C traceparent: {version}-{trace-id}-{parent-id}-{flags} */
102
- const TRACEPARENT_RE = /^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/;
103
- /**
104
- * Generate a random 32-hex-character trace ID.
105
- */
106
- function generateTraceId() {
107
- return crypto.randomBytes(16).toString("hex");
108
- }
109
- /**
110
- * Generate a random 16-hex-character span ID.
111
- */
112
- function generateSpanId() {
113
- return crypto.randomBytes(8).toString("hex");
114
- }
115
- /**
116
- * Parse a W3C traceparent header value.
117
- * Returns null if the format is invalid.
118
- */
119
- function parseTraceparent(header) {
120
- const match = TRACEPARENT_RE.exec(header.trim().toLowerCase());
121
- if (!match) return null;
122
- const version = match[1];
123
- const traceId = match[2];
124
- const parentSpanId = match[3];
125
- const flags = match[4];
126
- if (version === "ff" || traceId === "00000000000000000000000000000000" || parentSpanId === "0000000000000000") return null;
127
- return {
128
- version,
129
- traceId,
130
- parentSpanId,
131
- flags
132
- };
133
- }
134
- /**
135
- * Middleware that extracts W3C `traceparent` header and stores trace context
136
- * in the request's AsyncLocalStorage store.
137
- *
138
- * If no valid `traceparent` header is present, a new traceId is generated
139
- * so that every request always has a trace ID available for correlation.
140
- *
141
- * Must be mounted **after** `requestScopeMiddleware()` (which creates the store).
142
- *
143
- * @example
144
- * ```ts
145
- * bootstrap({
146
- * middleware: [
147
- * requestScopeMiddleware(),
148
- * traceContext(), // extracts or generates traceId
149
- * requestLogger(),
150
- * express.json(),
151
- * ],
152
- * })
153
- * ```
154
- */
155
- function traceContext(options = {}) {
156
- return (req, res, next) => {
157
- const store = requestStore.getStore();
158
- const traceparentHeader = req.headers[TRACEPARENT_HEADER];
159
- const raw = Array.isArray(traceparentHeader) ? traceparentHeader[0] : traceparentHeader;
160
- const parsed = raw ? parseTraceparent(raw) : null;
161
- const traceId = parsed?.traceId ?? generateTraceId();
162
- const spanId = generateSpanId();
163
- if (store) {
164
- store.values.set("traceId", traceId);
165
- store.values.set("spanId", spanId);
166
- if (parsed) {
167
- store.values.set("parentSpanId", parsed.parentSpanId);
168
- store.values.set("traceFlags", parsed.flags);
169
- store.values.set("traceVersion", parsed.version);
170
- }
171
- }
172
- req.traceId = traceId;
173
- req.spanId = spanId;
174
- if (options.propagateResponse) res.setHeader("traceresponse", traceId);
175
- next();
176
- };
177
- }
178
- //#endregion
179
- export { ASSETS, ASSET_MANIFEST_VERSION, ApiQueryParams, Application, Asset, Autowired, Builder, CRON_META, CacheEvict, Cacheable, CircuitBreaker, CircuitOpenError, Component, ConfigService, ConsoleLoggerProvider, Container, ContributorCycleError, Controller, Cron, Delete, DuplicateContributorError, DuplicateMountNameError, FILTER_OPERATORS, FileUpload, Get, HttpException, HttpStatus, INJECTION_TOKEN, Inject, Injectable, Logger, METADATA, MemoryCacheProvider, Middleware, MissingContributorError, MissingMountDepError, MountCycleError, Patch, Post, PostConstruct, Put, REQUEST_ID_HEADER, Repository, RequestContext, Scope, Service, SpaAdapter, TRACEPARENT_HEADER, UnknownAssetError, Value, ViewAdapter, assets, baseEnvSchema, bootstrap, buildPipeline, buildQueryParams, buildRoutes, buildUploadMiddleware, cleanupFiles, clearAssetCache, computed, cors, createConfigService, createLogger, createToken, csrf, defineAdapter, defineAugmentation, defineContextDecorator, defineEnv, defineHttpContextDecorator, definePlugin, errorHandler, getCacheProvider, getClassMeta, getClassMetaOrUndefined, getCronJobs, getEnv, getMetaMap, getMetaRecord, getMethodMeta, getMethodMetaOrUndefined, getRequestStore, getRequestValue, groupAssetKeys, hasClassMeta, helmet, isClusterPrimary, isInjectionToken, isRef, joinPaths, loadEnv, mountSort, normalizeApiQueryParamsConfig, normalizePath, notFoundHandler, parseFilters, parsePagination, parseQuery, parseSearchQuery, parseSort, parseTraceparent, pushClassMeta, pushMethodMeta, rateLimit, reactive, ref, reloadEnv, requestId, requestLogger, requestScopeMiddleware, requestStore, resetEnvCache, resolveAsset, resolveMimeTypes, rootLogger, runContributors, session, setCacheProvider, setClassMeta, setInMetaMap, setInMetaRecord, setMethodMeta, stripExt, toRefs, tokenName, traceContext, unref, upload, useAssets, validate, watch, withBuilder };
180
-
11
+ import{a as UnknownAssetError,c as resolveAsset,d as stripExt,f as INJECTION_TOKEN,i as ASSET_MANIFEST_VERSION,l as useAssets,m as isInjectionToken,n as tokenName,o as assets,p as createToken,r as ASSETS,s as clearAssetCache,t as Container,u as groupAssetKeys}from"./container-DrioVLNv.mjs";import{METADATA,Scope}from"./core/interfaces.mjs";import{ConsoleLoggerProvider,Logger,createLogger,rootLogger}from"./core/logger.mjs";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-WTmSU6Sf.mjs";import{ApiQueryParams,Asset,Autowired,Builder,Component,Controller,Delete,FileUpload,Get,Inject,Injectable,Middleware,Patch,Post,PostConstruct,Put,Repository,Service,Value,normalizeApiQueryParamsConfig,withBuilder}from"./core/decorators.mjs";import{_ as ModuleList,a as MissingMountDepError,c as runContributors,d as DuplicateContributorError,f as MissingContributorError,g as MutableModuleRegistry,h as CircuitOpenError,i as DuplicateMountNameError,l as buildPipeline,m as CircuitBreaker,n as defineAdapter,o as MountCycleError,p as defineContextDecorator,r as definePlugin,s as mountSort,t as defineAugmentation,u as ContributorCycleError,v as defineModules,y as defineModule}from"./core-MvABl8Cl.mjs";import{CRON_META,Cron,getCronJobs}from"./core/cron.mjs";import{CacheEvict,Cacheable,MemoryCacheProvider,getCacheProvider,setCacheProvider}from"./core/cache.mjs";import{HttpException,HttpStatus}from"./core/errors.mjs";import{joinPaths,normalizePath}from"./core/path.mjs";import{computed,isRef,reactive,ref,toRefs,unref,watch}from"./core/reactivity.mjs";import{REQUEST_ID_HEADER,requestId}from"./http/middleware/request-id.mjs";import{errorHandler,notFoundHandler}from"./http/middleware/error-handler.mjs";import{i as requestStore,n as getRequestStore,r as getRequestValue,t as RequestContext}from"./context-B4BeGq1B.mjs";import{n as requestScopeMiddleware,t as Application}from"./application-Zt956jNS.mjs";import{a as parseSearchQuery,i as parseQuery,n as parseFilters,o as parseSort,r as parsePagination,s as FILTER_OPERATORS,t as buildQueryParams}from"./query-BmO0aBf6.mjs";import{validate}from"./http/middleware/validate.mjs";import{buildUploadMiddleware,cleanupFiles,resolveMimeTypes,upload}from"./http/middleware/upload.mjs";import{buildRoutes}from"./http/router-builder.mjs";import{a as reloadEnv,i as loadEnv,n as defineEnv,o as resetEnvCache,r as getEnv,t as baseEnvSchema}from"./env-CObTuGZ3.mjs";import{n as isClusterPrimary,t as bootstrap}from"./bootstrap-CmFQq1ar.mjs";import{csrf}from"./http/middleware/csrf.mjs";import{requestLogger}from"./http/middleware/request-logger.mjs";import{helmet}from"./http/middleware/helmet.mjs";import{cors}from"./http/middleware/cors.mjs";import{rateLimit}from"./http/middleware/rate-limit.mjs";import{session}from"./http/middleware/session.mjs";import{ViewAdapter}from"./http/middleware/views.mjs";import{SpaAdapter}from"./http/middleware/spa.mjs";import{n as createConfigService,t as ConfigService}from"./config-DDz5LuWw.mjs";import crypto from"node:crypto";function defineHttpContextDecorator(spec){return defineContextDecorator(spec)}const TRACEPARENT_HEADER=`traceparent`,TRACEPARENT_RE=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/;function generateTraceId(){return crypto.randomBytes(16).toString(`hex`)}function generateSpanId(){return crypto.randomBytes(8).toString(`hex`)}function parseTraceparent(header){let match=TRACEPARENT_RE.exec(header.trim().toLowerCase());if(!match)return null;let version=match[1],traceId=match[2],parentSpanId=match[3],flags=match[4];return version===`ff`||traceId===`00000000000000000000000000000000`||parentSpanId===`0000000000000000`?null:{version,traceId,parentSpanId,flags}}function traceContext(options={}){return(req,res,next)=>{let store=requestStore.getStore(),traceparentHeader=req.headers[TRACEPARENT_HEADER],raw=Array.isArray(traceparentHeader)?traceparentHeader[0]:traceparentHeader,parsed=raw?parseTraceparent(raw):null,traceId=parsed?.traceId??generateTraceId(),spanId=generateSpanId();store&&(store.values.set(`traceId`,traceId),store.values.set(`spanId`,spanId),parsed&&(store.values.set(`parentSpanId`,parsed.parentSpanId),store.values.set(`traceFlags`,parsed.flags),store.values.set(`traceVersion`,parsed.version))),req.traceId=traceId,req.spanId=spanId,options.propagateResponse&&res.setHeader(`traceresponse`,traceId),next()}}export{ASSETS,ASSET_MANIFEST_VERSION,ApiQueryParams,Application,Asset,Autowired,Builder,CRON_META,CacheEvict,Cacheable,CircuitBreaker,CircuitOpenError,Component,ConfigService,ConsoleLoggerProvider,Container,ContributorCycleError,Controller,Cron,Delete,DuplicateContributorError,DuplicateMountNameError,FILTER_OPERATORS,FileUpload,Get,HttpException,HttpStatus,INJECTION_TOKEN,Inject,Injectable,Logger,METADATA,MemoryCacheProvider,Middleware,MissingContributorError,MissingMountDepError,ModuleList,MountCycleError,MutableModuleRegistry,Patch,Post,PostConstruct,Put,REQUEST_ID_HEADER,Repository,RequestContext,Scope,Service,SpaAdapter,TRACEPARENT_HEADER,UnknownAssetError,Value,ViewAdapter,assets,baseEnvSchema,bootstrap,buildPipeline,buildQueryParams,buildRoutes,buildUploadMiddleware,cleanupFiles,clearAssetCache,computed,cors,createConfigService,createLogger,createToken,csrf,defineAdapter,defineAugmentation,defineContextDecorator,defineEnv,defineHttpContextDecorator,defineModule,defineModules,definePlugin,errorHandler,getCacheProvider,getClassMeta,getClassMetaOrUndefined,getCronJobs,getEnv,getMetaMap,getMetaRecord,getMethodMeta,getMethodMetaOrUndefined,getRequestStore,getRequestValue,groupAssetKeys,hasClassMeta,helmet,isClusterPrimary,isInjectionToken,isRef,joinPaths,loadEnv,mountSort,normalizeApiQueryParamsConfig,normalizePath,notFoundHandler,parseFilters,parsePagination,parseQuery,parseSearchQuery,parseSort,parseTraceparent,pushClassMeta,pushMethodMeta,rateLimit,reactive,ref,reloadEnv,requestId,requestLogger,requestScopeMiddleware,requestStore,resetEnvCache,resolveAsset,resolveMimeTypes,rootLogger,runContributors,session,setCacheProvider,setClassMeta,setInMetaMap,setInMetaRecord,setMethodMeta,stripExt,toRefs,tokenName,traceContext,unref,upload,useAssets,validate,watch,withBuilder};
181
12
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/http/define-http-context-decorator.ts","../src/http/middleware/trace-context.ts"],"sourcesContent":["/**\n * HTTP-flavoured wrapper around {@link defineContextDecorator}.\n *\n * The core factory leaves `Ctx` defaulted to {@link ExecutionContext} so the\n * Context Contributor pipeline stays transport-agnostic — future WebSocket,\n * queue, and cron contexts share the same primitive. The cost is that the\n * vast majority of contributors (which are HTTP) have to spell the fourth\n * generic by hand to get `ctx.req` / `ctx.headers` typing:\n *\n * ```ts\n * // Verbose: spell every generic, including the params shape `P`.\n * defineContextDecorator<'tenant', Record<string, never>, Record<string, never>, RequestContext>({\n * key: 'tenant',\n * resolve: (ctx) => ({ id: ctx.req.headers['x-tenant-id'] as string }),\n * })\n * ```\n *\n * `defineHttpContextDecorator` removes that ceremony — the spec is typed\n * against `RequestContext` from the start, so resolvers can read `ctx.req`,\n * `ctx.headers`, `ctx.params`, etc. without a cast or generic dance:\n *\n * ```ts\n * import { defineHttpContextDecorator } from '@forinda/kickjs'\n *\n * const LoadTenant = defineHttpContextDecorator({\n * key: 'tenant',\n * resolve: (ctx) => ({ id: ctx.req.headers['x-tenant-id'] as string }),\n * })\n *\n * // Parameterised: the third generic carries the per-call params shape.\n * const LoadTenantParameterised = defineHttpContextDecorator<\n * 'tenant',\n * Record<string, never>,\n * { source: 'header' | 'subdomain' }\n * >({\n * key: 'tenant',\n * paramDefaults: { source: 'header' },\n * resolve: (ctx, _deps, params) => {\n * // params.source narrows inside `if` branches.\n * },\n * })\n * ```\n *\n * Use {@link defineContextDecorator} directly when authoring contributors\n * for non-HTTP transports or when you want to share one contributor across\n * HTTP + WS + queue (the resolver then has to stick to the\n * `ExecutionContext` surface — `ctx.get` / `ctx.set` / `ctx.requestId`).\n */\n\nimport {\n defineContextDecorator,\n type ContextDecorator,\n type ContextDecoratorSpec,\n type DepValue,\n} from '../core/context-decorator'\nimport type { RequestContext } from './context'\n\nexport function defineHttpContextDecorator<\n K extends string,\n D extends Record<string, DepValue> = Record<string, never>,\n P extends Record<string, unknown> = Record<string, never>,\n>(spec: ContextDecoratorSpec<K, D, P, RequestContext>): ContextDecorator<K, D, P, RequestContext> {\n return defineContextDecorator<K, D, P, RequestContext>(spec)\n}\n","import crypto from 'node:crypto'\nimport type { Request, Response, NextFunction } from 'express'\nimport { requestStore } from '../request-store'\n\n/**\n * W3C Trace Context header name.\n * @see https://www.w3.org/TR/trace-context/#traceparent-header\n */\nexport const TRACEPARENT_HEADER = 'traceparent'\n\n/** Regex for a valid W3C traceparent: {version}-{trace-id}-{parent-id}-{flags} */\nconst TRACEPARENT_RE = /^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/\n\nexport interface TraceContextOptions {\n /**\n * When true, respond with a `traceresponse` header containing the trace ID.\n * Useful for debugging. Default: false.\n */\n propagateResponse?: boolean\n}\n\n/**\n * Parsed W3C trace context fields.\n */\nexport interface TraceContext {\n /** W3C traceparent version (usually '00') */\n version: string\n /** 32-hex-char distributed trace ID */\n traceId: string\n /** 16-hex-char parent span ID */\n parentSpanId: string\n /** 2-hex-char trace flags */\n flags: string\n}\n\n/**\n * Generate a random 32-hex-character trace ID.\n */\nfunction generateTraceId(): string {\n return crypto.randomBytes(16).toString('hex')\n}\n\n/**\n * Generate a random 16-hex-character span ID.\n */\nfunction generateSpanId(): string {\n return crypto.randomBytes(8).toString('hex')\n}\n\n/**\n * Parse a W3C traceparent header value.\n * Returns null if the format is invalid.\n */\nexport function parseTraceparent(header: string): TraceContext | null {\n const match = TRACEPARENT_RE.exec(header.trim().toLowerCase())\n if (!match) return null\n\n const version = match[1]\n const traceId = match[2]\n const parentSpanId = match[3]\n const flags = match[4]\n\n // W3C spec: version ff is invalid, all-zero trace-id and parent-id are invalid\n if (\n version === 'ff' ||\n traceId === '00000000000000000000000000000000' ||\n parentSpanId === '0000000000000000'\n ) {\n return null\n }\n\n return { version, traceId, parentSpanId, flags }\n}\n\n/**\n * Middleware that extracts W3C `traceparent` header and stores trace context\n * in the request's AsyncLocalStorage store.\n *\n * If no valid `traceparent` header is present, a new traceId is generated\n * so that every request always has a trace ID available for correlation.\n *\n * Must be mounted **after** `requestScopeMiddleware()` (which creates the store).\n *\n * @example\n * ```ts\n * bootstrap({\n * middleware: [\n * requestScopeMiddleware(),\n * traceContext(), // extracts or generates traceId\n * requestLogger(),\n * express.json(),\n * ],\n * })\n * ```\n */\nexport function traceContext(options: TraceContextOptions = {}) {\n return (req: Request, res: Response, next: NextFunction) => {\n const store = requestStore.getStore()\n\n const traceparentHeader = req.headers[TRACEPARENT_HEADER]\n const raw = Array.isArray(traceparentHeader) ? traceparentHeader[0] : traceparentHeader\n const parsed = raw ? parseTraceparent(raw) : null\n\n const traceId = parsed?.traceId ?? generateTraceId()\n const spanId = generateSpanId()\n\n // Attach to the request store so logger + downstream code can access it\n if (store) {\n store.values.set('traceId', traceId)\n store.values.set('spanId', spanId)\n if (parsed) {\n store.values.set('parentSpanId', parsed.parentSpanId)\n store.values.set('traceFlags', parsed.flags)\n store.values.set('traceVersion', parsed.version)\n }\n }\n\n // Also expose on req for convenience\n ;(req as any).traceId = traceId\n ;(req as any).spanId = spanId\n\n if (options.propagateResponse) {\n res.setHeader('traceresponse', traceId)\n }\n\n next()\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,SAAgB,2BAId,MAAgG;AAChG,QAAO,uBAAgD,KAAK;;;;;;;;ACtD9D,MAAa,qBAAqB;;AAGlC,MAAM,iBAAiB;;;;AA2BvB,SAAS,kBAA0B;AACjC,QAAO,OAAO,YAAY,GAAG,CAAC,SAAS,MAAM;;;;;AAM/C,SAAS,iBAAyB;AAChC,QAAO,OAAO,YAAY,EAAE,CAAC,SAAS,MAAM;;;;;;AAO9C,SAAgB,iBAAiB,QAAqC;CACpE,MAAM,QAAQ,eAAe,KAAK,OAAO,MAAM,CAAC,aAAa,CAAC;AAC9D,KAAI,CAAC,MAAO,QAAO;CAEnB,MAAM,UAAU,MAAM;CACtB,MAAM,UAAU,MAAM;CACtB,MAAM,eAAe,MAAM;CAC3B,MAAM,QAAQ,MAAM;AAGpB,KACE,YAAY,QACZ,YAAY,sCACZ,iBAAiB,mBAEjB,QAAO;AAGT,QAAO;EAAE;EAAS;EAAS;EAAc;EAAO;;;;;;;;;;;;;;;;;;;;;;;AAwBlD,SAAgB,aAAa,UAA+B,EAAE,EAAE;AAC9D,SAAQ,KAAc,KAAe,SAAuB;EAC1D,MAAM,QAAQ,aAAa,UAAU;EAErC,MAAM,oBAAoB,IAAI,QAAQ;EACtC,MAAM,MAAM,MAAM,QAAQ,kBAAkB,GAAG,kBAAkB,KAAK;EACtE,MAAM,SAAS,MAAM,iBAAiB,IAAI,GAAG;EAE7C,MAAM,UAAU,QAAQ,WAAW,iBAAiB;EACpD,MAAM,SAAS,gBAAgB;AAG/B,MAAI,OAAO;AACT,SAAM,OAAO,IAAI,WAAW,QAAQ;AACpC,SAAM,OAAO,IAAI,UAAU,OAAO;AAClC,OAAI,QAAQ;AACV,UAAM,OAAO,IAAI,gBAAgB,OAAO,aAAa;AACrD,UAAM,OAAO,IAAI,cAAc,OAAO,MAAM;AAC5C,UAAM,OAAO,IAAI,gBAAgB,OAAO,QAAQ;;;AAKlD,MAAY,UAAU;AACtB,MAAY,SAAS;AAEvB,MAAI,QAAQ,kBACV,KAAI,UAAU,iBAAiB,QAAQ;AAGzC,QAAM"}
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":";;;;;;;;;;kqGAyDA,SAAgB,2BAId,KAAgG,CAChG,OAAO,uBAAgD,KAAK,CCtD9D,MAAa,mBAAqB,cAG5B,eAAiB,8DA2BvB,SAAS,iBAA0B,CACjC,OAAO,OAAO,YAAY,GAAG,CAAC,SAAS,MAAM,CAM/C,SAAS,gBAAyB,CAChC,OAAO,OAAO,YAAY,EAAE,CAAC,SAAS,MAAM,CAO9C,SAAgB,iBAAiB,OAAqC,CACpE,IAAM,MAAQ,eAAe,KAAK,OAAO,MAAM,CAAC,aAAa,CAAC,CAC9D,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,MAAO,CAwBlD,SAAgB,aAAa,QAA+B,EAAE,CAAE,CAC9D,OAAQ,IAAc,IAAe,OAAuB,CAC1D,IAAM,MAAQ,aAAa,UAAU,CAE/B,kBAAoB,IAAI,QAAQ,oBAChC,IAAM,MAAM,QAAQ,kBAAkB,CAAG,kBAAkB,GAAK,kBAChE,OAAS,IAAM,iBAAiB,IAAI,CAAG,KAEvC,QAAU,QAAQ,SAAW,iBAAiB,CAC9C,OAAS,gBAAgB,CAG3B,QACF,MAAM,OAAO,IAAI,UAAW,QAAQ,CACpC,MAAM,OAAO,IAAI,SAAU,OAAO,CAC9B,SACF,MAAM,OAAO,IAAI,eAAgB,OAAO,aAAa,CACrD,MAAM,OAAO,IAAI,aAAc,OAAO,MAAM,CAC5C,MAAM,OAAO,IAAI,eAAgB,OAAO,QAAQ,GAKlD,IAAY,QAAU,QACtB,IAAY,OAAS,OAEnB,QAAQ,mBACV,IAAI,UAAU,gBAAiB,QAAQ,CAGzC,MAAM"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @forinda/kickjs v5.5.0
3
+ *
4
+ * Copyright (c) Felix Orinda
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */
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-WTmSU6Sf.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"metadata-CdYaU-XM.mjs","names":[],"sources":["../src/core/metadata.ts"],"sourcesContent":["import 'reflect-metadata'\nimport type { InjectionToken } from './token'\n\n/**\n * Typed utilities for reflect-metadata operations.\n *\n * Replaces scattered Reflect.defineMetadata/getMetadata calls with a single\n * source of truth. If we later move to Stage 3 decorators or a WeakMap-based\n * store, only this file changes — all 24+ consumer files stay untouched.\n *\n * Keys may be symbols, strings, or `InjectionToken<T>` objects produced by\n * `createToken()`. Using `createToken` is the preferred pattern because the\n * token's phantom type flows through the helpers, enabling type-safe reads.\n */\n\ntype MetaKey = symbol | string | InjectionToken<unknown>\n\n// ── Setters ─────────────────────────────────────────────────────\n\n/** Set metadata on a class (or prototype for property decorators) */\nexport function setClassMeta<T>(key: MetaKey, value: T, target: object): void {\n Reflect.defineMetadata(key, value, target)\n}\n\n/** Set metadata on a specific method */\nexport function setMethodMeta<T>(key: MetaKey, value: T, target: object, method: string): void {\n Reflect.defineMetadata(key, value, target, method)\n}\n\n// ── Getters ─────────────────────────────────────────────────────\n\n/** Get metadata from a class, returning `fallback` if not set */\nexport function getClassMeta<T>(key: MetaKey, target: object, fallback: T): T {\n return (Reflect.getMetadata(key, target) as T) ?? fallback\n}\n\n/** Get metadata from a specific method, returning `fallback` if not set */\nexport function getMethodMeta<T>(key: MetaKey, target: object, method: string, fallback: T): T {\n return (Reflect.getMetadata(key, target, method) as T) ?? fallback\n}\n\n/** Check if metadata exists on a class */\nexport function hasClassMeta(key: MetaKey, target: object): boolean {\n return Reflect.hasMetadata(key, target)\n}\n\n/** Get metadata from a class with no default (returns undefined if absent) */\nexport function getClassMetaOrUndefined<T>(key: MetaKey, target: object): T | undefined {\n return Reflect.getMetadata(key, target) as T | undefined\n}\n\n/** Get metadata from a method with no default (returns undefined if absent) */\nexport function getMethodMetaOrUndefined<T>(\n key: MetaKey,\n target: object,\n method: string,\n): T | undefined {\n return Reflect.getMetadata(key, target, method) as T | undefined\n}\n\n// ── Accumulate: Arrays ──────────────────────────────────────────\n\n/** Append items to an array stored in class metadata */\nexport function pushClassMeta<T>(key: MetaKey, target: object, ...items: T[]): void {\n const existing: T[] = Reflect.getOwnMetadata(key, target) ?? []\n Reflect.defineMetadata(key, [...existing, ...items], target)\n}\n\n/** Append items to an array stored in method metadata */\nexport function pushMethodMeta<T>(\n key: MetaKey,\n target: object,\n method: string,\n ...items: T[]\n): void {\n const existing: T[] = Reflect.getOwnMetadata(key, target, method) ?? []\n Reflect.defineMetadata(key, [...existing, ...items], target, method)\n}\n\n// ── Accumulate: Maps ────────────────────────────────────────────\n\n/** Set a key/value in a Map stored in class metadata */\nexport function setInMetaMap<K, V>(key: MetaKey, target: object, mapKey: K, mapValue: V): void {\n const inherited: Map<K, V> | undefined = Reflect.getOwnMetadata(key, target)\n const map = inherited ? new Map(inherited) : new Map<K, V>()\n map.set(mapKey, mapValue)\n Reflect.defineMetadata(key, map, target)\n}\n\n/** Get a Map from class metadata (returns empty Map if absent) */\nexport function getMetaMap<K, V>(key: MetaKey, target: object): Map<K, V> {\n return Reflect.getMetadata(key, target) ?? new Map()\n}\n\n// ── Accumulate: Records ─────────────────────────────────────────\n\n/** Set a key/value in a Record stored in class metadata */\nexport function setInMetaRecord<V>(\n key: MetaKey,\n target: object,\n recKey: string | number,\n recValue: V,\n): void {\n const inherited: Record<string | number, V> | undefined = Reflect.getOwnMetadata(key, target)\n const rec = inherited ? { ...inherited } : {}\n rec[recKey] = recValue\n Reflect.defineMetadata(key, rec, target)\n}\n\n/** Get a Record from class metadata (returns empty object if absent) */\nexport function getMetaRecord<V>(key: MetaKey, target: object): Record<string | number, V> {\n return Reflect.getMetadata(key, target) ?? {}\n}\n"],"mappings":";;;;;;;;;;;;;AAoBA,SAAgB,aAAgB,KAAc,OAAU,QAAsB;AAC5E,SAAQ,eAAe,KAAK,OAAO,OAAO;;;AAI5C,SAAgB,cAAiB,KAAc,OAAU,QAAgB,QAAsB;AAC7F,SAAQ,eAAe,KAAK,OAAO,QAAQ,OAAO;;;AAMpD,SAAgB,aAAgB,KAAc,QAAgB,UAAgB;AAC5E,QAAQ,QAAQ,YAAY,KAAK,OAAO,IAAU;;;AAIpD,SAAgB,cAAiB,KAAc,QAAgB,QAAgB,UAAgB;AAC7F,QAAQ,QAAQ,YAAY,KAAK,QAAQ,OAAO,IAAU;;;AAI5D,SAAgB,aAAa,KAAc,QAAyB;AAClE,QAAO,QAAQ,YAAY,KAAK,OAAO;;;AAIzC,SAAgB,wBAA2B,KAAc,QAA+B;AACtF,QAAO,QAAQ,YAAY,KAAK,OAAO;;;AAIzC,SAAgB,yBACd,KACA,QACA,QACe;AACf,QAAO,QAAQ,YAAY,KAAK,QAAQ,OAAO;;;AAMjD,SAAgB,cAAiB,KAAc,QAAgB,GAAG,OAAkB;CAClF,MAAM,WAAgB,QAAQ,eAAe,KAAK,OAAO,IAAI,EAAE;AAC/D,SAAQ,eAAe,KAAK,CAAC,GAAG,UAAU,GAAG,MAAM,EAAE,OAAO;;;AAI9D,SAAgB,eACd,KACA,QACA,QACA,GAAG,OACG;CACN,MAAM,WAAgB,QAAQ,eAAe,KAAK,QAAQ,OAAO,IAAI,EAAE;AACvE,SAAQ,eAAe,KAAK,CAAC,GAAG,UAAU,GAAG,MAAM,EAAE,QAAQ,OAAO;;;AAMtE,SAAgB,aAAmB,KAAc,QAAgB,QAAW,UAAmB;CAC7F,MAAM,YAAmC,QAAQ,eAAe,KAAK,OAAO;CAC5E,MAAM,MAAM,YAAY,IAAI,IAAI,UAAU,mBAAG,IAAI,KAAW;AAC5D,KAAI,IAAI,QAAQ,SAAS;AACzB,SAAQ,eAAe,KAAK,KAAK,OAAO;;;AAI1C,SAAgB,WAAiB,KAAc,QAA2B;AACxE,QAAO,QAAQ,YAAY,KAAK,OAAO,oBAAI,IAAI,KAAK;;;AAMtD,SAAgB,gBACd,KACA,QACA,QACA,UACM;CACN,MAAM,YAAoD,QAAQ,eAAe,KAAK,OAAO;CAC7F,MAAM,MAAM,YAAY,EAAE,GAAG,WAAW,GAAG,EAAE;AAC7C,KAAI,UAAU;AACd,SAAQ,eAAe,KAAK,KAAK,OAAO;;;AAI1C,SAAgB,cAAiB,KAAc,QAA4C;AACzF,QAAO,QAAQ,YAAY,KAAK,OAAO,IAAI,EAAE"}
1
+ {"version":3,"file":"metadata-WTmSU6Sf.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,OAAO,CAI5C,SAAgB,cAAiB,IAAc,MAAU,OAAgB,OAAsB,CAC7F,QAAQ,eAAe,IAAK,MAAO,OAAQ,OAAO,CAMpD,SAAgB,aAAgB,IAAc,OAAgB,SAAgB,CAC5E,OAAQ,QAAQ,YAAY,IAAK,OAAO,EAAU,SAIpD,SAAgB,cAAiB,IAAc,OAAgB,OAAgB,SAAgB,CAC7F,OAAQ,QAAQ,YAAY,IAAK,OAAQ,OAAO,EAAU,SAI5D,SAAgB,aAAa,IAAc,OAAyB,CAClE,OAAO,QAAQ,YAAY,IAAK,OAAO,CAIzC,SAAgB,wBAA2B,IAAc,OAA+B,CACtF,OAAO,QAAQ,YAAY,IAAK,OAAO,CAIzC,SAAgB,yBACd,IACA,OACA,OACe,CACf,OAAO,QAAQ,YAAY,IAAK,OAAQ,OAAO,CAMjD,SAAgB,cAAiB,IAAc,OAAgB,GAAG,MAAkB,CAClF,IAAM,SAAgB,QAAQ,eAAe,IAAK,OAAO,EAAI,EAAE,CAC/D,QAAQ,eAAe,IAAK,CAAC,GAAG,SAAU,GAAG,MAAM,CAAE,OAAO,CAI9D,SAAgB,eACd,IACA,OACA,OACA,GAAG,MACG,CACN,IAAM,SAAgB,QAAQ,eAAe,IAAK,OAAQ,OAAO,EAAI,EAAE,CACvE,QAAQ,eAAe,IAAK,CAAC,GAAG,SAAU,GAAG,MAAM,CAAE,OAAQ,OAAO,CAMtE,SAAgB,aAAmB,IAAc,OAAgB,OAAW,SAAmB,CAC7F,IAAM,UAAmC,QAAQ,eAAe,IAAK,OAAO,CACtE,IAAM,UAAY,IAAI,IAAI,UAAU,CAAG,IAAI,IACjD,IAAI,IAAI,OAAQ,SAAS,CACzB,QAAQ,eAAe,IAAK,IAAK,OAAO,CAI1C,SAAgB,WAAiB,IAAc,OAA2B,CACxE,OAAO,QAAQ,YAAY,IAAK,OAAO,EAAI,IAAI,IAMjD,SAAgB,gBACd,IACA,OACA,OACA,SACM,CACN,IAAM,UAAoD,QAAQ,eAAe,IAAK,OAAO,CACvF,IAAM,UAAY,CAAE,GAAG,UAAW,CAAG,EAAE,CAC7C,IAAI,QAAU,SACd,QAAQ,eAAe,IAAK,IAAK,OAAO,CAI1C,SAAgB,cAAiB,IAAc,OAA4C,CACzF,OAAO,QAAQ,YAAY,IAAK,OAAO,EAAI,EAAE"}
@@ -1,9 +1,68 @@
1
1
 
2
2
  import { t as Container } from "./container-BZKeHc5X.mjs";
3
- import { o as ContributorRegistrations } from "./context-decorator-Bca_BoRK.mjs";
4
- import { r as AppAdapter, s as KickJsPluginName } from "./adapter-C1w_xt08.mjs";
5
- import { n as AppModuleClass } from "./app-module-D6zL_V5S.mjs";
3
+ import { o as ContributorRegistrations } from "./context-decorator-BgdDd-6X.mjs";
4
+ import { r as AppAdapter, s as KickJsPluginName } from "./adapter-0r2uRCD3.mjs";
5
+ import { r as AppModuleEntry } from "./app-module-CzlIIjO3.mjs";
6
6
 
7
+ //#region src/core/module-registry.d.ts
8
+ /**
9
+ * Imperative receiver passed to {@link KickPlugin.setup} and the
10
+ * top-level `bootstrap({ setup })` callback so adopters can register
11
+ * modules conditionally — based on env flags, runtime config,
12
+ * tenant lists, etc. — instead of being limited to the static
13
+ * `modules: [...]` array.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * bootstrap({
18
+ * modules: [HelloModule()], // static — always mounted
19
+ * setup(registry) {
20
+ * if (env.ENABLE_ADMIN) registry.mount(AdminModule())
21
+ * for (const tenant of env.TENANTS) {
22
+ * registry.mount(TenantModule.scoped(tenant.id, { id: tenant.id }))
23
+ * }
24
+ * },
25
+ * })
26
+ * ```
27
+ *
28
+ * **Currently exposes only `.mount(module)` — the HTTP-feature path.**
29
+ * A future `.use(module)` for non-HTTP modules (queues, cron, workers,
30
+ * DI-only seeds) is planned but not yet implemented; existing non-HTTP
31
+ * modules continue returning `null` from `routes()` and registering
32
+ * via `.mount()`.
33
+ *
34
+ * Same dispatch rules as the static `modules: [...]` array — class
35
+ * entries get `new`-ed at boot, `defineModule` factory output is used
36
+ * directly. The registry doesn't validate the entry shape itself; the
37
+ * Application loader does the typeof discrimination at mount time.
38
+ */
39
+ interface ModuleRegistry {
40
+ /**
41
+ * Register a module for the full HTTP lifecycle: `register()` runs,
42
+ * `import.meta.glob` decorator side-effects fire, `routes()` is
43
+ * called and its result mounted, `contributors()` are merged at
44
+ * `'module'` precedence and applied to the mounted routes.
45
+ *
46
+ * Modules are mounted in registration order (first call → first
47
+ * mount). Order across sources is: plugin static modules → plugin
48
+ * `setup()` calls → user static modules → user `setup()` callback.
49
+ */
50
+ mount(module: AppModuleEntry): void;
51
+ }
52
+ /**
53
+ * Internal collector implementing {@link ModuleRegistry}. Application
54
+ * passes one of these to every `setup()` callback during bootstrap;
55
+ * the collected `entries` array is then run through the same
56
+ * class-vs-instance dispatch as the static `modules: [...]` array.
57
+ *
58
+ * Not exported from the public surface — adopters interact only
59
+ * through the {@link ModuleRegistry} interface.
60
+ */
61
+ declare class MutableModuleRegistry implements ModuleRegistry {
62
+ readonly entries: AppModuleEntry[];
63
+ mount(module: AppModuleEntry): void;
64
+ }
65
+ //#endregion
7
66
  //#region src/core/plugin.d.ts
8
67
  /**
9
68
  * Plugin interface for extending KickJS applications.
@@ -85,10 +144,45 @@ interface KickPlugin {
85
144
  */
86
145
  register?(container: Container): void;
87
146
  /**
88
- * Return module classes to be loaded alongside user modules.
89
- * Plugin modules are loaded before user modules.
147
+ * Return modules to be loaded alongside user modules. Plugin
148
+ * modules are loaded before user modules.
149
+ *
150
+ * Accepts both class form (`SomeModule extends AppModule`) and
151
+ * instance form (output of {@link defineModule}'s factory call,
152
+ * e.g. `TasksModule({ scope: 'admin' })`) — the bootstrap loader
153
+ * discriminates and either `new`-s the class or uses the instance
154
+ * directly.
155
+ *
156
+ * Static path — for conditional / dynamic registration, use
157
+ * {@link KickPlugin.setup} instead.
158
+ */
159
+ modules?(): AppModuleEntry[];
160
+ /**
161
+ * Imperative module registration hook. Receives a {@link ModuleRegistry}
162
+ * the plugin can call `.mount(module)` on to register modules
163
+ * conditionally — e.g. based on injected config, env flags, or a
164
+ * tenant list resolved at boot.
165
+ *
166
+ * Runs after the static {@link KickPlugin.modules} array is collected
167
+ * but before user modules and the user-level `setup()` callback. The
168
+ * plugin sees the same dispatch rules as everything else: class
169
+ * entries get `new`-ed, factory output is used directly.
170
+ *
171
+ * @example
172
+ * ```ts
173
+ * definePlugin<{ tenants: string[] }>({
174
+ * name: 'MultiTenantPlugin',
175
+ * build: (config) => ({
176
+ * setup(registry) {
177
+ * for (const tenant of config.tenants) {
178
+ * registry.mount(TenantModule.scoped(tenant, { id: tenant }))
179
+ * }
180
+ * },
181
+ * }),
182
+ * })
183
+ * ```
90
184
  */
91
- modules?(): AppModuleClass[];
185
+ setup?(registry: ModuleRegistry): void;
92
186
  /**
93
187
  * Return adapter instances to be added to the application.
94
188
  * Plugin adapters are added before user adapters.
@@ -161,5 +255,5 @@ interface KickPlugin {
161
255
  devtoolsTabs?(): readonly unknown[];
162
256
  }
163
257
  //#endregion
164
- export { KickPlugin as t };
165
- //# sourceMappingURL=plugin-DF8Xfv9Z.d.mts.map
258
+ export { ModuleRegistry as n, MutableModuleRegistry as r, KickPlugin as t };
259
+ //# sourceMappingURL=plugin-JMkG7soG.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-JMkG7soG.d.mts","names":[],"sources":["../src/core/module-registry.ts","../src/core/plugin.ts"],"mappings":";;;;;;;;;;;;AAiCA;;;;;;;;;AAuBA;;;;;;;;;;;;;;;;;UAvBiB,cAAA;;AC0BjB;;;;;;;;;EDfE,KAAA,CAAM,MAAA,EAAQ,cAAA;AAAA;;;;;;;;;;cAYH,qBAAA,YAAiC,cAAA;EAAA,SACnC,OAAA,EAAS,cAAA;EAElB,KAAA,CAAM,MAAA,EAAQ,cAAA;AAAA;;;AA1BhB;;;;;;;;;AAuBA;;;;;;;;;;;;;;;;;;;ACGA;;;;;;;;;;;;;;;;;;;;;;;;AD1BA,UC0BiB,UAAA;EAsER;EApEP,IAAA;EA0Ea;;;;;;;;;;;;;;;;;;EAtDb,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;;;;;;;;;;;;;EAcpB,UAAA,eAAyB,OAAA;;;;;;EAOzB,YAAA;AAAA"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @forinda/kickjs v5.5.0
3
+ *
4
+ * Copyright (c) Felix Orinda
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */
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-BmO0aBf6.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"query-nAYUgagU.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":"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"}
1
+ {"version":3,"file":"query-BmO0aBf6.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":"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"}
@@ -1,5 +1,5 @@
1
1
 
2
- import { D as SourcedRegistration } from "./index-DvZfBNIf.mjs";
2
+ import { S as SourcedRegistration } from "./index-D-Wb23e6.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-C7sXk_FG.d.mts.map
31
+ //# sourceMappingURL=router-builder-CaQ629tw.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"router-builder-C7sXk_FG.d.mts","names":[],"sources":["../src/http/router-builder.ts"],"mappings":";;;;;;iBAoCgB,8BAAA,CAA+B,OAAA,WAAkB,mBAAA;AAAA,UAIhD,kBAAA;EAJ6B;;;;AAI9C;;EAOE,eAAA,YAA2B,mBAAA;AAAA;;AAc7B;;;;;;;;;;iBAAgB,WAAA,CAAY,eAAA,OAAsB,OAAA,GAAS,kBAAA,GAA0B,MAAA"}
1
+ {"version":3,"file":"router-builder-CaQ629tw.d.mts","names":[],"sources":["../src/http/router-builder.ts"],"mappings":";;;;;;iBAoCgB,8BAAA,CAA+B,OAAA,WAAkB,mBAAA;AAAA,UAIhD,kBAAA;EAJ6B;;;;AAI9C;;EAOE,eAAA,YAA2B,mBAAA;AAAA;;AAc7B;;;;;;;;;;iBAAgB,WAAA,CAAY,eAAA,OAAsB,OAAA,GAAS,kBAAA,GAA0B,MAAA"}
@@ -1,5 +1,5 @@
1
1
 
2
- import { r as AppAdapter, t as AdapterContext } from "./adapter-C1w_xt08.mjs";
2
+ import { r as AppAdapter, t as AdapterContext } from "./adapter-0r2uRCD3.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-e4FIS2RB.d.mts.map
101
+ //# sourceMappingURL=spa-CreyQc4N.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spa-e4FIS2RB.d.mts","names":[],"sources":["../src/http/middleware/spa.ts"],"mappings":";;;UAMiB,iBAAA;;;AAAjB;;;;;;;;;;;EAcE,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;cAEY,OAAA,GAAS,iBAAA;EAU7B,WAAA,CAAA;IAAc;EAAA,GAAO,cAAA;EAyCrB,WAAA,CAAA;IAAc;EAAA,GAAO,cAAA;AAAA"}
1
+ {"version":3,"file":"spa-CreyQc4N.d.mts","names":[],"sources":["../src/http/middleware/spa.ts"],"mappings":";;;UAMiB,iBAAA;;;AAAjB;;;;;;;;;;;EAcE,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;cAEY,OAAA,GAAS,iBAAA;EAU7B,WAAA,CAAA;IAAc;EAAA,GAAO,cAAA;EAyCrB,WAAA,CAAA;IAAc;EAAA,GAAO,cAAA;AAAA"}
@@ -1,8 +1,8 @@
1
1
 
2
2
  import { r as MetaValue } from "./execution-context-DKnt61pY.mjs";
3
- import { n as ContextDecorator, r as ContextDecoratorSpec, s as DepValue } from "./context-decorator-Bca_BoRK.mjs";
4
- import { c as AdapterFactory } from "./index-DvZfBNIf.mjs";
5
- import { n as RequestContext } from "./context-Ymvv-85x.mjs";
3
+ import { n as ContextDecorator, r as ContextDecoratorSpec, s as DepValue } from "./context-decorator-BgdDd-6X.mjs";
4
+ import { c as AdapterFactory } from "./index-D-Wb23e6.mjs";
5
+ import { r as RequestContext } from "./context-BAdAV-zO.mjs";
6
6
  import { NextFunction, Request, Response } from "express";
7
7
  import { AsyncLocalStorage } from "node:async_hooks";
8
8
 
@@ -214,4 +214,4 @@ interface ViewAdapterOptions {
214
214
  declare const ViewAdapter: AdapterFactory<ViewAdapterOptions, unknown>;
215
215
  //#endregion
216
216
  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-DkNp9JJs.d.mts.map
217
+ //# sourceMappingURL=views-1e3jQr5C.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"views-DkNp9JJs.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,CAAA;;;iBCoCA,0BAAA,6BAEJ,MAAA,SAAe,QAAA,IAAY,MAAA,2BAC3B,MAAA,oBAA0B,MAAA,gBAAA,CACpC,IAAA,EAAM,oBAAA,CAAqB,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,cAAA,IAAkB,gBAAA,CAAiB,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,cAAA;;;;UCzDjE,YAAA;;EAEf,SAAA;;;;;;EAMA,SAAA,EAAW,GAAA;;;;;;;;;;;;AFLb;;;;;;;;;EE0BE,MAAA,EAAQ,GAAA;AAAA;AFZV;AAAA,cEgBa,YAAA,EAAY,iBAAA,CAAA,YAAA;;;;;iBAMT,eAAA,CAAA,GAAmB,YAAA;;ADcnC;;;;;;;;;;;;;;;;;;;;;;;;;iBCsBgB,eAAA,kBAAA,CAAkC,GAAA,EAAK,CAAA,GAAI,SAAA,CAAU,CAAA;;;;;;;;;;;iBCrDrD,sBAAA,CAAA,IAAsB,GAAA,EACnB,OAAA,EAAO,IAAA,EAAQ,QAAA,EAAQ,IAAA,EAAQ,YAAA;;;;;;;cCnBrC,kBAAA;AAAA,UAKI,mBAAA;;;;;EAKf,iBAAA;AAAA;;;;UAMe,YAAA;;EAEf,OAAA;;EAEA,OAAA;;EAEA,YAAA;EJvBe;EIyBf,KAAA;AAAA;;;;;iBAqBc,gBAAA,CAAiB,MAAA,WAAiB,YAAA;;;;AJhClD;;;;;;;;ACoCA;;;;;;;;;;iBGsCgB,YAAA,CAAa,OAAA,GAAS,mBAAA,IAC5B,GAAA,EAAK,OAAA,EAAS,GAAA,EAAK,QAAA,EAAU,IAAA,EAAM,YAAA;;;UC3F5B,kBAAA;;;;;;;;;;;;;;;EAef,MAAA;;EAGA,GAAA;;EAGA,QAAA;;EAGA,MAAA;AAAA;ALtBF;;;;;;;;;;;AAcA;;;;;;;;ACoCA;;;;;;;;;;ADlDA,cKsDa,WAAA,EAAW,cAAA,CAAA,kBAAA"}
1
+ {"version":3,"file":"views-1e3jQr5C.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,CAAA;;;iBCoCA,0BAAA,6BAEJ,MAAA,SAAe,QAAA,IAAY,MAAA,2BAC3B,MAAA,oBAA0B,MAAA,gBAAA,CACpC,IAAA,EAAM,oBAAA,CAAqB,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,cAAA,IAAkB,gBAAA,CAAiB,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,cAAA;;;;UCzDjE,YAAA;;EAEf,SAAA;;;;;;EAMA,SAAA,EAAW,GAAA;;;;;;;;;;;;AFLb;;;;;;;;;EE0BE,MAAA,EAAQ,GAAA;AAAA;AFZV;AAAA,cEgBa,YAAA,EAAY,iBAAA,CAAA,YAAA;;;;;iBAMT,eAAA,CAAA,GAAmB,YAAA;;ADcnC;;;;;;;;;;;;;;;;;;;;;;;;;iBCsBgB,eAAA,kBAAA,CAAkC,GAAA,EAAK,CAAA,GAAI,SAAA,CAAU,CAAA;;;;;;;;;;;iBCrDrD,sBAAA,CAAA,IAAsB,GAAA,EACnB,OAAA,EAAO,IAAA,EAAQ,QAAA,EAAQ,IAAA,EAAQ,YAAA;;;;;;;cCnBrC,kBAAA;AAAA,UAKI,mBAAA;;;;;EAKf,iBAAA;AAAA;;;;UAMe,YAAA;;EAEf,OAAA;;EAEA,OAAA;;EAEA,YAAA;EJvBe;EIyBf,KAAA;AAAA;;;;;iBAqBc,gBAAA,CAAiB,MAAA,WAAiB,YAAA;;;;AJhClD;;;;;;;;ACoCA;;;;;;;;;;iBGsCgB,YAAA,CAAa,OAAA,GAAS,mBAAA,IAC5B,GAAA,EAAK,OAAA,EAAS,GAAA,EAAK,QAAA,EAAU,IAAA,EAAM,YAAA;;;UC3F5B,kBAAA;;;;;;;;;;;;;;;EAef,MAAA;;EAGA,GAAA;;EAGA,QAAA;;EAGA,MAAA;AAAA;ALtBF;;;;;;;;;;;AAcA;;;;;;;;ACoCA;;;;;;;;;;ADlDA,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.0",
3
+ "version": "5.5.0",
4
4
  "description": "A production-grade, decorator-driven Node.js framework built on Express 5 and TypeScript.",
5
5
  "keywords": [
6
6
  "kickjs",
@@ -141,7 +141,7 @@
141
141
  }
142
142
  },
143
143
  "devDependencies": {
144
- "@swc/core": "^1.15.30",
144
+ "@swc/core": "^1.15.33",
145
145
  "@types/cookie-parser": "^1.4.10",
146
146
  "@types/express": "^5.0.6",
147
147
  "@types/multer": "^2.1.0",