@ns8/ns8-shopify-switches
Advanced tools
Comparing version 1.0.184 to 1.0.185
@@ -35,3 +35,3 @@ "use strict"; | ||
loggingMethod(`${safeLabel}\n`, this.formatObjectForOutput((safeOutput)), this.formatObjectForOutput(safeContext)); | ||
Logger.logToHoneycomb(safeOutput, safeContext, label ? safeLabel.trim() : undefined); | ||
Logger.logToHoneycomb(type, safeOutput, safeContext, label ? safeLabel.trim() : undefined); | ||
} | ||
@@ -69,3 +69,3 @@ static intializeHoneycomb(disabled) { | ||
} | ||
static logToHoneycomb(data, context, label) { | ||
static logToHoneycomb(type, data, context, label) { | ||
if (Logger.honeycombClient == null || Logger.honeycombClient.newEvent == null) { | ||
@@ -75,3 +75,3 @@ return undefined; | ||
const honeycombEvent = Logger.honeycombClient.newEvent(); | ||
honeycombEvent.add(Object.assign({ message: label, functionName: context.functionName, functionVersion: context.functionVersion, requestId: context.awsRequestId }, data)); | ||
honeycombEvent.add(Object.assign({ message: label, messageType: type, functionName: context.functionName, functionVersion: context.functionVersion, requestId: context.awsRequestId, stage: process.env.STAGE, switchContext: context }, data)); | ||
honeycombEvent.send(); | ||
@@ -78,0 +78,0 @@ } |
@@ -226,8 +226,10 @@ "use strict"; | ||
if (!shouldOrderBeProcessed(switchContext.data)) { | ||
const message = 'ShopifyCreateOrderActionSwitch:: Order transaction not qualified to create a new order.'; | ||
const message = 'shouldOrderBeProcessed:: Order transaction not qualified to create a new order.'; | ||
const data = { | ||
domain: switchContext.merchant.domain, | ||
shopifyOrderId: order_id, | ||
method: 'shouldOrderBeProcessed', | ||
transaction: switchContext.data, | ||
}; | ||
console.log(`${message} %s\n\n%s`, JSON.stringify(data), JSON.stringify(switchContext)); | ||
Logger_1.Logger.log(data, switchContext, message); | ||
return undefined; | ||
@@ -234,0 +236,0 @@ } |
{ | ||
"name": "@ns8/ns8-shopify-switches", | ||
"version": "1.0.184", | ||
"version": "1.0.185", | ||
"description": "Custom switches for the shopify integration", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
94686
1160
11