Files
simstudioai--sim/apps/sim/blocks/blocks/enrow.ts
T
wehub-resource-sync d25d482dc2
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
chore: import upstream snapshot with attribution
2026-07-13 13:20:55 +08:00

129 lines
4.3 KiB
TypeScript

import { EnrowIcon } from '@/components/icons'
import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types'
import type { EnrowResponse } from '@/tools/enrow/types'
export const EnrowBlock: BlockConfig<EnrowResponse> = {
type: 'enrow',
name: 'Enrow',
description: 'Find and verify B2B emails with triple-verified accuracy',
authMode: AuthMode.ApiKey,
longDescription:
'Integrate Enrow to find verified B2B email addresses from a full name and company, or verify the deliverability of an existing email. Enrow performs deterministic verifications including catch-all emails — no additional verifier needed.',
docsLink: 'https://enrow.readme.io',
category: 'tools',
integrationType: IntegrationType.Sales,
bgColor: '#FFFFFF',
icon: EnrowIcon,
subBlocks: [
{
id: 'operation',
title: 'Operation',
type: 'dropdown',
options: [
{ label: 'Find Email', id: 'enrow_find_email' },
{ label: 'Verify Email', id: 'enrow_verify_email' },
],
value: () => 'enrow_find_email',
},
// --- Find Email ---
{
id: 'fullname',
title: 'Full Name',
type: 'short-input',
required: true,
placeholder: 'John Doe',
condition: { field: 'operation', value: 'enrow_find_email' },
},
{
id: 'company_domain',
title: 'Company Domain',
type: 'short-input',
required: true,
placeholder: 'stripe.com',
condition: { field: 'operation', value: 'enrow_find_email' },
},
{
id: 'company_name',
title: 'Company Name',
type: 'short-input',
placeholder: 'Stripe (used when domain is unavailable)',
condition: { field: 'operation', value: 'enrow_find_email' },
mode: 'advanced',
},
// --- Verify Email ---
{
id: 've_email',
title: 'Email Address',
type: 'short-input',
required: true,
placeholder: 'john@example.com',
condition: { field: 'operation', value: 'enrow_verify_email' },
},
// --- API Key (hidden on hosted Sim for operations with hosted-key support) ---
{
id: 'apiKey',
title: 'API Key',
type: 'short-input',
required: true,
placeholder: 'Enter your Enrow API key',
password: true,
hideWhenHosted: true,
},
],
tools: {
access: ['enrow_find_email', 'enrow_verify_email'],
config: {
tool: (params) => {
switch (params.operation) {
case 'enrow_find_email':
case 'enrow_verify_email':
return params.operation
default:
return 'enrow_find_email'
}
},
params: (params) => {
const { operation: _operation, ...rest } = params
// Map unique subBlock IDs back to tool param names
const idToParam: Record<string, string> = {
ve_email: 'email',
}
const result: Record<string, unknown> = {}
for (const [key, value] of Object.entries(rest)) {
if (value === undefined || value === null || value === '') continue
const mappedKey = idToParam[key] ?? key
result[mappedKey] = value
}
return result
},
},
},
inputs: {
operation: { type: 'string', description: 'Operation to perform' },
apiKey: { type: 'string', description: 'Enrow API key' },
fullname: { type: 'string', description: 'Full name for email search' },
company_domain: { type: 'string', description: 'Company domain for email search' },
company_name: { type: 'string', description: 'Company name for email search' },
ve_email: { type: 'string', description: 'Email address to verify' },
},
outputs: {
id: { type: 'string', description: 'Enrow job identifier' },
email: { type: 'string', description: 'Email address found or verified' },
qualification: { type: 'string', description: '"valid" or "invalid"' },
fullname: { type: 'string', description: 'Full name of the person (find only)' },
company_name: { type: 'string', description: 'Company name (find only)' },
company_domain: { type: 'string', description: 'Company domain (find only)' },
linkedin_url: { type: 'string', description: 'LinkedIn URL of the person (find only)' },
},
}
export const EnrowBlockMeta = {
tags: ['enrichment', 'sales-engagement'],
url: 'https://enrow.io',
} as const satisfies BlockMeta