@forinda/kickjs 2.0.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/README.md +63 -20
  2. package/dist/adapter-wuoBNkNs.d.mts +122 -0
  3. package/dist/adapter-wuoBNkNs.d.mts.map +1 -0
  4. package/dist/app-module-DOBmxARW.d.mts +40 -0
  5. package/dist/app-module-DOBmxARW.d.mts.map +1 -0
  6. package/dist/application-C5Q720a2.mjs +449 -0
  7. package/dist/application-C5Q720a2.mjs.map +1 -0
  8. package/dist/bootstrap-dEN6SjBl.mjs +205 -0
  9. package/dist/bootstrap-dEN6SjBl.mjs.map +1 -0
  10. package/dist/{core/cache.d.ts → cache-PufEhr0n.d.mts} +33 -31
  11. package/dist/cache-PufEhr0n.d.mts.map +1 -0
  12. package/dist/chunk-C9tIbwLT.mjs +15 -0
  13. package/dist/container-B7jFEbPE.mjs +496 -0
  14. package/dist/container-B7jFEbPE.mjs.map +1 -0
  15. package/dist/container-CcgV8eHL.d.mts +253 -0
  16. package/dist/container-CcgV8eHL.d.mts.map +1 -0
  17. package/dist/core/adapter.d.mts +3 -0
  18. package/dist/core/adapter.mjs +11 -0
  19. package/dist/core/app-module.d.mts +3 -0
  20. package/dist/core/app-module.mjs +11 -0
  21. package/dist/core/cache.d.mts +3 -0
  22. package/dist/core/cache.mjs +113 -0
  23. package/dist/core/cache.mjs.map +1 -0
  24. package/dist/core/container.d.mts +3 -0
  25. package/dist/core/container.mjs +12 -0
  26. package/dist/core/cron.d.mts +3 -0
  27. package/dist/core/cron.mjs +42 -0
  28. package/dist/core/cron.mjs.map +1 -0
  29. package/dist/core/decorators.d.mts +3 -0
  30. package/dist/core/decorators.mjs +219 -0
  31. package/dist/core/decorators.mjs.map +1 -0
  32. package/dist/core/errors.d.mts +3 -0
  33. package/dist/core/errors.mjs +97 -0
  34. package/dist/core/errors.mjs.map +1 -0
  35. package/dist/core/interfaces.d.mts +3 -0
  36. package/dist/core/interfaces.mjs +44 -0
  37. package/dist/core/interfaces.mjs.map +1 -0
  38. package/dist/core/logger.d.mts +3 -0
  39. package/dist/core/logger.mjs +217 -0
  40. package/dist/core/logger.mjs.map +1 -0
  41. package/dist/core/path.d.mts +3 -0
  42. package/dist/core/path.mjs +45 -0
  43. package/dist/core/path.mjs.map +1 -0
  44. package/dist/core/plugin.d.mts +3 -0
  45. package/dist/core/plugin.mjs +11 -0
  46. package/dist/core/reactivity.d.mts +3 -0
  47. package/dist/core/reactivity.mjs +189 -0
  48. package/dist/core/reactivity.mjs.map +1 -0
  49. package/dist/core-CMgIoRvg.mjs +121 -0
  50. package/dist/core-CMgIoRvg.mjs.map +1 -0
  51. package/dist/{core/cron.d.ts → cron-C29iHvHT.d.mts} +16 -14
  52. package/dist/cron-C29iHvHT.d.mts.map +1 -0
  53. package/dist/decorators-D3lBlmud.d.mts +204 -0
  54. package/dist/decorators-D3lBlmud.d.mts.map +1 -0
  55. package/dist/errors-BZUdxtjC.d.mts +68 -0
  56. package/dist/errors-BZUdxtjC.d.mts.map +1 -0
  57. package/dist/http/application.d.mts +220 -0
  58. package/dist/http/application.d.mts.map +1 -0
  59. package/dist/http/application.mjs +12 -0
  60. package/dist/http/bootstrap.d.mts +43 -0
  61. package/dist/http/bootstrap.d.mts.map +1 -0
  62. package/dist/http/bootstrap.mjs +12 -0
  63. package/dist/http/context.d.mts +190 -0
  64. package/dist/http/context.d.mts.map +1 -0
  65. package/dist/http/context.mjs +225 -0
  66. package/dist/http/context.mjs.map +1 -0
  67. package/dist/http/middleware/cors.d.mts +48 -0
  68. package/dist/http/middleware/cors.d.mts.map +1 -0
  69. package/dist/http/middleware/cors.mjs +83 -0
  70. package/dist/http/middleware/cors.mjs.map +1 -0
  71. package/dist/http/middleware/csrf.d.mts +52 -0
  72. package/dist/http/middleware/csrf.d.mts.map +1 -0
  73. package/dist/http/middleware/csrf.mjs +72 -0
  74. package/dist/http/middleware/csrf.mjs.map +1 -0
  75. package/dist/http/middleware/error-handler.d.mts +11 -0
  76. package/dist/http/middleware/error-handler.d.mts.map +1 -0
  77. package/dist/http/middleware/error-handler.mjs +52 -0
  78. package/dist/http/middleware/error-handler.mjs.map +1 -0
  79. package/dist/http/middleware/helmet.d.mts +41 -0
  80. package/dist/http/middleware/helmet.d.mts.map +1 -0
  81. package/dist/http/middleware/helmet.mjs +51 -0
  82. package/dist/http/middleware/helmet.mjs.map +1 -0
  83. package/dist/http/middleware/rate-limit.d.mts +56 -0
  84. package/dist/http/middleware/rate-limit.d.mts.map +1 -0
  85. package/dist/http/middleware/rate-limit.mjs +101 -0
  86. package/dist/http/middleware/rate-limit.mjs.map +1 -0
  87. package/dist/http/middleware/request-id.d.mts +10 -0
  88. package/dist/http/middleware/request-id.d.mts.map +1 -0
  89. package/dist/http/middleware/request-id.mjs +26 -0
  90. package/dist/http/middleware/request-id.mjs.map +1 -0
  91. package/dist/http/middleware/request-logger.d.mts +32 -0
  92. package/dist/http/middleware/request-logger.d.mts.map +1 -0
  93. package/dist/http/middleware/request-logger.mjs +49 -0
  94. package/dist/http/middleware/request-logger.mjs.map +1 -0
  95. package/dist/http/middleware/session.d.mts +67 -0
  96. package/dist/http/middleware/session.d.mts.map +1 -0
  97. package/dist/http/middleware/session.mjs +152 -0
  98. package/dist/http/middleware/session.mjs.map +1 -0
  99. package/dist/http/middleware/spa.d.mts +101 -0
  100. package/dist/http/middleware/spa.d.mts.map +1 -0
  101. package/dist/http/middleware/spa.mjs +108 -0
  102. package/dist/http/middleware/spa.mjs.map +1 -0
  103. package/dist/http/middleware/{upload.d.ts → upload.d.mts} +21 -17
  104. package/dist/http/middleware/upload.d.mts.map +1 -0
  105. package/dist/http/middleware/upload.mjs +191 -0
  106. package/dist/http/middleware/upload.mjs.map +1 -0
  107. package/dist/http/middleware/validate.d.mts +18 -0
  108. package/dist/http/middleware/validate.d.mts.map +1 -0
  109. package/dist/http/middleware/validate.mjs +62 -0
  110. package/dist/http/middleware/validate.mjs.map +1 -0
  111. package/dist/http/middleware/views.d.mts +62 -0
  112. package/dist/http/middleware/views.d.mts.map +1 -0
  113. package/dist/http/middleware/views.mjs +65 -0
  114. package/dist/http/middleware/views.mjs.map +1 -0
  115. package/dist/http/query/index.d.mts +3 -0
  116. package/dist/http/query/index.mjs +12 -0
  117. package/dist/http/{router-builder.d.ts → router-builder.d.mts} +9 -5
  118. package/dist/http/router-builder.d.mts.map +1 -0
  119. package/dist/http/router-builder.mjs +67 -0
  120. package/dist/http/router-builder.mjs.map +1 -0
  121. package/dist/index-4VM4dUJf.d.mts +107 -0
  122. package/dist/index-4VM4dUJf.d.mts.map +1 -0
  123. package/dist/index-rnK23QBD.d.mts +184 -0
  124. package/dist/index-rnK23QBD.d.mts.map +1 -0
  125. package/dist/index.d.mts +133 -0
  126. package/dist/index.d.mts.map +1 -0
  127. package/dist/index.mjs +126 -0
  128. package/dist/index.mjs.map +1 -0
  129. package/dist/interfaces-D5ohYl6D.d.mts +52 -0
  130. package/dist/interfaces-D5ohYl6D.d.mts.map +1 -0
  131. package/dist/logger-BLdfUF5b.d.mts +119 -0
  132. package/dist/logger-BLdfUF5b.d.mts.map +1 -0
  133. package/dist/metadata-BqXgNTOf.mjs +76 -0
  134. package/dist/metadata-BqXgNTOf.mjs.map +1 -0
  135. package/dist/{core/path.d.ts → path-Dq5V-i-x.d.mts} +7 -3
  136. package/dist/path-Dq5V-i-x.d.mts.map +1 -0
  137. package/dist/plugin-D20muJwC.d.mts +95 -0
  138. package/dist/plugin-D20muJwC.d.mts.map +1 -0
  139. package/dist/query-vljPDFaZ.mjs +164 -0
  140. package/dist/query-vljPDFaZ.mjs.map +1 -0
  141. package/dist/{core/reactivity.d.ts → reactivity-CMAQh0gi.d.mts} +21 -20
  142. package/dist/reactivity-CMAQh0gi.d.mts.map +1 -0
  143. package/package.json +73 -43
  144. package/dist/chunk-DVVP7zzD.js +0 -7
  145. package/dist/core/adapter.d.ts +0 -109
  146. package/dist/core/adapter.d.ts.map +0 -1
  147. package/dist/core/adapter.js +0 -0
  148. package/dist/core/app-module.d.ts +0 -28
  149. package/dist/core/app-module.d.ts.map +0 -1
  150. package/dist/core/app-module.js +0 -0
  151. package/dist/core/cache.d.ts.map +0 -1
  152. package/dist/core/cache.js +0 -57
  153. package/dist/core/container.d.ts +0 -63
  154. package/dist/core/container.d.ts.map +0 -1
  155. package/dist/core/container.js +0 -117
  156. package/dist/core/cron.d.ts.map +0 -1
  157. package/dist/core/cron.js +0 -22
  158. package/dist/core/decorators.d.ts +0 -153
  159. package/dist/core/decorators.d.ts.map +0 -1
  160. package/dist/core/decorators.js +0 -141
  161. package/dist/core/errors.d.ts +0 -64
  162. package/dist/core/errors.d.ts.map +0 -1
  163. package/dist/core/errors.js +0 -67
  164. package/dist/core/index.d.ts +0 -14
  165. package/dist/core/index.d.ts.map +0 -1
  166. package/dist/core/interfaces.d.ts +0 -44
  167. package/dist/core/interfaces.d.ts.map +0 -1
  168. package/dist/core/interfaces.js +0 -25
  169. package/dist/core/logger.d.ts +0 -43
  170. package/dist/core/logger.d.ts.map +0 -1
  171. package/dist/core/logger.js +0 -54
  172. package/dist/core/path.d.ts.map +0 -1
  173. package/dist/core/path.js +0 -12
  174. package/dist/core/plugin.d.ts +0 -90
  175. package/dist/core/plugin.d.ts.map +0 -1
  176. package/dist/core/plugin.js +0 -0
  177. package/dist/core/reactivity.d.ts.map +0 -1
  178. package/dist/core/reactivity.js +0 -101
  179. package/dist/core-B6Okew3W.js +0 -7
  180. package/dist/http/application.d.ts +0 -103
  181. package/dist/http/application.d.ts.map +0 -1
  182. package/dist/http/application.js +0 -167
  183. package/dist/http/bootstrap.d.ts +0 -22
  184. package/dist/http/bootstrap.d.ts.map +0 -1
  185. package/dist/http/bootstrap.js +0 -40
  186. package/dist/http/context.d.ts +0 -129
  187. package/dist/http/context.d.ts.map +0 -1
  188. package/dist/http/context.js +0 -115
  189. package/dist/http/index.d.ts +0 -16
  190. package/dist/http/index.d.ts.map +0 -1
  191. package/dist/http/middleware/cors.d.ts +0 -43
  192. package/dist/http/middleware/cors.d.ts.map +0 -1
  193. package/dist/http/middleware/cors.js +0 -31
  194. package/dist/http/middleware/csrf.d.ts +0 -47
  195. package/dist/http/middleware/csrf.d.ts.map +0 -1
  196. package/dist/http/middleware/csrf.js +0 -25
  197. package/dist/http/middleware/error-handler.d.ts +0 -6
  198. package/dist/http/middleware/error-handler.d.ts.map +0 -1
  199. package/dist/http/middleware/error-handler.js +0 -37
  200. package/dist/http/middleware/helmet.d.ts +0 -36
  201. package/dist/http/middleware/helmet.d.ts.map +0 -1
  202. package/dist/http/middleware/helmet.js +0 -20
  203. package/dist/http/middleware/rate-limit.d.ts +0 -51
  204. package/dist/http/middleware/rate-limit.d.ts.map +0 -1
  205. package/dist/http/middleware/rate-limit.js +0 -46
  206. package/dist/http/middleware/request-id.d.ts +0 -5
  207. package/dist/http/middleware/request-id.d.ts.map +0 -1
  208. package/dist/http/middleware/request-id.js +0 -12
  209. package/dist/http/middleware/request-logger.d.ts +0 -27
  210. package/dist/http/middleware/request-logger.d.ts.map +0 -1
  211. package/dist/http/middleware/request-logger.js +0 -16
  212. package/dist/http/middleware/session.d.ts +0 -62
  213. package/dist/http/middleware/session.d.ts.map +0 -1
  214. package/dist/http/middleware/session.js +0 -76
  215. package/dist/http/middleware/spa.d.ts +0 -93
  216. package/dist/http/middleware/spa.d.ts.map +0 -1
  217. package/dist/http/middleware/spa.js +0 -52
  218. package/dist/http/middleware/upload.d.ts.map +0 -1
  219. package/dist/http/middleware/upload.js +0 -119
  220. package/dist/http/middleware/validate.d.ts +0 -13
  221. package/dist/http/middleware/validate.d.ts.map +0 -1
  222. package/dist/http/middleware/validate.js +0 -45
  223. package/dist/http/middleware/views.d.ts +0 -56
  224. package/dist/http/middleware/views.d.ts.map +0 -1
  225. package/dist/http/middleware/views.js +0 -18
  226. package/dist/http/query/index.d.ts +0 -4
  227. package/dist/http/query/index.d.ts.map +0 -1
  228. package/dist/http/query/index.js +0 -10
  229. package/dist/http/query/parse-query.d.ts +0 -44
  230. package/dist/http/query/parse-query.d.ts.map +0 -1
  231. package/dist/http/query/types.d.ts +0 -100
  232. package/dist/http/query/types.d.ts.map +0 -1
  233. package/dist/http/router-builder.d.ts.map +0 -1
  234. package/dist/http/router-builder.js +0 -37
  235. package/dist/index.d.ts +0 -25
  236. package/dist/index.d.ts.map +0 -1
  237. package/dist/index.js +0 -103
  238. package/dist/query-Bym31XRp.js +0 -88
