Skip to content

Commit f727944

Browse files
committed
updated docs and types
1 parent 15d335c commit f727944

9 files changed

Lines changed: 113 additions & 167 deletions

File tree

apps/docs/content/docs/en/tools/enrich.mdx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ Retrieve basic LinkedIn profile information from an email address. A lighter ver
123123
| `title` | string | Job title |
124124
| `location` | string | Location |
125125
| `company` | string | Current company |
126+
| `companyLocation` | string | Company location |
126127
| `companyLinkedIn` | string | Company LinkedIn URL |
128+
| `profileId` | string | LinkedIn profile ID |
127129
| `schoolName` | string | School name |
128130
| `schoolUrl` | string | School URL |
129131
| `linkedInUrl` | string | LinkedIn profile URL |
@@ -597,7 +599,7 @@ Search for employees within specific companies by location and job title.
597599
| Parameter | Type | Required | Description |
598600
| --------- | ---- | -------- | ----------- |
599601
| `apiKey` | string | Yes | Enrich API key |
600-
| `companyIds` | json | Yes | Array of company IDs to search within |
602+
| `companyIds` | json | No | Array of company IDs to search within |
601603
| `country` | string | No | Country filter \(e.g., United States\) |
602604
| `city` | string | No | City filter \(e.g., San Francisco\) |
603605
| `state` | string | No | State filter \(e.g., California\) |
@@ -788,7 +790,7 @@ Get comments on a LinkedIn post.
788790
| --------- | ---- | -------- | ----------- |
789791
| `apiKey` | string | Yes | Enrich API key |
790792
| `postUrn` | string | Yes | LinkedIn activity URN \(e.g., urn:li:activity:7191163324208705536\) |
791-
| `page` | number | Yes | Page number \(starts at 1\) |
793+
| `page` | number | No | Page number \(starts at 1, default: 1\) |
792794

793795
#### Output
794796

@@ -840,6 +842,11 @@ Get a person
840842
|`commentary` | string | Activity text content |
841843
|`linkedInUrl` | string | Link to activity |
842844
|`timeElapsed` | string | Time elapsed since activity |
845+
|`numReactions` | number | Total number of reactions |
846+
|`author` | object | Activity author info |
847+
|`name` | string | Author name |
848+
|`profileId` | string | Profile ID |
849+
|`profilePicture` | string | Profile picture URL |
843850
|`reactionBreakdown` | object | Reactions |
844851
|`likes` | number | Likes |
845852
|`empathy` | number | Empathy reactions |

apps/sim/blocks/blocks/enrich.ts

