linkedin-secret-sauce 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,10 +30,62 @@ export interface ProviderResult {
30
30
  score?: number;
31
31
  confidence?: number;
32
32
  }
33
+ /**
34
+ * Extended provider result that can return multiple emails
35
+ */
36
+ export interface ProviderMultiResult {
37
+ emails: Array<{
38
+ email: string;
39
+ verified?: boolean;
40
+ confidence?: number;
41
+ isCatchAll?: boolean;
42
+ metadata?: Record<string, unknown>;
43
+ }>;
44
+ }
45
+ /**
46
+ * Email type classification
47
+ */
48
+ export type EmailType = 'business' | 'personal' | 'disposable' | 'role' | 'unknown';
49
+ /**
50
+ * Individual enriched email with full metadata
51
+ */
52
+ export interface EnrichedEmail {
53
+ /** The email address */
54
+ email: string;
55
+ /** Which provider found this email */
56
+ source: ProviderName;
57
+ /** Confidence score (0-100) */
58
+ confidence: number;
59
+ /** Whether the email was verified */
60
+ verified: boolean;
61
+ /** Email type classification */
62
+ type: EmailType;
63
+ /** Whether this is a catch-all domain */
64
+ isCatchAll?: boolean;
65
+ /** ISO timestamp of when this was found */
66
+ foundAt: string;
67
+ /** Additional provider-specific metadata */
68
+ metadata?: Record<string, unknown>;
69
+ }
70
+ /**
71
+ * Result containing all found emails from all providers
72
+ */
73
+ export interface MultiEmailResult {
74
+ /** All found emails, sorted by confidence (highest first) */
75
+ emails: EnrichedEmail[];
76
+ /** The original candidate */
77
+ candidate: EnrichmentCandidate;
78
+ /** Total cost incurred across all providers */
79
+ totalCost: number;
80
+ /** List of providers that were queried */
81
+ providersQueried: ProviderName[];
82
+ /** ISO timestamp of when enrichment completed */
83
+ completedAt: string;
84
+ }
33
85
  /**
34
86
  * Provider function signature
35
87
  */
36
- export type ProviderFunc = (candidate: EnrichmentCandidate) => Promise<ProviderResult | null>;
88
+ export type ProviderFunc = (candidate: EnrichmentCandidate) => Promise<ProviderResult | ProviderMultiResult | null>;
37
89
  /**
38
90
  * Input candidate for enrichment - flexible to accept various naming conventions
39
91
  */
@@ -78,10 +130,24 @@ export interface ApolloConfig {
78
130
  }
79
131
  /**
80
132
  * SmartProspect/Smartlead provider configuration
133
+ *
134
+ * Supports two auth methods:
135
+ * 1. Direct token: Pass `apiToken` directly
136
+ * 2. Credentials: Pass `email` and `password` for auto-login with token caching
81
137
  */
82
138
  export interface SmartProspectConfig {
83
- apiToken: string;
139
+ /** Direct API/JWT token (if you already have one) */
140
+ apiToken?: string;
141
+ /** SmartLead account email (for credentials-based auth) */
142
+ email?: string;
143
+ /** SmartLead account password (for credentials-based auth) */
144
+ password?: string;
145
+ /** API URL override (default: https://prospect-api.smartlead.ai/api/search-email-leads) */
84
146
  apiUrl?: string;
147
+ /** Login URL override (default: https://server.smartlead.ai/api/auth/login) */
148
+ loginUrl?: string;
149
+ /** Pre-fetch token on client creation (default: true) - ensures token is ready for first request */
150
+ eagerInit?: boolean;
85
151
  }
86
152
  /**
87
153
  * LinkedIn Data Dump provider configuration
@@ -179,17 +245,21 @@ export interface EnrichmentClientConfig {
179
245
  * Enrichment client interface
180
246
  */
