@thejob/schema 1.0.32 → 1.0.34
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/ai/ai.types.d.ts +138 -142
- package/dist/cjs/ai/ai.types.d.ts.map +1 -1
- package/dist/cjs/interfaces.index.d.ts +947 -494
- package/dist/cjs/interfaces.index.d.ts.map +1 -1
- package/dist/cjs/job/utils.d.ts +3 -4
- package/dist/cjs/job/utils.d.ts.map +1 -1
- package/dist/cjs/job-application/job-application.schema.d.ts +4 -5
- package/dist/cjs/job-application/job-application.schema.d.ts.map +1 -1
- package/dist/cjs/question/choice-question.schema.js +1 -1
- package/dist/cjs/question/input-question.schema.d.ts +2 -2
- package/dist/cjs/question/input-question.schema.d.ts.map +1 -1
- package/dist/cjs/question/input-question.schema.js +1 -1
- package/dist/cjs/resume/resume.constant.d.ts +0 -1
- package/dist/cjs/resume/resume.constant.d.ts.map +1 -1
- package/dist/cjs/resume/resume.constant.js +0 -1
- package/dist/cjs/resume/resume.schema.d.ts +318 -204
- package/dist/cjs/resume/resume.schema.d.ts.map +1 -1
- package/dist/cjs/resume/resume.schema.js +71 -133
- package/dist/esm/ai/ai.types.d.ts +138 -142
- package/dist/esm/ai/ai.types.d.ts.map +1 -1
- package/dist/esm/interfaces.index.d.ts +947 -494
- package/dist/esm/interfaces.index.d.ts.map +1 -1
- package/dist/esm/job/utils.d.ts +3 -4
- package/dist/esm/job/utils.d.ts.map +1 -1
- package/dist/esm/job-application/job-application.schema.d.ts +4 -5
- package/dist/esm/job-application/job-application.schema.d.ts.map +1 -1
- package/dist/esm/job-application/job-application.schema.js +1 -1
- package/dist/esm/question/choice-question.schema.js +1 -1
- package/dist/esm/question/input-question.schema.d.ts +2 -2
- package/dist/esm/question/input-question.schema.d.ts.map +1 -1
- package/dist/esm/question/input-question.schema.js +1 -1
- package/dist/esm/resume/resume.constant.d.ts +0 -1
- package/dist/esm/resume/resume.constant.d.ts.map +1 -1
- package/dist/esm/resume/resume.constant.js +0 -1
- package/dist/esm/resume/resume.schema.d.ts +318 -204
- package/dist/esm/resume/resume.schema.d.ts.map +1 -1
- package/dist/esm/resume/resume.schema.js +72 -134
- package/package.json +10 -3
|
@@ -1,200 +1,138 @@
|
|
|
1
1
|
import { DbDefaultSchema } from "../common";
|
|
2
|
-
import { UserSchema } from "../user";
|
|
3
|
-
import { array, boolean, lazy, object, string, ValidationError, } from "../yup-extended";
|
|
2
|
+
import { UserGeneralDetailSchema, UserSchema } from "../user";
|
|
3
|
+
import { array, boolean, lazy, object, reach, string, ValidationError, } from "../yup-extended";
|
|
4
4
|
import { ResumeMarkdownStyle, ResumeSectionType, ResumeStatus, SupportedResumeMarkdownStyles, SupportedResumeSectionTypes, SupportedResumeStatuses, } from "./resume.constant";
|
|
5
5
|
{
|
|
6
6
|
/**
|
|
7
7
|
* ResumeGeneralInfoSchema is a schema for the General Information section of a resume.
|
|
8
8
|
*/
|
|
9
9
|
}
|
|
10
|
-
const
|
|
11
|
-
name: object({
|
|
12
|
-
first: string().required().label("First Name"),
|
|
13
|
-
last: string().required().label("Last Name"),
|
|
14
|
-
}),
|
|
15
|
-
headline: string().max(100).optional().label("Headline"),
|
|
16
|
-
email: string().email().required().label("Email"),
|
|
17
|
-
mobile: string().required().label("Mobile"),
|
|
18
|
-
location: string().optional().label("Location"),
|
|
19
|
-
});
|
|
10
|
+
const ResumeGeneralInfoSectionSchema = UserGeneralDetailSchema;
|
|
20
11
|
{
|
|
21
12
|
/**
|
|
22
|
-
*
|
|
13
|
+
* ResumeWorkExperienceSectionSchema is a schema for the Work Experience section of a resume.
|
|
23
14
|
*/
|
|
24
15
|
}
|
|
25
|
-
const
|
|
26
|
-
// export type TResumeSummarySchema = InferType<typeof ResumeSummarySchema>;
|
|
16
|
+
const ResumeWorkExperienceSectionSchema = reach(UserSchema, "workExperiences");
|
|
27
17
|
{
|
|
28
18
|
/**
|
|
29
|
-
*
|
|
19
|
+
* ResumeEducationSectionSchema is a schema for the Education section of a resume.
|
|
30
20
|
*/
|
|
31
21
|
}
|
|
32
|
-
const
|
|
33
|
-
.shape({
|
|
34
|
-
designation: string().required().label("Designation"),
|
|
35
|
-
company: string().required().label("Company"),
|
|
36
|
-
startDate: string().required().label("Start Date"),
|
|
37
|
-
endDate: string().optional().label("End Date"),
|
|
38
|
-
isCurrentJob: boolean().default(false).label("Is Current"),
|
|
39
|
-
description: string().optional().label("Description"),
|
|
40
|
-
location: string().optional().label("Location"),
|
|
41
|
-
isRemote: boolean().default(false).label("Is Remote"),
|
|
42
|
-
})
|
|
43
|
-
.label("Work Experience");
|
|
44
|
-
{
|
|
45
|
-
/**
|
|
46
|
-
* ResumeEducationSchema is a schema for the Education section of a resume.
|
|
47
|
-
*/
|
|
48
|
-
}
|
|
49
|
-
const ResumeEducationSchema = object()
|
|
50
|
-
.shape({
|
|
51
|
-
institute: string().required().label("Institute"),
|
|
52
|
-
course: string().required().label("Course"),
|
|
53
|
-
fieldOfStudy: string().optional().label("Field of Study"),
|
|
54
|
-
startDate: string().required().label("Start Date"),
|
|
55
|
-
endDate: string().optional().label("End Date"),
|
|
56
|
-
location: string().optional().label("Location"),
|
|
57
|
-
isPursuing: boolean().default(false).label("Is Pursuing"),
|
|
58
|
-
isDistanceLearning: boolean().default(false).label("Is Distance Learning"),
|
|
59
|
-
description: string().optional().label("Description"),
|
|
60
|
-
})
|
|
61
|
-
.label("Education");
|
|
22
|
+
const ResumeEducationSectionSchema = reach(UserSchema, "educations");
|
|
62
23
|
{
|
|
63
24
|
/**
|
|
64
|
-
*
|
|
25
|
+
* ResumeSkillSectionSchema is a schema for the Skill section of a resume.
|
|
65
26
|
*/
|
|
66
27
|
}
|
|
67
|
-
const
|
|
68
|
-
.shape({
|
|
69
|
-
name: string().required().label("Name"),
|
|
70
|
-
// TODO: Rename proficiencyLevel to proficiency
|
|
71
|
-
proficiencyLevel: string().optional().label("Proficiency Level"),
|
|
72
|
-
lastUsed: string().optional().label("Last Used"),
|
|
73
|
-
})
|
|
74
|
-
.label("Skill");
|
|
28
|
+
const ResumeSkillSectionSchema = (reach(UserSchema, "skills"));
|
|
75
29
|
{
|
|
76
30
|
/**
|
|
77
|
-
*
|
|
31
|
+
* ResumeProjectSectionSchema is a schema for the Project section of a resume.
|
|
78
32
|
*/
|
|
79
33
|
}
|
|
80
|
-
const
|
|
81
|
-
.shape({
|
|
82
|
-
name: string().required().label("Name"),
|
|
83
|
-
description: string().required().label("Description"),
|
|
84
|
-
startDate: string().required().label("Start Date"),
|
|
85
|
-
endDate: string().optional().label("End Date"),
|
|
86
|
-
isOngoing: boolean().default(false).label("Is Ongoing"),
|
|
87
|
-
link: string().optional().label("Link"),
|
|
88
|
-
})
|
|
89
|
-
.label("Project");
|
|
34
|
+
const ResumeProjectSectionSchema = reach(UserSchema, "projects");
|
|
90
35
|
{
|
|
91
36
|
/**
|
|
92
|
-
*
|
|
37
|
+
* ResumeCertificationSectionSchema is a schema for the Certification section of a resume.
|
|
93
38
|
*/
|
|
94
39
|
}
|
|
95
|
-
const
|
|
96
|
-
.shape({
|
|
97
|
-
name: string().required().label("Name"),
|
|
98
|
-
description: string().optional().label("Description"),
|
|
99
|
-
authority: string().required().label("Authority"),
|
|
100
|
-
startDate: string().required().label("Start Date"),
|
|
101
|
-
endDate: string().optional().label("End Date"),
|
|
102
|
-
isOngoing: boolean().default(false).label("Is Ongoing"),
|
|
103
|
-
})
|
|
104
|
-
.label("Certification");
|
|
40
|
+
const ResumeCertificationSectionSchema = reach(UserSchema, "certifications");
|
|
105
41
|
{
|
|
106
42
|
/**
|
|
107
|
-
*
|
|
43
|
+
* ResumeInterestSectionSchema is a schema for the Interest section of a resume.
|
|
108
44
|
*/
|
|
109
45
|
}
|
|
110
|
-
const
|
|
111
|
-
.shape({
|
|
112
|
-
name: string().required().label("Name"),
|
|
113
|
-
category: string().optional().label("Category"),
|
|
114
|
-
description: string().optional().label("Description"),
|
|
115
|
-
})
|
|
116
|
-
.label("Interest");
|
|
46
|
+
const ResumeInterestSectionSchema = reach(UserSchema, "interests");
|
|
117
47
|
{
|
|
118
48
|
/**
|
|
119
|
-
*
|
|
49
|
+
* ResumeLanguageSectionSchema is a schema for the Language section of a resume.
|
|
120
50
|
*/
|
|
121
51
|
}
|
|
122
|
-
const
|
|
123
|
-
.shape({
|
|
124
|
-
name: string().required().label("Name"),
|
|
125
|
-
proficiency: string().required().label("Proficiency"),
|
|
126
|
-
description: string().optional().label("Description"),
|
|
127
|
-
})
|
|
128
|
-
.label("Language");
|
|
52
|
+
const ResumeLanguageSectionSchema = reach(UserSchema, "languages");
|
|
129
53
|
{
|
|
130
54
|
/**
|
|
131
|
-
*
|
|
55
|
+
* Note: Not supported yet.
|
|
56
|
+
* ResumeAdditionalInfoSectionSchema is a schema for the Additional Information section of a resume.
|
|
132
57
|
*/
|
|
133
58
|
}
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
59
|
+
// const ResumeAdditionalInfoSectionSchema = <
|
|
60
|
+
// ArraySchema<TUserSchema["additionalInfo"], object>
|
|
61
|
+
// >reach(UserSchema, "additionalInfo");
|
|
62
|
+
// export type TResumeAdditionalInfoSectionSchema = InferType<
|
|
63
|
+
// typeof ResumeAdditionalInfoSectionSchema
|
|
64
|
+
// >;
|
|
140
65
|
{
|
|
141
66
|
/**
|
|
67
|
+
* Note: Not supported yet.
|
|
142
68
|
* ResumeReferenceSectionSchema is a schema for a section of a resume.
|
|
143
69
|
*/
|
|
144
70
|
}
|
|
145
|
-
const ResumeReferenceSectionSchema = object()
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
})
|
|
155
|
-
|
|
71
|
+
// const ResumeReferenceSectionSchema = object()
|
|
72
|
+
// .shape({
|
|
73
|
+
// name: string().required().label("Name"),
|
|
74
|
+
// designation: string().required().label("Designation"),
|
|
75
|
+
// company: string().required().label("Company"),
|
|
76
|
+
// email: string().email().required().label("Email"),
|
|
77
|
+
// mobile: string().required().label("Mobile"),
|
|
78
|
+
// profileUrl: string().url().optional().label("Profile URL"),
|
|
79
|
+
// workedDirectly: boolean().default(false).label("Worked Directly"),
|
|
80
|
+
// })
|
|
81
|
+
// .label("Reference Section");
|
|
82
|
+
// export type TResumeReferenceSectionSchema = InferType<
|
|
83
|
+
// typeof ResumeReferenceSectionSchema
|
|
84
|
+
// >;
|
|
156
85
|
{
|
|
157
86
|
/**
|
|
158
|
-
*
|
|
87
|
+
* ResumeSchemaV2 is a lazy schema that dynamically loads the appropriate schema based on the section type.
|
|
159
88
|
*/
|
|
160
89
|
}
|
|
161
|
-
export const
|
|
90
|
+
export const ResumeSchemaV2 = array()
|
|
91
|
+
.of(lazy((section) => {
|
|
162
92
|
const { id } = section;
|
|
163
93
|
return object({
|
|
164
|
-
id: string()
|
|
165
|
-
|
|
166
|
-
.
|
|
94
|
+
id: string()
|
|
95
|
+
.oneOf(SupportedResumeSectionTypes)
|
|
96
|
+
.required()
|
|
97
|
+
.label("Section"),
|
|
98
|
+
data: lazy(() => {
|
|
167
99
|
switch (id) {
|
|
168
100
|
case ResumeSectionType.GeneralInfo:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
return ResumeSummarySchema;
|
|
101
|
+
// GeneralInfo schema is a single object schema, use it directly with null default
|
|
102
|
+
return ResumeGeneralInfoSectionSchema.nullable().default(null);
|
|
172
103
|
case ResumeSectionType.WorkExperience:
|
|
173
|
-
|
|
104
|
+
// WorkExperience schema is already an array schema, use it directly with empty array default
|
|
105
|
+
return ResumeWorkExperienceSectionSchema.default([]);
|
|
174
106
|
case ResumeSectionType.Education:
|
|
175
|
-
|
|
107
|
+
// Education schema is already an array schema, use it directly with empty array default
|
|
108
|
+
return ResumeEducationSectionSchema.default([]);
|
|
176
109
|
case ResumeSectionType.Skill:
|
|
177
|
-
|
|
110
|
+
// Skill schema is already an array schema, use it directly with empty array default
|
|
111
|
+
return ResumeSkillSectionSchema.default([]);
|
|
178
112
|
case ResumeSectionType.Project:
|
|
179
|
-
|
|
113
|
+
// Project schema is already an array schema, use it directly with empty array default
|
|
114
|
+
return ResumeProjectSectionSchema.default([]);
|
|
180
115
|
case ResumeSectionType.Certification:
|
|
181
|
-
|
|
116
|
+
// Certification schema is already an array schema, use it directly with empty array default
|
|
117
|
+
return ResumeCertificationSectionSchema.default([]);
|
|
182
118
|
case ResumeSectionType.Interest:
|
|
183
|
-
|
|
119
|
+
// Interest schema is already an array schema, use it directly with empty array default
|
|
120
|
+
return ResumeInterestSectionSchema.default([]);
|
|
184
121
|
case ResumeSectionType.Language:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
122
|
+
// Language schema is already an array schema, use it directly with empty array default
|
|
123
|
+
return ResumeLanguageSectionSchema.default([]);
|
|
124
|
+
// case ResumeSectionType.AdditionalInfo:
|
|
125
|
+
// // AdditionalInfo schema is already an array schema, use it directly with empty array default
|
|
126
|
+
// return ResumeAdditionalInfoSectionSchema.default([]);
|
|
127
|
+
// case ResumeSectionType.Reference:
|
|
128
|
+
// return array().of(ResumeReferenceSectionSchema).required().label("Data");
|
|
190
129
|
default:
|
|
191
130
|
throw new ValidationError(`Invalid Section Type: ${id}`);
|
|
192
131
|
}
|
|
193
|
-
})
|
|
194
|
-
.required()
|
|
195
|
-
.label("Data"),
|
|
132
|
+
}),
|
|
196
133
|
});
|
|
197
|
-
})
|
|
134
|
+
}))
|
|
135
|
+
.label("Resume Schema V2");
|
|
198
136
|
{
|
|
199
137
|
/**
|
|
200
138
|
* ResumeSchema is a schema for a resume.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thejob/schema",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.34",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"build": "npm run clean && npm run build:cjs && npm run build:esm",
|
|
14
14
|
"postbuild": "npm run generate-interface --stage=interfaceCleanup",
|
|
15
15
|
"test": "jest",
|
|
16
|
-
"lint": "eslint . --max-warnings
|
|
17
|
-
"lint:fix": "eslint --fix --ext .ts,.
|
|
16
|
+
"lint": "eslint . --max-warnings 50",
|
|
17
|
+
"lint:fix": "eslint --fix --ext .ts,.js .",
|
|
18
18
|
"test:watch": "jest --watch",
|
|
19
19
|
"dev": "npm run test:watch"
|
|
20
20
|
},
|
|
@@ -22,9 +22,15 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"devDependencies": {
|
|
25
|
+
"@eslint/js": "^9.33.0",
|
|
25
26
|
"@jest/globals": "^29.7.0",
|
|
26
27
|
"@types/jest": "^29.5.14",
|
|
27
28
|
"@types/validator": "^13.12.2",
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^8.40.0",
|
|
30
|
+
"@typescript-eslint/parser": "^8.40.0",
|
|
31
|
+
"eslint": "^9.33.0",
|
|
32
|
+
"eslint-config-prettier": "^10.1.8",
|
|
33
|
+
"eslint-plugin-only-warn": "^1.1.0",
|
|
28
34
|
"jest": "^29.7.0",
|
|
29
35
|
"nodemon": "^3.1.9",
|
|
30
36
|
"rimraf": "^6.0.1",
|
|
@@ -35,6 +41,7 @@
|
|
|
35
41
|
},
|
|
36
42
|
"dependencies": {
|
|
37
43
|
"dayjs": "^1.11.13",
|
|
44
|
+
"graphql-request": "^7.2.0",
|
|
38
45
|
"mongoose": "^8.11.0",
|
|
39
46
|
"validator": "^13.12.0",
|
|
40
47
|
"yup": "^1.6.1",
|