@thejob/schema 2.0.4 → 2.0.5

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
@@ -71,6 +71,8 @@ __export(index_exports, {
71
71
  PageStatus: () => PageStatus,
72
72
  PageType: () => PageType,
73
73
  PaginationSchema: () => PaginationSchema,
74
+ PostSchema: () => PostSchema,
75
+ PostStatus: () => PostStatus,
74
76
  ProficiencyLevel: () => ProficiencyLevel,
75
77
  QuestionSchema: () => QuestionSchema,
76
78
  QuestionType: () => QuestionType,
@@ -99,6 +101,7 @@ __export(index_exports, {
99
101
  SupportedJobStatuses: () => SupportedJobStatuses,
100
102
  SupportedPageStatuses: () => SupportedPageStatuses,
101
103
  SupportedPageTypes: () => SupportedPageTypes,
104
+ SupportedPostStatuses: () => SupportedPostStatuses,
102
105
  SupportedProficiencyLevels: () => SupportedProficiencyLevels,
103
106
  SupportedQuestionTypes: () => SupportedQuestionTypes,
104
107
  SupportedReferralSources: () => SupportedReferralSources,
@@ -819,6 +822,20 @@ var JobSchema = (0, import_yup18.object)({
819
822
  keywords: (0, import_yup18.array)().of((0, import_yup18.string)()).optional().label("Keywords")
820
823
  }).nullable().optional().label("SEO Tags"),
821
824
  jdSummary: (0, import_yup18.string)().optional().label("JD Summary"),
825
+ /**
826
+ * Structured, model-extracted sections of the posting, re-organized into clean
827
+ * bullet points. This is our OWN unique presentation of the job (rendered as the
828
+ * primary, server-side page content) so the page adds value over the raw scraped
829
+ * description and is not penalized by Google as duplicate content. All sections
830
+ * optional: absent on jobs not yet (re-)enriched, and any section is `[]`/omitted
831
+ * when the posting genuinely has none.
832
+ */
833
+ jobHighlights: (0, import_yup18.object)({
834
+ responsibilities: (0, import_yup18.array)().of((0, import_yup18.string)()).optional().label("Responsibilities"),
835
+ requirements: (0, import_yup18.array)().of((0, import_yup18.string)()).optional().label("Requirements"),
836
+ benefits: (0, import_yup18.array)().of((0, import_yup18.string)()).optional().label("Benefits"),
837
+ qualifications: (0, import_yup18.array)().of((0, import_yup18.string)()).optional().label("Qualifications")
838
+ }).nullable().optional().label("Job Highlights"),
822
839
  canCreateAlert: (0, import_yup18.boolean)().optional().label("Can create alert"),
823
840
  canDirectApply: (0, import_yup18.boolean)().optional().label("Can direct apply"),
824
841
  hasApplied: (0, import_yup18.boolean)().optional().label("Has applied"),
@@ -844,15 +861,65 @@ var JobSchema = (0, import_yup18.object)({
844
861
  featuredMarkets: (0, import_yup18.array)().of((0, import_yup18.string)().required()).optional().default([]).label("Featured markets")
845
862
  }).concat(DbDefaultSchema).noUnknown().label("Job");
846
863
 
847
- // src/pagination/pagination.schema.ts
864
+ // src/post/post.schema.ts
848
865
  var import_yup19 = require("yup");
849
- var PaginationSchema = (0, import_yup19.object)().shape({
850
- page: (0, import_yup19.number)().required().min(1).label("Page").default(1),
851
- limit: (0, import_yup19.number)().required().min(1).max(100).label("Limit").default(10),
852
- sortBy: (0, import_yup19.string)().notOneOf([""]).optional().label("SortBy"),
853
- nextPage: (0, import_yup19.string)().optional().label("Next Page Token"),
854
- prevPage: (0, import_yup19.string)().optional().label("Previous Page Token"),
855
- sortDirection: (0, import_yup19.string)().oneOf(["asc", "desc"]).optional().label("Sort Direction")
866
+
867
+ // src/post/post.constant.ts
868
+ var PostStatus = /* @__PURE__ */ ((PostStatus2) => {
869
+ PostStatus2["Draft"] = "draft";
870
+ PostStatus2["Published"] = "published";
871
+ PostStatus2["Archived"] = "archived";
872
+ return PostStatus2;
873
+ })(PostStatus || {});
874
+ var SupportedPostStatuses = Object.values(PostStatus);
875
+
876
+ // src/post/post.schema.ts
877
+ var PostSchema = (0, import_yup19.object)({
878
+ /** Headline shown in listings and at the top of the post. */
879
+ title: (0, import_yup19.string)().required().min(5).max(200).label("Title"),
880
+ /** User-friendly, unique URL identifier. */
881
+ slug: (0, import_yup19.string)().required().max(250).label("Slug"),
882
+ /** Short summary used in listings and meta description fallback. */
883
+ excerpt: (0, import_yup19.string)().max(500).optional().label("Excerpt"),
884
+ /** Rendered HTML source of truth for the post body (sanitized on write/render).
885
+ * Supports rich formatting markdown can't express (image size/alignment, etc). */
886
+ bodyHTML: (0, import_yup19.string)().required().min(1).label("Body (HTML)"),
887
+ /** Optional Markdown mirror of the body (portable text / search fallback).
888
+ * Kept for back-compat and plain-text derivation; bodyHTML is authoritative. */
889
+ bodyMarkdown: (0, import_yup19.string)().optional().label("Body (Markdown)"),
890
+ /** Cover/hero image URL. Not `.url()`-validated: the value is either an
891
+ * uploaded file URL served by this platform (which may be a bare host like
892
+ * `http://localhost:3082/...` in dev, that yup's `.url()` wrongly rejects) or
893
+ * an admin-pasted link. Kept as a plain string; empty ⇒ null. */
894
+ coverImage: (0, import_yup19.string)().nullable().optional().label("Cover image"),
895
+ /** Author (user id). */
896
+ authorId: (0, import_yup19.string)().required().label("Author ID"),
897
+ /** Free-form tags for filtering and related-posts. */
898
+ tags: (0, import_yup19.array)().of((0, import_yup19.string)().trim().required()).default([]).label("Tags"),
899
+ /** Estimated reading time in minutes (server-derived from body length). */
900
+ readingTimeMinutes: (0, import_yup19.number)().min(0).optional().label("Reading time (minutes)"),
901
+ /** SEO overrides. */
902
+ seoTags: (0, import_yup19.object)({
903
+ description: (0, import_yup19.string)().optional().label("Description"),
904
+ keywords: (0, import_yup19.array)().of((0, import_yup19.string)().required()).optional().label("Keywords")
905
+ }).nullable().optional().label("SEO Tags"),
906
+ /** When the post was first published (epoch ms). Server-owned. */
907
+ publishedAt: (0, import_yup19.number)().nullable().optional().label("Published at"),
908
+ /** Whether the post is featured in the blog listing. */
909
+ isFeatured: (0, import_yup19.boolean)().default(false).optional().label("Is featured"),
910
+ /** Publication state. */
911
+ status: (0, import_yup19.string)().oneOf(SupportedPostStatuses).default("draft" /* Draft */).required().label("Status")
912
+ }).concat(DbDefaultSchema).noUnknown().label("Post");
913
+
914
+ // src/pagination/pagination.schema.ts
915
+ var import_yup20 = require("yup");
916
+ var PaginationSchema = (0, import_yup20.object)().shape({
917
+ page: (0, import_yup20.number)().required().min(1).label("Page").default(1),
918
+ limit: (0, import_yup20.number)().required().min(1).max(100).label("Limit").default(10),
919
+ sortBy: (0, import_yup20.string)().notOneOf([""]).optional().label("SortBy"),
920
+ nextPage: (0, import_yup20.string)().optional().label("Next Page Token"),
921
+ prevPage: (0, import_yup20.string)().optional().label("Previous Page Token"),
922
+ sortDirection: (0, import_yup20.string)().oneOf(["asc", "desc"]).optional().label("Sort Direction")
856
923
  });
857
924
 
858
925
  // src/pagination/pagination.constant.ts
@@ -868,7 +935,7 @@ var DefaultPaginationOptions = {
868
935
  };
869
936
 
870
937
  // src/report/report.schema.ts
871
- var import_yup20 = require("yup");
938
+ var import_yup21 = require("yup");
872
939
 
873
940
  // src/report/report.constant.ts
874
941
  var ResourceType = /* @__PURE__ */ ((ResourceType3) => {
@@ -892,15 +959,15 @@ var ReportReason = /* @__PURE__ */ ((ReportReason3) => {
892
959
  var SupportedReportReasons = Object.values(ReportReason);
893
960
 
894
961
  // src/report/report.schema.ts
895
- var ReportSchema = (0, import_yup20.object)({
896
- type: (0, import_yup20.mixed)().oneOf(SupportedResourceTypes).required().label("Type"),
897
- resourceId: (0, import_yup20.string)().required().label("Resource ID"),
898
- reason: (0, import_yup20.mixed)().oneOf(SupportedReportReasons).required("Please choose a reason").label("Reason"),
899
- comment: (0, import_yup20.string)().max(1e3).optional().label("Comment")
962
+ var ReportSchema = (0, import_yup21.object)({
963
+ type: (0, import_yup21.mixed)().oneOf(SupportedResourceTypes).required().label("Type"),
964
+ resourceId: (0, import_yup21.string)().required().label("Resource ID"),
965
+ reason: (0, import_yup21.mixed)().oneOf(SupportedReportReasons).required("Please choose a reason").label("Reason"),
966
+ comment: (0, import_yup21.string)().max(1e3).optional().label("Comment")
900
967
  }).label("Report Schema");
901
968
 
902
969
  // src/user/user.schema.ts
903
- var import_yup33 = require("yup");
970
+ var import_yup34 = require("yup");
904
971
 
905
972
  // src/user/user.constant.ts
906
973
  var UserRole = /* @__PURE__ */ ((UserRole2) => {
@@ -982,51 +1049,51 @@ var MIN_SALARY_LOWER_BOUND = 0;
982
1049
  var MIN_SALARY_UPPER_BOUND = 1e6;
983
1050
 
984
1051
  // src/user/work-experience.schema.ts
985
- var import_yup21 = require("yup");
986
- var WorkExperienceSchema = (0, import_yup21.object)().shape({
1052
+ var import_yup22 = require("yup");
1053
+ var WorkExperienceSchema = (0, import_yup22.object)().shape({
987
1054
  company: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company"),
988
- designation: (0, import_yup21.string)().trim().required().label("Designation"),
1055
+ designation: (0, import_yup22.string)().trim().required().label("Designation"),
989
1056
  duration: DurationSchema({
990
1057
  format: "YYYY-MM",
991
1058
  startLabel: "Start Date",
992
1059
  endLabel: "End Date"
993
1060
  }).required().label("Duration"),
994
- description: (0, import_yup21.string)().trim().max(3e3).optional().label("Description"),
1061
+ description: (0, import_yup22.string)().trim().max(3e3).optional().label("Description"),
995
1062
  location: LocationSchema.required().label("Location"),
996
- isRemote: (0, import_yup21.boolean)().oneOf([true, false]).default(false).label("Is Remote")
1063
+ isRemote: (0, import_yup22.boolean)().oneOf([true, false]).default(false).label("Is Remote")
997
1064
  }).noUnknown().strict().label("Work Experience");
998
1065
 
999
1066
  // src/user/education.schema.ts
1000
- var import_yup22 = require("yup");
1001
- var EducationSchema = (0, import_yup22.object)({
1067
+ var import_yup23 = require("yup");
1068
+ var EducationSchema = (0, import_yup23.object)({
1002
1069
  institute: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Institute"),
1003
- course: (0, import_yup22.string)().trim().required().label("Course"),
1004
- fieldOfStudy: (0, import_yup22.string)().trim().required().label("Field of Study"),
1070
+ course: (0, import_yup23.string)().trim().required().label("Course"),
1071
+ fieldOfStudy: (0, import_yup23.string)().trim().required().label("Field of Study"),
1005
1072
  duration: DurationSchema({
1006
1073
  format: "YYYY-MM",
1007
1074
  startLabel: "Start Date",
1008
1075
  endLabel: "End Date"
1009
1076
  }).required().label("Duration"),
1010
- description: (0, import_yup22.string)().trim().max(3e3).optional().label("Description"),
1011
- isDistanceLearning: (0, import_yup22.boolean)().default(false).label("Is Distance Learning"),
1077
+ description: (0, import_yup23.string)().trim().max(3e3).optional().label("Description"),
1078
+ isDistanceLearning: (0, import_yup23.boolean)().default(false).label("Is Distance Learning"),
1012
1079
  location: LocationSchema.required().label("Location"),
1013
- studyType: (0, import_yup22.string)().oneOf(SupportedStudyTypes).trim().max(50).required().label("Study Type")
1080
+ studyType: (0, import_yup23.string)().oneOf(SupportedStudyTypes).trim().max(50).required().label("Study Type")
1014
1081
  }).noUnknown().strict().label("Education");
1015
1082
 
1016
1083
  // src/user/user-skill.schema.ts
1017
- var import_yup23 = require("yup");
1018
- var UserSkillSchema = (0, import_yup23.object)({
1019
- name: (0, import_yup23.string)().required().label("Name"),
1020
- proficiencyLevel: (0, import_yup23.string)().oneOf(SupportedProficiencyLevels).required().label("Proficiency Level"),
1084
+ var import_yup24 = require("yup");
1085
+ var UserSkillSchema = (0, import_yup24.object)({
1086
+ name: (0, import_yup24.string)().required().label("Name"),
1087
+ proficiencyLevel: (0, import_yup24.string)().oneOf(SupportedProficiencyLevels).required().label("Proficiency Level"),
1021
1088
  lastUsed: dateString().format("YYYY-MM").nullable().optional().label("Last Used")
1022
1089
  }).noUnknown().strict().label("Skill");
1023
1090
 
1024
1091
  // src/user/project.schema.ts
1025
- var import_yup24 = require("yup");
1026
- var UserProjectSchema = (0, import_yup24.object)({
1027
- name: (0, import_yup24.string)().trim().max(50).required().label("Name"),
1028
- url: (0, import_yup24.string)().optional().label("URL"),
1029
- description: (0, import_yup24.string)().trim().min(100).max(3e3).required().label("Description"),
1092
+ var import_yup25 = require("yup");
1093
+ var UserProjectSchema = (0, import_yup25.object)({
1094
+ name: (0, import_yup25.string)().trim().max(50).required().label("Name"),
1095
+ url: (0, import_yup25.string)().optional().label("URL"),
1096
+ description: (0, import_yup25.string)().trim().min(100).max(3e3).required().label("Description"),
1030
1097
  duration: DurationSchema({
1031
1098
  format: "YYYY-MM",
1032
1099
  startLabel: "Start Date",
@@ -1035,83 +1102,83 @@ var UserProjectSchema = (0, import_yup24.object)({
1035
1102
  }).noUnknown().strict().label("Project");
1036
1103
 
1037
1104
  // src/user/user-certification.schema.ts
1038
- var import_yup25 = require("yup");
1039
- var UserCertificationSchema = (0, import_yup25.object)({
1040
- name: (0, import_yup25.string)().trim().max(100).required().label("Name"),
1105
+ var import_yup26 = require("yup");
1106
+ var UserCertificationSchema = (0, import_yup26.object)({
1107
+ name: (0, import_yup26.string)().trim().max(100).required().label("Name"),
1041
1108
  // TODO: Add validation for authority
1042
- authority: (0, import_yup25.string)().trim().max(100).required().label("Authority"),
1043
- licenseNumber: (0, import_yup25.string)().trim().max(50).optional().label("License Number"),
1109
+ authority: (0, import_yup26.string)().trim().max(100).required().label("Authority"),
1110
+ licenseNumber: (0, import_yup26.string)().trim().max(50).optional().label("License Number"),
1044
1111
  duration: DurationSchema({
1045
1112
  format: "YYYY-MM",
1046
1113
  startLabel: "Start Date",
1047
1114
  endLabel: "End Date"
1048
1115
  }).optional().nullable().label("Duration"),
1049
- url: (0, import_yup25.string)().optional().label("URL")
1116
+ url: (0, import_yup26.string)().optional().label("URL")
1050
1117
  }).noUnknown().strict().label("Certification");
1051
1118
 
1052
1119
  // src/user/user-interest.schema.ts
1053
- var import_yup26 = require("yup");
1054
- var UserInterestSchema = (0, import_yup26.string)().trim().required().label("Interest");
1120
+ var import_yup27 = require("yup");
1121
+ var UserInterestSchema = (0, import_yup27.string)().trim().required().label("Interest");
1055
1122
 
1056
1123
  // src/user/user-language.schema.ts
1057
- var import_yup27 = require("yup");
1058
- var UserLanguageSchema = (0, import_yup27.object)({
1059
- name: (0, import_yup27.string)().trim().required().label("Name"),
1060
- proficiencyLevel: (0, import_yup27.string)().oneOf(SupportedProficiencyLevels).trim().max(50).required().label("Proficiency Level")
1124
+ var import_yup28 = require("yup");
1125
+ var UserLanguageSchema = (0, import_yup28.object)({
1126
+ name: (0, import_yup28.string)().trim().required().label("Name"),
1127
+ proficiencyLevel: (0, import_yup28.string)().oneOf(SupportedProficiencyLevels).trim().max(50).required().label("Proficiency Level")
1061
1128
  }).noUnknown().strict().label("Language");
1062
1129
 
1063
1130
  // src/user/user-additional-info.schema.ts
1064
- var import_yup28 = require("yup");
1065
- var UserAdditionalInfoSchema = (0, import_yup28.object)({
1066
- title: (0, import_yup28.string)().trim().max(60).required().label("Title"),
1067
- description: (0, import_yup28.string)().trim().max(1e3).required().label("Description")
1131
+ var import_yup29 = require("yup");
1132
+ var UserAdditionalInfoSchema = (0, import_yup29.object)({
1133
+ title: (0, import_yup29.string)().trim().max(60).required().label("Title"),
1134
+ description: (0, import_yup29.string)().trim().max(1e3).required().label("Description")
1068
1135
  }).noUnknown().strict().label("User Additional Info");
1069
1136
 
1070
1137
  // src/user/general-detail.schema.ts
1071
- var import_yup29 = require("yup");
1072
- var UserGeneralDetailSchema = (0, import_yup29.object)({
1073
- id: (0, import_yup29.string)().optional().label("ID"),
1074
- name: (0, import_yup29.object)().shape({
1075
- first: (0, import_yup29.string)().trim().max(50).required().label("First Name"),
1076
- last: (0, import_yup29.string)().trim().max(50).optional().label("Last Name")
1138
+ var import_yup30 = require("yup");
1139
+ var UserGeneralDetailSchema = (0, import_yup30.object)({
1140
+ id: (0, import_yup30.string)().optional().label("ID"),
1141
+ name: (0, import_yup30.object)().shape({
1142
+ first: (0, import_yup30.string)().trim().max(50).required().label("First Name"),
1143
+ last: (0, import_yup30.string)().trim().max(50).optional().label("Last Name")
1077
1144
  }).required().label("Name"),
1078
- headline: (0, import_yup29.string)().trim().max(200).optional().label("Headline"),
1079
- image: (0, import_yup29.string)().optional().label("Image"),
1080
- aboutMe: (0, import_yup29.string)().trim().max(3e3).optional().label("About Me"),
1081
- email: (0, import_yup29.string)().required().label("Email"),
1082
- mobile: (0, import_yup29.string)().nullable().optional().label("Mobile"),
1083
- emailVerified: (0, import_yup29.string)().nullable().optional().label("Email Verified"),
1084
- mobileVerified: (0, import_yup29.string)().nullable().optional().label("Mobile Verified"),
1085
- experienceLevel: (0, import_yup29.string)().oneOf(SupportedExperienceLevels).required().label("Experience level"),
1145
+ headline: (0, import_yup30.string)().trim().max(200).optional().label("Headline"),
1146
+ image: (0, import_yup30.string)().optional().label("Image"),
1147
+ aboutMe: (0, import_yup30.string)().trim().max(3e3).optional().label("About Me"),
1148
+ email: (0, import_yup30.string)().required().label("Email"),
1149
+ mobile: (0, import_yup30.string)().nullable().optional().label("Mobile"),
1150
+ emailVerified: (0, import_yup30.string)().nullable().optional().label("Email Verified"),
1151
+ mobileVerified: (0, import_yup30.string)().nullable().optional().label("Mobile Verified"),
1152
+ experienceLevel: (0, import_yup30.string)().oneOf(SupportedExperienceLevels).required().label("Experience level"),
1086
1153
  location: LocationSchema.required().label("Location"),
1087
- region: (0, import_yup29.object)().shape({
1088
- country: (0, import_yup29.string)().trim().required().label("Region Country"),
1089
- lang: (0, import_yup29.string)().trim().required().label("Region Language")
1154
+ region: (0, import_yup30.object)().shape({
1155
+ country: (0, import_yup30.string)().trim().required().label("Region Country"),
1156
+ lang: (0, import_yup30.string)().trim().required().label("Region Language")
1090
1157
  }).optional().default(void 0).label("Region"),
1091
- profileVisibility: (0, import_yup29.string)().oneOf(SupportedUserProfileVisibilities).default("public" /* Public */).label("Profile Visibility")
1158
+ profileVisibility: (0, import_yup30.string)().oneOf(SupportedUserProfileVisibilities).default("public" /* Public */).label("Profile Visibility")
1092
1159
  }).noUnknown().strict().label("General Detail");
1093
1160
 
1094
1161
  // src/user/user-job-preferences.schema.ts
1095
- var import_yup30 = require("yup");
1096
- var UserJobPreferencesSchema = (0, import_yup30.object)({
1162
+ var import_yup31 = require("yup");
1163
+ var UserJobPreferencesSchema = (0, import_yup31.object)({
1097
1164
  /**
1098
1165
  * Whether the job seeker is openly signalling availability. Surfaces the
1099
1166
  * "Open to work" badge on the public profile and boosts visibility in
1100
1167
  * recruiter search. Defaults to `false` - users must opt in.
1101
1168
  */
1102
- openToWork: (0, import_yup30.boolean)().default(false).label("Open to Work"),
1169
+ openToWork: (0, import_yup31.boolean)().default(false).label("Open to Work"),
1103
1170
  /**
1104
1171
  * How urgently the user is looking for their next job. Drives match scoring
1105
1172
  * and can downgrade the visibility of expired or low-relevance postings for
1106
1173
  * users in `passively_browsing` mode.
1107
1174
  */
1108
- jobSearchUrgency: (0, import_yup30.string)().oneOf(SupportedJobSearchUrgencies).required().label("Job Search Urgency"),
1175
+ jobSearchUrgency: (0, import_yup31.string)().oneOf(SupportedJobSearchUrgencies).required().label("Job Search Urgency"),
1109
1176
  /**
1110
1177
  * Locations the user wants to work in. Stores the full `LocationSchema`
1111
1178
  * shape (country, city, state, geo, etc.) as returned by the locations
1112
1179
  * autocomplete API.
1113
1180
  */
1114
- jobLocations: (0, import_yup30.array)().of(LocationSchema.required().label("Job Location")).min(1, "Pick at least one preferred location.").required().label("Job Locations"),
1181
+ jobLocations: (0, import_yup31.array)().of(LocationSchema.required().label("Job Location")).min(1, "Pick at least one preferred location.").required().label("Job Locations"),
1115
1182
  /**
1116
1183
  * Seniority levels the user wants jobs to be matched against. Multi-select
1117
1184
  * (up to 2) for borderline candidates.
@@ -1122,7 +1189,7 @@ var UserJobPreferencesSchema = (0, import_yup30.object)({
1122
1189
  * Both reuse the same `ExperienceLevel` taxonomy from `common.constant.ts`
1123
1190
  * so search/match logic doesn't have to translate between two vocabularies.
1124
1191
  */
1125
- 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"),
1192
+ targetExperienceLevels: (0, import_yup31.array)().of((0, import_yup31.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"),
1126
1193
  /**
1127
1194
  * Specializations the user is searching for - free-form titles.
1128
1195
  *
@@ -1131,19 +1198,19 @@ var UserJobPreferencesSchema = (0, import_yup30.object)({
1131
1198
  * surfaces a curated "Popular Roles" picker for discovery, but the user
1132
1199
  * can ultimately add any title; matching/normalization happens downstream.
1133
1200
  */
1134
- 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"),
1201
+ jobRoles: (0, import_yup31.array)().of((0, import_yup31.string)().trim().max(120).required()).min(1, "Pick at least one role.").required().label("Job Roles"),
1135
1202
  /**
1136
1203
  * Minimum acceptable annual base salary, in `minSalaryCurrency`.
1137
1204
  * Stored as an integer in the currency's major unit (e.g. dollars, not cents).
1138
1205
  * Defaults to 0 ("any salary") rather than being optional - every job-seeker
1139
1206
  * has a floor, even if it's zero.
1140
1207
  */
1141
- minSalary: (0, import_yup30.number)().integer().min(MIN_SALARY_LOWER_BOUND).max(MIN_SALARY_UPPER_BOUND).default(0).required().label("Minimum Salary"),
1142
- minSalaryCurrency: (0, import_yup30.string)().oneOf(SupportedSalaryCurrencies).default("USD").required().label("Minimum Salary Currency"),
1208
+ minSalary: (0, import_yup31.number)().integer().min(MIN_SALARY_LOWER_BOUND).max(MIN_SALARY_UPPER_BOUND).default(0).required().label("Minimum Salary"),
1209
+ minSalaryCurrency: (0, import_yup31.string)().oneOf(SupportedSalaryCurrencies).default("USD").required().label("Minimum Salary Currency"),
1143
1210
  /**
1144
1211
  * Marketing-attribution capture from the final onboarding step.
1145
1212
  */
1146
- referralSource: (0, import_yup30.string)().oneOf(SupportedReferralSources).required().label("Referral Source"),
1213
+ referralSource: (0, import_yup31.string)().oneOf(SupportedReferralSources).required().label("Referral Source"),
1147
1214
  /**
1148
1215
  * Resumes the user has uploaded. Embedded directly on the user document
1149
1216
  * (capped at 5) - they're cheap to denormalize, every wizard step that
@@ -1157,25 +1224,25 @@ var UserJobPreferencesSchema = (0, import_yup30.object)({
1157
1224
  * AI resume-builder flow - onboarding uploads land here, AI-built resumes
1158
1225
  * live in their own collection.
1159
1226
  */
1160
- resumes: (0, import_yup30.array)().of(
1161
- (0, import_yup30.object)({
1227
+ resumes: (0, import_yup31.array)().of(
1228
+ (0, import_yup31.object)({
1162
1229
  // Stable id assigned on upload - used to address a specific entry
1163
1230
  // for delete / set-primary operations without exposing the GCS URL
1164
1231
  // as a route key.
1165
- id: (0, import_yup30.string)().required().label("ID"),
1166
- url: (0, import_yup30.string)().required().label("Resume URL"),
1167
- filename: (0, import_yup30.string)().trim().max(255).optional().label("Filename"),
1168
- sizeBytes: (0, import_yup30.number)().integer().min(0).optional().label("Size (bytes)"),
1169
- mimeType: (0, import_yup30.string)().trim().max(120).optional().label("MIME Type"),
1170
- uploadedAt: (0, import_yup30.date)().required().label("Uploaded At"),
1171
- isPrimary: (0, import_yup30.boolean)().default(false).label("Is Primary")
1232
+ id: (0, import_yup31.string)().required().label("ID"),
1233
+ url: (0, import_yup31.string)().required().label("Resume URL"),
1234
+ filename: (0, import_yup31.string)().trim().max(255).optional().label("Filename"),
1235
+ sizeBytes: (0, import_yup31.number)().integer().min(0).optional().label("Size (bytes)"),
1236
+ mimeType: (0, import_yup31.string)().trim().max(120).optional().label("MIME Type"),
1237
+ uploadedAt: (0, import_yup31.date)().required().label("Uploaded At"),
1238
+ isPrimary: (0, import_yup31.boolean)().default(false).label("Is Primary")
1172
1239
  }).noUnknown().strict().label("Resume")
1173
1240
  ).max(5, "You can keep at most 5 resumes on file.").default([]).label("Resumes"),
1174
1241
  /**
1175
1242
  * Set when the user finishes the wizard's last step. Acts as the gate the
1176
1243
  * onboarding hook checks to redirect users who haven't completed setup.
1177
1244
  */
1178
- onboardingCompletedAt: (0, import_yup30.date)().nullable().optional().label("Onboarding Completed At"),
1245
+ onboardingCompletedAt: (0, import_yup31.date)().nullable().optional().label("Onboarding Completed At"),
1179
1246
  /**
1180
1247
  * Parser-suggested values for wizard fields, written by the resume-upload
1181
1248
  * flow. Every parser-derived field lands here - including profile-shaped
@@ -1195,106 +1262,106 @@ var UserJobPreferencesSchema = (0, import_yup30.object)({
1195
1262
  * APIs. If `user.<field>` is empty there, the correct behavior is empty,
1196
1263
  * because the user has not confirmed it yet.
1197
1264
  */
1198
- pendingPrefill: (0, import_yup30.object)({
1199
- headline: (0, import_yup30.string)().trim().optional().label("Pending Headline"),
1200
- aboutMe: (0, import_yup30.string)().trim().optional().label("Pending About Me"),
1201
- mobile: (0, import_yup30.string)().trim().optional().label("Pending Mobile"),
1265
+ pendingPrefill: (0, import_yup31.object)({
1266
+ headline: (0, import_yup31.string)().trim().optional().label("Pending Headline"),
1267
+ aboutMe: (0, import_yup31.string)().trim().optional().label("Pending About Me"),
1268
+ mobile: (0, import_yup31.string)().trim().optional().label("Pending Mobile"),
1202
1269
  location: LocationSchema.optional().default(void 0).label("Pending Location"),
1203
- experienceLevel: (0, import_yup30.string)().oneOf(SupportedExperienceLevels).optional().label("Pending Experience Level"),
1204
- socialAccounts: (0, import_yup30.array)().of(SocialAccountSchema.required()).optional().label("Pending Social Accounts"),
1205
- workExperiences: (0, import_yup30.array)().of(WorkExperienceSchema.required()).optional().label("Pending Work Experiences"),
1206
- educations: (0, import_yup30.array)().of(EducationSchema.required()).optional().label("Pending Educations")
1270
+ experienceLevel: (0, import_yup31.string)().oneOf(SupportedExperienceLevels).optional().label("Pending Experience Level"),
1271
+ socialAccounts: (0, import_yup31.array)().of(SocialAccountSchema.required()).optional().label("Pending Social Accounts"),
1272
+ workExperiences: (0, import_yup31.array)().of(WorkExperienceSchema.required()).optional().label("Pending Work Experiences"),
1273
+ educations: (0, import_yup31.array)().of(EducationSchema.required()).optional().label("Pending Educations")
1207
1274
  }).nullable().optional().default(void 0).label("Pending Prefill")
1208
1275
  }).noUnknown().strict().label("User Job Preferences Schema");
1209
1276
 
1210
1277
  // src/user/user-recruiter-profile.schema.ts
1211
- var import_yup31 = require("yup");
1212
- var RecruiterPageLinkSchema = (0, import_yup31.object)({
1278
+ var import_yup32 = require("yup");
1279
+ var RecruiterPageLinkSchema = (0, import_yup32.object)({
1213
1280
  page: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company Page"),
1214
- jobTitle: (0, import_yup31.string)().trim().max(100).optional().label("Job Title")
1281
+ jobTitle: (0, import_yup32.string)().trim().max(100).optional().label("Job Title")
1215
1282
  }).noUnknown().strict().label("Recruiter Page Link");
1216
- var UserRecruiterProfileSchema = (0, import_yup31.object)({
1217
- recruiterProfile: (0, import_yup31.object)({
1218
- hiringFor: (0, import_yup31.array)().of(RecruiterPageLinkSchema).default([]).label("Hiring For")
1283
+ var UserRecruiterProfileSchema = (0, import_yup32.object)({
1284
+ recruiterProfile: (0, import_yup32.object)({
1285
+ hiringFor: (0, import_yup32.array)().of(RecruiterPageLinkSchema).default([]).label("Hiring For")
1219
1286
  }).optional().default(void 0).label("Recruiter Profile")
1220
1287
  }).noUnknown().strict().label("User Recruiter Profile");
1221
1288
 
1222
1289
  // src/user/user-coordinator-profile.schema.ts
1223
- var import_yup32 = require("yup");
1224
- var CoordinatorPageLinkSchema = (0, import_yup32.object)({
1290
+ var import_yup33 = require("yup");
1291
+ var CoordinatorPageLinkSchema = (0, import_yup33.object)({
1225
1292
  page: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Institute Page"),
1226
- jobTitle: (0, import_yup32.string)().trim().max(100).optional().label("Job Title")
1293
+ jobTitle: (0, import_yup33.string)().trim().max(100).optional().label("Job Title")
1227
1294
  }).noUnknown().strict().label("Coordinator Page Link");
1228
- var UserCoordinatorProfileSchema = (0, import_yup32.object)({
1229
- coordinatorProfile: (0, import_yup32.object)({
1230
- coordinatesAt: (0, import_yup32.array)().of(CoordinatorPageLinkSchema).default([]).label("Coordinates At")
1295
+ var UserCoordinatorProfileSchema = (0, import_yup33.object)({
1296
+ coordinatorProfile: (0, import_yup33.object)({
1297
+ coordinatesAt: (0, import_yup33.array)().of(CoordinatorPageLinkSchema).default([]).label("Coordinates At")
1231
1298
  }).optional().default(void 0).label("Coordinator Profile")
1232
1299
  }).noUnknown().strict().label("User Coordinator Profile");
1233
1300
 
1234
1301
  // src/user/user.schema.ts
1235
- var UserSchema = (0, import_yup33.object)({
1302
+ var UserSchema = (0, import_yup34.object)({
1236
1303
  /**
1237
1304
  * Related auth account id from auth Server (e.g. Better auth https://auth.thejob.dev)
1238
1305
  */
1239
- authAccountId: (0, import_yup33.string)().required().label("Auth Account ID"),
1306
+ authAccountId: (0, import_yup34.string)().required().label("Auth Account ID"),
1240
1307
  /**
1241
1308
  * Social media information about the user (e.g. LinkedIn, GitHub, etc.)
1242
1309
  */
1243
- socialAccounts: (0, import_yup33.array)().of(SocialAccountSchema).default([]).label("Social Accounts"),
1310
+ socialAccounts: (0, import_yup34.array)().of(SocialAccountSchema).default([]).label("Social Accounts"),
1244
1311
  /**
1245
1312
  * Work experience information about the user
1246
1313
  */
1247
- workExperiences: (0, import_yup33.array)().of(WorkExperienceSchema).required().default([]).label("Work Experiences"),
1314
+ workExperiences: (0, import_yup34.array)().of(WorkExperienceSchema).required().default([]).label("Work Experiences"),
1248
1315
  /**
1249
1316
  * Education information about the user
1250
1317
  */
1251
- educations: (0, import_yup33.array)().of(EducationSchema).required().default([]).label("Educations"),
1318
+ educations: (0, import_yup34.array)().of(EducationSchema).required().default([]).label("Educations"),
1252
1319
  /**
1253
1320
  * Skills information about the user
1254
1321
  */
1255
- skills: (0, import_yup33.array)().of(UserSkillSchema).required().default([]).label("Skills"),
1322
+ skills: (0, import_yup34.array)().of(UserSkillSchema).required().default([]).label("Skills"),
1256
1323
  /**
1257
1324
  * Projects information about the user
1258
1325
  */
1259
- projects: (0, import_yup33.array)().of(UserProjectSchema).default([]).label("Projects"),
1326
+ projects: (0, import_yup34.array)().of(UserProjectSchema).default([]).label("Projects"),
1260
1327
  /**
1261
1328
  * Certifications information about the user
1262
1329
  */
1263
- certifications: (0, import_yup33.array)().of(UserCertificationSchema).default([]).label("Certifications"),
1330
+ certifications: (0, import_yup34.array)().of(UserCertificationSchema).default([]).label("Certifications"),
1264
1331
  /**
1265
1332
  * Interests information about the user.
1266
1333
  */
1267
- interests: (0, import_yup33.array)().of(UserInterestSchema).optional().default([]).label("Interests"),
1334
+ interests: (0, import_yup34.array)().of(UserInterestSchema).optional().default([]).label("Interests"),
1268
1335
  /**
1269
1336
  * Languages information about the user
1270
1337
  */
1271
- languages: (0, import_yup33.array)().of(UserLanguageSchema).required().default([]).label("Languages"),
1338
+ languages: (0, import_yup34.array)().of(UserLanguageSchema).required().default([]).label("Languages"),
1272
1339
  /**
1273
1340
  * Additional information about the user
1274
1341
  */
1275
- additionalInfo: (0, import_yup33.array)().of(UserAdditionalInfoSchema).default([]).label("Additional Information"),
1342
+ additionalInfo: (0, import_yup34.array)().of(UserAdditionalInfoSchema).default([]).label("Additional Information"),
1276
1343
  /**
1277
1344
  * Status of the user account
1278
1345
  */
1279
- status: (0, import_yup33.string)().oneOf(SupportedUserStatuses).required().label("Status"),
1346
+ status: (0, import_yup34.string)().oneOf(SupportedUserStatuses).required().label("Status"),
1280
1347
  /**
1281
1348
  * Roles assigned to the user
1282
1349
  */
1283
- roles: (0, import_yup33.array)().of((0, import_yup33.string)().oneOf(SupportedUserRoles)).required().default(DefaultUserRoles).label("Roles"),
1350
+ roles: (0, import_yup34.array)().of((0, import_yup34.string)().oneOf(SupportedUserRoles)).required().default(DefaultUserRoles).label("Roles"),
1284
1351
  /**
1285
1352
  * Vector embedding of the user's profile for semantic/hybrid search.
1286
1353
  * Generated from a structured summary of skills, experience, education, etc.
1287
1354
  * Only generated for public profiles with sufficient completeness (≥60%).
1288
1355
  */
1289
- embedding: (0, import_yup33.object)({
1290
- vector: (0, import_yup33.array)((0, import_yup33.number)().required()).optional().label("Embedding vector"),
1291
- model: (0, import_yup33.string)().optional().label("Embedding model")
1356
+ embedding: (0, import_yup34.object)({
1357
+ vector: (0, import_yup34.array)((0, import_yup34.number)().required()).optional().label("Embedding vector"),
1358
+ model: (0, import_yup34.string)().optional().label("Embedding model")
1292
1359
  }).nullable().optional().label("Embedding")
1293
1360
  }).concat(UserGeneralDetailSchema).concat(UserJobPreferencesSchema).concat(UserRecruiterProfileSchema).concat(UserCoordinatorProfileSchema).noUnknown().strict().label("User Schema");
1294
1361
 
1295
1362
  // src/user/user-completeness.schema.ts
1296
- var import_yup34 = require("yup");
1297
- var UserCompletenessSchema = (0, import_yup34.object)({
1363
+ var import_yup35 = require("yup");
1364
+ var UserCompletenessSchema = (0, import_yup35.object)({
1298
1365
  additionalInfo: CompletenessScoreSchema(0).label("Additional Info"),
1299
1366
  // Optional
1300
1367
  certifications: CompletenessScoreSchema(0).label("Certifications"),
@@ -1358,6 +1425,8 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
1358
1425
  PageStatus,
1359
1426
  PageType,
1360
1427
  PaginationSchema,
1428
+ PostSchema,
1429
+ PostStatus,
1361
1430
  ProficiencyLevel,
1362
1431
  QuestionSchema,
1363
1432
  QuestionType,
@@ -1386,6 +1455,7 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
1386
1455
  SupportedJobStatuses,
1387
1456
  SupportedPageStatuses,
1388
1457
  SupportedPageTypes,
1458
+ SupportedPostStatuses,
1389
1459
  SupportedProficiencyLevels,
1390
1460
  SupportedQuestionTypes,
1391
1461
  SupportedReferralSources,