@thejob/schema 2.0.7 → 2.0.9
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 +293 -169
- package/dist/index.d.cts +199 -1
- package/dist/index.d.ts +199 -1
- package/dist/index.js +285 -168
- package/package.json +1 -1
- package/src/index.ts +6 -0
- package/src/marketing/marketing.constant.ts +8 -0
- package/src/marketing/marketing.schema.ts +130 -0
- package/src/user/user.constant.ts +30 -0
- package/pnpm-workspace.yaml +0 -2
package/dist/index.js
CHANGED
|
@@ -1900,63 +1900,8 @@ var PostSchema = object17({
|
|
|
1900
1900
|
status: string14().oneOf(SupportedPostStatuses).default("draft" /* Draft */).required().label("Status")
|
|
1901
1901
|
}).concat(DbDefaultSchema).noUnknown().label("Post");
|
|
1902
1902
|
|
|
1903
|
-
// src/
|
|
1904
|
-
import { number as number7, object as object18, string as string15 } from "yup";
|
|
1905
|
-
var PaginationSchema = object18().shape({
|
|
1906
|
-
page: number7().required().min(1).label("Page").default(1),
|
|
1907
|
-
limit: number7().required().min(1).max(100).label("Limit").default(10),
|
|
1908
|
-
sortBy: string15().notOneOf([""]).optional().label("SortBy"),
|
|
1909
|
-
nextPage: string15().optional().label("Next Page Token"),
|
|
1910
|
-
prevPage: string15().optional().label("Previous Page Token"),
|
|
1911
|
-
sortDirection: string15().oneOf(["asc", "desc"]).optional().label("Sort Direction")
|
|
1912
|
-
});
|
|
1913
|
-
|
|
1914
|
-
// src/pagination/pagination.constant.ts
|
|
1915
|
-
var DefaultPaginatedResponse = {
|
|
1916
|
-
results: [],
|
|
1917
|
-
total: 0,
|
|
1918
|
-
page: 1,
|
|
1919
|
-
limit: 10
|
|
1920
|
-
};
|
|
1921
|
-
var DefaultPaginationOptions = {
|
|
1922
|
-
page: 1,
|
|
1923
|
-
limit: 10
|
|
1924
|
-
};
|
|
1925
|
-
|
|
1926
|
-
// src/report/report.schema.ts
|
|
1927
|
-
import { mixed as mixed4, object as object19, string as string16 } from "yup";
|
|
1928
|
-
|
|
1929
|
-
// src/report/report.constant.ts
|
|
1930
|
-
var ResourceType = /* @__PURE__ */ ((ResourceType3) => {
|
|
1931
|
-
ResourceType3["Job"] = "job";
|
|
1932
|
-
ResourceType3["User"] = "user";
|
|
1933
|
-
ResourceType3["Resume"] = "resume";
|
|
1934
|
-
ResourceType3["Company"] = "company";
|
|
1935
|
-
return ResourceType3;
|
|
1936
|
-
})(ResourceType || {});
|
|
1937
|
-
var SupportedResourceTypes = Object.values(ResourceType);
|
|
1938
|
-
var ReportReason = /* @__PURE__ */ ((ReportReason3) => {
|
|
1939
|
-
ReportReason3["OffensiveOrHarassing"] = "offensive_or_harassing";
|
|
1940
|
-
ReportReason3["JobExpired"] = "job_expired";
|
|
1941
|
-
ReportReason3["AskingMoney"] = "asking_money";
|
|
1942
|
-
ReportReason3["FakeJob"] = "fake_job";
|
|
1943
|
-
ReportReason3["IncorrectJobDetails"] = "incorrect_job_details";
|
|
1944
|
-
ReportReason3["SellingSomething"] = "selling_something";
|
|
1945
|
-
ReportReason3["Other"] = "other";
|
|
1946
|
-
return ReportReason3;
|
|
1947
|
-
})(ReportReason || {});
|
|
1948
|
-
var SupportedReportReasons = Object.values(ReportReason);
|
|
1949
|
-
|
|
1950
|
-
// src/report/report.schema.ts
|
|
1951
|
-
var ReportSchema = object19({
|
|
1952
|
-
type: mixed4().oneOf(SupportedResourceTypes).required().label("Type"),
|
|
1953
|
-
resourceId: string16().required().label("Resource ID"),
|
|
1954
|
-
reason: mixed4().oneOf(SupportedReportReasons).required("Please choose a reason").label("Reason"),
|
|
1955
|
-
comment: string16().max(1e3).optional().label("Comment")
|
|
1956
|
-
}).label("Report Schema");
|
|
1957
|
-
|
|
1958
|
-
// src/user/user.schema.ts
|
|
1959
|
-
import { array as array13, number as number9, object as object31, string as string29 } from "yup";
|
|
1903
|
+
// src/marketing/marketing.schema.ts
|
|
1904
|
+
import { array as array10, boolean as boolean11, number as number7, object as object18, string as string15 } from "yup";
|
|
1960
1905
|
|
|
1961
1906
|
// src/user/user.constant.ts
|
|
1962
1907
|
var UserRole = /* @__PURE__ */ ((UserRole2) => {
|
|
@@ -2036,53 +1981,218 @@ var SupportedReferralSources = Object.values(ReferralSource);
|
|
|
2036
1981
|
var SupportedSalaryCurrencies = ["USD", "EUR", "GBP", "SEK", "INR"];
|
|
2037
1982
|
var MIN_SALARY_LOWER_BOUND = 0;
|
|
2038
1983
|
var MIN_SALARY_UPPER_BOUND = 1e6;
|
|
1984
|
+
var PREFILL_MIRRORED_KEYS = [
|
|
1985
|
+
"headline",
|
|
1986
|
+
"aboutMe",
|
|
1987
|
+
"mobile",
|
|
1988
|
+
"location",
|
|
1989
|
+
"experienceLevel",
|
|
1990
|
+
"socialAccounts",
|
|
1991
|
+
"workExperiences",
|
|
1992
|
+
"educations"
|
|
1993
|
+
];
|
|
1994
|
+
var PRIVATE_PROFILE_FIELDS = [
|
|
1995
|
+
"email",
|
|
1996
|
+
"emailVerified",
|
|
1997
|
+
"mobile",
|
|
1998
|
+
"additionalInfo"
|
|
1999
|
+
];
|
|
2000
|
+
|
|
2001
|
+
// src/marketing/marketing.schema.ts
|
|
2002
|
+
var tokens = (label) => array10().of(string15().trim().required()).optional().default([]).label(label);
|
|
2003
|
+
var enumFacet = (values, label) => array10().of(string15().oneOf(values).required()).optional().default([]).label(label);
|
|
2004
|
+
var ListFilterSchema = object18({
|
|
2005
|
+
// ── Enum facets (closed vocabularies, chip pickers) ─────────────────────────
|
|
2006
|
+
countries: array10().of(string15().required()).optional().default([]).label("Countries"),
|
|
2007
|
+
roles: enumFacet(SupportedUserRoles, "Roles"),
|
|
2008
|
+
// The user's own current seniority (UserSchema.experienceLevel).
|
|
2009
|
+
experienceLevels: enumFacet(SupportedExperienceLevels, "Experience Levels"),
|
|
2010
|
+
// Levels the user is *targeting* (distinct from their current experienceLevel).
|
|
2011
|
+
targetExperienceLevels: enumFacet(
|
|
2012
|
+
SupportedExperienceLevels,
|
|
2013
|
+
"Target Experience Levels"
|
|
2014
|
+
),
|
|
2015
|
+
jobSearchUrgencies: enumFacet(SupportedJobSearchUrgencies, "Job Search Urgency"),
|
|
2016
|
+
referralSources: enumFacet(SupportedReferralSources, "Referral Source"),
|
|
2017
|
+
statuses: enumFacet(SupportedUserStatuses, "Account Status"),
|
|
2018
|
+
profileVisibilities: enumFacet(
|
|
2019
|
+
SupportedUserProfileVisibilities,
|
|
2020
|
+
"Profile Visibility"
|
|
2021
|
+
),
|
|
2022
|
+
// Proficiency held on any skill entry (skills[].proficiencyLevel).
|
|
2023
|
+
skillProficiencyLevels: enumFacet(
|
|
2024
|
+
SupportedProficiencyLevels,
|
|
2025
|
+
"Skill Proficiency"
|
|
2026
|
+
),
|
|
2027
|
+
// Proficiency held on any language entry (languages[].proficiencyLevel).
|
|
2028
|
+
languageProficiencyLevels: enumFacet(
|
|
2029
|
+
SupportedProficiencyLevels,
|
|
2030
|
+
"Language Proficiency"
|
|
2031
|
+
),
|
|
2032
|
+
// Mode of any education entry (educations[].studyType).
|
|
2033
|
+
studyTypes: enumFacet(SupportedStudyTypes, "Study Type"),
|
|
2034
|
+
// Platforms the user linked a social account for (socialAccounts[].type).
|
|
2035
|
+
socialAccountTypes: enumFacet(SupportedSocialAccounts, "Social Accounts"),
|
|
2036
|
+
// Currency of the user's salary floor (minSalaryCurrency).
|
|
2037
|
+
salaryCurrencies: enumFacet(SupportedSalaryCurrencies, "Salary Currency"),
|
|
2038
|
+
// ── Free-text token facets (nested profile arrays) ──────────────────────────
|
|
2039
|
+
skills: tokens("Skills"),
|
|
2040
|
+
languages: tokens("Languages"),
|
|
2041
|
+
interests: tokens("Interests"),
|
|
2042
|
+
companies: tokens("Companies"),
|
|
2043
|
+
designations: tokens("Job Titles / Designations"),
|
|
2044
|
+
institutes: tokens("Institutes"),
|
|
2045
|
+
courses: tokens("Courses"),
|
|
2046
|
+
fieldsOfStudy: tokens("Fields of Study"),
|
|
2047
|
+
certifications: tokens("Certifications"),
|
|
2048
|
+
certificationAuthorities: tokens("Certification Authorities"),
|
|
2049
|
+
projects: tokens("Projects"),
|
|
2050
|
+
jobRoles: tokens("Target Roles"),
|
|
2051
|
+
jobLocations: tokens("Preferred Job Locations"),
|
|
2052
|
+
// Companies a recruiter is hiring for (recruiterProfile.hiringFor[].page.name).
|
|
2053
|
+
hiringForCompanies: tokens("Hiring For (Companies)"),
|
|
2054
|
+
// Institutes a coordinator works at (coordinatorProfile.coordinatesAt[].page.name).
|
|
2055
|
+
coordinatesAtInstitutes: tokens("Coordinates At (Institutes)"),
|
|
2056
|
+
// Case-insensitive keyword match against headline + aboutMe.
|
|
2057
|
+
keywords: tokens("Profile Keywords"),
|
|
2058
|
+
// ── Range / boolean facets ──────────────────────────────────────────────────
|
|
2059
|
+
minSalaryFloor: number7().integer().min(0).optional().label("Min Salary \u2265"),
|
|
2060
|
+
minSalaryCeil: number7().integer().min(0).optional().label("Min Salary \u2264"),
|
|
2061
|
+
openToWorkOnly: boolean11().optional().default(false).label("Open to Work Only"),
|
|
2062
|
+
remoteExperienceOnly: boolean11().optional().default(false).label("Has Remote Experience"),
|
|
2063
|
+
hasResumeOnly: boolean11().optional().default(false).label("Has Resume"),
|
|
2064
|
+
onboardingCompletedOnly: boolean11().optional().default(false).label("Onboarding Completed"),
|
|
2065
|
+
emailVerifiedOnly: boolean11().optional().default(false).label("Email Verified Only"),
|
|
2066
|
+
mobileVerifiedOnly: boolean11().optional().default(false).label("Mobile Verified Only")
|
|
2067
|
+
}).label("Audience Filter");
|
|
2068
|
+
var MailingListSchema = object18({
|
|
2069
|
+
name: string15().required().min(1).max(120).label("Name"),
|
|
2070
|
+
description: string15().optional().max(500).label("Description"),
|
|
2071
|
+
filter: ListFilterSchema.default(() => ListFilterSchema.getDefault())
|
|
2072
|
+
}).label("Mailing List");
|
|
2073
|
+
var CampaignSchema = object18({
|
|
2074
|
+
name: string15().required().min(1).max(200).label("Campaign Name"),
|
|
2075
|
+
subject: string15().required().min(1).max(255).label("Subject"),
|
|
2076
|
+
// HTML body; may contain a {{unsubscribe_url}} placeholder.
|
|
2077
|
+
html: string15().required().min(1).label("HTML Body"),
|
|
2078
|
+
text: string15().optional().label("Plain-text Body"),
|
|
2079
|
+
listId: string15().required().label("Mailing List")
|
|
2080
|
+
}).label("Campaign");
|
|
2081
|
+
|
|
2082
|
+
// src/marketing/marketing.constant.ts
|
|
2083
|
+
var CampaignStatus = /* @__PURE__ */ ((CampaignStatus2) => {
|
|
2084
|
+
CampaignStatus2["Draft"] = "draft";
|
|
2085
|
+
CampaignStatus2["Sending"] = "sending";
|
|
2086
|
+
CampaignStatus2["Sent"] = "sent";
|
|
2087
|
+
CampaignStatus2["Failed"] = "failed";
|
|
2088
|
+
return CampaignStatus2;
|
|
2089
|
+
})(CampaignStatus || {});
|
|
2090
|
+
var SupportedCampaignStatuses = Object.values(CampaignStatus);
|
|
2091
|
+
|
|
2092
|
+
// src/pagination/pagination.schema.ts
|
|
2093
|
+
import { number as number8, object as object19, string as string16 } from "yup";
|
|
2094
|
+
var PaginationSchema = object19().shape({
|
|
2095
|
+
page: number8().required().min(1).label("Page").default(1),
|
|
2096
|
+
limit: number8().required().min(1).max(100).label("Limit").default(10),
|
|
2097
|
+
sortBy: string16().notOneOf([""]).optional().label("SortBy"),
|
|
2098
|
+
nextPage: string16().optional().label("Next Page Token"),
|
|
2099
|
+
prevPage: string16().optional().label("Previous Page Token"),
|
|
2100
|
+
sortDirection: string16().oneOf(["asc", "desc"]).optional().label("Sort Direction")
|
|
2101
|
+
});
|
|
2102
|
+
|
|
2103
|
+
// src/pagination/pagination.constant.ts
|
|
2104
|
+
var DefaultPaginatedResponse = {
|
|
2105
|
+
results: [],
|
|
2106
|
+
total: 0,
|
|
2107
|
+
page: 1,
|
|
2108
|
+
limit: 10
|
|
2109
|
+
};
|
|
2110
|
+
var DefaultPaginationOptions = {
|
|
2111
|
+
page: 1,
|
|
2112
|
+
limit: 10
|
|
2113
|
+
};
|
|
2114
|
+
|
|
2115
|
+
// src/report/report.schema.ts
|
|
2116
|
+
import { mixed as mixed4, object as object20, string as string17 } from "yup";
|
|
2117
|
+
|
|
2118
|
+
// src/report/report.constant.ts
|
|
2119
|
+
var ResourceType = /* @__PURE__ */ ((ResourceType3) => {
|
|
2120
|
+
ResourceType3["Job"] = "job";
|
|
2121
|
+
ResourceType3["User"] = "user";
|
|
2122
|
+
ResourceType3["Resume"] = "resume";
|
|
2123
|
+
ResourceType3["Company"] = "company";
|
|
2124
|
+
return ResourceType3;
|
|
2125
|
+
})(ResourceType || {});
|
|
2126
|
+
var SupportedResourceTypes = Object.values(ResourceType);
|
|
2127
|
+
var ReportReason = /* @__PURE__ */ ((ReportReason3) => {
|
|
2128
|
+
ReportReason3["OffensiveOrHarassing"] = "offensive_or_harassing";
|
|
2129
|
+
ReportReason3["JobExpired"] = "job_expired";
|
|
2130
|
+
ReportReason3["AskingMoney"] = "asking_money";
|
|
2131
|
+
ReportReason3["FakeJob"] = "fake_job";
|
|
2132
|
+
ReportReason3["IncorrectJobDetails"] = "incorrect_job_details";
|
|
2133
|
+
ReportReason3["SellingSomething"] = "selling_something";
|
|
2134
|
+
ReportReason3["Other"] = "other";
|
|
2135
|
+
return ReportReason3;
|
|
2136
|
+
})(ReportReason || {});
|
|
2137
|
+
var SupportedReportReasons = Object.values(ReportReason);
|
|
2138
|
+
|
|
2139
|
+
// src/report/report.schema.ts
|
|
2140
|
+
var ReportSchema = object20({
|
|
2141
|
+
type: mixed4().oneOf(SupportedResourceTypes).required().label("Type"),
|
|
2142
|
+
resourceId: string17().required().label("Resource ID"),
|
|
2143
|
+
reason: mixed4().oneOf(SupportedReportReasons).required("Please choose a reason").label("Reason"),
|
|
2144
|
+
comment: string17().max(1e3).optional().label("Comment")
|
|
2145
|
+
}).label("Report Schema");
|
|
2146
|
+
|
|
2147
|
+
// src/user/user.schema.ts
|
|
2148
|
+
import { array as array14, number as number10, object as object32, string as string30 } from "yup";
|
|
2039
2149
|
|
|
2040
2150
|
// src/user/work-experience.schema.ts
|
|
2041
|
-
import { boolean as
|
|
2042
|
-
var WorkExperienceSchema =
|
|
2151
|
+
import { boolean as boolean12, object as object21, string as string18 } from "yup";
|
|
2152
|
+
var WorkExperienceSchema = object21().shape({
|
|
2043
2153
|
company: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company"),
|
|
2044
|
-
designation:
|
|
2154
|
+
designation: string18().trim().required().label("Designation"),
|
|
2045
2155
|
duration: DurationSchema({
|
|
2046
2156
|
format: "YYYY-MM",
|
|
2047
2157
|
startLabel: "Start Date",
|
|
2048
2158
|
endLabel: "End Date"
|
|
2049
2159
|
}).required().label("Duration"),
|
|
2050
|
-
description:
|
|
2160
|
+
description: string18().trim().max(3e3).optional().label("Description"),
|
|
2051
2161
|
location: LocationSchema.required().label("Location"),
|
|
2052
|
-
isRemote:
|
|
2162
|
+
isRemote: boolean12().oneOf([true, false]).default(false).label("Is Remote")
|
|
2053
2163
|
}).noUnknown().strict().label("Work Experience");
|
|
2054
2164
|
|
|
2055
2165
|
// src/user/education.schema.ts
|
|
2056
|
-
import { boolean as
|
|
2057
|
-
var EducationSchema =
|
|
2166
|
+
import { boolean as boolean13, object as object22, string as string19 } from "yup";
|
|
2167
|
+
var EducationSchema = object22({
|
|
2058
2168
|
institute: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Institute"),
|
|
2059
|
-
course:
|
|
2060
|
-
fieldOfStudy:
|
|
2169
|
+
course: string19().trim().required().label("Course"),
|
|
2170
|
+
fieldOfStudy: string19().trim().required().label("Field of Study"),
|
|
2061
2171
|
duration: DurationSchema({
|
|
2062
2172
|
format: "YYYY-MM",
|
|
2063
2173
|
startLabel: "Start Date",
|
|
2064
2174
|
endLabel: "End Date"
|
|
2065
2175
|
}).required().label("Duration"),
|
|
2066
|
-
description:
|
|
2067
|
-
isDistanceLearning:
|
|
2176
|
+
description: string19().trim().max(3e3).optional().label("Description"),
|
|
2177
|
+
isDistanceLearning: boolean13().default(false).label("Is Distance Learning"),
|
|
2068
2178
|
location: LocationSchema.required().label("Location"),
|
|
2069
|
-
studyType:
|
|
2179
|
+
studyType: string19().oneOf(SupportedStudyTypes).trim().max(50).required().label("Study Type")
|
|
2070
2180
|
}).noUnknown().strict().label("Education");
|
|
2071
2181
|
|
|
2072
2182
|
// src/user/user-skill.schema.ts
|
|
2073
|
-
import { object as
|
|
2074
|
-
var UserSkillSchema =
|
|
2075
|
-
name:
|
|
2076
|
-
proficiencyLevel:
|
|
2183
|
+
import { object as object23, string as string20 } from "yup";
|
|
2184
|
+
var UserSkillSchema = object23({
|
|
2185
|
+
name: string20().required().label("Name"),
|
|
2186
|
+
proficiencyLevel: string20().oneOf(SupportedProficiencyLevels).required().label("Proficiency Level"),
|
|
2077
2187
|
lastUsed: dateString().format("YYYY-MM").nullable().optional().label("Last Used")
|
|
2078
2188
|
}).noUnknown().strict().label("Skill");
|
|
2079
2189
|
|
|
2080
2190
|
// src/user/project.schema.ts
|
|
2081
|
-
import { object as
|
|
2082
|
-
var UserProjectSchema =
|
|
2083
|
-
name:
|
|
2084
|
-
url:
|
|
2085
|
-
description:
|
|
2191
|
+
import { object as object24, string as string21 } from "yup";
|
|
2192
|
+
var UserProjectSchema = object24({
|
|
2193
|
+
name: string21().trim().max(50).required().label("Name"),
|
|
2194
|
+
url: string21().optional().label("URL"),
|
|
2195
|
+
description: string21().trim().min(100).max(3e3).required().label("Description"),
|
|
2086
2196
|
duration: DurationSchema({
|
|
2087
2197
|
format: "YYYY-MM",
|
|
2088
2198
|
startLabel: "Start Date",
|
|
@@ -2091,83 +2201,83 @@ var UserProjectSchema = object23({
|
|
|
2091
2201
|
}).noUnknown().strict().label("Project");
|
|
2092
2202
|
|
|
2093
2203
|
// src/user/user-certification.schema.ts
|
|
2094
|
-
import { object as
|
|
2095
|
-
var UserCertificationSchema =
|
|
2096
|
-
name:
|
|
2204
|
+
import { object as object25, string as string22 } from "yup";
|
|
2205
|
+
var UserCertificationSchema = object25({
|
|
2206
|
+
name: string22().trim().max(100).required().label("Name"),
|
|
2097
2207
|
// TODO: Add validation for authority
|
|
2098
|
-
authority:
|
|
2099
|
-
licenseNumber:
|
|
2208
|
+
authority: string22().trim().max(100).required().label("Authority"),
|
|
2209
|
+
licenseNumber: string22().trim().max(50).optional().label("License Number"),
|
|
2100
2210
|
duration: DurationSchema({
|
|
2101
2211
|
format: "YYYY-MM",
|
|
2102
2212
|
startLabel: "Start Date",
|
|
2103
2213
|
endLabel: "End Date"
|
|
2104
2214
|
}).optional().nullable().label("Duration"),
|
|
2105
|
-
url:
|
|
2215
|
+
url: string22().optional().label("URL")
|
|
2106
2216
|
}).noUnknown().strict().label("Certification");
|
|
2107
2217
|
|
|
2108
2218
|
// src/user/user-interest.schema.ts
|
|
2109
|
-
import { string as
|
|
2110
|
-
var UserInterestSchema =
|
|
2219
|
+
import { string as string23 } from "yup";
|
|
2220
|
+
var UserInterestSchema = string23().trim().required().label("Interest");
|
|
2111
2221
|
|
|
2112
2222
|
// src/user/user-language.schema.ts
|
|
2113
|
-
import { object as
|
|
2114
|
-
var UserLanguageSchema =
|
|
2115
|
-
name:
|
|
2116
|
-
proficiencyLevel:
|
|
2223
|
+
import { object as object26, string as string24 } from "yup";
|
|
2224
|
+
var UserLanguageSchema = object26({
|
|
2225
|
+
name: string24().trim().required().label("Name"),
|
|
2226
|
+
proficiencyLevel: string24().oneOf(SupportedProficiencyLevels).trim().max(50).required().label("Proficiency Level")
|
|
2117
2227
|
}).noUnknown().strict().label("Language");
|
|
2118
2228
|
|
|
2119
2229
|
// src/user/user-additional-info.schema.ts
|
|
2120
|
-
import { object as
|
|
2121
|
-
var UserAdditionalInfoSchema =
|
|
2122
|
-
title:
|
|
2123
|
-
description:
|
|
2230
|
+
import { object as object27, string as string25 } from "yup";
|
|
2231
|
+
var UserAdditionalInfoSchema = object27({
|
|
2232
|
+
title: string25().trim().max(60).required().label("Title"),
|
|
2233
|
+
description: string25().trim().max(1e3).required().label("Description")
|
|
2124
2234
|
}).noUnknown().strict().label("User Additional Info");
|
|
2125
2235
|
|
|
2126
2236
|
// src/user/general-detail.schema.ts
|
|
2127
|
-
import { object as
|
|
2128
|
-
var UserGeneralDetailSchema =
|
|
2129
|
-
id:
|
|
2130
|
-
name:
|
|
2131
|
-
first:
|
|
2132
|
-
last:
|
|
2237
|
+
import { object as object28, string as string26 } from "yup";
|
|
2238
|
+
var UserGeneralDetailSchema = object28({
|
|
2239
|
+
id: string26().optional().label("ID"),
|
|
2240
|
+
name: object28().shape({
|
|
2241
|
+
first: string26().trim().max(50).required().label("First Name"),
|
|
2242
|
+
last: string26().trim().max(50).optional().label("Last Name")
|
|
2133
2243
|
}).required().label("Name"),
|
|
2134
|
-
headline:
|
|
2135
|
-
image:
|
|
2136
|
-
aboutMe:
|
|
2137
|
-
email:
|
|
2138
|
-
mobile:
|
|
2139
|
-
emailVerified:
|
|
2140
|
-
mobileVerified:
|
|
2141
|
-
experienceLevel:
|
|
2244
|
+
headline: string26().trim().max(200).optional().label("Headline"),
|
|
2245
|
+
image: string26().optional().label("Image"),
|
|
2246
|
+
aboutMe: string26().trim().max(3e3).optional().label("About Me"),
|
|
2247
|
+
email: string26().required().label("Email"),
|
|
2248
|
+
mobile: string26().nullable().optional().label("Mobile"),
|
|
2249
|
+
emailVerified: string26().nullable().optional().label("Email Verified"),
|
|
2250
|
+
mobileVerified: string26().nullable().optional().label("Mobile Verified"),
|
|
2251
|
+
experienceLevel: string26().oneOf(SupportedExperienceLevels).required().label("Experience level"),
|
|
2142
2252
|
location: LocationSchema.required().label("Location"),
|
|
2143
|
-
region:
|
|
2144
|
-
country:
|
|
2145
|
-
lang:
|
|
2253
|
+
region: object28().shape({
|
|
2254
|
+
country: string26().trim().required().label("Region Country"),
|
|
2255
|
+
lang: string26().trim().required().label("Region Language")
|
|
2146
2256
|
}).optional().default(void 0).label("Region"),
|
|
2147
|
-
profileVisibility:
|
|
2257
|
+
profileVisibility: string26().oneOf(SupportedUserProfileVisibilities).default("public" /* Public */).label("Profile Visibility")
|
|
2148
2258
|
}).noUnknown().strict().label("General Detail");
|
|
2149
2259
|
|
|
2150
2260
|
// src/user/user-job-preferences.schema.ts
|
|
2151
|
-
import { array as
|
|
2152
|
-
var UserJobPreferencesSchema =
|
|
2261
|
+
import { array as array11, boolean as boolean14, date as date2, number as number9, object as object29, string as string27 } from "yup";
|
|
2262
|
+
var UserJobPreferencesSchema = object29({
|
|
2153
2263
|
/**
|
|
2154
2264
|
* Whether the job seeker is openly signalling availability. Surfaces the
|
|
2155
2265
|
* "Open to work" badge on the public profile and boosts visibility in
|
|
2156
2266
|
* recruiter search. Defaults to `false` - users must opt in.
|
|
2157
2267
|
*/
|
|
2158
|
-
openToWork:
|
|
2268
|
+
openToWork: boolean14().default(false).label("Open to Work"),
|
|
2159
2269
|
/**
|
|
2160
2270
|
* How urgently the user is looking for their next job. Drives match scoring
|
|
2161
2271
|
* and can downgrade the visibility of expired or low-relevance postings for
|
|
2162
2272
|
* users in `passively_browsing` mode.
|
|
2163
2273
|
*/
|
|
2164
|
-
jobSearchUrgency:
|
|
2274
|
+
jobSearchUrgency: string27().oneOf(SupportedJobSearchUrgencies).required().label("Job Search Urgency"),
|
|
2165
2275
|
/**
|
|
2166
2276
|
* Locations the user wants to work in. Stores the full `LocationSchema`
|
|
2167
2277
|
* shape (country, city, state, geo, etc.) as returned by the locations
|
|
2168
2278
|
* autocomplete API.
|
|
2169
2279
|
*/
|
|
2170
|
-
jobLocations:
|
|
2280
|
+
jobLocations: array11().of(LocationSchema.required().label("Job Location")).min(1, "Pick at least one preferred location.").required().label("Job Locations"),
|
|
2171
2281
|
/**
|
|
2172
2282
|
* Seniority levels the user wants jobs to be matched against. Multi-select
|
|
2173
2283
|
* (up to 2) for borderline candidates.
|
|
@@ -2178,7 +2288,7 @@ var UserJobPreferencesSchema = object28({
|
|
|
2178
2288
|
* Both reuse the same `ExperienceLevel` taxonomy from `common.constant.ts`
|
|
2179
2289
|
* so search/match logic doesn't have to translate between two vocabularies.
|
|
2180
2290
|
*/
|
|
2181
|
-
targetExperienceLevels:
|
|
2291
|
+
targetExperienceLevels: array11().of(string27().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"),
|
|
2182
2292
|
/**
|
|
2183
2293
|
* Specializations the user is searching for - free-form titles.
|
|
2184
2294
|
*
|
|
@@ -2187,19 +2297,19 @@ var UserJobPreferencesSchema = object28({
|
|
|
2187
2297
|
* surfaces a curated "Popular Roles" picker for discovery, but the user
|
|
2188
2298
|
* can ultimately add any title; matching/normalization happens downstream.
|
|
2189
2299
|
*/
|
|
2190
|
-
jobRoles:
|
|
2300
|
+
jobRoles: array11().of(string27().trim().max(120).required()).min(1, "Pick at least one role.").required().label("Job Roles"),
|
|
2191
2301
|
/**
|
|
2192
2302
|
* Minimum acceptable annual base salary, in `minSalaryCurrency`.
|
|
2193
2303
|
* Stored as an integer in the currency's major unit (e.g. dollars, not cents).
|
|
2194
2304
|
* Defaults to 0 ("any salary") rather than being optional - every job-seeker
|
|
2195
2305
|
* has a floor, even if it's zero.
|
|
2196
2306
|
*/
|
|
2197
|
-
minSalary:
|
|
2198
|
-
minSalaryCurrency:
|
|
2307
|
+
minSalary: number9().integer().min(MIN_SALARY_LOWER_BOUND).max(MIN_SALARY_UPPER_BOUND).default(0).required().label("Minimum Salary"),
|
|
2308
|
+
minSalaryCurrency: string27().oneOf(SupportedSalaryCurrencies).default("USD").required().label("Minimum Salary Currency"),
|
|
2199
2309
|
/**
|
|
2200
2310
|
* Marketing-attribution capture from the final onboarding step.
|
|
2201
2311
|
*/
|
|
2202
|
-
referralSource:
|
|
2312
|
+
referralSource: string27().oneOf(SupportedReferralSources).required().label("Referral Source"),
|
|
2203
2313
|
/**
|
|
2204
2314
|
* Resumes the user has uploaded. Embedded directly on the user document
|
|
2205
2315
|
* (capped at 5) - they're cheap to denormalize, every wizard step that
|
|
@@ -2213,18 +2323,18 @@ var UserJobPreferencesSchema = object28({
|
|
|
2213
2323
|
* AI resume-builder flow - onboarding uploads land here, AI-built resumes
|
|
2214
2324
|
* live in their own collection.
|
|
2215
2325
|
*/
|
|
2216
|
-
resumes:
|
|
2217
|
-
|
|
2326
|
+
resumes: array11().of(
|
|
2327
|
+
object29({
|
|
2218
2328
|
// Stable id assigned on upload - used to address a specific entry
|
|
2219
2329
|
// for delete / set-primary operations without exposing the GCS URL
|
|
2220
2330
|
// as a route key.
|
|
2221
|
-
id:
|
|
2222
|
-
url:
|
|
2223
|
-
filename:
|
|
2224
|
-
sizeBytes:
|
|
2225
|
-
mimeType:
|
|
2331
|
+
id: string27().required().label("ID"),
|
|
2332
|
+
url: string27().required().label("Resume URL"),
|
|
2333
|
+
filename: string27().trim().max(255).optional().label("Filename"),
|
|
2334
|
+
sizeBytes: number9().integer().min(0).optional().label("Size (bytes)"),
|
|
2335
|
+
mimeType: string27().trim().max(120).optional().label("MIME Type"),
|
|
2226
2336
|
uploadedAt: date2().required().label("Uploaded At"),
|
|
2227
|
-
isPrimary:
|
|
2337
|
+
isPrimary: boolean14().default(false).label("Is Primary")
|
|
2228
2338
|
}).noUnknown().strict().label("Resume")
|
|
2229
2339
|
).max(5, "You can keep at most 5 resumes on file.").default([]).label("Resumes"),
|
|
2230
2340
|
/**
|
|
@@ -2251,106 +2361,106 @@ var UserJobPreferencesSchema = object28({
|
|
|
2251
2361
|
* APIs. If `user.<field>` is empty there, the correct behavior is empty,
|
|
2252
2362
|
* because the user has not confirmed it yet.
|
|
2253
2363
|
*/
|
|
2254
|
-
pendingPrefill:
|
|
2255
|
-
headline:
|
|
2256
|
-
aboutMe:
|
|
2257
|
-
mobile:
|
|
2364
|
+
pendingPrefill: object29({
|
|
2365
|
+
headline: string27().trim().optional().label("Pending Headline"),
|
|
2366
|
+
aboutMe: string27().trim().optional().label("Pending About Me"),
|
|
2367
|
+
mobile: string27().trim().optional().label("Pending Mobile"),
|
|
2258
2368
|
location: LocationSchema.optional().default(void 0).label("Pending Location"),
|
|
2259
|
-
experienceLevel:
|
|
2260
|
-
socialAccounts:
|
|
2261
|
-
workExperiences:
|
|
2262
|
-
educations:
|
|
2369
|
+
experienceLevel: string27().oneOf(SupportedExperienceLevels).optional().label("Pending Experience Level"),
|
|
2370
|
+
socialAccounts: array11().of(SocialAccountSchema.required()).optional().label("Pending Social Accounts"),
|
|
2371
|
+
workExperiences: array11().of(WorkExperienceSchema.required()).optional().label("Pending Work Experiences"),
|
|
2372
|
+
educations: array11().of(EducationSchema.required()).optional().label("Pending Educations")
|
|
2263
2373
|
}).nullable().optional().default(void 0).label("Pending Prefill")
|
|
2264
2374
|
}).noUnknown().strict().label("User Job Preferences Schema");
|
|
2265
2375
|
|
|
2266
2376
|
// src/user/user-recruiter-profile.schema.ts
|
|
2267
|
-
import { array as
|
|
2268
|
-
var RecruiterPageLinkSchema =
|
|
2377
|
+
import { array as array12, object as object30, string as string28 } from "yup";
|
|
2378
|
+
var RecruiterPageLinkSchema = object30({
|
|
2269
2379
|
page: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company Page"),
|
|
2270
|
-
jobTitle:
|
|
2380
|
+
jobTitle: string28().trim().max(100).optional().label("Job Title")
|
|
2271
2381
|
}).noUnknown().strict().label("Recruiter Page Link");
|
|
2272
|
-
var UserRecruiterProfileSchema =
|
|
2273
|
-
recruiterProfile:
|
|
2274
|
-
hiringFor:
|
|
2382
|
+
var UserRecruiterProfileSchema = object30({
|
|
2383
|
+
recruiterProfile: object30({
|
|
2384
|
+
hiringFor: array12().of(RecruiterPageLinkSchema).default([]).label("Hiring For")
|
|
2275
2385
|
}).optional().default(void 0).label("Recruiter Profile")
|
|
2276
2386
|
}).noUnknown().strict().label("User Recruiter Profile");
|
|
2277
2387
|
|
|
2278
2388
|
// src/user/user-coordinator-profile.schema.ts
|
|
2279
|
-
import { array as
|
|
2280
|
-
var CoordinatorPageLinkSchema =
|
|
2389
|
+
import { array as array13, object as object31, string as string29 } from "yup";
|
|
2390
|
+
var CoordinatorPageLinkSchema = object31({
|
|
2281
2391
|
page: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Institute Page"),
|
|
2282
|
-
jobTitle:
|
|
2392
|
+
jobTitle: string29().trim().max(100).optional().label("Job Title")
|
|
2283
2393
|
}).noUnknown().strict().label("Coordinator Page Link");
|
|
2284
|
-
var UserCoordinatorProfileSchema =
|
|
2285
|
-
coordinatorProfile:
|
|
2286
|
-
coordinatesAt:
|
|
2394
|
+
var UserCoordinatorProfileSchema = object31({
|
|
2395
|
+
coordinatorProfile: object31({
|
|
2396
|
+
coordinatesAt: array13().of(CoordinatorPageLinkSchema).default([]).label("Coordinates At")
|
|
2287
2397
|
}).optional().default(void 0).label("Coordinator Profile")
|
|
2288
2398
|
}).noUnknown().strict().label("User Coordinator Profile");
|
|
2289
2399
|
|
|
2290
2400
|
// src/user/user.schema.ts
|
|
2291
|
-
var UserSchema =
|
|
2401
|
+
var UserSchema = object32({
|
|
2292
2402
|
/**
|
|
2293
2403
|
* Related auth account id from auth Server (e.g. Better auth https://auth.thejob.dev)
|
|
2294
2404
|
*/
|
|
2295
|
-
authAccountId:
|
|
2405
|
+
authAccountId: string30().required().label("Auth Account ID"),
|
|
2296
2406
|
/**
|
|
2297
2407
|
* Social media information about the user (e.g. LinkedIn, GitHub, etc.)
|
|
2298
2408
|
*/
|
|
2299
|
-
socialAccounts:
|
|
2409
|
+
socialAccounts: array14().of(SocialAccountSchema).default([]).label("Social Accounts"),
|
|
2300
2410
|
/**
|
|
2301
2411
|
* Work experience information about the user
|
|
2302
2412
|
*/
|
|
2303
|
-
workExperiences:
|
|
2413
|
+
workExperiences: array14().of(WorkExperienceSchema).required().default([]).label("Work Experiences"),
|
|
2304
2414
|
/**
|
|
2305
2415
|
* Education information about the user
|
|
2306
2416
|
*/
|
|
2307
|
-
educations:
|
|
2417
|
+
educations: array14().of(EducationSchema).required().default([]).label("Educations"),
|
|
2308
2418
|
/**
|
|
2309
2419
|
* Skills information about the user
|
|
2310
2420
|
*/
|
|
2311
|
-
skills:
|
|
2421
|
+
skills: array14().of(UserSkillSchema).required().default([]).label("Skills"),
|
|
2312
2422
|
/**
|
|
2313
2423
|
* Projects information about the user
|
|
2314
2424
|
*/
|
|
2315
|
-
projects:
|
|
2425
|
+
projects: array14().of(UserProjectSchema).default([]).label("Projects"),
|
|
2316
2426
|
/**
|
|
2317
2427
|
* Certifications information about the user
|
|
2318
2428
|
*/
|
|
2319
|
-
certifications:
|
|
2429
|
+
certifications: array14().of(UserCertificationSchema).default([]).label("Certifications"),
|
|
2320
2430
|
/**
|
|
2321
2431
|
* Interests information about the user.
|
|
2322
2432
|
*/
|
|
2323
|
-
interests:
|
|
2433
|
+
interests: array14().of(UserInterestSchema).optional().default([]).label("Interests"),
|
|
2324
2434
|
/**
|
|
2325
2435
|
* Languages information about the user
|
|
2326
2436
|
*/
|
|
2327
|
-
languages:
|
|
2437
|
+
languages: array14().of(UserLanguageSchema).required().default([]).label("Languages"),
|
|
2328
2438
|
/**
|
|
2329
2439
|
* Additional information about the user
|
|
2330
2440
|
*/
|
|
2331
|
-
additionalInfo:
|
|
2441
|
+
additionalInfo: array14().of(UserAdditionalInfoSchema).default([]).label("Additional Information"),
|
|
2332
2442
|
/**
|
|
2333
2443
|
* Status of the user account
|
|
2334
2444
|
*/
|
|
2335
|
-
status:
|
|
2445
|
+
status: string30().oneOf(SupportedUserStatuses).required().label("Status"),
|
|
2336
2446
|
/**
|
|
2337
2447
|
* Roles assigned to the user
|
|
2338
2448
|
*/
|
|
2339
|
-
roles:
|
|
2449
|
+
roles: array14().of(string30().oneOf(SupportedUserRoles)).required().default(DefaultUserRoles).label("Roles"),
|
|
2340
2450
|
/**
|
|
2341
2451
|
* Vector embedding of the user's profile for semantic/hybrid search.
|
|
2342
2452
|
* Generated from a structured summary of skills, experience, education, etc.
|
|
2343
2453
|
* Only generated for public profiles with sufficient completeness (≥60%).
|
|
2344
2454
|
*/
|
|
2345
|
-
embedding:
|
|
2346
|
-
vector:
|
|
2347
|
-
model:
|
|
2455
|
+
embedding: object32({
|
|
2456
|
+
vector: array14(number10().required()).optional().label("Embedding vector"),
|
|
2457
|
+
model: string30().optional().label("Embedding model")
|
|
2348
2458
|
}).nullable().optional().label("Embedding")
|
|
2349
2459
|
}).concat(UserGeneralDetailSchema).concat(UserJobPreferencesSchema).concat(UserRecruiterProfileSchema).concat(UserCoordinatorProfileSchema).noUnknown().strict().label("User Schema");
|
|
2350
2460
|
|
|
2351
2461
|
// src/user/user-completeness.schema.ts
|
|
2352
|
-
import { object as
|
|
2353
|
-
var UserCompletenessSchema =
|
|
2462
|
+
import { object as object33 } from "yup";
|
|
2463
|
+
var UserCompletenessSchema = object33({
|
|
2354
2464
|
additionalInfo: CompletenessScoreSchema(0).label("Additional Info"),
|
|
2355
2465
|
// Optional
|
|
2356
2466
|
certifications: CompletenessScoreSchema(0).label("Certifications"),
|
|
@@ -2374,6 +2484,8 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
|
|
|
2374
2484
|
export {
|
|
2375
2485
|
AnswerChoiceType,
|
|
2376
2486
|
ApplicationReceivePreference,
|
|
2487
|
+
CampaignSchema,
|
|
2488
|
+
CampaignStatus,
|
|
2377
2489
|
ChoiceQuestionSchema,
|
|
2378
2490
|
Common,
|
|
2379
2491
|
CompensationType,
|
|
@@ -2410,9 +2522,13 @@ export {
|
|
|
2410
2522
|
JobSearchUrgency,
|
|
2411
2523
|
JobStatus,
|
|
2412
2524
|
JobSubCategory,
|
|
2525
|
+
ListFilterSchema,
|
|
2413
2526
|
LocationSchema,
|
|
2414
2527
|
MIN_SALARY_LOWER_BOUND,
|
|
2415
2528
|
MIN_SALARY_UPPER_BOUND,
|
|
2529
|
+
MailingListSchema,
|
|
2530
|
+
PREFILL_MIRRORED_KEYS,
|
|
2531
|
+
PRIVATE_PROFILE_FIELDS,
|
|
2416
2532
|
PageSchema,
|
|
2417
2533
|
PageStatus,
|
|
2418
2534
|
PageType,
|
|
@@ -2437,6 +2553,7 @@ export {
|
|
|
2437
2553
|
StudyType,
|
|
2438
2554
|
SupportedAnswerChoiceTypes,
|
|
2439
2555
|
SupportedApplicationReceivePreferences,
|
|
2556
|
+
SupportedCampaignStatuses,
|
|
2440
2557
|
SupportedCompensationTypes,
|
|
2441
2558
|
SupportedContactTypes,
|
|
2442
2559
|
SupportedEducationLevels,
|