@absolutejs/engagement-apollo 0.0.4 → 0.0.6

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -50,7 +50,9 @@ var apolloSource = (options) => {
50
50
  company: org ? str(org.name) : null,
51
51
  companyDomain: org ? str(org.primary_domain) : null,
52
52
  emails,
53
+ facebookUrl: str(person.facebook_url),
53
54
  firstName: str(person.first_name),
55
+ githubUrl: str(person.github_url),
54
56
  lastName: str(person.last_name),
55
57
  linkedinUrl: str(person.linkedin_url),
56
58
  location: joinLocation([
@@ -61,7 +63,8 @@ var apolloSource = (options) => {
61
63
  name: str(person.name),
62
64
  photoUrl: str(person.photo_url),
63
65
  raw: person,
64
- title: str(person.title)
66
+ title: str(person.title),
67
+ twitterUrl: str(person.twitter_url)
65
68
  };
66
69
  };
67
70
  const matchById = async (id) => {
@@ -89,12 +92,18 @@ var apolloSource = (options) => {
89
92
  ...query.domain ? { q_organization_domains_list: [query.domain] } : {},
90
93
  ...!query.domain && query.company ? { q_keywords: query.company } : {}
91
94
  });
95
+ const searchRequests = search ? 1 : 0;
92
96
  const previews = search && Array.isArray(search.people) ? search.people : [];
93
97
  const ids = previews.map((person) => isRecord(person) ? str(person.id) : null).filter((id) => id !== null);
94
- if (ids.length === 0)
95
- return [];
98
+ if (ids.length === 0) {
99
+ return { people: [], revealsAttempted: 0, searchRequests };
100
+ }
96
101
  const revealed = await Promise.all(ids.map((id) => matchById(id)));
97
- return revealed.filter((person) => person !== null);
102
+ return {
103
+ people: revealed.filter((person) => person !== null),
104
+ revealsAttempted: ids.length,
105
+ searchRequests
106
+ };
98
107
  };
99
108
  const enrichCompany = async (query) => {
100
109
  if (!query.domain)
package/package.json CHANGED
@@ -39,5 +39,5 @@
39
39
  },
40
40
  "type": "module",
41
41
  "types": "./dist/index.d.ts",
42
- "version": "0.0.4"
42
+ "version": "0.0.6"
43
43
  }