cqrs-eventdenormalizer
Advanced tools
Comparing version 1.12.5 to 1.13.0
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var Denormalizer = require('./lib/denormalizer'), | ||
@@ -4,0 +2,0 @@ _ = require('lodash'), |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var _ = require('lodash'); | ||
@@ -4,0 +2,0 @@ |
@@ -1,2 +0,1 @@ | ||
'use strict'; | ||
var Definition = require('../definitionBase'), | ||
@@ -3,0 +2,0 @@ util = require('util'), |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var Definition = require('../definitionBase'), | ||
@@ -4,0 +2,0 @@ util = require('util'), |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var EventExtender = require('./eventExtender'), | ||
@@ -4,0 +2,0 @@ util = require('util'), |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var Definition = require('../definitionBase'), | ||
@@ -4,0 +2,0 @@ util = require('util'), |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var debug = require('debug')('denormalizer'), | ||
@@ -4,0 +2,0 @@ async = require('async'), |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
// Grab the util module that's bundled with Node | ||
@@ -4,0 +2,0 @@ var util = require('util'); |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
// Grab the util module that's bundled with Node | ||
@@ -4,0 +2,0 @@ var util = require('util'); |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
// Grab the util module that's bundled with Node | ||
@@ -4,0 +2,0 @@ var util = require('util'); |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var debug = require('debug')('denormalizer:eventDispatcher'), | ||
@@ -4,0 +2,0 @@ _ = require('lodash'), |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var debug = require('debug')('denormalizer:orderQueue'), | ||
@@ -4,0 +2,0 @@ _ = require('lodash'), |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var debug = require('debug')('denormalizer:replayHandler'), | ||
@@ -4,0 +2,0 @@ _ = require('lodash'), |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var debug = require('debug')('denormalizer:revisionGuard'), | ||
@@ -4,0 +2,0 @@ _ = require('lodash'), |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var util = require('util'), | ||
@@ -4,0 +2,0 @@ EventEmitter = require('events').EventEmitter, |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var util = require('util'), | ||
@@ -4,0 +2,0 @@ Store = require('../base'), |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var util = require('util'), | ||
@@ -4,0 +2,0 @@ Store = require('../base'), |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var util = require('util'), | ||
@@ -72,31 +70,54 @@ Store = require('../base'), | ||
var client = new mongo.MongoClient(); | ||
var client; | ||
client.connect(connectionUrl, options.options, function(err, db) { | ||
if (err) { | ||
if (callback) callback(err); | ||
} else { | ||
if (mongo.MongoClient.length === 2) { | ||
client = new mongo.MongoClient(connectionUrl, options.options); | ||
client.connect(function(err, cl) { | ||
if (err) { | ||
debug(err); | ||
if (callback) callback(err); | ||
return; | ||
} | ||
self.db = cl.db(cl.s.options.dbName); | ||
if (!self.db.close) { | ||
self.db.close = cl.close.bind(cl); | ||
} | ||
initDb(); | ||
}); | ||
} else { | ||
client = new mongo.MongoClient(); | ||
client.connect(connectionUrl, options.options, function(err, db) { | ||
if (err) { | ||
debug(err); | ||
if (callback) callback(err); | ||
return; | ||
} | ||
self.db = db; | ||
initDb(); | ||
}); | ||
} | ||
self.db.on('close', function() { | ||
self.emit('disconnect'); | ||
self.stopHeartbeat(); | ||
}); | ||
function initDb() { | ||
self.db.on('close', function() { | ||
self.emit('disconnect'); | ||
self.stopHeartbeat(); | ||
}); | ||
var finish = function (err) { | ||
self.store = self.db.collection(options.collectionName); | ||
// self.store.ensureIndex({ 'aggregateId': 1, date: 1 }, function() {}); | ||
if (!err) { | ||
self.emit('connect'); | ||
var finish = function (err) { | ||
self.store = self.db.collection(options.collectionName); | ||
// self.store.ensureIndex({ 'aggregateId': 1, date: 1 }, function() {}); | ||
if (!err) { | ||
self.emit('connect'); | ||
if (self.options.heartbeat) { | ||
self.startHeartbeat(); | ||
} | ||
if (self.options.heartbeat) { | ||
self.startHeartbeat(); | ||
} | ||
if (callback) callback(err, self); | ||
}; | ||
} | ||
if (callback) callback(err, self); | ||
}; | ||
finish(); | ||
} | ||
}); | ||
finish(); | ||
} | ||
}, | ||
@@ -103,0 +124,0 @@ |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var util = require('util'), | ||
@@ -4,0 +2,0 @@ Store = require('../base'), |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var util = require('util'), | ||
@@ -4,0 +2,0 @@ Store = require('../base'), |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var tolerate = require('tolerance'), | ||
@@ -4,0 +2,0 @@ _ = require('lodash'), |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var debug = require('debug')('denormalizer:structureLoader'), | ||
@@ -4,0 +2,0 @@ _ = require('lodash'), |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var debug = require('debug')('denormalizer:structureParser'), | ||
@@ -4,0 +2,0 @@ _ = require('lodash'), |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
var debug = require('debug')('denormalizer:treeExtender'), | ||
@@ -4,0 +2,0 @@ _ = require('lodash'); |
{ | ||
"author": "adrai", | ||
"name": "cqrs-eventdenormalizer", | ||
"version": "1.12.5", | ||
"version": "1.13.0", | ||
"private": false, | ||
@@ -24,3 +24,3 @@ "main": "index.js", | ||
"uuid": "3.1.0", | ||
"viewmodel": "1.7.6" | ||
"viewmodel": "1.8.0" | ||
}, | ||
@@ -33,3 +33,3 @@ "devDependencies": { | ||
"mocha": "3.x.x", | ||
"mongodb": ">= 0.0.1", | ||
"mongodb": "2.1.x", | ||
"redis": ">= 0.10.1", | ||
@@ -36,0 +36,0 @@ "tingodb": ">= 0.0.1" |
@@ -456,3 +456,3 @@ # Introduction | ||
// optional, default is folder name | ||
name: 'personDetail' | ||
name: 'personDetail', | ||
@@ -470,43 +470,42 @@ // optional, default '' | ||
// // or: | ||
// { index: {profileId: 1}, options: {} } | ||
// { index: { profileId: 1 }, options: {} }, | ||
// ], | ||
// repositorySettings: { // optional | ||
// mongodb : { // for mongo db | ||
// indexes: [ // same as above | ||
// 'profileId', | ||
// // or: | ||
// { profileId: 1 }, | ||
// // or: | ||
// { index: {profileId: 1}, options: {} } | ||
// ] | ||
// }, | ||
// elasticsearch6 : { // for elasticsearch 5.x and 6.x ( elasticsearch6 type / implementation / driver ) | ||
// refresh: 'wait_for', // refresh behaviour on index, default is true ( ie. force index refresh ) https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-refresh.html | ||
// waitForActiveShards: 2, // optional, defaults to 1 ( ie. wait only for primary ) https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html#create-index-wait-for-active-shards | ||
// index: { // optional applied on index create, https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-create-index.html | ||
// settings : { // will be merged with the default ones, | ||
// number_of_shards: 3, // optional, otherwise taken from type settings, defaults to 1, | ||
// number_of_replicas: 1 // optional otherwise taken from type settings, defaults to 0, | ||
// }, | ||
// mappings : { // optiona will be merged with the default ones, | ||
// properties: { // specific properties to not be handled by dynamic mapper | ||
// title: { | ||
// type: "text" | ||
// } | ||
// } | ||
// } | ||
// } | ||
// } | ||
// } | ||
// | ||
// repositorySettings: { // optional | ||
// mongodb: { // for mongo db | ||
// indexes: [ // same as above | ||
// 'profileId', | ||
// // or: | ||
// { profileId: 1 }, | ||
// // or: | ||
// { index: { profileId: 1 }, options: {} }, | ||
// ], | ||
// }, | ||
// elasticsearch6: { // for elasticsearch 5.x and 6.x ( elasticsearch6 type / implementation / driver ) | ||
// refresh: 'wait_for', // refresh behaviour on index, default is true ( ie. force index refresh ) https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-refresh.html | ||
// waitForActiveShards: 2, // optional, defaults to 1 ( ie. wait only for primary ) https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html#create-index-wait-for-active-shards | ||
// index: { // optional applied on index create, https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-create-index.html | ||
// settings: { // will be merged with the default ones, | ||
// number_of_shards: 3, // optional, otherwise taken from type settings, defaults to 1, | ||
// number_of_replicas: 1, // optional otherwise taken from type settings, defaults to 0, | ||
// }, | ||
// mappings: { // optiona will be merged with the default ones, | ||
// properties: { // specific properties to not be handled by dynamic mapper | ||
// title: { | ||
// type: 'text', | ||
// }, | ||
// }, | ||
// }, | ||
// }, | ||
// }, | ||
// }, | ||
}, | ||
// optionally, define some initialization data for new view models... | ||
// optionally, define some initialization data for new view models... | ||
{ | ||
emails: ['default@mycomp.org'], | ||
phoneNumbers: [] | ||
phoneNumbers: [], | ||
}); | ||
If you need an information from an other collection while denormalizing an event, you can require such a collection and make some lookups. | ||
@@ -865,3 +864,3 @@ for example | ||
Copyright (c) 2015 Adriano Raiano | ||
Copyright (c) 2018 Adriano Raiano | ||
@@ -868,0 +867,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
@@ -0,3 +1,6 @@ | ||
## [v1.13.0](https://github.com/adrai/node-cqrs-eventdenormalizer/compare/v1.12.5...v1.13.0) | ||
- compatibility with new mongodb version (3.x) | ||
## [v1.12.5](https://github.com/adrai/node-cqrs-eventdenormalizer/compare/v1.12.4...v1.12.5) | ||
- fixing dynamodb DocumentClient initialization [#65](https://github.com/adrai/node-cqrs-eventdenormalizer/pull/65) thanks to [nanov](https://github.com/nanov) | ||
- Fix callback on retry [#65](https://github.com/adrai/node-cqrs-eventdenormalizer/pull/65) thanks to [nanov](https://github.com/nanov) | ||
@@ -4,0 +7,0 @@ ## [v1.12.4](https://github.com/adrai/node-cqrs-eventdenormalizer/compare/v1.12.3...v1.12.4) |
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
196751
4549
881
+ Addedasync@2.6.0(transitive)
+ Addedviewmodel@1.8.0(transitive)
- Removedasync@2.5.0(transitive)
- Removedviewmodel@1.7.6(transitive)
Updatedviewmodel@1.8.0