@opra/elastic 1.5.3 → 1.5.5
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.
|
@@ -299,7 +299,8 @@ class ElasticEntityService extends elastic_service_js_1.ElasticService {
|
|
|
299
299
|
* @param operation - The operation to retrieve the encoder for. Valid values are 'create' and 'update'.
|
|
300
300
|
*/
|
|
301
301
|
_getInputCodec(operation) {
|
|
302
|
-
|
|
302
|
+
const cacheKey = operation + (this._dataTypeScope ? ':' + this._dataTypeScope : '');
|
|
303
|
+
let validator = this._inputCodecs[cacheKey];
|
|
303
304
|
if (validator)
|
|
304
305
|
return validator;
|
|
305
306
|
const options = {
|
|
@@ -310,14 +311,15 @@ class ElasticEntityService extends elastic_service_js_1.ElasticService {
|
|
|
310
311
|
options.partial = 'deep';
|
|
311
312
|
const dataType = this.dataType;
|
|
312
313
|
validator = dataType.generateCodec('decode', options);
|
|
313
|
-
this._inputCodecs[
|
|
314
|
+
this._inputCodecs[cacheKey] = validator;
|
|
314
315
|
return validator;
|
|
315
316
|
}
|
|
316
317
|
/**
|
|
317
318
|
* Retrieves the codec.
|
|
318
319
|
*/
|
|
319
320
|
_getOutputCodec(operation) {
|
|
320
|
-
|
|
321
|
+
const cacheKey = operation + (this._dataTypeScope ? ':' + this._dataTypeScope : '');
|
|
322
|
+
let validator = this._outputCodecs[cacheKey];
|
|
321
323
|
if (validator)
|
|
322
324
|
return validator;
|
|
323
325
|
const options = {
|
|
@@ -327,7 +329,7 @@ class ElasticEntityService extends elastic_service_js_1.ElasticService {
|
|
|
327
329
|
};
|
|
328
330
|
const dataType = this.dataType;
|
|
329
331
|
validator = dataType.generateCodec('decode', options);
|
|
330
|
-
this._outputCodecs[
|
|
332
|
+
this._outputCodecs[cacheKey] = validator;
|
|
331
333
|
return validator;
|
|
332
334
|
}
|
|
333
335
|
async _executeCommand(command, commandFn) {
|
|
@@ -296,7 +296,8 @@ export class ElasticEntityService extends ElasticService {
|
|
|
296
296
|
* @param operation - The operation to retrieve the encoder for. Valid values are 'create' and 'update'.
|
|
297
297
|
*/
|
|
298
298
|
_getInputCodec(operation) {
|
|
299
|
-
|
|
299
|
+
const cacheKey = operation + (this._dataTypeScope ? ':' + this._dataTypeScope : '');
|
|
300
|
+
let validator = this._inputCodecs[cacheKey];
|
|
300
301
|
if (validator)
|
|
301
302
|
return validator;
|
|
302
303
|
const options = {
|
|
@@ -307,14 +308,15 @@ export class ElasticEntityService extends ElasticService {
|
|
|
307
308
|
options.partial = 'deep';
|
|
308
309
|
const dataType = this.dataType;
|
|
309
310
|
validator = dataType.generateCodec('decode', options);
|
|
310
|
-
this._inputCodecs[
|
|
311
|
+
this._inputCodecs[cacheKey] = validator;
|
|
311
312
|
return validator;
|
|
312
313
|
}
|
|
313
314
|
/**
|
|
314
315
|
* Retrieves the codec.
|
|
315
316
|
*/
|
|
316
317
|
_getOutputCodec(operation) {
|
|
317
|
-
|
|
318
|
+
const cacheKey = operation + (this._dataTypeScope ? ':' + this._dataTypeScope : '');
|
|
319
|
+
let validator = this._outputCodecs[cacheKey];
|
|
318
320
|
if (validator)
|
|
319
321
|
return validator;
|
|
320
322
|
const options = {
|
|
@@ -324,7 +326,7 @@ export class ElasticEntityService extends ElasticService {
|
|
|
324
326
|
};
|
|
325
327
|
const dataType = this.dataType;
|
|
326
328
|
validator = dataType.generateCodec('decode', options);
|
|
327
|
-
this._outputCodecs[
|
|
329
|
+
this._outputCodecs[cacheKey] = validator;
|
|
328
330
|
return validator;
|
|
329
331
|
}
|
|
330
332
|
async _executeCommand(command, commandFn) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/elastic",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.5",
|
|
4
4
|
"description": "Opra Elastic Search adapter package",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
13
|
"@elastic/elasticsearch": ">=8.7.0",
|
|
14
|
-
"@opra/common": "^1.5.
|
|
15
|
-
"@opra/core": "^1.5.
|
|
14
|
+
"@opra/common": "^1.5.5",
|
|
15
|
+
"@opra/core": "^1.5.5"
|
|
16
16
|
},
|
|
17
17
|
"type": "module",
|
|
18
18
|
"exports": {
|