Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions templates/lib/triggers/trigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ async function processTrigger(msg, cfg, snapshot, incomingMessageHeaders, tokenD
logger.level && logger.level(logLevel);
}

logger.debug("Incoming message: %j", msg);
logger.info("Incoming message: %j", msg);
logger.trace("Incoming configuration: %j", cfg);
logger.debug("Incoming message headers: %j", incomingMessageHeaders);
logger.debug("Incoming token data: %j", tokenData);
logger.info("Incoming message headers: %j", incomingMessageHeaders);
logger.info("Incoming token data: %j", tokenData);

if (cfg?.key && componentJson?.authFormat) {
cfg.key = formatApiKey(cfg.key, componentJson.authFormat);
Expand Down
5 changes: 4 additions & 1 deletion templates/lib/utils/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const executeCall = async function (callParams) {
throw new Error(body.error || "API returned erroneous response");
}

this.logger.info("Swagger response %j", { status, url, headers });
this.logger.info("Swagger response %j", { status, url, headers, body });
if (!body) {
this.logger.info("Response body is empty, going to check response data");
const data = await getResponseData.call(this, response);
Expand Down Expand Up @@ -225,13 +225,15 @@ async function dataAndSnapshot(newElement, snapshot, snapshotKey, standardSnapsh
if (compareDate(currentObjectDate, lastObjectDate)) {
lastObjectDate = currentObjectDate;
}
this.logger.info("Going to emit data: %j", newObject);
await self.emit("data", newObject);
emittedItemsCount++;
} else {
if (compareDate(currentObjectDate, snapshot.lastUpdated)) {
if (compareDate(currentObjectDate, lastObjectDate)) {
lastObjectDate = currentObjectDate;
}
this.logger.info("Going to emit data: %j", newObject);
await self.emit("data", newObject);
emittedItemsCount++;
}
Expand All @@ -246,6 +248,7 @@ async function dataAndSnapshot(newElement, snapshot, snapshotKey, standardSnapsh
}
} else {
this.logger.info("Found one item in response data, going to emit...");
this.logger.info("Going to emit data: %j", newElement);
await self.emit("data", newElement);
}
}
Expand Down