@axinom/mosaic-message-bus 0.43.0-rc.7 → 0.44.0-rc.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.
@@ -14,9 +14,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.getLogEnvelope = void 0;
15
15
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
16
16
  function getLogEnvelope(envelope) {
17
- const parsedEnvelope = Buffer.isBuffer(envelope)
18
- ? JSON.parse(envelope.toString())
19
- : envelope;
17
+ let parsedEnvelope;
18
+ try {
19
+ parsedEnvelope = Buffer.isBuffer(envelope)
20
+ ? JSON.parse(envelope.toString())
21
+ : envelope;
22
+ }
23
+ catch (err) {
24
+ return {
25
+ error: 'Could not parse the envelope. Invalid JSON.',
26
+ details: err instanceof Error ? err.message : String(err),
27
+ };
28
+ }
20
29
  const { auth_token } = parsedEnvelope, envelopeWithoutToken = __rest(parsedEnvelope, ["auth_token"]);
21
30
  const defaultResponse = { error: 'Could not parse the provided JWT.' };
22
31
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"log-parser.js","sourceRoot":"","sources":["../../src/common/log-parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAaA,iHAAiH;AACjH,SAAgB,cAAc,CAAC,QAAa;IAC1C,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAC9C,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACjC,CAAC,CAAC,QAAQ,CAAC;IACb,MAAM,EAAE,UAAU,KAA8B,cAAc,EAAvC,oBAAoB,UAAK,cAAc,EAAxD,cAAuC,CAAiB,CAAC;IAC/D,MAAM,eAAe,GAAG,EAAE,KAAK,EAAE,mCAAmC,EAAE,CAAC;IACvE,IAAI;QACF,uCACK,oBAAoB,KACvB,SAAS,EAAE,UAAU;gBACnB,CAAC,CAAC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AM;QACN,uCACK,oBAAoB,KACvB,SAAS,EAAE,eAAe,IAC1B;KACH;AACH,CAAC;AA3BD,wCA2BC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axinom/mosaic-message-bus",
3
- "version": "0.43.0-rc.7",
3
+ "version": "0.44.0-rc.0",
4
4
  "description": "Messaging library for Axinom Mosaic services",
5
5
  "author": "Axinom",
6
6
  "license": "PROPRIETARY",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@axinom/mosaic-message-bus-abstractions": "^0.24.0",
35
- "@axinom/mosaic-service-common": "^0.62.0-rc.7",
35
+ "@axinom/mosaic-service-common": "^0.63.0-rc.0",
36
36
  "amqplib": "^0.10.3",
37
37
  "dotenv": "^8.2.0",
38
38
  "graphql": "^15.4.0",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "4d2dbe509438f1c3220e7bbc4aaba013da327d67"
68
+ "gitHead": "51cebd936bdc8ab8ca7ef6f35a1152ba64c0fefa"
69
69
  }
@@ -13,9 +13,17 @@ export function getLogEnvelope(envelope: {
13
13
  }): Record<string, unknown>;
14
14
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
15
15
  export function getLogEnvelope(envelope: any): Record<string, unknown> {
16
- const parsedEnvelope = Buffer.isBuffer(envelope)
17
- ? JSON.parse(envelope.toString())
18
- : envelope;
16
+ let parsedEnvelope;
17
+ try {
18
+ parsedEnvelope = Buffer.isBuffer(envelope)
19
+ ? JSON.parse(envelope.toString())
20
+ : envelope;
21
+ } catch (err) {
22
+ return {
23
+ error: 'Could not parse the envelope. Invalid JSON.',
24
+ details: err instanceof Error ? err.message : String(err),
25
+ };
26
+ }
19
27
  const { auth_token, ...envelopeWithoutToken } = parsedEnvelope;
20
28
  const defaultResponse = { error: 'Could not parse the provided JWT.' };
21
29
  try {