@thejob/schema 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +138 -2
- package/dist/index.cjs +175 -133
- package/dist/index.d.cts +34 -4
- package/dist/index.d.ts +34 -4
- package/dist/index.js +145 -108
- package/package.json +1 -1
- package/src/extensions/date-string.extension.ts +1 -1
- package/src/index.ts +6 -0
- package/src/report/report.constant.ts +20 -0
- package/src/report/report.schema.ts +20 -0
- package/src/social-account/social-account.schema.ts +1 -1
- package/src/user/user-coordinator-profile.schema.ts +1 -1
- package/src/user/user-job-preferences.schema.ts +11 -11
- package/src/user/user-recruiter-profile.schema.ts +1 -1
- package/src/user/user.constant.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -61,6 +61,9 @@ __export(index_exports, {
|
|
|
61
61
|
ProficiencyLevel: () => ProficiencyLevel,
|
|
62
62
|
RecruiterPageLinkSchema: () => RecruiterPageLinkSchema,
|
|
63
63
|
ReferralSource: () => ReferralSource,
|
|
64
|
+
ReportReason: () => ReportReason,
|
|
65
|
+
ReportSchema: () => ReportSchema,
|
|
66
|
+
ResourceType: () => ResourceType,
|
|
64
67
|
SkillSchema: () => SkillSchema,
|
|
65
68
|
SocialAccount: () => SocialAccount,
|
|
66
69
|
SocialAccountSchema: () => SocialAccountSchema,
|
|
@@ -74,6 +77,8 @@ __export(index_exports, {
|
|
|
74
77
|
SupportedPageTypes: () => SupportedPageTypes,
|
|
75
78
|
SupportedProficiencyLevels: () => SupportedProficiencyLevels,
|
|
76
79
|
SupportedReferralSources: () => SupportedReferralSources,
|
|
80
|
+
SupportedReportReasons: () => SupportedReportReasons,
|
|
81
|
+
SupportedResourceTypes: () => SupportedResourceTypes,
|
|
77
82
|
SupportedSalaryCurrencies: () => SupportedSalaryCurrencies,
|
|
78
83
|
SupportedSocialAccounts: () => SupportedSocialAccounts,
|
|
79
84
|
SupportedStudyTypes: () => SupportedStudyTypes,
|
|
@@ -434,7 +439,7 @@ var SupportedSocialAccounts = Object.values(SocialAccount);
|
|
|
434
439
|
|
|
435
440
|
// src/social-account/social-account.schema.ts
|
|
436
441
|
var SocialAccountSchema = (0, import_yup11.object)().shape({
|
|
437
|
-
// TODO: Remove isNew
|
|
442
|
+
// TODO: Remove isNew - it's unused. Backend (user-social-accounts.service.ts) just strips it before saving.
|
|
438
443
|
isNew: (0, import_yup11.boolean)().default(false).optional().label("Is New"),
|
|
439
444
|
type: (0, import_yup11.string)().oneOf(SupportedSocialAccounts).required().label("Account Type"),
|
|
440
445
|
url: (0, import_yup11.string)().required().label("URL")
|
|
@@ -503,19 +508,51 @@ var DefaultPaginationOptions = {
|
|
|
503
508
|
limit: 10
|
|
504
509
|
};
|
|
505
510
|
|
|
506
|
-
// src/
|
|
511
|
+
// src/report/report.schema.ts
|
|
507
512
|
var import_yup14 = require("yup");
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
+
|
|
514
|
+
// src/report/report.constant.ts
|
|
515
|
+
var ResourceType = /* @__PURE__ */ ((ResourceType3) => {
|
|
516
|
+
ResourceType3["Job"] = "job";
|
|
517
|
+
ResourceType3["User"] = "user";
|
|
518
|
+
ResourceType3["Resume"] = "resume";
|
|
519
|
+
ResourceType3["Company"] = "company";
|
|
520
|
+
return ResourceType3;
|
|
521
|
+
})(ResourceType || {});
|
|
522
|
+
var SupportedResourceTypes = Object.values(ResourceType);
|
|
523
|
+
var ReportReason = /* @__PURE__ */ ((ReportReason3) => {
|
|
524
|
+
ReportReason3["OffensiveOrHarassing"] = "offensive_or_harassing";
|
|
525
|
+
ReportReason3["JobExpired"] = "job_expired";
|
|
526
|
+
ReportReason3["AskingMoney"] = "asking_money";
|
|
527
|
+
ReportReason3["FakeJob"] = "fake_job";
|
|
528
|
+
ReportReason3["IncorrectJobDetails"] = "incorrect_job_details";
|
|
529
|
+
ReportReason3["SellingSomething"] = "selling_something";
|
|
530
|
+
ReportReason3["Other"] = "other";
|
|
531
|
+
return ReportReason3;
|
|
532
|
+
})(ReportReason || {});
|
|
533
|
+
var SupportedReportReasons = Object.values(ReportReason);
|
|
534
|
+
|
|
535
|
+
// 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")
|
|
541
|
+
}).label("Report Schema");
|
|
542
|
+
|
|
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")
|
|
513
550
|
}).optional().nullable().default(null).label("Logo"),
|
|
514
|
-
tags: (0,
|
|
551
|
+
tags: (0, import_yup15.array)().of((0, import_yup15.string)().max(50)).max(20).optional().label("Tags")
|
|
515
552
|
}).concat(DbDefaultSchema).noUnknown().strict().label("Skill");
|
|
516
553
|
|
|
517
554
|
// src/user/user.schema.ts
|
|
518
|
-
var
|
|
555
|
+
var import_yup28 = require("yup");
|
|
519
556
|
|
|
520
557
|
// src/user/user.constant.ts
|
|
521
558
|
var UserRole = /* @__PURE__ */ ((UserRole2) => {
|
|
@@ -597,51 +634,51 @@ var MIN_SALARY_LOWER_BOUND = 0;
|
|
|
597
634
|
var MIN_SALARY_UPPER_BOUND = 1e6;
|
|
598
635
|
|
|
599
636
|
// src/user/work-experience.schema.ts
|
|
600
|
-
var
|
|
601
|
-
var WorkExperienceSchema = (0,
|
|
637
|
+
var import_yup16 = require("yup");
|
|
638
|
+
var WorkExperienceSchema = (0, import_yup16.object)().shape({
|
|
602
639
|
company: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company"),
|
|
603
|
-
designation: (0,
|
|
640
|
+
designation: (0, import_yup16.string)().trim().required().label("Designation"),
|
|
604
641
|
duration: DurationSchema({
|
|
605
642
|
format: "YYYY-MM",
|
|
606
643
|
startLabel: "Start Date",
|
|
607
644
|
endLabel: "End Date"
|
|
608
645
|
}).required().label("Duration"),
|
|
609
|
-
description: (0,
|
|
646
|
+
description: (0, import_yup16.string)().trim().max(3e3).optional().label("Description"),
|
|
610
647
|
location: LocationSchema.required().label("Location"),
|
|
611
|
-
isRemote: (0,
|
|
648
|
+
isRemote: (0, import_yup16.boolean)().oneOf([true, false]).default(false).label("Is Remote")
|
|
612
649
|
}).noUnknown().strict().label("Work Experience");
|
|
613
650
|
|
|
614
651
|
// src/user/education.schema.ts
|
|
615
|
-
var
|
|
616
|
-
var EducationSchema = (0,
|
|
652
|
+
var import_yup17 = require("yup");
|
|
653
|
+
var EducationSchema = (0, import_yup17.object)({
|
|
617
654
|
institute: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Institute"),
|
|
618
|
-
course: (0,
|
|
619
|
-
fieldOfStudy: (0,
|
|
655
|
+
course: (0, import_yup17.string)().trim().required().label("Course"),
|
|
656
|
+
fieldOfStudy: (0, import_yup17.string)().trim().required().label("Field of Study"),
|
|
620
657
|
duration: DurationSchema({
|
|
621
658
|
format: "YYYY-MM",
|
|
622
659
|
startLabel: "Start Date",
|
|
623
660
|
endLabel: "End Date"
|
|
624
661
|
}).required().label("Duration"),
|
|
625
|
-
description: (0,
|
|
626
|
-
isDistanceLearning: (0,
|
|
662
|
+
description: (0, import_yup17.string)().trim().max(3e3).optional().label("Description"),
|
|
663
|
+
isDistanceLearning: (0, import_yup17.boolean)().default(false).label("Is Distance Learning"),
|
|
627
664
|
location: LocationSchema.required().label("Location"),
|
|
628
|
-
studyType: (0,
|
|
665
|
+
studyType: (0, import_yup17.string)().oneOf(SupportedStudyTypes).trim().max(50).required().label("Study Type")
|
|
629
666
|
}).noUnknown().strict().label("Education");
|
|
630
667
|
|
|
631
668
|
// src/user/user-skill.schema.ts
|
|
632
|
-
var
|
|
633
|
-
var UserSkillSchema = (0,
|
|
634
|
-
name: (0,
|
|
635
|
-
proficiencyLevel: (0,
|
|
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"),
|
|
636
673
|
lastUsed: dateString().format("YYYY-MM").nullable().optional().label("Last Used")
|
|
637
674
|
}).noUnknown().strict().label("Skill");
|
|
638
675
|
|
|
639
676
|
// src/user/project.schema.ts
|
|
640
|
-
var
|
|
641
|
-
var UserProjectSchema = (0,
|
|
642
|
-
name: (0,
|
|
643
|
-
url: (0,
|
|
644
|
-
description: (0,
|
|
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"),
|
|
645
682
|
duration: DurationSchema({
|
|
646
683
|
format: "YYYY-MM",
|
|
647
684
|
startLabel: "Start Date",
|
|
@@ -650,118 +687,118 @@ var UserProjectSchema = (0, import_yup18.object)({
|
|
|
650
687
|
}).noUnknown().strict().label("Project");
|
|
651
688
|
|
|
652
689
|
// src/user/user-certification.schema.ts
|
|
653
|
-
var
|
|
654
|
-
var UserCertificationSchema = (0,
|
|
655
|
-
name: (0,
|
|
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"),
|
|
656
693
|
// TODO: Add validation for authority
|
|
657
|
-
authority: (0,
|
|
658
|
-
licenseNumber: (0,
|
|
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"),
|
|
659
696
|
duration: DurationSchema({
|
|
660
697
|
format: "YYYY-MM",
|
|
661
698
|
startLabel: "Start Date",
|
|
662
699
|
endLabel: "End Date"
|
|
663
700
|
}).optional().nullable().label("Duration"),
|
|
664
|
-
url: (0,
|
|
701
|
+
url: (0, import_yup20.string)().optional().label("URL")
|
|
665
702
|
}).noUnknown().strict().label("Certification");
|
|
666
703
|
|
|
667
704
|
// src/user/user-interest.schema.ts
|
|
668
|
-
var
|
|
669
|
-
var UserInterestSchema = (0,
|
|
705
|
+
var import_yup21 = require("yup");
|
|
706
|
+
var UserInterestSchema = (0, import_yup21.string)().trim().required().label("Interest");
|
|
670
707
|
|
|
671
708
|
// src/user/user-language.schema.ts
|
|
672
|
-
var
|
|
673
|
-
var UserLanguageSchema = (0,
|
|
674
|
-
name: (0,
|
|
675
|
-
proficiencyLevel: (0,
|
|
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")
|
|
676
713
|
}).noUnknown().strict().label("Language");
|
|
677
714
|
|
|
678
715
|
// src/user/user-additional-info.schema.ts
|
|
679
|
-
var
|
|
680
|
-
var UserAdditionalInfoSchema = (0,
|
|
681
|
-
title: (0,
|
|
682
|
-
description: (0,
|
|
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")
|
|
683
720
|
}).noUnknown().strict().label("User Additional Info");
|
|
684
721
|
|
|
685
722
|
// src/user/general-detail.schema.ts
|
|
686
|
-
var
|
|
687
|
-
var UserGeneralDetailSchema = (0,
|
|
688
|
-
id: (0,
|
|
689
|
-
name: (0,
|
|
690
|
-
first: (0,
|
|
691
|
-
last: (0,
|
|
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")
|
|
692
729
|
}).required().label("Name"),
|
|
693
|
-
headline: (0,
|
|
694
|
-
image: (0,
|
|
695
|
-
aboutMe: (0,
|
|
696
|
-
email: (0,
|
|
697
|
-
mobile: (0,
|
|
698
|
-
emailVerified: (0,
|
|
699
|
-
mobileVerified: (0,
|
|
700
|
-
experienceLevel: (0,
|
|
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"),
|
|
701
738
|
location: LocationSchema.required().label("Location"),
|
|
702
|
-
region: (0,
|
|
703
|
-
country: (0,
|
|
704
|
-
lang: (0,
|
|
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")
|
|
705
742
|
}).optional().default(void 0).label("Region"),
|
|
706
|
-
profileVisibility: (0,
|
|
743
|
+
profileVisibility: (0, import_yup24.string)().oneOf(SupportedUserProfileVisibilities).default("public" /* Public */).label("Profile Visibility")
|
|
707
744
|
}).noUnknown().strict().label("General Detail");
|
|
708
745
|
|
|
709
746
|
// src/user/user-job-preferences.schema.ts
|
|
710
|
-
var
|
|
711
|
-
var UserJobPreferencesSchema = (0,
|
|
747
|
+
var import_yup25 = require("yup");
|
|
748
|
+
var UserJobPreferencesSchema = (0, import_yup25.object)({
|
|
712
749
|
/**
|
|
713
750
|
* Whether the job seeker is openly signalling availability. Surfaces the
|
|
714
751
|
* "Open to work" badge on the public profile and boosts visibility in
|
|
715
|
-
* recruiter search. Defaults to `false`
|
|
752
|
+
* recruiter search. Defaults to `false` - users must opt in.
|
|
716
753
|
*/
|
|
717
|
-
openToWork: (0,
|
|
754
|
+
openToWork: (0, import_yup25.boolean)().default(false).label("Open to Work"),
|
|
718
755
|
/**
|
|
719
756
|
* How urgently the user is looking for their next job. Drives match scoring
|
|
720
757
|
* and can downgrade the visibility of expired or low-relevance postings for
|
|
721
758
|
* users in `passively_browsing` mode.
|
|
722
759
|
*/
|
|
723
|
-
jobSearchUrgency: (0,
|
|
760
|
+
jobSearchUrgency: (0, import_yup25.string)().oneOf(SupportedJobSearchUrgencies).required().label("Job Search Urgency"),
|
|
724
761
|
/**
|
|
725
762
|
* Locations the user wants to work in. Stores the full `LocationSchema`
|
|
726
763
|
* shape (country, city, state, geo, etc.) as returned by the locations
|
|
727
764
|
* autocomplete API.
|
|
728
765
|
*/
|
|
729
|
-
jobLocations: (0,
|
|
766
|
+
jobLocations: (0, import_yup25.array)().of(LocationSchema.required().label("Job Location")).min(1, "Pick at least one preferred location.").required().label("Job Locations"),
|
|
730
767
|
/**
|
|
731
768
|
* Seniority levels the user wants jobs to be matched against. Multi-select
|
|
732
769
|
* (up to 2) for borderline candidates.
|
|
733
770
|
*
|
|
734
771
|
* Distinct from the singular `experienceLevel` field on `UserSchema`
|
|
735
|
-
* (concat'd via `UserGeneralDetailSchema`)
|
|
772
|
+
* (concat'd via `UserGeneralDetailSchema`) - that field captures the user's
|
|
736
773
|
* own current seniority, while these are the levels they want to *target*.
|
|
737
774
|
* Both reuse the same `ExperienceLevel` taxonomy from `common.constant.ts`
|
|
738
775
|
* so search/match logic doesn't have to translate between two vocabularies.
|
|
739
776
|
*/
|
|
740
|
-
targetExperienceLevels: (0,
|
|
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"),
|
|
741
778
|
/**
|
|
742
|
-
* Specializations the user is searching for
|
|
779
|
+
* Specializations the user is searching for - free-form titles.
|
|
743
780
|
*
|
|
744
781
|
* Job titles are an open vocabulary (think O*NET, ESCO, LinkedIn's title
|
|
745
782
|
* graph), so the schema only enforces length bounds per entry. The wizard
|
|
746
783
|
* surfaces a curated "Popular Roles" picker for discovery, but the user
|
|
747
784
|
* can ultimately add any title; matching/normalization happens downstream.
|
|
748
785
|
*/
|
|
749
|
-
jobRoles: (0,
|
|
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"),
|
|
750
787
|
/**
|
|
751
788
|
* Minimum acceptable annual base salary, in `minSalaryCurrency`.
|
|
752
789
|
* Stored as an integer in the currency's major unit (e.g. dollars, not cents).
|
|
753
|
-
* Defaults to 0 ("any salary") rather than being optional
|
|
790
|
+
* Defaults to 0 ("any salary") rather than being optional - every job-seeker
|
|
754
791
|
* has a floor, even if it's zero.
|
|
755
792
|
*/
|
|
756
|
-
minSalary: (0,
|
|
757
|
-
minSalaryCurrency: (0,
|
|
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"),
|
|
758
795
|
/**
|
|
759
796
|
* Marketing-attribution capture from the final onboarding step.
|
|
760
797
|
*/
|
|
761
|
-
referralSource: (0,
|
|
798
|
+
referralSource: (0, import_yup25.string)().oneOf(SupportedReferralSources).required().label("Referral Source"),
|
|
762
799
|
/**
|
|
763
800
|
* Resumes the user has uploaded. Embedded directly on the user document
|
|
764
|
-
* (capped at 5)
|
|
801
|
+
* (capped at 5) - they're cheap to denormalize, every wizard step that
|
|
765
802
|
* cares about them is already loading the user doc, and the cap keeps the
|
|
766
803
|
* subdoc bounded.
|
|
767
804
|
*
|
|
@@ -769,147 +806,147 @@ var UserJobPreferencesSchema = (0, import_yup24.object)({
|
|
|
769
806
|
* the API can sign for download is kept here.
|
|
770
807
|
*
|
|
771
808
|
* Distinct from the `Resumes` collection used by the (currently unused)
|
|
772
|
-
* AI resume-builder flow
|
|
809
|
+
* AI resume-builder flow - onboarding uploads land here, AI-built resumes
|
|
773
810
|
* live in their own collection.
|
|
774
811
|
*/
|
|
775
|
-
resumes: (0,
|
|
776
|
-
(0,
|
|
777
|
-
// Stable id assigned on upload
|
|
812
|
+
resumes: (0, import_yup25.array)().of(
|
|
813
|
+
(0, import_yup25.object)({
|
|
814
|
+
// Stable id assigned on upload - used to address a specific entry
|
|
778
815
|
// for delete / set-primary operations without exposing the GCS URL
|
|
779
816
|
// as a route key.
|
|
780
|
-
id: (0,
|
|
781
|
-
url: (0,
|
|
782
|
-
filename: (0,
|
|
783
|
-
sizeBytes: (0,
|
|
784
|
-
mimeType: (0,
|
|
785
|
-
uploadedAt: (0,
|
|
786
|
-
isPrimary: (0,
|
|
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")
|
|
787
824
|
}).noUnknown().strict().label("Resume")
|
|
788
825
|
).max(5, "You can keep at most 5 resumes on file.").default([]).label("Resumes"),
|
|
789
826
|
/**
|
|
790
827
|
* Set when the user finishes the wizard's last step. Acts as the gate the
|
|
791
828
|
* onboarding hook checks to redirect users who haven't completed setup.
|
|
792
829
|
*/
|
|
793
|
-
onboardingCompletedAt: (0,
|
|
830
|
+
onboardingCompletedAt: (0, import_yup25.date)().nullable().optional().label("Onboarding Completed At"),
|
|
794
831
|
/**
|
|
795
832
|
* Parser-suggested values for wizard fields, written by the resume-upload
|
|
796
|
-
* flow. Every parser-derived field lands here
|
|
833
|
+
* flow. Every parser-derived field lands here - including profile-shaped
|
|
797
834
|
* fields (headline, aboutMe, mobile, location, experienceLevel,
|
|
798
|
-
* socialAccounts, workExperiences, educations)
|
|
835
|
+
* socialAccounts, workExperiences, educations) - so nothing reaches the
|
|
799
836
|
* top-level user document until the user confirms it on the matching
|
|
800
837
|
* wizard step. When a user clicks Next on a step, the API drops the
|
|
801
838
|
* matching key from this sub-doc so a re-uploaded resume can't overwrite
|
|
802
839
|
* confirmed answers.
|
|
803
840
|
*
|
|
804
|
-
* READ RULE
|
|
841
|
+
* READ RULE - strict:
|
|
805
842
|
* `pendingPrefill.<field>` is ONLY for seeding a wizard step's form
|
|
806
843
|
* initial value (e.g. `prefer(user.<field>, user.pendingPrefill?.<field>)`
|
|
807
|
-
* in a step's `load`). It is NOT the user's actual value
|
|
844
|
+
* in a step's `load`). It is NOT the user's actual value - it's an
|
|
808
845
|
* unconfirmed suggestion. Never substitute it as a fallback in profile
|
|
809
846
|
* pages, search/match, recommendations, public profile, dashboards, or
|
|
810
847
|
* APIs. If `user.<field>` is empty there, the correct behavior is empty,
|
|
811
848
|
* because the user has not confirmed it yet.
|
|
812
849
|
*/
|
|
813
|
-
pendingPrefill: (0,
|
|
814
|
-
headline: (0,
|
|
815
|
-
aboutMe: (0,
|
|
816
|
-
mobile: (0,
|
|
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"),
|
|
817
854
|
location: LocationSchema.optional().default(void 0).label("Pending Location"),
|
|
818
|
-
experienceLevel: (0,
|
|
819
|
-
socialAccounts: (0,
|
|
820
|
-
workExperiences: (0,
|
|
821
|
-
educations: (0,
|
|
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")
|
|
822
859
|
}).nullable().optional().default(void 0).label("Pending Prefill")
|
|
823
860
|
}).noUnknown().strict().label("User Job Preferences Schema");
|
|
824
861
|
|
|
825
862
|
// src/user/user-recruiter-profile.schema.ts
|
|
826
|
-
var
|
|
827
|
-
var RecruiterPageLinkSchema = (0,
|
|
863
|
+
var import_yup26 = require("yup");
|
|
864
|
+
var RecruiterPageLinkSchema = (0, import_yup26.object)({
|
|
828
865
|
page: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company Page"),
|
|
829
|
-
jobTitle: (0,
|
|
866
|
+
jobTitle: (0, import_yup26.string)().trim().max(100).optional().label("Job Title")
|
|
830
867
|
}).noUnknown().strict().label("Recruiter Page Link");
|
|
831
|
-
var UserRecruiterProfileSchema = (0,
|
|
832
|
-
recruiterProfile: (0,
|
|
833
|
-
hiringFor: (0,
|
|
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")
|
|
834
871
|
}).optional().default(void 0).label("Recruiter Profile")
|
|
835
872
|
}).noUnknown().strict().label("User Recruiter Profile");
|
|
836
873
|
|
|
837
874
|
// src/user/user-coordinator-profile.schema.ts
|
|
838
|
-
var
|
|
839
|
-
var CoordinatorPageLinkSchema = (0,
|
|
875
|
+
var import_yup27 = require("yup");
|
|
876
|
+
var CoordinatorPageLinkSchema = (0, import_yup27.object)({
|
|
840
877
|
page: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Institute Page"),
|
|
841
|
-
jobTitle: (0,
|
|
878
|
+
jobTitle: (0, import_yup27.string)().trim().max(100).optional().label("Job Title")
|
|
842
879
|
}).noUnknown().strict().label("Coordinator Page Link");
|
|
843
|
-
var UserCoordinatorProfileSchema = (0,
|
|
844
|
-
coordinatorProfile: (0,
|
|
845
|
-
coordinatesAt: (0,
|
|
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")
|
|
846
883
|
}).optional().default(void 0).label("Coordinator Profile")
|
|
847
884
|
}).noUnknown().strict().label("User Coordinator Profile");
|
|
848
885
|
|
|
849
886
|
// src/user/user.schema.ts
|
|
850
|
-
var UserSchema = (0,
|
|
887
|
+
var UserSchema = (0, import_yup28.object)({
|
|
851
888
|
/**
|
|
852
889
|
* Related auth account id from auth Server (e.g. Better auth https://auth.thejob.dev)
|
|
853
890
|
*/
|
|
854
|
-
authAccountId: (0,
|
|
891
|
+
authAccountId: (0, import_yup28.string)().required().label("Auth Account ID"),
|
|
855
892
|
/**
|
|
856
893
|
* Social media information about the user (e.g. LinkedIn, GitHub, etc.)
|
|
857
894
|
*/
|
|
858
|
-
socialAccounts: (0,
|
|
895
|
+
socialAccounts: (0, import_yup28.array)().of(SocialAccountSchema).default([]).label("Social Accounts"),
|
|
859
896
|
/**
|
|
860
897
|
* Work experience information about the user
|
|
861
898
|
*/
|
|
862
|
-
workExperiences: (0,
|
|
899
|
+
workExperiences: (0, import_yup28.array)().of(WorkExperienceSchema).required().default([]).label("Work Experiences"),
|
|
863
900
|
/**
|
|
864
901
|
* Education information about the user
|
|
865
902
|
*/
|
|
866
|
-
educations: (0,
|
|
903
|
+
educations: (0, import_yup28.array)().of(EducationSchema).required().default([]).label("Educations"),
|
|
867
904
|
/**
|
|
868
905
|
* Skills information about the user
|
|
869
906
|
*/
|
|
870
|
-
skills: (0,
|
|
907
|
+
skills: (0, import_yup28.array)().of(UserSkillSchema).required().default([]).label("Skills"),
|
|
871
908
|
/**
|
|
872
909
|
* Projects information about the user
|
|
873
910
|
*/
|
|
874
|
-
projects: (0,
|
|
911
|
+
projects: (0, import_yup28.array)().of(UserProjectSchema).default([]).label("Projects"),
|
|
875
912
|
/**
|
|
876
913
|
* Certifications information about the user
|
|
877
914
|
*/
|
|
878
|
-
certifications: (0,
|
|
915
|
+
certifications: (0, import_yup28.array)().of(UserCertificationSchema).default([]).label("Certifications"),
|
|
879
916
|
/**
|
|
880
917
|
* Interests information about the user.
|
|
881
918
|
*/
|
|
882
|
-
interests: (0,
|
|
919
|
+
interests: (0, import_yup28.array)().of(UserInterestSchema).optional().default([]).label("Interests"),
|
|
883
920
|
/**
|
|
884
921
|
* Languages information about the user
|
|
885
922
|
*/
|
|
886
|
-
languages: (0,
|
|
923
|
+
languages: (0, import_yup28.array)().of(UserLanguageSchema).required().default([]).label("Languages"),
|
|
887
924
|
/**
|
|
888
925
|
* Additional information about the user
|
|
889
926
|
*/
|
|
890
|
-
additionalInfo: (0,
|
|
927
|
+
additionalInfo: (0, import_yup28.array)().of(UserAdditionalInfoSchema).default([]).label("Additional Information"),
|
|
891
928
|
/**
|
|
892
929
|
* Status of the user account
|
|
893
930
|
*/
|
|
894
|
-
status: (0,
|
|
931
|
+
status: (0, import_yup28.string)().oneOf(SupportedUserStatuses).required().label("Status"),
|
|
895
932
|
/**
|
|
896
933
|
* Roles assigned to the user
|
|
897
934
|
*/
|
|
898
|
-
roles: (0,
|
|
935
|
+
roles: (0, import_yup28.array)().of((0, import_yup28.string)().oneOf(SupportedUserRoles)).required().default(DefaultUserRoles).label("Roles"),
|
|
899
936
|
/**
|
|
900
937
|
* Vector embedding of the user's profile for semantic/hybrid search.
|
|
901
938
|
* Generated from a structured summary of skills, experience, education, etc.
|
|
902
939
|
* Only generated for public profiles with sufficient completeness (≥60%).
|
|
903
940
|
*/
|
|
904
|
-
embedding: (0,
|
|
905
|
-
vector: (0,
|
|
906
|
-
model: (0,
|
|
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")
|
|
907
944
|
}).nullable().optional().label("Embedding")
|
|
908
945
|
}).concat(UserGeneralDetailSchema).concat(UserJobPreferencesSchema).concat(UserRecruiterProfileSchema).concat(UserCoordinatorProfileSchema).noUnknown().strict().label("User Schema");
|
|
909
946
|
|
|
910
947
|
// src/user/user-completeness.schema.ts
|
|
911
|
-
var
|
|
912
|
-
var UserCompletenessSchema = (0,
|
|
948
|
+
var import_yup29 = require("yup");
|
|
949
|
+
var UserCompletenessSchema = (0, import_yup29.object)({
|
|
913
950
|
additionalInfo: CompletenessScoreSchema(0).label("Additional Info"),
|
|
914
951
|
// Optional
|
|
915
952
|
certifications: CompletenessScoreSchema(0).label("Certifications"),
|
|
@@ -963,6 +1000,9 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
|
|
|
963
1000
|
ProficiencyLevel,
|
|
964
1001
|
RecruiterPageLinkSchema,
|
|
965
1002
|
ReferralSource,
|
|
1003
|
+
ReportReason,
|
|
1004
|
+
ReportSchema,
|
|
1005
|
+
ResourceType,
|
|
966
1006
|
SkillSchema,
|
|
967
1007
|
SocialAccount,
|
|
968
1008
|
SocialAccountSchema,
|
|
@@ -976,6 +1016,8 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
|
|
|
976
1016
|
SupportedPageTypes,
|
|
977
1017
|
SupportedProficiencyLevels,
|
|
978
1018
|
SupportedReferralSources,
|
|
1019
|
+
SupportedReportReasons,
|
|
1020
|
+
SupportedResourceTypes,
|
|
979
1021
|
SupportedSalaryCurrencies,
|
|
980
1022
|
SupportedSocialAccounts,
|
|
981
1023
|
SupportedStudyTypes,
|
package/dist/index.d.cts
CHANGED
|
@@ -377,6 +377,36 @@ declare const DefaultPaginationOptions: {
|
|
|
377
377
|
limit: number;
|
|
378
378
|
};
|
|
379
379
|
|
|
380
|
+
declare enum ResourceType {
|
|
381
|
+
Job = "job",
|
|
382
|
+
User = "user",
|
|
383
|
+
Resume = "resume",
|
|
384
|
+
Company = "company"
|
|
385
|
+
}
|
|
386
|
+
declare const SupportedResourceTypes: ResourceType[];
|
|
387
|
+
declare enum ReportReason {
|
|
388
|
+
OffensiveOrHarassing = "offensive_or_harassing",
|
|
389
|
+
JobExpired = "job_expired",
|
|
390
|
+
AskingMoney = "asking_money",
|
|
391
|
+
FakeJob = "fake_job",
|
|
392
|
+
IncorrectJobDetails = "incorrect_job_details",
|
|
393
|
+
SellingSomething = "selling_something",
|
|
394
|
+
Other = "other"
|
|
395
|
+
}
|
|
396
|
+
declare const SupportedReportReasons: ReportReason[];
|
|
397
|
+
|
|
398
|
+
declare const ReportSchema: yup.ObjectSchema<{
|
|
399
|
+
type: NonNullable<ResourceType | undefined>;
|
|
400
|
+
resourceId: string;
|
|
401
|
+
reason: NonNullable<ReportReason | undefined>;
|
|
402
|
+
comment: string | undefined;
|
|
403
|
+
}, yup.AnyObject, {
|
|
404
|
+
type: undefined;
|
|
405
|
+
resourceId: undefined;
|
|
406
|
+
reason: undefined;
|
|
407
|
+
comment: undefined;
|
|
408
|
+
}, "">;
|
|
409
|
+
|
|
380
410
|
declare const SkillSchema: yup.ObjectSchema<{
|
|
381
411
|
name: string;
|
|
382
412
|
logo: {
|
|
@@ -499,7 +529,7 @@ declare enum JobSearchUrgency {
|
|
|
499
529
|
}
|
|
500
530
|
declare const SupportedJobSearchUrgencies: JobSearchUrgency[];
|
|
501
531
|
/**
|
|
502
|
-
* How the user heard about the platform
|
|
532
|
+
* How the user heard about the platform - captured at the end of onboarding
|
|
503
533
|
* for marketing attribution.
|
|
504
534
|
*/
|
|
505
535
|
declare enum ReferralSource {
|
|
@@ -1365,7 +1395,7 @@ declare const RecruiterPageLinkSchema: yup.ObjectSchema<{
|
|
|
1365
1395
|
}, "">;
|
|
1366
1396
|
/**
|
|
1367
1397
|
* Recruiter-role-specific fields on UserSchema. All optional at the field
|
|
1368
|
-
* level
|
|
1398
|
+
* level - presence is gated by `UserRole.Recruiter` in the user's `roles`,
|
|
1369
1399
|
* not by schema branching, so the user shape stays flat.
|
|
1370
1400
|
*/
|
|
1371
1401
|
declare const UserRecruiterProfileSchema: yup.ObjectSchema<{
|
|
@@ -1443,7 +1473,7 @@ declare const CoordinatorPageLinkSchema: yup.ObjectSchema<{
|
|
|
1443
1473
|
}, "">;
|
|
1444
1474
|
/**
|
|
1445
1475
|
* Coordinator-role-specific fields on UserSchema. All optional at the field
|
|
1446
|
-
* level
|
|
1476
|
+
* level - presence is gated by `UserRole.Coordinator` in the user's
|
|
1447
1477
|
* `roles`, not by schema branching, so the user shape stays flat.
|
|
1448
1478
|
*/
|
|
1449
1479
|
declare const UserCoordinatorProfileSchema: yup.ObjectSchema<{
|
|
@@ -1703,4 +1733,4 @@ declare const StudentCompletenessSchema: yup.ObjectSchema<{
|
|
|
1703
1733
|
};
|
|
1704
1734
|
}, "">;
|
|
1705
1735
|
|
|
1706
|
-
export { CompletenessScoreSchema, ContactTypes, CoordinatorPageLinkSchema, DateStringSchema, DbDefaultSchema, DefaultPaginatedResponse, DefaultPaginationOptions, DefaultUserRoles, DurationSchema, EducationLevel, EducationSchema, ExperienceLevel, GeneraDetailFields, GroupManagedBy, GroupMembershipSchema, GroupMembershipStatus, GroupSchema, GroupStatus, GroupTranslationSchema, GroupVisibility, JobSearchUrgency, LocationSchema, MIN_SALARY_LOWER_BOUND, MIN_SALARY_UPPER_BOUND, PageSchema, PageStatus, PageType, type PaginatedResponse, PaginationSchema, ProficiencyLevel, RecruiterPageLinkSchema, ReferralSource, SkillSchema, SocialAccount, SocialAccountSchema, StudentCompletenessSchema, StudyType, SupportedContactTypes, SupportedEducationLevels, SupportedExperienceLevels, SupportedJobSearchUrgencies, SupportedPageStatuses, SupportedPageTypes, SupportedProficiencyLevels, SupportedReferralSources, SupportedSalaryCurrencies, type SupportedSalaryCurrency, SupportedSocialAccounts, SupportedStudyTypes, SupportedUserProfileVisibilities, SupportedUserRoles, SupportedUserStatuses, type TDurationSchema, TermsAcceptedSchema, UserAdditionalInfoSchema, UserCertificationSchema, UserCompletenessSchema, UserCoordinatorProfileSchema, UserDetailType, UserGeneralDetailSchema, UserInterestSchema, UserJobPreferencesSchema, UserLanguageSchema, type UserProfileOverview, UserProfileVisibility, UserProjectSchema, UserRecruiterProfileSchema, UserRole, UserSchema, UserSkillSchema, UserStatus, WorkExperienceSchema, dateString };
|
|
1736
|
+
export { CompletenessScoreSchema, ContactTypes, CoordinatorPageLinkSchema, DateStringSchema, DbDefaultSchema, DefaultPaginatedResponse, DefaultPaginationOptions, DefaultUserRoles, DurationSchema, EducationLevel, EducationSchema, ExperienceLevel, GeneraDetailFields, GroupManagedBy, GroupMembershipSchema, GroupMembershipStatus, GroupSchema, GroupStatus, GroupTranslationSchema, GroupVisibility, JobSearchUrgency, LocationSchema, MIN_SALARY_LOWER_BOUND, MIN_SALARY_UPPER_BOUND, PageSchema, PageStatus, PageType, type PaginatedResponse, PaginationSchema, ProficiencyLevel, RecruiterPageLinkSchema, ReferralSource, ReportReason, ReportSchema, ResourceType, SkillSchema, SocialAccount, SocialAccountSchema, StudentCompletenessSchema, StudyType, SupportedContactTypes, SupportedEducationLevels, SupportedExperienceLevels, SupportedJobSearchUrgencies, SupportedPageStatuses, SupportedPageTypes, SupportedProficiencyLevels, SupportedReferralSources, SupportedReportReasons, SupportedResourceTypes, SupportedSalaryCurrencies, type SupportedSalaryCurrency, SupportedSocialAccounts, SupportedStudyTypes, SupportedUserProfileVisibilities, SupportedUserRoles, SupportedUserStatuses, type TDurationSchema, TermsAcceptedSchema, UserAdditionalInfoSchema, UserCertificationSchema, UserCompletenessSchema, UserCoordinatorProfileSchema, UserDetailType, UserGeneralDetailSchema, UserInterestSchema, UserJobPreferencesSchema, UserLanguageSchema, type UserProfileOverview, UserProfileVisibility, UserProjectSchema, UserRecruiterProfileSchema, UserRole, UserSchema, UserSkillSchema, UserStatus, WorkExperienceSchema, dateString };
|