linkedin-secret-sauce 0.11.1 → 0.12.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.
- package/dist/cosiall-client.d.ts +40 -1
- package/dist/cosiall-client.js +142 -3
- package/dist/enrichment/index.d.ts +3 -3
- package/dist/enrichment/index.js +10 -2
- package/dist/enrichment/matching.d.ts +14 -8
- package/dist/enrichment/matching.js +175 -94
- package/dist/enrichment/providers/cosiall.d.ts +27 -0
- package/dist/enrichment/providers/cosiall.js +110 -0
- package/dist/enrichment/providers/index.d.ts +8 -7
- package/dist/enrichment/providers/index.js +3 -1
- package/dist/enrichment/types.d.ts +25 -11
- package/dist/enrichment/types.js +44 -40
- package/dist/index.d.ts +1 -0
- package/dist/types.d.ts +29 -3
- package/dist/utils/metrics.d.ts +3 -0
- package/dist/utils/metrics.js +3 -0
- package/package.json +1 -1
package/dist/cosiall-client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccountCookies } from "./types";
|
|
1
|
+
import type { AccountCookies, CosiallProfileEmailsResponse, ProfileEmailsLookupOptions } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Fetches LinkedIn cookies for all available accounts from the Cosiall API.
|
|
4
4
|
* These cookies are used for authenticating requests to LinkedIn's API.
|
|
@@ -19,3 +19,42 @@ import type { AccountCookies } from "./types";
|
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
21
|
export declare function fetchCookiesFromCosiall(): Promise<AccountCookies[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Fetches email addresses associated with a LinkedIn profile from the Cosiall API.
|
|
24
|
+
*
|
|
25
|
+
* This endpoint provides flexible lookup by ObjectURN, LinkedIn URL, or vanity name.
|
|
26
|
+
* At least one lookup parameter must be provided.
|
|
27
|
+
*
|
|
28
|
+
* @param options - Lookup options (objectUrn, linkedInUrl, or vanity)
|
|
29
|
+
* @returns Profile emails response with profileId, objectUrn, linkedInUrl, and emails array
|
|
30
|
+
* @throws LinkedInClientError with code INVALID_REQUEST if no lookup parameters provided
|
|
31
|
+
* @throws LinkedInClientError with code NOT_FOUND if profile not found
|
|
32
|
+
* @throws LinkedInClientError with code AUTH_ERROR if API key is invalid
|
|
33
|
+
* @throws LinkedInClientError with code REQUEST_FAILED for other API errors
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* - Lookup priority: objectUrn > linkedInUrl > vanity
|
|
37
|
+
* - Returns empty emails array if profile exists but has no emails
|
|
38
|
+
* - URL normalization is handled server-side (trailing slashes, https prefix)
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* // Lookup by ObjectURN (most precise)
|
|
43
|
+
* const result = await fetchProfileEmailsFromCosiall({
|
|
44
|
+
* objectUrn: 'urn:li:fsd_profile:ACoAABcdEfG'
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* // Lookup by LinkedIn URL
|
|
48
|
+
* const result = await fetchProfileEmailsFromCosiall({
|
|
49
|
+
* linkedInUrl: 'https://www.linkedin.com/in/john-doe/'
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* // Lookup by vanity name
|
|
53
|
+
* const result = await fetchProfileEmailsFromCosiall({
|
|
54
|
+
* vanity: 'john-doe'
|
|
55
|
+
* });
|
|
56
|
+
*
|
|
57
|
+
* console.log(`Found ${result.emails.length} emails:`, result.emails);
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function fetchProfileEmailsFromCosiall(options: ProfileEmailsLookupOptions): Promise<CosiallProfileEmailsResponse>;
|
package/dist/cosiall-client.js
CHANGED
|
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.fetchCookiesFromCosiall = fetchCookiesFromCosiall;
|
|
37
|
+
exports.fetchProfileEmailsFromCosiall = fetchProfileEmailsFromCosiall;
|
|
37
38
|
const config_1 = require("./config");
|
|
38
39
|
const errors_1 = require("./utils/errors");
|
|
39
40
|
const logger_1 = require("./utils/logger");
|
|
@@ -120,11 +121,149 @@ async function fetchCookiesFromCosiall() {
|
|
|
120
121
|
}
|
|
121
122
|
return true;
|
|
122
123
|
}
|
|
123
|
-
return data
|
|
124
|
-
.filter(isItem)
|
|
125
|
-
.map((item) => ({
|
|
124
|
+
return data.filter(isItem).map((item) => ({
|
|
126
125
|
accountId: item.accountId,
|
|
127
126
|
cookies: item.cookies,
|
|
128
127
|
expiresAt: item.expiresAt,
|
|
129
128
|
}));
|
|
130
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Fetches email addresses associated with a LinkedIn profile from the Cosiall API.
|
|
132
|
+
*
|
|
133
|
+
* This endpoint provides flexible lookup by ObjectURN, LinkedIn URL, or vanity name.
|
|
134
|
+
* At least one lookup parameter must be provided.
|
|
135
|
+
*
|
|
136
|
+
* @param options - Lookup options (objectUrn, linkedInUrl, or vanity)
|
|
137
|
+
* @returns Profile emails response with profileId, objectUrn, linkedInUrl, and emails array
|
|
138
|
+
* @throws LinkedInClientError with code INVALID_REQUEST if no lookup parameters provided
|
|
139
|
+
* @throws LinkedInClientError with code NOT_FOUND if profile not found
|
|
140
|
+
* @throws LinkedInClientError with code AUTH_ERROR if API key is invalid
|
|
141
|
+
* @throws LinkedInClientError with code REQUEST_FAILED for other API errors
|
|
142
|
+
*
|
|
143
|
+
* @remarks
|
|
144
|
+
* - Lookup priority: objectUrn > linkedInUrl > vanity
|
|
145
|
+
* - Returns empty emails array if profile exists but has no emails
|
|
146
|
+
* - URL normalization is handled server-side (trailing slashes, https prefix)
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```typescript
|
|
150
|
+
* // Lookup by ObjectURN (most precise)
|
|
151
|
+
* const result = await fetchProfileEmailsFromCosiall({
|
|
152
|
+
* objectUrn: 'urn:li:fsd_profile:ACoAABcdEfG'
|
|
153
|
+
* });
|
|
154
|
+
*
|
|
155
|
+
* // Lookup by LinkedIn URL
|
|
156
|
+
* const result = await fetchProfileEmailsFromCosiall({
|
|
157
|
+
* linkedInUrl: 'https://www.linkedin.com/in/john-doe/'
|
|
158
|
+
* });
|
|
159
|
+
*
|
|
160
|
+
* // Lookup by vanity name
|
|
161
|
+
* const result = await fetchProfileEmailsFromCosiall({
|
|
162
|
+
* vanity: 'john-doe'
|
|
163
|
+
* });
|
|
164
|
+
*
|
|
165
|
+
* console.log(`Found ${result.emails.length} emails:`, result.emails);
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
async function fetchProfileEmailsFromCosiall(options) {
|
|
169
|
+
const { objectUrn, linkedInUrl, vanity } = options;
|
|
170
|
+
// Validate at least one parameter is provided
|
|
171
|
+
if (!objectUrn && !linkedInUrl && !vanity) {
|
|
172
|
+
throw new errors_1.LinkedInClientError("At least one of 'objectUrn', 'linkedInUrl', or 'vanity' must be provided", "INVALID_REQUEST", 400);
|
|
173
|
+
}
|
|
174
|
+
const { cosiallApiUrl, cosiallApiKey } = (0, config_1.getConfig)();
|
|
175
|
+
const base = cosiallApiUrl.replace(/\/+$/, "");
|
|
176
|
+
// Build query string
|
|
177
|
+
const params = new URLSearchParams();
|
|
178
|
+
if (objectUrn)
|
|
179
|
+
params.set("objectUrn", objectUrn);
|
|
180
|
+
if (linkedInUrl)
|
|
181
|
+
params.set("linkedInUrl", linkedInUrl);
|
|
182
|
+
if (vanity)
|
|
183
|
+
params.set("vanity", vanity);
|
|
184
|
+
const url = `${base}/api/flexiq/profile-emails?${params.toString()}`;
|
|
185
|
+
(0, logger_1.log)("info", "cosiall.profileEmails.start", {
|
|
186
|
+
objectUrn,
|
|
187
|
+
linkedInUrl,
|
|
188
|
+
vanity,
|
|
189
|
+
});
|
|
190
|
+
(0, metrics_1.incrementMetric)("cosiallProfileEmailsFetches");
|
|
191
|
+
const response = await fetch(url, {
|
|
192
|
+
method: "GET",
|
|
193
|
+
headers: {
|
|
194
|
+
"X-API-Key": cosiallApiKey,
|
|
195
|
+
Accept: "application/json",
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
// Handle error responses
|
|
199
|
+
if (!response.ok) {
|
|
200
|
+
const status = response.status;
|
|
201
|
+
let errorMessage = "Profile emails fetch failed";
|
|
202
|
+
let errorCode = "REQUEST_FAILED";
|
|
203
|
+
try {
|
|
204
|
+
const errorData = (await response.json());
|
|
205
|
+
errorMessage = errorData.error || errorMessage;
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
// Ignore JSON parse errors
|
|
209
|
+
}
|
|
210
|
+
if (status === 400) {
|
|
211
|
+
errorCode = "INVALID_REQUEST";
|
|
212
|
+
(0, logger_1.log)("warn", "cosiall.profileEmails.invalidRequest", {
|
|
213
|
+
status,
|
|
214
|
+
errorMessage,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
else if (status === 401) {
|
|
218
|
+
errorCode = "AUTH_ERROR";
|
|
219
|
+
(0, logger_1.log)("warn", "cosiall.profileEmails.authError", { status });
|
|
220
|
+
}
|
|
221
|
+
else if (status === 404) {
|
|
222
|
+
errorCode = "NOT_FOUND";
|
|
223
|
+
(0, logger_1.log)("info", "cosiall.profileEmails.notFound", {
|
|
224
|
+
objectUrn,
|
|
225
|
+
linkedInUrl,
|
|
226
|
+
vanity,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
(0, logger_1.log)("warn", "cosiall.profileEmails.error", { status, errorMessage });
|
|
231
|
+
(0, metrics_1.incrementMetric)("cosiallProfileEmailsFailures");
|
|
232
|
+
// Report unexpected errors to Sentry
|
|
233
|
+
try {
|
|
234
|
+
const { reportCriticalError } = await Promise.resolve().then(() => __importStar(require("./utils/sentry")));
|
|
235
|
+
reportCriticalError("Cosiall Profile Emails API failure", {
|
|
236
|
+
status,
|
|
237
|
+
errorMessage,
|
|
238
|
+
objectUrn,
|
|
239
|
+
linkedInUrl,
|
|
240
|
+
vanity,
|
|
241
|
+
tags: { component: "cosiall-client", endpoint: "profile-emails" },
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
catch { }
|
|
245
|
+
}
|
|
246
|
+
throw new errors_1.LinkedInClientError(errorMessage, errorCode, status);
|
|
247
|
+
}
|
|
248
|
+
const data = await response.json();
|
|
249
|
+
// Validate response structure
|
|
250
|
+
if (!data ||
|
|
251
|
+
typeof data !== "object" ||
|
|
252
|
+
!("profileId" in data) ||
|
|
253
|
+
!("objectUrn" in data) ||
|
|
254
|
+
!("linkedInUrl" in data) ||
|
|
255
|
+
!("emails" in data)) {
|
|
256
|
+
(0, logger_1.log)("error", "cosiall.profileEmails.invalidFormat", {
|
|
257
|
+
dataType: typeof data,
|
|
258
|
+
});
|
|
259
|
+
(0, metrics_1.incrementMetric)("cosiallProfileEmailsFailures");
|
|
260
|
+
throw new errors_1.LinkedInClientError("Invalid profile emails response format", "REQUEST_FAILED", 500);
|
|
261
|
+
}
|
|
262
|
+
const result = data;
|
|
263
|
+
(0, logger_1.log)("info", "cosiall.profileEmails.success", {
|
|
264
|
+
profileId: result.profileId,
|
|
265
|
+
emailCount: result.emails.length,
|
|
266
|
+
});
|
|
267
|
+
(0, metrics_1.incrementMetric)("cosiallProfileEmailsSuccess");
|
|
268
|
+
return result;
|
|
269
|
+
}
|
|
@@ -40,10 +40,10 @@ export { PROVIDER_COSTS, DEFAULT_PROVIDER_ORDER } from "./types";
|
|
|
40
40
|
export { isPersonalEmail, isBusinessEmail, isPersonalDomain, PERSONAL_DOMAINS, } from "./utils/personal-domains";
|
|
41
41
|
export { isDisposableEmail, isDisposableDomain, DISPOSABLE_DOMAINS, } from "./utils/disposable-domains";
|
|
42
42
|
export { isValidEmailSyntax, isRoleAccount, asciiFold, cleanNamePart, hostnameFromUrl, extractLinkedInUsername, } from "./utils/validation";
|
|
43
|
-
export { verifyEmailMx, checkDomainCatchAll, verifyEmailsExist } from "./verification/mx";
|
|
44
|
-
export { createConstructProvider, createLddProvider, createSmartProspectProvider, createHunterProvider, createDropcontactProvider, createBouncerProvider, createSnovioProvider, verifyEmailWithBouncer, checkCatchAllDomain, verifyEmailsBatch, findEmailsWithSnovio, verifyEmailWithSnovio, clearSnovioTokenCache, } from "./providers";
|
|
43
|
+
export { verifyEmailMx, checkDomainCatchAll, verifyEmailsExist, } from "./verification/mx";
|
|
44
|
+
export { createConstructProvider, createLddProvider, createSmartProspectProvider, createCosiallProvider, createHunterProvider, createDropcontactProvider, createBouncerProvider, createSnovioProvider, verifyEmailWithBouncer, checkCatchAllDomain, verifyEmailsBatch, findEmailsWithSnovio, verifyEmailWithSnovio, clearSnovioTokenCache, } from "./providers";
|
|
45
45
|
export { extractNumericLinkedInId } from "./providers/ldd";
|
|
46
46
|
export { createSmartProspectClient, type SmartProspectClient, type SmartProspectLocationOptions, } from "./providers/smartprospect";
|
|
47
|
-
export { enrichBusinessEmail, enrichBatch, enrichAllEmails, enrichAllBatch } from "./orchestrator";
|
|
47
|
+
export { enrichBusinessEmail, enrichBatch, enrichAllEmails, enrichAllBatch, } from "./orchestrator";
|
|
48
48
|
export { getSmartLeadToken, getSmartLeadUser, clearSmartLeadToken, clearAllSmartLeadTokens, getSmartLeadTokenCacheStats, enableFileCache, disableFileCache, isFileCacheEnabled, clearFileCache, type SmartLeadCredentials, type SmartLeadAuthConfig, type SmartLeadUser, type SmartLeadLoginResponse, } from "./auth";
|
|
49
49
|
export { calculateMatchConfidence, classifyMatchQuality, findBestMatch, matchContacts, buildSmartProspectFiltersFromLinkedIn, parseLinkedInSearchResponse, enrichLinkedInContact, enrichLinkedInContactsBatch, createLinkedInEnricher, getEmailsForLinkedInContact, getEmailsForLinkedInContactsBatch, salesLeadToContact, type LinkedInContact, type MatchResult, type MatchOptions, type LinkedInEnrichmentResult, type LinkedInEnrichmentOptions, type EmailSource, type EmailResult, type GetEmailsResult, type GetEmailsConfig, type GetEmailsOptions, } from "./matching";
|
package/dist/enrichment/index.js
CHANGED
|
@@ -43,13 +43,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
43
43
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.
|
|
47
|
-
exports.salesLeadToContact = exports.getEmailsForLinkedInContactsBatch = exports.getEmailsForLinkedInContact = exports.createLinkedInEnricher = exports.enrichLinkedInContactsBatch = exports.enrichLinkedInContact = exports.parseLinkedInSearchResponse = exports.buildSmartProspectFiltersFromLinkedIn = void 0;
|
|
46
|
+
exports.findBestMatch = exports.classifyMatchQuality = exports.calculateMatchConfidence = exports.clearFileCache = exports.isFileCacheEnabled = exports.disableFileCache = exports.enableFileCache = exports.getSmartLeadTokenCacheStats = exports.clearAllSmartLeadTokens = exports.clearSmartLeadToken = exports.getSmartLeadUser = exports.getSmartLeadToken = exports.enrichAllBatch = exports.enrichAllEmails = exports.enrichBatch = exports.enrichBusinessEmail = exports.createSmartProspectClient = exports.extractNumericLinkedInId = exports.clearSnovioTokenCache = exports.verifyEmailWithSnovio = exports.findEmailsWithSnovio = exports.verifyEmailsBatch = exports.checkCatchAllDomain = exports.verifyEmailWithBouncer = exports.createSnovioProvider = exports.createBouncerProvider = exports.createDropcontactProvider = exports.createHunterProvider = exports.createCosiallProvider = exports.createSmartProspectProvider = exports.createLddProvider = exports.createConstructProvider = exports.verifyEmailsExist = exports.checkDomainCatchAll = exports.verifyEmailMx = exports.extractLinkedInUsername = exports.hostnameFromUrl = exports.cleanNamePart = exports.asciiFold = exports.isRoleAccount = exports.isValidEmailSyntax = exports.DISPOSABLE_DOMAINS = exports.isDisposableDomain = exports.isDisposableEmail = exports.PERSONAL_DOMAINS = exports.isPersonalDomain = exports.isBusinessEmail = exports.isPersonalEmail = exports.DEFAULT_PROVIDER_ORDER = exports.PROVIDER_COSTS = void 0;
|
|
47
|
+
exports.salesLeadToContact = exports.getEmailsForLinkedInContactsBatch = exports.getEmailsForLinkedInContact = exports.createLinkedInEnricher = exports.enrichLinkedInContactsBatch = exports.enrichLinkedInContact = exports.parseLinkedInSearchResponse = exports.buildSmartProspectFiltersFromLinkedIn = exports.matchContacts = void 0;
|
|
48
48
|
exports.createEnrichmentClient = createEnrichmentClient;
|
|
49
49
|
const orchestrator_1 = require("./orchestrator");
|
|
50
50
|
const construct_1 = require("./providers/construct");
|
|
51
51
|
const ldd_1 = require("./providers/ldd");
|
|
52
52
|
const smartprospect_1 = require("./providers/smartprospect");
|
|
53
|
+
const cosiall_1 = require("./providers/cosiall");
|
|
53
54
|
const hunter_1 = require("./providers/hunter");
|
|
54
55
|
const dropcontact_1 = require("./providers/dropcontact");
|
|
55
56
|
const bouncer_1 = require("./providers/bouncer");
|
|
@@ -60,6 +61,7 @@ const snovio_1 = require("./providers/snovio");
|
|
|
60
61
|
* PHASE 1 - Free lookups (real data):
|
|
61
62
|
* - ldd: LinkedIn Data Dump - real verified emails (FREE)
|
|
62
63
|
* - smartprospect: SmartLead API - real verified emails (FREE with subscription)
|
|
64
|
+
* - cosiall: Cosiall Profile Emails - emails from LinkedIn profiles (FREE)
|
|
63
65
|
* - construct: Pattern guessing + MX check (FREE)
|
|
64
66
|
*
|
|
65
67
|
* PHASE 2 - Paid verification/finding (only if needed):
|
|
@@ -72,6 +74,7 @@ const snovio_1 = require("./providers/snovio");
|
|
|
72
74
|
const DEFAULT_ORDER = [
|
|
73
75
|
"ldd",
|
|
74
76
|
"smartprospect",
|
|
77
|
+
"cosiall",
|
|
75
78
|
"construct",
|
|
76
79
|
"bouncer",
|
|
77
80
|
"snovio",
|
|
@@ -96,6 +99,10 @@ function createEnrichmentClient(config) {
|
|
|
96
99
|
if (providerConfigs.smartprospect) {
|
|
97
100
|
providerFuncs.set("smartprospect", (0, smartprospect_1.createSmartProspectProvider)(providerConfigs.smartprospect));
|
|
98
101
|
}
|
|
102
|
+
// Cosiall is FREE - always create if not explicitly disabled
|
|
103
|
+
if (providerConfigs.cosiall?.enabled !== false) {
|
|
104
|
+
providerFuncs.set("cosiall", (0, cosiall_1.createCosiallProvider)(providerConfigs.cosiall));
|
|
105
|
+
}
|
|
99
106
|
if (providerConfigs.hunter) {
|
|
100
107
|
providerFuncs.set("hunter", (0, hunter_1.createHunterProvider)(providerConfigs.hunter));
|
|
101
108
|
}
|
|
@@ -270,6 +277,7 @@ var providers_1 = require("./providers");
|
|
|
270
277
|
Object.defineProperty(exports, "createConstructProvider", { enumerable: true, get: function () { return providers_1.createConstructProvider; } });
|
|
271
278
|
Object.defineProperty(exports, "createLddProvider", { enumerable: true, get: function () { return providers_1.createLddProvider; } });
|
|
272
279
|
Object.defineProperty(exports, "createSmartProspectProvider", { enumerable: true, get: function () { return providers_1.createSmartProspectProvider; } });
|
|
280
|
+
Object.defineProperty(exports, "createCosiallProvider", { enumerable: true, get: function () { return providers_1.createCosiallProvider; } });
|
|
273
281
|
Object.defineProperty(exports, "createHunterProvider", { enumerable: true, get: function () { return providers_1.createHunterProvider; } });
|
|
274
282
|
Object.defineProperty(exports, "createDropcontactProvider", { enumerable: true, get: function () { return providers_1.createDropcontactProvider; } });
|
|
275
283
|
Object.defineProperty(exports, "createBouncerProvider", { enumerable: true, get: function () { return providers_1.createBouncerProvider; } });
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Matches contacts between LinkedIn Sales Navigator and SmartProspect
|
|
5
5
|
* to find the same person across both platforms.
|
|
6
6
|
*/
|
|
7
|
-
import type { SmartProspectContact, SmartProspectConfig, SmartProspectFetchResponse, LddConfig } from
|
|
8
|
-
import type { SalesLeadSearchResult } from
|
|
9
|
-
import { type SmartProspectClient } from
|
|
7
|
+
import type { SmartProspectContact, SmartProspectConfig, SmartProspectFetchResponse, LddConfig } from "./types";
|
|
8
|
+
import type { SalesLeadSearchResult } from "../types";
|
|
9
|
+
import { type SmartProspectClient } from "./providers/smartprospect";
|
|
10
10
|
/**
|
|
11
11
|
* LinkedIn Sales Navigator contact (simplified from API response)
|
|
12
12
|
*/
|
|
@@ -68,7 +68,7 @@ export interface MatchResult {
|
|
|
68
68
|
/** Which fields matched */
|
|
69
69
|
matchedFields: string[];
|
|
70
70
|
/** Match quality classification */
|
|
71
|
-
quality:
|
|
71
|
+
quality: "exact" | "high" | "medium" | "low" | "none";
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Options for matching
|
|
@@ -91,7 +91,7 @@ export declare function calculateMatchConfidence(linkedin: LinkedInContact, smar
|
|
|
91
91
|
/**
|
|
92
92
|
* Classify match quality based on confidence and matched fields
|
|
93
93
|
*/
|
|
94
|
-
export declare function classifyMatchQuality(confidence: number, matchedFields: string[]):
|
|
94
|
+
export declare function classifyMatchQuality(confidence: number, matchedFields: string[]): "exact" | "high" | "medium" | "low" | "none";
|
|
95
95
|
/**
|
|
96
96
|
* Find the best matching SmartProspect contact for a LinkedIn contact
|
|
97
97
|
*/
|
|
@@ -130,7 +130,7 @@ export interface LinkedInEnrichmentResult {
|
|
|
130
130
|
/** Match confidence score (0-100) */
|
|
131
131
|
matchConfidence: number;
|
|
132
132
|
/** Match quality classification */
|
|
133
|
-
matchQuality:
|
|
133
|
+
matchQuality: "exact" | "high" | "medium" | "low" | "none";
|
|
134
134
|
/** Which fields matched */
|
|
135
135
|
matchedFields: string[];
|
|
136
136
|
/** Enriched email (if fetched) */
|
|
@@ -258,7 +258,7 @@ export declare function createLinkedInEnricher(smartProspectConfig: SmartProspec
|
|
|
258
258
|
/**
|
|
259
259
|
* Email source - where the email was found
|
|
260
260
|
*/
|
|
261
|
-
export type EmailSource =
|
|
261
|
+
export type EmailSource = "ldd" | "smartprospect" | "cosiall" | "linkedin" | "pattern" | "hunter" | "bouncer" | "snovio";
|
|
262
262
|
/**
|
|
263
263
|
* Email result from unified lookup
|
|
264
264
|
*/
|
|
@@ -270,7 +270,7 @@ export interface EmailResult {
|
|
|
270
270
|
/** Confidence score (0-100) */
|
|
271
271
|
confidence: number;
|
|
272
272
|
/** Email type classification */
|
|
273
|
-
type:
|
|
273
|
+
type: "business" | "personal" | "unknown";
|
|
274
274
|
/** Whether the email was verified */
|
|
275
275
|
verified: boolean;
|
|
276
276
|
/** Email deliverability score (0-1) for SmartProspect emails */
|
|
@@ -305,6 +305,10 @@ export interface GetEmailsConfig {
|
|
|
305
305
|
ldd?: LddConfig;
|
|
306
306
|
/** SmartProspect configuration (FREE for FlexIQ - already paying monthly) */
|
|
307
307
|
smartprospect?: SmartProspectConfig;
|
|
308
|
+
/** Cosiall Profile Emails (FREE - uses global Cosiall config, no config needed here) */
|
|
309
|
+
cosiall?: {
|
|
310
|
+
enabled?: boolean;
|
|
311
|
+
};
|
|
308
312
|
/** Company domain for email pattern guessing (optional - if not provided, will try to discover) */
|
|
309
313
|
companyDomain?: string;
|
|
310
314
|
/**
|
|
@@ -337,6 +341,8 @@ export interface GetEmailsOptions {
|
|
|
337
341
|
skipLdd?: boolean;
|
|
338
342
|
/** Skip SmartProspect lookup (default: false) */
|
|
339
343
|
skipSmartProspect?: boolean;
|
|
344
|
+
/** Skip Cosiall Profile Emails lookup (default: false) */
|
|
345
|
+
skipCosiall?: boolean;
|
|
340
346
|
/** Skip email pattern guessing (default: false) */
|
|
341
347
|
skipPatternGuessing?: boolean;
|
|
342
348
|
/** Skip LinkedIn company lookup for domain discovery (default: false) */
|