181
247
  export interface EnrichmentClient {
182
- /** Enrich a single candidate */
248
+ /** Enrich a single candidate - returns first valid business email (original behavior) */
183
249
  enrich: (candidate: EnrichmentCandidate) => Promise<CanonicalEmail>;
184
- /** Enrich multiple candidates in batches */
250
+ /** Enrich multiple candidates in batches - returns first valid business email per candidate */
185
251
  enrichBatch: (candidates: EnrichmentCandidate[], options?: BatchEnrichmentOptions) => Promise<Array<{
186
252
  candidate: EnrichmentCandidate;
187
253
  } & CanonicalEmail>>;
254
+ /** Enrich a single candidate - returns ALL found emails from ALL providers */
255
+ enrichAll: (candidate: EnrichmentCandidate) => Promise<MultiEmailResult>;
256
+ /** Enrich multiple candidates - returns ALL found emails for each candidate */
257
+ enrichAllBatch: (candidates: EnrichmentCandidate[], options?: BatchEnrichmentOptions) => Promise<MultiEmailResult[]>;
188
258
  }
189
259
  /**
190
260
  * Available provider names
191
261
  */
192
- export type ProviderName = 'construct' | 'ldd' | 'smartprospect' | 'hunter' | 'apollo' | 'dropcontact';
262
+ export type ProviderName = "construct" | "ldd" | "smartprospect" | "hunter" | "apollo" | "dropcontact";
193
263
  /**
194
264
  * Default provider order
195
265
  */
