linkedin-secret-sauce 0.3.1 → 0.3.2
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/parsers/search-parser.js +28 -2
- package/dist/types.d.ts +70 -0
- package/package.json +1 -2
|
@@ -36,12 +36,38 @@ function parseSalesSearchResults(rawResponse) {
|
|
|
36
36
|
const seg = best?.fileIdentifyingUrlPathSegment || '';
|
|
37
37
|
res.imageUrl = img.rootUrl + seg;
|
|
38
38
|
}
|
|
39
|
-
// Current position
|
|
40
|
-
const pos = Array.isArray(el?.currentPositions) ? el.currentPositions[0] : undefined;
|
|
39
|
+
// Current position (backward compatible - extract from first position)
|
|
40
|
+
const pos = Array.isArray(el?.currentPositions) && el.currentPositions.length > 0 ? el.currentPositions[0] : undefined;
|
|
41
41
|
if (pos) {
|
|
42
42
|
res.currentRole = pos?.title;
|
|
43
43
|
res.currentCompany = pos?.companyName;
|
|
44
|
+
// Extract company logo from companyUrnResolutionResult if available
|
|
45
|
+
const companyData = pos?.companyUrnResolutionResult;
|
|
46
|
+
if (companyData?.companyPictureDisplayImage) {
|
|
47
|
+
const cImg = companyData.companyPictureDisplayImage;
|
|
48
|
+
if (cImg?.rootUrl && Array.isArray(cImg?.artifacts) && cImg.artifacts.length) {
|
|
49
|
+
const bestC = cImg.artifacts.reduce((p, c) => ((c?.width || 0) > (p?.width || 0) ? c : p), {});
|
|
50
|
+
const segC = bestC?.fileIdentifyingUrlPathSegment || '';
|
|
51
|
+
res.companyLogoUrl = cImg.rootUrl + segC;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
44
54
|
}
|
|
55
|
+
// Rich profile data (new fields)
|
|
56
|
+
res.premium = el?.premium;
|
|
57
|
+
res.openLink = el?.openLink;
|
|
58
|
+
res.degree = el?.degree;
|
|
59
|
+
res.industry = el?.industry;
|
|
60
|
+
res.isOpenProfile = el?.isOpenProfile;
|
|
61
|
+
res.memorialized = el?.memorialized;
|
|
62
|
+
res.saved = el?.saved;
|
|
63
|
+
res.viewed = el?.viewed;
|
|
64
|
+
res.pendingInvitation = el?.pendingInvitation;
|
|
65
|
+
res.blockThirdPartyDataSharing = el?.blockThirdPartyDataSharing;
|
|
66
|
+
// Pass through full positions arrays
|
|
67
|
+
res.currentPositions = Array.isArray(el?.currentPositions) ? el.currentPositions : undefined;
|
|
68
|
+
res.pastPositions = Array.isArray(el?.pastPositions) ? el.pastPositions : undefined;
|
|
69
|
+
// Pass through spotlight badges
|
|
70
|
+
res.spotlightBadges = Array.isArray(el?.spotlightBadges) ? el.spotlightBadges : undefined;
|
|
45
71
|
results.push(res);
|
|
46
72
|
}
|
|
47
73
|
return results;
|
package/dist/types.d.ts
CHANGED
|
@@ -48,6 +48,63 @@ export interface LinkedInProfile {
|
|
|
48
48
|
positions: ProfilePosition[];
|
|
49
49
|
educations: ProfileEducation[];
|
|
50
50
|
}
|
|
51
|
+
export interface LinkedInTenure {
|
|
52
|
+
numYears?: number;
|
|
53
|
+
numMonths?: number;
|
|
54
|
+
}
|
|
55
|
+
export interface LinkedInPosition {
|
|
56
|
+
title?: string;
|
|
57
|
+
companyName?: string;
|
|
58
|
+
description?: string;
|
|
59
|
+
tenureAtPosition?: LinkedInTenure;
|
|
60
|
+
tenureAtCompany?: LinkedInTenure;
|
|
61
|
+
companyUrn?: string;
|
|
62
|
+
companyId?: string;
|
|
63
|
+
companyLogoUrl?: string;
|
|
64
|
+
posId?: number;
|
|
65
|
+
current?: boolean;
|
|
66
|
+
startedOn?: {
|
|
67
|
+
year?: number;
|
|
68
|
+
month?: number;
|
|
69
|
+
};
|
|
70
|
+
endedOn?: {
|
|
71
|
+
year?: number;
|
|
72
|
+
month?: number;
|
|
73
|
+
};
|
|
74
|
+
companyUrnResolutionResult?: {
|
|
75
|
+
entityUrn?: string;
|
|
76
|
+
name?: string;
|
|
77
|
+
industry?: string;
|
|
78
|
+
location?: string;
|
|
79
|
+
companyPictureDisplayImage?: {
|
|
80
|
+
rootUrl?: string;
|
|
81
|
+
artifacts?: {
|
|
82
|
+
width?: number;
|
|
83
|
+
fileIdentifyingUrlPathSegment?: string;
|
|
84
|
+
}[];
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export interface LinkedInSpotlightBadge {
|
|
89
|
+
id?: string;
|
|
90
|
+
displayValue?: string;
|
|
91
|
+
popup?: {
|
|
92
|
+
header?: {
|
|
93
|
+
text?: string;
|
|
94
|
+
};
|
|
95
|
+
message?: {
|
|
96
|
+
text?: string;
|
|
97
|
+
};
|
|
98
|
+
config?: {
|
|
99
|
+
supportsDataFetch?: boolean;
|
|
100
|
+
popupTypes?: string[];
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
associatedEntityUrnsUnions?: Array<{
|
|
104
|
+
profileUrn?: string;
|
|
105
|
+
companyUrn?: string;
|
|
106
|
+
}>;
|
|
107
|
+
}
|
|
51
108
|
export interface SalesLeadSearchResult {
|
|
52
109
|
name?: string;
|
|
53
110
|
headline?: string;
|
|
@@ -63,6 +120,19 @@ export interface SalesLeadSearchResult {
|
|
|
63
120
|
currentRole?: string;
|
|
64
121
|
currentCompany?: string;
|
|
65
122
|
companyLogoUrl?: string;
|
|
123
|
+
premium?: boolean;
|
|
124
|
+
openLink?: boolean;
|
|
125
|
+
degree?: number;
|
|
126
|
+
currentPositions?: LinkedInPosition[];
|
|
127
|
+
pastPositions?: LinkedInPosition[];
|
|
128
|
+
spotlightBadges?: LinkedInSpotlightBadge[];
|
|
129
|
+
industry?: string;
|
|
130
|
+
isOpenProfile?: boolean;
|
|
131
|
+
memorialized?: boolean;
|
|
132
|
+
saved?: boolean;
|
|
133
|
+
viewed?: boolean;
|
|
134
|
+
pendingInvitation?: boolean;
|
|
135
|
+
blockThirdPartyDataSharing?: boolean;
|
|
66
136
|
}
|
|
67
137
|
export interface SearchSalesResult {
|
|
68
138
|
items: SalesLeadSearchResult[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "linkedin-secret-sauce",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
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",
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
"lint:fix": "eslint \"src/**/*.ts\" --fix",
|
|
20
20
|
"dev": "tsc -w -p tsconfig.json",
|
|
21
21
|
"test": "vitest run",
|
|
22
|
-
"_prepare": "husky",
|
|
23
22
|
"prepublishOnly": "npm run build",
|
|
24
23
|
"release:patch": "npm version patch && git push --follow-tags",
|
|
25
24
|
"release:minor": "npm version minor && git push --follow-tags",
|