@axinom/mosaic-message-bus 0.43.0-rc.7 → 0.43.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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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,
|
|
1
|
+
{"version":3,"file":"log-parser.js","sourceRoot":"","sources":["../../src/common/log-parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAaA,iHAAiH;AACjH,SAAgB,cAAc,CAAC,QAAa;IAC1C,IAAI,cAAc,CAAC;IACnB,IAAI;QACF,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;YACxC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACjC,CAAC,CAAC,QAAQ,CAAC;KACd;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO;YACL,KAAK,EAAE,6CAA6C;YACpD,OAAO,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SAC1D,CAAC;KACH;IACD,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,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;gBACxE,CAAC,CAAC,eAAe,IACnB;KACH;IAAC,WAAM;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
|
|
3
|
+
"version": "0.43.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
|
|
35
|
+
"@axinom/mosaic-service-common": "^0.62.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": "
|
|
68
|
+
"gitHead": "53c1540262d00a496b37c1518bab28141474da9a"
|
|
69
69
|
}
|
package/src/common/log-parser.ts
CHANGED
|
@@ -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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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 {
|