@thejob/schema 1.0.39 → 1.0.41

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.
Files changed (37) hide show
  1. package/dist/cjs/design-and-font/design-and-font.schema.d.ts +46 -0
  2. package/dist/cjs/design-and-font/design-and-font.schema.d.ts.map +1 -0
  3. package/dist/cjs/design-and-font/design-and-font.schema.js +28 -0
  4. package/dist/cjs/design-and-font/index.d.ts +2 -0
  5. package/dist/cjs/design-and-font/index.d.ts.map +1 -0
  6. package/dist/cjs/design-and-font/index.js +17 -0
  7. package/dist/cjs/index.d.ts +1 -0
  8. package/dist/cjs/index.d.ts.map +1 -1
  9. package/dist/cjs/index.js +1 -0
  10. package/dist/cjs/interfaces.index.d.ts +43 -0
  11. package/dist/cjs/interfaces.index.d.ts.map +1 -1
  12. package/dist/cjs/job/job.schema.d.ts +1 -1
  13. package/dist/cjs/job/job.schema.d.ts.map +1 -1
  14. package/dist/cjs/job/job.schema.js +13 -18
  15. package/dist/cjs/job-role-template/job-role-template.schema.d.ts +1 -1
  16. package/dist/cjs/resume/resume.schema.d.ts +26 -0
  17. package/dist/cjs/resume/resume.schema.d.ts.map +1 -1
  18. package/dist/cjs/resume/resume.schema.js +2 -0
  19. package/dist/esm/design-and-font/design-and-font.schema.d.ts +46 -0
  20. package/dist/esm/design-and-font/design-and-font.schema.d.ts.map +1 -0
  21. package/dist/esm/design-and-font/design-and-font.schema.js +25 -0
  22. package/dist/esm/design-and-font/index.d.ts +2 -0
  23. package/dist/esm/design-and-font/index.d.ts.map +1 -0
  24. package/dist/esm/design-and-font/index.js +1 -0
  25. package/dist/esm/index.d.ts +1 -0
  26. package/dist/esm/index.d.ts.map +1 -1
  27. package/dist/esm/index.js +1 -0
  28. package/dist/esm/interfaces.index.d.ts +43 -0
  29. package/dist/esm/interfaces.index.d.ts.map +1 -1
  30. package/dist/esm/job/job.schema.d.ts +1 -1
  31. package/dist/esm/job/job.schema.d.ts.map +1 -1
  32. package/dist/esm/job/job.schema.js +13 -18
  33. package/dist/esm/job-role-template/job-role-template.schema.d.ts +1 -1
  34. package/dist/esm/resume/resume.schema.d.ts +26 -0
  35. package/dist/esm/resume/resume.schema.d.ts.map +1 -1
  36. package/dist/esm/resume/resume.schema.js +2 -0
  37. package/package.json +1 -1
@@ -6,8 +6,7 @@ import { QuestionType, } from "../question";
6
6
  import { array, boolean, lazy, mixed, number, object, string, } from "../yup-extended";
7
7
  import { JobStatus, SupportedJobStatuses } from "./job.constant";
8
8
  import { getSchemaByQuestion } from "./utils";