@@ -207,7 +277,7 @@ export interface VerificationResult {
207
277
  /** Confidence score 0-100 */
208
278
  confidence: number;
209
279
  /** Reason for the result */
210
- reason?: 'valid' | 'invalid' | 'syntax' | 'mx_missing' | 'disposable' | 'role_account' | 'catch_all' | 'timeout' | 'error';
280
+ reason?: "valid" | "invalid" | "syntax" | "mx_missing" | "disposable" | "role_account" | "catch_all" | "timeout" | "error";
211
281
  /** Whether this is a catch-all domain */
212
282
  isCatchAll: boolean;
213
283
  /** Whether this is a role account (info@, support@, etc.) */
@@ -246,26 +316,77 @@ export interface SmartProspectContact {
246
316
  verificationStatus?: string;
247
317
  catchAllStatus?: string;
248
318
  }
319
+ /**
320
+ * SmartProspect Search Filters
321
+ *
322
+ * Comprehensive filter interface matching SmartProspect/Smartlead's actual API.
323
+ * Field names and values match their exact API structure.
324
+ */
249
325
  export interface SmartProspectSearchFilters {
326
+ /** Full name (searches across first + last) */
250
327
  name?: string[];
328
+ /** First name only */
251
329
  firstName?: string[];
330
+ /** Last name only */
252
331
  lastName?: string[];
332
+ /** Job titles to search (free text, e.g., "CEO", "Software Engineer") */
253
333
  title?: string[];
254
- company?: string[];
255
- domain?: string[];
256
- department?: string[];
257
- level?: string[];
258
- industry?: string[];
334
+ /** Whether to match titles exactly (default: false) */
335
+ titleExactMatch?: boolean;
336
+ /** Departments - must use exact API values */
337
+ department?: SmartProspectDepartment[];
338
+ /** Seniority levels - must use exact API values */
339
+ level?: SmartProspectLevel[];
340
+ /** Company names (e.g., "Google", "Microsoft") */
341
+ companyName?: string[];
342
+ /** Company domains (e.g., "google.com", "microsoft.com") */
343
+ companyDomain?: string[];
344
+ /** Industries - must use exact API values */
345
+ companyIndustry?: SmartProspectIndustry[];
346
+ /** Sub-industries - must use exact API values */
347
+ companySubIndustry?: string[];
348
+ /** Headcount ranges - must use exact API values */
349
+ companyHeadCount?: SmartProspectHeadcount[];
350
+ /** Revenue ranges - must use exact API values */
351
+ companyRevenue?: SmartProspectRevenue[];
352
+ /** Countries (e.g., "United States", "United Kingdom", "Germany") */
259
353
  country?: string[];
354
+ /** States with country (e.g., "California, United States", "Bavaria, Germany") */
260
355
  state?: string[];
356
+ /** Cities with state and country (e.g., "San Francisco, California, United States") */
261
357
  city?: string[];
262
- companyHeadCount?: string[];
263
- companyRevenue?: string[];
358
+ /** Don't include contacts already owned/in campaigns (default: true) */
264
359
  dontDisplayOwnedContact?: boolean;
360
+ /** Number of results to return (default: 25, max: 100) */
265
361
  limit?: number;
266
- titleExactMatch?: boolean;
362
+ /** Scroll ID for cursor-based pagination (from previous response) */
267
363
  scroll_id?: string;
268
364
  }
365
+ /**
366
+ * SmartProspect Department values (exact API values)
367
+ */
368
+ export type SmartProspectDepartment = 'Engineering' | 'Finance & Administration' | 'Human Resources' | 'IT & IS' | 'Marketing' | 'Operations' | 'Other' | 'Support' | 'Sales';
369
+ /**
370
+ * SmartProspect Level/Seniority values (exact API values)
371
+ */
372
+ export type SmartProspectLevel = 'Staff' | 'Manager-Level' | 'Director-Level' | 'VP-Level' | 'C-Level';
373
+ /**
374
+ * SmartProspect Headcount ranges (exact API values)
375
+ */
376
+ export type SmartProspectHeadcount = '0 - 25' | '25 - 100' | '100 - 250' | '250 - 1000' | '1K - 10K' | '10K - 50K' | '50K - 100K' | '> 100K';
377
+ /**
378
+ * SmartProspect Revenue ranges (exact API values)
379
+ */
380
+ export type SmartProspectRevenue = '$0 - 1M' | '$1 - 10M' | '$10 - 50M' | '$50 - 100M' | '$100 - 250M' | '$250 - 500M' | '$500M - 1B' | '> $1B';
381
+ /**
382
+ * SmartProspect Industry values (exact API values)
383
+ */
384
+ export type SmartProspectIndustry = 'Software & Internet' | 'Business Services' | 'Real Estate & Construction' | 'Financial Services' | 'Healthcare, Pharmaceuticals, & Biotech' | 'Retail' | 'Consumer Services' | 'Education' | 'Media & Entertainment' | 'Travel, Recreation, and Leisure' | 'Transportation & Storage' | 'Manufacturing' | 'Wholesale & Distribution' | 'Non-Profit' | 'Energy & Utilities' | 'Government' | 'Agriculture & Mining' | 'Computers & Electronics' | 'Telecommunications' | 'Other';
385
+ /**
386
+ * SmartProspect Sub-Industry values (exact API values - partial list)
387
+ * Note: This is a subset of available sub-industries. The API accepts many more.
388
+ */
389
+ export declare const SMARTPROSPECT_SUB_INDUSTRIES: readonly ["Internet", "Information Technology and Services", "Information Services", "Computer Software", "Computer & Network Security", "Computer Games", "Glass, Ceramics & Concrete", "Construction", "Commercial Real Estate", "Civil Engineering", "Building Materials", "Architecture & Planning", "Writing and Editing", "Translation and Localization", "Think Tanks", "Staffing and Recruiting", "Security and Investigations", "Public Safety", "Public Relations and Communications", "Program Development", "Professional Training & Coaching", "Market Research", "Marketing and Advertising", "Management Consulting", "Legal Services", "Law Practice", "Law Enforcement", "International Trade and Development", "Import and Export", "Human Resources", "Graphic Design", "Facilities Services", "Executive Office", "Events Services", "Environmental Services", "Design", "Business Supplies and Equipment", "Animation", "Alternative Dispute Resolution", "Outsourcing/Offshoring"];
269
390
  export interface SmartProspectSearchResponse {
270
391
  success: boolean;
271
392
  message: string;
@@ -276,6 +397,27 @@ export interface SmartProspectSearchResponse {
276
397
  total_count: number;
277
398
  };
278
399
  }
400
+ /**
401
+ * SmartProspect Location lookup response (countries, states, cities)
402
+ */
403
+ export interface SmartProspectLocationItem {
404
+ id: number;
405
+ country_name?: string;
406
+ state_name?: string;
407
+ city_name?: string;
408
+ }
409
+ export interface SmartProspectLocationResponse {
410
+ success: boolean;
411
+ message: string;
412
+ data: SmartProspectLocationItem[];
413
+ pagination: {
414
+ limit: number;
415
+ offset: number;
416
+ page: number;
417
+ count: number;
418
+ };
419
+ search: string | null;
420
+ }
279
421
  export interface SmartProspectFetchResponse {
280
422
  success: boolean;
281
423
  message: string;
@@ -6,17 +6,17 @@
6
6
  * stateless - consumers pass their own API keys and configuration.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.PROVIDER_COSTS = exports.DEFAULT_PROVIDER_ORDER = void 0;
9
+ exports.SMARTPROSPECT_SUB_INDUSTRIES = exports.PROVIDER_COSTS = exports.DEFAULT_PROVIDER_ORDER = void 0;
10
10
  /**
11
11
  * Default provider order
12
12
  */
13
13
  exports.DEFAULT_PROVIDER_ORDER = [
14
- 'construct',
15
- 'ldd',
16
- 'smartprospect',
17
- 'hunter',
18
- 'apollo',
19
- 'dropcontact',
14
+ "construct",
15
+ "ldd",
16
+ "smartprospect",
17
+ "hunter",
18
+ "apollo",
19
+ "dropcontact",
20
20
  ];
21
21
  /**
22
22
  * Provider costs in USD per lookup
@@ -29,3 +29,52 @@ exports.PROVIDER_COSTS = {
29
29
  apollo: 0,
30
30
  dropcontact: 0.01,
31
31
  };
32
+ /**
33
+ * SmartProspect Sub-Industry values (exact API values - partial list)
34
+ * Note: This is a subset of available sub-industries. The API accepts many more.
35
+ */
36
+ exports.SMARTPROSPECT_SUB_INDUSTRIES = [
37
+ // Software & Internet
38
+ 'Internet',
39
+ 'Information Technology and Services',
40
+ 'Information Services',
41
+ 'Computer Software',
42
+ 'Computer & Network Security',
43
+ 'Computer Games',
44
+ // Real Estate & Construction
45
+ 'Glass, Ceramics & Concrete',
46
+ 'Construction',
47
+ 'Commercial Real Estate',
48
+ 'Civil Engineering',
49
+ 'Building Materials',
50
+ 'Architecture & Planning',
51
+ // Business Services
52
+ 'Writing and Editing',
53
+ 'Translation and Localization',
54
+ 'Think Tanks',
55
+ 'Staffing and Recruiting',
56
+ 'Security and Investigations',
57
+ 'Public Safety',
58
+ 'Public Relations and Communications',
59
+ 'Program Development',
60
+ 'Professional Training & Coaching',
61
+ 'Market Research',
62
+ 'Marketing and Advertising',
63
+ 'Management Consulting',
64
+ 'Legal Services',
65
+ 'Law Practice',
66
+ 'Law Enforcement',
67
+ 'International Trade and Development',
68
+ 'Import and Export',
69
+ 'Human Resources',
70
+ 'Graphic Design',
71
+ 'Facilities Services',
72
+ 'Executive Office',
73
+ 'Events Services',
74
+ 'Environmental Services',
75
+ 'Design',
76
+ 'Business Supplies and Equipment',
77
+ 'Animation',
78
+ 'Alternative Dispute Resolution',
79
+ 'Outsourcing/Offshoring',
80
+ ];
package/dist/index.d.ts CHANGED
@@ -14,4 +14,5 @@ export type { RequestHistoryEntry } from "./utils/request-history";
14
14
  export * from "./constants";
15
15
  export { createEnrichmentClient } from "./enrichment";
16
16
  export type { CanonicalEmail, EnrichmentCandidate, ProviderResult, ProviderFunc, ProviderName, EnrichmentClientConfig, EnrichmentClient, ProvidersConfig, EnrichmentOptions, BatchEnrichmentOptions, HunterConfig, ApolloConfig, SmartProspectConfig, LddConfig, DropcontactConfig, ConstructConfig, CacheAdapter, CostCallback, EnrichmentLogger, VerificationResult, SmartProspectContact, SmartProspectSearchFilters, LddProfileData, LddApiResponse, } from "./enrichment";
17
- export { isPersonalEmail, isBusinessEmail, isPersonalDomain, isDisposableEmail, isDisposableDomain, isValidEmailSyntax, isRoleAccount, verifyEmailMx, PERSONAL_DOMAINS, DISPOSABLE_DOMAINS, DEFAULT_PROVIDER_ORDER, PROVIDER_COSTS, } from "./enrichment";
17
+ export { isPersonalEmail, isBusinessEmail, isPersonalDomain, isDisposableEmail, isDisposableDomain, isValidEmailSyntax, isRoleAccount, verifyEmailMx, PERSONAL_DOMAINS, DISPOSABLE_DOMAINS, DEFAULT_PROVIDER_ORDER, PROVIDER_COSTS, getSmartLeadToken, getSmartLeadUser, clearSmartLeadToken, clearAllSmartLeadTokens, getSmartLeadTokenCacheStats, } from "./enrichment";
18
+ export type { SmartLeadCredentials, SmartLeadAuthConfig, SmartLeadUser, SmartLeadLoginResponse, } from "./enrichment";
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.PROVIDER_COSTS = exports.DEFAULT_PROVIDER_ORDER = exports.DISPOSABLE_DOMAINS = exports.PERSONAL_DOMAINS = exports.verifyEmailMx = exports.isRoleAccount = exports.isValidEmailSyntax = exports.isDisposableDomain = exports.isDisposableEmail = exports.isPersonalDomain = exports.isBusinessEmail = exports.isPersonalEmail = exports.createEnrichmentClient = exports.clearRequestHistory = exports.getRequestHistory = exports.parseSalesSearchResults = exports.parseFullProfile = exports.LinkedInClientError = exports.getConfig = exports.initializeLinkedInClient = void 0;
17
+ exports.getSmartLeadTokenCacheStats = exports.clearAllSmartLeadTokens = exports.clearSmartLeadToken = exports.getSmartLeadUser = exports.getSmartLeadToken = exports.PROVIDER_COSTS = exports.DEFAULT_PROVIDER_ORDER = exports.DISPOSABLE_DOMAINS = exports.PERSONAL_DOMAINS = exports.verifyEmailMx = exports.isRoleAccount = exports.isValidEmailSyntax = exports.isDisposableDomain = exports.isDisposableEmail = exports.isPersonalDomain = exports.isBusinessEmail = exports.isPersonalEmail = exports.createEnrichmentClient = exports.clearRequestHistory = exports.getRequestHistory = exports.parseSalesSearchResults = exports.parseFullProfile = exports.LinkedInClientError = exports.getConfig = exports.initializeLinkedInClient = void 0;
18
18
  var config_1 = require("./config");
19
19
  Object.defineProperty(exports, "initializeLinkedInClient", { enumerable: true, get: function () { return config_1.initializeLinkedInClient; } });
20
20
  Object.defineProperty(exports, "getConfig", { enumerable: true, get: function () { return config_1.getConfig; } });
@@ -52,3 +52,9 @@ Object.defineProperty(exports, "PERSONAL_DOMAINS", { enumerable: true, get: func
52
52
  Object.defineProperty(exports, "DISPOSABLE_DOMAINS", { enumerable: true, get: function () { return enrichment_2.DISPOSABLE_DOMAINS; } });
53
53
  Object.defineProperty(exports, "DEFAULT_PROVIDER_ORDER", { enumerable: true, get: function () { return enrichment_2.DEFAULT_PROVIDER_ORDER; } });
54
54
  Object.defineProperty(exports, "PROVIDER_COSTS", { enumerable: true, get: function () { return enrichment_2.PROVIDER_COSTS; } });
55
+ // SmartLead Auth
56
+ Object.defineProperty(exports, "getSmartLeadToken", { enumerable: true, get: function () { return enrichment_2.getSmartLeadToken; } });
57
+ Object.defineProperty(exports, "getSmartLeadUser", { enumerable: true, get: function () { return enrichment_2.getSmartLeadUser; } });
58
+ Object.defineProperty(exports, "clearSmartLeadToken", { enumerable: true, get: function () { return enrichment_2.clearSmartLeadToken; } });
59
+ Object.defineProperty(exports, "clearAllSmartLeadTokens", { enumerable: true, get: function () { return enrichment_2.clearAllSmartLeadTokens; } });
60
+ Object.defineProperty(exports, "getSmartLeadTokenCacheStats", { enumerable: true, get: function () { return enrichment_2.getSmartLeadTokenCacheStats; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkedin-secret-sauce",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Private LinkedIn Sales Navigator client with automatic cookie management",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",