@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/dist/index.cjs CHANGED
@@ -30,17 +30,27 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
+ AnswerChoiceType: () => AnswerChoiceType,
34
+ ApplicationReceivePreference: () => ApplicationReceivePreference,
35
+ ChoiceQuestionSchema: () => ChoiceQuestionSchema,
36
+ Common: () => Common,
37
+ CompensationType: () => CompensationType,
33
38
  CompletenessScoreSchema: () => CompletenessScoreSchema,
34
39
  ContactTypes: () => ContactTypes,
35
40
  CoordinatorPageLinkSchema: () => CoordinatorPageLinkSchema,
41
+ DISPLAY_DATE_FORMAT: () => DISPLAY_DATE_FORMAT,
42
+ DISPLAY_DATE_FORMAT_SHORT: () => DISPLAY_DATE_FORMAT_SHORT,
36
43
  DateStringSchema: () => DateStringSchema,
37
44
  DbDefaultSchema: () => DbDefaultSchema,
38
45
  DefaultPaginatedResponse: () => DefaultPaginatedResponse,
39
46
  DefaultPaginationOptions: () => DefaultPaginationOptions,
40
47
  DefaultUserRoles: () => DefaultUserRoles,
41
48
  DurationSchema: () => DurationSchema,
49
+ EMPTY_STRING: () => EMPTY_STRING,
42
50
  EducationLevel: () => EducationLevel,
43
51
  EducationSchema: () => EducationSchema,
52
+ EmployeeCount: () => EmployeeCount,
53
+ EmploymentType: () => EmploymentType,
44
54
  ExperienceLevel: () => ExperienceLevel,
45
55
  GeneraDetailFields: () => GeneraDetailFields,
46
56
  GroupManagedBy: () => GroupManagedBy,