9
- export const JobSchema = object()
10
- .shape({
9
+ export const JobSchema = object({
11
10
  /*
12
11
  * Job headline defines the title of the job post.
13
12
  * It is required and should be a string with a minimum length of 10 characters and a maximum length of 100 characters.
@@ -58,6 +57,7 @@ export const JobSchema = object()
58
57
  .required()
59
58
  .label("Company"),
60
59
  /*
60
+ * @deprecated: This field is deprecated and will be removed in future versions.
61
61
  * This property is required and can be used to specify the designation associated with the job post.
62
62
  * It can be a predefined designation (NameIdLogoSchema) or an other value (OtherValueSchema).
63
63
  * The value should be an object with name, id, and logo properties.
@@ -83,6 +83,7 @@ export const JobSchema = object()
83
83
  * It is useful for jobs that require specific skills, such as programming languages, frameworks, etc.
84
84
  * The value should be an array of skills, each skill can be a predefined skill (NameIdLogoSchema) or an other value (OtherValueSchema).
85
85
  *
86
+ * TODO: Make this field as array of string.
86
87
  * TODO: Add knockout skills that if not present in the application should immediately disqualify the application.
87
88
  */
88
89
  skills: array()
@@ -97,10 +98,7 @@ export const JobSchema = object()
97
98
  * This field will store the information about users who have bookmarked the job post.
98
99
  * It is optional and can be used to track the users who are interested in the job
99
100
  */
100
- bookmarks: array()
101
- .of(UserIdAndCreatedAtSchema)
102
- .optional()
103
- .label("Bookmarks"),
101
+ bookmarks: array().of(UserIdAndCreatedAtSchema).optional().label("Bookmarks"),
104
102
  /*
105
103
  * This field will store the information about users who have applied for the job post using Direct/Quick Apply feature.
106
104
  * It is optional and can be used to track the users who have applied for the job.
@@ -163,13 +161,15 @@ export const JobSchema = object()
163
161
  * This section is required and can be used to specify the location of the job.
164
162
  * It is useful for jobs that are location-specific, such as on-site jobs.
165
163
  * The value should be an array of locations.
166
- *
167
164
  * NOTE: Location is also required even if the job is remote, This is to comply with compliance and legal requirements.
165
+ *
166
+ * TODO: Make this field optional in the future.
168
167
  */
169
168
  locations: array()
170
169
  .of(LocationSchema)
171
- .required()
172
- .min(1)
170
+ .default([])
171
+ // .required()
172
+ // .min(1)
173
173
  .label("Location"),
174
174
  /*
175
175
  * Educational level section
@@ -269,9 +269,8 @@ export const JobSchema = object()
269
269
  * This is optional and can be used to improve the visibility of the job post in search engines.
270
270
  * It includes meta tags for description and keywords.
271
271
  */
272
- seoTags: object()
273
- .shape({
274
- meta: object().shape({
272
+ seoTags: object({
273
+ meta: object({
275
274
  description: string().optional().label("Description"),
276
275
  keywords: array().of(string()).optional().label("Keywords"),
277
276
  }),
@@ -329,8 +328,7 @@ export const JobSchema = object()
329
328
  * This is optional and can be used to specify the salary range for the job.
330
329
  * It includes currency, minimum, and maximum salary.
331
330
  */
332
- salaryRange: object()
333
- .shape({
331
+ salaryRange: object({
334
332
  currency: string().required().label("Currency").default("USD"), // Default to USD if not provided
335
333
  min: number().optional().min(0).label("Minimum Salary"),
336
334
  max: number().optional().min(0).label("Maximum Salary"),
@@ -338,10 +336,7 @@ export const JobSchema = object()
338
336
  .oneOf(SupportedCompensationTypes)
339
337
  .required()
340
338
  .label("Compensation Type"),
341
- isNegotiable: boolean()
342
- .optional()
343
- .default(false)
344
- .label("Is Negotiable"),
339
+ isNegotiable: boolean().optional().default(false).label("Is Negotiable"),
345
340
  })
346
341
  .default(undefined)
347
342
  .optional()
@@ -117,7 +117,7 @@ export declare const JobRoleTemplateSchema: import("yup").ObjectSchema<{
117
117
  description: undefined;
118
118
  descriptionMarkdown: undefined;
119
119
  descriptionHTML: undefined;
120
- locations: "";
120
+ locations: never[];
121
121
  educationLevel: undefined;
122
122
  validity: any;
123
123
  experienceLevel: undefined;
@@ -70,6 +70,23 @@ export type TResumeSocialAccountSectionSchema = InferType<typeof ResumeSocialAcc
70
70
  export declare const ResumeSchemaV2: import("yup").ObjectSchema<{
71
71
  userId: string;
72
72
  slug: string;
73
+ styles: {
74
+ pageMargin: number;
75
+ sectionSpacing: number;
76
+ baseColor: string;
77
+ fontStyle: string;
78
+ fontSize: number;
79
+ lineHeight: number;
80
+ background: {
81
+ height?: string | number | undefined;
82
+ width?: string | number | undefined;
83
+ top?: number | undefined;
84
+ right?: number | undefined;
85
+ bottom?: number | undefined;
86
+ left?: number | undefined;
87
+ image: string;
88
+ }[];
89
+ };
73
90
  sections: {
74
91
  id: NonNullable<ResumeSectionType | undefined>;
75
92
  data: {
@@ -366,6 +383,15 @@ export declare const ResumeSchemaV2: import("yup").ObjectSchema<{
366
383
  }, import("yup").AnyObject, {
367
384
  userId: undefined;
368
385
  slug: undefined;
386
+ styles: {
387
+ pageMargin: 10;
388
+ sectionSpacing: 10;
389
+ baseColor: "blue";
390
+ fontStyle: "Roboto";
391
+ fontSize: 12;
392
+ lineHeight: 1.15;
393
+ background: never[];
394
+ };
369
395
  sections: never[];
370
396
  id: undefined;
371
397
  shortId: undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"resume.schema.d.ts","sourceRoot":"","sources":["../../../src/resume/resume.schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAuC,MAAM,SAAS,CAAC;AAC3E,OAAO,EAEL,WAAW,EAEX,SAAS,EAMV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EAIb,MAAM,mBAAmB,CAAC;AAO3B,QAAA,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAA0B,CAAC;AAE/D,MAAM,MAAM,+BAA+B,GAAG,SAAS,CACrD,OAAO,8BAA8B,CACtC,CAAC;AAOF,QAAA,MAAM,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Y;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BA,CAAC;AAE1B,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC,OAAO,YAAY,CAAC,CAAC;AAE3D,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAuBb,CAAC;AAEvC,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { DbDefaultSchema } from "../common";
2
+ import { DesignAndFontSchema } from "../design-and-font";
2
3
  import { UserGeneralDetailSchema, UserSchema } from "../user";
3
4
  import { array, boolean, lazy, object, reach, string, ValidationError, } from "../yup-extended";
4
5
  import { ResumeMarkdownStyle, ResumeSectionType, ResumeStatus, SupportedResumeMarkdownStyles, SupportedResumeSectionTypes, SupportedResumeStatuses, } from "./resume.constant";
@@ -92,6 +93,7 @@ export const ResumeSchemaV2 = object()
92
93
  .shape({
93
94
  userId: string().objectId().required().label("User ID"),
94
95
  slug: string().required().label("Slug"),
96
+ styles: DesignAndFontSchema.required().label("Design and Font"),
95
97
  sections: array()
96
98
  .of(lazy((section) => {
97
99
  const { id } = section;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thejob/schema",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/esm/index.d.ts",