linkedin-secret-sauce 0.3.14 → 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.
@@ -13,7 +13,7 @@ function parseFullProfile(rawResponse, vanity) {
13
13
  lastName: identity.lastName,
14
14
  headline: identity.headline,
15
15
  summary: identity.summary,
16
- locationText: identity.locationName || identity.geoLocationName,
16
+ locationText: undefined, // Will be set below after geo lookup
17
17
  objectUrn: identity.objectUrn,
18
18
  premium: identity.premium,
19
19
  influencer: identity.influencer,
@@ -26,6 +26,16 @@ function parseFullProfile(rawResponse, vanity) {
26
26
  const geoLocation = identity.geoLocation;
27
27
  if (geoLocation?.geoUrn) {
28
28
  profile.geoLocationUrn = geoLocation.geoUrn;
29
+ // Lookup the geo object in included array to get the actual location name
30
+ const geoUrn = geoLocation.geoUrn;
31
+ const geoObj = included.find((it) => it?.entityUrn === geoUrn);
32
+ if (geoObj?.defaultLocalizedName) {
33
+ profile.locationText = geoObj.defaultLocalizedName;
34
+ }
35
+ }
36
+ // Fallback to direct location fields if geo lookup didn't work
37
+ if (!profile.locationText) {
38
+ profile.locationText = identity.locationName || identity.geoLocationName;
29
39
  }
30
40
  const location = identity.location;
31
41
  if (location?.countryCode) {
@@ -65,7 +75,8 @@ function parseFullProfile(rawResponse, vanity) {
65
75
  for (const item of included) {
66
76
  const rec = item;
67
77
  const urn = rec?.entityUrn || '';
68
- if (!urn.includes('fsd_profilePosition'))
78
+ // Only match individual positions, exclude position groups
79
+ if (!urn.includes('urn:li:fsd_profilePosition:'))
69
80
  continue;
70
81
  const pos = {
71
82
  title: rec?.title,
@@ -125,11 +136,28 @@ function parseFullProfile(rawResponse, vanity) {
125
136
  }
126
137
  if (skills.length > 0)
127
138
  profile.skills = skills;
128
- // Avatar (via helper)
129
- const avatarItem = included.find((it) => it?.vectorImage && JSON.stringify(it).includes('vectorImage'));
130
- const vector = avatarItem?.vectorImage;
131
- const bestUrl = (0, image_parser_1.selectBestImageUrl)(vector);
132
- if (bestUrl)
133
- profile.avatarUrl = bestUrl;
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;
134
162
  return profile;
135
163
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkedin-secret-sauce",
3
- "version": "0.3.14",
3
+ "version": "0.3.17",
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",