Skip to content

Commit c8f1b5d

Browse files
authored
Merge pull request #57 from joshuatz/dev
Formally release `v1` schema integration, fix truncated volunteer experiences
2 parents bdd9173 + bb270c7 commit c8f1b5d

10 files changed

+2078
-3000
lines changed

.eslintrc.json

+27-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
2-
"extends": ["airbnb-base","plugin:prettier/recommended"],
3-
"ignorePatterns": ["**/build/**/*", "**/scratch**/*"],
2+
"extends": ["airbnb-base","plugin:prettier/recommended", "plugin:@typescript-eslint/recommended", "plugin:import/errors", "plugin:import/warnings", "plugin:import/typescript"],
3+
"ignorePatterns": ["**/build*/**", "**/webstore-zips/**", "**/scratch**"],
4+
"plugins": [
5+
"@typescript-eslint"
6+
],
7+
"parser": "@typescript-eslint/parser",
48
"parserOptions": {
59
"ecmaVersion": 2018
610
},
@@ -29,9 +33,29 @@
2933
"prefer-destructuring": ["error", {
3034
"array": false,
3135
"object": true
32-
}]
36+
}],
37+
"@typescript-eslint/no-var-requires": "off",
38+
"@typescript-eslint/no-this-alias": "off",
39+
"@typescript-eslint/no-explicit-any": "warn",
40+
"@typescript-eslint/ban-ts-comment": "off",
41+
"@typescript-eslint/no-empty-interface": "off",
42+
"import/extensions": [
43+
"error",
44+
"ignorePackages",
45+
{
46+
"js": "never",
47+
"jsx": "never",
48+
"ts": "never",
49+
"tsx": "never"
50+
}
51+
]
3352
},
3453
"globals": {
3554
"chrome": "readonly"
55+
},
56+
"settings": {
57+
"import/resolver": {
58+
"typescript": {}
59+
}
3660
}
3761
}

.git-blame-ignore-revs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Eslint + Prettier updates and linting over repo
2+
d6fb09b701da5ccea23996ca662eb0871201007c

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,25 @@
88

99
![Demo GIF](demo-chrome_extension.gif "Demo Gif")
1010

