Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
clearbit
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
clearbit
Commits
fcee189a
Commit
fcee189a
authored
Nov 03, 2015
by
Rob Holland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use new find endpoint.
parent
102a1dde
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
22 deletions
+12
-22
enrichment.js
src/enrichment.js
+1
-4
company.js
src/enrichment/company.js
+1
-4
person.js
src/enrichment/person.js
+1
-4
company.js
test/company.js
+3
-3
person.js
test/person.js
+6
-7
No files found.
src/enrichment.js
View file @
fcee189a
...
@@ -16,10 +16,7 @@ exports.Enrichment = resource.create('Enrichment', {api: 'person'})
...
@@ -16,10 +16,7 @@ exports.Enrichment = resource.create('Enrichment', {api: 'person'})
assert
(
options
.
email
,
'An email must be provided'
);
assert
(
options
.
email
,
'An email must be provided'
);
return
this
.
get
(
return
this
.
get
(
'/combined/find'
,
options
);
'/combined/email/'
+
options
.
email
,
_
.
omit
(
options
,
'email'
)
);
},
},
Company
:
Company
,
Company
:
Company
,
...
...
src/enrichment/company.js
View file @
fcee189a
...
@@ -15,9 +15,6 @@ exports.Company = resource.create('Company', {api: 'company'})
...
@@ -15,9 +15,6 @@ exports.Company = resource.create('Company', {api: 'company'})
options
=
options
||
{};
options
=
options
||
{};
assert
(
options
.
domain
,
'A domain must be provided'
);
assert
(
options
.
domain
,
'A domain must be provided'
);
return
this
.
get
(
return
this
.
get
(
'/companies/find'
,
options
);
'/companies/domain/'
+
options
.
domain
,
_
.
omit
(
options
,
'domain'
)
);
}
}
});
});
src/enrichment/person.js
View file @
fcee189a
...
@@ -15,9 +15,6 @@ exports.Person = resource.create('Person', {api: 'person'})
...
@@ -15,9 +15,6 @@ exports.Person = resource.create('Person', {api: 'person'})
options
=
options
||
{};
options
=
options
||
{};
assert
(
options
.
email
,
'An email must be provided'
);
assert
(
options
.
email
,
'An email must be provided'
);
return
this
.
get
(
return
this
.
get
(
'/people/find'
,
options
);
'/people/email/'
+
options
.
email
,
_
.
omit
(
options
,
'email'
)
);
}
}
});
});
test/company.js
View file @
fcee189a
...
@@ -21,7 +21,7 @@ describe('Company', function () {
...
@@ -21,7 +21,7 @@ describe('Company', function () {
it
(
'can find a company by domain'
,
function
()
{
it
(
'can find a company by domain'
,
function
()
{
mock
mock
.
get
(
'/v1/companies/
domain/
uber.com'
)
.
get
(
'/v1/companies/
find?domain=
uber.com'
)
.
reply
(
200
,
company
);
.
reply
(
200
,
company
);
return
Company
.
find
({
domain
:
'uber.com'
})
return
Company
.
find
({
domain
:
'uber.com'
})
.
then
(
function
(
company
)
{
.
then
(
function
(
company
)
{
...
@@ -34,7 +34,7 @@ describe('Company', function () {
...
@@ -34,7 +34,7 @@ describe('Company', function () {
it
(
'can handle queued requests'
,
function
()
{
it
(
'can handle queued requests'
,
function
()
{
mock
mock
.
get
(
'/v1/companies/
domain/
uber.com'
)
.
get
(
'/v1/companies/
find?domain=
uber.com'
)
.
reply
(
202
,
{
.
reply
(
202
,
{
error
:
{
error
:
{
type
:
'queued'
type
:
'queued'
...
@@ -46,7 +46,7 @@ describe('Company', function () {
...
@@ -46,7 +46,7 @@ describe('Company', function () {
it
(
'can handle unknown records'
,
function
()
{
it
(
'can handle unknown records'
,
function
()
{
mock
mock
.
get
(
'/v1/companies/
domain/
nonexistent.co'
)
.
get
(
'/v1/companies/
find?domain=
nonexistent.co'
)
.
reply
(
404
,
{
.
reply
(
404
,
{
error
:
{
error
:
{
type
:
'unknown_record'
type
:
'unknown_record'
...
...
test/person.js
View file @
fcee189a
...
@@ -23,7 +23,7 @@ describe('Person', function () {
...
@@ -23,7 +23,7 @@ describe('Person', function () {
it
(
'can find a person by email'
,
function
()
{
it
(
'can find a person by email'
,
function
()
{
mock
mock
.
get
(
'/v1/people/
email/alex@
alexmaccaw.com'
)
.
get
(
'/v1/people/
find?email=alex%40
alexmaccaw.com'
)
.
reply
(
200
,
alex
);
.
reply
(
200
,
alex
);
return
Person
.
find
({
email
:
'alex@alexmaccaw.com'
})
return
Person
.
find
({
email
:
'alex@alexmaccaw.com'
})
.
then
(
function
(
person
)
{
.
then
(
function
(
person
)
{
...
@@ -35,14 +35,14 @@ describe('Person', function () {
...
@@ -35,14 +35,14 @@ describe('Person', function () {
it
(
'can subscribe to a person'
,
function
()
{
it
(
'can subscribe to a person'
,
function
()
{
mock
mock
.
get
(
'/v1/people/
email/alex@alexmaccaw.com?
subscribe=true'
)
.
get
(
'/v1/people/
find?email=alex%40alexmaccaw.com&
subscribe=true'
)
.
reply
(
200
,
alex
);
.
reply
(
200
,
alex
);
return
Person
.
find
({
email
:
'alex@alexmaccaw.com'
,
subscribe
:
true
});
return
Person
.
find
({
email
:
'alex@alexmaccaw.com'
,
subscribe
:
true
});
});
});
it
(
'can handle queued requests'
,
function
()
{
it
(
'can handle queued requests'
,
function
()
{
mock
mock
.
get
(
'/v1/people/
email/alex@
alexmaccaw.com'
)
.
get
(
'/v1/people/
find?email=alex%40
alexmaccaw.com'
)
.
reply
(
202
,
{
.
reply
(
202
,
{
error
:
{
error
:
{
type
:
'queued'
type
:
'queued'
...
@@ -54,7 +54,7 @@ describe('Person', function () {
...
@@ -54,7 +54,7 @@ describe('Person', function () {
it
(
'can handle unknown records'
,
function
()
{
it
(
'can handle unknown records'
,
function
()
{
mock
mock
.
get
(
'/v1/people/
email/bademail@
unknown.com'
)
.
get
(
'/v1/people/
find?email=bademail%40
unknown.com'
)
.
reply
(
404
,
{
.
reply
(
404
,
{
error
:
{
error
:
{
type
:
'unknown_record'
type
:
'unknown_record'
...
@@ -70,7 +70,7 @@ describe('Person', function () {
...
@@ -70,7 +70,7 @@ describe('Person', function () {
it
(
'can find a person by email'
,
function
()
{
it
(
'can find a person by email'
,
function
()
{
mock
mock
.
get
(
'/v1/combined/
email/alex@
alexmaccaw.com'
)
.
get
(
'/v1/combined/
find?email=alex%40
alexmaccaw.com'
)
.
reply
(
200
,
{
.
reply
(
200
,
{
person
:
alex
,
person
:
alex
,
company
:
company
company
:
company
...
@@ -86,7 +86,7 @@ describe('Person', function () {
...
@@ -86,7 +86,7 @@ describe('Person', function () {
it
(
'can handle queued requests'
,
function
()
{
it
(
'can handle queued requests'
,
function
()
{
mock
mock
.
get
(
'/v1/combined/
email/alex@
alexmaccaw.com'
)
.
get
(
'/v1/combined/
find?email=alex%40
alexmaccaw.com'
)
.
reply
(
202
,
{
.
reply
(
202
,
{
error
:
{
error
:
{
type
:
'queued'
type
:
'queued'
...
@@ -99,4 +99,3 @@ describe('Person', function () {
...
@@ -99,4 +99,3 @@ describe('Person', function () {
});
});
});
});
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