@opra/mongodb 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.
|
@@ -242,7 +242,8 @@ class MongoService extends core_1.ServiceBase {
|
|
|
242
242
|
* @param operation - The operation to retrieve the encoder for. Valid values are 'create' and 'update'.
|
|
243
243
|
*/
|
|
244
244
|
_getInputCodec(operation) {
|
|
245
|
-
|
|
245
|
+
const cacheKey = operation + (this._dataTypeScope ? ':' + this._dataTypeScope : '');
|
|
246
|
+
let validator = this._inputCodecs[cacheKey];
|
|
246
247
|
if (validator)
|
|
247
248
|
return validator;
|
|
248
249
|
const options = {
|
|
@@ -255,14 +256,15 @@ class MongoService extends core_1.ServiceBase {
|
|
|
255
256
|
}
|
|
256
257
|
const dataType = this.dataType;
|
|
257
258
|
validator = dataType.generateCodec('decode', options);
|
|
258
|
-
this._inputCodecs[
|
|
259
|
+
this._inputCodecs[cacheKey] = validator;
|
|
259
260
|
return validator;
|
|
260
261
|
}
|
|
261
262
|
/**
|
|
262
263
|
* Retrieves the codec.
|
|
263
264
|
*/
|
|
264
265
|
_getOutputCodec(operation) {
|
|
265
|
-
|
|
266
|
+
const cacheKey = operation + (this._dataTypeScope ? ':' + this._dataTypeScope : '');
|
|
267
|
+
let validator = this._outputCodecs[cacheKey];
|
|
266
268
|
if (validator)
|
|
267
269
|
return validator;
|
|
268
270
|
const options = {
|
|
@@ -272,7 +274,7 @@ class MongoService extends core_1.ServiceBase {
|
|
|
272
274
|
};
|
|
273
275
|
const dataType = this.dataType;
|
|
274
276
|
validator = dataType.generateCodec('decode', options);
|
|
275
|
-
this._outputCodecs[
|
|
277
|
+
this._outputCodecs[cacheKey] = validator;
|
|
276
278
|
return validator;
|
|
277
279
|
}
|
|
278
280
|
}
|
|
@@ -239,7 +239,8 @@ export class MongoService extends ServiceBase {
|
|
|
239
239
|
* @param operation - The operation to retrieve the encoder for. Valid values are 'create' and 'update'.
|
|
240
240
|
*/
|
|
241
241
|
_getInputCodec(operation) {
|
|
242
|
-
|
|
242
|
+
const cacheKey = operation + (this._dataTypeScope ? ':' + this._dataTypeScope : '');
|
|
243
|
+
let validator = this._inputCodecs[cacheKey];
|
|
243
244
|
if (validator)
|
|
244
245
|
return validator;
|
|
245
246
|
const options = {
|
|
@@ -252,14 +253,15 @@ export class MongoService extends ServiceBase {
|
|
|
252
253
|
}
|
|
253
254
|
const dataType = this.dataType;
|
|
254
255
|
validator = dataType.generateCodec('decode', options);
|
|
255
|
-
this._inputCodecs[
|
|
256
|
+
this._inputCodecs[cacheKey] = validator;
|
|
256
257
|
return validator;
|
|
257
258
|
}
|
|
258
259
|
/**
|
|
259
260
|
* Retrieves the codec.
|
|
260
261
|
*/
|
|
261
262
|
_getOutputCodec(operation) {
|
|
262
|
-
|
|
263
|
+
const cacheKey = operation + (this._dataTypeScope ? ':' + this._dataTypeScope : '');
|
|
264
|
+
let validator = this._outputCodecs[cacheKey];
|
|
263
265
|
if (validator)
|
|
264
266
|
return validator;
|
|
265
267
|
const options = {
|
|
@@ -269,7 +271,7 @@ export class MongoService extends ServiceBase {
|
|
|
269
271
|
};
|
|
270
272
|
const dataType = this.dataType;
|
|
271
273
|
validator = dataType.generateCodec('decode', options);
|
|
272
|
-
this._outputCodecs[
|
|
274
|
+
this._outputCodecs[cacheKey] = validator;
|
|
273
275
|
return validator;
|
|
274
276
|
}
|
|
275
277
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/mongodb",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.5",
|
|
4
4
|
"description": "Opra MongoDB adapter package",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"valgen": "^5.12.0"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@opra/common": "^1.5.
|
|
14
|
-
"@opra/core": "^1.5.
|
|
15
|
-
"@opra/http": "^1.5.
|
|
13
|
+
"@opra/common": "^1.5.5",
|
|
14
|
+
"@opra/core": "^1.5.5",
|
|
15
|
+
"@opra/http": "^1.5.5",
|
|
16
16
|
"mongodb": ">= 6.0.0"
|
|
17
17
|
},
|
|
18
18
|
"type": "module",
|