@@ -0,0 +1,204 @@
1
+
2
+ import { l as ServiceOptions } from "./interfaces-D5ohYl6D.mjs";
3
+ //#region src/core/decorators.d.ts
4
+ /** Mark a class as injectable with lifecycle scope */
5
+ declare function Injectable(options?: ServiceOptions): ClassDecorator;
6
+ /** Mark a class as a service (semantic alias for Injectable) */
7
+ declare function Service(options?: ServiceOptions): ClassDecorator;
8
+ /** Mark a class as a generic managed component */
9
+ declare function Component(options?: ServiceOptions): ClassDecorator;
10
+ /** Mark a class as a repository */
11
+ declare function Repository(options?: ServiceOptions): ClassDecorator;
12
+ /**
13
+ * Mark a class as an HTTP controller and register it in the DI container.
14
+ *
15
+ * @param path - **Deprecated.** The path parameter is no longer used for routing.
16
+ * Route prefixes are defined by the module's `routes().path` — the single source
17
+ * of truth for where routes are mounted. This parameter will be removed in a
18
+ * future major version.
19
+ */
20
+ declare function Controller(path?: string): ClassDecorator;
21
+ /** Mark a method as a lifecycle hook called after instantiation */
22
+ declare function PostConstruct(): MethodDecorator;
23
+ /** Property injection — resolved lazily from the container */
24
+ declare function Autowired(token?: any): PropertyDecorator;
25
+ /**
26
+ * Constructor parameter injection with an explicit token.
27
+ *
28
+ * **Constructor parameters only** — does not work as a property decorator.
29
+ * For property injection with a token, use `@Autowired(token)` instead.
30
+ */
31
+ declare function Inject(token: any): ParameterDecorator;
32
+ /**
33
+ * Global ambient registry of typed environment variables, populated by
34
+ * `kick typegen` from the project's env schema (typically
35
+ * `src/env.ts`'s `export default defineEnv(...)`).
36
+ *
37
+ * Empty by default — declarations come from `.kickjs/types/env.ts`
38
+ * generated alongside the rest of the typegen output. Once populated,
39
+ * `@Value('PORT')` autocompletes the key, type-checks the default
40
+ * value, and `process.env.PORT` is also typed via the parallel
41
+ * `NodeJS.ProcessEnv` augmentation in the same generated file.
42
+ */
43
+ declare global {
44
+ interface KickEnv {}
45
+ }
46
+ /** A string key known to the typed env registry (`never` until typegen runs) */
47
+ type EnvKey = keyof KickEnv & string;
48
+ /**
49
+ * Look up the type of a typed env entry.
50
+ *
51
+ * Decorators can't propagate the property type from the key, so users
52
+ * still need to write the property's type — but `Env<K>` lets them
53
+ * derive it from `KickEnv` instead of duplicating the schema:
54
+ *
55
+ * ```ts
56
+ * @Service()
57
+ * class MyService {
58
+ * @Value('PORT')
59
+ * private port!: Env<'PORT'> // → number, narrowed from KickEnv['PORT']
60
+ * }
61
+ * ```
62
+ */
63
+ type Env<K extends EnvKey = EnvKey> = KickEnv[K];
64
+ /**
65
+ * Constraint that allows any string when the typed env registry is
66
+ * empty (no `kick typegen` has run yet, so existing code with raw
67
+ * string keys keeps working) but locks the argument down to known
68
+ * `EnvKey` literals once the registry is populated.
69
+ *
70
+ * Implementation: when `EnvKey` is `never`, the conditional resolves
71
+ * to the user's `K`, accepting anything. Once typegen has populated
72
+ * `KickEnv`, `EnvKey` becomes a real union and the conditional forces
73
+ * `K` to be assignable to it.
74
+ */
75
+ type ValueKey<K extends string> = [EnvKey] extends [never] ? K : K & EnvKey;
76
+ /**
77
+ * Inject an environment variable value. Evaluated lazily so the env
78
+ * is available at access time, not at decoration time.
79
+ *
80
+ * If no default is provided and the env var is missing, throws at access time
81
+ * to catch misconfiguration early instead of returning undefined.
82
+ *
83
+ * Uses metadata + instance getter to work correctly with `useDefineForClassFields`.
84
+ *
85
+ * Type-safety:
86
+ * - Without `kick typegen` run, any string key is accepted (back-compat).
87
+ * - After typegen, `KickEnv` is populated and unknown keys become a tsc
88
+ * error. The optional `defaultValue` is type-checked against the
89
+ * schema's inferred type for that key.
90
+ */
91
+ declare function Value<K extends string>(envKey: ValueKey<K>, defaultValue?: K extends EnvKey ? KickEnv[K] : unknown): PropertyDecorator;
92
+ interface RouteDefinition {
93
+ method: string;
94
+ path: string;
95
+ handlerName: string;
96
+ validation?: {
97
+ /** JSON Schema object for validating the request body */body?: any; /** JSON Schema object for validating query parameters */
98
+ query?: any; /** JSON Schema object for validating URL params */
99
+ params?: any; /** Schema name in OpenAPI components/schemas for the request body. Auto-generated from handler name if omitted. */
100
+ name?: string;
101
+ };
102
+ }
103
+ declare const Get: (path?: string, validation?: RouteDefinition["validation"]) => MethodDecorator;
104
+ declare const Post: (path?: string, validation?: RouteDefinition["validation"]) => MethodDecorator;
105
+ declare const Put: (path?: string, validation?: RouteDefinition["validation"]) => MethodDecorator;
106
+ declare const Delete: (path?: string, validation?: RouteDefinition["validation"]) => MethodDecorator;
107
+ declare const Patch: (path?: string, validation?: RouteDefinition["validation"]) => MethodDecorator;
108
+ interface ApiQueryParamsConfig {
109
+ /** Fields that can be used in filter queries (e.g., `?filter=status:eq:active`) */
110
+ filterable?: string[];
111
+ /** Fields that can be used in sort queries (e.g., `?sort=createdAt:desc`) */
112
+ sortable?: string[];
113
+ /** Fields that are searched with the `?q=` parameter */
114
+ searchable?: string[];
115
+ }
116
+ /**
117
+ * Column-object-based query params config (e.g., from DrizzleQueryParamsConfig).
118
+ * `Object.keys()` is used to derive field names for OpenAPI docs.
119
+ */
120
+ interface ColumnApiQueryParamsConfig {
121
+ columns: Record<string, any>;
122
+ sortable?: Record<string, any>;
123
+ searchColumns?: any[];
124
+ [key: string]: any;
125
+ }
126
+ /**
127
+ * Normalize a query params config to the string-based ApiQueryParamsConfig.
128
+ * Handles both string-based and column-object-based configs.
129
+ */
130
+ declare function normalizeApiQueryParamsConfig(config: ApiQueryParamsConfig | ColumnApiQueryParamsConfig): ApiQueryParamsConfig;
131
+ /**
132
+ * Document the query parameters accepted by a GET endpoint.
133
+ * Used by SwaggerAdapter to generate `filter`, `sort`, `page`, `limit`, and `q` params
134
+ * in the OpenAPI spec, with descriptions listing the allowed fields.
135
+ *
136
+ * Accepts both string-based configs and column-object configs (e.g., DrizzleQueryParamsConfig).
137
+ *
138
+ * @example
139
+ * ```ts
140
+ * // String-based
141
+ * @ApiQueryParams({
142
+ * filterable: ['status', 'category', 'price'],
143
+ * sortable: ['name', 'createdAt', 'price'],
144
+ * searchable: ['name', 'description'],
145
+ * })
146
+ *
147
+ * // Column-object-based (Drizzle)
148
+ * @ApiQueryParams(TASK_QUERY_CONFIG)
149
+ * ```
150
+ */
151
+ declare function ApiQueryParams(config: ApiQueryParamsConfig | ColumnApiQueryParamsConfig): MethodDecorator;
152
+ /**
153
+ * Middleware handler function.
154
+ * Generic `TCtx` defaults to `any` — import `RequestContext` from
155
+ * `@forinda/kickjs-http` for full type safety:
156
+ *
157
+ * ```ts
158
+ * import type { MiddlewareHandler } from '@forinda/kickjs-core'
159
+ * import type { RequestContext } from '@forinda/kickjs-http'
160
+ *
161
+ * const auth: MiddlewareHandler<RequestContext> = (ctx, next) => {
162
+ * ctx.body // fully typed
163
+ * next()
164
+ * }
165
+ * ```
166
+ */
167
+ type MiddlewareHandler<TCtx = any> = (ctx: TCtx, next: () => void) => void | Promise<void>;
168
+ /** Attach middleware handlers to a class or method */
169
+ declare function Middleware(...handlers: MiddlewareHandler[]): ClassDecorator & MethodDecorator;
170
+ /**
171
+ * File filter — accepts short extensions ('jpg'), full MIME types ('image/jpeg'),
172
+ * wildcards ('image/*'), or a function `(mimetype, filename) => boolean` for full control.
173
+ */
174
+ type FileTypeFilter = string[] | ((mimetype: string, filename: string) => boolean);
175
+ /**
176
+ * Shared upload options used by both the `@FileUpload` decorator and the
177
+ * `upload.single()` / `upload.array()` / `upload.none()` middleware.
178
+ */
179
+ interface BaseUploadOptions {
180
+ /** Max file size in bytes (default: 5MB) */
181
+ maxSize?: number;
182
+ /**
183
+ * Allowed file types:
184
+ * - **string[]** — short extensions ('jpg'), full MIME types ('image/jpeg'), or wildcards ('image/*')
185
+ * - **function** — `(mimetype, filename) => boolean` for full control
186
+ */
187
+ allowedTypes?: FileTypeFilter;
188
+ /** Extend the built-in extension-to-MIME map */
189
+ customMimeMap?: Record<string, string>;
190
+ }
191
+ interface FileUploadConfig extends BaseUploadOptions {
192
+ mode: 'single' | 'array' | 'none';
193
+ /** Form field name (default: 'file') */
194
+ fieldName?: string;
195
+ /** Max files for array mode (default: 10) */
196
+ maxCount?: number;
197
+ }
198
+ /** Configure file upload handling for a controller method */
199
+ declare function FileUpload(config: FileUploadConfig): MethodDecorator;
200
+ /** Add a static builder() method for fluent construction */
201
+ declare function Builder(target: any): void;
202
+ //#endregion
203
+ export { Put as C, Value as D, Service as E, normalizeApiQueryParamsConfig as O, PostConstruct as S, RouteDefinition as T, Injectable as _, Builder as a, Patch as b, Controller as c, EnvKey as d, FileTypeFilter as f, Inject as g, Get as h, BaseUploadOptions as i, Delete as l, FileUploadConfig as m, ApiQueryParamsConfig as n, ColumnApiQueryParamsConfig as o, FileUpload as p, Autowired as r, Component as s, ApiQueryParams as t, Env as u, Middleware as v, Repository as w, Post as x, MiddlewareHandler as y };
204
+ //# sourceMappingURL=decorators-D3lBlmud.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorators-D3lBlmud.d.mts","names":[],"sources":["../src/core/decorators.ts"],"mappings":";;;;iBA8EgB,UAAA,CAAW,OAAA,GAAU,cAAA,GAAiB,cAAA;AAAtD;AAAA,iBAQgB,OAAA,CAAQ,OAAA,GAAU,cAAA,GAAiB,cAAA;;iBAQnC,SAAA,CAAU,OAAA,GAAU,cAAA,GAAiB,cAAA;;iBAQrC,UAAA,CAAW,OAAA,GAAU,cAAA,GAAiB,cAAA;;;;AAhBtD;;;;;iBA+BgB,UAAA,CAAW,IAAA,YAAgB,cAAA;;iBAW3B,aAAA,CAAA,GAAiB,eAAA;;iBASjB,SAAA,CAAU,KAAA,SAAc,iBAAA;;;;;;;iBAYxB,MAAA,CAAO,KAAA,QAAa,kBAAA;;AA/CpC;;;;;;;;;AAeA;QAiDQ,MAAA;EAAA,UAEI,OAAA;AAAA;AAxCZ;AAAA,KA4CY,MAAA,SAAe,OAAA;;;;AAnC3B;;;;;AAYA;;;;;AAIC;;KAoCW,GAAA,WAAc,MAAA,GAAS,MAAA,IAAU,OAAA,CAAQ,CAAA;;;;AAjBrD;;;;;AAiBA;;;KAaK,QAAA,sBAA8B,MAAA,oBAA0B,CAAA,GAAI,CAAA,GAAI,MAAA;;;;;;;;;;;;;AAbd;;;iBA8BvC,KAAA,kBAAA,CACd,MAAA,EAAQ,QAAA,CAAS,CAAA,GACjB,YAAA,GAAe,CAAA,SAAU,MAAA,GAAS,OAAA,CAAQ,CAAA,cACzC,iBAAA;AAAA,UAQc,eAAA;EACf,MAAA;EACA,IAAA;EACA,WAAA;EACA,UAAA;IAhCY,yDAkCV,IAAA,QAlCyD;IAoCzD,KAAA,QApCiE;IAsCjE,MAAA,QAtCuE;IAwCvE,IAAA;EAAA;AAAA;AAAA,cAiBS,GAAA,GAAG,IAAA,WAZO,UAAA,GAAe,eAAA,mBAAgC,eAAA;AAAA,cAazD,IAAA,GAAI,IAAA,WAbM,UAAA,GAAe,eAAA,mBAAgC,eAAA;AAAA,cAczD,GAAA,GAAG,IAAA,WAdO,UAAA,GAAe,eAAA,mBAAgC,eAAA;AAAA,cAezD,MAAA,GAAM,IAAA,WAfI,UAAA,GAAe,eAAA,mBAAgC,eAAA;AAAA,cAgBzD,KAAA,GAAK,IAAA,WAhBK,UAAA,GAAe,eAAA,mBAAgC,eAAA;AAAA,UAoBrD,oBAAA;EA7Cd;EA+CD,UAAA;EA/CkB;EAiDlB,QAAA;EAnDQ;EAqDR,UAAA;AAAA;;;;;UAOe,0BAAA;EACf,OAAA,EAAS,MAAA;EACT,QAAA,GAAW,MAAA;EACX,aAAA;EAAA,CACC,GAAA;AAAA;;;;;iBAOa,6BAAA,CACd,MAAA,EAAQ,oBAAA,GAAuB,0BAAA,GAC9B,oBAAA;;;;;;;;AAlCH;;;;;;;;;;AACA;;;iBAkEgB,cAAA,CACd,MAAA,EAAQ,oBAAA,GAAuB,0BAAA,GAC9B,eAAA;;;;;;;AAnEH;;;;;;;;;KA2FY,iBAAA,gBAAiC,GAAA,EAAK,IAAA,EAAM,IAAA,wBAA4B,OAAA;AA1FpF;AAAA,iBA6FgB,UAAA,CAAA,GAAc,QAAA,EAAU,iBAAA,KAAsB,cAAA,GAAiB,eAAA;;;;;KAqBnE,cAAA,gBAA8B,QAAA,UAAkB,QAAA;;;;AAjH5D;UAuHiB,iBAAA;;EAEf,OAAA;EAzHgB;;;;;EA+HhB,YAAA,GAAe,cAAA;EA3HA;EA6Hf,aAAA,GAAgB,MAAA;AAAA;AAAA,UAGD,gBAAA,SAAyB,iBAAA;EACxC,IAAA;EA7HA;EA+HA,SAAA;EA7HU;EA+HV,QAAA;AAAA;;iBAIc,UAAA,CAAW,MAAA,EAAQ,gBAAA,GAAmB,eAAA;;iBAStC,OAAA,CAAQ,MAAA"}
@@ -0,0 +1,68 @@
1
+
2
+ //#region src/core/errors.d.ts
3
+ /**
4
+ * Standard HTTP status codes as a const enum.
5
+ * Use instead of raw numbers for readability and type safety.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * throw new HttpException(HttpStatus.NOT_FOUND, 'User not found')
10
+ * ctx.res.status(HttpStatus.CREATED).json(data)
11
+ * ```
12
+ */
13
+ declare const HttpStatus: {
14
+ readonly OK: 200;
15
+ readonly CREATED: 201;
16
+ readonly ACCEPTED: 202;
17
+ readonly NO_CONTENT: 204;
18
+ readonly MOVED_PERMANENTLY: 301;
19
+ readonly FOUND: 302;
20
+ readonly NOT_MODIFIED: 304;
21
+ readonly TEMPORARY_REDIRECT: 307;
22
+ readonly PERMANENT_REDIRECT: 308;
23
+ readonly BAD_REQUEST: 400;
24
+ readonly UNAUTHORIZED: 401;
25
+ readonly PAYMENT_REQUIRED: 402;
26
+ readonly FORBIDDEN: 403;
27
+ readonly NOT_FOUND: 404;
28
+ readonly METHOD_NOT_ALLOWED: 405;
29
+ readonly NOT_ACCEPTABLE: 406;
30
+ readonly CONFLICT: 409;
31
+ readonly GONE: 410;
32
+ readonly UNPROCESSABLE_ENTITY: 422;
33
+ readonly TOO_MANY_REQUESTS: 429;
34
+ readonly INTERNAL_SERVER_ERROR: 500;
35
+ readonly NOT_IMPLEMENTED: 501;
36
+ readonly BAD_GATEWAY: 502;
37
+ readonly SERVICE_UNAVAILABLE: 503;
38
+ readonly GATEWAY_TIMEOUT: 504;
39
+ };
40
+ type HttpStatusCode = (typeof HttpStatus)[keyof typeof HttpStatus];
41
+ /** Validation error detail */
42
+ interface ValidationError {
43
+ field: string;
44
+ message: string;
45
+ code?: string;
46
+ }
47
+ /**
48
+ * Typed HTTP exception with status code and optional validation details.
49
+ * Provides static factory methods for common HTTP errors.
50
+ */
51
+ declare class HttpException extends Error {
52
+ readonly status: number;
53
+ readonly details?: ValidationError[] | undefined;
54
+ constructor(status: number, message: string, details?: ValidationError[] | undefined);
55
+ /** Create from a Zod error */
56
+ static fromZodError(error: any, message?: string): HttpException;
57
+ static badRequest(message?: string): HttpException;
58
+ static unauthorized(message?: string): HttpException;
59
+ static forbidden(message?: string): HttpException;
60
+ static notFound(message?: string): HttpException;
61
+ static conflict(message?: string): HttpException;
62
+ static unprocessable(message?: string, details?: ValidationError[]): HttpException;
63
+ static tooManyRequests(message?: string): HttpException;
64
+ static internal(message?: string): HttpException;
65
+ }
66
+ //#endregion
67
+ export { ValidationError as i, HttpStatus as n, HttpStatusCode as r, HttpException as t };
68
+ //# sourceMappingURL=errors-BZUdxtjC.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors-BZUdxtjC.d.mts","names":[],"sources":["../src/core/errors.ts"],"mappings":";;;AAUA;;;;;;;;;cAAa,UAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;KAmCD,cAAA,WAAyB,UAAA,eAAyB,UAAA;;UAG7C,eAAA;EACf,KAAA;EACA,OAAA;EACA,IAAA;AAAA;;;AAOF;;cAAa,aAAA,SAAsB,KAAA;EAAA,SAEf,MAAA;EAAA,SAEA,OAAA,GAAU,eAAA;cAFV,MAAA,UAChB,OAAA,UACgB,OAAA,GAAU,eAAA;EAsBa;EAAA,OAflC,YAAA,CAAa,KAAA,OAAY,OAAA,YAAmB,aAAA;EAAA,OAe5C,UAAA,CAAW,OAAA,YAAuB,aAAA;EAAA,OAGlC,YAAA,CAAa,OAAA,YAAwB,aAAA;EAAA,OAGrC,SAAA,CAAU,OAAA,YAAqB,aAAA;EAAA,OAG/B,QAAA,CAAS,OAAA,YAAqB,aAAA;EAAA,OAG9B,QAAA,CAAS,OAAA,YAAoB,aAAA;EAAA,OAG7B,aAAA,CAAc,OAAA,WAAkC,OAAA,GAAU,eAAA,KAAiB,aAAA;EAAA,OAG3E,eAAA,CAAgB,OAAA,YAA6B,aAAA;EAAA,OAG7C,QAAA,CAAS,OAAA,YAAiC,aAAA;AAAA"}
@@ -0,0 +1,220 @@
1
+
2
+ import { t as Container } from "../container-CcgV8eHL.mjs";
3
+ import { r as AppAdapter } from "../adapter-wuoBNkNs.mjs";
4
+ import { n as AppModuleClass } from "../app-module-DOBmxARW.mjs";
5
+ import { t as KickPlugin } from "../plugin-D20muJwC.mjs";
6
+ import http from "node:http";
7
+ import { Express, RequestHandler } from "express";
8
+
9
+ //#region src/http/application.d.ts
10
+ /**
11
+ * A middleware entry in the declarative pipeline.
12
+ * Can be a bare handler or an object with path scoping.
13
+ */
14
+ type MiddlewareEntry = RequestHandler | {
15
+ path: string;
16
+ handler: RequestHandler;
17
+ };
18
+ interface ApplicationOptions {
19
+ /** Feature modules to load */
20
+ modules: AppModuleClass[];
21
+ /** Adapters that hook into the lifecycle (DB, Redis, Swagger, etc.) */
22
+ adapters?: AppAdapter[];
23
+ /** Server port (falls back to PORT env var, then 3000) */
24
+ port?: number;
25
+ /** Global API prefix (default: '/api') */
26
+ apiPrefix?: string;
27
+ /** Default API version (default: 1) — routes become /{prefix}/v{version}/{path} */
28
+ defaultVersion?: number;
29
+ /**
30
+ * Global middleware pipeline. Declared in order.
31
+ * Replaces the hardcoded middleware stack — you control exactly what runs.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * bootstrap({
36
+ * modules,
37
+ * middleware: [
38
+ * helmet(),
39
+ * cors(),
40
+ * compression(),
41
+ * morgan('dev'),
42
+ * express.json({ limit: '1mb' }),
43
+ * ],
44
+ * })
45
+ * ```
46
+ *
47
+ * If omitted, a sensible default is applied:
48
+ * requestId(), express.json({ limit: '100kb' })
49
+ */
50
+ middleware?: MiddlewareEntry[];
51
+ /** Plugins that bundle modules, adapters, middleware, and DI bindings */
52
+ plugins?: KickPlugin[];
53
+ /** Express `trust proxy` setting */
54
+ trustProxy?: boolean | number | string | ((ip: string, hopIndex: number) => boolean);
55
+ /** Maximum JSON body size (only used when middleware is not provided) */
56
+ jsonLimit?: string | number;
57
+ /**
58
+ * Log route summary on startup. Default: true in dev, false in production.
59
+ * Set to `true` to always log, `false` to always suppress.
60
+ */
61
+ logRoutesTable?: boolean;
62
+ /**
63
+ * Maximum time (ms) to wait for graceful shutdown before forcing exit.
64
+ * Default: 30000 (30 seconds). Set to 0 to disable forced exit.
65
+ */
66
+ shutdownTimeout?: number;
67
+ /**
68
+ * Enable cluster mode for multi-core utilization.
69
+ *
70
+ * When enabled, the primary process forks worker processes that share the
71
+ * same port via Node's built-in `cluster` module (OS load balancing).
72
+ *
73
+ * - `true` — use all available CPU cores
74
+ * - `{ workers: N }` — use exactly N workers
75
+ *
76
+ * Workers are auto-restarted on crash. SIGTERM/SIGINT on the primary is
77
+ * forwarded to all workers.
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * bootstrap({ modules, cluster: true })
82
+ * bootstrap({ modules, cluster: { workers: 4 } })
83
+ * ```
84
+ */
85
+ cluster?: boolean | {
86
+ workers?: number;
87
+ };
88
+ /**
89
+ * Custom 404 handler for unmatched routes. Receives the raw Express
90
+ * `(req, res, next)` args. When omitted, the built-in handler returns
91
+ * `{ message: 'Not Found' }` with status 404.
92
+ *
93
+ * @example
94
+ * ```ts
95
+ * bootstrap({
96
+ * modules,
97
+ * onNotFound: (req, res) => {
98
+ * res.status(404).json({ error: 'Route not found', path: req.originalUrl })
99
+ * },
100
+ * })
101
+ * ```
102
+ */
103
+ onNotFound?: (req: any, res: any, next: any) => void;
104
+ /**
105
+ * Custom global error handler. Receives `(err, req, res, next)` — the
106
+ * standard Express error-handling signature. When omitted, the built-in
107
+ * handler formats ZodError, HttpException, and unexpected errors.
108
+ *
109
+ * @example
110
+ * ```ts
111
+ * bootstrap({
112
+ * modules,
113
+ * onError: (err, req, res, next) => {
114
+ * logger.error(err)
115
+ * res.status(err.status ?? 500).json({ error: err.message })
116
+ * },
117
+ * })
118
+ * ```
119
+ */
120
+ onError?: (err: any, req: any, res: any, next: any) => void;
121
+ }
122
+ /**
123
+ * The main application class. Wires together Express, the DI container,
124
+ * feature modules, adapters, and the middleware pipeline.
125
+ */
126
+ declare class Application {
127
+ private readonly options;
128
+ private app;
129
+ private container;
130
+ private httpServer;
131
+ private adapters;
132
+ private plugins;
133
+ /** Number of HTTP requests currently being processed */
134
+ private _inFlightRequests;
135
+ /** Whether the application is draining (shutting down gracefully) */
136
+ private _draining;
137
+ /** Whether shutdown has already been initiated (prevents double-shutdown) */
138
+ private _shutdownInitiated;
139
+ /** Resolvers waiting for in-flight requests to reach zero */
140
+ private _drainResolvers;
141
+ constructor(options: ApplicationOptions);
142
+ /** Whether the application is currently draining in-flight requests */
143
+ get isDraining(): boolean;
144
+ /** Number of HTTP requests currently being processed */
145
+ get inFlightRequests(): number;
146
+ /** Get the DI container instance */
147
+ getContainer(): Container;
148
+ /**
149
+ * Express request handler — delegates to the internal Express app.
150
+ *
151
+ * Used by the Vite dev-server plugin to route requests through KickJS:
152
+ * ```ts
153
+ * const mod = await ssrLoadModule('virtual:kickjs/app')
154
+ * mod.app.handle(req, res, next)
155
+ * ```
156
+ *
157
+ * Also works as a standard Node.js request handler for production:
158
+ * ```ts
159
+ * http.createServer(app.handle.bind(app))
160
+ * ```
161
+ */
162
+ handle(req: http.IncomingMessage, res: http.ServerResponse, next?: (err?: any) => void): void;
163
+ /**
164
+ * Full setup pipeline:
165
+ * 1. Adapter beforeMount hooks (early routes — docs, health)
166
+ * 2. Adapter middleware (phase: beforeGlobal)
167
+ * 3. Global middleware (user-declared or defaults)
168
+ * 4. Adapter middleware (phase: afterGlobal)
169
+ * 5. Module registration + DI bootstrap
170
+ * 6. Adapter middleware (phase: beforeRoutes)
171
+ * 7. Module route mounting
172
+ * 8. Adapter middleware (phase: afterRoutes)
173
+ * 9. Error handlers (notFound + global)
174
+ * 10. Adapter beforeStart hooks
175
+ */
176
+ /** Build the adapter context object (shared across all hooks) */
177
+ private adapterCtx;
178
+ /** Call an adapter hook, awaiting async hooks and catching errors */
179
+ private callHook;
180
+ setup(): Promise<void>;
181
+ /** Register modules and DI without starting the HTTP server (used by kick tinker) */
182
+ registerOnly(): Promise<void>;
183
+ /**
184
+ * Start the HTTP server.
185
+ *
186
+ * In **dev mode** (Vite plugin active): reuses `globalThis.__kickjs_httpServer`
187
+ * created by Vite. Adapters (WsAdapter, Socket.IO, etc.) receive the real
188
+ * `http.Server` through `afterStart({ server })` — zero adapter changes needed.
189
+ *
190
+ * In **production**: creates its own `http.Server` and binds to the port.
191
+ */
192
+ start(): Promise<void>;
193
+ /** HMR rebuild: swap Express handler without restarting the server */
194
+ rebuild(): Promise<void>;
195
+ /**
196
+ * Graceful shutdown with request draining.
197
+ *
198
+ * 1. Stops accepting new connections (server.close())
199
+ * 2. Waits for in-flight requests to complete (up to shutdownTimeout)
200
+ * 3. Calls adapter.shutdown() for all registered adapters
201
+ * 4. Force-closes after timeout
202
+ *
203
+ * Safe to call multiple times — subsequent calls return the same promise.
204
+ */
205
+ shutdown(): Promise<void>;
206
+ getExpressApp(): Express;
207
+ /** Get registered adapters — used by DevToolsAdapter for peer discovery */
208
+ getAdapters(): AppAdapter[];
209
+ getHttpServer(): http.Server | null;
210
+ private collectAdapterMiddleware;
211
+ private mountMiddlewareList;
212
+ private mountMiddlewareEntry;
213
+ /** Middleware that tracks in-flight requests for graceful draining */
214
+ private requestTrackingMiddleware;
215
+ /** Mount /health/live and /health/ready endpoints at the root (no API prefix) */
216
+ private mountHealthEndpoints;
217
+ }
218
+ //#endregion
219
+ export { Application, ApplicationOptions, MiddlewareEntry };
220
+ //# sourceMappingURL=application.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"application.d.mts","names":[],"sources":["../../src/http/application.ts"],"mappings":";;;;;;;;;;;;;KA2BY,eAAA,GAAkB,cAAA;EAAmB,IAAA;EAAc,OAAA,EAAS,cAAA;AAAA;AAAA,UAEvD,kBAAA;EAFqE;EAIpF,OAAA,EAAS,cAAA;EAJsC;EAM/C,QAAA,GAAW,UAAA;EAN2D;EAQtE,IAAA;EARoF;EAUpF,SAAA;EARiC;EAUjC,cAAA;EARS;;;;;;;;;;;;;;;;;;;;;EA+BT,UAAA,GAAa,eAAA;EAkBb;EAfA,OAAA,GAAU,UAAA;EAmCY;EAhCtB,UAAA,iCAA2C,EAAA,UAAY,QAAA;EAiDzC;EA/Cd,SAAA;EA+CkC;;;;EA1ClC,cAAA;EA4DyC;;;AAO3C;EA9DE,eAAA;;;;;;;;;;;;;;;;;;;EAoBA,OAAA;IAAsB,OAAA;EAAA;EAmDd;;;;;;;;;;;;;;;EAlCR,UAAA,IAAc,GAAA,OAAU,GAAA,OAAU,IAAA;EA+FU;;;;;;;;;;;;;;;;EA7E5C,OAAA,IAAW,GAAA,OAAU,GAAA,OAAU,GAAA,OAAU,IAAA;AAAA;;;;;cAO9B,WAAA;EAAA,iBAiBkB,OAAA;EAAA,QAhBrB,GAAA;EAAA,QACA,SAAA;EAAA,QACA,UAAA;EAAA,QACA,QAAA;EAAA,QAEA,OAAA;EAuhBoB;EAAA,QAphBpB,iBAAA;;UAEA,SAAA;;UAEA,kBAAA;;UAEA,eAAA;cAEqB,OAAA,EAAS,kBAAA;;MAyBlC,UAAA,CAAA;;MAKA,gBAAA,CAAA;;EAKJ,YAAA,CAAA,GAAgB,SAAA;;;;;;;;;;;;;;;EAkBhB,MAAA,CAAO,GAAA,EAAK,IAAA,CAAK,eAAA,EAAiB,GAAA,EAAK,IAAA,CAAK,cAAA,EAAgB,IAAA,IAAQ,GAAA;;;;;;;;;;;;;;;UAsB5D,UAAA;;UAYM,QAAA;EAeR,KAAA,CAAA,GAAS,OAAA;;EAwKT,YAAA,CAAA,GAAgB,OAAA;;;;;;;;;;EAahB,KAAA,CAAA,GAAS,OAAA;;EAkET,OAAA,CAAA,GAAW,OAAA;;;;;;;;;;;EAoCX,QAAA,CAAA,GAAY,OAAA;EAgElB,aAAA,CAAA,GAAiB,OAAA;;EAKjB,WAAA,CAAA,GAAe,UAAA;EAIf,aAAA,CAAA,GAAiB,IAAA,CAAK,MAAA;EAAA,QAMd,wBAAA;EAAA,QAmBA,mBAAA;EAAA,QAUA,oBAAA;;UASA,yBAAA;;UAsBA,oBAAA;AAAA"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @forinda/kickjs v2.2.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 { t as Application } from "../application-C5Q720a2.mjs";
12
+ export { Application };
@@ -0,0 +1,43 @@
1
+
2
+ import { Application, ApplicationOptions } from "./application.mjs";
3
+
4
+ //#region src/http/bootstrap.d.ts
5
+ /**
6
+ * Bootstrap a KickJS application with zero boilerplate.
7
+ *
8
+ * ## Dev Mode (with @forinda/kickjs-vite)
9
+ *
10
+ * When the Vite plugin is active (`globalThis.__kickjs_httpServer` is set),
11
+ * `bootstrap()` sets up the Express app and adapters but does NOT start
12
+ * the HTTP server — Vite owns the port. The returned `app` object has a
13
+ * `.handle(req, res, next)` method that the Vite dev-server plugin calls
14
+ * on each request via `ssrLoadModule()`.
15
+ *
16
+ * ## Production Mode
17
+ *
18
+ * Without the Vite plugin, `bootstrap()` creates its own `http.Server`,
19
+ * binds to the port, and starts listening — same behavior as before.
20
+ *
21
+ * ## HMR
22
+ *
23
+ * On subsequent calls (module re-evaluation), `bootstrap()` rebuilds the
24
+ * Express app and swaps the request handler without restarting the server.
25
+ *
26
+ * @returns The Application instance. In Vite dev mode, the Express handler
27
+ * is accessible at `app.handle` for the dev-server plugin to use.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * // src/index.ts
32
+ * import 'reflect-metadata'
33
+ * import { bootstrap } from '@forinda/kickjs'
34
+ * import { modules } from './modules'
35
+ *
36
+ * // Export for Vite plugin (dev) — also works standalone (prod)
37
+ * export const app = await bootstrap({ modules })
38
+ * ```
39
+ */
40
+ declare function bootstrap(options: ApplicationOptions): Promise<Application>;
41
+ //#endregion
42
+ export { bootstrap };
43
+ //# sourceMappingURL=bootstrap.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.d.mts","names":[],"sources":["../../src/http/bootstrap.ts"],"mappings":";;;;;;AAoDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAsB,SAAA,CAAU,OAAA,EAAS,kBAAA,GAAqB,OAAA,CAAQ,WAAA"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @forinda/kickjs v2.2.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 { t as bootstrap } from "../bootstrap-dEN6SjBl.mjs";
12
+ export { bootstrap };