11+
## Breaking Change - `v1.0` Schema Update
12+
The 10/31/2021 release of this extension (`v3.0.0`) changes the default shape of the JSON exported by this tool, to adhere to the newer `v1` schema offered by JSON Resume:
13+
14+
<details>
15+
<summary>Previously</summary>
16+
17+
- Stable: `v0.0.16`
18+
- Latest: `v0.1.3`
19+
- Beta: `v0.1.3` + `certificates`
20+
</details>
21+
22+
<details>
23+
<summary>Version 3.0.0</summary>
24+
25+
- ***Legacy***: `v0.0.16`
26+
- Stable: `v1.0.0`
27+
- Beta: Even with `v1.0.0` (for now)
28+
</details>
29+
1130
## Usage / Installation Options:
1231
There are (or *were*) a few different options for how to use this:
1332
- **Fast and simple**: Chrome Extension - [Get it here](https://chrome.google.com/webstore/detail/jcaldklkmnjfpjaboilcejindjejbklh/)
@@ -84,6 +103,7 @@ If I'm trying to assist you in solving an issue with this tool, I might have you
84103

85104
Date | Release | Notes
86105
--- | --- | ---
106+
10/31/2021 | 3.0.0 | **Breaking Update**: This extension has now been updated to output JSON matching the `v1` schema specification released by JSON Resume (see [#53](https://github.com/joshuatz/linkedin-to-jsonresume/pull/53) and [#56](https://github.com/joshuatz/linkedin-to-jsonresume/pull/56)). If you still need the `v0.0.16` schema output, it is no longer the default, but is still available for now under the "legacy" schema option. Thanks @ [anthonyjdella](https://github.com/anthonyjdella) for the PR and code contributions!<br/><br/>Fix: Also rolled into this release is a fix for truncated volunteer experiences (see [#55](https://github.com/joshuatz/linkedin-to-jsonresume/issues/55)). Thanks @ [fkrauthan](https://github.com/fkrauthan) for the heads up!
87107
2/27/2021 | 2.1.2 | Fix: Multiple issues around work history / experience; missing titles, ordering, etc. Overhauled approach to extracting work entries.
88108
12/19/2020 | 2.1.1 | Fix: Ordering of work history with new API endpoint ([#38](https://github.com/joshuatz/linkedin-to-jsonresume/issues/38))
89109
12/7/2020 | 2.1.0 | Fix: Issue with multilingual profile, when exporting your own profile with a different locale than your profile's default. ([#37](https://github.com/joshuatz/linkedin-to-jsonresume/pull/37))

global.d.ts

+48-50
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,15 @@
1-
import {ResumeSchemaLegacy as _ResumeSchemaLegacy} from './jsonresume.schema.legacy';
2-
import {ResumeSchemaStable as _ResumeSchemaStable, ResumeSchemaBeyondSpec as _ResumeSchemaBeyondSpec} from './jsonresume.schema.latest';
1+
import { ResumeSchemaLegacy as _ResumeSchemaLegacy } from './jsonresume.schema.legacy';
2+
import { ResumeSchemaStable as _ResumeSchemaStable, ResumeSchemaBeyondSpec as _ResumeSchemaBeyondSpec } from './jsonresume.schema.latest';
33

44
declare global {
55
interface GenObj {
66
[k: string]: any;
77
}
88

9-
/**
10-
* LI Types
11-
*/
9+
// LI Types
1210

1311
type LiUrn = string;
1412

15-
interface LiResponse {
16-
data: {
17-
$type: string;
18-
paging?: LiPaging;
19-
// This is kind of a ToC, where each string corresponds to an entityUrn ID of an entity in `included`
20-
'*elements'?: string[];
21-
// Any number of fields can be included, especially if this is a "flat" response (when `included` is empty, and all entity data is directly in `data`)
22-
[k: string]: IGenObj | string;
23-
} & Partial<LiEntity>;
24-
included: LiEntity[];
25-
}
26-
2713
interface LiPaging {
2814
count: number;
2915
start: number;
@@ -42,6 +28,18 @@ declare global {
4228
paging?: LiPaging;
4329
}
4430

31+
interface LiResponse {
32+
data: {
33+
$type: string;
34+
paging?: LiPaging;
35+
// This is kind of a ToC, where each string corresponds to an entityUrn ID of an entity in `included`
36+
'*elements'?: string[];
37+
// Any number of fields can be included, especially if this is a "flat" response (when `included` is empty, and all entity data is directly in `data`)
38+
[k: string]: GenObj | string | boolean;
39+
} & Partial<LiEntity>;
40+
included: LiEntity[];
41+
}
42+
4543
interface LiSupportedLocale {
4644
country: string;
4745
language: string;
@@ -67,7 +65,7 @@ declare global {
6765
type: {
6866
$type: string;
6967
category: string;
70-
}
68+
};
7169
$type: string;
7270
}
7371

@@ -76,16 +74,15 @@ declare global {
7674
interface InternalDb {
7775
tableOfContents: LiResponse['data'];
7876
entitiesByUrn: {
79-
[k: LiUrn]: LiEntity & {key: LiUrn}
80-
[k: string]: LiEntity & {key: LiUrn};
81-
}
82-
entities: Array<LiEntity & {key: LiUrn}>;
77+
[k: string]: LiEntity & { key: LiUrn };
78+
};
79+
entities: Array<LiEntity & { key: LiUrn }>;
8380
// Methods
8481
getElementKeys: () => string[];
85-
getElements: () => Array<LiEntity & {key: LIUrn}>;
82+
getElements: () => Array<LiEntity & { key: LiUrn }>;
8683
getValueByKey: (key: string | string[]) => LiEntity;
8784
getValuesByKey: (key: LiUrn | LiUrn[], optTocValModifier?: TocValModifier) => LiEntity[];
88-
getElementsByType: (typeStr: string | string []) => LiEntity[];
85+
getElementsByType: (typeStr: string | string[]) => LiEntity[];
8986
getElementByUrn: (urn: string) => LiEntity | undefined;
9087
/**
9188
* Get multiple elements by URNs
@@ -95,21 +92,22 @@ declare global {
9592
}
9693

9794
interface LiProfileContactInfoResponse extends LiResponse {
98-
data: LiResponse['data'] & Partial<LiEntity> & {
99-
$type: 'com.linkedin.voyager.identity.profile.ProfileContactInfo';
100-
address: string;
101-
birthDateOn: LiDate;
102-
birthdayVisibilitySetting: any;
103-
connectedAt: null | number;
104-
emailAddress: null | string;
105-
ims: any;
106-
interests: any;
107-
phoneNumbers: null | LiPhoneNum[];
108-
primaryTwitterHandle: null | string;
109-
twitterHandles: any[];
110-
weChatContactInfo: any;
111-
websites: null | LiWebsite[];
112-
}
95+
data: LiResponse['data'] &
96+
Partial<LiEntity> & {
97+
$type: 'com.linkedin.voyager.identity.profile.ProfileContactInfo';
98+
address: string;
99+
birthDateOn: LiDate;
100+
birthdayVisibilitySetting: any;
101+
connectedAt: null | number;
102+
emailAddress: null | string;
103+
ims: any;
104+
interests: any;
105+
phoneNumbers: null | LiPhoneNum[];
106+
primaryTwitterHandle: null | string;
107+
twitterHandles: any[];
108+
weChatContactInfo: any;
109+
websites: null | LiWebsite[];
110+
};
113111
}
114112

115113
/**
@@ -125,17 +123,17 @@ declare global {
125123
localeStr?: string;
126124
parseSuccess: boolean;
127125
sections: {
128-
basics: CaptureResult,
129-
attachments: CaptureResult,
130-
education: CaptureResult,
131-
work: CaptureResult,
132-
volunteer: CaptureResult,
133-
certificates: CaptureResult,
134-
skills: CaptureResult,
135-
projects: CaptureResult,
136-
awards: CaptureResult,
137-
publications: CaptureResult
138-
}
126+
basics: CaptureResult;
127+
attachments: CaptureResult;
128+
education: CaptureResult;
129+
work: CaptureResult;
130+
volunteer: CaptureResult;
131+
certificates: CaptureResult;
132+
skills: CaptureResult;
133+
projects: CaptureResult;
134+
awards: CaptureResult;
135+
publications: CaptureResult;
136+
};
139137
}
140138

141139
type SchemaVersion = 'legacy' | 'stable' | 'beta';

jsonresume.schema.latest.ts

+16-25
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,10 @@
66
*/
77

88
// All of these imports are because the spec is the same for the sub-section in both stable and latest (this doc)
9-
import {Iso8601, Award, Location, Profile, Interest, Language, Reference, Skill, ResumeSchemaLegacy} from './jsonresume.schema.legacy';
9+
import { Iso8601, Award, Location, Profile, Interest, Language, Reference, Skill, ResumeSchemaLegacy } from './jsonresume.schema.legacy.js';
1010

1111
// Re-export
12-
export {
13-
Iso8601,
14-
Award,
15-
Location,
16-
Profile,
17-
Interest,
18-
Language,
19-
Reference,
20-
Skill
21-
}
12+
export { Iso8601, Award, Location, Profile, Interest, Language, Reference, Skill };
2213

2314
export interface Certificate {
2415
/**
@@ -51,9 +42,9 @@ export interface Basics {
5142
/**
5243
* e.g. Web Developer
5344
*/
54-
label?: string;
45+
label?: string;
5546
location?: Location;
56-
name?: string;
47+
name?: string;
5748
/**
5849
* Phone numbers are stored as strings so use any format you like, e.g. 712-117-2923
5950
*/
@@ -90,7 +81,7 @@ export interface Education {
9081
* e.g. Massachusetts Institute of Technology
9182
*/
9283
institution?: string;
93-
startDate?: Iso8601;
84+
startDate?: Iso8601;
9485
/**
9586
* e.g. Bachelor
9687
*/
@@ -124,7 +115,7 @@ export interface Project {
124115
* Short summary of project. e.g. Collated works of 2017.
125116
*/
126117
description?: string;
127-
endDate?: Iso8601;
118+
endDate?: Iso8601;
128119
/**
129120
* Specify the relevant company/entity affiliations e.g. 'greenpeace', 'corporationXYZ'
130121
*/
@@ -144,7 +135,7 @@ export interface Project {
144135
/**
145136
* Specify your role on this project or in company
146137
*/
147-
roles?: string[];
138+
roles?: string[];
148139
startDate?: Iso8601;
149140
/**
150141
* e.g. 'volunteering', 'presentation', 'talk', 'application', 'conference'
@@ -161,21 +152,21 @@ export type Publication = Omit<ResumeSchemaLegacy['publications'][0], 'website'>
161152
* e.g. http://www.computer.org.example.com/csdl/mags/co/1996/10/rx069-abs.html
162153
*/
163154
url?: string;
164-
}
155+
};
165156

166157
export type Volunteer = Omit<ResumeSchemaLegacy['volunteer'][0], 'website'> & {
167158
/**
168159
* e.g. https://www.eff.org/
169160
*/
170161
url?: string;
171-
}
162+
};
172163

173164
export interface Work {
174165
/**
175166
* e.g. Social Media Company
176167
*/
177168
description?: string;
178-
endDate?: Iso8601;
169+
endDate?: Iso8601;
179170
/**
180171
* Specify multiple accomplishments
181172
*/
@@ -191,7 +182,7 @@ export interface Work {
191182
/**
192183
* e.g. Software Engineer
193184
*/
194-
position?: string;
185+
position?: string;
195186
startDate?: Iso8601;
196187
/**
197188
* Give an overview of your responsibilities at the company
@@ -211,8 +202,8 @@ export interface ResumeSchemaStable {
211202
/**
212203
* Specify any awards you have received throughout your professional career
213204
*/
214-
awards?: Award[];
215-
basics?: Basics;
205+
awards?: Award[];
206+
basics?: Basics;
216207
certificates: Certificate[];
217208
education?: Education[];
218209
interests?: Interest[];
@@ -239,12 +230,12 @@ export interface ResumeSchemaStable {
239230
/**
240231
* List out your professional skill-set
241232
*/
242-
skills?: Skill[];
233+
skills?: Skill[];
243234
volunteer?: Volunteer[];
244-
work?: Work[];
235+
work?: Work[];
245236
}
246237

247238
/**
248239
* Currently even - nothing beyond v1
249240
*/
250-
export interface ResumeSchemaBeyondSpec extends ResumeSchemaStable {}
241+
export interface ResumeSchemaBeyondSpec extends ResumeSchemaStable {}

0 commit comments

Comments
 (0)