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.
Files changed (47) hide show
  1. package/CHANGELOG.md +40 -2
  2. package/INSTALL-Redis.md +51 -0
  3. package/README.md +13 -44
  4. package/dist/build.common.js +19 -11
  5. package/dist/build.esm.js +19 -11
  6. package/docs/{styles/docs.css → docs.css} +99 -100
  7. package/docs/docs.js +41 -0
  8. package/docs/{images → img/associations}/belongs-to-many.png +0 -0
  9. package/docs/{images → img/associations}/belongs-to.png +0 -0
  10. package/docs/{images → img/associations}/has-many.png +0 -0
  11. package/docs/{images → img/associations}/has-one.png +0 -0
  12. package/docs/img/demos/login&users.jfif +0 -0
  13. package/docs/img/hero.svg +1 -0
  14. package/docs/{images → img}/logo.svg +0 -0
  15. package/docs/index.html +2552 -3144
  16. package/docs/templates/cjs/authentication.js +96 -0
  17. package/docs/templates/cjs/config.js +78 -0
  18. package/docs/templates/cjs/database.js +35 -0
  19. package/docs/templates/cjs/view.js +36 -0
  20. package/docs/templates/esm/authentication.js +96 -0
  21. package/docs/templates/esm/config.js +78 -0
  22. package/docs/templates/esm/database.js +35 -0
  23. package/docs/templates/esm/view.js +36 -0
  24. package/package.json +9 -6
  25. package/types/database/Model.d.ts +8 -8
  26. package/types/handlebars_helpers/date.d.ts +14 -0
  27. package/types/handlebars_helpers/index.d.ts +2 -1
  28. package/types/handlebars_helpers/string.d.ts +20 -0
  29. package/types/interfaces/AuthenticationOptions.d.ts +13 -0
  30. package/types/middlewares/CORS.d.ts +1 -1
  31. package/types/package.d.ts +3 -0
  32. package/types/services/AWSRekognitionClient.d.ts +2 -2
  33. package/types/services/RedisClient.d.ts +1 -1
  34. package/types/utils/Types.d.ts +8 -0
  35. package/types/utils/index.d.ts +7 -2
  36. package/types/utils/isArray.d.ts +8 -0
  37. package/types/utils/isAsyncFunction.d.ts +12 -0
  38. package/types/utils/isObject.d.ts +8 -0
  39. package/types/utils/isString.d.ts +8 -0
  40. package/docs/images/all.jpg +0 -0
  41. package/docs/images/edit-user.png +0 -0
  42. package/docs/images/home.png +0 -0
  43. package/docs/images/login.png +0 -0
  44. package/docs/images/logo-dark.svg +0 -12
  45. package/docs/images/new-user.png +0 -0
  46. package/docs/images/user-list.png +0 -0
  47. 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
@@ -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
- <a href="https://takuya-motoshima.github.io/express-sweet/"><img src="https://raw.githubusercontent.com/takuya-motoshima/express-sweet/main/logo.svg" height="140"></a>
1
+ # express-sweet
2
+ ![heading](docs/img/hero.svg)
2
3
 
3
4
  Extend Express functionality with Express Sweet and start developing fast, minimal web applications.
4
5
 
5
- ## Docs
6
-
7
- * <a href="https://takuya-motoshima.github.io/express-sweet/" target="_blank">Website and Documentation</a> - <a href="https://github.com/takuya-motoshima/express-sweet" target="_blank">[website repo]</a>
8
- * <a href="https://github.com/takuya-motoshima/express-sweet/blob/main/CHANGELOG.md" target="_blank">Changelog</a>
9
-
10
- ## Installation
11
-
12
- This is a [Node.js](https://nodejs.org/en/) module available through the [npm registry](https://www.npmjs.com/).
13
- Before installing, [download and install Node.js](https://nodejs.org/en/download/).
14
- Node.js 0.10 or higher is required.
15
-
16
- For details on installing Express Sweet, see the <a href="https://takuya-motoshima.github.io/express-sweet/#instl" target="_blank">&quot;installation reference&quot;</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)