Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formally release v1 schema integration, fix truncated volunteer experiences #57

Merged
merged 3 commits into from
Nov 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"extends": ["airbnb-base","plugin:prettier/recommended"],
"ignorePatterns": ["**/build/**/*", "**/scratch**/*"],
"extends": ["airbnb-base","plugin:prettier/recommended", "plugin:@typescript-eslint/recommended", "plugin:import/errors", "plugin:import/warnings", "plugin:import/typescript"],
"ignorePatterns": ["**/build*/**", "**/webstore-zips/**", "**/scratch**"],
"plugins": [
"@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018
},
Expand Down Expand Up @@ -29,9 +33,29 @@
"prefer-destructuring": ["error", {
"array": false,
"object": true
}]
}],
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-interface": "off",
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
]
},
"globals": {
"chrome": "readonly"
},
"settings": {
"import/resolver": {
"typescript": {}
}
}
}
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Eslint + Prettier updates and linting over repo
d6fb09b701da5ccea23996ca662eb0871201007c
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,25 @@

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

## Breaking Change - `v1.0` Schema Update
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:

<details>
<summary>Previously</summary>

- Stable: `v0.0.16`
- Latest: `v0.1.3`
- Beta: `v0.1.3` + `certificates`
</details>

<details>
<summary>Version 3.0.0</summary>

- ***Legacy***: `v0.0.16`
- Stable: `v1.0.0`
- Beta: Even with `v1.0.0` (for now)
</details>

## Usage / Installation Options:
There are (or *were*) a few different options for how to use this:
- **Fast and simple**: Chrome Extension - [Get it here](https://chrome.google.com/webstore/detail/jcaldklkmnjfpjaboilcejindjejbklh/)
Expand Down Expand Up @@ -84,6 +103,7 @@ If I'm trying to assist you in solving an issue with this tool, I might have you

Date | Release | Notes
--- | --- | ---
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!
2/27/2021 | 2.1.2 | Fix: Multiple issues around work history / experience; missing titles, ordering, etc. Overhauled approach to extracting work entries.
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))
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))
Expand Down
98 changes: 48 additions & 50 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
import {ResumeSchemaLegacy as _ResumeSchemaLegacy} from './jsonresume.schema.legacy';
import {ResumeSchemaStable as _ResumeSchemaStable, ResumeSchemaBeyondSpec as _ResumeSchemaBeyondSpec} from './jsonresume.schema.latest';
import { ResumeSchemaLegacy as _ResumeSchemaLegacy } from './jsonresume.schema.legacy';
import { ResumeSchemaStable as _ResumeSchemaStable, ResumeSchemaBeyondSpec as _ResumeSchemaBeyondSpec } from './jsonresume.schema.latest';

