Commit 376773e7 by AdriVanHoudt

Initial work for company api

parent 5d9452f1
'use strict';
/**
* Access the Company API.
*
* @constructor
* @param {FullContact} api Reference to the FullContact wrapping instance.
* @api public
*/
function Company(api) {
this.api = api;
this.endpoint = 'https://api.fullcontact.com/' + api.version + '/company/lookup.json';
this.send = api.process.bind(api, this);
}
/**
* Retriece company information by domain
*
* ```js
* fullcontact.company.domain('apple.com', [webhookUrl], [webhookId], fn);
* ```
*
* @returns {Company}
* @api public
*/
Company.prototype.domain = function disposable() {
var args = this.api.args(arguments, 'webhookUrl', 'webhookId');
this.send({ domain: args.value }, args);
return this;
};
module.exports = Company;
...@@ -270,6 +270,7 @@ FullContact.Location = require('./endpoints/location'); ...@@ -270,6 +270,7 @@ FullContact.Location = require('./endpoints/location');
FullContact.Person = require('./endpoints/person'); FullContact.Person = require('./endpoints/person');
FullContact.Email = require('./endpoints/email'); FullContact.Email = require('./endpoints/email');
FullContact.Name = require('./endpoints/name'); FullContact.Name = require('./endpoints/name');
FullContact.Company = require('./endpoints/company');
// //
// Lazy load the various of endpoints so they only get initialized when we // Lazy load the various of endpoints so they only get initialized when we
...@@ -291,6 +292,10 @@ FullContact.define(FullContact.prototype, 'name', function define() { ...@@ -291,6 +292,10 @@ FullContact.define(FullContact.prototype, 'name', function define() {
return new FullContact.Name(this); return new FullContact.Name(this);
}); });
FullContact.define(FullContact.prototype, 'company', function define() {
return new FullContact.Company(this);
});
// //
// Expose the FullContact API. // Expose the FullContact API.
// //
......
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