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