veloce-ts 0.3.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +673 -514
- package/dist/cjs/src/adapters/base.js +3 -0
- package/dist/cjs/src/adapters/base.js.map +9 -0
- package/dist/cjs/src/adapters/express.js +4 -0
- package/dist/cjs/src/adapters/express.js.map +10 -0
- package/dist/cjs/src/adapters/hono.js +3 -0
- package/dist/cjs/src/adapters/hono.js.map +10 -0
- package/dist/cjs/src/auth/index.js +18 -0
- package/dist/cjs/src/auth/index.js.map +115 -0
- package/dist/cjs/src/cli/index.js +27 -50
- package/dist/cjs/src/cli/index.js.map +4 -4
- package/dist/cjs/src/docs/index.js +3 -3
- package/dist/cjs/src/docs/index.js.map +3 -3
- package/dist/cjs/src/errors/index.js +29 -3
- package/dist/cjs/src/errors/index.js.map +75 -7
- package/dist/cjs/src/graphql/index.js +17 -17
- package/dist/cjs/src/graphql/index.js.map +6 -6
- package/dist/cjs/src/index.js +60 -54
- package/dist/cjs/src/index.js.map +33 -32
- package/dist/cjs/src/middleware/index.js +22 -22
- package/dist/cjs/src/middleware/index.js.map +5 -5
- package/dist/cjs/src/plugins/index.js +43 -44
- package/dist/cjs/src/plugins/index.js.map +10 -10
- package/dist/cjs/src/testing/index.js +34 -27
- package/dist/cjs/src/testing/index.js.map +19 -19
- package/dist/cjs/src/validation/index.js +2 -2
- package/dist/cjs/src/validation/index.js.map +5 -5
- package/dist/cjs/src/websocket/index.js +3 -3
- package/dist/cjs/src/websocket/index.js.map +3 -3
- package/dist/esm/src/adapters/base.js +4 -0
- package/dist/esm/src/adapters/base.js.map +9 -0
- package/dist/esm/src/adapters/express.js +5 -0
- package/dist/esm/src/adapters/express.js.map +10 -0
- package/dist/esm/src/adapters/hono.js +4 -0
- package/dist/esm/src/adapters/hono.js.map +10 -0
- package/dist/esm/src/auth/index.js +19 -0
- package/dist/esm/src/auth/index.js.map +115 -0
- package/dist/esm/src/cli/index.js +27 -50
- package/dist/esm/src/cli/index.js.map +4 -4
- package/dist/esm/src/docs/index.js +3 -3
- package/dist/esm/src/docs/index.js.map +3 -3
- package/dist/esm/src/errors/index.js +29 -3
- package/dist/esm/src/errors/index.js.map +75 -7
- package/dist/esm/src/graphql/index.js +18 -18
- package/dist/esm/src/graphql/index.js.map +6 -6
- package/dist/esm/src/index.js +60 -54
- package/dist/esm/src/index.js.map +33 -32
- package/dist/esm/src/middleware/index.js +23 -23
- package/dist/esm/src/middleware/index.js.map +5 -5
- package/dist/esm/src/plugins/index.js +43 -44
- package/dist/esm/src/plugins/index.js.map +10 -10
- package/dist/esm/src/testing/index.js +34 -27
- package/dist/esm/src/testing/index.js.map +19 -19
- package/dist/esm/src/validation/index.js +2 -2
- package/dist/esm/src/validation/index.js.map +5 -5
- package/dist/esm/src/websocket/index.js +2 -2
- package/dist/esm/src/websocket/index.js.map +3 -3
- package/dist/types/adapters/express.d.ts +66 -22
- package/dist/types/adapters/express.d.ts.map +1 -1
- package/dist/types/auth/auth-plugin.d.ts +1 -0
- package/dist/types/auth/auth-plugin.d.ts.map +1 -1
- package/dist/types/auth/auth-service.d.ts +6 -0
- package/dist/types/auth/auth-service.d.ts.map +1 -1
- package/dist/types/auth/jwt-provider.d.ts +1 -0
- package/dist/types/auth/jwt-provider.d.ts.map +1 -1
- package/dist/types/auth/session-plugin.d.ts +2 -0
- package/dist/types/auth/session-plugin.d.ts.map +1 -1
- package/dist/types/cli/commands/new.d.ts.map +1 -1
- package/dist/types/core/application.d.ts +1 -0
- package/dist/types/core/application.d.ts.map +1 -1
- package/dist/types/core/compiled-metadata.d.ts +28 -2
- package/dist/types/core/compiled-metadata.d.ts.map +1 -1
- package/dist/types/core/router-compiler.d.ts.map +1 -1
- package/dist/types/decorators/cache.d.ts.map +1 -1
- package/dist/types/decorators/docs.d.ts +67 -0
- package/dist/types/decorators/docs.d.ts.map +1 -1
- package/dist/types/decorators/http.d.ts +87 -1
- package/dist/types/decorators/http.d.ts.map +1 -1
- package/dist/types/decorators/middleware.d.ts.map +1 -1
- package/dist/types/dependencies/container.d.ts.map +1 -1
- package/dist/types/dependencies/drizzle.d.ts +64 -0
- package/dist/types/dependencies/drizzle.d.ts.map +1 -0
- package/dist/types/docs/openapi-generator.d.ts +12 -1
- package/dist/types/docs/openapi-generator.d.ts.map +1 -1
- package/dist/types/errors/exceptions.d.ts +45 -0
- package/dist/types/errors/exceptions.d.ts.map +1 -1
- package/dist/types/errors/handler.d.ts.map +1 -1
- package/dist/types/errors/index.d.ts +1 -1
- package/dist/types/errors/index.d.ts.map +1 -1
- package/dist/types/graphql/plugin.d.ts +5 -2
- package/dist/types/graphql/plugin.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/middleware/compression.d.ts.map +1 -1
- package/dist/types/middleware/cors.d.ts.map +1 -1
- package/dist/types/middleware/rate-limit.d.ts.map +1 -1
- package/dist/types/orm/pagination.d.ts +79 -3
- package/dist/types/orm/pagination.d.ts.map +1 -1
- package/dist/types/plugins/health.d.ts +9 -2
- package/dist/types/plugins/health.d.ts.map +1 -1
- package/dist/types/plugins/openapi.d.ts +2 -1
- package/dist/types/plugins/openapi.d.ts.map +1 -1
- package/dist/types/responses/response.d.ts.map +1 -1
- package/dist/types/testing/index.d.ts +2 -2
- package/dist/types/testing/index.d.ts.map +1 -1
- package/dist/types/testing/test-client.d.ts +122 -55
- package/dist/types/testing/test-client.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +9 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/validation/exceptions.d.ts +11 -9
- package/dist/types/validation/exceptions.d.ts.map +1 -1
- package/dist/types/validation/validator.d.ts.map +1 -1
- package/dist/types/websocket/plugin.d.ts +5 -0
- package/dist/types/websocket/plugin.d.ts.map +1 -1
- package/package.json +189 -189
package/CHANGELOG.md
CHANGED
|
@@ -1,514 +1,673 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [Unreleased]
|
|
9
|
-
|
|
10
|
-
## [0.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
####
|
|
29
|
-
- **
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
- **
|
|
37
|
-
- **
|
|
38
|
-
- **
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
###
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
-
|
|
128
|
-
|
|
129
|
-
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
-
|
|
169
|
-
|
|
170
|
-
###
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
###
|
|
185
|
-
|
|
186
|
-
####
|
|
187
|
-
|
|
188
|
-
-
|
|
189
|
-
-
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
-
|
|
204
|
-
-
|
|
205
|
-
-
|
|
206
|
-
-
|
|
207
|
-
-
|
|
208
|
-
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
- **
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
No
|
|
225
|
-
-
|
|
226
|
-
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
####
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
-
|
|
269
|
-
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
-
|
|
285
|
-
- **
|
|
286
|
-
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
###
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
- **
|
|
304
|
-
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
-
|
|
308
|
-
-
|
|
309
|
-
|
|
310
|
-
-
|
|
311
|
-
-
|
|
312
|
-
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
-
|
|
333
|
-
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
- **
|
|
339
|
-
- **
|
|
340
|
-
- **
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
-
|
|
347
|
-
-
|
|
348
|
-
-
|
|
349
|
-
-
|
|
350
|
-
-
|
|
351
|
-
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
-
|
|
359
|
-
-
|
|
360
|
-
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
-
|
|
364
|
-
-
|
|
365
|
-
-
|
|
366
|
-
-
|
|
367
|
-
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
- **
|
|
373
|
-
- **
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
-
|
|
384
|
-
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
- **
|
|
427
|
-
- **
|
|
428
|
-
- **
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
- Fixed
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
-
|
|
470
|
-
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
-
|
|
479
|
-
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
-
|
|
485
|
-
-
|
|
486
|
-
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
-
|
|
497
|
-
-
|
|
498
|
-
-
|
|
499
|
-
|
|
500
|
-
[
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.4.0] - 2026-03-27
|
|
11
|
+
|
|
12
|
+
Esta versión representa la mayor actualización desde el lanzamiento inicial. Se añadieron más de 25 mejoras nuevas distribuidas en tres oleadas de trabajo (alta, media y baja prioridad), cubriendo la cadena completa desde la generación de rutas hasta la documentación OpenAPI, el testing, el ORM y la CLI.
|
|
13
|
+
|
|
14
|
+
### 🚀 Nuevos Decoradores
|
|
15
|
+
|
|
16
|
+
#### Documentación OpenAPI (shorthand)
|
|
17
|
+
Cinco decoradores de una sola línea como alternativa concisa a `@ApiDoc({...})`:
|
|
18
|
+
- **`@Summary(text)`** — descripción corta visible en la lista de Swagger UI
|
|
19
|
+
- **`@Description(text)`** — texto largo en el panel de detalle de la operación
|
|
20
|
+
- **`@Tag(name)`** — asigna un tag individual; apilable con múltiples `@Tag`
|
|
21
|
+
- **`@Tags(...names)`** — asigna varios tags en un solo decorador
|
|
22
|
+
- **`@Deprecated()`** — marca la ruta como obsoleta (tachado en Swagger UI)
|
|
23
|
+
|
|
24
|
+
#### Control de respuesta
|
|
25
|
+
- **`@HttpCode(statusCode)`** — sobreescribe el código HTTP de respuesta del handler (p.ej. `201` para creación). Usado también por el generador OpenAPI para el código de éxito documentado
|
|
26
|
+
- **`@ResponseSchema(schema, statusCode?)`** — valida y sanitiza la respuesta del handler con un esquema Zod; informa el modelo de respuesta al spec de OpenAPI
|
|
27
|
+
|
|
28
|
+
#### Middleware declarativo por ruta
|
|
29
|
+
- **`@Timeout(ms, message?)`** — aborta la petición con **408 Request Timeout** si el handler supera el límite. Inyecta automáticamente el middleware al inicio del pipeline y emite el header `X-Timeout-Ms`
|
|
30
|
+
- **`@RateLimit(options)`** — aplica rate-limiting a nivel de ruta individual usando la misma configuración de `createRateLimitMiddleware()`. Los headers estándar `X-RateLimit-*` se envían automáticamente
|
|
31
|
+
|
|
32
|
+
### 🛠️ Mejoras al Framework Core
|
|
33
|
+
|
|
34
|
+
#### OpenAPI Generator (`src/docs/openapi-generator.ts`)
|
|
35
|
+
- **Auto-tagging**: deriva tags automáticamente del primer segmento del path (`/products/:id` → tag `"Products"`) sin necesidad de anotarlos manualmente
|
|
36
|
+
- **Bearer security scheme**: añade `components.securitySchemes.bearerAuth` al spec y aplica `security: [{ bearerAuth: [] }]` en rutas protegidas de forma automática
|
|
37
|
+
- **401 automático**: rutas protegidas reciben una respuesta `401 Unauthorized` documentada sin configuración adicional
|
|
38
|
+
- **Soporte de `@HttpCode`**: usa el `statusCode` del decorador como clave del bloque de éxito en `responses`
|
|
39
|
+
- **`@ResponseSchema` en el spec**: cuando está presente, el esquema Zod se convierte al formato JSON Schema para el bloque de contenido de la respuesta
|
|
40
|
+
|
|
41
|
+
#### Sistema de Excepciones HTTP (`src/errors/exceptions.ts`)
|
|
42
|
+
Seis nuevas clases de excepción para cubrir casos de error comunes:
|
|
43
|
+
- `ConflictException` (409)
|
|
44
|
+
- `GoneException` (410)
|
|
45
|
+
- `PayloadTooLargeException` (413)
|
|
46
|
+
- `UnprocessableEntityException` (422)
|
|
47
|
+
- `TooManyRequestsException` (429)
|
|
48
|
+
- `ServiceUnavailableException` (503)
|
|
49
|
+
|
|
50
|
+
#### Logger estructurado en ErrorHandler (`src/errors/handler.ts`)
|
|
51
|
+
- Errores 5xx se registran con `getLogger().error` incluyendo path, método, status y stack
|
|
52
|
+
- Errores 4xx se registran como `warn` en entorno de desarrollo
|
|
53
|
+
- Errores genéricos no capturados también pasan por Pino
|
|
54
|
+
|
|
55
|
+
#### Arreglos de orden de decoradores
|
|
56
|
+
- **`@UseMiddleware`** (`src/decorators/middleware.ts`): ahora siempre llama a `MetadataRegistry.defineRoute` para que el middleware no se pierda independientemente del orden de ejecución de los decoradores
|
|
57
|
+
- **`@Cache` / `@CacheInvalidate`** (`src/decorators/cache.ts`): mismo patrón — los metadatos se fusionan correctamente sin importar el orden de apilamiento
|
|
58
|
+
|
|
59
|
+
#### MetadataCompiler — caché lazy con snapshots (`src/core/compiled-metadata.ts`)
|
|
60
|
+
- Compilación lazy: una ruta sólo se recompila si sus metadatos cambiaron (comparación por snapshot JSON)
|
|
61
|
+
- IDs únicos para handlers funcionales vía `WeakMap<Function, number>` — evita colisiones de caché cuando distintas instancias de app registran el mismo path con handlers diferentes (bug crítico en tests paralelos)
|
|
62
|
+
- Método `clearCache()` expuesto para limpiar el estado entre tests
|
|
63
|
+
|
|
64
|
+
### 🧪 TestClient — API fluida y helpers de autenticación (`src/testing/test-client.ts`)
|
|
65
|
+
|
|
66
|
+
Reescritura completa de `TestClient`:
|
|
67
|
+
- **`TestResponse`** — nueva clase de respuesta con propiedades `status`, `headers`, `body`, `text`, `ok` y métodos de aserción encadenables:
|
|
68
|
+
- `expectStatus(code)`, `expectOk()`, `expectCreated()`, `expectNotFound()`, etc.
|
|
69
|
+
- `expectJson(partialObject)` — comprobación parcial del body
|
|
70
|
+
- `expectField(field, value?)` — verificar un campo específico
|
|
71
|
+
- `expectHeader(name, value?)` — verificar un header de respuesta
|
|
72
|
+
- `expectArrayLength(n)` — verificar longitud de array en respuesta
|
|
73
|
+
- **`withToken(token)`** — crea una instancia inmutable del cliente con el header `Authorization: Bearer` ya configurado
|
|
74
|
+
- **`withHeaders(headers)`** — crea una instancia inmutable con headers adicionales
|
|
75
|
+
- **`loginAs(credentials, endpoint?)`** — hace login, extrae el JWT y lo inyecta en el cliente actual para las peticiones siguientes
|
|
76
|
+
- **`registerAndLogin(user, endpoints?)`** — registra y hace login en una sola llamada
|
|
77
|
+
- **`clearAuth()`** — limpia el token almacenado
|
|
78
|
+
|
|
79
|
+
### 🔌 Plugins y Middleware
|
|
80
|
+
|
|
81
|
+
#### HealthCheckers.disk (`src/plugins/health.ts`)
|
|
82
|
+
- Usa `fs.statfs` (Node 18+ / Bun) para obtener métricas reales de disco: total, libre, usado y porcentaje
|
|
83
|
+
- Degradación elegante a `"healthy"` en plataformas sin soporte
|
|
84
|
+
|
|
85
|
+
#### CLI — Plantilla Fullstack corregida (`src/cli/commands/new.ts`)
|
|
86
|
+
- La plantilla `fullstack` ahora genera `src/index.ts` con `GraphQLPlugin` y `WebSocketPlugin` correctamente importados e instanciados (antes quedaban comentados)
|
|
87
|
+
|
|
88
|
+
#### Subpath exports en el build (`build.ts`)
|
|
89
|
+
- Se añadieron `./src/auth/index.ts`, `./src/adapters/base.ts`, `./src/adapters/hono.ts`, `./src/adapters/express.ts` como entrypoints explícitos para que los imports `veloce-ts/auth` y `veloce-ts/adapters/*` funcionen correctamente
|
|
90
|
+
|
|
91
|
+
### 🗄️ Drizzle ORM — Integración DI (`src/dependencies/drizzle.ts`)
|
|
92
|
+
|
|
93
|
+
Nuevo módulo para conectar Drizzle (u otro ORM) al contenedor de inyección de dependencias:
|
|
94
|
+
```typescript
|
|
95
|
+
// Registrar la instancia de la DB
|
|
96
|
+
registerDrizzle(app, db);
|
|
97
|
+
|
|
98
|
+
// Inyectar en controladores
|
|
99
|
+
@Get('/')
|
|
100
|
+
async list(@InjectDB() db: DrizzleDB) { … }
|
|
101
|
+
```
|
|
102
|
+
- `DB_TOKEN` — símbolo por defecto para el token de inyección
|
|
103
|
+
- `registerDrizzle(app, db, token?)` — registra como singleton en el `DIContainer`
|
|
104
|
+
- `@InjectDB(token?)` — decorador de parámetro, alias de `@Depends(DB_TOKEN)`
|
|
105
|
+
|
|
106
|
+
### 📊 Paginación mejorada (`src/orm/pagination.ts`)
|
|
107
|
+
|
|
108
|
+
#### Enriquecimiento de metadatos
|
|
109
|
+
- `PaginationMeta` incluye `from` y `to` (rango 1-based, p.ej. `from: 11, to: 20`)
|
|
110
|
+
- `CursorPaginatedResult` incluye `count` (ítems reales devueltos en la página)
|
|
111
|
+
|
|
112
|
+
#### Cursor pagination más precisa
|
|
113
|
+
- `createCursorPaginatedResult(data, limit, cursorField, hadPrevCursor)` — el nuevo parámetro `hadPrevCursor` activa `hasPrev: true` correctamente cuando se navega hacia adelante con cursor
|
|
114
|
+
- `createMultiCursor(entity, fields[])` — crea cursores compuestos por múltiples campos para ordenación estable (p.ej. `{ createdAt, id }`)
|
|
115
|
+
- `decodeMultiCursor(cursor)` — decodifica un cursor multi-campo de vuelta a un objeto
|
|
116
|
+
|
|
117
|
+
#### Helpers standalone
|
|
118
|
+
- `paginate<T>(data, total, page, limit)` — construye `{ data, meta }` en una sola llamada, sin necesidad de instanciar `PaginationHelper`
|
|
119
|
+
- `parseCursorQuery(query, defaultLimit?, maxLimit?)` — extrae `cursor` y `limit` de los query params sin lanzar excepciones
|
|
120
|
+
- `PaginationHelper.parsePaginationQuery(query, defaultLimit?, maxLimit?)` — equivalente para paginación offset; aplica límite máximo y usa defaults cuando los valores son inválidos
|
|
121
|
+
|
|
122
|
+
### 🔌 Express Adapter — Compatibilidad ESM (`src/adapters/express.ts`)
|
|
123
|
+
|
|
124
|
+
Reescritura completa del adaptador:
|
|
125
|
+
- Carga Express de forma lazy y segura usando `Function('return require')()` para compatibilidad ESM sin necesitar `declare const require: any`
|
|
126
|
+
- Acepta una instancia de Express pre-creada como segundo argumento del constructor (para añadir middleware propio antes del bridge)
|
|
127
|
+
- Manejo correcto de body raw (`Buffer`) vs body parseado (JSON/urlencoded)
|
|
128
|
+
- Omite el header `transfer-encoding` al reenviar respuestas (era fuente de errores en Express)
|
|
129
|
+
- Delega errores inesperados al pipeline de error de Express mediante `next(err)` en lugar de responder con 500 directamente
|
|
130
|
+
|
|
131
|
+
### 🐛 Bug Fixes
|
|
132
|
+
|
|
133
|
+
- **`ZodError` cross-module** (`src/errors/handler.ts`, `src/validation/validator.ts`): `instanceof ZodError` fallaba cuando la app consumidora tenía una instancia de Zod diferente a la del framework (caso frecuente con `bun link`). Añadido fallback `error.name === 'ZodError'` para garantizar respuestas 422 en todos los casos
|
|
134
|
+
- **Rutas `GET` marcadas públicas retornaban 401** en `products-api`: `app.use()` aplicaba el middleware a todos los métodos; corregido usando `app.on(['POST', 'PUT', 'DELETE'], path, middleware)` para restringir sólo a métodos de escritura
|
|
135
|
+
- **Cache collision en MetadataCompiler**: handlers funcionales distintos con el mismo path en diferentes instancias de app compartían el resultado compilado incorrecto; solucionado con IDs únicos por función
|
|
136
|
+
- **`@Cache` / `@UseMiddleware` perdían metadatos**: cuando se apilaban en orden inverso al de ejecución de decoradores, los metadatos podían sobreescribirse; solucionado actualizando el registro explícitamente en cada decorador
|
|
137
|
+
|
|
138
|
+
### 📋 Mensajes de validación mejorados (`src/validation/exceptions.ts`)
|
|
139
|
+
|
|
140
|
+
La respuesta de error `422` ahora incluye información estructurada adicional:
|
|
141
|
+
- `field` en formato convencional: `items[0].price` en lugar de `items.0.price`
|
|
142
|
+
- `received` — tipo recibido (cuando Zod lo reporta)
|
|
143
|
+
- `expected` — tipo esperado (cuando aplica)
|
|
144
|
+
- `minimum` / `maximum` — límites numéricos en errores de rango
|
|
145
|
+
|
|
146
|
+
```json
|
|
147
|
+
{
|
|
148
|
+
"error": "Validation Error",
|
|
149
|
+
"statusCode": 422,
|
|
150
|
+
"details": [
|
|
151
|
+
{ "field": "email", "message": "Invalid email", "code": "invalid_string" },
|
|
152
|
+
{ "field": "age", "message": "Number must be ≥ 18", "code": "too_small", "minimum": 18 },
|
|
153
|
+
{ "field": "tags[1]", "message": "String must not be empty", "code": "too_small" }
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 💥 Breaking Changes
|
|
159
|
+
|
|
160
|
+
Ninguno — todos los cambios son retrocompatibles. Las firmas de `createCursorPaginatedResult` tienen un nuevo parámetro opcional `hadPrevCursor` (cuarto argumento, `false` por defecto).
|
|
161
|
+
|
|
162
|
+
### 📦 Dependencias
|
|
163
|
+
|
|
164
|
+
Sin cambios en dependencias de runtime. Express sigue siendo peer dependency opcional.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## [0.3.3] - 2025-10-31
|
|
169
|
+
|
|
170
|
+
### 🐛 Critical Bug Fixes
|
|
171
|
+
- **JSON Response Serialization**: Fixed critical bug where JSON responses were not being serialized correctly
|
|
172
|
+
- **CLI Version Resolution**: Confirmed CLI correctly fetches and uses latest npm version (0.3.2)
|
|
173
|
+
- **Application Compilation**: Fixed missing `await app.compile()` call in generated templates
|
|
174
|
+
|
|
175
|
+
### 🔧 CLI Improvements
|
|
176
|
+
- **Version Fetching**: CLI now correctly fetches latest version from npm registry
|
|
177
|
+
- **Template Generation**: All templates now include proper `await app.compile()` call
|
|
178
|
+
- **Error Handling**: Improved error handling in CLI operations
|
|
179
|
+
|
|
180
|
+
## [0.3.2] - 2025-10-31
|
|
181
|
+
|
|
182
|
+
## [0.3.1] - 2025-10-31
|
|
183
|
+
|
|
184
|
+
### 🛠️ CLI Improvements
|
|
185
|
+
|
|
186
|
+
#### Enhanced Project Generation
|
|
187
|
+
- **Latest Version Fetching**: CLI now automatically fetches the latest VeloceTS version from npm registry
|
|
188
|
+
- **Improved Error Handling**: Better error messages and cleanup on project creation failure
|
|
189
|
+
- **Type Safety**: Fixed TypeScript errors in CLI with proper type definitions for npm registry API
|
|
190
|
+
- **Better User Experience**: Enhanced progress messages and visual feedback during project creation
|
|
191
|
+
- **Robust Fallbacks**: Multiple fallback strategies for version detection when npm is unavailable
|
|
192
|
+
|
|
193
|
+
#### Fixed Issues
|
|
194
|
+
- **npm Registry Integration**: Fixed CLI to use correct npm registry endpoint (`/veloce-ts` instead of `/veloce-ts/latest`)
|
|
195
|
+
- **Type Definitions**: Added proper TypeScript interfaces for npm registry response structure
|
|
196
|
+
- **Version Resolution**: Improved version parsing with proper type checking and validation
|
|
197
|
+
- **Package.json Generation**: Now uses specific dependency versions instead of 'latest' for better stability
|
|
198
|
+
- **Template Compilation**: All generated templates now include mandatory `await app.compile()` call
|
|
199
|
+
|
|
200
|
+
#### Technical Improvements
|
|
201
|
+
- **NpmRegistryResponse Interface**: Added proper typing for npm registry API responses
|
|
202
|
+
- **Async Error Handling**: Better error handling in async CLI operations
|
|
203
|
+
- **Dependency Versions**: Updated to use specific versions for better reproducibility:
|
|
204
|
+
- `hono: ^4.0.0` (instead of 'latest')
|
|
205
|
+
- `reflect-metadata: ^0.2.0` (instead of 'latest')
|
|
206
|
+
- `zod: ^3.22.0` (instead of 'latest')
|
|
207
|
+
- `typescript: ^5.3.0` (instead of 'latest')
|
|
208
|
+
- **Engine Requirements**: Added Node.js and Bun version requirements to generated package.json
|
|
209
|
+
|
|
210
|
+
#### Developer Experience
|
|
211
|
+
- **Progress Indicators**: Added emoji-based progress indicators for better visual feedback
|
|
212
|
+
- **Cleanup on Failure**: Automatic cleanup of partial projects when creation fails
|
|
213
|
+
- **Validation**: Better project name validation and error messages
|
|
214
|
+
- **Documentation**: Generated projects include comprehensive setup instructions
|
|
215
|
+
|
|
216
|
+
### 🐛 Bug Fixes
|
|
217
|
+
- **CLI TypeScript Errors**: Fixed 'data is of type unknown' error in npm registry API calls
|
|
218
|
+
- **Template Generation**: Fixed missing `await app.compile()` in all CLI templates
|
|
219
|
+
- **Dependency Management**: Improved dependency version resolution and fallback handling
|
|
220
|
+
|
|
221
|
+
### 📦 Migration Guide
|
|
222
|
+
|
|
223
|
+
#### For CLI Users
|
|
224
|
+
No breaking changes. Existing projects will continue to work. New projects generated with `veloce-ts new` will:
|
|
225
|
+
- Use the latest VeloceTS version automatically
|
|
226
|
+
- Include proper `await app.compile()` calls
|
|
227
|
+
- Have more stable dependency versions
|
|
228
|
+
|
|
229
|
+
#### For Framework Users
|
|
230
|
+
No changes required. This release only improves the CLI experience.
|
|
231
|
+
|
|
232
|
+
## [0.3.0] - 2025-10-29
|
|
233
|
+
|
|
234
|
+
### 🚀 Major Features Added
|
|
235
|
+
|
|
236
|
+
#### Response Caching System
|
|
237
|
+
- **In-Memory Cache Store**: Fast LRU-based caching with automatic cleanup
|
|
238
|
+
- **Redis Cache Store**: Distributed caching support for multi-instance deployments
|
|
239
|
+
- **@Cache() Decorator**: Declarative response caching with flexible TTL configuration
|
|
240
|
+
- **@CacheInvalidate() Decorator**: Pattern-based cache invalidation for mutations
|
|
241
|
+
- **Cache Middleware**: Functional API support for route-level caching
|
|
242
|
+
- **TTL Support**: Flexible time-to-live with string format ('5m', '1h', '1d') or seconds
|
|
243
|
+
- **Pattern Invalidation**: Wildcard pattern matching for cache invalidation ('products:*')
|
|
244
|
+
- **Cache Keys**: Smart key generation with placeholder support ('product:{id}')
|
|
245
|
+
- **Cache Headers**: Automatic X-Cache headers (HIT/MISS) in responses
|
|
246
|
+
|
|
247
|
+
#### Enhanced Request Context
|
|
248
|
+
- **Automatic Request IDs**: UUID generation for every request
|
|
249
|
+
- **@RequestId() Decorator**: Inject request ID into controller methods
|
|
250
|
+
- **@AbortSignal() Decorator**: Request cancellation support for long-running operations
|
|
251
|
+
- **Request Timeouts**: Configurable timeouts per route or globally
|
|
252
|
+
- **Logging Integration**: Request ID automatically propagates through all logs
|
|
253
|
+
- **Response Headers**: X-Request-ID header in all responses
|
|
254
|
+
- **Metadata Storage**: Attach custom data to request context
|
|
255
|
+
- **Request Lifecycle**: Automatic logging of request start/end with duration
|
|
256
|
+
|
|
257
|
+
#### Logging Improvements
|
|
258
|
+
- **Request Context Integration**: Automatic request ID in all log entries
|
|
259
|
+
- **Child Loggers**: Enhanced contextual logging with inheritance
|
|
260
|
+
- **Structured Logging**: JSON-formatted logs for production
|
|
261
|
+
- **Pretty Printing**: Human-readable logs for development
|
|
262
|
+
- **Log Middleware**: Request lifecycle logging with configurable headers
|
|
263
|
+
|
|
264
|
+
### 🎯 New Decorators
|
|
265
|
+
|
|
266
|
+
- **@Cache(options)**: Cache route responses with TTL and key configuration
|
|
267
|
+
- **@CacheInvalidate(pattern)**: Invalidate cache entries matching patterns
|
|
268
|
+
- **@RequestId()**: Inject unique request ID into handler parameters
|
|
269
|
+
- **@AbortSignal()**: Inject AbortSignal for request cancellation
|
|
270
|
+
|
|
271
|
+
### 🔧 New Middleware
|
|
272
|
+
|
|
273
|
+
- **createRequestContextMiddleware()**: Initialize request context with ID, timeout, and logging
|
|
274
|
+
- **createSimpleRequestIdMiddleware()**: Minimal request ID middleware
|
|
275
|
+
- **createCacheMiddleware()**: Functional API route caching
|
|
276
|
+
- **createCacheInvalidationMiddleware()**: Functional API cache invalidation
|
|
277
|
+
|
|
278
|
+
### 📦 New Modules
|
|
279
|
+
|
|
280
|
+
- **src/cache/**: Complete caching system
|
|
281
|
+
- `types.ts`: Cache interfaces and types
|
|
282
|
+
- `memory-store.ts`: In-memory LRU cache implementation
|
|
283
|
+
- `redis-store.ts`: Redis backend for distributed caching
|
|
284
|
+
- `manager.ts`: Global cache management and utilities
|
|
285
|
+
- **src/context/**: Enhanced request context
|
|
286
|
+
- `request-context.ts`: Request tracking with UUID and AbortSignal
|
|
287
|
+
- **src/middleware/**: New middleware
|
|
288
|
+
- `request-context.ts`: Request context initialization
|
|
289
|
+
- `cache.ts`: Cache middleware for functional API
|
|
290
|
+
- **src/decorators/**: New decorators
|
|
291
|
+
- `cache.ts`: @Cache and @CacheInvalidate decorators
|
|
292
|
+
|
|
293
|
+
### 🛠️ Core Improvements
|
|
294
|
+
|
|
295
|
+
- **Router Compiler**: Integrated cache checking and invalidation in route handlers
|
|
296
|
+
- **Type System**: New parameter types for request-id and abort-signal
|
|
297
|
+
- **Export System**: All new decorators and middleware properly exported
|
|
298
|
+
- **Error Handling**: Improved error handling with request ID context
|
|
299
|
+
|
|
300
|
+
### 📚 Documentation
|
|
301
|
+
|
|
302
|
+
#### New Guides (English + Spanish)
|
|
303
|
+
- **Caching Guide**: Complete guide to response caching (15,000 words total)
|
|
304
|
+
- In-memory and Redis stores
|
|
305
|
+
- Decorators and middleware
|
|
306
|
+
- TTL configuration
|
|
307
|
+
- Cache invalidation strategies
|
|
308
|
+
- Best practices with 50+ code examples
|
|
309
|
+
- **Request Context Guide**: Request tracking and management (12,000 words total)
|
|
310
|
+
- Automatic UUID generation
|
|
311
|
+
- Request cancellation with AbortSignal
|
|
312
|
+
- Timeout configuration
|
|
313
|
+
- Logging integration
|
|
314
|
+
- 40+ code examples
|
|
315
|
+
- **Logging Guide**: Structured logging with Pino (4,000 words total)
|
|
316
|
+
- Logger configuration
|
|
317
|
+
- Child loggers
|
|
318
|
+
- Request ID integration
|
|
319
|
+
- Best practices
|
|
320
|
+
|
|
321
|
+
#### Documentation Coverage
|
|
322
|
+
- Added 31,000+ words of professional documentation
|
|
323
|
+
- 100+ new code examples
|
|
324
|
+
- Bilingual support (English and Spanish)
|
|
325
|
+
- SEO-optimized with meta descriptions
|
|
326
|
+
- Cross-referenced between guides
|
|
327
|
+
|
|
328
|
+
### 🌐 Sidebar Updates
|
|
329
|
+
|
|
330
|
+
Updated Starlight documentation sidebar with new guides:
|
|
331
|
+
- Caching
|
|
332
|
+
- Request Context
|
|
333
|
+
- Logging
|
|
334
|
+
|
|
335
|
+
### ⚡ Performance Improvements
|
|
336
|
+
|
|
337
|
+
- **Cache System**: Sub-millisecond cache hits with in-memory store
|
|
338
|
+
- **LRU Eviction**: Automatic memory management in cache store
|
|
339
|
+
- **Request Context**: Minimal overhead UUID generation
|
|
340
|
+
- **Logging**: Efficient structured logging with Pino
|
|
341
|
+
|
|
342
|
+
### 🔄 API Additions
|
|
343
|
+
|
|
344
|
+
#### Cache Manager
|
|
345
|
+
```typescript
|
|
346
|
+
- CacheManager.setDefaultStore(store)
|
|
347
|
+
- CacheManager.getDefaultStore()
|
|
348
|
+
- CacheManager.generateKey(method, path, params, query, options)
|
|
349
|
+
- CacheManager.get(key, store?)
|
|
350
|
+
- CacheManager.set(key, value, ttl?, store?)
|
|
351
|
+
- CacheManager.delete(key, store?)
|
|
352
|
+
- CacheManager.invalidate(pattern, store?)
|
|
353
|
+
- CacheManager.clear(store?)
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
#### Helper Functions
|
|
357
|
+
```typescript
|
|
358
|
+
- getCache<T>(key): Promise<T | null>
|
|
359
|
+
- setCache<T>(key, value, ttl?): Promise<void>
|
|
360
|
+
- deleteCache(key): Promise<boolean>
|
|
361
|
+
- invalidateCache(pattern): Promise<number>
|
|
362
|
+
- clearCache(): Promise<void>
|
|
363
|
+
- getRequestId(context): string | null
|
|
364
|
+
- getAbortSignal(context): AbortSignal | null
|
|
365
|
+
- setRequestMetadata(context, key, value): void
|
|
366
|
+
- getRequestMetadata(context, key): any
|
|
367
|
+
- generateRequestId(): string
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### 🐛 Bug Fixes
|
|
371
|
+
|
|
372
|
+
- **ORM Exports**: Fixed DrizzleTransactionManager import path
|
|
373
|
+
- **Middleware Exports**: Added missing createCacheInvalidationMiddleware export
|
|
374
|
+
- **Request Context**: Fixed AbortController reference in context
|
|
375
|
+
|
|
376
|
+
### 💥 Breaking Changes
|
|
377
|
+
|
|
378
|
+
None - All changes are additive and backward compatible
|
|
379
|
+
|
|
380
|
+
### 📦 Dependencies
|
|
381
|
+
|
|
382
|
+
No new runtime dependencies added. Caching works with existing dependencies:
|
|
383
|
+
- In-memory cache: No dependencies (built-in)
|
|
384
|
+
- Redis cache: Requires `redis` or `ioredis` (peer dependency)
|
|
385
|
+
|
|
386
|
+
### 🎯 Migration Guide
|
|
387
|
+
|
|
388
|
+
#### Adding Cache to Existing Routes
|
|
389
|
+
|
|
390
|
+
```typescript
|
|
391
|
+
// Before
|
|
392
|
+
@Get('/products')
|
|
393
|
+
async getProducts() {
|
|
394
|
+
return await db.products.findAll();
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// After - Add caching
|
|
398
|
+
@Get('/products')
|
|
399
|
+
@Cache({ ttl: '5m', key: 'products:list' })
|
|
400
|
+
async getProducts() {
|
|
401
|
+
return await db.products.findAll();
|
|
402
|
+
}
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
#### Adding Request Tracking
|
|
406
|
+
|
|
407
|
+
```typescript
|
|
408
|
+
// Add to app initialization
|
|
409
|
+
import { createRequestContextMiddleware } from 'veloce-ts';
|
|
410
|
+
|
|
411
|
+
app.use(createRequestContextMiddleware({
|
|
412
|
+
timeout: 30000,
|
|
413
|
+
logging: true
|
|
414
|
+
}));
|
|
415
|
+
|
|
416
|
+
// Use in controllers
|
|
417
|
+
@Get('/data')
|
|
418
|
+
async getData(@RequestId() requestId: string) {
|
|
419
|
+
logger.info({ requestId }, 'Processing request');
|
|
420
|
+
return data;
|
|
421
|
+
}
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
### 📊 Statistics
|
|
425
|
+
|
|
426
|
+
- **New Files**: 15+ new source files
|
|
427
|
+
- **Documentation**: 31,000+ words
|
|
428
|
+
- **Code Examples**: 100+ examples
|
|
429
|
+
- **Test Coverage**: All new features covered
|
|
430
|
+
- **Languages**: Full bilingual support (EN/ES)
|
|
431
|
+
|
|
432
|
+
### 🙏 Acknowledgments
|
|
433
|
+
|
|
434
|
+
This release brings powerful performance optimization features to Veloce-TS:
|
|
435
|
+
- Response caching reduces database load and improves response times
|
|
436
|
+
- Request tracking enables better debugging and monitoring
|
|
437
|
+
- Enhanced logging provides better observability in production
|
|
438
|
+
|
|
439
|
+
## [0.2.6] - 2025-10-15
|
|
440
|
+
|
|
441
|
+
### Fixed
|
|
442
|
+
- **Query Export**: Added missing `Query` export from main index to resolve import conflicts
|
|
443
|
+
- **Parameter Decorators**: HTTP `@Query` decorator now properly exported alongside GraphQL decorators
|
|
444
|
+
- **Import Resolution**: Fixed "Export named 'Query' not found" error in applications
|
|
445
|
+
|
|
446
|
+
## [0.2.5] - 2025-10-15
|
|
447
|
+
|
|
448
|
+
### Fixed
|
|
449
|
+
- **GraphQL Query Conflict**: Removed conflicting alias `Query` from GraphQL decorators
|
|
450
|
+
- **Import Resolution**: GraphQL decorators now use `GQLQuery` to avoid conflicts with HTTP `@Query` decorator
|
|
451
|
+
- **Type Safety**: Eliminated TypeScript errors caused by decorator name conflicts
|
|
452
|
+
|
|
453
|
+
### Breaking Changes
|
|
454
|
+
- GraphQL queries now use `@GQLQuery` instead of `@Query` to avoid conflicts with HTTP parameter decorator
|
|
455
|
+
|
|
456
|
+
## [0.2.4] - 2025-10-15
|
|
457
|
+
|
|
458
|
+
### Fixed
|
|
459
|
+
- **Query Decorator**: Fixed `@Query` decorator to properly handle parameters without schemas
|
|
460
|
+
- **Query Parameter Extraction**: Improved query parameter handling in router compiler
|
|
461
|
+
- **Validation**: Added proper validation for query parameters with optional Zod schemas
|
|
462
|
+
- **Error Handling**: Fixed missing `ValidationError` import, now using `BadRequestException`
|
|
463
|
+
|
|
464
|
+
### Improved
|
|
465
|
+
- **Query Decorator Flexibility**: `@Query` now supports multiple usage patterns:
|
|
466
|
+
- `@Query()` - Extract all query parameters
|
|
467
|
+
- `@Query('param')` - Extract specific parameter
|
|
468
|
+
- `@Query(Schema)` - Validate with Zod schema
|
|
469
|
+
- **Router Compiler**: Enhanced parameter extraction and validation logic
|
|
470
|
+
- **Type Safety**: Better TypeScript support for query parameter handling
|
|
471
|
+
|
|
472
|
+
### Breaking Changes
|
|
473
|
+
- None
|
|
474
|
+
|
|
475
|
+
## [0.2.3] - 2025-10-14
|
|
476
|
+
|
|
477
|
+
### Fixed
|
|
478
|
+
- **WebSocket Exports**: Fixed missing `WebSocket` decorator export from WebSocket module
|
|
479
|
+
- **Import Resolution**: WebSocket decorators now properly exported from `veloce-ts/websocket`
|
|
480
|
+
|
|
481
|
+
## [0.2.2] - 2025-10-14
|
|
482
|
+
|
|
483
|
+
### Fixed
|
|
484
|
+
- **GraphQL Decorators**: Added missing `Query`, `Mutation`, and `Subscription` aliases for GraphQL decorators
|
|
485
|
+
- **Import Conflicts**: Fixed naming conflicts between params and GraphQL decorators
|
|
486
|
+
- **CLI Templates**: Fixed import errors in CLI template generation
|
|
487
|
+
- **Package Version**: CLI now uses current package version when generating new projects
|
|
488
|
+
|
|
489
|
+
### Changed
|
|
490
|
+
- **GraphQL Exports**: GraphQL decorators now available with intuitive names (`Query`, `Mutation`, `Subscription`)
|
|
491
|
+
- **Import Resolution**: Cleaner import structure to avoid naming conflicts
|
|
492
|
+
|
|
493
|
+
## [0.2.1] - 2025-10-14
|
|
494
|
+
|
|
495
|
+
### Fixed
|
|
496
|
+
- **GraphQL Exports**: Fixed missing `Arg` decorator export from GraphQL module
|
|
497
|
+
- **Import Resolution**: GraphQL decorators now properly exported from `veloce-ts/graphql`
|
|
498
|
+
- **Type Definitions**: GraphQL decorators included in TypeScript declarations
|
|
499
|
+
|
|
500
|
+
## [0.2.0] - 2025-10-14
|
|
501
|
+
|
|
502
|
+
### 🚀 Major Features Added
|
|
503
|
+
- **Complete Authentication System**: JWT-based authentication with access/refresh tokens
|
|
504
|
+
- **Role-Based Access Control (RBAC)**: Hierarchical roles with granular permissions system
|
|
505
|
+
- **SQLite Integration**: Built-in SQLite support with Bun's native database
|
|
506
|
+
- **Real-time WebSocket Support**: Enhanced WebSocket handling with decorators
|
|
507
|
+
- **GraphQL Integration**: Complete GraphQL support with resolvers and subscriptions
|
|
508
|
+
- **Advanced Middleware System**: Custom middleware with request/response interceptors
|
|
509
|
+
- **Admin Panel Features**: Comprehensive admin endpoints for user and system management
|
|
510
|
+
|
|
511
|
+
### 🎯 New Decorators & Features
|
|
512
|
+
- **@Auth**: JWT authentication decorator with automatic user injection
|
|
513
|
+
- **@CurrentUser**: Inject current authenticated user into handlers
|
|
514
|
+
- **@MinimumRole**: Role-based endpoint protection
|
|
515
|
+
- **@Permissions**: Granular permission-based access control
|
|
516
|
+
- **@WebSocket**: Enhanced WebSocket decorators with connection management
|
|
517
|
+
- **@Resolver**: GraphQL resolver decorators for queries and mutations
|
|
518
|
+
- **@OnConnect/@OnMessage/@OnDisconnect**: WebSocket lifecycle decorators
|
|
519
|
+
|
|
520
|
+
### 🔧 Core Framework Improvements
|
|
521
|
+
- **Router Compiler Fixes**: Fixed critical bugs with sparse array handling in metadata
|
|
522
|
+
- **Dependency Injection**: Enhanced DI system with better error handling
|
|
523
|
+
- **Parameter Resolution**: Improved parameter and dependency resolution
|
|
524
|
+
- **Type Safety**: Enhanced TypeScript inference and type checking
|
|
525
|
+
- **Error Handling**: Better error messages and debugging capabilities
|
|
526
|
+
|
|
527
|
+
### 📚 Documentation & Examples
|
|
528
|
+
- **Veloce TaskMaster**: Complete real-world example with authentication, RBAC, and frontend
|
|
529
|
+
- **Comprehensive Examples**: Task management system showcasing all framework features
|
|
530
|
+
- **Migration Guides**: Documentation for migrating from Express.js and other frameworks
|
|
531
|
+
- **API Documentation**: Enhanced OpenAPI/Swagger documentation generation
|
|
532
|
+
|
|
533
|
+
### 🛠️ Technical Improvements
|
|
534
|
+
- **Performance**: Optimized router compilation and metadata handling
|
|
535
|
+
- **Memory Management**: Better handling of metadata arrays and object references
|
|
536
|
+
- **Bundle Size**: Reduced framework bundle size through optimizations
|
|
537
|
+
- **Build System**: Improved TypeScript compilation and type generation
|
|
538
|
+
- **Testing**: Enhanced testing utilities and error reporting
|
|
539
|
+
|
|
540
|
+
### 🔒 Security Enhancements
|
|
541
|
+
- **JWT Security**: Secure token generation and validation
|
|
542
|
+
- **Password Hashing**: Built-in password hashing utilities
|
|
543
|
+
- **CSRF Protection**: Enhanced CORS and security middleware
|
|
544
|
+
- **Input Validation**: Improved Zod schema validation
|
|
545
|
+
- **Role Hierarchy**: Configurable role hierarchy with permission inheritance
|
|
546
|
+
|
|
547
|
+
### 🎨 Developer Experience
|
|
548
|
+
- **Better Error Messages**: More descriptive error messages with stack traces
|
|
549
|
+
- **Hot Reload**: Improved development server with better file watching
|
|
550
|
+
- **TypeScript Support**: Enhanced type inference and IntelliSense
|
|
551
|
+
- **Debugging**: Better debugging capabilities with request tracing
|
|
552
|
+
- **CLI Improvements**: Enhanced CLI with better project scaffolding
|
|
553
|
+
|
|
554
|
+
### 🐛 Critical Bug Fixes
|
|
555
|
+
- **Router Compilation**: Fixed sparse array handling in parameter metadata
|
|
556
|
+
- **Dependency Resolution**: Fixed undefined dependency handling
|
|
557
|
+
- **Array Length Errors**: Fixed array creation with invalid indices
|
|
558
|
+
- **Import Path Issues**: Corrected all import paths in generated projects
|
|
559
|
+
- **Metadata Processing**: Fixed metadata compilation edge cases
|
|
560
|
+
|
|
561
|
+
### 📦 New Dependencies
|
|
562
|
+
- **jsonwebtoken**: JWT token generation and validation
|
|
563
|
+
- **reflect-metadata**: Enhanced reflection capabilities for decorators
|
|
564
|
+
- **zod-to-json-schema**: Improved OpenAPI schema generation
|
|
565
|
+
|
|
566
|
+
## [0.1.7] - 2025-10-12
|
|
567
|
+
|
|
568
|
+
### Fixed
|
|
569
|
+
- Fixed syntax error in CLI new command that prevented build from completing
|
|
570
|
+
- Fixed README generation in CLI templates
|
|
571
|
+
|
|
572
|
+
## [0.1.6] - 2025-10-12
|
|
573
|
+
|
|
574
|
+
### Added
|
|
575
|
+
- **Landing Page**: Created modern Astro-based website with interactive terminal and file explorer
|
|
576
|
+
- **Interactive Terminal**: Built terminal component for API testing with command history
|
|
577
|
+
- **File Explorer**: Developed code browser with hierarchical navigation for demo app
|
|
578
|
+
- **Documentation Files**: CLI now generates README.md and API_DOCUMENTATION.md in new projects
|
|
579
|
+
|
|
580
|
+
### Changed
|
|
581
|
+
- **Complete Rebranding**: Renamed framework from FastAPI-TS to Veloce-TS throughout codebase
|
|
582
|
+
- **OpenAPIPlugin**: Now serves Swagger UI directly from code (no need for static HTML files)
|
|
583
|
+
- **Improved Swagger UI**: Updated to version 5.9.0 with better styling and functionality
|
|
584
|
+
- **Simplified Templates**: `veloce-ts new` command no longer generates unnecessary public files
|
|
585
|
+
- **Better Defaults**: OpenAPI documentation now uses "Veloce-TS" branding by default
|
|
586
|
+
- **Updated URLs**: All references now point to correct GitHub repository and documentation
|
|
587
|
+
|
|
588
|
+
### Fixed
|
|
589
|
+
- Fixed Swagger UI rendering issues with proper script loading
|
|
590
|
+
- Fixed OpenAPI plugin to correctly serve HTML responses and return proper content types
|
|
591
|
+
- Fixed broken links and outdated branding throughout codebase
|
|
592
|
+
- Improved CORS handling in generated templates
|
|
593
|
+
- Fixed CLI template generation to include proper documentation structure
|
|
594
|
+
|
|
595
|
+
## [0.1.5] - 2025-10-12
|
|
596
|
+
|
|
597
|
+
### Fixed
|
|
598
|
+
- Fixed CLI templates to include OpenAPIPlugin automatically when docs: true
|
|
599
|
+
- REST and Fullstack templates now properly initialize OpenAPI documentation
|
|
600
|
+
|
|
601
|
+
## [0.1.4] - 2025-10-13
|
|
602
|
+
|
|
603
|
+
### Fixed
|
|
604
|
+
- Fixed CLI templates to call `await app.compile()` before `app.listen()`
|
|
605
|
+
- This fixes the 404 error on all routes in generated projects
|
|
606
|
+
|
|
607
|
+
## [0.1.3] - 2025-10-12
|
|
608
|
+
|
|
609
|
+
### Fixed
|
|
610
|
+
- Fixed package.json main and exports paths to point to correct dist/*/src/ directories
|
|
611
|
+
- This fixes the "Cannot find package" error when importing veloce-ts
|
|
612
|
+
|
|
613
|
+
## [0.1.2] - 2025-10-12
|
|
614
|
+
|
|
615
|
+
### Fixed
|
|
616
|
+
- Fixed CLI templates to use correct package name `veloce-ts` instead of `VeloceTS`
|
|
617
|
+
- Fixed all import statements in generated projects
|
|
618
|
+
|
|
619
|
+
## [0.1.1] - 2025-10-12
|
|
620
|
+
|
|
621
|
+
### Fixed
|
|
622
|
+
- Fixed CLI binary path to use compiled dist files instead of source files
|
|
623
|
+
|
|
624
|
+
## [0.1.0] - 2025-10-12
|
|
625
|
+
|
|
626
|
+
### Added
|
|
627
|
+
- Initial release of veloce-ts framework
|
|
628
|
+
- Decorator-based routing with @Controller, @Get, @Post, @Put, @Delete, @Patch
|
|
629
|
+
- Functional API for decorator-free routing
|
|
630
|
+
- Automatic request validation with Zod schemas
|
|
631
|
+
- Dependency injection system with singleton, request, and transient scopes
|
|
632
|
+
- Automatic OpenAPI documentation generation
|
|
633
|
+
- Response handling with JSONResponse, HTMLResponse, FileResponse, StreamResponse, RedirectResponse
|
|
634
|
+
- Plugin system for extensibility
|
|
635
|
+
- WebSocket support with decorators
|
|
636
|
+
- GraphQL support with decorators
|
|
637
|
+
- CLI tool for project scaffolding and development
|
|
638
|
+
- Middleware system with CORS, rate limiting, and compression
|
|
639
|
+
- Error handling with custom exceptions
|
|
640
|
+
- Testing utilities with TestClient
|
|
641
|
+
- Multi-runtime support (Bun, Node.js, Deno, Cloudflare Workers)
|
|
642
|
+
- Adapter system for Express and Hono
|
|
643
|
+
- Type safety with full TypeScript support
|
|
644
|
+
- Performance optimizations with metadata compilation and schema caching
|
|
645
|
+
|
|
646
|
+
## [0.1.0] - 2025-10-12
|
|
647
|
+
|
|
648
|
+
### Added
|
|
649
|
+
- Initial development version
|
|
650
|
+
- Core framework architecture
|
|
651
|
+
- Basic routing and validation
|
|
652
|
+
- Documentation generation
|
|
653
|
+
- Plugin system
|
|
654
|
+
- WebSocket and GraphQL support
|
|
655
|
+
- CLI tooling
|
|
656
|
+
- Testing utilities
|
|
657
|
+
|
|
658
|
+
[Unreleased]: https://github.com/AlfredoMejia3001/veloce-ts/compare/v0.4.0...HEAD
|
|
659
|
+
[0.4.0]: https://github.com/AlfredoMejia3001/veloce-ts/compare/v0.3.3...v0.4.0
|
|
660
|
+
[0.3.3]: https://github.com/AlfredoMejia3001/veloce-ts/releases/tag/v0.3.3
|
|
661
|
+
[0.3.2]: https://github.com/AlfredoMejia3001/veloce-ts/releases/tag/v0.3.2
|
|
662
|
+
[0.3.1]: https://github.com/AlfredoMejia3001/veloce-ts/compare/v0.3.0...v0.3.1
|
|
663
|
+
[0.2.2]: https://github.com/AlfredoMejia3001/veloce-ts/compare/v0.2.1...v0.2.2
|
|
664
|
+
[0.2.1]: https://github.com/AlfredoMejia3001/veloce-ts/compare/v0.2.0...v0.2.1
|
|
665
|
+
[0.2.0]: https://github.com/AlfredoMejia3001/veloce-ts/compare/v0.1.7...v0.2.0
|
|
666
|
+
[0.1.7]: https://github.com/AlfredoMejia3001/veloce-ts/compare/v0.1.6...v0.1.7
|
|
667
|
+
[0.1.6]: https://github.com/AlfredoMejia3001/veloce-ts/compare/v0.1.5...v0.1.6
|
|
668
|
+
[0.1.5]: https://github.com/AlfredoMejia3001/veloce-ts/compare/v0.1.4...v0.1.5
|
|
669
|
+
[0.1.4]: https://github.com/AlfredoMejia3001/veloce-ts/compare/v0.1.3...v0.1.4
|
|
670
|
+
[0.1.3]: https://github.com/AlfredoMejia3001/veloce-ts/compare/v0.1.2...v0.1.3
|
|
671
|
+
[0.1.2]: https://github.com/AlfredoMejia3001/veloce-ts/compare/v0.1.1...v0.1.2
|
|
672
|
+
[0.1.1]: https://github.com/AlfredoMejia3001/veloce-ts/compare/v0.1.0...v0.1.1
|
|
673
|
+
[0.1.0]: https://github.com/AlfredoMejia3001/veloce-ts/releases/tag/v0.1.0
|