linkedin-secret-sauce 0.10.0 → 0.10.1
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.
|
@@ -1060,7 +1060,7 @@ async function queryPatternGuessing(contact, companyDomain, addEmail, result) {
|
|
|
1060
1060
|
try {
|
|
1061
1061
|
// Import construct provider dynamically to avoid circular deps
|
|
1062
1062
|
const { createConstructProvider } = await Promise.resolve().then(() => __importStar(require('./providers/construct')));
|
|
1063
|
-
const constructProvider = createConstructProvider({ maxAttempts:
|
|
1063
|
+
const constructProvider = createConstructProvider({ maxAttempts: 12, timeoutMs: 3000 });
|
|
1064
1064
|
const constructResult = await constructProvider({
|
|
1065
1065
|
firstName: contact.firstName,
|
|
1066
1066
|
lastName: contact.lastName,
|
|
@@ -12,27 +12,39 @@ const personal_domains_1 = require("../utils/personal-domains");
|
|
|
12
12
|
const validation_1 = require("../utils/validation");
|
|
13
13
|
/**
|
|
14
14
|
* Build all email pattern candidates for a person
|
|
15
|
+
*
|
|
16
|
+
* Patterns are ordered by commonality based on real-world email conventions:
|
|
17
|
+
* 1. firstname (most common for small companies)
|
|
18
|
+
* 2. firstname.lastname (most common for larger companies)
|
|
19
|
+
* 3. f.lastname, flastname, etc.
|
|
15
20
|
*/
|
|
16
21
|
function buildCandidates(input) {
|
|
17
22
|
const domain = String(input.domain || '').toLowerCase();
|
|
18
23
|
const first = (0, validation_1.cleanNamePart)(input.first || '');
|
|
19
24
|
const last = (0, validation_1.cleanNamePart)(input.last || '');
|
|
20
25
|
const fl = first ? first[0] : '';
|
|
26
|
+
const ll = last ? last[0] : '';
|
|
21
27
|
const locals = [];
|
|
22
|
-
//
|
|
28
|
+
// Simple first name pattern (very common, especially for small companies/startups)
|
|
29
|
+
if (first)
|
|
30
|
+
locals.push(first); // john
|
|
31
|
+
// Common combined patterns
|
|
23
32
|
if (first && last) {
|
|
24
|
-
locals.push(`${first}.${last}`); // john.doe
|
|
25
|
-
locals.push(`${fl}.${last}`); // j.doe
|
|
26
|
-
locals.push(`${first}${last[0] ?? ''}`); // johnd
|
|
33
|
+
locals.push(`${first}.${last}`); // john.doe (most common corporate pattern)
|
|
27
34
|
locals.push(`${fl}${last}`); // jdoe
|
|
35
|
+
locals.push(`${first}${ll}`); // johnd
|
|
36
|
+
locals.push(`${fl}.${last}`); // j.doe
|
|
37
|
+
locals.push(`${first}${last}`); // johndoe
|
|
28
38
|
locals.push(`${first}_${last}`); // john_doe
|
|
29
39
|
locals.push(`${last}.${first}`); // doe.john
|
|
40
|
+
locals.push(`${last}${first}`); // doejohn
|
|
41
|
+
locals.push(`${last}`); // doe (last name only)
|
|
42
|
+
locals.push(`${fl}${ll}`); // jd (initials)
|
|
30
43
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
locals.push(first); // john
|
|
34
|
-
if (last)
|
|
44
|
+
else if (last) {
|
|
45
|
+
// Only last name available
|
|
35
46
|
locals.push(last); // doe
|
|
47
|
+
}
|
|
36
48
|
// Deduplicate while preserving order
|
|
37
49
|
const seen = new Set();
|
|
38
50
|
const emails = [];
|