hoodie-plugins-manager
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -33,10 +33,10 @@ var events = require('events'), | ||
feed.stop(); | ||
}; | ||
}; | ||
// CouchDB 1.4.0 has a introduced the requirement that user fields be explicitly declared public for them to be | ||
// CouchDB 1.4.0 has a introduced the requirement that user fields be explicitly declared public for them to be | ||
// returned. In the case of admins, this filtering should not be applied, but there's a bug. | ||
// BUG: https://issues.apache.org/jira/browse/COUCHDB-1888 | ||
var couchRoot = manager._resolve(''); | ||
var couchRoot = manager._resolve(''); | ||
couchr.get(couchRoot, function(err, result) { | ||
@@ -51,4 +51,4 @@ if (err) { | ||
var publicFields = [ | ||
'_id', '_rev,name', 'password_sha', 'password_scheme', 'iterations', | ||
'name', 'roles', 'derived_key', 'salt', 'database', 'ownerHash', | ||
'_id', '_rev,name', 'password_sha', 'password_scheme', 'iterations', | ||
'name', 'roles', 'derived_key', 'salt', 'database', 'hoodieId', | ||
'updatedAt', 'signedUpAt', 'type' | ||
@@ -55,0 +55,0 @@ ]; |
@@ -76,7 +76,7 @@ var PluginAPI = require('hoodie-plugins-api').PluginAPI, | ||
var type = doc.type.substr(1); | ||
api.task.emit('change:' + type, db, doc); | ||
api.task.emit(type + ':change', db, doc); | ||
if (!doc.hasOwnProperty('$processedAt') && | ||
!doc.hasOwnProperty('$error') && | ||
!doc._deleted) { | ||
api.task.emit('add:' + type, db, doc); | ||
api.task.emit(type + ':add', db, doc); | ||
} | ||
@@ -93,3 +93,3 @@ } | ||
if (doc && doc.type) { | ||
api.account.emit('change:' + doc.type, doc); | ||
api.account.emit(doc.type + ':change', doc); | ||
} | ||
@@ -96,0 +96,0 @@ }); |
{ | ||
"name": "hoodie-plugins-manager", | ||
"version": "0.1.2", | ||
"description": "Run and dispatch events to Hoodie plugin server extensions", | ||
"dependencies": { | ||
"hoodie-plugins-api": "0.0.6", | ||
"couchr": "0.0.14", | ||
"async": "0.2.9", | ||
"underscore": "1.5.1", | ||
"nodemailer": "0.5.2", | ||
"dataurl": "0.1.0" | ||
}, | ||
"devDependencies": { | ||
"multicouch": "0.8.1", | ||
"request": "2.22.0", | ||
"mkdirp": "0.3.5", | ||
"rimraf": "2.2.1", | ||
"nodeunit": "0.8.1" | ||
}, | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "node_modules/.bin/nodeunit test" | ||
} | ||
} | ||
"name": "hoodie-plugins-manager", | ||
"version": "0.1.3", | ||
"description": "Run and dispatch events to Hoodie plugin server extensions", | ||
"dependencies": { | ||
"hoodie-plugins-api": "0.0.6", | ||
"couchr": "0.0.14", | ||
"async": "0.2.9", | ||
"underscore": "1.5.1", | ||
"nodemailer": "0.5.2", | ||
"dataurl": "0.1.0" | ||
}, | ||
"devDependencies": { | ||
"multicouch": "0.8.1", | ||
"request": "2.22.0", | ||
"mkdirp": "0.3.5", | ||
"rimraf": "2.2.1", | ||
"nodeunit": "0.8.1" | ||
}, | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "node_modules/.bin/nodeunit test" | ||
} | ||
} |
@@ -313,4 +313,4 @@ var plugins_manager = require('../lib/index'), | ||
recEvent('change'); | ||
recEvent('change:user'); | ||
recEvent('change:other'); | ||
recEvent('user:change'); | ||
recEvent('other:change'); | ||
@@ -330,7 +330,7 @@ var doc = {id: 'foo', password: 'secret'}; | ||
'change user/foo', | ||
'change:user user/foo', | ||
'user:change user/foo', | ||
'change user/foo', | ||
'change:user user/foo', | ||
'user:change user/foo', | ||
'change deleted', | ||
'change:user deleted' | ||
'user:change deleted' | ||
]); | ||
@@ -362,4 +362,4 @@ manager.stop(test.done); | ||
recEvent('change'); | ||
recEvent('change:mytask'); | ||
recEvent('change:other'); | ||
recEvent('mytask:change'); | ||
recEvent('other:change'); | ||
@@ -387,7 +387,7 @@ hoodie.database.add('user/foo', function (err) { | ||
'change test', | ||
'change:mytask test', | ||
'mytask:change test', | ||
'change test', | ||
'change:mytask test', | ||
'mytask:change test', | ||
'change deleted', | ||
'change:mytask deleted' | ||
'mytask:change deleted' | ||
]); | ||
@@ -423,3 +423,3 @@ // task events should no longer fire from this db | ||
}); | ||
hoodie.task.on('add:email', function (dbname, task) { | ||
hoodie.task.on('email:add', function (dbname, task) { | ||
test.equal(dbname, 'testdb'); | ||
@@ -469,3 +469,3 @@ test.equal(task.type, '$email'); | ||
}); | ||
hoodie.task.on('add:email', function (dbname, task) { | ||
hoodie.task.on('email:add', function (dbname, task) { | ||
test.equal(dbname, 'testdb'); | ||
@@ -566,6 +566,6 @@ test.equal(task.type, '$email'); | ||
var changed_tasks = []; | ||
hoodie.task.on('add:example', function (db, task) { | ||
hoodie.task.on('example:add', function (db, task) { | ||
added_tasks.push(task.name); | ||
}); | ||
hoodie.task.on('change:example', function (db, task) { | ||
hoodie.task.on('example:change', function (db, task) { | ||
changed_tasks.push(task.name); | ||
@@ -572,0 +572,0 @@ }); |
48691
12