linkedin-secret-sauce 0.3.12 → 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.
- package/dist/parsers/profile-parser.js +30 -0
- package/dist/types.d.ts +13 -0
- package/package.json +1 -1
|
@@ -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)
|
|
@@ -95,6 +110,21 @@ function parseFullProfile(rawResponse, vanity) {
|
|
|
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;
|