linkedin-secret-sauce 0.3.11 → 0.3.13

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.
@@ -8,14 +8,29 @@ function parseFullProfile(rawResponse, vanity) {
8
8
  const identity = included.find((it) => String(it?.$type || '').includes('identity.profile.Profile')) || {};
9
9
  const profile = {
10
10
  vanity,
11
+ publicIdentifier: identity.publicIdentifier,
11
12
  firstName: identity.firstName,
12
13
  lastName: identity.lastName,
13
14
  headline: identity.headline,
14
15
  summary: identity.summary,
15
16
  locationText: identity.locationName || identity.geoLocationName,
17
+ objectUrn: identity.objectUrn,
18
+ premium: identity.premium,
19
+ influencer: identity.influencer,
20
+ industryUrn: identity.industryUrn,
21
+ versionTag: identity.versionTag,
16
22
  positions: [],
17
23
  educations: [],
18
24
  };
25
+ // Extract geoLocation and countryCode
26
+ const geoLocation = identity.geoLocation;
27
+ if (geoLocation?.geoUrn) {
28
+ profile.geoLocationUrn = geoLocation.geoUrn;
29
+ }
30
+ const location = identity.location;
31
+ if (location?.countryCode) {
32
+ profile.countryCode = location.countryCode;
33
+ }
19
34
  // Positions
20
35
  function extractCompanyIdFromUrn(urn) {
21
36
  if (!urn)
@@ -56,11 +71,11 @@ function parseFullProfile(rawResponse, vanity) {
56
71
  title: rec?.title,
57
72
  companyName: rec?.companyName,
58
73
  description: rec?.description,
59
- isCurrent: !rec?.timePeriod?.endDate,
60
- startYear: rec?.timePeriod?.startDate?.year,
61
- startMonth: rec?.timePeriod?.startDate?.month,
62
- endYear: rec?.timePeriod?.endDate?.year,
63
- endMonth: rec?.timePeriod?.endDate?.month,
74
+ isCurrent: !rec?.timePeriod?.endDate && !rec?.dateRange?.end,
75
+ startYear: rec?.timePeriod?.startDate?.year || rec?.dateRange?.start?.year,
76
+ startMonth: rec?.timePeriod?.startDate?.month || rec?.dateRange?.start?.month,
77
+ endYear: rec?.timePeriod?.endDate?.year || rec?.dateRange?.end?.year,
78
+ endMonth: rec?.timePeriod?.endDate?.month || rec?.dateRange?.end?.month,
64
79
  };
65
80
  // Try to extract company URN and numeric id robustly
66
81
  const candUrns = [
@@ -88,13 +103,28 @@ function parseFullProfile(rawResponse, vanity) {
88
103
  schoolName: rec?.schoolName,
89
104
  degree: rec?.degreeName,
90
105
  fieldOfStudy: rec?.fieldOfStudy,
91
- startYear: rec?.timePeriod?.startDate?.year,
92
- startMonth: rec?.timePeriod?.startDate?.month,
93
- endYear: rec?.timePeriod?.endDate?.year,
94
- endMonth: rec?.timePeriod?.endDate?.month,
106
+ startYear: rec?.timePeriod?.startDate?.year || rec?.dateRange?.start?.year,
107
+ startMonth: rec?.timePeriod?.startDate?.month || rec?.dateRange?.start?.month,
108
+ endYear: rec?.timePeriod?.endDate?.year || rec?.dateRange?.end?.year,
109
+ endMonth: rec?.timePeriod?.endDate?.month || rec?.dateRange?.end?.month,
95
110
  };
96
111
  profile.educations.push(edu);
97
112
  }
113
+ // Skills
114
+ const skills = [];
115
+ for (const item of included) {
116
+ const rec = item;
117
+ const urn = rec?.entityUrn || '';
118
+ if (!urn.includes('fsd_skill'))
119
+ continue;
120
+ const skill = {
121
+ name: rec?.name,
122
+ entityUrn: urn,
123
+ };
124
+ skills.push(skill);
125
+ }
126
+ if (skills.length > 0)
127
+ profile.skills = skills;
98
128
  // Avatar (via helper)
99
129
  const avatarItem = included.find((it) => it?.vectorImage && JSON.stringify(it).includes('vectorImage'));
100
130
  const vector = avatarItem?.vectorImage;
package/dist/types.d.ts CHANGED
@@ -35,8 +35,13 @@ export interface ProfileEducation {
35
35
  endYear?: number;
36
36
  endMonth?: number;
37
37
  }
38
+ export interface ProfileSkill {
39
+ name?: string;
40
+ entityUrn?: string;
41
+ }
38
42
  export interface LinkedInProfile {
39
43
  vanity: string;
44
+ publicIdentifier?: string;
40
45
  firstName?: string;
41
46
  lastName?: string;
42
47
  headline?: string;
@@ -45,8 +50,16 @@ export interface LinkedInProfile {
45
50
  avatarUrl?: string;
46
51
  coverUrl?: string;
47
52
  fsdProfileUrn?: string;
53
+ objectUrn?: string;
54
+ premium?: boolean;
55
+ influencer?: boolean;
56
+ industryUrn?: string;
57
+ geoLocationUrn?: string;
58
+ countryCode?: string;
59
+ versionTag?: string;
48
60
  positions: ProfilePosition[];
49
61
  educations: ProfileEducation[];
62
+ skills?: ProfileSkill[];
50
63
  }
51
64
  export interface LinkedInTenure {
52
65
  numYears?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkedin-secret-sauce",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
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",