@thejob/schema 2.0.1 → 2.0.2

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,302 @@ 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
+ experienceLevel: (0, import_yup18.string)().oneOf(SupportedExperienceLevels).nullable().optional().label("Experience level"),
780
+ contactEmail: (0, import_yup18.string)().email().nullable().optional().label("Contact email"),
781
+ workingHoursPerWeek: (0, import_yup18.number)().nullable().optional().min(1).max(24 * 7).label("Working hours per week"),
782
+ tags: (0, import_yup18.array)().max(50).optional().label("Tags"),
783
+ /** Direct/Quick-apply questionnaire. Each item is validated against the
784
+ * concrete question schema for its `type`, with the stored `answers` omitted. */
785
+ questionnaire: (0, import_yup18.array)().of(
786
+ (0, import_yup18.lazy)((question) => {
787
+ const schema = getSchemaByQuestion(question.type);
788
+ if (question.type === "input" /* Input */) {
789
+ return schema.omit([
790
+ "answers"
791
+ ]);
792
+ } else if (question.type === "choice" /* Choice */) {
793
+ return schema.omit([
794
+ "answers"
795
+ ]);
796
+ } else if (question.type === "readAndAcknowledge" /* ReadAndAcknowledge */) {
797
+ return schema.omit(["answers"]);
798
+ }
799
+ return schema;
800
+ })
801
+ ).label("Questionnaire"),
802
+ status: (0, import_yup18.string)().oneOf(SupportedJobStatuses).default("draft" /* Draft */).required().label("Status"),
803
+ seoTags: (0, import_yup18.object)({
804
+ description: (0, import_yup18.string)().optional().label("Description"),
805
+ keywords: (0, import_yup18.array)().of((0, import_yup18.string)()).optional().label("Keywords")
806
+ }).nullable().optional().label("SEO Tags"),
807
+ jdSummary: (0, import_yup18.string)().optional().label("JD Summary"),
808
+ canCreateAlert: (0, import_yup18.boolean)().optional().label("Can create alert"),
809
+ canDirectApply: (0, import_yup18.boolean)().optional().label("Can direct apply"),
810
+ hasApplied: (0, import_yup18.boolean)().optional().label("Has applied"),
811
+ isOwner: (0, import_yup18.boolean)().optional().label("Is owner"),
812
+ hasBookmarked: (0, import_yup18.boolean)().optional().label("Has bookmarked"),
813
+ hasReported: (0, import_yup18.boolean)().optional().label("Has reported"),
814
+ ratePerHour: (0, import_yup18.number)().optional().min(0).label("Rate per hour"),
815
+ isPromoted: (0, import_yup18.boolean)().optional().label("Is promoted"),
816
+ salaryRange: (0, import_yup18.object)({
817
+ currency: (0, import_yup18.string)().required().label("Currency").default("USD"),
818
+ min: (0, import_yup18.number)().nullable().optional().min(0).label("Minimum Salary"),
819
+ max: (0, import_yup18.number)().nullable().optional().min(0).label("Maximum Salary"),
820
+ compensationType: (0, import_yup18.string)().oneOf(SupportedCompensationTypes).nullable().optional().label("Compensation Type"),
821
+ isNegotiable: (0, import_yup18.boolean)().nullable().optional().default(true).label("Is Negotiable")
822
+ }).nullable().optional().label("Salary Range"),
823
+ reports: (0, import_yup18.array)().of(UserIdAndCreatedAtSchema).optional().label("Reports"),
824
+ category: (0, import_yup18.string)().nullable().optional().label("Category"),
825
+ industry: (0, import_yup18.string)().nullable().optional().label("Industry"),
826
+ subCategories: (0, import_yup18.array)().of((0, import_yup18.string)().trim().required()).nullable().optional().label("Sub Categories"),
827
+ termsAccepted: (0, import_yup18.boolean)().oneOf([true], "Accept terms before proceeding").required("Accept terms before proceeding").label("Terms accepted"),
828
+ isFeatured: (0, import_yup18.boolean)().optional().default(false).label("Is featured"),
829
+ /** Market country codes to feature this job in; empty = global. */
830
+ featuredMarkets: (0, import_yup18.array)().of((0, import_yup18.string)().required()).optional().default([]).label("Featured markets")
831
+ }).concat(DbDefaultSchema).noUnknown().label("Job");
832
+
833
+ // src/pagination/pagination.schema.ts
834
+ var import_yup19 = require("yup");
835
+ var PaginationSchema = (0, import_yup19.object)().shape({
836
+ page: (0, import_yup19.number)().required().min(1).label("Page").default(1),
837
+ limit: (0, import_yup19.number)().required().min(1).max(100).label("Limit").default(10),
838
+ sortBy: (0, import_yup19.string)().notOneOf([""]).optional().label("SortBy"),
839
+ nextPage: (0, import_yup19.string)().optional().label("Next Page Token"),
840
+ prevPage: (0, import_yup19.string)().optional().label("Previous Page Token"),
841
+ sortDirection: (0, import_yup19.string)().oneOf(["asc", "desc"]).optional().label("Sort Direction")
497
842
  });
