Commit 2ddd53de by Tristan Rubadeau Committed by Adri Van Houdt

Added support for new `macromeasures` opt (#24)

* macromeasures arg in Person endpoint * macromeasures test * moved macromeasures section below webhooks in the README
parent 8e2faeee
......@@ -151,6 +151,7 @@ fullcontact.person.email('foo@bar.com', function (err, data) {
..
});
```
All `Person` API's accept the `queue` param.
```js
......@@ -168,6 +169,14 @@ fullcontact.person.email('foo@bar.com', null, 'https://mycallbackurl.com', 'webh
});
```
The `Person` API's now accept the `macromeasures` param as a boolean
```js
fullcontact.person.email('opensource@observe.it', null, null, null, null, null, true, function (err, data) {
..
});
```
#### person.md5(address, [queue], fn);
Retrieves contact information by e-mail address but transforms the email to an
......
......@@ -18,14 +18,14 @@ function Person(api) {
* Retrieve contact information by e-mail.
*
* ```js
* fullcontact.person.email('opensource@observe.it', [queue], [webhookUrl], [webhookId], [webhookBody], [style], fn);
* fullcontact.person.email('opensource@observe.it', [queue], [webhookUrl], [webhookId], [webhookBody], [style], [macromeasures], fn);
* ```
*
* @returns {Person}
* @api public
*/
Person.prototype.email = function email() {
var args = this.api.args(arguments, 'queue', 'webhookUrl', 'webhookId', 'webhookBody', 'style');
var args = this.api.args(arguments, 'queue', 'webhookUrl', 'webhookId', 'webhookBody', 'style', 'macromeasures');
this.send({ email: args.value }, args);
return this;
......
......@@ -70,6 +70,10 @@ FullContact.prototype.process = function req(api, query, args) {
query['style'] = args['style'];
}
if(args['macromeasures']) {
query['macromeasures'] = args['macromeasures']
}
//
// The packet that is send to the server or queued when we are in queuing
// mode.
......
......@@ -56,6 +56,14 @@ describe('FullContact.Person', function () {
it('provides the proper casing');
});
describe('#email with webhook url/id/bodyType/style/macromeasures', function () {
it('retrieves data by e-mail with macromeasures enabled', function (done) {
api.person.email('arnout@observe.it', null, null, null, null, null, true, done);
});
it('provides the proper casing');
});
describe('#md5', function () {
var md5 = require('crypto').createHash('md5')
.update('arnout@observe.it')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment