express-sweet 1.0.23 → 1.0.25
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 +54 -24
- package/dist/build.common.js +7 -7
- package/dist/build.esm.js +9 -9
- package/docs/img/logos/default-small.svg +1 -0
- package/docs/img/logos/default.svg +1 -0
- package/docs/img/logos/favicon.svg +1 -0
- package/docs/index.html +134 -14
- package/hero.svg +1 -1
- package/package.json +4 -5
- package/types/database/Database.d.ts +33 -33
- package/types/handlebars_helpers/string.d.ts +15 -1
- package/types/interfaces/AuthenticationOptions.d.ts +14 -0
- package/types/middlewares/Authentication.d.ts +2 -0
- package/types/package.d.ts +0 -1
- package/types/utils/isArray.d.ts +1 -1
- package/types/utils/isAsyncFunction.d.ts +1 -1
- package/types/utils/isObject.d.ts +1 -1
- package/types/utils/isString.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
-
## [1.0.
|
|
5
|
-
###
|
|
4
|
+
## [1.0.25] - 2022/11/24
|
|
5
|
+
### Added
|
|
6
|
+
- Added format_bytes view helper to convert bytes to appropriate units.
|
|
7
|
+
```html
|
|
8
|
+
{{format_bytes 1024}} => 1 KB
|
|
9
|
+
{{format_bytes 1234 2}} => 1.21 KB
|
|
10
|
+
{{format_bytes 1234 3}} => 1.205 KB
|
|
11
|
+
{{format_bytes 0}} => 0 Bytes
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## [1.0.24] - 2022/10/24
|
|
15
|
+
### Added
|
|
16
|
+
- Added is_ajax option to user authentication.
|
|
17
|
+
config/authentication.js:
|
|
18
|
+
```js
|
|
19
|
+
/**
|
|
20
|
+
* How to determine if it is an ajax request.
|
|
21
|
+
* The default is that if there is an XMLHttpRequest in the request header (req.xhr) returns true.
|
|
22
|
+
* For example, if there is no XMLHttpRequest in req(express.Request) and the Ajax endpoint starts with /api, a custom Ajax decision can be made like "return /^\/api\//.test(req.path)".
|
|
23
|
+
*
|
|
24
|
+
* @type {(req: express.Request) => boolean}
|
|
25
|
+
* @example
|
|
26
|
+
* is_ajax: req => {
|
|
27
|
+
* // If the request URL begins with /api, it is assumed to be Ajax.
|
|
28
|
+
* return /^\/api/.test(req.path);
|
|
29
|
+
* // return !!req.xhr;
|
|
30
|
+
* }
|
|
31
|
+
*/
|
|
32
|
+
is_ajax: req => !!req.xhr
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## [1.0.23] - 2022/10/20
|
|
36
|
+
### Added
|
|
6
37
|
- A request body object has been added to the parameters of the callback function for user authentication.
|
|
7
38
|
config/authentication.js:
|
|
8
39
|
```js
|
|
@@ -33,12 +64,8 @@ All notable changes to this project will be documented in this file.
|
|
|
33
64
|
}
|
|
34
65
|
```
|
|
35
66
|
|
|
36
|
-
## [1.0.23] - 2022/10/5
|
|
37
|
-
### Fixed
|
|
38
|
-
- Methodical check of request URLs that do not require authentication.
|
|
39
|
-
|
|
40
67
|
## [1.0.22] - 2022/7/27
|
|
41
|
-
###
|
|
68
|
+
### Added
|
|
42
69
|
- You can now set hook functions that are called before the view is rendered.
|
|
43
70
|
Hook functions can be used, for example, to set local variables that can be used in the view.
|
|
44
71
|
|
|
@@ -62,7 +89,7 @@ All notable changes to this project will be documented in this file.
|
|
|
62
89
|
```
|
|
63
90
|
|
|
64
91
|
## [1.0.21] - 2022/526
|
|
65
|
-
###
|
|
92
|
+
### Added
|
|
66
93
|
- Added an option to the face indexing method to retrieve details (gender, emotion, age group) of indexed faces.
|
|
67
94
|
```js
|
|
68
95
|
const sweet = require('../dist/build.common');
|
|
@@ -106,7 +133,7 @@ All notable changes to this project will be documented in this file.
|
|
|
106
133
|
```
|
|
107
134
|
|
|
108
135
|
## [1.0.20] - 2022/5/25
|
|
109
|
-
###
|
|
136
|
+
### Added
|
|
110
137
|
- Added an option to get details (emotion, gender, age group) to the face detection method.
|
|
111
138
|
```js
|
|
112
139
|
const sweet = require('../dist/build.common');
|
|
@@ -165,7 +192,7 @@ All notable changes to this project will be documented in this file.
|
|
|
165
192
|
```
|
|
166
193
|
|
|
167
194
|
## [1.0.19] - 2022/5/20
|
|
168
|
-
###
|
|
195
|
+
### Added
|
|
169
196
|
- Add date format helper to view.
|
|
170
197
|
```html
|
|
171
198
|
{{format_date 'YYYY/MM/DD' "2021-10-24T02:13:06.610Z"}} => 2021/10/24
|
|
@@ -174,7 +201,7 @@ All notable changes to this project will be documented in this file.
|
|
|
174
201
|
```
|
|
175
202
|
|
|
176
203
|
## [1.0.18] - 2022/5/18
|
|
177
|
-
###
|
|
204
|
+
### Added
|
|
178
205
|
- User authentication sessions can now be stored in redis.
|
|
179
206
|
To use redis for session storage, simply add the following option to config/authentication.js.
|
|
180
207
|
Please give it a try.
|
|
@@ -198,7 +225,7 @@ All notable changes to this project will be documented in this file.
|
|
|
198
225
|
```
|
|
199
226
|
|
|
200
227
|
## [1.0.17] - 2022/5/17
|
|
201
|
-
###
|
|
228
|
+
### Changed
|
|
202
229
|
- Updated documentation and refactored variable names.
|
|
203
230
|
|
|
204
231
|
## [1.0.16] - 2022/2/14
|
|
@@ -206,11 +233,11 @@ All notable changes to this project will be documented in this file.
|
|
|
206
233
|
- I forgot to include the build file, so I added the build file.
|
|
207
234
|
|
|
208
235
|
## [1.0.15] - 2022/2/14
|
|
209
|
-
###
|
|
236
|
+
### Changed
|
|
210
237
|
- Changed the type of 'config/authentication.js#allow_unauthenticated' from'string[]' to'(string|RegExp)[]}'.
|
|
211
238
|
|
|
212
239
|
## [1.0.14] - 2022/1/17
|
|
213
|
-
###
|
|
240
|
+
### Changed
|
|
214
241
|
- empty view helper can now check any type. Previously I could only check arrays.
|
|
215
242
|
```html
|
|
216
243
|
// If the value is an array.
|
|
@@ -254,7 +281,7 @@ All notable changes to this project will be documented in this file.
|
|
|
254
281
|
```
|
|
255
282
|
|
|
256
283
|
## [1.0.13] - 2021/12/13
|
|
257
|
-
###
|
|
284
|
+
### Added
|
|
258
285
|
- The model's begin method now accepts the transaction option.
|
|
259
286
|
See [Transaction | Sequelize](https://sequelize.org/master/class/lib/transaction.js~Transaction.html) for transaction options.
|
|
260
287
|
```js
|
|
@@ -280,7 +307,7 @@ All notable changes to this project will be documented in this file.
|
|
|
280
307
|
```
|
|
281
308
|
|
|
282
309
|
## [1.0.12] - 2021/11/16
|
|
283
|
-
###
|
|
310
|
+
### Added
|
|
284
311
|
- Added a method to the model that can execute raw SQL.
|
|
285
312
|
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.
|
|
286
313
|
|
|
@@ -299,7 +326,7 @@ All notable changes to this project will be documented in this file.
|
|
|
299
326
|
- Fixed a bug that the database config was read before NODE_ENV was set and the database config matching NODE_ENV could not be read.
|
|
300
327
|
|
|
301
328
|
## [1.0.10] - 2021/10/19
|
|
302
|
-
###
|
|
329
|
+
### Changed
|
|
303
330
|
- Added face similarity found to face search results in collection.
|
|
304
331
|
|
|
305
332
|
```js
|
|
@@ -324,7 +351,7 @@ All notable changes to this project will be documented in this file.
|
|
|
324
351
|
```
|
|
325
352
|
|
|
326
353
|
## [1.0.9] - 2021/10/13
|
|
327
|
-
###
|
|
354
|
+
### Changed
|
|
328
355
|
- Updated dependent package'sharp'from 0.25.4 to 0.29.1.
|
|
329
356
|
This update statically links sharp's pre-built libvips binaries, eliminating the need to install Phton.
|
|
330
357
|
Click [here](https://sharp.pixelplumbing.com/changelog) for sharp change log.
|
|
@@ -334,15 +361,15 @@ All notable changes to this project will be documented in this file.
|
|
|
334
361
|
- Fixed a bug where the default router couldn't aqua from the endpoint URL.
|
|
335
362
|
|
|
336
363
|
## [1.0.7] - 2021/8/13
|
|
337
|
-
###
|
|
364
|
+
### Added
|
|
338
365
|
- Added where member functions to Model class. Please see [here](https://takuya-motoshima.github.io/express-sweet/#model-class) for details.
|
|
339
366
|
|
|
340
367
|
## [1.0.6] - 2021/8/13
|
|
341
|
-
###
|
|
368
|
+
### Added
|
|
342
369
|
- Added fn, col and literal member functions to Model class. Please see [here](https://takuya-motoshima.github.io/express-sweet/#model-class) for details.
|
|
343
370
|
|
|
344
371
|
## [1.0.5] - 2021/8/12
|
|
345
|
-
###
|
|
372
|
+
### Changed
|
|
346
373
|
- Changed the maximum size per field for multipart (multipart/form-data) requests from 1MB to unlimited.
|
|
347
374
|
|
|
348
375
|
## [1.0.4] - 2021/6/13
|
|
@@ -350,7 +377,7 @@ All notable changes to this project will be documented in this file.
|
|
|
350
377
|
- Fixed a bug where the referrer URL was set in app.locals.currentPath instead of the current URL.
|
|
351
378
|
|
|
352
379
|
## [1.0.3] - 2021/6/13
|
|
353
|
-
###
|
|
380
|
+
### Changed
|
|
354
381
|
- Change 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.
|
|
355
382
|
|
|
356
383
|
```js
|
|
@@ -359,8 +386,10 @@ All notable changes to this project will be documented in this file.
|
|
|
359
386
|
```
|
|
360
387
|
|
|
361
388
|
## [1.0.2] - 2021//6/10
|
|
362
|
-
###
|
|
389
|
+
### Changed
|
|
363
390
|
- Updated rollup from version 2.44 to 2.51.
|
|
391
|
+
|
|
392
|
+
### Fixed
|
|
364
393
|
- Fixed a bug where preloading models failed in cjs.
|
|
365
394
|
|
|
366
395
|
## [1.0.1] - 2021/6/2
|
|
@@ -390,4 +419,5 @@ All notable changes to this project will be documented in this file.
|
|
|
390
419
|
[1.0.21]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.20...v1.0.21
|
|
391
420
|
[1.0.22]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.21...v1.0.22
|
|
392
421
|
[1.0.23]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.22...v1.0.23
|
|
393
|
-
[1.0.24]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.23...v1.0.24
|
|
422
|
+
[1.0.24]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.23...v1.0.24
|
|
423
|
+
[1.0.25]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.24...v1.0.25
|