@thejob/schema 1.0.40 → 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.
@@ -259,7 +259,7 @@ export declare const JobSchema: ObjectSchema<{
259
259
  description: undefined;
260
260
  descriptionMarkdown: undefined;
261
261
  descriptionHTML: undefined;
262
- locations: "";
262
+ locations: never[];
263
263
  educationLevel: undefined;
264
264
  validity: any;
265
265
  experienceLevel: undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"job.schema.d.ts","sourceRoot":"","sources":["../../../src/job/job.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAW7B,MAAM,WAAW,CAAC;AAInB,OAAO,EACL,YAAY,EAKb,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,SAAS,EAKT,YAAY,EAEb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAwB,MAAM,gBAAgB,CAAC;AAGjE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqZP,CAAC;AAEhB,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC"}
1
+ {"version":3,"file":"job.schema.d.ts","sourceRoot":"","sources":["../../../src/job/job.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAW7B,MAAM,WAAW,CAAC;AAInB,OAAO,EACL,YAAY,EAKb,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,SAAS,EAKT,YAAY,EAEb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAwB,MAAM,gBAAgB,CAAC;AAGjE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgZP,CAAC;AAEhB,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC"}
@@ -9,8 +9,7 @@ const question_1 = require("../question");
9
9
  const yup_extended_1 = require("../yup-extended");
10
10
  const job_constant_1 = require("./job.constant");
11
11
  const utils_1 = require("./utils");
12
- exports.JobSchema = (0, yup_extended_1.object)()
13
- .shape({
12
+ exports.JobSchema = (0, yup_extended_1.object)({
14
13
  /*
15
14
  * Job headline defines the title of the job post.
16
15
  * It is required and should be a string with a minimum length of 10 characters and a maximum length of 100 characters.
@@ -61,6 +60,7 @@ exports.JobSchema = (0, yup_extended_1.object)()
61
60
  .required()
62
61
  .label("Company"),
63
62
  /*
63
+ * @deprecated: This field is deprecated and will be removed in future versions.
64
64
  * This property is required and can be used to specify the designation associated with the job post.
65
65
  * It can be a predefined designation (NameIdLogoSchema) or an other value (OtherValueSchema).
66
66
  * The value should be an object with name, id, and logo properties.
@@ -86,6 +86,7 @@ exports.JobSchema = (0, yup_extended_1.object)()
86
86
  * It is useful for jobs that require specific skills, such as programming languages, frameworks, etc.
87
87
  * The value should be an array of skills, each skill can be a predefined skill (NameIdLogoSchema) or an other value (OtherValueSchema).
88
88
  *
89
+ * TODO: Make this field as array of string.
89
90
  * TODO: Add knockout skills that if not present in the application should immediately disqualify the application.
90
91
  */
91
92
  skills: (0, yup_extended_1.array)()
@@ -100,10 +101,7 @@ exports.JobSchema = (0, yup_extended_1.object)()
100
101
  * This field will store the information about users who have bookmarked the job post.
101
102
  * It is optional and can be used to track the users who are interested in the job
102
103
  */
103
- bookmarks: (0, yup_extended_1.array)()
104
- .of(common_1.UserIdAndCreatedAtSchema)
105
- .optional()
106
- .label("Bookmarks"),
104
+ bookmarks: (0, yup_extended_1.array)().of(common_1.UserIdAndCreatedAtSchema).optional().label("Bookmarks"),
107
105
  /*
108
106
  * This field will store the information about users who have applied for the job post using Direct/Quick Apply feature.
109
107
  * It is optional and can be used to track the users who have applied for the job.
@@ -166,13 +164,15 @@ exports.JobSchema = (0, yup_extended_1.object)()
166
164
  * This section is required and can be used to specify the location of the job.
167
165
  * It is useful for jobs that are location-specific, such as on-site jobs.
168
166
  * The value should be an array of locations.
169
- *
170
167
  * NOTE: Location is also required even if the job is remote, This is to comply with compliance and legal requirements.
168
+ *
169
+ * TODO: Make this field optional in the future.
171
170
  */
172
171
  locations: (0, yup_extended_1.array)()
173
172
  .of(location_1.LocationSchema)
174
- .required()
175
- .min(1)
173
+ .default([])
174
+ // .required()
175
+ // .min(1)
176
176
  .label("Location"),
177
177
  /*
178
178
  * Educational level section
@@ -272,9 +272,8 @@ exports.JobSchema = (0, yup_extended_1.object)()
272
272
  * This is optional and can be used to improve the visibility of the job post in search engines.
273
273
  * It includes meta tags for description and keywords.
274
274
  */
275
- seoTags: (0, yup_extended_1.object)()
276
- .shape({
277
- meta: (0, yup_extended_1.object)().shape({
275
+ seoTags: (0, yup_extended_1.object)({
276
+ meta: (0, yup_extended_1.object)({
278
277
  description: (0, yup_extended_1.string)().optional().label("Description"),
279
278
  keywords: (0, yup_extended_1.array)().of((0, yup_extended_1.string)()).optional().label("Keywords"),
280
279
  }),
@@ -332,8 +331,7 @@ exports.JobSchema = (0, yup_extended_1.object)()
332
331
  * This is optional and can be used to specify the salary range for the job.
333
332
  * It includes currency, minimum, and maximum salary.
334
333
  */
335
- salaryRange: (0, yup_extended_1.object)()
336
- .shape({
334
+ salaryRange: (0, yup_extended_1.object)({
337
335
  currency: (0, yup_extended_1.string)().required().label("Currency").default("USD"), // Default to USD if not provided
338
336
  min: (0, yup_extended_1.number)().optional().min(0).label("Minimum Salary"),
339
337
  max: (0, yup_extended_1.number)().optional().min(0).label("Maximum Salary"),
@@ -341,10 +339,7 @@ exports.JobSchema = (0, yup_extended_1.object)()
341
339
  .oneOf(common_1.SupportedCompensationTypes)
342
340
  .required()
343
341
  .label("Compensation Type"),
344
- isNegotiable: (0, yup_extended_1.boolean)()
345
- .optional()
346
- .default(false)
347
- .label("Is Negotiable"),
342
+ isNegotiable: (0, yup_extended_1.boolean)().optional().default(false).label("Is Negotiable"),
348
343
  })
349
344
  .default(undefined)
350
345
  .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;
@@ -259,7 +259,7 @@ export declare const JobSchema: ObjectSchema<{
259
259
  description: undefined;
260
260
  descriptionMarkdown: undefined;
261
261
  descriptionHTML: undefined;
262
- locations: "";
262
+ locations: never[];
263
263
  educationLevel: undefined;
264
264
  validity: any;
265
265
  experienceLevel: undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"job.schema.d.ts","sourceRoot":"","sources":["../../../src/job/job.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAW7B,MAAM,WAAW,CAAC;AAInB,OAAO,EACL,YAAY,EAKb,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,SAAS,EAKT,YAAY,EAEb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAwB,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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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thejob/schema",
3
- "version": "1.0.40",
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",