@@ -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 )
0 commit comments