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.
- package/CHANGELOG.md +186 -0
- package/dist/build.common.js +53 -0
- package/dist/build.esm.js +53 -0
- package/package.json +1 -1
- package/types/database/Database.d.ts +162 -0
- package/types/database/Model.d.ts +221 -0
- package/types/database/index.d.ts +4 -0
- package/types/database/loadModels.d.ts +6 -0
- package/types/exceptions/ApiError.d.ts +29 -0
- package/types/exceptions/index.d.ts +2 -0
- package/types/handlebars_helpers/comparison.d.ts +302 -0
- package/types/handlebars_helpers/html.d.ts +11 -0
- package/types/handlebars_helpers/index.d.ts +5 -0
- package/types/handlebars_helpers/object.d.ts +21 -0
- package/types/handlebars_helpers/string.d.ts +12 -0
- package/types/index.d.ts +9 -0
- package/types/interfaces/AuthenticationOptions.d.ts +84 -0
- package/types/interfaces/BoundingBox.d.ts +25 -0
- package/types/interfaces/Config.d.ts +66 -0
- package/types/interfaces/DatabaseOptions.d.ts +7 -0
- package/types/interfaces/FaceMatch.d.ts +31 -0
- package/types/interfaces/RekognitionOptions.d.ts +26 -0
- package/types/interfaces/ViewOptions.d.ts +30 -0
- package/types/interfaces/index.d.ts +8 -0
- package/types/middlewares/Authentication.d.ts +16 -0
- package/types/middlewares/CORS.d.ts +16 -0
- package/types/middlewares/Environment.d.ts +17 -0
- package/types/middlewares/ErrorHandling.d.ts +16 -0
- package/types/middlewares/Global.d.ts +13 -0
- package/types/middlewares/Http.d.ts +16 -0
- package/types/middlewares/Local.d.ts +20 -0
- package/types/middlewares/View.d.ts +16 -0
- package/types/middlewares/index.d.ts +8 -0
- package/types/mount.d.ts +7 -0
- package/types/package.d.ts +91 -0
- package/types/routing/Router.d.ts +19 -0
- package/types/routing/index.d.ts +2 -0
- package/types/services/AWSRekognitionClient.d.ts +359 -0
- package/types/services/Authentication.d.ts +39 -0
- package/types/services/RedisClient.d.ts +80 -0
- package/types/services/index.d.ts +3 -0
- package/types/utils/Types.d.ts +16 -0
- package/types/utils/index.d.ts +2 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as IORedis from 'ioredis';
|
|
2
|
+
/**
|
|
3
|
+
* Redis client.
|
|
4
|
+
* Supports Redis >= 2.6.12 and (Node.js >= 6). Completely compatible with Redis 6.x.
|
|
5
|
+
*/
|
|
6
|
+
export default class extends IORedis.Redis {
|
|
7
|
+
/**
|
|
8
|
+
* Constructs a Redis client object.
|
|
9
|
+
*
|
|
10
|
+
* @param {IORedis.IRedisOptions} options
|
|
11
|
+
* @param {number} options.port=6379 Port of the Redis server.
|
|
12
|
+
* @param {string} options.host=localhost Host of the Redis server.
|
|
13
|
+
* @param {string} options.family=4 Version of IP stack. Defaults to 4.
|
|
14
|
+
* @param {string} options.path=null Local domain socket path. If set the `port`, `host` and `family` will be ignored.
|
|
15
|
+
* @param {number} options.keepAlive=0 TCP KeepAlive on the socket with a X ms delay before start.
|
|
16
|
+
* Set to a non-number value to disable keepAlive.
|
|
17
|
+
* @param {boolean} options.noDelay=true Whether to disable the Nagle's Algorithm. By default we disable it to reduce the latency.
|
|
18
|
+
* @param {string} options.connectionName=null Connection name.
|
|
19
|
+
* @param {number} options.db=0 Database index to use.
|
|
20
|
+
* @param {string} options.password=null If set, client will send AUTH command with the value of this option when connected.
|
|
21
|
+
* @param {string} options.username=null - Similar to `password`, Provide this for Redis ACL support.
|
|
22
|
+
* @param {boolean} options.dropBufferSupport=false Drop the buffer support for better performance.
|
|
23
|
+
* This option is recommended to be enabled when handling large array response and you don't need the buffer support.
|
|
24
|
+
* @param {boolean} options.enableReadyCheck=true When a connection is established to
|
|
25
|
+
* the Redis server, the server might still be loading the database from disk.
|
|
26
|
+
* While loading, the server not respond to any commands.
|
|
27
|
+
* To work around this, when this option is `true`,
|
|
28
|
+
* ioredis will check the status of the Redis server,
|
|
29
|
+
* and when the Redis server is able to process commands,
|
|
30
|
+
* a `ready` event will be emitted.
|
|
31
|
+
* @param {boolean} options.enableOfflineQueue=true By default, if there is no active connection to the Redis server,
|
|
32
|
+
* commands are added to a queue and are executed once the connection is "ready"
|
|
33
|
+
* (when `enableReadyCheck` is `true`,
|
|
34
|
+
* "ready" means the Redis server has loaded the database from disk, otherwise means the connection
|
|
35
|
+
* to the Redis server has been established). If this option is false,
|
|
36
|
+
* when execute the command when the connection isn't ready, an error will be returned.
|
|
37
|
+
* @param {number} options.connectTimeout=10000 The milliseconds before a timeout occurs during the initial connection to the Redis server.
|
|
38
|
+
* @param {boolean} options.autoResubscribe=true After reconnected, if the previous connection was in the subscriber mode, client will auto re-subscribe these channels.
|
|
39
|
+
* @param {boolean} options.autoResendUnfulfilledCommands=true If true, client will resend unfulfilled
|
|
40
|
+
* commands(e.g. block commands) in the previous connection when reconnected.
|
|
41
|
+
* @param {boolean} options.lazyConnect=false By default,
|
|
42
|
+
* When a new `Redis` instance is created, it will connect to Redis server automatically.
|
|
43
|
+
* If you want to keep the instance disconnected until a command is called, you can pass the `lazyConnect` option to the constructor:
|
|
44
|
+
* ```javascript
|
|
45
|
+
* const redis = new RedisClient({lazyConnect: true});
|
|
46
|
+
* // No attempting to connect to the Redis server here.
|
|
47
|
+
* // Now let's connect to the Redis server
|
|
48
|
+
* redis.get('foo', function () {});
|
|
49
|
+
* ```
|
|
50
|
+
* @param {Object} options.tls TLS connection support. See https://github.com/luin/ioredis#tls-options
|
|
51
|
+
* @param {string} options.keyPrefix='' The prefix to prepend to all keys in a command.
|
|
52
|
+
* @param {function} options.retryStrategy See "Quick Start" section
|
|
53
|
+
* @param {number} options.maxRetriesPerRequest See "Quick Start" section
|
|
54
|
+
* @param {number} options.maxLoadingRetryTime=10000 when redis server is not ready, we will wait for `loading_eta_seconds` from `info` command or maxLoadingRetryTime (milliseconds), whichever is smaller.
|
|
55
|
+
* @param {function} options.reconnectOnError See "Quick Start" section
|
|
56
|
+
* @param {boolean} options.readOnly=false Enable READONLY mode for the connection. Only available for cluster mode.
|
|
57
|
+
* @param {boolean} options.stringNumbers=false Force numbers to be always returned as JavaScript strings. This option is necessary when dealing with big numbers (exceed the [-2^53, +2^53] range).
|
|
58
|
+
* @param {boolean} options.enableTLSForSentinelMode=false Whether to support the `tls` option when connecting to Redis via sentinel mode.
|
|
59
|
+
* @param {NatMap} options.natMap=null NAT map for sentinel connector.
|
|
60
|
+
* @param {boolean} options.updateSentinels=true Update the given `sentinels` list with new IP addresses when communicating with existing sentinels.
|
|
61
|
+
* @param {boolean} options.failoverDetector=false Detect failover actively by subscribing to the
|
|
62
|
+
* related channels. With this option disabled, ioredis is still able to detect failovers because Redis
|
|
63
|
+
* Sentinel will disconnect all clients whenever a failover happens, so ioredis will reconnect to the new
|
|
64
|
+
* master. This option is useful when you want to detect failover quicker, but it will create more TCP
|
|
65
|
+
* connections to Redis servers in order to subscribe to related channels.
|
|
66
|
+
* @param {boolean} options.enableAutoPipelining=false When enabled, all commands issued during an event loop
|
|
67
|
+
* iteration are automatically wrapped in a pipeline and sent to the server at the same time.
|
|
68
|
+
* This can dramatically improve performance.
|
|
69
|
+
* @param {string[]} options.autoPipeliningIgnoredCommands=[] The list of commands which must not be automatically wrapped in pipelines.
|
|
70
|
+
* @param {number} options.maxScriptsCachingTime=60000 Default script definition caching time.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* const RedisClient = require('express-sweet').services.RedisClient;
|
|
74
|
+
*
|
|
75
|
+
* // Instantiate Redis client.
|
|
76
|
+
* const unixSocketRedis = new RedisClient({path: "/tmp/echo.sock"});
|
|
77
|
+
* const redis = new RedisClient({host: 'localhost', port: 6379});
|
|
78
|
+
*/
|
|
79
|
+
constructor(opts: IORedis.IRedisOptions);
|
|
80
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type judgment processing.
|
|
3
|
+
*/
|
|
4
|
+
export default class {
|
|
5
|
+
/**
|
|
6
|
+
* Returns true for asynchronous functions, false otherwise.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* Types.isAsyncFunction(async () => {});// true
|
|
10
|
+
* Types.isAsyncFunction(() => {});// false
|
|
11
|
+
*
|
|
12
|
+
* @param {Function} value
|
|
13
|
+
* @return {boolean}
|
|
14
|
+
*/
|
|
15
|
+
static isAsyncFunction(value: Function): boolean;
|
|
16
|
+
}
|