diff --git a/lib/messages/search_entry.js b/lib/messages/search_entry.js index 3daa52c..3a8a1a2 100644 --- a/lib/messages/search_entry.js +++ b/lib/messages/search_entry.js @@ -59,6 +59,30 @@ function SearchEntry(options) { }); return obj; }); + + this.__defineGetter__('raw', function () { + var obj = { + dn: self.dn.toString(), + controls: [] + }; + + self.attributes.forEach(function (a) { + if (a.buffers && a.buffers.length) { + if (a.buffers.length > 1) { + obj[a.type] = a.buffers.slice(); + } else { + obj[a.type] = a.buffers[0]; + } + } else { + obj[a.type] = []; + } + }); + self.controls.forEach(function (element, index, array) { + obj.controls.push(element.json); + }); + return obj; + }); + this.__defineGetter__('_dn', function () { return self.objectName; }); diff --git a/package.json b/package.json index 4133e55..12c956f 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "name": "ldapjs", "homepage": "http://ldapjs.org", "description": "LDAP client and server APIs", - "version": "0.5.9", + "version": "0.6.0", "repository": { "type": "git", "url": "git://github.com/mcavage/node-ldapjs.git" @@ -22,7 +22,7 @@ "lib": "./lib" }, "engines": { - "node": ">=0.6" + "node": ">=0.8" }, "dependencies": { "asn1": "0.1.11",