@getanthill/event-source
Advanced tools
Comparing version 0.11.0 to 0.12.0
@@ -41,26 +41,2 @@ "use strict"; | ||
return class EventSourced { | ||
/** | ||
* EventSourced class constructor | ||
* | ||
* @param {object} services External services | ||
* @param {object} services.db MongoDb connection | ||
* @param {object} services.logger The logger instance | ||
* @param {string} correlationId The instance correlationId | ||
*/ | ||
constructor({ db, logger }, correlationId) { | ||
/* istanbul ignore next */ | ||
this.logger = { | ||
trace: () => null, | ||
info: () => null, | ||
warn: () => null, | ||
error: () => null, | ||
}; | ||
this.correlationId = null; | ||
this.latestHandledEvents = []; | ||
this.db = db; | ||
this.logger = logger || this.logger; | ||
this.correlationId = correlationId; | ||
this.defaultStoreStateErrorHandler = | ||
this.defaultStoreStateErrorHandler.bind(this); | ||
} | ||
static get options() { | ||
@@ -372,2 +348,26 @@ return Object.assign({ | ||
/** | ||
* EventSourced class constructor | ||
* | ||
* @param {object} services External services | ||
* @param {object} services.db MongoDb connection | ||
* @param {object} services.logger The logger instance | ||
* @param {string} correlationId The instance correlationId | ||
*/ | ||
constructor({ db, logger }, correlationId) { | ||
/* istanbul ignore next */ | ||
this.logger = { | ||
trace: () => null, | ||
info: () => null, | ||
warn: () => null, | ||
error: () => null, | ||
}; | ||
this.correlationId = null; | ||
this.latestHandledEvents = []; | ||
this.db = db; | ||
this.logger = logger || this.logger; | ||
this.correlationId = correlationId; | ||
this.defaultStoreStateErrorHandler = | ||
this.defaultStoreStateErrorHandler.bind(this); | ||
} | ||
/** | ||
* default store state handler, does nothing by default because state storage is not critical | ||
@@ -374,0 +374,0 @@ * @param {object} err error thrown when attempted to store the state |
{ | ||
"name": "@getanthill/event-source", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"description": "Event-sourced data store handling library", | ||
@@ -38,10 +38,10 @@ "main": "dist/index.js", | ||
"@babel/preset-typescript": "^7.18.6", | ||
"@commitlint/cli": "17.2.0", | ||
"@commitlint/config-conventional": "17.2.0", | ||
"@commitlint/cli": "17.3.0", | ||
"@commitlint/config-conventional": "17.3.0", | ||
"@semantic-release/changelog": "6.0.1", | ||
"@semantic-release/gitlab": "9.5.0", | ||
"@rollup/plugin-commonjs": "^23.0.2", | ||
"@rollup/plugin-node-resolve": "^13.2.1", | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
"@rollup/plugin-typescript": "^9.0.2", | ||
"@types/jest": "^29.2.2", | ||
"@types/jest": "^29.2.3", | ||
"babel-jest": "^29.3.1", | ||
@@ -52,11 +52,11 @@ "babel-loader": "^9.1.0", | ||
"jest": "^29.3.1", | ||
"mongodb": "^4.11.0", | ||
"npm": "^9.1.1", | ||
"mongodb": "^4.12.0", | ||
"npm": "^9.1.2", | ||
"prettier": "^2.7.1", | ||
"rollup": "^3.3.0", | ||
"rollup-plugin-external-globals": "^0.6.1", | ||
"rollup": "^3.4.0", | ||
"rollup-plugin-external-globals": "^0.7.1", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"semantic-release": "19.0.5", | ||
"tslib": "^2.4.1", | ||
"typescript": "^4.8.4", | ||
"typescript": "^4.9.3", | ||
"validate-branch-name": "1.3.0" | ||
@@ -63,0 +63,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
101225