linkedin-secret-sauce 0.3.15 → 0.3.18

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
- if (!urn.includes('fsd_profilePosition'))
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,
@@ -100,6 +101,14 @@ function parseFullProfile(rawResponse, vanity) {
100
101
  const cid = extractCompanyIdFromUrn(foundUrn);
101
102
  if (cid)
102
103
  pos.companyId = cid;
104
+ // Extract company logo from included array by dereferencing the URN
105
+ const companyObj = included.find(it => it?.entityUrn === foundUrn);
106
+ if (companyObj) {
107
+ const logoVector = companyObj.logo?.vectorImage;
108
+ const logoUrl = (0, image_parser_1.selectBestImageUrl)(logoVector);
109
+ if (logoUrl)
110
+ pos.companyLogoUrl = logoUrl;
111
+ }
103
112
  }
104
113
  profile.positions.push(pos);
105
114
  }
@@ -135,11 +144,28 @@ function parseFullProfile(rawResponse, vanity) {
135
144
  }
136
145
  if (skills.length > 0)
137
146
  profile.skills = skills;
138
- // Avatar (via helper)
139
- const avatarItem = included.find((it) => it?.vectorImage && JSON.stringify(it).includes('vectorImage'));
140
- const vector = avatarItem?.vectorImage;
141
- const bestUrl = (0, image_parser_1.selectBestImageUrl)(vector);
142
- if (bestUrl)
143
- profile.avatarUrl = bestUrl;
147
+ // Avatar - check identity.profilePicture first (primary source)
148
+ const profilePicture = identity.profilePicture;
149
+ const displayImageReference = profilePicture?.displayImageReference;
150
+ const avatarVector = displayImageReference?.vectorImage;
151
+ const avatarUrl = (0, image_parser_1.selectBestImageUrl)(avatarVector);
152
+ if (avatarUrl) {
153
+ profile.avatarUrl = avatarUrl;
154
+ }
155
+ else {
156
+ // Fallback: search included array for backward compatibility
157
+ const avatarItem = included.find((it) => it?.vectorImage && JSON.stringify(it).includes('vectorImage'));
158
+ const fallbackVector = avatarItem?.vectorImage;
159
+ const fallbackUrl = (0, image_parser_1.selectBestImageUrl)(fallbackVector);
160
+ if (fallbackUrl)
161
+ profile.avatarUrl = fallbackUrl;
162
+ }
163
+ // Cover photo - check identity.backgroundPicture
164
+ const backgroundPicture = identity.backgroundPicture;
165
+ const bgDisplayImageReference = backgroundPicture?.displayImageReference;
166
+ const coverVector = bgDisplayImageReference?.vectorImage;
167
+ const coverUrl = (0, image_parser_1.selectBestImageUrl)(coverVector);
168
+ if (coverUrl)
169
+ profile.coverUrl = coverUrl;
144
170
  return profile;
145
171
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkedin-secret-sauce",
3
- "version": "0.3.15",
3
+ "version": "0.3.18",
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",