@lumigo/node-core
Advanced tools
Comparing version 1.14.2 to 1.15.0
@@ -29,2 +29,8 @@ "use strict"; | ||
const messageId = requestContext.requestId; | ||
const fromMessageIds = [messageId]; | ||
let tracestate = headers === null || headers === void 0 ? void 0 : headers.tracestate; | ||
if (tracestate && tracestate.indexOf('=')) { | ||
tracestate = tracestate.split('=')[1]; | ||
fromMessageIds.push(tracestate); | ||
} | ||
return { | ||
@@ -34,3 +40,3 @@ id: (0, generalUtils_1.getRandomId)(), | ||
triggeredBy: message_trigger_enum_1.MessageTrigger.ApiGateway, | ||
fromMessageIds: [messageId], | ||
fromMessageIds: fromMessageIds, | ||
extra: { api, stage, httpMethod, resource }, | ||
@@ -40,8 +46,14 @@ }; | ||
this.getApiGatewayV2Data = (message, targetId) => { | ||
var _a, _b, _c, _d, _e, _f, _g; | ||
var _a, _b, _c, _d, _e, _f, _g, _h; | ||
const httpMethod = (_b = (_a = message.requestContext) === null || _a === void 0 ? void 0 : _a.http) === null || _b === void 0 ? void 0 : _b.method; | ||
const resource = (_d = (_c = message.requestContext) === null || _c === void 0 ? void 0 : _c.http) === null || _d === void 0 ? void 0 : _d.path; | ||
const messageId = (_e = message.requestContext) === null || _e === void 0 ? void 0 : _e.requestId; | ||
const api = ((_f = message.requestContext) === null || _f === void 0 ? void 0 : _f.domainName) || null; | ||
const stage = ((_g = message.requestContext) === null || _g === void 0 ? void 0 : _g.stage) || 'unknown'; | ||
const fromMessageIds = [messageId]; | ||
let tracestate = (_f = message.headers) === null || _f === void 0 ? void 0 : _f.tracestate; | ||
if (tracestate && tracestate.indexOf('=')) { | ||
tracestate = tracestate.split('=')[1]; | ||
fromMessageIds.push(tracestate); | ||
} | ||
const api = ((_g = message.requestContext) === null || _g === void 0 ? void 0 : _g.domainName) || null; | ||
const stage = ((_h = message.requestContext) === null || _h === void 0 ? void 0 : _h.stage) || 'unknown'; | ||
return { | ||
@@ -51,3 +63,3 @@ id: (0, generalUtils_1.getRandomId)(), | ||
triggeredBy: message_trigger_enum_1.MessageTrigger.ApiGateway, | ||
fromMessageIds: messageId ? [messageId] : [], | ||
fromMessageIds: fromMessageIds, | ||
extra: { api, stage, httpMethod, resource }, | ||
@@ -54,0 +66,0 @@ }; |
{ | ||
"name": "@lumigo/node-core", | ||
"version": "1.14.2", | ||
"version": "1.15.0", | ||
"description": "Lumigo core node sdk", | ||
@@ -19,3 +19,3 @@ "main": "lib/index.js", | ||
"repository": "git@github.com:lumigo-io/node-core.git", | ||
"author": "Orr Levinger", | ||
"author": "Lumigo LTD (https://lumigo.io)", | ||
"dependencies": { | ||
@@ -22,0 +22,0 @@ "utf8": "^3.0.0", |
Sorry, the diff of this file is not supported yet
224319
30448
2134
21
1
1
1
4