declare global {
interface GenObj {
[k: string]: any;
}

/**
* LI Types
*/
// LI Types

type LiUrn = string;

interface LiResponse {
data: {
$type: string;
paging?: LiPaging;
// This is kind of a ToC, where each string corresponds to an entityUrn ID of an entity in `included`
'*elements'?: string[];
// 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`)
[k: string]: IGenObj | string;
} & Partial<LiEntity>;
included: LiEntity[];
}

interface LiPaging {
count: number;
start: number;
Expand All @@ -42,6 +28,18 @@ declare global {
paging?: LiPaging;
}

interface LiResponse {
data: {
$type: string;
paging?: LiPaging;
// This is kind of a ToC, where each string corresponds to an entityUrn ID of an entity in `included`
'*elements'?: string[];
// 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`)
[k: string]: GenObj | string | boolean;
} & Partial<LiEntity>;
included: LiEntity[];
}

interface LiSupportedLocale {
country: string;
language: string;
Expand All @@ -67,7 +65,7 @@ declare global {
type: {
$type: string;
category: string;
}
};
$type: string;
}

Expand All @@ -76,16 +74,15 @@ declare global {
interface InternalDb {
tableOfContents: LiResponse['data'];
entitiesByUrn: {
[k: LiUrn]: LiEntity & {key: LiUrn}
[k: string]: LiEntity & {key: LiUrn};
}
entities: Array<LiEntity & {key: LiUrn}>;
[k: string]: LiEntity & { key: LiUrn };
};
entities: Array<LiEntity & { key: LiUrn }>;
// Methods
getElementKeys: () => string[];
getElements: () => Array<LiEntity & {key: LIUrn}>;
getElements: () => Array<LiEntity & { key: LiUrn }>;
getValueByKey: (key: string | string[]) => LiEntity;
getValuesByKey: (key: LiUrn | LiUrn[], optTocValModifier?: TocValModifier) => LiEntity[];
getElementsByType: (typeStr: string | string []) => LiEntity[];
getElementsByType: (typeStr: string | string[]) => LiEntity[];
getElementByUrn: (urn: string) => LiEntity | undefined;
/**
* Get multiple elements by URNs
Expand All @@ -95,21 +92,22 @@ declare global {
}

interface LiProfileContactInfoResponse extends LiResponse {
data: LiResponse['data'] & Partial<LiEntity> & {
$type: 'com.linkedin.voyager.identity.profile.ProfileContactInfo';
address: string;
birthDateOn: LiDate;
birthdayVisibilitySetting: any;
connectedAt: null | number;
emailAddress: null | string;
ims: any;
interests: any;
phoneNumbers: null | LiPhoneNum[];
primaryTwitterHandle: null | string;
twitterHandles: any[];
weChatContactInfo: any;
websites: null | LiWebsite[];
}
data: LiResponse['data'] &
Partial<LiEntity> & {
$type: 'com.linkedin.voyager.identity.profile.ProfileContactInfo';
address: string;
birthDateOn: LiDate;
birthdayVisibilitySetting: any;
connectedAt: null | number;
emailAddress: null | string;
ims: any;
interests: any;
phoneNumbers: null | LiPhoneNum[];
primaryTwitterHandle: null | string;
twitterHandles: any[];
weChatContactInfo: any;
websites: null | LiWebsite[];
};
}

/**
Expand All @@ -125,17 +123,17 @@ declare global {
localeStr?: string;
parseSuccess: boolean;
sections: {
basics: CaptureResult,
attachments: CaptureResult,
education: CaptureResult,
work: CaptureResult,
volunteer: CaptureResult,
certificates: CaptureResult,
skills: CaptureResult,
projects: CaptureResult,
awards: CaptureResult,
publications: CaptureResult
}
basics: CaptureResult;
attachments: CaptureResult;
education: CaptureResult;
work: CaptureResult;
volunteer: CaptureResult;
certificates: CaptureResult;
skills: CaptureResult;
projects: CaptureResult;
awards: CaptureResult;
publications: CaptureResult;
};
}

type SchemaVersion = 'legacy' | 'stable' | 'beta';
Expand Down
41 changes: 16 additions & 25 deletions jsonresume.schema.latest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,10 @@
*/

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

// Re-export
export {
Iso8601,
Award,
Location,
Profile,
Interest,
Language,
Reference,
Skill
}
export { Iso8601, Award, Location, Profile, Interest, Language, Reference, Skill };

export interface Certificate {
/**
Expand Down Expand Up @@ -51,9 +42,9 @@ export interface Basics {
/**
* e.g. Web Developer
*/
label?: string;
label?: string;
location?: Location;
name?: string;
name?: string;
/**
* Phone numbers are stored as strings so use any format you like, e.g. 712-117-2923
*/
Expand Down Expand Up @@ -90,7 +81,7 @@ export interface Education {
* e.g. Massachusetts Institute of Technology
*/
institution?: string;
startDate?: Iso8601;
startDate?: Iso8601;
/**
* e.g. Bachelor
*/
Expand Down Expand Up @@ -124,7 +115,7 @@ export interface Project {
* Short summary of project. e.g. Collated works of 2017.
*/
description?: string;
endDate?: Iso8601;
endDate?: Iso8601;
/**
* Specify the relevant company/entity affiliations e.g. 'greenpeace', 'corporationXYZ'
*/
Expand All @@ -144,7 +135,7 @@ export interface Project {
/**
* Specify your role on this project or in company
*/
roles?: string[];
roles?: string[];
startDate?: Iso8601;
/**
* e.g. 'volunteering', 'presentation', 'talk', 'application', 'conference'
Expand All @@ -161,21 +152,21 @@ export type Publication = Omit<ResumeSchemaLegacy['publications'][0], 'website'>
* e.g. http://www.computer.org.example.com/csdl/mags/co/1996/10/rx069-abs.html
*/
url?: string;
}
};

export type Volunteer = Omit<ResumeSchemaLegacy['volunteer'][0], 'website'> & {
/**
* e.g. https://www.eff.org/
*/
url?: string;
}
};

export interface Work {
/**
* e.g. Social Media Company
*/
description?: string;
endDate?: Iso8601;
endDate?: Iso8601;
/**
* Specify multiple accomplishments
*/
Expand All @@ -191,7 +182,7 @@ export interface Work {
/**
* e.g. Software Engineer
*/
position?: string;
position?: string;
startDate?: Iso8601;
/**
* Give an overview of your responsibilities at the company
Expand All @@ -211,8 +202,8 @@ export interface ResumeSchemaStable {
/**
* Specify any awards you have received throughout your professional career
*/
awards?: Award[];
basics?: Basics;
awards?: Award[];
basics?: Basics;
certificates: Certificate[];
education?: Education[];
interests?: Interest[];
Expand All @@ -239,12 +230,12 @@ export interface ResumeSchemaStable {
/**
* List out your professional skill-set
*/
skills?: Skill[];
skills?: Skill[];
volunteer?: Volunteer[];
work?: Work[];
work?: Work[];
}

/**
* Currently even - nothing beyond v1
*/
export interface ResumeSchemaBeyondSpec extends ResumeSchemaStable {}
export interface ResumeSchemaBeyondSpec extends ResumeSchemaStable {}
Loading