498
843
 
499
844
  // src/pagination/pagination.constant.ts
@@ -509,7 +854,7 @@ var DefaultPaginationOptions = {
509
854
  };
510
855
 
511
856
  // src/report/report.schema.ts
512
- var import_yup14 = require("yup");
857
+ var import_yup20 = require("yup");
513
858
 
514
859
  // src/report/report.constant.ts
515
860
  var ResourceType = /* @__PURE__ */ ((ResourceType3) => {
@@ -533,26 +878,15 @@ var ReportReason = /* @__PURE__ */ ((ReportReason3) => {
533
878
  var SupportedReportReasons = Object.values(ReportReason);
534
879
 
535
880
  // 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")
881
+ var ReportSchema = (0, import_yup20.object)({
882
+ type: (0, import_yup20.mixed)().oneOf(SupportedResourceTypes).required().label("Type"),
883
+ resourceId: (0, import_yup20.string)().required().label("Resource ID"),
884
+ reason: (0, import_yup20.mixed)().oneOf(SupportedReportReasons).required("Please choose a reason").label("Reason"),
885
+ comment: (0, import_yup20.string)().max(1e3).optional().label("Comment")
541
886
  }).label("Report Schema");
542
887
 
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
888
  // src/user/user.schema.ts
555
- var import_yup28 = require("yup");
889
+ var import_yup33 = require("yup");
556
890
 
557
891
  // src/user/user.constant.ts
558
892
  var UserRole = /* @__PURE__ */ ((UserRole2) => {
@@ -634,51 +968,51 @@ var MIN_SALARY_LOWER_BOUND = 0;
634
968
  var MIN_SALARY_UPPER_BOUND = 1e6;
635
969
 
636
970
  // src/user/work-experience.schema.ts
637
- var import_yup16 = require("yup");
638
- var WorkExperienceSchema = (0, import_yup16.object)().shape({
971
+ var import_yup21 = require("yup");
972
+ var WorkExperienceSchema = (0, import_yup21.object)().shape({
639
973
  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"),
974
+ designation: (0, import_yup21.string)().trim().required().label("Designation"),
641
975
  duration: DurationSchema({
642
976
  format: "YYYY-MM",
643
977
  startLabel: "Start Date",
644
978
  endLabel: "End Date"
645
979
  }).required().label("Duration"),
646
- description: (0, import_yup16.string)().trim().max(3e3).optional().label("Description"),
980
+ description: (0, import_yup21.string)().trim().max(3e3).optional().label("Description"),
647
981
  location: LocationSchema.required().label("Location"),
648
- isRemote: (0, import_yup16.boolean)().oneOf([true, false]).default(false).label("Is Remote")
982
+ isRemote: (0, import_yup21.boolean)().oneOf([true, false]).default(false).label("Is Remote")
649
983
  }).noUnknown().strict().label("Work Experience");
650
984
 
651
985
  // src/user/education.schema.ts
652
- var import_yup17 = require("yup");
653
- var EducationSchema = (0, import_yup17.object)({
986
+ var import_yup22 = require("yup");
987
+ var EducationSchema = (0, import_yup22.object)({
654
988
  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"),
989
+ course: (0, import_yup22.string)().trim().required().label("Course"),
990
+ fieldOfStudy: (0, import_yup22.string)().trim().required().label("Field of Study"),
657
991
  duration: DurationSchema({
658
992
  format: "YYYY-MM",
659
993
  startLabel: "Start Date",
660
994
  endLabel: "End Date"
661
995
  }).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"),
996
+ description: (0, import_yup22.string)().trim().max(3e3).optional().label("Description"),
997
+ isDistanceLearning: (0, import_yup22.boolean)().default(false).label("Is Distance Learning"),
664
998
  location: LocationSchema.required().label("Location"),
665
- studyType: (0, import_yup17.string)().oneOf(SupportedStudyTypes).trim().max(50).required().label("Study Type")
999
+ studyType: (0, import_yup22.string)().oneOf(SupportedStudyTypes).trim().max(50).required().label("Study Type")
666
1000
  }).noUnknown().strict().label("Education");
667
1001
 
668
1002
  // 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"),
1003
+ var import_yup23 = require("yup");
1004
+ var UserSkillSchema = (0, import_yup23.object)({
1005
+ name: (0, import_yup23.string)().required().label("Name"),
1006
+ proficiencyLevel: (0, import_yup23.string)().oneOf(SupportedProficiencyLevels).required().label("Proficiency Level"),
673
1007
  lastUsed: dateString().format("YYYY-MM").nullable().optional().label("Last Used")
674
1008
  }).noUnknown().strict().label("Skill");
675
1009
 
676
1010
  // 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"),
1011
+ var import_yup24 = require("yup");
1012
+ var UserProjectSchema = (0, import_yup24.object)({
1013
+ name: (0, import_yup24.string)().trim().max(50).required().label("Name"),
1014
+ url: (0, import_yup24.string)().optional().label("URL"),
1015
+ description: (0, import_yup24.string)().trim().min(100).max(3e3).required().label("Description"),
682
1016
  duration: DurationSchema({
683
1017
  format: "YYYY-MM",
684
1018
  startLabel: "Start Date",
@@ -687,83 +1021,83 @@ var UserProjectSchema = (0, import_yup19.object)({
687
1021
  }).noUnknown().strict().label("Project");
688
1022
 
689
1023
  // 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"),
1024
+ var import_yup25 = require("yup");
1025
+ var UserCertificationSchema = (0, import_yup25.object)({
1026
+ name: (0, import_yup25.string)().trim().max(100).required().label("Name"),
693
1027
  // 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"),
1028
+ authority: (0, import_yup25.string)().trim().max(100).required().label("Authority"),
1029
+ licenseNumber: (0, import_yup25.string)().trim().max(50).optional().label("License Number"),
696
1030
  duration: DurationSchema({
697
1031
  format: "YYYY-MM",
698
1032
  startLabel: "Start Date",
699
1033
  endLabel: "End Date"
700
1034
  }).optional().nullable().label("Duration"),
701
- url: (0, import_yup20.string)().optional().label("URL")
1035
+ url: (0, import_yup25.string)().optional().label("URL")
702
1036
  }).noUnknown().strict().label("Certification");
703
1037
 
704
1038
  // src/user/user-interest.schema.ts
705
- var import_yup21 = require("yup");
706
- var UserInterestSchema = (0, import_yup21.string)().trim().required().label("Interest");
1039
+ var import_yup26 = require("yup");
1040
+ var UserInterestSchema = (0, import_yup26.string)().trim().required().label("Interest");
707
1041
 
708
1042
  // 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")
1043
+ var import_yup27 = require("yup");
1044
+ var UserLanguageSchema = (0, import_yup27.object)({
1045
+ name: (0, import_yup27.string)().trim().required().label("Name"),
1046
+ proficiencyLevel: (0, import_yup27.string)().oneOf(SupportedProficiencyLevels).trim().max(50).required().label("Proficiency Level")
713
1047
  }).noUnknown().strict().label("Language");
714
1048
 
715
1049
  // 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")
1050
+ var import_yup28 = require("yup");
1051
+ var UserAdditionalInfoSchema = (0, import_yup28.object)({
1052
+ title: (0, import_yup28.string)().trim().max(60).required().label("Title"),
1053
+ description: (0, import_yup28.string)().trim().max(1e3).required().label("Description")
720
1054
  }).noUnknown().strict().label("User Additional Info");
721
1055
 
722
1056
  // 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")
1057
+ var import_yup29 = require("yup");
1058
+ var UserGeneralDetailSchema = (0, import_yup29.object)({
1059
+ id: (0, import_yup29.string)().optional().label("ID"),
1060
+ name: (0, import_yup29.object)().shape({
1061
+ first: (0, import_yup29.string)().trim().max(50).required().label("First Name"),
1062
+ last: (0, import_yup29.string)().trim().max(50).optional().label("Last Name")
729
1063
  }).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"),
1064
+ headline: (0, import_yup29.string)().trim().max(200).optional().label("Headline"),
1065
+ image: (0, import_yup29.string)().optional().label("Image"),
1066
+ aboutMe: (0, import_yup29.string)().trim().max(3e3).optional().label("About Me"),
1067
+ email: (0, import_yup29.string)().required().label("Email"),
1068
+ mobile: (0, import_yup29.string)().nullable().optional().label("Mobile"),
1069
+ emailVerified: (0, import_yup29.string)().nullable().optional().label("Email Verified"),
1070
+ mobileVerified: (0, import_yup29.string)().nullable().optional().label("Mobile Verified"),
1071
+ experienceLevel: (0, import_yup29.string)().oneOf(SupportedExperienceLevels).required().label("Experience level"),
738
1072
  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")
1073
+ region: (0, import_yup29.object)().shape({
1074
+ country: (0, import_yup29.string)().trim().required().label("Region Country"),
1075
+ lang: (0, import_yup29.string)().trim().required().label("Region Language")
742
1076
  }).optional().default(void 0).label("Region"),
743
- profileVisibility: (0, import_yup24.string)().oneOf(SupportedUserProfileVisibilities).default("public" /* Public */).label("Profile Visibility")
1077
+ profileVisibility: (0, import_yup29.string)().oneOf(SupportedUserProfileVisibilities).default("public" /* Public */).label("Profile Visibility")
744
1078
  }).noUnknown().strict().label("General Detail");
745
1079
 
746
1080
  // src/user/user-job-preferences.schema.ts
747
- var import_yup25 = require("yup");
748
- var UserJobPreferencesSchema = (0, import_yup25.object)({
1081
+ var import_yup30 = require("yup");
1082
+ var UserJobPreferencesSchema = (0, import_yup30.object)({
749
1083
  /**
750
1084
  * Whether the job seeker is openly signalling availability. Surfaces the
751
1085
  * "Open to work" badge on the public profile and boosts visibility in
752
1086
  * recruiter search. Defaults to `false` - users must opt in.
753
1087
  */
754
- openToWork: (0, import_yup25.boolean)().default(false).label("Open to Work"),
1088
+ openToWork: (0, import_yup30.boolean)().default(false).label("Open to Work"),
755
1089
  /**
756
1090
  * How urgently the user is looking for their next job. Drives match scoring
757
1091
  * and can downgrade the visibility of expired or low-relevance postings for
758
1092
  * users in `passively_browsing` mode.
759
1093
  */
760
- jobSearchUrgency: (0, import_yup25.string)().oneOf(SupportedJobSearchUrgencies).required().label("Job Search Urgency"),
1094
+ jobSearchUrgency: (0, import_yup30.string)().oneOf(SupportedJobSearchUrgencies).required().label("Job Search Urgency"),
761
1095
  /**
762
1096
  * Locations the user wants to work in. Stores the full `LocationSchema`
763
1097
  * shape (country, city, state, geo, etc.) as returned by the locations
764
1098
  * autocomplete API.
765
1099
  */
766
- jobLocations: (0, import_yup25.array)().of(LocationSchema.required().label("Job Location")).min(1, "Pick at least one preferred location.").required().label("Job Locations"),
1100
+ jobLocations: (0, import_yup30.array)().of(LocationSchema.required().label("Job Location")).min(1, "Pick at least one preferred location.").required().label("Job Locations"),
767
1101
  /**
768
1102
  * Seniority levels the user wants jobs to be matched against. Multi-select
769
1103
  * (up to 2) for borderline candidates.
@@ -774,7 +1108,7 @@ var UserJobPreferencesSchema = (0, import_yup25.object)({
774
1108
  * Both reuse the same `ExperienceLevel` taxonomy from `common.constant.ts`
775
1109
  * so search/match logic doesn't have to translate between two vocabularies.
776
1110
  */
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"),
1111
+ 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
1112
  /**
779
1113
  * Specializations the user is searching for - free-form titles.
780
1114
  *
@@ -783,19 +1117,19 @@ var UserJobPreferencesSchema = (0, import_yup25.object)({
783
1117
  * surfaces a curated "Popular Roles" picker for discovery, but the user
784
1118
  * can ultimately add any title; matching/normalization happens downstream.
785
1119
  */
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"),
1120
+ 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
1121
  /**
788
1122
  * Minimum acceptable annual base salary, in `minSalaryCurrency`.
789
1123
  * Stored as an integer in the currency's major unit (e.g. dollars, not cents).
790
1124
  * Defaults to 0 ("any salary") rather than being optional - every job-seeker
791
1125
  * has a floor, even if it's zero.
792
1126
  */
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"),
1127
+ minSalary: (0, import_yup30.number)().integer().min(MIN_SALARY_LOWER_BOUND).max(MIN_SALARY_UPPER_BOUND).default(0).required().label("Minimum Salary"),
1128
+ minSalaryCurrency: (0, import_yup30.string)().oneOf(SupportedSalaryCurrencies).default("USD").required().label("Minimum Salary Currency"),
795
1129
  /**
796
1130
  * Marketing-attribution capture from the final onboarding step.
797
1131
  */
798
- referralSource: (0, import_yup25.string)().oneOf(SupportedReferralSources).required().label("Referral Source"),
1132
+ referralSource: (0, import_yup30.string)().oneOf(SupportedReferralSources).required().label("Referral Source"),
799
1133
  /**
800
1134
  * Resumes the user has uploaded. Embedded directly on the user document
801
1135
  * (capped at 5) - they're cheap to denormalize, every wizard step that
@@ -809,25 +1143,25 @@ var UserJobPreferencesSchema = (0, import_yup25.object)({
809
1143
  * AI resume-builder flow - onboarding uploads land here, AI-built resumes
810
1144
  * live in their own collection.
811
1145
  */
812
- resumes: (0, import_yup25.array)().of(
813
- (0, import_yup25.object)({
1146
+ resumes: (0, import_yup30.array)().of(
1147
+ (0, import_yup30.object)({
814
1148
  // Stable id assigned on upload - used to address a specific entry
815
1149
  // for delete / set-primary operations without exposing the GCS URL
816
1150
  // 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")
1151
+ id: (0, import_yup30.string)().required().label("ID"),
1152
+ url: (0, import_yup30.string)().required().label("Resume URL"),
1153
+ filename: (0, import_yup30.string)().trim().max(255).optional().label("Filename"),
1154
+ sizeBytes: (0, import_yup30.number)().integer().min(0).optional().label("Size (bytes)"),
1155
+ mimeType: (0, import_yup30.string)().trim().max(120).optional().label("MIME Type"),
1156
+ uploadedAt: (0, import_yup30.date)().required().label("Uploaded At"),
1157
+ isPrimary: (0, import_yup30.boolean)().default(false).label("Is Primary")
824
1158
  }).noUnknown().strict().label("Resume")
825
1159
  ).max(5, "You can keep at most 5 resumes on file.").default([]).label("Resumes"),
826
1160
  /**
827
1161
  * Set when the user finishes the wizard's last step. Acts as the gate the
828
1162
  * onboarding hook checks to redirect users who haven't completed setup.
829
1163
  */
830
- onboardingCompletedAt: (0, import_yup25.date)().nullable().optional().label("Onboarding Completed At"),
1164
+ onboardingCompletedAt: (0, import_yup30.date)().nullable().optional().label("Onboarding Completed At"),
831
1165
  /**
832
1166
  * Parser-suggested values for wizard fields, written by the resume-upload
833
1167
  * flow. Every parser-derived field lands here - including profile-shaped
@@ -847,106 +1181,106 @@ var UserJobPreferencesSchema = (0, import_yup25.object)({
847
1181
  * APIs. If `user.<field>` is empty there, the correct behavior is empty,
848
1182
  * because the user has not confirmed it yet.
849
1183
  */
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"),
1184
+ pendingPrefill: (0, import_yup30.object)({
1185
+ headline: (0, import_yup30.string)().trim().optional().label("Pending Headline"),
1186
+ aboutMe: (0, import_yup30.string)().trim().optional().label("Pending About Me"),
1187
+ mobile: (0, import_yup30.string)().trim().optional().label("Pending Mobile"),
854
1188
  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")
1189
+ experienceLevel: (0, import_yup30.string)().oneOf(SupportedExperienceLevels).optional().label("Pending Experience Level"),
1190
+ socialAccounts: (0, import_yup30.array)().of(SocialAccountSchema.required()).optional().label("Pending Social Accounts"),
1191
+ workExperiences: (0, import_yup30.array)().of(WorkExperienceSchema.required()).optional().label("Pending Work Experiences"),
1192
+ educations: (0, import_yup30.array)().of(EducationSchema.required()).optional().label("Pending Educations")
859
1193
  }).nullable().optional().default(void 0).label("Pending Prefill")
860
1194
  }).noUnknown().strict().label("User Job Preferences Schema");
861
1195
 
862
1196
  // src/user/user-recruiter-profile.schema.ts
863
- var import_yup26 = require("yup");
864
- var RecruiterPageLinkSchema = (0, import_yup26.object)({
1197
+ var import_yup31 = require("yup");
1198
+ var RecruiterPageLinkSchema = (0, import_yup31.object)({
865
1199
  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")
1200
+ jobTitle: (0, import_yup31.string)().trim().max(100).optional().label("Job Title")
867
1201
  }).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")
1202
+ var UserRecruiterProfileSchema = (0, import_yup31.object)({
1203
+ recruiterProfile: (0, import_yup31.object)({
1204
+ hiringFor: (0, import_yup31.array)().of(RecruiterPageLinkSchema).default([]).label("Hiring For")
871
1205
  }).optional().default(void 0).label("Recruiter Profile")
872
1206
  }).noUnknown().strict().label("User Recruiter Profile");
873
1207
 
874
1208
  // src/user/user-coordinator-profile.schema.ts
875
- var import_yup27 = require("yup");
876
- var CoordinatorPageLinkSchema = (0, import_yup27.object)({
1209
+ var import_yup32 = require("yup");
1210
+ var CoordinatorPageLinkSchema = (0, import_yup32.object)({
877
1211
  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")
1212
+ jobTitle: (0, import_yup32.string)().trim().max(100).optional().label("Job Title")
879
1213
  }).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")
1214
+ var UserCoordinatorProfileSchema = (0, import_yup32.object)({
1215
+ coordinatorProfile: (0, import_yup32.object)({
1216
+ coordinatesAt: (0, import_yup32.array)().of(CoordinatorPageLinkSchema).default([]).label("Coordinates At")
883
1217
  }).optional().default(void 0).label("Coordinator Profile")
884
1218
  }).noUnknown().strict().label("User Coordinator Profile");
885
1219
 
886
1220
  // src/user/user.schema.ts
887
- var UserSchema = (0, import_yup28.object)({
1221
+ var UserSchema = (0, import_yup33.object)({
888
1222
  /**
889
1223
  * Related auth account id from auth Server (e.g. Better auth https://auth.thejob.dev)
890
1224
  */
891
- authAccountId: (0, import_yup28.string)().required().label("Auth Account ID"),
1225
+ authAccountId: (0, import_yup33.string)().required().label("Auth Account ID"),
892
1226
  /**
893
1227
  * Social media information about the user (e.g. LinkedIn, GitHub, etc.)
894
1228
  */
895
- socialAccounts: (0, import_yup28.array)().of(SocialAccountSchema).default([]).label("Social Accounts"),
1229
+ socialAccounts: (0, import_yup33.array)().of(SocialAccountSchema).default([]).label("Social Accounts"),
896
1230
  /**
897
1231
  * Work experience information about the user
898
1232
  */
899
- workExperiences: (0, import_yup28.array)().of(WorkExperienceSchema).required().default([]).label("Work Experiences"),
1233
+ workExperiences: (0, import_yup33.array)().of(WorkExperienceSchema).required().default([]).label("Work Experiences"),
900
1234
  /**
901
1235
  * Education information about the user
902
1236
  */
903
- educations: (0, import_yup28.array)().of(EducationSchema).required().default([]).label("Educations"),
1237
+ educations: (0, import_yup33.array)().of(EducationSchema).required().default([]).label("Educations"),
904
1238
  /**
905
1239
  * Skills information about the user
906
1240
  */
907
- skills: (0, import_yup28.array)().of(UserSkillSchema).required().default([]).label("Skills"),
1241
+ skills: (0, import_yup33.array)().of(UserSkillSchema).required().default([]).label("Skills"),
908
1242
  /**
909
1243
  * Projects information about the user
910
1244
  */
911
- projects: (0, import_yup28.array)().of(UserProjectSchema).default([]).label("Projects"),
1245
+ projects: (0, import_yup33.array)().of(UserProjectSchema).default([]).label("Projects"),
912
1246
  /**
913
1247
  * Certifications information about the user
914
1248
  */
915
- certifications: (0, import_yup28.array)().of(UserCertificationSchema).default([]).label("Certifications"),
1249
+ certifications: (0, import_yup33.array)().of(UserCertificationSchema).default([]).label("Certifications"),
916
1250
  /**
917
1251
  * Interests information about the user.
918
1252
  */
919
- interests: (0, import_yup28.array)().of(UserInterestSchema).optional().default([]).label("Interests"),
1253
+ interests: (0, import_yup33.array)().of(UserInterestSchema).optional().default([]).label("Interests"),
920
1254
  /**
921
1255
  * Languages information about the user
922
1256
  */
923
- languages: (0, import_yup28.array)().of(UserLanguageSchema).required().default([]).label("Languages"),
1257
+ languages: (0, import_yup33.array)().of(UserLanguageSchema).required().default([]).label("Languages"),
924
1258
  /**
925
1259
  * Additional information about the user
926
1260
  */
927
- additionalInfo: (0, import_yup28.array)().of(UserAdditionalInfoSchema).default([]).label("Additional Information"),
1261
+ additionalInfo: (0, import_yup33.array)().of(UserAdditionalInfoSchema).default([]).label("Additional Information"),
928
1262
  /**
929
1263
  * Status of the user account
930
1264
  */
931
- status: (0, import_yup28.string)().oneOf(SupportedUserStatuses).required().label("Status"),
1265
+ status: (0, import_yup33.string)().oneOf(SupportedUserStatuses).required().label("Status"),
932
1266
  /**
933
1267
  * Roles assigned to the user
934
1268
  */
935
- roles: (0, import_yup28.array)().of((0, import_yup28.string)().oneOf(SupportedUserRoles)).required().default(DefaultUserRoles).label("Roles"),
1269
+ roles: (0, import_yup33.array)().of((0, import_yup33.string)().oneOf(SupportedUserRoles)).required().default(DefaultUserRoles).label("Roles"),
936
1270
  /**
937
1271
  * Vector embedding of the user's profile for semantic/hybrid search.
938
1272
  * Generated from a structured summary of skills, experience, education, etc.
939
1273
  * Only generated for public profiles with sufficient completeness (≥60%).
940
1274
  */
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")
1275
+ embedding: (0, import_yup33.object)({
1276
+ vector: (0, import_yup33.array)((0, import_yup33.number)().required()).optional().label("Embedding vector"),
1277
+ model: (0, import_yup33.string)().optional().label("Embedding model")
944
1278
  }).nullable().optional().label("Embedding")
945
1279
  }).concat(UserGeneralDetailSchema).concat(UserJobPreferencesSchema).concat(UserRecruiterProfileSchema).concat(UserCoordinatorProfileSchema).noUnknown().strict().label("User Schema");
946
1280
 
947
1281
  // src/user/user-completeness.schema.ts
948
- var import_yup29 = require("yup");
949
- var UserCompletenessSchema = (0, import_yup29.object)({
1282
+ var import_yup34 = require("yup");
1283
+ var UserCompletenessSchema = (0, import_yup34.object)({
950
1284
  additionalInfo: CompletenessScoreSchema(0).label("Additional Info"),
951
1285
  // Optional
952
1286
  certifications: CompletenessScoreSchema(0).label("Certifications"),
@@ -969,17 +1303,27 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
969
1303
  ]);
970
1304
  // Annotate the CommonJS export names for ESM import in node:
971
1305
  0 && (module.exports = {
1306
+ AnswerChoiceType,
1307
+ ApplicationReceivePreference,
1308
+ ChoiceQuestionSchema,
1309
+ Common,
1310
+ CompensationType,
972
1311
  CompletenessScoreSchema,
973
1312
  ContactTypes,
974
1313
  CoordinatorPageLinkSchema,
1314
+ DISPLAY_DATE_FORMAT,
1315
+ DISPLAY_DATE_FORMAT_SHORT,
975
1316
  DateStringSchema,
976
1317
  DbDefaultSchema,
977
1318
  DefaultPaginatedResponse,
978
1319
  DefaultPaginationOptions,
979
1320
  DefaultUserRoles,
980
1321
  DurationSchema,
1322
+ EMPTY_STRING,
981
1323
  EducationLevel,
982
1324
  EducationSchema,
1325
+ EmployeeCount,
1326
+ EmploymentType,
983
1327
  ExperienceLevel,
984
1328
  GeneraDetailFields,
985
1329
  GroupManagedBy,
@@ -989,7 +1333,10 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
989
1333
  GroupStatus,
990
1334
  GroupTranslationSchema,
991
1335
  GroupVisibility,
1336
+ InputQuestionSchema,
1337
+ JobSchema,
992
1338
  JobSearchUrgency,
1339
+ JobStatus,
993
1340
  LocationSchema,
994
1341
  MIN_SALARY_LOWER_BOUND,
995
1342
  MIN_SALARY_UPPER_BOUND,
@@ -998,23 +1345,35 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
998
1345
  PageType,
999
1346
  PaginationSchema,
1000
1347
  ProficiencyLevel,
1348
+ QuestionSchema,
1349
+ QuestionType,
1350
+ ReadAndAcknowledgeQuestionSchema,
1001
1351
  RecruiterPageLinkSchema,
1002
1352
  ReferralSource,
1003
1353
  ReportReason,
1004
1354
  ReportSchema,
1005
1355
  ResourceType,
1356
+ SITEMAP_FORMAT,
1357
+ SYSTEM_DATE_FORMAT,
1006
1358
  SkillSchema,
1007
1359
  SocialAccount,
1008
1360
  SocialAccountSchema,
1009
1361
  StudentCompletenessSchema,
1010
1362
  StudyType,
1363
+ SupportedAnswerChoiceTypes,
1364
+ SupportedApplicationReceivePreferences,
1365
+ SupportedCompensationTypes,
1011
1366
  SupportedContactTypes,
1012
1367
  SupportedEducationLevels,
1368
+ SupportedEmployeeCounts,
1369
+ SupportedEmploymentTypes,
1013
1370
  SupportedExperienceLevels,
1014
1371
  SupportedJobSearchUrgencies,
1372
+ SupportedJobStatuses,
1015
1373
  SupportedPageStatuses,
1016
1374
  SupportedPageTypes,
1017
1375
  SupportedProficiencyLevels,
1376
+ SupportedQuestionTypes,
1018
1377
  SupportedReferralSources,
1019
1378
  SupportedReportReasons,
1020
1379
  SupportedResourceTypes,
@@ -1024,6 +1383,7 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
1024
1383
  SupportedUserProfileVisibilities,
1025
1384
  SupportedUserRoles,
1026
1385
  SupportedUserStatuses,
1386
+ SupportedWorkModes,
1027
1387
  TermsAcceptedSchema,
1028
1388
  UserAdditionalInfoSchema,
1029
1389
  UserCertificationSchema,
@@ -1031,6 +1391,7 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
1031
1391
  UserCoordinatorProfileSchema,
1032
1392
  UserDetailType,
1033
1393
  UserGeneralDetailSchema,
1394
+ UserIdAndCreatedAtSchema,
1034
1395
  UserInterestSchema,
1035
1396
  UserJobPreferencesSchema,
1036
1397
  UserLanguageSchema,
@@ -1042,5 +1403,7 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
1042
1403
  UserSkillSchema,
1043
1404
  UserStatus,
1044
1405
  WorkExperienceSchema,
1045
- dateString
1406
+ WorkMode,
1407
+ dateString,
1408
+ getSchemaByQuestion
1046
1409
  });