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
f871a6e3
Commit
f871a6e3
authored
Nov 05, 2015
by
Rob Holland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Swing find endpoint to /v2
parent
fcee189a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
13 deletions
+12
-13
enrichment.js
src/enrichment.js
+1
-1
company.js
src/enrichment/company.js
+1
-1
person.js
src/enrichment/person.js
+1
-1
company.js
test/company.js
+3
-4
person.js
test/person.js
+6
-6
No files found.
src/enrichment.js
View file @
f871a6e3
...
...
@@ -6,7 +6,7 @@ var _ = require('lodash');
var
Company
=
require
(
'./enrichment/company'
);
var
Person
=
require
(
'./enrichment/person'
);
exports
.
Enrichment
=
resource
.
create
(
'Enrichment'
,
{
api
:
'person'
})
exports
.
Enrichment
=
resource
.
create
(
'Enrichment'
,
{
api
:
'person'
,
version
:
2
})
.
extend
(
null
,
{
find
:
function
(
options
){
options
=
options
||
{};
...
...
src/enrichment/company.js
View file @
f871a6e3
...
...
@@ -4,7 +4,7 @@ var assert = require('assert');
var
resource
=
require
(
'../resource'
);
var
_
=
require
(
'lodash'
);
exports
.
Company
=
resource
.
create
(
'Company'
,
{
api
:
'company'
})
exports
.
Company
=
resource
.
create
(
'Company'
,
{
api
:
'company'
,
version
:
2
})
.
extend
({
flag
:
function
(
options
){
return
this
.
constructor
.
post
(
'/companies/'
+
this
.
id
+
'/flag'
,
options
);
...
...
src/enrichment/person.js
View file @
f871a6e3
...
...
@@ -4,7 +4,7 @@ var assert = require('assert');
var
resource
=
require
(
'../resource'
);
var
_
=
require
(
'lodash'
);
exports
.
Person
=
resource
.
create
(
'Person'
,
{
api
:
'person'
})
exports
.
Person
=
resource
.
create
(
'Person'
,
{
api
:
'person'
,
version
:
2
})
.
extend
({
flag
:
function
(
options
){
return
this
.
constructor
.
post
(
'/people/'
+
this
.
id
+
'/flag'
,
options
);
...
...
test/company.js
View file @
f871a6e3
...
...
@@ -21,7 +21,7 @@ describe('Company', function () {
it
(
'can find a company by domain'
,
function
()
{
mock
.
get
(
'/v
1
/companies/find?domain=uber.com'
)
.
get
(
'/v
2
/companies/find?domain=uber.com'
)
.
reply
(
200
,
company
);
return
Company
.
find
({
domain
:
'uber.com'
})
.
then
(
function
(
company
)
{
...
...
@@ -32,9 +32,8 @@ describe('Company', function () {
});
it
(
'can handle queued requests'
,
function
()
{
mock
.
get
(
'/v
1
/companies/find?domain=uber.com'
)
.
get
(
'/v
2
/companies/find?domain=uber.com'
)
.
reply
(
202
,
{
error
:
{
type
:
'queued'
...
...
@@ -46,7 +45,7 @@ describe('Company', function () {
it
(
'can handle unknown records'
,
function
()
{
mock
.
get
(
'/v
1
/companies/find?domain=nonexistent.co'
)
.
get
(
'/v
2
/companies/find?domain=nonexistent.co'
)
.
reply
(
404
,
{
error
:
{
type
:
'unknown_record'
...
...
test/person.js
View file @
f871a6e3
...
...
@@ -23,7 +23,7 @@ describe('Person', function () {
it
(
'can find a person by email'
,
function
()
{
mock
.
get
(
'/v
1
/people/find?email=alex%40alexmaccaw.com'
)
.
get
(
'/v
2
/people/find?email=alex%40alexmaccaw.com'
)
.
reply
(
200
,
alex
);
return
Person
.
find
({
email
:
'alex@alexmaccaw.com'
})
.
then
(
function
(
person
)
{
...
...
@@ -35,14 +35,14 @@ describe('Person', function () {
it
(
'can subscribe to a person'
,
function
()
{
mock
.
get
(
'/v
1
/people/find?email=alex%40alexmaccaw.com&subscribe=true'
)
.
get
(
'/v
2
/people/find?email=alex%40alexmaccaw.com&subscribe=true'
)
.
reply
(
200
,
alex
);
return
Person
.
find
({
email
:
'alex@alexmaccaw.com'
,
subscribe
:
true
});
});
it
(
'can handle queued requests'
,
function
()
{
mock
.
get
(
'/v
1
/people/find?email=alex%40alexmaccaw.com'
)
.
get
(
'/v
2
/people/find?email=alex%40alexmaccaw.com'
)
.
reply
(
202
,
{
error
:
{
type
:
'queued'
...
...
@@ -54,7 +54,7 @@ describe('Person', function () {
it
(
'can handle unknown records'
,
function
()
{
mock
.
get
(
'/v
1
/people/find?email=bademail%40unknown.com'
)
.
get
(
'/v
2
/people/find?email=bademail%40unknown.com'
)
.
reply
(
404
,
{
error
:
{
type
:
'unknown_record'
...
...
@@ -70,7 +70,7 @@ describe('Person', function () {
it
(
'can find a person by email'
,
function
()
{
mock
.
get
(
'/v
1
/combined/find?email=alex%40alexmaccaw.com'
)
.
get
(
'/v
2
/combined/find?email=alex%40alexmaccaw.com'
)
.
reply
(
200
,
{
person
:
alex
,
company
:
company
...
...
@@ -86,7 +86,7 @@ describe('Person', function () {
it
(
'can handle queued requests'
,
function
()
{
mock
.
get
(
'/v
1
/combined/find?email=alex%40alexmaccaw.com'
)
.
get
(
'/v
2
/combined/find?email=alex%40alexmaccaw.com'
)
.
reply
(
202
,
{
error
:
{
type
:
'queued'
...
...
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