|
| 1 | +import { RB2BIcon } from '@/components/icons' |
| 2 | +import type { BlockConfig } from '@/blocks/types' |
| 3 | +import { AuthMode, IntegrationType } from '@/blocks/types' |
| 4 | +import type { Rb2bResponse } from '@/tools/rb2b/types' |
| 5 | + |
| 6 | +const EMAIL_OPERATIONS = [ |
| 7 | + 'hem_to_business_profile', |
| 8 | + 'hem_to_best_linkedin', |
| 9 | + 'hem_to_linkedin', |
| 10 | + 'hem_to_maid', |
| 11 | + 'email_to_activity', |
| 12 | +] |
| 13 | + |
| 14 | +const LINKEDIN_OPERATIONS = [ |
| 15 | + 'linkedin_to_business_profile', |
| 16 | + 'linkedin_to_best_personal_email', |
| 17 | + 'linkedin_to_personal_email', |
| 18 | + 'linkedin_to_hashed_emails', |
| 19 | + 'linkedin_to_mobile_phone', |
| 20 | +] |
| 21 | + |
| 22 | +const IP_OPERATIONS = ['ip_to_hem', 'ip_to_maid', 'ip_to_company'] |
| 23 | + |
| 24 | +export const RB2BBlock: BlockConfig<Rb2bResponse> = { |
| 25 | + type: 'rb2b', |
| 26 | + name: 'RB2B', |
| 27 | + description: 'Identify and enrich website visitors', |
| 28 | + authMode: AuthMode.ApiKey, |
| 29 | + longDescription: |
| 30 | + 'Resolve IP addresses, hashed emails, and LinkedIn profiles into person-level identity and B2B enrichment data using the RB2B API. Convert IPs to hashed emails, MAIDs, and company domains; enrich emails into LinkedIn profiles, business profiles, and mobile IDs; and look up emails or phone numbers from LinkedIn. Requires an RB2B API key.', |
| 31 | + category: 'tools', |
| 32 | + integrationType: IntegrationType.Sales, |
| 33 | + tags: ['enrichment', 'identity', 'sales-engagement'], |
| 34 | + docsLink: 'https://docs.sim.ai/tools/rb2b', |
| 35 | + bgColor: '#51FF00', |
| 36 | + icon: RB2BIcon, |
| 37 | + subBlocks: [ |
| 38 | + { |
| 39 | + id: 'operation', |
| 40 | + title: 'Operation', |
| 41 | + type: 'dropdown', |
| 42 | + options: [ |
| 43 | + { label: 'Credit Check', id: 'credit_check' }, |
| 44 | + { label: 'IP to HEM', id: 'ip_to_hem' }, |
| 45 | + { label: 'IP to MAID', id: 'ip_to_maid' }, |
| 46 | + { label: 'IP to Company', id: 'ip_to_company' }, |
| 47 | + { label: 'Email/HEM to Business Profile', id: 'hem_to_business_profile' }, |
| 48 | + { label: 'Email/HEM to Best LinkedIn URL', id: 'hem_to_best_linkedin' }, |
| 49 | + { label: 'Email/HEM to LinkedIn Slug', id: 'hem_to_linkedin' }, |
| 50 | + { label: 'Email/HEM to MAID', id: 'hem_to_maid' }, |
| 51 | + { label: 'Email to Last Active Date', id: 'email_to_activity' }, |
| 52 | + { label: 'LinkedIn to Business Profile', id: 'linkedin_to_business_profile' }, |
| 53 | + { label: 'LinkedIn to Best Personal Email', id: 'linkedin_to_best_personal_email' }, |
| 54 | + { label: 'LinkedIn to Personal Email', id: 'linkedin_to_personal_email' }, |
| 55 | + { label: 'LinkedIn to Hashed Emails', id: 'linkedin_to_hashed_emails' }, |
| 56 | + { label: 'LinkedIn to Mobile Phone', id: 'linkedin_to_mobile_phone' }, |
| 57 | + { label: 'LinkedIn Slug Search', id: 'linkedin_slug_search' }, |
| 58 | + ], |
| 59 | + value: () => 'ip_to_hem', |
| 60 | + }, |
| 61 | + { |
| 62 | + id: 'ip_address', |
| 63 | + title: 'IP Address', |
| 64 | + type: 'short-input', |
| 65 | + placeholder: 'e.g. 162.192.6.240', |
| 66 | + condition: { field: 'operation', value: IP_OPERATIONS }, |
| 67 | + required: { field: 'operation', value: IP_OPERATIONS }, |
| 68 | + }, |
| 69 | + { |
| 70 | + id: 'user_agent', |
| 71 | + title: 'User Agent', |
| 72 | + type: 'short-input', |
| 73 | + placeholder: 'Optional user agent string', |
| 74 | + condition: { field: 'operation', value: ['ip_to_hem', 'ip_to_maid'] }, |
| 75 | + }, |
| 76 | + { |
| 77 | + id: 'include_sha256', |
| 78 | + title: 'Include SHA-256 Hashes', |
| 79 | + type: 'switch', |
| 80 | + condition: { field: 'operation', value: 'ip_to_hem' }, |
| 81 | + }, |
| 82 | + { |
| 83 | + id: 'email', |
| 84 | + title: 'Email or MD5 Hash', |
| 85 | + type: 'short-input', |
| 86 | + placeholder: 'jane@example.com or an MD5 hash', |
| 87 | + condition: { field: 'operation', value: EMAIL_OPERATIONS }, |
| 88 | + required: { field: 'operation', value: EMAIL_OPERATIONS }, |
| 89 | + }, |
| 90 | + { |
| 91 | + id: 'linkedin_slug', |
| 92 | + title: 'LinkedIn Slug or URL', |
| 93 | + type: 'short-input', |
| 94 | + placeholder: 'e.g. firstname-lastname or full profile URL', |
| 95 | + condition: { field: 'operation', value: LINKEDIN_OPERATIONS }, |
| 96 | + required: { field: 'operation', value: LINKEDIN_OPERATIONS }, |
| 97 | + }, |
| 98 | + { |
| 99 | + id: 'first_name', |
| 100 | + title: 'First Name', |
| 101 | + type: 'short-input', |
| 102 | + placeholder: 'Jane', |
| 103 | + condition: { field: 'operation', value: 'linkedin_slug_search' }, |
| 104 | + required: { field: 'operation', value: 'linkedin_slug_search' }, |
| 105 | + }, |
| 106 | + { |
| 107 | + id: 'last_name', |
| 108 | + title: 'Last Name', |
| 109 | + type: 'short-input', |
| 110 | + placeholder: 'Doe', |
| 111 | + condition: { field: 'operation', value: 'linkedin_slug_search' }, |
| 112 | + required: { field: 'operation', value: 'linkedin_slug_search' }, |
| 113 | + }, |
| 114 | + { |
| 115 | + id: 'company_domain', |
| 116 | + title: 'Company Domain', |
| 117 | + type: 'short-input', |
| 118 | + placeholder: 'example.com', |
| 119 | + condition: { field: 'operation', value: 'linkedin_slug_search' }, |
| 120 | + required: { field: 'operation', value: 'linkedin_slug_search' }, |
| 121 | + }, |
| 122 | + { |
| 123 | + id: 'apiKey', |
| 124 | + title: 'API Key', |
| 125 | + type: 'short-input', |
| 126 | + placeholder: 'Enter your RB2B API key', |
| 127 | + password: true, |
| 128 | + required: true, |
| 129 | + }, |
| 130 | + ], |
| 131 | + tools: { |
| 132 | + access: [ |
| 133 | + 'rb2b_credit_check', |
| 134 | + 'rb2b_ip_to_hem', |
| 135 | + 'rb2b_ip_to_maid', |
| 136 | + 'rb2b_ip_to_company', |
| 137 | + 'rb2b_hem_to_business_profile', |
| 138 | + 'rb2b_hem_to_best_linkedin', |
| 139 | + 'rb2b_hem_to_linkedin', |
| 140 | + 'rb2b_hem_to_maid', |
| 141 | + 'rb2b_email_to_activity', |
| 142 | + 'rb2b_linkedin_to_business_profile', |
| 143 | + 'rb2b_linkedin_to_best_personal_email', |
| 144 | + 'rb2b_linkedin_to_personal_email', |
| 145 | + 'rb2b_linkedin_to_hashed_emails', |
| 146 | + 'rb2b_linkedin_to_mobile_phone', |
| 147 | + 'rb2b_linkedin_slug_search', |
| 148 | + ], |
| 149 | + config: { |
| 150 | + tool: (params) => `rb2b_${params.operation}`, |
| 151 | + }, |
| 152 | + }, |
| 153 | + inputs: { |
| 154 | + operation: { type: 'string', description: 'Operation to perform' }, |
| 155 | + apiKey: { type: 'string', description: 'RB2B API key' }, |
| 156 | + ip_address: { type: 'string', description: 'IP address to resolve' }, |
| 157 | + user_agent: { type: 'string', description: 'Optional user agent string' }, |
| 158 | + include_sha256: { type: 'boolean', description: 'Include SHA-256 hashes (IP to HEM)' }, |
| 159 | + email: { type: 'string', description: 'Email address or MD5 hash of the email' }, |
| 160 | + linkedin_slug: { type: 'string', description: 'LinkedIn profile slug or URL' }, |
| 161 | + first_name: { type: 'string', description: 'First name (LinkedIn Slug Search)' }, |
| 162 | + last_name: { type: 'string', description: 'Last name (LinkedIn Slug Search)' }, |
| 163 | + company_domain: { type: 'string', description: 'Company domain (LinkedIn Slug Search)' }, |
| 164 | + }, |
| 165 | + outputs: { |
| 166 | + credits_remaining: { type: 'number', description: 'API credits remaining (Credit Check)' }, |
| 167 | + results: { |
| 168 | + type: 'json', |
| 169 | + description: 'Result list for IP/MAID/company/activity lookups', |
| 170 | + }, |
| 171 | + match_count: { type: 'number', description: 'Number of matches (Email to Last Active Date)' }, |
| 172 | + credits_charged: { type: 'number', description: 'Credits charged for the request' }, |
| 173 | + credits_exhausted: { type: 'boolean', description: 'Whether the account is out of credits' }, |
| 174 | + linkedin_url: { type: 'string', description: 'LinkedIn profile URL' }, |
| 175 | + linkedin_slug: { type: 'string', description: 'LinkedIn slug' }, |
| 176 | + email: { type: 'string', description: 'Best personal email' }, |
| 177 | + emails: { type: 'array', description: 'Personal email addresses' }, |
| 178 | + mobile_phone: { type: 'string', description: 'Mobile phone number' }, |
| 179 | + business_md5_array: { type: 'array', description: 'MD5 hashes of business emails' }, |
| 180 | + business_sha256_array: { type: 'array', description: 'SHA-256 hashes of business emails' }, |
| 181 | + personal_md5_array: { type: 'array', description: 'MD5 hashes of personal emails' }, |
| 182 | + personal_sha256_array: { type: 'array', description: 'SHA-256 hashes of personal emails' }, |
| 183 | + first_name: { type: 'string', description: 'First name (business profile)' }, |
| 184 | + last_name: { type: 'string', description: 'Last name (business profile)' }, |
| 185 | + full_name: { type: 'string', description: 'Full name (LinkedIn business profile)' }, |
| 186 | + headline: { type: 'string', description: 'LinkedIn headline' }, |
| 187 | + title: { type: 'string', description: 'Job title' }, |
| 188 | + seniority: { type: 'string', description: 'Seniority level' }, |
| 189 | + country: { type: 'string', description: 'Country' }, |
| 190 | + current_industry: { type: 'string', description: 'Current industry' }, |
| 191 | + functional_area: { type: 'json', description: 'Functional area(s)' }, |
| 192 | + current_company: { type: 'string', description: 'Current company name' }, |
| 193 | + current_company_url: { type: 'string', description: 'Current company website' }, |
| 194 | + current_company_linkedinurl: { type: 'string', description: 'Current company LinkedIn URL' }, |
| 195 | + company: { type: 'json', description: 'Company details (LinkedIn business profile)' }, |
| 196 | + business_email: { type: 'string', description: 'Business email address' }, |
| 197 | + personal_email: { type: 'string', description: 'Personal email address' }, |
| 198 | + personal_emails: { type: 'array', description: 'Personal emails (business profile)' }, |
| 199 | + linkedinurl: { type: 'string', description: 'LinkedIn profile URL (business profile)' }, |
| 200 | + link_email: { type: 'string', description: 'Linked business email (business profile)' }, |
| 201 | + work_email_confirmed: { type: 'string', description: 'Whether the work email is confirmed' }, |
| 202 | + company_employee_count: { type: 'string', description: 'Company employee count' }, |
| 203 | + company_employee_range: { type: 'string', description: 'Company employee range band' }, |
| 204 | + company_revenue_range: { type: 'string', description: 'Company revenue range band' }, |
| 205 | + md5: { type: 'string', description: 'MD5 hash of the resolved email' }, |
| 206 | + }, |
| 207 | +} |
0 commit comments