express-sweet 1.0.15 → 1.0.16

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 (43) hide show
  1. package/CHANGELOG.md +186 -0
  2. package/dist/build.common.js +53 -0
  3. package/dist/build.esm.js +53 -0
  4. package/package.json +1 -1
  5. package/types/database/Database.d.ts +162 -0
  6. package/types/database/Model.d.ts +221 -0
  7. package/types/database/index.d.ts +4 -0
  8. package/types/database/loadModels.d.ts +6 -0
  9. package/types/exceptions/ApiError.d.ts +29 -0
  10. package/types/exceptions/index.d.ts +2 -0
  11. package/types/handlebars_helpers/comparison.d.ts +302 -0
  12. package/types/handlebars_helpers/html.d.ts +11 -0
  13. package/types/handlebars_helpers/index.d.ts +5 -0
  14. package/types/handlebars_helpers/object.d.ts +21 -0
  15. package/types/handlebars_helpers/string.d.ts +12 -0
  16. package/types/index.d.ts +9 -0
  17. package/types/interfaces/AuthenticationOptions.d.ts +84 -0
  18. package/types/interfaces/BoundingBox.d.ts +25 -0
  19. package/types/interfaces/Config.d.ts +66 -0
  20. package/types/interfaces/DatabaseOptions.d.ts +7 -0
  21. package/types/interfaces/FaceMatch.d.ts +31 -0
  22. package/types/interfaces/RekognitionOptions.d.ts +26 -0
  23. package/types/interfaces/ViewOptions.d.ts +30 -0
  24. package/types/interfaces/index.d.ts +8 -0
  25. package/types/middlewares/Authentication.d.ts +16 -0
  26. package/types/middlewares/CORS.d.ts +16 -0
  27. package/types/middlewares/Environment.d.ts +17 -0
  28. package/types/middlewares/ErrorHandling.d.ts +16 -0
  29. package/types/middlewares/Global.d.ts +13 -0
  30. package/types/middlewares/Http.d.ts +16 -0
  31. package/types/middlewares/Local.d.ts +20 -0
  32. package/types/middlewares/View.d.ts +16 -0
  33. package/types/middlewares/index.d.ts +8 -0
  34. package/types/mount.d.ts +7 -0
  35. package/types/package.d.ts +91 -0
  36. package/types/routing/Router.d.ts +19 -0
  37. package/types/routing/index.d.ts +2 -0
  38. package/types/services/AWSRekognitionClient.d.ts +359 -0
  39. package/types/services/Authentication.d.ts +39 -0
  40. package/types/services/RedisClient.d.ts +80 -0
  41. package/types/services/index.d.ts +3 -0
  42. package/types/utils/Types.d.ts +16 -0
  43. package/types/utils/index.d.ts +2 -0
