@thejob/schema 2.1.3 → 2.1.4
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 +5 -5
- package/CLAUDE.md +62 -0
- package/dist/index.cjs +204 -137
- package/dist/index.d.cts +175 -123
- package/dist/index.d.ts +175 -123
- package/dist/index.js +170 -106
- package/package.json +1 -1
- package/src/index.ts +6 -0
- package/src/saved-search/saved-search.constant.ts +17 -0
- package/src/saved-search/saved-search.schema.ts +84 -0
package/dist/index.cjs
CHANGED
|
@@ -100,6 +100,8 @@ __export(index_exports, {
|
|
|
100
100
|
ResourceType: () => ResourceType,
|
|
101
101
|
SITEMAP_FORMAT: () => SITEMAP_FORMAT,
|
|
102
102
|
SYSTEM_DATE_FORMAT: () => SYSTEM_DATE_FORMAT,
|
|
103
|
+
SavedSearchSchema: () => SavedSearchSchema,
|
|
104
|
+
SavedSearchStatus: () => SavedSearchStatus,
|
|
103
105
|
SkillSchema: () => SkillSchema,
|
|
104
106
|
SocialAccount: () => SocialAccount,
|
|
105
107
|
SocialAccountSchema: () => SocialAccountSchema,
|
|
@@ -132,6 +134,7 @@ __export(index_exports, {
|
|
|
132
134
|
SupportedReportReasons: () => SupportedReportReasons,
|
|
133
135
|
SupportedResourceTypes: () => SupportedResourceTypes,
|
|
134
136
|
SupportedSalaryCurrencies: () => SupportedSalaryCurrencies,
|
|
137
|
+
SupportedSavedSearchStatuses: () => SupportedSavedSearchStatuses,
|
|
135
138
|
SupportedSocialAccounts: () => SupportedSocialAccounts,
|
|
136
139
|
SupportedStudyTypes: () => SupportedStudyTypes,
|
|
137
140
|
SupportedUserProfileVisibilities: () => SupportedUserProfileVisibilities,
|
|
@@ -2299,9 +2302,70 @@ var DefaultPaginationOptions = {
|
|
|
2299
2302
|
limit: 10
|
|
2300
2303
|
};
|
|
2301
2304
|
|
|
2302
|
-
// src/
|
|
2305
|
+
// src/saved-search/saved-search.schema.ts
|
|
2303
2306
|
var import_yup22 = require("yup");
|
|
2304
2307
|
|
|
2308
|
+
// src/saved-search/saved-search.constant.ts
|
|
2309
|
+
var SavedSearchStatus = /* @__PURE__ */ ((SavedSearchStatus2) => {
|
|
2310
|
+
SavedSearchStatus2["Active"] = "active";
|
|
2311
|
+
SavedSearchStatus2["Paused"] = "paused";
|
|
2312
|
+
return SavedSearchStatus2;
|
|
2313
|
+
})(SavedSearchStatus || {});
|
|
2314
|
+
var SupportedSavedSearchStatuses = Object.values(SavedSearchStatus);
|
|
2315
|
+
|
|
2316
|
+
// src/saved-search/saved-search.schema.ts
|
|
2317
|
+
var SavedSearchSchema = (0, import_yup22.object)({
|
|
2318
|
+
/** Public identifier. Server-assigned. */
|
|
2319
|
+
shortId: (0, import_yup22.string)().trim().label("Short Id"),
|
|
2320
|
+
/**
|
|
2321
|
+
* Owner's Better Auth account id. Server-assigned from the verified token,
|
|
2322
|
+
* never accepted from a request body.
|
|
2323
|
+
*/
|
|
2324
|
+
ownerUserId: (0, import_yup22.string)().trim().label("Owner"),
|
|
2325
|
+
/** What the user calls this search, e.g. "Remote React roles". */
|
|
2326
|
+
label: (0, import_yup22.string)().trim().max(120).required().label("Label"),
|
|
2327
|
+
/**
|
|
2328
|
+
* The free-text query. Optional because a search can be filters-only ("all
|
|
2329
|
+
* remote jobs in Sweden"), which is a legitimate alert to want.
|
|
2330
|
+
*/
|
|
2331
|
+
search: (0, import_yup22.string)().trim().max(500).optional().label("Search Text"),
|
|
2332
|
+
/**
|
|
2333
|
+
* Field filters, in the same `{ field: values }` shape the search endpoint
|
|
2334
|
+
* parses from `filter[field]=a,b`. Held as a free-form object rather than a
|
|
2335
|
+
* closed schema because the job facets it addresses live in jobs-service and
|
|
2336
|
+
* change independently; validating them here would put this package in the
|
|
2337
|
+
* business of tracking that vocabulary.
|
|
2338
|
+
*/
|
|
2339
|
+
filter: (0, import_yup22.object)().optional().default({}).label("Filters"),
|
|
2340
|
+
/**
|
|
2341
|
+
* How often to mail matches. `off` keeps the search saved but silent, which is
|
|
2342
|
+
* the difference between "I don't want mail" and "delete my search".
|
|
2343
|
+
*
|
|
2344
|
+
* Reuses the cadence enum from `marketingConsent.jobAlertFrequency` rather
|
|
2345
|
+
* than defining a second one: two vocabularies for the same concept is how
|
|
2346
|
+
* they drift.
|
|
2347
|
+
*/
|
|
2348
|
+
frequency: (0, import_yup22.string)().oneOf(SupportedJobAlertFrequencies).default("off" /* Off */).label("Alert Frequency"),
|
|
2349
|
+
status: (0, import_yup22.string)().oneOf(SupportedSavedSearchStatuses).default("active" /* Active */).label("Status"),
|
|
2350
|
+
/**
|
|
2351
|
+
* Epoch ms of the last alert sent for this search. The matching sweep reads it
|
|
2352
|
+
* to decide whether the cadence is due, and writes it only AFTER a successful
|
|
2353
|
+
* publish, so a failed run retries next tick rather than silently skipping a
|
|
2354
|
+
* period.
|
|
2355
|
+
*/
|
|
2356
|
+
lastNotifiedAt: (0, import_yup22.number)().optional().label("Last Notified At"),
|
|
2357
|
+
/**
|
|
2358
|
+
* Epoch ms high-water mark: only jobs created after this are "new" for the
|
|
2359
|
+
* next alert. Kept separate from `lastNotifiedAt` because a run that finds no
|
|
2360
|
+
* matches should still advance what counts as new, without implying mail was
|
|
2361
|
+
* sent.
|
|
2362
|
+
*/
|
|
2363
|
+
lastMatchedAt: (0, import_yup22.number)().optional().label("Last Matched At")
|
|
2364
|
+
}).noUnknown().strict();
|
|
2365
|
+
|
|
2366
|
+
// src/report/report.schema.ts
|
|
2367
|
+
var import_yup23 = require("yup");
|
|
2368
|
+
|
|
2305
2369
|
// src/report/report.constant.ts
|
|
2306
2370
|
var ResourceType = /* @__PURE__ */ ((ResourceType3) => {
|
|
2307
2371
|
ResourceType3["Job"] = "job";
|
|
@@ -2324,15 +2388,15 @@ var ReportReason = /* @__PURE__ */ ((ReportReason3) => {
|
|
|
2324
2388
|
var SupportedReportReasons = Object.values(ReportReason);
|
|
2325
2389
|
|
|
2326
2390
|
// src/report/report.schema.ts
|
|
2327
|
-
var ReportSchema = (0,
|
|
2328
|
-
type: (0,
|
|
2329
|
-
resourceId: (0,
|
|
2330
|
-
reason: (0,
|
|
2331
|
-
comment: (0,
|
|
2391
|
+
var ReportSchema = (0, import_yup23.object)({
|
|
2392
|
+
type: (0, import_yup23.mixed)().oneOf(SupportedResourceTypes).required().label("Type"),
|
|
2393
|
+
resourceId: (0, import_yup23.string)().required().label("Resource ID"),
|
|
2394
|
+
reason: (0, import_yup23.mixed)().oneOf(SupportedReportReasons).required("Please choose a reason").label("Reason"),
|
|
2395
|
+
comment: (0, import_yup23.string)().max(1e3).optional().label("Comment")
|
|
2332
2396
|
}).label("Report Schema");
|
|
2333
2397
|
|
|
2334
2398
|
// src/feedback/feedback.schema.ts
|
|
2335
|
-
var
|
|
2399
|
+
var import_yup24 = require("yup");
|
|
2336
2400
|
|
|
2337
2401
|
// src/feedback/feedback.constant.ts
|
|
2338
2402
|
var FeedbackType = /* @__PURE__ */ ((FeedbackType3) => {
|
|
@@ -2355,63 +2419,63 @@ var SupportedFeedbackStatuses = Object.values(FeedbackStatus);
|
|
|
2355
2419
|
var FEEDBACK_MESSAGE_MAX = 4e3;
|
|
2356
2420
|
|
|
2357
2421
|
// src/feedback/feedback.schema.ts
|
|
2358
|
-
var FeedbackSchema = (0,
|
|
2359
|
-
type: (0,
|
|
2360
|
-
message: (0,
|
|
2361
|
-
email: (0,
|
|
2362
|
-
pageUrl: (0,
|
|
2363
|
-
status: (0,
|
|
2422
|
+
var FeedbackSchema = (0, import_yup24.object)({
|
|
2423
|
+
type: (0, import_yup24.mixed)().oneOf(SupportedFeedbackTypes).required().label("Type"),
|
|
2424
|
+
message: (0, import_yup24.string)().trim().required("Please enter a message").max(FEEDBACK_MESSAGE_MAX).label("Message"),
|
|
2425
|
+
email: (0, import_yup24.string)().email().optional().label("Email"),
|
|
2426
|
+
pageUrl: (0, import_yup24.string)().optional().label("Page URL"),
|
|
2427
|
+
status: (0, import_yup24.mixed)().oneOf(SupportedFeedbackStatuses).optional().label("Status")
|
|
2364
2428
|
}).label("Feedback Schema");
|
|
2365
2429
|
|
|
2366
2430
|
// src/user/user.schema.ts
|
|
2367
|
-
var
|
|
2431
|
+
var import_yup37 = require("yup");
|
|
2368
2432
|
|
|
2369
2433
|
// src/user/work-experience.schema.ts
|
|
2370
|
-
var
|
|
2371
|
-
var WorkExperienceSchema = (0,
|
|
2434
|
+
var import_yup25 = require("yup");
|
|
2435
|
+
var WorkExperienceSchema = (0, import_yup25.object)().shape({
|
|
2372
2436
|
company: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company"),
|
|
2373
|
-
designation: (0,
|
|
2437
|
+
designation: (0, import_yup25.string)().trim().required().label("Designation"),
|
|
2374
2438
|
duration: DurationSchema({
|
|
2375
2439
|
format: "YYYY-MM",
|
|
2376
2440
|
startLabel: "Start Date",
|
|
2377
2441
|
endLabel: "End Date"
|
|
2378
2442
|
}).required().label("Duration"),
|
|
2379
|
-
description: (0,
|
|
2443
|
+
description: (0, import_yup25.string)().trim().max(3e3).optional().label("Description"),
|
|
2380
2444
|
location: LocationSchema.required().label("Location"),
|
|
2381
|
-
isRemote: (0,
|
|
2445
|
+
isRemote: (0, import_yup25.boolean)().oneOf([true, false]).default(false).label("Is Remote")
|
|
2382
2446
|
}).noUnknown().strict().label("Work Experience");
|
|
2383
2447
|
|
|
2384
2448
|
// src/user/education.schema.ts
|
|
2385
|
-
var
|
|
2386
|
-
var EducationSchema = (0,
|
|
2449
|
+
var import_yup26 = require("yup");
|
|
2450
|
+
var EducationSchema = (0, import_yup26.object)({
|
|
2387
2451
|
institute: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Institute"),
|
|
2388
|
-
course: (0,
|
|
2389
|
-
fieldOfStudy: (0,
|
|
2452
|
+
course: (0, import_yup26.string)().trim().required().label("Course"),
|
|
2453
|
+
fieldOfStudy: (0, import_yup26.string)().trim().required().label("Field of Study"),
|
|
2390
2454
|
duration: DurationSchema({
|
|
2391
2455
|
format: "YYYY-MM",
|
|
2392
2456
|
startLabel: "Start Date",
|
|
2393
2457
|
endLabel: "End Date"
|
|
2394
2458
|
}).required().label("Duration"),
|
|
2395
|
-
description: (0,
|
|
2396
|
-
isDistanceLearning: (0,
|
|
2459
|
+
description: (0, import_yup26.string)().trim().max(3e3).optional().label("Description"),
|
|
2460
|
+
isDistanceLearning: (0, import_yup26.boolean)().default(false).label("Is Distance Learning"),
|
|
2397
2461
|
location: LocationSchema.required().label("Location"),
|
|
2398
|
-
studyType: (0,
|
|
2462
|
+
studyType: (0, import_yup26.string)().oneOf(SupportedStudyTypes).trim().max(50).required().label("Study Type")
|
|
2399
2463
|
}).noUnknown().strict().label("Education");
|
|
2400
2464
|
|
|
2401
2465
|
// src/user/user-skill.schema.ts
|
|
2402
|
-
var
|
|
2403
|
-
var UserSkillSchema = (0,
|
|
2404
|
-
name: (0,
|
|
2405
|
-
proficiencyLevel: (0,
|
|
2466
|
+
var import_yup27 = require("yup");
|
|
2467
|
+
var UserSkillSchema = (0, import_yup27.object)({
|
|
2468
|
+
name: (0, import_yup27.string)().required().label("Name"),
|
|
2469
|
+
proficiencyLevel: (0, import_yup27.string)().oneOf(SupportedProficiencyLevels).required().label("Proficiency Level"),
|
|
2406
2470
|
lastUsed: dateString().format("YYYY-MM").nullable().optional().label("Last Used")
|
|
2407
2471
|
}).noUnknown().strict().label("Skill");
|
|
2408
2472
|
|
|
2409
2473
|
// src/user/project.schema.ts
|
|
2410
|
-
var
|
|
2411
|
-
var UserProjectSchema = (0,
|
|
2412
|
-
name: (0,
|
|
2413
|
-
url: (0,
|
|
2414
|
-
description: (0,
|
|
2474
|
+
var import_yup28 = require("yup");
|
|
2475
|
+
var UserProjectSchema = (0, import_yup28.object)({
|
|
2476
|
+
name: (0, import_yup28.string)().trim().max(50).required().label("Name"),
|
|
2477
|
+
url: (0, import_yup28.string)().optional().label("URL"),
|
|
2478
|
+
description: (0, import_yup28.string)().trim().min(100).max(3e3).required().label("Description"),
|
|
2415
2479
|
duration: DurationSchema({
|
|
2416
2480
|
format: "YYYY-MM",
|
|
2417
2481
|
startLabel: "Start Date",
|
|
@@ -2420,83 +2484,83 @@ var UserProjectSchema = (0, import_yup27.object)({
|
|
|
2420
2484
|
}).noUnknown().strict().label("Project");
|
|
2421
2485
|
|
|
2422
2486
|
// src/user/user-certification.schema.ts
|
|
2423
|
-
var
|
|
2424
|
-
var UserCertificationSchema = (0,
|
|
2425
|
-
name: (0,
|
|
2487
|
+
var import_yup29 = require("yup");
|
|
2488
|
+
var UserCertificationSchema = (0, import_yup29.object)({
|
|
2489
|
+
name: (0, import_yup29.string)().trim().max(100).required().label("Name"),
|
|
2426
2490
|
// TODO: Add validation for authority
|
|
2427
|
-
authority: (0,
|
|
2428
|
-
licenseNumber: (0,
|
|
2491
|
+
authority: (0, import_yup29.string)().trim().max(100).required().label("Authority"),
|
|
2492
|
+
licenseNumber: (0, import_yup29.string)().trim().max(50).optional().label("License Number"),
|
|
2429
2493
|
duration: DurationSchema({
|
|
2430
2494
|
format: "YYYY-MM",
|
|
2431
2495
|
startLabel: "Start Date",
|
|
2432
2496
|
endLabel: "End Date"
|
|
2433
2497
|
}).optional().nullable().label("Duration"),
|
|
2434
|
-
url: (0,
|
|
2498
|
+
url: (0, import_yup29.string)().optional().label("URL")
|
|
2435
2499
|
}).noUnknown().strict().label("Certification");
|
|
2436
2500
|
|
|
2437
2501
|
// src/user/user-interest.schema.ts
|
|
2438
|
-
var
|
|
2439
|
-
var UserInterestSchema = (0,
|
|
2502
|
+
var import_yup30 = require("yup");
|
|
2503
|
+
var UserInterestSchema = (0, import_yup30.string)().trim().required().label("Interest");
|
|
2440
2504
|
|
|
2441
2505
|
// src/user/user-language.schema.ts
|
|
2442
|
-
var
|
|
2443
|
-
var UserLanguageSchema = (0,
|
|
2444
|
-
name: (0,
|
|
2445
|
-
proficiencyLevel: (0,
|
|
2506
|
+
var import_yup31 = require("yup");
|
|
2507
|
+
var UserLanguageSchema = (0, import_yup31.object)({
|
|
2508
|
+
name: (0, import_yup31.string)().trim().required().label("Name"),
|
|
2509
|
+
proficiencyLevel: (0, import_yup31.string)().oneOf(SupportedProficiencyLevels).trim().max(50).required().label("Proficiency Level")
|
|
2446
2510
|
}).noUnknown().strict().label("Language");
|
|
2447
2511
|
|
|
2448
2512
|
// src/user/user-additional-info.schema.ts
|
|
2449
|
-
var
|
|
2450
|
-
var UserAdditionalInfoSchema = (0,
|
|
2451
|
-
title: (0,
|
|
2452
|
-
description: (0,
|
|
2513
|
+
var import_yup32 = require("yup");
|
|
2514
|
+
var UserAdditionalInfoSchema = (0, import_yup32.object)({
|
|
2515
|
+
title: (0, import_yup32.string)().trim().max(60).required().label("Title"),
|
|
2516
|
+
description: (0, import_yup32.string)().trim().max(1e3).required().label("Description")
|
|
2453
2517
|
}).noUnknown().strict().label("User Additional Info");
|
|
2454
2518
|
|
|
2455
2519
|
// src/user/general-detail.schema.ts
|
|
2456
|
-
var
|
|
2457
|
-
var UserGeneralDetailSchema = (0,
|
|
2458
|
-
id: (0,
|
|
2459
|
-
name: (0,
|
|
2460
|
-
first: (0,
|
|
2461
|
-
last: (0,
|
|
2520
|
+
var import_yup33 = require("yup");
|
|
2521
|
+
var UserGeneralDetailSchema = (0, import_yup33.object)({
|
|
2522
|
+
id: (0, import_yup33.string)().optional().label("ID"),
|
|
2523
|
+
name: (0, import_yup33.object)().shape({
|
|
2524
|
+
first: (0, import_yup33.string)().trim().max(50).required().label("First Name"),
|
|
2525
|
+
last: (0, import_yup33.string)().trim().max(50).optional().label("Last Name")
|
|
2462
2526
|
}).required().label("Name"),
|
|
2463
|
-
headline: (0,
|
|
2464
|
-
image: (0,
|
|
2465
|
-
aboutMe: (0,
|
|
2466
|
-
email: (0,
|
|
2467
|
-
mobile: (0,
|
|
2468
|
-
emailVerified: (0,
|
|
2469
|
-
mobileVerified: (0,
|
|
2470
|
-
experienceLevel: (0,
|
|
2527
|
+
headline: (0, import_yup33.string)().trim().max(200).optional().label("Headline"),
|
|
2528
|
+
image: (0, import_yup33.string)().optional().label("Image"),
|
|
2529
|
+
aboutMe: (0, import_yup33.string)().trim().max(3e3).optional().label("About Me"),
|
|
2530
|
+
email: (0, import_yup33.string)().required().label("Email"),
|
|
2531
|
+
mobile: (0, import_yup33.string)().nullable().optional().label("Mobile"),
|
|
2532
|
+
emailVerified: (0, import_yup33.string)().nullable().optional().label("Email Verified"),
|
|
2533
|
+
mobileVerified: (0, import_yup33.string)().nullable().optional().label("Mobile Verified"),
|
|
2534
|
+
experienceLevel: (0, import_yup33.string)().oneOf(SupportedExperienceLevels).required().label("Experience level"),
|
|
2471
2535
|
location: LocationSchema.required().label("Location"),
|
|
2472
|
-
region: (0,
|
|
2473
|
-
country: (0,
|
|
2474
|
-
lang: (0,
|
|
2536
|
+
region: (0, import_yup33.object)().shape({
|
|
2537
|
+
country: (0, import_yup33.string)().trim().required().label("Region Country"),
|
|
2538
|
+
lang: (0, import_yup33.string)().trim().required().label("Region Language")
|
|
2475
2539
|
}).optional().default(void 0).label("Region"),
|
|
2476
|
-
profileVisibility: (0,
|
|
2540
|
+
profileVisibility: (0, import_yup33.string)().oneOf(SupportedUserProfileVisibilities).default("public" /* Public */).label("Profile Visibility")
|
|
2477
2541
|
}).noUnknown().strict().label("General Detail");
|
|
2478
2542
|
|
|
2479
2543
|
// src/user/user-job-preferences.schema.ts
|
|
2480
|
-
var
|
|
2481
|
-
var UserJobPreferencesSchema = (0,
|
|
2544
|
+
var import_yup34 = require("yup");
|
|
2545
|
+
var UserJobPreferencesSchema = (0, import_yup34.object)({
|
|
2482
2546
|
/**
|
|
2483
2547
|
* Whether the job seeker is openly signalling availability. Surfaces the
|
|
2484
2548
|
* "Open to work" badge on the public profile and boosts visibility in
|
|
2485
2549
|
* recruiter search. Defaults to `false` - users must opt in.
|
|
2486
2550
|
*/
|
|
2487
|
-
openToWork: (0,
|
|
2551
|
+
openToWork: (0, import_yup34.boolean)().default(false).label("Open to Work"),
|
|
2488
2552
|
/**
|
|
2489
2553
|
* How urgently the user is looking for their next job. Drives match scoring
|
|
2490
2554
|
* and can downgrade the visibility of expired or low-relevance postings for
|
|
2491
2555
|
* users in `passively_browsing` mode.
|
|
2492
2556
|
*/
|
|
2493
|
-
jobSearchUrgency: (0,
|
|
2557
|
+
jobSearchUrgency: (0, import_yup34.string)().oneOf(SupportedJobSearchUrgencies).required().label("Job Search Urgency"),
|
|
2494
2558
|
/**
|
|
2495
2559
|
* Locations the user wants to work in. Stores the full `LocationSchema`
|
|
2496
2560
|
* shape (country, city, state, geo, etc.) as returned by the locations
|
|
2497
2561
|
* autocomplete API.
|
|
2498
2562
|
*/
|
|
2499
|
-
jobLocations: (0,
|
|
2563
|
+
jobLocations: (0, import_yup34.array)().of(LocationSchema.required().label("Job Location")).min(1, "Pick at least one preferred location.").required().label("Job Locations"),
|
|
2500
2564
|
/**
|
|
2501
2565
|
* Seniority levels the user wants jobs to be matched against. Multi-select
|
|
2502
2566
|
* (up to 2) for borderline candidates.
|
|
@@ -2507,7 +2571,7 @@ var UserJobPreferencesSchema = (0, import_yup33.object)({
|
|
|
2507
2571
|
* Both reuse the same `ExperienceLevel` taxonomy from `common.constant.ts`
|
|
2508
2572
|
* so search/match logic doesn't have to translate between two vocabularies.
|
|
2509
2573
|
*/
|
|
2510
|
-
targetExperienceLevels: (0,
|
|
2574
|
+
targetExperienceLevels: (0, import_yup34.array)().of((0, import_yup34.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"),
|
|
2511
2575
|
/**
|
|
2512
2576
|
* Specializations the user is searching for - free-form titles.
|
|
2513
2577
|
*
|
|
@@ -2516,19 +2580,19 @@ var UserJobPreferencesSchema = (0, import_yup33.object)({
|
|
|
2516
2580
|
* surfaces a curated "Popular Roles" picker for discovery, but the user
|
|
2517
2581
|
* can ultimately add any title; matching/normalization happens downstream.
|
|
2518
2582
|
*/
|
|
2519
|
-
jobRoles: (0,
|
|
2583
|
+
jobRoles: (0, import_yup34.array)().of((0, import_yup34.string)().trim().max(120).required()).min(1, "Pick at least one role.").required().label("Job Roles"),
|
|
2520
2584
|
/**
|
|
2521
2585
|
* Minimum acceptable annual base salary, in `minSalaryCurrency`.
|
|
2522
2586
|
* Stored as an integer in the currency's major unit (e.g. dollars, not cents).
|
|
2523
2587
|
* Defaults to 0 ("any salary") rather than being optional - every job-seeker
|
|
2524
2588
|
* has a floor, even if it's zero.
|
|
2525
2589
|
*/
|
|
2526
|
-
minSalary: (0,
|
|
2527
|
-
minSalaryCurrency: (0,
|
|
2590
|
+
minSalary: (0, import_yup34.number)().integer().min(MIN_SALARY_LOWER_BOUND).max(MIN_SALARY_UPPER_BOUND).default(0).required().label("Minimum Salary"),
|
|
2591
|
+
minSalaryCurrency: (0, import_yup34.string)().oneOf(SupportedSalaryCurrencies).default("USD").required().label("Minimum Salary Currency"),
|
|
2528
2592
|
/**
|
|
2529
2593
|
* Marketing-attribution capture from the final onboarding step.
|
|
2530
2594
|
*/
|
|
2531
|
-
referralSource: (0,
|
|
2595
|
+
referralSource: (0, import_yup34.string)().oneOf(SupportedReferralSources).required().label("Referral Source"),
|
|
2532
2596
|
/**
|
|
2533
2597
|
* Resumes the user has uploaded. Embedded directly on the user document
|
|
2534
2598
|
* (capped at 5) - they're cheap to denormalize, every wizard step that
|
|
@@ -2542,25 +2606,25 @@ var UserJobPreferencesSchema = (0, import_yup33.object)({
|
|
|
2542
2606
|
* AI resume-builder flow - onboarding uploads land here, AI-built resumes
|
|
2543
2607
|
* live in their own collection.
|
|
2544
2608
|
*/
|
|
2545
|
-
resumes: (0,
|
|
2546
|
-
(0,
|
|
2609
|
+
resumes: (0, import_yup34.array)().of(
|
|
2610
|
+
(0, import_yup34.object)({
|
|
2547
2611
|
// Stable id assigned on upload - used to address a specific entry
|
|
2548
2612
|
// for delete / set-primary operations without exposing the GCS URL
|
|
2549
2613
|
// as a route key.
|
|
2550
|
-
id: (0,
|
|
2551
|
-
url: (0,
|
|
2552
|
-
filename: (0,
|
|
2553
|
-
sizeBytes: (0,
|
|
2554
|
-
mimeType: (0,
|
|
2555
|
-
uploadedAt: (0,
|
|
2556
|
-
isPrimary: (0,
|
|
2614
|
+
id: (0, import_yup34.string)().required().label("ID"),
|
|
2615
|
+
url: (0, import_yup34.string)().required().label("Resume URL"),
|
|
2616
|
+
filename: (0, import_yup34.string)().trim().max(255).optional().label("Filename"),
|
|
2617
|
+
sizeBytes: (0, import_yup34.number)().integer().min(0).optional().label("Size (bytes)"),
|
|
2618
|
+
mimeType: (0, import_yup34.string)().trim().max(120).optional().label("MIME Type"),
|
|
2619
|
+
uploadedAt: (0, import_yup34.date)().required().label("Uploaded At"),
|
|
2620
|
+
isPrimary: (0, import_yup34.boolean)().default(false).label("Is Primary")
|
|
2557
2621
|
}).noUnknown().strict().label("Resume")
|
|
2558
2622
|
).max(5, "You can keep at most 5 resumes on file.").default([]).label("Resumes"),
|
|
2559
2623
|
/**
|
|
2560
2624
|
* Set when the user finishes the wizard's last step. Acts as the gate the
|
|
2561
2625
|
* onboarding hook checks to redirect users who haven't completed setup.
|
|
2562
2626
|
*/
|
|
2563
|
-
onboardingCompletedAt: (0,
|
|
2627
|
+
onboardingCompletedAt: (0, import_yup34.date)().nullable().optional().label("Onboarding Completed At"),
|
|
2564
2628
|
/**
|
|
2565
2629
|
* Parser-suggested values for wizard fields, written by the resume-upload
|
|
2566
2630
|
* flow. Every parser-derived field lands here - including profile-shaped
|
|
@@ -2580,92 +2644,92 @@ var UserJobPreferencesSchema = (0, import_yup33.object)({
|
|
|
2580
2644
|
* APIs. If `user.<field>` is empty there, the correct behavior is empty,
|
|
2581
2645
|
* because the user has not confirmed it yet.
|
|
2582
2646
|
*/
|
|
2583
|
-
pendingPrefill: (0,
|
|
2584
|
-
headline: (0,
|
|
2585
|
-
aboutMe: (0,
|
|
2586
|
-
mobile: (0,
|
|
2647
|
+
pendingPrefill: (0, import_yup34.object)({
|
|
2648
|
+
headline: (0, import_yup34.string)().trim().optional().label("Pending Headline"),
|
|
2649
|
+
aboutMe: (0, import_yup34.string)().trim().optional().label("Pending About Me"),
|
|
2650
|
+
mobile: (0, import_yup34.string)().trim().optional().label("Pending Mobile"),
|
|
2587
2651
|
location: LocationSchema.optional().default(void 0).label("Pending Location"),
|
|
2588
|
-
experienceLevel: (0,
|
|
2589
|
-
socialAccounts: (0,
|
|
2590
|
-
workExperiences: (0,
|
|
2591
|
-
educations: (0,
|
|
2652
|
+
experienceLevel: (0, import_yup34.string)().oneOf(SupportedExperienceLevels).optional().label("Pending Experience Level"),
|
|
2653
|
+
socialAccounts: (0, import_yup34.array)().of(SocialAccountSchema.required()).optional().label("Pending Social Accounts"),
|
|
2654
|
+
workExperiences: (0, import_yup34.array)().of(WorkExperienceSchema.required()).optional().label("Pending Work Experiences"),
|
|
2655
|
+
educations: (0, import_yup34.array)().of(EducationSchema.required()).optional().label("Pending Educations")
|
|
2592
2656
|
}).nullable().optional().default(void 0).label("Pending Prefill")
|
|
2593
2657
|
}).noUnknown().strict().label("User Job Preferences Schema");
|
|
2594
2658
|
|
|
2595
2659
|
// src/user/user-recruiter-profile.schema.ts
|
|
2596
|
-
var
|
|
2597
|
-
var RecruiterPageLinkSchema = (0,
|
|
2660
|
+
var import_yup35 = require("yup");
|
|
2661
|
+
var RecruiterPageLinkSchema = (0, import_yup35.object)({
|
|
2598
2662
|
page: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company Page"),
|
|
2599
|
-
jobTitle: (0,
|
|
2663
|
+
jobTitle: (0, import_yup35.string)().trim().max(100).optional().label("Job Title")
|
|
2600
2664
|
}).noUnknown().strict().label("Recruiter Page Link");
|
|
2601
|
-
var UserRecruiterProfileSchema = (0,
|
|
2602
|
-
recruiterProfile: (0,
|
|
2603
|
-
hiringFor: (0,
|
|
2665
|
+
var UserRecruiterProfileSchema = (0, import_yup35.object)({
|
|
2666
|
+
recruiterProfile: (0, import_yup35.object)({
|
|
2667
|
+
hiringFor: (0, import_yup35.array)().of(RecruiterPageLinkSchema).default([]).label("Hiring For")
|
|
2604
2668
|
}).optional().default(void 0).label("Recruiter Profile")
|
|
2605
2669
|
}).noUnknown().strict().label("User Recruiter Profile");
|
|
2606
2670
|
|
|
2607
2671
|
// src/user/user-coordinator-profile.schema.ts
|
|
2608
|
-
var
|
|
2609
|
-
var CoordinatorPageLinkSchema = (0,
|
|
2672
|
+
var import_yup36 = require("yup");
|
|
2673
|
+
var CoordinatorPageLinkSchema = (0, import_yup36.object)({
|
|
2610
2674
|
page: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Institute Page"),
|
|
2611
|
-
jobTitle: (0,
|
|
2675
|
+
jobTitle: (0, import_yup36.string)().trim().max(100).optional().label("Job Title")
|
|
2612
2676
|
}).noUnknown().strict().label("Coordinator Page Link");
|
|
2613
|
-
var UserCoordinatorProfileSchema = (0,
|
|
2614
|
-
coordinatorProfile: (0,
|
|
2615
|
-
coordinatesAt: (0,
|
|
2677
|
+
var UserCoordinatorProfileSchema = (0, import_yup36.object)({
|
|
2678
|
+
coordinatorProfile: (0, import_yup36.object)({
|
|
2679
|
+
coordinatesAt: (0, import_yup36.array)().of(CoordinatorPageLinkSchema).default([]).label("Coordinates At")
|
|
2616
2680
|
}).optional().default(void 0).label("Coordinator Profile")
|
|
2617
2681
|
}).noUnknown().strict().label("User Coordinator Profile");
|
|
2618
2682
|
|
|
2619
2683
|
// src/user/user.schema.ts
|
|
2620
|
-
var UserSchema = (0,
|
|
2684
|
+
var UserSchema = (0, import_yup37.object)({
|
|
2621
2685
|
/**
|
|
2622
2686
|
* Related auth account id from auth Server (e.g. Better auth https://auth.thejob.dev)
|
|
2623
2687
|
*/
|
|
2624
|
-
authAccountId: (0,
|
|
2688
|
+
authAccountId: (0, import_yup37.string)().required().label("Auth Account ID"),
|
|
2625
2689
|
/**
|
|
2626
2690
|
* Social media information about the user (e.g. LinkedIn, GitHub, etc.)
|
|
2627
2691
|
*/
|
|
2628
|
-
socialAccounts: (0,
|
|
2692
|
+
socialAccounts: (0, import_yup37.array)().of(SocialAccountSchema).default([]).label("Social Accounts"),
|
|
2629
2693
|
/**
|
|
2630
2694
|
* Work experience information about the user
|
|
2631
2695
|
*/
|
|
2632
|
-
workExperiences: (0,
|
|
2696
|
+
workExperiences: (0, import_yup37.array)().of(WorkExperienceSchema).required().default([]).label("Work Experiences"),
|
|
2633
2697
|
/**
|
|
2634
2698
|
* Education information about the user
|
|
2635
2699
|
*/
|
|
2636
|
-
educations: (0,
|
|
2700
|
+
educations: (0, import_yup37.array)().of(EducationSchema).required().default([]).label("Educations"),
|
|
2637
2701
|
/**
|
|
2638
2702
|
* Skills information about the user
|
|
2639
2703
|
*/
|
|
2640
|
-
skills: (0,
|
|
2704
|
+
skills: (0, import_yup37.array)().of(UserSkillSchema).required().default([]).label("Skills"),
|
|
2641
2705
|
/**
|
|
2642
2706
|
* Projects information about the user
|
|
2643
2707
|
*/
|
|
2644
|
-
projects: (0,
|
|
2708
|
+
projects: (0, import_yup37.array)().of(UserProjectSchema).default([]).label("Projects"),
|
|
2645
2709
|
/**
|
|
2646
2710
|
* Certifications information about the user
|
|
2647
2711
|
*/
|
|
2648
|
-
certifications: (0,
|
|
2712
|
+
certifications: (0, import_yup37.array)().of(UserCertificationSchema).default([]).label("Certifications"),
|
|
2649
2713
|
/**
|
|
2650
2714
|
* Interests information about the user.
|
|
2651
2715
|
*/
|
|
2652
|
-
interests: (0,
|
|
2716
|
+
interests: (0, import_yup37.array)().of(UserInterestSchema).optional().default([]).label("Interests"),
|
|
2653
2717
|
/**
|
|
2654
2718
|
* Languages information about the user
|
|
2655
2719
|
*/
|
|
2656
|
-
languages: (0,
|
|
2720
|
+
languages: (0, import_yup37.array)().of(UserLanguageSchema).required().default([]).label("Languages"),
|
|
2657
2721
|
/**
|
|
2658
2722
|
* Additional information about the user
|
|
2659
2723
|
*/
|
|
2660
|
-
additionalInfo: (0,
|
|
2724
|
+
additionalInfo: (0, import_yup37.array)().of(UserAdditionalInfoSchema).default([]).label("Additional Information"),
|
|
2661
2725
|
/**
|
|
2662
2726
|
* Status of the user account
|
|
2663
2727
|
*/
|
|
2664
|
-
status: (0,
|
|
2728
|
+
status: (0, import_yup37.string)().oneOf(SupportedUserStatuses).required().label("Status"),
|
|
2665
2729
|
/**
|
|
2666
2730
|
* Roles assigned to the user
|
|
2667
2731
|
*/
|
|
2668
|
-
roles: (0,
|
|
2732
|
+
roles: (0, import_yup37.array)().of((0, import_yup37.string)().oneOf(SupportedUserRoles)).required().default(DefaultUserRoles).label("Roles"),
|
|
2669
2733
|
/**
|
|
2670
2734
|
* Explicit consent to receive marketing email (newsletters, job alerts by
|
|
2671
2735
|
* broadcast, product updates). Marketing sends are HARD-GATED on
|
|
@@ -2677,18 +2741,18 @@ var UserSchema = (0, import_yup36.object)({
|
|
|
2677
2741
|
* unsubscribe sets `subscribed=false` so consent and the email-service
|
|
2678
2742
|
* suppression list stay consistent. Defaults to NOT subscribed (opt-in).
|
|
2679
2743
|
*/
|
|
2680
|
-
marketingConsent: (0,
|
|
2681
|
-
subscribed: (0,
|
|
2744
|
+
marketingConsent: (0, import_yup37.object)({
|
|
2745
|
+
subscribed: (0, import_yup37.boolean)().default(false).label("Subscribed to marketing email"),
|
|
2682
2746
|
/** Epoch ms of the last consent change (opt-in or opt-out). */
|
|
2683
|
-
updatedAt: (0,
|
|
2747
|
+
updatedAt: (0, import_yup37.number)().optional().label("Consent updated at"),
|
|
2684
2748
|
/** Where the consent change originated, e.g. `onboarding`, `unsubscribe`, `settings`. */
|
|
2685
|
-
source: (0,
|
|
2749
|
+
source: (0, import_yup37.string)().optional().label("Consent source"),
|
|
2686
2750
|
/**
|
|
2687
2751
|
* How often the user receives job-alert emails. `off` disables job alerts
|
|
2688
2752
|
* only; other marketing stays governed by `subscribed`. Unset means the
|
|
2689
2753
|
* user has not chosen a cadence yet.
|
|
2690
2754
|
*/
|
|
2691
|
-
jobAlertFrequency: (0,
|
|
2755
|
+
jobAlertFrequency: (0, import_yup37.string)().oneOf(SupportedJobAlertFrequencies).optional().label("Job alert frequency")
|
|
2692
2756
|
}).default({ subscribed: false }).label("Marketing Consent"),
|
|
2693
2757
|
/**
|
|
2694
2758
|
* Per-channel toggles for NOTIFICATION email — mail about activity on the
|
|
@@ -2703,11 +2767,11 @@ var UserSchema = (0, import_yup36.object)({
|
|
|
2703
2767
|
*
|
|
2704
2768
|
* Transactional mail (magic-link, verification) ignores this object entirely.
|
|
2705
2769
|
*/
|
|
2706
|
-
notificationPrefs: (0,
|
|
2707
|
-
groupActivity: (0,
|
|
2708
|
-
jobActivity: (0,
|
|
2709
|
-
applicationUpdates: (0,
|
|
2710
|
-
productUpdates: (0,
|
|
2770
|
+
notificationPrefs: (0, import_yup37.object)({
|
|
2771
|
+
groupActivity: (0, import_yup37.boolean)().default(true).label("Group activity email"),
|
|
2772
|
+
jobActivity: (0, import_yup37.boolean)().default(true).label("Job activity email"),
|
|
2773
|
+
applicationUpdates: (0, import_yup37.boolean)().default(true).label("Application update email"),
|
|
2774
|
+
productUpdates: (0, import_yup37.boolean)().default(false).label("Product update email")
|
|
2711
2775
|
}).default({
|
|
2712
2776
|
groupActivity: true,
|
|
2713
2777
|
jobActivity: true,
|
|
@@ -2719,15 +2783,15 @@ var UserSchema = (0, import_yup36.object)({
|
|
|
2719
2783
|
* Generated from a structured summary of skills, experience, education, etc.
|
|
2720
2784
|
* Only generated for public profiles with sufficient completeness (≥60%).
|
|
2721
2785
|
*/
|
|
2722
|
-
embedding: (0,
|
|
2723
|
-
vector: (0,
|
|
2724
|
-
model: (0,
|
|
2786
|
+
embedding: (0, import_yup37.object)({
|
|
2787
|
+
vector: (0, import_yup37.array)((0, import_yup37.number)().required()).optional().label("Embedding vector"),
|
|
2788
|
+
model: (0, import_yup37.string)().optional().label("Embedding model")
|
|
2725
2789
|
}).nullable().optional().label("Embedding")
|
|
2726
2790
|
}).concat(UserGeneralDetailSchema).concat(UserJobPreferencesSchema).concat(UserRecruiterProfileSchema).concat(UserCoordinatorProfileSchema).noUnknown().strict().label("User Schema");
|
|
2727
2791
|
|
|
2728
2792
|
// src/user/user-completeness.schema.ts
|
|
2729
|
-
var
|
|
2730
|
-
var UserCompletenessSchema = (0,
|
|
2793
|
+
var import_yup38 = require("yup");
|
|
2794
|
+
var UserCompletenessSchema = (0, import_yup38.object)({
|
|
2731
2795
|
additionalInfo: CompletenessScoreSchema(0).label("Additional Info"),
|
|
2732
2796
|
// Optional
|
|
2733
2797
|
certifications: CompletenessScoreSchema(0).label("Certifications"),
|
|
@@ -2820,6 +2884,8 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
|
|
|
2820
2884
|
ResourceType,
|
|
2821
2885
|
SITEMAP_FORMAT,
|
|
2822
2886
|
SYSTEM_DATE_FORMAT,
|
|
2887
|
+
SavedSearchSchema,
|
|
2888
|
+
SavedSearchStatus,
|
|
2823
2889
|
SkillSchema,
|
|
2824
2890
|
SocialAccount,
|
|
2825
2891
|
SocialAccountSchema,
|
|
@@ -2852,6 +2918,7 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
|
|
|
2852
2918
|
SupportedReportReasons,
|
|
2853
2919
|
SupportedResourceTypes,
|
|
2854
2920
|
SupportedSalaryCurrencies,
|
|
2921
|
+
SupportedSavedSearchStatuses,
|
|
2855
2922
|
SupportedSocialAccounts,
|
|
2856
2923
|
SupportedStudyTypes,
|
|
2857
2924
|
SupportedUserProfileVisibilities,
|