express-sweet 1.0.14 → 1.0.15

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 (44) hide show
  1. package/CHANGELOG.md +0 -173
  2. package/docs/index.html +5 -2
  3. package/package.json +1 -1
  4. package/dist/build.common.js +0 -53
  5. package/dist/build.esm.js +0 -53
  6. package/types/database/Database.d.ts +0 -162
  7. package/types/database/Model.d.ts +0 -221
  8. package/types/database/index.d.ts +0 -4
  9. package/types/database/loadModels.d.ts +0 -6
  10. package/types/exceptions/ApiError.d.ts +0 -29
  11. package/types/exceptions/index.d.ts +0 -2
  12. package/types/handlebars_helpers/comparison.d.ts +0 -302
  13. package/types/handlebars_helpers/html.d.ts +0 -11
  14. package/types/handlebars_helpers/index.d.ts +0 -5
  15. package/types/handlebars_helpers/object.d.ts +0 -21
  16. package/types/handlebars_helpers/string.d.ts +0 -12
  17. package/types/index.d.ts +0 -9
  18. package/types/interfaces/AuthenticationOptions.d.ts +0 -84
  19. package/types/interfaces/BoundingBox.d.ts +0 -25
  20. package/types/interfaces/Config.d.ts +0 -66
  21. package/types/interfaces/DatabaseOptions.d.ts +0 -7
  22. package/types/interfaces/FaceMatch.d.ts +0 -31
  23. package/types/interfaces/RekognitionOptions.d.ts +0 -26
  24. package/types/interfaces/ViewOptions.d.ts +0 -30
  25. package/types/interfaces/index.d.ts +0 -8
  26. package/types/middlewares/Authentication.d.ts +0 -16
  27. package/types/middlewares/CORS.d.ts +0 -16
  28. package/types/middlewares/Environment.d.ts +0 -17
  29. package/types/middlewares/ErrorHandling.d.ts +0 -16
  30. package/types/middlewares/Global.d.ts +0 -13
  31. package/types/middlewares/Http.d.ts +0 -16
  32. package/types/middlewares/Local.d.ts +0 -20
  33. package/types/middlewares/View.d.ts +0 -16
  34. package/types/middlewares/index.d.ts +0 -8
  35. package/types/mount.d.ts +0 -7
  36. package/types/package.d.ts +0 -91
  37. package/types/routing/Router.d.ts +0 -19
  38. package/types/routing/index.d.ts +0 -2
  39. package/types/services/AWSRekognitionClient.d.ts +0 -359
  40. package/types/services/Authentication.d.ts +0 -39
  41. package/types/services/RedisClient.d.ts +0 -80
  42. package/types/services/index.d.ts +0 -3
  43. package/types/utils/Types.d.ts +0 -16
  44. package/types/utils/index.d.ts +0 -2
