@ti-engine/core 1.8.1 → 1.9.0
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 +37 -0
- package/components/auditing.js +2 -4
- package/components/definitions.types.js +19 -4
- package/components/exchange/default/default-message-exchange.js +2 -0
- package/components/exchange/default/default-message-receiver.js +2 -0
- package/components/exchange/default/default-message-sender.js +2 -0
- package/components/exchange/message-dispatcher.js +4 -0
- package/components/exchange/message-exchange.js +4 -0
- package/components/exchange/message-handler.js +7 -5
- package/components/exchange/message-memory-cache.js +3 -0
- package/components/exchange/message-observer.js +2 -0
- package/components/exchange/message-receiver.js +2 -1
- package/components/exchange/message-sender.js +2 -2
- package/components/exchange/message-tracer.js +2 -3
- package/components/service-caller.js +2 -5
- package/components/service-consumer.js +2 -0
- package/components/service-executor.js +3 -5
- package/components/service-instance.js +2 -4
- package/components/service-provider.js +3 -0
- package/integrations/redis-integration.js +1 -5
- package/package.json +152 -36
- package/types/bin/start-instance.d.ts +1 -0
- package/types/components/auditing.d.ts +30 -0
- package/types/components/connection-observer.d.ts +49 -0
- package/types/components/definitions.types.d.ts +443 -0
- package/types/components/exchange/default/default-message-exchange.d.ts +61 -0
- package/types/components/exchange/default/default-message-receiver.d.ts +49 -0
- package/types/components/exchange/default/default-message-sender.d.ts +50 -0
- package/types/components/exchange/message-dispatcher.d.ts +77 -0
- package/types/components/exchange/message-exchange.d.ts +306 -0
- package/types/components/exchange/message-handler.d.ts +132 -0
- package/types/components/exchange/message-memory-cache.d.ts +84 -0
- package/types/components/exchange/message-observer.d.ts +87 -0
- package/types/components/exchange/message-receiver.d.ts +91 -0
- package/types/components/exchange/message-sender.d.ts +68 -0
- package/types/components/exchange/message-tracer.d.ts +84 -0
- package/types/components/service-caller.d.ts +68 -0
- package/types/components/service-consumer.d.ts +81 -0
- package/types/components/service-executor.d.ts +101 -0
- package/types/components/service-instance.d.ts +111 -0
- package/types/components/service-provider.d.ts +120 -0
- package/types/integrations/redis-integration.d.ts +223 -0
- package/types/utils/cache.d.ts +320 -0
- package/types/utils/config.d.ts +40 -0
- package/types/utils/exceptions.d.ts +224 -0
- package/types/utils/localization.d.ts +194 -0
- package/types/utils/logger.d.ts +24 -0
- package/types/utils/tools.d.ts +70 -0
- package/utils/cache.js +0 -1
- package/utils/exceptions.js +2 -0
- package/utils/localization.js +2 -0
- package/utils/logger.js +2 -0
- package/utils/tools.js +10 -8
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
export { cacheCommandsEnum as cacheCommands };
|
|
2
|
+
export { clientStatusEnum as clientStatus };
|
|
3
|
+
export { cacheOverrideModeEnum as cacheOverrideMode };
|
|
4
|
+
export declare var createRedisClient: (identifier: string) => RedisClient;
|
|
5
|
+
import ConnectionObserver = require("#connection-observer");
|
|
6
|
+
export type TiRedisCommand = string;
|
|
7
|
+
/**
|
|
8
|
+
* Enum for listing all used Redis cache commands.
|
|
9
|
+
*
|
|
10
|
+
* @readonly
|
|
11
|
+
* @enum {string}
|
|
12
|
+
* @typedef {string} TiRedisCommand
|
|
13
|
+
*/
|
|
14
|
+
declare let cacheCommandsEnum: import("../components/definitions.types").TiEnumOf<{
|
|
15
|
+
ADD_TO_SET: string[];
|
|
16
|
+
DELETE_VALUE: string[];
|
|
17
|
+
EXPIRE: string[];
|
|
18
|
+
GET_ALL_FROM_SET: string[];
|
|
19
|
+
GET_VALUE: string[];
|
|
20
|
+
HASH_GET: string[];
|
|
21
|
+
HASH_GET_ALL: string[];
|
|
22
|
+
HASH_REMOVE: string[];
|
|
23
|
+
HASH_EXPIRE: string[];
|
|
24
|
+
HASH_SET: string[];
|
|
25
|
+
HASH_SET_MANY: string[];
|
|
26
|
+
IS_SET_MEMBER: string[];
|
|
27
|
+
JSON_ARRAY_APPEND: string[];
|
|
28
|
+
JSON_GET: string[];
|
|
29
|
+
JSON_MERGE: string[];
|
|
30
|
+
JSON_MGET: string[];
|
|
31
|
+
JSON_SET: string[];
|
|
32
|
+
KEYS: string[];
|
|
33
|
+
LIST_PUSH: string[];
|
|
34
|
+
LIST_POP_TAIL_BLOCKING: string[];
|
|
35
|
+
LIST_POP_TAIL_PUSH_HEAD_BLOCKING: string[];
|
|
36
|
+
LIST_REMOVE: string[];
|
|
37
|
+
SET_VALUE: string[];
|
|
38
|
+
UNION_OF_SETS: string[];
|
|
39
|
+
}>;
|
|
40
|
+
export type TiRedisClientStatus = number;
|
|
41
|
+
/**
|
|
42
|
+
* Enum for listing all client statuses.
|
|
43
|
+
*
|
|
44
|
+
* @readonly
|
|
45
|
+
* @enum {number}
|
|
46
|
+
* @typedef {number} TiRedisClientStatus
|
|
47
|
+
*/
|
|
48
|
+
declare let clientStatusEnum: import("../components/definitions.types").TiEnumOf<{
|
|
49
|
+
UNINITIALIZED: (string | number)[];
|
|
50
|
+
CONNECTED: (string | number)[];
|
|
51
|
+
CONNECTING: (string | number)[];
|
|
52
|
+
DISRUPTED: (string | number)[];
|
|
53
|
+
SHUTTING_DOWN: (string | number)[];
|
|
54
|
+
DISCONNECTED: (string | number)[];
|
|
55
|
+
}>;
|
|
56
|
+
export type TiRedisOverrideMode = string;
|
|
57
|
+
/**
|
|
58
|
+
* Enum for listing the Redis key override modes.
|
|
59
|
+
*
|
|
60
|
+
* @readonly
|
|
61
|
+
* @enum {string}
|
|
62
|
+
* @typedef {string} TiRedisOverrideMode
|
|
63
|
+
*/
|
|
64
|
+
declare let cacheOverrideModeEnum: import("../components/definitions.types").TiEnumOf<{
|
|
65
|
+
DEFAULT: string[];
|
|
66
|
+
NX: string[];
|
|
67
|
+
XX: string[];
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* Used to create a Redis Cache client.
|
|
71
|
+
* <br/>
|
|
72
|
+
* NOTE: This client is set to automatically resend all pending commands on connection recovery with no limit on the retry attempts.
|
|
73
|
+
* This is done to avoid losing any pending commands in case of a connection failure. For a different behavior, use custom implementation.
|
|
74
|
+
*
|
|
75
|
+
* @class RedisClient
|
|
76
|
+
* @public
|
|
77
|
+
*/
|
|
78
|
+
declare class RedisClient {
|
|
79
|
+
#private;
|
|
80
|
+
/**
|
|
81
|
+
* @constructor
|
|
82
|
+
* @param {string} identifier
|
|
83
|
+
* @returns {RedisClient}
|
|
84
|
+
*/
|
|
85
|
+
constructor(identifier: string);
|
|
86
|
+
/**
|
|
87
|
+
* Used to return the Redis client identifier assigned internally.
|
|
88
|
+
*
|
|
89
|
+
* @property
|
|
90
|
+
* @returns {string}
|
|
91
|
+
* @public
|
|
92
|
+
*/
|
|
93
|
+
get identifier(): string;
|
|
94
|
+
/**
|
|
95
|
+
* Used to return the client ID assigned by the Redis server.
|
|
96
|
+
*
|
|
97
|
+
* @property
|
|
98
|
+
* @returns {number}
|
|
99
|
+
* @public
|
|
100
|
+
*/
|
|
101
|
+
get clientID(): number;
|
|
102
|
+
/**
|
|
103
|
+
* Used to return the Redis client status.
|
|
104
|
+
*
|
|
105
|
+
* @property
|
|
106
|
+
* @returns {number}
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
109
|
+
get clientStatus(): number;
|
|
110
|
+
/**
|
|
111
|
+
* Used to return the Redis server version.
|
|
112
|
+
*
|
|
113
|
+
* @property
|
|
114
|
+
* @returns {number}
|
|
115
|
+
* @public
|
|
116
|
+
*/
|
|
117
|
+
get serverVersion(): number;
|
|
118
|
+
/**
|
|
119
|
+
* Verify if Redis server supports JSON data types.
|
|
120
|
+
*
|
|
121
|
+
* @property
|
|
122
|
+
* @returns {boolean}
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
125
|
+
get isJSONSupported(): boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Used to initialize the Redis client.
|
|
128
|
+
*
|
|
129
|
+
* @method
|
|
130
|
+
* @param {string} host
|
|
131
|
+
* @param {number} port
|
|
132
|
+
* @param {string} authKey
|
|
133
|
+
* @param {string} user
|
|
134
|
+
* @param {number} defaultDB
|
|
135
|
+
* @param {number} [retryMaxIntervalMs=1000] Optional max backoff interval.
|
|
136
|
+
* @param {number|undefined} [retryMaxAttempts=undefined] Optional max (re)connection attempts before abort.
|
|
137
|
+
* @public
|
|
138
|
+
*/
|
|
139
|
+
initialize(host: string, port: number, authKey: string, user: string, defaultDB: number, retryMaxIntervalMs?: number, retryMaxAttempts?: number | undefined): Promise<any>;
|
|
140
|
+
/**
|
|
141
|
+
* Used to register a new {@link ConnectionObserver} for events related to the Redis connection state.
|
|
142
|
+
*
|
|
143
|
+
* @method
|
|
144
|
+
* @param {ConnectionObserver} connectionObserver The {@link ConnectionObserver} that will be notified of any changes.
|
|
145
|
+
* @public
|
|
146
|
+
*/
|
|
147
|
+
addConnectionObserver(connectionObserver: ConnectionObserver): void;
|
|
148
|
+
/**
|
|
149
|
+
* Used to execute multiple commands within a Redis transaction.
|
|
150
|
+
*
|
|
151
|
+
* @method
|
|
152
|
+
* @param {Array[]} commands
|
|
153
|
+
* @returns {Promise<*>}
|
|
154
|
+
* @public
|
|
155
|
+
*/
|
|
156
|
+
executeCommands(commands: any[][]): Promise<any>;
|
|
157
|
+
/**
|
|
158
|
+
* Used to send a new blocking command to Redis.
|
|
159
|
+
* <br/>
|
|
160
|
+
* WARNING: This will reserve the client connection until a result is received.
|
|
161
|
+
*
|
|
162
|
+
* @method
|
|
163
|
+
* @param {string} command
|
|
164
|
+
* @param {Array} commandArguments
|
|
165
|
+
* @returns {Promise<*>}
|
|
166
|
+
* @public
|
|
167
|
+
*/
|
|
168
|
+
blockingCommand(command: string, commandArguments: any[]): Promise<any>;
|
|
169
|
+
/**
|
|
170
|
+
* Used to publish a message to the specified channel.
|
|
171
|
+
*
|
|
172
|
+
* @method
|
|
173
|
+
* @param {string} channel
|
|
174
|
+
* @param {(Object|string)} message
|
|
175
|
+
* @returns {Promise<number>}
|
|
176
|
+
* @public
|
|
177
|
+
*/
|
|
178
|
+
publishCommand(channel: string, message: (Object | string)): Promise<number>;
|
|
179
|
+
/**
|
|
180
|
+
* Used to subscribe to the specified channel for messages.
|
|
181
|
+
* <br/>
|
|
182
|
+
* NOTE: Call unsubscribeCommand(channel) to detach later.
|
|
183
|
+
*
|
|
184
|
+
* @method
|
|
185
|
+
* @param {string} channel Unique identifier of the channel to subscribe to.
|
|
186
|
+
* @param {(message: Object) => void} messageHandler Will execute this handler every time a new message is received.
|
|
187
|
+
* @returns {Promise}
|
|
188
|
+
* @public
|
|
189
|
+
*/
|
|
190
|
+
subscribeCommand(channel: string, messageHandler: (message: Object) => void): Promise<any>;
|
|
191
|
+
/**
|
|
192
|
+
* Used to unsubscribe from a channel and remove its message handler.
|
|
193
|
+
*
|
|
194
|
+
* @method
|
|
195
|
+
* @param {string} channel Unique identifier of the channel to unsubscribe from.
|
|
196
|
+
* @returns {Promise}
|
|
197
|
+
* @public
|
|
198
|
+
*/
|
|
199
|
+
unsubscribeCommand(channel: string): Promise<any>;
|
|
200
|
+
/**
|
|
201
|
+
* Used to execute any Redis command in an unmanaged way.
|
|
202
|
+
* <br/>
|
|
203
|
+
* WARNING: Use this only if there is no other implemented function in this module and the command
|
|
204
|
+
* you want to execute is not supported by the 'multi' Redis command (implemented in {@link RedisClient.executeCommands}).
|
|
205
|
+
* Make sure to handle the result as it will be returned raw.
|
|
206
|
+
*
|
|
207
|
+
* @method
|
|
208
|
+
* @param {string[]} commandArguments
|
|
209
|
+
* @returns {Promise<Object>}
|
|
210
|
+
* @public
|
|
211
|
+
*/
|
|
212
|
+
callCommand(commandArguments: string[]): Promise<Object>;
|
|
213
|
+
/**
|
|
214
|
+
* Used to gracefully close the Redis connection.
|
|
215
|
+
* Attempts to quit(), then falls back to disconnect() on timeout.
|
|
216
|
+
*
|
|
217
|
+
* @method
|
|
218
|
+
* @param {number} [timeoutMs=1000]
|
|
219
|
+
* @returns {Promise}
|
|
220
|
+
* @public
|
|
221
|
+
*/
|
|
222
|
+
shutDown(timeoutMs?: number): Promise<any>;
|
|
223
|
+
}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
declare const _exported: Readonly<CommonMemoryCache>;
|
|
2
|
+
export { _exported as instance };
|
|
3
|
+
import ConnectionObserver = require("#connection-observer");
|
|
4
|
+
/**
|
|
5
|
+
* Used to create and/or return a Common Memory Cache singleton instance.
|
|
6
|
+
*
|
|
7
|
+
* @class CommonMemoryCache
|
|
8
|
+
* @extends ConnectionObserver
|
|
9
|
+
* @singleton
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
declare class CommonMemoryCache extends ConnectionObserver {
|
|
13
|
+
#private;
|
|
14
|
+
/**
|
|
15
|
+
* @constructor
|
|
16
|
+
* @return {CommonMemoryCache}
|
|
17
|
+
*/
|
|
18
|
+
constructor();
|
|
19
|
+
/**
|
|
20
|
+
* Property returning the operational state of the cache.
|
|
21
|
+
*
|
|
22
|
+
* @property
|
|
23
|
+
* @returns {boolean}
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
get isOperational(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Property returning the connection identifier of the cache service.
|
|
29
|
+
*
|
|
30
|
+
* @property
|
|
31
|
+
* @returns {string}
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
get connectionIdentifier(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Used to initialize the cache service.
|
|
37
|
+
*
|
|
38
|
+
* @method
|
|
39
|
+
* @returns {Promise}
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
initialize(): Promise<any>;
|
|
43
|
+
/**
|
|
44
|
+
* Used to gracefully shut down the cache service.
|
|
45
|
+
*
|
|
46
|
+
* @method
|
|
47
|
+
* @return {Promise}
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
shutDown(): Promise<any>;
|
|
51
|
+
/**
|
|
52
|
+
* Needs to be invoked by the connection handler when the connection is disrupted.
|
|
53
|
+
*
|
|
54
|
+
* @method
|
|
55
|
+
* @param {string} identifier The identifier of the observed connection.
|
|
56
|
+
* @override
|
|
57
|
+
* @public
|
|
58
|
+
*/
|
|
59
|
+
onConnectionDisrupted(identifier: string): void;
|
|
60
|
+
/**
|
|
61
|
+
* Needs to be invoked by the connection handler when the connection is recovered.
|
|
62
|
+
*
|
|
63
|
+
* @method
|
|
64
|
+
* @param {string} identifier The identifier of the observed connection.
|
|
65
|
+
* @override
|
|
66
|
+
* @public
|
|
67
|
+
*/
|
|
68
|
+
onConnectionRecovered(identifier: string): void;
|
|
69
|
+
/**
|
|
70
|
+
* Needs to be invoked by the connection handler when the connection is irrevocably lost.
|
|
71
|
+
*
|
|
72
|
+
* @method
|
|
73
|
+
* @param {string} identifier The identifier of the observed connection.
|
|
74
|
+
* @throws {TiException.E_GEN_SYSTEM_CACHE_UNAVAILABLE} If the cache service is no longer available.
|
|
75
|
+
* @override
|
|
76
|
+
* @public
|
|
77
|
+
*/
|
|
78
|
+
onConnectionLost(identifier: string): void;
|
|
79
|
+
/**
|
|
80
|
+
* Used to register a new {@link ConnectionObserver} for events related to the underlying Redis connection state.
|
|
81
|
+
*
|
|
82
|
+
* @method
|
|
83
|
+
* @param {ConnectionObserver} connectionObserver The {@link ConnectionObserver} that will be notified of any changes.
|
|
84
|
+
* @public
|
|
85
|
+
*/
|
|
86
|
+
addConnectionObserver(connectionObserver: ConnectionObserver): void;
|
|
87
|
+
/**
|
|
88
|
+
* Used to search for keys by a given pattern.
|
|
89
|
+
*
|
|
90
|
+
* @method
|
|
91
|
+
* @param {string} pattern
|
|
92
|
+
* @returns {Promise<Array>}
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
matchKeys(pattern: string): Promise<any[]>;
|
|
96
|
+
/**
|
|
97
|
+
* Used to set a specific string value.
|
|
98
|
+
*
|
|
99
|
+
* @method
|
|
100
|
+
* @param {string} key
|
|
101
|
+
* @param {string} value
|
|
102
|
+
* @param {number} [expiration] Expiration value is in seconds.
|
|
103
|
+
* @return {Promise<string>}
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
setValue(key: string, value: string, expiration?: number): Promise<string>;
|
|
107
|
+
/**
|
|
108
|
+
* Used to set multiple string values.
|
|
109
|
+
*
|
|
110
|
+
* @method
|
|
111
|
+
* @param {Object} keyValues
|
|
112
|
+
* @param {string} [prefix]
|
|
113
|
+
* @param {number} [expiration]
|
|
114
|
+
* @return {Promise}
|
|
115
|
+
* @public
|
|
116
|
+
*/
|
|
117
|
+
setValues(keyValues: Object, prefix?: string, expiration?: number): Promise<any>;
|
|
118
|
+
/**
|
|
119
|
+
* Used to get a string value.
|
|
120
|
+
*
|
|
121
|
+
* @method
|
|
122
|
+
* @param {string} key
|
|
123
|
+
* @return {Promise}
|
|
124
|
+
* @public
|
|
125
|
+
*/
|
|
126
|
+
getValue(key: string): Promise<any>;
|
|
127
|
+
/**
|
|
128
|
+
* Used to get multiple string values.
|
|
129
|
+
*
|
|
130
|
+
* @method
|
|
131
|
+
* @param {string[]} keys
|
|
132
|
+
* @param {string} [prefix]
|
|
133
|
+
* @return {Promise}
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
getValues(keys: string[], prefix?: string): Promise<any>;
|
|
137
|
+
/**
|
|
138
|
+
* Used to delete a value / item.
|
|
139
|
+
*
|
|
140
|
+
* @method
|
|
141
|
+
* @param {string} key
|
|
142
|
+
* @returns {Promise<boolean>}
|
|
143
|
+
* @public
|
|
144
|
+
*/
|
|
145
|
+
deleteValue(key: string): Promise<boolean>;
|
|
146
|
+
/**
|
|
147
|
+
* Used to set expiration in seconds to an existing key.
|
|
148
|
+
* <br/>
|
|
149
|
+
* NOTE: For performance optimization reasons, only use this only if the Redis command does not itself support the 'EX' argument.
|
|
150
|
+
*
|
|
151
|
+
* @method
|
|
152
|
+
* @param {string} key
|
|
153
|
+
* @param {number} seconds
|
|
154
|
+
* @param {string} [name] If you need to expire a field in a hash set instead, provide the name of the set here.
|
|
155
|
+
* @returns {Promise<number>} This will resolve with the seconds as provided initially by the caller.
|
|
156
|
+
* @public
|
|
157
|
+
*/
|
|
158
|
+
expireValue(key: string, seconds: number, name?: string): Promise<number>;
|
|
159
|
+
/**
|
|
160
|
+
* Used to add the specified values to a list.
|
|
161
|
+
*
|
|
162
|
+
* @method
|
|
163
|
+
* @param {string} listName
|
|
164
|
+
* @param {Object[]} values
|
|
165
|
+
* @returns {Promise<number>}
|
|
166
|
+
* @public
|
|
167
|
+
*/
|
|
168
|
+
listPushValue(listName: string, values: Object[]): Promise<number>;
|
|
169
|
+
/**
|
|
170
|
+
* Used to add the specified value to a set.
|
|
171
|
+
*
|
|
172
|
+
* @method
|
|
173
|
+
* @param {string} key
|
|
174
|
+
* @param {string|Object} value
|
|
175
|
+
* @returns {Promise}
|
|
176
|
+
* @public
|
|
177
|
+
*/
|
|
178
|
+
addToSet(key: string, value: string | Object): Promise<any>;
|
|
179
|
+
/**
|
|
180
|
+
* Used to add multiple values to multiple sets in one transactional request.
|
|
181
|
+
* <br/>
|
|
182
|
+
* NOTE: The two arrays of keys and values must have correct index relations (i.e., first pair on keys[0] and values[0] and so on)!
|
|
183
|
+
*
|
|
184
|
+
* @method
|
|
185
|
+
* @param {string[]} keys
|
|
186
|
+
* @param {string[]} values
|
|
187
|
+
* @returns {Promise}
|
|
188
|
+
* @public
|
|
189
|
+
*/
|
|
190
|
+
addToSetMulti(keys: string[], values: string[]): Promise<any>;
|
|
191
|
+
/**
|
|
192
|
+
* Used to check if the provided value is a member of the specified set.
|
|
193
|
+
*
|
|
194
|
+
* @method
|
|
195
|
+
* @param {string} setName
|
|
196
|
+
* @param {string} value
|
|
197
|
+
* @returns {Promise<boolean>}
|
|
198
|
+
* @public
|
|
199
|
+
*/
|
|
200
|
+
isSetMember(setName: string, value: string): Promise<boolean>;
|
|
201
|
+
/**
|
|
202
|
+
* Used to get all elements of a set.
|
|
203
|
+
*
|
|
204
|
+
* @method
|
|
205
|
+
* @param {string} key
|
|
206
|
+
* @returns {Promise<Object[]>}
|
|
207
|
+
* @public
|
|
208
|
+
*/
|
|
209
|
+
membersOfSet(key: string): Promise<Object[]>;
|
|
210
|
+
/**
|
|
211
|
+
* Used to get a union of all elements in the list of sets.
|
|
212
|
+
*
|
|
213
|
+
* @method
|
|
214
|
+
* @param {string[]} keys
|
|
215
|
+
* @returns {Promise<Object[]>}
|
|
216
|
+
* @public
|
|
217
|
+
*/
|
|
218
|
+
unionOfSets(keys: string[]): Promise<Object[]>;
|
|
219
|
+
/**
|
|
220
|
+
* Used to set a single hash field.
|
|
221
|
+
*
|
|
222
|
+
* @method
|
|
223
|
+
* @deprecated
|
|
224
|
+
* @param {string} key
|
|
225
|
+
* @param {string} name
|
|
226
|
+
* @param {*} value
|
|
227
|
+
* @returns {Promise}
|
|
228
|
+
* @public
|
|
229
|
+
*/
|
|
230
|
+
hashSetField(key: string, name: string, value: any): Promise<any>;
|
|
231
|
+
/**
|
|
232
|
+
* Used to set multiple hash fields.
|
|
233
|
+
*
|
|
234
|
+
* @method
|
|
235
|
+
* @deprecated
|
|
236
|
+
* @param {string} key
|
|
237
|
+
* @param {Object[]} fields
|
|
238
|
+
* @param {string} fields[].name
|
|
239
|
+
* @param {*} fields[].value
|
|
240
|
+
* @returns {Promise}
|
|
241
|
+
* @public
|
|
242
|
+
*/
|
|
243
|
+
hashSetFields(key: string, fields: {
|
|
244
|
+
name: string;
|
|
245
|
+
value: any;
|
|
246
|
+
}[]): Promise<any>;
|
|
247
|
+
/**
|
|
248
|
+
* Used to get a single field from a hash.
|
|
249
|
+
*
|
|
250
|
+
* @method
|
|
251
|
+
* @param {string} key
|
|
252
|
+
* @param {string} field
|
|
253
|
+
* @return {Promise}
|
|
254
|
+
* @public
|
|
255
|
+
*/
|
|
256
|
+
hashGetField(key: string, field: string): Promise<any>;
|
|
257
|
+
/**
|
|
258
|
+
* Used to remove a single field from a hash.
|
|
259
|
+
*
|
|
260
|
+
* @method
|
|
261
|
+
* @param {string} key
|
|
262
|
+
* @param {string} field
|
|
263
|
+
* @return {Promise<boolean>} Will return 'true' if the field was removed, 'false' otherwise.
|
|
264
|
+
* @public
|
|
265
|
+
*/
|
|
266
|
+
hashDeleteField(key: string, field: string): Promise<boolean>;
|
|
267
|
+
/**
|
|
268
|
+
* Used to store a JSON variable.
|
|
269
|
+
* <br/>
|
|
270
|
+
* NOTE: Requires ReJSON module installed on server to work.
|
|
271
|
+
*
|
|
272
|
+
* @method
|
|
273
|
+
* @param {string} key
|
|
274
|
+
* @param {Object} value
|
|
275
|
+
* @param {string|string[]} [path="$"] A dot-separated JSONPath string, or an array of literal key segments (use the array form when key names may contain dots or other special characters).
|
|
276
|
+
* @param {number} [overrideMode=0] By default this allows full override for existing keys.
|
|
277
|
+
* Option 1 will set the key only if it doesn't already exist. Option 2 will set it only if it already exists.
|
|
278
|
+
* @returns {Promise}
|
|
279
|
+
* @public
|
|
280
|
+
*/
|
|
281
|
+
setJSON(key: string, value: Object, path?: string | string[], overrideMode?: number): Promise<any>;
|
|
282
|
+
/**
|
|
283
|
+
* Used to fetch a JSON variable.
|
|
284
|
+
* <br/>
|
|
285
|
+
* NOTE: Requires ReJSON module installed on server to work.
|
|
286
|
+
*
|
|
287
|
+
* @method
|
|
288
|
+
* @param {string} key
|
|
289
|
+
* @param {string|string[]} [path="$"] A dot-separated JSONPath string, or an array of literal key segments (use the array form when key names may contain dots or other special characters).
|
|
290
|
+
* @returns {Promise<Object>}
|
|
291
|
+
* @public
|
|
292
|
+
*/
|
|
293
|
+
getJSON(key: string, path?: string | string[]): Promise<Object>;
|
|
294
|
+
/**
|
|
295
|
+
* Used to update/edit an existing JSON variable.
|
|
296
|
+
* <br/>
|
|
297
|
+
* NOTE: Requires ReJSON module installed on server to work.
|
|
298
|
+
*
|
|
299
|
+
* @method
|
|
300
|
+
* @param {string} key
|
|
301
|
+
* @param {Object} value
|
|
302
|
+
* @param {string|string[]} [path="$"] A dot-separated JSONPath string, or an array of literal key segments (use the array form when key names may contain dots or other special characters).
|
|
303
|
+
* @returns {Promise}
|
|
304
|
+
* @public
|
|
305
|
+
*/
|
|
306
|
+
editJSON(key: string, value: Object, path?: string | string[]): Promise<any>;
|
|
307
|
+
/**
|
|
308
|
+
* Used to add an item to a JSON array. That array needs to exist already.
|
|
309
|
+
* <br/>
|
|
310
|
+
* NOTE: Requires ReJSON module installed on server to work.
|
|
311
|
+
*
|
|
312
|
+
* @method
|
|
313
|
+
* @param {string} key
|
|
314
|
+
* @param {Object} value
|
|
315
|
+
* @param {string|string[]} [path="$"] A dot-separated JSONPath string, or an array of literal key segments (use the array form when key names may contain dots or other special characters).
|
|
316
|
+
* @returns {Promise}
|
|
317
|
+
* @public
|
|
318
|
+
*/
|
|
319
|
+
arrayAppendJSON(key: string, value: Object, path?: string | string[]): Promise<any>;
|
|
320
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export { settingsEnum as setting };
|
|
2
|
+
export declare var getSetting: (setting: string | TiSetting, defaultValue?: any) => any;
|
|
3
|
+
export type TiSetting = string;
|
|
4
|
+
/**
|
|
5
|
+
* Enum for listing all system settings.
|
|
6
|
+
*
|
|
7
|
+
* @readonly
|
|
8
|
+
* @enum {string} Keys of this ENUM are strings.
|
|
9
|
+
* @typedef {string} TiSetting
|
|
10
|
+
*/
|
|
11
|
+
declare const settingsEnum: import("../components/definitions.types").TiEnumOf<{
|
|
12
|
+
AUDITING_LOG_CONSOLE_ENABLED: string[];
|
|
13
|
+
AUDITING_LOG_DETAILS: string[];
|
|
14
|
+
AUDITING_LOG_MIN_LEVEL: string[];
|
|
15
|
+
AUDITING_LOG_USES_JSON: string[];
|
|
16
|
+
GCLOUD_API_KEY: string[];
|
|
17
|
+
GCLOUD_PROJECT_ID: string[];
|
|
18
|
+
LOCALIZATION_LABELS_PATH: string[];
|
|
19
|
+
LOCALIZATION_LANGUAGE: string[];
|
|
20
|
+
MEMORY_CACHE_AUTH_KEY: string[];
|
|
21
|
+
MEMORY_CACHE_REDIS_DB: string[];
|
|
22
|
+
MEMORY_CACHE_REDIS_HOST: string[];
|
|
23
|
+
MEMORY_CACHE_REDIS_PORT: string[];
|
|
24
|
+
MEMORY_CACHE_RETRY_MAX_ATTEMPTS: string[];
|
|
25
|
+
MEMORY_CACHE_RETRY_MAX_INTERVAL: string[];
|
|
26
|
+
MEMORY_CACHE_USER: string[];
|
|
27
|
+
MESSAGE_EXCHANGE_QUEUE_PREFIX: string[];
|
|
28
|
+
MESSAGE_EXCHANGE_MESSAGE_STORE: string[];
|
|
29
|
+
MESSAGE_EXCHANGE_SECURITY_HASH_ENABLED: string[];
|
|
30
|
+
MESSAGE_EXCHANGE_SECURITY_HASH_KEY: string[];
|
|
31
|
+
MESSAGE_EXCHANGE_TRACE_EXPIRATION_TIME: string[];
|
|
32
|
+
MESSAGE_EXCHANGE_TRACE_LOG_ENABLED: string[];
|
|
33
|
+
MESSAGE_EXCHANGE_TRACE_REPOSITORY: string[];
|
|
34
|
+
SERVICE_EXECUTION_TIMEOUT: string[];
|
|
35
|
+
SERVICE_HEALTH_CHECK_ADDRESS: string[];
|
|
36
|
+
SERVICE_HEALTH_CHECK_INTERVAL: string[];
|
|
37
|
+
SERVICE_HEALTH_CHECK_TIMEOUT: string[];
|
|
38
|
+
SERVICE_REGISTRY_ADDRESS: string[];
|
|
39
|
+
OPERATION_MODE: string[];
|
|
40
|
+
}>;
|