@opra/sqb 1.5.2 → 1.5.4

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.
@@ -99,7 +99,8 @@ class SqbEntityService extends sqb_service_base_js_1.SqbServiceBase {
99
99
  * @param operation - The operation to retrieve the encoder for. Valid values are 'create' and 'update'.
100
100
  */
101
101
  getInputCodec(operation) {
102
- let validator = this._inputCodecs[operation];
102
+ const cacheKey = operation + (this._dataTypeScope ? ':' + this._dataTypeScope : '');
103
+ let validator = this._inputCodecs[cacheKey];
103
104
  if (validator)
104
105
  return validator;
105
106
  const options = {
@@ -110,14 +111,15 @@ class SqbEntityService extends sqb_service_base_js_1.SqbServiceBase {
110
111
  options.partial = 'deep';
111
112
  const dataType = this.dataType;
112
113
  validator = dataType.generateCodec('decode', options);
113
- this._inputCodecs[operation] = validator;
114
+ this._inputCodecs[cacheKey] = validator;
114
115
  return validator;
115
116
  }
116
117
  /**
117
118
  * Retrieves the codec.
118
119
  */
119
120
  getOutputCodec(operation) {
120
- let validator = this._outputCodecs[operation];
121
+ const cacheKey = operation + (this._dataTypeScope ? ':' + this._dataTypeScope : '');
122
+ let validator = this._outputCodecs[cacheKey];
121
123
  if (validator)
122
124
  return validator;
123
125
  const options = {
@@ -127,7 +129,7 @@ class SqbEntityService extends sqb_service_base_js_1.SqbServiceBase {
127
129
  };
128
130
  const dataType = this.dataType;
129
131
  validator = dataType.generateCodec('decode', options);
130
- this._outputCodecs[operation] = validator;
132
+ this._outputCodecs[cacheKey] = validator;
131
133
  return validator;
132
134
  }
133
135
  /**
@@ -96,7 +96,8 @@ export class SqbEntityService extends SqbServiceBase {
96
96
  * @param operation - The operation to retrieve the encoder for. Valid values are 'create' and 'update'.
97
97
  */
98
98
  getInputCodec(operation) {
99
- let validator = this._inputCodecs[operation];
99
+ const cacheKey = operation + (this._dataTypeScope ? ':' + this._dataTypeScope : '');
100
+ let validator = this._inputCodecs[cacheKey];
100
101
  if (validator)
101
102
  return validator;
102
103
  const options = {
@@ -107,14 +108,15 @@ export class SqbEntityService extends SqbServiceBase {
107
108
  options.partial = 'deep';
108
109
  const dataType = this.dataType;
109
110
  validator = dataType.generateCodec('decode', options);
110
- this._inputCodecs[operation] = validator;
111
+ this._inputCodecs[cacheKey] = validator;
111
112
  return validator;
112
113
  }
113
114
  /**
114
115
  * Retrieves the codec.
115
116
  */
116
117
  getOutputCodec(operation) {
117
- let validator = this._outputCodecs[operation];
118
+ const cacheKey = operation + (this._dataTypeScope ? ':' + this._dataTypeScope : '');
119
+ let validator = this._outputCodecs[cacheKey];
118
120
  if (validator)
119
121
  return validator;
120
122
  const options = {
@@ -124,7 +126,7 @@ export class SqbEntityService extends SqbServiceBase {
124
126
  };
125
127
  const dataType = this.dataType;
126
128
  validator = dataType.generateCodec('decode', options);
127
- this._outputCodecs[operation] = validator;
129
+ this._outputCodecs[cacheKey] = validator;
128
130
  return validator;
129
131
  }
130
132
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/sqb",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "description": "Opra SQB adapter package",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -10,8 +10,8 @@
10
10
  "valgen": "^5.12.0"
11
11
  },
12
12
  "peerDependencies": {
13
- "@opra/core": "^1.5.2",
14
- "@opra/http": "^1.5.2",
13
+ "@opra/core": "^1.5.4",
14
+ "@opra/http": "^1.5.4",
15
15
  "@sqb/connect": ">= 4.19.1"
16
16
  },
17
17
  "type": "module",