@restorecommerce/chassis-srv 1.1.0 → 1.1.2

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 CHANGED
@@ -1,3 +1,11 @@
1
+ ### 1.1.2 (October 14th, 2022)
2
+
3
+ - updated dependencies
4
+
5
+ ### 1.1.1 (October 14th, 2022)
6
+
7
+ - updated dependencies logger (for centralized field handling), protos (address changes)
8
+
1
9
  ### 1.1.0 (October 4th, 2022)
2
10
 
3
11
  - support for full text search
@@ -154,8 +154,7 @@ The following View specific configuration properties are available:
154
154
  * `view.similarityThreshold` [`number`]: to assess the similarity of longer strings that share subsequences value betwen `0.0` and `1.0`
155
155
  * `view.options`: View Options containing list of `fields` to be indexed with applicable `analyzers` for each field.
156
156
 
157
- Refer test for further
158
- For more details refer https://github.com/restorecommerce/chassis-srv/blob/master/test/database.spec.ts#L525[full text search tests].
157
+ Refer test for further details https://github.com/restorecommerce/chassis-srv/blob/master/test/database.spec.ts#L525[full text search tests].
159
158
 
160
159
  [#configuration_command_interface]
161
160
  === Command Interface
@@ -17,10 +17,10 @@ exports.tracingMiddleware = tracingMiddleware;
17
17
  const loggingMiddleware = (logger) => {
18
18
  return async function* (call, context) {
19
19
  const { path } = call.method;
20
- logger.verbose(`[rid: ${context.rid}] received request to method ${path}`, call);
20
+ logger.verbose(`[rid: ${context.rid}] received request to method ${path}`, call.request);
21
21
  try {
22
22
  const response = yield* call.next(call.request, context);
23
- logger.verbose(`[rid: ${context.rid}] request to method ${path} response`, { request: call, response });
23
+ logger.verbose(`[rid: ${context.rid}] request to method ${path} response`, { request: call.request, response });
24
24
  return response;
25
25
  }
26
26
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"middlewares.js","sourceRoot":"","sources":["../../../../../src/microservice/transport/provider/grpc/middlewares.ts"],"names":[],"mappings":";;;AAAA,yCAA2E;AAC3E,2DAAkD;AAElD,+BAAoC;AAEpC,MAAM,aAAa,GAAG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AI,IAAA,iCAAY,EAAC,KAAK,CAAC,EAAE;gBAC9B,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,sBAAsB,IAAI,SAAS,EAAE;oBAC9D,OAAO,EAAE,KAAK,CAAC,OAAO;oBACtB,KAAK,EAAE,KAAK,CAAC,KAAK;iBACnB,CAAC,CAAC;aACJ;iBAAM;gBACL,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,sBAAsB,IAAI,QAAQ,EAAE;oBAC7D,OAAO,EAAE,KAAK,CAAC,OAAO;oBACtB,KAAK,EAAE,KAAK,CAAC,KAAK;iBACnB,CAAC,CAAC;aACJ;YAED,OAAO;gBACL,MAAM,EAAE;oBACN,IAAI,EAAE,GAAG;oBACT,OAAO,EAAE,KAAK,CAAC,OAAO;iBACvB;aACmB,CAAC;SACxB;IACH,CAAC,CAAC;AACJ,CAAC,CAAC;AAvCW,QAAA,iBAAiB,qBAuC5B"}
1
+ {"version":3,"file":"middlewares.js","sourceRoot":"","sources":["../../../../../src/microservice/transport/provider/grpc/middlewares.ts"],"names":[],"mappings":";;;AAAA,yCAA2E;AAC3E,2DAAkD;AAElD,+BAAoC;AAEpC,MAAM,aAAa,GAAG,cAAc,CAAC;AAM9B,KAAK,SAAS,CAAC,CAAC,iBAAiB,CACtC,IAA4D,EAC5D,OAAoB;IAEpB,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,IAAA,SAAM,GAAE,CAAC;IAC/D,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAC7C,OAAO,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;QACpC,GAAG,OAAO;QACV,GAAG,EAAE,MAAM;KACZ,CAAC,CAAC;AACL,CAAC;AAVD,8CAUC;AAEM,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAE,EAAE;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N,IAAI,EAAE,GAAG;oBACT,OAAO,EAAE,KAAK,CAAC,OAAO;iBACvB;aACmB,CAAC;SACxB;IACH,CAAC,CAAC;AACJ,CAAC,CAAC;AAvCW,QAAA,iBAAiB,qBAuC5B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@restorecommerce/chassis-srv",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Restore Commerce microservice chassis",
5
5
  "main": "./lib/index.js",
6
6
  "author": "n-fuse GmbH",
@@ -18,20 +18,20 @@
18
18
  "typings": "lib/index.d.ts",
19
19
  "dependencies": {
20
20
  "@grpc/grpc-js": "^1.7.1",
21
- "@restorecommerce/grpc-client": "^1.0.1",
22
- "@restorecommerce/kafka-client": "^1.0.2",
23
- "@restorecommerce/logger": "^1.1.0",
24
- "@restorecommerce/protos": "^1.1.0",
25
- "@restorecommerce/rc-grpc-clients": "^1.1.0",
26
- "@restorecommerce/service-config": "^1.0.1",
21
+ "@restorecommerce/grpc-client": "^1.0.3",
22
+ "@restorecommerce/kafka-client": "^1.0.4",
23
+ "@restorecommerce/logger": "^1.2.1",
24
+ "@restorecommerce/protos": "^2.0.1",
25
+ "@restorecommerce/rc-grpc-clients": "^2.0.1",
26
+ "@restorecommerce/service-config": "^1.0.3",
27
27
  "arangojs": "^7.8.0",
28
28
  "async": "^3.2.4",
29
29
  "async-retry": "^1.3.3",
30
30
  "cache-manager": "^4.1.0",
31
31
  "cls-hooked": "^4.2.2",
32
32
  "cls-rtracer": "^2.6.2",
33
- "google-protobuf": "^3.21.0",
34
- "kafkajs": "^2.2.0",
33
+ "google-protobuf": "^3.21.2",
34
+ "kafkajs": "^2.2.1",
35
35
  "lodash": "^4.17.21",
36
36
  "long": "^5.2.0",
37
37
  "nedb": "^1.8.0",
@@ -46,12 +46,12 @@
46
46
  "@types/long": "^5.0.0",
47
47
  "@types/mocha": "^10.0.0",
48
48
  "@types/nedb": "^1.8.12",
49
- "@types/node": "^18.8.1",
50
- "@typescript-eslint/eslint-plugin": "^5.39.0",
51
- "@typescript-eslint/eslint-plugin-tslint": "^5.39.0",
52
- "@typescript-eslint/parser": "^5.39.0",
49
+ "@types/node": "^18.8.5",
50
+ "@typescript-eslint/eslint-plugin": "^5.40.0",
51
+ "@typescript-eslint/eslint-plugin-tslint": "^5.40.0",
52
+ "@typescript-eslint/parser": "^5.40.0",
53
53
  "cross-env": "^7.0.3",
54
- "eslint": "^8.24.0",
54
+ "eslint": "^8.25.0",
55
55
  "eslint-plugin-prefer-arrow-functions": "^3.1.4",
56
56
  "mocha": "^10.0.0",
57
57
  "mocha-typescript": "^1.1.17",
@@ -1 +0,0 @@
1
- export {};
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // TODO Re-implement
4
- const removeBufferFields = (object, ctx) => {
5
- // Check if the cfg file contains any bufferFields and remove them
6
- if (!object) {
7
- object = {};
8
- }
9
- if (ctx.config && ctx.config.services) {
10
- const service = ctx.config.services;
11
- const servicesKeys = Object.keys(ctx.config.services);
12
- for (let key of servicesKeys) {
13
- // bufferFields
14
- if (service[key] && service[key][ctx.method] && service[key][ctx.method].bufferFields) {
15
- let bufferFields = service[key][ctx.method].bufferFields;
16
- const bufferKeys = Object.keys(bufferFields);
17
- for (let key of bufferKeys) {
18
- const bufferField = bufferFields[key];
19
- // if any bufferField is found
20
- // delete it from the cloned object
21
- if (object[bufferField]) {
22
- delete object[bufferField];
23
- }
24
- // delete it from the test case
25
- if (object.items && object.items[0]
26
- && object.items[0].data) {
27
- delete object.items[0].data;
28
- }
29
- }
30
- }
31
- // maskFields
32
- if (service[key] && service[key][ctx.method] && service[key][ctx.method].maskFields) {
33
- let maskFields = service[key][ctx.method].maskFields;
34
- for (let maskField of maskFields) {
35
- // if any maskField is configured, mask it
36
- if (object[maskField]) {
37
- const maskLength = object[maskField].length;
38
- object[maskField] = '*'.repeat(maskLength);
39
- }
40
- // delete it from the test case
41
- if (object.items && object.items[0]
42
- && object.items[0].data) {
43
- delete object.items[0].data;
44
- }
45
- }
46
- }
47
- }
48
- }
49
- return object;
50
- };
51
- //# sourceMappingURL=endpoint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../src/microservice/endpoint.ts"],"names":[],"mappings":";;AAAA,oBAAoB;AACpB,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;IACzC,kEAAkE;IAClE,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,GAAG,EAAE,CAAC;KACb;IACD,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE;QACrC,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC;QACpC,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACtD,KAAK,IAAI,GAAG,IAAI,YAAY,EAAE;YAC5B,eAAe;YACf,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,YAAY,EAAE;gBACrF,IAAI,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC;gBACzD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBAC7C,KAAK,IAAI,GAAG,IAAI,UAAU,EAAE;oBAC1B,MAAM,WAAW,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;oBACtC,8BAA8B;oBAC9B,mCAAmC;oBACnC,IAAI,MAAM,CAAC,WAAW,CAAC,EAAE;wBACvB,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC;qBAC5B;oBACD,+BAA+B;oBAC/B,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