fc_enrich 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0f1c306c150ca198c4d1cb6ad1a27413e6ca9b5dba8876b79c81be28099275d
4
- data.tar.gz: b4b21640388cabc83290967c2b10d13ecc3004d196e5826060070952618033c4
3
+ metadata.gz: f240ac261cc95ac2e06e3dfc699c269550a5a7c24fbebf65115f8d517ea46306
4
+ data.tar.gz: 489a78df78e4b6f246cf4a8ed9bd93b4b239b2e9a0b1dcf3bae99d4febf45d6c
5
5
  SHA512:
6
- metadata.gz: 8f72860e2d9ddbcd518a3c3350d929fca97e9c6ee968774b991c5acfd6d0d5a27bcd6aa3c36ae5ade52da8346ce150a23dbef7bf61eef7acadf967add8d6ba37
7
- data.tar.gz: 2a9bfd59a888586adc8dccfb0d027e1acf71ecdefc80f44d8bb89ece474b785cc25e620c957800d92a03149dab3303800c83da170995a324a653342d4bc38e9f
6
+ metadata.gz: 22b749b5fdf8e9f0f70ec20c0d94c191aa882658813a53c9942c9693f03655a806a79b8f5fa3014f47ee5392dcf1b3515203b907bc11b3503af6d584597b7b84
7
+ data.tar.gz: a647676169c8e010e3ae7b5e673545431318a08686c4cf2730c256f3eb1ba082c6abec5fc0041e97a1c5d9003d7fd530c46aec8cac4833cba6892f2c178dda40
@@ -1,3 +1,6 @@
1
+ ## [0.3.0]
2
+ * CompanyEnrichRequest
3
+
1
4
  ## [0.2.1]
2
5
  * add additional info to fake data
3
6
 
data/README.md CHANGED
@@ -24,6 +24,8 @@ Or install it yourself as:
24
24
  FcEnrich.api_key = "[API_KEY]"
25
25
  ```
26
26
 
27
+ #### Person Enrich
28
+
27
29
  see https://platform.fullcontact.com/docs/apis/enrich/multi-field-request
28
30
 
29
31
  ```ruby
@@ -64,7 +66,29 @@ see https://platform.fullcontact.com/docs/apis/enrich/multi-field-request
64
66
  data_filter: ["social", "employment_history"])
65
67
  ```
66
68
 
67
- ## Usage Testing
69
+
70
+ #### Company Enrich
71
+
72
+ see https://platform.fullcontact.com/docs/apis/enrich/company-enrichment
73
+
74
+ ```ruby
75
+ company_request = FcEnrich::CompanyEnrichRequest.new(domain: "fullcontact.com")
76
+ company = company_request.perform
77
+ puts company.name # "FullContact, Inc."
78
+ puts company.location # "1755 Blake Street, Suite 450, Denver, Colorado, United States"
79
+ puts company.twitter # "@fullcontact"
80
+ puts company.linkedin # "https://www.linkedin.com/company/fullcontact-inc-"
81
+ puts company.bio # "FullContact is the ... contacts and be awesome with people."
82
+ puts company.logo # "https://d2ojpxxtu63wzl.cloudfront.net/stati...8ea9e4d47f5af6c"
83
+ puts company.website # "https://www.fullcontact.com"
84
+ puts company.founded # 2010
85
+ puts company.employees # 350
86
+ puts company.locale # "en"
87
+ puts company.category # "Other"
88
+ puts company.details # ...
89
+ ```
90
+
91
+ ### Testing
68
92
 
69
93
  Inside your tests can enable fake mode which will always return the same sample json
70
94
 
@@ -74,11 +98,19 @@ Rspec.describe "Test" do
74
98
  allow(FcEnrich).to receive(:use_fake?).and_return(true)
75
99
  end
76
100
 
77
- it 'returns sample client info' do
101
+ it 'returns sample person info' do
78
102
  person_request = FcEnrich::PersonEnrichRequest.new(email: "any@email.com")
79
103
  person = person_request.perform
80
104
  expect(person.full_name).to eq("Bart Lorang")
81
105
  end
106
+
107
+ it 'returns sample company info' do
108
+ allow(described_class).to receive(:use_fake?).and_return(true)
109
+
110
+ person_request = FcEnrich::CompanyEnrichRequest.new(domain: "email.com")
111
+ person = person_request.perform
112
+ expect(person.name).to eq("FullContact, Inc.")
113
+ end
82
114
  end
83
115
  ```
