@thejob/schema 2.0.1 → 2.0.3
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/.claude/scheduled_tasks.lock +1 -0
- package/dist/index.cjs +511 -141
- package/dist/index.d.cts +562 -86
- package/dist/index.d.ts +562 -86
- package/dist/index.js +479 -138
- package/package.json +1 -1
- package/src/common/common.constant.ts +30 -0
- package/src/common/common.schema.ts +14 -0
- package/src/index.ts +11 -0
- package/src/job/job.constant.ts +66 -0
- package/src/job/job.schema.ts +256 -0
- package/src/question/choice-question.schema.ts +96 -0
- package/src/question/index.ts +6 -0
- package/src/question/input-question.schema.ts +24 -0
- package/src/question/question.constant.ts +14 -0
- package/src/question/question.schema.ts +22 -0
- package/src/question/question.utils.ts +23 -0
- package/src/question/read-and-acknowledge.schema.ts +25 -0
package/dist/index.js
CHANGED
|
@@ -15,8 +15,34 @@ var CompletenessScoreSchema = (minScore = 50) => object().shape({
|
|
|
15
15
|
totalSteps: number().min(0).default(0).label("Total Steps"),
|
|
16
16
|
completedSteps: number().min(0).default(0).label("Completed Steps")
|
|
17
17
|
});
|
|
18
|
+
var UserIdAndCreatedAtSchema = object().shape({
|
|
19
|
+
userId: string().required().label("User Id"),
|
|
20
|
+
createdAt: string().required().label("Created At")
|
|
21
|
+
});
|
|
18
22
|
|
|
19
23
|
// src/common/common.constant.ts
|
|
24
|
+
var Common = /* @__PURE__ */ ((Common2) => {
|
|
25
|
+
Common2["Yes"] = "yes";
|
|
26
|
+
Common2["No"] = "no";
|
|
27
|
+
Common2["DateRangeOption"] = "date_range_option";
|
|
28
|
+
Common2["ExperienceLevel"] = "experience_level";
|
|
29
|
+
Common2["Company"] = "company";
|
|
30
|
+
Common2["EmploymentType"] = "employment_type";
|
|
31
|
+
Common2["WorkMode"] = "work_mode";
|
|
32
|
+
Common2["Location"] = "location";
|
|
33
|
+
Common2["CareerLevel"] = "career_level";
|
|
34
|
+
Common2["Category"] = "category";
|
|
35
|
+
Common2["Designation"] = "designation";
|
|
36
|
+
Common2["EducationLevel"] = "education_level";
|
|
37
|
+
Common2["Language"] = "language";
|
|
38
|
+
Common2["Skill"] = "skill";
|
|
39
|
+
return Common2;
|
|
40
|
+
})(Common || {});
|
|
41
|
+
var EMPTY_STRING = "eMpTyStRiNg";
|
|
42
|
+
var SYSTEM_DATE_FORMAT = "YYYY-MM-DD";
|
|
43
|
+
var DISPLAY_DATE_FORMAT = "LL";
|
|
44
|
+
var DISPLAY_DATE_FORMAT_SHORT = "MMMM, YYYY";
|
|
45
|
+
var SITEMAP_FORMAT = "YYYY-MM-DDThh:mm:ssZ";
|
|
20
46
|
var StudyType = /* @__PURE__ */ ((StudyType2) => {
|
|
21
47
|
StudyType2["FullTime"] = "full_time";
|
|
22
48
|
StudyType2["PartTime"] = "part_time";
|
|
@@ -198,6 +224,9 @@ var GroupMembershipSchema = object3({
|
|
|
198
224
|
updatedAt: number2().optional().label("Updated At")
|
|
199
225
|
});
|
|
200
226
|
|
|
227
|
+
// src/job/job.schema.ts
|
|
228
|
+
import { array as array8, boolean as boolean9, lazy, mixed as mixed3, number as number5, object as object16, string as string13 } from "yup";
|
|
229
|
+
|
|
201
230
|
// src/location/location.schema.ts
|
|
202
231
|
import { array as array2, number as number3, object as object4, string as string3 } from "yup";
|
|
203
232
|
var LocationSchema = object4({
|
|
@@ -376,15 +405,309 @@ var PageSchema = object10().shape({
|
|
|
376
405
|
followersCount: number4().min(0).optional().label("Followers Count")
|
|
377
406
|
}).concat(CompanySchema).concat(InstituteSchema).concat(DbDefaultSchema).noUnknown(true).strict(true).required().label("Page Schema");
|
|
378
407
|
|
|
408
|
+
// src/skill/skill.schema.ts
|
|
409
|
+
import { array as array6, object as object11, string as string8 } from "yup";
|
|
410
|
+
var SkillSchema = object11({
|
|
411
|
+
name: string8().trim().required().label("Skill Name"),
|
|
412
|
+
logo: object11({
|
|
413
|
+
light: string8().required().label("Light Logo"),
|
|
414
|
+
dark: string8().optional().nullable().label("Dark Logo")
|
|
415
|
+
}).optional().nullable().default(null).label("Logo"),
|
|
416
|
+
tags: array6().of(string8().max(50)).max(20).optional().label("Tags")
|
|
417
|
+
}).concat(DbDefaultSchema).noUnknown().strict().label("Skill");
|
|
418
|
+
|
|
419
|
+
// src/question/question.constant.ts
|
|
420
|
+
var QuestionType = /* @__PURE__ */ ((QuestionType2) => {
|
|
421
|
+
QuestionType2["Input"] = "input";
|
|
422
|
+
QuestionType2["Choice"] = "choice";
|
|
423
|
+
QuestionType2["ReadAndAcknowledge"] = "readAndAcknowledge";
|
|
424
|
+
return QuestionType2;
|
|
425
|
+
})(QuestionType || {});
|
|
426
|
+
var SupportedQuestionTypes = Object.values(QuestionType);
|
|
427
|
+
var AnswerChoiceType = /* @__PURE__ */ ((AnswerChoiceType2) => {
|
|
428
|
+
AnswerChoiceType2["Single"] = "single";
|
|
429
|
+
AnswerChoiceType2["Multiple"] = "multiple";
|
|
430
|
+
return AnswerChoiceType2;
|
|
431
|
+
})(AnswerChoiceType || {});
|
|
432
|
+
var SupportedAnswerChoiceTypes = Object.values(AnswerChoiceType);
|
|
433
|
+
|
|
434
|
+
// src/question/question.schema.ts
|
|
435
|
+
import { boolean as boolean8, object as object12, string as string9 } from "yup";
|
|
436
|
+
var QuestionSchema = object12().shape({
|
|
437
|
+
label: string9().max(50).optional().label("Label"),
|
|
438
|
+
default: boolean8().optional().default(false).label("Default"),
|
|
439
|
+
title: string9().required().max(200).label("Title"),
|
|
440
|
+
type: string9().oneOf(SupportedQuestionTypes).required().label("Type"),
|
|
441
|
+
isOptional: boolean8().optional().label("Mark if the question is optional"),
|
|
442
|
+
readonly: boolean8().optional().label("Readonly"),
|
|
443
|
+
isNew: boolean8().optional().label("Is New")
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
// src/question/input-question.schema.ts
|
|
447
|
+
import { object as object13, string as string10 } from "yup";
|
|
448
|
+
var InputQuestionSchema = QuestionSchema.concat(
|
|
449
|
+
object13().shape({
|
|
450
|
+
type: string10().oneOf(["input" /* Input */]).required().label("Question type"),
|
|
451
|
+
preferredAnswer: string10().max(100).optional().label("Preferred Answer"),
|
|
452
|
+
answers: string10().max(500).when("isOptional", {
|
|
453
|
+
is: (isOptional) => Boolean(isOptional),
|
|
454
|
+
then: (schema) => schema.optional(),
|
|
455
|
+
otherwise: (schema) => schema.required()
|
|
456
|
+
}).label("Answer")
|
|
457
|
+
})
|
|
458
|
+
);
|
|
459
|
+
|
|
460
|
+
// src/question/choice-question.schema.ts
|
|
461
|
+
import { array as array7, mixed as mixed2, object as object14, string as string11 } from "yup";
|
|
462
|
+
var ChoicePreferredAnswerSchema = (label = "Preferred answer") => mixed2().when("answerChoiceType", {
|
|
463
|
+
is: (value) => value === "multiple" /* Multiple */,
|
|
464
|
+
then: () => array7(string11()).test(
|
|
465
|
+
"is-valid-option",
|
|
466
|
+
`${label} must be from the provided options`,
|
|
467
|
+
function(answer) {
|
|
468
|
+
const { options = [] } = this.parent;
|
|
469
|
+
if (answer && answer.length > 0) {
|
|
470
|
+
return answer.every((a) => options.includes(a));
|
|
471
|
+
}
|
|
472
|
+
return true;
|
|
473
|
+
}
|
|
474
|
+
).optional().label(label),
|
|
475
|
+
otherwise: () => string11().test(
|
|
476
|
+
"is-valid-option",
|
|
477
|
+
`${label} must be from the provided options`,
|
|
478
|
+
function(answer) {
|
|
479
|
+
const { options = [] } = this.parent;
|
|
480
|
+
return !answer || options.includes(answer);
|
|
481
|
+
}
|
|
482
|
+
).optional().label(label)
|
|
483
|
+
});
|
|
484
|
+
var getChoiceAnswerSchema = (answerChoiceType, isOptional) => {
|
|
485
|
+
if (answerChoiceType === "multiple" /* Multiple */) {
|
|
486
|
+
const multiAnswerSchema = array7(string11().max(500));
|
|
487
|
+
return isOptional ? multiAnswerSchema.optional().default([]) : multiAnswerSchema.min(1, "Select at least one option.").required("Select at least one option.").default([]);
|
|
488
|
+
}
|
|
489
|
+
const singleAnswerSchema = string11().max(500);
|
|
490
|
+
return isOptional ? singleAnswerSchema.optional() : singleAnswerSchema.required("Select an option.");
|
|
491
|
+
};
|
|
492
|
+
var ChoiceQuestionSchema = QuestionSchema.concat(
|
|
493
|
+
object14().shape({
|
|
494
|
+
type: string11().oneOf(["choice" /* Choice */]).required().label("Question type"),
|
|
495
|
+
optionsFrom: string11().oneOf(["skill" /* Skill */, "education_level" /* EducationLevel */, "experience_level" /* ExperienceLevel */]).optional().label("Option field"),
|
|
496
|
+
options: array7(string11().required()).min(1).required().label("Options"),
|
|
497
|
+
answerChoiceType: string11().oneOf(SupportedAnswerChoiceTypes).required().default("single" /* Single */).label("Type"),
|
|
498
|
+
preferredAnswer: ChoicePreferredAnswerSchema("Preferred answer"),
|
|
499
|
+
answers: mixed2().when(
|
|
500
|
+
["answerChoiceType", "isOptional"],
|
|
501
|
+
([answerChoiceType, isOptional]) => getChoiceAnswerSchema(answerChoiceType, isOptional)
|
|
502
|
+
)
|
|
503
|
+
})
|
|
504
|
+
);
|
|
505
|
+
|
|
506
|
+
// src/question/read-and-acknowledge.schema.ts
|
|
507
|
+
import { object as object15, string as string12 } from "yup";
|
|
508
|
+
var AcknowledgeAnswerSchema = string12().oneOf(["yes" /* Yes */, "no" /* No */]).required("This question must be acknowledged.");
|
|
509
|
+
var ReadAndAcknowledgeQuestionSchema = QuestionSchema.concat(
|
|
510
|
+
object15().shape({
|
|
511
|
+
type: string12().oneOf(["readAndAcknowledge" /* ReadAndAcknowledge */]).required().label("Question type"),
|
|
512
|
+
description: string12().max(1e4).required().label("Content"),
|
|
513
|
+
preferredAnswer: AcknowledgeAnswerSchema.label("Preferred Answer"),
|
|
514
|
+
answers: AcknowledgeAnswerSchema.label("Answer")
|
|
515
|
+
})
|
|
516
|
+
);
|
|
517
|
+
|
|
518
|
+
// src/question/question.utils.ts
|
|
519
|
+
var getSchemaByQuestion = (type) => {
|
|
520
|
+
switch (type) {
|
|
521
|
+
case "input" /* Input */:
|
|
522
|
+
return InputQuestionSchema;
|
|
523
|
+
case "choice" /* Choice */:
|
|
524
|
+
return ChoiceQuestionSchema;
|
|
525
|
+
case "readAndAcknowledge" /* ReadAndAcknowledge */:
|
|
526
|
+
return ReadAndAcknowledgeQuestionSchema;
|
|
527
|
+
default:
|
|
528
|
+
throw new Error("Unsupported schema: " + type);
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
// src/job/job.constant.ts
|
|
533
|
+
var JobStatus = /* @__PURE__ */ ((JobStatus2) => {
|
|
534
|
+
JobStatus2["Published"] = "published";
|
|
535
|
+
JobStatus2["Draft"] = "draft";
|
|
536
|
+
JobStatus2["Deleted"] = "deleted";
|
|
537
|
+
JobStatus2["Closed"] = "closed";
|
|
538
|
+
JobStatus2["Expired"] = "expired";
|
|
539
|
+
return JobStatus2;
|
|
540
|
+
})(JobStatus || {});
|
|
541
|
+
var SupportedJobStatuses = Object.values(JobStatus);
|
|
542
|
+
var EmploymentType = /* @__PURE__ */ ((EmploymentType2) => {
|
|
543
|
+
EmploymentType2["Fulltime"] = "full_time";
|
|
544
|
+
EmploymentType2["PartTime"] = "part_time";
|
|
545
|
+
EmploymentType2["Temporary"] = "temporary";
|
|
546
|
+
EmploymentType2["Contract"] = "contract";
|
|
547
|
+
EmploymentType2["Internship"] = "internship";
|
|
548
|
+
EmploymentType2["Freelance"] = "freelance";
|
|
549
|
+
EmploymentType2["Volunteer"] = "volunteer";
|
|
550
|
+
EmploymentType2["PerDiem"] = "per_diem";
|
|
551
|
+
return EmploymentType2;
|
|
552
|
+
})(EmploymentType || {});
|
|
553
|
+
var SupportedEmploymentTypes = Object.values(EmploymentType);
|
|
554
|
+
var WorkMode = /* @__PURE__ */ ((WorkMode2) => {
|
|
555
|
+
WorkMode2["OnSite"] = "on_site";
|
|
556
|
+
WorkMode2["Hybrid"] = "hybrid";
|
|
557
|
+
WorkMode2["Remote"] = "remote";
|
|
558
|
+
return WorkMode2;
|
|
559
|
+
})(WorkMode || {});
|
|
560
|
+
var SupportedWorkModes = Object.values(WorkMode);
|
|
561
|
+
var CompensationType = /* @__PURE__ */ ((CompensationType2) => {
|
|
562
|
+
CompensationType2["Hourly"] = "hourly";
|
|
563
|
+
CompensationType2["Weekly"] = "weekly";
|
|
564
|
+
CompensationType2["Monthly"] = "monthly";
|
|
565
|
+
CompensationType2["Yearly"] = "yearly";
|
|
566
|
+
CompensationType2["OneTime"] = "one-time";
|
|
567
|
+
CompensationType2["Other"] = "other";
|
|
568
|
+
return CompensationType2;
|
|
569
|
+
})(CompensationType || {});
|
|
570
|
+
var SupportedCompensationTypes = Object.values(CompensationType);
|
|
571
|
+
var EmployeeCount = /* @__PURE__ */ ((EmployeeCount2) => {
|
|
572
|
+
EmployeeCount2["_1_2"] = "1_2_employees";
|
|
573
|
+
EmployeeCount2["_3_10"] = "3_10_employees";
|
|
574
|
+
EmployeeCount2["_11_100"] = "11_100_employees";
|
|
575
|
+
EmployeeCount2["_101_1000"] = "101_1000_employees";
|
|
576
|
+
EmployeeCount2["_1001_5000"] = "1001_5000_employees";
|
|
577
|
+
EmployeeCount2["_5001_10000"] = "5001_10000_employees";
|
|
578
|
+
EmployeeCount2["_10001_Plus"] = "10001_plus_employees";
|
|
579
|
+
return EmployeeCount2;
|
|
580
|
+
})(EmployeeCount || {});
|
|
581
|
+
var SupportedEmployeeCounts = Object.values(EmployeeCount);
|
|
582
|
+
var ApplicationReceivePreference = /* @__PURE__ */ ((ApplicationReceivePreference2) => {
|
|
583
|
+
ApplicationReceivePreference2["Inbox"] = "inbox";
|
|
584
|
+
ApplicationReceivePreference2["Email"] = "email";
|
|
585
|
+
ApplicationReceivePreference2["ExternalWebsite"] = "external_website";
|
|
586
|
+
return ApplicationReceivePreference2;
|
|
587
|
+
})(ApplicationReceivePreference || {});
|
|
588
|
+
var SupportedApplicationReceivePreferences = Object.values(
|
|
589
|
+
ApplicationReceivePreference
|
|
590
|
+
);
|
|
591
|
+
|
|
592
|
+
// src/job/job.schema.ts
|
|
593
|
+
var JobSchema = object16({
|
|
594
|
+
/** Unique id usable by external systems to reference the job. */
|
|
595
|
+
uniqueId: string13().optional().label("Unique ID"),
|
|
596
|
+
/** Job title shown in listings and search. */
|
|
597
|
+
headline: string13().required().min(5).max(150).label("Headline"),
|
|
598
|
+
/** User-friendly, unique URL identifier. */
|
|
599
|
+
slug: string13().required().max(250).label("Slug"),
|
|
600
|
+
/** How applications are received (inbox vs external website). */
|
|
601
|
+
applicationReceivePreference: mixed3().oneOf([
|
|
602
|
+
"inbox" /* Inbox */,
|
|
603
|
+
"external_website" /* ExternalWebsite */
|
|
604
|
+
]).required().label("Preference"),
|
|
605
|
+
/** Required when applicationReceivePreference is ExternalWebsite. */
|
|
606
|
+
externalApplyLink: string13().when("applicationReceivePreference", {
|
|
607
|
+
is: (value) => value === "external_website" /* ExternalWebsite */,
|
|
608
|
+
then: (schema) => schema.url().required().label("Apply for Job link"),
|
|
609
|
+
otherwise: (schema) => schema.optional()
|
|
610
|
+
}),
|
|
611
|
+
/** Company the job belongs to (subset of PageSchema). */
|
|
612
|
+
company: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company"),
|
|
613
|
+
/** @deprecated kept for backwards compatibility. */
|
|
614
|
+
designation: string13().optional().nullable().label("Designation"),
|
|
615
|
+
employmentType: string13().required().label("Employment type"),
|
|
616
|
+
workMode: string13().required().label("Work mode"),
|
|
617
|
+
skills: array8().of(SkillSchema.pick(["name", "logo"]).required().label("Skill")).nullable().optional().label("Skills"),
|
|
618
|
+
bookmarks: array8().of(UserIdAndCreatedAtSchema).optional().label("Bookmarks"),
|
|
619
|
+
embedding: object16({
|
|
620
|
+
vector: array8(number5().required()).optional().label("Embedding vector"),
|
|
621
|
+
model: string13().optional().label("Embedding model")
|
|
622
|
+
}).nullable().optional().label("Embedding"),
|
|
623
|
+
applicants: array8().of(UserIdAndCreatedAtSchema).optional().label("Applicants"),
|
|
624
|
+
applicantCount: number5().optional().label("Applicant count"),
|
|
625
|
+
externalApplicationLinkClickCount: number5().optional().label("External application link click count"),
|
|
626
|
+
description: string13().required().min(100).max(5e4).label("Description"),
|
|
627
|
+
descriptionMarkdown: string13().required().label("Description Markdown"),
|
|
628
|
+
descriptionHTML: string13().optional().label("Description HTML"),
|
|
629
|
+
/**
|
|
630
|
+
* Job locations. Required even for remote roles (compliance/legal). Defaults
|
|
631
|
+
* to an empty array; min(1) is intentionally not enforced yet.
|
|
632
|
+
*/
|
|
633
|
+
locations: array8().of(LocationSchema).default([]).label("Location"),
|
|
634
|
+
educationLevel: array8(string13().oneOf(SupportedEducationLevels)).required().min(1).label("Educational level"),
|
|
635
|
+
/** Posting validity window (start/expiry). */
|
|
636
|
+
validity: DurationSchema({
|
|
637
|
+
format: SYSTEM_DATE_FORMAT,
|
|
638
|
+
startLabel: "Start Date",
|
|
639
|
+
endLabel: "Expiry Date"
|
|
640
|
+
}).label("Validity"),
|
|
641
|
+
/**
|
|
642
|
+
* When the auto-close system last re-checked this job's liveness (epoch ms).
|
|
643
|
+
* Server-owned operational field: set by the expiry re-crawl track when a job
|
|
644
|
+
* has no `validity.endDate` and must be verified by crawling its page. Guards
|
|
645
|
+
* re-check cadence so the same job is not re-crawled on every sweep.
|
|
646
|
+
*/
|
|
647
|
+
lastExpiryCheckAt: number5().optional().nullable().label("Last expiry check at"),
|
|
648
|
+
experienceLevel: string13().oneOf(SupportedExperienceLevels).nullable().optional().label("Experience level"),
|
|
649
|
+
contactEmail: string13().email().nullable().optional().label("Contact email"),
|
|
650
|
+
workingHoursPerWeek: number5().nullable().optional().min(1).max(24 * 7).label("Working hours per week"),
|
|
651
|
+
tags: array8().max(50).optional().label("Tags"),
|
|
652
|
+
/** Direct/Quick-apply questionnaire. Each item is validated against the
|
|
653
|
+
* concrete question schema for its `type`, with the stored `answers` omitted. */
|
|
654
|
+
questionnaire: array8().of(
|
|
655
|
+
lazy((question) => {
|
|
656
|
+
const schema = getSchemaByQuestion(question.type);
|
|
657
|
+
if (question.type === "input" /* Input */) {
|
|
658
|
+
return schema.omit([
|
|
659
|
+
"answers"
|
|
660
|
+
]);
|
|
661
|
+
} else if (question.type === "choice" /* Choice */) {
|
|
662
|
+
return schema.omit([
|
|
663
|
+
"answers"
|
|
664
|
+
]);
|
|
665
|
+
} else if (question.type === "readAndAcknowledge" /* ReadAndAcknowledge */) {
|
|
666
|
+
return schema.omit(["answers"]);
|
|
667
|
+
}
|
|
668
|
+
return schema;
|
|
669
|
+
})
|
|
670
|
+
).label("Questionnaire"),
|
|
671
|
+
status: string13().oneOf(SupportedJobStatuses).default("draft" /* Draft */).required().label("Status"),
|
|
672
|
+
seoTags: object16({
|
|
673
|
+
description: string13().optional().label("Description"),
|
|
674
|
+
keywords: array8().of(string13()).optional().label("Keywords")
|
|
675
|
+
}).nullable().optional().label("SEO Tags"),
|
|
676
|
+
jdSummary: string13().optional().label("JD Summary"),
|
|
677
|
+
canCreateAlert: boolean9().optional().label("Can create alert"),
|
|
678
|
+
canDirectApply: boolean9().optional().label("Can direct apply"),
|
|
679
|
+
hasApplied: boolean9().optional().label("Has applied"),
|
|
680
|
+
isOwner: boolean9().optional().label("Is owner"),
|
|
681
|
+
hasBookmarked: boolean9().optional().label("Has bookmarked"),
|
|
682
|
+
hasReported: boolean9().optional().label("Has reported"),
|
|
683
|
+
ratePerHour: number5().optional().min(0).label("Rate per hour"),
|
|
684
|
+
isPromoted: boolean9().optional().label("Is promoted"),
|
|
685
|
+
salaryRange: object16({
|
|
686
|
+
currency: string13().required().label("Currency").default("USD"),
|
|
687
|
+
min: number5().nullable().optional().min(0).label("Minimum Salary"),
|
|
688
|
+
max: number5().nullable().optional().min(0).label("Maximum Salary"),
|
|
689
|
+
compensationType: string13().oneOf(SupportedCompensationTypes).nullable().optional().label("Compensation Type"),
|
|
690
|
+
isNegotiable: boolean9().nullable().optional().default(true).label("Is Negotiable")
|
|
691
|
+
}).nullable().optional().label("Salary Range"),
|
|
692
|
+
reports: array8().of(UserIdAndCreatedAtSchema).optional().label("Reports"),
|
|
693
|
+
category: string13().nullable().optional().label("Category"),
|
|
694
|
+
industry: string13().nullable().optional().label("Industry"),
|
|
695
|
+
subCategories: array8().of(string13().trim().required()).nullable().optional().label("Sub Categories"),
|
|
696
|
+
termsAccepted: boolean9().oneOf([true], "Accept terms before proceeding").required("Accept terms before proceeding").label("Terms accepted"),
|
|
697
|
+
isFeatured: boolean9().optional().default(false).label("Is featured"),
|
|
698
|
+
/** Market country codes to feature this job in; empty = global. */
|
|
699
|
+
featuredMarkets: array8().of(string13().required()).optional().default([]).label("Featured markets")
|
|
700
|
+
}).concat(DbDefaultSchema).noUnknown().label("Job");
|
|
701
|
+
|
|
379
702
|
// src/pagination/pagination.schema.ts
|
|
380
|
-
import { number as
|
|
381
|
-
var PaginationSchema =
|
|
382
|
-
page:
|
|
383
|
-
limit:
|
|
384
|
-
sortBy:
|
|
385
|
-
nextPage:
|
|
386
|
-
prevPage:
|
|
387
|
-
sortDirection:
|
|
703
|
+
import { number as number6, object as object17, string as string14 } from "yup";
|
|
704
|
+
var PaginationSchema = object17().shape({
|
|
705
|
+
page: number6().required().min(1).label("Page").default(1),
|
|
706
|
+
limit: number6().required().min(1).max(100).label("Limit").default(10),
|
|
707
|
+
sortBy: string14().notOneOf([""]).optional().label("SortBy"),
|
|
708
|
+
nextPage: string14().optional().label("Next Page Token"),
|
|
709
|
+
prevPage: string14().optional().label("Previous Page Token"),
|
|
710
|
+
sortDirection: string14().oneOf(["asc", "desc"]).optional().label("Sort Direction")
|
|
388
711
|
});
|
|
389
712
|
|
|
390
713
|
// src/pagination/pagination.constant.ts
|
|
@@ -400,7 +723,7 @@ var DefaultPaginationOptions = {
|
|
|
400
723
|
};
|
|
401
724
|
|
|
402
725
|
// src/report/report.schema.ts
|
|
403
|
-
import { mixed as
|
|
726
|
+
import { mixed as mixed4, object as object18, string as string15 } from "yup";
|
|
404
727
|
|
|
405
728
|
// src/report/report.constant.ts
|
|
406
729
|
var ResourceType = /* @__PURE__ */ ((ResourceType3) => {
|
|
@@ -424,26 +747,15 @@ var ReportReason = /* @__PURE__ */ ((ReportReason3) => {
|
|
|
424
747
|
var SupportedReportReasons = Object.values(ReportReason);
|
|
425
748
|
|
|
426
749
|
// src/report/report.schema.ts
|
|
427
|
-
var ReportSchema =
|
|
428
|
-
type:
|
|
429
|
-
resourceId:
|
|
430
|
-
reason:
|
|
431
|
-
comment:
|
|
750
|
+
var ReportSchema = object18({
|
|
751
|
+
type: mixed4().oneOf(SupportedResourceTypes).required().label("Type"),
|
|
752
|
+
resourceId: string15().required().label("Resource ID"),
|
|
753
|
+
reason: mixed4().oneOf(SupportedReportReasons).required("Please choose a reason").label("Reason"),
|
|
754
|
+
comment: string15().max(1e3).optional().label("Comment")
|
|
432
755
|
}).label("Report Schema");
|
|
433
756
|
|
|
434
|
-
// src/skill/skill.schema.ts
|
|
435
|
-
import { array as array6, object as object13, string as string10 } from "yup";
|
|
436
|
-
var SkillSchema = object13({
|
|
437
|
-
name: string10().trim().required().label("Skill Name"),
|
|
438
|
-
logo: object13({
|
|
439
|
-
light: string10().required().label("Light Logo"),
|
|
440
|
-
dark: string10().optional().nullable().label("Dark Logo")
|
|
441
|
-
}).optional().nullable().default(null).label("Logo"),
|
|
442
|
-
tags: array6().of(string10().max(50)).max(20).optional().label("Tags")
|
|
443
|
-
}).concat(DbDefaultSchema).noUnknown().strict().label("Skill");
|
|
444
|
-
|
|
445
757
|
// src/user/user.schema.ts
|
|
446
|
-
import { array as
|
|
758
|
+
import { array as array12, number as number8, object as object30, string as string28 } from "yup";
|
|
447
759
|
|
|
448
760
|
// src/user/user.constant.ts
|
|
449
761
|
var UserRole = /* @__PURE__ */ ((UserRole2) => {
|
|
@@ -525,51 +837,51 @@ var MIN_SALARY_LOWER_BOUND = 0;
|
|
|
525
837
|
var MIN_SALARY_UPPER_BOUND = 1e6;
|
|
526
838
|
|
|
527
839
|
// src/user/work-experience.schema.ts
|
|
528
|
-
import { boolean as
|
|
529
|
-
var WorkExperienceSchema =
|
|
840
|
+
import { boolean as boolean10, object as object19, string as string16 } from "yup";
|
|
841
|
+
var WorkExperienceSchema = object19().shape({
|
|
530
842
|
company: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company"),
|
|
531
|
-
designation:
|
|
843
|
+
designation: string16().trim().required().label("Designation"),
|
|
532
844
|
duration: DurationSchema({
|
|
533
845
|
format: "YYYY-MM",
|
|
534
846
|
startLabel: "Start Date",
|
|
535
847
|
endLabel: "End Date"
|
|
536
848
|
}).required().label("Duration"),
|
|
537
|
-
description:
|
|
849
|
+
description: string16().trim().max(3e3).optional().label("Description"),
|
|
538
850
|
location: LocationSchema.required().label("Location"),
|
|
539
|
-
isRemote:
|
|
851
|
+
isRemote: boolean10().oneOf([true, false]).default(false).label("Is Remote")
|
|
540
852
|
}).noUnknown().strict().label("Work Experience");
|
|
541
853
|
|
|
542
854
|
// src/user/education.schema.ts
|
|
543
|
-
import { boolean as
|
|
544
|
-
var EducationSchema =
|
|
855
|
+
import { boolean as boolean11, object as object20, string as string17 } from "yup";
|
|
856
|
+
var EducationSchema = object20({
|
|
545
857
|
institute: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Institute"),
|
|
546
|
-
course:
|
|
547
|
-
fieldOfStudy:
|
|
858
|
+
course: string17().trim().required().label("Course"),
|
|
859
|
+
fieldOfStudy: string17().trim().required().label("Field of Study"),
|
|
548
860
|
duration: DurationSchema({
|
|
549
861
|
format: "YYYY-MM",
|
|
550
862
|
startLabel: "Start Date",
|
|
551
863
|
endLabel: "End Date"
|
|
552
864
|
}).required().label("Duration"),
|
|
553
|
-
description:
|
|
554
|
-
isDistanceLearning:
|
|
865
|
+
description: string17().trim().max(3e3).optional().label("Description"),
|
|
866
|
+
isDistanceLearning: boolean11().default(false).label("Is Distance Learning"),
|
|
555
867
|
location: LocationSchema.required().label("Location"),
|
|
556
|
-
studyType:
|
|
868
|
+
studyType: string17().oneOf(SupportedStudyTypes).trim().max(50).required().label("Study Type")
|
|
557
869
|
}).noUnknown().strict().label("Education");
|
|
558
870
|
|
|
559
871
|
// src/user/user-skill.schema.ts
|
|
560
|
-
import { object as
|
|
561
|
-
var UserSkillSchema =
|
|
562
|
-
name:
|
|
563
|
-
proficiencyLevel:
|
|
872
|
+
import { object as object21, string as string18 } from "yup";
|
|
873
|
+
var UserSkillSchema = object21({
|
|
874
|
+
name: string18().required().label("Name"),
|
|
875
|
+
proficiencyLevel: string18().oneOf(SupportedProficiencyLevels).required().label("Proficiency Level"),
|
|
564
876
|
lastUsed: dateString().format("YYYY-MM").nullable().optional().label("Last Used")
|
|
565
877
|
}).noUnknown().strict().label("Skill");
|
|
566
878
|
|
|
567
879
|
// src/user/project.schema.ts
|
|
568
|
-
import { object as
|
|
569
|
-
var UserProjectSchema =
|
|
570
|
-
name:
|
|
571
|
-
url:
|
|
572
|
-
description:
|
|
880
|
+
import { object as object22, string as string19 } from "yup";
|
|
881
|
+
var UserProjectSchema = object22({
|
|
882
|
+
name: string19().trim().max(50).required().label("Name"),
|
|
883
|
+
url: string19().optional().label("URL"),
|
|
884
|
+
description: string19().trim().min(100).max(3e3).required().label("Description"),
|
|
573
885
|
duration: DurationSchema({
|
|
574
886
|
format: "YYYY-MM",
|
|
575
887
|
startLabel: "Start Date",
|
|
@@ -578,83 +890,83 @@ var UserProjectSchema = object17({
|
|
|
578
890
|
}).noUnknown().strict().label("Project");
|
|
579
891
|
|
|
580
892
|
// src/user/user-certification.schema.ts
|
|
581
|
-
import { object as
|
|
582
|
-
var UserCertificationSchema =
|
|
583
|
-
name:
|
|
893
|
+
import { object as object23, string as string20 } from "yup";
|
|
894
|
+
var UserCertificationSchema = object23({
|
|
895
|
+
name: string20().trim().max(100).required().label("Name"),
|
|
584
896
|
// TODO: Add validation for authority
|
|
585
|
-
authority:
|
|
586
|
-
licenseNumber:
|
|
897
|
+
authority: string20().trim().max(100).required().label("Authority"),
|
|
898
|
+
licenseNumber: string20().trim().max(50).optional().label("License Number"),
|
|
587
899
|
duration: DurationSchema({
|
|
588
900
|
format: "YYYY-MM",
|
|
589
901
|
startLabel: "Start Date",
|
|
590
902
|
endLabel: "End Date"
|
|
591
903
|
}).optional().nullable().label("Duration"),
|
|
592
|
-
url:
|
|
904
|
+
url: string20().optional().label("URL")
|
|
593
905
|
}).noUnknown().strict().label("Certification");
|
|
594
906
|
|
|
595
907
|
// src/user/user-interest.schema.ts
|
|
596
|
-
import { string as
|
|
597
|
-
var UserInterestSchema =
|
|
908
|
+
import { string as string21 } from "yup";
|
|
909
|
+
var UserInterestSchema = string21().trim().required().label("Interest");
|
|
598
910
|
|
|
599
911
|
// src/user/user-language.schema.ts
|
|
600
|
-
import { object as
|
|
601
|
-
var UserLanguageSchema =
|
|
602
|
-
name:
|
|
603
|
-
proficiencyLevel:
|
|
912
|
+
import { object as object24, string as string22 } from "yup";
|
|
913
|
+
var UserLanguageSchema = object24({
|
|
914
|
+
name: string22().trim().required().label("Name"),
|
|
915
|
+
proficiencyLevel: string22().oneOf(SupportedProficiencyLevels).trim().max(50).required().label("Proficiency Level")
|
|
604
916
|
}).noUnknown().strict().label("Language");
|
|
605
917
|
|
|
606
918
|
// src/user/user-additional-info.schema.ts
|
|
607
|
-
import { object as
|
|
608
|
-
var UserAdditionalInfoSchema =
|
|
609
|
-
title:
|
|
610
|
-
description:
|
|
919
|
+
import { object as object25, string as string23 } from "yup";
|
|
920
|
+
var UserAdditionalInfoSchema = object25({
|
|
921
|
+
title: string23().trim().max(60).required().label("Title"),
|
|
922
|
+
description: string23().trim().max(1e3).required().label("Description")
|
|
611
923
|
}).noUnknown().strict().label("User Additional Info");
|
|
612
924
|
|
|
613
925
|
// src/user/general-detail.schema.ts
|
|
614
|
-
import { object as
|
|
615
|
-
var UserGeneralDetailSchema =
|
|
616
|
-
id:
|
|
617
|
-
name:
|
|
618
|
-
first:
|
|
619
|
-
last:
|
|
926
|
+
import { object as object26, string as string24 } from "yup";
|
|
927
|
+
var UserGeneralDetailSchema = object26({
|
|
928
|
+
id: string24().optional().label("ID"),
|
|
929
|
+
name: object26().shape({
|
|
930
|
+
first: string24().trim().max(50).required().label("First Name"),
|
|
931
|
+
last: string24().trim().max(50).optional().label("Last Name")
|
|
620
932
|
}).required().label("Name"),
|
|
621
|
-
headline:
|
|
622
|
-
image:
|
|
623
|
-
aboutMe:
|
|
624
|
-
email:
|
|
625
|
-
mobile:
|
|
626
|
-
emailVerified:
|
|
627
|
-
mobileVerified:
|
|
628
|
-
experienceLevel:
|
|
933
|
+
headline: string24().trim().max(200).optional().label("Headline"),
|
|
934
|
+
image: string24().optional().label("Image"),
|
|
935
|
+
aboutMe: string24().trim().max(3e3).optional().label("About Me"),
|
|
936
|
+
email: string24().required().label("Email"),
|
|
937
|
+
mobile: string24().nullable().optional().label("Mobile"),
|
|
938
|
+
emailVerified: string24().nullable().optional().label("Email Verified"),
|
|
939
|
+
mobileVerified: string24().nullable().optional().label("Mobile Verified"),
|
|
940
|
+
experienceLevel: string24().oneOf(SupportedExperienceLevels).required().label("Experience level"),
|
|
629
941
|
location: LocationSchema.required().label("Location"),
|
|
630
|
-
region:
|
|
631
|
-
country:
|
|
632
|
-
lang:
|
|
942
|
+
region: object26().shape({
|
|
943
|
+
country: string24().trim().required().label("Region Country"),
|
|
944
|
+
lang: string24().trim().required().label("Region Language")
|
|
633
945
|
}).optional().default(void 0).label("Region"),
|
|
634
|
-
profileVisibility:
|
|
946
|
+
profileVisibility: string24().oneOf(SupportedUserProfileVisibilities).default("public" /* Public */).label("Profile Visibility")
|
|
635
947
|
}).noUnknown().strict().label("General Detail");
|
|
636
948
|
|
|
637
949
|
// src/user/user-job-preferences.schema.ts
|
|
638
|
-
import { array as
|
|
639
|
-
var UserJobPreferencesSchema =
|
|
950
|
+
import { array as array9, boolean as boolean12, date as date2, number as number7, object as object27, string as string25 } from "yup";
|
|
951
|
+
var UserJobPreferencesSchema = object27({
|
|
640
952
|
/**
|
|
641
953
|
* Whether the job seeker is openly signalling availability. Surfaces the
|
|
642
954
|
* "Open to work" badge on the public profile and boosts visibility in
|
|
643
955
|
* recruiter search. Defaults to `false` - users must opt in.
|
|
644
956
|
*/
|
|
645
|
-
openToWork:
|
|
957
|
+
openToWork: boolean12().default(false).label("Open to Work"),
|
|
646
958
|
/**
|
|
647
959
|
* How urgently the user is looking for their next job. Drives match scoring
|
|
648
960
|
* and can downgrade the visibility of expired or low-relevance postings for
|
|
649
961
|
* users in `passively_browsing` mode.
|
|
650
962
|
*/
|
|
651
|
-
jobSearchUrgency:
|
|
963
|
+
jobSearchUrgency: string25().oneOf(SupportedJobSearchUrgencies).required().label("Job Search Urgency"),
|
|
652
964
|
/**
|
|
653
965
|
* Locations the user wants to work in. Stores the full `LocationSchema`
|
|
654
966
|
* shape (country, city, state, geo, etc.) as returned by the locations
|
|
655
967
|
* autocomplete API.
|
|
656
968
|
*/
|
|
657
|
-
jobLocations:
|
|
969
|
+
jobLocations: array9().of(LocationSchema.required().label("Job Location")).min(1, "Pick at least one preferred location.").required().label("Job Locations"),
|
|
658
970
|
/**
|
|
659
971
|
* Seniority levels the user wants jobs to be matched against. Multi-select
|
|
660
972
|
* (up to 2) for borderline candidates.
|
|
@@ -665,7 +977,7 @@ var UserJobPreferencesSchema = object22({
|
|
|
665
977
|
* Both reuse the same `ExperienceLevel` taxonomy from `common.constant.ts`
|
|
666
978
|
* so search/match logic doesn't have to translate between two vocabularies.
|
|
667
979
|
*/
|
|
668
|
-
targetExperienceLevels:
|
|
980
|
+
targetExperienceLevels: array9().of(string25().oneOf(SupportedExperienceLevels).required()).min(1, "Pick at least one experience level.").max(2, "You can select at most 2 experience levels.").required().label("Target Experience Levels"),
|
|
669
981
|
/**
|
|
670
982
|
* Specializations the user is searching for - free-form titles.
|
|
671
983
|
*
|
|
@@ -674,19 +986,19 @@ var UserJobPreferencesSchema = object22({
|
|
|
674
986
|
* surfaces a curated "Popular Roles" picker for discovery, but the user
|
|
675
987
|
* can ultimately add any title; matching/normalization happens downstream.
|
|
676
988
|
*/
|
|
677
|
-
jobRoles:
|
|
989
|
+
jobRoles: array9().of(string25().trim().max(120).required()).min(1, "Pick at least one role.").required().label("Job Roles"),
|
|
678
990
|
/**
|
|
679
991
|
* Minimum acceptable annual base salary, in `minSalaryCurrency`.
|
|
680
992
|
* Stored as an integer in the currency's major unit (e.g. dollars, not cents).
|
|
681
993
|
* Defaults to 0 ("any salary") rather than being optional - every job-seeker
|
|
682
994
|
* has a floor, even if it's zero.
|
|
683
995
|
*/
|
|
684
|
-
minSalary:
|
|
685
|
-
minSalaryCurrency:
|
|
996
|
+
minSalary: number7().integer().min(MIN_SALARY_LOWER_BOUND).max(MIN_SALARY_UPPER_BOUND).default(0).required().label("Minimum Salary"),
|
|
997
|
+
minSalaryCurrency: string25().oneOf(SupportedSalaryCurrencies).default("USD").required().label("Minimum Salary Currency"),
|
|
686
998
|
/**
|
|
687
999
|
* Marketing-attribution capture from the final onboarding step.
|
|
688
1000
|
*/
|
|
689
|
-
referralSource:
|
|
1001
|
+
referralSource: string25().oneOf(SupportedReferralSources).required().label("Referral Source"),
|
|
690
1002
|
/**
|
|
691
1003
|
* Resumes the user has uploaded. Embedded directly on the user document
|
|
692
1004
|
* (capped at 5) - they're cheap to denormalize, every wizard step that
|
|
@@ -700,18 +1012,18 @@ var UserJobPreferencesSchema = object22({
|
|
|
700
1012
|
* AI resume-builder flow - onboarding uploads land here, AI-built resumes
|
|
701
1013
|
* live in their own collection.
|
|
702
1014
|
*/
|
|
703
|
-
resumes:
|
|
704
|
-
|
|
1015
|
+
resumes: array9().of(
|
|
1016
|
+
object27({
|
|
705
1017
|
// Stable id assigned on upload - used to address a specific entry
|
|
706
1018
|
// for delete / set-primary operations without exposing the GCS URL
|
|
707
1019
|
// as a route key.
|
|
708
|
-
id:
|
|
709
|
-
url:
|
|
710
|
-
filename:
|
|
711
|
-
sizeBytes:
|
|
712
|
-
mimeType:
|
|
1020
|
+
id: string25().required().label("ID"),
|
|
1021
|
+
url: string25().required().label("Resume URL"),
|
|
1022
|
+
filename: string25().trim().max(255).optional().label("Filename"),
|
|
1023
|
+
sizeBytes: number7().integer().min(0).optional().label("Size (bytes)"),
|
|
1024
|
+
mimeType: string25().trim().max(120).optional().label("MIME Type"),
|
|
713
1025
|
uploadedAt: date2().required().label("Uploaded At"),
|
|
714
|
-
isPrimary:
|
|
1026
|
+
isPrimary: boolean12().default(false).label("Is Primary")
|
|
715
1027
|
}).noUnknown().strict().label("Resume")
|
|
716
1028
|
).max(5, "You can keep at most 5 resumes on file.").default([]).label("Resumes"),
|
|
717
1029
|
/**
|
|
@@ -738,106 +1050,106 @@ var UserJobPreferencesSchema = object22({
|
|
|
738
1050
|
* APIs. If `user.<field>` is empty there, the correct behavior is empty,
|
|
739
1051
|
* because the user has not confirmed it yet.
|
|
740
1052
|
*/
|
|
741
|
-
pendingPrefill:
|
|
742
|
-
headline:
|
|
743
|
-
aboutMe:
|
|
744
|
-
mobile:
|
|
1053
|
+
pendingPrefill: object27({
|
|
1054
|
+
headline: string25().trim().optional().label("Pending Headline"),
|
|
1055
|
+
aboutMe: string25().trim().optional().label("Pending About Me"),
|
|
1056
|
+
mobile: string25().trim().optional().label("Pending Mobile"),
|
|
745
1057
|
location: LocationSchema.optional().default(void 0).label("Pending Location"),
|
|
746
|
-
experienceLevel:
|
|
747
|
-
socialAccounts:
|
|
748
|
-
workExperiences:
|
|
749
|
-
educations:
|
|
1058
|
+
experienceLevel: string25().oneOf(SupportedExperienceLevels).optional().label("Pending Experience Level"),
|
|
1059
|
+
socialAccounts: array9().of(SocialAccountSchema.required()).optional().label("Pending Social Accounts"),
|
|
1060
|
+
workExperiences: array9().of(WorkExperienceSchema.required()).optional().label("Pending Work Experiences"),
|
|
1061
|
+
educations: array9().of(EducationSchema.required()).optional().label("Pending Educations")
|
|
750
1062
|
}).nullable().optional().default(void 0).label("Pending Prefill")
|
|
751
1063
|
}).noUnknown().strict().label("User Job Preferences Schema");
|
|
752
1064
|
|
|
753
1065
|
// src/user/user-recruiter-profile.schema.ts
|
|
754
|
-
import { array as
|
|
755
|
-
var RecruiterPageLinkSchema =
|
|
1066
|
+
import { array as array10, object as object28, string as string26 } from "yup";
|
|
1067
|
+
var RecruiterPageLinkSchema = object28({
|
|
756
1068
|
page: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company Page"),
|
|
757
|
-
jobTitle:
|
|
1069
|
+
jobTitle: string26().trim().max(100).optional().label("Job Title")
|
|
758
1070
|
}).noUnknown().strict().label("Recruiter Page Link");
|
|
759
|
-
var UserRecruiterProfileSchema =
|
|
760
|
-
recruiterProfile:
|
|
761
|
-
hiringFor:
|
|
1071
|
+
var UserRecruiterProfileSchema = object28({
|
|
1072
|
+
recruiterProfile: object28({
|
|
1073
|
+
hiringFor: array10().of(RecruiterPageLinkSchema).default([]).label("Hiring For")
|
|
762
1074
|
}).optional().default(void 0).label("Recruiter Profile")
|
|
763
1075
|
}).noUnknown().strict().label("User Recruiter Profile");
|
|
764
1076
|
|
|
765
1077
|
// src/user/user-coordinator-profile.schema.ts
|
|
766
|
-
import { array as
|
|
767
|
-
var CoordinatorPageLinkSchema =
|
|
1078
|
+
import { array as array11, object as object29, string as string27 } from "yup";
|
|
1079
|
+
var CoordinatorPageLinkSchema = object29({
|
|
768
1080
|
page: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Institute Page"),
|
|
769
|
-
jobTitle:
|
|
1081
|
+
jobTitle: string27().trim().max(100).optional().label("Job Title")
|
|
770
1082
|
}).noUnknown().strict().label("Coordinator Page Link");
|
|
771
|
-
var UserCoordinatorProfileSchema =
|
|
772
|
-
coordinatorProfile:
|
|
773
|
-
coordinatesAt:
|
|
1083
|
+
var UserCoordinatorProfileSchema = object29({
|
|
1084
|
+
coordinatorProfile: object29({
|
|
1085
|
+
coordinatesAt: array11().of(CoordinatorPageLinkSchema).default([]).label("Coordinates At")
|
|
774
1086
|
}).optional().default(void 0).label("Coordinator Profile")
|
|
775
1087
|
}).noUnknown().strict().label("User Coordinator Profile");
|
|
776
1088
|
|
|
777
1089
|
// src/user/user.schema.ts
|
|
778
|
-
var UserSchema =
|
|
1090
|
+
var UserSchema = object30({
|
|
779
1091
|
/**
|
|
780
1092
|
* Related auth account id from auth Server (e.g. Better auth https://auth.thejob.dev)
|
|
781
1093
|
*/
|
|
782
|
-
authAccountId:
|
|
1094
|
+
authAccountId: string28().required().label("Auth Account ID"),
|
|
783
1095
|
/**
|
|
784
1096
|
* Social media information about the user (e.g. LinkedIn, GitHub, etc.)
|
|
785
1097
|
*/
|
|
786
|
-
socialAccounts:
|
|
1098
|
+
socialAccounts: array12().of(SocialAccountSchema).default([]).label("Social Accounts"),
|
|
787
1099
|
/**
|
|
788
1100
|
* Work experience information about the user
|
|
789
1101
|
*/
|
|
790
|
-
workExperiences:
|
|
1102
|
+
workExperiences: array12().of(WorkExperienceSchema).required().default([]).label("Work Experiences"),
|
|
791
1103
|
/**
|
|
792
1104
|
* Education information about the user
|
|
793
1105
|
*/
|
|
794
|
-
educations:
|
|
1106
|
+
educations: array12().of(EducationSchema).required().default([]).label("Educations"),
|
|
795
1107
|
/**
|
|
796
1108
|
* Skills information about the user
|
|
797
1109
|
*/
|
|
798
|
-
skills:
|
|
1110
|
+
skills: array12().of(UserSkillSchema).required().default([]).label("Skills"),
|
|
799
1111
|
/**
|
|
800
1112
|
* Projects information about the user
|
|
801
1113
|
*/
|
|
802
|
-
projects:
|
|
1114
|
+
projects: array12().of(UserProjectSchema).default([]).label("Projects"),
|
|
803
1115
|
/**
|
|
804
1116
|
* Certifications information about the user
|
|
805
1117
|
*/
|
|
806
|
-
certifications:
|
|
1118
|
+
certifications: array12().of(UserCertificationSchema).default([]).label("Certifications"),
|
|
807
1119
|
/**
|
|
808
1120
|
* Interests information about the user.
|
|
809
1121
|
*/
|
|
810
|
-
interests:
|
|
1122
|
+
interests: array12().of(UserInterestSchema).optional().default([]).label("Interests"),
|
|
811
1123
|
/**
|
|
812
1124
|
* Languages information about the user
|
|
813
1125
|
*/
|
|
814
|
-
languages:
|
|
1126
|
+
languages: array12().of(UserLanguageSchema).required().default([]).label("Languages"),
|
|
815
1127
|
/**
|
|
816
1128
|
* Additional information about the user
|
|
817
1129
|
*/
|
|
818
|
-
additionalInfo:
|
|
1130
|
+
additionalInfo: array12().of(UserAdditionalInfoSchema).default([]).label("Additional Information"),
|
|
819
1131
|
/**
|
|
820
1132
|
* Status of the user account
|
|
821
1133
|
*/
|
|
822
|
-
status:
|
|
1134
|
+
status: string28().oneOf(SupportedUserStatuses).required().label("Status"),
|
|
823
1135
|
/**
|
|
824
1136
|
* Roles assigned to the user
|
|
825
1137
|
*/
|
|
826
|
-
roles:
|
|
1138
|
+
roles: array12().of(string28().oneOf(SupportedUserRoles)).required().default(DefaultUserRoles).label("Roles"),
|
|
827
1139
|
/**
|
|
828
1140
|
* Vector embedding of the user's profile for semantic/hybrid search.
|
|
829
1141
|
* Generated from a structured summary of skills, experience, education, etc.
|
|
830
1142
|
* Only generated for public profiles with sufficient completeness (≥60%).
|
|
831
1143
|
*/
|
|
832
|
-
embedding:
|
|
833
|
-
vector:
|
|
834
|
-
model:
|
|
1144
|
+
embedding: object30({
|
|
1145
|
+
vector: array12(number8().required()).optional().label("Embedding vector"),
|
|
1146
|
+
model: string28().optional().label("Embedding model")
|
|
835
1147
|
}).nullable().optional().label("Embedding")
|
|
836
1148
|
}).concat(UserGeneralDetailSchema).concat(UserJobPreferencesSchema).concat(UserRecruiterProfileSchema).concat(UserCoordinatorProfileSchema).noUnknown().strict().label("User Schema");
|
|
837
1149
|
|
|
838
1150
|
// src/user/user-completeness.schema.ts
|
|
839
|
-
import { object as
|
|
840
|
-
var UserCompletenessSchema =
|
|
1151
|
+
import { object as object31 } from "yup";
|
|
1152
|
+
var UserCompletenessSchema = object31({
|
|
841
1153
|
additionalInfo: CompletenessScoreSchema(0).label("Additional Info"),
|
|
842
1154
|
// Optional
|
|
843
1155
|
certifications: CompletenessScoreSchema(0).label("Certifications"),
|
|
@@ -859,17 +1171,27 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
|
|
|
859
1171
|
"workExperiences" /* WorkExperiences */
|
|
860
1172
|
]);
|
|
861
1173
|
export {
|
|
1174
|
+
AnswerChoiceType,
|
|
1175
|
+
ApplicationReceivePreference,
|
|
1176
|
+
ChoiceQuestionSchema,
|
|
1177
|
+
Common,
|
|
1178
|
+
CompensationType,
|
|
862
1179
|
CompletenessScoreSchema,
|
|
863
1180
|
ContactTypes,
|
|
864
1181
|
CoordinatorPageLinkSchema,
|
|
1182
|
+
DISPLAY_DATE_FORMAT,
|
|
1183
|
+
DISPLAY_DATE_FORMAT_SHORT,
|
|
865
1184
|
DateStringSchema,
|
|
866
1185
|
DbDefaultSchema,
|
|
867
1186
|
DefaultPaginatedResponse,
|
|
868
1187
|
DefaultPaginationOptions,
|
|
869
1188
|
DefaultUserRoles,
|
|
870
1189
|
DurationSchema,
|
|
1190
|
+
EMPTY_STRING,
|
|
871
1191
|
EducationLevel,
|
|
872
1192
|
EducationSchema,
|
|
1193
|
+
EmployeeCount,
|
|
1194
|
+
EmploymentType,
|
|
873
1195
|
ExperienceLevel,
|
|
874
1196
|
GeneraDetailFields,
|
|
875
1197
|
GroupManagedBy,
|
|
@@ -879,7 +1201,10 @@ export {
|
|
|
879
1201
|
GroupStatus,
|
|
880
1202
|
GroupTranslationSchema,
|
|
881
1203
|
GroupVisibility,
|
|
1204
|
+
InputQuestionSchema,
|
|
1205
|
+
JobSchema,
|
|
882
1206
|
JobSearchUrgency,
|
|
1207
|
+
JobStatus,
|
|
883
1208
|
LocationSchema,
|
|
884
1209
|
MIN_SALARY_LOWER_BOUND,
|
|
885
1210
|
MIN_SALARY_UPPER_BOUND,
|
|
@@ -888,23 +1213,35 @@ export {
|
|
|
888
1213
|
PageType,
|
|
889
1214
|
PaginationSchema,
|
|
890
1215
|
ProficiencyLevel,
|
|
1216
|
+
QuestionSchema,
|
|
1217
|
+
QuestionType,
|
|
1218
|
+
ReadAndAcknowledgeQuestionSchema,
|
|
891
1219
|
RecruiterPageLinkSchema,
|
|
892
1220
|
ReferralSource,
|
|
893
1221
|
ReportReason,
|
|
894
1222
|
ReportSchema,
|
|
895
1223
|
ResourceType,
|
|
1224
|
+
SITEMAP_FORMAT,
|
|
1225
|
+
SYSTEM_DATE_FORMAT,
|
|
896
1226
|
SkillSchema,
|
|
897
1227
|
SocialAccount,
|
|
898
1228
|
SocialAccountSchema,
|
|
899
1229
|
StudentCompletenessSchema,
|
|
900
1230
|
StudyType,
|
|
1231
|
+
SupportedAnswerChoiceTypes,
|
|
1232
|
+
SupportedApplicationReceivePreferences,
|
|
1233
|
+
SupportedCompensationTypes,
|
|
901
1234
|
SupportedContactTypes,
|
|
902
1235
|
SupportedEducationLevels,
|
|
1236
|
+
SupportedEmployeeCounts,
|
|
1237
|
+
SupportedEmploymentTypes,
|
|
903
1238
|
SupportedExperienceLevels,
|
|
904
1239
|
SupportedJobSearchUrgencies,
|
|
1240
|
+
SupportedJobStatuses,
|
|
905
1241
|
SupportedPageStatuses,
|
|
906
1242
|
SupportedPageTypes,
|
|
907
1243
|
SupportedProficiencyLevels,
|
|
1244
|
+
SupportedQuestionTypes,
|
|
908
1245
|
SupportedReferralSources,
|
|
909
1246
|
SupportedReportReasons,
|
|
910
1247
|
SupportedResourceTypes,
|
|
@@ -914,6 +1251,7 @@ export {
|
|
|
914
1251
|
SupportedUserProfileVisibilities,
|
|
915
1252
|
SupportedUserRoles,
|
|
916
1253
|
SupportedUserStatuses,
|
|
1254
|
+
SupportedWorkModes,
|
|
917
1255
|
TermsAcceptedSchema,
|
|
918
1256
|
UserAdditionalInfoSchema,
|
|
919
1257
|
UserCertificationSchema,
|
|
@@ -921,6 +1259,7 @@ export {
|
|
|
921
1259
|
UserCoordinatorProfileSchema,
|
|
922
1260
|
UserDetailType,
|
|
923
1261
|
UserGeneralDetailSchema,
|
|
1262
|
+
UserIdAndCreatedAtSchema,
|
|
924
1263
|
UserInterestSchema,
|
|
925
1264
|
UserJobPreferencesSchema,
|
|
926
1265
|
UserLanguageSchema,
|
|
@@ -932,5 +1271,7 @@ export {
|
|
|
932
1271
|
UserSkillSchema,
|
|
933
1272
|
UserStatus,
|
|
934
1273
|
WorkExperienceSchema,
|
|
935
|
-
|
|
1274
|
+
WorkMode,
|
|
1275
|
+
dateString,
|
|
1276
|
+
getSchemaByQuestion
|
|
936
1277
|
};
|