@rsdk/grpc.clients 3.0.1-next.0 → 3.1.0-next.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 CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.1.0-next.0](https://github.com/R-Vision/rsdk/compare/v3.0.2...v3.1.0-next.0) (2023-08-08)
7
+
8
+ ### Features
9
+
10
+ * added exception code to payload ([#92](https://github.com/R-Vision/rsdk/issues/92)) ([6a9565b](https://github.com/R-Vision/rsdk/commit/6a9565b23746122676abb1f5166f9ef8b181864b))
11
+
12
+ ## [3.0.2](https://github.com/R-Vision/rsdk/compare/v3.0.1...v3.0.2) (2023-08-07)
13
+
14
+ **Note:** Version bump only for package @rsdk/grpc.clients
15
+
16
+ ## [3.0.1](https://github.com/R-Vision/rsdk/compare/v3.0.0...v3.0.1) (2023-08-07)
17
+
18
+ ### Bug Fixes
19
+
20
+ * **deps:** correctly peerDependencies ([349628f](https://github.com/R-Vision/rsdk/commit/349628f10da46a30d6c8b9f9387e010869318212))
21
+
6
22
  ## [3.0.1-next.0](https://github.com/R-Vision/rsdk/compare/v3.0.0...v3.0.1-next.0) (2023-08-07)
7
23
 
8
24
  **Note:** Version bump only for package @rsdk/grpc.clients
@@ -33,32 +33,11 @@ async function* (call, options) {
33
33
  cause: error,
34
34
  });
35
35
  }
36
- const message = 'GRPC Call failed!';
36
+ const message = status?.message ?? error.details ?? 'GRPC Call failed!';
37
37
  const props = {
38
- details: {
39
- /*
40
- * Details - will be original message from server,
41
- * while message field will be a composite string with
42
- * status path and original message in one line
43
- */
44
- message: error.details,
45
- /**
46
- * GRPC-package and method
47
- */
48
- path: error.path,
49
- /**
50
- * A developer-facing error message, which should be in English. Any
51
- * user-facing error message should be localized and sent in the
52
- * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
53
- *
54
- * https://github.com/deeplay-io/nice-grpc/blob/f0db4d130e1243db1cecb6586dca679e5d9b8fd5/packages/nice-grpc-error-details/proto/google/rpc/status.proto#L39
55
- */
56
- statusMessage: status?.message,
57
- /**
58
- * any context from call
59
- */
60
- details: status?.details,
61
- },
38
+ details: status?.details,
39
+ code: status?.exceptionCode,
40
+ cause: error,
62
41
  };
63
42
  /**
64
43
  * According to /docs/images/exceptions.mapping.png
@@ -1 +1 @@
1
- {"version":3,"file":"exception-mapper.middleware.js","sourceRoot":"","sources":["../../src/middleware/exception-mapper.middleware.ts"],"names":[],"mappings":";;;AAAA,2EAAyE;AACzE,qCASoB;AACpB,yCAAkE;AAGlE;;GAEG;AACI,MAAM,yBAAyB,GAAG,GAAqB,EAAE;AAC9D,+DAA+D;AAC/D,KAAK,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO;IAC5B,IAAI,MAA0B,CAAC;IAE/B,IAAI;QACF,OAAO,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACpC,GAAG,OAAO;YACV;;;eAGG;YACH,SAAS,CAAC,OAAO;gBACf,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;gBAE7D,IAAI,aAAa,IAAI,IAAI,EAAE;oBACzB,MAAM,GAAG,cAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;iBACvC;gBAED,OAAO,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,CAAC;YAC/B,CAAC;SACF,CAAC,CAAC;KACJ;IAAC,OAAO,KAAc,EAAE;QACvB,IAAI,CAAC,CAAC,KAAK,YAAY,uBAAW,CAAC,EAAE;YACnC,MAAM,IAAI,wBAAiB,CAAC,qCAAqC,EAAE;gBACjE,KAAK,EAAE,KAAK;aACb,CAAC,CAAC;SACJ;QAED,MAAM,OAAO,GAAG,mBAAmB,CAAC;QACpC,MAAM,KAAK,GAAG;YACZ,OAAO,EAAE;gBACP;;;;mBAIG;gBACH,OAAO,EAAE,KAAK,CAAC,OAAO;gBAEtB;;mBAEG;gBACH,IAAI,EAAE,KAAK,CAAC,IAAI;gBAEhB;;;;;;mBAMG;gBACH,aAAa,EAAE,MAAM,EAAE,OAAO;gBAE9B;;mBAEG;gBACH,OAAO,EAAE,MAAM,EAAE,OAAO;aACzB;SACF,CAAC;QAEF;;WAEG;QAEH,qDAAqD;QACrD,QAAQ,KAAK,CAAC,IAAI,EAAE;YAClB,KAAK,kBAAc,CAAC,iBAAiB;gBACnC,MAAM,IAAI,uBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC7C,KAAK,kBAAc,CAAC,gBAAgB;gBAClC,MAAM,IAAI,qBAAc,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC3C,KAAK,kBAAc,CAAC,cAAc;gBAChC,MAAM,IAAI,+BAAwB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YACrD,KAAK,kBAAc,CAAC,mBAAmB;gBACrC,MAAM,IAAI,wBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC9C,KAAK,kBAAc,CAAC,eAAe;gBACjC,MAAM,IAAI,oBAAa,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC1C,KAAK,kBAAc,CAAC,iBAAiB;gBACnC,MAAM,IAAI,0BAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAChD,KAAK,kBAAc,CAAC,SAAS;gBAC3B,MAAM,IAAI,wBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC9C;gBACE,MAAM,IAAI,wBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;SAC/C;KACF;AACH,CAAC,CAAC;AApFS,QAAA,yBAAyB,6BAoFlC"}
1
+ {"version":3,"file":"exception-mapper.middleware.js","sourceRoot":"","sources":["../../src/middleware/exception-mapper.middleware.ts"],"names":[],"mappings":";;;AAAA,2EAAyE;AAEzE,qCASoB;AAC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K,kBAAc,CAAC,cAAc;gBAChC,MAAM,IAAI,+BAAwB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YACrD,KAAK,kBAAc,CAAC,mBAAmB;gBACrC,MAAM,IAAI,wBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC9C,KAAK,kBAAc,CAAC,eAAe;gBACjC,MAAM,IAAI,oBAAa,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC1C,KAAK,kBAAc,CAAC,iBAAiB;gBACnC,MAAM,IAAI,0BAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAChD,KAAK,kBAAc,CAAC,SAAS;gBAC3B,MAAM,IAAI,wBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC9C;gBACE,MAAM,IAAI,wBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;SAC/C;KACF;AACH,CAAC,CAAC;AA5DS,QAAA,yBAAyB,6BA4DlC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsdk/grpc.clients",
3
- "version": "3.0.1-next.0",
3
+ "version": "3.1.0-next.0",
4
4
  "description": "Grpc clients infrastructure",
5
5
  "license": "Apache License 2.0",
6
6
  "publishConfig": {
@@ -17,16 +17,16 @@
17
17
  "@grpc/grpc-js": "^1.8.7",
18
18
  "@nestjs/common": "^10.1.3",
19
19
  "@nestjs/microservices": "^10.1.3",
20
- "@rsdk/autodoc.protocol": "^3.0.0",
21
- "@rsdk/builtin-contract": "*",
22
- "@rsdk/common": "^3.0.0",
23
- "@rsdk/core": "^3.0.1-next.0",
24
- "@rsdk/grpc.common": "^3.0.1-next.0",
25
- "@rsdk/logging": "^3.0.0",
26
- "@rsdk/metadata": "^3.0.0",
20
+ "@rsdk/autodoc.protocol": "^3.1.0-next.0",
21
+ "@rsdk/builtin-contract": "^3.1.0-next.0",
22
+ "@rsdk/common": "^3.1.0-next.0",
23
+ "@rsdk/core": "^3.1.0-next.0",
24
+ "@rsdk/grpc.common": "^3.1.0-next.0",
25
+ "@rsdk/logging": "^3.1.0-next.0",
26
+ "@rsdk/metadata": "^3.1.0-next.0",
27
27
  "nice-grpc": "^2.1.4",
28
28
  "nice-grpc-opentelemetry": "^0.1.2",
29
29
  "rxjs": "^7.0.0"
30
30
  },
31
- "gitHead": "fc4e33568c2e79d62977fc6e17175e08893cb196"
31
+ "gitHead": "55598931db264fb6d5b5c4787c48298ed86bbc0d"
32
32
  }
@@ -1,4 +1,5 @@
1
1
  import { Status } from '@rsdk/builtin-contract/dist/grpc/error/v1/error';
2
+ import type { ExceptionsProps } from '@rsdk/core';
2
3
  import {
3
4
  AuthException,
4
5
  ConflictException,
@@ -44,35 +45,11 @@ export const exceptionMapperMiddleware = (): ClientMiddleware =>
44
45
  });
45
46
  }
46
47
 
47
- const message = 'GRPC Call failed!';
48
- const props = {
49
- details: {
50
- /*
51
- * Details - will be original message from server,
52
- * while message field will be a composite string with
53
- * status path and original message in one line
54
- */
55
- message: error.details,
56
-
57
- /**
58
- * GRPC-package and method
59
- */
60
- path: error.path,
61
-
62
- /**
63
- * A developer-facing error message, which should be in English. Any
64
- * user-facing error message should be localized and sent in the
65
- * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
66
- *
67
- * https://github.com/deeplay-io/nice-grpc/blob/f0db4d130e1243db1cecb6586dca679e5d9b8fd5/packages/nice-grpc-error-details/proto/google/rpc/status.proto#L39
68
- */
69
- statusMessage: status?.message,
70
-
71
- /**
72
- * any context from call
73
- */
74
- details: status?.details,
75
- },
48
+ const message = status?.message ?? error.details ?? 'GRPC Call failed!';
49
+ const props: ExceptionsProps = {
50
+ details: status?.details,
51
+ code: status?.exceptionCode,
52
+ cause: error,
76
53
  };
77
54
 
78
55
  /**