84
116
 
@@ -22,4 +22,5 @@ module FcEnrich
22
22
  end
23
23
 
24
24
  require 'fc_enrich/person_enrich_request'
25
+ require 'fc_enrich/company_enrich_request'
25
26
  require 'fc_enrich/fake_client'
@@ -0,0 +1,40 @@
1
+ require 'hashie'
2
+ require 'active_support/core_ext/string'
3
+
4
+ require_relative 'http_client'
5
+
6
+ module FcEnrich
7
+ class CompanyEnrichRequest < Hashie::Trash
8
+ include Hashie::Extensions::IndifferentAccess
9
+
10
+ property :domain
11
+ property :webhookUrl, from: :webhook_url
12
+
13
+ def perform(http_client: FcEnrich.http_client)
14
+ Response.new(
15
+ http_client.post("/v3/company.enrich", to_hash)
16
+ )
17
+ end
18
+
19
+ class Response < Hashie::Trash
20
+ include Hashie::Extensions::IndifferentAccess
21
+ include Hashie::Extensions::IgnoreUndeclared
22
+ include Hashie::Extensions::Coercion
23
+
24
+ property :name
25
+ property :location
26
+ property :twitter
27
+ property :linkedin
28
+ property :bio
29
+ property :logo
30
+ property :website
31
+ property :founded
32
+ property :employees
33
+ property :locale
34
+ property :category
35
+ property :details
36
+
37
+ coerce_key :details, Hashie::Mash
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,160 @@
1
+ {
2
+ "name": "FullContact, Inc.",
3
+ "location": "1755 Blake Street, Suite 450, Denver, Colorado, United States",
4
+ "twitter": "@fullcontact",
5
+ "linkedin": "https://www.linkedin.com/company/fullcontact-inc-",
6
+ "bio": "FullContact is the ... contacts and be awesome with people.",
7
+ "logo": "https://d2ojpxxtu63wzl.cloudfront.net/static.png",
8
+ "website": "https://www.fullcontact.com",
9
+ "founded": 2010,
10
+ "employees": 350,
11
+ "locale": "en",
12
+ "category": "Other",
13
+ "details": {
14
+ "entity": {
15
+ "name": "FullContact, Inc",
16
+ "founded": 2010,
17
+ "employees": 350
18
+ },
19
+ "locales": [{
20
+ "code": "en",
21
+ "name": "English"
22
+ }],
23
+ "categories": [{
24
+ "code": "OTHER",
25
+ "name": "Other"
26
+ }],
27
+ "industries": [{
28
+ "type": "SIC",
29
+ "name": "Computer Programming, Data Processing, and Other Computer Related Services",
30
+ "code": "737"
31
+ },
32
+ {
33
+ "type": "NAICS",
34
+ "name": "Data Processing, Hosting, and Related Services",
35
+ "code": "5182"
36
+ }],
37
+ "emails": [{
38
+ "value": "support@fullcontact.com",
39
+ "label": "other"
40
+ },
41
+ {
42
+ "value": "team@fullcontact.com",
43
+ "label": "sales"
44
+ },
45
+ {
46
+ "value": "sales@fullcontact.com",
47
+ "label": "work"
48
+ }],
49
+ "phones": [{
50
+ "value": "+1 (720) 475-1292",
51
+ "label": "other"
52
+ },
53
+ {
54
+ "value": "+1 (888) 330-6943",
55
+ "label": "other"
56
+ },
57
+ {
58
+ "value": "(303) 717-0414",
59
+ "label": "other"
60
+ }],
61
+ "profiles": {
62
+ "twitter": {
63
+ "username": "fullcontact",
64
+ "url": "https://twitter.com/fullcontact",
65
+ "service": "twitter",
66
+ "followers": 2873,
67
+ "following": 120
68
+ },
69
+ "linkedin": {
70
+ "username": "fullcontact-inc-",
71
+ "url": "https://www.linkedin.com/company/fullcontact-inc-",
72
+ "service": "linkedin"
73
+ }
74
+ },
75
+ "locations": [{
76
+ "label": "Headquarters",
77
+ "addressLine1": "1755 Blake Street",
78
+ "addressLine2": "Suite 450",
79
+ "city": "Denver",
80
+ "region": "Colorado",
81
+ "regionCode": "CO",
82
+ "postalCode": "80202",
83
+ "country": "United States",
84
+ "countryCode": "USA",
85
+ "formatted": "1755 Blake Street Suite 450 Denver CO 80202"
86
+ }],
87
+ "images": [{
88
+ "url": "https://d2ojpxxtu63wzl.cloudfront.net/...01842912b",
89
+ "label": "logo"
90
+ },
91
+ {
92
+ "url": "https://d2ojpxxtu63wzl.cloudfro...33e489c3aa06c3ac7",
93
+ "label": "other"
94
+ }],
95
+ "urls": [{
96
+ "value": "https://www.fullcontact.com",
97
+ "label": "website"
98
+ },
99
+ {
100
+ "value": "https://www.fullcontact.com/feed",
101
+ "label": "rss"
102
+ },
103
+ {
104
+ "value": "https://www.youtube.com/watch?v=RnltbT0BKMo",
105
+ "label": "youtube"
106
+ }],
107
+ "keywords": [
108
+ "CRM",
109
+ "Contact Management",
110
+ "Developer APIs",
111
+ "Information Services",
112
+ "Social Media"
113
+ ],
114
+ "traffic": {
115
+ "countryRank": {
116
+ "global": {
117
+ "rank": 40093,
118
+ "name": "Global"
119
+ },
120
+ "us": {
121
+ "rank": 15545,
122
+ "name": "United States"
123
+ }
124
+ },
125
+ "localeRank": {
126
+ "in": {
127
+ "rank": 29313,
128
+ "name": "India"
129
+ },
130
+ "gb": {
131
+ "rank": 18772,
132
+ "name": "United Kingdom"
133
+ },
134
+ "us": {
135
+ "rank": 15545,
136
+ "name": "United States"
137
+ }
138
+ }
139
+ },
140
+ "keyPeople": [{
141
+ "fullName": "Bart Lorang",
142
+ "title": "CEO",
143
+ "avatar": "https://d2ojpxxtu63wzl.cl...bf84a60c5926701b4c5033"
144
+ },
145
+ {
146
+ "fullName": "Scott Brave",
147
+ "title": "CTO",
148
+ "avatar": "https://d2ojpxxtu63wzl.cloudf....49ec3bcbb401c47"
149
+ }]
150
+ },
151
+ "dataAddOns": [{
152
+ "id": "keypeople",
153
+ "name": "Key People",
154
+ "enabled": true,
155
+ "applied": true,
156
+ "description": "People of interest at this company",
157
+ "docLink": "https://fullcontact../api-next-slate/#keypeople"
158
+ }],
159
+ "updated": "2017-11-01"
160
+ }
@@ -1,3 +1,3 @@
1
1
  module FcEnrich
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fc_enrich
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Petersen-Speelman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-01 00:00:00.000000000 Z
11
+ date: 2020-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -111,7 +111,9 @@ files:
111
111
  - fc_enrich.gemspec
112
112
  - gems.rb
113
113
  - lib/fc_enrich.rb
114
+ - lib/fc_enrich/company_enrich_request.rb
114
115
  - lib/fc_enrich/fake_client.rb
116
+ - lib/fc_enrich/fake_client/post_v3_company.enrich.json
115
117
  - lib/fc_enrich/fake_client/post_v3_person.enrich.json
116
118
  - lib/fc_enrich/http_client.rb
117
119
  - lib/fc_enrich/person_enrich_request.rb