@@ -50,7 +60,10 @@ __export(index_exports, {
50
60
  GroupStatus: () => GroupStatus,
51
61
  GroupTranslationSchema: () => GroupTranslationSchema,
52
62
  GroupVisibility: () => GroupVisibility,
63
+ InputQuestionSchema: () => InputQuestionSchema,
64
+ JobSchema: () => JobSchema,
53
65
  JobSearchUrgency: () => JobSearchUrgency,
66
+ JobStatus: () => JobStatus,
54
67
  LocationSchema: () => LocationSchema,
55
68
  MIN_SALARY_LOWER_BOUND: () => MIN_SALARY_LOWER_BOUND,
56
69
  MIN_SALARY_UPPER_BOUND: () => MIN_SALARY_UPPER_BOUND,
@@ -59,23 +72,35 @@ __export(index_exports, {
59
72
  PageType: () => PageType,
60
73
  PaginationSchema: () => PaginationSchema,
61
74
  ProficiencyLevel: () => ProficiencyLevel,
75
+ QuestionSchema: () => QuestionSchema,
76
+ QuestionType: () => QuestionType,
77
+ ReadAndAcknowledgeQuestionSchema: () => ReadAndAcknowledgeQuestionSchema,
62
78
  RecruiterPageLinkSchema: () => RecruiterPageLinkSchema,
63
79
  ReferralSource: () => ReferralSource,
64
80
  ReportReason: () => ReportReason,
65
81
  ReportSchema: () => ReportSchema,
66
82
  ResourceType: () => ResourceType,
83
+ SITEMAP_FORMAT: () => SITEMAP_FORMAT,
84
+ SYSTEM_DATE_FORMAT: () => SYSTEM_DATE_FORMAT,
67
85
  SkillSchema: () => SkillSchema,
68
86
  SocialAccount: () => SocialAccount,
69
87
  SocialAccountSchema: () => SocialAccountSchema,
70
88
  StudentCompletenessSchema: () => StudentCompletenessSchema,
71
89
  StudyType: () => StudyType,
90
+ SupportedAnswerChoiceTypes: () => SupportedAnswerChoiceTypes,
91
+ SupportedApplicationReceivePreferences: () => SupportedApplicationReceivePreferences,
92
+ SupportedCompensationTypes: () => SupportedCompensationTypes,
72
93
  SupportedContactTypes: () => SupportedContactTypes,
73
94
  SupportedEducationLevels: () => SupportedEducationLevels,
95
+ SupportedEmployeeCounts: () => SupportedEmployeeCounts,
96
+ SupportedEmploymentTypes: () => SupportedEmploymentTypes,
74
97
  SupportedExperienceLevels: () => SupportedExperienceLevels,
75
98
  SupportedJobSearchUrgencies: () => SupportedJobSearchUrgencies,
99
+ SupportedJobStatuses: () => SupportedJobStatuses,
76
100
  SupportedPageStatuses: () => SupportedPageStatuses,
77
101
  SupportedPageTypes: () => SupportedPageTypes,
78
102
  SupportedProficiencyLevels: () => SupportedProficiencyLevels,
103
+ SupportedQuestionTypes: () => SupportedQuestionTypes,
79
104
  SupportedReferralSources: () => SupportedReferralSources,
80
105
  SupportedReportReasons: () => SupportedReportReasons,
81
106
  SupportedResourceTypes: () => SupportedResourceTypes,
@@ -85,6 +110,7 @@ __export(index_exports, {
85
110
  SupportedUserProfileVisibilities: () => SupportedUserProfileVisibilities,
86
111
  SupportedUserRoles: () => SupportedUserRoles,
87
112
  SupportedUserStatuses: () => SupportedUserStatuses,
113
+ SupportedWorkModes: () => SupportedWorkModes,
88
114
  TermsAcceptedSchema: () => TermsAcceptedSchema,
89
115
  UserAdditionalInfoSchema: () => UserAdditionalInfoSchema,
90
116
  UserCertificationSchema: () => UserCertificationSchema,
@@ -92,6 +118,7 @@ __export(index_exports, {
92
118
  UserCoordinatorProfileSchema: () => UserCoordinatorProfileSchema,
93
119
  UserDetailType: () => UserDetailType,
94
120
  UserGeneralDetailSchema: () => UserGeneralDetailSchema,
121
+ UserIdAndCreatedAtSchema: () => UserIdAndCreatedAtSchema,
95
122
  UserInterestSchema: () => UserInterestSchema,
96
123
  UserJobPreferencesSchema: () => UserJobPreferencesSchema,
97
124
  UserLanguageSchema: () => UserLanguageSchema,
@@ -103,7 +130,9 @@ __export(index_exports, {
103
130
  UserSkillSchema: () => UserSkillSchema,
104
131
  UserStatus: () => UserStatus,
105
132
  WorkExperienceSchema: () => WorkExperienceSchema,
106
- dateString: () => dateString
133
+ WorkMode: () => WorkMode,
134
+ dateString: () => dateString,
135
+ getSchemaByQuestion: () => getSchemaByQuestion
107
136
  });
108
137
  module.exports = __toCommonJS(index_exports);
109
138
 
@@ -124,8 +153,34 @@ var CompletenessScoreSchema = (minScore = 50) => (0, import_yup.object)().shape(
124
153
  totalSteps: (0, import_yup.number)().min(0).default(0).label("Total Steps"),
125
154
  completedSteps: (0, import_yup.number)().min(0).default(0).label("Completed Steps")
126
155
  });
156
+ var UserIdAndCreatedAtSchema = (0, import_yup.object)().shape({
157
+ userId: (0, import_yup.string)().required().label("User Id"),
158
+ createdAt: (0, import_yup.string)().required().label("Created At")
159
+ });
127
160
 
128
161
  // src/common/common.constant.ts
162
+ var Common = /* @__PURE__ */ ((Common2) => {
163
+ Common2["Yes"] = "yes";
164
+ Common2["No"] = "no";
165
+ Common2["DateRangeOption"] = "date_range_option";
166
+ Common2["ExperienceLevel"] = "experience_level";
167
+ Common2["Company"] = "company";
168
+ Common2["EmploymentType"] = "employment_type";
169
+ Common2["WorkMode"] = "work_mode";
170
+ Common2["Location"] = "location";
171
+ Common2["CareerLevel"] = "career_level";
172
+ Common2["Category"] = "category";
173
+ Common2["Designation"] = "designation";
174
+ Common2["EducationLevel"] = "education_level";
175
+ Common2["Language"] = "language";
176
+ Common2["Skill"] = "skill";
177
+ return Common2;
178
+ })(Common || {});
179
+ var EMPTY_STRING = "eMpTyStRiNg";
180
+ var SYSTEM_DATE_FORMAT = "YYYY-MM-DD";
181
+ var DISPLAY_DATE_FORMAT = "LL";
182
+ var DISPLAY_DATE_FORMAT_SHORT = "MMMM, YYYY";
183
+ var SITEMAP_FORMAT = "YYYY-MM-DDThh:mm:ssZ";
129
184
  var StudyType = /* @__PURE__ */ ((StudyType2) => {
130
185
  StudyType2["FullTime"] = "full_time";
131
186
  StudyType2["PartTime"] = "part_time";
@@ -307,6 +362,9 @@ var GroupMembershipSchema = (0, import_yup4.object)({
307
362
  updatedAt: (0, import_yup4.number)().optional().label("Updated At")
308
363
  });
309
364
 
365
+ // src/job/job.schema.ts
366
+ var import_yup18 = require("yup");
367
+
310
368
  // src/location/location.schema.ts
311
369
  var import_yup5 = require("yup");
312
370
  var LocationSchema = (0, import_yup5.object)({
@@ -485,15 +543,309 @@ var PageSchema = (0, import_yup12.object)().shape({
485
543
  followersCount: (0, import_yup12.number)().min(0).optional().label("Followers Count")
486
544
  }).concat(CompanySchema).concat(InstituteSchema).concat(DbDefaultSchema).noUnknown(true).strict(true).required().label("Page Schema");
487
545
 
488
- // src/pagination/pagination.schema.ts
546
+ // src/skill/skill.schema.ts
489
547
  var import_yup13 = require("yup");
490
- var PaginationSchema = (0, import_yup13.object)().shape({
491
- page: (0, import_yup13.number)().required().min(1).label("Page").default(1),
492
- limit: (0, import_yup13.number)().required().min(1).max(100).label("Limit").default(10),
493
- sortBy: (0, import_yup13.string)().notOneOf([""]).optional().label("SortBy"),
494
- nextPage: (0, import_yup13.string)().optional().label("Next Page Token"),
495
- prevPage: (0, import_yup13.string)().optional().label("Previous Page Token"),
496
- sortDirection: (0, import_yup13.string)().oneOf(["asc", "desc"]).optional().label("Sort Direction")
548
+ var SkillSchema = (0, import_yup13.object)({
549
+ name: (0, import_yup13.string)().trim().required().label("Skill Name"),
550
+ logo: (0, import_yup13.object)({
551
+ light: (0, import_yup13.string)().required().label("Light Logo"),
552
+ dark: (0, import_yup13.string)().optional().nullable().label("Dark Logo")
553
+ }).optional().nullable().default(null).label("Logo"),
554
+ tags: (0, import_yup13.array)().of((0, import_yup13.string)().max(50)).max(20).optional().label("Tags")
555
+ }).concat(DbDefaultSchema).noUnknown().strict().label("Skill");
556
+
557
+ // src/question/question.constant.ts
558
+ var QuestionType = /* @__PURE__ */ ((QuestionType2) => {
559
+ QuestionType2["Input"] = "input";
560
+ QuestionType2["Choice"] = "choice";
561
+ QuestionType2["ReadAndAcknowledge"] = "readAndAcknowledge";
562
+ return QuestionType2;
563
+ })(QuestionType || {});
564
+ var SupportedQuestionTypes = Object.values(QuestionType);
565
+ var AnswerChoiceType = /* @__PURE__ */ ((AnswerChoiceType2) => {
566
+ AnswerChoiceType2["Single"] = "single";
567
+ AnswerChoiceType2["Multiple"] = "multiple";
568
+ return AnswerChoiceType2;
569
+ })(AnswerChoiceType || {});
570
+ var SupportedAnswerChoiceTypes = Object.values(AnswerChoiceType);
571
+
572
+ // src/question/question.schema.ts
573
+ var import_yup14 = require("yup");
574
+ var QuestionSchema = (0, import_yup14.object)().shape({
575
+ label: (0, import_yup14.string)().max(50).optional().label("Label"),
576
+ default: (0, import_yup14.boolean)().optional().default(false).label("Default"),
577
+ title: (0, import_yup14.string)().required().max(200).label("Title"),
578
+ type: (0, import_yup14.string)().oneOf(SupportedQuestionTypes).required().label("Type"),
579
+ isOptional: (0, import_yup14.boolean)().optional().label("Mark if the question is optional"),
580
+ readonly: (0, import_yup14.boolean)().optional().label("Readonly"),
581
+ isNew: (0, import_yup14.boolean)().optional().label("Is New")
582
+ });
583
+
584
+ // src/question/input-question.schema.ts
585
+ var import_yup15 = require("yup");
586
+ var InputQuestionSchema = QuestionSchema.concat(
587
+ (0, import_yup15.object)().shape({
588
+ type: (0, import_yup15.string)().oneOf(["input" /* Input */]).required().label("Question type"),
589
+ preferredAnswer: (0, import_yup15.string)().max(100).optional().label("Preferred Answer"),
590
+ answers: (0, import_yup15.string)().max(500).when("isOptional", {
591
+ is: (isOptional) => Boolean(isOptional),
592
+ then: (schema) => schema.optional(),
593
+ otherwise: (schema) => schema.required()
594
+ }).label("Answer")
595
+ })
596
+ );
597
+
598
+ // src/question/choice-question.schema.ts
599
+ var import_yup16 = require("yup");
600
+ var ChoicePreferredAnswerSchema = (label = "Preferred answer") => (0, import_yup16.mixed)().when("answerChoiceType", {
601
+ is: (value) => value === "multiple" /* Multiple */,
602
+ then: () => (0, import_yup16.array)((0, import_yup16.string)()).test(
603
+ "is-valid-option",
604
+ `${label} must be from the provided options`,
605
+ function(answer) {
606
+ const { options = [] } = this.parent;
607
+ if (answer && answer.length > 0) {
608
+ return answer.every((a) => options.includes(a));
609
+ }
610
+ return true;
611
+ }
612
+ ).optional().label(label),
613
+ otherwise: () => (0, import_yup16.string)().test(
614
+ "is-valid-option",
615
+ `${label} must be from the provided options`,
616
+ function(answer) {
617
+ const { options = [] } = this.parent;
618
+ return !answer || options.includes(answer);
619
+ }
620
+ ).optional().label(label)
621
+ });
622
+ var getChoiceAnswerSchema = (answerChoiceType, isOptional) => {
623
+ if (answerChoiceType === "multiple" /* Multiple */) {
624
+ const multiAnswerSchema = (0, import_yup16.array)((0, import_yup16.string)().max(500));
625
+ return isOptional ? multiAnswerSchema.optional().default([]) : multiAnswerSchema.min(1, "Select at least one option.").required("Select at least one option.").default([]);
626
+ }
627
+ const singleAnswerSchema = (0, import_yup16.string)().max(500);
628
+ return isOptional ? singleAnswerSchema.optional() : singleAnswerSchema.required("Select an option.");
629
+ };
630
+ var ChoiceQuestionSchema = QuestionSchema.concat(
631
+ (0, import_yup16.object)().shape({
632
+ type: (0, import_yup16.string)().oneOf(["choice" /* Choice */]).required().label("Question type"),
633
+ optionsFrom: (0, import_yup16.string)().oneOf(["skill" /* Skill */, "education_level" /* EducationLevel */, "experience_level" /* ExperienceLevel */]).optional().label("Option field"),
634
+ options: (0, import_yup16.array)((0, import_yup16.string)().required()).min(1).required().label("Options"),
635
+ answerChoiceType: (0, import_yup16.string)().oneOf(SupportedAnswerChoiceTypes).required().default("single" /* Single */).label("Type"),
636
+ preferredAnswer: ChoicePreferredAnswerSchema("Preferred answer"),
637
+ answers: (0, import_yup16.mixed)().when(
638
+ ["answerChoiceType", "isOptional"],
639
+ ([answerChoiceType, isOptional]) => getChoiceAnswerSchema(answerChoiceType, isOptional)
640
+ )
641
+ })
642
+ );
643
+
644
+ // src/question/read-and-acknowledge.schema.ts
645
+ var import_yup17 = require("yup");
646
+ var AcknowledgeAnswerSchema = (0, import_yup17.string)().oneOf(["yes" /* Yes */, "no" /* No */]).required("This question must be acknowledged.");
647
+ var ReadAndAcknowledgeQuestionSchema = QuestionSchema.concat(
648
+ (0, import_yup17.object)().shape({
649
+ type: (0, import_yup17.string)().oneOf(["readAndAcknowledge" /* ReadAndAcknowledge */]).required().label("Question type"),
650
+ description: (0, import_yup17.string)().max(1e4).required().label("Content"),
651
+ preferredAnswer: AcknowledgeAnswerSchema.label("Preferred Answer"),
652
+ answers: AcknowledgeAnswerSchema.label("Answer")
653
+ })
654
+ );
655
+
656
+ // src/question/question.utils.ts
657
+ var getSchemaByQuestion = (type) => {
658
+ switch (type) {
659
+ case "input" /* Input */:
660
+ return InputQuestionSchema;
661
+ case "choice" /* Choice */:
662
+ return ChoiceQuestionSchema;
663
+ case "readAndAcknowledge" /* ReadAndAcknowledge */:
664
+ return ReadAndAcknowledgeQuestionSchema;
665
+ default:
666
+ throw new Error("Unsupported schema: " + type);
667
+ }
668
+ };
669
+
670
+ // src/job/job.constant.ts
671
+ var JobStatus = /* @__PURE__ */ ((JobStatus2) => {
672
+ JobStatus2["Published"] = "published";
673
+ JobStatus2["Draft"] = "draft";
674
+ JobStatus2["Deleted"] = "deleted";
675
+ JobStatus2["Closed"] = "closed";
676
+ JobStatus2["Expired"] = "expired";
677
+ return JobStatus2;
678
+ })(JobStatus || {});
679
+ var SupportedJobStatuses = Object.values(JobStatus);
680
+ var EmploymentType = /* @__PURE__ */ ((EmploymentType2) => {
681
+ EmploymentType2["Fulltime"] = "full_time";
682
+ EmploymentType2["PartTime"] = "part_time";
683
+ EmploymentType2["Temporary"] = "temporary";
684
+ EmploymentType2["Contract"] = "contract";
685
+ EmploymentType2["Internship"] = "internship";
686
+ EmploymentType2["Freelance"] = "freelance";
687
+ EmploymentType2["Volunteer"] = "volunteer";
688
+ EmploymentType2["PerDiem"] = "per_diem";
689
+ return EmploymentType2;
690
+ })(EmploymentType || {});
691
+ var SupportedEmploymentTypes = Object.values(EmploymentType);
692
+ var WorkMode = /* @__PURE__ */ ((WorkMode2) => {
693
+ WorkMode2["OnSite"] = "on_site";
694
+ WorkMode2["Hybrid"] = "hybrid";
695
+ WorkMode2["Remote"] = "remote";
696
+ return WorkMode2;
697
+ })(WorkMode || {});
698
+ var SupportedWorkModes = Object.values(WorkMode);
699
+ var CompensationType = /* @__PURE__ */ ((CompensationType2) => {
700
+ CompensationType2["Hourly"] = "hourly";
701
+ CompensationType2["Weekly"] = "weekly";
702
+ CompensationType2["Monthly"] = "monthly";
703
+ CompensationType2["Yearly"] = "yearly";
704
+ CompensationType2["OneTime"] = "one-time";
705
+ CompensationType2["Other"] = "other";
706
+ return CompensationType2;
707
+ })(CompensationType || {});
708
+ var SupportedCompensationTypes = Object.values(CompensationType);
709
+ var EmployeeCount = /* @__PURE__ */ ((EmployeeCount2) => {
710
+ EmployeeCount2["_1_2"] = "1_2_employees";
711
+ EmployeeCount2["_3_10"] = "3_10_employees";
712
+ EmployeeCount2["_11_100"] = "11_100_employees";
713
+ EmployeeCount2["_101_1000"] = "101_1000_employees";
714
+ EmployeeCount2["_1001_5000"] = "1001_5000_employees";
715
+ EmployeeCount2["_5001_10000"] = "5001_10000_employees";
716
+ EmployeeCount2["_10001_Plus"] = "10001_plus_employees";
717
+ return EmployeeCount2;
718
+ })(EmployeeCount || {});
719
+ var SupportedEmployeeCounts = Object.values(EmployeeCount);
720
+ var ApplicationReceivePreference = /* @__PURE__ */ ((ApplicationReceivePreference2) => {
721
+ ApplicationReceivePreference2["Inbox"] = "inbox";
722
+ ApplicationReceivePreference2["Email"] = "email";
723
+ ApplicationReceivePreference2["ExternalWebsite"] = "external_website";
724
+ return ApplicationReceivePreference2;
725
+ })(ApplicationReceivePreference || {});
726
+ var SupportedApplicationReceivePreferences = Object.values(
727
+ ApplicationReceivePreference
728
+ );
729
+
730
+ // src/job/job.schema.ts
731
+ var JobSchema = (0, import_yup18.object)({
732
+ /** Unique id usable by external systems to reference the job. */
733
+ uniqueId: (0, import_yup18.string)().optional().label("Unique ID"),
734
+ /** Job title shown in listings and search. */
735
+ headline: (0, import_yup18.string)().required().min(5).max(150).label("Headline"),
736
+ /** User-friendly, unique URL identifier. */
737
+ slug: (0, import_yup18.string)().required().max(250).label("Slug"),
738
+ /** How applications are received (inbox vs external website). */
739
+ applicationReceivePreference: (0, import_yup18.mixed)().oneOf([
740
+ "inbox" /* Inbox */,
741
+ "external_website" /* ExternalWebsite */
742
+ ]).required().label("Preference"),
743
+ /** Required when applicationReceivePreference is ExternalWebsite. */
744
+ externalApplyLink: (0, import_yup18.string)().when("applicationReceivePreference", {
745
+ is: (value) => value === "external_website" /* ExternalWebsite */,
746
+ then: (schema) => schema.url().required().label("Apply for Job link"),
747
+ otherwise: (schema) => schema.optional()
748
+ }),
749
+ /** Company the job belongs to (subset of PageSchema). */
750
+ company: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company"),
751
+ /** @deprecated kept for backwards compatibility. */
752
+ designation: (0, import_yup18.string)().optional().nullable().label("Designation"),
753
+ employmentType: (0, import_yup18.string)().required().label("Employment type"),
754
+ workMode: (0, import_yup18.string)().required().label("Work mode"),
755
+ skills: (0, import_yup18.array)().of(SkillSchema.pick(["name", "logo"]).required().label("Skill")).nullable().optional().label("Skills"),
756
+ bookmarks: (0, import_yup18.array)().of(UserIdAndCreatedAtSchema).optional().label("Bookmarks"),
757
+ embedding: (0, import_yup18.object)({
758
+ vector: (0, import_yup18.array)((0, import_yup18.number)().required()).optional().label("Embedding vector"),
759
+ model: (0, import_yup18.string)().optional().label("Embedding model")
760
+ }).nullable().optional().label("Embedding"),
761
+ applicants: (0, import_yup18.array)().of(UserIdAndCreatedAtSchema).optional().label("Applicants"),
762
+ applicantCount: (0, import_yup18.number)().optional().label("Applicant count"),
763
+ externalApplicationLinkClickCount: (0, import_yup18.number)().optional().label("External application link click count"),
764
+ description: (0, import_yup18.string)().required().min(100).max(5e4).label("Description"),
765
+ descriptionMarkdown: (0, import_yup18.string)().required().label("Description Markdown"),
766
+ descriptionHTML: (0, import_yup18.string)().optional().label("Description HTML"),
767
+ /**
768
+ * Job locations. Required even for remote roles (compliance/legal). Defaults
769
+ * to an empty array; min(1) is intentionally not enforced yet.
770
+ */
771
+ locations: (0, import_yup18.array)().of(LocationSchema).default([]).label("Location"),
772
+ educationLevel: (0, import_yup18.array)((0, import_yup18.string)().oneOf(SupportedEducationLevels)).required().min(1).label("Educational level"),
773
+ /** Posting validity window (start/expiry). */
774
+ validity: DurationSchema({
775
+ format: SYSTEM_DATE_FORMAT,
776
+ startLabel: "Start Date",
777
+ endLabel: "Expiry Date"
778
+ }).label("Validity"),
779
+ /**
780
+ * When the auto-close system last re-checked this job's liveness (epoch ms).
781
+ * Server-owned operational field: set by the expiry re-crawl track when a job
782
+ * has no `validity.endDate` and must be verified by crawling its page. Guards
783
+ * re-check cadence so the same job is not re-crawled on every sweep.
784
+ */
785
+ lastExpiryCheckAt: (0, import_yup18.number)().optional().nullable().label("Last expiry check at"),
786
+ experienceLevel: (0, import_yup18.string)().oneOf(SupportedExperienceLevels).nullable().optional().label("Experience level"),
787
+ contactEmail: (0, import_yup18.string)().email().nullable().optional().label("Contact email"),
788
+ workingHoursPerWeek: (0, import_yup18.number)().nullable().optional().min(1).max(24 * 7).label("Working hours per week"),
789
+ tags: (0, import_yup18.array)().max(50).optional().label("Tags"),
790
+ /** Direct/Quick-apply questionnaire. Each item is validated against the
791
+ * concrete question schema for its `type`, with the stored `answers` omitted. */
792
+ questionnaire: (0, import_yup18.array)().of(
793
+ (0, import_yup18.lazy)((question) => {
794
+ const schema = getSchemaByQuestion(question.type);
795
+ if (question.type === "input" /* Input */) {
796
+ return schema.omit([
797
+ "answers"
798
+ ]);
799
+ } else if (question.type === "choice" /* Choice */) {
800
+ return schema.omit([
801
+ "answers"
802
+ ]);
803
+ } else if (question.type === "readAndAcknowledge" /* ReadAndAcknowledge */) {
804
+ return schema.omit(["answers"]);
805
+ }
806
+ return schema;
807
+ })
808
+ ).label("Questionnaire"),
809
+ status: (0, import_yup18.string)().oneOf(SupportedJobStatuses).default("draft" /* Draft */).required().label("Status"),
810
+ seoTags: (0, import_yup18.object)({
811
+ description: (0, import_yup18.string)().optional().label("Description"),
812
+ keywords: (0, import_yup18.array)().of((0, import_yup18.string)()).optional().label("Keywords")
813
+ }).nullable().optional().label("SEO Tags"),
814
+ jdSummary: (0, import_yup18.string)().optional().label("JD Summary"),
815
+ canCreateAlert: (0, import_yup18.boolean)().optional().label("Can create alert"),
816
+ canDirectApply: (0, import_yup18.boolean)().optional().label("Can direct apply"),
817
+ hasApplied: (0, import_yup18.boolean)().optional().label("Has applied"),
818
+ isOwner: (0, import_yup18.boolean)().optional().label("Is owner"),
819
+ hasBookmarked: (0, import_yup18.boolean)().optional().label("Has bookmarked"),
820
+ hasReported: (0, import_yup18.boolean)().optional().label("Has reported"),
821
+ ratePerHour: (0, import_yup18.number)().optional().min(0).label("Rate per hour"),
822
+ isPromoted: (0, import_yup18.boolean)().optional().label("Is promoted"),
823
+ salaryRange: (0, import_yup18.object)({
824
+ currency: (0, import_yup18.string)().required().label("Currency").default("USD"),
825
+ min: (0, import_yup18.number)().nullable().optional().min(0).label("Minimum Salary"),
826
+ max: (0, import_yup18.number)().nullable().optional().min(0).label("Maximum Salary"),
827
+ compensationType: (0, import_yup18.string)().oneOf(SupportedCompensationTypes).nullable().optional().label("Compensation Type"),
828
+ isNegotiable: (0, import_yup18.boolean)().nullable().optional().default(true).label("Is Negotiable")
829
+ }).nullable().optional().label("Salary Range"),
830
+ reports: (0, import_yup18.array)().of(UserIdAndCreatedAtSchema).optional().label("Reports"),
831
+ category: (0, import_yup18.string)().nullable().optional().label("Category"),
832
+ industry: (0, import_yup18.string)().nullable().optional().label("Industry"),
833
+ subCategories: (0, import_yup18.array)().of((0, import_yup18.string)().trim().required()).nullable().optional().label("Sub Categories"),
834
+ termsAccepted: (0, import_yup18.boolean)().oneOf([true], "Accept terms before proceeding").required("Accept terms before proceeding").label("Terms accepted"),
835
+ isFeatured: (0, import_yup18.boolean)().optional().default(false).label("Is featured"),
836
+ /** Market country codes to feature this job in; empty = global. */
837
+ featuredMarkets: (0, import_yup18.array)().of((0, import_yup18.string)().required()).optional().default([]).label("Featured markets")
838
+ }).concat(DbDefaultSchema).noUnknown().label("Job");
839
+
840
+ // src/pagination/pagination.schema.ts
841
+ var import_yup19 = require("yup");
842
+ var PaginationSchema = (0, import_yup19.object)().shape({
843
+ page: (0, import_yup19.number)().required().min(1).label("Page").default(1),
844
+ limit: (0, import_yup19.number)().required().min(1).max(100).label("Limit").default(10),
845
+ sortBy: (0, import_yup19.string)().notOneOf([""]).optional().label("SortBy"),
846
+ nextPage: (0, import_yup19.string)().optional().label("Next Page Token"),
847
+ prevPage: (0, import_yup19.string)().optional().label("Previous Page Token"),
848
+ sortDirection: (0, import_yup19.string)().oneOf(["asc", "desc"]).optional().label("Sort Direction")
497
849
  });
498
850
 
499
851
  // src/pagination/pagination.constant.ts
@@ -509,7 +861,7 @@ var DefaultPaginationOptions = {
509
861
  };
510
862
 
511
863
  // src/report/report.schema.ts
512
- var import_yup14 = require("yup");
864
+ var import_yup20 = require("yup");
513
865
 
514
866
  // src/report/report.constant.ts
515
867
  var ResourceType = /* @__PURE__ */ ((ResourceType3) => {
@@ -533,26 +885,15 @@ var ReportReason = /* @__PURE__ */ ((ReportReason3) => {
533
885
  var SupportedReportReasons = Object.values(ReportReason);
534
886
 
535
887
  // src/report/report.schema.ts
536
- var ReportSchema = (0, import_yup14.object)({
537
- type: (0, import_yup14.mixed)().oneOf(SupportedResourceTypes).required().label("Type"),
538
- resourceId: (0, import_yup14.string)().required().label("Resource ID"),
539
- reason: (0, import_yup14.mixed)().oneOf(SupportedReportReasons).required("Please choose a reason").label("Reason"),
540
- comment: (0, import_yup14.string)().max(1e3).optional().label("Comment")
888
+ var ReportSchema = (0, import_yup20.object)({
889
+ type: (0, import_yup20.mixed)().oneOf(SupportedResourceTypes).required().label("Type"),
890
+ resourceId: (0, import_yup20.string)().required().label("Resource ID"),
891
+ reason: (0, import_yup20.mixed)().oneOf(SupportedReportReasons).required("Please choose a reason").label("Reason"),
892
+ comment: (0, import_yup20.string)().max(1e3).optional().label("Comment")
541
893
  }).label("Report Schema");
542
894
 
543
- // src/skill/skill.schema.ts
544
- var import_yup15 = require("yup");
545
- var SkillSchema = (0, import_yup15.object)({
546
- name: (0, import_yup15.string)().trim().required().label("Skill Name"),
547
- logo: (0, import_yup15.object)({
548
- light: (0, import_yup15.string)().required().label("Light Logo"),
549
- dark: (0, import_yup15.string)().optional().nullable().label("Dark Logo")
550
- }).optional().nullable().default(null).label("Logo"),
551
- tags: (0, import_yup15.array)().of((0, import_yup15.string)().max(50)).max(20).optional().label("Tags")
552
- }).concat(DbDefaultSchema).noUnknown().strict().label("Skill");
553
-
554
895
  // src/user/user.schema.ts
555
- var import_yup28 = require("yup");
896
+ var import_yup33 = require("yup");
556
897
 
557
898
  // src/user/user.constant.ts
558
899
  var UserRole = /* @__PURE__ */ ((UserRole2) => {
@@ -634,51 +975,51 @@ var MIN_SALARY_LOWER_BOUND = 0;
634
975
  var MIN_SALARY_UPPER_BOUND = 1e6;
635
976
 
636
977
  // src/user/work-experience.schema.ts
637
- var import_yup16 = require("yup");
638
- var WorkExperienceSchema = (0, import_yup16.object)().shape({
978
+ var import_yup21 = require("yup");
979
+ var WorkExperienceSchema = (0, import_yup21.object)().shape({
639
980
  company: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company"),
640
- designation: (0, import_yup16.string)().trim().required().label("Designation"),
981
+ designation: (0, import_yup21.string)().trim().required().label("Designation"),
641
982
  duration: DurationSchema({
642
983
  format: "YYYY-MM",
643
984
  startLabel: "Start Date",
644
985
  endLabel: "End Date"
645
986
  }).required().label("Duration"),
646
- description: (0, import_yup16.string)().trim().max(3e3).optional().label("Description"),
987
+ description: (0, import_yup21.string)().trim().max(3e3).optional().label("Description"),
647
988
  location: LocationSchema.required().label("Location"),
648
- isRemote: (0, import_yup16.boolean)().oneOf([true, false]).default(false).label("Is Remote")
989
+ isRemote: (0, import_yup21.boolean)().oneOf([true, false]).default(false).label("Is Remote")
649
990
  }).noUnknown().strict().label("Work Experience");
650
991
 
651
992
  // src/user/education.schema.ts
652
- var import_yup17 = require("yup");
653
- var EducationSchema = (0, import_yup17.object)({
993
+ var import_yup22 = require("yup");
994
+ var EducationSchema = (0, import_yup22.object)({
654
995
  institute: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Institute"),
655
- course: (0, import_yup17.string)().trim().required().label("Course"),
656
- fieldOfStudy: (0, import_yup17.string)().trim().required().label("Field of Study"),
996
+ course: (0, import_yup22.string)().trim().required().label("Course"),
997
+ fieldOfStudy: (0, import_yup22.string)().trim().required().label("Field of Study"),
657
998
  duration: DurationSchema({
658
999
  format: "YYYY-MM",
659
1000
  startLabel: "Start Date",
660
1001
  endLabel: "End Date"
661
1002
  }).required().label("Duration"),
662
- description: (0, import_yup17.string)().trim().max(3e3).optional().label("Description"),
663
- isDistanceLearning: (0, import_yup17.boolean)().default(false).label("Is Distance Learning"),
1003
+ description: (0, import_yup22.string)().trim().max(3e3).optional().label("Description"),
1004
+ isDistanceLearning: (0, import_yup22.boolean)().default(false).label("Is Distance Learning"),
664
1005
  location: LocationSchema.required().label("Location"),
665
- studyType: (0, import_yup17.string)().oneOf(SupportedStudyTypes).trim().max(50).required().label("Study Type")
1006
+ studyType: (0, import_yup22.string)().oneOf(SupportedStudyTypes).trim().max(50).required().label("Study Type")
666
1007
  }).noUnknown().strict().label("Education");
667
1008
 
668
1009
  // src/user/user-skill.schema.ts
669
- var import_yup18 = require("yup");
670
- var UserSkillSchema = (0, import_yup18.object)({
671
- name: (0, import_yup18.string)().required().label("Name"),
672
- proficiencyLevel: (0, import_yup18.string)().oneOf(SupportedProficiencyLevels).required().label("Proficiency Level"),
1010
+ var import_yup23 = require("yup");
1011
+ var UserSkillSchema = (0, import_yup23.object)({
1012
+ name: (0, import_yup23.string)().required().label("Name"),
1013
+ proficiencyLevel: (0, import_yup23.string)().oneOf(SupportedProficiencyLevels).required().label("Proficiency Level"),
673
1014
  lastUsed: dateString().format("YYYY-MM").nullable().optional().label("Last Used")
674
1015
  }).noUnknown().strict().label("Skill");
675
1016
 
676
1017
  // src/user/project.schema.ts
677
- var import_yup19 = require("yup");
678
- var UserProjectSchema = (0, import_yup19.object)({
679
- name: (0, import_yup19.string)().trim().max(50).required().label("Name"),
680
- url: (0, import_yup19.string)().optional().label("URL"),
681
- description: (0, import_yup19.string)().trim().min(100).max(3e3).required().label("Description"),
1018
+ var import_yup24 = require("yup");
1019
+ var UserProjectSchema = (0, import_yup24.object)({
1020
+ name: (0, import_yup24.string)().trim().max(50).required().label("Name"),
1021
+ url: (0, import_yup24.string)().optional().label("URL"),
1022
+ description: (0, import_yup24.string)().trim().min(100).max(3e3).required().label("Description"),
682
1023
  duration: DurationSchema({
683
1024
  format: "YYYY-MM",
684
1025
  startLabel: "Start Date",
@@ -687,83 +1028,83 @@ var UserProjectSchema = (0, import_yup19.object)({
687
1028
  }).noUnknown().strict().label("Project");
688
1029
 
689
1030
  // src/user/user-certification.schema.ts
690
- var import_yup20 = require("yup");
691
- var UserCertificationSchema = (0, import_yup20.object)({
692
- name: (0, import_yup20.string)().trim().max(100).required().label("Name"),
1031
+ var import_yup25 = require("yup");
1032
+ var UserCertificationSchema = (0, import_yup25.object)({
1033
+ name: (0, import_yup25.string)().trim().max(100).required().label("Name"),
693
1034
  // TODO: Add validation for authority
694
- authority: (0, import_yup20.string)().trim().max(100).required().label("Authority"),
695
- licenseNumber: (0, import_yup20.string)().trim().max(50).optional().label("License Number"),
1035
+ authority: (0, import_yup25.string)().trim().max(100).required().label("Authority"),
1036
+ licenseNumber: (0, import_yup25.string)().trim().max(50).optional().label("License Number"),
696
1037
  duration: DurationSchema({
697
1038
  format: "YYYY-MM",
698
1039
  startLabel: "Start Date",
699
1040
  endLabel: "End Date"
700
1041
  }).optional().nullable().label("Duration"),
701
- url: (0, import_yup20.string)().optional().label("URL")
1042
+ url: (0, import_yup25.string)().optional().label("URL")
702
1043
  }).noUnknown().strict().label("Certification");
703
1044
 
704
1045
  // src/user/user-interest.schema.ts
705
- var import_yup21 = require("yup");
706
- var UserInterestSchema = (0, import_yup21.string)().trim().required().label("Interest");
1046
+ var import_yup26 = require("yup");
1047
+ var UserInterestSchema = (0, import_yup26.string)().trim().required().label("Interest");
707
1048
 
708
1049
  // src/user/user-language.schema.ts
709
- var import_yup22 = require("yup");
710
- var UserLanguageSchema = (0, import_yup22.object)({
711
- name: (0, import_yup22.string)().trim().required().label("Name"),
712
- proficiencyLevel: (0, import_yup22.string)().oneOf(SupportedProficiencyLevels).trim().max(50).required().label("Proficiency Level")
1050
+ var import_yup27 = require("yup");
1051
+ var UserLanguageSchema = (0, import_yup27.object)({
1052
+ name: (0, import_yup27.string)().trim().required().label("Name"),
1053
+ proficiencyLevel: (0, import_yup27.string)().oneOf(SupportedProficiencyLevels).trim().max(50).required().label("Proficiency Level")
713
1054
  }).noUnknown().strict().label("Language");
714
1055
 
715
1056
  // src/user/user-additional-info.schema.ts
716
- var import_yup23 = require("yup");
717
- var UserAdditionalInfoSchema = (0, import_yup23.object)({
718
- title: (0, import_yup23.string)().trim().max(60).required().label("Title"),
719
- description: (0, import_yup23.string)().trim().max(1e3).required().label("Description")
1057
+ var import_yup28 = require("yup");
1058
+ var UserAdditionalInfoSchema = (0, import_yup28.object)({
1059
+ title: (0, import_yup28.string)().trim().max(60).required().label("Title"),
1060
+ description: (0, import_yup28.string)().trim().max(1e3).required().label("Description")
720
1061
  }).noUnknown().strict().label("User Additional Info");
721
1062
 
722
1063
  // src/user/general-detail.schema.ts
723
- var import_yup24 = require("yup");
724
- var UserGeneralDetailSchema = (0, import_yup24.object)({
725
- id: (0, import_yup24.string)().optional().label("ID"),
726
- name: (0, import_yup24.object)().shape({
727
- first: (0, import_yup24.string)().trim().max(50).required().label("First Name"),
728
- last: (0, import_yup24.string)().trim().max(50).optional().label("Last Name")
1064
+ var import_yup29 = require("yup");
1065
+ var UserGeneralDetailSchema = (0, import_yup29.object)({
1066
+ id: (0, import_yup29.string)().optional().label("ID"),
1067
+ name: (0, import_yup29.object)().shape({
1068
+ first: (0, import_yup29.string)().trim().max(50).required().label("First Name"),
1069
+ last: (0, import_yup29.string)().trim().max(50).optional().label("Last Name")
729
1070
  }).required().label("Name"),
730
- headline: (0, import_yup24.string)().trim().max(200).optional().label("Headline"),
731
- image: (0, import_yup24.string)().optional().label("Image"),
732
- aboutMe: (0, import_yup24.string)().trim().max(3e3).optional().label("About Me"),
733
- email: (0, import_yup24.string)().required().label("Email"),
734
- mobile: (0, import_yup24.string)().nullable().optional().label("Mobile"),
735
- emailVerified: (0, import_yup24.string)().nullable().optional().label("Email Verified"),
736
- mobileVerified: (0, import_yup24.string)().nullable().optional().label("Mobile Verified"),
737
- experienceLevel: (0, import_yup24.string)().oneOf(SupportedExperienceLevels).required().label("Experience level"),
1071
+ headline: (0, import_yup29.string)().trim().max(200).optional().label("Headline"),
1072
+ image: (0, import_yup29.string)().optional().label("Image"),
1073
+ aboutMe: (0, import_yup29.string)().trim().max(3e3).optional().label("About Me"),
1074
+ email: (0, import_yup29.string)().required().label("Email"),
1075
+ mobile: (0, import_yup29.string)().nullable().optional().label("Mobile"),
1076
+ emailVerified: (0, import_yup29.string)().nullable().optional().label("Email Verified"),
1077
+ mobileVerified: (0, import_yup29.string)().nullable().optional().label("Mobile Verified"),
1078
+ experienceLevel: (0, import_yup29.string)().oneOf(SupportedExperienceLevels).required().label("Experience level"),
738
1079
  location: LocationSchema.required().label("Location"),
739
- region: (0, import_yup24.object)().shape({
740
- country: (0, import_yup24.string)().trim().required().label("Region Country"),
741
- lang: (0, import_yup24.string)().trim().required().label("Region Language")
1080
+ region: (0, import_yup29.object)().shape({
1081
+ country: (0, import_yup29.string)().trim().required().label("Region Country"),
1082
+ lang: (0, import_yup29.string)().trim().required().label("Region Language")
742
1083
  }).optional().default(void 0).label("Region"),
743
- profileVisibility: (0, import_yup24.string)().oneOf(SupportedUserProfileVisibilities).default("public" /* Public */).label("Profile Visibility")
1084
+ profileVisibility: (0, import_yup29.string)().oneOf(SupportedUserProfileVisibilities).default("public" /* Public */).label("Profile Visibility")
744
1085
  }).noUnknown().strict().label("General Detail");
745
1086
 
746
1087
  // src/user/user-job-preferences.schema.ts
747
- var import_yup25 = require("yup");
748
- var UserJobPreferencesSchema = (0, import_yup25.object)({
1088
+ var import_yup30 = require("yup");
1089
+ var UserJobPreferencesSchema = (0, import_yup30.object)({
749
1090
  /**
750
1091
  * Whether the job seeker is openly signalling availability. Surfaces the
751
1092
  * "Open to work" badge on the public profile and boosts visibility in
752
1093
  * recruiter search. Defaults to `false` - users must opt in.
753
1094
  */
754
- openToWork: (0, import_yup25.boolean)().default(false).label("Open to Work"),
1095
+ openToWork: (0, import_yup30.boolean)().default(false).label("Open to Work"),
755
1096
  /**
756
1097
  * How urgently the user is looking for their next job. Drives match scoring
757
1098
  * and can downgrade the visibility of expired or low-relevance postings for
758
1099
  * users in `passively_browsing` mode.
759
1100
  */
760
- jobSearchUrgency: (0, import_yup25.string)().oneOf(SupportedJobSearchUrgencies).required().label("Job Search Urgency"),
1101
+ jobSearchUrgency: (0, import_yup30.string)().oneOf(SupportedJobSearchUrgencies).required().label("Job Search Urgency"),
761
1102
  /**
762
1103
  * Locations the user wants to work in. Stores the full `LocationSchema`
763
1104
  * shape (country, city, state, geo, etc.) as returned by the locations
764
1105
  * autocomplete API.
765
1106
  */
766
- jobLocations: (0, import_yup25.array)().of(LocationSchema.required().label("Job Location")).min(1, "Pick at least one preferred location.").required().label("Job Locations"),
1107
+ jobLocations: (0, import_yup30.array)().of(LocationSchema.required().label("Job Location")).min(1, "Pick at least one preferred location.").required().label("Job Locations"),
767
1108
  /**
768
1109
  * Seniority levels the user wants jobs to be matched against. Multi-select
769
1110
  * (up to 2) for borderline candidates.
@@ -774,7 +1115,7 @@ var UserJobPreferencesSchema = (0, import_yup25.object)({
774
1115
  * Both reuse the same `ExperienceLevel` taxonomy from `common.constant.ts`
775
1116
  * so search/match logic doesn't have to translate between two vocabularies.
776
1117
  */
777
- targetExperienceLevels: (0, import_yup25.array)().of((0, import_yup25.string)().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"),
1118
+ targetExperienceLevels: (0, import_yup30.array)().of((0, import_yup30.string)().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"),
778
1119
  /**
779
1120
  * Specializations the user is searching for - free-form titles.
780
1121
  *
@@ -783,19 +1124,19 @@ var UserJobPreferencesSchema = (0, import_yup25.object)({
783
1124
  * surfaces a curated "Popular Roles" picker for discovery, but the user
784
1125
  * can ultimately add any title; matching/normalization happens downstream.
785
1126
  */
786
- jobRoles: (0, import_yup25.array)().of((0, import_yup25.string)().trim().max(120).required()).min(1, "Pick at least one role.").required().label("Job Roles"),
1127
+ jobRoles: (0, import_yup30.array)().of((0, import_yup30.string)().trim().max(120).required()).min(1, "Pick at least one role.").required().label("Job Roles"),
787
1128
  /**
788
1129
  * Minimum acceptable annual base salary, in `minSalaryCurrency`.
789
1130
  * Stored as an integer in the currency's major unit (e.g. dollars, not cents).
790
1131
  * Defaults to 0 ("any salary") rather than being optional - every job-seeker
791
1132
  * has a floor, even if it's zero.
792
1133
  */
793
- minSalary: (0, import_yup25.number)().integer().min(MIN_SALARY_LOWER_BOUND).max(MIN_SALARY_UPPER_BOUND).default(0).required().label("Minimum Salary"),
794
- minSalaryCurrency: (0, import_yup25.string)().oneOf(SupportedSalaryCurrencies).default("USD").required().label("Minimum Salary Currency"),
1134
+ minSalary: (0, import_yup30.number)().integer().min(MIN_SALARY_LOWER_BOUND).max(MIN_SALARY_UPPER_BOUND).default(0).required().label("Minimum Salary"),
1135
+ minSalaryCurrency: (0, import_yup30.string)().oneOf(SupportedSalaryCurrencies).default("USD").required().label("Minimum Salary Currency"),
795
1136
  /**
796
1137
  * Marketing-attribution capture from the final onboarding step.
797
1138
  */
798
- referralSource: (0, import_yup25.string)().oneOf(SupportedReferralSources).required().label("Referral Source"),
1139
+ referralSource: (0, import_yup30.string)().oneOf(SupportedReferralSources).required().label("Referral Source"),
799
1140
  /**
800
1141
  * Resumes the user has uploaded. Embedded directly on the user document
801
1142
  * (capped at 5) - they're cheap to denormalize, every wizard step that
@@ -809,25 +1150,25 @@ var UserJobPreferencesSchema = (0, import_yup25.object)({
809
1150
  * AI resume-builder flow - onboarding uploads land here, AI-built resumes
810
1151
  * live in their own collection.
811
1152
  */
812
- resumes: (0, import_yup25.array)().of(
813
- (0, import_yup25.object)({
1153
+ resumes: (0, import_yup30.array)().of(
1154
+ (0, import_yup30.object)({
814
1155
  // Stable id assigned on upload - used to address a specific entry
815
1156
  // for delete / set-primary operations without exposing the GCS URL
816
1157
  // as a route key.
817
- id: (0, import_yup25.string)().required().label("ID"),
818
- url: (0, import_yup25.string)().required().label("Resume URL"),
819
- filename: (0, import_yup25.string)().trim().max(255).optional().label("Filename"),
820
- sizeBytes: (0, import_yup25.number)().integer().min(0).optional().label("Size (bytes)"),
821
- mimeType: (0, import_yup25.string)().trim().max(120).optional().label("MIME Type"),
822
- uploadedAt: (0, import_yup25.date)().required().label("Uploaded At"),
823
- isPrimary: (0, import_yup25.boolean)().default(false).label("Is Primary")
1158
+ id: (0, import_yup30.string)().required().label("ID"),
1159
+ url: (0, import_yup30.string)().required().label("Resume URL"),
1160
+ filename: (0, import_yup30.string)().trim().max(255).optional().label("Filename"),
1161
+ sizeBytes: (0, import_yup30.number)().integer().min(0).optional().label("Size (bytes)"),
1162
+ mimeType: (0, import_yup30.string)().trim().max(120).optional().label("MIME Type"),
1163
+ uploadedAt: (0, import_yup30.date)().required().label("Uploaded At"),
1164
+ isPrimary: (0, import_yup30.boolean)().default(false).label("Is Primary")
824
1165
  }).noUnknown().strict().label("Resume")
825
1166
  ).max(5, "You can keep at most 5 resumes on file.").default([]).label("Resumes"),
826
1167
  /**
827
1168
  * Set when the user finishes the wizard's last step. Acts as the gate the
828
1169
  * onboarding hook checks to redirect users who haven't completed setup.
829
1170
  */
830
- onboardingCompletedAt: (0, import_yup25.date)().nullable().optional().label("Onboarding Completed At"),
1171
+ onboardingCompletedAt: (0, import_yup30.date)().nullable().optional().label("Onboarding Completed At"),
831
1172
  /**
832
1173
  * Parser-suggested values for wizard fields, written by the resume-upload
833
1174
  * flow. Every parser-derived field lands here - including profile-shaped
@@ -847,106 +1188,106 @@ var UserJobPreferencesSchema = (0, import_yup25.object)({
847
1188
  * APIs. If `user.<field>` is empty there, the correct behavior is empty,
848
1189
  * because the user has not confirmed it yet.
849
1190
  */
850
- pendingPrefill: (0, import_yup25.object)({
851
- headline: (0, import_yup25.string)().trim().optional().label("Pending Headline"),
852
- aboutMe: (0, import_yup25.string)().trim().optional().label("Pending About Me"),
853
- mobile: (0, import_yup25.string)().trim().optional().label("Pending Mobile"),
1191
+ pendingPrefill: (0, import_yup30.object)({
1192
+ headline: (0, import_yup30.string)().trim().optional().label("Pending Headline"),
1193
+ aboutMe: (0, import_yup30.string)().trim().optional().label("Pending About Me"),
1194
+ mobile: (0, import_yup30.string)().trim().optional().label("Pending Mobile"),
854
1195
  location: LocationSchema.optional().default(void 0).label("Pending Location"),
855
- experienceLevel: (0, import_yup25.string)().oneOf(SupportedExperienceLevels).optional().label("Pending Experience Level"),
856
- socialAccounts: (0, import_yup25.array)().of(SocialAccountSchema.required()).optional().label("Pending Social Accounts"),
857
- workExperiences: (0, import_yup25.array)().of(WorkExperienceSchema.required()).optional().label("Pending Work Experiences"),
858
- educations: (0, import_yup25.array)().of(EducationSchema.required()).optional().label("Pending Educations")
1196
+ experienceLevel: (0, import_yup30.string)().oneOf(SupportedExperienceLevels).optional().label("Pending Experience Level"),
1197
+ socialAccounts: (0, import_yup30.array)().of(SocialAccountSchema.required()).optional().label("Pending Social Accounts"),
1198
+ workExperiences: (0, import_yup30.array)().of(WorkExperienceSchema.required()).optional().label("Pending Work Experiences"),
1199
+ educations: (0, import_yup30.array)().of(EducationSchema.required()).optional().label("Pending Educations")
859
1200
  }).nullable().optional().default(void 0).label("Pending Prefill")
860
1201
  }).noUnknown().strict().label("User Job Preferences Schema");
861
1202
 
862
1203
  // src/user/user-recruiter-profile.schema.ts
863
- var import_yup26 = require("yup");
864
- var RecruiterPageLinkSchema = (0, import_yup26.object)({
1204
+ var import_yup31 = require("yup");
1205
+ var RecruiterPageLinkSchema = (0, import_yup31.object)({
865
1206
  page: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company Page"),
866
- jobTitle: (0, import_yup26.string)().trim().max(100).optional().label("Job Title")
1207
+ jobTitle: (0, import_yup31.string)().trim().max(100).optional().label("Job Title")
867
1208
  }).noUnknown().strict().label("Recruiter Page Link");
868
- var UserRecruiterProfileSchema = (0, import_yup26.object)({
869
- recruiterProfile: (0, import_yup26.object)({
870
- hiringFor: (0, import_yup26.array)().of(RecruiterPageLinkSchema).default([]).label("Hiring For")
1209
+ var UserRecruiterProfileSchema = (0, import_yup31.object)({
1210
+ recruiterProfile: (0, import_yup31.object)({
1211
+ hiringFor: (0, import_yup31.array)().of(RecruiterPageLinkSchema).default([]).label("Hiring For")
871
1212
  }).optional().default(void 0).label("Recruiter Profile")
872
1213
  }).noUnknown().strict().label("User Recruiter Profile");
873
1214
 
874
1215
  // src/user/user-coordinator-profile.schema.ts
875
- var import_yup27 = require("yup");
876
- var CoordinatorPageLinkSchema = (0, import_yup27.object)({
1216
+ var import_yup32 = require("yup");
1217
+ var CoordinatorPageLinkSchema = (0, import_yup32.object)({
877
1218
  page: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Institute Page"),
878
- jobTitle: (0, import_yup27.string)().trim().max(100).optional().label("Job Title")
1219
+ jobTitle: (0, import_yup32.string)().trim().max(100).optional().label("Job Title")
879
1220
  }).noUnknown().strict().label("Coordinator Page Link");
880
- var UserCoordinatorProfileSchema = (0, import_yup27.object)({
881
- coordinatorProfile: (0, import_yup27.object)({
882
- coordinatesAt: (0, import_yup27.array)().of(CoordinatorPageLinkSchema).default([]).label("Coordinates At")
1221
+ var UserCoordinatorProfileSchema = (0, import_yup32.object)({
1222
+ coordinatorProfile: (0, import_yup32.object)({
1223
+ coordinatesAt: (0, import_yup32.array)().of(CoordinatorPageLinkSchema).default([]).label("Coordinates At")
883
1224
  }).optional().default(void 0).label("Coordinator Profile")
884
1225
  }).noUnknown().strict().label("User Coordinator Profile");
885
1226
 
886
1227
  // src/user/user.schema.ts
887
- var UserSchema = (0, import_yup28.object)({
1228
+ var UserSchema = (0, import_yup33.object)({
888
1229
  /**
889
1230
  * Related auth account id from auth Server (e.g. Better auth https://auth.thejob.dev)
890
1231
  */
891
- authAccountId: (0, import_yup28.string)().required().label("Auth Account ID"),
1232
+ authAccountId: (0, import_yup33.string)().required().label("Auth Account ID"),
892
1233
  /**
893
1234
  * Social media information about the user (e.g. LinkedIn, GitHub, etc.)
894
1235
  */
895
- socialAccounts: (0, import_yup28.array)().of(SocialAccountSchema).default([]).label("Social Accounts"),
1236
+ socialAccounts: (0, import_yup33.array)().of(SocialAccountSchema).default([]).label("Social Accounts"),
896
1237
  /**
897
1238
  * Work experience information about the user
898
1239
  */
899
- workExperiences: (0, import_yup28.array)().of(WorkExperienceSchema).required().default([]).label("Work Experiences"),
1240
+ workExperiences: (0, import_yup33.array)().of(WorkExperienceSchema).required().default([]).label("Work Experiences"),
900
1241
  /**
901
1242
  * Education information about the user
902
1243
  */
903
- educations: (0, import_yup28.array)().of(EducationSchema).required().default([]).label("Educations"),
1244
+ educations: (0, import_yup33.array)().of(EducationSchema).required().default([]).label("Educations"),
904
1245
  /**
905
1246
  * Skills information about the user
906
1247
  */
907
- skills: (0, import_yup28.array)().of(UserSkillSchema).required().default([]).label("Skills"),
1248
+ skills: (0, import_yup33.array)().of(UserSkillSchema).required().default([]).label("Skills"),
908
1249
  /**
909
1250
  * Projects information about the user
910
1251
  */
911
- projects: (0, import_yup28.array)().of(UserProjectSchema).default([]).label("Projects"),
1252
+ projects: (0, import_yup33.array)().of(UserProjectSchema).default([]).label("Projects"),
912
1253
  /**
913
1254
  * Certifications information about the user
914
1255
  */
915
- certifications: (0, import_yup28.array)().of(UserCertificationSchema).default([]).label("Certifications"),
1256
+ certifications: (0, import_yup33.array)().of(UserCertificationSchema).default([]).label("Certifications"),
916
1257
  /**
917
1258
  * Interests information about the user.
918
1259
  */
919
- interests: (0, import_yup28.array)().of(UserInterestSchema).optional().default([]).label("Interests"),
1260
+ interests: (0, import_yup33.array)().of(UserInterestSchema).optional().default([]).label("Interests"),
920
1261
  /**
921
1262
  * Languages information about the user
922
1263
  */
923
- languages: (0, import_yup28.array)().of(UserLanguageSchema).required().default([]).label("Languages"),
1264
+ languages: (0, import_yup33.array)().of(UserLanguageSchema).required().default([]).label("Languages"),
924
1265
  /**
925
1266
  * Additional information about the user
926
1267
  */
927
- additionalInfo: (0, import_yup28.array)().of(UserAdditionalInfoSchema).default([]).label("Additional Information"),
1268
+ additionalInfo: (0, import_yup33.array)().of(UserAdditionalInfoSchema).default([]).label("Additional Information"),
928
1269
  /**
929
1270
  * Status of the user account
930
1271
  */
931
- status: (0, import_yup28.string)().oneOf(SupportedUserStatuses).required().label("Status"),
1272
+ status: (0, import_yup33.string)().oneOf(SupportedUserStatuses).required().label("Status"),
932
1273
  /**
933
1274
  * Roles assigned to the user
934
1275
  */
935
- roles: (0, import_yup28.array)().of((0, import_yup28.string)().oneOf(SupportedUserRoles)).required().default(DefaultUserRoles).label("Roles"),
1276
+ roles: (0, import_yup33.array)().of((0, import_yup33.string)().oneOf(SupportedUserRoles)).required().default(DefaultUserRoles).label("Roles"),
936
1277
  /**
937
1278
  * Vector embedding of the user's profile for semantic/hybrid search.
938
1279
  * Generated from a structured summary of skills, experience, education, etc.
939
1280
  * Only generated for public profiles with sufficient completeness (≥60%).
940
1281
  */
941
- embedding: (0, import_yup28.object)({
942
- vector: (0, import_yup28.array)((0, import_yup28.number)().required()).optional().label("Embedding vector"),
943
- model: (0, import_yup28.string)().optional().label("Embedding model")
1282
+ embedding: (0, import_yup33.object)({
1283
+ vector: (0, import_yup33.array)((0, import_yup33.number)().required()).optional().label("Embedding vector"),
1284
+ model: (0, import_yup33.string)().optional().label("Embedding model")
944
1285
  }).nullable().optional().label("Embedding")
945
1286
  }).concat(UserGeneralDetailSchema).concat(UserJobPreferencesSchema).concat(UserRecruiterProfileSchema).concat(UserCoordinatorProfileSchema).noUnknown().strict().label("User Schema");
946
1287
 
947
1288
  // src/user/user-completeness.schema.ts
948
- var import_yup29 = require("yup");
949
- var UserCompletenessSchema = (0, import_yup29.object)({
1289
+ var import_yup34 = require("yup");
1290
+ var UserCompletenessSchema = (0, import_yup34.object)({
950
1291
  additionalInfo: CompletenessScoreSchema(0).label("Additional Info"),
951
1292
  // Optional
952
1293
  certifications: CompletenessScoreSchema(0).label("Certifications"),
@@ -969,17 +1310,27 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
969
1310
  ]);
970
1311
  // Annotate the CommonJS export names for ESM import in node:
971
1312
  0 && (module.exports = {
1313
+ AnswerChoiceType,
1314
+ ApplicationReceivePreference,
1315
+ ChoiceQuestionSchema,
1316
+ Common,
1317
+ CompensationType,
972
1318
  CompletenessScoreSchema,
973
1319
  ContactTypes,
974
1320
  CoordinatorPageLinkSchema,
1321
+ DISPLAY_DATE_FORMAT,
1322
+ DISPLAY_DATE_FORMAT_SHORT,
975
1323
  DateStringSchema,
976
1324
  DbDefaultSchema,
977
1325
  DefaultPaginatedResponse,
978
1326
  DefaultPaginationOptions,
979
1327
  DefaultUserRoles,
980
1328
  DurationSchema,
1329
+ EMPTY_STRING,
981
1330
  EducationLevel,
982
1331
  EducationSchema,
1332
+ EmployeeCount,
1333
+ EmploymentType,
983
1334
  ExperienceLevel,
984
1335
  GeneraDetailFields,
985
1336
  GroupManagedBy,
@@ -989,7 +1340,10 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
989
1340
  GroupStatus,
990
1341
  GroupTranslationSchema,
991
1342
  GroupVisibility,
1343
+ InputQuestionSchema,
1344
+ JobSchema,
992
1345
  JobSearchUrgency,
1346
+ JobStatus,
993
1347
  LocationSchema,
994
1348
  MIN_SALARY_LOWER_BOUND,
995
1349
  MIN_SALARY_UPPER_BOUND,
@@ -998,23 +1352,35 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
998
1352
  PageType,
999
1353
  PaginationSchema,
1000
1354
  ProficiencyLevel,
1355
+ QuestionSchema,
1356
+ QuestionType,
1357
+ ReadAndAcknowledgeQuestionSchema,
1001
1358
  RecruiterPageLinkSchema,
1002
1359
  ReferralSource,
1003
1360
  ReportReason,
1004
1361
  ReportSchema,
1005
1362
  ResourceType,
1363
+ SITEMAP_FORMAT,
1364
+ SYSTEM_DATE_FORMAT,
1006
1365
  SkillSchema,
1007
1366
  SocialAccount,
1008
1367
  SocialAccountSchema,
1009
1368
  StudentCompletenessSchema,
1010
1369
  StudyType,
1370
+ SupportedAnswerChoiceTypes,
1371
+ SupportedApplicationReceivePreferences,
1372
+ SupportedCompensationTypes,
1011
1373
  SupportedContactTypes,
1012
1374
  SupportedEducationLevels,
1375
+ SupportedEmployeeCounts,
1376
+ SupportedEmploymentTypes,
1013
1377
  SupportedExperienceLevels,
1014
1378
  SupportedJobSearchUrgencies,
1379
+ SupportedJobStatuses,
1015
1380
  SupportedPageStatuses,
1016
1381
  SupportedPageTypes,
1017
1382
  SupportedProficiencyLevels,
1383
+ SupportedQuestionTypes,
1018
1384
  SupportedReferralSources,
1019
1385
  SupportedReportReasons,
1020
1386
  SupportedResourceTypes,
@@ -1024,6 +1390,7 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
1024
1390
  SupportedUserProfileVisibilities,
1025
1391
  SupportedUserRoles,
1026
1392
  SupportedUserStatuses,
1393
+ SupportedWorkModes,
1027
1394
  TermsAcceptedSchema,
1028
1395
  UserAdditionalInfoSchema,
1029
1396
  UserCertificationSchema,
@@ -1031,6 +1398,7 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
1031
1398
  UserCoordinatorProfileSchema,
1032
1399
  UserDetailType,
1033
1400
  UserGeneralDetailSchema,
1401
+ UserIdAndCreatedAtSchema,
1034
1402
  UserInterestSchema,
1035
1403
  UserJobPreferencesSchema,
1036
1404
  UserLanguageSchema,
@@ -1042,5 +1410,7 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
1042
1410
  UserSkillSchema,
1043
1411
  UserStatus,
1044
1412
  WorkExperienceSchema,
1045
- dateString
1413
+ WorkMode,
1414
+ dateString,
1415
+ getSchemaByQuestion
1046
1416
  });