@barchart/events-client-js
Advanced tools
Comparing version 4.2.0 to 5.0.0
@@ -16,2 +16,3 @@ /** | ||
* @property {EventType} type - The type of event. | ||
* @property {String} version - The version of the product. | ||
* @property {Timestamp} timestamp - The time of the event's occurrence. | ||
@@ -18,0 +19,0 @@ * @property {String[]} context - Additional data which qualifies the event's type. |
@@ -18,10 +18,13 @@ const assert = require('@barchart/common-js/lang/assert'), | ||
* @param {ProductType} product | ||
* @param {String} version | ||
*/ | ||
class EventFactory { | ||
constructor(customer, product) { | ||
constructor(customer, product, version) { | ||
assert.argumentIsRequired(customer, 'customer', CustomerType, 'CustomerType'); | ||
assert.argumentIsRequired(product, 'product', ProductType, 'ProductType'); | ||
assert.argumentIsRequired(version, 'version', String, 'String'); | ||
this._customer = customer; | ||
this._product = product; | ||
this._version = version; | ||
} | ||
@@ -44,2 +47,3 @@ | ||
product: this._product, | ||
version: this._version, | ||
type: type, | ||
@@ -57,6 +61,7 @@ timestamp: Timestamp.now().timestamp, | ||
* @param {ProductType} product | ||
* @param {String} version | ||
* @returns {EventFactory} | ||
*/ | ||
static for(customer, product) { | ||
return new EventFactory(customer, product); | ||
static for(customer, product, version) { | ||
return new EventFactory(customer, product, version); | ||
} | ||
@@ -63,0 +68,0 @@ |
@@ -5,4 +5,4 @@ module.exports = (() => { | ||
return { | ||
version: '4.2.0' | ||
version: '5.0.0' | ||
}; | ||
})(); |
{ | ||
"name": "@barchart/events-client-js", | ||
"version": "4.2.0", | ||
"version": "5.0.0", | ||
"description": "JavaScript SDK for Barchart's Event Tracking Service", | ||
@@ -26,3 +26,3 @@ "author": { | ||
"@barchart/common-js": "^4.8.0", | ||
"@barchart/events-api-common": "^4.2.0" | ||
"@barchart/events-api-common": "^5.0.0" | ||
}, | ||
@@ -51,3 +51,4 @@ "devDependencies": { | ||
}, | ||
"license": "MIT" | ||
"license": "MIT", | ||
"gitHead": "f85d29d39dca426845ae2271a5263d2c478bdbc3" | ||
} |
780
28589
+ Added@barchart/events-api-common@5.2.0(transitive)
+ Addeduuid@9.0.1(transitive)
- Removed@barchart/events-api-common@4.2.0(transitive)
- Removeduuid@8.3.2(transitive)