Lines changed: 39 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ export const EnrichBlock: BlockConfig = {
271271
type: 'code',
272272
placeholder: '[12345, 67890]',
273273
condition: { field: 'operation', value: 'search_company_employees' },
274-
required: { field: 'operation', value: 'search_company_employees' },
275274
},
276275
{
277276
id: 'country',
@@ -310,13 +309,31 @@ export const EnrichBlock: BlockConfig = {
310309
placeholder: '["germany", "france"]',
311310
condition: { field: 'operation', value: 'search_similar_companies' },
312311
},
312+
{
313+
id: 'employeeSizeType',
314+
title: 'Employee Size Filter Type',
315+
type: 'dropdown',
316+
options: [
317+
{ label: 'Range', id: 'RANGE' },
318+
{ label: 'Exact', id: 'EXACT' },
319+
],
320+
condition: { field: 'operation', value: 'search_similar_companies' },
321+
mode: 'advanced',
322+
},
313323
{
314324
id: 'employeeSizeRange',
315325
title: 'Employee Size Range (JSON)',
316326
type: 'code',
317327
placeholder: '[{"start": 50, "end": 200}]',
318328
condition: { field: 'operation', value: 'search_similar_companies' },
319329
},
330+
{
331+
id: 'num',
332+
title: 'Results Per Page',
333+
type: 'short-input',
334+
placeholder: '10',
335+
condition: { field: 'operation', value: 'search_similar_companies' },
336+
},
320337

321338
{
322339
id: 'filters',
@@ -418,6 +435,14 @@ export const EnrichBlock: BlockConfig = {
418435
condition: { field: 'operation', value: 'search_company_activities' },
419436
required: { field: 'operation', value: 'search_company_activities' },
420437
},
438+
{
439+
id: 'offset',
440+
title: 'Offset',
441+
type: 'short-input',
442+
placeholder: '0',
443+
condition: { field: 'operation', value: 'search_company_activities' },
444+
mode: 'advanced',
445+
},
421446

422447
{
423448
id: 'hash',
@@ -446,6 +471,7 @@ export const EnrichBlock: BlockConfig = {
446471
'search_post_comments',
447472
],
448473
},
474+
required: { field: 'operation', value: 'sales_pointer_people' },
449475
},
450476
{
451477
id: 'pageSize',
@@ -502,70 +528,7 @@ export const EnrichBlock: BlockConfig = {
502528
'enrich_search_logo',
503529
],
504530
config: {
505-
tool: (params) => {
506-
switch (params.operation) {
507-
case 'check_credits':
508-
return 'enrich_check_credits'
509-
case 'email_to_profile':
510-
return 'enrich_email_to_profile'
511-
case 'email_to_person_lite':
512-
return 'enrich_email_to_person_lite'
513-
case 'linkedin_profile':
514-
return 'enrich_linkedin_profile'
515-
case 'find_email':
516-
return 'enrich_find_email'
517-
case 'linkedin_to_work_email':
518-
return 'enrich_linkedin_to_work_email'
519-
case 'linkedin_to_personal_email':
520-
return 'enrich_linkedin_to_personal_email'
521-
case 'phone_finder':
522-
return 'enrich_phone_finder'
523-
case 'email_to_phone':
524-
return 'enrich_email_to_phone'
525-
case 'verify_email':
526-
return 'enrich_verify_email'
527-
case 'disposable_email_check':
528-
return 'enrich_disposable_email_check'
529-
case 'email_to_ip':
530-
return 'enrich_email_to_ip'
531-
case 'ip_to_company':
532-
return 'enrich_ip_to_company'
533-
case 'company_lookup':
534-
return 'enrich_company_lookup'
535-
case 'company_funding':
536-
return 'enrich_company_funding'
537-
case 'company_revenue':
538-
return 'enrich_company_revenue'
539-
case 'search_people':
540-
return 'enrich_search_people'
541-
case 'search_company':
542-
return 'enrich_search_company'
543-
case 'search_company_employees':
544-
return 'enrich_search_company_employees'
545-
case 'search_similar_companies':
546-
return 'enrich_search_similar_companies'
547-
case 'sales_pointer_people':
548-
return 'enrich_sales_pointer_people'
549-
case 'search_posts':
550-
return 'enrich_search_posts'
551-
case 'get_post_details':
552-
return 'enrich_get_post_details'
553-
case 'search_post_reactions':
554-
return 'enrich_search_post_reactions'
555-
case 'search_post_comments':
556-
return 'enrich_search_post_comments'
557-
case 'search_people_activities':
558-
return 'enrich_search_people_activities'
559-
case 'search_company_activities':
560-
return 'enrich_search_company_activities'
561-
case 'reverse_hash_lookup':
562-
return 'enrich_reverse_hash_lookup'
563-
case 'search_logo':
564-
return 'enrich_search_logo'
565-
default:
566-
throw new Error(`Invalid Enrich operation: ${params.operation}`)
567-
}
568-
},
531+
tool: (params) => `enrich_${params.operation}`,
569532
params: (params) => {
570533
const { operation, ...rest } = params
571534
const parsedParams: Record<string, any> = { ...rest }
@@ -631,8 +594,18 @@ export const EnrichBlock: BlockConfig = {
631594
parsedParams.url = rest.domain
632595
}
633596

634-
if (parsedParams.page) parsedParams.page = Number(parsedParams.page)
597+
if (parsedParams.page) {
598+
const pageNum = Number(parsedParams.page)
599+
if (operation === 'search_people' || operation === 'search_company') {
600+
parsedParams.currentPage = pageNum
601+
parsedParams.page = undefined
602+
} else {
603+
parsedParams.page = pageNum
604+
}
605+
}
635606
if (parsedParams.pageSize) parsedParams.pageSize = Number(parsedParams.pageSize)
607+
if (parsedParams.num) parsedParams.num = Number(parsedParams.num)
608+
if (parsedParams.offset) parsedParams.offset = Number(parsedParams.offset)
636609
if (parsedParams.staffCountMin)
637610
parsedParams.staffCountMin = Number(parsedParams.staffCountMin)
638611
if (parsedParams.staffCountMax)

apps/sim/hooks/queries/usage-history.ts

Lines changed: 0 additions & 80 deletions
This file was deleted.

apps/sim/tools/enrich/email_to_person_lite.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ export const emailToPersonLiteTool: ToolConfig<
5555
title: data.title ?? null,
5656
location: data.location ?? null,
5757
company: data.company ?? null,
58+
companyLocation: data.company_location ?? data.companyLocation ?? null,
5859
companyLinkedIn: data.company_linkedin ?? data.companyLinkedIn ?? null,
60+
profileId: data.profile_id ?? data.profileId ?? null,
5961
schoolName: data.school_name ?? data.schoolName ?? null,
6062
schoolUrl: data.school_url ?? data.schoolUrl ?? null,
6163
linkedInUrl: data.linkedin_url ?? data.linkedInUrl ?? null,
@@ -106,11 +108,21 @@ export const emailToPersonLiteTool: ToolConfig<
106108
description: 'Current company',
107109
optional: true,
108110
},
111+
companyLocation: {
112+
type: 'string',
113+
description: 'Company location',
114+
optional: true,
115+
},
109116
companyLinkedIn: {
110117
type: 'string',
111118
description: 'Company LinkedIn URL',
112119
optional: true,
113120
},
121+
profileId: {
122+
type: 'string',
123+
description: 'LinkedIn profile ID',
124+
optional: true,
125+
},
114126
schoolName: {
115127
type: 'string',
116128
description: 'School name',

apps/sim/tools/enrich/email_to_profile.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,28 @@ export const emailToProfileTool: ToolConfig<
5151
transformResponse: async (response: Response) => {
5252
const data = await response.json()
5353

54+
// API returns positions nested under data.positions.positionHistory
5455
const positionHistory =
55-
data.positionHistory?.map((pos: any) => ({
56+
data.positions?.positionHistory?.map((pos: any) => ({
5657
title: pos.title ?? '',
57-
company: pos.companyName ?? pos.company ?? '',
58-
startDate: pos.startDate ?? null,
59-
endDate: pos.endDate ?? null,
60-
location: pos.location ?? null,
58+
company: pos.company?.companyName ?? '',
59+
startDate: pos.startEndDate?.start
60+
? `${pos.startEndDate.start.year}-${pos.startEndDate.start.month ?? 1}`
61+
: null,
62+
endDate: pos.startEndDate?.end
63+
? `${pos.startEndDate.end.year}-${pos.startEndDate.end.month ?? 1}`
64+
: null,
65+
location: pos.company?.companyLocation ?? null,
6166
})) ?? []
6267

68+
// API returns education nested under data.schools.educationHistory
6369
const education =
64-
data.schools?.map((edu: any) => ({
65-
school: edu.schoolName ?? edu.school ?? '',
66-
degree: edu.degree ?? null,
70+
data.schools?.educationHistory?.map((edu: any) => ({
71+
school: edu.school?.schoolName ?? '',
72+
degree: edu.degreeName ?? null,
6773
fieldOfStudy: edu.fieldOfStudy ?? null,
68-
startDate: edu.startDate ?? null,
69-
endDate: edu.endDate ?? null,
74+
startDate: edu.startEndDate?.start?.year ? String(edu.startEndDate.start.year) : null,
75+
endDate: edu.startEndDate?.end?.year ? String(edu.startEndDate.end.year) : null,
7076
})) ?? []
7177

7278
const certifications =

apps/sim/tools/enrich/search_company_employees.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const searchCompanyEmployeesTool: ToolConfig<
2222
},
2323
companyIds: {
2424
type: 'json',
25-
required: true,
25+
required: false,
2626
visibility: 'user-or-llm',
2727
description: 'Array of company IDs to search within',
2828
},
@@ -72,10 +72,9 @@ export const searchCompanyEmployeesTool: ToolConfig<
7272
'Content-Type': 'application/json',
7373
}),
7474
body: (params) => {
75-
const body: Record<string, any> = {
76-
companyIds: params.companyIds,
77-
}
75+
const body: Record<string, any> = {}
7876

77+
if (params.companyIds) body.companyIds = params.companyIds
7978
if (params.country) body.country = params.country
8079
if (params.city) body.city = params.city
8180
if (params.state) body.state = params.state

0 commit comments

Comments
 (0)