@thejob/schema 1.0.35 → 1.0.37
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 +290 -0
- package/dist/cjs/interfaces.index.d.ts.map +1 -1
- package/dist/cjs/resume/resume.schema.d.ts +279 -258
- package/dist/cjs/resume/resume.schema.d.ts.map +1 -1
- package/dist/cjs/resume/resume.schema.js +57 -48
- package/dist/esm/interfaces.index.d.ts +290 -0
- package/dist/esm/interfaces.index.d.ts.map +1 -1
- package/dist/esm/resume/resume.schema.d.ts +279 -258
- package/dist/esm/resume/resume.schema.d.ts.map +1 -1
- package/dist/esm/resume/resume.schema.js +57 -48
- package/package.json +1 -1
|
@@ -87,54 +87,63 @@ const ResumeLanguageSectionSchema = reach(UserSchema, "languages");
|
|
|
87
87
|
* ResumeSchemaV2 is a lazy schema that dynamically loads the appropriate schema based on the section type.
|
|
88
88
|
*/
|
|
89
89
|
}
|
|
90
|
-
export const ResumeSchemaV2 =
|
|
91
|
-
.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
})
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
90
|
+
export const ResumeSchemaV2 = object()
|
|
91
|
+
.shape({
|
|
92
|
+
userId: string().objectId().required().label("User ID"),
|
|
93
|
+
slug: string().required().label("Slug"),
|
|
94
|
+
sections: array()
|
|
95
|
+
.of(lazy((section) => {
|
|
96
|
+
const { id } = section;
|
|
97
|
+
return object({
|
|
98
|
+
id: string()
|
|
99
|
+
.oneOf(SupportedResumeSectionTypes)
|
|
100
|
+
.required()
|
|
101
|
+
.label("Section"),
|
|
102
|
+
data: lazy(() => {
|
|
103
|
+
switch (id) {
|
|
104
|
+
case ResumeSectionType.GeneralInfo:
|
|
105
|
+
// GeneralInfo schema is a single object schema, use it directly with null default
|
|
106
|
+
return ResumeGeneralInfoSectionSchema.nullable().default(null);
|
|
107
|
+
case ResumeSectionType.WorkExperience:
|
|
108
|
+
// WorkExperience schema is already an array schema, use it directly with empty array default
|
|
109
|
+
return ResumeWorkExperienceSectionSchema.default([]);
|
|
110
|
+
case ResumeSectionType.Education:
|
|
111
|
+
// Education schema is already an array schema, use it directly with empty array default
|
|
112
|
+
return ResumeEducationSectionSchema.default([]);
|
|
113
|
+
case ResumeSectionType.Skill:
|
|
114
|
+
// Skill schema is already an array schema, use it directly with empty array default
|
|
115
|
+
return ResumeSkillSectionSchema.default([]);
|
|
116
|
+
case ResumeSectionType.Project:
|
|
117
|
+
// Project schema is already an array schema, use it directly with empty array default
|
|
118
|
+
return ResumeProjectSectionSchema.default([]);
|
|
119
|
+
case ResumeSectionType.Certification:
|
|
120
|
+
// Certification schema is already an array schema, use it directly with empty array default
|
|
121
|
+
return ResumeCertificationSectionSchema.default([]);
|
|
122
|
+
case ResumeSectionType.Interest:
|
|
123
|
+
// Interest schema is already an array schema, use it directly with empty array default
|
|
124
|
+
return ResumeInterestSectionSchema.default([]);
|
|
125
|
+
case ResumeSectionType.Language:
|
|
126
|
+
// Language schema is already an array schema, use it directly with empty array default
|
|
127
|
+
return ResumeLanguageSectionSchema.default([]);
|
|
128
|
+
// case ResumeSectionType.AdditionalInfo:
|
|
129
|
+
// // AdditionalInfo schema is already an array schema, use it directly with empty array default
|
|
130
|
+
// return ResumeAdditionalInfoSectionSchema.default([]);
|
|
131
|
+
// case ResumeSectionType.Reference:
|
|
132
|
+
// return array().of(ResumeReferenceSectionSchema).required().label("Data");
|
|
133
|
+
default:
|
|
134
|
+
throw new ValidationError(`Invalid Section Type: ${id}`);
|
|
135
|
+
}
|
|
136
|
+
}),
|
|
137
|
+
});
|
|
138
|
+
}))
|
|
139
|
+
.required()
|
|
140
|
+
.default([])
|
|
141
|
+
.label("Resume sections"),
|
|
142
|
+
})
|
|
143
|
+
.concat(DbDefaultSchema)
|
|
144
|
+
.noUnknown()
|
|
145
|
+
.strict()
|
|
146
|
+
.label("Resume V2 Schema");
|
|
138
147
|
// export type TResumeSectionMap = {
|
|
139
148
|
// [ResumeSectionType.GeneralInfo]: TResumeGeneralInfoSectionSchema;
|
|
140
149
|
// [ResumeSectionType.WorkExperience]: TResumeWorkExperienceSectionSchema;
|