express-sweet 3.0.1 → 4.0.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 +719 -706
- package/README.md +206 -57
- package/configuration_sample/cjs/config.js +5 -4
- package/configuration_sample/cjs/upload.js +91 -0
- package/configuration_sample/esm/config.js +5 -4
- package/configuration_sample/esm/upload.js +91 -0
- package/dist/build.cjs +41 -35
- package/dist/build.mjs +41 -35
- package/package.json +6 -4
- package/types/database/Model.d.ts +2 -2
- package/types/handlebars_helpers/object.d.ts +2 -2
- package/types/index.d.ts +1 -43
- package/types/interfaces/{BasicConfig.d.ts → AppConfig.d.ts} +8 -7
- package/types/interfaces/DatabaseConfig.d.ts +1 -0
- package/types/interfaces/UploadConfig.d.ts +73 -0
- package/types/interfaces/index.d.ts +6 -2
- package/types/middlewares/corsPolicy.d.ts +28 -0
- package/types/middlewares/{Environment.d.ts → envLoader.d.ts} +13 -15
- package/types/middlewares/errorHandler.d.ts +32 -0
- package/types/middlewares/globalVars.d.ts +25 -0
- package/types/middlewares/index.d.ts +19 -11
- package/types/middlewares/localVars.d.ts +44 -0
- package/types/middlewares/passportAuth.d.ts +15 -0
- package/types/middlewares/requestParser.d.ts +27 -0
- package/types/{routing/Router.d.ts → middlewares/routeMapper.d.ts} +14 -16
- package/types/middlewares/viewEngine.d.ts +49 -0
- package/types/mount.d.ts +33 -1
- package/types/utils/Types.d.ts +17 -11
- package/types/utils/index.d.ts +7 -3
- package/types/utils/loadAppConfig.d.ts +17 -0
- package/types/utils/loadUploadConfig.d.ts +20 -0
- package/types/middlewares/Authentication.d.ts +0 -52
- package/types/middlewares/CORS.d.ts +0 -30
- package/types/middlewares/ErrorHandler.d.ts +0 -34
- package/types/middlewares/Global.d.ts +0 -27
- package/types/middlewares/Http.d.ts +0 -29
- package/types/middlewares/Local.d.ts +0 -42
- package/types/middlewares/View.d.ts +0 -49
- package/types/routing/index.d.ts +0 -37
- package/types/utils/loadBasicConfig.d.ts +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,706 +1,719 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
## [
|
|
6
|
-
|
|
7
|
-
###
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
- The
|
|
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
|
-
## [1.0.
|
|
456
|
-
|
|
457
|
-
###
|
|
458
|
-
|
|
459
|
-
-
|
|
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
|
-
## [1.0.
|
|
509
|
-
|
|
510
|
-
###
|
|
511
|
-
|
|
512
|
-
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
[1.0.
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
[1.0.
|
|
660
|
-
[1.0.
|
|
661
|
-
[1.0.
|
|
662
|
-
[1.0.
|
|
663
|
-
[1.0.
|
|
664
|
-
[1.0.
|
|
665
|
-
[1.0.
|
|
666
|
-
[1.0.
|
|
667
|
-
[1.0.
|
|
668
|
-
[1.0.
|
|
669
|
-
[1.0.
|
|
670
|
-
[1.0.
|
|
671
|
-
[1.0.
|
|
672
|
-
[1.0.
|
|
673
|
-
[1.0.
|
|
674
|
-
[1.0.
|
|
675
|
-
[1.0.
|
|
676
|
-
[1.0.
|
|
677
|
-
[1.0.
|
|
678
|
-
[1.0.
|
|
679
|
-
[1.0.
|
|
680
|
-
[1.0.
|
|
681
|
-
[1.0.
|
|
682
|
-
[1.0.
|
|
683
|
-
[1.0.
|
|
684
|
-
[1.0.
|
|
685
|
-
[1.0.
|
|
686
|
-
[1.0.
|
|
687
|
-
[1.0.
|
|
688
|
-
[1.0.
|
|
689
|
-
[1.0.
|
|
690
|
-
[1.0.
|
|
691
|
-
[1.0.
|
|
692
|
-
[1.0.
|
|
693
|
-
[1.
|
|
694
|
-
[1.
|
|
695
|
-
[
|
|
696
|
-
[
|
|
697
|
-
[
|
|
698
|
-
[
|
|
699
|
-
[
|
|
700
|
-
[
|
|
701
|
-
[
|
|
702
|
-
[
|
|
703
|
-
[
|
|
704
|
-
[
|
|
705
|
-
[
|
|
706
|
-
[
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
### Breaking Changes
|
|
8
|
+
|
|
9
|
+
**Middleware Architecture Refactoring**
|
|
10
|
+
- All middleware components have been refactored from class-based to function-based architecture
|
|
11
|
+
- Middleware naming updated to follow Express.js conventions (2-word composition pattern)
|
|
12
|
+
|
|
13
|
+
**Middleware Name Changes:**
|
|
14
|
+
| Previous (Class-based) | Current (Function-based) |
|
|
15
|
+
|------------------------|--------------------------|
|
|
16
|
+
| `CORS` | `corsPolicy` |
|
|
17
|
+
| `Environment` | `envLoader` |
|
|
18
|
+
| `ErrorHandler` | `errorHandler` |
|
|
19
|
+
| `Http` | `requestParser` |
|
|
20
|
+
| `Local` | `localVars` |
|
|
21
|
+
| `Router` | `routeMapper` |
|
|
22
|
+
| `View` | `viewEngine` |
|
|
23
|
+
| `Authentication` | `passportAuth` |
|
|
24
|
+
| `Global` | `globalVars` |
|
|
25
|
+
|
|
26
|
+
**Migration Notes:**
|
|
27
|
+
- These are internal changes and do not affect the public API
|
|
28
|
+
- The `mount()` function handles all middleware automatically
|
|
29
|
+
- No changes required in application code for standard usage
|
|
30
|
+
|
|
31
|
+
**Express 5 Migration**
|
|
32
|
+
- **Requires Node.js 18.x or higher**
|
|
33
|
+
- Upgraded from Express 4.21.2 to Express 5.2.1
|
|
34
|
+
- Note: `express-handlebars` remains at v7.1.3 to maintain Node.js 18+ compatibility (v8 requires Node.js 20+)
|
|
35
|
+
- Route patterns with regex parameters no longer support `/:param(\\d+)` syntax
|
|
36
|
+
- Use RegExp with named capture groups instead: `/^\/(?<userId>\d+)$/`
|
|
37
|
+
- See migration example in Changed section below
|
|
38
|
+
- For more details on Express 5 changes, see:
|
|
39
|
+
- [Express 5 Migration Guide](https://expressjs.com/en/guide/migrating-5.html)
|
|
40
|
+
- [Express.js Release Notes](https://expressjs.com/en/changelog/)
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
|
|
44
|
+
**File Upload Support (Multer)**
|
|
45
|
+
- Added dynamic file upload middleware using Multer
|
|
46
|
+
- New `config/upload.js` configuration file for flexible upload handling
|
|
47
|
+
- Support for single file, multiple files (array), and multiple field uploads
|
|
48
|
+
- Both memory storage and disk storage options
|
|
49
|
+
- Request-based middleware resolution for route-specific upload configurations
|
|
50
|
+
- Sample configurations added:
|
|
51
|
+
- [ESM Configuration](configuration_sample/esm/upload.js)
|
|
52
|
+
- [CJS Configuration](configuration_sample/cjs/upload.js)
|
|
53
|
+
|
|
54
|
+
### Changed
|
|
55
|
+
|
|
56
|
+
**Express 5 Compatibility Updates**
|
|
57
|
+
- Added `query parser: 'extended'` setting in HTTP middleware to maintain Express 4 behavior for nested query objects
|
|
58
|
+
- Added `multer().none()` middleware to parse `multipart/form-data` requests without files
|
|
59
|
+
|
|
60
|
+
**Route Pattern Migration Example**
|
|
61
|
+
```js
|
|
62
|
+
// Before (Express 4)
|
|
63
|
+
router.get('/:userId(\\d+)', (req, res) => {
|
|
64
|
+
const userId = req.params.userId; // Works
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// After (Express 5)
|
|
68
|
+
router.get(/^\/(?<userId>\d+)$/, (req, res) => {
|
|
69
|
+
const userId = req.params.userId; // Works with named capture group
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Fixed
|
|
74
|
+
|
|
75
|
+
- Fixed `ERR_INVALID_URL` error when invalid Host header values are provided
|
|
76
|
+
- `baseUrl` is now set to `undefined` when URL construction fails, allowing graceful error handling via `rewrite_base_url` hook or template checks
|
|
77
|
+
|
|
78
|
+
## [3.0.2] - 2025-11-28
|
|
79
|
+
|
|
80
|
+
### Changed
|
|
81
|
+
|
|
82
|
+
**CORS Middleware Enhancements**
|
|
83
|
+
- Added `Authorization` header support for Bearer token and API key authentication
|
|
84
|
+
- Added cache control headers (`Cache-Control`, `If-None-Match`, `If-Modified-Since`) for conditional requests
|
|
85
|
+
- Added `Range` header support for partial content and resumable downloads
|
|
86
|
+
- Added `X-CSRF-Token` header support for CSRF protection
|
|
87
|
+
- Added explicit handling for OPTIONS preflight requests
|
|
88
|
+
|
|
89
|
+
**Demo Improvements**
|
|
90
|
+
- Added new REST API demo showcasing CORS functionality with simple CRUD endpoints
|
|
91
|
+
|
|
92
|
+
## [3.0.1] - 2025-09-02
|
|
93
|
+
|
|
94
|
+
### Changed
|
|
95
|
+
|
|
96
|
+
- Added pool configuration examples and JSDoc documentation to sample database configuration.
|
|
97
|
+
- [ESM Configuration](configuration_sample/esm/database.js)
|
|
98
|
+
- [CJS Configuration](configuration_sample/cjs/database.js)
|
|
99
|
+
|
|
100
|
+
## [3.0.0] - 2025-08-26
|
|
101
|
+
|
|
102
|
+
This release introduces significant improvements to database layer architecture and adds configurable logging support.
|
|
103
|
+
|
|
104
|
+
### Breaking Changes
|
|
105
|
+
|
|
106
|
+
**Database Layer Refactoring**
|
|
107
|
+
- `Database` class removed → Use `DatabaseManager` singleton pattern
|
|
108
|
+
- All models now share a single database connection for improved performance
|
|
109
|
+
- Enhanced database management with connection testing and graceful shutdown
|
|
110
|
+
|
|
111
|
+
### Added
|
|
112
|
+
|
|
113
|
+
#### Database Management
|
|
114
|
+
- **`DatabaseManager.getInstance()`** - Get singleton Sequelize database instance
|
|
115
|
+
- **`DatabaseManager.isConnected()`** - Test database connectivity
|
|
116
|
+
- **`DatabaseManager.getConfig()`** - Access original database configuration
|
|
117
|
+
- **`DatabaseManager.getSequelizeOptions()`** - Access runtime Sequelize options
|
|
118
|
+
- **`DatabaseManager.close()`** - Graceful database connection shutdown
|
|
119
|
+
|
|
120
|
+
#### Logging Configuration
|
|
121
|
+
- **`config/logging.js`** - Morgan logging configuration support
|
|
122
|
+
|
|
123
|
+
Create `config/logging.js` to customize HTTP request logging:
|
|
124
|
+
```js
|
|
125
|
+
// config/logging.js
|
|
126
|
+
export default {
|
|
127
|
+
format: 'combined', // Options: 'combined', 'common', 'dev', 'short', 'tiny'
|
|
128
|
+
skip: (req, res) => {
|
|
129
|
+
// Skip logging for health check endpoints
|
|
130
|
+
return req.path === '/health';
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Default behavior**: Uses 'combined' format with no skip conditions if config file is not provided.
|
|
136
|
+
|
|
137
|
+
### Changed
|
|
138
|
+
|
|
139
|
+
- Updated `sequelize` dependency from v6.37.1 to v6.37.7
|
|
140
|
+
|
|
141
|
+
### Migration Guide
|
|
142
|
+
|
|
143
|
+
**Database Usage Migration:**
|
|
144
|
+
```js
|
|
145
|
+
// v2.x - Old way
|
|
146
|
+
import * as expx from 'express-sweet';
|
|
147
|
+
|
|
148
|
+
const config = await expx.utils.loadDatabaseConfig();
|
|
149
|
+
const db = new expx.database.Database(config.database, config.username, config.password, config);
|
|
150
|
+
|
|
151
|
+
// v3.x - New way
|
|
152
|
+
import * as expx from 'express-sweet';
|
|
153
|
+
|
|
154
|
+
const db = await expx.database.DatabaseManager.getInstance();
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## [2.0.9] - 2025-08-12
|
|
158
|
+
|
|
159
|
+
### Added
|
|
160
|
+
|
|
161
|
+
- Added `getConfig()` method to Database class to retrieve the current database configuration object containing all sequelize options.
|
|
162
|
+
|
|
163
|
+
### Changed
|
|
164
|
+
|
|
165
|
+
- Updated `multer` dependency from v1.4.5-lts.1 to v2.0.2 for improved file upload handling and security enhancements.
|
|
166
|
+
|
|
167
|
+
## [2.0.8] - 2025-07-29
|
|
168
|
+
|
|
169
|
+
### Changed
|
|
170
|
+
|
|
171
|
+
- Updated the usage example of the `isConnect` method in the `Database` class in the README reference.
|
|
172
|
+
|
|
173
|
+
## [2.0.7] - 2025-07-22
|
|
174
|
+
|
|
175
|
+
### Changed
|
|
176
|
+
|
|
177
|
+
- Updated dependencies to address vulnerabilities
|
|
178
|
+
- `express`: 4.19.2 => 4.21.2
|
|
179
|
+
- `express-session`: 1.18.0 => 1.18.2
|
|
180
|
+
- `body-parser`: 1.19.0 => 2.2.0
|
|
181
|
+
- `cookie-parser`: 1.4.4 => 1.4.7
|
|
182
|
+
- `morgan`: 1.10.0 => 1.10.1
|
|
183
|
+
- `rollup`: 4.21.2 => 4.45.1
|
|
184
|
+
|
|
185
|
+
## [2.0.6] - 2025-02-09
|
|
186
|
+
|
|
187
|
+
### Fixed
|
|
188
|
+
|
|
189
|
+
- Fixed a bug that caused logout redirection to fail when the redirect URL contained query parameters.
|
|
190
|
+
|
|
191
|
+
## [2.0.5] - 2025-02-04
|
|
192
|
+
|
|
193
|
+
### Added
|
|
194
|
+
|
|
195
|
+
- Added a Handlebars helper, available for use in views, to replace HTML tags in a string.
|
|
196
|
+
|
|
197
|
+
Example:
|
|
198
|
+
|
|
199
|
+
```html
|
|
200
|
+
{{!-- results in: lorem ipsum dolor sit amet --}}
|
|
201
|
+
{{{stripTags '<a href="https://example.com">lorem ipsum <strong>dolor</strong> <em>sit</em> amet</a>'}}}
|
|
202
|
+
|
|
203
|
+
{{!-- results in: lorem ipsum <strong>dolor</strong> sit amet --}}
|
|
204
|
+
{{{stripTags '<a href="https://example.com">lorem ipsum <strong>dolor</strong> <em>sit</em> amet</a>' '<strong>' ''}}}
|
|
205
|
+
|
|
206
|
+
{{!-- results in: 🍩lorem ipsum 🍩dolor🍩 🍩sit🍩 amet🍩 --}}
|
|
207
|
+
{{{stripTags '<a href="https://example.com">lorem ipsum <strong>dolor</strong> <em>sit</em> amet</a>' [] '🍩'}}}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## [2.0.4] - 2025-01-14
|
|
211
|
+
|
|
212
|
+
### Changed
|
|
213
|
+
|
|
214
|
+
- Refactored variable names.
|
|
215
|
+
- Fixed Docker demo.
|
|
216
|
+
- Changed the directory name for storing custom error classes in the demo from `exceptions` to `errors`.
|
|
217
|
+
- Added a section to the README.md API reference about considerations when using the `hasMany` association with the `findAll` method.
|
|
218
|
+
|
|
219
|
+
### Added
|
|
220
|
+
|
|
221
|
+
- **`findObjectInArray` Handlebars helper:** This helper is added to the view, allowing you to find an object in an array based on a specified field name and value.
|
|
222
|
+
|
|
223
|
+
Example:
|
|
224
|
+
|
|
225
|
+
```html
|
|
226
|
+
{{!--
|
|
227
|
+
items is an array of objects: [{id: 123, name: 'Item A'}, {id: 456, name: 'Item B'}]
|
|
228
|
+
This code will output: "Item A"
|
|
229
|
+
--}}
|
|
230
|
+
{{#each items}}
|
|
231
|
+
{{#if (eq id 123)}}
|
|
232
|
+
{{lookup (findObjectInArray ../items 'id' id) 'name'}}
|
|
233
|
+
{{/if}}
|
|
234
|
+
{{/each}}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## [2.0.3] - 2024-09-03
|
|
238
|
+
|
|
239
|
+
> **Note:** This version used class-based middleware with names like `CORS`, `Environment`, `ErrorHandler`, `Http`, `Local`, `Router`, `View`, and `Authentication`. In v3.x and later, these were refactored to function-based middleware with new names (`corsPolicy`, `envLoader`, `errorHandler`, `requestParser`, `localVars`, `routeMapper`, `viewEngine`, `passportAuth`). The items listed below reflect the naming and structure used in v2.0.3.
|
|
240
|
+
|
|
241
|
+
### Breaking Changes
|
|
242
|
+
|
|
243
|
+
**Template Engine Migration**
|
|
244
|
+
- Template engine changed from `express-hbs` to `express-handlebars`.
|
|
245
|
+
However, the `block` and `contentFor` helpers are still available for backward compatibility.
|
|
246
|
+
|
|
247
|
+
**Database Layer Changes**
|
|
248
|
+
- `database/Database` has been changed from a `sequelize.Sequelize` instance to a `sequelize.Sequelize` class. If you use it in the future, you need to instantiate it.
|
|
249
|
+
- DB connection check method has been changed.
|
|
250
|
+
- After:
|
|
251
|
+
```js
|
|
252
|
+
const expx = require('express-sweet');
|
|
253
|
+
|
|
254
|
+
// Create Database instance.
|
|
255
|
+
const config = await expx.utils.loadDatabaseConfig();
|
|
256
|
+
const database = new expx.database.Database(config.database, config.username, config.password, config);
|
|
257
|
+
|
|
258
|
+
// Check database connection.
|
|
259
|
+
await database.isConnect();
|
|
260
|
+
```
|
|
261
|
+
- Before:
|
|
262
|
+
```js
|
|
263
|
+
const expx = require('express-sweet');
|
|
264
|
+
|
|
265
|
+
// Check database connection.
|
|
266
|
+
await expx.database.Database.isConnect();
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**Async Function Signature Changes**
|
|
270
|
+
- All middleware mount methods, configuration loaders, authentication services, and database initialization functions now return `Promise` types instead of synchronous return types. This change enables asynchronous configuration loading and proper async/await usage throughout the framework.
|
|
271
|
+
|
|
272
|
+
### Changed
|
|
273
|
+
|
|
274
|
+
- Added `"type": "module"` to the `package.json` of the ESM app generated by `express-sweet-generator`. It is now fully ESM compliant.
|
|
275
|
+
- `require` was changed to dynamic import.
|
|
276
|
+
- Updated passport from 0.4.1 to 0.7.0
|
|
277
|
+
|
|
278
|
+
## [2.0.2] - 2024-09-01
|
|
279
|
+
|
|
280
|
+
### Changed
|
|
281
|
+
|
|
282
|
+
- Updated express from 4.18.3 to 4.19.2.
|
|
283
|
+
- Updated rollup from 2.79.1 to 4.21.2.
|
|
284
|
+
- Renamed build files (build.common.js => build.cjs, build.esm.js => build.mjs).
|
|
285
|
+
- The express package was excluded from the build file. Instead, users should install express on their own.
|
|
286
|
+
|
|
287
|
+
## [2.0.1] - 2024-04-05
|
|
288
|
+
|
|
289
|
+
### Changed
|
|
290
|
+
|
|
291
|
+
- Removed [nodejs-shared](https://www.npmjs.com/package/nodejs-shared) package dependency.
|
|
292
|
+
|
|
293
|
+
## [2.0.0] - 2024-03-24
|
|
294
|
+
|
|
295
|
+
### Breaking Changes
|
|
296
|
+
|
|
297
|
+
**AWS SDK Removal**
|
|
298
|
+
- EXPRESS SWEET version 2 no longer depends on the AWS SDK.
|
|
299
|
+
The `services.AWSRekognitionClient` and `services.AWSSesClient` have been migrated to the [AWS SDK Extension](https://www.npmjs.com/package/aws-sdk-extension) NPM package, so please install from there if needed.
|
|
300
|
+
|
|
301
|
+
## [1.1.1] - 2024-03-23
|
|
302
|
+
|
|
303
|
+
### Changed
|
|
304
|
+
|
|
305
|
+
- When cookie security is enabled and the application runs over HTTP, a warning message is now displayed during user authentication to prevent authentication issues caused by secure cookie settings incompatible with the HTTP protocol.
|
|
306
|
+
|
|
307
|
+
## [1.1.0] - 2024-03-06
|
|
308
|
+
|
|
309
|
+
### Changed
|
|
310
|
+
|
|
311
|
+
- Updated EXPRESS SWEET's dependency packages.
|
|
312
|
+
- [express](https://www.npmjs.com/package/express) from v4.18.2 to v4.18.3
|
|
313
|
+
- [multer](https://www.npmjs.com/package/multer) from v1.4.4 to v1.4.5-lts.1
|
|
314
|
+
- [express-session](https://www.npmjs.com/package/express-session) from v1.17.3 to v1.18.0
|
|
315
|
+
- [sequelize](https://www.npmjs.com/package/sequelize) from v6.32.0 to v6.37.1
|
|
316
|
+
- [mariadb](https://www.npmjs.com/package/mariadb) from v2.4.0 to v3.2.3
|
|
317
|
+
- [moment](https://www.npmjs.com/package/moment) from v2.29.4 to v2.30.1
|
|
318
|
+
|
|
319
|
+
## [1.0.44] - 2023-12-30
|
|
320
|
+
|
|
321
|
+
### Changed
|
|
322
|
+
|
|
323
|
+
- The `Secure` and `HttpOnly` attributes of session cookies can now be configured through the authentication configuration file.
|
|
324
|
+
|
|
325
|
+
## [1.0.43] - 2023-12-30
|
|
326
|
+
|
|
327
|
+
### Changed
|
|
328
|
+
|
|
329
|
+
- Session cookie name is now configurable through the authentication configuration file.
|
|
330
|
+
|
|
331
|
+
## [1.0.42] - 2023-08-31
|
|
332
|
+
|
|
333
|
+
### Changed
|
|
334
|
+
|
|
335
|
+
- Updated TypeScript version from 4.8.4 to 5.2.2.
|
|
336
|
+
- Updated redis dependency packages used for user authentication.
|
|
337
|
+
- Updated redis package version from 4.3.1 to 4.6.8.
|
|
338
|
+
[Here](https://github.com/redis/node-redis/blob/master/CHANGELOG.md) are the changes.
|
|
339
|
+
- Updated connect-redis package version from 6.1.3 to 7.1.0.
|
|
340
|
+
[Here](https://github.com/tj/connect-redis/releases) are the changes.
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
## [1.0.41] - 2023-08-04
|
|
344
|
+
|
|
345
|
+
### Changed
|
|
346
|
+
|
|
347
|
+
- Added an option to the method that searches for faces in the collection to throw an exception if a face is not found or if multiple faces are found.
|
|
348
|
+
|
|
349
|
+
## [1.0.40] - 2023-08-04
|
|
350
|
+
|
|
351
|
+
### Changed
|
|
352
|
+
|
|
353
|
+
- Fixed to return null instead of throwing an error when looking for faces in the collection using images without faces (<code>AWSRekognitionClient.searchFaces()</code>).
|
|
354
|
+
|
|
355
|
+
## [1.0.39] - 2023-07-24
|
|
356
|
+
|
|
357
|
+
### Changed
|
|
358
|
+
|
|
359
|
+
- Renamed AWS Rekognition exception classes to more descriptive names. All face-related error classes now follow a consistent naming pattern with "Face" prefix and "Failed"/"Missing"/"Multiple" suffixes for better clarity and error handling.
|
|
360
|
+
|
|
361
|
+
## [1.0.38] - 2023-07-17
|
|
362
|
+
|
|
363
|
+
### Fixed
|
|
364
|
+
|
|
365
|
+
- Fixed a bug that prevented login user data from being referenced in the view rendering hook function.
|
|
366
|
+
|
|
367
|
+
## [1.0.37] - 2023-07-17
|
|
368
|
+
|
|
369
|
+
### Changed
|
|
370
|
+
|
|
371
|
+
- The view rendering hook function now supports asynchronous functions for async operations before rendering.
|
|
372
|
+
|
|
373
|
+
### Added
|
|
374
|
+
|
|
375
|
+
- New Math-related view helpers have been added.
|
|
376
|
+
|
|
377
|
+
## [1.0.36] - 2023-07-12
|
|
378
|
+
|
|
379
|
+
### Changed
|
|
380
|
+
|
|
381
|
+
- Moved the Ajax determination option (`is_ajax`) from authentication configuration to application configuration.
|
|
382
|
+
- The error handler option has been replaced with a hookable error handling mechanism (`hook_handle_error`) for more flexible error processing.
|
|
383
|
+
|
|
384
|
+
## [1.0.35] - 2023-07-11
|
|
385
|
+
|
|
386
|
+
### Changed
|
|
387
|
+
|
|
388
|
+
- The login failure redirect URL option can now be defined as a function for dynamic redirect behavior.
|
|
389
|
+
- Authentication service's `failureRedirect` method signature changed to accept both request and response objects instead of response only.
|
|
390
|
+
|
|
391
|
+
## [1.0.34] - 2023-07-01
|
|
392
|
+
|
|
393
|
+
### Changed
|
|
394
|
+
|
|
395
|
+
- Changed the response status code from 403 to 401 when asynchronous communication requiring authentication fails to authenticate.
|
|
396
|
+
|
|
397
|
+
## [1.0.33] - 2023-07-01
|
|
398
|
+
|
|
399
|
+
### Added
|
|
400
|
+
|
|
401
|
+
- Added regular expression comparison view helper.
|
|
402
|
+
|
|
403
|
+
## [1.0.32] - 2023-07-01
|
|
404
|
+
|
|
405
|
+
### Fixed
|
|
406
|
+
|
|
407
|
+
- Fixed a bug that prevented cookies from being accessed in the view rendering hook function.
|
|
408
|
+
|
|
409
|
+
## [1.0.31] - 2023-06-29
|
|
410
|
+
|
|
411
|
+
### Changed
|
|
412
|
+
|
|
413
|
+
- Changed helper function names in the view (Handlebars) from SnakeCase to CamelCase.
|
|
414
|
+
|After|Before|Description|
|
|
415
|
+
|--|--|--|
|
|
416
|
+
|notEmpty|not_empty|Check that it is not empty.|
|
|
417
|
+
|formatDate|format_date|Use moment to format the date.|
|
|
418
|
+
|cacheBusting|cache_busting|Returns the Assets path containing the file update time parameter.|
|
|
419
|
+
|jsonStringify|json_stringify|Stringify an object using JSON.stringify.|
|
|
420
|
+
|jsonParse|json_parse|Parses the given string using JSON.parse.|
|
|
421
|
+
|formatBytes|format_bytes|Convert bytes to just the right units(KB, MB, GB, TB, PB, EB, ZB, YB).|
|
|
422
|
+
|
|
423
|
+
### Added
|
|
424
|
+
|
|
425
|
+
- Added view helper to convert numeric values to strings with language-sensitive representations.
|
|
426
|
+
|
|
427
|
+
## [1.0.30] - 2023-06-26
|
|
428
|
+
|
|
429
|
+
### Changed
|
|
430
|
+
|
|
431
|
+
- Fixed AWS Rekognition credentials passing.
|
|
432
|
+
|
|
433
|
+
## [1.0.29] - 2023-06-20
|
|
434
|
+
|
|
435
|
+
### Changed
|
|
436
|
+
|
|
437
|
+
- Changed class private variables and methods from soft private to hard private.
|
|
438
|
+
|
|
439
|
+
### Added
|
|
440
|
+
|
|
441
|
+
- Added AWS SES email sending client class.
|
|
442
|
+
|
|
443
|
+
## [1.0.28] - 2023-06-16
|
|
444
|
+
|
|
445
|
+
### Changed
|
|
446
|
+
|
|
447
|
+
- Updated AWS SDK version from 2 to 3.
|
|
448
|
+
|
|
449
|
+
## [1.0.27] - 2023-06-12
|
|
450
|
+
|
|
451
|
+
### Changed
|
|
452
|
+
|
|
453
|
+
- The view rendering hook function now receives the request object as an argument for accessing request data during rendering.
|
|
454
|
+
|
|
455
|
+
## [1.0.26] - 2023-06-11
|
|
456
|
+
|
|
457
|
+
### Changed
|
|
458
|
+
|
|
459
|
+
- Updated Sequelize from v5 to v6.
|
|
460
|
+
- Changed the framework debug log to output only when the environment variable SWEET_DEBUG is defined.
|
|
461
|
+
.env:
|
|
462
|
+
```
|
|
463
|
+
SWEET_DEBUG=true
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
## [1.0.25] - 2022-11-24
|
|
467
|
+
|
|
468
|
+
### Added
|
|
469
|
+
|
|
470
|
+
- Added formatBytes view helper to convert bytes to appropriate units.
|
|
471
|
+
|
|
472
|
+
## [1.0.24] - 2022-10-24
|
|
473
|
+
|
|
474
|
+
### Added
|
|
475
|
+
|
|
476
|
+
- Added Ajax request detection option to authentication configuration for custom XHR/fetch request handling.
|
|
477
|
+
|
|
478
|
+
## [1.0.23] - 2022-10-20
|
|
479
|
+
|
|
480
|
+
### Added
|
|
481
|
+
|
|
482
|
+
- A request body object has been added to the parameters of the callback function for user authentication.
|
|
483
|
+
|
|
484
|
+
## [1.0.22] - 2022-07-27
|
|
485
|
+
|
|
486
|
+
### Added
|
|
487
|
+
|
|
488
|
+
- You can now set hook functions that are called before the view is rendered. Hook functions can be used, for example, to set local variables that can be used in the view.
|
|
489
|
+
|
|
490
|
+
## [1.0.21] - 2022-05-26
|
|
491
|
+
|
|
492
|
+
### Added
|
|
493
|
+
|
|
494
|
+
- Added an option to the face indexing method to retrieve details (gender, emotion, age group) of indexed faces.
|
|
495
|
+
|
|
496
|
+
## [1.0.20] - 2022-05-25
|
|
497
|
+
|
|
498
|
+
### Added
|
|
499
|
+
|
|
500
|
+
- Added an option to get details (emotion, gender, age group) to the face detection method.
|
|
501
|
+
|
|
502
|
+
## [1.0.19] - 2022-05-20
|
|
503
|
+
|
|
504
|
+
### Added
|
|
505
|
+
|
|
506
|
+
- Add date format helper to view.
|
|
507
|
+
|
|
508
|
+
## [1.0.18] - 2022-05-18
|
|
509
|
+
|
|
510
|
+
### Added
|
|
511
|
+
|
|
512
|
+
- User authentication sessions can now be stored in redis. To use redis for session storage, simply add the following option to config/authentication.js. Please give it a try.
|
|
513
|
+
config/authentication.js:
|
|
514
|
+
```json
|
|
515
|
+
session_store: 'redis',
|
|
516
|
+
redis_host: 'redis://localhost:6379'
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
## [1.0.17] - 2022-05-17
|
|
520
|
+
|
|
521
|
+
### Changed
|
|
522
|
+
|
|
523
|
+
- Updated documentation and refactored variable names.
|
|
524
|
+
|
|
525
|
+
## [1.0.16] - 2022-02-14
|
|
526
|
+
|
|
527
|
+
### Fixed
|
|
528
|
+
|
|
529
|
+
- I forgot to include the build file, so I added the build file.
|
|
530
|
+
|
|
531
|
+
## [1.0.15] - 2022-02-14
|
|
532
|
+
|
|
533
|
+
### Changed
|
|
534
|
+
|
|
535
|
+
- The unauthenticated route pattern option now accepts both string and RegExp patterns for more flexible route matching.
|
|
536
|
+
|
|
537
|
+
## [1.0.14] - 2022-01-17
|
|
538
|
+
|
|
539
|
+
### Changed
|
|
540
|
+
|
|
541
|
+
- The empty view helper can now check any type. Previously it could only check arrays.
|
|
542
|
+
|
|
543
|
+
## [1.0.13] - 2021-12-13
|
|
544
|
+
|
|
545
|
+
### Added
|
|
546
|
+
|
|
547
|
+
- The model's begin method now accepts the transaction option.
|
|
548
|
+
```js
|
|
549
|
+
let transaction;
|
|
550
|
+
try {
|
|
551
|
+
transaction = await BookModel.begin({
|
|
552
|
+
isolationLevel: BookModel.Transaction.ISOLATION_LEVELS.REPEATABLE_READ,
|
|
553
|
+
type: BookModel.Transaction.TYPES.DEFERRED,
|
|
554
|
+
});
|
|
555
|
+
const book = await BookModel.findOne({where: {id: 1}}, {transaction});
|
|
556
|
+
book.title = 'When Im Gone';
|
|
557
|
+
await book.save({transaction});
|
|
558
|
+
await transaction.commit();
|
|
559
|
+
|
|
560
|
+
// Load updated data.
|
|
561
|
+
await book.reload();
|
|
562
|
+
} catch (error) {
|
|
563
|
+
if (transaction)
|
|
564
|
+
await transaction.rollback();
|
|
565
|
+
}
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
## [1.0.12] - 2021-11-16
|
|
569
|
+
|
|
570
|
+
### Added
|
|
571
|
+
|
|
572
|
+
- Added a method to the model that can execute raw SQL. As there are often use cases in which it is just easier to execute raw / already prepared SQL queries, you can use the Model.query method.
|
|
573
|
+
```js
|
|
574
|
+
// By default the function will return two arguments - a results array, and an object containing metadata (such as amount of affected rows, etc).
|
|
575
|
+
// Note that since this is a raw query, the metadata are dialect specific.
|
|
576
|
+
const [results, metadata] = await BookModel.query("UPDATE book SET title = 'When Im Gone' WHERE id = 1");
|
|
577
|
+
|
|
578
|
+
// In cases where you don't need to access the metadata you can pass in a query type to tell sequelize how to format the results. For example, for a simple select query you could do:
|
|
579
|
+
// We didn't need to destructure the result here - the results were returned directly
|
|
580
|
+
const users = await BookModel.query("SELECT * FROM book", {type: BookModel.QueryTypes.SELECT});
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
## [1.0.11] - 2021-11-10
|
|
584
|
+
|
|
585
|
+
### Fixed
|
|
586
|
+
|
|
587
|
+
- Fixed a bug where the database config was read before NODE_ENV was set, preventing the correct database config from being loaded.
|
|
588
|
+
|
|
589
|
+
## [1.0.10] - 2021-10-19
|
|
590
|
+
|
|
591
|
+
### Changed
|
|
592
|
+
|
|
593
|
+
- Added face similarity score to face search results in collection.
|
|
594
|
+
|
|
595
|
+
## [1.0.9] - 2021-10-13
|
|
596
|
+
|
|
597
|
+
### Changed
|
|
598
|
+
|
|
599
|
+
- Updated dependent package 'sharp' from 0.25.4 to 0.29.1.
|
|
600
|
+
This update statically links sharp's pre-built libvips binaries, eliminating the need to install Python.
|
|
601
|
+
Click [here](https://sharp.pixelplumbing.com/changelog) for sharp change log.
|
|
602
|
+
|
|
603
|
+
## [1.0.8] - 2021-09-25
|
|
604
|
+
|
|
605
|
+
### Fixed
|
|
606
|
+
|
|
607
|
+
- Fixed a bug where the default router couldn't be accessed from the endpoint URL.
|
|
608
|
+
|
|
609
|
+
## [1.0.7] - 2021-08-13
|
|
610
|
+
|
|
611
|
+
### Added
|
|
612
|
+
|
|
613
|
+
- Added where member functions to Model class.
|
|
614
|
+
|
|
615
|
+
## [1.0.6] - 2021-08-13
|
|
616
|
+
|
|
617
|
+
### Added
|
|
618
|
+
|
|
619
|
+
- Added fn, col and literal member functions to Model class.
|
|
620
|
+
|
|
621
|
+
## [1.0.5] - 2021-08-12
|
|
622
|
+
|
|
623
|
+
### Changed
|
|
624
|
+
|
|
625
|
+
- Changed the maximum size per field for multipart (multipart/form-data) requests from 1MB to unlimited.
|
|
626
|
+
|
|
627
|
+
## [1.0.4] - 2021-06-13
|
|
628
|
+
|
|
629
|
+
### Fixed
|
|
630
|
+
|
|
631
|
+
- Fixed a bug where the referrer URL was set in app.locals.currentPath instead of the current URL.
|
|
632
|
+
|
|
633
|
+
## [1.0.3] - 2021-06-13
|
|
634
|
+
|
|
635
|
+
### Changed
|
|
636
|
+
|
|
637
|
+
- Changed the current URL path of a local variable. app.locals.currentPath is a USVString containing an initial '/' followed by the path of the URL, not including the query string or fragment.
|
|
638
|
+
```js
|
|
639
|
+
// For example, when the current URL is "https://example.com/docs/api?q=value", "/docs/api" is set for "app.locals.currentPath".
|
|
640
|
+
console.log(app.locals.currentPath);
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
## [1.0.2] - 2021-06-10
|
|
644
|
+
|
|
645
|
+
### Changed
|
|
646
|
+
|
|
647
|
+
- Updated rollup from version 2.44 to 2.51.
|
|
648
|
+
|
|
649
|
+
### Fixed
|
|
650
|
+
|
|
651
|
+
- Fixed a bug where preloading models failed in cjs.
|
|
652
|
+
|
|
653
|
+
## [1.0.1] - 2021-06-02
|
|
654
|
+
|
|
655
|
+
### Fixed
|
|
656
|
+
|
|
657
|
+
- Fixed a bug that caused an error when reading options defined in ESM's default Export.
|
|
658
|
+
|
|
659
|
+
[1.0.1]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.0...v1.0.1
|
|
660
|
+
[1.0.2]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.1...v1.0.2
|
|
661
|
+
[1.0.3]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.2...v1.0.3
|
|
662
|
+
[1.0.4]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.3...v1.0.4
|
|
663
|
+
[1.0.5]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.4...v1.0.5
|
|
664
|
+
[1.0.6]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.5...v1.0.6
|
|
665
|
+
[1.0.7]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.6...v1.0.7
|
|
666
|
+
[1.0.8]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.7...v1.0.8
|
|
667
|
+
[1.0.9]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.8...v1.0.9
|
|
668
|
+
[1.0.10]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.9...v1.0.10
|
|
669
|
+
[1.0.11]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.10...v1.0.11
|
|
670
|
+
[1.0.12]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.11...v1.0.12
|
|
671
|
+
[1.0.13]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.12...v1.0.13
|
|
672
|
+
[1.0.14]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.13...v1.0.14
|
|
673
|
+
[1.0.15]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.14...v1.0.15
|
|
674
|
+
[1.0.16]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.15...v1.0.16
|
|
675
|
+
[1.0.17]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.16...v1.0.17
|
|
676
|
+
[1.0.18]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.17...v1.0.18
|
|
677
|
+
[1.0.19]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.18...v1.0.19
|
|
678
|
+
[1.0.20]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.19...v1.0.20
|
|
679
|
+
[1.0.21]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.20...v1.0.21
|
|
680
|
+
[1.0.22]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.21...v1.0.22
|
|
681
|
+
[1.0.23]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.22...v1.0.23
|
|
682
|
+
[1.0.24]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.23...v1.0.24
|
|
683
|
+
[1.0.25]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.24...v1.0.25
|
|
684
|
+
[1.0.26]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.25...v1.0.26
|
|
685
|
+
[1.0.27]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.26...v1.0.27
|
|
686
|
+
[1.0.28]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.27...v1.0.28
|
|
687
|
+
[1.0.29]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.28...v1.0.29
|
|
688
|
+
[1.0.30]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.29...v1.0.30
|
|
689
|
+
[1.0.31]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.30...v1.0.31
|
|
690
|
+
[1.0.32]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.31...v1.0.32
|
|
691
|
+
[1.0.33]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.32...v1.0.33
|
|
692
|
+
[1.0.34]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.33...v1.0.34
|
|
693
|
+
[1.0.35]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.34...v1.0.35
|
|
694
|
+
[1.0.36]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.35...v1.0.36
|
|
695
|
+
[1.0.37]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.36...v1.0.37
|
|
696
|
+
[1.0.38]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.37...v1.0.38
|
|
697
|
+
[1.0.39]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.38...v1.0.39
|
|
698
|
+
[1.0.40]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.39...v1.0.40
|
|
699
|
+
[1.0.41]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.40...v1.0.41
|
|
700
|
+
[1.0.42]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.41...v1.0.42
|
|
701
|
+
[1.0.43]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.42...v1.0.43
|
|
702
|
+
[1.0.44]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.43...v1.0.44
|
|
703
|
+
[1.0.45]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.44...v1.0.45
|
|
704
|
+
[1.1.0]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.45...v1.1.0
|
|
705
|
+
[1.1.1]: https://github.com/takuya-motoshima/express-sweet/compare/v1.1.0...v1.1.1
|
|
706
|
+
[2.0.0]: https://github.com/takuya-motoshima/express-sweet/compare/v1.1.1...v2.0.0
|
|
707
|
+
[2.0.1]: https://github.com/takuya-motoshima/express-sweet/compare/v2.0.0...v2.0.1
|
|
708
|
+
[2.0.2]: https://github.com/takuya-motoshima/express-sweet/compare/v2.0.1...v2.0.2
|
|
709
|
+
[2.0.3]: https://github.com/takuya-motoshima/express-sweet/compare/v2.0.2...v2.0.3
|
|
710
|
+
[2.0.4]: https://github.com/takuya-motoshima/express-sweet/compare/v2.0.3...v2.0.4
|
|
711
|
+
[2.0.5]: https://github.com/takuya-motoshima/express-sweet/compare/v2.0.4...v2.0.5
|
|
712
|
+
[2.0.6]: https://github.com/takuya-motoshima/express-sweet/compare/v2.0.5...v2.0.6
|
|
713
|
+
[2.0.7]: https://github.com/takuya-motoshima/express-sweet/compare/v2.0.6...v2.0.7
|
|
714
|
+
[2.0.8]: https://github.com/takuya-motoshima/express-sweet/compare/v2.0.7...v2.0.8
|
|
715
|
+
[2.0.9]: https://github.com/takuya-motoshima/express-sweet/compare/v2.0.8...v2.0.9
|
|
716
|
+
[3.0.0]: https://github.com/takuya-motoshima/express-sweet/compare/v2.0.9...v3.0.0
|
|
717
|
+
[3.0.1]: https://github.com/takuya-motoshima/express-sweet/compare/v3.0.0...v3.0.1
|
|
718
|
+
[3.0.2]: https://github.com/takuya-motoshima/express-sweet/compare/v3.0.1...v3.0.2
|
|
719
|
+
[Unreleased]: https://github.com/takuya-motoshima/express-sweet/compare/v3.0.2...HEAD
|