express-sweet 1.0.40 → 1.0.42

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 (66) hide show
  1. package/CHANGELOG.md +72 -6
  2. package/INSTALL-Redis.md +65 -39
  3. package/README.md +7 -0
  4. package/dist/build.common.js +66 -19
  5. package/dist/build.esm.js +66 -19
  6. package/docs/index.html +11 -3
  7. package/package.json +12 -20
  8. package/types/database/Database.d.ts +181 -181
  9. package/types/database/Model.d.ts +221 -221
  10. package/types/database/index.d.ts +3 -4
  11. package/types/database/loadModels.d.ts +6 -6
  12. package/types/exceptions/FaceCollectionCreateFailed.d.ts +25 -25
  13. package/types/exceptions/FaceCollectionDeleteFailed.d.ts +25 -25
  14. package/types/exceptions/FaceIndexFailed.d.ts +20 -20
  15. package/types/exceptions/FaceMissingInPhoto.d.ts +11 -11
  16. package/types/exceptions/FacesMultipleInPhoto.d.ts +11 -11
  17. package/types/exceptions/index.d.ts +5 -6
  18. package/types/handlebars_helpers/comparison.d.ts +351 -351
  19. package/types/handlebars_helpers/date.d.ts +19 -19
  20. package/types/handlebars_helpers/html.d.ts +12 -12
  21. package/types/handlebars_helpers/index.d.ts +7 -8
  22. package/types/handlebars_helpers/math.d.ts +81 -81
  23. package/types/handlebars_helpers/number.d.ts +18 -18
  24. package/types/handlebars_helpers/object.d.ts +21 -21
  25. package/types/handlebars_helpers/string.d.ts +50 -50
  26. package/types/index.d.ts +7 -8
  27. package/types/interfaces/AuthenticationConfig.d.ts +108 -108
  28. package/types/interfaces/BasicConfig.d.ts +74 -74
  29. package/types/interfaces/BoundingBox.d.ts +25 -25
  30. package/types/interfaces/DatabaseConfig.d.ts +7 -7
  31. package/types/interfaces/FaceDetails.d.ts +30 -0
  32. package/types/interfaces/FaceDetailsEmotions.d.ts +40 -40
  33. package/types/interfaces/FaceMatch.d.ts +31 -31
  34. package/types/interfaces/IndexFaceDetails.d.ts +29 -0
  35. package/types/interfaces/RekognitionOptions.d.ts +26 -26
  36. package/types/interfaces/SesOptions.d.ts +27 -27
  37. package/types/interfaces/ViewConfig.d.ts +44 -44
  38. package/types/interfaces/index.d.ts +8 -9
  39. package/types/middlewares/Authentication.d.ts +13 -13
  40. package/types/middlewares/CORS.d.ts +10 -10
  41. package/types/middlewares/Environment.d.ts +10 -10
  42. package/types/middlewares/ErrorHandler.d.ts +10 -10
  43. package/types/middlewares/Global.d.ts +13 -13
  44. package/types/middlewares/Http.d.ts +10 -10
  45. package/types/middlewares/Local.d.ts +13 -13
  46. package/types/middlewares/View.d.ts +14 -14
  47. package/types/middlewares/index.d.ts +7 -8
  48. package/types/mount.d.ts +7 -7
  49. package/types/routing/Router.d.ts +13 -13
  50. package/types/routing/index.d.ts +1 -2
  51. package/types/services/AWSRekognitionClient.d.ts +126 -118
  52. package/types/services/AWSSesClient.d.ts +57 -57
  53. package/types/services/Authentication.d.ts +34 -34
  54. package/types/services/index.d.ts +3 -4
  55. package/types/utils/Types.d.ts +24 -24
  56. package/types/utils/index.d.ts +9 -12
  57. package/types/utils/isArray.d.ts +8 -8
  58. package/types/utils/isAsyncFunction.d.ts +12 -12
  59. package/types/utils/isFunction.d.ts +13 -13
  60. package/types/utils/isObject.d.ts +8 -8
  61. package/types/utils/isString.d.ts +8 -8
  62. package/types/utils/loadAuthenticationConfig.d.ts +8 -8
  63. package/types/utils/loadBasicConfig.d.ts +8 -8
  64. package/types/utils/loadDatabaseConfig.d.ts +8 -8
  65. package/types/utils/loadViewConfig.d.ts +8 -8
  66. package/types/services/RedisClient.d.ts +0 -80
