Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fullcontact
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
prospector
fullcontact
Commits
e0cfbcbc
Commit
e0cfbcbc
authored
Jan 13, 2015
by
Arnout Kazemier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6 from AdriVanHoudt/master
Webhook support for person.email
parents
03a7ad80
8817aabe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
5 deletions
+16
-5
.travis.yml
.travis.yml
+0
-1
person.js
endpoints/person.js
+1
-1
index.js
index.js
+3
-1
person.test.js
test/person.test.js
+12
-2
No files found.
.travis.yml
View file @
e0cfbcbc
language
:
node_js
language
:
node_js
node_js
:
node_js
:
-
"
0.8"
-
"
0.10"
-
"
0.10"
endpoints/person.js
View file @
e0cfbcbc
...
@@ -25,7 +25,7 @@ function Person(api) {
...
@@ -25,7 +25,7 @@ function Person(api) {
* @api public
* @api public
*/
*/
Person
.
prototype
.
email
=
function
email
()
{
Person
.
prototype
.
email
=
function
email
()
{
var
args
=
this
.
api
.
args
(
arguments
,
'queue'
);
var
args
=
this
.
api
.
args
(
arguments
,
'queue'
,
'webhookUrl'
,
'webhookId'
);
this
.
send
({
email
:
args
.
value
},
args
);
this
.
send
({
email
:
args
.
value
},
args
);
return
this
;
return
this
;
...
...
index.js
View file @
e0cfbcbc
...
@@ -45,6 +45,8 @@ FullContact.prototype.process = function req(api, query, args) {
...
@@ -45,6 +45,8 @@ FullContact.prototype.process = function req(api, query, args) {
if
(
args
.
queue
)
query
.
queue
=
args
.
queue
;
if
(
args
.
queue
)
query
.
queue
=
args
.
queue
;
if
(
args
.
casing
)
query
.
casing
=
args
.
casing
;
if
(
args
.
casing
)
query
.
casing
=
args
.
casing
;
if
(
args
.
population
)
query
.
includeZeroPopulation
=
!!
args
.
population
;
if
(
args
.
population
)
query
.
includeZeroPopulation
=
!!
args
.
population
;
if
(
args
.
webhookUrl
)
query
.
webhookUrl
=
args
.
webhookUrl
;
if
(
args
.
webhookId
)
query
.
webhookId
=
args
.
webhookId
;
//
//
// The packet that is send to the server or queued when we are in queuing
// The packet that is send to the server or queued when we are in queuing
...
@@ -93,7 +95,7 @@ FullContact.prototype.request = function req(packet, args) {
...
@@ -93,7 +95,7 @@ FullContact.prototype.request = function req(packet, args) {
// it will have a "message" property when it's a failed request so we can
// it will have a "message" property when it's a failed request so we can
// leverage that to return a nice error.
// leverage that to return a nice error.
//
//
if
(
body
.
status
!==
200
)
{
if
(
body
.
status
!==
200
&&
body
.
status
!==
202
)
{
err
=
new
Error
(
body
.
message
);
err
=
new
Error
(
body
.
message
);
err
.
status
=
body
.
status
;
err
.
status
=
body
.
status
;
...
...
test/person.test.js
View file @
e0cfbcbc
...
@@ -29,12 +29,20 @@ describe('FullContact.Person', function () {
...
@@ -29,12 +29,20 @@ describe('FullContact.Person', function () {
it
(
'provides the proper casing'
);
it
(
'provides the proper casing'
);
});
});
describe
(
'#email with webhook url/id'
,
function
()
{
it
(
'retrieves data by e-mail and sets up a webhook with the right url and id'
,
function
(
done
)
{
api
.
person
.
email
(
'arnout@observe.it'
,
null
,
'http://requestb.in/1bxgb751'
,
'webhookTest'
,
done
);
});
it
(
'provides the proper casing'
);
});
describe
(
'#md5'
,
function
()
{
describe
(
'#md5'
,
function
()
{
var
md5
=
require
(
'crypto'
).
createHash
(
'md5'
)
var
md5
=
require
(
'crypto'
).
createHash
(
'md5'
)
.
update
(
'arnout@observe.it'
)
.
update
(
'arnout@observe.it'
)
.
digest
(
'hex'
)
.
digest
(
'hex'
)
.
toString
();
.
toString
();
it
(
'retrieves data by md5 e-mail'
,
function
(
done
)
{
it
(
'retrieves data by md5 e-mail'
,
function
(
done
)
{
api
.
person
.
md5
(
md5
,
done
);
api
.
person
.
md5
(
md5
,
done
);
...
@@ -68,7 +76,9 @@ describe('FullContact.Person', function () {
...
@@ -68,7 +76,9 @@ describe('FullContact.Person', function () {
});
});
describe
(
'#phone'
,
function
()
{
describe
(
'#phone'
,
function
()
{
it
(
'retrieves data by phone number'
);
it
(
'retrieves data by phone number'
,
function
(
done
)
{
api
.
person
.
phone
(
'+13037170414'
,
done
);
});
it
(
'provides the proper casing'
);
it
(
'provides the proper casing'
);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment