@balena/event-log
Advanced tools
Comparing version 4.1.0 to 5.0.0-object-context-arg-d52b7f6f2ef762356e90f4560a551b6c15d08bef
@@ -166,7 +166,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}, | ||
create: function (type, jsonData, applicationId, deviceId, callback) { | ||
create: function (type, jsonData, context, callback) { | ||
var _this = this; | ||
if (!context) { | ||
context = {}; | ||
} | ||
function runBeforeHook() { | ||
return new Promise(function (resolve, reject) { | ||
hooks.beforeCreate.call(_this, type, jsonData, applicationId, deviceId, (err, result) => { | ||
hooks.beforeCreate.call(_this, type, jsonData, context, (err, result) => { | ||
if (err) { | ||
@@ -185,3 +188,3 @@ return reject(err); | ||
return new Promise(function (resolve) { | ||
resolve(hooks.afterCreate.call(_this, err, type, jsonData, applicationId, deviceId)); | ||
resolve(hooks.afterCreate.call(_this, err, type, jsonData, context)); | ||
}).catch(function (err2) { | ||
@@ -198,7 +201,3 @@ if (debug) { | ||
type, | ||
{ | ||
applicationId: applicationId, | ||
deviceId: deviceId, | ||
jsonData: jsonData, | ||
}, | ||
Object.assign(Object.assign({}, context), { jsonData: jsonData }), | ||
]); | ||
@@ -231,4 +230,4 @@ }) | ||
events.forEach(function (event) { | ||
obj[event] = function (jsonData, applicationId, deviceId) { | ||
return eventLog.create(startCase(base + ' ' + event), jsonData, applicationId, deviceId); | ||
obj[event] = function (jsonData, context) { | ||
return eventLog.create(startCase(base + ' ' + event), jsonData, context); | ||
}; | ||
@@ -235,0 +234,0 @@ }); |
@@ -7,2 +7,8 @@ # Change Log | ||
## 5.0.0 - 2020-12-04 | ||
* Limit the published files [Thodoris Greasidis] | ||
* Include typings [Thodoris Greasidis] | ||
* Use a context object instead of tail id arguments [Thodoris Greasidis] | ||
## 4.1.0 - 2020-07-15 | ||
@@ -9,0 +15,0 @@ |
{ | ||
"name": "@balena/event-log", | ||
"version": "4.1.0", | ||
"version": "5.0.0-object-context-arg-d52b7f6f2ef762356e90f4560a551b6c15d08bef", | ||
"description": "Balena events logging util", | ||
"main": "build/balena-event-log.js", | ||
"files": [ | ||
"build/", | ||
"typings/" | ||
], | ||
"dependencies": { | ||
@@ -7,0 +11,0 @@ "analytics-client": "^0.8.0", |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
35714
12
554
1
1