diff --git a/apps/sim/blocks/blocks/peopledatalabs.ts b/apps/sim/blocks/blocks/peopledatalabs.ts index b8572509bd..2578574993 100644 --- a/apps/sim/blocks/blocks/peopledatalabs.ts +++ b/apps/sim/blocks/blocks/peopledatalabs.ts @@ -64,6 +64,7 @@ export const PeopleDataLabsBlock: BlockConfig = { id: 'first_name', title: 'First Name', type: 'short-input', + placeholder: 'Jane', condition: { field: 'operation', value: ['pdl_person_enrich', 'pdl_person_identify'] }, mode: 'advanced', }, @@ -71,6 +72,7 @@ export const PeopleDataLabsBlock: BlockConfig = { id: 'last_name', title: 'Last Name', type: 'short-input', + placeholder: 'Doe', condition: { field: 'operation', value: ['pdl_person_enrich', 'pdl_person_identify'] }, mode: 'advanced', }, @@ -185,6 +187,7 @@ export const PeopleDataLabsBlock: BlockConfig = { id: 'pdl_id', title: 'PDL Company ID', type: 'short-input', + placeholder: 'people-data-labs', condition: { field: 'operation', value: 'pdl_company_enrich' }, mode: 'advanced', }, @@ -268,6 +271,7 @@ export const PeopleDataLabsBlock: BlockConfig = { id: 'identify_postal_code', title: 'Postal Code', type: 'short-input', + placeholder: '94103', condition: { field: 'operation', value: 'pdl_person_identify' }, mode: 'advanced', }, @@ -366,6 +370,25 @@ export const PeopleDataLabsBlock: BlockConfig = { mode: 'advanced', }, + // Title case (shared by Person Enrich/Identify/Search, Company Enrich, Autocomplete) + { + id: 'titlecase', + title: 'Title Case Names', + type: 'switch', + condition: { + field: 'operation', + value: [ + 'pdl_person_enrich', + 'pdl_person_identify', + 'pdl_person_search', + 'pdl_company_enrich', + 'pdl_company_search', + 'pdl_autocomplete', + ], + }, + mode: 'advanced', + }, + // API Key { id: 'apiKey', @@ -488,6 +511,18 @@ export const PeopleDataLabsBlock: BlockConfig = { result.min_likelihood = undefined } + // titlecase is honored by enrich/identify/search/autocomplete; clear it for others + if ( + op !== 'pdl_person_enrich' && + op !== 'pdl_person_identify' && + op !== 'pdl_person_search' && + op !== 'pdl_company_enrich' && + op !== 'pdl_company_search' && + op !== 'pdl_autocomplete' + ) { + result.titlecase = undefined + } + if (op === 'pdl_person_identify') { if (params.identify_locality !== undefined) result.locality = params.identify_locality if (params.identify_region !== undefined) result.region = params.identify_region @@ -575,6 +610,8 @@ export const PeopleDataLabsBlock: BlockConfig = { // Bulk requests: { type: 'string', description: 'JSON array of bulk request objects' }, required: { type: 'string', description: 'Required-fields expression for bulk' }, + // Shared + titlecase: { type: 'boolean', description: 'Return name fields in title case' }, }, outputs: { diff --git a/apps/sim/tools/peopledatalabs/autocomplete.ts b/apps/sim/tools/peopledatalabs/autocomplete.ts index c9306e6461..588605f7a5 100644 --- a/apps/sim/tools/peopledatalabs/autocomplete.ts +++ b/apps/sim/tools/peopledatalabs/autocomplete.ts @@ -45,6 +45,12 @@ export const autocompleteTool: ToolConfig { const data = (await response.json()) as Record + const status = (data.status as number) ?? response.status + + if (status === 404) { + return { success: true, output: { total: 0, scroll_token: null, results: [] } } + } if (!response.ok) { const error = (data.error as { message?: string })?.message diff --git a/apps/sim/tools/peopledatalabs/person_enrich.ts b/apps/sim/tools/peopledatalabs/person_enrich.ts index 4627fccefc..0157260534 100644 --- a/apps/sim/tools/peopledatalabs/person_enrich.ts +++ b/apps/sim/tools/peopledatalabs/person_enrich.ts @@ -89,6 +89,12 @@ export const personEnrichTool: ToolConfig { const data = (await response.json()) as Record + const status = (data.status as number) ?? response.status + + if (status === 404) { + return { success: true, output: { total: 0, scroll_token: null, results: [] } } + } if (!response.ok) { const error = (data.error as { message?: string })?.message diff --git a/apps/sim/tools/peopledatalabs/types.ts b/apps/sim/tools/peopledatalabs/types.ts index 93a461df3b..a69da995c8 100644 --- a/apps/sim/tools/peopledatalabs/types.ts +++ b/apps/sim/tools/peopledatalabs/types.ts @@ -217,6 +217,7 @@ export interface PdlPersonEnrichParams { location?: string min_likelihood?: number required?: string + titlecase?: boolean } export interface PdlPersonEnrichResponse extends ToolResponse { @@ -234,6 +235,7 @@ export interface PdlPersonSearchParams { size?: number scroll_token?: string dataset?: string + titlecase?: boolean } export interface PdlPersonSearchResponse extends ToolResponse { @@ -257,6 +259,7 @@ export interface PdlCompanyEnrichParams { country?: string min_likelihood?: number required?: string + titlecase?: boolean } export interface PdlCompanyEnrichResponse extends ToolResponse { @@ -273,6 +276,7 @@ export interface PdlCompanySearchParams { query?: string size?: number scroll_token?: string + titlecase?: boolean } export interface PdlCompanySearchResponse extends ToolResponse { @@ -288,6 +292,7 @@ export interface PdlAutocompleteParams { field: string text?: string size?: number + titlecase?: boolean } export interface PdlAutocompleteSuggestion { @@ -364,6 +369,7 @@ export interface PdlPersonIdentifyParams { birth_date?: string data_include?: string include_if_matched?: boolean + titlecase?: boolean } export interface PdlPersonIdentifyMatch {