@ti-engine/core 1.12.3 → 1.14.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 +15 -0
- package/bin/settings.json +4 -0
- package/components/cache/cache-capability.js +42 -0
- package/components/cache/cache-provider.js +432 -0
- package/components/cache/redis-cache-provider.js +749 -0
- package/components/service-instance.js +40 -3
- package/package.json +13 -1
- package/types/components/cache/cache-capability.d.ts +23 -0
- package/types/components/cache/cache-provider.d.ts +326 -0
- package/types/components/cache/redis-cache-provider.d.ts +327 -0
- package/types/components/service-instance.d.ts +14 -0
- package/types/utils/cache.d.ts +70 -26
- package/types/utils/config.d.ts +4 -0
- package/utils/cache.js +180 -378
- package/utils/config.js +12 -0
|
@@ -86,6 +86,23 @@ class ServiceInstance {
|
|
|
86
86
|
return ServiceInstance.#instanceID;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Property returning whether the message exchange is enabled for this instance.
|
|
91
|
+
* <br/>
|
|
92
|
+
* NOTE: When this is off the instance neither initializes nor shuts down the message dispatcher, and therefore
|
|
93
|
+
* touches none of the primitives the exchange needs from the cache backend - blocking reads and pub/sub, which are
|
|
94
|
+
* the only parts of the cache surface a non-Redis backend cannot reasonably provide. A single-instance deployment
|
|
95
|
+
* with no mesh to talk to is the case this exists for. Defaults to enabled, so an existing deployment is
|
|
96
|
+
* unaffected.
|
|
97
|
+
*
|
|
98
|
+
* @property
|
|
99
|
+
* @returns {boolean}
|
|
100
|
+
* @public
|
|
101
|
+
*/
|
|
102
|
+
static get isMessageExchangeEnabled() {
|
|
103
|
+
return config.getSetting( config.setting.MESSAGE_EXCHANGE_ENABLED, true ) !== false;
|
|
104
|
+
}
|
|
105
|
+
|
|
89
106
|
/**
|
|
90
107
|
* Property returning the current service domain name.
|
|
91
108
|
*
|
|
@@ -160,6 +177,11 @@ class ServiceInstance {
|
|
|
160
177
|
onStart() {
|
|
161
178
|
return new Promise( ( resolve, reject ) => {
|
|
162
179
|
cache.instance.initialize().then( () => {
|
|
180
|
+
if ( ServiceInstance.isMessageExchangeEnabled === false ) {
|
|
181
|
+
logger.log( `Message exchange is disabled for instance '${ ServiceInstance.instanceID }' - it will neither send nor receive service messages.`, logger.logSeverity.NOTICE );
|
|
182
|
+
return undefined;
|
|
183
|
+
}
|
|
184
|
+
|
|
163
185
|
const DefaultMessageExchange = require( "#default-message-exchange" );
|
|
164
186
|
const ServiceProvider = require( "#service-provider" );
|
|
165
187
|
const ServiceConsumer = require( "#service-consumer" );
|
|
@@ -214,6 +236,13 @@ class ServiceInstance {
|
|
|
214
236
|
*/
|
|
215
237
|
onStop() {
|
|
216
238
|
return new Promise( ( resolve, reject ) => {
|
|
239
|
+
// Symmetrical with onStart: a dispatcher that was never initialized has nothing to shut down, and asking
|
|
240
|
+
// it to would fail a stop that has nothing wrong with it.
|
|
241
|
+
if ( ServiceInstance.isMessageExchangeEnabled === false ) {
|
|
242
|
+
resolve();
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
|
|
217
246
|
messageDispatcher.instance.shutDown().then( () => {
|
|
218
247
|
resolve();
|
|
219
248
|
} ).catch( ( error ) => {
|
|
@@ -274,9 +303,17 @@ class ServiceInstance {
|
|
|
274
303
|
#postStart() {
|
|
275
304
|
return new Promise( ( resolve ) => {
|
|
276
305
|
// Schedule regular health check:
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
306
|
+
// The default interval is a six-field cron, so this writes once per second for as long as the instance
|
|
307
|
+
// lives. That is what an orchestrator watching a mesh of instances wants, and pure cost anywhere else -
|
|
308
|
+
// a single instance with nothing reading the key, or a host that already knows whether the process is
|
|
309
|
+
// running, pays a write per second for nothing.
|
|
310
|
+
if ( config.getSetting( config.setting.SERVICE_HEALTH_CHECK_ENABLED, true ) === false ) {
|
|
311
|
+
logger.log( `Health check reporting is disabled for instance '${ ServiceInstance.instanceID }'.`, logger.logSeverity.NOTICE );
|
|
312
|
+
} else {
|
|
313
|
+
this.#reportHealthyJob = schedule.scheduleJob( config.getSetting( config.setting.SERVICE_HEALTH_CHECK_INTERVAL ), () => {
|
|
314
|
+
this.reportHealthy();
|
|
315
|
+
} );
|
|
316
|
+
}
|
|
280
317
|
|
|
281
318
|
logger.log( `Instance '${ ServiceInstance.instanceID }' started successfully.`, logger.logSeverity.NOTICE, {
|
|
282
319
|
nodeVersion: process.version,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ti-engine/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "Microservice framework for Node.js: a Redis-backed message exchange with end-to-end call tracing, retries and tamper-evident message envelopes.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"microservices",
|
|
@@ -68,6 +68,14 @@
|
|
|
68
68
|
"types": "./types/utils/cache.d.ts",
|
|
69
69
|
"default": "./utils/cache.js"
|
|
70
70
|
},
|
|
71
|
+
"#cache-capability": {
|
|
72
|
+
"types": "./types/components/cache/cache-capability.d.ts",
|
|
73
|
+
"default": "./components/cache/cache-capability.js"
|
|
74
|
+
},
|
|
75
|
+
"#cache-provider": {
|
|
76
|
+
"types": "./types/components/cache/cache-provider.d.ts",
|
|
77
|
+
"default": "./components/cache/cache-provider.js"
|
|
78
|
+
},
|
|
71
79
|
"#config": {
|
|
72
80
|
"types": "./types/utils/config.d.ts",
|
|
73
81
|
"default": "./utils/config.js"
|
|
@@ -137,6 +145,10 @@
|
|
|
137
145
|
"types": "./types/components/exchange/message-tracer.d.ts",
|
|
138
146
|
"default": "./components/exchange/message-tracer.js"
|
|
139
147
|
},
|
|
148
|
+
"#redis-cache-provider": {
|
|
149
|
+
"types": "./types/components/cache/redis-cache-provider.d.ts",
|
|
150
|
+
"default": "./components/cache/redis-cache-provider.js"
|
|
151
|
+
},
|
|
140
152
|
"#redis-integration": {
|
|
141
153
|
"types": "./types/integrations/redis-integration.d.ts",
|
|
142
154
|
"default": "./integrations/redis-integration.js"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export { cacheCapabilityEnum as cacheCapability };
|
|
2
|
+
export type TiCacheCapability = string;
|
|
3
|
+
/**
|
|
4
|
+
* Enum for listing the optional behaviors a cache backend may or may not provide.
|
|
5
|
+
* <br/>
|
|
6
|
+
* NOTE: A backend declares what it supports through {@link CacheProvider#capabilities}; an application declares what it
|
|
7
|
+
* requires through the 'memoryCache.requiredCapabilities' setting. The two are reconciled once, during startup, so that
|
|
8
|
+
* a backend which cannot do what the application needs fails where somebody is watching rather than inside a request
|
|
9
|
+
* weeks later.
|
|
10
|
+
*
|
|
11
|
+
* @readonly
|
|
12
|
+
* @enum {string}
|
|
13
|
+
* @typedef {string} TiCacheCapability
|
|
14
|
+
*/
|
|
15
|
+
declare const cacheCapabilityEnum: import("../definitions.types").TiEnumOf<{
|
|
16
|
+
KEY_EXPIRY: string[];
|
|
17
|
+
KEY_PATTERN_MATCH: string[];
|
|
18
|
+
LISTS: string[];
|
|
19
|
+
SETS: string[];
|
|
20
|
+
HASH_FIELDS: string[];
|
|
21
|
+
JSON_DOCUMENTS: string[];
|
|
22
|
+
ATOMIC_JSON_EDIT: string[];
|
|
23
|
+
}>;
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
export = CacheProvider;
|
|
2
|
+
import type ConnectionObserver from "#connection-observer";
|
|
3
|
+
/** @import ConnectionObserver from "#connection-observer" */
|
|
4
|
+
/**
|
|
5
|
+
* An abstract class that defines the storage behavior required by the {@link CommonMemoryCache}.
|
|
6
|
+
* <br/>
|
|
7
|
+
* NOTE: This sets the contract between the cache and whatever actually holds the values. It has to be inherited and
|
|
8
|
+
* implemented with the specifics of a given backend. For a working example please see the {@link RedisCacheProvider} class.
|
|
9
|
+
* <br/>
|
|
10
|
+
* NOTE: Implementations must NOT check whether the cache is operational. {@link CommonMemoryCache} performs that check
|
|
11
|
+
* once, before it delegates, so every backend inherits the same guard instead of restating it in each of its methods.
|
|
12
|
+
*
|
|
13
|
+
* @class CacheProvider
|
|
14
|
+
* @abstract
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
declare class CacheProvider {
|
|
18
|
+
/**
|
|
19
|
+
* @constructor
|
|
20
|
+
* @throws {TiException.E_GEN_ABSTRACT_CLASS_INIT} If this class is instantiated directly.
|
|
21
|
+
*/
|
|
22
|
+
constructor();
|
|
23
|
+
/**
|
|
24
|
+
* Property returning the optional behaviors this backend provides.
|
|
25
|
+
* <br/>
|
|
26
|
+
* NOTE: Some capabilities can only be established once a connection exists — RedisJSON, for example, is a server-side
|
|
27
|
+
* module that has to be probed. Read this after {@link CacheProvider#initialize} has resolved, never before.
|
|
28
|
+
*
|
|
29
|
+
* @property
|
|
30
|
+
* @returns {string[]} Values drawn from {@link TiCacheCapability}.
|
|
31
|
+
* @abstract
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
get capabilities(): string[];
|
|
35
|
+
/**
|
|
36
|
+
* Used to verify whether this backend provides a given capability.
|
|
37
|
+
*
|
|
38
|
+
* @method
|
|
39
|
+
* @param {string} capability A value from {@link TiCacheCapability}.
|
|
40
|
+
* @returns {boolean}
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
hasCapability(capability: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Used to initialize the backend and establish whatever connection it requires.
|
|
46
|
+
*
|
|
47
|
+
* @method
|
|
48
|
+
* @returns {Promise}
|
|
49
|
+
* @abstract
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
initialize(): Promise<any>;
|
|
53
|
+
/**
|
|
54
|
+
* Used to gracefully shut the backend down.
|
|
55
|
+
*
|
|
56
|
+
* @method
|
|
57
|
+
* @returns {Promise}
|
|
58
|
+
* @abstract
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
shutDown(): Promise<any>;
|
|
62
|
+
/**
|
|
63
|
+
* Used to register a new {@link ConnectionObserver} for events related to the backend connection state.
|
|
64
|
+
*
|
|
65
|
+
* @method
|
|
66
|
+
* @param {ConnectionObserver} connectionObserver The {@link ConnectionObserver} that will be notified of any changes.
|
|
67
|
+
* @abstract
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
70
|
+
addConnectionObserver(connectionObserver: ConnectionObserver): void;
|
|
71
|
+
/**
|
|
72
|
+
* Used to search for keys by a given pattern.
|
|
73
|
+
*
|
|
74
|
+
* @method
|
|
75
|
+
* @param {string} pattern
|
|
76
|
+
* @returns {Promise<Array>}
|
|
77
|
+
* @requires {TiCacheCapability.KEY_PATTERN_MATCH}
|
|
78
|
+
* @abstract
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
matchKeys(pattern: string): Promise<any[]>;
|
|
82
|
+
/**
|
|
83
|
+
* Used to set a specific string value.
|
|
84
|
+
*
|
|
85
|
+
* @method
|
|
86
|
+
* @param {string} key
|
|
87
|
+
* @param {string} value
|
|
88
|
+
* @param {number} [expiration] Expiration value is in seconds.
|
|
89
|
+
* @returns {Promise<string>}
|
|
90
|
+
* @abstract
|
|
91
|
+
* @public
|
|
92
|
+
*/
|
|
93
|
+
setValue(key: string, value: string, expiration?: number): Promise<string>;
|
|
94
|
+
/**
|
|
95
|
+
* Used to set multiple string values.
|
|
96
|
+
*
|
|
97
|
+
* @method
|
|
98
|
+
* @param {Object} keyValues
|
|
99
|
+
* @param {string} [prefix]
|
|
100
|
+
* @param {number} [expiration] Expiration value is in seconds.
|
|
101
|
+
* @returns {Promise}
|
|
102
|
+
* @abstract
|
|
103
|
+
* @public
|
|
104
|
+
*/
|
|
105
|
+
setValues(keyValues: Object, prefix?: string, expiration?: number): Promise<any>;
|
|
106
|
+
/**
|
|
107
|
+
* Used to get a string value.
|
|
108
|
+
*
|
|
109
|
+
* @method
|
|
110
|
+
* @param {string} key
|
|
111
|
+
* @returns {Promise}
|
|
112
|
+
* @abstract
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
getValue(key: string): Promise<any>;
|
|
116
|
+
/**
|
|
117
|
+
* Used to get multiple string values.
|
|
118
|
+
*
|
|
119
|
+
* @method
|
|
120
|
+
* @param {string[]} keys
|
|
121
|
+
* @param {string} [prefix]
|
|
122
|
+
* @returns {Promise}
|
|
123
|
+
* @abstract
|
|
124
|
+
* @public
|
|
125
|
+
*/
|
|
126
|
+
getValues(keys: string[], prefix?: string): Promise<any>;
|
|
127
|
+
/**
|
|
128
|
+
* Used to delete a value / item.
|
|
129
|
+
*
|
|
130
|
+
* @method
|
|
131
|
+
* @param {string} key
|
|
132
|
+
* @returns {Promise<boolean>}
|
|
133
|
+
* @abstract
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
deleteValue(key: string): Promise<boolean>;
|
|
137
|
+
/**
|
|
138
|
+
* Used to set expiration in seconds to an existing key.
|
|
139
|
+
*
|
|
140
|
+
* @method
|
|
141
|
+
* @param {string} key
|
|
142
|
+
* @param {number} seconds
|
|
143
|
+
* @param {string} [name] If a field in a hash set is to be expired instead, the name of that set.
|
|
144
|
+
* @returns {Promise<number>}
|
|
145
|
+
* @requires {TiCacheCapability.KEY_EXPIRY}
|
|
146
|
+
* @abstract
|
|
147
|
+
* @public
|
|
148
|
+
*/
|
|
149
|
+
expireValue(key: string, seconds: number, name?: string): Promise<number>;
|
|
150
|
+
/**
|
|
151
|
+
* Used to add the specified values to a list.
|
|
152
|
+
*
|
|
153
|
+
* @method
|
|
154
|
+
* @param {string} listName
|
|
155
|
+
* @param {Object[]} values
|
|
156
|
+
* @returns {Promise<number>}
|
|
157
|
+
* @requires {TiCacheCapability.LISTS}
|
|
158
|
+
* @abstract
|
|
159
|
+
* @public
|
|
160
|
+
*/
|
|
161
|
+
listPushValue(listName: string, values: Object[]): Promise<number>;
|
|
162
|
+
/**
|
|
163
|
+
* Used to add the specified value to a set.
|
|
164
|
+
*
|
|
165
|
+
* @method
|
|
166
|
+
* @param {string} key
|
|
167
|
+
* @param {string|Object} value
|
|
168
|
+
* @returns {Promise}
|
|
169
|
+
* @requires {TiCacheCapability.SETS}
|
|
170
|
+
* @abstract
|
|
171
|
+
* @public
|
|
172
|
+
*/
|
|
173
|
+
addToSet(key: string, value: string | Object): Promise<any>;
|
|
174
|
+
/**
|
|
175
|
+
* Used to add multiple values to multiple sets in one transactional request.
|
|
176
|
+
*
|
|
177
|
+
* @method
|
|
178
|
+
* @param {string[]} keys
|
|
179
|
+
* @param {string[]} values
|
|
180
|
+
* @returns {Promise}
|
|
181
|
+
* @requires {TiCacheCapability.SETS}
|
|
182
|
+
* @abstract
|
|
183
|
+
* @public
|
|
184
|
+
*/
|
|
185
|
+
addToSetMulti(keys: string[], values: string[]): Promise<any>;
|
|
186
|
+
/**
|
|
187
|
+
* Used to verify whether a value is a member of a set.
|
|
188
|
+
*
|
|
189
|
+
* @method
|
|
190
|
+
* @param {string} setName
|
|
191
|
+
* @param {string|Object} value
|
|
192
|
+
* @returns {Promise<boolean>}
|
|
193
|
+
* @requires {TiCacheCapability.SETS}
|
|
194
|
+
* @abstract
|
|
195
|
+
* @public
|
|
196
|
+
*/
|
|
197
|
+
isSetMember(setName: string, value: string | Object): Promise<boolean>;
|
|
198
|
+
/**
|
|
199
|
+
* Used to fetch all members of a set.
|
|
200
|
+
*
|
|
201
|
+
* @method
|
|
202
|
+
* @param {string} key
|
|
203
|
+
* @returns {Promise<Array>}
|
|
204
|
+
* @requires {TiCacheCapability.SETS}
|
|
205
|
+
* @abstract
|
|
206
|
+
* @public
|
|
207
|
+
*/
|
|
208
|
+
membersOfSet(key: string): Promise<any[]>;
|
|
209
|
+
/**
|
|
210
|
+
* Used to fetch the union of the provided sets.
|
|
211
|
+
*
|
|
212
|
+
* @method
|
|
213
|
+
* @param {string[]} keys
|
|
214
|
+
* @returns {Promise<Array>}
|
|
215
|
+
* @requires {TiCacheCapability.SETS}
|
|
216
|
+
* @abstract
|
|
217
|
+
* @public
|
|
218
|
+
*/
|
|
219
|
+
unionOfSets(keys: string[]): Promise<any[]>;
|
|
220
|
+
/**
|
|
221
|
+
* Used to set a single field in a hash set.
|
|
222
|
+
*
|
|
223
|
+
* @method
|
|
224
|
+
* @param {string} key
|
|
225
|
+
* @param {string} name
|
|
226
|
+
* @param {string|Object} value
|
|
227
|
+
* @returns {Promise}
|
|
228
|
+
* @requires {TiCacheCapability.HASH_FIELDS}
|
|
229
|
+
* @abstract
|
|
230
|
+
* @public
|
|
231
|
+
*/
|
|
232
|
+
hashSetField(key: string, name: string, value: string | Object): Promise<any>;
|
|
233
|
+
/**
|
|
234
|
+
* Used to set multiple fields in a hash set.
|
|
235
|
+
*
|
|
236
|
+
* @method
|
|
237
|
+
* @param {string} key
|
|
238
|
+
* @param {Object} fields
|
|
239
|
+
* @returns {Promise}
|
|
240
|
+
* @requires {TiCacheCapability.HASH_FIELDS}
|
|
241
|
+
* @abstract
|
|
242
|
+
* @public
|
|
243
|
+
*/
|
|
244
|
+
hashSetFields(key: string, fields: Object): Promise<any>;
|
|
245
|
+
/**
|
|
246
|
+
* Used to fetch a single field from a hash set.
|
|
247
|
+
*
|
|
248
|
+
* @method
|
|
249
|
+
* @param {string} key
|
|
250
|
+
* @param {string} field
|
|
251
|
+
* @returns {Promise}
|
|
252
|
+
* @requires {TiCacheCapability.HASH_FIELDS}
|
|
253
|
+
* @abstract
|
|
254
|
+
* @public
|
|
255
|
+
*/
|
|
256
|
+
hashGetField(key: string, field: string): Promise<any>;
|
|
257
|
+
/**
|
|
258
|
+
* Used to delete a single field from a hash set.
|
|
259
|
+
*
|
|
260
|
+
* @method
|
|
261
|
+
* @param {string} key
|
|
262
|
+
* @param {string} field
|
|
263
|
+
* @returns {Promise}
|
|
264
|
+
* @requires {TiCacheCapability.HASH_FIELDS}
|
|
265
|
+
* @abstract
|
|
266
|
+
* @public
|
|
267
|
+
*/
|
|
268
|
+
hashDeleteField(key: string, field: string): Promise<any>;
|
|
269
|
+
/**
|
|
270
|
+
* Used to store a JSON document, or a branch of one.
|
|
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.
|
|
276
|
+
* @param {number} [overrideMode=0] 0 allows full override; 1 sets only if absent; 2 sets only if present.
|
|
277
|
+
* @returns {Promise}
|
|
278
|
+
* @requires {TiCacheCapability.JSON_DOCUMENTS}
|
|
279
|
+
* @abstract
|
|
280
|
+
* @public
|
|
281
|
+
*/
|
|
282
|
+
setJSON(key: string, value: Object, path?: string | string[], overrideMode?: number): Promise<any>;
|
|
283
|
+
/**
|
|
284
|
+
* Used to fetch a JSON document, or a branch of one.
|
|
285
|
+
*
|
|
286
|
+
* @method
|
|
287
|
+
* @param {string} key
|
|
288
|
+
* @param {string|string[]} [path="$"] A dot-separated JSONPath string, or an array of literal key segments.
|
|
289
|
+
* @returns {Promise<Object>}
|
|
290
|
+
* @requires {TiCacheCapability.JSON_DOCUMENTS}
|
|
291
|
+
* @abstract
|
|
292
|
+
* @public
|
|
293
|
+
*/
|
|
294
|
+
getJSON(key: string, path?: string | string[]): Promise<Object>;
|
|
295
|
+
/**
|
|
296
|
+
* Used to merge a value into an existing JSON document at the given path.
|
|
297
|
+
* <br/>
|
|
298
|
+
* NOTE: Callers rely on this being applied atomically by the backend when {@link TiCacheCapability.ATOMIC_JSON_EDIT}
|
|
299
|
+
* is declared — two concurrent edits to different paths of the same document must both survive. A backend that can
|
|
300
|
+
* only read-modify-write must NOT declare that capability, because the loss is silent: nothing throws, and one of
|
|
301
|
+
* the two writes is simply gone.
|
|
302
|
+
*
|
|
303
|
+
* @method
|
|
304
|
+
* @param {string} key
|
|
305
|
+
* @param {Object} value
|
|
306
|
+
* @param {string|string[]} [path="$"] A dot-separated JSONPath string, or an array of literal key segments.
|
|
307
|
+
* @returns {Promise}
|
|
308
|
+
* @requires {TiCacheCapability.JSON_DOCUMENTS}
|
|
309
|
+
* @abstract
|
|
310
|
+
* @public
|
|
311
|
+
*/
|
|
312
|
+
editJSON(key: string, value: Object, path?: string | string[]): Promise<any>;
|
|
313
|
+
/**
|
|
314
|
+
* Used to append a value to an array inside a JSON document.
|
|
315
|
+
*
|
|
316
|
+
* @method
|
|
317
|
+
* @param {string} key
|
|
318
|
+
* @param {Object} value
|
|
319
|
+
* @param {string|string[]} [path="$"] A dot-separated JSONPath string, or an array of literal key segments.
|
|
320
|
+
* @returns {Promise}
|
|
321
|
+
* @requires {TiCacheCapability.JSON_DOCUMENTS}
|
|
322
|
+
* @abstract
|
|
323
|
+
* @public
|
|
324
|
+
*/
|
|
325
|
+
arrayAppendJSON(key: string, value: Object, path?: string | string[]): Promise<any>;
|
|
326
|
+
}
|