@lakutata/nats 1.5.1 → 1.5.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
@@ -3,6 +3,14 @@
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
+ ## [1.5.2](https://github.com/lakutata/lakutata-packages/compare/@lakutata/nats@1.5.1...@lakutata/nats@1.5.2) (2026-01-11)
7
+
8
+ **Note:** Version bump only for package @lakutata/nats
9
+
10
+
11
+
12
+
13
+
6
14
  ## [1.5.1](https://github.com/lakutata/lakutata-packages/compare/@lakutata/nats@1.5.0...@lakutata/nats@1.5.1) (2025-12-28)
7
15
 
8
16
  **Note:** Version bump only for package @lakutata/nats
@@ -1,5 +1,6 @@
1
1
  import { Exception } from 'lakutata';
2
2
  export declare class ServiceInvokeException extends Exception {
3
3
  errno: string | number;
4
+ service?: string;
4
5
  }
5
6
  //# sourceMappingURL=ServiceInvokeException.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ServiceInvokeException.d.ts","sourceRoot":"","sources":["../../src/exceptions/ServiceInvokeException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAA;AAElC,qBAAa,sBAAuB,SAAQ,SAAS;IAC1C,KAAK,EAAE,MAAM,GAAG,MAAM,CAAqB;CACrD"}
1
+ {"version":3,"file":"ServiceInvokeException.d.ts","sourceRoot":"","sources":["../../src/exceptions/ServiceInvokeException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAA;AAElC,qBAAa,sBAAuB,SAAQ,SAAS;IAC1C,KAAK,EAAE,MAAM,GAAG,MAAM,CAAqB;IAE3C,OAAO,CAAC,EAAC,MAAM,CAAA;CACzB"}
@@ -14,8 +14,9 @@ export declare class ServiceResponseCodec {
14
14
  /**
15
15
  * Decode service response
16
16
  * @param response
17
+ * @param serviceId
17
18
  */
18
- static decode(response: ServiceResponse): any;
19
+ static decode(response: ServiceResponse, serviceId?: string): any;
19
20
  }
20
21
  export {};
21
22
  //# sourceMappingURL=ServiceResponseCodec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ServiceResponseCodec.d.ts","sourceRoot":"","sources":["../../src/lib/ServiceResponseCodec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAA;AAGlC,UAAU,eAAe;IACrB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI,CAAA;IACxC,QAAQ,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAA;CAC/B;AAED,qBAAa,oBAAoB;IAC7B;;;;OAIG;WACW,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,GAAG,eAAe;IAYlE;;;OAGG;WACW,MAAM,CAAC,QAAQ,EAAE,eAAe,GAAG,GAAG;CAQvD"}
1
+ {"version":3,"file":"ServiceResponseCodec.d.ts","sourceRoot":"","sources":["../../src/lib/ServiceResponseCodec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAA;AAGlC,UAAU,eAAe;IACrB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI,CAAA;IACxC,QAAQ,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAA;CAC/B;AAED,qBAAa,oBAAoB;IAC7B;;;;OAIG;WACW,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,GAAG,eAAe;IAYlE;;;;OAIG;WACW,MAAM,CAAC,QAAQ,EAAE,eAAe,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,GAAG;CAS3E"}
@@ -22,11 +22,14 @@ class ServiceResponseCodec {
22
22
  /**
23
23
  * Decode service response
24
24
  * @param response
25
+ * @param serviceId
25
26
  */
26
- static decode(response) {
27
+ static decode(response, serviceId) {
27
28
  if (!response.success) {
28
29
  const remoteError = response.error;
29
30
  const serviceInvokeException = new ServiceInvokeException_1.ServiceInvokeException(remoteError.message || 'Unknown Error');
31
+ if (serviceId)
32
+ serviceInvokeException.service = serviceId;
30
33
  throw Object.assign(serviceInvokeException, response.error);
31
34
  }
32
35
  return response.payload;
@@ -44,7 +44,7 @@ let ServiceProxy = class ServiceProxy extends lakutata_1.Provider {
44
44
  */
45
45
  async invoke(input, timeout = 60 * 60 * 1000) {
46
46
  const response = await this.nats.request(this.serviceId, input, timeout);
47
- return ServiceResponseCodec_1.ServiceResponseCodec.decode(response);
47
+ return ServiceResponseCodec_1.ServiceResponseCodec.decode(response, this.serviceId);
48
48
  }
49
49
  /**
50
50
  * On service event
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lakutata/nats",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "Lakutata NATS Client",
5
5
  "keywords": [
6
6
  "lakutata",
@@ -32,5 +32,5 @@
32
32
  "lakutata": "^2.0.117",
33
33
  "nats": "^2.29.3"
34
34
  },
35
- "gitHead": "17359613e7541eecc38622ced493bd60e80f1f22"
35
+ "gitHead": "7b37eadf0960460f5a8624709ab5c4bc6032f531"
36
36
  }