@@ -0,0 +1,302 @@
1
+ /**
2
+ * Determine whether or not two values are equal (===).
3
+ *
4
+ * @example
5
+ * {{eq '3' 3}} => false
6
+ *
7
+ * {{#if (eqw foo 'bar')}}
8
+ * Hello
9
+ * {{/if}}
10
+ *
11
+ * @param {any} value1 First value to be compared with second.
12
+ * @param {any} value2 Second value to be compared with first.
13
+ * @returns {boolean} Returns true if the value and type are the same, false if they are different.
14
+ */
15
+ export declare function eq(value1: any, value2: any): boolean;
16
+ /**
17
+ * Determine whether or not two values are equal (==) i.e weak checking.
18
+ *
19
+ * @example
20
+ * {{eqw '3' 3}} => true
21
+ *
22
+ * {{#if (eqw foo 'bar')}}
23
+ * Hello
24
+ * {{/if}}
25
+ *
26
+ * @param {any} value1 First value to be compared with second.
27
+ * @param {any} value2 Second value to be compared with first.
28
+ * @returns {boolean} Returns true if the values are the same, false if they are different.
29
+ */
30
+ export declare function eqw(value1: any, value2: any): boolean;
31
+ /**
32
+ * Determine whether or not two values are not equal (!==).
33
+ *
34
+ * @example
35
+ * {{neq 4 3}} => true
36
+ *
37
+ * {{#if (neq foo 'bar')}}
38
+ * Hello
39
+ * {{/if}}
40
+ *
41
+ * @param {any} value1 First value to be compared with second.
42
+ * @param {any} value2 Second value to be compared with first.
43
+ * @returns {boolean} Returns true if the value and type are different, false if they are the same.
44
+ */
45
+ export declare function neq(value1: any, value2: any): boolean;
46
+ /**
47
+ * Determine whether or not two values are not equal (!=) weak checking.
48
+ *
49
+ * @example
50
+ * {{neqw '3' 3}} => false
51
+ *
52
+ * {{#if (neqw foo 'bar')}}
53
+ * Hello
54
+ * {{/if}}
55
+ *
56
+ * @param {any} value1 First value to be compared with second.
57
+ * @param {any} value2 Second value to be compared with first.
58
+ * @returns {boolean} Returns true if the values are different, false if they are the same.
59
+ */
60
+ export declare function neqw(value1: any, value2: any): boolean;
61
+ /**
62
+ * Check for less than condition (a < b).
63
+ *
64
+ * @example
65
+ * {{lt 2 3}} => true
66
+ *
67
+ * {{#if (lt 2 5)}}
68
+ * Hello
69
+ * {{/if}}
70
+ *
71
+ * @param {any} value1 First value to be compared with second.
72
+ * @param {any} value2 Second value to be compared with first.
73
+ * @returns {boolean} Returns true if the first value is less than the second value, false otherwise.
74
+ */
75
+ export declare function lt(value1: any, value2: any): boolean;
76
+ /**
77
+ * Check for less than or equals condition (a <= b).
78
+ *
79
+ * @example
80
+ * {{lte 2 3}} => true
81
+ *
82
+ * {{#if (lte 2 5)}}
83
+ * Hello
84
+ * {{/if}}
85
+ *
86
+ * @param {any} value1 First value to be compared with second.
87
+ * @param {any} value2 Second value to be compared with first.
88
+ * @returns {boolean} Returns true if the first value is less than or equal to the second value, false otherwise.
89
+ */
90
+ export declare function lte(value1: any, value2: any): boolean;
91
+ /**
92
+ * Check for greater than condition (a > b).
93
+ *
94
+ * @example
95
+ * {{gt 2 3}} => false
96
+ *
97
+ * {{#if (gt 5 6)}}
98
+ * Hello
99
+ * {{/if}}
100
+ *
101
+ * @param {any} value1 First value to be compared with second.
102
+ * @param {any} value2 Second value to be compared with first.
103
+ * @returns {boolean} Returns true if the first value exceeds the second value, false otherwise.
104
+ */
105
+ export declare function gt(value1: any, value2: any): boolean;
106
+ /**
107
+ * Check for greater than or equals condition (a >= b).
108
+ *
109
+ * @example
110
+ * {{gte 3 3}} => true
111
+ *
112
+ * {{#if (gte 10 2)}}
113
+ * Hello
114
+ * {{/if}}
115
+ *
116
+ * @param {any} value1 First value to be compared with second.
117
+ * @param {any} value2 Second value to be compared with first.
118
+ * @returns {boolean} Returns true if the first value is greater than or equal to the second value, false otherwise.
119
+ */
120
+ export declare function gte(value1: any, value2: any): boolean;
121
+ /**
122
+ * Logical NOT of any expression.
123
+ *
124
+ * @example
125
+ * {{not true}} => false
126
+ * {{not false}} => true
127
+ *
128
+ * {{#if (not (eq foo 'bar'))}}
129
+ * Hello
130
+ * {{/if}}
131
+ *
132
+ * @param {any} expression Any expression.
133
+ * @returns {boolean} Returns the logical negation of the value.
134
+ */
135
+ export declare function not(expression: any): boolean;
136
+ /**
137
+ * Helper to imitate the ternary '?:' conditional operator.
138
+ *
139
+ * @example
140
+ * {{ifx true 'Foo' 'Bar'}} => Foo
141
+ * {{ifx false 'Foo' 'Bar'}} => Foo
142
+ * {{ifx (eq value 1) 5 6}} => 6 // return (value === 1) ? 5 : 6
143
+ * {{ifx (not (eq value 1)) 5 6}} => 6 // return (value !== 1) ? 5 : 6
144
+ *
145
+ * <!-- The third parameter is optional, and by default it will be blank string ('') -->
146
+ * {{ifx true 'active'}} => 'active'
147
+ * {{ifx false 'active'}} => ''
148
+ *
149
+ * @param {boolean} condition Satisfying condition for getting first value. Either true of false.
150
+ * @param {any} value1 First value to be displayed as result..
151
+ * @param {any} value2 Second value to be displayed as result. Defaults to an empty string.
152
+ * @returns {any} Returns the result of the ternary operator.
153
+ */
154
+ export declare function ifx(condition: boolean, value1: any, value2: any): any;
155
+ /**
156
+ * Check if it is empty.
157
+ * If the value is an array, returns true if there are no elements.
158
+ * If the value is a string, the leading and trailing spaces are trimmed and then checked.
159
+ *
160
+ * @example
161
+ * // If the value is an array.
162
+ * let value = [5, 6];
163
+ * {{empty value}} => false
164
+ *
165
+ * {{#if (empty value)}}
166
+ * Hello
167
+ * {{/if}}
168
+ *
169
+ * // If the value is a string.
170
+ * let value = 'Hello';
171
+ * {{empty value}} => false
172
+ *
173
+ * let value = '';
174
+ * {{empty value}} => true
175
+ *
176
+ * let value = ' ';
177
+ * {{empty value}} => true
178
+ *
179
+ * @param {any} value Character strings, arrays, objects, etc. to be checked.
180
+ * @returns {boolean} Returns true if the value is empty, false otherwise.
181
+ */
182
+ export declare function empty(value: any): boolean;
183
+ /**
184
+ * Check that it is not empty.
185
+ * If the value is an array, returns true if there is an element.
186
+ * If the value is a string, the leading and trailing spaces are trimmed and then checked.
187
+ *
188
+ * @example
189
+ * // If the value is an array.
190
+ * let value = [5, 6];
191
+ * {{not_empty value}} => true
192
+ *
193
+ * {{#if (not_empty value)}}
194
+ * Hello
195
+ * {{/if}}
196
+ *
197
+ * // If the value is a string.
198
+ * let value = 'Hello';
199
+ * {{not_empty value}} => true
200
+ *
201
+ * let value = '';
202
+ * {{not_empty value}} => false
203
+ *
204
+ * let value = ' ';
205
+ * {{not_empty value}} => false
206
+ *
207
+ * @param {any} value Character strings, arrays, objects, etc. to be checked.
208
+ * @returns {boolean} Returns true if the value is not empty, false otherwise.
209
+ */
210
+ export declare function not_empty(value: any): boolean;
211
+ /**
212
+ * Determine the length of an array.
213
+ *
214
+ * @example
215
+ * let items = [5, 6];
216
+ * {{count items}} => 2
217
+ *
218
+ * @param {any[]} items Array whose elements to be counted.
219
+ * @returns {number|false} Returns the length of the array if the value is an array, false if the value is not an array.
220
+ */
221
+ export declare function count(items: any[]): number | false;
222
+ /**
223
+ * Returns the boolean AND of two or more parameters passed i.e it is true iff all the parameters are true.
224
+ *
225
+ * @example
226
+ * let value1 = value2 = true;
227
+ * {{and value1 value2}} => true
228
+ *
229
+ * let value1 = false, value2 = true;
230
+ * {{and value1 value2}} => false
231
+ *
232
+ * {{#if (and value1 value2)}}
233
+ * // do something
234
+ * {{else}}
235
+ * // do something else
236
+ * {{/if}}
237
+ *
238
+ * @param {...any} params Any number of boolean parameters.
239
+ * @returns {boolean} Returns the result of the logical product.
240
+ */
241
+ export declare function and(...params: any[]): boolean;
242
+ /**
243
+ * Returns the boolean OR of two or more parameters passed i.e it is true if any of the parameters is true.
244
+ *
245
+ * @example
246
+ * let value1 = true, value2 = false;
247
+ * {{or value1 value2}} => true
248
+ *
249
+ * let value = value2 = false;
250
+ * {{or value1 value2}} => false
251
+ *
252
+ * {{#if (or value1 value2)}}
253
+ * // do something
254
+ * {{else}}
255
+ * // do something else
256
+ * {{/if}}
257
+ *
258
+ * @param {...any} params Any number of boolean parameters.
259
+ * @returns {boolean} Returns the result of the OR.
260
+ */
261
+ export declare function or(...params: any[]): boolean;
262
+ /**
263
+ * Returns the first non-falsy value from the parameter list.
264
+ * Works quite similar to the SQL's "COALESCE()" function, but unlike this checks for the first non-false parameter.
265
+ *
266
+ * @example
267
+ * let fullName = 'Foo Bar', nickName = 'foob';
268
+ * {{coalesce fullName nickName 'Unknown'}} => 'Foo Bar'
269
+ *
270
+ * let fullName = '', nickName = 'foob';
271
+ * {{coalesce fullName nickName 'Unknown'}} => 'foob'
272
+ *
273
+ * @param {...any} params Any number of parameters.
274
+ * @returns {any} Returns the first non-false element of the parameter.
275
+ */
276
+ export declare function coalesce(...params: any[]): any;
277
+ /**
278
+ * Returns boolean if the array contains the element strictly or non-strictly.
279
+ *
280
+ * @example
281
+ * let items = [1, 2, 3];
282
+ * let value = 2;
283
+ *
284
+ * {{includes items value}} => true
285
+ *
286
+ * let value = '2'
287
+ * {{includes items value}} => false
288
+ * {{includes items value true}} => false
289
+ * {{includes items value false}} => true
290
+ *
291
+ * {{#if (includes items value)}}
292
+ * <!-- Do something -->
293
+ * {{/if}}
294
+ *
295
+ * {{ifx (includes items value) 'Yes' 'No'}}
296
+ *
297
+ * @param {any[]} items The array.
298
+ * @param {any} value The value to be checked for existence in the array.
299
+ * @param {boolean} strict FALSE for non-strict checking. TRUE by default.
300
+ * @returns {boolean} Returns true if the array contains the specified value, false otherwise.
301
+ */
302
+ export declare function includes(items: any[], value: any, strict?: boolean): boolean;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Returns the Assets path containing the file update time parameter.
3
+ *
4
+ * @example
5
+ * {{cache_busting '/assets/style.css' '//example.com'}} => example.com/assets/style.css?1620526340463
6
+ *
7
+ * @param {string} filePath Paths of Assets files such as CSS and JS in public directories.
8
+ * @param {string} baseUrl Application Origin URL.
9
+ * @return {string} Returns the Assets file path with the update date and time parameters.
10
+ */
11
+ export declare function cache_busting(filePath: string, baseUrl: string): string;
@@ -0,0 +1,5 @@
1
+ import * as html from './html';
2
+ import * as object from './object';
3
+ import * as string from './string';
4
+ import * as comparison from './comparison';
5
+ export { html, object, string, comparison };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Stringify an object using JSON.stringify.
3
+ *
4
+ * @example
5
+ * {{json_stringify value}}
6
+ *
7
+ * @param {any} value The value to convert to a JSON string.
8
+ * @param {number} indent The number of space characters to use as whitespace.
9
+ * @return {string} A JSON string representing the given value, or undefined.
10
+ */
11
+ export declare function json_stringify(value: any, indent?: number | string): string | undefined;
12
+ /**
13
+ * Parses the given string using JSON.parse.
14
+ *
15
+ * @example
16
+ * {{json_parse value}}
17
+ *
18
+ * @param {any} value Object to stringify.
19
+ * @return {any} JavaScript value or object described by a string.
20
+ */
21
+ export declare function json_parse(value: any): any;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Returns a new string with some or all matches of a pattern replaced by a replacement.
3
+ *
4
+ * @example
5
+ * {{replace 'The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?' 'dog' 'monkey'}}
6
+ *
7
+ * @param {string} value String.
8
+ * @param {string} find The string to be replaced.
9
+ * @param {string} replace The string to replace.
10
+ * @return {string} Character string after replacement.
11
+ */
12
+ export declare function replace(value: string, find: string, replace: string): string;
@@ -0,0 +1,9 @@
1
+ import { version } from '~/package';
2
+ import mount from './mount';
3
+ import * as database from './database';
4
+ import * as services from './services';
5
+ import * as utils from './utils';
6
+ import * as middlewares from './middlewares';
7
+ import * as exceptions from './exceptions';
8
+ import * as interfaces from './interfaces';
9
+ export { version, mount, database, services, utils, middlewares, exceptions, interfaces };
@@ -0,0 +1,84 @@
1
+ /**
2
+ * User authentication configuration interface.
3
+ */
4
+ export default interface {
5
+ /**
6
+ * Enable user authentication, defaults to disabled (false).
7
+ * @type {boolean}
8
+ */
9
+ enabled: boolean;
10
+ /**
11
+ * Authentication user ID field name, defaults to `username`.
12
+ * @type {string}
13
+ */
14
+ username: string;
15
+ /**
16
+ * Authentication password field name, defaults to `password`.
17
+ * @type {string}
18
+ */
19
+ password: string;
20
+ /**
21
+ * URL to redirect after successful authentication, defaults to `/`.
22
+ * @type {string}
23
+ */
24
+ success_redirect: string;
25
+ /**
26
+ * URL to redirect after log off, defaults to `/login`.
27
+ * @type {string}
28
+ */
29
+ failure_redirect: string;
30
+ /**
31
+ * This hook is called when authenticating a user.
32
+ * Please find the user information that owns the credentials based on the user name and password you received and return it.
33
+ * If the user who owns the credentials cannot be found, return null.
34
+ *
35
+ * Note that the user information must include an ID value that can identify the user.
36
+ *
37
+ * @example
38
+ * authenticate_user: async (username, password) => {
39
+ * const UserModel = require('../models/UserModel');
40
+ * return UserModel.findOne({
41
+ * where: {
42
+ * email: username,
43
+ * password: password
44
+ * },
45
+ * raw: true
46
+ * });
47
+ * }
48
+ *
49
+ * @type {(username: string, password: string) => Promise<{[key: string]: any}|null>}
50
+ */
51
+ authenticate_user: (username: string, password: string) => Promise<{
52
+ [key: string]: any;
53
+ } | null>;
54
+ /**
55
+ * This hook is called when user authentication is successful.
56
+ * Please search and return the authenticated user information to be set in the session based on the user ID of the parameter.
57
+ * The returned data will be set in the req.user property and the view's session variable.
58
+ *
59
+ * @example
60
+ *
61
+ * subscribe_user: async (id) => {
62
+ * const UserModel = require('../models/UserModel');
63
+ * return UserModel.findOne({
64
+ * where: {id},
65
+ * raw: true
66
+ * });
67
+ * }
68
+ *
69
+ * @type {(id: number|string) => Promise<{[key: string]: any}>}
70
+ */
71
+ subscribe_user: (id: number | string) => Promise<{
72
+ [key: string]: any;
73
+ }>;
74
+ /**
75
+ * URL without authentication. If the URL described in the access URL partially matches, authentication will not be performed, defaults to none.
76
+ * @type {(string|RegExp)[]}
77
+ */
78
+ allow_unauthenticated: (string | RegExp)[];
79
+ /**
80
+ * Authenticated user session expiration, defaults to 24 hours (24 * 3600000).
81
+ * @type {number}
82
+ */
83
+ expiration: number;
84
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Bounding box interface for faces, labels, borders, etc.
3
+ */
4
+ export default interface {
5
+ /**
6
+ * The width of the bounding box.
7
+ * @type {number}
8
+ */
9
+ width: number;
10
+ /**
11
+ * The height of the bounding box.
12
+ * @type {number}
13
+ */
14
+ height: number;
15
+ /**
16
+ * The x coordinate of the bounding box with the origin (0,0) in the upper left corner.
17
+ * @type {number}
18
+ */
19
+ left: number;
20
+ /**
21
+ * The y coordinate of the bounding box with the origin (0,0) in the upper left corner.
22
+ * @type {number}
23
+ */
24
+ top: number;
25
+ }
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Express Sweet basic configuration interface.
3
+ */
4
+ export default interface {
5
+ /**
6
+ * Environment variable file (.env) path, defaults to none (undefined).
7
+ * @type {string}
8
+ */
9
+ env_path?: string;
10
+ /**
11
+ * CORS permission, defaults to invalid (false).
12
+ * @type {{enabled: boolean}}
13
+ */
14
+ cors_enabled?: boolean;
15
+ /**
16
+ * Maximum body size you can request, defaults to `100kb`.
17
+ * @type {string|number}
18
+ */
19
+ max_body_size?: string | number;
20
+ /**
21
+ * Absolute path to the router directory, defaults to `<application root directory>/routes`.
22
+ * @type {string}
23
+ */
24
+ router_dir?: string;
25
+ /**
26
+ * The endpoint to run when the root URL is requested, defaults to none (undefined).
27
+ * @type {string}
28
+ */
29
+ default_router?: string;
30
+ /**
31
+ * This is a hook that rewrites the base URL.
32
+ * If you want to rewrite the app.locals.baseUrl property and the view's baseUrl variable, use this hook to return a new base URL.
33
+ * The default value is the referrer's origin (eg https://example.com).
34
+ *
35
+ * @example
36
+ * rewrite_base_url: baseUrl => {
37
+ * return `${baseUrl}/admin`;
38
+ * }
39
+ *
40
+ * @type {(baseUrl: string): string}
41
+ */
42
+ rewrite_base_url?: (baseUrl: string) => string;
43
+ /**
44
+ * This is a hook for error handling.
45
+ * For example, you can use it when you want to send an external notification of the error received by this hook.
46
+ *
47
+ * @example
48
+ * error_handler: async err => {
49
+ * // Notify system administrator of error.
50
+ * return new Promise((resolve, reject) => {
51
+ * const sendmail = require('sendmail')();
52
+ * sendmail({
53
+ * from: 'no-reply@example.com',
54
+ * to: 'administrator@example.com',
55
+ * subject: 'Error occurred',
56
+ * text: err.message
57
+ * }, err => {
58
+ * err ? reject(err) : resolve();
59
+ * });
60
+ * });
61
+ * }
62
+ *
63
+ * @type {(err: any): void|Promise<void>}
64
+ */
65
+ error_handler?: (err: any) => void | Promise<void>;
66
+ }
@@ -0,0 +1,7 @@
1
+ import sequelize from 'sequelize';
2
+ /**
3
+ * Database configuration.
4
+ */
5
+ export default interface {
6
+ [key: string]: sequelize.Options;
7
+ }
@@ -0,0 +1,31 @@
1
+ import BoundingBox from './BoundingBox';
2
+ /**
3
+ * This is the metadata structure of the bounding box coordinates, reliability (the bounding box contains a face), face ID, etc. returned by the searchFaces(), listFaces() methods, etc.
4
+ */
5
+ export default interface {
6
+ /**
7
+ * A unique identifier assigned to the face.
8
+ * @type {string}
9
+ */
10
+ faceId: string;
11
+ /**
12
+ * Bounding box of the face.
13
+ * width : Width of the bounding box as a ratio of the overall image width.
14
+ * height : Height of the bounding box as a ratio of the overall image height.
15
+ * left : Left coordinate of the bounding box as a ratio of overall image width.
16
+ * top : Top coordinate of the bounding box as a ratio of overall image height.
17
+ * @type {BoundingBox}
18
+ */
19
+ boundingBox: BoundingBox;
20
+ /**
21
+ * Identifier that you assign to all the faces in the input image.
22
+ * @type {string}
23
+ */
24
+ externalImageId?: string;
25
+ /**
26
+ * Confidence in the match of this face with the input face.
27
+ * Valid Range: Minimum value of 0. Maximum value of 100.
28
+ * @type {number}
29
+ */
30
+ similarity?: number;
31
+ }
@@ -0,0 +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
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * View's configuration interface.
3
+ */
4
+ export default interface {
5
+ /**
6
+ * Absolute path to the directory where the view files are located, defaults to `<application root directory>/views`.
7
+ * @type {string}
8
+ */
9
+ views_dir?: string;
10
+ /**
11
+ * Path to partials templates, one or several directories, defaults to `<application root directory>/views/partials`.
12
+ * @type {string|string[]}
13
+ */
14
+ partials_dir?: string | string[];
15
+ /**
16
+ * Path to layout templates, defaults to `<application root directory>/views/layout`.
17
+ * @type {string}
18
+ */
19
+ layouts_dir?: string;
20
+ /**
21
+ * Absolute path to default layout template. defaults to `<application root directory>/views/layout/default.hbs`.
22
+ * @type {string}
23
+ */
24
+ default_layout?: string;
25
+ /**
26
+ * Extension for templates & partials, defaults to `.hbs`,
27
+ * @type {string}
28
+ */
29
+ extension?: string;
30
+ }
@@ -0,0 +1,8 @@
1
+ import AuthenticationOptions from './AuthenticationOptions';
2
+ import Config from './Config';
3
+ import DatabaseOptions from './DatabaseOptions';
4
+ import FaceMatch from './FaceMatch';
5
+ import BoundingBox from './BoundingBox';
6
+ import RekognitionOptions from './RekognitionOptions';
7
+ import ViewOptions from './ViewOptions';
8
+ export { AuthenticationOptions, Config, DatabaseOptions, FaceMatch, BoundingBox, RekognitionOptions, ViewOptions };
@@ -0,0 +1,16 @@
1
+ import express from 'express';
2
+ /**
3
+ * Incorporate user authentication into your application.
4
+ */
5
+ export default class {
6
+ /**
7
+ * Mount on application.
8
+ */
9
+ static mount(app: express.Express): void;
10
+ /**
11
+ * Returns the option.
12
+ *
13
+ * @return {AuthenticationOptions} option.
14
+ */
15
+ private static loadOptions;
16
+ }
@@ -0,0 +1,16 @@
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): undefined;
10
+ /**
11
+ * Returns the option.
12
+ *
13
+ * @return {Config} option.
14
+ */
15
+ private static loadOptions;
16
+ }