@thejob/util 1.0.27 → 1.0.29
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/user/utils.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TUserSchema } from "@thejob/schema";
|
|
1
2
|
/**
|
|
2
3
|
* Prepares a user profile for vector embedding by creating a semantic narrative.
|
|
3
4
|
* Mirrors prepareJobForEmbedding() — same "Label: Value" format for Voyage AI.
|
|
@@ -7,35 +8,7 @@
|
|
|
7
8
|
* 2. About me (intent/personality signal)
|
|
8
9
|
* 3. Flattened structured data (skills, experience, education)
|
|
9
10
|
*/
|
|
10
|
-
export declare function prepareUserForEmbedding(user:
|
|
11
|
-
headline?: string;
|
|
12
|
-
aboutMe?: string;
|
|
13
|
-
location?: {
|
|
14
|
-
city?: string;
|
|
15
|
-
stateCode?: string;
|
|
16
|
-
state?: string;
|
|
17
|
-
country?: string;
|
|
18
|
-
};
|
|
19
|
-
skills?: Array<{
|
|
20
|
-
skill?: {
|
|
21
|
-
name?: string;
|
|
22
|
-
};
|
|
23
|
-
name?: string;
|
|
24
|
-
}>;
|
|
25
|
-
experienceLevel?: string;
|
|
26
|
-
workExperiences?: Array<{
|
|
27
|
-
title?: string;
|
|
28
|
-
company?: string;
|
|
29
|
-
}>;
|
|
30
|
-
educations?: Array<{
|
|
31
|
-
degree?: string;
|
|
32
|
-
fieldOfStudy?: string;
|
|
33
|
-
institution?: string;
|
|
34
|
-
}>;
|
|
35
|
-
languages?: Array<{
|
|
36
|
-
name: string;
|
|
37
|
-
}>;
|
|
38
|
-
}): string;
|
|
11
|
+
export declare function prepareUserForEmbedding(user: TUserSchema): string;
|
|
39
12
|
export declare const parseName: (name: string | {
|
|
40
13
|
first: string;
|
|
41
14
|
last?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/user/utils.ts"],"names":[],"mappings":"AAAA
|
|
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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseName = void 0;
|
|
4
4
|
exports.prepareUserForEmbedding = prepareUserForEmbedding;
|
|
5
|
+
const common_1 = require("../common");
|
|
5
6
|
/**
|
|
6
7
|
* Prepares a user profile for vector embedding by creating a semantic narrative.
|
|
7
8
|
* Mirrors prepareJobForEmbedding() — same "Label: Value" format for Voyage AI.
|
|
@@ -17,25 +18,38 @@ function prepareUserForEmbedding(user) {
|
|
|
17
18
|
const locationParts = [
|
|
18
19
|
user.location?.city,
|
|
19
20
|
user.location?.stateCode || user.location?.state,
|
|
20
|
-
user.location?.country,
|
|
21
|
+
user.location?.country || user.region?.country,
|
|
21
22
|
].filter(Boolean);
|
|
22
23
|
const location = locationParts.join(", ");
|
|
23
24
|
const skillsList = user.skills
|
|
24
|
-
?.map((s) => (s.skill
|
|
25
|
+
?.map((s) => (0, common_1.fromWithOtherValue)(s.skill ?? s, common_1.displayByName)?.toLowerCase())
|
|
25
26
|
.filter(Boolean)
|
|
26
27
|
.join(", ") || "";
|
|
27
28
|
const experienceList = user.workExperiences
|
|
28
|
-
?.map((w) => [
|
|
29
|
+
?.map((w) => [
|
|
30
|
+
w.designation,
|
|
31
|
+
w.company
|
|
32
|
+
? `${(0, common_1.fromWithOtherValue)(w.company, common_1.displayByName)}, Work Location: ${(0, common_1.displayLocation)(w.location, "small")}`
|
|
33
|
+
: undefined,
|
|
34
|
+
]
|
|
35
|
+
.filter(Boolean)
|
|
36
|
+
.join(" at "))
|
|
29
37
|
.filter(Boolean)
|
|
30
38
|
.join("; ") || "";
|
|
31
39
|
const educationList = user.educations
|
|
32
|
-
?.map((e) => [
|
|
40
|
+
?.map((e) => [
|
|
41
|
+
e.course,
|
|
42
|
+
e.fieldOfStudy,
|
|
43
|
+
e.institute
|
|
44
|
+
? `at ${(0, common_1.fromWithOtherValue)(e.institute, common_1.displayByName)}, Study Location: ${(0, common_1.displayLocation)(e.location, "small")}`
|
|
45
|
+
: undefined,
|
|
46
|
+
]
|
|
33
47
|
.filter(Boolean)
|
|
34
48
|
.join(" "))
|
|
35
49
|
.filter(Boolean)
|
|
36
50
|
.join("; ") || "";
|
|
37
51
|
const languagesList = user.languages
|
|
38
|
-
?.map((l) => l.
|
|
52
|
+
?.map((l) => (0, common_1.fromWithOtherValue)(l.language, common_1.displayByName))
|
|
39
53
|
.filter(Boolean)
|
|
40
54
|
.join(", ") || "";
|
|
41
55
|
const parts = [];
|
package/dist/esm/user/utils.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TUserSchema } from "@thejob/schema";
|
|
1
2
|
/**
|
|
2
3
|
* Prepares a user profile for vector embedding by creating a semantic narrative.
|
|
3
4
|
* Mirrors prepareJobForEmbedding() — same "Label: Value" format for Voyage AI.
|
|
@@ -7,35 +8,7 @@
|
|
|
7
8
|
* 2. About me (intent/personality signal)
|
|
8
9
|
* 3. Flattened structured data (skills, experience, education)
|
|
9
10
|
*/
|
|
10
|
-
export declare function prepareUserForEmbedding(user:
|
|
11
|
-
headline?: string;
|
|
12
|
-
aboutMe?: string;
|
|
13
|
-
location?: {
|
|
14
|
-
city?: string;
|
|
15
|
-
stateCode?: string;
|
|
16
|
-
state?: string;
|
|
17
|
-
country?: string;
|
|
18
|
-
};
|
|
19
|
-
skills?: Array<{
|
|
20
|
-
skill?: {
|
|
21
|
-
name?: string;
|
|
22
|
-
};
|
|
23
|
-
name?: string;
|
|
24
|
-
}>;
|
|
25
|
-
experienceLevel?: string;
|
|
26
|
-
workExperiences?: Array<{
|
|
27
|
-
title?: string;
|
|
28
|
-
company?: string;
|
|
29
|
-
}>;
|
|
30
|
-
educations?: Array<{
|
|
31
|
-
degree?: string;
|
|
32
|
-
fieldOfStudy?: string;
|
|
33
|
-
institution?: string;
|
|
34
|
-
}>;
|
|
35
|
-
languages?: Array<{
|
|
36
|
-
name: string;
|
|
37
|
-
}>;
|
|
38
|
-
}): string;
|
|
11
|
+
export declare function prepareUserForEmbedding(user: TUserSchema): string;
|
|
39
12
|
export declare const parseName: (name: string | {
|
|
40
13
|
first: string;
|
|
41
14
|
last?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/user/utils.ts"],"names":[],"mappings":"AAAA
|
|
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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { displayByName, displayLocation, fromWithOtherValue } from "../common";
|
|
1
2
|
/**
|
|
2
3
|
* Prepares a user profile for vector embedding by creating a semantic narrative.
|
|
3
4
|
* Mirrors prepareJobForEmbedding() — same "Label: Value" format for Voyage AI.
|
|
@@ -13,25 +14,38 @@ export function prepareUserForEmbedding(user) {
|
|
|
13
14
|
const locationParts = [
|
|
14
15
|
user.location?.city,
|
|
15
16
|
user.location?.stateCode || user.location?.state,
|
|
16
|
-
user.location?.country,
|
|
17
|
+
user.location?.country || user.region?.country,
|
|
17
18
|
].filter(Boolean);
|
|
18
19
|
const location = locationParts.join(", ");
|
|
19
20
|
const skillsList = user.skills
|
|
20
|
-
?.map((s) => (s.skill
|
|
21
|
+
?.map((s) => fromWithOtherValue(s.skill ?? s, displayByName)?.toLowerCase())
|
|
21
22
|
.filter(Boolean)
|
|
22
23
|
.join(", ") || "";
|
|
23
24
|
const experienceList = user.workExperiences
|
|
24
|
-
?.map((w) => [
|
|
25
|
+
?.map((w) => [
|
|
26
|
+
w.designation,
|
|
27
|
+
w.company
|
|
28
|
+
? `${fromWithOtherValue(w.company, displayByName)}, Work Location: ${displayLocation(w.location, "small")}`
|
|
29
|
+
: undefined,
|
|
30
|
+
]
|
|
31
|
+
.filter(Boolean)
|
|
32
|
+
.join(" at "))
|
|
25
33
|
.filter(Boolean)
|
|
26
34
|
.join("; ") || "";
|
|
27
35
|
const educationList = user.educations
|
|
28
|
-
?.map((e) => [
|
|
36
|
+
?.map((e) => [
|
|
37
|
+
e.course,
|
|
38
|
+
e.fieldOfStudy,
|
|
39
|
+
e.institute
|
|
40
|
+
? `at ${fromWithOtherValue(e.institute, displayByName)}, Study Location: ${displayLocation(e.location, "small")}`
|
|
41
|
+
: undefined,
|
|
42
|
+
]
|
|
29
43
|
.filter(Boolean)
|
|
30
44
|
.join(" "))
|
|
31
45
|
.filter(Boolean)
|
|
32
46
|
.join("; ") || "";
|
|
33
47
|
const languagesList = user.languages
|
|
34
|
-
?.map((l) => l.
|
|
48
|
+
?.map((l) => fromWithOtherValue(l.language, displayByName))
|
|
35
49
|
.filter(Boolean)
|
|
36
50
|
.join(", ") || "";
|
|
37
51
|
const parts = [];
|