express-sweet 1.0.16 → 1.0.19
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 +40 -2
- package/INSTALL-Redis.md +51 -0
- package/README.md +13 -44
- package/dist/build.common.js +19 -11
- package/dist/build.esm.js +19 -11
- package/docs/{styles/docs.css → docs.css} +99 -100
- package/docs/docs.js +41 -0
- package/docs/{images → img/associations}/belongs-to-many.png +0 -0
- package/docs/{images → img/associations}/belongs-to.png +0 -0
- package/docs/{images → img/associations}/has-many.png +0 -0
- package/docs/{images → img/associations}/has-one.png +0 -0
- package/docs/img/demos/login&users.jfif +0 -0
- package/docs/img/hero.svg +1 -0
- package/docs/{images → img}/logo.svg +0 -0
- package/docs/index.html +2552 -3144
- package/docs/templates/cjs/authentication.js +96 -0
- package/docs/templates/cjs/config.js +78 -0
- package/docs/templates/cjs/database.js +35 -0
- package/docs/templates/cjs/view.js +36 -0
- package/docs/templates/esm/authentication.js +96 -0
- package/docs/templates/esm/config.js +78 -0
- package/docs/templates/esm/database.js +35 -0
- package/docs/templates/esm/view.js +36 -0
- package/package.json +9 -6
- package/types/database/Model.d.ts +8 -8
- package/types/handlebars_helpers/date.d.ts +14 -0
- package/types/handlebars_helpers/index.d.ts +2 -1
- package/types/handlebars_helpers/string.d.ts +20 -0
- package/types/interfaces/AuthenticationOptions.d.ts +13 -0
- package/types/middlewares/CORS.d.ts +1 -1
- package/types/package.d.ts +3 -0
- package/types/services/AWSRekognitionClient.d.ts +2 -2
- package/types/services/RedisClient.d.ts +1 -1
- package/types/utils/Types.d.ts +8 -0
- package/types/utils/index.d.ts +7 -2
- package/types/utils/isArray.d.ts +8 -0
- package/types/utils/isAsyncFunction.d.ts +12 -0
- package/types/utils/isObject.d.ts +8 -0
- package/types/utils/isString.d.ts +8 -0
- package/docs/images/all.jpg +0 -0
- package/docs/images/edit-user.png +0 -0
- package/docs/images/home.png +0 -0
- package/docs/images/login.png +0 -0
- package/docs/images/logo-dark.svg +0 -12
- package/docs/images/new-user.png +0 -0
- package/docs/images/user-list.png +0 -0
- package/docs/scripts/docs.js +0 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,43 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
-
|
|
3
2
|
All notable changes to this project will be documented in this file.
|
|
4
3
|
|
|
4
|
+
## [1.0.19] - 2022-05-20
|
|
5
|
+
### Fixed
|
|
6
|
+
- Add date format helper to view.
|
|
7
|
+
```html
|
|
8
|
+
{{format_date 'YYYY/MM/DD' "2021-10-24T02:13:06.610Z"}} => 2021/10/24
|
|
9
|
+
{{format_date 'YYYY/MM/DD' "2021-10-24T02:13:06.610Z" 'jp'}} => 2021/10/24
|
|
10
|
+
{{format_date 'YYYY/MM/DD' "2021-10-24T02:13:06.610Z" 'es'}} => 2021/10/24
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## [1.0.18] - 2022-05-18
|
|
14
|
+
### Fixed
|
|
15
|
+
- User authentication sessions can now be stored in redis.
|
|
16
|
+
To use redis for session storage, simply add the following option to config/authentication.js.
|
|
17
|
+
Please give it a try.
|
|
18
|
+
|
|
19
|
+
config/authentication.js:
|
|
20
|
+
```json
|
|
21
|
+
/**
|
|
22
|
+
* The session store instance, defaults to a new MemoryStore(memory) instance.
|
|
23
|
+
* @type {'memory|redis'}
|
|
24
|
+
*/
|
|
25
|
+
session_store: 'memory',
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* If the session is stored in "redis", this field is required and should be set to the hostname of the Redis server.
|
|
29
|
+
* For example, to connect to redis on localhost on port 6379, set "redis://localhost:6379".
|
|
30
|
+
* To connect to a different host or port, use a connection string in the format "redis[s]://[[username][:password]@][host][:port][/db-number]".
|
|
31
|
+
* For example, "redis://alice:foobared@awesome.redis.server:6380".
|
|
32
|
+
* @type {string|undefined}
|
|
33
|
+
*/
|
|
34
|
+
redis_host: 'redis://localhost:6379'
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## [1.0.17] - 2022-05-17
|
|
38
|
+
### Fixed
|
|
39
|
+
- Updated documentation and refactored variable names.
|
|
40
|
+
|
|
5
41
|
## [1.0.16] - 2022-02-14
|
|
6
42
|
### Fixed
|
|
7
43
|
- I forgot to include the build file, so I added the build file.
|
|
@@ -183,4 +219,6 @@ All notable changes to this project will be documented in this file.
|
|
|
183
219
|
[1.0.13]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.12...v1.0.13
|
|
184
220
|
[1.0.14]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.13...v1.0.14
|
|
185
221
|
[1.0.15]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.14...v1.0.15
|
|
186
|
-
[1.0.16]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.15...v1.0.16
|
|
222
|
+
[1.0.16]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.15...v1.0.16
|
|
223
|
+
[1.0.17]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.16...v1.0.17
|
|
224
|
+
[1.0.18]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.17...v1.0.18
|
package/INSTALL-Redis.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Install Redis
|
|
2
|
+
==============
|
|
3
|
+
|
|
4
|
+
* OS: `Amazon Linux 2`
|
|
5
|
+
* Redis: `v6.2.6 or later`
|
|
6
|
+
* see more: https://redis.io/download#installation
|
|
7
|
+
|
|
8
|
+
Check the version of Redis that can be installed.
|
|
9
|
+
```sh
|
|
10
|
+
amazon-linux-extras list|grep redis
|
|
11
|
+
# Below is an example of the output.
|
|
12
|
+
# 56 redis6 available [ =stable ]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Install Redis by specifying the version.
|
|
16
|
+
```sh
|
|
17
|
+
sudo amazon-linux-extras install -y redis6
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Configure and start Redis autostart.
|
|
21
|
+
```sh
|
|
22
|
+
sudo systemctl status redis.service
|
|
23
|
+
sudo systemctl start redis.service
|
|
24
|
+
sudo systemctl enable redis.service
|
|
25
|
+
sudo systemctl is-enabled redis.service
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Check Redis process.
|
|
29
|
+
```sh
|
|
30
|
+
ps -ef | grep redis | grep -v grep
|
|
31
|
+
# Below is an example of the output.
|
|
32
|
+
# redis 5407 1 0 11:02 ? 00:00:00 /usr/bin/redis-server 127.0.0.1:6379
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Check Redis behavior. If "redis-cli ping" returns PONG, it is success.
|
|
36
|
+
```sh
|
|
37
|
+
redis-cli ping
|
|
38
|
+
# Below is an example of the output.
|
|
39
|
+
# PONG
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Test Redis read/write.
|
|
43
|
+
```sh
|
|
44
|
+
redis-cli
|
|
45
|
+
|
|
46
|
+
set myMessage "hello world"
|
|
47
|
+
# OK
|
|
48
|
+
|
|
49
|
+
get myMessage
|
|
50
|
+
# "hello world"
|
|
51
|
+
```
|
package/README.md
CHANGED
|
@@ -1,51 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
# express-sweet
|
|
2
|
+

|
|
2
3
|
|
|
3
4
|
Extend Express functionality with Express Sweet and start developing fast, minimal web applications.
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
For details on installing Express Sweet, see the <a href="https://takuya-motoshima.github.io/express-sweet/#instl" target="_blank">"installation reference"</a>.
|
|
17
|
-
|
|
18
|
-
<table>
|
|
19
|
-
<tr>
|
|
20
|
-
<td valign="top">
|
|
21
|
-
<div>Login</div>
|
|
22
|
-
<img src="https://raw.githubusercontent.com/takuya-motoshima/express-sweet/main/screencaps/login.png" width="400">
|
|
23
|
-
</td>
|
|
24
|
-
<td valign="top">
|
|
25
|
-
<div>Home</div>
|
|
26
|
-
<img src="https://raw.githubusercontent.com/takuya-motoshima/express-sweet/main/screencaps/home.png" width="400">
|
|
27
|
-
</td>
|
|
28
|
-
</tr>
|
|
29
|
-
<tr>
|
|
30
|
-
<td valign="top">
|
|
31
|
-
<div>User list</div>
|
|
32
|
-
<img src="https://raw.githubusercontent.com/takuya-motoshima/express-sweet/main/screencaps/user-list.png" width="400">
|
|
33
|
-
</td>
|
|
34
|
-
<td valign="top">
|
|
35
|
-
<div>New user</div>
|
|
36
|
-
<img src="https://raw.githubusercontent.com/takuya-motoshima/express-sweet/main/screencaps/new-user.png" width="400">
|
|
37
|
-
</td>
|
|
38
|
-
</tr>
|
|
39
|
-
<tr>
|
|
40
|
-
<td valign="top">
|
|
41
|
-
<div>Edit user</div>
|
|
42
|
-
<img src="https://raw.githubusercontent.com/takuya-motoshima/express-sweet/main/screencaps/edit-user.png" width="400">
|
|
43
|
-
</td>
|
|
44
|
-
</tr>
|
|
45
|
-
</table>
|
|
6
|
+
## Documentation
|
|
7
|
+
* [Introduction](https://takuya-motoshima.github.io/express-sweet/#introduction)
|
|
8
|
+
* [Quick Start](https://takuya-motoshima.github.io/express-sweet/#quick-start)
|
|
9
|
+
* [Environment variable](https://takuya-motoshima.github.io/express-sweet/#environment-variable)
|
|
10
|
+
* [Base configuration](https://takuya-motoshima.github.io/express-sweet/#base-configuration)
|
|
11
|
+
* [Routing](https://takuya-motoshima.github.io/express-sweet/#routing)
|
|
12
|
+
* [Views](https://takuya-motoshima.github.io/express-sweet/#views)
|
|
13
|
+
* [Model](https://takuya-motoshima.github.io/express-sweet/#model)
|
|
14
|
+
* [User authentication](https://takuya-motoshima.github.io/express-sweet/#user-authentication)
|
|
15
|
+
* [Rekognition](https://takuya-motoshima.github.io/express-sweet/#rekognition)
|
|
16
|
+
* [Changelog](https://takuya-motoshima.github.io/express-sweet/#changelog)
|
|
46
17
|
|
|
47
18
|
## Author
|
|
48
|
-
|
|
49
19
|
**Takuya Motoshima**
|
|
50
20
|
|
|
51
21
|
* [github/takuya-motoshima](https://github.com/takuya-motoshima)
|
|
@@ -53,5 +23,4 @@ For details on installing Express Sweet, see the <a href="https://takuya-motoshi
|
|
|
53
23
|
* [facebook/takuya.motoshima.7](https://www.facebook.com/takuya.motoshima.7)
|
|
54
24
|
|
|
55
25
|
## License
|
|
56
|
-
|
|
57
26
|
[MIT](LICENSE)
|