@@ -1,26 +1,26 @@
1
- /**
2
- * AWS Rekognition Client Optional Interface.
3
- */
4
- export default interface {
5
- /**
6
- * Your AWS access key ID.
7
- * @type {string}
8
- */
9
- accessKeyId: string;
10
- /**
11
- * Your AWS secret access key.
12
- * @type {string}
13
- */
14
- secretAccessKey: string;
15
- /**
16
- * The region to send service requests to.
17
- * @type {string}
18
- */
19
- region: string;
20
- /**
21
- * Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds.
22
- * The default is 5000 milliseconds.
23
- * @type {number}
24
- */
25
- timeout?: number;
26
- }
1
+ /**
2
+ * Rekognition Client Optional Interface.
3
+ */
4
+ export default interface RekognitionOptions {
5
+ /**
6
+ * Your AWS access key ID.
7
+ * @type {string}
8
+ */
9
+ accessKeyId: string;
10
+ /**
11
+ * Your AWS secret access key.
12
+ * @type {string}
13
+ */
14
+ secretAccessKey: string;
15
+ /**
16
+ * The region to send service requests to.
17
+ * @type {string}
18
+ */
19
+ region: string;
20
+ /**
21
+ * Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds.
22
+ * The default is 5000 milliseconds.
23
+ * @type {number}
24
+ */
25
+ timeout?: number;
26
+ }
@@ -1,27 +1,27 @@
1
- /**
2
- * AWS SES Client Optional Interface.
3
- */
4
- export default interface {
5
- /**
6
- * API version in YYYYY-MM-DD format (or date).
7
- * Specify 'latest' to use the latest possible version.
8
- * The default is 'latest'.
9
- * @type {string}
10
- */
11
- apiVersion: string;
12
- /**
13
- * The region to send service requests to.
14
- * @type {string}
15
- */
16
- region: string;
17
- /**
18
- * Your AWS access key ID.
19
- * @type {string}
20
- */
21
- accessKeyId: string;
22
- /**
23
- * Your AWS secret access key.
24
- * @type {string}
25
- */
26
- secretAccessKey: string;
27
- }
1
+ /**
2
+ * AWS SES Client Optional Interface.
3
+ */
4
+ export default interface SesOptions {
5
+ /**
6
+ * API version in YYYYY-MM-DD format (or date).
7
+ * Specify 'latest' to use the latest possible version.
8
+ * The default is 'latest'.
9
+ * @type {string}
10
+ */
11
+ apiVersion: string;
12
+ /**
13
+ * The region to send service requests to.
14
+ * @type {string}
15
+ */
16
+ region: string;
17
+ /**
18
+ * Your AWS access key ID.
19
+ * @type {string}
20
+ */
21
+ accessKeyId: string;
22
+ /**
23
+ * Your AWS secret access key.
24
+ * @type {string}
25
+ */
26
+ secretAccessKey: string;
27
+ }
@@ -1,44 +1,44 @@
1
- import express from 'express';
2
- /**
3
- * View's configuration interface.
4
- */
5
- export default interface {
6
- /**
7
- * Absolute path to the directory where the view files are located, defaults to `<application root directory>/views`.
8
- * @type {string}
9
- */
10
- views_dir?: string;
11
- /**
12
- * Path to partials templates, one or several directories, defaults to `<application root directory>/views/partials`.
13
- * @type {string|string[]}
14
- */
15
- partials_dir?: string | string[];
16
- /**
17
- * Path to layout templates, defaults to `<application root directory>/views/layout`.
18
- * @type {string}
19
- */
20
- layouts_dir?: string;
21
- /**
22
- * Absolute path to default layout template. defaults to `<application root directory>/views/layout/default.hbs`.
23
- * @type {string}
24
- */
25
- default_layout?: string;
26
- /**
27
- * Extension for templates & partials, defaults to `.hbs`,
28
- * @type {string}
29
- */
30
- extension?: string;
31
- /**
32
- * Hook function just before the view is rendered.
33
- * For example, you can set your own local variables that can be used within the view.
34
- *
35
- * @example
36
- * // The message set here can be referenced in the view as {{message}}.
37
- * beforeRender: (req, res) => {
38
- * res.locals.message = 'Hello World';
39
- * }
40
- *
41
- * @type {(res: express.Response) => Promise<void>|void}
42
- */
43
- beforeRender?: (req: express.Request, res: express.Response) => Promise<void> | void;
44
- }
1
+ import express from 'express';
2
+ /**
3
+ * View's configuration interface.
4
+ */
5
+ export default interface SesOptions {
6
+ /**
7
+ * Absolute path to the directory where the view files are located, defaults to `<application root directory>/views`.
8
+ * @type {string}
9
+ */
10
+ views_dir?: string;
11
+ /**
12
+ * Path to partials templates, one or several directories, defaults to `<application root directory>/views/partials`.
13
+ * @type {string|string[]}
14
+ */
15
+ partials_dir?: string | string[];
16
+ /**
17
+ * Path to layout templates, defaults to `<application root directory>/views/layout`.
18
+ * @type {string}
19
+ */
20
+ layouts_dir?: string;
21
+ /**
22
+ * Absolute path to default layout template. defaults to `<application root directory>/views/layout/default.hbs`.
23
+ * @type {string}
24
+ */
25
+ default_layout?: string;
26
+ /**
27
+ * Extension for templates & partials, defaults to `.hbs`,
28
+ * @type {string}
29
+ */
30
+ extension?: string;
31
+ /**
32
+ * Hook function just before the view is rendered.
33
+ * For example, you can set your own local variables that can be used within the view.
34
+ *
35
+ * @example
36
+ * // The message set here can be referenced in the view as {{message}}.
37
+ * beforeRender: (req, res) => {
38
+ * res.locals.message = 'Hello World';
39
+ * }
40
+ *
41
+ * @type {(res: express.Response) => Promise<void>|void}
42
+ */
43
+ beforeRender?: (req: express.Request, res: express.Response) => Promise<void> | void;
44
+ }
@@ -1,9 +1,8 @@
1
- import AuthenticationConfig from '~/interfaces/AuthenticationConfig';
2
- import BasicConfig from '~/interfaces/BasicConfig';
3
- import DatabaseConfig from '~/interfaces/DatabaseConfig';
4
- import FaceMatch from '~/interfaces/FaceMatch';
5
- import BoundingBox from '~/interfaces/BoundingBox';
6
- import RekognitionOptions from '~/interfaces/RekognitionOptions';
7
- import SesOptions from '~/interfaces/SesOptions';
8
- import ViewConfig from '~/interfaces/ViewConfig';
9
- export { AuthenticationConfig, BasicConfig, DatabaseConfig, FaceMatch, BoundingBox, RekognitionOptions, SesOptions, ViewConfig };
1
+ export { default as AuthenticationConfig } from '~/interfaces/AuthenticationConfig';
2
+ export { default as BasicConfig } from '~/interfaces/BasicConfig';
3
+ export { default as DatabaseConfig } from '~/interfaces/DatabaseConfig';
4
+ export { default as FaceMatch } from '~/interfaces/FaceMatch';
5
+ export { default as BoundingBox } from '~/interfaces/BoundingBox';
6
+ export { default as RekognitionOptions } from '~/interfaces/RekognitionOptions';
7
+ export { default as SesOptions } from '~/interfaces/SesOptions';
8
+ export { default as ViewConfig } from '~/interfaces/ViewConfig';
@@ -1,13 +1,13 @@
1
- import express from 'express';
2
- /**
3
- * Incorporate user authentication into your application.
4
- * If an unauthenticated user makes a request to a URL that allows access only if authenticated, the user will be redirected to the page specified by "failure_redirect".
5
- * If that access is asynchronous, a 401 error is returned.
6
- */
7
- export default class {
8
- #private;
9
- /**
10
- * Mount on application.
11
- */
12
- static mount(app: express.Express): undefined;
13
- }
1
+ import express from 'express';
2
+ /**
3
+ * Incorporate user authentication into your application.
4
+ * If an unauthenticated user makes a request to a URL that allows access only if authenticated, the user will be redirected to the page specified by "failure_redirect".
5
+ * If that access is asynchronous, a 401 error is returned.
6
+ */
7
+ export default class {
8
+ #private;
9
+ /**
10
+ * Mount on application.
11
+ */
12
+ static mount(app: express.Express): undefined;
13
+ }
@@ -1,10 +1,10 @@
1
- import express from 'express';
2
- /**
3
- * Enables the CORS.
4
- */
5
- export default class {
6
- /**
7
- * Mount on application.
8
- */
9
- static mount(app: express.Express): void;
10
- }
1
+ import express from 'express';
2
+ /**
3
+ * Enables the CORS.
4
+ */
5
+ export default class {
6
+ /**
7
+ * Mount on application.
8
+ */
9
+ static mount(app: express.Express): void;
10
+ }
@@ -1,10 +1,10 @@
1
- /**
2
- * Set environment variables.
3
- * Read the environment variable file in options.path and set it in "process.env".
4
- */
5
- export default class {
6
- /**
7
- * Mount on application.
8
- */
9
- static mount(): void;
10
- }
1
+ /**
2
+ * Set environment variables.
3
+ * Read the environment variable file in options.path and set it in "process.env".
4
+ */
5
+ export default class {
6
+ /**
7
+ * Mount on application.
8
+ */
9
+ static mount(): void;
10
+ }
@@ -1,10 +1,10 @@
1
- import express from 'express';
2
- /**
3
- * Error handling.
4
- */
5
- export default class {
6
- /**
7
- * Mount on application.
8
- */
9
- static mount(app: express.Express): void;
10
- }
1
+ import express from 'express';
2
+ /**
3
+ * Error handling.
4
+ */
5
+ export default class {
6
+ /**
7
+ * Mount on application.
8
+ */
9
+ static mount(app: express.Express): void;
10
+ }
@@ -1,13 +1,13 @@
1
- /**
2
- * Set global variables.
3
- * It can be accessed like "global.xxx" in all router and model classes.
4
- *
5
- * Below is a description of the variables.
6
- * APP_DIR: The directory where app.js is located.
7
- */
8
- export default class {
9
- /**
10
- * Mount on application.
11
- */
12
- static mount(): void;
13
- }
1
+ /**
2
+ * Set global variables.
3
+ * It can be accessed like "global.xxx" in all router and model classes.
4
+ *
5
+ * Below is a description of the variables.
6
+ * APP_DIR: The directory where app.js is located.
7
+ */
8
+ export default class {
9
+ /**
10
+ * Mount on application.
11
+ */
12
+ static mount(): void;
13
+ }
@@ -1,10 +1,10 @@
1
- import express from 'express';
2
- /**
3
- * Defines all the requisites in HTTP.
4
- */
5
- export default class {
6
- /**
7
- * Mount on application.
8
- */
9
- static mount(app: express.Express): void;
10
- }
1
+ import express from 'express';
2
+ /**
3
+ * Defines all the requisites in HTTP.
4
+ */
5
+ export default class {
6
+ /**
7
+ * Mount on application.
8
+ */
9
+ static mount(app: express.Express): void;
10
+ }
@@ -1,13 +1,13 @@
1
- import express from 'express';
2
- /**
3
- * Set local variables.
4
- * It can be accessed in all views as {{var}} or {{{var}}}.
5
- * Below is a description of the variables.
6
- * baseUrl: The base URL for this application.
7
- */
8
- export default class {
9
- /**
10
- * Mount on application.
11
- */
12
- static mount(app: express.Express): void;
13
- }
1
+ import express from 'express';
2
+ /**
3
+ * Set local variables.
4
+ * It can be accessed in all views as {{var}} or {{{var}}}.
5
+ * Below is a description of the variables.
6
+ * baseUrl: The base URL for this application.
7
+ */
8
+ export default class {
9
+ /**
10
+ * Mount on application.
11
+ */
12
+ static mount(app: express.Express): void;
13
+ }
@@ -1,14 +1,14 @@
1
- import express from 'express';
2
- /**
3
- * Enable Handlebars template engine.
4
- */
5
- export default class {
6
- /**
7
- * Mount on application.
8
- */
9
- static mount(app: express.Express): void;
10
- /**
11
- * Mount middleware to be executed just before drawing the view.
12
- */
13
- static mountBeforeRender(app: express.Express): void;
14
- }
1
+ import express from 'express';
2
+ /**
3
+ * Enable Handlebars template engine.
4
+ */
5
+ export default class {
6
+ /**
7
+ * Mount on application.
8
+ */
9
+ static mount(app: express.Express): void;
10
+ /**
11
+ * Mount middleware to be executed just before drawing the view.
12
+ */
13
+ static mountBeforeRender(app: express.Express): void;
14
+ }
@@ -1,8 +1,7 @@
1
- import CORS from '~/middlewares/CORS';
2
- import Environment from '~/middlewares/Environment';
3
- import Global from '~/middlewares/Global';
4
- import Http from '~/middlewares/Http';
5
- import Local from '~/middlewares/Local';
6
- import View from '~/middlewares/View';
7
- import ErrorHandler from '~/middlewares/ErrorHandler';
8
- export { CORS, Environment, Global, Http, Local, View, ErrorHandler, };
1
+ export { default as CORS } from '~/middlewares/CORS';
2
+ export { default as Environment } from '~/middlewares/Environment';
3
+ export { default as Global } from '~/middlewares/Global';
4
+ export { default as Http } from '~/middlewares/Http';
5
+ export { default as Local } from '~/middlewares/Local';
6
+ export { default as View } from '~/middlewares/View';
7
+ export { default as ErrorHandler } from '~/middlewares/ErrorHandler';
package/types/mount.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import express from 'express';
2
- /**
3
- * Mount extensions on your application.
4
- *
5
- * @param {express.Express} app Express application instance
6
- */
7
- export default function (app: express.Express): void;
1
+ import express from 'express';
2
+ /**
3
+ * Mount extensions on your application.
4
+ *
5
+ * @param {express.Express} app Express application instance
6
+ */
7
+ export default function (app: express.Express): void;
@@ -1,13 +1,13 @@
1
- import express from 'express';
2
- /**
3
- * Set up URL routing.
4
- *
5
- * Define URL routing based on the path of the file in the routes directory.
6
- * For example, if you have "routes/api/users.js", you can request the method in "user.js (ts)" with the base URL as "https:////api/users".
7
- */
8
- export default class {
9
- /**
10
- * Mount on application.
11
- */
12
- static mount(app: express.Express): void;
13
- }
1
+ import express from 'express';
2
+ /**
3
+ * Set up URL routing.
4
+ *
5
+ * Define URL routing based on the path of the file in the routes directory.
6
+ * For example, if you have "routes/api/users.js", you can request the method in "user.js (ts)" with the base URL as "https:////api/users".
7
+ */
8
+ export default class {
9
+ /**
10
+ * Mount on application.
11
+ */
12
+ static mount(app: express.Express): void;
13
+ }
@@ -1,2 +1 @@
1
- import Router from '~/routing/Router';
2
- export { Router };
1
+ export { default as Router } from '~/routing/Router';