@thejob/schema 2.1.1 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +199 -119
- package/dist/index.d.cts +72 -1
- package/dist/index.d.ts +72 -1
- package/dist/index.js +164 -92
- package/package.json +1 -1
- package/src/feedback/feedback.constant.ts +21 -0
- package/src/feedback/feedback.schema.ts +32 -0
- package/src/index.ts +6 -0
- package/src/user/user.constant.ts +23 -0
- package/src/user/user.schema.ts +27 -0
package/dist/index.cjs
CHANGED
|
@@ -54,6 +54,10 @@ __export(index_exports, {
|
|
|
54
54
|
EmployeeCount: () => EmployeeCount,
|
|
55
55
|
EmploymentType: () => EmploymentType,
|
|
56
56
|
ExperienceLevel: () => ExperienceLevel,
|
|
57
|
+
FEEDBACK_MESSAGE_MAX: () => FEEDBACK_MESSAGE_MAX,
|
|
58
|
+
FeedbackSchema: () => FeedbackSchema,
|
|
59
|
+
FeedbackStatus: () => FeedbackStatus,
|
|
60
|
+
FeedbackType: () => FeedbackType,
|
|
57
61
|
GeneraDetailFields: () => GeneraDetailFields,
|
|
58
62
|
GroupManagedBy: () => GroupManagedBy,
|
|
59
63
|
GroupMembershipSchema: () => GroupMembershipSchema,
|
|
@@ -76,6 +80,7 @@ __export(index_exports, {
|
|
|
76
80
|
MIN_SALARY_LOWER_BOUND: () => MIN_SALARY_LOWER_BOUND,
|
|
77
81
|
MIN_SALARY_UPPER_BOUND: () => MIN_SALARY_UPPER_BOUND,
|
|
78
82
|
MailingListSchema: () => MailingListSchema,
|
|
83
|
+
NotificationChannel: () => NotificationChannel,
|
|
79
84
|
PREFILL_MIRRORED_KEYS: () => PREFILL_MIRRORED_KEYS,
|
|
80
85
|
PRIVATE_PROFILE_FIELDS: () => PRIVATE_PROFILE_FIELDS,
|
|
81
86
|
PageSchema: () => PageSchema,
|
|
@@ -109,12 +114,15 @@ __export(index_exports, {
|
|
|
109
114
|
SupportedEmployeeCounts: () => SupportedEmployeeCounts,
|
|
110
115
|
SupportedEmploymentTypes: () => SupportedEmploymentTypes,
|
|
111
116
|
SupportedExperienceLevels: () => SupportedExperienceLevels,
|
|
117
|
+
SupportedFeedbackStatuses: () => SupportedFeedbackStatuses,
|
|
118
|
+
SupportedFeedbackTypes: () => SupportedFeedbackTypes,
|
|
112
119
|
SupportedJobAlertFrequencies: () => SupportedJobAlertFrequencies,
|
|
113
120
|
SupportedJobCategories: () => SupportedJobCategories,
|
|
114
121
|
SupportedJobIndustries: () => SupportedJobIndustries,
|
|
115
122
|
SupportedJobSearchUrgencies: () => SupportedJobSearchUrgencies,
|
|
116
123
|
SupportedJobStatuses: () => SupportedJobStatuses,
|
|
117
124
|
SupportedJobSubCategories: () => SupportedJobSubCategories,
|
|
125
|
+
SupportedNotificationChannels: () => SupportedNotificationChannels,
|
|
118
126
|
SupportedPageStatuses: () => SupportedPageStatuses,
|
|
119
127
|
SupportedPageTypes: () => SupportedPageTypes,
|
|
120
128
|
SupportedPostStatuses: () => SupportedPostStatuses,
|
|
@@ -2149,6 +2157,14 @@ var JobAlertFrequency = /* @__PURE__ */ ((JobAlertFrequency2) => {
|
|
|
2149
2157
|
return JobAlertFrequency2;
|
|
2150
2158
|
})(JobAlertFrequency || {});
|
|
2151
2159
|
var SupportedJobAlertFrequencies = Object.values(JobAlertFrequency);
|
|
2160
|
+
var NotificationChannel = /* @__PURE__ */ ((NotificationChannel2) => {
|
|
2161
|
+
NotificationChannel2["GroupActivity"] = "groupActivity";
|
|
2162
|
+
NotificationChannel2["JobActivity"] = "jobActivity";
|
|
2163
|
+
NotificationChannel2["ApplicationUpdates"] = "applicationUpdates";
|
|
2164
|
+
NotificationChannel2["ProductUpdates"] = "productUpdates";
|
|
2165
|
+
return NotificationChannel2;
|
|
2166
|
+
})(NotificationChannel || {});
|
|
2167
|
+
var SupportedNotificationChannels = Object.values(NotificationChannel);
|
|
2152
2168
|
var SupportedSalaryCurrencies = ["USD", "EUR", "GBP", "SEK", "INR"];
|
|
2153
2169
|
var MIN_SALARY_LOWER_BOUND = 0;
|
|
2154
2170
|
var MIN_SALARY_UPPER_BOUND = 1e6;
|
|
@@ -2315,55 +2331,87 @@ var ReportSchema = (0, import_yup22.object)({
|
|
|
2315
2331
|
comment: (0, import_yup22.string)().max(1e3).optional().label("Comment")
|
|
2316
2332
|
}).label("Report Schema");
|
|
2317
2333
|
|
|
2334
|
+
// src/feedback/feedback.schema.ts
|
|
2335
|
+
var import_yup23 = require("yup");
|
|
2336
|
+
|
|
2337
|
+
// src/feedback/feedback.constant.ts
|
|
2338
|
+
var FeedbackType = /* @__PURE__ */ ((FeedbackType3) => {
|
|
2339
|
+
FeedbackType3["Bug"] = "bug";
|
|
2340
|
+
FeedbackType3["Feature"] = "feature";
|
|
2341
|
+
FeedbackType3["Suggestion"] = "suggestion";
|
|
2342
|
+
FeedbackType3["Report"] = "report";
|
|
2343
|
+
FeedbackType3["Other"] = "other";
|
|
2344
|
+
return FeedbackType3;
|
|
2345
|
+
})(FeedbackType || {});
|
|
2346
|
+
var SupportedFeedbackTypes = Object.values(FeedbackType);
|
|
2347
|
+
var FeedbackStatus = /* @__PURE__ */ ((FeedbackStatus3) => {
|
|
2348
|
+
FeedbackStatus3["New"] = "new";
|
|
2349
|
+
FeedbackStatus3["InReview"] = "in_review";
|
|
2350
|
+
FeedbackStatus3["Resolved"] = "resolved";
|
|
2351
|
+
FeedbackStatus3["Archived"] = "archived";
|
|
2352
|
+
return FeedbackStatus3;
|
|
2353
|
+
})(FeedbackStatus || {});
|
|
2354
|
+
var SupportedFeedbackStatuses = Object.values(FeedbackStatus);
|
|
2355
|
+
var FEEDBACK_MESSAGE_MAX = 4e3;
|
|
2356
|
+
|
|
2357
|
+
// src/feedback/feedback.schema.ts
|
|
2358
|
+
var FeedbackSchema = (0, import_yup23.object)({
|
|
2359
|
+
type: (0, import_yup23.mixed)().oneOf(SupportedFeedbackTypes).required().label("Type"),
|
|
2360
|
+
message: (0, import_yup23.string)().trim().required("Please enter a message").max(FEEDBACK_MESSAGE_MAX).label("Message"),
|
|
2361
|
+
email: (0, import_yup23.string)().email().optional().label("Email"),
|
|
2362
|
+
pageUrl: (0, import_yup23.string)().optional().label("Page URL"),
|
|
2363
|
+
status: (0, import_yup23.mixed)().oneOf(SupportedFeedbackStatuses).optional().label("Status")
|
|
2364
|
+
}).label("Feedback Schema");
|
|
2365
|
+
|
|
2318
2366
|
// src/user/user.schema.ts
|
|
2319
|
-
var
|
|
2367
|
+
var import_yup36 = require("yup");
|
|
2320
2368
|
|
|
2321
2369
|
// src/user/work-experience.schema.ts
|
|
2322
|
-
var
|
|
2323
|
-
var WorkExperienceSchema = (0,
|
|
2370
|
+
var import_yup24 = require("yup");
|
|
2371
|
+
var WorkExperienceSchema = (0, import_yup24.object)().shape({
|
|
2324
2372
|
company: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company"),
|
|
2325
|
-
designation: (0,
|
|
2373
|
+
designation: (0, import_yup24.string)().trim().required().label("Designation"),
|
|
2326
2374
|
duration: DurationSchema({
|
|
2327
2375
|
format: "YYYY-MM",
|
|
2328
2376
|
startLabel: "Start Date",
|
|
2329
2377
|
endLabel: "End Date"
|
|
2330
2378
|
}).required().label("Duration"),
|
|
2331
|
-
description: (0,
|
|
2379
|
+
description: (0, import_yup24.string)().trim().max(3e3).optional().label("Description"),
|
|
2332
2380
|
location: LocationSchema.required().label("Location"),
|
|
2333
|
-
isRemote: (0,
|
|
2381
|
+
isRemote: (0, import_yup24.boolean)().oneOf([true, false]).default(false).label("Is Remote")
|
|
2334
2382
|
}).noUnknown().strict().label("Work Experience");
|
|
2335
2383
|
|
|
2336
2384
|
// src/user/education.schema.ts
|
|
2337
|
-
var
|
|
2338
|
-
var EducationSchema = (0,
|
|
2385
|
+
var import_yup25 = require("yup");
|
|
2386
|
+
var EducationSchema = (0, import_yup25.object)({
|
|
2339
2387
|
institute: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Institute"),
|
|
2340
|
-
course: (0,
|
|
2341
|
-
fieldOfStudy: (0,
|
|
2388
|
+
course: (0, import_yup25.string)().trim().required().label("Course"),
|
|
2389
|
+
fieldOfStudy: (0, import_yup25.string)().trim().required().label("Field of Study"),
|
|
2342
2390
|
duration: DurationSchema({
|
|
2343
2391
|
format: "YYYY-MM",
|
|
2344
2392
|
startLabel: "Start Date",
|
|
2345
2393
|
endLabel: "End Date"
|
|
2346
2394
|
}).required().label("Duration"),
|
|
2347
|
-
description: (0,
|
|
2348
|
-
isDistanceLearning: (0,
|
|
2395
|
+
description: (0, import_yup25.string)().trim().max(3e3).optional().label("Description"),
|
|
2396
|
+
isDistanceLearning: (0, import_yup25.boolean)().default(false).label("Is Distance Learning"),
|
|
2349
2397
|
location: LocationSchema.required().label("Location"),
|
|
2350
|
-
studyType: (0,
|
|
2398
|
+
studyType: (0, import_yup25.string)().oneOf(SupportedStudyTypes).trim().max(50).required().label("Study Type")
|
|
2351
2399
|
}).noUnknown().strict().label("Education");
|
|
2352
2400
|
|
|
2353
2401
|
// src/user/user-skill.schema.ts
|
|
2354
|
-
var
|
|
2355
|
-
var UserSkillSchema = (0,
|
|
2356
|
-
name: (0,
|
|
2357
|
-
proficiencyLevel: (0,
|
|
2402
|
+
var import_yup26 = require("yup");
|
|
2403
|
+
var UserSkillSchema = (0, import_yup26.object)({
|
|
2404
|
+
name: (0, import_yup26.string)().required().label("Name"),
|
|
2405
|
+
proficiencyLevel: (0, import_yup26.string)().oneOf(SupportedProficiencyLevels).required().label("Proficiency Level"),
|
|
2358
2406
|
lastUsed: dateString().format("YYYY-MM").nullable().optional().label("Last Used")
|
|
2359
2407
|
}).noUnknown().strict().label("Skill");
|
|
2360
2408
|
|
|
2361
2409
|
// src/user/project.schema.ts
|
|
2362
|
-
var
|
|
2363
|
-
var UserProjectSchema = (0,
|
|
2364
|
-
name: (0,
|
|
2365
|
-
url: (0,
|
|
2366
|
-
description: (0,
|
|
2410
|
+
var import_yup27 = require("yup");
|
|
2411
|
+
var UserProjectSchema = (0, import_yup27.object)({
|
|
2412
|
+
name: (0, import_yup27.string)().trim().max(50).required().label("Name"),
|
|
2413
|
+
url: (0, import_yup27.string)().optional().label("URL"),
|
|
2414
|
+
description: (0, import_yup27.string)().trim().min(100).max(3e3).required().label("Description"),
|
|
2367
2415
|
duration: DurationSchema({
|
|
2368
2416
|
format: "YYYY-MM",
|
|
2369
2417
|
startLabel: "Start Date",
|
|
@@ -2372,83 +2420,83 @@ var UserProjectSchema = (0, import_yup26.object)({
|
|
|
2372
2420
|
}).noUnknown().strict().label("Project");
|
|
2373
2421
|
|
|
2374
2422
|
// src/user/user-certification.schema.ts
|
|
2375
|
-
var
|
|
2376
|
-
var UserCertificationSchema = (0,
|
|
2377
|
-
name: (0,
|
|
2423
|
+
var import_yup28 = require("yup");
|
|
2424
|
+
var UserCertificationSchema = (0, import_yup28.object)({
|
|
2425
|
+
name: (0, import_yup28.string)().trim().max(100).required().label("Name"),
|
|
2378
2426
|
// TODO: Add validation for authority
|
|
2379
|
-
authority: (0,
|
|
2380
|
-
licenseNumber: (0,
|
|
2427
|
+
authority: (0, import_yup28.string)().trim().max(100).required().label("Authority"),
|
|
2428
|
+
licenseNumber: (0, import_yup28.string)().trim().max(50).optional().label("License Number"),
|
|
2381
2429
|
duration: DurationSchema({
|
|
2382
2430
|
format: "YYYY-MM",
|
|
2383
2431
|
startLabel: "Start Date",
|
|
2384
2432
|
endLabel: "End Date"
|
|
2385
2433
|
}).optional().nullable().label("Duration"),
|
|
2386
|
-
url: (0,
|
|
2434
|
+
url: (0, import_yup28.string)().optional().label("URL")
|
|
2387
2435
|
}).noUnknown().strict().label("Certification");
|
|
2388
2436
|
|
|
2389
2437
|
// src/user/user-interest.schema.ts
|
|
2390
|
-
var
|
|
2391
|
-
var UserInterestSchema = (0,
|
|
2438
|
+
var import_yup29 = require("yup");
|
|
2439
|
+
var UserInterestSchema = (0, import_yup29.string)().trim().required().label("Interest");
|
|
2392
2440
|
|
|
2393
2441
|
// src/user/user-language.schema.ts
|
|
2394
|
-
var
|
|
2395
|
-
var UserLanguageSchema = (0,
|
|
2396
|
-
name: (0,
|
|
2397
|
-
proficiencyLevel: (0,
|
|
2442
|
+
var import_yup30 = require("yup");
|
|
2443
|
+
var UserLanguageSchema = (0, import_yup30.object)({
|
|
2444
|
+
name: (0, import_yup30.string)().trim().required().label("Name"),
|
|
2445
|
+
proficiencyLevel: (0, import_yup30.string)().oneOf(SupportedProficiencyLevels).trim().max(50).required().label("Proficiency Level")
|
|
2398
2446
|
}).noUnknown().strict().label("Language");
|
|
2399
2447
|
|
|
2400
2448
|
// src/user/user-additional-info.schema.ts
|
|
2401
|
-
var
|
|
2402
|
-
var UserAdditionalInfoSchema = (0,
|
|
2403
|
-
title: (0,
|
|
2404
|
-
description: (0,
|
|
2449
|
+
var import_yup31 = require("yup");
|
|
2450
|
+
var UserAdditionalInfoSchema = (0, import_yup31.object)({
|
|
2451
|
+
title: (0, import_yup31.string)().trim().max(60).required().label("Title"),
|
|
2452
|
+
description: (0, import_yup31.string)().trim().max(1e3).required().label("Description")
|
|
2405
2453
|
}).noUnknown().strict().label("User Additional Info");
|
|
2406
2454
|
|
|
2407
2455
|
// src/user/general-detail.schema.ts
|
|
2408
|
-
var
|
|
2409
|
-
var UserGeneralDetailSchema = (0,
|
|
2410
|
-
id: (0,
|
|
2411
|
-
name: (0,
|
|
2412
|
-
first: (0,
|
|
2413
|
-
last: (0,
|
|
2456
|
+
var import_yup32 = require("yup");
|
|
2457
|
+
var UserGeneralDetailSchema = (0, import_yup32.object)({
|
|
2458
|
+
id: (0, import_yup32.string)().optional().label("ID"),
|
|
2459
|
+
name: (0, import_yup32.object)().shape({
|
|
2460
|
+
first: (0, import_yup32.string)().trim().max(50).required().label("First Name"),
|
|
2461
|
+
last: (0, import_yup32.string)().trim().max(50).optional().label("Last Name")
|
|
2414
2462
|
}).required().label("Name"),
|
|
2415
|
-
headline: (0,
|
|
2416
|
-
image: (0,
|
|
2417
|
-
aboutMe: (0,
|
|
2418
|
-
email: (0,
|
|
2419
|
-
mobile: (0,
|
|
2420
|
-
emailVerified: (0,
|
|
2421
|
-
mobileVerified: (0,
|
|
2422
|
-
experienceLevel: (0,
|
|
2463
|
+
headline: (0, import_yup32.string)().trim().max(200).optional().label("Headline"),
|
|
2464
|
+
image: (0, import_yup32.string)().optional().label("Image"),
|
|
2465
|
+
aboutMe: (0, import_yup32.string)().trim().max(3e3).optional().label("About Me"),
|
|
2466
|
+
email: (0, import_yup32.string)().required().label("Email"),
|
|
2467
|
+
mobile: (0, import_yup32.string)().nullable().optional().label("Mobile"),
|
|
2468
|
+
emailVerified: (0, import_yup32.string)().nullable().optional().label("Email Verified"),
|
|
2469
|
+
mobileVerified: (0, import_yup32.string)().nullable().optional().label("Mobile Verified"),
|
|
2470
|
+
experienceLevel: (0, import_yup32.string)().oneOf(SupportedExperienceLevels).required().label("Experience level"),
|
|
2423
2471
|
location: LocationSchema.required().label("Location"),
|
|
2424
|
-
region: (0,
|
|
2425
|
-
country: (0,
|
|
2426
|
-
lang: (0,
|
|
2472
|
+
region: (0, import_yup32.object)().shape({
|
|
2473
|
+
country: (0, import_yup32.string)().trim().required().label("Region Country"),
|
|
2474
|
+
lang: (0, import_yup32.string)().trim().required().label("Region Language")
|
|
2427
2475
|
}).optional().default(void 0).label("Region"),
|
|
2428
|
-
profileVisibility: (0,
|
|
2476
|
+
profileVisibility: (0, import_yup32.string)().oneOf(SupportedUserProfileVisibilities).default("public" /* Public */).label("Profile Visibility")
|
|
2429
2477
|
}).noUnknown().strict().label("General Detail");
|
|
2430
2478
|
|
|
2431
2479
|
// src/user/user-job-preferences.schema.ts
|
|
2432
|
-
var
|
|
2433
|
-
var UserJobPreferencesSchema = (0,
|
|
2480
|
+
var import_yup33 = require("yup");
|
|
2481
|
+
var UserJobPreferencesSchema = (0, import_yup33.object)({
|
|
2434
2482
|
/**
|
|
2435
2483
|
* Whether the job seeker is openly signalling availability. Surfaces the
|
|
2436
2484
|
* "Open to work" badge on the public profile and boosts visibility in
|
|
2437
2485
|
* recruiter search. Defaults to `false` - users must opt in.
|
|
2438
2486
|
*/
|
|
2439
|
-
openToWork: (0,
|
|
2487
|
+
openToWork: (0, import_yup33.boolean)().default(false).label("Open to Work"),
|
|
2440
2488
|
/**
|
|
2441
2489
|
* How urgently the user is looking for their next job. Drives match scoring
|
|
2442
2490
|
* and can downgrade the visibility of expired or low-relevance postings for
|
|
2443
2491
|
* users in `passively_browsing` mode.
|
|
2444
2492
|
*/
|
|
2445
|
-
jobSearchUrgency: (0,
|
|
2493
|
+
jobSearchUrgency: (0, import_yup33.string)().oneOf(SupportedJobSearchUrgencies).required().label("Job Search Urgency"),
|
|
2446
2494
|
/**
|
|
2447
2495
|
* Locations the user wants to work in. Stores the full `LocationSchema`
|
|
2448
2496
|
* shape (country, city, state, geo, etc.) as returned by the locations
|
|
2449
2497
|
* autocomplete API.
|
|
2450
2498
|
*/
|
|
2451
|
-
jobLocations: (0,
|
|
2499
|
+
jobLocations: (0, import_yup33.array)().of(LocationSchema.required().label("Job Location")).min(1, "Pick at least one preferred location.").required().label("Job Locations"),
|
|
2452
2500
|
/**
|
|
2453
2501
|
* Seniority levels the user wants jobs to be matched against. Multi-select
|
|
2454
2502
|
* (up to 2) for borderline candidates.
|
|
@@ -2459,7 +2507,7 @@ var UserJobPreferencesSchema = (0, import_yup32.object)({
|
|
|
2459
2507
|
* Both reuse the same `ExperienceLevel` taxonomy from `common.constant.ts`
|
|
2460
2508
|
* so search/match logic doesn't have to translate between two vocabularies.
|
|
2461
2509
|
*/
|
|
2462
|
-
targetExperienceLevels: (0,
|
|
2510
|
+
targetExperienceLevels: (0, import_yup33.array)().of((0, import_yup33.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"),
|
|
2463
2511
|
/**
|
|
2464
2512
|
* Specializations the user is searching for - free-form titles.
|
|
2465
2513
|
*
|
|
@@ -2468,19 +2516,19 @@ var UserJobPreferencesSchema = (0, import_yup32.object)({
|
|
|
2468
2516
|
* surfaces a curated "Popular Roles" picker for discovery, but the user
|
|
2469
2517
|
* can ultimately add any title; matching/normalization happens downstream.
|
|
2470
2518
|
*/
|
|
2471
|
-
jobRoles: (0,
|
|
2519
|
+
jobRoles: (0, import_yup33.array)().of((0, import_yup33.string)().trim().max(120).required()).min(1, "Pick at least one role.").required().label("Job Roles"),
|
|
2472
2520
|
/**
|
|
2473
2521
|
* Minimum acceptable annual base salary, in `minSalaryCurrency`.
|
|
2474
2522
|
* Stored as an integer in the currency's major unit (e.g. dollars, not cents).
|
|
2475
2523
|
* Defaults to 0 ("any salary") rather than being optional - every job-seeker
|
|
2476
2524
|
* has a floor, even if it's zero.
|
|
2477
2525
|
*/
|
|
2478
|
-
minSalary: (0,
|
|
2479
|
-
minSalaryCurrency: (0,
|
|
2526
|
+
minSalary: (0, import_yup33.number)().integer().min(MIN_SALARY_LOWER_BOUND).max(MIN_SALARY_UPPER_BOUND).default(0).required().label("Minimum Salary"),
|
|
2527
|
+
minSalaryCurrency: (0, import_yup33.string)().oneOf(SupportedSalaryCurrencies).default("USD").required().label("Minimum Salary Currency"),
|
|
2480
2528
|
/**
|
|
2481
2529
|
* Marketing-attribution capture from the final onboarding step.
|
|
2482
2530
|
*/
|
|
2483
|
-
referralSource: (0,
|
|
2531
|
+
referralSource: (0, import_yup33.string)().oneOf(SupportedReferralSources).required().label("Referral Source"),
|
|
2484
2532
|
/**
|
|
2485
2533
|
* Resumes the user has uploaded. Embedded directly on the user document
|
|
2486
2534
|
* (capped at 5) - they're cheap to denormalize, every wizard step that
|
|
@@ -2494,25 +2542,25 @@ var UserJobPreferencesSchema = (0, import_yup32.object)({
|
|
|
2494
2542
|
* AI resume-builder flow - onboarding uploads land here, AI-built resumes
|
|
2495
2543
|
* live in their own collection.
|
|
2496
2544
|
*/
|
|
2497
|
-
resumes: (0,
|
|
2498
|
-
(0,
|
|
2545
|
+
resumes: (0, import_yup33.array)().of(
|
|
2546
|
+
(0, import_yup33.object)({
|
|
2499
2547
|
// Stable id assigned on upload - used to address a specific entry
|
|
2500
2548
|
// for delete / set-primary operations without exposing the GCS URL
|
|
2501
2549
|
// as a route key.
|
|
2502
|
-
id: (0,
|
|
2503
|
-
url: (0,
|
|
2504
|
-
filename: (0,
|
|
2505
|
-
sizeBytes: (0,
|
|
2506
|
-
mimeType: (0,
|
|
2507
|
-
uploadedAt: (0,
|
|
2508
|
-
isPrimary: (0,
|
|
2550
|
+
id: (0, import_yup33.string)().required().label("ID"),
|
|
2551
|
+
url: (0, import_yup33.string)().required().label("Resume URL"),
|
|
2552
|
+
filename: (0, import_yup33.string)().trim().max(255).optional().label("Filename"),
|
|
2553
|
+
sizeBytes: (0, import_yup33.number)().integer().min(0).optional().label("Size (bytes)"),
|
|
2554
|
+
mimeType: (0, import_yup33.string)().trim().max(120).optional().label("MIME Type"),
|
|
2555
|
+
uploadedAt: (0, import_yup33.date)().required().label("Uploaded At"),
|
|
2556
|
+
isPrimary: (0, import_yup33.boolean)().default(false).label("Is Primary")
|
|
2509
2557
|
}).noUnknown().strict().label("Resume")
|
|
2510
2558
|
).max(5, "You can keep at most 5 resumes on file.").default([]).label("Resumes"),
|
|
2511
2559
|
/**
|
|
2512
2560
|
* Set when the user finishes the wizard's last step. Acts as the gate the
|
|
2513
2561
|
* onboarding hook checks to redirect users who haven't completed setup.
|
|
2514
2562
|
*/
|
|
2515
|
-
onboardingCompletedAt: (0,
|
|
2563
|
+
onboardingCompletedAt: (0, import_yup33.date)().nullable().optional().label("Onboarding Completed At"),
|
|
2516
2564
|
/**
|
|
2517
2565
|
* Parser-suggested values for wizard fields, written by the resume-upload
|
|
2518
2566
|
* flow. Every parser-derived field lands here - including profile-shaped
|
|
@@ -2532,92 +2580,92 @@ var UserJobPreferencesSchema = (0, import_yup32.object)({
|
|
|
2532
2580
|
* APIs. If `user.<field>` is empty there, the correct behavior is empty,
|
|
2533
2581
|
* because the user has not confirmed it yet.
|
|
2534
2582
|
*/
|
|
2535
|
-
pendingPrefill: (0,
|
|
2536
|
-
headline: (0,
|
|
2537
|
-
aboutMe: (0,
|
|
2538
|
-
mobile: (0,
|
|
2583
|
+
pendingPrefill: (0, import_yup33.object)({
|
|
2584
|
+
headline: (0, import_yup33.string)().trim().optional().label("Pending Headline"),
|
|
2585
|
+
aboutMe: (0, import_yup33.string)().trim().optional().label("Pending About Me"),
|
|
2586
|
+
mobile: (0, import_yup33.string)().trim().optional().label("Pending Mobile"),
|
|
2539
2587
|
location: LocationSchema.optional().default(void 0).label("Pending Location"),
|
|
2540
|
-
experienceLevel: (0,
|
|
2541
|
-
socialAccounts: (0,
|
|
2542
|
-
workExperiences: (0,
|
|
2543
|
-
educations: (0,
|
|
2588
|
+
experienceLevel: (0, import_yup33.string)().oneOf(SupportedExperienceLevels).optional().label("Pending Experience Level"),
|
|
2589
|
+
socialAccounts: (0, import_yup33.array)().of(SocialAccountSchema.required()).optional().label("Pending Social Accounts"),
|
|
2590
|
+
workExperiences: (0, import_yup33.array)().of(WorkExperienceSchema.required()).optional().label("Pending Work Experiences"),
|
|
2591
|
+
educations: (0, import_yup33.array)().of(EducationSchema.required()).optional().label("Pending Educations")
|
|
2544
2592
|
}).nullable().optional().default(void 0).label("Pending Prefill")
|
|
2545
2593
|
}).noUnknown().strict().label("User Job Preferences Schema");
|
|
2546
2594
|
|
|
2547
2595
|
// src/user/user-recruiter-profile.schema.ts
|
|
2548
|
-
var
|
|
2549
|
-
var RecruiterPageLinkSchema = (0,
|
|
2596
|
+
var import_yup34 = require("yup");
|
|
2597
|
+
var RecruiterPageLinkSchema = (0, import_yup34.object)({
|
|
2550
2598
|
page: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company Page"),
|
|
2551
|
-
jobTitle: (0,
|
|
2599
|
+
jobTitle: (0, import_yup34.string)().trim().max(100).optional().label("Job Title")
|
|
2552
2600
|
}).noUnknown().strict().label("Recruiter Page Link");
|
|
2553
|
-
var UserRecruiterProfileSchema = (0,
|
|
2554
|
-
recruiterProfile: (0,
|
|
2555
|
-
hiringFor: (0,
|
|
2601
|
+
var UserRecruiterProfileSchema = (0, import_yup34.object)({
|
|
2602
|
+
recruiterProfile: (0, import_yup34.object)({
|
|
2603
|
+
hiringFor: (0, import_yup34.array)().of(RecruiterPageLinkSchema).default([]).label("Hiring For")
|
|
2556
2604
|
}).optional().default(void 0).label("Recruiter Profile")
|
|
2557
2605
|
}).noUnknown().strict().label("User Recruiter Profile");
|
|
2558
2606
|
|
|
2559
2607
|
// src/user/user-coordinator-profile.schema.ts
|
|
2560
|
-
var
|
|
2561
|
-
var CoordinatorPageLinkSchema = (0,
|
|
2608
|
+
var import_yup35 = require("yup");
|
|
2609
|
+
var CoordinatorPageLinkSchema = (0, import_yup35.object)({
|
|
2562
2610
|
page: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Institute Page"),
|
|
2563
|
-
jobTitle: (0,
|
|
2611
|
+
jobTitle: (0, import_yup35.string)().trim().max(100).optional().label("Job Title")
|
|
2564
2612
|
}).noUnknown().strict().label("Coordinator Page Link");
|
|
2565
|
-
var UserCoordinatorProfileSchema = (0,
|
|
2566
|
-
coordinatorProfile: (0,
|
|
2567
|
-
coordinatesAt: (0,
|
|
2613
|
+
var UserCoordinatorProfileSchema = (0, import_yup35.object)({
|
|
2614
|
+
coordinatorProfile: (0, import_yup35.object)({
|
|
2615
|
+
coordinatesAt: (0, import_yup35.array)().of(CoordinatorPageLinkSchema).default([]).label("Coordinates At")
|
|
2568
2616
|
}).optional().default(void 0).label("Coordinator Profile")
|
|
2569
2617
|
}).noUnknown().strict().label("User Coordinator Profile");
|
|
2570
2618
|
|
|
2571
2619
|
// src/user/user.schema.ts
|
|
2572
|
-
var UserSchema = (0,
|
|
2620
|
+
var UserSchema = (0, import_yup36.object)({
|
|
2573
2621
|
/**
|
|
2574
2622
|
* Related auth account id from auth Server (e.g. Better auth https://auth.thejob.dev)
|
|
2575
2623
|
*/
|
|
2576
|
-
authAccountId: (0,
|
|
2624
|
+
authAccountId: (0, import_yup36.string)().required().label("Auth Account ID"),
|
|
2577
2625
|
/**
|
|
2578
2626
|
* Social media information about the user (e.g. LinkedIn, GitHub, etc.)
|
|
2579
2627
|
*/
|
|
2580
|
-
socialAccounts: (0,
|
|
2628
|
+
socialAccounts: (0, import_yup36.array)().of(SocialAccountSchema).default([]).label("Social Accounts"),
|
|
2581
2629
|
/**
|
|
2582
2630
|
* Work experience information about the user
|
|
2583
2631
|
*/
|
|
2584
|
-
workExperiences: (0,
|
|
2632
|
+
workExperiences: (0, import_yup36.array)().of(WorkExperienceSchema).required().default([]).label("Work Experiences"),
|
|
2585
2633
|
/**
|
|
2586
2634
|
* Education information about the user
|
|
2587
2635
|
*/
|
|
2588
|
-
educations: (0,
|
|
2636
|
+
educations: (0, import_yup36.array)().of(EducationSchema).required().default([]).label("Educations"),
|
|
2589
2637
|
/**
|
|
2590
2638
|
* Skills information about the user
|
|
2591
2639
|
*/
|
|
2592
|
-
skills: (0,
|
|
2640
|
+
skills: (0, import_yup36.array)().of(UserSkillSchema).required().default([]).label("Skills"),
|
|
2593
2641
|
/**
|
|
2594
2642
|
* Projects information about the user
|
|
2595
2643
|
*/
|
|
2596
|
-
projects: (0,
|
|
2644
|
+
projects: (0, import_yup36.array)().of(UserProjectSchema).default([]).label("Projects"),
|
|
2597
2645
|
/**
|
|
2598
2646
|
* Certifications information about the user
|
|
2599
2647
|
*/
|
|
2600
|
-
certifications: (0,
|
|
2648
|
+
certifications: (0, import_yup36.array)().of(UserCertificationSchema).default([]).label("Certifications"),
|
|
2601
2649
|
/**
|
|
2602
2650
|
* Interests information about the user.
|
|
2603
2651
|
*/
|
|
2604
|
-
interests: (0,
|
|
2652
|
+
interests: (0, import_yup36.array)().of(UserInterestSchema).optional().default([]).label("Interests"),
|
|
2605
2653
|
/**
|
|
2606
2654
|
* Languages information about the user
|
|
2607
2655
|
*/
|
|
2608
|
-
languages: (0,
|
|
2656
|
+
languages: (0, import_yup36.array)().of(UserLanguageSchema).required().default([]).label("Languages"),
|
|
2609
2657
|
/**
|
|
2610
2658
|
* Additional information about the user
|
|
2611
2659
|
*/
|
|
2612
|
-
additionalInfo: (0,
|
|
2660
|
+
additionalInfo: (0, import_yup36.array)().of(UserAdditionalInfoSchema).default([]).label("Additional Information"),
|
|
2613
2661
|
/**
|
|
2614
2662
|
* Status of the user account
|
|
2615
2663
|
*/
|
|
2616
|
-
status: (0,
|
|
2664
|
+
status: (0, import_yup36.string)().oneOf(SupportedUserStatuses).required().label("Status"),
|
|
2617
2665
|
/**
|
|
2618
2666
|
* Roles assigned to the user
|
|
2619
2667
|
*/
|
|
2620
|
-
roles: (0,
|
|
2668
|
+
roles: (0, import_yup36.array)().of((0, import_yup36.string)().oneOf(SupportedUserRoles)).required().default(DefaultUserRoles).label("Roles"),
|
|
2621
2669
|
/**
|
|
2622
2670
|
* Explicit consent to receive marketing email (newsletters, job alerts by
|
|
2623
2671
|
* broadcast, product updates). Marketing sends are HARD-GATED on
|
|
@@ -2629,33 +2677,57 @@ var UserSchema = (0, import_yup35.object)({
|
|
|
2629
2677
|
* unsubscribe sets `subscribed=false` so consent and the email-service
|
|
2630
2678
|
* suppression list stay consistent. Defaults to NOT subscribed (opt-in).
|
|
2631
2679
|
*/
|
|
2632
|
-
marketingConsent: (0,
|
|
2633
|
-
subscribed: (0,
|
|
2680
|
+
marketingConsent: (0, import_yup36.object)({
|
|
2681
|
+
subscribed: (0, import_yup36.boolean)().default(false).label("Subscribed to marketing email"),
|
|
2634
2682
|
/** Epoch ms of the last consent change (opt-in or opt-out). */
|
|
2635
|
-
updatedAt: (0,
|
|
2683
|
+
updatedAt: (0, import_yup36.number)().optional().label("Consent updated at"),
|
|
2636
2684
|
/** Where the consent change originated, e.g. `onboarding`, `unsubscribe`, `settings`. */
|
|
2637
|
-
source: (0,
|
|
2685
|
+
source: (0, import_yup36.string)().optional().label("Consent source"),
|
|
2638
2686
|
/**
|
|
2639
2687
|
* How often the user receives job-alert emails. `off` disables job alerts
|
|
2640
2688
|
* only; other marketing stays governed by `subscribed`. Unset means the
|
|
2641
2689
|
* user has not chosen a cadence yet.
|
|
2642
2690
|
*/
|
|
2643
|
-
jobAlertFrequency: (0,
|
|
2691
|
+
jobAlertFrequency: (0, import_yup36.string)().oneOf(SupportedJobAlertFrequencies).optional().label("Job alert frequency")
|
|
2644
2692
|
}).default({ subscribed: false }).label("Marketing Consent"),
|
|
2693
|
+
/**
|
|
2694
|
+
* Per-channel toggles for NOTIFICATION email — mail about activity on the
|
|
2695
|
+
* user's own account (a group invite, a job of theirs expiring).
|
|
2696
|
+
*
|
|
2697
|
+
* Deliberately separate from `marketingConsent`, which they must NOT be
|
|
2698
|
+
* collapsed into: the two have different legal footing, which the
|
|
2699
|
+
* email-service footer rules already encode. Notifications are opt-OUT
|
|
2700
|
+
* (default `true`) because a user who declined marketing still needs to hear
|
|
2701
|
+
* that their group invite arrived; marketing stays opt-IN. `productUpdates`
|
|
2702
|
+
* is the exception — it is promotional in character, so it defaults off.
|
|
2703
|
+
*
|
|
2704
|
+
* Transactional mail (magic-link, verification) ignores this object entirely.
|
|
2705
|
+
*/
|
|
2706
|
+
notificationPrefs: (0, import_yup36.object)({
|
|
2707
|
+
groupActivity: (0, import_yup36.boolean)().default(true).label("Group activity email"),
|
|
2708
|
+
jobActivity: (0, import_yup36.boolean)().default(true).label("Job activity email"),
|
|
2709
|
+
applicationUpdates: (0, import_yup36.boolean)().default(true).label("Application update email"),
|
|
2710
|
+
productUpdates: (0, import_yup36.boolean)().default(false).label("Product update email")
|
|
2711
|
+
}).default({
|
|
2712
|
+
groupActivity: true,
|
|
2713
|
+
jobActivity: true,
|
|
2714
|
+
applicationUpdates: true,
|
|
2715
|
+
productUpdates: false
|
|
2716
|
+
}).label("Notification Preferences"),
|
|
2645
2717
|
/**
|
|
2646
2718
|
* Vector embedding of the user's profile for semantic/hybrid search.
|
|
2647
2719
|
* Generated from a structured summary of skills, experience, education, etc.
|
|
2648
2720
|
* Only generated for public profiles with sufficient completeness (≥60%).
|
|
2649
2721
|
*/
|
|
2650
|
-
embedding: (0,
|
|
2651
|
-
vector: (0,
|
|
2652
|
-
model: (0,
|
|
2722
|
+
embedding: (0, import_yup36.object)({
|
|
2723
|
+
vector: (0, import_yup36.array)((0, import_yup36.number)().required()).optional().label("Embedding vector"),
|
|
2724
|
+
model: (0, import_yup36.string)().optional().label("Embedding model")
|
|
2653
2725
|
}).nullable().optional().label("Embedding")
|
|
2654
2726
|
}).concat(UserGeneralDetailSchema).concat(UserJobPreferencesSchema).concat(UserRecruiterProfileSchema).concat(UserCoordinatorProfileSchema).noUnknown().strict().label("User Schema");
|
|
2655
2727
|
|
|
2656
2728
|
// src/user/user-completeness.schema.ts
|
|
2657
|
-
var
|
|
2658
|
-
var UserCompletenessSchema = (0,
|
|
2729
|
+
var import_yup37 = require("yup");
|
|
2730
|
+
var UserCompletenessSchema = (0, import_yup37.object)({
|
|
2659
2731
|
additionalInfo: CompletenessScoreSchema(0).label("Additional Info"),
|
|
2660
2732
|
// Optional
|
|
2661
2733
|
certifications: CompletenessScoreSchema(0).label("Certifications"),
|
|
@@ -2702,6 +2774,10 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
|
|
|
2702
2774
|
EmployeeCount,
|
|
2703
2775
|
EmploymentType,
|
|
2704
2776
|
ExperienceLevel,
|
|
2777
|
+
FEEDBACK_MESSAGE_MAX,
|
|
2778
|
+
FeedbackSchema,
|
|
2779
|
+
FeedbackStatus,
|
|
2780
|
+
FeedbackType,
|
|
2705
2781
|
GeneraDetailFields,
|
|
2706
2782
|
GroupManagedBy,
|
|
2707
2783
|
GroupMembershipSchema,
|
|
@@ -2724,6 +2800,7 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
|
|
|
2724
2800
|
MIN_SALARY_LOWER_BOUND,
|
|
2725
2801
|
MIN_SALARY_UPPER_BOUND,
|
|
2726
2802
|
MailingListSchema,
|
|
2803
|
+
NotificationChannel,
|
|
2727
2804
|
PREFILL_MIRRORED_KEYS,
|
|
2728
2805
|
PRIVATE_PROFILE_FIELDS,
|
|
2729
2806
|
PageSchema,
|
|
@@ -2757,12 +2834,15 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
|
|
|
2757
2834
|
SupportedEmployeeCounts,
|
|
2758
2835
|
SupportedEmploymentTypes,
|
|
2759
2836
|
SupportedExperienceLevels,
|
|
2837
|
+
SupportedFeedbackStatuses,
|
|
2838
|
+
SupportedFeedbackTypes,
|
|
2760
2839
|
SupportedJobAlertFrequencies,
|
|
2761
2840
|
SupportedJobCategories,
|
|
2762
2841
|
SupportedJobIndustries,
|
|
2763
2842
|
SupportedJobSearchUrgencies,
|
|
2764
2843
|
SupportedJobStatuses,
|
|
2765
2844
|
SupportedJobSubCategories,
|
|
2845
|
+
SupportedNotificationChannels,
|
|
2766
2846
|
SupportedPageStatuses,
|
|
2767
2847
|
SupportedPageTypes,
|
|
2768
2848
|
SupportedPostStatuses,
|