chore: import upstream snapshot with attribution
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export { workEmailEnrichment } from './work-email'
|
||||
@@ -0,0 +1,150 @@
|
||||
/**
|
||||
* @vitest-environment node
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import type { EnrichmentProvider } from '@/enrichments/types'
|
||||
import { workEmailEnrichment } from '@/enrichments/work-email/work-email'
|
||||
|
||||
function provider(id: string): EnrichmentProvider {
|
||||
const p = workEmailEnrichment.providers.find((x) => x.id === id)
|
||||
if (!p) throw new Error(`Provider ${id} not found in work-email cascade`)
|
||||
return p
|
||||
}
|
||||
|
||||
const nameDomain = { fullName: 'John Doe', companyDomain: 'https://www.acme.com/careers' }
|
||||
const linkedinOnly = { fullName: 'John Doe', linkedinUrl: 'https://linkedin.com/in/johndoe' }
|
||||
|
||||
describe('work-email enrichment cascade', () => {
|
||||
it('chains the hosted providers in waterfall order', () => {
|
||||
expect(workEmailEnrichment.providers.map((p) => p.id)).toEqual([
|
||||
'hunter',
|
||||
'findymail',
|
||||
'findymail-linkedin',
|
||||
'prospeo',
|
||||
'wiza',
|
||||
'pdl',
|
||||
'datagma',
|
||||
'leadmagic',
|
||||
'dropcontact',
|
||||
'enrow',
|
||||
])
|
||||
})
|
||||
|
||||
describe('findymail (name)', () => {
|
||||
const p = provider('findymail')
|
||||
it('maps name + domain and extracts contact.email', () => {
|
||||
expect(p.toolId).toBe('findymail_find_email_from_name')
|
||||
expect(p.buildParams(nameDomain)).toEqual({ name: 'John Doe', domain: 'acme.com' })
|
||||
expect(p.mapOutput({ contact: { email: 'j@acme.com' } })).toEqual({ email: 'j@acme.com' })
|
||||
expect(p.buildParams(linkedinOnly)).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
describe('findymail-linkedin', () => {
|
||||
const p = provider('findymail-linkedin')
|
||||
it('keys off the LinkedIn URL and skips without one', () => {
|
||||
expect(p.toolId).toBe('findymail_find_email_from_linkedin')
|
||||
expect(p.buildParams(linkedinOnly)).toEqual({
|
||||
linkedin_url: 'https://linkedin.com/in/johndoe',
|
||||
})
|
||||
expect(p.buildParams(nameDomain)).toBeNull()
|
||||
expect(p.mapOutput({ contact: { email: 'j@acme.com' } })).toEqual({ email: 'j@acme.com' })
|
||||
})
|
||||
})
|
||||
|
||||
describe('prospeo (opportunistic)', () => {
|
||||
const p = provider('prospeo')
|
||||
it('uses name+domain, or LinkedIn when present', () => {
|
||||
expect(p.buildParams(nameDomain)).toEqual({
|
||||
full_name: 'John Doe',
|
||||
company_website: 'acme.com',
|
||||
})
|
||||
expect(p.buildParams(linkedinOnly)).toEqual({
|
||||
full_name: 'John Doe',
|
||||
linkedin_url: 'https://linkedin.com/in/johndoe',
|
||||
})
|
||||
expect(p.buildParams({ fullName: 'John Doe' })).toBeNull()
|
||||
expect(p.mapOutput({ person: { email: { email: 'j@acme.com' } } })).toEqual({
|
||||
email: 'j@acme.com',
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('wiza (opportunistic)', () => {
|
||||
const p = provider('wiza')
|
||||
it('reveals email-only (partial), preferring LinkedIn profile_url', () => {
|
||||
expect(p.buildParams(nameDomain)).toEqual({
|
||||
full_name: 'John Doe',
|
||||
domain: 'acme.com',
|
||||
enrichment_level: 'partial',
|
||||
})
|
||||
expect(p.buildParams(linkedinOnly)).toEqual({
|
||||
full_name: 'John Doe',
|
||||
profile_url: 'https://linkedin.com/in/johndoe',
|
||||
enrichment_level: 'partial',
|
||||
})
|
||||
expect(p.buildParams({ fullName: 'John Doe' })).toBeNull()
|
||||
expect(p.mapOutput({ email: 'j@acme.com' })).toEqual({ email: 'j@acme.com' })
|
||||
})
|
||||
})
|
||||
|
||||
describe('datagma', () => {
|
||||
const p = provider('datagma')
|
||||
it('maps name + normalized company domain', () => {
|
||||
expect(p.toolId).toBe('datagma_find_email')
|
||||
expect(p.buildParams(nameDomain)).toEqual({ fullName: 'John Doe', company: 'acme.com' })
|
||||
expect(p.buildParams({ fullName: 'John Doe' })).toBeNull()
|
||||
expect(p.mapOutput({ email: 'j@acme.com' })).toEqual({ email: 'j@acme.com' })
|
||||
expect(p.mapOutput({})).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
describe('leadmagic', () => {
|
||||
const p = provider('leadmagic')
|
||||
it('passes full_name + domain and keeps mononym rows', () => {
|
||||
expect(p.toolId).toBe('leadmagic_find_email')
|
||||
expect(p.buildParams(nameDomain)).toEqual({ full_name: 'John Doe', domain: 'acme.com' })
|
||||
expect(p.buildParams({ fullName: 'John Doe' })).toBeNull()
|
||||
// single-token name still runs (no longer skipped)
|
||||
expect(p.buildParams({ fullName: 'Cher', companyDomain: 'acme.com' })).toEqual({
|
||||
full_name: 'Cher',
|
||||
domain: 'acme.com',
|
||||
})
|
||||
expect(p.mapOutput({ email: 'j@acme.com' })).toEqual({ email: 'j@acme.com' })
|
||||
})
|
||||
})
|
||||
|
||||
describe('dropcontact', () => {
|
||||
const p = provider('dropcontact')
|
||||
it('enriches from name plus company or LinkedIn', () => {
|
||||
expect(p.toolId).toBe('dropcontact_enrich_contact')
|
||||
expect(p.buildParams(nameDomain)).toEqual({ full_name: 'John Doe', website: 'acme.com' })
|
||||
expect(p.buildParams(linkedinOnly)).toEqual({
|
||||
full_name: 'John Doe',
|
||||
linkedin: 'https://linkedin.com/in/johndoe',
|
||||
})
|
||||
expect(p.buildParams({ companyDomain: 'acme.com' })).toBeNull()
|
||||
expect(p.mapOutput({ email: 'j@acme.com' })).toEqual({ email: 'j@acme.com' })
|
||||
expect(p.mapOutput({})).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
describe('enrow', () => {
|
||||
const p = provider('enrow')
|
||||
it('maps full name + company domain', () => {
|
||||
expect(p.toolId).toBe('enrow_find_email')
|
||||
expect(p.buildParams(nameDomain)).toEqual({
|
||||
fullname: 'John Doe',
|
||||
company_domain: 'acme.com',
|
||||
})
|
||||
expect(p.buildParams({ fullName: 'John Doe' })).toBeNull()
|
||||
// only a valid-qualified email fills the cell
|
||||
expect(p.mapOutput({ email: 'j@acme.com', qualification: 'valid' })).toEqual({
|
||||
email: 'j@acme.com',
|
||||
})
|
||||
expect(p.mapOutput({ email: 'j@acme.com', qualification: 'invalid' })).toBeNull()
|
||||
expect(p.mapOutput({ email: 'j@acme.com' })).toBeNull()
|
||||
expect(p.mapOutput({})).toBeNull()
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,212 @@
|
||||
import { Mail } from '@sim/emcn/icons'
|
||||
import { filterUndefined } from '@sim/utils/object'
|
||||
import { normalizeDomain, splitName, str, toolProvider } from '@/enrichments/providers'
|
||||
import type { EnrichmentConfig } from '@/enrichments/types'
|
||||
|
||||
/**
|
||||
* Work Email enrichment. Finds a person's work email from a full name plus any
|
||||
* available identifiers (company domain, LinkedIn URL) via a provider waterfall:
|
||||
* deterministic finders first (Hunter, Findymail by name then by LinkedIn), then
|
||||
* enrichment/reveal providers (Prospeo, Wiza), then People Data Labs as a broad
|
||||
* record-match fallback, then Datagma, LeadMagic, Dropcontact, and Enrow
|
||||
* as additional finders. Each provider opportunistically uses whatever
|
||||
* identifiers the row provides and self-skips when it has none usable, so adding
|
||||
* more inputs widens coverage. First email wins; all providers support hosted keys.
|
||||
*/
|
||||
export const workEmailEnrichment: EnrichmentConfig = {
|
||||
id: 'work-email',
|
||||
name: 'Work Email',
|
||||
description: "Find a person's work email from their name, company, or LinkedIn URL.",
|
||||
icon: Mail,
|
||||
inputs: [
|
||||
{ id: 'fullName', name: 'Full name', type: 'string', required: true },
|
||||
{ id: 'companyDomain', name: 'Company domain', type: 'string' },
|
||||
{ id: 'linkedinUrl', name: 'LinkedIn URL', type: 'string' },
|
||||
],
|
||||
outputs: [{ id: 'email', name: 'email', type: 'string' }],
|
||||
providers: [
|
||||
toolProvider({
|
||||
id: 'hunter',
|
||||
label: 'Hunter',
|
||||
toolId: 'hunter_email_finder',
|
||||
buildParams: (inputs) => {
|
||||
const name = splitName(inputs.fullName)
|
||||
const domain = normalizeDomain(inputs.companyDomain)
|
||||
if (!name || !domain) return null
|
||||
return { domain, first_name: name.firstName, last_name: name.lastName }
|
||||
},
|
||||
mapOutput: (output) => {
|
||||
const email = str(output.email)
|
||||
return email ? { email } : null
|
||||
},
|
||||
}),
|
||||
toolProvider({
|
||||
id: 'findymail',
|
||||
label: 'Findymail',
|
||||
toolId: 'findymail_find_email_from_name',
|
||||
buildParams: (inputs) => {
|
||||
const name = str(inputs.fullName)
|
||||
const domain = normalizeDomain(inputs.companyDomain)
|
||||
if (!name || !domain) return null
|
||||
return { name, domain }
|
||||
},
|
||||
mapOutput: (output) => {
|
||||
const contact = output.contact as Record<string, unknown> | null
|
||||
const email = str(contact?.email)
|
||||
return email ? { email } : null
|
||||
},
|
||||
}),
|
||||
toolProvider({
|
||||
id: 'findymail-linkedin',
|
||||
label: 'Findymail (LinkedIn)',
|
||||
toolId: 'findymail_find_email_from_linkedin',
|
||||
buildParams: (inputs) => {
|
||||
const linkedin = str(inputs.linkedinUrl)
|
||||
if (!linkedin) return null
|
||||
return { linkedin_url: linkedin }
|
||||
},
|
||||
mapOutput: (output) => {
|
||||
const contact = output.contact as Record<string, unknown> | null
|
||||
const email = str(contact?.email)
|
||||
return email ? { email } : null
|
||||
},
|
||||
}),
|
||||
toolProvider({
|
||||
id: 'prospeo',
|
||||
label: 'Prospeo',
|
||||
toolId: 'prospeo_enrich_person',
|
||||
buildParams: (inputs) => {
|
||||
const linkedin = str(inputs.linkedinUrl)
|
||||
const fullName = str(inputs.fullName)
|
||||
const companyWebsite = normalizeDomain(inputs.companyDomain)
|
||||
if (!linkedin && !(fullName && companyWebsite)) return null
|
||||
return filterUndefined({
|
||||
linkedin_url: linkedin || undefined,
|
||||
full_name: fullName || undefined,
|
||||
company_website: companyWebsite || undefined,
|
||||
})
|
||||
},
|
||||
mapOutput: (output) => {
|
||||
const person = output.person as Record<string, unknown> | undefined
|
||||
const emailObj = person?.email as Record<string, unknown> | undefined
|
||||
const email = str(emailObj?.email)
|
||||
return email ? { email } : null
|
||||
},
|
||||
}),
|
||||
toolProvider({
|
||||
id: 'wiza',
|
||||
label: 'Wiza',
|
||||
toolId: 'wiza_individual_reveal',
|
||||
buildParams: (inputs) => {
|
||||
const linkedin = str(inputs.linkedinUrl)
|
||||
const fullName = str(inputs.fullName)
|
||||
const domain = normalizeDomain(inputs.companyDomain)
|
||||
if (!linkedin && !(fullName && domain)) return null
|
||||
// 'partial' reveals the email only (2 credits); avoids phone charges.
|
||||
return filterUndefined({
|
||||
profile_url: linkedin || undefined,
|
||||
full_name: fullName || undefined,
|
||||
domain: domain || undefined,
|
||||
enrichment_level: 'partial',
|
||||
})
|
||||
},
|
||||
mapOutput: (output) => {
|
||||
const email = str(output.email)
|
||||
return email ? { email } : null
|
||||
},
|
||||
}),
|
||||
toolProvider({
|
||||
id: 'pdl',
|
||||
label: 'People Data Labs',
|
||||
toolId: 'pdl_person_enrich',
|
||||
buildParams: (inputs) => {
|
||||
const name = str(inputs.fullName)
|
||||
if (!name) return null
|
||||
// `required` makes PDL 404 (free) when the profile has no work email,
|
||||
// instead of charging a credit for a match we'd discard as a no-match.
|
||||
return filterUndefined({
|
||||
name,
|
||||
company: normalizeDomain(inputs.companyDomain) || undefined,
|
||||
min_likelihood: 6,
|
||||
required: 'work_email',
|
||||
})
|
||||
},
|
||||
mapOutput: (output) => {
|
||||
const person = output.person as Record<string, unknown> | undefined
|
||||
const email = str(person?.work_email)
|
||||
return email ? { email } : null
|
||||
},
|
||||
}),
|
||||
toolProvider({
|
||||
id: 'datagma',
|
||||
label: 'Datagma',
|
||||
toolId: 'datagma_find_email',
|
||||
buildParams: (inputs) => {
|
||||
const fullName = str(inputs.fullName)
|
||||
const company = normalizeDomain(inputs.companyDomain)
|
||||
if (!fullName || !company) return null
|
||||
return { fullName, company }
|
||||
},
|
||||
mapOutput: (output) => {
|
||||
const email = str(output.email)
|
||||
return email ? { email } : null
|
||||
},
|
||||
}),
|
||||
toolProvider({
|
||||
id: 'leadmagic',
|
||||
label: 'LeadMagic',
|
||||
toolId: 'leadmagic_find_email',
|
||||
buildParams: (inputs) => {
|
||||
// LeadMagic accepts full_name + domain, so pass the whole name and let it
|
||||
// split — this keeps single-token (mononym) rows in play.
|
||||
const fullName = str(inputs.fullName)
|
||||
const domain = normalizeDomain(inputs.companyDomain)
|
||||
if (!fullName || !domain) return null
|
||||
return { full_name: fullName, domain }
|
||||
},
|
||||
mapOutput: (output) => {
|
||||
const email = str(output.email)
|
||||
return email ? { email } : null
|
||||
},
|
||||
}),
|
||||
toolProvider({
|
||||
id: 'dropcontact',
|
||||
label: 'Dropcontact',
|
||||
toolId: 'dropcontact_enrich_contact',
|
||||
buildParams: (inputs) => {
|
||||
const fullName = str(inputs.fullName)
|
||||
const website = normalizeDomain(inputs.companyDomain)
|
||||
const linkedin = str(inputs.linkedinUrl)
|
||||
if (!fullName || (!website && !linkedin)) return null
|
||||
return filterUndefined({
|
||||
full_name: fullName,
|
||||
website: website || undefined,
|
||||
linkedin: linkedin || undefined,
|
||||
})
|
||||
},
|
||||
mapOutput: (output) => {
|
||||
const email = str(output.email)
|
||||
return email ? { email } : null
|
||||
},
|
||||
}),
|
||||
toolProvider({
|
||||
id: 'enrow',
|
||||
label: 'Enrow',
|
||||
toolId: 'enrow_find_email',
|
||||
buildParams: (inputs) => {
|
||||
const fullname = str(inputs.fullName)
|
||||
const company_domain = normalizeDomain(inputs.companyDomain)
|
||||
if (!fullname || !company_domain) return null
|
||||
return { fullname, company_domain }
|
||||
},
|
||||
mapOutput: (output) => {
|
||||
// Enrow qualifies each found email valid/invalid; only accept verified-valid
|
||||
// results so the cell isn't filled with an address Enrow itself rejected
|
||||
// (and which hosted billing correctly charges zero for).
|
||||
const email = str(output.email)
|
||||
const qualification = str(output.qualification).toLowerCase()
|
||||
return email && qualification === 'valid' ? { email } : null
|
||||
},
|
||||
}),
|
||||
],
|
||||
}
|
||||
Reference in New Issue
Block a user