linkedin-secret-sauce 0.3.15 → 0.3.17
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.
|
@@ -75,7 +75,8 @@ function parseFullProfile(rawResponse, vanity) {
|
|
|
75
75
|
for (const item of included) {
|
|
76
76
|
const rec = item;
|
|
77
77
|
const urn = rec?.entityUrn || '';
|
|
78
|
-
|
|
78
|
+
// Only match individual positions, exclude position groups
|
|
79
|
+
if (!urn.includes('urn:li:fsd_profilePosition:'))
|
|
79
80
|
continue;
|
|
80
81
|
const pos = {
|
|
81
82
|
title: rec?.title,
|
|
@@ -135,11 +136,28 @@ function parseFullProfile(rawResponse, vanity) {
|
|
|
135
136
|
}
|
|
136
137
|
if (skills.length > 0)
|
|
137
138
|
profile.skills = skills;
|
|
138
|
-
// Avatar (
|
|
139
|
-
const
|
|
140
|
-
const
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
139
|
+
// Avatar - check identity.profilePicture first (primary source)
|
|
140
|
+
const profilePicture = identity.profilePicture;
|
|
141
|
+
const displayImageReference = profilePicture?.displayImageReference;
|
|
142
|
+
const avatarVector = displayImageReference?.vectorImage;
|
|
143
|
+
const avatarUrl = (0, image_parser_1.selectBestImageUrl)(avatarVector);
|
|
144
|
+
if (avatarUrl) {
|
|
145
|
+
profile.avatarUrl = avatarUrl;
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
// Fallback: search included array for backward compatibility
|
|
149
|
+
const avatarItem = included.find((it) => it?.vectorImage && JSON.stringify(it).includes('vectorImage'));
|
|
150
|
+
const fallbackVector = avatarItem?.vectorImage;
|
|
151
|
+
const fallbackUrl = (0, image_parser_1.selectBestImageUrl)(fallbackVector);
|
|
152
|
+
if (fallbackUrl)
|
|
153
|
+
profile.avatarUrl = fallbackUrl;
|
|
154
|
+
}
|
|
155
|
+
// Cover photo - check identity.backgroundPicture
|
|
156
|
+
const backgroundPicture = identity.backgroundPicture;
|
|
157
|
+
const bgDisplayImageReference = backgroundPicture?.displayImageReference;
|
|
158
|
+
const coverVector = bgDisplayImageReference?.vectorImage;
|
|
159
|
+
const coverUrl = (0, image_parser_1.selectBestImageUrl)(coverVector);
|
|
160
|
+
if (coverUrl)
|
|
161
|
+
profile.coverUrl = coverUrl;
|
|
144
162
|
return profile;
|
|
145
163
|
}
|