@thejob/schema 1.0.33 → 1.0.35
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/interfaces.index.d.ts +61 -238
- package/dist/cjs/interfaces.index.d.ts.map +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 +85 -133
- package/dist/esm/interfaces.index.d.ts +61 -238
- package/dist/esm/interfaces.index.d.ts.map +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 +86 -134
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NewResumePromptSchema = exports.ResumeSchema = exports.
|
|
3
|
+
exports.NewResumePromptSchema = exports.ResumeSchema = exports.ResumeSchemaV2 = void 0;
|
|
4
4
|
const common_1 = require("../common");
|
|
5
5
|
const user_1 = require("../user");
|
|
6
6
|
const yup_extended_1 = require("../yup-extended");
|
|
@@ -10,194 +10,146 @@ const resume_constant_1 = require("./resume.constant");
|
|
|
10
10
|
* ResumeGeneralInfoSchema is a schema for the General Information section of a resume.
|
|
11
11
|
*/
|
|
12
12
|
}
|
|
13
|
-
const
|
|
14
|
-
name: (0, yup_extended_1.object)({
|
|
15
|
-
first: (0, yup_extended_1.string)().required().label("First Name"),
|
|
16
|
-
last: (0, yup_extended_1.string)().required().label("Last Name"),
|
|
17
|
-
}),
|
|
18
|
-
headline: (0, yup_extended_1.string)().max(100).optional().label("Headline"),
|
|
19
|
-
email: (0, yup_extended_1.string)().email().required().label("Email"),
|
|
20
|
-
mobile: (0, yup_extended_1.string)().required().label("Mobile"),
|
|
21
|
-
location: (0, yup_extended_1.string)().optional().label("Location"),
|
|
22
|
-
});
|
|
13
|
+
const ResumeGeneralInfoSectionSchema = user_1.UserGeneralDetailSchema;
|
|
23
14
|
{
|
|
24
15
|
/**
|
|
25
|
-
*
|
|
16
|
+
* ResumeWorkExperienceSectionSchema is a schema for the Work Experience section of a resume.
|
|
26
17
|
*/
|
|
27
18
|
}
|
|
28
|
-
const
|
|
29
|
-
// export type TResumeSummarySchema = InferType<typeof ResumeSummarySchema>;
|
|
19
|
+
const ResumeWorkExperienceSectionSchema = (0, yup_extended_1.reach)(user_1.UserSchema, "workExperiences");
|
|
30
20
|
{
|
|
31
21
|
/**
|
|
32
|
-
*
|
|
22
|
+
* ResumeEducationSectionSchema is a schema for the Education section of a resume.
|
|
33
23
|
*/
|
|
34
24
|
}
|
|
35
|
-
const
|
|
36
|
-
.shape({
|
|
37
|
-
designation: (0, yup_extended_1.string)().required().label("Designation"),
|
|
38
|
-
company: (0, yup_extended_1.string)().required().label("Company"),
|
|
39
|
-
startDate: (0, yup_extended_1.string)().required().label("Start Date"),
|
|
40
|
-
endDate: (0, yup_extended_1.string)().optional().label("End Date"),
|
|
41
|
-
isCurrentJob: (0, yup_extended_1.boolean)().default(false).label("Is Current"),
|
|
42
|
-
description: (0, yup_extended_1.string)().optional().label("Description"),
|
|
43
|
-
location: (0, yup_extended_1.string)().optional().label("Location"),
|
|
44
|
-
isRemote: (0, yup_extended_1.boolean)().default(false).label("Is Remote"),
|
|
45
|
-
})
|
|
46
|
-
.label("Work Experience");
|
|
47
|
-
{
|
|
48
|
-
/**
|
|
49
|
-
* ResumeEducationSchema is a schema for the Education section of a resume.
|
|
50
|
-
*/
|
|
51
|
-
}
|
|
52
|
-
const ResumeEducationSchema = (0, yup_extended_1.object)()
|
|
53
|
-
.shape({
|
|
54
|
-
institute: (0, yup_extended_1.string)().required().label("Institute"),
|
|
55
|
-
course: (0, yup_extended_1.string)().required().label("Course"),
|
|
56
|
-
fieldOfStudy: (0, yup_extended_1.string)().optional().label("Field of Study"),
|
|
57
|
-
startDate: (0, yup_extended_1.string)().required().label("Start Date"),
|
|
58
|
-
endDate: (0, yup_extended_1.string)().optional().label("End Date"),
|
|
59
|
-
location: (0, yup_extended_1.string)().optional().label("Location"),
|
|
60
|
-
isPursuing: (0, yup_extended_1.boolean)().default(false).label("Is Pursuing"),
|
|
61
|
-
isDistanceLearning: (0, yup_extended_1.boolean)().default(false).label("Is Distance Learning"),
|
|
62
|
-
description: (0, yup_extended_1.string)().optional().label("Description"),
|
|
63
|
-
})
|
|
64
|
-
.label("Education");
|
|
25
|
+
const ResumeEducationSectionSchema = (0, yup_extended_1.reach)(user_1.UserSchema, "educations");
|
|
65
26
|
{
|
|
66
27
|
/**
|
|
67
|
-
*
|
|
28
|
+
* ResumeSkillSectionSchema is a schema for the Skill section of a resume.
|
|
68
29
|
*/
|
|
69
30
|
}
|
|
70
|
-
const
|
|
71
|
-
.shape({
|
|
72
|
-
name: (0, yup_extended_1.string)().required().label("Name"),
|
|
73
|
-
// TODO: Rename proficiencyLevel to proficiency
|
|
74
|
-
proficiencyLevel: (0, yup_extended_1.string)().optional().label("Proficiency Level"),
|
|
75
|
-
lastUsed: (0, yup_extended_1.string)().optional().label("Last Used"),
|
|
76
|
-
})
|
|
77
|
-
.label("Skill");
|
|
31
|
+
const ResumeSkillSectionSchema = ((0, yup_extended_1.reach)(user_1.UserSchema, "skills"));
|
|
78
32
|
{
|
|
79
33
|
/**
|
|
80
|
-
*
|
|
34
|
+
* ResumeProjectSectionSchema is a schema for the Project section of a resume.
|
|
81
35
|
*/
|
|
82
36
|
}
|
|
83
|
-
const
|
|
84
|
-
.shape({
|
|
85
|
-
name: (0, yup_extended_1.string)().required().label("Name"),
|
|
86
|
-
description: (0, yup_extended_1.string)().required().label("Description"),
|
|
87
|
-
startDate: (0, yup_extended_1.string)().required().label("Start Date"),
|
|
88
|
-
endDate: (0, yup_extended_1.string)().optional().label("End Date"),
|
|
89
|
-
isOngoing: (0, yup_extended_1.boolean)().default(false).label("Is Ongoing"),
|
|
90
|
-
link: (0, yup_extended_1.string)().optional().label("Link"),
|
|
91
|
-
})
|
|
92
|
-
.label("Project");
|
|
37
|
+
const ResumeProjectSectionSchema = (0, yup_extended_1.reach)(user_1.UserSchema, "projects");
|
|
93
38
|
{
|
|
94
39
|
/**
|
|
95
|
-
*
|
|
40
|
+
* ResumeCertificationSectionSchema is a schema for the Certification section of a resume.
|
|
96
41
|
*/
|
|
97
42
|
}
|
|
98
|
-
const
|
|
99
|
-
.shape({
|
|
100
|
-
name: (0, yup_extended_1.string)().required().label("Name"),
|
|
101
|
-
description: (0, yup_extended_1.string)().optional().label("Description"),
|
|
102
|
-
authority: (0, yup_extended_1.string)().required().label("Authority"),
|
|
103
|
-
startDate: (0, yup_extended_1.string)().required().label("Start Date"),
|
|
104
|
-
endDate: (0, yup_extended_1.string)().optional().label("End Date"),
|
|
105
|
-
isOngoing: (0, yup_extended_1.boolean)().default(false).label("Is Ongoing"),
|
|
106
|
-
})
|
|
107
|
-
.label("Certification");
|
|
43
|
+
const ResumeCertificationSectionSchema = (0, yup_extended_1.reach)(user_1.UserSchema, "certifications");
|
|
108
44
|
{
|
|
109
45
|
/**
|
|
110
|
-
*
|
|
46
|
+
* ResumeInterestSectionSchema is a schema for the Interest section of a resume.
|
|
111
47
|
*/
|
|
112
48
|
}
|
|
113
|
-
const
|
|
114
|
-
.shape({
|
|
115
|
-
name: (0, yup_extended_1.string)().required().label("Name"),
|
|
116
|
-
category: (0, yup_extended_1.string)().optional().label("Category"),
|
|
117
|
-
description: (0, yup_extended_1.string)().optional().label("Description"),
|
|
118
|
-
})
|
|
119
|
-
.label("Interest");
|
|
49
|
+
const ResumeInterestSectionSchema = (0, yup_extended_1.reach)(user_1.UserSchema, "interests");
|
|
120
50
|
{
|
|
121
51
|
/**
|
|
122
|
-
*
|
|
52
|
+
* ResumeLanguageSectionSchema is a schema for the Language section of a resume.
|
|
123
53
|
*/
|
|
124
54
|
}
|
|
125
|
-
const
|
|
126
|
-
.shape({
|
|
127
|
-
name: (0, yup_extended_1.string)().required().label("Name"),
|
|
128
|
-
proficiency: (0, yup_extended_1.string)().required().label("Proficiency"),
|
|
129
|
-
description: (0, yup_extended_1.string)().optional().label("Description"),
|
|
130
|
-
})
|
|
131
|
-
.label("Language");
|
|
55
|
+
const ResumeLanguageSectionSchema = (0, yup_extended_1.reach)(user_1.UserSchema, "languages");
|
|
132
56
|
{
|
|
133
57
|
/**
|
|
134
|
-
*
|
|
58
|
+
* Note: Not supported yet.
|
|
59
|
+
* ResumeAdditionalInfoSectionSchema is a schema for the Additional Information section of a resume.
|
|
135
60
|
*/
|
|
136
61
|
}
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
62
|
+
// const ResumeAdditionalInfoSectionSchema = <
|
|
63
|
+
// ArraySchema<TUserSchema["additionalInfo"], object>
|
|
64
|
+
// >reach(UserSchema, "additionalInfo");
|
|
65
|
+
// export type TResumeAdditionalInfoSectionSchema = InferType<
|
|
66
|
+
// typeof ResumeAdditionalInfoSectionSchema
|
|
67
|
+
// >;
|
|
143
68
|
{
|
|
144
69
|
/**
|
|
70
|
+
* Note: Not supported yet.
|
|
145
71
|
* ResumeReferenceSectionSchema is a schema for a section of a resume.
|
|
146
72
|
*/
|
|
147
73
|
}
|
|
148
|
-
const ResumeReferenceSectionSchema =
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
})
|
|
158
|
-
|
|
74
|
+
// const ResumeReferenceSectionSchema = object()
|
|
75
|
+
// .shape({
|
|
76
|
+
// name: string().required().label("Name"),
|
|
77
|
+
// designation: string().required().label("Designation"),
|
|
78
|
+
// company: string().required().label("Company"),
|
|
79
|
+
// email: string().email().required().label("Email"),
|
|
80
|
+
// mobile: string().required().label("Mobile"),
|
|
81
|
+
// profileUrl: string().url().optional().label("Profile URL"),
|
|
82
|
+
// workedDirectly: boolean().default(false).label("Worked Directly"),
|
|
83
|
+
// })
|
|
84
|
+
// .label("Reference Section");
|
|
85
|
+
// export type TResumeReferenceSectionSchema = InferType<
|
|
86
|
+
// typeof ResumeReferenceSectionSchema
|
|
87
|
+
// >;
|
|
159
88
|
{
|
|
160
89
|
/**
|
|
161
|
-
*
|
|
90
|
+
* ResumeSchemaV2 is a lazy schema that dynamically loads the appropriate schema based on the section type.
|
|
162
91
|
*/
|
|
163
92
|
}
|
|
164
|
-
exports.
|
|
93
|
+
exports.ResumeSchemaV2 = (0, yup_extended_1.array)()
|
|
94
|
+
.of((0, yup_extended_1.lazy)((section) => {
|
|
165
95
|
const { id } = section;
|
|
166
96
|
return (0, yup_extended_1.object)({
|
|
167
|
-
id: (0, yup_extended_1.string)()
|
|
168
|
-
|
|
169
|
-
.
|
|
97
|
+
id: (0, yup_extended_1.string)()
|
|
98
|
+
.oneOf(resume_constant_1.SupportedResumeSectionTypes)
|
|
99
|
+
.required()
|
|
100
|
+
.label("Section"),
|
|
101
|
+
data: (0, yup_extended_1.lazy)(() => {
|
|
170
102
|
switch (id) {
|
|
171
103
|
case resume_constant_1.ResumeSectionType.GeneralInfo:
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
return ResumeSummarySchema;
|
|
104
|
+
// GeneralInfo schema is a single object schema, use it directly with null default
|
|
105
|
+
return ResumeGeneralInfoSectionSchema.nullable().default(null);
|
|
175
106
|
case resume_constant_1.ResumeSectionType.WorkExperience:
|
|
176
|
-
|
|
107
|
+
// WorkExperience schema is already an array schema, use it directly with empty array default
|
|
108
|
+
return ResumeWorkExperienceSectionSchema.default([]);
|
|
177
109
|
case resume_constant_1.ResumeSectionType.Education:
|
|
178
|
-
|
|
110
|
+
// Education schema is already an array schema, use it directly with empty array default
|
|
111
|
+
return ResumeEducationSectionSchema.default([]);
|
|
179
112
|
case resume_constant_1.ResumeSectionType.Skill:
|
|
180
|
-
|
|
113
|
+
// Skill schema is already an array schema, use it directly with empty array default
|
|
114
|
+
return ResumeSkillSectionSchema.default([]);
|
|
181
115
|
case resume_constant_1.ResumeSectionType.Project:
|
|
182
|
-
|
|
116
|
+
// Project schema is already an array schema, use it directly with empty array default
|
|
117
|
+
return ResumeProjectSectionSchema.default([]);
|
|
183
118
|
case resume_constant_1.ResumeSectionType.Certification:
|
|
184
|
-
|
|
119
|
+
// Certification schema is already an array schema, use it directly with empty array default
|
|
120
|
+
return ResumeCertificationSectionSchema.default([]);
|
|
185
121
|
case resume_constant_1.ResumeSectionType.Interest:
|
|
186
|
-
|
|
122
|
+
// Interest schema is already an array schema, use it directly with empty array default
|
|
123
|
+
return ResumeInterestSectionSchema.default([]);
|
|
187
124
|
case resume_constant_1.ResumeSectionType.Language:
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
125
|
+
// Language schema is already an array schema, use it directly with empty array default
|
|
126
|
+
return ResumeLanguageSectionSchema.default([]);
|
|
127
|
+
// case ResumeSectionType.AdditionalInfo:
|
|
128
|
+
// // AdditionalInfo schema is already an array schema, use it directly with empty array default
|
|
129
|
+
// return ResumeAdditionalInfoSectionSchema.default([]);
|
|
130
|
+
// case ResumeSectionType.Reference:
|
|
131
|
+
// return array().of(ResumeReferenceSectionSchema).required().label("Data");
|
|
193
132
|
default:
|
|
194
133
|
throw new yup_extended_1.ValidationError(`Invalid Section Type: ${id}`);
|
|
195
134
|
}
|
|
196
|
-
})
|
|
197
|
-
.required()
|
|
198
|
-
.label("Data"),
|
|
135
|
+
}),
|
|
199
136
|
});
|
|
200
|
-
})
|
|
137
|
+
}))
|
|
138
|
+
.required()
|
|
139
|
+
.default([])
|
|
140
|
+
.label("Resume Schema V2");
|
|
141
|
+
// export type TResumeSectionMap = {
|
|
142
|
+
// [ResumeSectionType.GeneralInfo]: TResumeGeneralInfoSectionSchema;
|
|
143
|
+
// [ResumeSectionType.WorkExperience]: TResumeWorkExperienceSectionSchema;
|
|
144
|
+
// [ResumeSectionType.Education]: TResumeEducationSectionSchema;
|
|
145
|
+
// [ResumeSectionType.Skill]: TResumeSkillSectionSchema;
|
|
146
|
+
// [ResumeSectionType.Project]: TResumeProjectSectionSchema;
|
|
147
|
+
// [ResumeSectionType.Certification]: TResumeCertificationSectionSchema;
|
|
148
|
+
// [ResumeSectionType.Interest]: TResumeInterestSectionSchema;
|
|
149
|
+
// [ResumeSectionType.Language]: TResumeLanguageSectionSchema;
|
|
150
|
+
// // [ResumeSectionType.AdditionalInfo]: TResumeAdditionalInfoSectionSchema;
|
|
151
|
+
// // [ResumeSectionType.Reference]: TResumeReferenceSectionSchema;
|
|
152
|
+
// };
|
|
201
153
|
{
|
|
202
154
|
/**
|
|
203
155
|
* ResumeSchema is a schema for a resume.
|