express-sweet 1.0.17 → 1.0.20

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 CHANGED
@@ -1,7 +1,98 @@
1
1
  # Changelog
2
-
3
2
  All notable changes to this project will be documented in this file.
4
3
 
4
+ ## [1.0.20] - 2022-05-25
5
+ ### Fixed
6
+ - Added an option to get details (emotion, gender, age group) to the face detection method.
7
+ ```js
8
+ const sweet = require('../dist/build.common');
9
+
10
+ // Load environment variables.
11
+ sweet.middlewares.Environment.mount();
12
+
13
+ // Rekognition Client.
14
+ const client = new sweet.services.AWSRekognitionClient({
15
+ accessKeyId: process.env.AWS_REKOGNITION_ACCESS_KEY_ID,
16
+ secretAccessKey: process.env.AWS_REKOGNITION_SECRET_ACCESS_KEY,
17
+ region: process.env.AWS_REKOGNITION_REGION
18
+ });
19
+
20
+ (async () => {
21
+ // Detects bounding boxes on faces.
22
+ // Output: [
23
+ // {
24
+ // width: 0.3099822998046875,
25
+ // height: 0.661512017250061,
26
+ // left: 0.5449195504188538,
27
+ // top: 0.11531734466552734
28
+ // }
29
+ // ]
30
+ let res = await client.detectFaces('img/face.jpg');
31
+ console.log(res);
32
+
33
+ // Detect facial details.
34
+ // Output: [
35
+ // {
36
+ // boundingBox: {
37
+ // width: 0.3099822998046875,
38
+ // height: 0.661512017250061,
39
+ // left: 0.5449195504188538,
40
+ // top: 0.11531734466552734
41
+ // },
42
+ // ageRange: { high: 14, low: 6 },
43
+ // gender: 'female',
44
+ // emotions: {
45
+ // happy: 99.78905487060547,
46
+ // surprised: 6.306276321411133,
47
+ // fear: 5.880091190338135,
48
+ // sad: 2.152125835418701,
49
+ // confused: 0.023256277665495872,
50
+ // angry: 0.018351631239056587,
51
+ // calm: 0.015775982290506363,
52
+ // disgusted: 0.013914424926042557
53
+ // }
54
+ // }
55
+ // ]
56
+ const minConfidence = 90;
57
+ const withDetails = true;
58
+ res = await client.detectFaces('img/face.jpg', minConfidence, withDetails);
59
+ console.log(res);
60
+ })();
61
+ ```
62
+
63
+ ## [1.0.19] - 2022-05-20
64
+ ### Fixed
65
+ - Add date format helper to view.
66
+ ```html
67
+ {{format_date 'YYYY/MM/DD' "2021-10-24T02:13:06.610Z"}} => 2021/10/24
68
+ {{format_date 'YYYY/MM/DD' "2021-10-24T02:13:06.610Z" 'jp'}} => 2021/10/24
69
+ {{format_date 'YYYY/MM/DD' "2021-10-24T02:13:06.610Z" 'es'}} => 2021/10/24
70
+ ```
71
+
72
+ ## [1.0.18] - 2022-05-18
73
+ ### Fixed
74
+ - User authentication sessions can now be stored in redis.
75
+ To use redis for session storage, simply add the following option to config/authentication.js.
76
+ Please give it a try.
77
+
78
+ config/authentication.js:
79
+ ```json
80
+ /**
81
+ * The session store instance, defaults to a new MemoryStore(memory) instance.
82
+ * @type {'memory|redis'}
83
+ */
84
+ session_store: 'memory',
85
+
86
+ /**
87
+ * If the session is stored in "redis", this field is required and should be set to the hostname of the Redis server.
88
+ * For example, to connect to redis on localhost on port 6379, set "redis://localhost:6379".
89
+ * To connect to a different host or port, use a connection string in the format "redis[s]://[[username][:password]@][host][:port][/db-number]".
90
+ * For example, "redis://alice:foobared@awesome.redis.server:6380".
91
+ * @type {string|undefined}
92
+ */
93
+ redis_host: 'redis://localhost:6379'
94
+ ```
95
+
5
96
  ## [1.0.17] - 2022-05-17
6
97
  ### Fixed
7
98
  - Updated documentation and refactored variable names.
@@ -188,4 +279,7 @@ All notable changes to this project will be documented in this file.
188
279
  [1.0.14]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.13...v1.0.14
189
280
  [1.0.15]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.14...v1.0.15
190
281
  [1.0.16]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.15...v1.0.16
191
- [1.0.17]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.16...v1.0.17
282
+ [1.0.17]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.16...v1.0.17
283
+ [1.0.18]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.17...v1.0.18
284
+ [1.0.19]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.18...v1.0.19
285
+ [1.0.20]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.19...v1.0.20
@@ -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
+ ```