All files / types job.ts

100% Statements 92/92
100% Branches 0/0
100% Functions 0/0
100% Lines 92/92

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 931x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
import type { Preferences } from "../../shared/types/profile";
 
export type {
  Arrangement,
  ArrangementConfidence,
  Seniority,
  SalaryPeriod,
  Salary,
  Fit,
  JobStatus,
  PageExtractPayload as PageExtract,
  JobAnalysisResponse as JobAnalysis,
  StructuredSource,
  StructuredSourceKind,
  ExtractionStrategy,
  ExtractionProvenance,
  ExtractArgs,
} from "../../shared/types/job";
export { JOB_STATUSES, ARRANGEMENTS } from "../../shared/types/job";
 
/** Discriminates a saved posting's origin. Absent/"url" for every save the extension made before this feature. */
export type PostingSource = "url" | "document" | "paste";
 
/** A persisted posting in the saved-jobs library. */
export interface SavedJob {
  schemaVersion: number;
  canonicalUrl: string;
  sourceUrl: string;
  /** Absent means "url" — every pre-005 saved job (FR-020). */
  source?: PostingSource;
  analysis: import("../../shared/types/job").JobAnalysisResponse;
  status: import("../../shared/types/job").JobStatus;
  notes: string;
  savedAt: string;
  updatedAt: string;
  /** Set after a rescore found no posting (006 contracts/saved-jobs-api.md). */
  unavailableAt?: string | null;
}
 
/** User-authored candidate profile, stored locally, sent only with analysis requests. */
export interface CandidateProfile {
  text: string;
  dealbreakers: string[];
  updatedAt: string;
  /** Server-derived (006 R5). Optional on read so an older backend still type-checks. */
  fingerprint?: string;
  /** Structured preferences (006 PR4). Absent when none are set. */
  preferences?: Preferences;
  /** Skills the user added with "I have this" (006 PR5). Absent when none. */
  confirmedSkills?: string[];
}
 
export type JobErrorCode =
  | "network-error"
  | "service-error"
  | "not-configured"
  | "extract-too-large"
  | "thin-content"
  | "no-access"
  | "page-access"
  | "usage-limit-reached"
  | "unknown";
 
/** contracts/metering.md 429 `usage` echo — carried on a usage-limit-reached error. */
export interface UsageInfo {
  count: number;
  limit: number;
  resetsAt: string;
  tier: "free" | "premium";
  /** 006: what this request cost, and the free-rescore allowance after it. */
  charged?: "none" | "rescore" | "analysis";
  rescoresUsed?: number;
  rescoresLimit?: number;
}
 
export interface JobPanelError {
  code: JobErrorCode;
  message: string;
  action: string;
  retryable: boolean;
  /** Present only for code "usage-limit-reached" (FR-009 exhausted state). */
  usage?: UsageInfo;
  /**
   * Present only for code "page-access". "needs-click": Chrome has not granted
   * page access yet — the toolbar icon (or its shortcut) grants it.
   * "restricted": access was just granted and still failed, so this is a page
   * Chrome never lets extensions read (chrome://, the Web Store).
   */
  pageAccess?: PageAccessBlock;
}
 
export type PageAccessBlock = "needs-click" | "restricted";