@@ -987,57 +987,59 @@ export class PeopleSearchTool extends ToolBubble<
987987 const feLimit = Math . min ( limit , 100 ) ;
988988
989989 try {
990- const fullEnrichParams : Record < string , unknown > = {
991- operation : 'people_search' ,
992- limit : feLimit ,
993- credentials,
994- } ;
995- if ( allJobTitles . length > 0 )
996- fullEnrichParams . current_position_titles = allJobTitles . map ( ( v ) => ( {
997- value : v ,
998- } ) ) ;
999- if ( companyName )
1000- fullEnrichParams . current_company_names = [ { value : companyName } ] ;
1001- if ( pastCompanyName )
1002- fullEnrichParams . past_company_names = [ { value : pastCompanyName } ] ;
1003- if ( allLocations . length > 0 )
1004- fullEnrichParams . person_locations = allLocations . map ( ( v ) => ( {
1005- value : v ,
1006- } ) ) ;
1007- if ( skills ?. length )
1008- fullEnrichParams . person_skills = skills . map ( ( v ) => ( { value : v } ) ) ;
1009- if ( seniorityLevels ?. length )
1010- fullEnrichParams . current_position_seniority_level = seniorityLevels . map (
1011- ( v ) => ( { value : v } )
1012- ) ;
1013- if ( companyIndustries ?. length )
1014- fullEnrichParams . current_company_industries = companyIndustries . map (
1015- ( v ) => ( { value : v } )
1016- ) ;
1017- if (
1018- minCompanyHeadcount !== undefined ||
1019- maxCompanyHeadcount !== undefined
1020- ) {
1021- const range : { min ?: number ; max ?: number } = { } ;
1022- if ( minCompanyHeadcount !== undefined ) range . min = minCompanyHeadcount ;
1023- if ( maxCompanyHeadcount !== undefined ) range . max = maxCompanyHeadcount ;
1024- fullEnrichParams . current_company_headcounts = [ range ] ;
1025- }
1026- if ( cursor ) fullEnrichParams . search_after = cursor ;
990+ const headcountRange : { min ?: number ; max ?: number } = { } ;
991+ if ( minCompanyHeadcount !== undefined )
992+ headcountRange . min = minCompanyHeadcount ;
993+ if ( maxCompanyHeadcount !== undefined )
994+ headcountRange . max = maxCompanyHeadcount ;
1027995
1028- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1029- const feResult = await new FullEnrichBubble (
1030- fullEnrichParams as any ,
1031- this . context
996+ const people_search = await new FullEnrichBubble (
997+ {
998+ operation : 'people_search' ,
999+ limit : feLimit ,
1000+ ...( allJobTitles . length > 0 && {
1001+ current_position_titles : allJobTitles . map ( ( v ) => ( { value : v } ) ) ,
1002+ } ) ,
1003+ ...( companyName && {
1004+ current_company_names : [ { value : companyName } ] ,
1005+ } ) ,
1006+ ...( pastCompanyName && {
1007+ past_company_names : [ { value : pastCompanyName } ] ,
1008+ } ) ,
1009+ ...( allLocations . length > 0 && {
1010+ person_locations : allLocations . map ( ( v ) => ( { value : v } ) ) ,
1011+ } ) ,
1012+ ...( skills ?. length && {
1013+ person_skills : skills . map ( ( v ) => ( { value : v } ) ) ,
1014+ } ) ,
1015+ ...( seniorityLevels ?. length && {
1016+ current_position_seniority_level : seniorityLevels . map ( ( v ) => ( {
1017+ value : v ,
1018+ } ) ) ,
1019+ } ) ,
1020+ ...( companyIndustries ?. length && {
1021+ current_company_industries : companyIndustries . map ( ( v ) => ( {
1022+ value : v ,
1023+ } ) ) ,
1024+ } ) ,
1025+ ...( ( minCompanyHeadcount !== undefined ||
1026+ maxCompanyHeadcount !== undefined ) && {
1027+ current_company_headcounts : [ headcountRange ] ,
1028+ } ) ,
1029+ ...( cursor && { search_after : cursor } ) ,
1030+ credentials,
1031+ } ,
1032+ this . context ,
1033+ 'people_search'
10321034 ) . action ( ) ;
10331035
1034- if ( ! feResult . success ) {
1036+ if ( ! people_search . success ) {
10351037 return this . createErrorResult (
1036- feResult . error || 'FullEnrich people search failed'
1038+ people_search . error || 'FullEnrich people search failed'
10371039 ) ;
10381040 }
10391041
1040- const data = feResult . data as {
1042+ const data = people_search . data as {
10411043 people ?: Array < Record < string , unknown > > ;
10421044 metadata ?: {
10431045 total : number ;
0 commit comments