package/CHANGELOG.md CHANGED
@@ -1,173 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- ## [1.0.14] - 2022-01-17
6
- - empty view helper can now check any type. Previously I could only check arrays.
7
- ```html
8
- // If the value is an array.
9
- let value = [5, 6];
10
- {{empty value}} => false
11
-
12
- {{#if (empty value)}}
13
- Hello
14
- {{/if}}
15
-
16
- // If the value is a string.
17
- let value = 'Hello';
18
- {{empty value}} => false
19
-
20
- let value = '';
21
- {{empty value}} => true
22
-
23
- let value = ' ';
24
- {{empty value}} => true
25
- ```
26
-
27
- - Added not_empty view helper.
28
- ```html
29
- // If the value is an array.
30
- let value = [5, 6];
31
- {{not_empty value}} => true
32
-
33
- {{#if (not_empty value)}}
34
- Hello
35
- {{/if}}
36
-
37
- // If the value is a string.
38
- let value = 'Hello';
39
- {{not_empty value}} => true
40
-
41
- let value = '';
42
- {{not_empty value}} => false
43
-
44
- let value = ' ';
45
- {{not_empty value}} => false
46
- ```
47
-
48
- ## [1.0.13] - 2021-12-13
49
- ### Fixed
50
- - The model's begin method now accepts the transaction option.
51
- See [Transaction | Sequelize](https://sequelize.org/master/class/lib/transaction.js~Transaction.html) for transaction options.
52
- ```js
53
- let transaction;
54
- try {
55
- transaction = await BookModel.begin({
56
- isolationLevel: BookModel.Transaction.ISOLATION_LEVELS.REPEATABLE_READ,
57
- type: BookModel.Transaction.TYPES.DEFERRED,
58
- });
59
- const book = await BookModel.findOne({where: {id: 1}}, {transaction});
60
- book.title = 'When Im Gone';
61
- await book.save({transaction});
62
- await transaction.commit();
63
-
64
- // Check the update result.
65
- // Output: New title of book: When Im Gone
66
- await book.reload();
67
- console.log(`New title of book: ${book.title}`);
68
- } catch (err) {
69
- if (transaction)
70
- await transaction.rollback();
71
- }
72
- ```
73
-
74
- ## [1.0.12] - 2021-11-16
75
- ### Fixed
76
- - Added a method to the model that can execute raw SQL.
77
- 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.
78
-
79
- ```js
80
- // By default the function will return two arguments - a results array, and an object containing metadata (such as amount of affected rows, etc).
81
- // Note that since this is a raw query, the metadata are dialect specific.
82
- const [results, metadata] = await BookModel.query("UPDATE book SET title = 'When Im Gone' WHERE id = 1");
83
-
84
- // 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:
85
- // We didn't need to destructure the result here - the results were returned directly
86
- const users = await BookModel.query("SELECT * FROM book", {type: BookModel.QueryTypes.SELECT});
87
- ```
88
-
89
- ## [1.0.11] - 2021-11-10
90
- ### Fixed
91
- - 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.
92
-
93
- ## [1.0.10] - 2021-10-19
94
- ### Fixed
95
- - Added face similarity found to face search results in collection.
96
-
97
- ```js
98
- import * as sweet from 'express-sweet';
99
-
100
- // Find a face from the collection.
101
- // Output: Face search results: [
102
- // {
103
- // faceId: '385e1b00-4ede-4219-a7b0-0b9cbe4953e5',
104
- // boundingBox: {
105
- // width: 0.3204210102558136,
106
- // height: 1.0046900510787964,
107
- // left: 0.39145898818969727,
108
- // top: 0.07936319708824158
109
- // },
110
- // similarity: 99.98941802978516
111
- // }
112
- // ]
113
- const collectionId = 'MyCollection';
114
- const res = await client.searchFaces(collectionId, 'img/face.jpg');
115
- console.log('Face search results:', res);
116
- ```
117
-
118
- ## [1.0.9] - 2021-10-13
119
- ### Fixed
120
- - Updated dependent package'sharp'from 0.25.4 to 0.29.1.
121
- This update statically links sharp's pre-built libvips binaries, eliminating the need to install Phton.
122
- Click [here](https://sharp.pixelplumbing.com/changelog) for sharp change log.
123
-
124
- ## [1.0.8] - 2021-09-25
125
- ### Fixed
126
- - Fixed a bug where the default router couldn't aqua from the endpoint URL.
127
-
128
- ## [1.0.7] - 2021-08-13
129
- ### Fixed
130
- - Added where member functions to Model class. Please see [here](https://takuya-motoshima.github.io/express-sweet/#model-class) for details.
131
-
132
- ## [1.0.6] - 2021-08-13
133
- ### Fixed
134
- - Added fn, col and literal member functions to Model class. Please see [here](https://takuya-motoshima.github.io/express-sweet/#model-class) for details.
135
-
136
- ## [1.0.5] - 2021-08-12
137
- ### Fixed
138
- - Changed the maximum size per field for multipart (multipart/form-data) requests from 1MB to unlimited.
139
-
140
- ## [1.0.4] - 2021-06-13
141
- ### Fixed
142
- - Fixed a bug where the referrer URL was set in app.locals.currentPath instead of the current URL.
143
-
144
- ## [1.0.3] - 2021-06-13
145
- ### Fixed
146
- - 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.
147
-
148
- ```js
149
- // For example, when the current URL is "https://example.com/docs/api?q=value", "/docs/api" is set for "app.locals.currentPath".
150
- console.log(app.locals.currentPath);
151
- ```
152
-
153
- ## [1.0.2] - 2021-06-10
154
- ### Fixed
155
- - Updated rollup from version 2.44 to 2.51.
156
- - Fixed a bug where preloading models failed in cjs.
157
-
158
- ## [1.0.1] - 2021-06-02
159
- ### Fixed
160
- - Fixed a bug that caused an error when reading options defined in ESM's default Export.
161
-
162
- [1.0.1]: https://github.com/takuya-motoshima/express-sweet/commit/bd6bf98b7e12f3daca834610b2cb7ad4997ec868
163
- [1.0.2]: https://github.com/takuya-motoshima/express-sweet/commit/8f7fba9d4875661a02f74327f3ec2298ce76290d
164
- [1.0.3]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.2...v1.0.3
165
- [1.0.4]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.3...v1.0.4
166
- [1.0.5]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.4...v1.0.5
167
- [1.0.6]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.5...v1.0.6
168
- [1.0.7]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.6...v1.0.7
169
- [1.0.8]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.7...v1.0.8
170
- [1.0.9]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.8...v1.0.9
171
- [1.0.10]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.9...v1.0.10
172
- [1.0.11]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.10...v1.0.11
173
- [1.0.12]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.11...v1.0.12
package/docs/index.html CHANGED
@@ -923,6 +923,9 @@ module.exports = {
923
923
  You can use the <code>"allow_unauthenticated"</code> option to disable this behavior on certain requests.<br>
924
924
  For example, if you don’t want to authenticate all requests that contain "api" in the URL, set <code>"allow_unauthenticated"</code> as follows.
925
925
  <pre><code class="js">allow_unauthenticated: [&#039;/api&#039;]</code></pre>
926
+
927
+ You can also use regular expressions.
928
+ <pre><code class="js">allow_unauthenticated: [/^\/api/]</code></pre>
926
929
  </td>
927
930
  </tr>
928
931
  <tr>
@@ -1008,7 +1011,7 @@ export default {
1008
1011
 
1009
1012
  /**
1010
1013
  * URL without authentication. If the URL described in the access URL partially matches, authentication will not be performed, defaults to none.
1011
- * @type {string}
1014
+ * @type {(string|RegExp)[]}
1012
1015
  */
1013
1016
  allow_unauthenticated: [&#039;/api&#039;],
1014
1017
 
@@ -1082,7 +1085,7 @@ module.exports = {
1082
1085
 
1083
1086
  /**
1084
1087
  * URL without authentication. If the URL described in the access URL partially matches, authentication will not be performed, defaults to none.
1085
- * @type {string}
1088
+ * @type {(string|RegExp)[]}
1086
1089
  */
1087
1090
  allow_unauthenticated: [&#039;/api&#039;],
1088
1091
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-sweet",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "Extend Express functionality with Express Sweet and start developing fast, minimal web applications.",
5
5
  "main": "dist/build.common.js",
6
6
  "module": "dist/build.esm.js",