Comparing version 0.2.2 to 0.2.3
{ | ||
"name": "ad", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Active Directory API for Node", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,3 +8,3 @@ # AD | ||
[![Build Passing](https://img.shields.io/badge/build-passing-brightgreen.svg)](https://img.shields.io/badge/build-passing-brightgreen.svg) | ||
[![Build Coverage 100%](https://img.shields.io/badge/build-passing-brightgreen.svg)](https://img.shields.io/badge/build-100%25-brightgreen.svg) | ||
[![Build Coverage 100%](https://img.shields.io/badge/coverage-100%25-brightgreen.svg)](https://img.shields.io/badge/build-100%25-brightgreen.svg) | ||
@@ -100,3 +100,3 @@ | ||
```bash | ||
```js | ||
ad.user().get(filter) | ||
@@ -563,2 +563,2 @@ ad.user().add(options) | ||
MIT | ||
MIT |
@@ -113,3 +113,3 @@ const api = require('../util/api'); | ||
/* istanbul ignore next */ | ||
return reject({error: true, message: e.message}); | ||
return reject({message: e.message, type: e.type, stack: e.stack}); | ||
} | ||
@@ -124,7 +124,7 @@ }); | ||
/* istanbul ignore next */ | ||
return reject({error: true, message: err.message}); | ||
return reject({message: err.message}); | ||
} | ||
if (!users) { | ||
/* istanbul ignore next */ | ||
return reject({error: true, message: `Group ${groupName} does not exist.`}); | ||
return reject({message: `Group ${groupName} does not exist.`}); | ||
} | ||
@@ -166,7 +166,7 @@ return resolve(users); | ||
/* istanbul ignore next */ | ||
return reject({error: true, message: `Object ${searchString} does not exist.`}); | ||
return reject({message: `Object ${searchString} does not exist.`}); | ||
} | ||
if (results.length > 1) { | ||
/* istanbul ignore next */ | ||
return reject({error: true, message: `More than 1 Object was returned.`}); | ||
return reject({message: `More than 1 Object was returned.`}); | ||
} | ||
@@ -204,9 +204,13 @@ this._deleteObjectByDN(results[0].dn).then(result => { | ||
} | ||
client.modifyDN(oldDN, newDN, (err) => { | ||
if (err) { | ||
/* istanbul ignore next */ | ||
return reject({error: true, message: err.message}); | ||
} | ||
return resolve({success: true}); | ||
}); | ||
try { | ||
client.modifyDN(oldDN, newDN, (err) => { | ||
if (err) { | ||
/* istanbul ignore next */ | ||
return reject({message: err.message}); | ||
} | ||
return resolve({success: true}); | ||
}); | ||
} catch(e) { | ||
return reject({message: e.message}); | ||
} | ||
}); | ||
@@ -213,0 +217,0 @@ } |
@@ -231,2 +231,10 @@ const AD = require('../index.js'); | ||
test('user(user).move() should handle an invalid user.', async () => { | ||
try { | ||
let result = await ad.user('test52000').move('!Builtin'); | ||
} catch(err) { | ||
expect(err).toBeDefined(); | ||
} | ||
}); | ||
test('user(user).unlock() should not throw.', async () => { | ||
@@ -233,0 +241,0 @@ try { |
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
62737
1748
562