@thejob/util 1.0.28 → 1.0.30
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/cjs/completeness/index.d.ts +1 -0
- package/dist/cjs/completeness/index.d.ts.map +1 -1
- package/dist/cjs/completeness/index.js +1 -0
- package/dist/cjs/completeness/job-match-completeness.d.ts +21 -0
- package/dist/cjs/completeness/job-match-completeness.d.ts.map +1 -0
- package/dist/cjs/completeness/job-match-completeness.js +38 -0
- package/dist/cjs/user/utils.d.ts +1 -1
- package/dist/cjs/user/utils.d.ts.map +1 -1
- package/dist/cjs/user/utils.js +2 -2
- package/dist/esm/completeness/index.d.ts +1 -0
- package/dist/esm/completeness/index.d.ts.map +1 -1
- package/dist/esm/completeness/index.js +1 -0
- package/dist/esm/completeness/job-match-completeness.d.ts +21 -0
- package/dist/esm/completeness/job-match-completeness.d.ts.map +1 -0
- package/dist/esm/completeness/job-match-completeness.js +35 -0
- package/dist/esm/user/utils.d.ts +1 -1
- package/dist/esm/user/utils.d.ts.map +1 -1
- package/dist/esm/user/utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/completeness/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/completeness/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TUserSchema } from "@thejob/schema";
|
|
2
|
+
/**
|
|
3
|
+
* Calculates a job-match completeness score (0–100) based only on the fields
|
|
4
|
+
* that directly affect search ranking and candidate-job matching quality.
|
|
5
|
+
*
|
|
6
|
+
* Intentionally excludes profile UX fields (image, mobile, socialAccounts,
|
|
7
|
+
* certifications, projects, interests, additionalInfo) that have no bearing
|
|
8
|
+
* on whether a candidate can be accurately ranked against a job.
|
|
9
|
+
*
|
|
10
|
+
* Weights:
|
|
11
|
+
* headline 25 — strongest FTS + embedding signal
|
|
12
|
+
* skills 25 — directly matched against job requirements
|
|
13
|
+
* workExperiences 20 — seniority and title signals
|
|
14
|
+
* experienceLevel 15 — level fit (entry / mid / senior)
|
|
15
|
+
* aboutMe 10 — semantic narrative and intent
|
|
16
|
+
* educations 5 — degree / field matching
|
|
17
|
+
* ---
|
|
18
|
+
* 100
|
|
19
|
+
*/
|
|
20
|
+
export declare function calculateJobMatchCompleteness(user: Partial<TUserSchema>): number;
|
|
21
|
+
//# sourceMappingURL=job-match-completeness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job-match-completeness.d.ts","sourceRoot":"","sources":["../../../src/completeness/job-match-completeness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,GACzB,MAAM,CAWR"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateJobMatchCompleteness = calculateJobMatchCompleteness;
|
|
4
|
+
const utils_1 = require("../common/utils");
|
|
5
|
+
/**
|
|
6
|
+
* Calculates a job-match completeness score (0–100) based only on the fields
|
|
7
|
+
* that directly affect search ranking and candidate-job matching quality.
|
|
8
|
+
*
|
|
9
|
+
* Intentionally excludes profile UX fields (image, mobile, socialAccounts,
|
|
10
|
+
* certifications, projects, interests, additionalInfo) that have no bearing
|
|
11
|
+
* on whether a candidate can be accurately ranked against a job.
|
|
12
|
+
*
|
|
13
|
+
* Weights:
|
|
14
|
+
* headline 25 — strongest FTS + embedding signal
|
|
15
|
+
* skills 25 — directly matched against job requirements
|
|
16
|
+
* workExperiences 20 — seniority and title signals
|
|
17
|
+
* experienceLevel 15 — level fit (entry / mid / senior)
|
|
18
|
+
* aboutMe 10 — semantic narrative and intent
|
|
19
|
+
* educations 5 — degree / field matching
|
|
20
|
+
* ---
|
|
21
|
+
* 100
|
|
22
|
+
*/
|
|
23
|
+
function calculateJobMatchCompleteness(user) {
|
|
24
|
+
let score = 0;
|
|
25
|
+
if (user.headline?.trim())
|
|
26
|
+
score += 25;
|
|
27
|
+
if ((user.skills?.length ?? 0) > 0)
|
|
28
|
+
score += 25;
|
|
29
|
+
if ((user.workExperiences?.length ?? 0) > 0)
|
|
30
|
+
score += 20;
|
|
31
|
+
if (user.experienceLevel)
|
|
32
|
+
score += 15;
|
|
33
|
+
if (user.aboutMe?.trim())
|
|
34
|
+
score += 10;
|
|
35
|
+
if ((user.educations?.length ?? 0) > 0)
|
|
36
|
+
score += 5;
|
|
37
|
+
return (0, utils_1.toPositiveWholeNumber)(score);
|
|
38
|
+
}
|
package/dist/cjs/user/utils.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { TUserSchema } from "@thejob/schema";
|
|
|
8
8
|
* 2. About me (intent/personality signal)
|
|
9
9
|
* 3. Flattened structured data (skills, experience, education)
|
|
10
10
|
*/
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function prepareUserForEmbedding(user: TUserSchema): string;
|
|
12
12
|
export declare const parseName: (name: string | {
|
|
13
13
|
first: string;
|
|
14
14
|
last?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/user/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C;;;;;;;;GAQG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/user/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAmEjE;AAED,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE;WAAvB,MAAM;WAAS,MAAM;CAWtE,CAAC"}
|
package/dist/cjs/user/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseName = void 0;
|
|
4
|
-
exports.
|
|
4
|
+
exports.prepareUserForEmbedding = prepareUserForEmbedding;
|
|
5
5
|
const common_1 = require("../common");
|
|
6
6
|
/**
|
|
7
7
|
* Prepares a user profile for vector embedding by creating a semantic narrative.
|
|
@@ -12,7 +12,7 @@ const common_1 = require("../common");
|
|
|
12
12
|
* 2. About me (intent/personality signal)
|
|
13
13
|
* 3. Flattened structured data (skills, experience, education)
|
|
14
14
|
*/
|
|
15
|
-
function
|
|
15
|
+
function prepareUserForEmbedding(user) {
|
|
16
16
|
const headline = user.headline?.trim() || "";
|
|
17
17
|
const about = user.aboutMe?.replace(/\n/g, " ").trim() || "";
|
|
18
18
|
const locationParts = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/completeness/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/completeness/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TUserSchema } from "@thejob/schema";
|
|
2
|
+
/**
|
|
3
|
+
* Calculates a job-match completeness score (0–100) based only on the fields
|
|
4
|
+
* that directly affect search ranking and candidate-job matching quality.
|
|
5
|
+
*
|
|
6
|
+
* Intentionally excludes profile UX fields (image, mobile, socialAccounts,
|
|
7
|
+
* certifications, projects, interests, additionalInfo) that have no bearing
|
|
8
|
+
* on whether a candidate can be accurately ranked against a job.
|
|
9
|
+
*
|
|
10
|
+
* Weights:
|
|
11
|
+
* headline 25 — strongest FTS + embedding signal
|
|
12
|
+
* skills 25 — directly matched against job requirements
|
|
13
|
+
* workExperiences 20 — seniority and title signals
|
|
14
|
+
* experienceLevel 15 — level fit (entry / mid / senior)
|
|
15
|
+
* aboutMe 10 — semantic narrative and intent
|
|
16
|
+
* educations 5 — degree / field matching
|
|
17
|
+
* ---
|
|
18
|
+
* 100
|
|
19
|
+
*/
|
|
20
|
+
export declare function calculateJobMatchCompleteness(user: Partial<TUserSchema>): number;
|
|
21
|
+
//# sourceMappingURL=job-match-completeness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job-match-completeness.d.ts","sourceRoot":"","sources":["../../../src/completeness/job-match-completeness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,GACzB,MAAM,CAWR"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { toPositiveWholeNumber } from "../common/utils";
|
|
2
|
+
/**
|
|
3
|
+
* Calculates a job-match completeness score (0–100) based only on the fields
|
|
4
|
+
* that directly affect search ranking and candidate-job matching quality.
|
|
5
|
+
*
|
|
6
|
+
* Intentionally excludes profile UX fields (image, mobile, socialAccounts,
|
|
7
|
+
* certifications, projects, interests, additionalInfo) that have no bearing
|
|
8
|
+
* on whether a candidate can be accurately ranked against a job.
|
|
9
|
+
*
|
|
10
|
+
* Weights:
|
|
11
|
+
* headline 25 — strongest FTS + embedding signal
|
|
12
|
+
* skills 25 — directly matched against job requirements
|
|
13
|
+
* workExperiences 20 — seniority and title signals
|
|
14
|
+
* experienceLevel 15 — level fit (entry / mid / senior)
|
|
15
|
+
* aboutMe 10 — semantic narrative and intent
|
|
16
|
+
* educations 5 — degree / field matching
|
|
17
|
+
* ---
|
|
18
|
+
* 100
|
|
19
|
+
*/
|
|
20
|
+
export function calculateJobMatchCompleteness(user) {
|
|
21
|
+
let score = 0;
|
|
22
|
+
if (user.headline?.trim())
|
|
23
|
+
score += 25;
|
|
24
|
+
if ((user.skills?.length ?? 0) > 0)
|
|
25
|
+
score += 25;
|
|
26
|
+
if ((user.workExperiences?.length ?? 0) > 0)
|
|
27
|
+
score += 20;
|
|
28
|
+
if (user.experienceLevel)
|
|
29
|
+
score += 15;
|
|
30
|
+
if (user.aboutMe?.trim())
|
|
31
|
+
score += 10;
|
|
32
|
+
if ((user.educations?.length ?? 0) > 0)
|
|
33
|
+
score += 5;
|
|
34
|
+
return toPositiveWholeNumber(score);
|
|
35
|
+
}
|
package/dist/esm/user/utils.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { TUserSchema } from "@thejob/schema";
|
|
|
8
8
|
* 2. About me (intent/personality signal)
|
|
9
9
|
* 3. Flattened structured data (skills, experience, education)
|
|
10
10
|
*/
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function prepareUserForEmbedding(user: TUserSchema): string;
|
|
12
12
|
export declare const parseName: (name: string | {
|
|
13
13
|
first: string;
|
|
14
14
|
last?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/user/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C;;;;;;;;GAQG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/user/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAmEjE;AAED,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE;WAAvB,MAAM;WAAS,MAAM;CAWtE,CAAC"}
|
package/dist/esm/user/utils.js
CHANGED
|
@@ -8,7 +8,7 @@ import { displayByName, displayLocation, fromWithOtherValue } from "../common";
|
|
|
8
8
|
* 2. About me (intent/personality signal)
|
|
9
9
|
* 3. Flattened structured data (skills, experience, education)
|
|
10
10
|
*/
|
|
11
|
-
export function
|
|
11
|
+
export function prepareUserForEmbedding(user) {
|
|
12
12
|
const headline = user.headline?.trim() || "";
|
|
13
13
|
const about = user.aboutMe?.replace(/\n/g, " ").trim() || "";
|
|
14
14
|
const locationParts = [
|