Commit d194fdd3 by Alex MacCaw

add Prospector lib

parent ee326f30
......@@ -20,6 +20,7 @@ function ClearbitClient (config) {
this.Company = require('./enrichment/company').Company(this);
this.Person = require('./enrichment/person').Person(this);
this.Discovery = require('./discovery').Discovery(this);
this.Prospector = require('./prospector').Prospector(this);
this.Watchlist = require('./watchlist').Watchlist(this);
this.WatchlistCandidate = require('./watchlist').WatchlistCandidate(this);
this.WatchlistEntity = require('./watchlist').WatchlistEntity(this);
......
'use strict';
var resource = require('./resource');
var Promise = require('bluebird');
exports.Prospector = resource.create('Prospector', {api: 'prospector'})
.extend({
getEmail: function (){
return this.getEmailResponse().then(function(resp){
return resp.email;
});
},
getVerified: function () {
return this.getEmailResponse().then(function(resp){
return resp.verified;
});
},
getEmailResponse: function () {
if (this.emailResponse)
return this.emailResponse;
return this.emailResponse = this.constructor.get(
'/people/' + this.id + '/email'
);
}
}, {
search: function (options) {
options = options || {};
return this.get(
'/people/search',
options
);
}
});
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